@@ -48,6 +48,21 @@ export default class ComponentTreeController extends Controller {
48
48
49
49
renderItems . push ( item ) ;
50
50
51
+ if (
52
+ item . isHtmlTag &&
53
+ renderNode . children . some ( ( c ) => c . type === 'modifier' )
54
+ ) {
55
+ const idx = renderNode . children . findLastIndex (
56
+ ( c ) => c . type === 'modifier'
57
+ ) ;
58
+ renderNode . children . splice ( idx + 1 , 0 , {
59
+ type : 'placeholder-closing-tag' ,
60
+ id : renderNode . id + '-closing-tag' ,
61
+ name : '' ,
62
+ children : [ ] ,
63
+ } ) ;
64
+ }
65
+
51
66
renderNode . children . forEach ( ( node ) => flatten ( item , node ) ) ;
52
67
}
53
68
} ;
@@ -301,7 +316,32 @@ class RenderItem {
301
316
}
302
317
303
318
get isComponent ( ) {
304
- return this . renderNode . type === 'component' ;
319
+ return (
320
+ this . renderNode . type === 'component' ||
321
+ this . renderNode . type === 'remote-element'
322
+ ) ;
323
+ }
324
+
325
+ get isModifier ( ) {
326
+ return this . renderNode . type === 'modifier' ;
327
+ }
328
+
329
+ get hasModifiers ( ) {
330
+ return this . childItems . some ( ( item ) => item . isModifier ) ;
331
+ }
332
+
333
+ get isLastModifier ( ) {
334
+ return (
335
+ this . parentItem . childItems . findLast ( ( item ) => item . isModifier ) === this
336
+ ) ;
337
+ }
338
+
339
+ get isHtmlTag ( ) {
340
+ return this . renderNode . type === 'html-element' ;
341
+ }
342
+
343
+ get isClosingTag ( ) {
344
+ return this . renderNode . type === 'placeholder-closing-tag' ;
305
345
}
306
346
307
347
get name ( ) {
@@ -313,12 +353,15 @@ class RenderItem {
313
353
}
314
354
315
355
get isCurlyInvocation ( ) {
356
+ if ( this . isModifier ) {
357
+ return true ;
358
+ }
316
359
return this . renderNode . args && this . renderNode . args . positional ;
317
360
}
318
361
319
362
get hasInstance ( ) {
320
363
let { instance } = this . renderNode ;
321
- return typeof instance === 'object' && instance !== null ;
364
+ return typeof instance === 'object' && instance ;
322
365
}
323
366
324
367
get instance ( ) {
@@ -330,7 +373,7 @@ class RenderItem {
330
373
}
331
374
332
375
get hasBounds ( ) {
333
- return this . renderNode . bounds !== null ;
376
+ return this . renderNode . bounds ;
334
377
}
335
378
336
379
get isRoot ( ) {
@@ -400,6 +443,7 @@ class RenderItem {
400
443
}
401
444
402
445
@action showPreview ( ) {
446
+ if ( this . isClosingTag ) return ;
403
447
this . controller . previewing = this . id ;
404
448
}
405
449
@@ -410,6 +454,7 @@ class RenderItem {
410
454
}
411
455
412
456
@action toggleInspection ( ) {
457
+ if ( this . isClosingTag ) return ;
413
458
if ( this . isPinned ) {
414
459
this . controller . pinned = undefined ;
415
460
} else {
0 commit comments