@@ -347,6 +347,8 @@ type SubscribeStates =
347347 | "select"
348348 | "selectEnd"
349349 | "reposition"
350+ | "repositionIdle"
351+ | "repositionActive"
350352 | "repositionEnd" ;
351353
352354export function createCanvasMachine ( id : string ) {
@@ -365,6 +367,8 @@ export function createCanvasMachine(id: string) {
365367 select : [ ] ,
366368 selectEnd : [ ] ,
367369 reposition : [ ] ,
370+ repositionIdle : [ ] ,
371+ repositionActive : [ ] ,
368372 repositionEnd : [ ] ,
369373 } ;
370374 function subscribeCanvasMachine ( state : SubscribeStates , cb : Callback ) {
@@ -513,6 +517,12 @@ export function createCanvasMachine(id: string) {
513517 } ,
514518 [ reposition ] : {
515519 initial : repositionIdle ,
520+ entry : ( context , event ) => {
521+ callSubscribers ( "reposition" , context , event ) ;
522+ } ,
523+ exit : ( context , event ) => {
524+ callSubscribers ( "repositionEnd" , context , event ) ;
525+ } ,
516526 on : {
517527 [ MOUSE_UP ] : {
518528 target : selected ,
@@ -531,7 +541,7 @@ export function createCanvasMachine(id: string) {
531541 [ MOUSE_MOVE ] : {
532542 target : repositionActive ,
533543 cond : isNotInTheSameParent ,
534- actions : [ "setRepositionTarget" , "emitRepositionStarted " ] ,
544+ actions : [ "setRepositionTarget" , "emitRepositionActive " ] ,
535545 } ,
536546 } ,
537547 } ,
@@ -546,11 +556,11 @@ export function createCanvasMachine(id: string) {
546556 [ MOUSE_MOVE ] : {
547557 target : repositionIdle ,
548558 cond : isInTheSameParent ,
549- actions : [ "emitRepositionEnded " ] ,
559+ actions : [ "emitRepositionIdle " ] ,
550560 } ,
551561 [ MOUSE_MOVE ] : {
552562 cond : isNotInTheSameParent ,
553- actions : [ "setRepositionTarget" , "emitRepositionStarted " ] ,
563+ actions : [ "setRepositionTarget" , "emitRepositionActive " ] ,
554564 } ,
555565 } ,
556566 } ,
@@ -712,8 +722,8 @@ export function createCanvasMachine(id: string) {
712722 emitReady : callSubscribersFromAction ( "ready" ) ,
713723 emitComponentCreated : callSubscribersFromAction ( "COMPONENT_CREATED" ) ,
714724 emitComponentRendered : callSubscribersFromAction ( "COMPONENT_RENDERED" ) ,
715- emitRepositionStarted : callSubscribersFromAction ( "reposition " ) ,
716- emitRepositionEnded : callSubscribersFromAction ( "repositionEnd " ) ,
725+ emitRepositionIdle : callSubscribersFromAction ( "repositionIdle " ) ,
726+ emitRepositionActive : callSubscribersFromAction ( "repositionActive " ) ,
717727 setHoverComponent,
718728 setSelectedComponent,
719729 setLastDropped,
0 commit comments