histoire 0.3.2 → 0.4.1
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.
- package/dist/bundled/BaseEmpty.js +13 -0
- package/dist/bundled/HomeView.js +23 -0
- package/dist/bundled/MobileOverlay.js +303 -0
- package/dist/bundled/SearchPane.js +504 -0
- package/dist/bundled/StoryView.js +2330 -0
- package/dist/bundled/api.js +32 -0
- package/dist/bundled/config.js +4 -0
- package/dist/bundled/const.js +5 -0
- package/dist/bundled/dark.js +4 -0
- package/dist/bundled/events.js +29 -0
- package/dist/bundled/global-components.js +203 -0
- package/dist/bundled/index.js +7 -0
- package/dist/bundled/index2.js +762 -0
- package/dist/bundled/reactivity.js +96 -0
- package/dist/bundled/sandbox.js +97 -0
- package/dist/bundled/search-docs-data.js +7 -0
- package/dist/bundled/story.js +59 -0
- package/dist/bundled/style.css +102 -0
- package/dist/client/app/App.vue +2 -2
- package/dist/client/app/api.d.ts +1 -0
- package/dist/client/app/api.js +1 -0
- package/dist/client/app/codegen/vue3.js +1 -3
- package/dist/client/app/components/HomeView.vue +1 -1
- package/dist/client/app/components/app/AppLogo.vue +1 -1
- package/dist/client/app/components/app/MobileOverlay.vue +0 -1
- package/dist/client/app/components/base/BaseEmpty.vue +1 -1
- package/dist/client/app/components/base/BaseOverflowMenu.vue +1 -1
- package/dist/client/app/components/exposed/Story.vue +1 -1
- package/dist/client/app/components/panel/StoryEvent.vue +1 -0
- package/dist/client/app/components/search/SearchItem.vue +1 -1
- package/dist/client/app/components/search/SearchPane.vue +108 -25
- package/dist/client/app/components/search/search-docs-data.d.ts +3 -0
- package/dist/client/app/components/search/{search-data.js → search-docs-data.js} +1 -2
- package/dist/client/app/components/search/search-title-data.d.ts +3 -0
- package/dist/client/app/components/search/search-title-data.js +7 -0
- package/dist/client/app/components/search/types.d.ts +7 -0
- package/dist/client/app/components/search/types.js +1 -0
- package/dist/client/app/components/story/StoryVariantGridItem.vue +1 -1
- package/dist/client/app/components/story/StoryVariantListItem.vue +1 -1
- package/dist/client/app/components/story/StoryVariantSinglePreviewNative.vue +6 -3
- package/dist/client/app/components/tree/StoryListItem.vue +1 -1
- package/dist/client/app/global-components.js +0 -1
- package/dist/client/app/index.d.ts +1 -1
- package/dist/client/app/index.js +21 -19
- package/dist/client/app/sandbox.d.ts +1 -1
- package/dist/client/app/sandbox.js +0 -2
- package/dist/client/app/stores/events.d.ts +1 -1
- package/dist/client/app/stores/events.js +1 -2
- package/dist/client/app/stores/folder.js +0 -1
- package/dist/client/app/stores/story.js +0 -1
- package/dist/client/app/types.js +0 -1
- package/dist/client/app/util/events.d.ts +1 -1
- package/dist/client/app/util/events.js +2 -3
- package/dist/client/app/util/keyboard.js +0 -1
- package/dist/client/app/util/mapping.js +0 -1
- package/dist/client/app/util/preview-settings.js +0 -1
- package/dist/client/app/util/reactivity.js +0 -1
- package/dist/client/app/util/scroll.js +0 -1
- package/dist/client/app/util/variant.js +0 -1
- package/dist/client/bundle-index.js +5 -0
- package/dist/client/bundle-main.js +5 -0
- package/dist/client/bundle-sandbox.js +3 -0
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -2
- package/dist/client/server/vue3/run.js +8 -1
- package/dist/controls.js +0 -1
- package/dist/node/alias.js +1 -1
- package/dist/node/build.js +4 -4
- package/dist/node/builtin-plugins/tailwind-tokens.js +1 -1
- package/dist/node/search.d.ts +15 -1
- package/dist/node/search.js +78 -32
- package/dist/node/server.js +2 -2
- package/dist/node/types.d.ts +1 -0
- package/dist/node/vite.d.ts +4 -2
- package/dist/node/vite.js +24 -28
- package/package.json +11 -10
- package/src/client/app/App.vue +2 -2
- package/src/client/app/api.ts +1 -0
- package/src/client/app/codegen/vue3.ts +1 -2
- package/src/client/app/components/HomeView.vue +1 -1
- package/src/client/app/components/app/AppLogo.vue +1 -1
- package/src/client/app/components/app/MobileOverlay.vue +0 -1
- package/src/client/app/components/base/BaseEmpty.vue +1 -1
- package/src/client/app/components/base/BaseOverflowMenu.vue +1 -1
- package/src/client/app/components/exposed/Story.vue +1 -1
- package/src/client/app/components/panel/StoryEvent.vue +1 -0
- package/src/client/app/components/search/SearchItem.vue +1 -1
- package/src/client/app/components/search/SearchPane.vue +108 -25
- package/src/client/app/components/search/search-docs-data.ts +10 -0
- package/src/client/app/components/search/search-title-data.ts +10 -0
- package/src/client/app/components/search/types.ts +4 -0
- package/src/client/app/components/story/StoryVariantGridItem.vue +1 -1
- package/src/client/app/components/story/StoryVariantListItem.vue +1 -1
- package/src/client/app/components/story/StoryVariantSinglePreviewNative.vue +6 -3
- package/src/client/app/components/tree/StoryListItem.vue +1 -1
- package/src/client/app/index.ts +23 -19
- package/src/client/app/sandbox.ts +0 -1
- package/src/client/app/stores/events.ts +1 -1
- package/src/client/app/util/events.ts +2 -2
- package/src/client/bundle-index.js +5 -0
- package/src/client/bundle-main.js +5 -0
- package/src/client/bundle-sandbox.js +3 -0
- package/src/client/index.ts +1 -1
- package/src/client/server/vue3/run.ts +11 -0
- package/src/node/alias.ts +1 -1
- package/src/node/build.ts +4 -4
- package/src/node/builtin-plugins/tailwind-tokens.ts +1 -1
- package/src/node/search.ts +87 -32
- package/src/node/server.ts +2 -2
- package/src/node/types.ts +1 -0
- package/src/node/vite.ts +24 -29
- package/vite.config.ts +46 -0
- package/dist/client/app/codegen/vue3.js.map +0 -1
- package/dist/client/app/components/search/search-data.d.ts +0 -2
- package/dist/client/app/components/search/search-data.js.map +0 -1
- package/dist/client/app/global-components.js.map +0 -1
- package/dist/client/app/index.js.map +0 -1
- package/dist/client/app/sandbox.js.map +0 -1
- package/dist/client/app/stores/events.js.map +0 -1
- package/dist/client/app/stores/folder.js.map +0 -1
- package/dist/client/app/stores/story.js.map +0 -1
- package/dist/client/app/types.js.map +0 -1
- package/dist/client/app/util/events.js.map +0 -1
- package/dist/client/app/util/keyboard.js.map +0 -1
- package/dist/client/app/util/mapping.js.map +0 -1
- package/dist/client/app/util/preview-settings.js.map +0 -1
- package/dist/client/app/util/reactivity.js.map +0 -1
- package/dist/client/app/util/scroll.js.map +0 -1
- package/dist/client/app/util/variant.js.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/client/server/vue3/run.js.map +0 -1
- package/dist/controls.js.map +0 -1
- package/src/client/app/components/search/search-data.ts +0 -9
package/dist/node/search.js
CHANGED
|
@@ -1,54 +1,80 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
2
|
import flexsearch from 'flexsearch';
|
|
3
3
|
import path from 'pathe';
|
|
4
|
+
import Case from 'case';
|
|
4
5
|
import { loadModule } from './load.js';
|
|
5
6
|
const require = createRequire(import.meta.url);
|
|
6
|
-
export async function
|
|
7
|
+
export async function generateTitleSearchData(ctx) {
|
|
8
|
+
const searchIndex = await createIndex();
|
|
9
|
+
const { idMap, addToIdMap } = createIdMap();
|
|
10
|
+
for (const storyFile of ctx.storyFiles) {
|
|
11
|
+
if (storyFile.story) {
|
|
12
|
+
searchIndex.add({
|
|
13
|
+
id: addToIdMap(storyFile.story.id, 'story'),
|
|
14
|
+
text: convertTitleToSentence(storyFile.story.title),
|
|
15
|
+
});
|
|
16
|
+
for (const variant of storyFile.story.variants) {
|
|
17
|
+
searchIndex.add({
|
|
18
|
+
id: addToIdMap(`${storyFile.story.id}:${variant.id}`, 'variant'),
|
|
19
|
+
text: convertTitleToSentence(`${storyFile.story.title} ${variant.title}`),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
index: await exportSearchIndex(searchIndex),
|
|
26
|
+
idMap,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export async function generateDocSearchData(ctx) {
|
|
30
|
+
const searchIndex = await createIndex();
|
|
31
|
+
const { idMap, addToIdMap } = createIdMap();
|
|
32
|
+
for (const storyFile of ctx.storyFiles) {
|
|
33
|
+
if (storyFile.story && storyFile.story.docsText) {
|
|
34
|
+
searchIndex.add({
|
|
35
|
+
id: addToIdMap(storyFile.story.id, 'story'),
|
|
36
|
+
text: storyFile.story.docsText,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
index: await exportSearchIndex(searchIndex),
|
|
42
|
+
idMap,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async function createIndex() {
|
|
7
46
|
const flexsearchRoot = path.dirname(require.resolve('flexsearch/package.json'));
|
|
8
|
-
|
|
47
|
+
return new flexsearch.Document({
|
|
9
48
|
preset: 'match',
|
|
10
49
|
document: {
|
|
11
50
|
id: 'id',
|
|
12
51
|
index: [
|
|
13
|
-
'
|
|
14
|
-
'docs',
|
|
15
|
-
],
|
|
16
|
-
store: [
|
|
17
|
-
'kind',
|
|
52
|
+
'text',
|
|
18
53
|
],
|
|
19
54
|
},
|
|
20
55
|
charset: await loadModule(`${flexsearchRoot}/dist/module/lang/latin/advanced.js`),
|
|
21
56
|
language: await loadModule(`${flexsearchRoot}/dist/module/lang/en.js`),
|
|
22
|
-
tokenize: '
|
|
57
|
+
tokenize: 'forward',
|
|
23
58
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
for (const variant of storyFile.story.variants) {
|
|
33
|
-
searchIndex.add({
|
|
34
|
-
id: `${storyFile.story.id}:${variant.id}`,
|
|
35
|
-
kind: 'variant',
|
|
36
|
-
title: `${storyFile.story.title} ${variant.title}`,
|
|
37
|
-
docs: '', // @TODO
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
59
|
+
}
|
|
60
|
+
function createIdMap() {
|
|
61
|
+
let uid = 0;
|
|
62
|
+
const idMap = {};
|
|
63
|
+
function addToIdMap(id, kind) {
|
|
64
|
+
const n = uid++;
|
|
65
|
+
idMap[n] = { id, kind };
|
|
66
|
+
return n;
|
|
41
67
|
}
|
|
42
|
-
return
|
|
68
|
+
return {
|
|
69
|
+
idMap,
|
|
70
|
+
addToIdMap,
|
|
71
|
+
};
|
|
43
72
|
}
|
|
44
73
|
const exportKeys = new Set([
|
|
45
74
|
'reg',
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'docs.cfg',
|
|
50
|
-
'docs.map',
|
|
51
|
-
'docs.ctx',
|
|
75
|
+
'text.cfg',
|
|
76
|
+
'text.map',
|
|
77
|
+
'text.ctx',
|
|
52
78
|
'tag',
|
|
53
79
|
'store',
|
|
54
80
|
]);
|
|
@@ -66,3 +92,23 @@ async function exportSearchIndex(index) {
|
|
|
66
92
|
});
|
|
67
93
|
});
|
|
68
94
|
}
|
|
95
|
+
function convertTitleToSentence(text) {
|
|
96
|
+
return text.split(' ').map(str => Case.lower(str)).join(' ');
|
|
97
|
+
}
|
|
98
|
+
// @TODO clear handlers when SearchPane unmounts
|
|
99
|
+
export function getSearchDataJS(data) {
|
|
100
|
+
return `export let searchData = ${JSON.stringify(data)}
|
|
101
|
+
const handlers = []
|
|
102
|
+
export function onUpdate (cb) {
|
|
103
|
+
handlers.push(cb)
|
|
104
|
+
}
|
|
105
|
+
if (import.meta.hot) {
|
|
106
|
+
import.meta.hot.accept(newModule => {
|
|
107
|
+
searchData = newModule.searchData
|
|
108
|
+
handlers.forEach(h => {
|
|
109
|
+
h(newModule.searchData)
|
|
110
|
+
newModule.onUpdate(h)
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
}`;
|
|
114
|
+
}
|
package/dist/node/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createServer as createViteServer } from 'vite';
|
|
2
|
-
import { createVitePlugins,
|
|
2
|
+
import { createVitePlugins, RESOLVED_SEARCH_TITLE_DATA_ID, RESOLVED_STORIES_ID } from './vite.js';
|
|
3
3
|
import { notifyStoryChange, onStoryChange, watchStories } from './stories.js';
|
|
4
4
|
import { useCollectStories } from './collect/index.js';
|
|
5
5
|
import { DevPluginApi } from './plugin.js';
|
|
@@ -94,7 +94,7 @@ export async function createServer(ctx, port) {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
invalidateModule(RESOLVED_STORIES_ID);
|
|
97
|
-
invalidateModule(
|
|
97
|
+
invalidateModule(RESOLVED_SEARCH_TITLE_DATA_ID);
|
|
98
98
|
});
|
|
99
99
|
async function close() {
|
|
100
100
|
for (const cb of pluginOnCleanups) {
|
package/dist/node/types.d.ts
CHANGED
package/dist/node/vite.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export declare const CONFIG_ID = "$histoire-config";
|
|
|
8
8
|
export declare const RESOLVED_CONFIG_ID: string;
|
|
9
9
|
export declare const THEME_ID = "$histoire-theme";
|
|
10
10
|
export declare const RESOLVED_THEME_ID: string;
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
11
|
+
export declare const SEARCH_TITLE_DATA_ID = "$histoire-search-title-data";
|
|
12
|
+
export declare const RESOLVED_SEARCH_TITLE_DATA_ID: string;
|
|
13
|
+
export declare const SEARCH_DOCS_DATA_ID = "$histoire-search-docs-data";
|
|
14
|
+
export declare const RESOLVED_SEARCH_DOCS_DATA_ID: string;
|
|
13
15
|
export declare function createVitePlugins(ctx: Context): Promise<VitePlugin[]>;
|
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 {
|
|
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
|
|
21
|
-
export const
|
|
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(
|
|
84
|
-
return
|
|
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:
|
|
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 ===
|
|
143
|
-
return
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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}/
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "histoire",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
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,9 @@
|
|
|
33
33
|
"histoire": "./bin.mjs"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@histoire/controls": "^0.
|
|
36
|
+
"@histoire/controls": "^0.4.1",
|
|
37
37
|
"@iconify/vue": "^3.2.1",
|
|
38
|
-
"@
|
|
38
|
+
"@types/markdown-it": "^12.2.3",
|
|
39
39
|
"@vueuse/core": "^8.2.5",
|
|
40
40
|
"birpc": "^0.1.1",
|
|
41
41
|
"case": "^1.6.3",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"defu": "^6.0.0",
|
|
45
45
|
"diacritics": "^1.3.0",
|
|
46
46
|
"flexsearch": "^0.7.21",
|
|
47
|
-
"floating-vue": "^2.0.0-beta.
|
|
47
|
+
"floating-vue": "^2.0.0-beta.16",
|
|
48
48
|
"fs-extra": "^10.0.1",
|
|
49
49
|
"globby": "^13.1.1",
|
|
50
50
|
"happy-dom": "^2.55.0",
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
"sirv": "^2.0.2",
|
|
63
63
|
"tinypool": "^0.1.2",
|
|
64
64
|
"vite-node": "0.7.6",
|
|
65
|
-
"vue-router": "^4.0.14"
|
|
65
|
+
"vue-router": "^4.0.14",
|
|
66
|
+
"vue": "^3.2.31"
|
|
66
67
|
},
|
|
67
68
|
"peerDependencies": {
|
|
68
|
-
"vite": "^2.9.0"
|
|
69
|
-
"vue": "^3.2.31"
|
|
69
|
+
"vite": "^2.9.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@peeky/test": "^0.13.5",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"@types/fs-extra": "^9.0.13",
|
|
76
76
|
"@types/markdown-it": "^12.2.3",
|
|
77
77
|
"@types/node": "^17.0.23",
|
|
78
|
+
"@vitejs/plugin-vue": "^2.3.1",
|
|
78
79
|
"autoprefixer": "^10.4.4",
|
|
79
80
|
"concurrently": "^7.1.0",
|
|
80
81
|
"postcss": "^8.4.12",
|
|
@@ -85,9 +86,9 @@
|
|
|
85
86
|
"vue": "^3.2.31"
|
|
86
87
|
},
|
|
87
88
|
"scripts": {
|
|
88
|
-
"build": "rimraf dist && tsc -d && pnpm run build:css && node ./scripts/copy.mjs",
|
|
89
|
+
"build": "rimraf dist && tsc -d && vite build && pnpm run build:css && node ./scripts/copy.mjs",
|
|
89
90
|
"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\"",
|
|
91
|
+
"watch": "concurrently \"tsc -d -w --sourceMap\" \"vite build --watch\" \"pnpm run build:css --watch\" \"node ./scripts/watchAndCopy.mjs\"",
|
|
91
92
|
"test:open": "peeky open",
|
|
92
93
|
"test": "peeky run"
|
|
93
94
|
}
|
package/src/client/app/App.vue
CHANGED
|
@@ -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
|
|
19
|
-
import { onKeyboardShortcut } from './util/keyboard
|
|
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
|
|
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
|
|
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'
|
|
@@ -70,7 +70,7 @@ const ChildWrapper = {
|
|
|
70
70
|
*/
|
|
71
71
|
const ChildrenRender = (props, { slots }) => {
|
|
72
72
|
const [fragment] = slots.default()
|
|
73
|
-
return fragment.children.map((vnode, index) => h(ChildWrapper, { index }, [vnode]))
|
|
73
|
+
return fragment.children.map((vnode, index) => h(ChildWrapper, { index }, () => [vnode]))
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { computed, defineComponent, provide, useAttrs, VNode, h, PropType, getCurrentInstance } from 'vue'
|
|
3
|
-
import { Story } from '../../types.js'
|
|
3
|
+
import type { Story } from '../../types.js'
|
|
4
4
|
import Variant from './Variant.vue'
|
|
5
5
|
|
|
6
6
|
export default defineComponent({
|
|
@@ -3,7 +3,7 @@ import { PropType, ref, toRefs } from 'vue'
|
|
|
3
3
|
import { useRouter } from 'vue-router'
|
|
4
4
|
import { Icon } from '@iconify/vue'
|
|
5
5
|
import { SearchResult } from '../../types'
|
|
6
|
-
import { onKeyboardShortcut } from '../../util/keyboard
|
|
6
|
+
import { onKeyboardShortcut } from '../../util/keyboard'
|
|
7
7
|
import BaseListItemLink from '../base/BaseListItemLink.vue'
|
|
8
8
|
import { useScrollOnActive } from '../../util/scroll'
|
|
9
9
|
|