// Available variables: // - Machine // - interpret // - assign // - send // - sendParent // - spawn // - raise // - actions // - XState (all XState exports) const portCallMachine = Machine({ id: 'port-call', type: 'parallel', states: { mouse: { initial: 'idle', states: { idle: { on :{ MOUSE_MOVE: { target: 'active', cond: 'hitBycurrentRow', }, }, }, active: { on :{ MOUSE_MOVE: { target: 'idle', cond: 'notHitBycurrentRow', }, MOUSE_ENTER: 'hovered', }, }, hovered: { on :{ MOUSE_LEAVE: [ { target: 'idle', cond: 'notHitBycurrentRow' }, { target: 'active', cond: 'hitBycurrentRow' }, ], MOUSE_CLICK: 'selected', }, }, selected: { on :{ MOUSE_CLICK_OUTSIDE: [ { target: 'idle', cond: 'notHitBycurrentRow' }, { target: 'active', cond: 'hitBycurrentRow' }, ], }, }, }, }, operations: { initial: 'none', states: { none: { on: { LIVE_MOVES: { target: 'pending', cond: 'isFirstLiveMoves', }, }, }, pending: { on: { LIVE_MOVES: { target: 'completed', cond: 'isLastLiveMoves', }, }, }, completed: {}, }, }, }, }, { guards: { notHitBycurrentRow: () => true, hitBycurrentRow: () => true, isFirstLiveMoves: () => true, isLastLiveMoves: () => true, } })