xstate-viz
xstate-viz copied to clipboard
Visualizer enhancements
This PR:
- Separates Visualizer component
- Separates EditorRenderer component which is responsible for rendering the editor
- Creates a version of visualizer without the editor
The part that creates two versions of the visualizer, one with the editor and one without, is still a work in progress. I'll clean up with more reusability in mind.
fixes https://github.com/statecharts/xstate-viz/issues/17
Chores:
- Update XState to v4.5
I'm thinking about keeping statecharts with and without editor separately but another way to tackle it would be to have a withEditor: boolean prop on the StateChart component to support both.
to have a withEditor: boolean prop on the StateChart component to support both.
+100 for having a falg to show/hide the editor! 🙌
This looks great! Hopefully it won't conflict too much with my local changes, but if it does, I'll merge parts of yours in locally.
@coodoo ok I'll change it to a single component with that flag. Also thinking about adding a toggle editor button next to reset button just in case people wanna see the editor in action.
@davidkpiano I'm sure we can work it out :)
@davidkpiano This should be now ready to ship. Side note: I'll work on Monaco editor in a separate PR. Tried adding it to the same branch, but Monaco needs some voodoo magic to get web workers running with Rollup.