@histoire/app 0.10.6 → 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,270 @@
|
|
|
1
|
+
import { defineComponent, ref, watch, computed, openBlock, createElementBlock, Fragment, createElementVNode, createVNode, unref, withDirectives, withKeys, withModifiers, vModelText, createBlock, withCtx, createTextVNode, renderList, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
|
+
import { useFocus, useDebounce } from "@histoire/vendors/vue-use";
|
|
3
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
4
|
+
import * as flexsearch from "flexsearch";
|
|
5
|
+
import charset from "../../node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/advanced.js";
|
|
6
|
+
import language from "../../node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/en.js";
|
|
7
|
+
import { useStoryStore } from "../../stores/story.js";
|
|
8
|
+
import BaseEmpty from "../base/BaseEmpty.js";
|
|
9
|
+
import SearchItem from "./SearchItem.js";
|
|
10
|
+
import { searchData, onUpdate } from "./search-title-data.js";
|
|
11
|
+
const _hoisted_1 = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "htw-max-h-[400px] htw-overflow-y-auto htw-rounded-b-lg"
|
|
14
|
+
};
|
|
15
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
|
+
__name: "SearchPane",
|
|
17
|
+
props: {
|
|
18
|
+
shown: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
emits: {
|
|
24
|
+
close: () => true
|
|
25
|
+
},
|
|
26
|
+
setup(__props, { emit }) {
|
|
27
|
+
const props = __props;
|
|
28
|
+
const DocSearchData = () => import("./search-docs-data.js");
|
|
29
|
+
function close() {
|
|
30
|
+
emit("close");
|
|
31
|
+
}
|
|
32
|
+
const input = ref();
|
|
33
|
+
const { focused } = useFocus(input, {
|
|
34
|
+
initialValue: true
|
|
35
|
+
});
|
|
36
|
+
watch(() => props.shown, (value) => {
|
|
37
|
+
if (value) {
|
|
38
|
+
requestAnimationFrame(() => {
|
|
39
|
+
focused.value = true;
|
|
40
|
+
input.value.select();
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const searchInputText = ref("");
|
|
45
|
+
const rateLimitedSearch = useDebounce(searchInputText, 50);
|
|
46
|
+
const storyStore = useStoryStore();
|
|
47
|
+
let titleSearchIndex;
|
|
48
|
+
let titleIdMap;
|
|
49
|
+
function createIndex() {
|
|
50
|
+
return new flexsearch.Document({
|
|
51
|
+
preset: "match",
|
|
52
|
+
document: {
|
|
53
|
+
id: "id",
|
|
54
|
+
index: [
|
|
55
|
+
"text"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
worker: true,
|
|
59
|
+
charset,
|
|
60
|
+
language,
|
|
61
|
+
tokenize: "forward"
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
async function loadSearchIndex(data) {
|
|
65
|
+
titleSearchIndex = createIndex();
|
|
66
|
+
for (const key of Object.keys(data.index)) {
|
|
67
|
+
await titleSearchIndex.import(key, data.index[key]);
|
|
68
|
+
}
|
|
69
|
+
titleIdMap = data.idMap;
|
|
70
|
+
}
|
|
71
|
+
loadSearchIndex(searchData);
|
|
72
|
+
onUpdate((searchData2) => {
|
|
73
|
+
loadSearchIndex(searchData2);
|
|
74
|
+
});
|
|
75
|
+
let docSearchIndex;
|
|
76
|
+
let docIdMap;
|
|
77
|
+
async function loadDocSearchIndex() {
|
|
78
|
+
async function load(data) {
|
|
79
|
+
docSearchIndex = createIndex();
|
|
80
|
+
for (const key of Object.keys(data.index)) {
|
|
81
|
+
await docSearchIndex.import(key, data.index[key]);
|
|
82
|
+
}
|
|
83
|
+
docIdMap = data.idMap;
|
|
84
|
+
if (rateLimitedSearch.value) {
|
|
85
|
+
searchOnDocField(rateLimitedSearch.value);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const searchDataModule = await DocSearchData();
|
|
89
|
+
load(searchDataModule.searchData);
|
|
90
|
+
searchDataModule.onUpdate((searchData2) => {
|
|
91
|
+
load(searchData2);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
loadDocSearchIndex();
|
|
95
|
+
const titleResults = ref([]);
|
|
96
|
+
watch(rateLimitedSearch, async (value) => {
|
|
97
|
+
const list = [];
|
|
98
|
+
const raw = await titleSearchIndex.search(value);
|
|
99
|
+
let rank = 0;
|
|
100
|
+
for (const field of raw) {
|
|
101
|
+
for (const id of field.result) {
|
|
102
|
+
const idMapData = titleIdMap[id];
|
|
103
|
+
if (!idMapData)
|
|
104
|
+
continue;
|
|
105
|
+
switch (idMapData.kind) {
|
|
106
|
+
case "story": {
|
|
107
|
+
list.push(storyResultFactory(storyStore.getStoryById(idMapData.id), rank));
|
|
108
|
+
rank++;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case "variant": {
|
|
112
|
+
const [storyId] = idMapData.id.split(":");
|
|
113
|
+
const story = storyStore.getStoryById(storyId);
|
|
114
|
+
const variant = storyStore.getVariantById(idMapData.id);
|
|
115
|
+
list.push(variantResultFactory(story, variant, rank));
|
|
116
|
+
rank++;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
titleResults.value = list;
|
|
123
|
+
});
|
|
124
|
+
const docsResults = ref([]);
|
|
125
|
+
async function searchOnDocField(query) {
|
|
126
|
+
if (docSearchIndex) {
|
|
127
|
+
const list = [];
|
|
128
|
+
const raw = await docSearchIndex.search(query);
|
|
129
|
+
let rank = 0;
|
|
130
|
+
for (const field of raw) {
|
|
131
|
+
for (const id of field.result) {
|
|
132
|
+
const idMapData = docIdMap[id];
|
|
133
|
+
if (!idMapData)
|
|
134
|
+
continue;
|
|
135
|
+
switch (idMapData.kind) {
|
|
136
|
+
case "story": {
|
|
137
|
+
list.push(storyResultFactory(storyStore.getStoryById(idMapData.id), rank, "docs"));
|
|
138
|
+
rank++;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
docsResults.value = list;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
watch(rateLimitedSearch, searchOnDocField);
|
|
148
|
+
function storyResultFactory(story, rank, type = "title") {
|
|
149
|
+
return {
|
|
150
|
+
kind: "story",
|
|
151
|
+
rank,
|
|
152
|
+
id: `story:${story.id}`,
|
|
153
|
+
title: story.title,
|
|
154
|
+
route: {
|
|
155
|
+
name: "story",
|
|
156
|
+
params: {
|
|
157
|
+
storyId: story.id
|
|
158
|
+
},
|
|
159
|
+
query: {
|
|
160
|
+
...type === "docs" ? { tab: "docs" } : {}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
path: story.file.path.slice(0, -1),
|
|
164
|
+
icon: story.icon,
|
|
165
|
+
iconColor: story.iconColor,
|
|
166
|
+
type
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function variantResultFactory(story, variant, rank, type = "title") {
|
|
170
|
+
var _a;
|
|
171
|
+
return {
|
|
172
|
+
kind: "variant",
|
|
173
|
+
rank,
|
|
174
|
+
id: `variant:${story.id}:${variant.id}`,
|
|
175
|
+
title: variant.title,
|
|
176
|
+
route: {
|
|
177
|
+
name: "story",
|
|
178
|
+
params: {
|
|
179
|
+
storyId: story.id
|
|
180
|
+
},
|
|
181
|
+
query: {
|
|
182
|
+
variantId: variant.id,
|
|
183
|
+
...type === "docs" ? { tab: "docs" } : {}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
path: [...(_a = story.file.path) != null ? _a : [], story.title],
|
|
187
|
+
icon: variant.icon,
|
|
188
|
+
iconColor: variant.iconColor,
|
|
189
|
+
type
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
const results = computed(() => {
|
|
193
|
+
const list = [...titleResults.value];
|
|
194
|
+
const seen = {};
|
|
195
|
+
for (const r of titleResults.value) {
|
|
196
|
+
seen[r.id] = true;
|
|
197
|
+
}
|
|
198
|
+
for (const r of docsResults.value) {
|
|
199
|
+
if (!seen[r.id]) {
|
|
200
|
+
list.push(r);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return list;
|
|
204
|
+
});
|
|
205
|
+
const selectedIndex = ref(0);
|
|
206
|
+
watch(results, () => {
|
|
207
|
+
selectedIndex.value = 0;
|
|
208
|
+
});
|
|
209
|
+
function selectNext() {
|
|
210
|
+
selectedIndex.value++;
|
|
211
|
+
if (selectedIndex.value > results.value.length - 1) {
|
|
212
|
+
selectedIndex.value = 0;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function selectPrevious() {
|
|
216
|
+
selectedIndex.value--;
|
|
217
|
+
if (selectedIndex.value < 0) {
|
|
218
|
+
selectedIndex.value = results.value.length - 1;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return (_ctx, _cache) => {
|
|
222
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
223
|
+
createElementVNode("div", {
|
|
224
|
+
class: "htw-flex htw-items-center htw-gap-4 htw-pl-6 htw-border htw-border-transparent focus-visible:htw-border-primary-500",
|
|
225
|
+
onClick: _cache[4] || (_cache[4] = ($event) => focused.value = true)
|
|
226
|
+
}, [
|
|
227
|
+
createVNode(unref(Icon), {
|
|
228
|
+
icon: "carbon:search",
|
|
229
|
+
class: "flex-none htw-w-4 htw-h-4"
|
|
230
|
+
}),
|
|
231
|
+
withDirectives(createElementVNode("input", {
|
|
232
|
+
ref_key: "input",
|
|
233
|
+
ref: input,
|
|
234
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchInputText.value = $event),
|
|
235
|
+
placeholder: "Search for stories, variants...",
|
|
236
|
+
class: "htw-bg-transparent htw-w-full htw-flex-1 htw-pl-0 htw-pr-6 htw-py-4 htw-outline-none",
|
|
237
|
+
onKeydown: [
|
|
238
|
+
_cache[1] || (_cache[1] = withKeys(withModifiers(($event) => selectNext(), ["prevent"]), ["down"])),
|
|
239
|
+
_cache[2] || (_cache[2] = withKeys(withModifiers(($event) => selectPrevious(), ["prevent"]), ["up"])),
|
|
240
|
+
_cache[3] || (_cache[3] = withKeys(($event) => close(), ["escape"]))
|
|
241
|
+
]
|
|
242
|
+
}, null, 544), [
|
|
243
|
+
[vModelText, searchInputText.value]
|
|
244
|
+
])
|
|
245
|
+
]),
|
|
246
|
+
unref(rateLimitedSearch) && !unref(results).length ? (openBlock(), createBlock(BaseEmpty, {
|
|
247
|
+
key: 0,
|
|
248
|
+
class: "no-animation"
|
|
249
|
+
}, {
|
|
250
|
+
default: withCtx(() => [
|
|
251
|
+
createTextVNode(" No results ")
|
|
252
|
+
]),
|
|
253
|
+
_: 1
|
|
254
|
+
})) : unref(results).length ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
255
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(results), (result, index) => {
|
|
256
|
+
return openBlock(), createBlock(SearchItem, {
|
|
257
|
+
key: result.id,
|
|
258
|
+
result,
|
|
259
|
+
selected: index === selectedIndex.value,
|
|
260
|
+
onClose: _cache[5] || (_cache[5] = ($event) => close())
|
|
261
|
+
}, null, 8, ["result", "selected"]);
|
|
262
|
+
}), 128))
|
|
263
|
+
])) : createCommentVNode("", true)
|
|
264
|
+
], 64);
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
export {
|
|
269
|
+
_sfc_main as default
|
|
270
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { markRaw } from "@histoire/vendors/vue";
|
|
2
|
-
import { searchData as searchData$1, onUpdate as onUpdate$1 } from "
|
|
2
|
+
import { searchData as searchData$1, onUpdate as onUpdate$1 } from "virtual:$histoire-search-docs-data";
|
|
3
3
|
const searchData = markRaw(searchData$1);
|
|
4
4
|
function onUpdate(cb) {
|
|
5
5
|
onUpdate$1(cb);
|
|
6
6
|
}
|
|
7
|
-
export {
|
|
7
|
+
export {
|
|
8
|
+
onUpdate,
|
|
9
|
+
searchData
|
|
10
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { markRaw } from "@histoire/vendors/vue";
|
|
2
|
-
import { searchData as searchData$1, onUpdate as onUpdate$1 } from "
|
|
2
|
+
import { searchData as searchData$1, onUpdate as onUpdate$1 } from "virtual:$histoire-search-title-data";
|
|
3
3
|
const searchData = markRaw(searchData$1);
|
|
4
4
|
function onUpdate(cb) {
|
|
5
5
|
onUpdate$1(cb);
|
|
6
6
|
}
|
|
7
|
-
export {
|
|
7
|
+
export {
|
|
8
|
+
onUpdate,
|
|
9
|
+
searchData
|
|
10
|
+
};
|
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import _sfc_main from "./GenericMountStory.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./GenericMountStory.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
5
5
|
};
|
|
6
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
-
...__default__,
|
|
8
|
-
__name: "GenericMountStory",
|
|
9
|
-
props: {
|
|
10
|
-
story: null
|
|
11
|
-
},
|
|
12
|
-
setup(__props) {
|
|
13
|
-
const props = __props;
|
|
14
|
-
const mountComponent = ref(null);
|
|
15
|
-
watchEffect(async () => {
|
|
16
|
-
var _a;
|
|
17
|
-
const clientPlugin = clientSupportPlugins[(_a = props.story.file) == null ? void 0 : _a.supportPluginId];
|
|
18
|
-
if (clientPlugin) {
|
|
19
|
-
const pluginModule = await clientPlugin();
|
|
20
|
-
mountComponent.value = markRaw(pluginModule.MountStory);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
return (_ctx, _cache) => {
|
|
24
|
-
return mountComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(mountComponent.value), mergeProps({
|
|
25
|
-
key: 0,
|
|
26
|
-
story: __props.story
|
|
27
|
-
}, _ctx.$attrs), null, 16, ["story"])) : createCommentVNode("", true);
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
export { _sfc_main as default };
|
package/dist/bundled/components/story/GenericMountStory.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent, ref, watchEffect, markRaw, openBlock, createBlock, resolveDynamicComponent, mergeProps, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
|
+
import { clientSupportPlugins } from "virtual:$histoire-support-plugins-client";
|
|
3
|
+
const __default__ = {
|
|
4
|
+
inheritAttrs: false
|
|
5
|
+
};
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
...__default__,
|
|
8
|
+
__name: "GenericMountStory",
|
|
9
|
+
props: {
|
|
10
|
+
story: null
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const mountComponent = ref(null);
|
|
15
|
+
watchEffect(async () => {
|
|
16
|
+
var _a;
|
|
17
|
+
const clientPlugin = clientSupportPlugins[(_a = props.story.file) == null ? void 0 : _a.supportPluginId];
|
|
18
|
+
if (clientPlugin) {
|
|
19
|
+
const pluginModule = await clientPlugin();
|
|
20
|
+
mountComponent.value = markRaw(pluginModule.MountStory);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return (_ctx, _cache) => {
|
|
24
|
+
return mountComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(mountComponent.value), mergeProps({
|
|
25
|
+
key: 0,
|
|
26
|
+
story: __props.story
|
|
27
|
+
}, _ctx.$attrs), null, 16, ["story"])) : createCommentVNode("", true);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
_sfc_main as default
|
|
33
|
+
};
|
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import _sfc_main from "./GenericRenderStory.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./GenericRenderStory.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
5
5
|
};
|
|
6
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
-
...__default__,
|
|
8
|
-
__name: "GenericRenderStory",
|
|
9
|
-
props: {
|
|
10
|
-
story: null
|
|
11
|
-
},
|
|
12
|
-
setup(__props) {
|
|
13
|
-
const props = __props;
|
|
14
|
-
const mountComponent = ref(null);
|
|
15
|
-
watchEffect(async () => {
|
|
16
|
-
var _a;
|
|
17
|
-
const clientPlugin = clientSupportPlugins[(_a = props.story.file) == null ? void 0 : _a.supportPluginId];
|
|
18
|
-
if (clientPlugin) {
|
|
19
|
-
const pluginModule = await clientPlugin();
|
|
20
|
-
mountComponent.value = markRaw(pluginModule.RenderStory);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
return (_ctx, _cache) => {
|
|
24
|
-
return mountComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(mountComponent.value), mergeProps({
|
|
25
|
-
key: 0,
|
|
26
|
-
story: __props.story
|
|
27
|
-
}, _ctx.$attrs), null, 16, ["story"])) : createCommentVNode("", true);
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
export { _sfc_main as default };
|
package/dist/bundled/components/story/GenericRenderStory.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent, ref, watchEffect, markRaw, openBlock, createBlock, resolveDynamicComponent, mergeProps, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
|
+
import { clientSupportPlugins } from "virtual:$histoire-support-plugins-client";
|
|
3
|
+
const __default__ = {
|
|
4
|
+
inheritAttrs: false
|
|
5
|
+
};
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
...__default__,
|
|
8
|
+
__name: "GenericRenderStory",
|
|
9
|
+
props: {
|
|
10
|
+
story: null
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const mountComponent = ref(null);
|
|
15
|
+
watchEffect(async () => {
|
|
16
|
+
var _a;
|
|
17
|
+
const clientPlugin = clientSupportPlugins[(_a = props.story.file) == null ? void 0 : _a.supportPluginId];
|
|
18
|
+
if (clientPlugin) {
|
|
19
|
+
const pluginModule = await clientPlugin();
|
|
20
|
+
mountComponent.value = markRaw(pluginModule.RenderStory);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return (_ctx, _cache) => {
|
|
24
|
+
return mountComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(mountComponent.value), mergeProps({
|
|
25
|
+
key: 0,
|
|
26
|
+
story: __props.story
|
|
27
|
+
}, _ctx.$attrs), null, 16, ["story"])) : createCommentVNode("", true);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
_sfc_main as default
|
|
33
|
+
};
|
|
@@ -1,181 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import "./StoryResponsivePreview.vue_vue_type_style_index_0_scoped_true_lang.js";
|
|
8
|
-
import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
|
|
9
|
-
const _withScopeId = (n) => (pushScopeId("data-v-4514e446"), n = n(), popScopeId(), n);
|
|
10
|
-
const _hoisted_1 = { class: "htw-w-full htw-h-full htw-flex-1 htw-border htw-border-gray-100 dark:htw-border-gray-800 htw-rounded-lg htw-relative htw-overflow-hidden" };
|
|
11
|
-
const _hoisted_2 = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "htw-absolute htw-inset-0 htw-w-full htw-h-full htw-bg-gray-200 dark:htw-bg-gray-850 htw-rounded-r-lg htw-border-l-2 htw-border-gray-500/10 dark:htw-border-gray-700/30 htw-overflow-hidden"
|
|
1
|
+
import _sfc_main from "./StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import "./StoryResponsivePreview.vue_vue_type_style_index_0_scoped_1375d05a_lang.js";
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const StoryResponsivePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1375d05a"]]);
|
|
5
|
+
export {
|
|
6
|
+
StoryResponsivePreview as default
|
|
14
7
|
};
|
|
15
|
-
const _hoisted_3 = { class: "htw-p-4 htw-h-full htw-relative" };
|
|
16
|
-
const _hoisted_4 = { class: "htw-w-full htw-h-full htw-border htw-border-gray-100 dark:htw-border-gray-800 htw-rounded-sm htw-relative" };
|
|
17
|
-
const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "bind-preview-bg htw-absolute htw-inset-0" }, null, -1));
|
|
18
|
-
const _hoisted_6 = /* @__PURE__ */ createStaticVNode('<div class="htw-absolute htw-top-1 htw-left-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-top-1 htw-right-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-bottom-1 htw-left-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-bottom-1 htw-right-4 htw-h-2 htw-w-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-left-1 htw-top-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-left-1 htw-bottom-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-right-1 htw-top-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div><div class="htw-absolute htw-right-1 htw-bottom-4 htw-w-2 htw-h-px htw-bg-gray-200 dark:htw-bg-gray-800" data-v-4514e446></div>', 8);
|
|
19
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
|
-
__name: "StoryResponsivePreview",
|
|
21
|
-
props: {
|
|
22
|
-
variant: null
|
|
23
|
-
},
|
|
24
|
-
setup(__props) {
|
|
25
|
-
const props = __props;
|
|
26
|
-
useCssVars((_ctx) => ({
|
|
27
|
-
"65757cd6": unref(settings).backgroundColor
|
|
28
|
-
}));
|
|
29
|
-
const settings = usePreviewSettingsStore().currentSettings;
|
|
30
|
-
const resizing = ref(false);
|
|
31
|
-
const onUnmountedCleanupFns = [];
|
|
32
|
-
onUnmounted(() => {
|
|
33
|
-
onUnmountedCleanupFns.forEach((fn) => fn());
|
|
34
|
-
});
|
|
35
|
-
function addWindowListener(event, listener) {
|
|
36
|
-
window.addEventListener(event, listener);
|
|
37
|
-
const removeListener = () => window.removeEventListener(event, listener);
|
|
38
|
-
onUnmountedCleanupFns.push(removeListener);
|
|
39
|
-
return () => {
|
|
40
|
-
removeListener();
|
|
41
|
-
onUnmountedCleanupFns.splice(onUnmountedCleanupFns.indexOf(removeListener), 1);
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function useDragger(el, value, min, max, axis) {
|
|
45
|
-
function onMouseDown(event) {
|
|
46
|
-
var _a;
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
event.stopPropagation();
|
|
49
|
-
const start = axis === "x" ? event.clientX : event.clientY;
|
|
50
|
-
const startValue = (_a = value.value) != null ? _a : axis === "x" ? previewWrapper.value.clientWidth - 67 : previewWrapper.value.clientHeight - 70;
|
|
51
|
-
resizing.value = true;
|
|
52
|
-
const removeListeners = [
|
|
53
|
-
addWindowListener("mousemove", onMouseMove),
|
|
54
|
-
addWindowListener("mouseup", onMouseUp)
|
|
55
|
-
];
|
|
56
|
-
function onMouseMove(event2) {
|
|
57
|
-
const snapTarget = axis === "x" ? previewWrapper.value.clientWidth : previewWrapper.value.clientHeight;
|
|
58
|
-
const delta = (axis === "x" ? event2.clientX : event2.clientY) - start;
|
|
59
|
-
value.value = Math.max(min, Math.min(max, startValue + delta));
|
|
60
|
-
if (Math.abs(value.value - (snapTarget - 67)) < 16) {
|
|
61
|
-
value.value = null;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
function onMouseUp() {
|
|
65
|
-
removeListeners.forEach((fn) => fn());
|
|
66
|
-
resizing.value = false;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
useEventListener(el, "mousedown", onMouseDown);
|
|
70
|
-
function onTouchStart(event) {
|
|
71
|
-
event.preventDefault();
|
|
72
|
-
event.stopPropagation();
|
|
73
|
-
const start = axis === "x" ? event.touches[0].clientX : event.touches[0].clientY;
|
|
74
|
-
const startValue = value.value;
|
|
75
|
-
resizing.value = true;
|
|
76
|
-
const removeListeners = [
|
|
77
|
-
addWindowListener("touchmove", onTouchMove),
|
|
78
|
-
addWindowListener("touchend", onTouchEnd),
|
|
79
|
-
addWindowListener("touchcancel", onTouchEnd)
|
|
80
|
-
];
|
|
81
|
-
function onTouchMove(event2) {
|
|
82
|
-
const delta = (axis === "x" ? event2.touches[0].clientX : event2.touches[0].clientY) - start;
|
|
83
|
-
value.value = Math.max(min, Math.min(max, startValue + delta));
|
|
84
|
-
}
|
|
85
|
-
function onTouchEnd() {
|
|
86
|
-
removeListeners.forEach((fn) => fn());
|
|
87
|
-
resizing.value = false;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
useEventListener(el, "touchstart", onTouchStart);
|
|
91
|
-
}
|
|
92
|
-
const responsiveWidth = computed({
|
|
93
|
-
get: () => settings[settings.rotate ? "responsiveHeight" : "responsiveWidth"],
|
|
94
|
-
set: (value) => {
|
|
95
|
-
settings[settings.rotate ? "responsiveHeight" : "responsiveWidth"] = value;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
const responsiveHeight = computed({
|
|
99
|
-
get: () => settings[settings.rotate ? "responsiveWidth" : "responsiveHeight"],
|
|
100
|
-
set: (value) => {
|
|
101
|
-
settings[settings.rotate ? "responsiveWidth" : "responsiveHeight"] = value;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
const horizontalDragger = ref();
|
|
105
|
-
const verticalDragger = ref();
|
|
106
|
-
const cornerDragger = ref();
|
|
107
|
-
const previewWrapper = ref();
|
|
108
|
-
useDragger(horizontalDragger, responsiveWidth, 32, 2e4, "x");
|
|
109
|
-
useDragger(verticalDragger, responsiveHeight, 32, 2e4, "y");
|
|
110
|
-
useDragger(cornerDragger, responsiveWidth, 32, 2e4, "x");
|
|
111
|
-
useDragger(cornerDragger, responsiveHeight, 32, 2e4, "y");
|
|
112
|
-
const finalWidth = computed(() => settings.rotate ? settings.responsiveHeight : settings.responsiveWidth);
|
|
113
|
-
const finalHeight = computed(() => settings.rotate ? settings.responsiveWidth : settings.responsiveHeight);
|
|
114
|
-
const isResponsiveEnabled = computed(() => !props.variant.responsiveDisabled);
|
|
115
|
-
return (_ctx, _cache) => {
|
|
116
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
117
|
-
unref(isResponsiveEnabled) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
118
|
-
createVNode(HatchedPattern, { class: "htw-w-full htw-h-full htw-text-black/[2%] dark:htw-text-white/[2%]" })
|
|
119
|
-
])) : createCommentVNode("", true),
|
|
120
|
-
createElementVNode("div", {
|
|
121
|
-
ref_key: "previewWrapper",
|
|
122
|
-
ref: previewWrapper,
|
|
123
|
-
class: "htw-h-full htw-overflow-auto htw-relative"
|
|
124
|
-
}, [
|
|
125
|
-
createElementVNode("div", {
|
|
126
|
-
class: normalizeClass(["htw-h-full htw-p-4 htw-overflow-hidden htw-bg-white dark:htw-bg-gray-700 htw-rounded-lg htw-relative", unref(isResponsiveEnabled) ? {
|
|
127
|
-
"htw-w-fit": !!unref(finalWidth),
|
|
128
|
-
"htw-h-fit": !!unref(finalHeight)
|
|
129
|
-
} : void 0])
|
|
130
|
-
}, [
|
|
131
|
-
createElementVNode("div", _hoisted_3, [
|
|
132
|
-
createElementVNode("div", _hoisted_4, [
|
|
133
|
-
_hoisted_5,
|
|
134
|
-
unref(settings).checkerboard ? (openBlock(), createBlock(CheckerboardPattern, {
|
|
135
|
-
key: 0,
|
|
136
|
-
class: "htw-absolute htw-inset-0 htw-w-full htw-h-full htw-text-gray-500/20"
|
|
137
|
-
})) : createCommentVNode("", true),
|
|
138
|
-
renderSlot(_ctx.$slots, "default", {
|
|
139
|
-
isResponsiveEnabled: unref(isResponsiveEnabled),
|
|
140
|
-
finalWidth: unref(finalWidth),
|
|
141
|
-
finalHeight: unref(finalHeight),
|
|
142
|
-
resizing: resizing.value
|
|
143
|
-
}, void 0, true)
|
|
144
|
-
]),
|
|
145
|
-
_hoisted_6
|
|
146
|
-
]),
|
|
147
|
-
unref(isResponsiveEnabled) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
148
|
-
createElementVNode("div", {
|
|
149
|
-
ref_key: "horizontalDragger",
|
|
150
|
-
ref: horizontalDragger,
|
|
151
|
-
class: "htw-absolute htw-w-4 htw-top-0 htw-bottom-4 htw-right-0 hover:htw-bg-primary-100 dark:hover:htw-bg-primary-800 htw-flex htw-items-center htw-justify-center htw-cursor-ew-resize htw-group hover:htw-text-primary-500"
|
|
152
|
-
}, [
|
|
153
|
-
createVNode(unref(Icon), {
|
|
154
|
-
icon: "mdi:drag-vertical-variant",
|
|
155
|
-
class: "htw-w-4 htw-h-4 htw-opacity-20 group-hover:htw-opacity-90"
|
|
156
|
-
})
|
|
157
|
-
], 512),
|
|
158
|
-
createElementVNode("div", {
|
|
159
|
-
ref_key: "verticalDragger",
|
|
160
|
-
ref: verticalDragger,
|
|
161
|
-
class: "htw-absolute htw-h-4 htw-left-0 htw-right-4 htw-bottom-0 hover:htw-bg-primary-100 dark:hover:htw-bg-primary-800 htw-flex htw-items-center htw-justify-center htw-cursor-ns-resize htw-group hover:htw-text-primary-500"
|
|
162
|
-
}, [
|
|
163
|
-
createVNode(unref(Icon), {
|
|
164
|
-
icon: "mdi:drag-horizontal-variant",
|
|
165
|
-
class: "htw-w-4 htw-h-4 htw-opacity-20 group-hover:htw-opacity-90"
|
|
166
|
-
})
|
|
167
|
-
], 512),
|
|
168
|
-
createElementVNode("div", {
|
|
169
|
-
ref_key: "cornerDragger",
|
|
170
|
-
ref: cornerDragger,
|
|
171
|
-
class: "htw-absolute htw-w-4 htw-h-4 htw-right-0 htw-bottom-0 hover:htw-bg-primary-100 dark:hover:htw-bg-primary-800 htw-flex htw-items-center htw-justify-center htw-cursor-nwse-resize htw-group hover:htw-text-primary-500"
|
|
172
|
-
}, null, 512)
|
|
173
|
-
], 64)) : createCommentVNode("", true)
|
|
174
|
-
], 2)
|
|
175
|
-
], 512)
|
|
176
|
-
]);
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
var StoryResponsivePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4514e446"]]);
|
|
181
|
-
export { StoryResponsivePreview as default };
|