histoire 0.4.6 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/bundled/HomeView.js +1 -0
  2. package/dist/bundled/MobileOverlay.js +3 -1
  3. package/dist/bundled/SandboxVue3.js +649 -0
  4. package/dist/bundled/SearchPane.js +2 -0
  5. package/dist/bundled/StoryView.js +307 -618
  6. package/dist/bundled/global-components.js +5 -5
  7. package/dist/bundled/index2.js +111 -43
  8. package/dist/bundled/sandbox.js +2 -2
  9. package/dist/bundled/state.js +16 -83
  10. package/dist/client/app/App.vue +18 -0
  11. package/dist/client/app/codegen/serialize-js.js +1 -1
  12. package/dist/client/app/codegen/vue3.d.ts +2 -0
  13. package/dist/client/app/codegen/vue3.js +37 -12
  14. package/dist/client/app/components/app/InitialLoading.vue +46 -0
  15. package/dist/client/app/components/app/MobileOverlay.vue +1 -1
  16. package/dist/client/app/components/exposed/Story.vue +2 -1
  17. package/dist/client/app/components/exposed/Variant.vue +4 -4
  18. package/dist/client/app/components/panel/ControlsComponentPropItem.vue +96 -0
  19. package/dist/client/app/components/panel/ControlsComponentProps.vue +33 -0
  20. package/dist/client/app/components/panel/StatePresets.vue +8 -6
  21. package/dist/client/app/components/panel/StoryControls.vue +18 -3
  22. package/dist/client/app/components/sandbox/SandboxVue3.vue +70 -2
  23. package/dist/client/app/style/transitions.pcss +12 -0
  24. package/dist/client/app/types.d.ts +11 -0
  25. package/dist/client/app/util/state.d.ts +1 -0
  26. package/dist/client/app/util/state.js +11 -2
  27. package/dist/node/build.js +1 -3
  28. package/dist/node/collect/index.js +6 -0
  29. package/dist/node/config.d.ts +23 -23
  30. package/dist/node/plugin.d.ts +2 -2
  31. package/dist/node/server.js +16 -5
  32. package/dist/style.css +92 -13
  33. package/package.json +2 -2
  34. package/src/client/app/App.vue +18 -0
  35. package/src/client/app/codegen/serialize-js.ts +1 -1
  36. package/src/client/app/codegen/vue3.ts +40 -12
  37. package/src/client/app/components/app/InitialLoading.vue +46 -0
  38. package/src/client/app/components/app/MobileOverlay.vue +1 -1
  39. package/src/client/app/components/exposed/Story.vue +2 -1
  40. package/src/client/app/components/exposed/Variant.vue +4 -4
  41. package/src/client/app/components/panel/ControlsComponentPropItem.vue +96 -0
  42. package/src/client/app/components/panel/ControlsComponentProps.vue +33 -0
  43. package/src/client/app/components/panel/StatePresets.vue +8 -6
  44. package/src/client/app/components/panel/StoryControls.vue +18 -3
  45. package/src/client/app/components/sandbox/SandboxVue3.vue +70 -2
  46. package/src/client/app/style/transitions.pcss +12 -0
  47. package/src/client/app/types.ts +13 -0
  48. package/src/client/app/util/state.ts +12 -2
  49. package/src/node/build.ts +1 -3
  50. package/src/node/collect/index.ts +7 -0
  51. package/src/node/server.ts +20 -5
  52. package/dist/bundled/dark.js +0 -4
@@ -110,15 +110,30 @@ export async function createServer (ctx: Context, port: number) {
110
110
  await executeStoryFile(changedFile)
111
111
 
112
112
  // Queued updates
113
- for (const storyFile of queuedFiles) {
114
- await executeStoryFile(storyFile)
115
- }
113
+ await Promise.all(queuedFiles.map(storyFile => executeStoryFile(storyFile)))
116
114
  } else {
117
115
  // Full update
118
- for (const storyFile of ctx.storyFiles) {
119
- await executeStoryFile(storyFile)
116
+
117
+ // Progress tracking
118
+ const fileCount = ctx.storyFiles.length
119
+ let loadedFilesCount = 0
120
+ const sendProgress = () => {
121
+ server.ws.send('histoire:stories-loading-progress', {
122
+ loadedFileCount: loadedFilesCount,
123
+ totalFileCount: fileCount,
124
+ })
120
125
  }
126
+
127
+ sendProgress()
128
+
129
+ await Promise.all(ctx.storyFiles.map(async storyFile => {
130
+ await executeStoryFile(storyFile)
131
+ loadedFilesCount++
132
+ sendProgress()
133
+ }))
134
+
121
135
  didAllStoriesYet = true
136
+ server.ws.send('histoire:all-stories-loaded', {})
122
137
  }
123
138
  console.log('Collect stories end', Date.now() - time, 'ms')
124
139
 
@@ -1,4 +0,0 @@
1
- import { useDark, useToggle } from "@vueuse/core";
2
- const isDark = useDark({ valueDark: "htw-dark" });
3
- const toggleDark = useToggle(isDark);
4
- export { isDark as i, toggleDark as t };