histoire 0.2.5 → 0.3.2
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/client/app/App.vue +8 -3
- package/dist/client/app/codegen/const.d.ts +1 -0
- package/dist/client/app/codegen/const.js +3 -0
- package/dist/client/app/codegen/vue3.js +83 -21
- package/dist/client/app/codegen/vue3.js.map +1 -0
- package/dist/client/app/components/base/BaseEmpty.vue +17 -1
- package/dist/client/app/components/base/BaseOverflowMenu.vue +118 -0
- package/dist/client/app/components/base/BaseOverflowTab.vue +46 -0
- package/dist/client/app/components/exposed/Story.vue +33 -1
- package/dist/client/app/components/exposed/Variant.vue +19 -1
- package/dist/client/app/components/panel/PaneTabs.vue +64 -0
- package/dist/client/app/components/{story → panel}/StoryControls.vue +6 -1
- package/dist/client/app/components/{story → panel}/StoryDocs.vue +18 -11
- package/dist/client/app/components/panel/StoryEvent.vue +53 -0
- package/dist/client/app/components/panel/StoryEvents.vue +45 -0
- package/{src/client/app/components/story → dist/client/app/components/panel}/StorySidePanel.vue +17 -20
- package/{src/client/app/components/story → dist/client/app/components/panel}/StorySourceCode.vue +24 -14
- package/dist/client/app/components/sandbox/SandboxVue3.vue +16 -4
- package/dist/client/app/components/sandbox/lib.js +2 -1
- package/dist/client/app/components/search/SearchLoading.vue +16 -0
- package/dist/client/app/components/search/SearchModal.vue +12 -149
- package/dist/client/app/components/search/SearchPane.vue +210 -0
- package/dist/client/app/components/search/search-data.d.ts +2 -0
- package/dist/client/app/components/search/search-data.js +8 -0
- package/dist/client/app/components/search/search-data.js.map +1 -0
- package/dist/client/app/components/story/StoryResponsivePreview.vue +9 -98
- package/dist/client/app/components/story/StoryVariantSingle.vue +109 -0
- package/dist/client/app/components/story/StoryVariantSinglePreviewNative.vue +39 -0
- package/dist/client/app/components/story/StoryVariantSinglePreviewRemote.vue +153 -0
- package/dist/client/app/components/story/StoryVariantSingleView.vue +13 -6
- package/dist/client/app/components/story/StoryView.vue +17 -3
- package/dist/client/app/components/story/StoryViewer.vue +2 -92
- package/dist/client/app/components/{story/toolbar → toolbar}/StoryVariantBackground.vue +3 -3
- package/{src/client/app/components/story → dist/client/app/components}/toolbar/StoryVariantNewTab.vue +2 -2
- package/dist/client/app/components/{story/toolbar → toolbar}/StoryVariantResponsiveSize.vue +3 -3
- package/{src/client/app/components/story → dist/client/app/components}/toolbar/StoryVariantTitle.vue +1 -1
- package/dist/client/app/components/tree/StoryGroup.vue +4 -4
- package/dist/client/app/components/tree/StoryListFolder.vue +4 -4
- package/dist/client/app/components/tree/StoryListItem.vue +4 -1
- package/dist/client/app/global-components.js +1 -0
- package/dist/client/app/global-components.js.map +1 -0
- package/dist/client/app/index.js +1 -0
- package/dist/client/app/index.js.map +1 -0
- package/dist/client/app/router.d.ts +1 -0
- package/dist/client/app/router.js +3 -1
- package/dist/client/app/sandbox.js +12 -1
- package/dist/client/app/sandbox.js.map +1 -0
- package/dist/client/app/stores/events.d.ts +29 -0
- package/dist/client/app/stores/events.js +26 -0
- package/dist/client/app/stores/events.js.map +1 -0
- package/dist/client/app/stores/folder.d.ts +10 -0
- package/dist/client/app/stores/folder.js +48 -0
- package/dist/client/app/stores/folder.js.map +1 -0
- package/dist/client/app/stores/story.d.ts +41 -8
- package/dist/client/app/stores/story.js +21 -33
- package/dist/client/app/stores/story.js.map +1 -0
- package/dist/client/app/style/main.pcss +5 -0
- package/dist/client/app/style/sandbox.css +2 -0
- package/dist/client/app/style/transitions.pcss +13 -0
- package/dist/client/app/types.d.ts +4 -0
- package/dist/client/app/types.js +1 -0
- package/dist/client/app/types.js.map +1 -0
- package/dist/client/app/util/const.d.ts +1 -0
- package/dist/client/app/util/const.js +1 -0
- package/dist/client/app/util/events.d.ts +1 -0
- package/dist/client/app/util/events.js +32 -0
- package/dist/client/app/util/events.js.map +1 -0
- package/dist/client/app/util/keyboard.js +1 -0
- package/dist/client/app/util/keyboard.js.map +1 -0
- package/dist/client/app/util/mapping.js +5 -2
- package/dist/client/app/util/mapping.js.map +1 -0
- package/dist/client/app/util/preview-settings.js +1 -0
- package/dist/client/app/util/preview-settings.js.map +1 -0
- package/dist/client/app/util/reactivity.js +1 -0
- package/dist/client/app/util/reactivity.js.map +1 -0
- package/dist/client/app/util/scroll.js +1 -0
- package/dist/client/app/util/scroll.js.map +1 -0
- package/dist/client/app/util/variant.js +1 -0
- package/dist/client/app/util/variant.js.map +1 -0
- package/dist/client/index.d.ts +4 -3
- package/dist/client/index.js +3 -1
- package/dist/client/index.js.map +1 -0
- package/dist/client/server/index.d.ts +7 -2
- package/dist/client/server/index.js +8 -26
- package/{src/client/server/Story.server.vue → dist/client/server/vue3/Story.vue} +14 -3
- package/dist/client/server/{Variant.server.vue → vue3/Variant.vue} +0 -0
- package/dist/client/server/vue3/run.d.ts +2 -0
- package/dist/client/server/vue3/run.js +33 -0
- package/dist/client/server/vue3/run.js.map +1 -0
- package/dist/controls.js +1 -0
- package/dist/controls.js.map +1 -0
- package/dist/node/alias.d.ts +2 -1
- package/dist/node/alias.js +3 -2
- package/dist/node/build.js +74 -21
- package/dist/node/builtin-plugins/tailwind-tokens.d.ts +5 -0
- package/dist/node/builtin-plugins/tailwind-tokens.js +510 -0
- package/dist/node/collect/index.js +3 -1
- package/dist/node/collect/worker.js +6 -2
- package/dist/node/commands/preview.js +4 -25
- package/dist/node/config.d.ts +103 -3
- package/dist/node/config.js +40 -23
- package/dist/node/context.d.ts +3 -3
- package/dist/node/context.js +1 -1
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +1 -0
- package/dist/node/load.d.ts +12 -0
- package/dist/node/load.js +42 -0
- package/dist/node/plugin.d.ts +67 -11
- package/dist/node/plugin.js +42 -245
- package/dist/node/preview.d.ts +8 -0
- package/dist/node/preview.js +41 -0
- package/dist/node/search.d.ts +2 -0
- package/dist/node/search.js +68 -0
- package/dist/node/server.js +43 -21
- package/dist/node/stories.d.ts +2 -0
- package/dist/node/stories.js +4 -4
- package/dist/node/types.d.ts +1 -0
- package/dist/node/util/find-up.d.ts +1 -0
- package/dist/node/util/find-up.js +20 -0
- package/dist/node/vite.d.ts +13 -0
- package/dist/node/vite.js +278 -0
- package/dist/style.css +174 -86
- package/package.json +7 -6
- package/scripts/copy.mjs +2 -1
- package/src/client/app/App.vue +8 -3
- package/src/client/app/codegen/const.ts +3 -0
- package/src/client/app/codegen/vue3.ts +80 -22
- package/src/client/app/components/base/BaseEmpty.vue +17 -1
- package/src/client/app/components/base/BaseOverflowMenu.vue +118 -0
- package/src/client/app/components/base/BaseOverflowTab.vue +46 -0
- package/src/client/app/components/exposed/Story.vue +33 -1
- package/src/client/app/components/exposed/Variant.vue +19 -1
- package/src/client/app/components/panel/PaneTabs.vue +64 -0
- package/src/client/app/components/{story → panel}/StoryControls.vue +6 -1
- package/src/client/app/components/{story → panel}/StoryDocs.vue +18 -11
- package/src/client/app/components/panel/StoryEvent.vue +53 -0
- package/src/client/app/components/panel/StoryEvents.vue +45 -0
- package/{dist/client/app/components/story → src/client/app/components/panel}/StorySidePanel.vue +17 -20
- package/{dist/client/app/components/story → src/client/app/components/panel}/StorySourceCode.vue +24 -14
- package/src/client/app/components/sandbox/SandboxVue3.vue +16 -4
- package/src/client/app/components/sandbox/lib.ts +3 -1
- package/src/client/app/components/search/SearchLoading.vue +16 -0
- package/src/client/app/components/search/SearchModal.vue +12 -149
- package/src/client/app/components/search/SearchPane.vue +210 -0
- package/src/client/app/components/search/search-data.ts +9 -0
- package/src/client/app/components/story/StoryResponsivePreview.vue +9 -98
- package/src/client/app/components/story/StoryVariantSingle.vue +109 -0
- package/src/client/app/components/story/StoryVariantSinglePreviewNative.vue +39 -0
- package/src/client/app/components/story/StoryVariantSinglePreviewRemote.vue +153 -0
- package/src/client/app/components/story/StoryVariantSingleView.vue +13 -6
- package/src/client/app/components/story/StoryView.vue +17 -3
- package/src/client/app/components/story/StoryViewer.vue +2 -92
- package/src/client/app/components/{story/toolbar → toolbar}/StoryVariantBackground.vue +3 -3
- package/{dist/client/app/components/story → src/client/app/components}/toolbar/StoryVariantNewTab.vue +2 -2
- package/src/client/app/components/{story/toolbar → toolbar}/StoryVariantResponsiveSize.vue +3 -3
- package/{dist/client/app/components/story → src/client/app/components}/toolbar/StoryVariantTitle.vue +1 -1
- package/src/client/app/components/tree/StoryGroup.vue +4 -4
- package/src/client/app/components/tree/StoryListFolder.vue +4 -4
- package/src/client/app/components/tree/StoryListItem.vue +4 -1
- package/src/client/app/router.ts +4 -1
- package/src/client/app/sandbox.ts +11 -1
- package/src/client/app/stores/events.ts +36 -0
- package/{dist/client/app/stores/story.ts → src/client/app/stores/folder.ts} +16 -23
- package/src/client/app/stores/story.ts +21 -40
- package/src/client/app/style/main.pcss +5 -0
- package/src/client/app/style/sandbox.css +2 -0
- package/src/client/app/style/transitions.pcss +13 -0
- package/src/client/app/types.ts +5 -0
- package/src/client/app/util/const.ts +1 -0
- package/src/client/app/util/events.ts +30 -0
- package/src/client/app/util/mapping.ts +4 -2
- package/src/client/index.ts +4 -3
- package/src/client/server/index.ts +14 -27
- package/{dist/client/server/Story.server.vue → src/client/server/vue3/Story.vue} +14 -3
- package/src/client/server/{Variant.server.vue → vue3/Variant.vue} +0 -0
- package/{dist/client/server/index.ts → src/client/server/vue3/run.ts} +10 -4
- package/src/node/alias.ts +4 -2
- package/src/node/build.ts +86 -21
- package/src/node/builtin-plugins/tailwind-tokens.ts +521 -0
- package/src/node/collect/index.ts +3 -1
- package/src/node/collect/worker.ts +7 -2
- package/src/node/commands/preview.ts +4 -33
- package/src/node/config.ts +53 -27
- package/src/node/context.ts +3 -3
- package/src/node/index.ts +1 -0
- package/src/node/load.ts +63 -0
- package/src/node/plugin.ts +75 -252
- package/src/node/preview.ts +56 -0
- package/src/node/search.ts +75 -0
- package/src/node/server.ts +49 -23
- package/src/node/stories.ts +4 -4
- package/src/node/types.ts +1 -0
- package/src/node/util/find-up.ts +24 -0
- package/src/node/vite.ts +296 -0
- package/tailwind.config.cjs +1 -0
- package/dist/client/app/codegen/serialize-js.ts +0 -119
- package/dist/client/app/codegen/util.ts +0 -79
- package/dist/client/app/codegen/vue3.ts +0 -276
- package/dist/client/app/components/sandbox/lib.ts +0 -8
- package/dist/client/app/global-components.ts +0 -13
- package/dist/client/app/index.ts +0 -28
- package/dist/client/app/router.ts +0 -17
- package/dist/client/app/sandbox.ts +0 -94
- package/dist/client/app/stores/preview-settings.ts +0 -17
- package/dist/client/app/types.ts +0 -78
- package/dist/client/app/util/config.ts +0 -6
- package/dist/client/app/util/const.ts +0 -3
- package/dist/client/app/util/dark.ts +0 -4
- package/dist/client/app/util/env.ts +0 -1
- package/dist/client/app/util/keyboard.ts +0 -99
- package/dist/client/app/util/mapping.ts +0 -48
- package/dist/client/app/util/preview-settings.ts +0 -8
- package/dist/client/app/util/reactivity.ts +0 -22
- package/dist/client/app/util/responsive.ts +0 -3
- package/dist/client/app/util/scroll.ts +0 -31
- package/dist/client/app/util/tooltip.ts +0 -13
- package/dist/client/app/util/variant.ts +0 -20
- package/dist/client/index.ts +0 -12
- package/dist/client/shim.d.ts +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Story } from '../types';
|
|
1
|
+
import { Story, Variant } from '../types';
|
|
2
2
|
export declare const useStoryStore: import("pinia").StoreDefinition<"story", import("pinia")._UnwrapAll<Pick<{
|
|
3
3
|
stories: import("vue").Ref<{
|
|
4
4
|
id: string;
|
|
@@ -10,6 +10,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
10
10
|
icon?: string;
|
|
11
11
|
iconColor?: string;
|
|
12
12
|
initState?: () => any;
|
|
13
|
+
setupApp?: (payload: any) => unknown;
|
|
13
14
|
slots?: () => Readonly<any>;
|
|
14
15
|
state?: any;
|
|
15
16
|
source?: string;
|
|
@@ -19,12 +20,14 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
19
20
|
}[];
|
|
20
21
|
layout?: {
|
|
21
22
|
type: "single";
|
|
23
|
+
iframe?: boolean;
|
|
22
24
|
} | {
|
|
23
25
|
type: "grid";
|
|
24
26
|
width?: string | number;
|
|
25
27
|
};
|
|
26
28
|
icon?: string;
|
|
27
29
|
iconColor?: string;
|
|
30
|
+
docsOnly?: boolean;
|
|
28
31
|
file?: {
|
|
29
32
|
id: string;
|
|
30
33
|
framework: string;
|
|
@@ -38,6 +41,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
38
41
|
icon?: string;
|
|
39
42
|
iconColor?: string;
|
|
40
43
|
initState?: () => any;
|
|
44
|
+
setupApp?: (payload: any) => unknown;
|
|
41
45
|
slots?: () => Readonly<any>;
|
|
42
46
|
state?: any;
|
|
43
47
|
source?: string;
|
|
@@ -45,6 +49,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
45
49
|
configReady?: boolean;
|
|
46
50
|
previewReady?: boolean;
|
|
47
51
|
};
|
|
52
|
+
slots?: () => Readonly<any>;
|
|
48
53
|
}[]>;
|
|
49
54
|
setStories: (value: Story[]) => void;
|
|
50
55
|
currentStory: import("vue").ComputedRef<{
|
|
@@ -57,6 +62,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
57
62
|
icon?: string;
|
|
58
63
|
iconColor?: string;
|
|
59
64
|
initState?: () => any;
|
|
65
|
+
setupApp?: (payload: any) => unknown;
|
|
60
66
|
slots?: () => Readonly<any>;
|
|
61
67
|
state?: any;
|
|
62
68
|
source?: string;
|
|
@@ -66,12 +72,14 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
66
72
|
}[];
|
|
67
73
|
layout?: {
|
|
68
74
|
type: "single";
|
|
75
|
+
iframe?: boolean;
|
|
69
76
|
} | {
|
|
70
77
|
type: "grid";
|
|
71
78
|
width?: string | number;
|
|
72
79
|
};
|
|
73
80
|
icon?: string;
|
|
74
81
|
iconColor?: string;
|
|
82
|
+
docsOnly?: boolean;
|
|
75
83
|
file?: {
|
|
76
84
|
id: string;
|
|
77
85
|
framework: string;
|
|
@@ -85,6 +93,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
85
93
|
icon?: string;
|
|
86
94
|
iconColor?: string;
|
|
87
95
|
initState?: () => any;
|
|
96
|
+
setupApp?: (payload: any) => unknown;
|
|
88
97
|
slots?: () => Readonly<any>;
|
|
89
98
|
state?: any;
|
|
90
99
|
source?: string;
|
|
@@ -92,6 +101,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
92
101
|
configReady?: boolean;
|
|
93
102
|
previewReady?: boolean;
|
|
94
103
|
};
|
|
104
|
+
slots?: () => Readonly<any>;
|
|
95
105
|
}>;
|
|
96
106
|
currentVariant: import("vue").ComputedRef<{
|
|
97
107
|
id: string;
|
|
@@ -99,6 +109,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
99
109
|
icon?: string;
|
|
100
110
|
iconColor?: string;
|
|
101
111
|
initState?: () => any;
|
|
112
|
+
setupApp?: (payload: any) => unknown;
|
|
102
113
|
slots?: () => Readonly<any>;
|
|
103
114
|
state?: any;
|
|
104
115
|
source?: string;
|
|
@@ -106,8 +117,8 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
106
117
|
configReady?: boolean;
|
|
107
118
|
previewReady?: boolean;
|
|
108
119
|
}>;
|
|
109
|
-
|
|
110
|
-
|
|
120
|
+
getStoryById: (id: string) => Story;
|
|
121
|
+
getVariantById: (idWithStoryId: string) => Variant;
|
|
111
122
|
}, "stories">>, import("pinia")._UnwrapAll<Pick<{
|
|
112
123
|
stories: import("vue").Ref<{
|
|
113
124
|
id: string;
|
|
@@ -119,6 +130,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
119
130
|
icon?: string;
|
|
120
131
|
iconColor?: string;
|
|
121
132
|
initState?: () => any;
|
|
133
|
+
setupApp?: (payload: any) => unknown;
|
|
122
134
|
slots?: () => Readonly<any>;
|
|
123
135
|
state?: any;
|
|
124
136
|
source?: string;
|
|
@@ -128,12 +140,14 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
128
140
|
}[];
|
|
129
141
|
layout?: {
|
|
130
142
|
type: "single";
|
|
143
|
+
iframe?: boolean;
|
|
131
144
|
} | {
|
|
132
145
|
type: "grid";
|
|
133
146
|
width?: string | number;
|
|
134
147
|
};
|
|
135
148
|
icon?: string;
|
|
136
149
|
iconColor?: string;
|
|
150
|
+
docsOnly?: boolean;
|
|
137
151
|
file?: {
|
|
138
152
|
id: string;
|
|
139
153
|
framework: string;
|
|
@@ -147,6 +161,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
147
161
|
icon?: string;
|
|
148
162
|
iconColor?: string;
|
|
149
163
|
initState?: () => any;
|
|
164
|
+
setupApp?: (payload: any) => unknown;
|
|
150
165
|
slots?: () => Readonly<any>;
|
|
151
166
|
state?: any;
|
|
152
167
|
source?: string;
|
|
@@ -154,6 +169,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
154
169
|
configReady?: boolean;
|
|
155
170
|
previewReady?: boolean;
|
|
156
171
|
};
|
|
172
|
+
slots?: () => Readonly<any>;
|
|
157
173
|
}[]>;
|
|
158
174
|
setStories: (value: Story[]) => void;
|
|
159
175
|
currentStory: import("vue").ComputedRef<{
|
|
@@ -166,6 +182,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
166
182
|
icon?: string;
|
|
167
183
|
iconColor?: string;
|
|
168
184
|
initState?: () => any;
|
|
185
|
+
setupApp?: (payload: any) => unknown;
|
|
169
186
|
slots?: () => Readonly<any>;
|
|
170
187
|
state?: any;
|
|
171
188
|
source?: string;
|
|
@@ -175,12 +192,14 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
175
192
|
}[];
|
|
176
193
|
layout?: {
|
|
177
194
|
type: "single";
|
|
195
|
+
iframe?: boolean;
|
|
178
196
|
} | {
|
|
179
197
|
type: "grid";
|
|
180
198
|
width?: string | number;
|
|
181
199
|
};
|
|
182
200
|
icon?: string;
|
|
183
201
|
iconColor?: string;
|
|
202
|
+
docsOnly?: boolean;
|
|
184
203
|
file?: {
|
|
185
204
|
id: string;
|
|
186
205
|
framework: string;
|
|
@@ -194,6 +213,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
194
213
|
icon?: string;
|
|
195
214
|
iconColor?: string;
|
|
196
215
|
initState?: () => any;
|
|
216
|
+
setupApp?: (payload: any) => unknown;
|
|
197
217
|
slots?: () => Readonly<any>;
|
|
198
218
|
state?: any;
|
|
199
219
|
source?: string;
|
|
@@ -201,6 +221,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
201
221
|
configReady?: boolean;
|
|
202
222
|
previewReady?: boolean;
|
|
203
223
|
};
|
|
224
|
+
slots?: () => Readonly<any>;
|
|
204
225
|
}>;
|
|
205
226
|
currentVariant: import("vue").ComputedRef<{
|
|
206
227
|
id: string;
|
|
@@ -208,6 +229,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
208
229
|
icon?: string;
|
|
209
230
|
iconColor?: string;
|
|
210
231
|
initState?: () => any;
|
|
232
|
+
setupApp?: (payload: any) => unknown;
|
|
211
233
|
slots?: () => Readonly<any>;
|
|
212
234
|
state?: any;
|
|
213
235
|
source?: string;
|
|
@@ -215,8 +237,8 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
215
237
|
configReady?: boolean;
|
|
216
238
|
previewReady?: boolean;
|
|
217
239
|
}>;
|
|
218
|
-
|
|
219
|
-
|
|
240
|
+
getStoryById: (id: string) => Story;
|
|
241
|
+
getVariantById: (idWithStoryId: string) => Variant;
|
|
220
242
|
}, "currentStory" | "currentVariant">>, Pick<{
|
|
221
243
|
stories: import("vue").Ref<{
|
|
222
244
|
id: string;
|
|
@@ -228,6 +250,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
228
250
|
icon?: string;
|
|
229
251
|
iconColor?: string;
|
|
230
252
|
initState?: () => any;
|
|
253
|
+
setupApp?: (payload: any) => unknown;
|
|
231
254
|
slots?: () => Readonly<any>;
|
|
232
255
|
state?: any;
|
|
233
256
|
source?: string;
|
|
@@ -237,12 +260,14 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
237
260
|
}[];
|
|
238
261
|
layout?: {
|
|
239
262
|
type: "single";
|
|
263
|
+
iframe?: boolean;
|
|
240
264
|
} | {
|
|
241
265
|
type: "grid";
|
|
242
266
|
width?: string | number;
|
|
243
267
|
};
|
|
244
268
|
icon?: string;
|
|
245
269
|
iconColor?: string;
|
|
270
|
+
docsOnly?: boolean;
|
|
246
271
|
file?: {
|
|
247
272
|
id: string;
|
|
248
273
|
framework: string;
|
|
@@ -256,6 +281,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
256
281
|
icon?: string;
|
|
257
282
|
iconColor?: string;
|
|
258
283
|
initState?: () => any;
|
|
284
|
+
setupApp?: (payload: any) => unknown;
|
|
259
285
|
slots?: () => Readonly<any>;
|
|
260
286
|
state?: any;
|
|
261
287
|
source?: string;
|
|
@@ -263,6 +289,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
263
289
|
configReady?: boolean;
|
|
264
290
|
previewReady?: boolean;
|
|
265
291
|
};
|
|
292
|
+
slots?: () => Readonly<any>;
|
|
266
293
|
}[]>;
|
|
267
294
|
setStories: (value: Story[]) => void;
|
|
268
295
|
currentStory: import("vue").ComputedRef<{
|
|
@@ -275,6 +302,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
275
302
|
icon?: string;
|
|
276
303
|
iconColor?: string;
|
|
277
304
|
initState?: () => any;
|
|
305
|
+
setupApp?: (payload: any) => unknown;
|
|
278
306
|
slots?: () => Readonly<any>;
|
|
279
307
|
state?: any;
|
|
280
308
|
source?: string;
|
|
@@ -284,12 +312,14 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
284
312
|
}[];
|
|
285
313
|
layout?: {
|
|
286
314
|
type: "single";
|
|
315
|
+
iframe?: boolean;
|
|
287
316
|
} | {
|
|
288
317
|
type: "grid";
|
|
289
318
|
width?: string | number;
|
|
290
319
|
};
|
|
291
320
|
icon?: string;
|
|
292
321
|
iconColor?: string;
|
|
322
|
+
docsOnly?: boolean;
|
|
293
323
|
file?: {
|
|
294
324
|
id: string;
|
|
295
325
|
framework: string;
|
|
@@ -303,6 +333,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
303
333
|
icon?: string;
|
|
304
334
|
iconColor?: string;
|
|
305
335
|
initState?: () => any;
|
|
336
|
+
setupApp?: (payload: any) => unknown;
|
|
306
337
|
slots?: () => Readonly<any>;
|
|
307
338
|
state?: any;
|
|
308
339
|
source?: string;
|
|
@@ -310,6 +341,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
310
341
|
configReady?: boolean;
|
|
311
342
|
previewReady?: boolean;
|
|
312
343
|
};
|
|
344
|
+
slots?: () => Readonly<any>;
|
|
313
345
|
}>;
|
|
314
346
|
currentVariant: import("vue").ComputedRef<{
|
|
315
347
|
id: string;
|
|
@@ -317,6 +349,7 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
317
349
|
icon?: string;
|
|
318
350
|
iconColor?: string;
|
|
319
351
|
initState?: () => any;
|
|
352
|
+
setupApp?: (payload: any) => unknown;
|
|
320
353
|
slots?: () => Readonly<any>;
|
|
321
354
|
state?: any;
|
|
322
355
|
source?: string;
|
|
@@ -324,6 +357,6 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
324
357
|
configReady?: boolean;
|
|
325
358
|
previewReady?: boolean;
|
|
326
359
|
}>;
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}, "setStories" | "
|
|
360
|
+
getStoryById: (id: string) => Story;
|
|
361
|
+
getVariantById: (idWithStoryId: string) => Variant;
|
|
362
|
+
}, "setStories" | "getStoryById" | "getVariantById">>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineStore } from 'pinia';
|
|
2
|
-
import { computed, ref
|
|
2
|
+
import { computed, ref } from 'vue';
|
|
3
3
|
import { router } from '../router';
|
|
4
|
-
import { useStorage } from '@vueuse/core';
|
|
5
4
|
export const useStoryStore = defineStore('story', () => {
|
|
6
5
|
const stories = ref([]);
|
|
7
6
|
function setStories(value) {
|
|
@@ -9,44 +8,33 @@ export const useStoryStore = defineStore('story', () => {
|
|
|
9
8
|
}
|
|
10
9
|
const currentStory = computed(() => stories.value.find(s => s.id === router.currentRoute.value.params.storyId));
|
|
11
10
|
const currentVariant = computed(() => currentStory.value?.variants.find(v => v.id === router.currentRoute.value.query.variantId));
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
openedFolders.value.set(stringPath, defaultToggleValue);
|
|
21
|
-
}
|
|
22
|
-
else if (currentValue) {
|
|
23
|
-
openedFolders.value.set(stringPath, false);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
openedFolders.value.set(stringPath, true);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function isFolderOpened(path, defaultValue = false) {
|
|
30
|
-
const value = openedFolders.value.get(getStringPath(path));
|
|
31
|
-
if (value == null) {
|
|
32
|
-
return defaultValue;
|
|
11
|
+
const maps = computed(() => {
|
|
12
|
+
const storyMap = new Map();
|
|
13
|
+
const variantMap = new Map();
|
|
14
|
+
for (const story of stories.value) {
|
|
15
|
+
storyMap.set(story.id, story);
|
|
16
|
+
for (const variant of story.variants) {
|
|
17
|
+
variantMap.set(`${story.id}:${variant.id}`, variant);
|
|
18
|
+
}
|
|
33
19
|
}
|
|
34
|
-
return
|
|
20
|
+
return {
|
|
21
|
+
stories: storyMap,
|
|
22
|
+
variants: variantMap,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
function getStoryById(id) {
|
|
26
|
+
return maps.value.stories.get(id);
|
|
35
27
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
toggleFolder(path.slice(0, pathLength), true);
|
|
39
|
-
}
|
|
28
|
+
function getVariantById(idWithStoryId) {
|
|
29
|
+
return maps.value.variants.get(idWithStoryId);
|
|
40
30
|
}
|
|
41
|
-
watch(currentStory, () => {
|
|
42
|
-
openFileFolders(currentStory.value.file.path);
|
|
43
|
-
});
|
|
44
31
|
return {
|
|
45
32
|
stories,
|
|
46
33
|
setStories,
|
|
47
34
|
currentStory,
|
|
48
35
|
currentVariant,
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
getStoryById,
|
|
37
|
+
getVariantById,
|
|
51
38
|
};
|
|
52
39
|
});
|
|
40
|
+
//# sourceMappingURL=story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"story.js","sourceRoot":"","sources":["../../../../src/client/app/stores/story.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAGlC,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE;IACrD,MAAM,OAAO,GAAG,GAAG,CAAU,EAAE,CAAC,CAAA;IAChC,SAAS,UAAU,CAAE,KAAc;QACjC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAA;IACvB,CAAC;IAED,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,YAAY,CA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https://fonts.googleapis.com/css2?family=Lato&display=swap');
|
|
2
2
|
@import 'floating-vue/dist/style.css';
|
|
3
|
+
@import '@histoire/controls/dist/style.css';
|
|
3
4
|
|
|
4
5
|
@import 'floating-vue.pcss';
|
|
5
6
|
@import 'transitions.pcss';
|
|
@@ -78,4 +79,8 @@ body {
|
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
}
|
|
82
|
+
|
|
83
|
+
hr {
|
|
84
|
+
margin: 1rem 0;
|
|
85
|
+
}
|
|
81
86
|
}
|
|
@@ -11,6 +11,19 @@
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
.__histoire-scale-y {
|
|
15
|
+
&-enter-active,
|
|
16
|
+
&-leave-active {
|
|
17
|
+
transition: transform .15s, opacity .15s;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&-enter-from,
|
|
21
|
+
&-leave-to {
|
|
22
|
+
transform: scaleY(0);
|
|
23
|
+
opacity: 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
14
27
|
.__histoire-fade {
|
|
15
28
|
&-enter-active,
|
|
16
29
|
&-leave-active {
|
|
@@ -13,14 +13,17 @@ export interface Story {
|
|
|
13
13
|
variants: Variant[];
|
|
14
14
|
layout?: {
|
|
15
15
|
type: 'single';
|
|
16
|
+
iframe?: boolean;
|
|
16
17
|
} | {
|
|
17
18
|
type: 'grid';
|
|
18
19
|
width?: number | string;
|
|
19
20
|
};
|
|
20
21
|
icon?: string;
|
|
21
22
|
iconColor?: string;
|
|
23
|
+
docsOnly?: boolean;
|
|
22
24
|
file?: StoryFile;
|
|
23
25
|
lastSelectedVariant?: Variant;
|
|
26
|
+
slots?: () => Readonly<any>;
|
|
24
27
|
}
|
|
25
28
|
export interface Variant {
|
|
26
29
|
id: string;
|
|
@@ -28,6 +31,7 @@ export interface Variant {
|
|
|
28
31
|
icon?: string;
|
|
29
32
|
iconColor?: string;
|
|
30
33
|
initState?: () => any;
|
|
34
|
+
setupApp?: (payload: any) => unknown;
|
|
31
35
|
slots?: () => Readonly<any>;
|
|
32
36
|
state?: any;
|
|
33
37
|
source?: string;
|
package/dist/client/app/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/client/app/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hstEvent(name: string, argument: any): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useEventsStore } from '../stores/events.js';
|
|
2
|
+
import { EVENT_SEND } from './const';
|
|
3
|
+
export function hstEvent(name, argument) {
|
|
4
|
+
console.log('[histoire] Event fired', { name, argument });
|
|
5
|
+
const event = {
|
|
6
|
+
name,
|
|
7
|
+
argument: JSON.parse(stringifyEvent(argument)), // Needed for HTMLEvent that can't be cloned
|
|
8
|
+
};
|
|
9
|
+
if (location.href.includes('__sandbox')) {
|
|
10
|
+
window.parent?.postMessage({
|
|
11
|
+
type: EVENT_SEND,
|
|
12
|
+
event,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
useEventsStore().addEvent(event);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function stringifyEvent(e) {
|
|
20
|
+
const obj = {};
|
|
21
|
+
for (const k in e) {
|
|
22
|
+
obj[k] = e[k];
|
|
23
|
+
}
|
|
24
|
+
return JSON.stringify(obj, (k, v) => {
|
|
25
|
+
if (v instanceof Node)
|
|
26
|
+
return 'Node';
|
|
27
|
+
if (v instanceof Window)
|
|
28
|
+
return 'Window';
|
|
29
|
+
return v;
|
|
30
|
+
}, ' ');
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../../src/client/app/util/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBA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S,EAAE;YAC7B,OAAO,KAAK,CAAA;SACb;KACF;IACD,OAAO,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AACnC,CAAC;AAED,MAAM,UAAU,SAAS,CAAE,GAAW;IACpC,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IACvB,IAAI,GAAG,KAAK,MAAM,EAAE;QAClB,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAA;KAC5B;IACD,IAAI,GAAG,KAAK,KAAK,EAAE;QACjB,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAA;KAC3B;IACD,IAAI,GAAG,KAAK,OAAO,EAAE;QACnB,OAAO,GAAG,CAAA;KACX;IACD,IAAI,GAAG,KAAK,MAAM,EAAE;QAClB,OAAO,GAAG,CAAA;KACX;IACD,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;AACrE,CAAC"}
|
|
@@ -8,6 +8,7 @@ export function mapFile(file, existingFile) {
|
|
|
8
8
|
title: file.story.title,
|
|
9
9
|
file: markRaw(file),
|
|
10
10
|
variants: file.story.variants.map(v => mapVariant(v)),
|
|
11
|
+
slots: () => ({}),
|
|
11
12
|
},
|
|
12
13
|
};
|
|
13
14
|
if (existingFile) {
|
|
@@ -18,7 +19,7 @@ export function mapFile(file, existingFile) {
|
|
|
18
19
|
for (const key in existingVariant) {
|
|
19
20
|
if (typeof existingVariant[key] !== 'undefined') {
|
|
20
21
|
if (key === 'state') {
|
|
21
|
-
|
|
22
|
+
variant.state = existingVariant.state;
|
|
22
23
|
continue;
|
|
23
24
|
}
|
|
24
25
|
variant[key] = existingVariant[key];
|
|
@@ -35,9 +36,11 @@ export function mapFile(file, existingFile) {
|
|
|
35
36
|
export function mapVariant(variant) {
|
|
36
37
|
return {
|
|
37
38
|
...variant,
|
|
38
|
-
state:
|
|
39
|
+
state: null,
|
|
39
40
|
initState: null,
|
|
41
|
+
setupApp: null,
|
|
40
42
|
slots: () => ({}),
|
|
41
43
|
previewReady: false,
|
|
42
44
|
};
|
|
43
45
|
}
|
|
46
|
+
//# sourceMappingURL=mapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["../../../../src/client/app/util/mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAG7B,MAAM,UAAU,OAAO,CAAE,IAAe,EAAE,YAAwB;IAChE,MAAM,MAAM,GAAc;QACxB,GAAG,IAAI;QACP,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC;QAClC,KAAK,EAAE;YACL,GAAG,IAAI,CAAC,KAAK;YACb,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACvB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC;YACnB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACrD,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;SAClB;KACF,CAAA;IAED,IAAI,YAAY,EAAE;QAChB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE;YACzC,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;YAC5C,MAAM,eAAe,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;YAC1D,IAAI,eAAe,EAAE;gBACnB,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE;oBACjC,IAAI,OAAO,eAAe,CAAC,GAAG,CAAC,KAAK,WAAW,EAAE;wBAC/C,IAAI,GAAG,KAAK,OAAO,EAAE;4BACnB,OAAO,CAAC,KAAK,GAAG,eAAe,CAAC,KAAK,CAAA;4BACrC,SAAQ;yBACT;wBACD,OAAO,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,CAAA;qBACpC;iBACF;aACF;SACF;QACD,IAAI,YAAY,CAAC,KAAK,CAAC,mBAAmB,EAAE;YAC1C,MAAM,CAAC,KAAK,CAAC,mBAAmB,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,YAAY,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAA;SACvH;KACF;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED,MAAM,UAAU,UAAU,CAAE,OAAgB;IAC1C,OAAO;QACL,GAAG,OAAO;QACV,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;QACjB,YAAY,EAAE,KAAK;KACpB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-settings.js","sourceRoot":"","sources":["../../../../src/client/app/util/preview-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAG9B,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAkB,EAAqB,CAAC,CAAA;AAEhF,MAAM,UAAU,oBAAoB,CAAE,QAAyB;IAC7D,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAA;AAC3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactivity.js","sourceRoot":"","sources":["../../../../src/client/app/util/reactivity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM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,IAAI,EAAE,CAAC,KAAK,EAAE;YACZ,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE;gBACvB,UAAU,EAAE,WAAW;gBACvB,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,SAAS;gBACjB,QAAQ,EAAE,QAAQ;aACnB,CAAC,CAAA;SACH;IACH,CAAC;IAED,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,CAAC,KAAK,EAAE;YAChB,UAAU,EAAE,CAAA;SACb;IACH,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,UAAU;KACX,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variant.js","sourceRoot":"","sources":["../../../../src/client/app/util/variant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAO,MAAM,KAAK,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC,MAAM,UAAU,sBAAsB,CAAE,OAAqB;IAC3D,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,KAAK,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAC3E,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;QAClC,GAAG,KAAK;QACR,KAAK,EAAE;YACL,GAAG,KAAK,CAAC,KAAK;YACd,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE;SAC5B;KACF,CAAC,CAAC,CAAA;IAEH,OAAO;QACL,QAAQ;QACR,WAAW;KACZ,CAAA;AACH,CAAC"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { App } from 'vue';
|
|
2
2
|
import type { Story, Variant } from './app/types.js';
|
|
3
|
+
export { hstEvent } from './app/util/events';
|
|
3
4
|
export declare type Vue3StorySetupHandler = (payload: {
|
|
4
5
|
app: App;
|
|
5
|
-
story
|
|
6
|
-
variant
|
|
6
|
+
story?: Story;
|
|
7
|
+
variant?: Variant;
|
|
7
8
|
}) => Promise<void> | void;
|
|
8
|
-
export declare function
|
|
9
|
+
export declare function defineSetupVue3(handler: Vue3StorySetupHandler): Vue3StorySetupHandler;
|
package/dist/client/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAQ5C,MAAM,UAAU,eAAe,CAAE,OAA8B;IAC7D,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import type { StoryFile } from '../../node/types';
|
|
2
|
-
export
|
|
1
|
+
import type { StoryFile, Story } from '../../node/types';
|
|
2
|
+
export interface ServerRunPayload {
|
|
3
|
+
file: StoryFile;
|
|
4
|
+
storyData: Story[];
|
|
5
|
+
el: HTMLElement;
|
|
6
|
+
}
|
|
7
|
+
export declare function run(payload: ServerRunPayload): Promise<any>;
|