@poveste/app 0.13.1 → 0.15.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.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/app.css +31 -31
- package/dist/bundled/components/HomeView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/app/AppLogo.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/bundled/components/app/Breadcrumb.js +1 -1
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/bundled/components/app/TopBar.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/bundled/components/app/TopBarChipItem.js +1 -1
- package/dist/bundled/components/base/BaseCheckbox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/base/BaseEmpty.js +2 -2
- package/dist/bundled/components/base/BaseOverflowMenu.vue_vue_type_script_setup_true_lang.js +18 -15
- package/dist/bundled/components/base/BaseSelect.vue_vue_type_script_setup_true_lang.js +158 -26
- package/dist/bundled/components/base/BaseSplitPane.js +1 -1
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_script_setup_true_lang.js +6 -4
- package/dist/bundled/components/command/CommandPrompts.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/command/CommandPromptsModal.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/bundled/components/command/PromptSelect.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/bundled/components/command/PromptText.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue_vue_type_script_setup_true_lang.js +20 -14
- package/dist/bundled/components/panel/PaneTabs.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/bundled/components/panel/StatePresets.vue_vue_type_script_setup_true_lang.js +94 -55
- package/dist/bundled/components/panel/StoryControls.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/panel/StoryDocs.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/bundled/components/panel/StoryEvent.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/bundled/components/panel/StoryEvents.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/bundled/components/panel/StorySidePanel.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/bundled/components/panel/StorySourceCode.js +1 -1
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/bundled/components/search/SearchItemContent.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/bundled/components/search/SearchPane.vue_vue_type_script_setup_true_lang.js +16 -9
- package/dist/bundled/components/story/GenericMountStory.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/bundled/components/story/GenericRenderStory.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/bundled/components/story/StoryResponsivePreview.js +1 -1
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js +23 -8
- package/dist/bundled/components/story/StoryVariantGrid.js +1 -1
- package/dist/bundled/components/story/StoryVariantGrid.vue_vue_type_script_setup_true_lang.js +15 -10
- package/dist/bundled/components/story/StoryVariantGridItem.js +1 -1
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue_vue_type_script_setup_true_lang.js +9 -6
- package/dist/bundled/components/story/StoryView.vue_vue_type_script_setup_true_lang.js +7 -3
- package/dist/bundled/components/story/StoryViewer.js +1 -1
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/bundled/components/toolbar/ToolbarBackground.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue_vue_type_script_setup_true_lang.js +17 -16
- package/dist/bundled/components/toolbar/ToolbarTitle.js +1 -1
- package/dist/bundled/components/toolbar/ToolbarTitle.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/tree/StoryGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/bundled/components/tree/StoryList.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/bundled/components/tree/StoryListFolder.js +1 -1
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/bundled/components/tree/StoryListItem.js +1 -1
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/bundled/plugin.js +4 -3
- package/dist/bundled/sandbox.js +5 -4
- package/dist/bundled/stores/folder.js +1 -1
- package/dist/bundled/stores/story.js +2 -2
- package/dist/bundled/util/commands.js +21 -10
- package/dist/bundled/util/dark.js +1 -1
- package/dist/bundled/util/docs.js +2 -1
- package/dist/bundled/util/events.js +1 -1
- package/dist/bundled/util/grid-slots.js +2 -2
- package/dist/bundled/util/icons.generated.js +0 -1
- package/dist/bundled/util/keyboard.js +9 -14
- package/dist/bundled/util/mapping.js +3 -3
- package/dist/bundled/util/preview-settings.js +1 -1
- package/dist/bundled/util/render-tracker.js +33 -0
- package/dist/bundled/util/variant.js +12 -2
- package/dist/style.css +23 -1
- package/package.json +14 -18
- package/src/__tests__/render-tracker.spec.ts +38 -0
- package/src/app/App.vue +7 -4
- package/src/app/components/HomeView.vue +1 -1
- package/src/app/components/app/AppLogo.vue +6 -2
- package/src/app/components/app/Breadcrumb.vue +2 -1
- package/src/app/components/app/TopBar.vue +7 -2
- package/src/app/components/app/TopBarChipItem.vue +1 -1
- package/src/app/components/base/BaseCheckbox.vue +1 -1
- package/src/app/components/base/BaseEmpty.vue +1 -1
- package/src/app/components/base/BaseListItemLink.vue +4 -2
- package/src/app/components/base/BaseOverflowMenu.vue +25 -18
- package/src/app/components/base/BaseSelect.vue +171 -15
- package/src/app/components/base/BaseSplitPane.vue +11 -6
- package/src/app/components/command/CommandPrompts.vue +1 -1
- package/src/app/components/command/CommandPromptsModal.vue +1 -0
- package/src/app/components/command/PromptSelect.vue +3 -2
- package/src/app/components/command/PromptText.vue +7 -3
- package/src/app/components/panel/ControlsComponentPropItem.vue +26 -15
- package/src/app/components/panel/PaneTabs.vue +6 -6
- package/src/app/components/panel/StatePresets.vue +125 -68
- package/src/app/components/panel/StoryControls.vue +1 -1
- package/src/app/components/panel/StoryDocs.vue +3 -1
- package/src/app/components/panel/StoryEvent.vue +7 -2
- package/src/app/components/panel/StoryEvents.vue +4 -1
- package/src/app/components/panel/StorySidePanel.vue +3 -1
- package/src/app/components/panel/StorySourceCode.vue +12 -8
- package/src/app/components/search/SearchItemContent.vue +2 -1
- package/src/app/components/search/SearchPane.vue +16 -8
- package/src/app/components/story/GenericMountStory.vue +2 -1
- package/src/app/components/story/GenericRenderStory.vue +2 -1
- package/src/app/components/story/StoryResponsivePreview.vue +36 -7
- package/src/app/components/story/StoryVariantGrid.vue +33 -16
- package/src/app/components/story/StoryVariantGridItem.vue +1 -1
- package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +14 -8
- package/src/app/components/story/StoryView.vue +10 -4
- package/src/app/components/story/StoryViewer.vue +3 -3
- package/src/app/components/toolbar/ToolbarBackground.vue +1 -1
- package/src/app/components/toolbar/ToolbarResponsiveSize.vue +23 -3
- package/src/app/components/toolbar/ToolbarTitle.vue +2 -2
- package/src/app/components/tree/StoryGroup.vue +2 -2
- package/src/app/components/tree/StoryList.vue +2 -2
- package/src/app/components/tree/StoryListFolder.vue +2 -2
- package/src/app/components/tree/StoryListItem.vue +1 -1
- package/src/app/plugin.ts +7 -3
- package/src/app/sandbox.ts +9 -3
- package/src/app/stores/folder.ts +1 -1
- package/src/app/stores/story.ts +2 -2
- package/src/app/types.ts +6 -6
- package/src/app/util/commands.ts +27 -17
- package/src/app/util/dark.ts +1 -1
- package/src/app/util/docs.ts +2 -1
- package/src/app/util/env.ts +0 -1
- package/src/app/util/events.ts +6 -5
- package/src/app/util/grid-slots.ts +2 -2
- package/src/app/util/icons.generated.ts +1 -1
- package/src/app/util/keyboard.ts +10 -11
- package/src/app/util/mapping.ts +3 -3
- package/src/app/util/preview-settings.ts +1 -1
- package/src/app/util/render-tracker.ts +31 -0
- package/src/app/util/scroll.ts +5 -1
- package/src/app/util/state.ts +4 -4
- package/src/app/util/variant.ts +16 -3
- package/src/app/components/base/BaseCopyIcon.vue +0 -34
|
@@ -20,7 +20,7 @@ var PromptText_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
20
20
|
const props = __props;
|
|
21
21
|
const emit = __emit;
|
|
22
22
|
const model = computed({
|
|
23
|
-
get: () => props.modelValue,
|
|
23
|
+
get: () => props.modelValue ?? "",
|
|
24
24
|
set: (value) => emit("update:modelValue", value)
|
|
25
25
|
});
|
|
26
26
|
const input = ref();
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { computed, createBlock, createCommentVNode, createVNode, defineComponent, normalizeClass, openBlock, resolveDirective, resolveDynamicComponent, unref,
|
|
1
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, normalizeClass, openBlock, resolveDirective, resolveDynamicComponent, unref, withDirectives } from "@poveste/vendors/vue";
|
|
2
2
|
import { Icon } from "@poveste/vendors/iconify";
|
|
3
3
|
import { HstCheckbox, HstJson, HstNumber, HstText } from "@poveste/controls";
|
|
4
4
|
//#region src/app/components/panel/ControlsComponentPropItem.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _hoisted_1 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "flex items-end hover:bg-primary-100 dark:hover:bg-primary-800"
|
|
8
|
+
};
|
|
9
|
+
var _hoisted_2 = ["aria-label", "disabled"];
|
|
5
10
|
var ControlsComponentPropItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
11
|
__name: "ControlsComponentPropItem",
|
|
7
12
|
props: {
|
|
@@ -34,25 +39,26 @@ var ControlsComponentPropItem_vue_vue_type_script_setup_true_lang_default = /*@_
|
|
|
34
39
|
const canReset = computed(() => props.variant.state?._hPropState?.[props.component.index] && props.definition.name in props.variant.state._hPropState[props.component.index]);
|
|
35
40
|
return (_ctx, _cache) => {
|
|
36
41
|
const _directive_tooltip = resolveDirective("tooltip");
|
|
37
|
-
return comp.value ? (openBlock(), createBlock(resolveDynamicComponent(comp.value), {
|
|
38
|
-
key: 0,
|
|
42
|
+
return comp.value ? (openBlock(), createElementBlock("div", _hoisted_1, [(openBlock(), createBlock(resolveDynamicComponent(comp.value), {
|
|
39
43
|
modelValue: model.value,
|
|
40
|
-
"onUpdate:modelValue": _cache[
|
|
44
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
41
45
|
placeholder: model.value === void 0 ? __props.definition?.default : null,
|
|
42
|
-
class: "poveste-controls-component-prop-item",
|
|
46
|
+
class: "poveste-controls-component-prop-item grow min-w-0",
|
|
43
47
|
title: `${__props.definition.name}${canReset.value ? " *" : ""}`
|
|
44
|
-
},
|
|
45
|
-
actions: withCtx(() => [withDirectives(createVNode(unref(Icon), {
|
|
46
|
-
icon: "carbon:erase",
|
|
47
|
-
class: normalizeClass(["cursor-pointer w-4 h-4 hover:text-primary-500 dark:hover:text-primary-400 text-gray-900 dark:text-gray-100", [canReset.value ? "opacity-50 hover:opacity-100" : "opacity-25 pointer-events-none"]]),
|
|
48
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => reset(), ["stop"]))
|
|
49
|
-
}, null, 8, ["class"]), [[_directive_tooltip, "Remove override"]])]),
|
|
50
|
-
_: 1
|
|
51
|
-
}, 8, [
|
|
48
|
+
}, null, 8, [
|
|
52
49
|
"modelValue",
|
|
53
50
|
"placeholder",
|
|
54
51
|
"title"
|
|
55
|
-
]))
|
|
52
|
+
])), withDirectives((openBlock(), createElementBlock("button", {
|
|
53
|
+
type: "button",
|
|
54
|
+
"aria-label": `Remove override of ${__props.definition.name}`,
|
|
55
|
+
disabled: !canReset.value,
|
|
56
|
+
class: normalizeClass(["flex-none flex mr-2 mb-[10px] p-0 bg-transparent border-0 cursor-pointer text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400", [canReset.value ? "opacity-50 hover:opacity-100 focus-visible:opacity-100" : "opacity-25 pointer-events-none"]]),
|
|
57
|
+
onClick: _cache[1] || (_cache[1] = ($event) => reset())
|
|
58
|
+
}, [createVNode(unref(Icon), {
|
|
59
|
+
icon: "carbon:erase",
|
|
60
|
+
class: "w-4 h-4"
|
|
61
|
+
})], 10, _hoisted_2)), [[_directive_tooltip, "Remove override"]])])) : createCommentVNode("", true);
|
|
56
62
|
};
|
|
57
63
|
}
|
|
58
64
|
});
|
|
@@ -29,7 +29,7 @@ var PaneTabs_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
29
29
|
tab: ""
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
-
matched: !_ctx.$route.query
|
|
32
|
+
matched: !_ctx.$route.query["tab"]
|
|
33
33
|
}, {
|
|
34
34
|
default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode(" Controls ", -1)])]),
|
|
35
35
|
_: 1
|
|
@@ -42,7 +42,7 @@ var PaneTabs_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
42
42
|
tab: "docs"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
matched: _ctx.$route.query
|
|
45
|
+
matched: _ctx.$route.query["tab"] === "docs",
|
|
46
46
|
class: normalizeClass({ "opacity-70": !unref(renderedDoc) })
|
|
47
47
|
}, {
|
|
48
48
|
default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode(" Docs ", -1)])]),
|
|
@@ -60,7 +60,7 @@ var PaneTabs_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
60
60
|
tab: "events"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
-
matched: _ctx.$route.query
|
|
63
|
+
matched: _ctx.$route.query["tab"] === "events",
|
|
64
64
|
class: normalizeClass({ "opacity-70": !hasEvents.value })
|
|
65
65
|
}, {
|
|
66
66
|
default: withCtx(() => [_cache[5] || (_cache[5] = createTextVNode(" Events ", -1)), unref(eventsStore).unseen ? (openBlock(), createBlock(BaseTag_default, { key: 0 }, {
|
|
@@ -83,7 +83,7 @@ var PaneTabs_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
83
83
|
tab: ""
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
|
-
matched: !_ctx.$route.query
|
|
86
|
+
matched: !_ctx.$route.query["tab"]
|
|
87
87
|
}, {
|
|
88
88
|
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Controls ", -1)])]),
|
|
89
89
|
_: 1
|
|
@@ -96,7 +96,7 @@ var PaneTabs_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
96
96
|
tab: "docs"
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
|
-
matched: _ctx.$route.query
|
|
99
|
+
matched: _ctx.$route.query["tab"] === "docs",
|
|
100
100
|
class: normalizeClass({ "opacity-70": !unref(renderedDoc) })
|
|
101
101
|
}, {
|
|
102
102
|
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" Docs ", -1)])]),
|
|
@@ -114,7 +114,7 @@ var PaneTabs_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
114
114
|
tab: "events"
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
|
-
matched: _ctx.$route.query
|
|
117
|
+
matched: _ctx.$route.query["tab"] === "events",
|
|
118
118
|
class: normalizeClass({ "opacity-70": !hasEvents.value })
|
|
119
119
|
}, {
|
|
120
120
|
default: withCtx(() => [_cache[2] || (_cache[2] = createTextVNode(" Events ", -1)), unref(eventsStore).unseen ? (openBlock(), createBlock(BaseTag_default, { key: 0 }, {
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { toPresetState, toRawDeep } from "../../util/state.js";
|
|
2
2
|
import BaseSelect_default from "../base/BaseSelect.js";
|
|
3
|
-
import { onClickOutside, useStorage, useTimeoutFn } from "@poveste/vendors/vue-use";
|
|
4
|
-
import { computed, createBlock,
|
|
3
|
+
import { onClickOutside, useLiveAnnouncer, useStorage, useTimeoutFn } from "@poveste/vendors/vue-use";
|
|
4
|
+
import { computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, isRef, nextTick, normalizeClass, onMounted, openBlock, ref, resolveDirective, unref, vModelText, withDirectives, withKeys } from "@poveste/vendors/vue";
|
|
5
5
|
import { Icon } from "@poveste/vendors/iconify";
|
|
6
6
|
import { applyState, clone } from "@poveste/shared";
|
|
7
7
|
//#region src/app/components/panel/StatePresets.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var _hoisted_1 = { class: "poveste-state-presets flex gap-2 w-full items-center" };
|
|
9
|
-
var _hoisted_2 = ["
|
|
10
|
-
var _hoisted_3 =
|
|
11
|
-
|
|
12
|
-
class: "flex items-center gap-2"
|
|
13
|
-
};
|
|
14
|
-
var _hoisted_4 = { class: "flex-1 truncate" };
|
|
15
|
-
var _hoisted_5 = { class: "flex gap-2 items-center" };
|
|
16
|
-
var _hoisted_6 = { class: "flex-1 truncate" };
|
|
9
|
+
var _hoisted_2 = ["disabled"];
|
|
10
|
+
var _hoisted_3 = ["disabled"];
|
|
11
|
+
var _hoisted_4 = ["disabled"];
|
|
17
12
|
var DEFAULT_ID = "default";
|
|
18
13
|
var StatePresets_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
19
14
|
__name: "StatePresets",
|
|
@@ -41,13 +36,17 @@ var StatePresets_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
41
36
|
}
|
|
42
37
|
function applyPreset(id) {
|
|
43
38
|
if (id === DEFAULT_ID) resetState();
|
|
44
|
-
else
|
|
39
|
+
else {
|
|
40
|
+
const preset = presetStates.value.get(id);
|
|
41
|
+
if (preset) applyState(props.variant.state, clone(toRawDeep(preset.state)));
|
|
42
|
+
}
|
|
45
43
|
}
|
|
46
44
|
onMounted(() => {
|
|
47
45
|
if (selectedOption.value !== DEFAULT_ID) applyPreset(selectedOption.value);
|
|
48
46
|
});
|
|
49
47
|
const input = ref();
|
|
50
48
|
const select = ref();
|
|
49
|
+
const picker = ref();
|
|
51
50
|
const canEdit = computed(() => selectedOption.value !== DEFAULT_ID);
|
|
52
51
|
const isEditing = ref(false);
|
|
53
52
|
async function createPreset() {
|
|
@@ -59,18 +58,28 @@ var StatePresets_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
59
58
|
selectedOption.value = id;
|
|
60
59
|
isEditing.value = true;
|
|
61
60
|
await nextTick();
|
|
62
|
-
input.value
|
|
61
|
+
input.value?.select();
|
|
63
62
|
}
|
|
63
|
+
const editingLabel = computed({
|
|
64
|
+
get: () => presetStates.value.get(selectedOption.value)?.label ?? "",
|
|
65
|
+
set: (value) => {
|
|
66
|
+
const preset = presetStates.value.get(selectedOption.value);
|
|
67
|
+
if (preset) preset.label = value;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
64
70
|
const savedNotif = ref(false);
|
|
71
|
+
const { polite } = useLiveAnnouncer();
|
|
65
72
|
const savedTimeout = useTimeoutFn(() => {
|
|
66
73
|
savedNotif.value = false;
|
|
67
74
|
}, 1e3);
|
|
68
75
|
async function savePreset() {
|
|
69
76
|
if (!canEdit.value) return;
|
|
70
77
|
const preset = presetStates.value.get(selectedOption.value);
|
|
78
|
+
if (!preset) return;
|
|
71
79
|
preset.state = toPresetState(props.variant.state, omitKeys);
|
|
72
80
|
savedNotif.value = true;
|
|
73
81
|
savedTimeout.start();
|
|
82
|
+
polite("Preset saved");
|
|
74
83
|
}
|
|
75
84
|
function deletePreset(id) {
|
|
76
85
|
if (!confirm("Are you sure you want to delete this preset?")) return;
|
|
@@ -81,12 +90,17 @@ var StatePresets_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
81
90
|
if (!canEdit.value) return;
|
|
82
91
|
isEditing.value = true;
|
|
83
92
|
await nextTick();
|
|
84
|
-
input.value
|
|
93
|
+
input.value?.select();
|
|
85
94
|
}
|
|
86
|
-
function stopEditing() {
|
|
95
|
+
async function stopEditing(refocus = false) {
|
|
96
|
+
if (!isEditing.value) return;
|
|
87
97
|
isEditing.value = false;
|
|
98
|
+
if (refocus) {
|
|
99
|
+
await nextTick();
|
|
100
|
+
picker.value?.focus();
|
|
101
|
+
}
|
|
88
102
|
}
|
|
89
|
-
onClickOutside(select, stopEditing);
|
|
103
|
+
onClickOutside(select, () => stopEditing());
|
|
90
104
|
return (_ctx, _cache) => {
|
|
91
105
|
const _directive_tooltip = resolveDirective("tooltip");
|
|
92
106
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -94,53 +108,78 @@ var StatePresets_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
94
108
|
ref_key: "select",
|
|
95
109
|
ref: select,
|
|
96
110
|
class: "flex-1 min-w-0"
|
|
97
|
-
}, [
|
|
111
|
+
}, [isEditing.value ? withDirectives((openBlock(), createElementBlock("input", {
|
|
112
|
+
key: 0,
|
|
113
|
+
ref_key: "input",
|
|
114
|
+
ref: input,
|
|
115
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => editingLabel.value = $event),
|
|
116
|
+
type: "text",
|
|
117
|
+
"aria-label": "Preset name",
|
|
118
|
+
class: "text-inherit bg-transparent w-full px-2 h-[27px] -my-1 border border-solid border-primary-500 rounded-sm outline-none",
|
|
119
|
+
onKeydown: [_cache[1] || (_cache[1] = withKeys(($event) => stopEditing(true), ["enter"])), _cache[2] || (_cache[2] = withKeys(($event) => stopEditing(true), ["escape"]))]
|
|
120
|
+
}, null, 544)), [[vModelText, editingLabel.value]]) : (openBlock(), createBlock(BaseSelect_default, {
|
|
121
|
+
key: 1,
|
|
122
|
+
ref_key: "picker",
|
|
123
|
+
ref: picker,
|
|
98
124
|
modelValue: unref(selectedOption),
|
|
99
|
-
"onUpdate:modelValue": _cache[
|
|
125
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(selectedOption) ? selectedOption.value = $event : null),
|
|
126
|
+
label: "Preset",
|
|
100
127
|
options: presetsOptions.value,
|
|
101
|
-
onDblclick: _cache[
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
onDblclick: _cache[4] || (_cache[4] = ($event) => startEditing()),
|
|
129
|
+
onSelect: _cache[5] || (_cache[5] = (id) => applyPreset(id))
|
|
130
|
+
}, null, 8, ["modelValue", "options"]))], 512),
|
|
131
|
+
withDirectives((openBlock(), createElementBlock("button", {
|
|
132
|
+
type: "button",
|
|
133
|
+
"data-testid": "preset-rename",
|
|
134
|
+
"aria-label": "Rename preset",
|
|
135
|
+
disabled: !canEdit.value,
|
|
136
|
+
class: normalizeClass(["flex-none flex p-0 bg-transparent border-0 cursor-pointer text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400", [canEdit.value ? "opacity-50 hover:opacity-100 focus-visible:opacity-100" : "opacity-25 pointer-events-none"]]),
|
|
137
|
+
onClick: _cache[6] || (_cache[6] = ($event) => startEditing())
|
|
138
|
+
}, [createVNode(unref(Icon), {
|
|
139
|
+
icon: "carbon:edit",
|
|
140
|
+
class: "w-4 h-4"
|
|
141
|
+
})], 10, _hoisted_2)), [[_directive_tooltip, canEdit.value ? "Rename this preset" : null]]),
|
|
142
|
+
withDirectives((openBlock(), createElementBlock("button", {
|
|
143
|
+
type: "button",
|
|
144
|
+
"data-testid": "preset-delete",
|
|
145
|
+
"aria-label": "Delete preset",
|
|
146
|
+
disabled: !canEdit.value,
|
|
147
|
+
class: normalizeClass(["flex-none flex p-0 bg-transparent border-0 cursor-pointer text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400", [canEdit.value ? "opacity-50 hover:opacity-100 focus-visible:opacity-100" : "opacity-25 pointer-events-none"]]),
|
|
148
|
+
onClick: _cache[7] || (_cache[7] = ($event) => deletePreset(unref(selectedOption)))
|
|
149
|
+
}, [createVNode(unref(Icon), {
|
|
150
|
+
icon: "carbon:trash-can",
|
|
151
|
+
class: "w-4 h-4"
|
|
152
|
+
})], 10, _hoisted_3)), [[_directive_tooltip, canEdit.value ? "Delete this preset" : null]]),
|
|
153
|
+
withDirectives((openBlock(), createElementBlock("button", {
|
|
154
|
+
type: "button",
|
|
128
155
|
"data-testid": "preset-save",
|
|
156
|
+
"aria-label": "Save to preset",
|
|
157
|
+
disabled: !canEdit.value,
|
|
158
|
+
class: normalizeClass(["flex-none flex p-0 bg-transparent border-0 cursor-pointer text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400", [canEdit.value ? "opacity-50 hover:opacity-100 focus-visible:opacity-100" : "opacity-25 pointer-events-none"]]),
|
|
159
|
+
onClick: _cache[8] || (_cache[8] = ($event) => savePreset())
|
|
160
|
+
}, [createVNode(unref(Icon), {
|
|
129
161
|
icon: savedNotif.value ? "carbon:checkmark" : "carbon:save",
|
|
130
|
-
class:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
162
|
+
class: "w-4 h-4"
|
|
163
|
+
}, null, 8, ["icon"])], 10, _hoisted_4)), [[_directive_tooltip, savedNotif.value ? "Saved!" : canEdit.value ? "Save to preset" : null]]),
|
|
164
|
+
withDirectives((openBlock(), createElementBlock("button", {
|
|
165
|
+
type: "button",
|
|
134
166
|
"data-testid": "preset-create",
|
|
167
|
+
"aria-label": "Create new preset",
|
|
168
|
+
class: "flex-none flex p-0 bg-transparent border-0 cursor-pointer text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400 opacity-50 hover:opacity-100 focus-visible:opacity-100",
|
|
169
|
+
onClick: _cache[9] || (_cache[9] = ($event) => createPreset())
|
|
170
|
+
}, [createVNode(unref(Icon), {
|
|
135
171
|
icon: "carbon:add-alt",
|
|
136
|
-
class: "
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
172
|
+
class: "w-4 h-4"
|
|
173
|
+
})])), [[_directive_tooltip, "Create new preset"]]),
|
|
174
|
+
withDirectives((openBlock(), createElementBlock("button", {
|
|
175
|
+
type: "button",
|
|
176
|
+
"aria-label": "Reset to initial state",
|
|
177
|
+
class: "flex-none flex p-0 bg-transparent border-0 cursor-pointer text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400 opacity-50 hover:opacity-100 focus-visible:opacity-100",
|
|
178
|
+
onClick: _cache[10] || (_cache[10] = ($event) => resetState())
|
|
179
|
+
}, [createVNode(unref(Icon), {
|
|
140
180
|
icon: "carbon:reset",
|
|
141
|
-
class: "
|
|
142
|
-
|
|
143
|
-
}, null, 512), [[_directive_tooltip, "Reset to initial state"]])
|
|
181
|
+
class: "w-4 h-4"
|
|
182
|
+
})])), [[_directive_tooltip, "Reset to initial state"]])
|
|
144
183
|
]);
|
|
145
184
|
};
|
|
146
185
|
}
|
|
@@ -31,7 +31,7 @@ var StoryControls_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
31
31
|
watch(() => props.variant, () => {
|
|
32
32
|
ready.value = false;
|
|
33
33
|
});
|
|
34
|
-
const hasCustomControls = computed(() => props.variant.slots().controls || props.story.slots().controls);
|
|
34
|
+
const hasCustomControls = computed(() => props.variant.slots?.().controls || props.story.slots?.().controls);
|
|
35
35
|
const hasInitState = computed(() => Object.entries(props.variant.state || {}).some(([key]) => !key.startsWith("_h")));
|
|
36
36
|
return (_ctx, _cache) => {
|
|
37
37
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -10,7 +10,9 @@ var _hoisted_1 = ["innerHTML"];
|
|
|
10
10
|
function useStoryDoc(story) {
|
|
11
11
|
const renderedDoc = ref("");
|
|
12
12
|
watchEffect(async () => {
|
|
13
|
-
const
|
|
13
|
+
const filePath = story.value?.file?.filePath;
|
|
14
|
+
if (!filePath) return;
|
|
15
|
+
const mdKey = filePath.replace(/\.(\w*)$/, ".md");
|
|
14
16
|
if (markdownFiles[mdKey]) {
|
|
15
17
|
const md = await markdownFiles[mdKey]();
|
|
16
18
|
renderedDoc.value = md.html;
|
|
@@ -14,7 +14,11 @@ var StoryEvent_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
14
14
|
const formattedArgument = computed(() => {
|
|
15
15
|
switch (typeof props.event.argument) {
|
|
16
16
|
case "string": return `"${props.event.argument}"`;
|
|
17
|
-
case "object":
|
|
17
|
+
case "object": {
|
|
18
|
+
const argument = props.event.argument;
|
|
19
|
+
if (!argument) return "null";
|
|
20
|
+
return `{ ${Object.keys(argument).map((key) => `${key}: ${argument[key]}`).join(", ")} }`;
|
|
21
|
+
}
|
|
18
22
|
default: return props.event.argument;
|
|
19
23
|
}
|
|
20
24
|
});
|
|
@@ -16,7 +16,8 @@ var StoryEvents_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
16
16
|
async function resetUnseen() {
|
|
17
17
|
if (eventsStore.unseen > 0) eventsStore.unseen = 0;
|
|
18
18
|
await nextTick();
|
|
19
|
-
|
|
19
|
+
const events = eventsElement.value;
|
|
20
|
+
events?.scrollTo({ top: events.scrollHeight });
|
|
20
21
|
}
|
|
21
22
|
return (_ctx, _cache) => {
|
|
22
23
|
return openBlock(), createElementBlock("div", {
|
|
@@ -7,7 +7,7 @@ import PaneTabs_default from "./PaneTabs.js";
|
|
|
7
7
|
import StoryControls_default from "./StoryControls.js";
|
|
8
8
|
import StoryEvents_default from "./StoryEvents.js";
|
|
9
9
|
import StorySourceCode_default from "./StorySourceCode.js";
|
|
10
|
-
import { computed, createBlock, createElementBlock, createElementVNode,
|
|
10
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, resolveDynamicComponent, unref, withCtx } from "@poveste/vendors/vue";
|
|
11
11
|
import { useRoute } from "@poveste/vendors/vue-router";
|
|
12
12
|
//#region src/app/components/panel/StorySidePanel.vue?vue&type=script&setup=true&lang.ts
|
|
13
13
|
var _hoisted_1 = { class: "h-full w-full p-2" };
|
|
@@ -21,7 +21,7 @@ var StorySidePanel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
21
21
|
const innerOrientation = computed(() => layoutStore.settings.storyOptionsPlacement === "bottom" ? "landscape" : "portrait");
|
|
22
22
|
const route = useRoute();
|
|
23
23
|
const panelContentComponent = computed(() => {
|
|
24
|
-
switch (route.query
|
|
24
|
+
switch (route.query["tab"]) {
|
|
25
25
|
case "docs": return StoryDocs_default;
|
|
26
26
|
case "events": return StoryEvents_default;
|
|
27
27
|
default: return StoryControls_default;
|
|
@@ -47,19 +47,21 @@ var StorySidePanel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
47
47
|
class: "poveste-story-side-panel poveste-loaded h-full",
|
|
48
48
|
"data-testid": "story-side-panel"
|
|
49
49
|
}, {
|
|
50
|
-
first: withCtx(() => [createElementVNode("div", _hoisted_3, [
|
|
50
|
+
first: withCtx(() => [createElementVNode("div", _hoisted_3, [unref(storyStore).currentStory ? (openBlock(), createBlock(PaneTabs_default, {
|
|
51
|
+
key: 0,
|
|
51
52
|
story: unref(storyStore).currentStory,
|
|
52
53
|
variant: unref(storyStore).currentVariant
|
|
53
|
-
}, null, 8, ["story", "variant"]), (openBlock(), createBlock(resolveDynamicComponent(panelContentComponent.value), {
|
|
54
|
+
}, null, 8, ["story", "variant"])) : createCommentVNode("", true), (openBlock(), createBlock(resolveDynamicComponent(panelContentComponent.value), {
|
|
54
55
|
story: unref(storyStore).currentStory,
|
|
55
56
|
variant: unref(storyStore).currentVariant,
|
|
56
57
|
class: "h-full overflow-auto"
|
|
57
58
|
}, null, 8, ["story", "variant"]))])]),
|
|
58
|
-
last: withCtx(() => [
|
|
59
|
+
last: withCtx(() => [unref(storyStore).currentStory ? (openBlock(), createBlock(StorySourceCode_default, {
|
|
60
|
+
key: 0,
|
|
59
61
|
story: unref(storyStore).currentStory,
|
|
60
62
|
variant: unref(storyStore).currentVariant,
|
|
61
63
|
class: "h-full"
|
|
62
|
-
}, null, 8, ["story", "variant"])]),
|
|
64
|
+
}, null, 8, ["story", "variant"])) : createCommentVNode("", true)]),
|
|
63
65
|
_: 1
|
|
64
66
|
}, 8, ["save-id", "orientation"]))])]);
|
|
65
67
|
};
|
|
@@ -2,6 +2,6 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
|
|
|
2
2
|
import StorySourceCode_vue_vue_type_script_setup_true_lang_default from "./StorySourceCode.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/app/components/panel/StorySourceCode.vue
|
|
5
|
-
var StorySourceCode_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StorySourceCode_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var StorySourceCode_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StorySourceCode_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-b595e0d4"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { StorySourceCode_default as default };
|
package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -27,9 +27,10 @@ var StorySourceCode_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
27
27
|
},
|
|
28
28
|
setup(__props) {
|
|
29
29
|
const props = __props;
|
|
30
|
-
const generateSourceCodeFn =
|
|
30
|
+
const generateSourceCodeFn = shallowRef(null);
|
|
31
31
|
watchEffect(async () => {
|
|
32
|
-
const
|
|
32
|
+
const supportPluginId = props.story.file?.supportPluginId;
|
|
33
|
+
const clientPlugin = supportPluginId ? clientSupportPlugins[supportPluginId] : void 0;
|
|
33
34
|
if (clientPlugin) {
|
|
34
35
|
const pluginModule = await clientPlugin();
|
|
35
36
|
generateSourceCodeFn.value = markRaw(pluginModule.generateSourceCode);
|
|
@@ -51,7 +52,7 @@ var StorySourceCode_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
51
52
|
} else dynamicSourceCode.value = await generateSourceCodeFn.value(props.variant);
|
|
52
53
|
} catch (e) {
|
|
53
54
|
console.error(e);
|
|
54
|
-
error.value = e.message;
|
|
55
|
+
error.value = e instanceof Error ? e.message : String(e);
|
|
55
56
|
}
|
|
56
57
|
if (!dynamicSourceCode.value) displayedSource.value = "static";
|
|
57
58
|
}, {
|
|
@@ -85,7 +86,7 @@ var StorySourceCode_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
85
86
|
});
|
|
86
87
|
const scroller = ref();
|
|
87
88
|
function onScroll(event) {
|
|
88
|
-
if (sourceHtml.value) lastScroll = event.target.scrollTop;
|
|
89
|
+
if (sourceHtml.value && event.target instanceof HTMLElement) lastScroll = event.target.scrollTop;
|
|
89
90
|
}
|
|
90
91
|
watch(sourceHtml, async () => {
|
|
91
92
|
await nextTick();
|
|
@@ -97,13 +98,13 @@ var StorySourceCode_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
97
98
|
_cache[2] || (_cache[2] = createElementVNode("div", { class: "text-gray-900 dark:text-gray-100" }, " Source ", -1)),
|
|
98
99
|
_cache[3] || (_cache[3] = createElementVNode("div", { class: "flex-1" }, null, -1)),
|
|
99
100
|
createElementVNode("div", _hoisted_3, [withDirectives((openBlock(), createElementBlock("button", {
|
|
100
|
-
class: normalizeClass(["flex items-center gap-1 h-full px-1 bg-gray-500/10 rounded-l transition-all ease-[cubic-bezier(0,1,.6,1)] duration-300 overflow-hidden", [displayedSource.value !== "dynamic" ? "max-w-6 opacity-70" : "max-w-[82px] text-primary-800 dark:text-primary-400", dynamicSourceCode.value ? "cursor-pointer hover:bg-gray-500/30 active:bg-gray-600/50" : "opacity-50"]]),
|
|
101
|
+
class: normalizeClass(["flex items-center gap-1 h-full px-1 bg-gray-500/10 rounded-l transition-all ease-[cubic-bezier(0,1,.6,1)] duration-300 overflow-hidden", [displayedSource.value !== "dynamic" ? "max-w-6 opacity-70" : "max-w-[82px] text-primary-800 dark:text-primary-400", dynamicSourceCode.value ? "cursor-pointer hover:bg-gray-500/30 active:bg-gray-600/50" : displayedSource.value !== "dynamic" && "opacity-50"]]),
|
|
101
102
|
onClick: _cache[0] || (_cache[0] = ($event) => dynamicSourceCode.value && (displayedSource.value = "dynamic"))
|
|
102
103
|
}, [createVNode(unref(Icon), {
|
|
103
104
|
icon: "carbon:flash",
|
|
104
105
|
class: "w-4 h-4 flex-none"
|
|
105
106
|
}), createElementVNode("span", { class: normalizeClass(["transition-opacity duration-300", { "opacity-0": displayedSource.value !== "dynamic" }]) }, " Dynamic ", 2)], 2)), [[_directive_tooltip, !dynamicSourceCode.value ? "Dynamic source code is not available" : displayedSource.value !== "dynamic" ? "Switch to dynamic source" : null]]), withDirectives((openBlock(), createElementBlock("button", {
|
|
106
|
-
class: normalizeClass(["flex items-center gap-1 h-full px-1 bg-gray-500/10 rounded-r transition-all ease-[cubic-bezier(0,1,.6,1)] duration-300 overflow-hidden", [displayedSource.value !== "static" ? "max-w-6 opacity-70" : "max-w-[63px] text-primary-800 dark:text-primary-400", staticSourceCode.value ? "cursor-pointer hover:bg-gray-500/30 active:bg-gray-600/50" : "opacity-50"]]),
|
|
107
|
+
class: normalizeClass(["flex items-center gap-1 h-full px-1 bg-gray-500/10 rounded-r transition-all ease-[cubic-bezier(0,1,.6,1)] duration-300 overflow-hidden", [displayedSource.value !== "static" ? "max-w-6 opacity-70" : "max-w-[63px] text-primary-800 dark:text-primary-400", staticSourceCode.value ? "cursor-pointer hover:bg-gray-500/30 active:bg-gray-600/50" : displayedSource.value !== "static" && "opacity-50"]]),
|
|
107
108
|
onClick: _cache[1] || (_cache[1] = ($event) => staticSourceCode.value && (displayedSource.value = "static"))
|
|
108
109
|
}, [createVNode(unref(Icon), {
|
|
109
110
|
icon: "carbon:document",
|
|
@@ -125,6 +126,7 @@ var StorySourceCode_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
125
126
|
ref: scroller,
|
|
126
127
|
class: "__poveste-code-placeholder w-full h-full p-4 outline-none bg-transparent resize-none m-0",
|
|
127
128
|
value: displayedSourceCode.value,
|
|
129
|
+
"aria-label": "Source code",
|
|
128
130
|
readonly: "",
|
|
129
131
|
"data-testid": "story-source-code",
|
|
130
132
|
onScroll
|
package/dist/bundled/components/search/SearchItemContent.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -18,7 +18,8 @@ var SearchItemContent_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
18
18
|
setup(__props) {
|
|
19
19
|
const defaultIcons = {
|
|
20
20
|
story: "carbon:cube",
|
|
21
|
-
variant: "carbon:cube"
|
|
21
|
+
variant: "carbon:cube",
|
|
22
|
+
command: "carbon:chevron-right"
|
|
22
23
|
};
|
|
23
24
|
const kindLabels = {
|
|
24
25
|
story: "Story",
|
|
@@ -50,7 +50,7 @@ var SearchPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
50
50
|
watch(() => props.shown, (value) => {
|
|
51
51
|
if (value) requestAnimationFrame(() => {
|
|
52
52
|
focused.value = true;
|
|
53
|
-
input.value
|
|
53
|
+
input.value?.select();
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
const searchInputText = ref("");
|
|
@@ -95,14 +95,17 @@ var SearchPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
95
95
|
const idMapData = titleIdMap[document.item.id];
|
|
96
96
|
if (!idMapData) continue;
|
|
97
97
|
switch (idMapData.kind) {
|
|
98
|
-
case "story":
|
|
99
|
-
|
|
98
|
+
case "story": {
|
|
99
|
+
const story = storyStore.getStoryById(idMapData.id);
|
|
100
|
+
if (!story) continue;
|
|
101
|
+
list.push(storyResultFactory(story, rank));
|
|
100
102
|
rank++;
|
|
101
103
|
break;
|
|
104
|
+
}
|
|
102
105
|
case "variant": {
|
|
103
|
-
const
|
|
104
|
-
const story = storyStore.getStoryById(storyId);
|
|
106
|
+
const story = storyStore.getStoryById(idMapData.id.replace(/:.*$/s, ""));
|
|
105
107
|
const variant = storyStore.getVariantById(idMapData.id);
|
|
108
|
+
if (!story || !variant) continue;
|
|
106
109
|
list.push(variantResultFactory(story, variant, rank));
|
|
107
110
|
rank++;
|
|
108
111
|
break;
|
|
@@ -121,9 +124,13 @@ var SearchPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
121
124
|
const idMapData = docIdMap[document.item.id];
|
|
122
125
|
if (!idMapData) continue;
|
|
123
126
|
switch (idMapData.kind) {
|
|
124
|
-
case "story":
|
|
125
|
-
|
|
127
|
+
case "story": {
|
|
128
|
+
const story = storyStore.getStoryById(idMapData.id);
|
|
129
|
+
if (!story) continue;
|
|
130
|
+
list.push(storyResultFactory(story, rank, "docs"));
|
|
126
131
|
rank++;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
127
134
|
}
|
|
128
135
|
}
|
|
129
136
|
docsResults.value = list;
|
|
@@ -141,7 +148,7 @@ var SearchPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
141
148
|
params: { storyId: story.id },
|
|
142
149
|
query: { ...type === "docs" ? { tab: "docs" } : {} }
|
|
143
150
|
},
|
|
144
|
-
path: story.file
|
|
151
|
+
path: story.file?.path.slice(0, -1) ?? [],
|
|
145
152
|
icon: story.icon,
|
|
146
153
|
iconColor: story.iconColor
|
|
147
154
|
};
|
|
@@ -160,7 +167,7 @@ var SearchPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
160
167
|
...type === "docs" ? { tab: "docs" } : {}
|
|
161
168
|
}
|
|
162
169
|
},
|
|
163
|
-
path: [...story.file
|
|
170
|
+
path: [...story.file?.path ?? [], story.title],
|
|
164
171
|
icon: variant.icon,
|
|
165
172
|
iconColor: variant.iconColor
|
|
166
173
|
};
|
package/dist/bundled/components/story/GenericMountStory.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -8,7 +8,8 @@ var GenericMountStory_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
8
8
|
const props = __props;
|
|
9
9
|
const mountComponent = ref(null);
|
|
10
10
|
watchEffect(async () => {
|
|
11
|
-
const
|
|
11
|
+
const supportPluginId = props.story.file?.supportPluginId;
|
|
12
|
+
const clientPlugin = supportPluginId ? clientSupportPlugins[supportPluginId] : void 0;
|
|
12
13
|
if (clientPlugin) {
|
|
13
14
|
const pluginModule = await clientPlugin();
|
|
14
15
|
mountComponent.value = markRaw(pluginModule.MountStory);
|
package/dist/bundled/components/story/GenericRenderStory.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -8,7 +8,8 @@ var GenericRenderStory_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
|
|
|
8
8
|
const props = __props;
|
|
9
9
|
const mountComponent = ref(null);
|
|
10
10
|
watchEffect(async () => {
|
|
11
|
-
const
|
|
11
|
+
const supportPluginId = props.story.file?.supportPluginId;
|
|
12
|
+
const clientPlugin = supportPluginId ? clientSupportPlugins[supportPluginId] : void 0;
|
|
12
13
|
if (clientPlugin) try {
|
|
13
14
|
const pluginModule = await clientPlugin();
|
|
14
15
|
mountComponent.value = markRaw(pluginModule.RenderStory);
|
|
@@ -2,6 +2,6 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
|
|
|
2
2
|
import StoryResponsivePreview_vue_vue_type_script_setup_true_lang_default from "./StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/app/components/story/StoryResponsivePreview.vue
|
|
5
|
-
var StoryResponsivePreview_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StoryResponsivePreview_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var StoryResponsivePreview_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StoryResponsivePreview_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-13932615"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { StoryResponsivePreview_default as default };
|