histoire 0.7.7 → 0.8.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.
- package/dist/bundled/App.js +166 -0
- package/dist/bundled/_virtual/plugin-vue_export-helper.js +8 -0
- package/dist/bundled/api.js +1 -32
- package/dist/bundled/assets/histoire-text-dark.js +2 -0
- package/dist/bundled/assets/histoire-text.js +2 -0
- package/dist/bundled/{HomeView.js → assets/histoire.js} +1 -23
- package/dist/bundled/components/HomeView.js +24 -0
- package/dist/bundled/components/app/AppHeader.js +67 -0
- package/dist/bundled/components/app/AppLogo.js +26 -0
- package/dist/bundled/components/app/Breadcrumb.js +95 -0
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/app/InitialLoading.js +48 -0
- package/dist/bundled/components/app/MobileOverlay.js +41 -0
- package/dist/bundled/components/base/BaseCheckbox.js +75 -0
- package/dist/bundled/{BaseEmpty.js → components/base/BaseEmpty.js} +4 -4
- package/dist/bundled/components/base/BaseEmpty.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/base/BaseListItemLink.js +50 -0
- package/dist/bundled/components/base/BaseOverflowMenu.js +97 -0
- package/dist/bundled/components/base/BaseOverflowTab.js +45 -0
- package/dist/bundled/components/base/BaseSelect.js +88 -0
- package/dist/bundled/{MobileOverlay.js → components/base/BaseSplitPane.js} +9 -130
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/base/BaseTab.js +45 -0
- package/dist/bundled/components/misc/CheckerboardPattern.js +41 -0
- package/dist/bundled/components/misc/HatchedPattern.js +11 -0
- package/dist/bundled/components/misc/HatchedPattern.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/panel/ControlsComponentPropItem.js +98 -0
- package/dist/bundled/components/panel/ControlsComponentProps.js +42 -0
- package/dist/bundled/components/panel/PaneTabs.js +110 -0
- package/dist/bundled/components/panel/StatePresets.js +184 -0
- package/dist/bundled/components/panel/StoryControls.js +66 -0
- package/dist/bundled/components/panel/StoryDocs.js +48 -0
- package/dist/bundled/components/panel/StoryEvent.js +56 -0
- package/dist/bundled/components/panel/StoryEvents.js +49 -0
- package/dist/bundled/components/panel/StorySidePanel.js +68 -0
- package/dist/bundled/components/panel/StorySourceCode.js +110 -0
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/search/SearchItem.js +113 -0
- package/dist/bundled/components/search/SearchItem.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/search/SearchLoading.js +19 -0
- package/dist/bundled/components/search/SearchModal.js +46 -0
- package/dist/bundled/components/search/SearchPane.js +263 -0
- package/dist/bundled/{search-docs-data.js → components/search/search-docs-data.js} +1 -1
- package/dist/bundled/components/search/search-title-data.js +7 -0
- package/dist/bundled/components/story/StoryResponsivePreview.js +180 -0
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/story/StoryVariantGrid.js +94 -0
- package/dist/bundled/components/story/StoryVariantGridItem.js +106 -0
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/story/StoryVariantListItem.js +58 -0
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/story/StoryVariantSingle.js +115 -0
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.js +43 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.js +119 -0
- package/dist/bundled/components/story/StoryVariantSingleView.js +49 -0
- package/dist/bundled/components/story/StoryView.js +107 -0
- package/dist/bundled/components/story/StoryViewer.js +57 -0
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/toolbar/StoryVariantBackground.js +85 -0
- package/dist/bundled/components/toolbar/StoryVariantBackground.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/toolbar/StoryVariantNewTab.js +33 -0
- package/dist/bundled/components/toolbar/StoryVariantResponsiveSize.js +129 -0
- package/dist/bundled/components/toolbar/StoryVariantTitle.js +24 -0
- package/dist/bundled/components/tree/StoryGroup.js +74 -0
- package/dist/bundled/components/tree/StoryList.js +37 -0
- package/dist/bundled/components/tree/StoryListFolder.js +89 -0
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/components/tree/StoryListItem.js +72 -0
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/dist/bundled/index.js +28 -5
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/common.js +40 -0
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/en.js +5 -0
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/advanced.js +11 -0
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/balance.js +26 -0
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/simple.js +10 -0
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang.js +50 -0
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/type.js +8 -0
- package/dist/bundled/router.js +28 -0
- package/dist/bundled/sandbox.js +11 -14
- package/dist/bundled/{events.js → stores/events.js} +3 -3
- package/dist/bundled/stores/folder.js +46 -0
- package/dist/bundled/stores/preview-settings.js +15 -0
- package/dist/bundled/{story.js → stores/story.js} +4 -30
- package/dist/bundled/style.css +56 -56
- package/dist/bundled/{config.js → util/config.js} +1 -1
- package/dist/bundled/{const.js → util/const.js} +1 -1
- package/dist/bundled/util/dark.js +4 -0
- package/dist/bundled/util/env.js +2 -0
- package/dist/bundled/util/events.js +32 -0
- package/dist/bundled/util/keyboard.js +84 -0
- package/dist/bundled/{mapping.js → util/mapping.js} +5 -5
- package/dist/bundled/util/preview-settings.js +6 -0
- package/dist/bundled/util/responsive.js +3 -0
- package/dist/bundled/util/sandbox.js +8 -0
- package/dist/bundled/util/scroll.js +28 -0
- package/dist/bundled/{state.js → util/state.js} +4 -3
- package/dist/bundled/util/tooltip.js +12 -0
- package/dist/bundled/util/variant.js +35 -0
- package/dist/client/app/App.vue +0 -1
- package/dist/client/app/components/app/Breadcrumb.vue +1 -1
- package/dist/client/app/components/app/MobileOverlay.vue +1 -1
- package/dist/client/app/components/base/BaseCheckbox.vue +2 -1
- package/dist/client/app/components/base/BaseCopyIcon.vue +34 -0
- package/dist/client/app/components/base/BaseOverflowMenu.vue +1 -0
- package/dist/client/app/components/base/BaseSplitPane.vue +1 -0
- package/dist/client/app/components/panel/StatePresets.vue +3 -3
- package/dist/client/app/components/panel/StorySidePanel.vue +1 -1
- package/dist/client/app/components/story/StoryVariantGridItem.vue +1 -0
- package/dist/client/app/components/story/StoryVariantSingle.vue +5 -7
- package/dist/client/app/components/story/StoryVariantSinglePreviewRemote.vue +3 -6
- package/dist/client/app/components/story/StoryViewer.vue +2 -2
- package/dist/client/app/components/tree/StoryList.vue +1 -1
- package/dist/client/app/components/tree/StoryListItem.vue +2 -2
- package/dist/client/app/index.js +1 -3
- package/dist/client/app/sandbox.js +3 -2
- package/dist/client/app/stores/story.d.ts +30 -30
- package/dist/client/app/util/dark.d.ts +1 -1
- package/dist/client/app/util/mapping.js +3 -3
- package/dist/client/app/util/responsive.d.ts +1 -1
- package/dist/client/app/util/scroll.js +1 -1
- package/dist/client/app/util/state.js +2 -1
- package/dist/node/build.js +8 -1
- package/dist/node/commands/dev.js +1 -1
- package/dist/node/server.js +5 -4
- package/dist/node/util/log.d.ts +1 -0
- package/dist/node/util/log.js +9 -0
- package/dist/node/vite.d.ts +1 -1
- package/dist/node/vite.js +5 -3
- package/dist/style.css +21 -0
- package/index.d.ts +0 -2
- package/package.json +8 -15
- package/src/client/app/App.vue +0 -1
- package/src/client/app/components/app/Breadcrumb.vue +1 -1
- package/src/client/app/components/app/MobileOverlay.vue +1 -1
- package/src/client/app/components/base/BaseCheckbox.vue +2 -1
- package/src/client/app/components/base/BaseCopyIcon.vue +34 -0
- package/src/client/app/components/base/BaseOverflowMenu.vue +1 -0
- package/src/client/app/components/base/BaseSplitPane.vue +1 -0
- package/src/client/app/components/panel/StatePresets.vue +3 -3
- package/src/client/app/components/panel/StorySidePanel.vue +1 -1
- package/src/client/app/components/story/StoryVariantGridItem.vue +1 -0
- package/src/client/app/components/story/StoryVariantSingle.vue +5 -7
- package/src/client/app/components/story/StoryVariantSinglePreviewRemote.vue +3 -6
- package/src/client/app/components/story/StoryViewer.vue +2 -2
- package/src/client/app/components/tree/StoryList.vue +1 -1
- package/src/client/app/components/tree/StoryListItem.vue +2 -2
- package/src/client/app/index.ts +1 -5
- package/src/client/app/sandbox.ts +3 -2
- package/src/client/app/util/mapping.ts +3 -3
- package/src/client/app/util/scroll.ts +1 -1
- package/src/client/app/util/state.ts +2 -1
- package/src/node/build.ts +13 -3
- package/src/node/commands/dev.ts +1 -1
- package/src/node/server.ts +5 -4
- package/src/node/util/log.ts +9 -0
- package/src/node/vite.ts +5 -3
- package/tsconfig.json +12 -0
- package/vite.config.ts +21 -10
- package/vue.d.ts +1 -0
- package/dist/bundled/SearchPane.js +0 -506
- package/dist/bundled/StoryView.js +0 -2264
- package/dist/bundled/dark.js +0 -4
- package/dist/bundled/index2.js +0 -843
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
import { useStoryStore } from '../../stores/story'
|
|
4
4
|
import { Icon } from '@iconify/vue'
|
|
5
5
|
import { isMobile } from '../../util/responsive'
|
|
@@ -20,12 +20,11 @@ const variant = computed(() => storyStore.currentVariant)
|
|
|
20
20
|
|
|
21
21
|
<template>
|
|
22
22
|
<div
|
|
23
|
-
v-if="hasSingleVariant &&
|
|
23
|
+
v-if="hasSingleVariant && variant"
|
|
24
24
|
class="htw-p-2 htw-h-full"
|
|
25
25
|
>
|
|
26
26
|
<StoryVariantSingleView
|
|
27
|
-
|
|
28
|
-
:variant="storyStore.currentVariant"
|
|
27
|
+
:variant="variant"
|
|
29
28
|
:story="storyStore.currentStory"
|
|
30
29
|
/>
|
|
31
30
|
</div>
|
|
@@ -63,7 +62,6 @@ const variant = computed(() => storyStore.currentVariant)
|
|
|
63
62
|
class="htw-p-2 htw-h-full"
|
|
64
63
|
>
|
|
65
64
|
<StoryVariantSingleView
|
|
66
|
-
v-if="storyStore.currentVariant.configReady"
|
|
67
65
|
:variant="storyStore.currentVariant"
|
|
68
66
|
:story="storyStore.currentStory"
|
|
69
67
|
/>
|
|
@@ -79,9 +77,9 @@ const variant = computed(() => storyStore.currentVariant)
|
|
|
79
77
|
<template #first>
|
|
80
78
|
<div class="htw-h-full htw-overflow-y-auto">
|
|
81
79
|
<StoryVariantListItem
|
|
82
|
-
v-for="(
|
|
80
|
+
v-for="(v, index) of storyStore.currentStory.variants"
|
|
83
81
|
:key="index"
|
|
84
|
-
:variant="
|
|
82
|
+
:variant="v"
|
|
85
83
|
/>
|
|
86
84
|
</div>
|
|
87
85
|
</template>
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed,
|
|
2
|
+
import { computed, ref, toRaw, watch } from 'vue'
|
|
3
3
|
import { useEventListener } from '@vueuse/core'
|
|
4
|
-
import {
|
|
5
|
-
import { applyStateToVariant } from '@histoire/shared'
|
|
4
|
+
import { applyState } from '@histoire/shared'
|
|
6
5
|
import { STATE_SYNC, PREVIEW_SETTINGS_SYNC, SANDBOX_READY, EVENT_SEND } from '../../util/const'
|
|
7
6
|
import type { Story, Variant } from '../../types'
|
|
8
|
-
import HatchedPattern from '../misc/HatchedPattern.vue'
|
|
9
|
-
import CheckerboardPattern from '../misc/CheckerboardPattern.vue'
|
|
10
7
|
import { getSandboxUrl } from '../../util/sandbox'
|
|
11
8
|
import { usePreviewSettingsStore } from '../../stores/preview-settings'
|
|
12
9
|
import { HstEvent, useEventsStore } from '../../stores/events'
|
|
@@ -66,7 +63,7 @@ useEventListener(window, 'message', (event) => {
|
|
|
66
63
|
|
|
67
64
|
function updateVariantState (state: any) {
|
|
68
65
|
synced = true
|
|
69
|
-
|
|
66
|
+
applyState(props.variant.state, state)
|
|
70
67
|
}
|
|
71
68
|
|
|
72
69
|
function logEvent (event: HstEvent) {
|
|
@@ -39,9 +39,9 @@ watch(variant, () => {
|
|
|
39
39
|
@close="closeMenu"
|
|
40
40
|
>
|
|
41
41
|
<StoryVariantListItem
|
|
42
|
-
v-for="(
|
|
42
|
+
v-for="(v, index) of storyStore.currentStory.variants"
|
|
43
43
|
:key="index"
|
|
44
|
-
:variant="
|
|
44
|
+
:variant="v"
|
|
45
45
|
/>
|
|
46
46
|
</MobileOverlay>
|
|
47
47
|
</template>
|
|
@@ -18,9 +18,9 @@ const filePadding = computed(() => {
|
|
|
18
18
|
})
|
|
19
19
|
|
|
20
20
|
const route = useRoute()
|
|
21
|
-
const
|
|
21
|
+
const isActive = computed(() => route.params.storyId === props.story.id)
|
|
22
22
|
const el = ref<HTMLDivElement>()
|
|
23
|
-
useScrollOnActive(
|
|
23
|
+
useScrollOnActive(isActive, el)
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<template>
|
package/dist/client/app/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/* eslint-disable import/first */
|
|
2
|
-
// export * from 'vue'
|
|
3
1
|
import '$histoire-theme';
|
|
4
2
|
import { createApp } from 'vue';
|
|
5
3
|
import { createPinia } from 'pinia';
|
|
6
|
-
import FloatingVue from 'floating-vue';
|
|
4
|
+
import { FloatingVue } from 'floating-vue';
|
|
7
5
|
import App from './App.vue';
|
|
8
6
|
import { router } from './router';
|
|
9
7
|
export function mountMainApp() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseQuery } from 'vue-router';
|
|
2
2
|
import { computed, createApp, h, onMounted, ref, watch } from 'vue';
|
|
3
3
|
import { createPinia } from 'pinia';
|
|
4
|
-
import {
|
|
4
|
+
import { applyState } from '@histoire/shared';
|
|
5
5
|
import { SandboxVue3, MountStoryVue3 } from '@histoire/plugin-vue/client';
|
|
6
6
|
import { mapFile } from './util/mapping';
|
|
7
7
|
// @ts-expect-error virtual module
|
|
@@ -21,11 +21,12 @@ const app = createApp({
|
|
|
21
21
|
let synced = false;
|
|
22
22
|
let mounted = false;
|
|
23
23
|
window.addEventListener('message', event => {
|
|
24
|
+
// console.log('[sandbox] received message', event.data)
|
|
24
25
|
if (event.data?.type === STATE_SYNC) {
|
|
25
26
|
if (!mounted)
|
|
26
27
|
return;
|
|
27
28
|
synced = true;
|
|
28
|
-
|
|
29
|
+
applyState(variant.value.state, event.data.state);
|
|
29
30
|
}
|
|
30
31
|
else if (event.data?.type === PREVIEW_SETTINGS_SYNC) {
|
|
31
32
|
applyPreviewSettings(event.data.settings);
|
|
@@ -9,12 +9,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
9
9
|
title: string;
|
|
10
10
|
icon?: string;
|
|
11
11
|
iconColor?: string;
|
|
12
|
-
initState?: () => any;
|
|
13
12
|
setupApp?: (payload: any) => unknown;
|
|
14
13
|
slots?: () => Readonly<any>;
|
|
15
|
-
state
|
|
14
|
+
state: any;
|
|
16
15
|
source?: string;
|
|
17
16
|
responsiveDisabled?: boolean;
|
|
17
|
+
autoPropsDisabled?: boolean;
|
|
18
18
|
configReady?: boolean;
|
|
19
19
|
previewReady?: boolean;
|
|
20
20
|
}[];
|
|
@@ -40,12 +40,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
40
40
|
title: string;
|
|
41
41
|
icon?: string;
|
|
42
42
|
iconColor?: string;
|
|
43
|
-
initState?: () => any;
|
|
44
43
|
setupApp?: (payload: any) => unknown;
|
|
45
44
|
slots?: () => Readonly<any>;
|
|
46
|
-
state
|
|
45
|
+
state: any;
|
|
47
46
|
source?: string;
|
|
48
47
|
responsiveDisabled?: boolean;
|
|
48
|
+
autoPropsDisabled?: boolean;
|
|
49
49
|
configReady?: boolean;
|
|
50
50
|
previewReady?: boolean;
|
|
51
51
|
};
|
|
@@ -61,12 +61,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
61
61
|
title: string;
|
|
62
62
|
icon?: string;
|
|
63
63
|
iconColor?: string;
|
|
64
|
-
initState?: () => any;
|
|
65
64
|
setupApp?: (payload: any) => unknown;
|
|
66
65
|
slots?: () => Readonly<any>;
|
|
67
|
-
state
|
|
66
|
+
state: any;
|
|
68
67
|
source?: string;
|
|
69
68
|
responsiveDisabled?: boolean;
|
|
69
|
+
autoPropsDisabled?: boolean;
|
|
70
70
|
configReady?: boolean;
|
|
71
71
|
previewReady?: boolean;
|
|
72
72
|
}[];
|
|
@@ -92,12 +92,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
92
92
|
title: string;
|
|
93
93
|
icon?: string;
|
|
94
94
|
iconColor?: string;
|
|
95
|
-
initState?: () => any;
|
|
96
95
|
setupApp?: (payload: any) => unknown;
|
|
97
96
|
slots?: () => Readonly<any>;
|
|
98
|
-
state
|
|
97
|
+
state: any;
|
|
99
98
|
source?: string;
|
|
100
99
|
responsiveDisabled?: boolean;
|
|
100
|
+
autoPropsDisabled?: boolean;
|
|
101
101
|
configReady?: boolean;
|
|
102
102
|
previewReady?: boolean;
|
|
103
103
|
};
|
|
@@ -108,12 +108,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
108
108
|
title: string;
|
|
109
109
|
icon?: string;
|
|
110
110
|
iconColor?: string;
|
|
111
|
-
initState?: () => any;
|
|
112
111
|
setupApp?: (payload: any) => unknown;
|
|
113
112
|
slots?: () => Readonly<any>;
|
|
114
|
-
state
|
|
113
|
+
state: any;
|
|
115
114
|
source?: string;
|
|
116
115
|
responsiveDisabled?: boolean;
|
|
116
|
+
autoPropsDisabled?: boolean;
|
|
117
117
|
configReady?: boolean;
|
|
118
118
|
previewReady?: boolean;
|
|
119
119
|
}>;
|
|
@@ -129,12 +129,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
129
129
|
title: string;
|
|
130
130
|
icon?: string;
|
|
131
131
|
iconColor?: string;
|
|
132
|
-
initState?: () => any;
|
|
133
132
|
setupApp?: (payload: any) => unknown;
|
|
134
133
|
slots?: () => Readonly<any>;
|
|
135
|
-
state
|
|
134
|
+
state: any;
|
|
136
135
|
source?: string;
|
|
137
136
|
responsiveDisabled?: boolean;
|
|
137
|
+
autoPropsDisabled?: boolean;
|
|
138
138
|
configReady?: boolean;
|
|
139
139
|
previewReady?: boolean;
|
|
140
140
|
}[];
|
|
@@ -160,12 +160,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
160
160
|
title: string;
|
|
161
161
|
icon?: string;
|
|
162
162
|
iconColor?: string;
|
|
163
|
-
initState?: () => any;
|
|
164
163
|
setupApp?: (payload: any) => unknown;
|
|
165
164
|
slots?: () => Readonly<any>;
|
|
166
|
-
state
|
|
165
|
+
state: any;
|
|
167
166
|
source?: string;
|
|
168
167
|
responsiveDisabled?: boolean;
|
|
168
|
+
autoPropsDisabled?: boolean;
|
|
169
169
|
configReady?: boolean;
|
|
170
170
|
previewReady?: boolean;
|
|
171
171
|
};
|
|
@@ -181,12 +181,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
181
181
|
title: string;
|
|
182
182
|
icon?: string;
|
|
183
183
|
iconColor?: string;
|
|
184
|
-
initState?: () => any;
|
|
185
184
|
setupApp?: (payload: any) => unknown;
|
|
186
185
|
slots?: () => Readonly<any>;
|
|
187
|
-
state
|
|
186
|
+
state: any;
|
|
188
187
|
source?: string;
|
|
189
188
|
responsiveDisabled?: boolean;
|
|
189
|
+
autoPropsDisabled?: boolean;
|
|
190
190
|
configReady?: boolean;
|
|
191
191
|
previewReady?: boolean;
|
|
192
192
|
}[];
|
|
@@ -212,12 +212,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
212
212
|
title: string;
|
|
213
213
|
icon?: string;
|
|
214
214
|
iconColor?: string;
|
|
215
|
-
initState?: () => any;
|
|
216
215
|
setupApp?: (payload: any) => unknown;
|
|
217
216
|
slots?: () => Readonly<any>;
|
|
218
|
-
state
|
|
217
|
+
state: any;
|
|
219
218
|
source?: string;
|
|
220
219
|
responsiveDisabled?: boolean;
|
|
220
|
+
autoPropsDisabled?: boolean;
|
|
221
221
|
configReady?: boolean;
|
|
222
222
|
previewReady?: boolean;
|
|
223
223
|
};
|
|
@@ -228,12 +228,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
228
228
|
title: string;
|
|
229
229
|
icon?: string;
|
|
230
230
|
iconColor?: string;
|
|
231
|
-
initState?: () => any;
|
|
232
231
|
setupApp?: (payload: any) => unknown;
|
|
233
232
|
slots?: () => Readonly<any>;
|
|
234
|
-
state
|
|
233
|
+
state: any;
|
|
235
234
|
source?: string;
|
|
236
235
|
responsiveDisabled?: boolean;
|
|
236
|
+
autoPropsDisabled?: boolean;
|
|
237
237
|
configReady?: boolean;
|
|
238
238
|
previewReady?: boolean;
|
|
239
239
|
}>;
|
|
@@ -249,12 +249,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
249
249
|
title: string;
|
|
250
250
|
icon?: string;
|
|
251
251
|
iconColor?: string;
|
|
252
|
-
initState?: () => any;
|
|
253
252
|
setupApp?: (payload: any) => unknown;
|
|
254
253
|
slots?: () => Readonly<any>;
|
|
255
|
-
state
|
|
254
|
+
state: any;
|
|
256
255
|
source?: string;
|
|
257
256
|
responsiveDisabled?: boolean;
|
|
257
|
+
autoPropsDisabled?: boolean;
|
|
258
258
|
configReady?: boolean;
|
|
259
259
|
previewReady?: boolean;
|
|
260
260
|
}[];
|
|
@@ -280,12 +280,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
280
280
|
title: string;
|
|
281
281
|
icon?: string;
|
|
282
282
|
iconColor?: string;
|
|
283
|
-
initState?: () => any;
|
|
284
283
|
setupApp?: (payload: any) => unknown;
|
|
285
284
|
slots?: () => Readonly<any>;
|
|
286
|
-
state
|
|
285
|
+
state: any;
|
|
287
286
|
source?: string;
|
|
288
287
|
responsiveDisabled?: boolean;
|
|
288
|
+
autoPropsDisabled?: boolean;
|
|
289
289
|
configReady?: boolean;
|
|
290
290
|
previewReady?: boolean;
|
|
291
291
|
};
|
|
@@ -301,12 +301,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
301
301
|
title: string;
|
|
302
302
|
icon?: string;
|
|
303
303
|
iconColor?: string;
|
|
304
|
-
initState?: () => any;
|
|
305
304
|
setupApp?: (payload: any) => unknown;
|
|
306
305
|
slots?: () => Readonly<any>;
|
|
307
|
-
state
|
|
306
|
+
state: any;
|
|
308
307
|
source?: string;
|
|
309
308
|
responsiveDisabled?: boolean;
|
|
309
|
+
autoPropsDisabled?: boolean;
|
|
310
310
|
configReady?: boolean;
|
|
311
311
|
previewReady?: boolean;
|
|
312
312
|
}[];
|
|
@@ -332,12 +332,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
332
332
|
title: string;
|
|
333
333
|
icon?: string;
|
|
334
334
|
iconColor?: string;
|
|
335
|
-
initState?: () => any;
|
|
336
335
|
setupApp?: (payload: any) => unknown;
|
|
337
336
|
slots?: () => Readonly<any>;
|
|
338
|
-
state
|
|
337
|
+
state: any;
|
|
339
338
|
source?: string;
|
|
340
339
|
responsiveDisabled?: boolean;
|
|
340
|
+
autoPropsDisabled?: boolean;
|
|
341
341
|
configReady?: boolean;
|
|
342
342
|
previewReady?: boolean;
|
|
343
343
|
};
|
|
@@ -348,12 +348,12 @@ export declare const useStoryStore: import("pinia").StoreDefinition<"story", imp
|
|
|
348
348
|
title: string;
|
|
349
349
|
icon?: string;
|
|
350
350
|
iconColor?: string;
|
|
351
|
-
initState?: () => any;
|
|
352
351
|
setupApp?: (payload: any) => unknown;
|
|
353
352
|
slots?: () => Readonly<any>;
|
|
354
|
-
state
|
|
353
|
+
state: any;
|
|
355
354
|
source?: string;
|
|
356
355
|
responsiveDisabled?: boolean;
|
|
356
|
+
autoPropsDisabled?: boolean;
|
|
357
357
|
configReady?: boolean;
|
|
358
358
|
previewReady?: boolean;
|
|
359
359
|
}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const isDark: import("vue").WritableComputedRef<boolean>;
|
|
1
|
+
export declare const isDark: import("vue-demi").WritableComputedRef<boolean>;
|
|
2
2
|
export declare const toggleDark: (value?: boolean) => boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { markRaw } from 'vue';
|
|
2
|
+
import { reactive as _reactive } from '@histoire/vendors/dist/client/vue';
|
|
2
3
|
const copiedFromExistingVariant = [
|
|
3
4
|
'state',
|
|
4
5
|
'slots',
|
|
5
|
-
'initState',
|
|
6
6
|
'source',
|
|
7
7
|
'responsiveDisabled',
|
|
8
|
+
'autoPropsDisabled',
|
|
8
9
|
'setupApp',
|
|
9
10
|
'configReady',
|
|
10
11
|
'previewReady',
|
|
@@ -58,8 +59,7 @@ export function mapVariant(variant, existingVariant) {
|
|
|
58
59
|
// Create
|
|
59
60
|
result = {
|
|
60
61
|
...variant,
|
|
61
|
-
state:
|
|
62
|
-
initState: null,
|
|
62
|
+
state: _reactive({}),
|
|
63
63
|
setupApp: null,
|
|
64
64
|
slots: () => ({}),
|
|
65
65
|
previewReady: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const isMobile: import("vue").Ref<boolean>;
|
|
1
|
+
export declare const isMobile: import("vue-demi").Ref<boolean>;
|
|
@@ -2,7 +2,8 @@ import { unref, isRef } from 'vue';
|
|
|
2
2
|
const isObject = (val) => val !== null && typeof val === 'object';
|
|
3
3
|
export function toRawDeep(val, seen = new Set()) {
|
|
4
4
|
const unwrappedValue = isRef(val) ? unref(val) : val;
|
|
5
|
-
|
|
5
|
+
const valueType = typeof unwrappedValue;
|
|
6
|
+
if (valueType === 'symbol' || valueType === 'function') {
|
|
6
7
|
return unwrappedValue.toString();
|
|
7
8
|
}
|
|
8
9
|
if (!isObject(unwrappedValue)) {
|
package/dist/node/build.js
CHANGED
|
@@ -93,10 +93,17 @@ export async function build(ctx) {
|
|
|
93
93
|
},
|
|
94
94
|
});
|
|
95
95
|
};
|
|
96
|
-
vuePlugin.configureServer();
|
|
96
|
+
vuePlugin.configureServer(server);
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
});
|
|
100
|
+
buildViteConfig.plugins.push({
|
|
101
|
+
name: 'histoire-build-config-override',
|
|
102
|
+
config(config) {
|
|
103
|
+
// Don't externalize
|
|
104
|
+
config.build.rollupOptions.external = [];
|
|
105
|
+
},
|
|
106
|
+
});
|
|
100
107
|
const results = await viteBuild(buildViteConfig);
|
|
101
108
|
const result = Array.isArray(results) ? results[0] : results;
|
|
102
109
|
const styleOutput = result.output.find(o => o.name === 'style.css' && o.type === 'asset');
|
|
@@ -29,7 +29,7 @@ export async function devCommand(options) {
|
|
|
29
29
|
async function restart(source) {
|
|
30
30
|
if (stop) {
|
|
31
31
|
console.log(pc.blue(`${source} config changed, restarting...`));
|
|
32
|
-
stop();
|
|
32
|
+
await stop();
|
|
33
33
|
stop = null; // Don't call stop again until new start() is done
|
|
34
34
|
stop = await start();
|
|
35
35
|
}
|
package/dist/node/server.js
CHANGED
|
@@ -4,6 +4,7 @@ import { onStoryChange, watchStories } from './stories.js';
|
|
|
4
4
|
import { useCollectStories } from './collect/index.js';
|
|
5
5
|
import { DevPluginApi } from './plugin.js';
|
|
6
6
|
import { useModuleLoader } from './load.js';
|
|
7
|
+
import { wrapLogError } from './util/log.js';
|
|
7
8
|
export async function createServer(ctx, port) {
|
|
8
9
|
const server = await createViteServer(await getViteConfigWithPlugins(false, ctx));
|
|
9
10
|
await server.pluginContainer.buildStart({});
|
|
@@ -119,11 +120,11 @@ export async function createServer(ctx, port) {
|
|
|
119
120
|
});
|
|
120
121
|
async function close() {
|
|
121
122
|
for (const cb of pluginOnCleanups) {
|
|
122
|
-
await cb();
|
|
123
|
+
await wrapLogError('plugin.onDev.onCleanup', () => cb());
|
|
123
124
|
}
|
|
124
|
-
await server.close();
|
|
125
|
-
await nodeServer.close();
|
|
126
|
-
await destroyCollectStories();
|
|
125
|
+
await wrapLogError('server.close', () => server.close());
|
|
126
|
+
await wrapLogError('nodeServer', () => nodeServer.close());
|
|
127
|
+
await wrapLogError('destroyCollectStories', () => destroyCollectStories());
|
|
127
128
|
}
|
|
128
129
|
return {
|
|
129
130
|
server,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function wrapLogError(id: string, cb: () => unknown): Promise<void>;
|
package/dist/node/vite.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ export declare const RESOLVED_GENERATED_GLOBAL_SETUP: string;
|
|
|
17
17
|
export declare const GENERATED_SETUP_CODE = "$histoire-generated-setup-code";
|
|
18
18
|
export declare const RESOLVED_GENERATED_SETUP_CODE: string;
|
|
19
19
|
export declare function resolveViteConfig(ctx: Context): Promise<ResolvedConfig>;
|
|
20
|
-
export declare function getViteConfigWithPlugins(
|
|
20
|
+
export declare function getViteConfigWithPlugins(isServer: boolean, ctx: Context): Promise<InlineConfig>;
|
package/dist/node/vite.js
CHANGED
|
@@ -46,7 +46,7 @@ async function mergeHistoireViteConfig(viteConfig, ctx) {
|
|
|
46
46
|
}
|
|
47
47
|
return viteConfig;
|
|
48
48
|
}
|
|
49
|
-
export async function getViteConfigWithPlugins(
|
|
49
|
+
export async function getViteConfigWithPlugins(isServer, ctx) {
|
|
50
50
|
const resolvedViteConfig = await resolveViteConfig(ctx);
|
|
51
51
|
const inlineConfig = await mergeHistoireViteConfig({}, ctx);
|
|
52
52
|
const plugins = [];
|
|
@@ -60,7 +60,7 @@ export async function getViteConfigWithPlugins(server, ctx) {
|
|
|
60
60
|
],
|
|
61
61
|
},
|
|
62
62
|
optimizeDeps: {
|
|
63
|
-
disabled:
|
|
63
|
+
disabled: isServer,
|
|
64
64
|
entries: [
|
|
65
65
|
`${APP_PATH}/bundle-main.js`,
|
|
66
66
|
`${APP_PATH}/bundle-sandbox.js`,
|
|
@@ -84,12 +84,14 @@ export async function getViteConfigWithPlugins(server, ctx) {
|
|
|
84
84
|
allow: [DIST_PATH, TEMP_PATH, resolvedViteConfig.root, process.cwd()],
|
|
85
85
|
},
|
|
86
86
|
watch: {
|
|
87
|
-
ignored: [`!**/node_modules/.histoire
|
|
87
|
+
ignored: [`!**/node_modules/.histoire/**`, '**/vite.config.*'],
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
define: {
|
|
91
91
|
// We need to force this to be able to use `devtoolsRawSetupState`
|
|
92
92
|
__VUE_PROD_DEVTOOLS__: 'true',
|
|
93
|
+
// Disable warnings
|
|
94
|
+
'process.env.NODE_ENV': JSON.stringify(isServer ? 'production' : process.env.NODE_ENV ?? 'development'),
|
|
93
95
|
},
|
|
94
96
|
};
|
|
95
97
|
},
|
package/dist/style.css
CHANGED
|
@@ -1057,6 +1057,10 @@ button {
|
|
|
1057
1057
|
margin-bottom:0.5rem
|
|
1058
1058
|
}
|
|
1059
1059
|
|
|
1060
|
+
.htw-mr-2{
|
|
1061
|
+
margin-right:0.5rem
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1060
1064
|
.htw-box-border{
|
|
1061
1065
|
box-sizing:border-box
|
|
1062
1066
|
}
|
|
@@ -1681,6 +1685,14 @@ button {
|
|
|
1681
1685
|
background-color:rgb(var(--_histoire-color-primary-500) / var(--tw-bg-opacity)) !important
|
|
1682
1686
|
}
|
|
1683
1687
|
|
|
1688
|
+
.htw-fill-primary-500{
|
|
1689
|
+
fill:rgb(var(--_histoire-color-primary-500))
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
.htw-fill-transparent{
|
|
1693
|
+
fill:transparent
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1684
1696
|
.htw-stroke-white{
|
|
1685
1697
|
stroke:#fff
|
|
1686
1698
|
}
|
|
@@ -1980,6 +1992,10 @@ button {
|
|
|
1980
1992
|
transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)
|
|
1981
1993
|
}
|
|
1982
1994
|
|
|
1995
|
+
.htw-will-change-transform{
|
|
1996
|
+
will-change:transform
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1983
1999
|
body,
|
|
1984
2000
|
pre {
|
|
1985
2001
|
margin: 0;
|
|
@@ -2091,6 +2107,11 @@ body {
|
|
|
2091
2107
|
background-color:rgb(var(--_histoire-color-gray-100) / 0.5)
|
|
2092
2108
|
}
|
|
2093
2109
|
|
|
2110
|
+
.htw-group:hover .group-hover\:htw-border-primary-500{
|
|
2111
|
+
--tw-border-opacity:1;
|
|
2112
|
+
border-color:rgb(var(--_histoire-color-primary-500) / var(--tw-border-opacity))
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2094
2115
|
.htw-group:hover .group-hover\:htw-bg-primary-100{
|
|
2095
2116
|
--tw-bg-opacity:1;
|
|
2096
2117
|
background-color:rgb(var(--_histoire-color-primary-100) / var(--tw-bg-opacity))
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "histoire",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "A fast story book powered by Vite",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"histoire": "./bin.mjs"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@histoire/controls": "^0.
|
|
37
|
-
"@histoire/plugin-vue": "^0.
|
|
38
|
-
"@histoire/shared": "^0.
|
|
39
|
-
"@
|
|
36
|
+
"@histoire/controls": "^0.8.0",
|
|
37
|
+
"@histoire/plugin-vue": "^0.8.0",
|
|
38
|
+
"@histoire/shared": "^0.8.0",
|
|
39
|
+
"@histoire/vendors": "^0.8.0",
|
|
40
|
+
"@types/flexsearch": "^0.7.3",
|
|
40
41
|
"@types/markdown-it": "^12.2.3",
|
|
41
|
-
"@vueuse/core": "^8.2.5",
|
|
42
42
|
"birpc": "^0.1.1",
|
|
43
43
|
"case": "^1.6.3",
|
|
44
44
|
"chokidar": "^3.5.3",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
"defu": "^6.0.0",
|
|
47
47
|
"diacritics": "^1.3.0",
|
|
48
48
|
"flexsearch": "^0.7.21",
|
|
49
|
-
"floating-vue": "^2.0.0-beta.16",
|
|
50
49
|
"fs-extra": "^10.0.1",
|
|
51
50
|
"globby": "^13.1.1",
|
|
52
51
|
"happy-dom": "^2.55.0",
|
|
@@ -57,15 +56,10 @@
|
|
|
57
56
|
"mrmime": "^1.0.0",
|
|
58
57
|
"pathe": "^0.2.0",
|
|
59
58
|
"picocolors": "^1.0.0",
|
|
60
|
-
"pinia": "^2.0.13",
|
|
61
59
|
"sade": "^1.8.1",
|
|
62
|
-
"scroll-into-view-if-needed": "^2.2.29",
|
|
63
|
-
"shiki": "^0.10.1",
|
|
64
60
|
"sirv": "^2.0.2",
|
|
65
61
|
"tinypool": "^0.1.2",
|
|
66
|
-
"vite-node": "0.12.1"
|
|
67
|
-
"vue-router": "^4.0.14",
|
|
68
|
-
"vue": "^3.2.31"
|
|
62
|
+
"vite-node": "0.12.1"
|
|
69
63
|
},
|
|
70
64
|
"peerDependencies": {
|
|
71
65
|
"vite": "^2.9.0"
|
|
@@ -73,7 +67,6 @@
|
|
|
73
67
|
"devDependencies": {
|
|
74
68
|
"@peeky/test": "^0.13.5",
|
|
75
69
|
"@tailwindcss/typography": "^0.5.2",
|
|
76
|
-
"@types/flexsearch": "^0.7.3",
|
|
77
70
|
"@types/fs-extra": "^9.0.13",
|
|
78
71
|
"@types/markdown-it": "^12.2.3",
|
|
79
72
|
"@types/node": "^17.0.32",
|
|
@@ -83,7 +76,7 @@
|
|
|
83
76
|
"postcss": "^8.4.12",
|
|
84
77
|
"postcss-import": "^14.1.0",
|
|
85
78
|
"tailwindcss": "^3.0.23",
|
|
86
|
-
"typescript": "^4.
|
|
79
|
+
"typescript": "^4.7.4",
|
|
87
80
|
"vite": "^2.9.1",
|
|
88
81
|
"vue": "^3.2.31"
|
|
89
82
|
},
|
package/src/client/app/App.vue
CHANGED