Last active
March 1, 2020 21:32
-
-
Save sulram/a52abf0bdce670b5e3928ec61d0a4443 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const editorMachine = Machine({ | |
id: 'editor', | |
type: 'parallel', | |
states: { | |
editor: { | |
initial: 'idle', | |
states: { | |
idle: { | |
on: { | |
NODE_MDOWN: 'checkNodeMove', | |
LINE_MDOWN: 'checkLineMove', | |
AREA_MDOWN: 'checkAreaMove', | |
} | |
}, | |
checkNodeMove: { | |
on: { | |
NODE_MMOVE: 'draggingNode', | |
NODE_CLICK: 'idle' | |
} | |
}, | |
draggingNode: { | |
on: { | |
NODE_MUP: 'idle' | |
} | |
}, | |
checkLineMove: { | |
on: { | |
LINE_MMOVE: 'draggingLine', | |
LINE_CLICK: 'idle' | |
} | |
}, | |
draggingLine: { | |
on: { | |
LINE_MUP: 'idle' | |
} | |
}, | |
checkAreaMove: { | |
on: { | |
AREA_MMOVE: 'draggingArea', | |
AREA_CLICK: 'idle' | |
} | |
}, | |
draggingArea: { | |
on: { | |
AREA_MUP: 'idle' | |
} | |
}, | |
} | |
}, | |
inspector: { | |
initial: 'none', | |
states: { | |
none: { | |
on: { | |
NODE_CLICK: 'nodeSelect' | |
} | |
}, | |
nodeSelect: { | |
on: { | |
CHOICE_SEL: 'choiceSelect', | |
AREA_CLICK: 'none' | |
} | |
}, | |
choiceSelect: { | |
on: { | |
CLOSE: 'nodeSelect', | |
AREA_CLICK: 'none' | |
} | |
} | |
} | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment