@poveste/app 0.1.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/LICENSE +22 -0
- package/dist/app/assets/histoire-text-dark.svg +89 -0
- package/dist/app/assets/histoire-text.svg +89 -0
- package/dist/app/assets/histoire.svg +51 -0
- package/dist/app/style/floating.pcss +34 -0
- package/dist/app/style/main.pcss +100 -0
- package/dist/app/style/sandbox.css +24 -0
- package/dist/app/style/transitions.pcss +51 -0
- package/dist/bundle-index.js +1 -0
- package/dist/bundle-main-dev.js +4 -0
- package/dist/bundle-main.js +5 -0
- package/dist/bundle-sandbox-dev.js +2 -0
- package/dist/bundle-sandbox.js +2 -0
- package/dist/bundled/App.vue.js +5 -0
- package/dist/bundled/App.vue2.js +167 -0
- package/dist/bundled/_virtual/_plugin-vue_export-helper.js +10 -0
- package/dist/bundled/api.js +12 -0
- package/dist/bundled/app.css +116 -0
- package/dist/bundled/assets/histoire-text-dark.svg.js +4 -0
- package/dist/bundled/assets/histoire-text.svg.js +4 -0
- package/dist/bundled/assets/histoire.svg.js +4 -0
- package/dist/bundled/components/HomeView.vue.js +5 -0
- package/dist/bundled/components/HomeView.vue2.js +66 -0
- package/dist/bundled/components/app/AppHeader.vue.js +5 -0
- package/dist/bundled/components/app/AppHeader.vue2.js +71 -0
- package/dist/bundled/components/app/AppLogo.vue.js +5 -0
- package/dist/bundled/components/app/AppLogo.vue2.js +29 -0
- package/dist/bundled/components/app/Breadcrumb.vue.js +8 -0
- package/dist/bundled/components/app/Breadcrumb.vue2.js +91 -0
- package/dist/bundled/components/app/HomeCounter.vue.js +5 -0
- package/dist/bundled/components/app/HomeCounter.vue2.js +42 -0
- package/dist/bundled/components/app/InitialLoading.vue.js +5 -0
- package/dist/bundled/components/app/InitialLoading.vue2.js +51 -0
- package/dist/bundled/components/app/MobileOverlay.vue.js +5 -0
- package/dist/bundled/components/app/MobileOverlay.vue2.js +45 -0
- package/dist/bundled/components/base/BaseButton.vue.js +5 -0
- package/dist/bundled/components/base/BaseButton.vue2.js +39 -0
- package/dist/bundled/components/base/BaseCheckbox.vue.js +5 -0
- package/dist/bundled/components/base/BaseCheckbox.vue2.js +78 -0
- package/dist/bundled/components/base/BaseEmpty.vue.js +14 -0
- package/dist/bundled/components/base/BaseIcon.vue.js +8 -0
- package/dist/bundled/components/base/BaseIcon.vue2.js +29 -0
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue.js +5 -0
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue2.js +20 -0
- package/dist/bundled/components/base/BaseListItem.vue.js +5 -0
- package/dist/bundled/components/base/BaseListItem.vue2.js +33 -0
- package/dist/bundled/components/base/BaseListItemLink.vue.js +33 -0
- package/dist/bundled/components/base/BaseListItemLink.vue2.js +26 -0
- package/dist/bundled/components/base/BaseOverflowMenu.vue.js +5 -0
- package/dist/bundled/components/base/BaseOverflowMenu.vue2.js +100 -0
- package/dist/bundled/components/base/BaseOverflowTab.vue.js +36 -0
- package/dist/bundled/components/base/BaseOverflowTab.vue2.js +18 -0
- package/dist/bundled/components/base/BaseSelect.vue.js +5 -0
- package/dist/bundled/components/base/BaseSelect.vue2.js +77 -0
- package/dist/bundled/components/base/BaseSplitPane.vue.js +8 -0
- package/dist/bundled/components/base/BaseSplitPane.vue2.js +183 -0
- package/dist/bundled/components/base/BaseTab.vue.js +36 -0
- package/dist/bundled/components/base/BaseTab.vue2.js +18 -0
- package/dist/bundled/components/base/BaseTag.vue.js +13 -0
- package/dist/bundled/components/command/CommandPrompts.vue.js +5 -0
- package/dist/bundled/components/command/CommandPrompts.vue2.js +91 -0
- package/dist/bundled/components/command/CommandPromptsModal.vue.js +5 -0
- package/dist/bundled/components/command/CommandPromptsModal.vue2.js +45 -0
- package/dist/bundled/components/command/PromptSelect.vue.js +5 -0
- package/dist/bundled/components/command/PromptSelect.vue2.js +142 -0
- package/dist/bundled/components/command/PromptText.vue.js +5 -0
- package/dist/bundled/components/command/PromptText.vue2.js +67 -0
- package/dist/bundled/components/misc/CheckerboardPattern.vue.js +40 -0
- package/dist/bundled/components/misc/HatchedPattern.vue.js +12 -0
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue.js +5 -0
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue2.js +72 -0
- package/dist/bundled/components/panel/ControlsComponentProps.vue.js +5 -0
- package/dist/bundled/components/panel/ControlsComponentProps.vue2.js +45 -0
- package/dist/bundled/components/panel/ControlsComponentState.vue.js +5 -0
- package/dist/bundled/components/panel/ControlsComponentState.vue2.js +41 -0
- package/dist/bundled/components/panel/ControlsComponentStateItem.vue.js +5 -0
- package/dist/bundled/components/panel/ControlsComponentStateItem.vue2.js +46 -0
- package/dist/bundled/components/panel/PaneTabs.vue.js +5 -0
- package/dist/bundled/components/panel/PaneTabs.vue2.js +114 -0
- package/dist/bundled/components/panel/StatePresets.vue.js +5 -0
- package/dist/bundled/components/panel/StatePresets.vue2.js +193 -0
- package/dist/bundled/components/panel/StoryControls.vue.js +5 -0
- package/dist/bundled/components/panel/StoryControls.vue2.js +87 -0
- package/dist/bundled/components/panel/StoryDocs.vue.js +7 -0
- package/dist/bundled/components/panel/StoryDocs.vue2.js +161 -0
- package/dist/bundled/components/panel/StoryEvent.vue.js +5 -0
- package/dist/bundled/components/panel/StoryEvent.vue2.js +59 -0
- package/dist/bundled/components/panel/StoryEvents.vue.js +5 -0
- package/dist/bundled/components/panel/StoryEvents.vue2.js +53 -0
- package/dist/bundled/components/panel/StorySidePanel.vue.js +5 -0
- package/dist/bundled/components/panel/StorySidePanel.vue2.js +83 -0
- package/dist/bundled/components/panel/StorySourceCode.vue.js +8 -0
- package/dist/bundled/components/panel/StorySourceCode.vue2.js +204 -0
- package/dist/bundled/components/search/SearchItem.vue.js +8 -0
- package/dist/bundled/components/search/SearchItem.vue2.js +93 -0
- package/dist/bundled/components/search/SearchItemContent.vue.js +5 -0
- package/dist/bundled/components/search/SearchItemContent.vue2.js +71 -0
- package/dist/bundled/components/search/SearchLoading.vue.js +5 -0
- package/dist/bundled/components/search/SearchLoading.vue2.js +21 -0
- package/dist/bundled/components/search/SearchModal.vue.js +5 -0
- package/dist/bundled/components/search/SearchModal.vue2.js +51 -0
- package/dist/bundled/components/search/SearchPane.vue.js +5 -0
- package/dist/bundled/components/search/SearchPane.vue2.js +272 -0
- package/dist/bundled/components/search/search-docs-data.js +11 -0
- package/dist/bundled/components/search/search-title-data.js +11 -0
- package/dist/bundled/components/story/GenericMountStory.vue.js +5 -0
- package/dist/bundled/components/story/GenericMountStory.vue2.js +34 -0
- package/dist/bundled/components/story/GenericRenderStory.vue.js +5 -0
- package/dist/bundled/components/story/GenericRenderStory.vue2.js +39 -0
- package/dist/bundled/components/story/StoryResponsivePreview.vue.js +8 -0
- package/dist/bundled/components/story/StoryResponsivePreview.vue2.js +207 -0
- package/dist/bundled/components/story/StoryVariantGrid.vue.js +5 -0
- package/dist/bundled/components/story/StoryVariantGrid.vue2.js +146 -0
- package/dist/bundled/components/story/StoryVariantGridItem.vue.js +8 -0
- package/dist/bundled/components/story/StoryVariantGridItem.vue2.js +153 -0
- package/dist/bundled/components/story/StoryVariantListItem.vue.js +8 -0
- package/dist/bundled/components/story/StoryVariantListItem.vue2.js +55 -0
- package/dist/bundled/components/story/StoryVariantSingle.vue.js +8 -0
- package/dist/bundled/components/story/StoryVariantSingle.vue2.js +107 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue.js +5 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue2.js +70 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue.js +5 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue2.js +128 -0
- package/dist/bundled/components/story/StoryVariantSingleView.vue.js +5 -0
- package/dist/bundled/components/story/StoryVariantSingleView.vue2.js +66 -0
- package/dist/bundled/components/story/StoryView.vue.js +5 -0
- package/dist/bundled/components/story/StoryView.vue2.js +104 -0
- package/dist/bundled/components/story/StoryViewer.vue.js +8 -0
- package/dist/bundled/components/story/StoryViewer.vue2.js +55 -0
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue.js +5 -0
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue2.js +31 -0
- package/dist/bundled/components/toolbar/ToolbarBackground.vue.js +8 -0
- package/dist/bundled/components/toolbar/ToolbarBackground.vue2.js +98 -0
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue.js +5 -0
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue2.js +36 -0
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue.js +5 -0
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue2.js +127 -0
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue.js +5 -0
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue2.js +27 -0
- package/dist/bundled/components/toolbar/ToolbarTitle.vue.js +5 -0
- package/dist/bundled/components/toolbar/ToolbarTitle.vue2.js +26 -0
- package/dist/bundled/components/tree/StoryGroup.vue.js +5 -0
- package/dist/bundled/components/tree/StoryGroup.vue2.js +74 -0
- package/dist/bundled/components/tree/StoryList.vue.js +5 -0
- package/dist/bundled/components/tree/StoryList.vue2.js +41 -0
- package/dist/bundled/components/tree/StoryListFolder.vue.js +8 -0
- package/dist/bundled/components/tree/StoryListFolder.vue2.js +86 -0
- package/dist/bundled/components/tree/StoryListItem.vue.js +8 -0
- package/dist/bundled/components/tree/StoryListItem.vue2.js +69 -0
- package/dist/bundled/index.js +35 -0
- package/dist/bundled/plugin.js +49 -0
- package/dist/bundled/router.js +32 -0
- package/dist/bundled/sandbox.js +87 -0
- package/dist/bundled/stores/command.js +25 -0
- package/dist/bundled/stores/events.js +29 -0
- package/dist/bundled/stores/folder.js +54 -0
- package/dist/bundled/stores/preview-settings.js +19 -0
- package/dist/bundled/stores/story.js +43 -0
- package/dist/bundled/util/commands.js +57 -0
- package/dist/bundled/util/config.js +8 -0
- package/dist/bundled/util/const.js +10 -0
- package/dist/bundled/util/dark.js +28 -0
- package/dist/bundled/util/docs.js +26 -0
- package/dist/bundled/util/env.js +4 -0
- package/dist/bundled/util/events.js +33 -0
- package/dist/bundled/util/keyboard.js +90 -0
- package/dist/bundled/util/mapping.js +70 -0
- package/dist/bundled/util/open-in-editor.js +6 -0
- package/dist/bundled/util/preview-settings.js +21 -0
- package/dist/bundled/util/responsive.js +6 -0
- package/dist/bundled/util/sandbox.js +11 -0
- package/dist/bundled/util/scroll.js +31 -0
- package/dist/bundled/util/select.js +28 -0
- package/dist/bundled/util/state.js +41 -0
- package/dist/bundled/util/tooltip.js +15 -0
- package/dist/bundled/util/variant.js +21 -0
- package/dist/style.css +2626 -0
- package/package.json +56 -0
- package/postcss-scope-wrapper.cjs +35 -0
- package/postcss.config.cjs +9 -0
- package/scripts/copy.mjs +12 -0
- package/scripts/watchAndCopy.mjs +15 -0
- package/src/app/App.vue +172 -0
- package/src/app/api.ts +9 -0
- package/src/app/assets/histoire-text-dark.svg +89 -0
- package/src/app/assets/histoire-text.svg +89 -0
- package/src/app/assets/histoire.svg +51 -0
- package/src/app/components/HomeView.vue +61 -0
- package/src/app/components/app/AppHeader.vue +65 -0
- package/src/app/components/app/AppLogo.vue +25 -0
- package/src/app/components/app/Breadcrumb.vue +98 -0
- package/src/app/components/app/HomeCounter.vue +39 -0
- package/src/app/components/app/InitialLoading.vue +44 -0
- package/src/app/components/app/MobileOverlay.vue +33 -0
- package/src/app/components/base/BaseButton.vue +33 -0
- package/src/app/components/base/BaseCheckbox.vue +76 -0
- package/src/app/components/base/BaseCopyIcon.vue +34 -0
- package/src/app/components/base/BaseEmpty.vue +21 -0
- package/src/app/components/base/BaseIcon.vue +31 -0
- package/src/app/components/base/BaseKeyboardShortcut.vue +16 -0
- package/src/app/components/base/BaseListItem.vue +30 -0
- package/src/app/components/base/BaseListItemLink.vue +56 -0
- package/src/app/components/base/BaseOverflowMenu.vue +119 -0
- package/src/app/components/base/BaseOverflowTab.vue +47 -0
- package/src/app/components/base/BaseSelect.vue +75 -0
- package/src/app/components/base/BaseSplitPane.vue +244 -0
- package/src/app/components/base/BaseTab.vue +47 -0
- package/src/app/components/base/BaseTag.vue +5 -0
- package/src/app/components/command/CommandPrompts.vue +95 -0
- package/src/app/components/command/CommandPromptsModal.vue +41 -0
- package/src/app/components/command/PromptSelect.vue +142 -0
- package/src/app/components/command/PromptText.vue +65 -0
- package/src/app/components/misc/CheckerboardPattern.vue +32 -0
- package/src/app/components/misc/HatchedPattern.vue +13 -0
- package/src/app/components/panel/ControlsComponentPropItem.vue +73 -0
- package/src/app/components/panel/ControlsComponentProps.vue +34 -0
- package/src/app/components/panel/ControlsComponentState.vue +38 -0
- package/src/app/components/panel/ControlsComponentStateItem.vue +44 -0
- package/src/app/components/panel/PaneTabs.vue +84 -0
- package/src/app/components/panel/StatePresets.vue +199 -0
- package/src/app/components/panel/StoryControls.vue +97 -0
- package/src/app/components/panel/StoryDocs.vue +202 -0
- package/src/app/components/panel/StoryEvent.vue +54 -0
- package/src/app/components/panel/StoryEvents.vue +48 -0
- package/src/app/components/panel/StorySidePanel.vue +76 -0
- package/src/app/components/panel/StorySourceCode.vue +248 -0
- package/src/app/components/search/SearchItem.vue +89 -0
- package/src/app/components/search/SearchItemContent.vue +67 -0
- package/src/app/components/search/SearchLoading.vue +16 -0
- package/src/app/components/search/SearchModal.vue +44 -0
- package/src/app/components/search/SearchPane.vue +319 -0
- package/src/app/components/search/search-docs-data.ts +9 -0
- package/src/app/components/search/search-title-data.ts +9 -0
- package/src/app/components/search/types.ts +4 -0
- package/src/app/components/story/GenericMountStory.vue +35 -0
- package/src/app/components/story/GenericRenderStory.vue +41 -0
- package/src/app/components/story/StoryResponsivePreview.vue +216 -0
- package/src/app/components/story/StoryVariantGrid.vue +169 -0
- package/src/app/components/story/StoryVariantGridItem.vue +163 -0
- package/src/app/components/story/StoryVariantListItem.vue +52 -0
- package/src/app/components/story/StoryVariantSingle.vue +105 -0
- package/src/app/components/story/StoryVariantSinglePreviewNative.vue +66 -0
- package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +143 -0
- package/src/app/components/story/StoryVariantSingleView.vue +61 -0
- package/src/app/components/story/StoryView.vue +110 -0
- package/src/app/components/story/StoryViewer.vue +52 -0
- package/src/app/components/toolbar/DevOnlyToolbarOpenInEditor.vue +23 -0
- package/src/app/components/toolbar/ToolbarBackground.vue +81 -0
- package/src/app/components/toolbar/ToolbarNewTab.vue +29 -0
- package/src/app/components/toolbar/ToolbarResponsiveSize.vue +82 -0
- package/src/app/components/toolbar/ToolbarTextDirection.vue +19 -0
- package/src/app/components/toolbar/ToolbarTitle.vue +21 -0
- package/src/app/components/tree/StoryGroup.vue +73 -0
- package/src/app/components/tree/StoryList.vue +35 -0
- package/src/app/components/tree/StoryListFolder.vue +88 -0
- package/src/app/components/tree/StoryListItem.vue +72 -0
- package/src/app/index.ts +33 -0
- package/src/app/plugin.ts +59 -0
- package/src/app/router.ts +29 -0
- package/src/app/sandbox.ts +101 -0
- package/src/app/stores/command.ts +26 -0
- package/src/app/stores/events.ts +36 -0
- package/src/app/stores/folder.ts +63 -0
- package/src/app/stores/preview-settings.ts +18 -0
- package/src/app/stores/story.ts +47 -0
- package/src/app/style/floating.pcss +34 -0
- package/src/app/style/main.pcss +100 -0
- package/src/app/style/sandbox.css +24 -0
- package/src/app/style/transitions.pcss +51 -0
- package/src/app/types.ts +72 -0
- package/src/app/util/commands.ts +57 -0
- package/src/app/util/config.ts +5 -0
- package/src/app/util/const.ts +4 -0
- package/src/app/util/dark.ts +27 -0
- package/src/app/util/docs.ts +27 -0
- package/src/app/util/env.ts +1 -0
- package/src/app/util/events.ts +31 -0
- package/src/app/util/keyboard.ts +103 -0
- package/src/app/util/mapping.ts +80 -0
- package/src/app/util/open-in-editor.ts +3 -0
- package/src/app/util/preview-settings.ts +23 -0
- package/src/app/util/responsive.ts +3 -0
- package/src/app/util/sandbox.ts +9 -0
- package/src/app/util/scroll.ts +32 -0
- package/src/app/util/select.ts +30 -0
- package/src/app/util/state.ts +45 -0
- package/src/app/util/tooltip.ts +13 -0
- package/src/app/util/variant.ts +21 -0
- package/src/bundle-index.js +1 -0
- package/src/bundle-main-dev.js +4 -0
- package/src/bundle-main.js +5 -0
- package/src/bundle-sandbox-dev.js +2 -0
- package/src/bundle-sandbox.js +2 -0
- package/src/index.ts +1 -0
- package/src/shim.d.ts +10 -0
- package/src/virtual.d.ts +7 -0
- package/tailwind.config.cjs +137 -0
- package/tsconfig.json +53 -0
- package/vite.config.ts +88 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { defineComponent, toRefs, watch, ref, computed, createElementBlock, openBlock, createCommentVNode, createBlock, unref, normalizeClass, withCtx, createVNode, createTextVNode, watchEffect, nextTick } from "@poveste/vendors/vue";
|
|
2
|
+
import { Icon } from "@poveste/vendors/iconify";
|
|
3
|
+
import { markdownFiles } from "virtual:$histoire-markdown-files";
|
|
4
|
+
import { useRouter, useRoute } from "@poveste/vendors/vue-router";
|
|
5
|
+
import { histoireConfig } from "../../util/config.js";
|
|
6
|
+
import BaseEmpty from "../base/BaseEmpty.vue.js";
|
|
7
|
+
import "../toolbar/DevOnlyToolbarOpenInEditor.vue.js";
|
|
8
|
+
import _sfc_main$1 from "../toolbar/DevOnlyToolbarOpenInEditor.vue2.js";
|
|
9
|
+
"use strict";
|
|
10
|
+
const _hoisted_1 = ["innerHTML"];
|
|
11
|
+
function useStoryDoc(story) {
|
|
12
|
+
const renderedDoc = ref("");
|
|
13
|
+
watchEffect(async () => {
|
|
14
|
+
const mdKey = story.value.file.filePath.replace(/\.(\w*)$/, ".md");
|
|
15
|
+
if (markdownFiles[mdKey]) {
|
|
16
|
+
const md = await markdownFiles[mdKey]();
|
|
17
|
+
renderedDoc.value = md.html;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
let comp = story.value.file?.component;
|
|
21
|
+
if (comp) {
|
|
22
|
+
if (comp.__asyncResolved) {
|
|
23
|
+
comp = comp.__asyncResolved;
|
|
24
|
+
} else if (comp.__asyncLoader) {
|
|
25
|
+
comp = await comp.__asyncLoader();
|
|
26
|
+
} else if (typeof comp === "function") {
|
|
27
|
+
try {
|
|
28
|
+
comp = await comp();
|
|
29
|
+
} catch (e) {
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (comp?.default) {
|
|
33
|
+
comp = comp.default;
|
|
34
|
+
}
|
|
35
|
+
renderedDoc.value = comp.doc;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
renderedDoc
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
43
|
+
__name: "StoryDocs",
|
|
44
|
+
props: {
|
|
45
|
+
story: {
|
|
46
|
+
type: Object,
|
|
47
|
+
required: true
|
|
48
|
+
},
|
|
49
|
+
standalone: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
emits: ["scrollTop"],
|
|
55
|
+
setup(__props, { emit: __emit }) {
|
|
56
|
+
const props = __props;
|
|
57
|
+
const emit = __emit;
|
|
58
|
+
const { story } = toRefs(props);
|
|
59
|
+
const { renderedDoc } = useStoryDoc(story);
|
|
60
|
+
const router = useRouter();
|
|
61
|
+
const fakeHost = `http://a.com`;
|
|
62
|
+
function onClick(e) {
|
|
63
|
+
const link = e.target.closest("a");
|
|
64
|
+
if (link && link.getAttribute("data-route") && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey && link.target !== `_blank`) {
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
const url = new URL(link.href, fakeHost);
|
|
67
|
+
const targetHref = url.pathname + url.search + url.hash;
|
|
68
|
+
router.push(targetHref);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function getHash() {
|
|
72
|
+
const hash = location.hash;
|
|
73
|
+
if (histoireConfig.routerMode === "hash") {
|
|
74
|
+
const index = hash.indexOf("#", 1);
|
|
75
|
+
if (index !== -1) {
|
|
76
|
+
return hash.slice(index);
|
|
77
|
+
} else {
|
|
78
|
+
return void 0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return hash;
|
|
82
|
+
}
|
|
83
|
+
async function scrollToAnchor() {
|
|
84
|
+
await nextTick();
|
|
85
|
+
const hash = getHash();
|
|
86
|
+
if (hash) {
|
|
87
|
+
const anchor = document.querySelector(decodeURIComponent(hash));
|
|
88
|
+
if (anchor) {
|
|
89
|
+
anchor.scrollIntoView();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
emit("scrollTop");
|
|
94
|
+
}
|
|
95
|
+
watch(renderedDoc, () => {
|
|
96
|
+
scrollToAnchor();
|
|
97
|
+
}, {
|
|
98
|
+
immediate: true
|
|
99
|
+
});
|
|
100
|
+
const renderedEl = ref();
|
|
101
|
+
const route = useRoute();
|
|
102
|
+
async function patchAnchorLinks() {
|
|
103
|
+
await nextTick();
|
|
104
|
+
if (histoireConfig.routerMode === "hash" && renderedEl.value) {
|
|
105
|
+
const links = renderedEl.value.querySelectorAll("a.header-anchor");
|
|
106
|
+
for (const link of links) {
|
|
107
|
+
const href = link.getAttribute("href");
|
|
108
|
+
if (href) {
|
|
109
|
+
link.setAttribute("href", `#${route.path + href}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
watch(renderedDoc, () => {
|
|
115
|
+
patchAnchorLinks();
|
|
116
|
+
}, {
|
|
117
|
+
immediate: true
|
|
118
|
+
});
|
|
119
|
+
const filePath = computed(() => story.value.file?.docsFilePath ?? (props.standalone && story.value.file?.filePath));
|
|
120
|
+
return (_ctx, _cache) => {
|
|
121
|
+
return openBlock(), createElementBlock("div", {
|
|
122
|
+
class: "histoire-story-docs",
|
|
123
|
+
onClickCapture: onClick
|
|
124
|
+
}, [
|
|
125
|
+
_ctx.__HISTOIRE_DEV__ && unref(renderedDoc) && filePath.value ? (openBlock(), createElementBlock("div", {
|
|
126
|
+
key: 0,
|
|
127
|
+
class: normalizeClass(["htw-flex htw-items-center htw-gap-2 htw-p-2", {
|
|
128
|
+
"htw-pt-4": !__props.standalone
|
|
129
|
+
}])
|
|
130
|
+
}, [
|
|
131
|
+
filePath.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
132
|
+
key: 0,
|
|
133
|
+
file: filePath.value,
|
|
134
|
+
tooltip: "Edit docs in editor"
|
|
135
|
+
}, null, 8, ["file"])) : createCommentVNode("", true)
|
|
136
|
+
], 2)) : createCommentVNode("", true),
|
|
137
|
+
!unref(renderedDoc) ? (openBlock(), createBlock(BaseEmpty, { key: 1 }, {
|
|
138
|
+
default: withCtx(() => [
|
|
139
|
+
createVNode(unref(Icon), {
|
|
140
|
+
icon: "carbon:document-unknown",
|
|
141
|
+
class: "htw-w-8 htw-h-8 htw-opacity-50 htw-mb-6"
|
|
142
|
+
}),
|
|
143
|
+
_cache[0] || (_cache[0] = createTextVNode(" No documentation available ", -1))
|
|
144
|
+
]),
|
|
145
|
+
_: 1
|
|
146
|
+
})) : (openBlock(), createElementBlock("div", {
|
|
147
|
+
key: 2,
|
|
148
|
+
ref_key: "renderedEl",
|
|
149
|
+
ref: renderedEl,
|
|
150
|
+
class: "htw-prose dark:htw-prose-invert htw-p-4 htw-max-w-none",
|
|
151
|
+
"data-test-id": "story-docs",
|
|
152
|
+
innerHTML: unref(renderedDoc)
|
|
153
|
+
}, null, 8, _hoisted_1))
|
|
154
|
+
], 32);
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
export {
|
|
159
|
+
_sfc_main as default,
|
|
160
|
+
useStoryDoc
|
|
161
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { defineComponent, computed, resolveComponent, createBlock, openBlock, withCtx, createElementVNode, toDisplayString, normalizeClass, createElementBlock, createCommentVNode } from "@poveste/vendors/vue";
|
|
2
|
+
"use strict";
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "htw-text-xs htw-opacity-50 htw-truncate"
|
|
6
|
+
};
|
|
7
|
+
const _hoisted_2 = { class: "htw-overflow-auto htw-max-w-[400px] htw-max-h-[400px]" };
|
|
8
|
+
const _hoisted_3 = { class: "htw-p-4" };
|
|
9
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
+
__name: "StoryEvent",
|
|
11
|
+
props: {
|
|
12
|
+
event: {}
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const formattedArgument = computed(() => {
|
|
17
|
+
switch (typeof props.event.argument) {
|
|
18
|
+
case "string":
|
|
19
|
+
return `"${props.event.argument}"`;
|
|
20
|
+
case "object":
|
|
21
|
+
return `{ ${Object.keys(props.event.argument).map((key) => `${key}: ${props.event.argument[key]}`).join(", ")} }`;
|
|
22
|
+
default:
|
|
23
|
+
return props.event.argument;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
const _component_VDropdown = resolveComponent("VDropdown");
|
|
28
|
+
return openBlock(), createBlock(_component_VDropdown, {
|
|
29
|
+
class: "histoire-story-event htw-group",
|
|
30
|
+
placement: "right",
|
|
31
|
+
"data-test-id": "event-item"
|
|
32
|
+
}, {
|
|
33
|
+
default: withCtx(({ shown }) => [
|
|
34
|
+
createElementVNode("div", {
|
|
35
|
+
class: normalizeClass(["group-hover:htw-bg-primary-100 dark:group-hover:htw-bg-primary-700 htw-cursor-pointer htw-py-2 htw-px-4 htw-flex htw-items-baseline htw-gap-1 htw-leading-normal", [
|
|
36
|
+
shown ? "htw-bg-primary-50 dark:htw-bg-primary-600" : "group-odd:htw-bg-gray-100/50 dark:group-odd:htw-bg-gray-750/40"
|
|
37
|
+
]])
|
|
38
|
+
}, [
|
|
39
|
+
createElementVNode("span", {
|
|
40
|
+
class: normalizeClass({
|
|
41
|
+
"htw-text-primary-500": shown
|
|
42
|
+
})
|
|
43
|
+
}, toDisplayString(__props.event.name), 3),
|
|
44
|
+
__props.event.argument ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(formattedArgument.value), 1)) : createCommentVNode("", true)
|
|
45
|
+
], 2)
|
|
46
|
+
]),
|
|
47
|
+
popper: withCtx(() => [
|
|
48
|
+
createElementVNode("div", _hoisted_2, [
|
|
49
|
+
createElementVNode("pre", _hoisted_3, toDisplayString(__props.event.argument), 1)
|
|
50
|
+
])
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
export {
|
|
58
|
+
_sfc_main as default
|
|
59
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent, computed, onMounted, watch, nextTick, ref, createElementBlock, openBlock, createBlock, withCtx, createVNode, createTextVNode, unref, Fragment, renderList } from "@poveste/vendors/vue";
|
|
2
|
+
import { Icon } from "@poveste/vendors/iconify";
|
|
3
|
+
import { useEventsStore } from "../../stores/events.js";
|
|
4
|
+
import BaseEmpty from "../base/BaseEmpty.vue.js";
|
|
5
|
+
import "./StoryEvent.vue.js";
|
|
6
|
+
import _sfc_main$1 from "./StoryEvent.vue2.js";
|
|
7
|
+
"use strict";
|
|
8
|
+
const _hoisted_1 = { key: 1 };
|
|
9
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
+
__name: "StoryEvents",
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const eventsStore = useEventsStore();
|
|
13
|
+
const hasEvents = computed(() => eventsStore.events.length);
|
|
14
|
+
onMounted(resetUnseen);
|
|
15
|
+
watch(() => eventsStore.unseen, resetUnseen);
|
|
16
|
+
async function resetUnseen() {
|
|
17
|
+
if (eventsStore.unseen > 0) {
|
|
18
|
+
eventsStore.unseen = 0;
|
|
19
|
+
}
|
|
20
|
+
await nextTick();
|
|
21
|
+
eventsElement.value.scrollTo({ top: eventsElement.value.scrollHeight });
|
|
22
|
+
}
|
|
23
|
+
const eventsElement = ref();
|
|
24
|
+
return (_ctx, _cache) => {
|
|
25
|
+
return openBlock(), createElementBlock("div", {
|
|
26
|
+
ref_key: "eventsElement",
|
|
27
|
+
ref: eventsElement,
|
|
28
|
+
class: "histoire-story-events"
|
|
29
|
+
}, [
|
|
30
|
+
!hasEvents.value ? (openBlock(), createBlock(BaseEmpty, { key: 0 }, {
|
|
31
|
+
default: withCtx(() => [
|
|
32
|
+
createVNode(unref(Icon), {
|
|
33
|
+
icon: "carbon:event-schedule",
|
|
34
|
+
class: "htw-w-8 htw-h-8 htw-opacity-50 htw-mb-6"
|
|
35
|
+
}),
|
|
36
|
+
_cache[0] || (_cache[0] = createTextVNode(" No event fired ", -1))
|
|
37
|
+
]),
|
|
38
|
+
_: 1
|
|
39
|
+
})) : (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
40
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(eventsStore).events, (event, key) => {
|
|
41
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
42
|
+
key,
|
|
43
|
+
event
|
|
44
|
+
}, null, 8, ["event"]);
|
|
45
|
+
}), 128))
|
|
46
|
+
]))
|
|
47
|
+
], 512);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
export {
|
|
52
|
+
_sfc_main as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { defineComponent, computed, createBlock, unref, openBlock, withCtx, createElementVNode, createVNode, resolveDynamicComponent } from "@poveste/vendors/vue";
|
|
2
|
+
import { useRoute } from "@poveste/vendors/vue-router";
|
|
3
|
+
import { useStoryStore } from "../../stores/story.js";
|
|
4
|
+
import BaseEmpty from "../base/BaseEmpty.vue.js";
|
|
5
|
+
import BaseSplitPane from "../base/BaseSplitPane.vue.js";
|
|
6
|
+
import "./PaneTabs.vue.js";
|
|
7
|
+
import "./StoryControls.vue.js";
|
|
8
|
+
import "./StoryDocs.vue.js";
|
|
9
|
+
import "./StoryEvents.vue.js";
|
|
10
|
+
import StorySourceCode from "./StorySourceCode.vue.js";
|
|
11
|
+
import _sfc_main$1 from "./StoryControls.vue2.js";
|
|
12
|
+
import _sfc_main$2 from "./StoryEvents.vue2.js";
|
|
13
|
+
import _sfc_main$3 from "./StoryDocs.vue2.js";
|
|
14
|
+
import _sfc_main$4 from "./PaneTabs.vue2.js";
|
|
15
|
+
"use strict";
|
|
16
|
+
const _hoisted_1 = { class: "htw-flex htw-flex-col htw-h-full" };
|
|
17
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
+
__name: "StorySidePanel",
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const storyStore = useStoryStore();
|
|
21
|
+
const route = useRoute();
|
|
22
|
+
const panelContentComponent = computed(() => {
|
|
23
|
+
switch (route.query.tab) {
|
|
24
|
+
case "docs":
|
|
25
|
+
return _sfc_main$3;
|
|
26
|
+
case "events":
|
|
27
|
+
return _sfc_main$2;
|
|
28
|
+
default:
|
|
29
|
+
return _sfc_main$1;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return (_ctx, _cache) => {
|
|
33
|
+
return !unref(storyStore).currentVariant ? (openBlock(), createBlock(BaseEmpty, {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "histoire-story-side-panel histoire-selection"
|
|
36
|
+
}, {
|
|
37
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
38
|
+
createElementVNode("span", null, "Select a variant", -1)
|
|
39
|
+
])]),
|
|
40
|
+
_: 1
|
|
41
|
+
})) : !unref(storyStore).currentVariant.configReady || !unref(storyStore).currentVariant.previewReady ? (openBlock(), createBlock(BaseEmpty, {
|
|
42
|
+
key: 1,
|
|
43
|
+
class: "histoire-story-side-panel histoire-loading"
|
|
44
|
+
}, {
|
|
45
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
46
|
+
createElementVNode("span", null, "Loading...", -1)
|
|
47
|
+
])]),
|
|
48
|
+
_: 1
|
|
49
|
+
})) : (openBlock(), createBlock(BaseSplitPane, {
|
|
50
|
+
key: 2,
|
|
51
|
+
"save-id": "story-sidepane",
|
|
52
|
+
orientation: "portrait",
|
|
53
|
+
class: "histoire-story-side-panel histoire-loaded htw-h-full",
|
|
54
|
+
"data-test-id": "story-side-panel"
|
|
55
|
+
}, {
|
|
56
|
+
first: withCtx(() => [
|
|
57
|
+
createElementVNode("div", _hoisted_1, [
|
|
58
|
+
createVNode(_sfc_main$4, {
|
|
59
|
+
story: unref(storyStore).currentStory,
|
|
60
|
+
variant: unref(storyStore).currentVariant
|
|
61
|
+
}, null, 8, ["story", "variant"]),
|
|
62
|
+
(openBlock(), createBlock(resolveDynamicComponent(panelContentComponent.value), {
|
|
63
|
+
story: unref(storyStore).currentStory,
|
|
64
|
+
variant: unref(storyStore).currentVariant,
|
|
65
|
+
class: "htw-h-full htw-overflow-auto"
|
|
66
|
+
}, null, 8, ["story", "variant"]))
|
|
67
|
+
])
|
|
68
|
+
]),
|
|
69
|
+
last: withCtx(() => [
|
|
70
|
+
createVNode(StorySourceCode, {
|
|
71
|
+
story: unref(storyStore).currentStory,
|
|
72
|
+
variant: unref(storyStore).currentVariant,
|
|
73
|
+
class: "htw-h-full"
|
|
74
|
+
}, null, 8, ["story", "variant"])
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
export {
|
|
82
|
+
_sfc_main as default
|
|
83
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _sfc_main from "./StorySourceCode.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
"use strict";
|
|
5
|
+
const StorySourceCode = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c937edfe"]]);
|
|
6
|
+
export {
|
|
7
|
+
StorySourceCode as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { defineComponent, ref, watchEffect, markRaw, shallowRef, watch, computed, onMounted, nextTick, resolveDirective, createElementBlock, openBlock, createCommentVNode, createBlock, createElementVNode, createVNode, withDirectives, normalizeClass, unref, toDisplayString, withCtx } from "@poveste/vendors/vue";
|
|
2
|
+
import { Icon } from "@poveste/vendors/iconify";
|
|
3
|
+
import { HstCopyIcon } from "@poveste/controls";
|
|
4
|
+
import { unindent } from "@poveste/shared";
|
|
5
|
+
import { createHighlighter } from "shiki";
|
|
6
|
+
import { clientSupportPlugins } from "virtual:$histoire-support-plugins-client";
|
|
7
|
+
import { isDark } from "../../util/dark.js";
|
|
8
|
+
import BaseEmpty from "../base/BaseEmpty.vue.js";
|
|
9
|
+
"use strict";
|
|
10
|
+
const _hoisted_1 = { class: "histoire-story-source-code htw-bg-gray-50 dark:htw-bg-gray-750 htw-h-full htw-overflow-hidden htw-flex htw-flex-col" };
|
|
11
|
+
const _hoisted_2 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "htw-h-10 htw-flex-none htw-border-b htw-border-solid htw-border-gray-500/5 htw-px-4 htw-flex htw-items-center htw-gap-2"
|
|
14
|
+
};
|
|
15
|
+
const _hoisted_3 = { class: "htw-flex htw-flex-none htw-gap-px htw-h-full htw-py-2" };
|
|
16
|
+
const _hoisted_4 = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "htw-text-red-500 htw-h-full htw-p-2 htw-overflow-auto htw-font-mono htw-text-sm"
|
|
19
|
+
};
|
|
20
|
+
const _hoisted_5 = ["value"];
|
|
21
|
+
const _hoisted_6 = ["innerHTML"];
|
|
22
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
23
|
+
__name: "StorySourceCode",
|
|
24
|
+
props: {
|
|
25
|
+
story: {},
|
|
26
|
+
variant: {}
|
|
27
|
+
},
|
|
28
|
+
setup(__props) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const generateSourceCodeFn = ref(null);
|
|
31
|
+
watchEffect(async () => {
|
|
32
|
+
const clientPlugin = clientSupportPlugins[props.story.file?.supportPluginId];
|
|
33
|
+
if (clientPlugin) {
|
|
34
|
+
const pluginModule = await clientPlugin();
|
|
35
|
+
generateSourceCodeFn.value = markRaw(pluginModule.generateSourceCode);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const highlighter = shallowRef();
|
|
39
|
+
const dynamicSourceCode = ref("");
|
|
40
|
+
const error = ref(null);
|
|
41
|
+
watch(() => [props.variant, generateSourceCodeFn.value], async () => {
|
|
42
|
+
if (!generateSourceCodeFn.value) return;
|
|
43
|
+
error.value = null;
|
|
44
|
+
dynamicSourceCode.value = "";
|
|
45
|
+
try {
|
|
46
|
+
if (props.variant.source) {
|
|
47
|
+
dynamicSourceCode.value = props.variant.source;
|
|
48
|
+
} else if (props.variant.slots?.().source) {
|
|
49
|
+
const source = props.variant.slots?.().source()[0].children;
|
|
50
|
+
if (source) {
|
|
51
|
+
dynamicSourceCode.value = await unindent(source);
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
dynamicSourceCode.value = await generateSourceCodeFn.value(props.variant);
|
|
55
|
+
}
|
|
56
|
+
} catch (e) {
|
|
57
|
+
console.error(e);
|
|
58
|
+
error.value = e.message;
|
|
59
|
+
}
|
|
60
|
+
if (!dynamicSourceCode.value) {
|
|
61
|
+
displayedSource.value = "static";
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
deep: true,
|
|
65
|
+
immediate: true
|
|
66
|
+
});
|
|
67
|
+
const staticSourceCode = ref("");
|
|
68
|
+
watch(() => [props.story, props.story?.file?.source], async () => {
|
|
69
|
+
staticSourceCode.value = "";
|
|
70
|
+
const sourceLoader = props.story.file?.source;
|
|
71
|
+
if (sourceLoader) {
|
|
72
|
+
staticSourceCode.value = (await sourceLoader()).default;
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
immediate: true
|
|
76
|
+
});
|
|
77
|
+
const displayedSource = ref("dynamic");
|
|
78
|
+
const displayedSourceCode = computed(() => {
|
|
79
|
+
if (displayedSource.value === "dynamic") {
|
|
80
|
+
return dynamicSourceCode.value;
|
|
81
|
+
}
|
|
82
|
+
return staticSourceCode.value;
|
|
83
|
+
});
|
|
84
|
+
onMounted(async () => {
|
|
85
|
+
highlighter.value = await createHighlighter({
|
|
86
|
+
langs: [
|
|
87
|
+
"html",
|
|
88
|
+
"jsx"
|
|
89
|
+
],
|
|
90
|
+
themes: [
|
|
91
|
+
"github-light",
|
|
92
|
+
"github-dark"
|
|
93
|
+
]
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
const sourceHtml = computed(() => displayedSourceCode.value ? highlighter.value?.codeToHtml(displayedSourceCode.value, {
|
|
97
|
+
lang: "html",
|
|
98
|
+
theme: isDark.value ? "github-dark" : "github-light"
|
|
99
|
+
}) : "");
|
|
100
|
+
let lastScroll = 0;
|
|
101
|
+
watch(() => props.variant, () => {
|
|
102
|
+
lastScroll = 0;
|
|
103
|
+
});
|
|
104
|
+
const scroller = ref();
|
|
105
|
+
function onScroll(event) {
|
|
106
|
+
if (sourceHtml.value) {
|
|
107
|
+
lastScroll = event.target.scrollTop;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
watch(sourceHtml, async () => {
|
|
111
|
+
await nextTick();
|
|
112
|
+
if (scroller.value) {
|
|
113
|
+
scroller.value.scrollTop = lastScroll;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
return (_ctx, _cache) => {
|
|
117
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
118
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
119
|
+
!error.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
120
|
+
_cache[2] || (_cache[2] = createElementVNode("div", { class: "htw-text-gray-900 dark:htw-text-gray-100" }, " Source ", -1)),
|
|
121
|
+
_cache[3] || (_cache[3] = createElementVNode("div", { class: "htw-flex-1" }, null, -1)),
|
|
122
|
+
createElementVNode("div", _hoisted_3, [
|
|
123
|
+
withDirectives((openBlock(), createElementBlock("button", {
|
|
124
|
+
class: normalizeClass(["htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-1 htw-bg-gray-500/10 htw-rounded-l htw-transition-all htw-ease-[cubic-bezier(0,1,.6,1)] htw-duration-300 htw-overflow-hidden", [
|
|
125
|
+
displayedSource.value !== "dynamic" ? "htw-max-w-6 htw-opacity-70" : "htw-max-w-[82px] htw-text-primary-600 dark:htw-text-primary-400",
|
|
126
|
+
dynamicSourceCode.value ? "htw-cursor-pointer hover:htw-bg-gray-500/30 active:htw-bg-gray-600/50" : "htw-opacity-50"
|
|
127
|
+
]]),
|
|
128
|
+
onClick: _cache[0] || (_cache[0] = ($event) => dynamicSourceCode.value && (displayedSource.value = "dynamic"))
|
|
129
|
+
}, [
|
|
130
|
+
createVNode(unref(Icon), {
|
|
131
|
+
icon: "carbon:flash",
|
|
132
|
+
class: "htw-w-4 htw-h-4 htw-flex-none"
|
|
133
|
+
}),
|
|
134
|
+
createElementVNode("span", {
|
|
135
|
+
class: normalizeClass(["transition-opacity duration-300", {
|
|
136
|
+
"opacity-0": displayedSource.value !== "dynamic"
|
|
137
|
+
}])
|
|
138
|
+
}, " Dynamic ", 2)
|
|
139
|
+
], 2)), [
|
|
140
|
+
[_directive_tooltip, !dynamicSourceCode.value ? "Dynamic source code is not available" : displayedSource.value !== "dynamic" ? "Switch to dynamic source" : null]
|
|
141
|
+
]),
|
|
142
|
+
withDirectives((openBlock(), createElementBlock("button", {
|
|
143
|
+
class: normalizeClass(["htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-1 htw-bg-gray-500/10 htw-rounded-r htw-transition-all htw-ease-[cubic-bezier(0,1,.6,1)] htw-duration-300 htw-overflow-hidden", [
|
|
144
|
+
displayedSource.value !== "static" ? "htw-max-w-6 htw-opacity-70" : "htw-max-w-[63px] htw-text-primary-600 dark:htw-text-primary-400",
|
|
145
|
+
staticSourceCode.value ? "htw-cursor-pointer hover:htw-bg-gray-500/30 active:htw-bg-gray-600/50" : "htw-opacity-50"
|
|
146
|
+
]]),
|
|
147
|
+
onClick: _cache[1] || (_cache[1] = ($event) => staticSourceCode.value && (displayedSource.value = "static"))
|
|
148
|
+
}, [
|
|
149
|
+
createVNode(unref(Icon), {
|
|
150
|
+
icon: "carbon:document",
|
|
151
|
+
class: "htw-w-4 htw-h-4 htw-flex-none"
|
|
152
|
+
}),
|
|
153
|
+
createElementVNode("span", {
|
|
154
|
+
class: normalizeClass(["transition-opacity duration-300", {
|
|
155
|
+
"opacity-0": displayedSource.value !== "static"
|
|
156
|
+
}])
|
|
157
|
+
}, " Static ", 2)
|
|
158
|
+
], 2)), [
|
|
159
|
+
[_directive_tooltip, !staticSourceCode.value ? "Static source code is not available" : displayedSource.value !== "static" ? "Switch to static source" : null]
|
|
160
|
+
])
|
|
161
|
+
]),
|
|
162
|
+
createVNode(unref(HstCopyIcon), {
|
|
163
|
+
content: displayedSourceCode.value,
|
|
164
|
+
class: "htw-flex-none"
|
|
165
|
+
}, null, 8, ["content"])
|
|
166
|
+
])) : createCommentVNode("", true),
|
|
167
|
+
error.value ? (openBlock(), createElementBlock("div", _hoisted_4, " Error: " + toDisplayString(error.value), 1)) : !displayedSourceCode.value ? (openBlock(), createBlock(BaseEmpty, { key: 2 }, {
|
|
168
|
+
default: withCtx(() => [
|
|
169
|
+
createVNode(unref(Icon), {
|
|
170
|
+
icon: "carbon:code-hide",
|
|
171
|
+
class: "htw-w-8 htw-h-8 htw-opacity-50 htw-mb-6"
|
|
172
|
+
}),
|
|
173
|
+
_cache[4] || (_cache[4] = createElementVNode("span", null, "Not available", -1))
|
|
174
|
+
]),
|
|
175
|
+
_: 1
|
|
176
|
+
})) : !sourceHtml.value ? (openBlock(), createElementBlock("textarea", {
|
|
177
|
+
key: 3,
|
|
178
|
+
ref_key: "scroller",
|
|
179
|
+
ref: scroller,
|
|
180
|
+
class: "__histoire-code-placeholder htw-w-full htw-h-full htw-p-4 htw-outline-none htw-bg-transparent htw-resize-none htw-m-0",
|
|
181
|
+
value: displayedSourceCode.value,
|
|
182
|
+
readonly: "",
|
|
183
|
+
"data-test-id": "story-source-code",
|
|
184
|
+
onScroll
|
|
185
|
+
}, null, 40, _hoisted_5)) : (openBlock(), createElementBlock("div", {
|
|
186
|
+
key: 4,
|
|
187
|
+
ref_key: "scroller",
|
|
188
|
+
ref: scroller,
|
|
189
|
+
class: "htw-w-full htw-h-full htw-overflow-auto",
|
|
190
|
+
"data-test-id": "story-source-code",
|
|
191
|
+
onScroll
|
|
192
|
+
}, [
|
|
193
|
+
createElementVNode("div", {
|
|
194
|
+
class: "__histoire-code htw-p-4 htw-w-fit",
|
|
195
|
+
innerHTML: sourceHtml.value
|
|
196
|
+
}, null, 8, _hoisted_6)
|
|
197
|
+
], 544))
|
|
198
|
+
]);
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
export {
|
|
203
|
+
_sfc_main as default
|
|
204
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _sfc_main from "./SearchItem.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
"use strict";
|
|
5
|
+
const SearchItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9f94ad2b"]]);
|
|
6
|
+
export {
|
|
7
|
+
SearchItem as default
|
|
8
|
+
};
|