@@ -14,7 +14,12 @@ import {
1414 transpileExpression ,
1515} from "@webstudio-is/sdk" ;
1616import { indexAttribute , isAttributeNameSafe , showAttribute } from "./props" ;
17- import { collectionComponent , descendantComponent } from "./core-components" ;
17+ import {
18+ blockComponent ,
19+ blockTemplateComponent ,
20+ collectionComponent ,
21+ descendantComponent ,
22+ } from "./core-components" ;
1823import type { IndexesWithinAncestors } from "./instance-utils" ;
1924
2025/**
@@ -231,6 +236,10 @@ export const generateJsxElement = ({
231236 }
232237
233238 let generatedElement = "" ;
239+ if ( instance . component === blockTemplateComponent ) {
240+ return "" ;
241+ }
242+
234243 if ( instance . component === collectionComponent ) {
235244 // prevent generating invalid collection
236245 if (
@@ -246,6 +255,10 @@ export const generateJsxElement = ({
246255 generatedElement += children ;
247256 generatedElement += `</Fragment>\n` ;
248257 generatedElement += `)}\n` ;
258+ } else if ( instance . component === blockComponent ) {
259+ if ( instance . children . length > 1 ) {
260+ generatedElement += children ;
261+ }
249262 } else {
250263 const [ _namespace , shortName ] = parseComponentName ( instance . component ) ;
251264 const componentVariable = scope . getName ( instance . component , shortName ) ;
0 commit comments