xstate-viz icon indicating copy to clipboard operation
xstate-viz copied to clipboard

Visualizer enhancements

Open farskid opened this issue 6 years ago • 6 comments

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

farskid avatar May 26 '19 05:05 farskid

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.

farskid avatar May 26 '19 14:05 farskid

to have a withEditor: boolean prop on the StateChart component to support both.

+100 for having a falg to show/hide the editor! 🙌

coodoo avatar May 26 '19 21:05 coodoo

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.

davidkpiano avatar May 27 '19 05:05 davidkpiano

@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.

farskid avatar May 27 '19 18:05 farskid

@davidkpiano I'm sure we can work it out :)

farskid avatar May 27 '19 18:05 farskid

@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.

farskid avatar May 27 '19 21:05 farskid