universalviewer icon indicating copy to clipboard operation
universalviewer copied to clipboard

Added Storybook using JSX with UV demos

Open stephenwf opened this issue 5 years ago β€’ 1 comments
trafficstars

Support for Storybook using the HTML preset and JSX-DOM for rendering the HTML using JSX.

  • Requires dist folder to exist, so you need to run npm build first
  • Can be started using npm run storybook
  • Will watch for changes in the UV, so can be used to develop it
  • HTML file for pulling in extra resources
  • Mounts the contents of ./dist so you can access configs and resources in that folder – before we switch that over the webpack too.
  • Added "Knobs" add-on and hooked it up to the UV demo to switch out the Manifest and Canvas. Could be useful for building simple configuration editing examples.
  • Added JSX support to TS configuration, along with JSX-DOM. When you construct a JSX element, the return value is a HTMLElement that can be immediately attached. (not React)
  • Stories can be found in ./stories/ and can pull in files, classes from ../src relative to that folder.
  • JS files that change may not be picked up when, such as jQuery plugins or lib folder. You'll have to restart to see these changes.

Mostly a baseline, I wanted to get the minimum configuration in, plenty more could be added for theming, add-ons and showcasing various other UI elements in isolation.

Screenshot 2020-04-05 at 12 18 38

stephenwf avatar Apr 05 '20 11:04 stephenwf

@demiankatz I was having some problems with the files being gitignored! Looks like the storybook config isn't there. Let me change that now πŸ‘

stephenwf avatar Apr 15 '20 13:04 stephenwf