@histoire/app 0.10.7 → 0.11.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/app/style/main.pcss +11 -0
- package/dist/bundled/App.js +4 -148
- package/dist/bundled/App.vue_vue_type_script_setup_true_lang.js +156 -0
- package/dist/bundled/_virtual/{plugin-vue_export-helper.js → _plugin-vue_export-helper.js} +4 -2
- package/dist/bundled/api.js +4 -1
- package/dist/bundled/assets/histoire-text-dark.js +4 -2
- package/dist/bundled/assets/histoire-text.js +4 -2
- package/dist/bundled/assets/histoire.js +4 -2
- package/dist/bundled/components/HomeView.js +5 -24
- package/dist/bundled/components/HomeView.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/bundled/components/app/AppHeader.js +5 -67
- package/dist/bundled/components/app/AppHeader.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/bundled/components/app/AppLogo.js +5 -26
- package/dist/bundled/components/app/AppLogo.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/bundled/components/app/Breadcrumb.js +7 -95
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_style_index_0_scoped_afeba72b_lang.js +4 -0
- package/dist/bundled/components/app/InitialLoading.js +5 -48
- package/dist/bundled/components/app/InitialLoading.vue_vue_type_script_setup_true_lang.js +50 -0
- package/dist/bundled/components/app/MobileOverlay.js +4 -40
- package/dist/bundled/components/app/MobileOverlay.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/bundled/components/base/BaseCheckbox.js +4 -74
- package/dist/bundled/components/base/BaseCheckbox.vue_vue_type_script_setup_true_lang.js +77 -0
- package/dist/bundled/components/base/BaseEmpty.js +7 -5
- package/dist/bundled/components/base/BaseEmpty.vue_vue_type_style_index_0_scoped_af3328a6_lang.js +4 -0
- package/dist/bundled/components/base/BaseListItemLink.js +7 -25
- package/dist/bundled/components/base/BaseListItemLink.vue_vue_type_script_lang.js +25 -0
- package/dist/bundled/components/base/BaseOverflowMenu.js +4 -96
- package/dist/bundled/components/base/BaseOverflowMenu.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/bundled/components/base/BaseOverflowTab.js +7 -17
- package/dist/bundled/components/base/BaseOverflowTab.vue_vue_type_script_lang.js +17 -0
- package/dist/bundled/components/base/BaseSelect.js +5 -69
- package/dist/bundled/components/base/BaseSelect.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/bundled/components/base/BaseSplitPane.js +7 -184
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_script_setup_true_lang.js +183 -0
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_style_index_0_scoped_bb6c600c_lang.js +4 -0
- package/dist/bundled/components/base/BaseTab.js +7 -17
- package/dist/bundled/components/base/BaseTab.vue_vue_type_script_lang.js +17 -0
- package/dist/bundled/components/misc/CheckerboardPattern.js +5 -3
- package/dist/bundled/components/misc/HatchedPattern.js +7 -5
- package/dist/bundled/components/misc/HatchedPattern.vue_vue_type_style_index_0_scoped_91561117_lang.js +4 -0
- package/dist/bundled/components/panel/ControlsComponentPropItem.js +5 -98
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/bundled/components/panel/ControlsComponentProps.js +5 -42
- package/dist/bundled/components/panel/ControlsComponentProps.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/bundled/components/panel/PaneTabs.js +4 -111
- package/dist/bundled/components/panel/PaneTabs.vue_vue_type_script_setup_true_lang.js +110 -0
- package/dist/bundled/components/panel/StatePresets.js +4 -189
- package/dist/bundled/components/panel/StatePresets.vue_vue_type_script_setup_true_lang.js +193 -0
- package/dist/bundled/components/panel/StoryControls.js +4 -72
- package/dist/bundled/components/panel/StoryControls.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/bundled/components/panel/StoryDocs.js +6 -72
- package/dist/bundled/components/panel/StoryDocs.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/bundled/components/panel/StoryEvent.js +4 -55
- package/dist/bundled/components/panel/StoryEvent.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/bundled/components/panel/StoryEvents.js +5 -49
- package/dist/bundled/components/panel/StoryEvents.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/bundled/components/panel/StorySidePanel.js +5 -72
- package/dist/bundled/components/panel/StorySidePanel.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/bundled/components/panel/StorySourceCode.js +6 -130
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_style_index_0_scoped_0d096b10_lang.js +4 -0
- package/dist/bundled/components/search/SearchItem.js +6 -112
- package/dist/bundled/components/search/SearchItem.vue_vue_type_script_setup_true_lang.js +112 -0
- package/dist/bundled/components/search/SearchItem.vue_vue_type_style_index_0_scoped_b819ed97_lang.js +4 -0
- package/dist/bundled/components/search/SearchLoading.js +5 -19
- package/dist/bundled/components/search/SearchLoading.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/bundled/components/search/SearchModal.js +4 -45
- package/dist/bundled/components/search/SearchModal.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/bundled/components/search/SearchPane.js +4 -268
- package/dist/bundled/components/search/SearchPane.vue_vue_type_script_setup_true_lang.js +270 -0
- package/dist/bundled/components/search/search-docs-data.js +5 -2
- package/dist/bundled/components/search/search-title-data.js +5 -2
- package/dist/bundled/components/story/GenericMountStory.js +4 -30
- package/dist/bundled/components/story/GenericMountStory.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/bundled/components/story/GenericRenderStory.js +4 -30
- package/dist/bundled/components/story/GenericRenderStory.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/bundled/components/story/StoryResponsivePreview.js +6 -180
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js +183 -0
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_style_index_0_scoped_1375d05a_lang.js +4 -0
- package/dist/bundled/components/story/StoryVariantGrid.js +5 -94
- package/dist/bundled/components/story/StoryVariantGrid.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/bundled/components/story/StoryVariantGridItem.js +7 -108
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js +108 -0
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_style_index_0_scoped_be3a417b_lang.js +4 -0
- package/dist/bundled/components/story/StoryVariantListItem.js +7 -58
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_script_setup_true_lang.js +57 -0
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_style_index_0_scoped_cc25ec8b_lang.js +4 -0
- package/dist/bundled/components/story/StoryVariantSingle.js +6 -114
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_style_index_0_scoped_afe0bbc2_lang.js +4 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.js +5 -45
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.js +5 -122
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/bundled/components/story/StoryVariantSingleView.js +4 -48
- package/dist/bundled/components/story/StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/bundled/components/story/StoryView.js +4 -89
- package/dist/bundled/components/story/StoryView.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/bundled/components/story/StoryViewer.js +7 -57
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_style_index_0_scoped_54d5a557_lang.js +4 -0
- package/dist/bundled/components/toolbar/StoryVariantBackground.js +7 -85
- package/dist/bundled/components/toolbar/StoryVariantBackground.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/bundled/components/toolbar/StoryVariantBackground.vue_vue_type_style_index_0_scoped_8dc02d19_lang.js +4 -0
- package/dist/bundled/components/toolbar/StoryVariantNewTab.js +5 -33
- package/dist/bundled/components/toolbar/StoryVariantNewTab.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/bundled/components/toolbar/StoryVariantResponsiveSize.js +5 -129
- package/dist/bundled/components/toolbar/StoryVariantResponsiveSize.vue_vue_type_script_setup_true_lang.js +131 -0
- package/dist/bundled/components/toolbar/StoryVariantTitle.js +5 -24
- package/dist/bundled/components/toolbar/StoryVariantTitle.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/bundled/components/tree/StoryGroup.js +4 -73
- package/dist/bundled/components/tree/StoryGroup.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/bundled/components/tree/StoryList.js +5 -37
- package/dist/bundled/components/tree/StoryList.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/bundled/components/tree/StoryListFolder.js +7 -89
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_style_index_0_scoped_41fb5f7e_lang.js +4 -0
- package/dist/bundled/components/tree/StoryListItem.js +6 -71
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_style_index_0_scoped_313a2f42_lang.js +4 -0
- package/dist/bundled/index.js +6 -3
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/common.js +13 -1
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/en.js +7 -2
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/advanced.js +7 -2
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/balance.js +7 -2
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/simple.js +7 -2
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang.js +11 -1
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/type.js +4 -1
- package/dist/bundled/router.js +4 -1
- package/dist/bundled/sandbox.js +5 -3
- package/dist/bundled/stores/events.js +3 -1
- package/dist/bundled/stores/folder.js +6 -2
- package/dist/bundled/stores/preview-settings.js +3 -1
- package/dist/bundled/stores/story.js +3 -1
- package/dist/bundled/style.css +37 -46
- package/dist/bundled/util/config.js +5 -2
- package/dist/bundled/util/const.js +6 -1
- package/dist/bundled/util/dark.js +4 -1
- package/dist/bundled/util/env.js +3 -1
- package/dist/bundled/util/events.js +4 -2
- package/dist/bundled/util/keyboard.js +4 -1
- package/dist/bundled/util/mapping.js +4 -1
- package/dist/bundled/util/preview-settings.js +4 -1
- package/dist/bundled/util/responsive.js +3 -1
- package/dist/bundled/util/sandbox.js +3 -1
- package/dist/bundled/util/scroll.js +3 -1
- package/dist/bundled/util/state.js +3 -1
- package/dist/bundled/util/tooltip.js +3 -1
- package/dist/bundled/util/variant.js +3 -1
- package/dist/style.css +145 -119
- package/package.json +6 -6
- package/src/app/App.vue +2 -2
- package/src/app/api.ts +1 -1
- package/src/app/components/base/BaseSplitPane.vue +2 -2
- package/src/app/components/panel/StorySourceCode.vue +134 -26
- package/src/app/components/search/search-docs-data.ts +1 -1
- package/src/app/components/search/search-title-data.ts +1 -1
- package/src/app/components/story/StoryResponsivePreview.vue +55 -54
- package/src/app/components/story/StoryVariantSingle.vue +2 -2
- package/src/app/index.ts +1 -1
- package/src/app/sandbox.ts +1 -1
- package/src/app/stores/folder.ts +3 -1
- package/src/app/style/main.pcss +11 -0
- package/src/app/util/config.ts +1 -1
- package/src/app/util/events.ts +1 -1
- package/tailwind.config.cjs +12 -0
- package/tsconfig.json +0 -1
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/base/BaseEmpty.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/misc/HatchedPattern.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/search/SearchItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/toolbar/StoryVariantBackground.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { defineComponent, ref, watch, computed, openBlock, createBlock, withCtx, createElementVNode, unref, normalizeClass, normalizeStyle, toRaw } from "@histoire/vendors/vue";
|
|
2
|
+
import { useEventListener } from "@histoire/vendors/vue-use";
|
|
3
|
+
import { applyState } from "@histoire/shared";
|
|
4
|
+
import { SANDBOX_READY, EVENT_SEND, STATE_SYNC, PREVIEW_SETTINGS_SYNC } from "../../util/const.js";
|
|
5
|
+
import { getSandboxUrl } from "../../util/sandbox.js";
|
|
6
|
+
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
7
|
+
import { useEventsStore } from "../../stores/events.js";
|
|
8
|
+
import StoryResponsivePreview from "./StoryResponsivePreview.js";
|
|
9
|
+
import { toRawDeep } from "../../util/state.js";
|
|
10
|
+
const _hoisted_1 = ["src"];
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
__name: "StoryVariantSinglePreviewRemote",
|
|
13
|
+
props: {
|
|
14
|
+
story: null,
|
|
15
|
+
variant: null
|
|
16
|
+
},
|
|
17
|
+
setup(__props) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const settings = usePreviewSettingsStore().currentSettings;
|
|
20
|
+
const iframe = ref();
|
|
21
|
+
function syncState() {
|
|
22
|
+
if (iframe.value && props.variant.previewReady) {
|
|
23
|
+
iframe.value.contentWindow.postMessage({
|
|
24
|
+
type: STATE_SYNC,
|
|
25
|
+
state: toRawDeep(props.variant.state, true)
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
let synced = false;
|
|
30
|
+
watch(() => props.variant.state, () => {
|
|
31
|
+
if (synced) {
|
|
32
|
+
synced = false;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
syncState();
|
|
36
|
+
}, {
|
|
37
|
+
deep: true,
|
|
38
|
+
immediate: true
|
|
39
|
+
});
|
|
40
|
+
Object.assign(props.variant, {
|
|
41
|
+
previewReady: false
|
|
42
|
+
});
|
|
43
|
+
useEventListener(window, "message", (event) => {
|
|
44
|
+
switch (event.data.type) {
|
|
45
|
+
case STATE_SYNC:
|
|
46
|
+
updateVariantState(event.data.state);
|
|
47
|
+
break;
|
|
48
|
+
case EVENT_SEND:
|
|
49
|
+
logEvent(event.data.event);
|
|
50
|
+
break;
|
|
51
|
+
case SANDBOX_READY:
|
|
52
|
+
setPreviewReady();
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
function updateVariantState(state) {
|
|
57
|
+
synced = true;
|
|
58
|
+
applyState(props.variant.state, state);
|
|
59
|
+
}
|
|
60
|
+
function logEvent(event) {
|
|
61
|
+
const eventsStore = useEventsStore();
|
|
62
|
+
eventsStore.addEvent(event);
|
|
63
|
+
}
|
|
64
|
+
function setPreviewReady() {
|
|
65
|
+
Object.assign(props.variant, {
|
|
66
|
+
previewReady: true
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const sandboxUrl = computed(() => {
|
|
70
|
+
return getSandboxUrl(props.story, props.variant);
|
|
71
|
+
});
|
|
72
|
+
const isIframeLoaded = ref(false);
|
|
73
|
+
watch(sandboxUrl, () => {
|
|
74
|
+
isIframeLoaded.value = false;
|
|
75
|
+
Object.assign(props.variant, {
|
|
76
|
+
previewReady: false
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
function syncSettings() {
|
|
80
|
+
if (iframe.value) {
|
|
81
|
+
iframe.value.contentWindow.postMessage({
|
|
82
|
+
type: PREVIEW_SETTINGS_SYNC,
|
|
83
|
+
settings: toRaw(settings)
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
watch(() => settings, () => {
|
|
88
|
+
syncSettings();
|
|
89
|
+
}, {
|
|
90
|
+
deep: true,
|
|
91
|
+
immediate: true
|
|
92
|
+
});
|
|
93
|
+
function onIframeLoad() {
|
|
94
|
+
isIframeLoaded.value = true;
|
|
95
|
+
syncState();
|
|
96
|
+
syncSettings();
|
|
97
|
+
}
|
|
98
|
+
return (_ctx, _cache) => {
|
|
99
|
+
return openBlock(), createBlock(StoryResponsivePreview, { variant: __props.variant }, {
|
|
100
|
+
default: withCtx(({ isResponsiveEnabled, finalWidth, finalHeight, resizing }) => [
|
|
101
|
+
createElementVNode("iframe", {
|
|
102
|
+
ref_key: "iframe",
|
|
103
|
+
ref: iframe,
|
|
104
|
+
src: unref(sandboxUrl),
|
|
105
|
+
class: normalizeClass(["htw-w-full htw-h-full htw-relative", {
|
|
106
|
+
"htw-invisible": !isIframeLoaded.value,
|
|
107
|
+
"htw-pointer-events-none": resizing
|
|
108
|
+
}]),
|
|
109
|
+
style: normalizeStyle(isResponsiveEnabled ? {
|
|
110
|
+
width: finalWidth ? `${finalWidth}px` : null,
|
|
111
|
+
height: finalHeight ? `${finalHeight}px` : null
|
|
112
|
+
} : void 0),
|
|
113
|
+
"data-test-id": "preview-iframe",
|
|
114
|
+
onLoad: _cache[0] || (_cache[0] = ($event) => onIframeLoad())
|
|
115
|
+
}, null, 46, _hoisted_1)
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
}, 8, ["variant"]);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
export {
|
|
123
|
+
_sfc_main as default
|
|
124
|
+
};
|
|
@@ -1,49 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import StoryVariantBackground from "../toolbar/StoryVariantBackground.js";
|
|
6
|
-
import _sfc_main$3 from "../toolbar/StoryVariantNewTab.js";
|
|
7
|
-
import _sfc_main$4 from "./StoryVariantSinglePreviewNative.js";
|
|
8
|
-
import _sfc_main$5 from "./StoryVariantSinglePreviewRemote.js";
|
|
9
|
-
const _hoisted_1 = {
|
|
10
|
-
class: "htw-h-full htw-flex htw-flex-col",
|
|
11
|
-
"data-test-id": "story-variant-single-view"
|
|
1
|
+
import _sfc_main from "./StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
12
5
|
};
|
|
13
|
-
const _hoisted_2 = {
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "htw-flex-none htw-flex htw-items-center htw-h-8 -htw-mt-1"
|
|
16
|
-
};
|
|
17
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
-
__name: "StoryVariantSingleView",
|
|
19
|
-
props: {
|
|
20
|
-
variant: null,
|
|
21
|
-
story: null
|
|
22
|
-
},
|
|
23
|
-
setup(__props) {
|
|
24
|
-
return (_ctx, _cache) => {
|
|
25
|
-
var _a;
|
|
26
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
27
|
-
!unref(isMobile) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
28
|
-
createVNode(_sfc_main$1, { variant: __props.variant }, null, 8, ["variant"]),
|
|
29
|
-
!__props.variant.responsiveDisabled ? (openBlock(), createBlock(_sfc_main$2, { key: 0 })) : createCommentVNode("", true),
|
|
30
|
-
createVNode(StoryVariantBackground),
|
|
31
|
-
createVNode(_sfc_main$3, {
|
|
32
|
-
variant: __props.variant,
|
|
33
|
-
story: __props.story
|
|
34
|
-
}, null, 8, ["variant", "story"])
|
|
35
|
-
])) : createCommentVNode("", true),
|
|
36
|
-
((_a = __props.story.layout) == null ? void 0 : _a.iframe) === false ? (openBlock(), createBlock(_sfc_main$4, {
|
|
37
|
-
key: 1,
|
|
38
|
-
story: __props.story,
|
|
39
|
-
variant: __props.variant
|
|
40
|
-
}, null, 8, ["story", "variant"])) : (openBlock(), createBlock(_sfc_main$5, {
|
|
41
|
-
key: 2,
|
|
42
|
-
story: __props.story,
|
|
43
|
-
variant: __props.variant
|
|
44
|
-
}, null, 8, ["story", "variant"]))
|
|
45
|
-
]);
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
export { _sfc_main as default };
|
package/dist/bundled/components/story/StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, unref, createVNode, createBlock, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
|
+
import { isMobile } from "../../util/responsive.js";
|
|
3
|
+
import "../toolbar/StoryVariantTitle.js";
|
|
4
|
+
import "../toolbar/StoryVariantResponsiveSize.js";
|
|
5
|
+
import StoryVariantBackground from "../toolbar/StoryVariantBackground.js";
|
|
6
|
+
import "../toolbar/StoryVariantNewTab.js";
|
|
7
|
+
import "./StoryVariantSinglePreviewNative.js";
|
|
8
|
+
import "./StoryVariantSinglePreviewRemote.js";
|
|
9
|
+
import _sfc_main$1 from "../toolbar/StoryVariantTitle.vue_vue_type_script_setup_true_lang.js";
|
|
10
|
+
import _sfc_main$2 from "../toolbar/StoryVariantResponsiveSize.vue_vue_type_script_setup_true_lang.js";
|
|
11
|
+
import _sfc_main$3 from "../toolbar/StoryVariantNewTab.vue_vue_type_script_setup_true_lang.js";
|
|
12
|
+
import _sfc_main$4 from "./StoryVariantSinglePreviewNative.vue_vue_type_script_setup_true_lang.js";
|
|
13
|
+
import _sfc_main$5 from "./StoryVariantSinglePreviewRemote.vue_vue_type_script_setup_true_lang.js";
|
|
14
|
+
const _hoisted_1 = {
|
|
15
|
+
class: "htw-h-full htw-flex htw-flex-col",
|
|
16
|
+
"data-test-id": "story-variant-single-view"
|
|
17
|
+
};
|
|
18
|
+
const _hoisted_2 = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "htw-flex-none htw-flex htw-items-center htw-h-8 -htw-mt-1"
|
|
21
|
+
};
|
|
22
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
23
|
+
__name: "StoryVariantSingleView",
|
|
24
|
+
props: {
|
|
25
|
+
variant: null,
|
|
26
|
+
story: null
|
|
27
|
+
},
|
|
28
|
+
setup(__props) {
|
|
29
|
+
return (_ctx, _cache) => {
|
|
30
|
+
var _a;
|
|
31
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
32
|
+
!unref(isMobile) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
33
|
+
createVNode(_sfc_main$1, { variant: __props.variant }, null, 8, ["variant"]),
|
|
34
|
+
!__props.variant.responsiveDisabled ? (openBlock(), createBlock(_sfc_main$2, { key: 0 })) : createCommentVNode("", true),
|
|
35
|
+
createVNode(StoryVariantBackground),
|
|
36
|
+
createVNode(_sfc_main$3, {
|
|
37
|
+
variant: __props.variant,
|
|
38
|
+
story: __props.story
|
|
39
|
+
}, null, 8, ["variant", "story"])
|
|
40
|
+
])) : createCommentVNode("", true),
|
|
41
|
+
((_a = __props.story.layout) == null ? void 0 : _a.iframe) === false ? (openBlock(), createBlock(_sfc_main$4, {
|
|
42
|
+
key: 1,
|
|
43
|
+
story: __props.story,
|
|
44
|
+
variant: __props.variant
|
|
45
|
+
}, null, 8, ["story", "variant"])) : (openBlock(), createBlock(_sfc_main$5, {
|
|
46
|
+
key: 2,
|
|
47
|
+
story: __props.story,
|
|
48
|
+
variant: __props.variant
|
|
49
|
+
}, null, 8, ["story", "variant"]))
|
|
50
|
+
]);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export {
|
|
55
|
+
_sfc_main as default
|
|
56
|
+
};
|
|
@@ -1,90 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import BaseSplitPane from "../base/BaseSplitPane.js";
|
|
6
|
-
import BaseEmpty from "../base/BaseEmpty.js";
|
|
7
|
-
import { isMobile } from "../../util/responsive.js";
|
|
8
|
-
import StoryViewer from "./StoryViewer.js";
|
|
9
|
-
import _sfc_main$2 from "../panel/StorySidePanel.js";
|
|
10
|
-
import _sfc_main$1 from "../panel/StoryDocs.js";
|
|
11
|
-
const _hoisted_1 = {
|
|
12
|
-
key: 1,
|
|
13
|
-
class: "htw-h-full"
|
|
1
|
+
import _sfc_main from "./StoryView.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./StoryView.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
14
5
|
};
|
|
15
|
-
const _hoisted_2 = {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "htw-h-full htw-overflow-auto"
|
|
18
|
-
};
|
|
19
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
|
-
__name: "StoryView",
|
|
21
|
-
setup(__props) {
|
|
22
|
-
const storyStore = useStoryStore();
|
|
23
|
-
const router = useRouter();
|
|
24
|
-
const route = useRoute();
|
|
25
|
-
watch(() => storyStore.currentVariant, (value) => {
|
|
26
|
-
if (value) {
|
|
27
|
-
storyStore.currentStory.lastSelectedVariant = value;
|
|
28
|
-
}
|
|
29
|
-
}, {
|
|
30
|
-
immediate: true
|
|
31
|
-
});
|
|
32
|
-
watch(() => [storyStore.currentStory, storyStore.currentVariant], () => {
|
|
33
|
-
var _a, _b;
|
|
34
|
-
if (!storyStore.currentVariant) {
|
|
35
|
-
if ((_a = storyStore.currentStory) == null ? void 0 : _a.lastSelectedVariant) {
|
|
36
|
-
setVariant(storyStore.currentStory.lastSelectedVariant.id);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if (((_b = storyStore.currentStory) == null ? void 0 : _b.variants.length) === 1) {
|
|
40
|
-
setVariant(storyStore.currentStory.variants[0].id);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
immediate: true
|
|
45
|
-
});
|
|
46
|
-
function setVariant(variantId) {
|
|
47
|
-
router.replace({
|
|
48
|
-
...route,
|
|
49
|
-
query: {
|
|
50
|
-
...route.query,
|
|
51
|
-
variantId
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
return (_ctx, _cache) => {
|
|
56
|
-
return !unref(storyStore).currentStory ? (openBlock(), createBlock(BaseEmpty, { key: 0 }, {
|
|
57
|
-
default: withCtx(() => [
|
|
58
|
-
createVNode(unref(Icon), {
|
|
59
|
-
icon: "carbon:software-resource-resource",
|
|
60
|
-
class: "htw-w-16 htw-h-16 htw-opacity-50"
|
|
61
|
-
})
|
|
62
|
-
]),
|
|
63
|
-
_: 1
|
|
64
|
-
})) : (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
65
|
-
unref(storyStore).currentStory.docsOnly ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
66
|
-
createVNode(_sfc_main$1, {
|
|
67
|
-
story: unref(storyStore).currentStory,
|
|
68
|
-
class: "md:htw-p-12 htw-w-full md:htw-max-w-[600px] lg:htw-max-w-[800px] xl:htw-max-w-[900px]"
|
|
69
|
-
}, null, 8, ["story"])
|
|
70
|
-
])) : unref(isMobile) ? (openBlock(), createBlock(StoryViewer, { key: 1 })) : (openBlock(), createBlock(BaseSplitPane, {
|
|
71
|
-
key: 2,
|
|
72
|
-
"save-id": "story-main",
|
|
73
|
-
min: 30,
|
|
74
|
-
max: 95,
|
|
75
|
-
"default-split": 75,
|
|
76
|
-
class: "htw-h-full"
|
|
77
|
-
}, {
|
|
78
|
-
first: withCtx(() => [
|
|
79
|
-
createVNode(StoryViewer)
|
|
80
|
-
]),
|
|
81
|
-
last: withCtx(() => [
|
|
82
|
-
createVNode(_sfc_main$2)
|
|
83
|
-
]),
|
|
84
|
-
_: 1
|
|
85
|
-
}))
|
|
86
|
-
]));
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
export { _sfc_main as default };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { defineComponent, watch, unref, openBlock, createBlock, withCtx, createVNode, createElementBlock } from "@histoire/vendors/vue";
|
|
2
|
+
import { useRouter, useRoute } from "@histoire/vendors/vue-router";
|
|
3
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
4
|
+
import { useStoryStore } from "../../stores/story.js";
|
|
5
|
+
import BaseSplitPane from "../base/BaseSplitPane.js";
|
|
6
|
+
import BaseEmpty from "../base/BaseEmpty.js";
|
|
7
|
+
import { isMobile } from "../../util/responsive.js";
|
|
8
|
+
import StoryViewer from "./StoryViewer.js";
|
|
9
|
+
import "../panel/StorySidePanel.js";
|
|
10
|
+
import "../panel/StoryDocs.js";
|
|
11
|
+
import _sfc_main$1 from "../panel/StoryDocs.vue_vue_type_script_setup_true_lang.js";
|
|
12
|
+
import _sfc_main$2 from "../panel/StorySidePanel.vue_vue_type_script_setup_true_lang.js";
|
|
13
|
+
const _hoisted_1 = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "htw-h-full"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_2 = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "htw-h-full htw-overflow-auto"
|
|
20
|
+
};
|
|
21
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
22
|
+
__name: "StoryView",
|
|
23
|
+
setup(__props) {
|
|
24
|
+
const storyStore = useStoryStore();
|
|
25
|
+
const router = useRouter();
|
|
26
|
+
const route = useRoute();
|
|
27
|
+
watch(() => storyStore.currentVariant, (value) => {
|
|
28
|
+
if (value) {
|
|
29
|
+
storyStore.currentStory.lastSelectedVariant = value;
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
immediate: true
|
|
33
|
+
});
|
|
34
|
+
watch(() => [storyStore.currentStory, storyStore.currentVariant], () => {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
if (!storyStore.currentVariant) {
|
|
37
|
+
if ((_a = storyStore.currentStory) == null ? void 0 : _a.lastSelectedVariant) {
|
|
38
|
+
setVariant(storyStore.currentStory.lastSelectedVariant.id);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (((_b = storyStore.currentStory) == null ? void 0 : _b.variants.length) === 1) {
|
|
42
|
+
setVariant(storyStore.currentStory.variants[0].id);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
46
|
+
immediate: true
|
|
47
|
+
});
|
|
48
|
+
function setVariant(variantId) {
|
|
49
|
+
router.replace({
|
|
50
|
+
...route,
|
|
51
|
+
query: {
|
|
52
|
+
...route.query,
|
|
53
|
+
variantId
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return (_ctx, _cache) => {
|
|
58
|
+
return !unref(storyStore).currentStory ? (openBlock(), createBlock(BaseEmpty, { key: 0 }, {
|
|
59
|
+
default: withCtx(() => [
|
|
60
|
+
createVNode(unref(Icon), {
|
|
61
|
+
icon: "carbon:software-resource-resource",
|
|
62
|
+
class: "htw-w-16 htw-h-16 htw-opacity-50"
|
|
63
|
+
})
|
|
64
|
+
]),
|
|
65
|
+
_: 1
|
|
66
|
+
})) : (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
67
|
+
unref(storyStore).currentStory.docsOnly ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
68
|
+
createVNode(_sfc_main$1, {
|
|
69
|
+
story: unref(storyStore).currentStory,
|
|
70
|
+
class: "md:htw-p-12 htw-w-full md:htw-max-w-[600px] lg:htw-max-w-[800px] xl:htw-max-w-[900px]"
|
|
71
|
+
}, null, 8, ["story"])
|
|
72
|
+
])) : unref(isMobile) ? (openBlock(), createBlock(StoryViewer, { key: 1 })) : (openBlock(), createBlock(BaseSplitPane, {
|
|
73
|
+
key: 2,
|
|
74
|
+
"save-id": "story-main",
|
|
75
|
+
min: 30,
|
|
76
|
+
max: 95,
|
|
77
|
+
"default-split": 75,
|
|
78
|
+
class: "htw-h-full"
|
|
79
|
+
}, {
|
|
80
|
+
first: withCtx(() => [
|
|
81
|
+
createVNode(StoryViewer)
|
|
82
|
+
]),
|
|
83
|
+
last: withCtx(() => [
|
|
84
|
+
createVNode(_sfc_main$2)
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
}))
|
|
88
|
+
]));
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
export {
|
|
93
|
+
_sfc_main as default
|
|
94
|
+
};
|
|
@@ -1,57 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
|
|
9
|
-
const _withScopeId = (n) => (pushScopeId("data-v-b9d4a640"), n = n(), popScopeId(), n);
|
|
10
|
-
const _hoisted_1 = { class: "htw-bg-gray-50 htw-h-full dark:htw-bg-gray-750" };
|
|
11
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
-
__name: "StoryViewer",
|
|
13
|
-
setup(__props) {
|
|
14
|
-
useCssVars((_ctx) => {
|
|
15
|
-
var _a;
|
|
16
|
-
return {
|
|
17
|
-
"10f93ca4": (_a = unref(variant)) == null ? void 0 : _a.iconColor
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
const storyStore = useStoryStore();
|
|
21
|
-
const variant = computed(() => storyStore.currentVariant);
|
|
22
|
-
const isMenuOpened = ref(false);
|
|
23
|
-
function closeMenu() {
|
|
24
|
-
isMenuOpened.value = false;
|
|
25
|
-
}
|
|
26
|
-
watch(variant, () => {
|
|
27
|
-
isMenuOpened.value = false;
|
|
28
|
-
});
|
|
29
|
-
return (_ctx, _cache) => {
|
|
30
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
31
|
-
createElementVNode("div", _hoisted_1, [
|
|
32
|
-
unref(storyStore).currentStory.layout.type === "grid" ? (openBlock(), createBlock(_sfc_main$1, { key: 0 })) : unref(storyStore).currentStory.layout.type === "single" ? (openBlock(), createBlock(StoryVariantSingle, {
|
|
33
|
-
key: 1,
|
|
34
|
-
onOpenVariantMenu: _cache[0] || (_cache[0] = ($event) => isMenuOpened.value = true)
|
|
35
|
-
})) : createCommentVNode("", true)
|
|
36
|
-
]),
|
|
37
|
-
createVNode(_sfc_main$2, {
|
|
38
|
-
title: "Select a variant",
|
|
39
|
-
opened: isMenuOpened.value,
|
|
40
|
-
onClose: closeMenu
|
|
41
|
-
}, {
|
|
42
|
-
default: withCtx(() => [
|
|
43
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(storyStore).currentStory.variants, (v, index) => {
|
|
44
|
-
return openBlock(), createBlock(StoryVariantListItem, {
|
|
45
|
-
key: index,
|
|
46
|
-
variant: v
|
|
47
|
-
}, null, 8, ["variant"]);
|
|
48
|
-
}), 128))
|
|
49
|
-
]),
|
|
50
|
-
_: 1
|
|
51
|
-
}, 8, ["opened"])
|
|
52
|
-
], 64);
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
var StoryViewer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b9d4a640"]]);
|
|
57
|
-
export { StoryViewer as default };
|
|
1
|
+
import _sfc_main from "./StoryViewer.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import "./StoryViewer.vue_vue_type_style_index_0_scoped_54d5a557_lang.js";
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const StoryViewer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-54d5a557"]]);
|
|
5
|
+
export {
|
|
6
|
+
StoryViewer as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineComponent, useCssVars, unref, computed, ref, watch, openBlock, createElementBlock, Fragment, createElementVNode, createBlock, createCommentVNode, createVNode, withCtx, renderList, pushScopeId, popScopeId } from "@histoire/vendors/vue";
|
|
2
|
+
import { useStoryStore } from "../../stores/story.js";
|
|
3
|
+
import StoryVariantListItem from "./StoryVariantListItem.js";
|
|
4
|
+
import "../app/MobileOverlay.js";
|
|
5
|
+
import "./StoryVariantGrid.js";
|
|
6
|
+
import StoryVariantSingle from "./StoryVariantSingle.js";
|
|
7
|
+
import _sfc_main$1 from "./StoryVariantGrid.vue_vue_type_script_setup_true_lang.js";
|
|
8
|
+
import _sfc_main$2 from "../app/MobileOverlay.vue_vue_type_script_setup_true_lang.js";
|
|
9
|
+
const _withScopeId = (n) => (pushScopeId("data-v-54d5a557"), n = n(), popScopeId(), n);
|
|
10
|
+
const _hoisted_1 = { class: "htw-bg-gray-50 htw-h-full dark:htw-bg-gray-750" };
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
__name: "StoryViewer",
|
|
13
|
+
setup(__props) {
|
|
14
|
+
useCssVars((_ctx) => {
|
|
15
|
+
var _a;
|
|
16
|
+
return {
|
|
17
|
+
"249174dc": (_a = unref(variant)) == null ? void 0 : _a.iconColor
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
const storyStore = useStoryStore();
|
|
21
|
+
const variant = computed(() => storyStore.currentVariant);
|
|
22
|
+
const isMenuOpened = ref(false);
|
|
23
|
+
function closeMenu() {
|
|
24
|
+
isMenuOpened.value = false;
|
|
25
|
+
}
|
|
26
|
+
watch(variant, () => {
|
|
27
|
+
isMenuOpened.value = false;
|
|
28
|
+
});
|
|
29
|
+
return (_ctx, _cache) => {
|
|
30
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
31
|
+
createElementVNode("div", _hoisted_1, [
|
|
32
|
+
unref(storyStore).currentStory.layout.type === "grid" ? (openBlock(), createBlock(_sfc_main$1, { key: 0 })) : unref(storyStore).currentStory.layout.type === "single" ? (openBlock(), createBlock(StoryVariantSingle, {
|
|
33
|
+
key: 1,
|
|
34
|
+
onOpenVariantMenu: _cache[0] || (_cache[0] = ($event) => isMenuOpened.value = true)
|
|
35
|
+
})) : createCommentVNode("", true)
|
|
36
|
+
]),
|
|
37
|
+
createVNode(_sfc_main$2, {
|
|
38
|
+
title: "Select a variant",
|
|
39
|
+
opened: isMenuOpened.value,
|
|
40
|
+
onClose: closeMenu
|
|
41
|
+
}, {
|
|
42
|
+
default: withCtx(() => [
|
|
43
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(storyStore).currentStory.variants, (v, index) => {
|
|
44
|
+
return openBlock(), createBlock(StoryVariantListItem, {
|
|
45
|
+
key: index,
|
|
46
|
+
variant: v
|
|
47
|
+
}, null, 8, ["variant"]);
|
|
48
|
+
}), 128))
|
|
49
|
+
]),
|
|
50
|
+
_: 1
|
|
51
|
+
}, 8, ["opened"])
|
|
52
|
+
], 64);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export {
|
|
57
|
+
_sfc_main as default
|
|
58
|
+
};
|
|
@@ -1,85 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const _withScopeId = (n) => (pushScopeId("data-v-bc4883a4"), n = n(), popScopeId(), n);
|
|
9
|
-
const _hoisted_1 = { class: "htw-cursor-pointer hover:htw-text-primary-500 htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 htw-group" };
|
|
10
|
-
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "bind-preview-bg htw-w-4 htw-h-4 htw-rounded-full htw-border htw-border-black/50 dark:htw-border-white/50" }, null, -1));
|
|
11
|
-
const _hoisted_3 = { class: "htw-flex htw-flex-col htw-items-stretch" };
|
|
12
|
-
const _hoisted_4 = /* @__PURE__ */ createTextVNode(" Checkerboard ");
|
|
13
|
-
const _hoisted_5 = ["onClick"];
|
|
14
|
-
const _hoisted_6 = { class: "htw-mr-auto" };
|
|
15
|
-
const _hoisted_7 = { class: "htw-ml-auto htw-opacity-70" };
|
|
16
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
-
__name: "StoryVariantBackground",
|
|
18
|
-
setup(__props) {
|
|
19
|
-
useCssVars((_ctx) => ({
|
|
20
|
-
"6bcdf233": unref(settings).backgroundColor
|
|
21
|
-
}));
|
|
22
|
-
const settings = usePreviewSettingsStore().currentSettings;
|
|
23
|
-
return (_ctx, _cache) => {
|
|
24
|
-
const _component_VDropdown = resolveComponent("VDropdown");
|
|
25
|
-
const _directive_tooltip = resolveDirective("tooltip");
|
|
26
|
-
return unref(histoireConfig).backgroundPresets.length ? (openBlock(), createBlock(_component_VDropdown, {
|
|
27
|
-
key: 0,
|
|
28
|
-
placement: "bottom-end",
|
|
29
|
-
skidding: 6,
|
|
30
|
-
class: "htw-h-full htw-flex-none"
|
|
31
|
-
}, {
|
|
32
|
-
popper: withCtx(({ hide }) => [
|
|
33
|
-
createElementVNode("div", _hoisted_3, [
|
|
34
|
-
createVNode(_sfc_main$1, {
|
|
35
|
-
modelValue: unref(settings).checkerboard,
|
|
36
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(settings).checkerboard = $event)
|
|
37
|
-
}, {
|
|
38
|
-
default: withCtx(() => [
|
|
39
|
-
_hoisted_4
|
|
40
|
-
]),
|
|
41
|
-
_: 1
|
|
42
|
-
}, 8, ["modelValue"]),
|
|
43
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(histoireConfig).backgroundPresets, (option, index) => {
|
|
44
|
-
return openBlock(), createElementBlock("button", {
|
|
45
|
-
key: index,
|
|
46
|
-
class: normalizeClass(["htw-px-4 htw-py-3 htw-cursor-pointer htw-text-left htw-flex htw-gap-4", [
|
|
47
|
-
unref(settings).backgroundColor === option.color ? "htw-bg-primary-500 hover:htw-bg-primary-600 htw-text-white dark:htw-text-black" : "htw-bg-transparent hover:htw-bg-primary-100 dark:hover:htw-bg-primary-700"
|
|
48
|
-
]]),
|
|
49
|
-
onClick: ($event) => {
|
|
50
|
-
unref(settings).backgroundColor = option.color;
|
|
51
|
-
hide();
|
|
52
|
-
}
|
|
53
|
-
}, [
|
|
54
|
-
createElementVNode("span", _hoisted_6, toDisplayString(option.label), 1),
|
|
55
|
-
option.color !== "$checkerboard" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
56
|
-
createElementVNode("span", _hoisted_7, toDisplayString(option.color), 1),
|
|
57
|
-
createElementVNode("div", {
|
|
58
|
-
class: "htw-w-4 htw-h-4 htw-rounded-full htw-border htw-border-black/20 dark:htw-border-white/20",
|
|
59
|
-
style: normalizeStyle({
|
|
60
|
-
backgroundColor: option.color
|
|
61
|
-
})
|
|
62
|
-
}, null, 4)
|
|
63
|
-
], 64)) : createCommentVNode("", true)
|
|
64
|
-
], 10, _hoisted_5);
|
|
65
|
-
}), 128))
|
|
66
|
-
])
|
|
67
|
-
]),
|
|
68
|
-
default: withCtx(() => [
|
|
69
|
-
withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
|
|
70
|
-
_hoisted_2,
|
|
71
|
-
createVNode(unref(Icon), {
|
|
72
|
-
icon: "carbon:caret-down",
|
|
73
|
-
class: "htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
|
|
74
|
-
})
|
|
75
|
-
])), [
|
|
76
|
-
[_directive_tooltip, "Background color"]
|
|
77
|
-
])
|
|
78
|
-
]),
|
|
79
|
-
_: 1
|
|
80
|
-
})) : createCommentVNode("", true);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
var StoryVariantBackground = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bc4883a4"]]);
|
|
85
|
-
export { StoryVariantBackground as default };
|
|
1
|
+
import _sfc_main from "./StoryVariantBackground.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import "./StoryVariantBackground.vue_vue_type_style_index_0_scoped_8dc02d19_lang.js";
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const StoryVariantBackground = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8dc02d19"]]);
|
|
5
|
+
export {
|
|
6
|
+
StoryVariantBackground as default
|
|
7
|
+
};
|