@poveste/app 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/postcss.config.cjs +1 -1
- package/src/app/App.vue +9 -9
- package/src/app/assets/poveste-text-dark.svg +15 -0
- package/src/app/assets/poveste-text.svg +15 -0
- package/src/app/assets/poveste.svg +14 -0
- package/src/app/components/HomeView.vue +4 -4
- package/src/app/components/app/AppHeader.vue +4 -4
- package/src/app/components/app/AppLogo.vue +7 -7
- package/src/app/components/app/Breadcrumb.vue +1 -1
- package/src/app/components/app/InitialLoading.vue +3 -3
- package/src/app/components/app/MobileOverlay.vue +2 -2
- package/src/app/components/base/BaseButton.vue +1 -1
- package/src/app/components/base/BaseCheckbox.vue +1 -1
- package/src/app/components/base/BaseCopyIcon.vue +1 -1
- package/src/app/components/base/BaseEmpty.vue +1 -1
- package/src/app/components/base/BaseIcon.vue +2 -2
- package/src/app/components/base/BaseKeyboardShortcut.vue +1 -1
- package/src/app/components/base/BaseListItemLink.vue +1 -1
- package/src/app/components/base/BaseOverflowMenu.vue +1 -1
- package/src/app/components/base/BaseOverflowTab.vue +2 -2
- package/src/app/components/base/BaseSelect.vue +1 -1
- package/src/app/components/base/BaseSplitPane.vue +2 -2
- package/src/app/components/base/BaseTab.vue +2 -2
- package/src/app/components/base/BaseTag.vue +1 -1
- package/src/app/components/command/CommandPrompts.vue +1 -1
- package/src/app/components/command/CommandPromptsModal.vue +1 -1
- package/src/app/components/command/PromptSelect.vue +1 -1
- package/src/app/components/command/PromptText.vue +1 -1
- package/src/app/components/misc/HatchedPattern.vue +2 -2
- package/src/app/components/panel/ControlsComponentPropItem.vue +1 -1
- package/src/app/components/panel/ControlsComponentProps.vue +1 -1
- package/src/app/components/panel/ControlsComponentState.vue +1 -1
- package/src/app/components/panel/ControlsComponentStateItem.vue +1 -1
- package/src/app/components/panel/PaneTabs.vue +1 -1
- package/src/app/components/panel/StatePresets.vue +3 -3
- package/src/app/components/panel/StoryControls.vue +2 -2
- package/src/app/components/panel/StoryDocs.vue +6 -6
- package/src/app/components/panel/StoryEvent.vue +1 -1
- package/src/app/components/panel/StoryEvents.vue +1 -1
- package/src/app/components/panel/StorySidePanel.vue +3 -3
- package/src/app/components/panel/StorySourceCode.vue +5 -5
- package/src/app/components/search/SearchItem.vue +1 -1
- package/src/app/components/search/SearchLoading.vue +1 -1
- package/src/app/components/search/SearchModal.vue +1 -1
- package/src/app/components/search/SearchPane.vue +3 -3
- 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/GenericMountStory.vue +2 -2
- package/src/app/components/story/GenericRenderStory.vue +2 -2
- package/src/app/components/story/StoryResponsivePreview.vue +1 -1
- package/src/app/components/story/StoryVariantGrid.vue +2 -2
- package/src/app/components/story/StoryVariantGridItem.vue +6 -4
- package/src/app/components/story/StoryVariantListItem.vue +1 -1
- package/src/app/components/story/StoryVariantSingle.vue +2 -2
- package/src/app/components/story/StoryVariantSinglePreviewNative.vue +7 -5
- package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +1 -1
- package/src/app/components/story/StoryVariantSingleView.vue +2 -2
- package/src/app/components/story/StoryView.vue +2 -2
- package/src/app/components/story/StoryViewer.vue +1 -1
- package/src/app/components/toolbar/DevOnlyToolbarOpenInEditor.vue +1 -1
- package/src/app/components/toolbar/ToolbarBackground.vue +4 -4
- package/src/app/components/toolbar/ToolbarNewTab.vue +1 -1
- package/src/app/components/toolbar/ToolbarResponsiveSize.vue +5 -5
- package/src/app/components/toolbar/ToolbarTextDirection.vue +1 -1
- package/src/app/components/toolbar/ToolbarTitle.vue +1 -1
- package/src/app/components/tree/StoryGroup.vue +1 -1
- package/src/app/components/tree/StoryList.vue +1 -1
- package/src/app/components/tree/StoryListFolder.vue +3 -3
- package/src/app/components/tree/StoryListItem.vue +1 -1
- package/src/app/index.ts +2 -2
- package/src/app/plugin.ts +2 -2
- package/src/app/router.ts +2 -2
- package/src/app/sandbox.ts +6 -6
- package/src/app/stores/folder.ts +1 -1
- package/src/app/stores/preview-settings.ts +1 -1
- package/src/app/style/main.pcss +3 -3
- package/src/app/style/sandbox.css +1 -1
- package/src/app/style/transitions.pcss +4 -4
- package/src/app/types.ts +2 -2
- package/src/app/util/commands.ts +2 -2
- package/src/app/util/config.ts +2 -2
- package/src/app/util/const.ts +4 -4
- package/src/app/util/dark.ts +4 -4
- package/src/app/util/docs.ts +1 -1
- package/src/app/util/events.ts +1 -1
- package/src/app/util/preview-settings.ts +5 -3
- package/src/virtual.d.ts +1 -1
- package/tailwind.config.cjs +2 -2
- package/vite.config.ts +2 -2
- package/dist/app/assets/histoire-text-dark.svg +0 -89
- package/dist/app/assets/histoire-text.svg +0 -89
- package/dist/app/assets/histoire.svg +0 -51
- package/dist/app/style/floating.pcss +0 -34
- package/dist/app/style/main.pcss +0 -100
- package/dist/app/style/sandbox.css +0 -24
- package/dist/app/style/transitions.pcss +0 -51
- package/dist/bundle-index.js +0 -1
- package/dist/bundle-main-dev.js +0 -4
- package/dist/bundle-main.js +0 -5
- package/dist/bundle-sandbox-dev.js +0 -2
- package/dist/bundle-sandbox.js +0 -2
- package/dist/bundled/App.vue.js +0 -5
- package/dist/bundled/App.vue2.js +0 -167
- package/dist/bundled/_virtual/_plugin-vue_export-helper.js +0 -10
- package/dist/bundled/api.js +0 -12
- package/dist/bundled/app.css +0 -116
- package/dist/bundled/assets/histoire-text-dark.svg.js +0 -4
- package/dist/bundled/assets/histoire-text.svg.js +0 -4
- package/dist/bundled/assets/histoire.svg.js +0 -4
- package/dist/bundled/components/HomeView.vue.js +0 -5
- package/dist/bundled/components/HomeView.vue2.js +0 -66
- package/dist/bundled/components/app/AppHeader.vue.js +0 -5
- package/dist/bundled/components/app/AppHeader.vue2.js +0 -71
- package/dist/bundled/components/app/AppLogo.vue.js +0 -5
- package/dist/bundled/components/app/AppLogo.vue2.js +0 -29
- package/dist/bundled/components/app/Breadcrumb.vue.js +0 -8
- package/dist/bundled/components/app/Breadcrumb.vue2.js +0 -91
- package/dist/bundled/components/app/HomeCounter.vue.js +0 -5
- package/dist/bundled/components/app/HomeCounter.vue2.js +0 -42
- package/dist/bundled/components/app/InitialLoading.vue.js +0 -5
- package/dist/bundled/components/app/InitialLoading.vue2.js +0 -51
- package/dist/bundled/components/app/MobileOverlay.vue.js +0 -5
- package/dist/bundled/components/app/MobileOverlay.vue2.js +0 -45
- package/dist/bundled/components/base/BaseButton.vue.js +0 -5
- package/dist/bundled/components/base/BaseButton.vue2.js +0 -39
- package/dist/bundled/components/base/BaseCheckbox.vue.js +0 -5
- package/dist/bundled/components/base/BaseCheckbox.vue2.js +0 -78
- package/dist/bundled/components/base/BaseEmpty.vue.js +0 -14
- package/dist/bundled/components/base/BaseIcon.vue.js +0 -8
- package/dist/bundled/components/base/BaseIcon.vue2.js +0 -29
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue.js +0 -5
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue2.js +0 -20
- package/dist/bundled/components/base/BaseListItem.vue.js +0 -5
- package/dist/bundled/components/base/BaseListItem.vue2.js +0 -33
- package/dist/bundled/components/base/BaseListItemLink.vue.js +0 -33
- package/dist/bundled/components/base/BaseListItemLink.vue2.js +0 -26
- package/dist/bundled/components/base/BaseOverflowMenu.vue.js +0 -5
- package/dist/bundled/components/base/BaseOverflowMenu.vue2.js +0 -100
- package/dist/bundled/components/base/BaseOverflowTab.vue.js +0 -36
- package/dist/bundled/components/base/BaseOverflowTab.vue2.js +0 -18
- package/dist/bundled/components/base/BaseSelect.vue.js +0 -5
- package/dist/bundled/components/base/BaseSelect.vue2.js +0 -77
- package/dist/bundled/components/base/BaseSplitPane.vue.js +0 -8
- package/dist/bundled/components/base/BaseSplitPane.vue2.js +0 -183
- package/dist/bundled/components/base/BaseTab.vue.js +0 -36
- package/dist/bundled/components/base/BaseTab.vue2.js +0 -18
- package/dist/bundled/components/base/BaseTag.vue.js +0 -13
- package/dist/bundled/components/command/CommandPrompts.vue.js +0 -5
- package/dist/bundled/components/command/CommandPrompts.vue2.js +0 -91
- package/dist/bundled/components/command/CommandPromptsModal.vue.js +0 -5
- package/dist/bundled/components/command/CommandPromptsModal.vue2.js +0 -45
- package/dist/bundled/components/command/PromptSelect.vue.js +0 -5
- package/dist/bundled/components/command/PromptSelect.vue2.js +0 -142
- package/dist/bundled/components/command/PromptText.vue.js +0 -5
- package/dist/bundled/components/command/PromptText.vue2.js +0 -67
- package/dist/bundled/components/misc/CheckerboardPattern.vue.js +0 -40
- package/dist/bundled/components/misc/HatchedPattern.vue.js +0 -12
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue2.js +0 -72
- package/dist/bundled/components/panel/ControlsComponentProps.vue.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentProps.vue2.js +0 -45
- package/dist/bundled/components/panel/ControlsComponentState.vue.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentState.vue2.js +0 -41
- package/dist/bundled/components/panel/ControlsComponentStateItem.vue.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentStateItem.vue2.js +0 -46
- package/dist/bundled/components/panel/PaneTabs.vue.js +0 -5
- package/dist/bundled/components/panel/PaneTabs.vue2.js +0 -114
- package/dist/bundled/components/panel/StatePresets.vue.js +0 -5
- package/dist/bundled/components/panel/StatePresets.vue2.js +0 -193
- package/dist/bundled/components/panel/StoryControls.vue.js +0 -5
- package/dist/bundled/components/panel/StoryControls.vue2.js +0 -87
- package/dist/bundled/components/panel/StoryDocs.vue.js +0 -7
- package/dist/bundled/components/panel/StoryDocs.vue2.js +0 -161
- package/dist/bundled/components/panel/StoryEvent.vue.js +0 -5
- package/dist/bundled/components/panel/StoryEvent.vue2.js +0 -59
- package/dist/bundled/components/panel/StoryEvents.vue.js +0 -5
- package/dist/bundled/components/panel/StoryEvents.vue2.js +0 -53
- package/dist/bundled/components/panel/StorySidePanel.vue.js +0 -5
- package/dist/bundled/components/panel/StorySidePanel.vue2.js +0 -83
- package/dist/bundled/components/panel/StorySourceCode.vue.js +0 -8
- package/dist/bundled/components/panel/StorySourceCode.vue2.js +0 -204
- package/dist/bundled/components/search/SearchItem.vue.js +0 -8
- package/dist/bundled/components/search/SearchItem.vue2.js +0 -93
- package/dist/bundled/components/search/SearchItemContent.vue.js +0 -5
- package/dist/bundled/components/search/SearchItemContent.vue2.js +0 -71
- package/dist/bundled/components/search/SearchLoading.vue.js +0 -5
- package/dist/bundled/components/search/SearchLoading.vue2.js +0 -21
- package/dist/bundled/components/search/SearchModal.vue.js +0 -5
- package/dist/bundled/components/search/SearchModal.vue2.js +0 -51
- package/dist/bundled/components/search/SearchPane.vue.js +0 -5
- package/dist/bundled/components/search/SearchPane.vue2.js +0 -272
- package/dist/bundled/components/search/search-docs-data.js +0 -11
- package/dist/bundled/components/search/search-title-data.js +0 -11
- package/dist/bundled/components/story/GenericMountStory.vue.js +0 -5
- package/dist/bundled/components/story/GenericMountStory.vue2.js +0 -34
- package/dist/bundled/components/story/GenericRenderStory.vue.js +0 -5
- package/dist/bundled/components/story/GenericRenderStory.vue2.js +0 -39
- package/dist/bundled/components/story/StoryResponsivePreview.vue.js +0 -8
- package/dist/bundled/components/story/StoryResponsivePreview.vue2.js +0 -207
- package/dist/bundled/components/story/StoryVariantGrid.vue.js +0 -5
- package/dist/bundled/components/story/StoryVariantGrid.vue2.js +0 -146
- package/dist/bundled/components/story/StoryVariantGridItem.vue.js +0 -8
- package/dist/bundled/components/story/StoryVariantGridItem.vue2.js +0 -153
- package/dist/bundled/components/story/StoryVariantListItem.vue.js +0 -8
- package/dist/bundled/components/story/StoryVariantListItem.vue2.js +0 -55
- package/dist/bundled/components/story/StoryVariantSingle.vue.js +0 -8
- package/dist/bundled/components/story/StoryVariantSingle.vue2.js +0 -107
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue.js +0 -5
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue2.js +0 -70
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue.js +0 -5
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue2.js +0 -128
- package/dist/bundled/components/story/StoryVariantSingleView.vue.js +0 -5
- package/dist/bundled/components/story/StoryVariantSingleView.vue2.js +0 -66
- package/dist/bundled/components/story/StoryView.vue.js +0 -5
- package/dist/bundled/components/story/StoryView.vue2.js +0 -104
- package/dist/bundled/components/story/StoryViewer.vue.js +0 -8
- package/dist/bundled/components/story/StoryViewer.vue2.js +0 -55
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue.js +0 -5
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue2.js +0 -31
- package/dist/bundled/components/toolbar/ToolbarBackground.vue.js +0 -8
- package/dist/bundled/components/toolbar/ToolbarBackground.vue2.js +0 -98
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue2.js +0 -36
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue2.js +0 -127
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue2.js +0 -27
- package/dist/bundled/components/toolbar/ToolbarTitle.vue.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarTitle.vue2.js +0 -26
- package/dist/bundled/components/tree/StoryGroup.vue.js +0 -5
- package/dist/bundled/components/tree/StoryGroup.vue2.js +0 -74
- package/dist/bundled/components/tree/StoryList.vue.js +0 -5
- package/dist/bundled/components/tree/StoryList.vue2.js +0 -41
- package/dist/bundled/components/tree/StoryListFolder.vue.js +0 -8
- package/dist/bundled/components/tree/StoryListFolder.vue2.js +0 -86
- package/dist/bundled/components/tree/StoryListItem.vue.js +0 -8
- package/dist/bundled/components/tree/StoryListItem.vue2.js +0 -69
- package/dist/bundled/index.js +0 -35
- package/dist/bundled/plugin.js +0 -49
- package/dist/bundled/router.js +0 -32
- package/dist/bundled/sandbox.js +0 -87
- package/dist/bundled/stores/command.js +0 -25
- package/dist/bundled/stores/events.js +0 -29
- package/dist/bundled/stores/folder.js +0 -54
- package/dist/bundled/stores/preview-settings.js +0 -19
- package/dist/bundled/stores/story.js +0 -43
- package/dist/bundled/util/commands.js +0 -57
- package/dist/bundled/util/config.js +0 -8
- package/dist/bundled/util/const.js +0 -10
- package/dist/bundled/util/dark.js +0 -28
- package/dist/bundled/util/docs.js +0 -26
- package/dist/bundled/util/env.js +0 -4
- package/dist/bundled/util/events.js +0 -33
- package/dist/bundled/util/keyboard.js +0 -90
- package/dist/bundled/util/mapping.js +0 -70
- package/dist/bundled/util/open-in-editor.js +0 -6
- package/dist/bundled/util/preview-settings.js +0 -21
- package/dist/bundled/util/responsive.js +0 -6
- package/dist/bundled/util/sandbox.js +0 -11
- package/dist/bundled/util/scroll.js +0 -31
- package/dist/bundled/util/select.js +0 -28
- package/dist/bundled/util/state.js +0 -41
- package/dist/bundled/util/tooltip.js +0 -15
- package/dist/bundled/util/variant.js +0 -21
- package/dist/style.css +0 -2626
- package/src/app/assets/histoire-text-dark.svg +0 -89
- package/src/app/assets/histoire-text.svg +0 -89
- package/src/app/assets/histoire.svg +0 -51
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, watch, onMounted, createElementBlock, openBlock, createCommentVNode, createElementVNode, unref, createVNode, createBlock, normalizeStyle, Fragment, renderList } from "@poveste/vendors/vue";
|
|
2
|
-
import { useResizeObserver } from "@poveste/vendors/vue-use";
|
|
3
|
-
import { useStoryStore } from "../../stores/story.js";
|
|
4
|
-
import { isMobile } from "../../util/responsive.js";
|
|
5
|
-
import "../toolbar/DevOnlyToolbarOpenInEditor.vue.js";
|
|
6
|
-
import ToolbarBackground from "../toolbar/ToolbarBackground.vue.js";
|
|
7
|
-
import "../toolbar/ToolbarTextDirection.vue.js";
|
|
8
|
-
import StoryVariantGridItem from "./StoryVariantGridItem.vue.js";
|
|
9
|
-
import _sfc_main$1 from "../toolbar/ToolbarTextDirection.vue2.js";
|
|
10
|
-
import _sfc_main$2 from "../toolbar/DevOnlyToolbarOpenInEditor.vue2.js";
|
|
11
|
-
"use strict";
|
|
12
|
-
const _hoisted_1 = { class: "histoire-story-variant-grid htw-flex htw-flex-col htw-items-stretch htw-h-full __histoire-pane-shadow-from-right" };
|
|
13
|
-
const _hoisted_2 = {
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "htw-flex-none htw-flex htw-items-center htw-justify-end htw-h-8 htw-mx-2 htw-mt-1"
|
|
16
|
-
};
|
|
17
|
-
const _hoisted_3 = { class: "htw-flex htw-w-0 htw-flex-1 htw-mx-4" };
|
|
18
|
-
const margin = 16;
|
|
19
|
-
const gap = 16;
|
|
20
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
21
|
-
__name: "StoryVariantGrid",
|
|
22
|
-
setup(__props) {
|
|
23
|
-
const storyStore = useStoryStore();
|
|
24
|
-
const gridTemplateWidth = computed(() => {
|
|
25
|
-
if (storyStore.currentStory.layout.type !== "grid") {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const layoutWidth = storyStore.currentStory.layout.width;
|
|
29
|
-
if (!layoutWidth) {
|
|
30
|
-
return "200px";
|
|
31
|
-
}
|
|
32
|
-
if (typeof layoutWidth === "number") {
|
|
33
|
-
return `${layoutWidth}px`;
|
|
34
|
-
}
|
|
35
|
-
return layoutWidth;
|
|
36
|
-
});
|
|
37
|
-
const itemWidth = ref(16);
|
|
38
|
-
const maxItemHeight = ref(0);
|
|
39
|
-
const maxCount = ref(10);
|
|
40
|
-
const countPerRow = ref(0);
|
|
41
|
-
const visibleRows = ref(0);
|
|
42
|
-
const el = ref(null);
|
|
43
|
-
useResizeObserver(el, () => {
|
|
44
|
-
updateMaxCount();
|
|
45
|
-
updateSize();
|
|
46
|
-
});
|
|
47
|
-
function updateMaxCount() {
|
|
48
|
-
if (!maxItemHeight.value) return;
|
|
49
|
-
const width = el.value.clientWidth - margin * 2;
|
|
50
|
-
const height = el.value.clientHeight;
|
|
51
|
-
const scrollTop = el.value.scrollTop;
|
|
52
|
-
countPerRow.value = Math.floor((width + gap) / (itemWidth.value + gap));
|
|
53
|
-
visibleRows.value = Math.ceil((height + scrollTop + gap) / (maxItemHeight.value + gap));
|
|
54
|
-
const newMaxCount = countPerRow.value * visibleRows.value;
|
|
55
|
-
if (maxCount.value < newMaxCount) {
|
|
56
|
-
maxCount.value = newMaxCount;
|
|
57
|
-
}
|
|
58
|
-
if (storyStore.currentVariant) {
|
|
59
|
-
const index = storyStore.currentStory.variants.indexOf(storyStore.currentVariant);
|
|
60
|
-
if (index + 1 > maxCount.value) {
|
|
61
|
-
maxCount.value = index + 1;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function onItemResize(w, h) {
|
|
66
|
-
itemWidth.value = w;
|
|
67
|
-
if (maxItemHeight.value < h) {
|
|
68
|
-
maxItemHeight.value = h;
|
|
69
|
-
updateMaxCount();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
watch(() => storyStore.currentVariant, () => {
|
|
73
|
-
maxItemHeight.value = 0;
|
|
74
|
-
updateMaxCount();
|
|
75
|
-
});
|
|
76
|
-
const gridEl = ref(null);
|
|
77
|
-
const gridColumnWidth = ref(1);
|
|
78
|
-
const viewWidth = ref(1);
|
|
79
|
-
function updateSize() {
|
|
80
|
-
if (!el.value) return;
|
|
81
|
-
viewWidth.value = el.value.clientWidth;
|
|
82
|
-
if (!gridEl.value) return;
|
|
83
|
-
if (gridTemplateWidth.value.endsWith("%")) {
|
|
84
|
-
gridColumnWidth.value = viewWidth.value * Number.parseInt(gridTemplateWidth.value) / 100 - gap;
|
|
85
|
-
} else {
|
|
86
|
-
gridColumnWidth.value = Number.parseInt(gridTemplateWidth.value);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
onMounted(() => {
|
|
90
|
-
updateSize();
|
|
91
|
-
});
|
|
92
|
-
useResizeObserver(gridEl, () => {
|
|
93
|
-
updateSize();
|
|
94
|
-
});
|
|
95
|
-
const columnCount = computed(() => Math.min(storyStore.currentStory.variants.length, Math.floor((viewWidth.value + gap) / (gridColumnWidth.value + gap))));
|
|
96
|
-
return (_ctx, _cache) => {
|
|
97
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
98
|
-
!unref(isMobile) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
99
|
-
createVNode(ToolbarBackground),
|
|
100
|
-
createVNode(_sfc_main$1),
|
|
101
|
-
_ctx.__HISTOIRE_DEV__ ? (openBlock(), createBlock(_sfc_main$2, {
|
|
102
|
-
key: 0,
|
|
103
|
-
file: unref(storyStore).currentStory.file?.filePath,
|
|
104
|
-
tooltip: "Edit story in editor"
|
|
105
|
-
}, null, 8, ["file"])) : createCommentVNode("", true)
|
|
106
|
-
])) : createCommentVNode("", true),
|
|
107
|
-
createElementVNode("div", {
|
|
108
|
-
ref_key: "el",
|
|
109
|
-
ref: el,
|
|
110
|
-
class: "htw-overflow-y-auto htw-flex htw-flex-1",
|
|
111
|
-
onScroll: _cache[0] || (_cache[0] = ($event) => updateMaxCount())
|
|
112
|
-
}, [
|
|
113
|
-
createElementVNode("div", _hoisted_3, [
|
|
114
|
-
createElementVNode("div", {
|
|
115
|
-
class: "htw-m-auto",
|
|
116
|
-
style: normalizeStyle({
|
|
117
|
-
minHeight: `${unref(storyStore).currentStory.variants.length / countPerRow.value * (maxItemHeight.value + gap) - gap}px`
|
|
118
|
-
})
|
|
119
|
-
}, [
|
|
120
|
-
createElementVNode("div", {
|
|
121
|
-
ref_key: "gridEl",
|
|
122
|
-
ref: gridEl,
|
|
123
|
-
class: "htw-grid htw-gap-4 htw-my-4",
|
|
124
|
-
style: normalizeStyle({
|
|
125
|
-
gridTemplateColumns: `repeat(${columnCount.value}, ${gridColumnWidth.value}px)`
|
|
126
|
-
})
|
|
127
|
-
}, [
|
|
128
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(storyStore).currentStory.variants.slice(0, maxCount.value), (variant, index) => {
|
|
129
|
-
return openBlock(), createBlock(StoryVariantGridItem, {
|
|
130
|
-
key: index,
|
|
131
|
-
variant,
|
|
132
|
-
story: unref(storyStore).currentStory,
|
|
133
|
-
onResize: onItemResize
|
|
134
|
-
}, null, 8, ["variant", "story"]);
|
|
135
|
-
}), 128))
|
|
136
|
-
], 4)
|
|
137
|
-
], 4)
|
|
138
|
-
])
|
|
139
|
-
], 544)
|
|
140
|
-
]);
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
export {
|
|
145
|
-
_sfc_main as default
|
|
146
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import _sfc_main from "./StoryVariantGridItem.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
"use strict";
|
|
5
|
-
const StoryVariantGridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2cc73400"]]);
|
|
6
|
-
export {
|
|
7
|
-
StoryVariantGridItem as default
|
|
8
|
-
};
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { defineComponent, useCssVars, unref, toRefs, ref, computed, resolveComponent, resolveDirective, createElementBlock, openBlock, createElementVNode, withDirectives, createBlock, normalizeClass, withCtx, createVNode, toDisplayString, withModifiers, createCommentVNode, normalizeStyle } from "@poveste/vendors/vue";
|
|
2
|
-
import { Icon } from "@poveste/vendors/iconify";
|
|
3
|
-
import { HstCopyIcon } from "@poveste/controls";
|
|
4
|
-
import { useResizeObserver } from "@poveste/vendors/vue-use";
|
|
5
|
-
import { useRouter } from "@poveste/vendors/vue-router";
|
|
6
|
-
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
7
|
-
import { histoireConfig } from "../../util/config.js";
|
|
8
|
-
import { isDark } from "../../util/dark.js";
|
|
9
|
-
import { getSourceCode } from "../../util/docs.js";
|
|
10
|
-
import { getContrastColor } from "../../util/preview-settings.js";
|
|
11
|
-
import { useScrollOnActive } from "../../util/scroll.js";
|
|
12
|
-
import { useCurrentVariantRoute } from "../../util/variant.js";
|
|
13
|
-
import CheckerboardPattern from "../misc/CheckerboardPattern.vue.js";
|
|
14
|
-
import "../toolbar/ToolbarNewTab.vue.js";
|
|
15
|
-
import "./GenericRenderStory.vue.js";
|
|
16
|
-
import _sfc_main$1 from "../toolbar/ToolbarNewTab.vue2.js";
|
|
17
|
-
import _sfc_main$2 from "./GenericRenderStory.vue2.js";
|
|
18
|
-
"use strict";
|
|
19
|
-
const _hoisted_1 = { class: "htw-flex-none htw-flex htw-items-center" };
|
|
20
|
-
const _hoisted_2 = { class: "htw-truncate htw-flex-1" };
|
|
21
|
-
const _hoisted_3 = { class: "htw-flex-none htw-ml-auto htw-hidden group-hover:htw-flex htw-items-center" };
|
|
22
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
23
|
-
__name: "StoryVariantGridItem",
|
|
24
|
-
props: {
|
|
25
|
-
variant: {
|
|
26
|
-
type: Object,
|
|
27
|
-
required: true
|
|
28
|
-
},
|
|
29
|
-
story: {
|
|
30
|
-
type: Object,
|
|
31
|
-
required: true
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
emits: {
|
|
35
|
-
resize: (_width, _height) => true
|
|
36
|
-
},
|
|
37
|
-
setup(__props, { emit: __emit }) {
|
|
38
|
-
useCssVars((_ctx) => ({
|
|
39
|
-
"v2f48b1c5": unref(variant).iconColor,
|
|
40
|
-
"v19f135f4": unref(settings).backgroundColor
|
|
41
|
-
}));
|
|
42
|
-
const props = __props;
|
|
43
|
-
const emit = __emit;
|
|
44
|
-
const { variant } = toRefs(props);
|
|
45
|
-
const { isActive, targetRoute } = useCurrentVariantRoute(variant);
|
|
46
|
-
Object.assign(props.variant, {
|
|
47
|
-
previewReady: false
|
|
48
|
-
});
|
|
49
|
-
function onReady() {
|
|
50
|
-
Object.assign(props.variant, {
|
|
51
|
-
previewReady: true
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
const router = useRouter();
|
|
55
|
-
function selectVariant() {
|
|
56
|
-
router.push(targetRoute.value);
|
|
57
|
-
}
|
|
58
|
-
const el = ref();
|
|
59
|
-
const { autoScroll } = useScrollOnActive(isActive, el);
|
|
60
|
-
useResizeObserver(el, () => {
|
|
61
|
-
if (props.variant.previewReady) {
|
|
62
|
-
emit("resize", el.value.clientWidth, el.value.clientHeight);
|
|
63
|
-
if (isActive.value) {
|
|
64
|
-
autoScroll();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
const settings = usePreviewSettingsStore().currentSettings;
|
|
69
|
-
const contrastColor = computed(() => getContrastColor(settings));
|
|
70
|
-
const autoApplyContrastColor = computed(() => !!histoireConfig.autoApplyContrastColor);
|
|
71
|
-
return (_ctx, _cache) => {
|
|
72
|
-
const _component_RouterLink = resolveComponent("RouterLink");
|
|
73
|
-
const _directive_tooltip = resolveDirective("tooltip");
|
|
74
|
-
return openBlock(), createElementBlock("div", {
|
|
75
|
-
ref_key: "el",
|
|
76
|
-
ref: el,
|
|
77
|
-
class: "histoire-story-variant-grid-item htw-cursor-default htw-flex htw-flex-col htw-gap-y-1 htw-group"
|
|
78
|
-
}, [
|
|
79
|
-
createElementVNode("div", _hoisted_1, [
|
|
80
|
-
withDirectives((openBlock(), createBlock(_component_RouterLink, {
|
|
81
|
-
to: unref(targetRoute),
|
|
82
|
-
class: normalizeClass(["htw-rounded htw-w-max htw-px-2 htw-py-0.5 htw-min-w-16 htw-cursor-pointer htw-flex htw-items-center htw-gap-1 htw-flex-shrink", {
|
|
83
|
-
"hover:htw-bg-gray-200 htw-text-gray-500 dark:hover:htw-bg-gray-800": !unref(isActive),
|
|
84
|
-
"htw-bg-primary-200 hover:htw-bg-primary-300 htw-text-primary-800 dark:htw-bg-primary-700 dark:hover:htw-bg-primary-800 dark:htw-text-primary-200": unref(isActive)
|
|
85
|
-
}])
|
|
86
|
-
}, {
|
|
87
|
-
default: withCtx(() => [
|
|
88
|
-
createVNode(unref(Icon), {
|
|
89
|
-
icon: unref(variant).icon ?? "carbon:cube",
|
|
90
|
-
class: normalizeClass(["htw-w-4 htw-h-4 htw-opacity-50", {
|
|
91
|
-
"htw-text-gray-500": !unref(isActive) && !unref(variant).iconColor,
|
|
92
|
-
"bind-icon-color": !unref(isActive) && unref(variant).iconColor
|
|
93
|
-
}])
|
|
94
|
-
}, null, 8, ["icon", "class"]),
|
|
95
|
-
createElementVNode("span", _hoisted_2, toDisplayString(unref(variant).title), 1)
|
|
96
|
-
]),
|
|
97
|
-
_: 1
|
|
98
|
-
}, 8, ["to", "class"])), [
|
|
99
|
-
[_directive_tooltip, unref(variant).title]
|
|
100
|
-
]),
|
|
101
|
-
createElementVNode("div", _hoisted_3, [
|
|
102
|
-
createVNode(unref(HstCopyIcon), {
|
|
103
|
-
content: () => unref(getSourceCode)(__props.story, unref(variant))
|
|
104
|
-
}, null, 8, ["content"]),
|
|
105
|
-
createVNode(_sfc_main$1, {
|
|
106
|
-
variant: unref(variant),
|
|
107
|
-
story: __props.story
|
|
108
|
-
}, null, 8, ["variant", "story"])
|
|
109
|
-
])
|
|
110
|
-
]),
|
|
111
|
-
createElementVNode("div", {
|
|
112
|
-
class: normalizeClass(["htw-border htw-bg-white dark:htw-bg-gray-700 htw-rounded htw-flex-1 htw-p-4 htw-relative", {
|
|
113
|
-
"htw-border-gray-100 dark:htw-border-gray-800": !unref(isActive),
|
|
114
|
-
"htw-border-primary-200 dark:htw-border-primary-900": unref(isActive)
|
|
115
|
-
}]),
|
|
116
|
-
"data-test-id": "sandbox-render",
|
|
117
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => selectVariant(), ["stop"])),
|
|
118
|
-
onKeyup: _cache[1] || (_cache[1] = ($event) => selectVariant())
|
|
119
|
-
}, [
|
|
120
|
-
_cache[2] || (_cache[2] = createElementVNode("div", {
|
|
121
|
-
class: "htw-absolute htw-inset-0 htw-rounded bind-preview-bg",
|
|
122
|
-
"data-test-id": "responsive-preview-bg"
|
|
123
|
-
}, null, -1)),
|
|
124
|
-
unref(settings).checkerboard ? (openBlock(), createBlock(CheckerboardPattern, {
|
|
125
|
-
key: 0,
|
|
126
|
-
class: "htw-absolute htw-inset-0 htw-w-full htw-h-full htw-text-gray-500/20"
|
|
127
|
-
})) : createCommentVNode("", true),
|
|
128
|
-
createElementVNode("div", {
|
|
129
|
-
class: "htw-relative htw-h-full",
|
|
130
|
-
style: normalizeStyle({
|
|
131
|
-
"--histoire-contrast-color": contrastColor.value,
|
|
132
|
-
"color": autoApplyContrastColor.value ? contrastColor.value : void 0
|
|
133
|
-
})
|
|
134
|
-
}, [
|
|
135
|
-
(openBlock(), createBlock(_sfc_main$2, {
|
|
136
|
-
key: `${__props.story.id}-${unref(variant).id}`,
|
|
137
|
-
variant: unref(variant),
|
|
138
|
-
story: __props.story,
|
|
139
|
-
dir: unref(settings).textDirection,
|
|
140
|
-
class: normalizeClass({
|
|
141
|
-
[unref(histoireConfig).theme.darkClass]: unref(isDark)
|
|
142
|
-
}),
|
|
143
|
-
onReady
|
|
144
|
-
}, null, 8, ["variant", "story", "dir", "class"]))
|
|
145
|
-
], 4)
|
|
146
|
-
], 34)
|
|
147
|
-
], 512);
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
export {
|
|
152
|
-
_sfc_main as default
|
|
153
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import _sfc_main from "./StoryVariantListItem.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
"use strict";
|
|
5
|
-
const StoryVariantListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1b279b85"]]);
|
|
6
|
-
export {
|
|
7
|
-
StoryVariantListItem as default
|
|
8
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { defineComponent, useCssVars, unref, toRefs, ref, createElementBlock, openBlock, createVNode, withCtx, createElementVNode, normalizeClass, toDisplayString } from "@poveste/vendors/vue";
|
|
2
|
-
import { Icon } from "@poveste/vendors/iconify";
|
|
3
|
-
import { useScrollOnActive } from "../../util/scroll.js";
|
|
4
|
-
import { useCurrentVariantRoute } from "../../util/variant.js";
|
|
5
|
-
import BaseListItemLink from "../base/BaseListItemLink.vue.js";
|
|
6
|
-
"use strict";
|
|
7
|
-
const _hoisted_1 = { class: "htw-truncate" };
|
|
8
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
-
__name: "StoryVariantListItem",
|
|
10
|
-
props: {
|
|
11
|
-
variant: {
|
|
12
|
-
type: Object,
|
|
13
|
-
required: true
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
setup(__props) {
|
|
17
|
-
useCssVars((_ctx) => ({
|
|
18
|
-
"ab2181a2": unref(variant).iconColor
|
|
19
|
-
}));
|
|
20
|
-
const props = __props;
|
|
21
|
-
const { variant } = toRefs(props);
|
|
22
|
-
const { isActive, targetRoute } = useCurrentVariantRoute(variant);
|
|
23
|
-
const el = ref();
|
|
24
|
-
useScrollOnActive(isActive, el);
|
|
25
|
-
return (_ctx, _cache) => {
|
|
26
|
-
return openBlock(), createElementBlock("div", {
|
|
27
|
-
ref_key: "el",
|
|
28
|
-
ref: el,
|
|
29
|
-
class: "histoire-story-variant-list-item",
|
|
30
|
-
"data-test-id": "story-variant-list-item"
|
|
31
|
-
}, [
|
|
32
|
-
createVNode(BaseListItemLink, {
|
|
33
|
-
to: unref(targetRoute),
|
|
34
|
-
"is-active": unref(isActive),
|
|
35
|
-
class: "htw-px-2 htw-py-2 md:htw-py-1.5 htw-m-1 htw-rounded-sm htw-flex htw-items-center htw-gap-2"
|
|
36
|
-
}, {
|
|
37
|
-
default: withCtx(({ active }) => [
|
|
38
|
-
createVNode(unref(Icon), {
|
|
39
|
-
icon: unref(variant).icon ?? "carbon:cube",
|
|
40
|
-
class: normalizeClass(["htw-w-5 htw-h-5 sm:htw-w-4 sm:htw-h-4 htw-flex-none", {
|
|
41
|
-
"htw-text-gray-500": !active && !unref(variant).iconColor,
|
|
42
|
-
"bind-icon-color": !active && unref(variant).iconColor
|
|
43
|
-
}])
|
|
44
|
-
}, null, 8, ["icon", "class"]),
|
|
45
|
-
createElementVNode("span", _hoisted_1, toDisplayString(unref(variant).title), 1)
|
|
46
|
-
]),
|
|
47
|
-
_: 1
|
|
48
|
-
}, 8, ["to", "is-active"])
|
|
49
|
-
], 512);
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
export {
|
|
54
|
-
_sfc_main as default
|
|
55
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import _sfc_main from "./StoryVariantSingle.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
"use strict";
|
|
5
|
-
const StoryVariantSingle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c2a43485"]]);
|
|
6
|
-
export {
|
|
7
|
-
StoryVariantSingle as default
|
|
8
|
-
};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { defineComponent, useCssVars, computed, createElementBlock, openBlock, createVNode, unref, Fragment, createBlock, createElementVNode, createCommentVNode, createTextVNode, normalizeClass, toDisplayString, withCtx, renderList } from "@poveste/vendors/vue";
|
|
2
|
-
import { Icon } from "@poveste/vendors/iconify";
|
|
3
|
-
import { useStoryStore } from "../../stores/story.js";
|
|
4
|
-
import { isMobile } from "../../util/responsive.js";
|
|
5
|
-
import BaseSplitPane from "../base/BaseSplitPane.vue.js";
|
|
6
|
-
import StoryVariantListItem from "./StoryVariantListItem.vue.js";
|
|
7
|
-
import "./StoryVariantSingleView.vue.js";
|
|
8
|
-
import _sfc_main$1 from "./StoryVariantSingleView.vue2.js";
|
|
9
|
-
"use strict";
|
|
10
|
-
const _hoisted_1 = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "histoire-story-variant-single htw-p-2 htw-h-full __histoire-pane-shadow-from-right"
|
|
13
|
-
};
|
|
14
|
-
const _hoisted_2 = {
|
|
15
|
-
key: 0,
|
|
16
|
-
class: "htw-divide-y htw-divide-gray-100 dark:htw-divide-gray-800 htw-h-full htw-flex htw-flex-col"
|
|
17
|
-
};
|
|
18
|
-
const _hoisted_3 = {
|
|
19
|
-
key: 0,
|
|
20
|
-
class: "htw-p-2 htw-h-full"
|
|
21
|
-
};
|
|
22
|
-
const _hoisted_4 = { class: "htw-h-full htw-overflow-y-auto" };
|
|
23
|
-
const _hoisted_5 = {
|
|
24
|
-
key: 0,
|
|
25
|
-
class: "htw-p-2 htw-h-full __histoire-pane-shadow-from-right"
|
|
26
|
-
};
|
|
27
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
28
|
-
__name: "StoryVariantSingle",
|
|
29
|
-
emits: {
|
|
30
|
-
openVariantMenu: () => true
|
|
31
|
-
},
|
|
32
|
-
setup(__props) {
|
|
33
|
-
useCssVars((_ctx) => ({
|
|
34
|
-
"v41c4d268": variant.value?.iconColor
|
|
35
|
-
}));
|
|
36
|
-
const storyStore = useStoryStore();
|
|
37
|
-
const hasSingleVariant = computed(() => storyStore.currentStory?.variants.length === 1);
|
|
38
|
-
const variant = computed(() => storyStore.currentVariant);
|
|
39
|
-
return (_ctx, _cache) => {
|
|
40
|
-
return hasSingleVariant.value && variant.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
41
|
-
createVNode(_sfc_main$1, {
|
|
42
|
-
variant: variant.value,
|
|
43
|
-
story: unref(storyStore).currentStory
|
|
44
|
-
}, null, 8, ["variant", "story"])
|
|
45
|
-
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
46
|
-
unref(isMobile) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
47
|
-
createElementVNode("a", {
|
|
48
|
-
class: "htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center htw-flex-none",
|
|
49
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("openVariantMenu"))
|
|
50
|
-
}, [
|
|
51
|
-
variant.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
52
|
-
createVNode(unref(Icon), {
|
|
53
|
-
icon: variant.value.icon ?? "carbon:cube",
|
|
54
|
-
class: normalizeClass(["htw-w-5 htw-h-5 htw-flex-none", {
|
|
55
|
-
"htw-text-gray-500": !variant.value.iconColor,
|
|
56
|
-
"bind-icon-color": variant.value.iconColor
|
|
57
|
-
}])
|
|
58
|
-
}, null, 8, ["icon", "class"]),
|
|
59
|
-
createTextVNode(" " + toDisplayString(variant.value.title), 1)
|
|
60
|
-
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
61
|
-
createTextVNode(" Select a variant... ")
|
|
62
|
-
], 64)),
|
|
63
|
-
createVNode(unref(Icon), {
|
|
64
|
-
icon: "carbon:chevron-sort",
|
|
65
|
-
class: "htw-w-5 htw-h-5 htw-shrink-0 htw-ml-auto"
|
|
66
|
-
})
|
|
67
|
-
]),
|
|
68
|
-
unref(storyStore).currentVariant ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
69
|
-
createVNode(_sfc_main$1, {
|
|
70
|
-
variant: unref(storyStore).currentVariant,
|
|
71
|
-
story: unref(storyStore).currentStory
|
|
72
|
-
}, null, 8, ["variant", "story"])
|
|
73
|
-
])) : createCommentVNode("", true)
|
|
74
|
-
])) : (openBlock(), createBlock(BaseSplitPane, {
|
|
75
|
-
key: 1,
|
|
76
|
-
"save-id": "story-single-main-split",
|
|
77
|
-
min: 5,
|
|
78
|
-
max: 40,
|
|
79
|
-
"default-split": 17
|
|
80
|
-
}, {
|
|
81
|
-
first: withCtx(() => [
|
|
82
|
-
createElementVNode("div", _hoisted_4, [
|
|
83
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(storyStore).currentStory.variants, (v, index) => {
|
|
84
|
-
return openBlock(), createBlock(StoryVariantListItem, {
|
|
85
|
-
key: index,
|
|
86
|
-
variant: v
|
|
87
|
-
}, null, 8, ["variant"]);
|
|
88
|
-
}), 128))
|
|
89
|
-
])
|
|
90
|
-
]),
|
|
91
|
-
last: withCtx(() => [
|
|
92
|
-
unref(storyStore).currentVariant ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
93
|
-
createVNode(_sfc_main$1, {
|
|
94
|
-
variant: unref(storyStore).currentVariant,
|
|
95
|
-
story: unref(storyStore).currentStory
|
|
96
|
-
}, null, 8, ["variant", "story"])
|
|
97
|
-
])) : createCommentVNode("", true)
|
|
98
|
-
]),
|
|
99
|
-
_: 1
|
|
100
|
-
}))
|
|
101
|
-
], 64));
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
export {
|
|
106
|
-
_sfc_main as default
|
|
107
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, createBlock, openBlock, withCtx, createElementVNode, normalizeStyle, unref, normalizeClass } from "@poveste/vendors/vue";
|
|
2
|
-
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
3
|
-
import { histoireConfig } from "../../util/config.js";
|
|
4
|
-
import { isDark } from "../../util/dark.js";
|
|
5
|
-
import { getContrastColor } from "../../util/preview-settings.js";
|
|
6
|
-
import "./GenericRenderStory.vue.js";
|
|
7
|
-
import StoryResponsivePreview from "./StoryResponsivePreview.vue.js";
|
|
8
|
-
import _sfc_main$1 from "./GenericRenderStory.vue2.js";
|
|
9
|
-
"use strict";
|
|
10
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
-
__name: "StoryVariantSinglePreviewNative",
|
|
12
|
-
props: {
|
|
13
|
-
story: {},
|
|
14
|
-
variant: {}
|
|
15
|
-
},
|
|
16
|
-
setup(__props) {
|
|
17
|
-
const props = __props;
|
|
18
|
-
Object.assign(props.variant, {
|
|
19
|
-
previewReady: false
|
|
20
|
-
});
|
|
21
|
-
function onReady() {
|
|
22
|
-
Object.assign(props.variant, {
|
|
23
|
-
previewReady: true
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
const settings = usePreviewSettingsStore().currentSettings;
|
|
27
|
-
const contrastColor = computed(() => getContrastColor(settings));
|
|
28
|
-
const autoApplyContrastColor = computed(() => !!histoireConfig.autoApplyContrastColor);
|
|
29
|
-
return (_ctx, _cache) => {
|
|
30
|
-
return openBlock(), createBlock(StoryResponsivePreview, {
|
|
31
|
-
class: "histoire-story-variant-single-preview-native",
|
|
32
|
-
variant: __props.variant
|
|
33
|
-
}, {
|
|
34
|
-
default: withCtx(({ isResponsiveEnabled, finalWidth, finalHeight }) => [
|
|
35
|
-
createElementVNode("div", {
|
|
36
|
-
style: normalizeStyle([
|
|
37
|
-
isResponsiveEnabled ? {
|
|
38
|
-
width: finalWidth ? `${finalWidth}px` : "100%",
|
|
39
|
-
height: finalHeight ? `${finalHeight}px` : "100%"
|
|
40
|
-
} : { width: "100%", height: "100%" },
|
|
41
|
-
{
|
|
42
|
-
"--histoire-contrast-color": contrastColor.value,
|
|
43
|
-
"color": autoApplyContrastColor.value ? contrastColor.value : void 0
|
|
44
|
-
}
|
|
45
|
-
]),
|
|
46
|
-
class: "htw-relative",
|
|
47
|
-
"data-test-id": "sandbox-render"
|
|
48
|
-
}, [
|
|
49
|
-
(openBlock(), createBlock(_sfc_main$1, {
|
|
50
|
-
key: `${__props.story.id}-${__props.variant.id}`,
|
|
51
|
-
variant: __props.variant,
|
|
52
|
-
story: __props.story,
|
|
53
|
-
class: normalizeClass(["htw-h-full", {
|
|
54
|
-
[unref(histoireConfig).sandboxDarkClass]: unref(isDark),
|
|
55
|
-
// @TODO remove
|
|
56
|
-
[unref(histoireConfig).theme.darkClass]: unref(isDark)
|
|
57
|
-
}]),
|
|
58
|
-
dir: unref(settings).textDirection,
|
|
59
|
-
onReady
|
|
60
|
-
}, null, 8, ["variant", "story", "class", "dir"]))
|
|
61
|
-
], 4)
|
|
62
|
-
]),
|
|
63
|
-
_: 1
|
|
64
|
-
}, 8, ["variant"]);
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
export {
|
|
69
|
-
_sfc_main as default
|
|
70
|
-
};
|