histoire 0.3.1 → 0.4.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 (150) hide show
  1. package/dist/bundled/BaseEmpty.js +13 -0
  2. package/dist/bundled/HomeView.js +23 -0
  3. package/dist/bundled/MobileOverlay.js +303 -0
  4. package/dist/bundled/SearchPane.js +504 -0
  5. package/dist/bundled/StoryView.js +2330 -0
  6. package/dist/bundled/api.js +32 -0
  7. package/dist/bundled/config.js +4 -0
  8. package/dist/bundled/const.js +5 -0
  9. package/dist/bundled/dark.js +4 -0
  10. package/dist/bundled/events.js +29 -0
  11. package/dist/bundled/global-components.js +203 -0
  12. package/dist/bundled/index.js +7 -0
  13. package/dist/bundled/index2.js +762 -0
  14. package/dist/bundled/reactivity.js +96 -0
  15. package/dist/bundled/sandbox.js +97 -0
  16. package/dist/bundled/search-docs-data.js +7 -0
  17. package/dist/bundled/story.js +59 -0
  18. package/dist/bundled/style.css +102 -0
  19. package/dist/client/app/App.vue +2 -2
  20. package/dist/client/app/api.d.ts +1 -0
  21. package/dist/client/app/api.js +1 -0
  22. package/dist/client/app/codegen/vue3.js +1 -2
  23. package/dist/client/app/components/HomeView.vue +1 -1
  24. package/dist/client/app/components/app/AppLogo.vue +1 -1
  25. package/dist/client/app/components/app/MobileOverlay.vue +0 -1
  26. package/dist/client/app/components/base/BaseEmpty.vue +1 -1
  27. package/dist/client/app/components/base/BaseOverflowMenu.vue +118 -0
  28. package/dist/client/app/components/base/BaseOverflowTab.vue +46 -0
  29. package/dist/client/app/components/exposed/Story.vue +13 -2
  30. package/dist/client/app/components/exposed/Variant.vue +6 -0
  31. package/dist/client/app/components/panel/PaneTabs.vue +64 -0
  32. package/{src/client/app/components/story → dist/client/app/components/panel}/StoryControls.vue +1 -1
  33. package/dist/client/app/components/{story → panel}/StoryDocs.vue +0 -0
  34. package/dist/client/app/components/{story → panel}/StoryEvent.vue +1 -0
  35. package/dist/client/app/components/{story → panel}/StoryEvents.vue +0 -0
  36. package/dist/client/app/components/{story → panel}/StorySidePanel.vue +3 -31
  37. package/dist/client/app/components/{story → panel}/StorySourceCode.vue +0 -0
  38. package/dist/client/app/components/sandbox/SandboxVue3.vue +10 -0
  39. package/dist/client/app/components/search/SearchItem.vue +1 -1
  40. package/dist/client/app/components/search/SearchPane.vue +108 -25
  41. package/dist/client/app/components/search/search-docs-data.d.ts +3 -0
  42. package/dist/client/app/components/search/{search-data.js → search-docs-data.js} +1 -1
  43. package/dist/client/app/components/search/search-title-data.d.ts +3 -0
  44. package/dist/client/app/components/search/search-title-data.js +7 -0
  45. package/dist/client/app/components/search/types.d.ts +7 -0
  46. package/dist/client/app/components/search/types.js +1 -0
  47. package/dist/client/app/components/story/StoryResponsivePreview.vue +9 -131
  48. package/dist/client/app/components/story/StoryVariantGridItem.vue +1 -1
  49. package/dist/client/app/components/story/StoryVariantListItem.vue +1 -1
  50. package/dist/client/app/components/story/StoryVariantSingle.vue +109 -0
  51. package/dist/client/app/components/story/StoryVariantSinglePreviewNative.vue +42 -0
  52. package/dist/client/app/components/story/StoryVariantSinglePreviewRemote.vue +153 -0
  53. package/dist/client/app/components/story/StoryVariantSingleView.vue +13 -6
  54. package/dist/client/app/components/story/StoryView.vue +2 -2
  55. package/dist/client/app/components/story/StoryViewer.vue +2 -92
  56. package/{src/client/app/components/story → dist/client/app/components}/toolbar/StoryVariantBackground.vue +3 -3
  57. package/dist/client/app/components/{story/toolbar → toolbar}/StoryVariantNewTab.vue +2 -2
  58. package/{src/client/app/components/story → dist/client/app/components}/toolbar/StoryVariantResponsiveSize.vue +3 -3
  59. package/dist/client/app/components/{story/toolbar → toolbar}/StoryVariantTitle.vue +1 -1
  60. package/dist/client/app/components/tree/StoryListItem.vue +1 -1
  61. package/dist/client/app/index.d.ts +1 -1
  62. package/dist/client/app/index.js +21 -18
  63. package/dist/client/app/sandbox.d.ts +1 -1
  64. package/dist/client/app/sandbox.js +0 -1
  65. package/dist/client/app/stores/events.js +1 -1
  66. package/dist/client/app/stores/story.d.ts +27 -0
  67. package/dist/client/app/style/transitions.pcss +13 -0
  68. package/dist/client/app/types.d.ts +3 -0
  69. package/dist/client/app/util/events.d.ts +1 -1
  70. package/dist/client/app/util/events.js +2 -2
  71. package/dist/client/app/util/mapping.js +2 -0
  72. package/dist/client/bundle-index.js +5 -0
  73. package/dist/client/bundle-main.js +5 -0
  74. package/dist/client/bundle-sandbox.js +3 -0
  75. package/dist/client/index.d.ts +1 -1
  76. package/dist/client/index.js +1 -1
  77. package/dist/client/server/vue3/Story.vue +1 -1
  78. package/dist/client/server/vue3/run.js +8 -0
  79. package/dist/node/alias.js +1 -1
  80. package/dist/node/build.js +4 -4
  81. package/dist/node/builtin-plugins/tailwind-tokens.js +1 -1
  82. package/dist/node/search.d.ts +15 -1
  83. package/dist/node/search.js +78 -32
  84. package/dist/node/server.js +2 -2
  85. package/dist/node/types.d.ts +1 -0
  86. package/dist/node/vite.d.ts +4 -2
  87. package/dist/node/vite.js +24 -28
  88. package/dist/style.css +93 -69
  89. package/package.json +10 -10
  90. package/src/client/app/App.vue +2 -2
  91. package/src/client/app/api.ts +1 -0
  92. package/src/client/app/codegen/vue3.ts +1 -2
  93. package/src/client/app/components/HomeView.vue +1 -1
  94. package/src/client/app/components/app/AppLogo.vue +1 -1
  95. package/src/client/app/components/app/MobileOverlay.vue +0 -1
  96. package/src/client/app/components/base/BaseEmpty.vue +1 -1
  97. package/src/client/app/components/base/BaseOverflowMenu.vue +118 -0
  98. package/src/client/app/components/base/BaseOverflowTab.vue +46 -0
  99. package/src/client/app/components/exposed/Story.vue +13 -2
  100. package/src/client/app/components/exposed/Variant.vue +6 -0
  101. package/src/client/app/components/panel/PaneTabs.vue +64 -0
  102. package/{dist/client/app/components/story → src/client/app/components/panel}/StoryControls.vue +1 -1
  103. package/src/client/app/components/{story → panel}/StoryDocs.vue +0 -0
  104. package/src/client/app/components/{story → panel}/StoryEvent.vue +1 -0
  105. package/src/client/app/components/{story → panel}/StoryEvents.vue +0 -0
  106. package/src/client/app/components/{story → panel}/StorySidePanel.vue +3 -31
  107. package/src/client/app/components/{story → panel}/StorySourceCode.vue +0 -0
  108. package/src/client/app/components/sandbox/SandboxVue3.vue +10 -0
  109. package/src/client/app/components/search/SearchItem.vue +1 -1
  110. package/src/client/app/components/search/SearchPane.vue +108 -25
  111. package/src/client/app/components/search/search-docs-data.ts +10 -0
  112. package/src/client/app/components/search/search-title-data.ts +10 -0
  113. package/src/client/app/components/search/types.ts +4 -0
  114. package/src/client/app/components/story/StoryResponsivePreview.vue +9 -131
  115. package/src/client/app/components/story/StoryVariantGridItem.vue +1 -1
  116. package/src/client/app/components/story/StoryVariantListItem.vue +1 -1
  117. package/src/client/app/components/story/StoryVariantSingle.vue +109 -0
  118. package/src/client/app/components/story/StoryVariantSinglePreviewNative.vue +42 -0
  119. package/src/client/app/components/story/StoryVariantSinglePreviewRemote.vue +153 -0
  120. package/src/client/app/components/story/StoryVariantSingleView.vue +13 -6
  121. package/src/client/app/components/story/StoryView.vue +2 -2
  122. package/src/client/app/components/story/StoryViewer.vue +2 -92
  123. package/{dist/client/app/components/story → src/client/app/components}/toolbar/StoryVariantBackground.vue +3 -3
  124. package/src/client/app/components/{story/toolbar → toolbar}/StoryVariantNewTab.vue +2 -2
  125. package/{dist/client/app/components/story → src/client/app/components}/toolbar/StoryVariantResponsiveSize.vue +3 -3
  126. package/src/client/app/components/{story/toolbar → toolbar}/StoryVariantTitle.vue +1 -1
  127. package/src/client/app/components/tree/StoryListItem.vue +1 -1
  128. package/src/client/app/index.ts +23 -19
  129. package/src/client/app/sandbox.ts +1 -2
  130. package/src/client/app/stores/events.ts +1 -1
  131. package/src/client/app/style/transitions.pcss +13 -0
  132. package/src/client/app/types.ts +4 -0
  133. package/src/client/app/util/events.ts +2 -2
  134. package/src/client/app/util/mapping.ts +2 -0
  135. package/src/client/bundle-index.js +5 -0
  136. package/src/client/bundle-main.js +5 -0
  137. package/src/client/bundle-sandbox.js +3 -0
  138. package/src/client/index.ts +1 -1
  139. package/src/client/server/vue3/Story.vue +1 -1
  140. package/src/client/server/vue3/run.ts +11 -0
  141. package/src/node/alias.ts +1 -1
  142. package/src/node/build.ts +4 -4
  143. package/src/node/builtin-plugins/tailwind-tokens.ts +1 -1
  144. package/src/node/search.ts +87 -32
  145. package/src/node/server.ts +2 -2
  146. package/src/node/types.ts +1 -0
  147. package/src/node/vite.ts +24 -29
  148. package/vite.config.ts +46 -0
  149. package/dist/client/app/components/search/search-data.d.ts +0 -2
  150. package/src/client/app/components/search/search-data.ts +0 -9
package/dist/node/vite.js CHANGED
@@ -7,7 +7,7 @@ import { notifyStoryChange } from './stories.js';
7
7
  import { makeTree } from './tree.js';
8
8
  import { parseColor } from './colors.js';
9
9
  import { createMarkdownRenderer } from './markdown.js';
10
- import { generateSearchData } from './search.js';
10
+ import { getSearchDataJS, generateDocSearchData, generateTitleSearchData } from './search.js';
11
11
  const require = createRequire(import.meta.url);
12
12
  export const STORIES_ID = '$histoire-stories';
13
13
  export const RESOLVED_STORIES_ID = `/${STORIES_ID}-resolved`;
@@ -17,15 +17,13 @@ export const CONFIG_ID = '$histoire-config';
17
17
  export const RESOLVED_CONFIG_ID = `/${CONFIG_ID}-resolved`;
18
18
  export const THEME_ID = '$histoire-theme';
19
19
  export const RESOLVED_THEME_ID = `/${THEME_ID}-resolved.css`;
20
- export const SEARCH_DATA_ID = '$histoire-search-data';
21
- export const RESOLVED_SEARCH_DATA_ID = `/${SEARCH_DATA_ID}-resolved`;
20
+ export const SEARCH_TITLE_DATA_ID = '$histoire-search-title-data';
21
+ export const RESOLVED_SEARCH_TITLE_DATA_ID = `/${SEARCH_TITLE_DATA_ID}-resolved`;
22
+ export const SEARCH_DOCS_DATA_ID = '$histoire-search-docs-data';
23
+ export const RESOLVED_SEARCH_DOCS_DATA_ID = `/${SEARCH_DOCS_DATA_ID}-resolved`;
22
24
  export async function createVitePlugins(ctx) {
23
25
  const viteConfig = await resolveViteConfig({}, ctx.mode === 'dev' ? 'serve' : 'build');
24
- const hasVuePlugin = viteConfig.plugins.find(p => p.name === 'vite:vue');
25
26
  const plugins = [];
26
- if (!hasVuePlugin) {
27
- plugins.push((await import('@vitejs/plugin-vue')).default());
28
- }
29
27
  if (ctx.config.vite) {
30
28
  plugins.push({
31
29
  name: 'histoire-vite-config-override',
@@ -42,12 +40,14 @@ export async function createVitePlugins(ctx) {
42
40
  // force include vue to avoid duplicated copies when linked + optimized
43
41
  include: [
44
42
  'vue',
45
- dirname(require.resolve('@vue/runtime-core/package.json')),
46
43
  dirname(require.resolve('shiki/package.json')),
47
44
  dirname(require.resolve('vscode-textmate/package.json')),
48
45
  dirname(require.resolve('vscode-oniguruma/package.json')),
49
46
  dirname(require.resolve('case/package.json')),
50
47
  ],
48
+ exclude: [
49
+ 'histoire',
50
+ ],
51
51
  },
52
52
  server: {
53
53
  fs: {
@@ -80,8 +80,11 @@ export async function createVitePlugins(ctx) {
80
80
  if (id.startsWith(THEME_ID)) {
81
81
  return RESOLVED_THEME_ID;
82
82
  }
83
- if (id.startsWith(SEARCH_DATA_ID)) {
84
- return RESOLVED_SEARCH_DATA_ID;
83
+ if (id.startsWith(SEARCH_TITLE_DATA_ID)) {
84
+ return RESOLVED_SEARCH_TITLE_DATA_ID;
85
+ }
86
+ if (id.startsWith(SEARCH_DOCS_DATA_ID)) {
87
+ return RESOLVED_SEARCH_DOCS_DATA_ID;
85
88
  }
86
89
  },
87
90
  async load(id) {
@@ -91,7 +94,10 @@ export async function createVitePlugins(ctx) {
91
94
  return {
92
95
  id: file.id,
93
96
  path: file.treePath,
94
- story: file.story,
97
+ story: {
98
+ ...file.story,
99
+ docsText: undefined,
100
+ },
95
101
  framework: 'vue3',
96
102
  index,
97
103
  };
@@ -139,21 +145,11 @@ if (import.meta.hot) {
139
145
  css += '}';
140
146
  return css;
141
147
  }
142
- if (id === RESOLVED_SEARCH_DATA_ID) {
143
- return `export let searchData = ${JSON.stringify(await generateSearchData(ctx))}
144
- const handlers = []
145
- export function onUpdate (cb) {
146
- handlers.push(cb)
147
- }
148
- if (import.meta.hot) {
149
- import.meta.hot.accept(newModule => {
150
- searchData = newModule.searchData
151
- handlers.forEach(h => {
152
- h(newModule.searchData)
153
- newModule.onUpdate(h)
154
- })
155
- })
156
- }`;
148
+ if (id === RESOLVED_SEARCH_TITLE_DATA_ID) {
149
+ return getSearchDataJS(await generateTitleSearchData(ctx));
150
+ }
151
+ if (id === RESOLVED_SEARCH_DOCS_DATA_ID) {
152
+ return getSearchDataJS(await generateDocSearchData(ctx));
157
153
  }
158
154
  },
159
155
  handleHotUpdate(updateContext) {
@@ -186,7 +182,7 @@ if (import.meta.hot) {
186
182
  }
187
183
  }
188
184
  </script>
189
- <script type="module" src="/@fs/${APP_PATH}/sandbox.js"></script>
185
+ <script type="module" src="/@fs/${APP_PATH}/bundle-sandbox.js"></script>
190
186
  </body>
191
187
  </html>`;
192
188
  // Apply Vite HTML transforms. This injects the Vite HMR client, and
@@ -215,7 +211,7 @@ if (import.meta.hot) {
215
211
  </head>
216
212
  <body>
217
213
  <div id="app"></div>
218
- <script type="module" src="/@fs/${APP_PATH}/index.js"></script>
214
+ <script type="module" src="/@fs/${APP_PATH}/bundle-main.js"></script>
219
215
  </body>
220
216
  </html>`;
221
217
  // Apply Vite HTML transforms. This injects the Vite HMR client, and
package/dist/style.css CHANGED
@@ -257,6 +257,17 @@
257
257
  opacity: 0;
258
258
  }
259
259
 
260
+ .__histoire-scale-y-enter-active,
261
+ .__histoire-scale-y-leave-active {
262
+ transition: transform .15s, opacity .15s;
263
+ }
264
+
265
+ .__histoire-scale-y-enter-from,
266
+ .__histoire-scale-y-leave-to {
267
+ transform: scaleY(0);
268
+ opacity: 0;
269
+ }
270
+
260
271
  .__histoire-fade-enter-active,
261
272
  .__histoire-fade-leave-active {
262
273
  transition: transform .15s, opacity .15s;
@@ -923,6 +934,10 @@ button {
923
934
  margin-left:auto
924
935
  }
925
936
 
937
+ .htw-mb-6{
938
+ margin-bottom:1.5rem
939
+ }
940
+
926
941
  .htw-mt-0\.5{
927
942
  margin-top:0.125rem
928
943
  }
@@ -931,10 +946,6 @@ button {
931
946
  margin-top:0px
932
947
  }
933
948
 
934
- .htw-mb-6{
935
- margin-bottom:1.5rem
936
- }
937
-
938
949
  .-htw-mt-1{
939
950
  margin-top:-0.25rem
940
951
  }
@@ -1007,14 +1018,18 @@ button {
1007
1018
  height:16px
1008
1019
  }
1009
1020
 
1010
- .htw-h-\[2px\]{
1011
- height:2px
1012
- }
1013
-
1014
1021
  .htw-h-4{
1015
1022
  height:1rem
1016
1023
  }
1017
1024
 
1025
+ .htw-h-10{
1026
+ height:2.5rem
1027
+ }
1028
+
1029
+ .htw-h-\[2px\]{
1030
+ height:2px
1031
+ }
1032
+
1018
1033
  .htw-h-\[51px\]{
1019
1034
  height:51px
1020
1035
  }
@@ -1033,10 +1048,6 @@ button {
1033
1048
  height:1px
1034
1049
  }
1035
1050
 
1036
- .htw-h-10{
1037
- height:2.5rem
1038
- }
1039
-
1040
1051
  .htw-h-\[1px\]{
1041
1052
  height:1px
1042
1053
  }
@@ -1097,6 +1108,10 @@ button {
1097
1108
  width:1rem
1098
1109
  }
1099
1110
 
1111
+ .htw-w-\[2px\]{
1112
+ width:2px
1113
+ }
1114
+
1100
1115
  .htw-w-fit{
1101
1116
  width:-webkit-fit-content;
1102
1117
  width:-moz-fit-content;
@@ -1133,6 +1148,10 @@ button {
1133
1148
  width:8rem
1134
1149
  }
1135
1150
 
1151
+ .htw-min-w-\[150px\]{
1152
+ min-width:150px
1153
+ }
1154
+
1136
1155
  .htw-min-w-4{
1137
1156
  min-width:1rem
1138
1157
  }
@@ -1149,10 +1168,6 @@ button {
1149
1168
  max-width:100%
1150
1169
  }
1151
1170
 
1152
- .htw-max-w-\[512px\]{
1153
- max-width:512px
1154
- }
1155
-
1156
1171
  .htw-max-w-none{
1157
1172
  max-width:none
1158
1173
  }
@@ -1161,6 +1176,10 @@ button {
1161
1176
  max-width:400px
1162
1177
  }
1163
1178
 
1179
+ .htw-max-w-\[512px\]{
1180
+ max-width:512px
1181
+ }
1182
+
1164
1183
  .htw-flex-none{
1165
1184
  flex:none
1166
1185
  }
@@ -1341,14 +1360,14 @@ button {
1341
1360
  border-radius:0.25rem
1342
1361
  }
1343
1362
 
1344
- .htw-rounded-lg{
1345
- border-radius:0.75rem
1346
- }
1347
-
1348
1363
  .htw-rounded-full{
1349
1364
  border-radius:9999px
1350
1365
  }
1351
1366
 
1367
+ .htw-rounded-lg{
1368
+ border-radius:0.75rem
1369
+ }
1370
+
1352
1371
  .htw-rounded{
1353
1372
  border-radius:0.375rem
1354
1373
  }
@@ -1463,17 +1482,22 @@ button {
1463
1482
  background-color:rgb(var(--_histoire-color-primary-500) / 0.25)
1464
1483
  }
1465
1484
 
1466
- .htw-bg-white\/80{
1467
- background-color:rgb(255 255 255 / 0.8)
1485
+ .htw-bg-primary-50{
1486
+ --tw-bg-opacity:1;
1487
+ background-color:rgb(var(--_histoire-color-primary-50) / var(--tw-bg-opacity))
1488
+ }
1489
+
1490
+ .htw-bg-gray-100{
1491
+ --tw-bg-opacity:1;
1492
+ background-color:rgb(var(--_histoire-color-gray-100) / var(--tw-bg-opacity))
1468
1493
  }
1469
1494
 
1470
1495
  .htw-bg-transparent{
1471
1496
  background-color:transparent
1472
1497
  }
1473
1498
 
1474
- .htw-bg-primary-50{
1475
- --tw-bg-opacity:1;
1476
- background-color:rgb(var(--_histoire-color-primary-50) / var(--tw-bg-opacity))
1499
+ .htw-bg-white\/80{
1500
+ background-color:rgb(255 255 255 / 0.8)
1477
1501
  }
1478
1502
 
1479
1503
  .htw-bg-gray-200{
@@ -1481,11 +1505,6 @@ button {
1481
1505
  background-color:rgb(var(--_histoire-color-gray-200) / var(--tw-bg-opacity))
1482
1506
  }
1483
1507
 
1484
- .htw-bg-gray-100{
1485
- --tw-bg-opacity:1;
1486
- background-color:rgb(var(--_histoire-color-gray-100) / var(--tw-bg-opacity))
1487
- }
1488
-
1489
1508
  .htw-bg-primary-200{
1490
1509
  --tw-bg-opacity:1;
1491
1510
  background-color:rgb(var(--_histoire-color-primary-200) / var(--tw-bg-opacity))
@@ -1549,16 +1568,6 @@ button {
1549
1568
  padding-bottom:3rem
1550
1569
  }
1551
1570
 
1552
- .htw-py-4{
1553
- padding-top:1rem;
1554
- padding-bottom:1rem
1555
- }
1556
-
1557
- .htw-py-2{
1558
- padding-top:0.5rem;
1559
- padding-bottom:0.5rem
1560
- }
1561
-
1562
1571
  .htw-px-0\.5{
1563
1572
  padding-left:0.125rem;
1564
1573
  padding-right:0.125rem
@@ -1569,6 +1578,16 @@ button {
1569
1578
  padding-right:0px
1570
1579
  }
1571
1580
 
1581
+ .htw-py-2{
1582
+ padding-top:0.5rem;
1583
+ padding-bottom:0.5rem
1584
+ }
1585
+
1586
+ .htw-py-4{
1587
+ padding-top:1rem;
1588
+ padding-bottom:1rem
1589
+ }
1590
+
1572
1591
  .htw-px-2{
1573
1592
  padding-left:0.5rem;
1574
1593
  padding-right:0.5rem
@@ -1682,6 +1701,11 @@ button {
1682
1701
  color:rgb(var(--_histoire-color-gray-400) / var(--tw-text-opacity))
1683
1702
  }
1684
1703
 
1704
+ .htw-text-red-500{
1705
+ --tw-text-opacity:1;
1706
+ color:rgb(239 68 68 / var(--tw-text-opacity))
1707
+ }
1708
+
1685
1709
  .htw-text-black\/\[2\%\]{
1686
1710
  color:rgb(0 0 0 / 2%)
1687
1711
  }
@@ -1690,11 +1714,6 @@ button {
1690
1714
  color:rgb(var(--_histoire-color-gray-500) / 0.2)
1691
1715
  }
1692
1716
 
1693
- .htw-text-red-500{
1694
- --tw-text-opacity:1;
1695
- color:rgb(239 68 68 / var(--tw-text-opacity))
1696
- }
1697
-
1698
1717
  .htw-text-primary-800{
1699
1718
  --tw-text-opacity:1;
1700
1719
  color:rgb(var(--_histoire-color-primary-800) / var(--tw-text-opacity))
@@ -1712,14 +1731,14 @@ button {
1712
1731
  opacity:0.4
1713
1732
  }
1714
1733
 
1715
- .htw-opacity-60{
1716
- opacity:0.6
1717
- }
1718
-
1719
1734
  .htw-opacity-50{
1720
1735
  opacity:0.5
1721
1736
  }
1722
1737
 
1738
+ .htw-opacity-60{
1739
+ opacity:0.6
1740
+ }
1741
+
1723
1742
  .htw-opacity-30{
1724
1743
  opacity:0.3
1725
1744
  }
@@ -1853,15 +1872,15 @@ body {
1853
1872
  background-color:rgb(var(--_histoire-color-primary-600) / var(--tw-bg-opacity))
1854
1873
  }
1855
1874
 
1856
- .hover\:htw-bg-primary-500\/50:hover{
1857
- background-color:rgb(var(--_histoire-color-primary-500) / 0.5)
1858
- }
1859
-
1860
1875
  .hover\:htw-bg-primary-50:hover{
1861
1876
  --tw-bg-opacity:1;
1862
1877
  background-color:rgb(var(--_histoire-color-primary-50) / var(--tw-bg-opacity))
1863
1878
  }
1864
1879
 
1880
+ .hover\:htw-bg-primary-500\/50:hover{
1881
+ background-color:rgb(var(--_histoire-color-primary-500) / 0.5)
1882
+ }
1883
+
1865
1884
  .hover\:htw-bg-gray-200:hover{
1866
1885
  --tw-bg-opacity:1;
1867
1886
  background-color:rgb(var(--_histoire-color-gray-200) / var(--tw-bg-opacity))
@@ -1904,14 +1923,14 @@ body {
1904
1923
  background-color:rgb(var(--_histoire-color-primary-100) / var(--tw-bg-opacity))
1905
1924
  }
1906
1925
 
1907
- .htw-group:hover .group-hover\:htw-opacity-90{
1908
- opacity:0.9
1909
- }
1910
-
1911
1926
  .htw-group:hover .group-hover\:htw-opacity-100{
1912
1927
  opacity:1
1913
1928
  }
1914
1929
 
1930
+ .htw-group:hover .group-hover\:htw-opacity-90{
1931
+ opacity:0.9
1932
+ }
1933
+
1915
1934
  .htw-group:active .group-active\:htw-bg-gray-500\/20{
1916
1935
  background-color:rgb(var(--_histoire-color-gray-500) / 0.2)
1917
1936
  }
@@ -1959,15 +1978,15 @@ body {
1959
1978
  border-color:rgb(var(--_histoire-color-gray-850) / var(--tw-border-opacity))
1960
1979
  }
1961
1980
 
1962
- .htw-dark .dark\:htw-border-gray-700\/30{
1963
- border-color:rgb(var(--_histoire-color-gray-700) / 0.3)
1964
- }
1965
-
1966
1981
  .htw-dark .dark\:htw-border-gray-750{
1967
1982
  --tw-border-opacity:1;
1968
1983
  border-color:rgb(var(--_histoire-color-gray-750) / var(--tw-border-opacity))
1969
1984
  }
1970
1985
 
1986
+ .htw-dark .dark\:htw-border-gray-700\/30{
1987
+ border-color:rgb(var(--_histoire-color-gray-700) / 0.3)
1988
+ }
1989
+
1971
1990
  .htw-dark .dark\:htw-border-primary-900{
1972
1991
  --tw-border-opacity:1;
1973
1992
  border-color:rgb(var(--_histoire-color-primary-900) / var(--tw-border-opacity))
@@ -1991,23 +2010,23 @@ body {
1991
2010
  background-color:rgb(var(--_histoire-color-primary-400) / var(--tw-bg-opacity))
1992
2011
  }
1993
2012
 
1994
- .htw-dark .dark\:htw-bg-gray-700\/80{
1995
- background-color:rgb(var(--_histoire-color-gray-700) / 0.8)
1996
- }
1997
-
1998
2013
  .htw-dark .dark\:htw-bg-primary-600{
1999
2014
  --tw-bg-opacity:1;
2000
2015
  background-color:rgb(var(--_histoire-color-primary-600) / var(--tw-bg-opacity))
2001
2016
  }
2002
2017
 
2003
- .htw-dark .dark\:htw-bg-gray-850{
2018
+ .htw-dark .dark\:htw-bg-gray-800{
2004
2019
  --tw-bg-opacity:1;
2005
- background-color:rgb(var(--_histoire-color-gray-850) / var(--tw-bg-opacity))
2020
+ background-color:rgb(var(--_histoire-color-gray-800) / var(--tw-bg-opacity))
2006
2021
  }
2007
2022
 
2008
- .htw-dark .dark\:htw-bg-gray-800{
2023
+ .htw-dark .dark\:htw-bg-gray-700\/80{
2024
+ background-color:rgb(var(--_histoire-color-gray-700) / 0.8)
2025
+ }
2026
+
2027
+ .htw-dark .dark\:htw-bg-gray-850{
2009
2028
  --tw-bg-opacity:1;
2010
- background-color:rgb(var(--_histoire-color-gray-800) / var(--tw-bg-opacity))
2029
+ background-color:rgb(var(--_histoire-color-gray-850) / var(--tw-bg-opacity))
2011
2030
  }
2012
2031
 
2013
2032
  .htw-dark .dark\:htw-bg-primary-700{
@@ -2025,6 +2044,11 @@ body {
2025
2044
  background-color:rgb(0 0 0 / var(--tw-bg-opacity))
2026
2045
  }
2027
2046
 
2047
+ .htw-dark .dark\:htw-bg-gray-600{
2048
+ --tw-bg-opacity:1;
2049
+ background-color:rgb(var(--_histoire-color-gray-600) / var(--tw-bg-opacity))
2050
+ }
2051
+
2028
2052
  .htw-dark .dark\:htw-text-gray-100{
2029
2053
  --tw-text-opacity:1;
2030
2054
  color:rgb(var(--_histoire-color-gray-100) / var(--tw-text-opacity))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "histoire",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "A fast story book powered by Vite",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -21,7 +21,7 @@
21
21
  "types": "./dist/node/index.d.ts"
22
22
  },
23
23
  "./client": {
24
- "import": "./dist/client/index.js",
24
+ "import": "./dist/client/bundle-index.js",
25
25
  "types": "./dist/client/index.d.ts"
26
26
  },
27
27
  "./*": "./*"
@@ -33,9 +33,8 @@
33
33
  "histoire": "./bin.mjs"
34
34
  },
35
35
  "dependencies": {
36
- "@histoire/controls": "^0.3.1",
36
+ "@histoire/controls": "^0.4.0",
37
37
  "@iconify/vue": "^3.2.1",
38
- "@vitejs/plugin-vue": "^2.3.1",
39
38
  "@vueuse/core": "^8.2.5",
40
39
  "birpc": "^0.1.1",
41
40
  "case": "^1.6.3",
@@ -44,7 +43,7 @@
44
43
  "defu": "^6.0.0",
45
44
  "diacritics": "^1.3.0",
46
45
  "flexsearch": "^0.7.21",
47
- "floating-vue": "^2.0.0-beta.14",
46
+ "floating-vue": "^2.0.0-beta.16",
48
47
  "fs-extra": "^10.0.1",
49
48
  "globby": "^13.1.1",
50
49
  "happy-dom": "^2.55.0",
@@ -62,11 +61,11 @@
62
61
  "sirv": "^2.0.2",
63
62
  "tinypool": "^0.1.2",
64
63
  "vite-node": "0.7.6",
65
- "vue-router": "^4.0.14"
64
+ "vue-router": "^4.0.14",
65
+ "vue": "^3.2.31"
66
66
  },
67
67
  "peerDependencies": {
68
- "vite": "^2.9.0",
69
- "vue": "^3.2.31"
68
+ "vite": "^2.9.0"
70
69
  },
71
70
  "devDependencies": {
72
71
  "@peeky/test": "^0.13.5",
@@ -75,6 +74,7 @@
75
74
  "@types/fs-extra": "^9.0.13",
76
75
  "@types/markdown-it": "^12.2.3",
77
76
  "@types/node": "^17.0.23",
77
+ "@vitejs/plugin-vue": "^2.3.1",
78
78
  "autoprefixer": "^10.4.4",
79
79
  "concurrently": "^7.1.0",
80
80
  "postcss": "^8.4.12",
@@ -85,9 +85,9 @@
85
85
  "vue": "^3.2.31"
86
86
  },
87
87
  "scripts": {
88
- "build": "rimraf dist && tsc -d && pnpm run build:css && node ./scripts/copy.mjs",
88
+ "build": "rimraf dist && tsc -d && vite build && pnpm run build:css && node ./scripts/copy.mjs",
89
89
  "build:css": "tailwindcss -i src/client/app/style/main.pcss -o ./dist/style.css -c tailwind.config.cjs --postcss postcss.config.cjs",
90
- "watch": "concurrently \"tsc -d -w --sourceMap\" \"pnpm run build:css --watch\" \"node ./scripts/watchAndCopy.mjs\"",
90
+ "watch": "concurrently \"tsc -d -w --sourceMap\" \"vite build --watch\" \"pnpm run build:css --watch\" \"node ./scripts/watchAndCopy.mjs\"",
91
91
  "test:open": "peeky open",
92
92
  "test": "peeky run"
93
93
  }
@@ -15,8 +15,8 @@ import type { StoryFile, Tree } from './types'
15
15
  import { useStoryStore } from './stores/story'
16
16
  import { mapFile } from './util/mapping'
17
17
  import { useTitle } from '@vueuse/core'
18
- import { histoireConfig } from './util/config.js'
19
- import { onKeyboardShortcut } from './util/keyboard.js'
18
+ import { histoireConfig } from './util/config'
19
+ import { onKeyboardShortcut } from './util/keyboard'
20
20
  import { isMobile } from './util/responsive'
21
21
  import Breadcrumb from './components/app/Breadcrumb.vue'
22
22
  import SearchModal from './components/search/SearchModal.vue'
@@ -0,0 +1 @@
1
+ export { hstEvent } from './util/events.js'
@@ -1,8 +1,7 @@
1
1
  // @ts-nocheck
2
2
  // @TODO remove no-check and fix vnode type errors
3
3
 
4
- import { VNode, vModelText, vModelCheckbox, vModelSelect, vModelRadio, vModelDynamic } from 'vue'
5
- import { Text } from '@vue/runtime-core'
4
+ import { VNode, vModelText, vModelCheckbox, vModelSelect, vModelRadio, vModelDynamic, Text } from 'vue'
6
5
  import { pascal } from 'case'
7
6
  import { createAutoBuildingObject, indent } from './util'
8
7
  import { serializeJs } from './serialize-js'
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { computed } from 'vue'
3
- import { histoireConfig, customLogos } from '../util/config.js'
3
+ import { histoireConfig, customLogos } from '../util/config'
4
4
  import HistoireLogo from '../assets/histoire.svg'
5
5
 
6
6
  const logoUrl = computed(() => histoireConfig.theme?.logo?.square ? customLogos.square : HistoireLogo)
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { isDark } from '../../util/dark'
3
3
  import { computed } from 'vue'
4
- import { histoireConfig, customLogos } from '../../util/config.js'
4
+ import { histoireConfig, customLogos } from '../../util/config'
5
5
 
6
6
  import HistoireLogoDark from '../../assets/histoire-text-dark.svg'
7
7
  import HistoireLogoLight from '../../assets/histoire-text.svg'
@@ -1,6 +1,5 @@
1
1
  <script lang="ts" setup>
2
2
  import { Icon } from '@iconify/vue'
3
- import { defineEmits } from '@vue/runtime-core'
4
3
 
5
4
  const props = defineProps<{
6
5
  title: string
@@ -5,7 +5,7 @@
5
5
  </template>
6
6
 
7
7
  <style scoped>
8
- .htw-base-empty {
8
+ .htw-base-empty:not(.no-animation) {
9
9
  animation: htw-base-empty .3s 1s both;
10
10
  }
11
11