@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,84 @@
|
|
|
1
|
+
import { defineComponent, useCssVars, unref, resolveComponent, resolveDirective, openBlock, createBlock, withCtx, createElementVNode, createVNode, createTextVNode, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString, normalizeStyle, createCommentVNode, withDirectives, pushScopeId, popScopeId } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
4
|
+
import { histoireConfig } from "../../util/config.js";
|
|
5
|
+
import "../base/BaseCheckbox.js";
|
|
6
|
+
import _sfc_main$1 from "../base/BaseCheckbox.vue_vue_type_script_setup_true_lang.js";
|
|
7
|
+
const _withScopeId = (n) => (pushScopeId("data-v-8dc02d19"), n = n(), popScopeId(), n);
|
|
8
|
+
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" };
|
|
9
|
+
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));
|
|
10
|
+
const _hoisted_3 = { class: "htw-flex htw-flex-col htw-items-stretch" };
|
|
11
|
+
const _hoisted_4 = ["onClick"];
|
|
12
|
+
const _hoisted_5 = { class: "htw-mr-auto" };
|
|
13
|
+
const _hoisted_6 = { class: "htw-ml-auto htw-opacity-70" };
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
__name: "StoryVariantBackground",
|
|
16
|
+
setup(__props) {
|
|
17
|
+
useCssVars((_ctx) => ({
|
|
18
|
+
"e45edc1a": unref(settings).backgroundColor
|
|
19
|
+
}));
|
|
20
|
+
const settings = usePreviewSettingsStore().currentSettings;
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
const _component_VDropdown = resolveComponent("VDropdown");
|
|
23
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
24
|
+
return unref(histoireConfig).backgroundPresets.length ? (openBlock(), createBlock(_component_VDropdown, {
|
|
25
|
+
key: 0,
|
|
26
|
+
placement: "bottom-end",
|
|
27
|
+
skidding: 6,
|
|
28
|
+
class: "htw-h-full htw-flex-none"
|
|
29
|
+
}, {
|
|
30
|
+
popper: withCtx(({ hide }) => [
|
|
31
|
+
createElementVNode("div", _hoisted_3, [
|
|
32
|
+
createVNode(_sfc_main$1, {
|
|
33
|
+
modelValue: unref(settings).checkerboard,
|
|
34
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(settings).checkerboard = $event)
|
|
35
|
+
}, {
|
|
36
|
+
default: withCtx(() => [
|
|
37
|
+
createTextVNode(" Checkerboard ")
|
|
38
|
+
]),
|
|
39
|
+
_: 1
|
|
40
|
+
}, 8, ["modelValue"]),
|
|
41
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(histoireConfig).backgroundPresets, (option, index) => {
|
|
42
|
+
return openBlock(), createElementBlock("button", {
|
|
43
|
+
key: index,
|
|
44
|
+
class: normalizeClass(["htw-px-4 htw-py-3 htw-cursor-pointer htw-text-left htw-flex htw-gap-4", [
|
|
45
|
+
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"
|
|
46
|
+
]]),
|
|
47
|
+
onClick: ($event) => {
|
|
48
|
+
unref(settings).backgroundColor = option.color;
|
|
49
|
+
hide();
|
|
50
|
+
}
|
|
51
|
+
}, [
|
|
52
|
+
createElementVNode("span", _hoisted_5, toDisplayString(option.label), 1),
|
|
53
|
+
option.color !== "$checkerboard" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
54
|
+
createElementVNode("span", _hoisted_6, toDisplayString(option.color), 1),
|
|
55
|
+
createElementVNode("div", {
|
|
56
|
+
class: "htw-w-4 htw-h-4 htw-rounded-full htw-border htw-border-black/20 dark:htw-border-white/20",
|
|
57
|
+
style: normalizeStyle({
|
|
58
|
+
backgroundColor: option.color
|
|
59
|
+
})
|
|
60
|
+
}, null, 4)
|
|
61
|
+
], 64)) : createCommentVNode("", true)
|
|
62
|
+
], 10, _hoisted_4);
|
|
63
|
+
}), 128))
|
|
64
|
+
])
|
|
65
|
+
]),
|
|
66
|
+
default: withCtx(() => [
|
|
67
|
+
withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
|
|
68
|
+
_hoisted_2,
|
|
69
|
+
createVNode(unref(Icon), {
|
|
70
|
+
icon: "carbon:caret-down",
|
|
71
|
+
class: "htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
|
|
72
|
+
})
|
|
73
|
+
])), [
|
|
74
|
+
[_directive_tooltip, "Background color"]
|
|
75
|
+
])
|
|
76
|
+
]),
|
|
77
|
+
_: 1
|
|
78
|
+
})) : createCommentVNode("", true);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
export {
|
|
83
|
+
_sfc_main as default
|
|
84
|
+
};
|
|
@@ -1,33 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
__name: "StoryVariantNewTab",
|
|
7
|
-
props: {
|
|
8
|
-
variant: null,
|
|
9
|
-
story: null
|
|
10
|
-
},
|
|
11
|
-
setup(__props) {
|
|
12
|
-
const props = __props;
|
|
13
|
-
const sandboxUrl = computed(() => {
|
|
14
|
-
return getSandboxUrl(props.story, props.variant);
|
|
15
|
-
});
|
|
16
|
-
return (_ctx, _cache) => {
|
|
17
|
-
const _directive_tooltip = resolveDirective("tooltip");
|
|
18
|
-
return withDirectives((openBlock(), createElementBlock("a", {
|
|
19
|
-
href: unref(sandboxUrl),
|
|
20
|
-
target: "_blank",
|
|
21
|
-
class: "htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 hover:htw-text-primary-500 htw-opacity-50 hover:htw-opacity-100 dark:hover:htw-text-primary-400 htw-text-gray-900 dark:htw-text-gray-100"
|
|
22
|
-
}, [
|
|
23
|
-
createVNode(unref(Icon), {
|
|
24
|
-
icon: "carbon:launch",
|
|
25
|
-
class: "base-list-item-link-icon htw-w-4 htw-h-4"
|
|
26
|
-
})
|
|
27
|
-
], 8, _hoisted_1)), [
|
|
28
|
-
[_directive_tooltip, "Open variant in new tab"]
|
|
29
|
-
]);
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
export { _sfc_main as default };
|
|
1
|
+
import _sfc_main from "./StoryVariantNewTab.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./StoryVariantNewTab.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
5
|
+
};
|
package/dist/bundled/components/toolbar/StoryVariantNewTab.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent, computed, resolveDirective, withDirectives, openBlock, createElementBlock, unref, createVNode } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import { getSandboxUrl } from "../../util/sandbox.js";
|
|
4
|
+
const _hoisted_1 = ["href"];
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "StoryVariantNewTab",
|
|
7
|
+
props: {
|
|
8
|
+
variant: null,
|
|
9
|
+
story: null
|
|
10
|
+
},
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
const sandboxUrl = computed(() => {
|
|
14
|
+
return getSandboxUrl(props.story, props.variant);
|
|
15
|
+
});
|
|
16
|
+
return (_ctx, _cache) => {
|
|
17
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
18
|
+
return withDirectives((openBlock(), createElementBlock("a", {
|
|
19
|
+
href: unref(sandboxUrl),
|
|
20
|
+
target: "_blank",
|
|
21
|
+
class: "htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 hover:htw-text-primary-500 htw-opacity-50 hover:htw-opacity-100 dark:hover:htw-text-primary-400 htw-text-gray-900 dark:htw-text-gray-100"
|
|
22
|
+
}, [
|
|
23
|
+
createVNode(unref(Icon), {
|
|
24
|
+
icon: "carbon:launch",
|
|
25
|
+
class: "base-list-item-link-icon htw-w-4 htw-h-4"
|
|
26
|
+
})
|
|
27
|
+
], 8, _hoisted_1)), [
|
|
28
|
+
[_directive_tooltip, "Open variant in new tab"]
|
|
29
|
+
]);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
_sfc_main as default
|
|
35
|
+
};
|
|
@@ -1,129 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const _hoisted_1 = { class: "htw-flex htw-flex-col htw-items-stretch" };
|
|
7
|
-
const _hoisted_2 = /* @__PURE__ */ createTextVNode(" Rotate ");
|
|
8
|
-
const _hoisted_3 = { class: "htw-flex htw-gap-2 htw-px-4 htw-py-3" };
|
|
9
|
-
const _hoisted_4 = /* @__PURE__ */ createElementVNode("span", { class: "htw-opacity-50" }, "x", -1);
|
|
10
|
-
const _hoisted_5 = ["onClick"];
|
|
11
|
-
const _hoisted_6 = { class: "htw-ml-auto htw-opacity-70 htw-flex htw-gap-1" };
|
|
12
|
-
const _hoisted_7 = { key: 0 };
|
|
13
|
-
const _hoisted_8 = { key: 0 };
|
|
14
|
-
const _hoisted_9 = { key: 1 };
|
|
15
|
-
const _hoisted_10 = { key: 2 };
|
|
16
|
-
const _hoisted_11 = { key: 0 };
|
|
17
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
-
__name: "StoryVariantResponsiveSize",
|
|
19
|
-
setup(__props) {
|
|
20
|
-
const settings = usePreviewSettingsStore().currentSettings;
|
|
21
|
-
return (_ctx, _cache) => {
|
|
22
|
-
var _a;
|
|
23
|
-
const _component_VDropdown = resolveComponent("VDropdown");
|
|
24
|
-
const _directive_tooltip = resolveDirective("tooltip");
|
|
25
|
-
return openBlock(), createBlock(_component_VDropdown, {
|
|
26
|
-
placement: "bottom-end",
|
|
27
|
-
skidding: 6,
|
|
28
|
-
disabled: !((_a = unref(histoireConfig).responsivePresets) == null ? void 0 : _a.length),
|
|
29
|
-
class: "htw-h-full htw-flex-none"
|
|
30
|
-
}, {
|
|
31
|
-
popper: withCtx(({ hide }) => [
|
|
32
|
-
createElementVNode("div", _hoisted_1, [
|
|
33
|
-
createVNode(_sfc_main$1, {
|
|
34
|
-
modelValue: unref(settings).rotate,
|
|
35
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(settings).rotate = $event)
|
|
36
|
-
}, {
|
|
37
|
-
default: withCtx(() => [
|
|
38
|
-
_hoisted_2
|
|
39
|
-
]),
|
|
40
|
-
_: 1
|
|
41
|
-
}, 8, ["modelValue"]),
|
|
42
|
-
createElementVNode("div", _hoisted_3, [
|
|
43
|
-
withDirectives(createElementVNode("input", {
|
|
44
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(settings).responsiveWidth = $event),
|
|
45
|
-
type: "number",
|
|
46
|
-
class: "htw-bg-transparent htw-border htw-border-gray-200 dark:htw-border-gray-850 htw-rounded htw-w-20 htw-opacity-50 focus:htw-opacity-100 htw-flex-1 htw-min-w-0",
|
|
47
|
-
step: "16",
|
|
48
|
-
placeholder: "Auto"
|
|
49
|
-
}, null, 512), [
|
|
50
|
-
[
|
|
51
|
-
vModelText,
|
|
52
|
-
unref(settings).responsiveWidth,
|
|
53
|
-
void 0,
|
|
54
|
-
{ number: true }
|
|
55
|
-
],
|
|
56
|
-
[_directive_tooltip, "Responsive width (px)"]
|
|
57
|
-
]),
|
|
58
|
-
_hoisted_4,
|
|
59
|
-
withDirectives(createElementVNode("input", {
|
|
60
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(settings).responsiveHeight = $event),
|
|
61
|
-
type: "number",
|
|
62
|
-
class: "htw-bg-transparent htw-border htw-border-gray-200 dark:htw-border-gray-850 htw-rounded htw-w-20 htw-opacity-50 focus:htw-opacity-100 htw-flex-1 htw-min-w-0",
|
|
63
|
-
step: "16",
|
|
64
|
-
placeholder: "Auto"
|
|
65
|
-
}, null, 512), [
|
|
66
|
-
[
|
|
67
|
-
vModelText,
|
|
68
|
-
unref(settings).responsiveHeight,
|
|
69
|
-
void 0,
|
|
70
|
-
{ number: true }
|
|
71
|
-
],
|
|
72
|
-
[_directive_tooltip, "Responsive height (px)"]
|
|
73
|
-
])
|
|
74
|
-
]),
|
|
75
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(histoireConfig).responsivePresets, (preset, index) => {
|
|
76
|
-
return openBlock(), createElementBlock("button", {
|
|
77
|
-
key: index,
|
|
78
|
-
class: normalizeClass(["htw-px-4 htw-py-3 htw-cursor-pointer htw-text-left htw-flex htw-gap-4", [
|
|
79
|
-
unref(settings).responsiveWidth === preset.width && unref(settings).responsiveHeight === preset.height ? "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"
|
|
80
|
-
]]),
|
|
81
|
-
onClick: ($event) => {
|
|
82
|
-
unref(settings).responsiveWidth = preset.width;
|
|
83
|
-
unref(settings).responsiveHeight = preset.height;
|
|
84
|
-
hide();
|
|
85
|
-
}
|
|
86
|
-
}, [
|
|
87
|
-
createTextVNode(toDisplayString(preset.label) + " ", 1),
|
|
88
|
-
createElementVNode("span", _hoisted_6, [
|
|
89
|
-
preset.width ? (openBlock(), createElementBlock("span", _hoisted_7, [
|
|
90
|
-
createTextVNode(toDisplayString(preset.width), 1),
|
|
91
|
-
!preset.height ? (openBlock(), createElementBlock("span", _hoisted_8, "px")) : createCommentVNode("", true)
|
|
92
|
-
])) : createCommentVNode("", true),
|
|
93
|
-
preset.width && preset.height ? (openBlock(), createElementBlock("span", _hoisted_9, "x")) : createCommentVNode("", true),
|
|
94
|
-
preset.height ? (openBlock(), createElementBlock("span", _hoisted_10, [
|
|
95
|
-
createTextVNode(toDisplayString(preset.height), 1),
|
|
96
|
-
!preset.width ? (openBlock(), createElementBlock("span", _hoisted_11, "px")) : createCommentVNode("", true)
|
|
97
|
-
])) : createCommentVNode("", true)
|
|
98
|
-
])
|
|
99
|
-
], 10, _hoisted_5);
|
|
100
|
-
}), 128))
|
|
101
|
-
])
|
|
102
|
-
]),
|
|
103
|
-
default: withCtx(() => {
|
|
104
|
-
var _a2;
|
|
105
|
-
return [
|
|
106
|
-
withDirectives((openBlock(), createElementBlock("div", {
|
|
107
|
-
class: normalizeClass(["htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 htw-group", {
|
|
108
|
-
"htw-cursor-pointer hover:htw-text-primary-500": (_a2 = unref(histoireConfig).responsivePresets) == null ? void 0 : _a2.length
|
|
109
|
-
}])
|
|
110
|
-
}, [
|
|
111
|
-
createVNode(unref(Icon), {
|
|
112
|
-
icon: "carbon:devices",
|
|
113
|
-
class: "htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
|
|
114
|
-
}),
|
|
115
|
-
createVNode(unref(Icon), {
|
|
116
|
-
icon: "carbon:caret-down",
|
|
117
|
-
class: "htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
|
|
118
|
-
})
|
|
119
|
-
], 2)), [
|
|
120
|
-
[_directive_tooltip, "Responsive sizes"]
|
|
121
|
-
])
|
|
122
|
-
];
|
|
123
|
-
}),
|
|
124
|
-
_: 1
|
|
125
|
-
}, 8, ["disabled"]);
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
export { _sfc_main as default };
|
|
1
|
+
import _sfc_main from "./StoryVariantResponsiveSize.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./StoryVariantResponsiveSize.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
5
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { defineComponent, resolveComponent, resolveDirective, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createTextVNode, withDirectives, vModelText, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
4
|
+
import { histoireConfig } from "../../util/config.js";
|
|
5
|
+
import "../base/BaseCheckbox.js";
|
|
6
|
+
import _sfc_main$1 from "../base/BaseCheckbox.vue_vue_type_script_setup_true_lang.js";
|
|
7
|
+
const _hoisted_1 = { class: "htw-flex htw-flex-col htw-items-stretch" };
|
|
8
|
+
const _hoisted_2 = { class: "htw-flex htw-gap-2 htw-px-4 htw-py-3" };
|
|
9
|
+
const _hoisted_3 = /* @__PURE__ */ createElementVNode("span", { class: "htw-opacity-50" }, "x", -1);
|
|
10
|
+
const _hoisted_4 = ["onClick"];
|
|
11
|
+
const _hoisted_5 = { class: "htw-ml-auto htw-opacity-70 htw-flex htw-gap-1" };
|
|
12
|
+
const _hoisted_6 = { key: 0 };
|
|
13
|
+
const _hoisted_7 = { key: 0 };
|
|
14
|
+
const _hoisted_8 = { key: 1 };
|
|
15
|
+
const _hoisted_9 = { key: 2 };
|
|
16
|
+
const _hoisted_10 = { key: 0 };
|
|
17
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
+
__name: "StoryVariantResponsiveSize",
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const settings = usePreviewSettingsStore().currentSettings;
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
var _a;
|
|
23
|
+
const _component_VDropdown = resolveComponent("VDropdown");
|
|
24
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
25
|
+
return openBlock(), createBlock(_component_VDropdown, {
|
|
26
|
+
placement: "bottom-end",
|
|
27
|
+
skidding: 6,
|
|
28
|
+
disabled: !((_a = unref(histoireConfig).responsivePresets) == null ? void 0 : _a.length),
|
|
29
|
+
class: "htw-h-full htw-flex-none"
|
|
30
|
+
}, {
|
|
31
|
+
popper: withCtx(({ hide }) => [
|
|
32
|
+
createElementVNode("div", _hoisted_1, [
|
|
33
|
+
createVNode(_sfc_main$1, {
|
|
34
|
+
modelValue: unref(settings).rotate,
|
|
35
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(settings).rotate = $event)
|
|
36
|
+
}, {
|
|
37
|
+
default: withCtx(() => [
|
|
38
|
+
createTextVNode(" Rotate ")
|
|
39
|
+
]),
|
|
40
|
+
_: 1
|
|
41
|
+
}, 8, ["modelValue"]),
|
|
42
|
+
createElementVNode("div", _hoisted_2, [
|
|
43
|
+
withDirectives(createElementVNode("input", {
|
|
44
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(settings).responsiveWidth = $event),
|
|
45
|
+
type: "number",
|
|
46
|
+
class: "htw-bg-transparent htw-border htw-border-gray-200 dark:htw-border-gray-850 htw-rounded htw-w-20 htw-opacity-50 focus:htw-opacity-100 htw-flex-1 htw-min-w-0",
|
|
47
|
+
step: "16",
|
|
48
|
+
placeholder: "Auto"
|
|
49
|
+
}, null, 512), [
|
|
50
|
+
[
|
|
51
|
+
vModelText,
|
|
52
|
+
unref(settings).responsiveWidth,
|
|
53
|
+
void 0,
|
|
54
|
+
{ number: true }
|
|
55
|
+
],
|
|
56
|
+
[_directive_tooltip, "Responsive width (px)"]
|
|
57
|
+
]),
|
|
58
|
+
_hoisted_3,
|
|
59
|
+
withDirectives(createElementVNode("input", {
|
|
60
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(settings).responsiveHeight = $event),
|
|
61
|
+
type: "number",
|
|
62
|
+
class: "htw-bg-transparent htw-border htw-border-gray-200 dark:htw-border-gray-850 htw-rounded htw-w-20 htw-opacity-50 focus:htw-opacity-100 htw-flex-1 htw-min-w-0",
|
|
63
|
+
step: "16",
|
|
64
|
+
placeholder: "Auto"
|
|
65
|
+
}, null, 512), [
|
|
66
|
+
[
|
|
67
|
+
vModelText,
|
|
68
|
+
unref(settings).responsiveHeight,
|
|
69
|
+
void 0,
|
|
70
|
+
{ number: true }
|
|
71
|
+
],
|
|
72
|
+
[_directive_tooltip, "Responsive height (px)"]
|
|
73
|
+
])
|
|
74
|
+
]),
|
|
75
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(histoireConfig).responsivePresets, (preset, index) => {
|
|
76
|
+
return openBlock(), createElementBlock("button", {
|
|
77
|
+
key: index,
|
|
78
|
+
class: normalizeClass(["htw-px-4 htw-py-3 htw-cursor-pointer htw-text-left htw-flex htw-gap-4", [
|
|
79
|
+
unref(settings).responsiveWidth === preset.width && unref(settings).responsiveHeight === preset.height ? "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"
|
|
80
|
+
]]),
|
|
81
|
+
onClick: ($event) => {
|
|
82
|
+
unref(settings).responsiveWidth = preset.width;
|
|
83
|
+
unref(settings).responsiveHeight = preset.height;
|
|
84
|
+
hide();
|
|
85
|
+
}
|
|
86
|
+
}, [
|
|
87
|
+
createTextVNode(toDisplayString(preset.label) + " ", 1),
|
|
88
|
+
createElementVNode("span", _hoisted_5, [
|
|
89
|
+
preset.width ? (openBlock(), createElementBlock("span", _hoisted_6, [
|
|
90
|
+
createTextVNode(toDisplayString(preset.width), 1),
|
|
91
|
+
!preset.height ? (openBlock(), createElementBlock("span", _hoisted_7, "px")) : createCommentVNode("", true)
|
|
92
|
+
])) : createCommentVNode("", true),
|
|
93
|
+
preset.width && preset.height ? (openBlock(), createElementBlock("span", _hoisted_8, "x")) : createCommentVNode("", true),
|
|
94
|
+
preset.height ? (openBlock(), createElementBlock("span", _hoisted_9, [
|
|
95
|
+
createTextVNode(toDisplayString(preset.height), 1),
|
|
96
|
+
!preset.width ? (openBlock(), createElementBlock("span", _hoisted_10, "px")) : createCommentVNode("", true)
|
|
97
|
+
])) : createCommentVNode("", true)
|
|
98
|
+
])
|
|
99
|
+
], 10, _hoisted_4);
|
|
100
|
+
}), 128))
|
|
101
|
+
])
|
|
102
|
+
]),
|
|
103
|
+
default: withCtx(() => {
|
|
104
|
+
var _a2;
|
|
105
|
+
return [
|
|
106
|
+
withDirectives((openBlock(), createElementBlock("div", {
|
|
107
|
+
class: normalizeClass(["htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 htw-group", {
|
|
108
|
+
"htw-cursor-pointer hover:htw-text-primary-500": (_a2 = unref(histoireConfig).responsivePresets) == null ? void 0 : _a2.length
|
|
109
|
+
}])
|
|
110
|
+
}, [
|
|
111
|
+
createVNode(unref(Icon), {
|
|
112
|
+
icon: "carbon:devices",
|
|
113
|
+
class: "htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
|
|
114
|
+
}),
|
|
115
|
+
createVNode(unref(Icon), {
|
|
116
|
+
icon: "carbon:caret-down",
|
|
117
|
+
class: "htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
|
|
118
|
+
})
|
|
119
|
+
], 2)), [
|
|
120
|
+
[_directive_tooltip, "Responsive sizes"]
|
|
121
|
+
])
|
|
122
|
+
];
|
|
123
|
+
}),
|
|
124
|
+
_: 1
|
|
125
|
+
}, 8, ["disabled"]);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
export {
|
|
130
|
+
_sfc_main as default
|
|
131
|
+
};
|
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
props: {
|
|
7
|
-
variant: null
|
|
8
|
-
},
|
|
9
|
-
setup(__props) {
|
|
10
|
-
return (_ctx, _cache) => {
|
|
11
|
-
var _a;
|
|
12
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
13
|
-
createVNode(unref(Icon), {
|
|
14
|
-
icon: (_a = __props.variant.icon) != null ? _a : "carbon:cube",
|
|
15
|
-
class: normalizeClass(["base-list-item-link-icon htw-w-4 htw-h-4 htw-opacity-50", [
|
|
16
|
-
__props.variant.iconColor ? "bind-icon-color" : "htw-text-gray-500"
|
|
17
|
-
]])
|
|
18
|
-
}, null, 8, ["icon", "class"]),
|
|
19
|
-
createElementVNode("span", null, toDisplayString(__props.variant.title), 1)
|
|
20
|
-
]);
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
export { _sfc_main as default };
|
|
1
|
+
import _sfc_main from "./StoryVariantTitle.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./StoryVariantTitle.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
5
|
+
};
|
package/dist/bundled/components/toolbar/StoryVariantTitle.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createVNode, unref, normalizeClass, createElementVNode, toDisplayString } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
const _hoisted_1 = { class: "htw-flex htw-items-center htw-gap-1 htw-text-gray-500 htw-flex-1 htw-truncate htw-min-w-0" };
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "StoryVariantTitle",
|
|
6
|
+
props: {
|
|
7
|
+
variant: null
|
|
8
|
+
},
|
|
9
|
+
setup(__props) {
|
|
10
|
+
return (_ctx, _cache) => {
|
|
11
|
+
var _a;
|
|
12
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
13
|
+
createVNode(unref(Icon), {
|
|
14
|
+
icon: (_a = __props.variant.icon) != null ? _a : "carbon:cube",
|
|
15
|
+
class: normalizeClass(["base-list-item-link-icon htw-w-4 htw-h-4 htw-opacity-50", [
|
|
16
|
+
__props.variant.iconColor ? "bind-icon-color" : "htw-text-gray-500"
|
|
17
|
+
]])
|
|
18
|
+
}, null, 8, ["icon", "class"]),
|
|
19
|
+
createElementVNode("span", null, toDisplayString(__props.variant.title), 1)
|
|
20
|
+
]);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
_sfc_main as default
|
|
26
|
+
};
|
|
@@ -1,74 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { useFolderStore } from "../../stores/folder.js";
|
|
6
|
-
const _hoisted_1 = {
|
|
7
|
-
"data-test-id": "story-group",
|
|
8
|
-
class: "htw-my-2 first:htw-mt-0 last:htw-mb-0"
|
|
1
|
+
import _sfc_main from "./StoryGroup.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./StoryGroup.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
9
5
|
};
|
|
10
|
-
const _hoisted_2 = ["onKeyup"];
|
|
11
|
-
const _hoisted_3 = { class: "htw-truncate htw-opacity-50" };
|
|
12
|
-
const _hoisted_4 = /* @__PURE__ */ createElementVNode("span", { class: "htw-h-[1px] htw-flex-1 htw-bg-gray-500/10 htw-mx-2" }, null, -1);
|
|
13
|
-
const _hoisted_5 = { key: 1 };
|
|
14
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
-
__name: "StoryGroup",
|
|
16
|
-
props: {
|
|
17
|
-
path: { default: () => [] },
|
|
18
|
-
group: null,
|
|
19
|
-
stories: null
|
|
20
|
-
},
|
|
21
|
-
setup(__props) {
|
|
22
|
-
const props = __props;
|
|
23
|
-
const folderStore = useFolderStore();
|
|
24
|
-
const folderPath = computed(() => [...props.path, props.group.title]);
|
|
25
|
-
const isFolderOpen = computed(() => folderStore.isFolderOpened(folderPath.value, true));
|
|
26
|
-
function toggleOpen() {
|
|
27
|
-
folderStore.toggleFolder(folderPath.value, false);
|
|
28
|
-
}
|
|
29
|
-
return (_ctx, _cache) => {
|
|
30
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
31
|
-
__props.group.title ? (openBlock(), createElementBlock("div", {
|
|
32
|
-
key: 0,
|
|
33
|
-
role: "button",
|
|
34
|
-
tabindex: "0",
|
|
35
|
-
class: "htw-px-0.5 htw-py-2 md:htw-py-1.5 htw-mx-1 htw-rounded-sm hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900 htw-cursor-pointer htw-select-none htw-flex htw-items-center htw-gap-1 htw-min-w-0",
|
|
36
|
-
onClick: toggleOpen,
|
|
37
|
-
onKeyup: [
|
|
38
|
-
withKeys(toggleOpen, ["enter"]),
|
|
39
|
-
withKeys(toggleOpen, ["space"])
|
|
40
|
-
]
|
|
41
|
-
}, [
|
|
42
|
-
createVNode(unref(Icon), {
|
|
43
|
-
icon: "carbon:caret-right",
|
|
44
|
-
class: normalizeClass(["htw-w-4 htw-h-4 htw-transition-transform htw-duration-150 htw-opacity-30 htw-flex-none", {
|
|
45
|
-
"htw-rotate-90": unref(isFolderOpen)
|
|
46
|
-
}])
|
|
47
|
-
}, null, 8, ["class"]),
|
|
48
|
-
createElementVNode("span", _hoisted_3, toDisplayString(__props.group.title), 1),
|
|
49
|
-
_hoisted_4
|
|
50
|
-
], 40, _hoisted_2)) : createCommentVNode("", true),
|
|
51
|
-
unref(isFolderOpen) ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
52
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.group.children, (element) => {
|
|
53
|
-
return openBlock(), createElementBlock(Fragment, {
|
|
54
|
-
key: element.title
|
|
55
|
-
}, [
|
|
56
|
-
element.children ? (openBlock(), createBlock(StoryListFolder, {
|
|
57
|
-
key: 0,
|
|
58
|
-
path: unref(folderPath),
|
|
59
|
-
folder: element,
|
|
60
|
-
stories: __props.stories,
|
|
61
|
-
depth: 0
|
|
62
|
-
}, null, 8, ["path", "folder", "stories"])) : (openBlock(), createBlock(StoryListItem, {
|
|
63
|
-
key: 1,
|
|
64
|
-
story: __props.stories[element.index],
|
|
65
|
-
depth: 0
|
|
66
|
-
}, null, 8, ["story"]))
|
|
67
|
-
], 64);
|
|
68
|
-
}), 128))
|
|
69
|
-
])) : createCommentVNode("", true)
|
|
70
|
-
]);
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
export { _sfc_main as default };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { createElementVNode, defineComponent, computed, openBlock, createElementBlock, withKeys, createVNode, unref, normalizeClass, toDisplayString, createCommentVNode, Fragment, renderList, createBlock } from "@histoire/vendors/vue";
|
|
2
|
+
import StoryListItem from "./StoryListItem.js";
|
|
3
|
+
import StoryListFolder from "./StoryListFolder.js";
|
|
4
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
5
|
+
import { useFolderStore } from "../../stores/folder.js";
|
|
6
|
+
const _hoisted_1 = {
|
|
7
|
+
"data-test-id": "story-group",
|
|
8
|
+
class: "htw-my-2 first:htw-mt-0 last:htw-mb-0"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_2 = ["onKeyup"];
|
|
11
|
+
const _hoisted_3 = { class: "htw-truncate htw-opacity-50" };
|
|
12
|
+
const _hoisted_4 = /* @__PURE__ */ createElementVNode("span", { class: "htw-h-[1px] htw-flex-1 htw-bg-gray-500/10 htw-mx-2" }, null, -1);
|
|
13
|
+
const _hoisted_5 = { key: 1 };
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
__name: "StoryGroup",
|
|
16
|
+
props: {
|
|
17
|
+
path: { default: () => [] },
|
|
18
|
+
group: null,
|
|
19
|
+
stories: null
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const folderStore = useFolderStore();
|
|
24
|
+
const folderPath = computed(() => [...props.path, props.group.title]);
|
|
25
|
+
const isFolderOpen = computed(() => folderStore.isFolderOpened(folderPath.value, true));
|
|
26
|
+
function toggleOpen() {
|
|
27
|
+
folderStore.toggleFolder(folderPath.value, false);
|
|
28
|
+
}
|
|
29
|
+
return (_ctx, _cache) => {
|
|
30
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
31
|
+
__props.group.title ? (openBlock(), createElementBlock("div", {
|
|
32
|
+
key: 0,
|
|
33
|
+
role: "button",
|
|
34
|
+
tabindex: "0",
|
|
35
|
+
class: "htw-px-0.5 htw-py-2 md:htw-py-1.5 htw-mx-1 htw-rounded-sm hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900 htw-cursor-pointer htw-select-none htw-flex htw-items-center htw-gap-1 htw-min-w-0",
|
|
36
|
+
onClick: toggleOpen,
|
|
37
|
+
onKeyup: [
|
|
38
|
+
withKeys(toggleOpen, ["enter"]),
|
|
39
|
+
withKeys(toggleOpen, ["space"])
|
|
40
|
+
]
|
|
41
|
+
}, [
|
|
42
|
+
createVNode(unref(Icon), {
|
|
43
|
+
icon: "carbon:caret-right",
|
|
44
|
+
class: normalizeClass(["htw-w-4 htw-h-4 htw-transition-transform htw-duration-150 htw-opacity-30 htw-flex-none", {
|
|
45
|
+
"htw-rotate-90": unref(isFolderOpen)
|
|
46
|
+
}])
|
|
47
|
+
}, null, 8, ["class"]),
|
|
48
|
+
createElementVNode("span", _hoisted_3, toDisplayString(__props.group.title), 1),
|
|
49
|
+
_hoisted_4
|
|
50
|
+
], 40, _hoisted_2)) : createCommentVNode("", true),
|
|
51
|
+
unref(isFolderOpen) ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
52
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.group.children, (element) => {
|
|
53
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
54
|
+
key: element.title
|
|
55
|
+
}, [
|
|
56
|
+
element.children ? (openBlock(), createBlock(StoryListFolder, {
|
|
57
|
+
key: 0,
|
|
58
|
+
path: unref(folderPath),
|
|
59
|
+
folder: element,
|
|
60
|
+
stories: __props.stories,
|
|
61
|
+
depth: 0
|
|
62
|
+
}, null, 8, ["path", "folder", "stories"])) : (openBlock(), createBlock(StoryListItem, {
|
|
63
|
+
key: 1,
|
|
64
|
+
story: __props.stories[element.index],
|
|
65
|
+
depth: 0
|
|
66
|
+
}, null, 8, ["story"]))
|
|
67
|
+
], 64);
|
|
68
|
+
}), 128))
|
|
69
|
+
])) : createCommentVNode("", true)
|
|
70
|
+
]);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
_sfc_main as default
|
|
76
|
+
};
|