@histoire/app 0.10.7 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/style/main.pcss +12 -1
- 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 +79 -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 +130 -0
- package/dist/bundled/components/story/StoryVariantGridItem.js +7 -108
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js +134 -0
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_style_index_0_scoped_5ded7495_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 +40 -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 +203 -122
- 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/StoryControls.vue +5 -3
- 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/StoryVariantGrid.vue +57 -18
- package/src/app/components/story/StoryVariantGridItem.vue +37 -10
- 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 +12 -1
- 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
|
@@ -1,58 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const _withScopeId = (n) => (pushScopeId("data-v-7f8cccbc"), n = n(), popScopeId(), n);
|
|
9
|
-
const _hoisted_1 = { class: "htw-truncate" };
|
|
10
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
-
__name: "StoryVariantListItem",
|
|
12
|
-
props: {
|
|
13
|
-
variant: {
|
|
14
|
-
type: Object,
|
|
15
|
-
required: true
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
setup(__props) {
|
|
19
|
-
const props = __props;
|
|
20
|
-
useCssVars((_ctx) => ({
|
|
21
|
-
"cebc8760": unref(variant).iconColor
|
|
22
|
-
}));
|
|
23
|
-
const { variant } = toRefs(props);
|
|
24
|
-
const { isActive, targetRoute } = useCurrentVariantRoute(variant);
|
|
25
|
-
const el = ref();
|
|
26
|
-
useScrollOnActive(isActive, el);
|
|
27
|
-
return (_ctx, _cache) => {
|
|
28
|
-
return openBlock(), createElementBlock("div", {
|
|
29
|
-
ref_key: "el",
|
|
30
|
-
ref: el,
|
|
31
|
-
"data-test-id": "story-variant-list-item"
|
|
32
|
-
}, [
|
|
33
|
-
createVNode(BaseListItemLink, {
|
|
34
|
-
to: unref(targetRoute),
|
|
35
|
-
"is-active": unref(isActive),
|
|
36
|
-
class: "htw-px-2 htw-py-2 md:htw-py-1.5 htw-m-1 htw-rounded-sm htw-flex htw-items-center htw-gap-2"
|
|
37
|
-
}, {
|
|
38
|
-
default: withCtx(({ active }) => {
|
|
39
|
-
var _a;
|
|
40
|
-
return [
|
|
41
|
-
createVNode(unref(Icon), {
|
|
42
|
-
icon: (_a = unref(variant).icon) != null ? _a : "carbon:cube",
|
|
43
|
-
class: normalizeClass(["base-list-item-link-icon htw-w-5 htw-h-5 sm:htw-w-4 sm:htw-h-4 htw-flex-none", {
|
|
44
|
-
"htw-text-gray-500": !active && !unref(variant).iconColor,
|
|
45
|
-
"bind-icon-color": !active && unref(variant).iconColor
|
|
46
|
-
}])
|
|
47
|
-
}, null, 8, ["icon", "class"]),
|
|
48
|
-
createElementVNode("span", _hoisted_1, toDisplayString(unref(variant).title), 1)
|
|
49
|
-
];
|
|
50
|
-
}),
|
|
51
|
-
_: 1
|
|
52
|
-
}, 8, ["to", "is-active"])
|
|
53
|
-
], 512);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
var StoryVariantListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7f8cccbc"]]);
|
|
58
|
-
export { StoryVariantListItem as default };
|
|
1
|
+
import _sfc_main from "./StoryVariantListItem.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import "./StoryVariantListItem.vue_vue_type_style_index_0_scoped_cc25ec8b_lang.js";
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const StoryVariantListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cc25ec8b"]]);
|
|
5
|
+
export {
|
|
6
|
+
StoryVariantListItem as default
|
|
7
|
+
};
|
package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineComponent, useCssVars, unref, toRefs, ref, openBlock, createElementBlock, createVNode, withCtx, normalizeClass, createElementVNode, toDisplayString, pushScopeId, popScopeId } from "@histoire/vendors/vue";
|
|
2
|
+
import { useCurrentVariantRoute } from "../../util/variant.js";
|
|
3
|
+
import BaseListItemLink from "../base/BaseListItemLink.js";
|
|
4
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
5
|
+
import { useScrollOnActive } from "../../util/scroll.js";
|
|
6
|
+
const _withScopeId = (n) => (pushScopeId("data-v-cc25ec8b"), n = n(), popScopeId(), n);
|
|
7
|
+
const _hoisted_1 = { class: "htw-truncate" };
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "StoryVariantListItem",
|
|
10
|
+
props: {
|
|
11
|
+
variant: {
|
|
12
|
+
type: Object,
|
|
13
|
+
required: true
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
useCssVars((_ctx) => ({
|
|
19
|
+
"0a652b00": unref(variant).iconColor
|
|
20
|
+
}));
|
|
21
|
+
const { variant } = toRefs(props);
|
|
22
|
+
const { isActive, targetRoute } = useCurrentVariantRoute(variant);
|
|
23
|
+
const el = ref();
|
|
24
|
+
useScrollOnActive(isActive, el);
|
|
25
|
+
return (_ctx, _cache) => {
|
|
26
|
+
return openBlock(), createElementBlock("div", {
|
|
27
|
+
ref_key: "el",
|
|
28
|
+
ref: el,
|
|
29
|
+
"data-test-id": "story-variant-list-item"
|
|
30
|
+
}, [
|
|
31
|
+
createVNode(BaseListItemLink, {
|
|
32
|
+
to: unref(targetRoute),
|
|
33
|
+
"is-active": unref(isActive),
|
|
34
|
+
class: "htw-px-2 htw-py-2 md:htw-py-1.5 htw-m-1 htw-rounded-sm htw-flex htw-items-center htw-gap-2"
|
|
35
|
+
}, {
|
|
36
|
+
default: withCtx(({ active }) => {
|
|
37
|
+
var _a;
|
|
38
|
+
return [
|
|
39
|
+
createVNode(unref(Icon), {
|
|
40
|
+
icon: (_a = unref(variant).icon) != null ? _a : "carbon:cube",
|
|
41
|
+
class: normalizeClass(["base-list-item-link-icon htw-w-5 htw-h-5 sm:htw-w-4 sm:htw-h-4 htw-flex-none", {
|
|
42
|
+
"htw-text-gray-500": !active && !unref(variant).iconColor,
|
|
43
|
+
"bind-icon-color": !active && unref(variant).iconColor
|
|
44
|
+
}])
|
|
45
|
+
}, null, 8, ["icon", "class"]),
|
|
46
|
+
createElementVNode("span", _hoisted_1, toDisplayString(unref(variant).title), 1)
|
|
47
|
+
];
|
|
48
|
+
}),
|
|
49
|
+
_: 1
|
|
50
|
+
}, 8, ["to", "is-active"])
|
|
51
|
+
], 512);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
_sfc_main as default
|
|
57
|
+
};
|
|
@@ -1,115 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import _sfc_main$1 from "./StoryVariantSingleView.js";
|
|
8
|
-
import "./StoryVariantSingle.vue_vue_type_style_index_0_scoped_true_lang.js";
|
|
9
|
-
import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
|
|
10
|
-
const _withScopeId = (n) => (pushScopeId("data-v-2ca2325e"), n = n(), popScopeId(), n);
|
|
11
|
-
const _hoisted_1 = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "htw-p-2 htw-h-full"
|
|
1
|
+
import _sfc_main from "./StoryVariantSingle.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import "./StoryVariantSingle.vue_vue_type_style_index_0_scoped_afe0bbc2_lang.js";
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const StoryVariantSingle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-afe0bbc2"]]);
|
|
5
|
+
export {
|
|
6
|
+
StoryVariantSingle as default
|
|
14
7
|
};
|
|
15
|
-
const _hoisted_2 = {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "htw-divide-y htw-divide-gray-100 dark:htw-divide-gray-800 htw-h-full htw-flex htw-flex-col"
|
|
18
|
-
};
|
|
19
|
-
const _hoisted_3 = /* @__PURE__ */ createTextVNode(" Select a variant... ");
|
|
20
|
-
const _hoisted_4 = {
|
|
21
|
-
key: 0,
|
|
22
|
-
class: "htw-p-2 htw-h-full"
|
|
23
|
-
};
|
|
24
|
-
const _hoisted_5 = { class: "htw-h-full htw-overflow-y-auto" };
|
|
25
|
-
const _hoisted_6 = {
|
|
26
|
-
key: 0,
|
|
27
|
-
class: "htw-p-2 htw-h-full"
|
|
28
|
-
};
|
|
29
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
30
|
-
__name: "StoryVariantSingle",
|
|
31
|
-
emits: {
|
|
32
|
-
"open-variant-menu": () => true
|
|
33
|
-
},
|
|
34
|
-
setup(__props) {
|
|
35
|
-
useCssVars((_ctx) => {
|
|
36
|
-
var _a;
|
|
37
|
-
return {
|
|
38
|
-
"0589c2c6": (_a = unref(variant)) == null ? void 0 : _a.iconColor
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
const storyStore = useStoryStore();
|
|
42
|
-
const hasSingleVariant = computed(() => {
|
|
43
|
-
var _a;
|
|
44
|
-
return ((_a = storyStore.currentStory) == null ? void 0 : _a.variants.length) === 1;
|
|
45
|
-
});
|
|
46
|
-
const variant = computed(() => storyStore.currentVariant);
|
|
47
|
-
return (_ctx, _cache) => {
|
|
48
|
-
var _a;
|
|
49
|
-
return unref(hasSingleVariant) && unref(variant) ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
50
|
-
createVNode(_sfc_main$1, {
|
|
51
|
-
variant: unref(variant),
|
|
52
|
-
story: unref(storyStore).currentStory
|
|
53
|
-
}, null, 8, ["variant", "story"])
|
|
54
|
-
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
55
|
-
unref(isMobile) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
56
|
-
createElementVNode("a", {
|
|
57
|
-
class: "htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center htw-flex-none",
|
|
58
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("open-variant-menu"))
|
|
59
|
-
}, [
|
|
60
|
-
unref(variant) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
61
|
-
createVNode(unref(Icon), {
|
|
62
|
-
icon: (_a = unref(variant).icon) != null ? _a : "carbon:cube",
|
|
63
|
-
class: normalizeClass(["base-list-item-link-icon htw-w-5 htw-h-5 htw-flex-none", {
|
|
64
|
-
"htw-text-gray-500": !unref(variant).iconColor,
|
|
65
|
-
"bind-icon-color": unref(variant).iconColor
|
|
66
|
-
}])
|
|
67
|
-
}, null, 8, ["icon", "class"]),
|
|
68
|
-
createTextVNode(" " + toDisplayString(unref(variant).title), 1)
|
|
69
|
-
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
70
|
-
_hoisted_3
|
|
71
|
-
], 64)),
|
|
72
|
-
createVNode(unref(Icon), {
|
|
73
|
-
icon: "carbon:chevron-sort",
|
|
74
|
-
class: "htw-w-5 htw-h-5 htw-shrink-0 htw-ml-auto"
|
|
75
|
-
})
|
|
76
|
-
]),
|
|
77
|
-
unref(storyStore).currentVariant ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
78
|
-
createVNode(_sfc_main$1, {
|
|
79
|
-
variant: unref(storyStore).currentVariant,
|
|
80
|
-
story: unref(storyStore).currentStory
|
|
81
|
-
}, null, 8, ["variant", "story"])
|
|
82
|
-
])) : createCommentVNode("", true)
|
|
83
|
-
])) : (openBlock(), createBlock(BaseSplitPane, {
|
|
84
|
-
key: 1,
|
|
85
|
-
"save-id": "story-single-main-split",
|
|
86
|
-
min: 5,
|
|
87
|
-
max: 40,
|
|
88
|
-
"default-split": 17
|
|
89
|
-
}, {
|
|
90
|
-
first: withCtx(() => [
|
|
91
|
-
createElementVNode("div", _hoisted_5, [
|
|
92
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(storyStore).currentStory.variants, (v, index) => {
|
|
93
|
-
return openBlock(), createBlock(StoryVariantListItem, {
|
|
94
|
-
key: index,
|
|
95
|
-
variant: v
|
|
96
|
-
}, null, 8, ["variant"]);
|
|
97
|
-
}), 128))
|
|
98
|
-
])
|
|
99
|
-
]),
|
|
100
|
-
last: withCtx(() => [
|
|
101
|
-
unref(storyStore).currentVariant ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
102
|
-
createVNode(_sfc_main$1, {
|
|
103
|
-
variant: unref(storyStore).currentVariant,
|
|
104
|
-
story: unref(storyStore).currentStory
|
|
105
|
-
}, null, 8, ["variant", "story"])
|
|
106
|
-
])) : createCommentVNode("", true)
|
|
107
|
-
]),
|
|
108
|
-
_: 1
|
|
109
|
-
}))
|
|
110
|
-
], 64));
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
var StoryVariantSingle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2ca2325e"]]);
|
|
115
|
-
export { StoryVariantSingle as default };
|
package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { defineComponent, useCssVars, unref, computed, openBlock, createElementBlock, createVNode, Fragment, createElementVNode, normalizeClass, createTextVNode, toDisplayString, createCommentVNode, createBlock, withCtx, renderList, pushScopeId, popScopeId } from "@histoire/vendors/vue";
|
|
2
|
+
import { useStoryStore } from "../../stores/story.js";
|
|
3
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
4
|
+
import { isMobile } from "../../util/responsive.js";
|
|
5
|
+
import BaseSplitPane from "../base/BaseSplitPane.js";
|
|
6
|
+
import StoryVariantListItem from "./StoryVariantListItem.js";
|
|
7
|
+
import "./StoryVariantSingleView.js";
|
|
8
|
+
import _sfc_main$1 from "./StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js";
|
|
9
|
+
const _withScopeId = (n) => (pushScopeId("data-v-afe0bbc2"), n = n(), popScopeId(), n);
|
|
10
|
+
const _hoisted_1 = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "htw-p-2 htw-h-full __histoire-pane-shadow-from-right"
|
|
13
|
+
};
|
|
14
|
+
const _hoisted_2 = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "htw-divide-y htw-divide-gray-100 dark:htw-divide-gray-800 htw-h-full htw-flex htw-flex-col"
|
|
17
|
+
};
|
|
18
|
+
const _hoisted_3 = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "htw-p-2 htw-h-full"
|
|
21
|
+
};
|
|
22
|
+
const _hoisted_4 = { class: "htw-h-full htw-overflow-y-auto" };
|
|
23
|
+
const _hoisted_5 = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "htw-p-2 htw-h-full __histoire-pane-shadow-from-right"
|
|
26
|
+
};
|
|
27
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
28
|
+
__name: "StoryVariantSingle",
|
|
29
|
+
emits: {
|
|
30
|
+
"open-variant-menu": () => true
|
|
31
|
+
},
|
|
32
|
+
setup(__props) {
|
|
33
|
+
useCssVars((_ctx) => {
|
|
34
|
+
var _a;
|
|
35
|
+
return {
|
|
36
|
+
"1c98af6a": (_a = unref(variant)) == null ? void 0 : _a.iconColor
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
const storyStore = useStoryStore();
|
|
40
|
+
const hasSingleVariant = computed(() => {
|
|
41
|
+
var _a;
|
|
42
|
+
return ((_a = storyStore.currentStory) == null ? void 0 : _a.variants.length) === 1;
|
|
43
|
+
});
|
|
44
|
+
const variant = computed(() => storyStore.currentVariant);
|
|
45
|
+
return (_ctx, _cache) => {
|
|
46
|
+
var _a;
|
|
47
|
+
return unref(hasSingleVariant) && unref(variant) ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
48
|
+
createVNode(_sfc_main$1, {
|
|
49
|
+
variant: unref(variant),
|
|
50
|
+
story: unref(storyStore).currentStory
|
|
51
|
+
}, null, 8, ["variant", "story"])
|
|
52
|
+
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
53
|
+
unref(isMobile) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
54
|
+
createElementVNode("a", {
|
|
55
|
+
class: "htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center htw-flex-none",
|
|
56
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("open-variant-menu"))
|
|
57
|
+
}, [
|
|
58
|
+
unref(variant) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
59
|
+
createVNode(unref(Icon), {
|
|
60
|
+
icon: (_a = unref(variant).icon) != null ? _a : "carbon:cube",
|
|
61
|
+
class: normalizeClass(["base-list-item-link-icon htw-w-5 htw-h-5 htw-flex-none", {
|
|
62
|
+
"htw-text-gray-500": !unref(variant).iconColor,
|
|
63
|
+
"bind-icon-color": unref(variant).iconColor
|
|
64
|
+
}])
|
|
65
|
+
}, null, 8, ["icon", "class"]),
|
|
66
|
+
createTextVNode(" " + toDisplayString(unref(variant).title), 1)
|
|
67
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
68
|
+
createTextVNode(" Select a variant... ")
|
|
69
|
+
], 64)),
|
|
70
|
+
createVNode(unref(Icon), {
|
|
71
|
+
icon: "carbon:chevron-sort",
|
|
72
|
+
class: "htw-w-5 htw-h-5 htw-shrink-0 htw-ml-auto"
|
|
73
|
+
})
|
|
74
|
+
]),
|
|
75
|
+
unref(storyStore).currentVariant ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
76
|
+
createVNode(_sfc_main$1, {
|
|
77
|
+
variant: unref(storyStore).currentVariant,
|
|
78
|
+
story: unref(storyStore).currentStory
|
|
79
|
+
}, null, 8, ["variant", "story"])
|
|
80
|
+
])) : createCommentVNode("", true)
|
|
81
|
+
])) : (openBlock(), createBlock(BaseSplitPane, {
|
|
82
|
+
key: 1,
|
|
83
|
+
"save-id": "story-single-main-split",
|
|
84
|
+
min: 5,
|
|
85
|
+
max: 40,
|
|
86
|
+
"default-split": 17
|
|
87
|
+
}, {
|
|
88
|
+
first: withCtx(() => [
|
|
89
|
+
createElementVNode("div", _hoisted_4, [
|
|
90
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(storyStore).currentStory.variants, (v, index) => {
|
|
91
|
+
return openBlock(), createBlock(StoryVariantListItem, {
|
|
92
|
+
key: index,
|
|
93
|
+
variant: v
|
|
94
|
+
}, null, 8, ["variant"]);
|
|
95
|
+
}), 128))
|
|
96
|
+
])
|
|
97
|
+
]),
|
|
98
|
+
last: withCtx(() => [
|
|
99
|
+
unref(storyStore).currentVariant ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
100
|
+
createVNode(_sfc_main$1, {
|
|
101
|
+
variant: unref(storyStore).currentVariant,
|
|
102
|
+
story: unref(storyStore).currentStory
|
|
103
|
+
}, null, 8, ["variant", "story"])
|
|
104
|
+
])) : createCommentVNode("", true)
|
|
105
|
+
]),
|
|
106
|
+
_: 1
|
|
107
|
+
}))
|
|
108
|
+
], 64));
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
export {
|
|
113
|
+
_sfc_main as default
|
|
114
|
+
};
|
|
@@ -1,45 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
props: {
|
|
7
|
-
story: null,
|
|
8
|
-
variant: null
|
|
9
|
-
},
|
|
10
|
-
setup(__props) {
|
|
11
|
-
const props = __props;
|
|
12
|
-
Object.assign(props.variant, {
|
|
13
|
-
previewReady: false
|
|
14
|
-
});
|
|
15
|
-
function onReady() {
|
|
16
|
-
Object.assign(props.variant, {
|
|
17
|
-
previewReady: true
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return (_ctx, _cache) => {
|
|
21
|
-
return openBlock(), createBlock(StoryResponsivePreview, { variant: __props.variant }, {
|
|
22
|
-
default: withCtx(({ isResponsiveEnabled, finalWidth, finalHeight }) => [
|
|
23
|
-
createElementVNode("div", {
|
|
24
|
-
style: normalizeStyle(isResponsiveEnabled ? {
|
|
25
|
-
width: finalWidth ? `${finalWidth}px` : "100%",
|
|
26
|
-
height: finalHeight ? `${finalHeight}px` : "100%"
|
|
27
|
-
} : { width: "100%", height: "100%" }),
|
|
28
|
-
class: "htw-relative",
|
|
29
|
-
"data-test-id": "sandbox-render"
|
|
30
|
-
}, [
|
|
31
|
-
(openBlock(), createBlock(_sfc_main$1, {
|
|
32
|
-
key: `${__props.story.id}-${__props.variant.id}`,
|
|
33
|
-
variant: __props.variant,
|
|
34
|
-
story: __props.story,
|
|
35
|
-
class: "htw-h-full",
|
|
36
|
-
onReady
|
|
37
|
-
}, null, 8, ["variant", "story"]))
|
|
38
|
-
], 4)
|
|
39
|
-
]),
|
|
40
|
-
_: 1
|
|
41
|
-
}, 8, ["variant"]);
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
export { _sfc_main as default };
|
|
1
|
+
import _sfc_main from "./StoryVariantSinglePreviewNative.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./StoryVariantSinglePreviewNative.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
5
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeStyle } from "@histoire/vendors/vue";
|
|
2
|
+
import "./GenericRenderStory.js";
|
|
3
|
+
import StoryResponsivePreview from "./StoryResponsivePreview.js";
|
|
4
|
+
import _sfc_main$1 from "./GenericRenderStory.vue_vue_type_script_setup_true_lang.js";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "StoryVariantSinglePreviewNative",
|
|
7
|
+
props: {
|
|
8
|
+
story: null,
|
|
9
|
+
variant: null
|
|
10
|
+
},
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
Object.assign(props.variant, {
|
|
14
|
+
previewReady: false
|
|
15
|
+
});
|
|
16
|
+
function onReady() {
|
|
17
|
+
Object.assign(props.variant, {
|
|
18
|
+
previewReady: true
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
return openBlock(), createBlock(StoryResponsivePreview, { variant: __props.variant }, {
|
|
23
|
+
default: withCtx(({ isResponsiveEnabled, finalWidth, finalHeight }) => [
|
|
24
|
+
createElementVNode("div", {
|
|
25
|
+
style: normalizeStyle(isResponsiveEnabled ? {
|
|
26
|
+
width: finalWidth ? `${finalWidth}px` : "100%",
|
|
27
|
+
height: finalHeight ? `${finalHeight}px` : "100%"
|
|
28
|
+
} : { width: "100%", height: "100%" }),
|
|
29
|
+
class: "htw-relative",
|
|
30
|
+
"data-test-id": "sandbox-render"
|
|
31
|
+
}, [
|
|
32
|
+
(openBlock(), createBlock(_sfc_main$1, {
|
|
33
|
+
key: `${__props.story.id}-${__props.variant.id}`,
|
|
34
|
+
variant: __props.variant,
|
|
35
|
+
story: __props.story,
|
|
36
|
+
class: "htw-h-full",
|
|
37
|
+
onReady
|
|
38
|
+
}, null, 8, ["variant", "story"]))
|
|
39
|
+
], 4)
|
|
40
|
+
]),
|
|
41
|
+
_: 1
|
|
42
|
+
}, 8, ["variant"]);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
_sfc_main as default
|
|
48
|
+
};
|
|
@@ -1,122 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 { _sfc_main as default };
|
|
1
|
+
import _sfc_main from "./StoryVariantSinglePreviewRemote.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./StoryVariantSinglePreviewRemote.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
5
|
+
};
|