1- import { Component , h , Host , Prop , State , Element , Event , EventEmitter } from '@stencil/core' ;
1+ import { Component , h , Host , Prop , State , Element , Event , EventEmitter , Build } from '@stencil/core' ;
22
33import { unifyEvent } from '@deckdeckgo/utils' ;
44
@@ -12,7 +12,7 @@ interface ResizeMatrix {
1212@Component ( {
1313 tag : 'deckgo-drr' ,
1414 styleUrl : 'deckdeckgo-drr.scss' ,
15- shadow : true
15+ shadow : true ,
1616} )
1717export class DeckdeckgoDragResizeRotate {
1818 @Element ( ) el : HTMLElement ;
@@ -160,7 +160,7 @@ export class DeckdeckgoDragResizeRotate {
160160 }
161161
162162 private async displaySlot ( ) {
163- const element : HTMLElement = this . el . querySelector ( `:scope > *` ) ;
163+ const element : HTMLElement = this . el . querySelector ( Build . isBrowser ? `:scope > *` : '> *' ) ;
164164
165165 if ( element && element . style . display === 'none' ) {
166166 element . style . display = '' ;
@@ -416,7 +416,7 @@ export class DeckdeckgoDragResizeRotate {
416416
417417 return {
418418 x : this . dragBottom || this . dragTop ? 0 : currentX - this . startX ,
419- y : this . dragStart || this . dragEnd ? 0 : currentY - this . startY
419+ y : this . dragStart || this . dragEnd ? 0 : currentY - this . startY ,
420420 } ;
421421 }
422422
@@ -512,7 +512,7 @@ export class DeckdeckgoDragResizeRotate {
512512 a,
513513 b,
514514 c,
515- d
515+ d,
516516 } ;
517517 }
518518
@@ -527,7 +527,7 @@ export class DeckdeckgoDragResizeRotate {
527527 '--height' : `${ this . height } ${ heightUnit } ` ,
528528 '--top' : `${ this . top } ${ heightUnit } ` ,
529529 '--left' : `${ this . left } ${ widthUnit } ` ,
530- '--rotate' : this . rotate ? `${ this . rotate } deg` : `0deg`
530+ '--rotate' : this . rotate ? `${ this . rotate } deg` : `0deg` ,
531531 } }
532532 class = { `${ this . selected ? 'selected' : '' } ${ this . drag !== 'none' ? 'draggable' : '' } ${ this . drag !== 'none' && this . moving ? 'drag' : '' } ` } >
533533 { this . renderEdgesAnchors ( ) }
@@ -571,7 +571,7 @@ export class DeckdeckgoDragResizeRotate {
571571 onMouseDown = { ( ) => ( this . dragTopStart = true ) }
572572 onTouchStart = { ( ) => ( this . dragTopStart = true ) } >
573573 < div > </ div >
574- </ div >
574+ </ div > ,
575575 ] ;
576576 }
577577
@@ -600,7 +600,7 @@ export class DeckdeckgoDragResizeRotate {
600600 class = "border start"
601601 onClick = { ( $event ) => $event . stopPropagation ( ) }
602602 onMouseDown = { ( ) => ( this . dragStart = true ) }
603- onTouchStart = { ( ) => ( this . dragStart = true ) } > </ div >
603+ onTouchStart = { ( ) => ( this . dragStart = true ) } > </ div > ,
604604 ] ;
605605 }
606606
0 commit comments