@ohos-ports/histoire-app 1.0.0-beta.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 +21 -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 +3 -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/_node-dom-env.js +188 -0
- package/dist/bundled/_virtual/_node-dom-polyfill.js +152 -0
- package/dist/bundled/_virtual/_plugin-vue_export-helper.js +10 -0
- package/dist/bundled/_virtual/histoire-commands.js +8 -0
- package/dist/bundled/_virtual/histoire-config.js +42 -0
- package/dist/bundled/_virtual/histoire-markdown-files.js +8 -0
- package/dist/bundled/_virtual/histoire-search-docs-data.js +11 -0
- package/dist/bundled/_virtual/histoire-search-title-data.js +11 -0
- package/dist/bundled/_virtual/histoire-stories.js +17 -0
- package/dist/bundled/_virtual/histoire-support-plugins-client.js +8 -0
- package/dist/bundled/_virtual/histoire-theme.js +8 -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 +36 -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 +7 -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 +2853 -0
- package/package.json +62 -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,127 @@
|
|
|
1
|
+
import { defineComponent, resolveComponent, resolveDirective, createBlock, openBlock, unref, withCtx, withDirectives, createElementBlock, normalizeClass, createVNode, createElementVNode, createTextVNode, vModelText, Fragment, renderList, toDisplayString, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
4
|
+
import { histoireConfig } from "../../util/config.js";
|
|
5
|
+
import "../base/BaseCheckbox.vue.js";
|
|
6
|
+
import _sfc_main$1 from "../base/BaseCheckbox.vue2.js";
|
|
7
|
+
"use strict";
|
|
8
|
+
const _hoisted_1 = { class: "htw-flex htw-flex-col htw-items-stretch" };
|
|
9
|
+
const _hoisted_2 = { class: "htw-flex htw-items-center htw-gap-2 htw-px-4 htw-py-3" };
|
|
10
|
+
const _hoisted_3 = ["onClick"];
|
|
11
|
+
const _hoisted_4 = { class: "htw-ml-auto htw-opacity-70 htw-flex htw-gap-1" };
|
|
12
|
+
const _hoisted_5 = { key: 0 };
|
|
13
|
+
const _hoisted_6 = { key: 0 };
|
|
14
|
+
const _hoisted_7 = { key: 1 };
|
|
15
|
+
const _hoisted_8 = { key: 2 };
|
|
16
|
+
const _hoisted_9 = { key: 0 };
|
|
17
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
+
__name: "ToolbarResponsiveSize",
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const settings = usePreviewSettingsStore().currentSettings;
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
const _component_VDropdown = resolveComponent("VDropdown");
|
|
23
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
24
|
+
return openBlock(), createBlock(_component_VDropdown, {
|
|
25
|
+
placement: "bottom-end",
|
|
26
|
+
skidding: 6,
|
|
27
|
+
disabled: !unref(histoireConfig).responsivePresets?.length,
|
|
28
|
+
class: "histoire-toolbar-responsive-size htw-h-full htw-flex-none"
|
|
29
|
+
}, {
|
|
30
|
+
popper: withCtx(({ hide }) => [
|
|
31
|
+
createElementVNode("div", _hoisted_1, [
|
|
32
|
+
createVNode(_sfc_main$1, {
|
|
33
|
+
modelValue: unref(settings).rotate,
|
|
34
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(settings).rotate = $event)
|
|
35
|
+
}, {
|
|
36
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
37
|
+
createTextVNode(" Rotate ", -1)
|
|
38
|
+
])]),
|
|
39
|
+
_: 1
|
|
40
|
+
}, 8, ["modelValue"]),
|
|
41
|
+
createElementVNode("div", _hoisted_2, [
|
|
42
|
+
withDirectives(createElementVNode("input", {
|
|
43
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(settings).responsiveWidth = $event),
|
|
44
|
+
type: "number",
|
|
45
|
+
class: "htw-bg-transparent htw-border htw-border-gray-200 dark:htw-border-gray-850 htw-rounded htw-w-20 htw-opacity-50 focus:htw-opacity-100 htw-flex-1 htw-min-w-0",
|
|
46
|
+
step: "16",
|
|
47
|
+
placeholder: "Auto"
|
|
48
|
+
}, null, 512), [
|
|
49
|
+
[
|
|
50
|
+
vModelText,
|
|
51
|
+
unref(settings).responsiveWidth,
|
|
52
|
+
void 0,
|
|
53
|
+
{ number: true }
|
|
54
|
+
],
|
|
55
|
+
[_directive_tooltip, "Responsive width (px)"]
|
|
56
|
+
]),
|
|
57
|
+
_cache[4] || (_cache[4] = createElementVNode("span", { class: "htw-opacity-50" }, "×", -1)),
|
|
58
|
+
withDirectives(createElementVNode("input", {
|
|
59
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(settings).responsiveHeight = $event),
|
|
60
|
+
type: "number",
|
|
61
|
+
class: "htw-bg-transparent htw-border htw-border-gray-200 dark:htw-border-gray-850 htw-rounded htw-w-20 htw-opacity-50 focus:htw-opacity-100 htw-flex-1 htw-min-w-0",
|
|
62
|
+
step: "16",
|
|
63
|
+
placeholder: "Auto"
|
|
64
|
+
}, null, 512), [
|
|
65
|
+
[
|
|
66
|
+
vModelText,
|
|
67
|
+
unref(settings).responsiveHeight,
|
|
68
|
+
void 0,
|
|
69
|
+
{ number: true }
|
|
70
|
+
],
|
|
71
|
+
[_directive_tooltip, "Responsive height (px)"]
|
|
72
|
+
])
|
|
73
|
+
]),
|
|
74
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(histoireConfig).responsivePresets, (preset, index) => {
|
|
75
|
+
return openBlock(), createElementBlock("button", {
|
|
76
|
+
key: index,
|
|
77
|
+
class: normalizeClass(["htw-px-4 htw-py-3 htw-cursor-pointer htw-text-left htw-flex htw-gap-4", [
|
|
78
|
+
unref(settings).responsiveWidth === preset.width && unref(settings).responsiveHeight === preset.height ? "htw-bg-primary-500 hover:htw-bg-primary-600 htw-text-white dark:htw-text-black" : "htw-bg-transparent hover:htw-bg-primary-100 dark:hover:htw-bg-primary-700"
|
|
79
|
+
]]),
|
|
80
|
+
onClick: ($event) => {
|
|
81
|
+
unref(settings).responsiveWidth = preset.width;
|
|
82
|
+
unref(settings).responsiveHeight = preset.height;
|
|
83
|
+
hide();
|
|
84
|
+
}
|
|
85
|
+
}, [
|
|
86
|
+
createTextVNode(toDisplayString(preset.label) + " ", 1),
|
|
87
|
+
createElementVNode("span", _hoisted_4, [
|
|
88
|
+
preset.width ? (openBlock(), createElementBlock("span", _hoisted_5, [
|
|
89
|
+
createTextVNode(toDisplayString(preset.width), 1),
|
|
90
|
+
!preset.height ? (openBlock(), createElementBlock("span", _hoisted_6, "px")) : createCommentVNode("", true)
|
|
91
|
+
])) : createCommentVNode("", true),
|
|
92
|
+
preset.width && preset.height ? (openBlock(), createElementBlock("span", _hoisted_7, "x")) : createCommentVNode("", true),
|
|
93
|
+
preset.height ? (openBlock(), createElementBlock("span", _hoisted_8, [
|
|
94
|
+
createTextVNode(toDisplayString(preset.height), 1),
|
|
95
|
+
!preset.width ? (openBlock(), createElementBlock("span", _hoisted_9, "px")) : createCommentVNode("", true)
|
|
96
|
+
])) : createCommentVNode("", true)
|
|
97
|
+
])
|
|
98
|
+
], 10, _hoisted_3);
|
|
99
|
+
}), 128))
|
|
100
|
+
])
|
|
101
|
+
]),
|
|
102
|
+
default: withCtx(() => [
|
|
103
|
+
withDirectives((openBlock(), createElementBlock("div", {
|
|
104
|
+
class: normalizeClass(["htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 htw-group", {
|
|
105
|
+
"htw-cursor-pointer hover:htw-text-primary-500": unref(histoireConfig).responsivePresets?.length
|
|
106
|
+
}])
|
|
107
|
+
}, [
|
|
108
|
+
createVNode(unref(Icon), {
|
|
109
|
+
icon: "carbon:devices",
|
|
110
|
+
class: "htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
|
|
111
|
+
}),
|
|
112
|
+
createVNode(unref(Icon), {
|
|
113
|
+
icon: "carbon:caret-down",
|
|
114
|
+
class: "htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
|
|
115
|
+
})
|
|
116
|
+
], 2)), [
|
|
117
|
+
[_directive_tooltip, "Responsive sizes"]
|
|
118
|
+
])
|
|
119
|
+
]),
|
|
120
|
+
_: 1
|
|
121
|
+
}, 8, ["disabled"]);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
export {
|
|
126
|
+
_sfc_main as default
|
|
127
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineComponent, resolveDirective, withDirectives, createElementBlock, openBlock, unref, createVNode } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
4
|
+
"use strict";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "ToolbarTextDirection",
|
|
7
|
+
setup(__props) {
|
|
8
|
+
const settings = usePreviewSettingsStore().currentSettings;
|
|
9
|
+
return (_ctx, _cache) => {
|
|
10
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
11
|
+
return withDirectives((openBlock(), createElementBlock("a", {
|
|
12
|
+
class: "histoire-toolbar-text-direction htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 hover:htw-text-primary-500 htw-opacity-50 hover:htw-opacity-100 dark:hover:htw-text-primary-400 htw-text-gray-900 dark:htw-text-gray-100",
|
|
13
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(settings).textDirection = unref(settings).textDirection === "ltr" ? "rtl" : "ltr")
|
|
14
|
+
}, [
|
|
15
|
+
createVNode(unref(Icon), {
|
|
16
|
+
icon: unref(settings).textDirection === "ltr" ? "fluent:text-paragraph-direction-right-16-regular" : "fluent:text-paragraph-direction-left-16-regular",
|
|
17
|
+
class: "htw-w-4 htw-h-4"
|
|
18
|
+
}, null, 8, ["icon"])
|
|
19
|
+
])), [
|
|
20
|
+
[_directive_tooltip, `Switch to text direction ${unref(settings).textDirection === "ltr" ? "Right to Left" : "Left to Right"}`]
|
|
21
|
+
]);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
_sfc_main as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, createVNode, createElementVNode, unref, normalizeClass, toDisplayString } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
"use strict";
|
|
4
|
+
const _hoisted_1 = { class: "histoire-toolbar-title htw-flex htw-items-center htw-gap-1 htw-text-gray-500 htw-flex-1 htw-truncate htw-min-w-0" };
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "ToolbarTitle",
|
|
7
|
+
props: {
|
|
8
|
+
variant: {}
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
return (_ctx, _cache) => {
|
|
12
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
13
|
+
createVNode(unref(Icon), {
|
|
14
|
+
icon: __props.variant.icon ?? "carbon:cube",
|
|
15
|
+
class: normalizeClass(["htw-w-4 htw-h-4 htw-opacity-50", [
|
|
16
|
+
__props.variant.iconColor ? "bind-icon-color" : "htw-text-gray-500"
|
|
17
|
+
]])
|
|
18
|
+
}, null, 8, ["icon", "class"]),
|
|
19
|
+
createElementVNode("span", null, toDisplayString(__props.variant.title), 1)
|
|
20
|
+
]);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
_sfc_main as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defineComponent, computed, createElementBlock, openBlock, createCommentVNode, Fragment, createElementVNode, withKeys, createVNode, unref, toDisplayString, renderList, createBlock } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import { useFolderStore } from "../../stores/folder.js";
|
|
4
|
+
import StoryListFolder from "./StoryListFolder.vue.js";
|
|
5
|
+
import StoryListItem from "./StoryListItem.vue.js";
|
|
6
|
+
"use strict";
|
|
7
|
+
const _hoisted_1 = {
|
|
8
|
+
"data-test-id": "story-group",
|
|
9
|
+
class: "histoire-story-group htw-my-2 first:htw-mt-0 last:htw-mb-0 htw-group"
|
|
10
|
+
};
|
|
11
|
+
const _hoisted_2 = { class: "htw-truncate" };
|
|
12
|
+
const _hoisted_3 = { key: 1 };
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "StoryGroup",
|
|
15
|
+
props: {
|
|
16
|
+
path: { default: () => [] },
|
|
17
|
+
group: {},
|
|
18
|
+
stories: {}
|
|
19
|
+
},
|
|
20
|
+
setup(__props) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const folderStore = useFolderStore();
|
|
23
|
+
const folderPath = computed(() => [...props.path, props.group.title]);
|
|
24
|
+
const isFolderOpen = computed(() => folderStore.isFolderOpened(folderPath.value, true));
|
|
25
|
+
function toggleOpen() {
|
|
26
|
+
folderStore.toggleFolder(folderPath.value, false);
|
|
27
|
+
}
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
30
|
+
__props.group.title ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
31
|
+
_cache[0] || (_cache[0] = createElementVNode("div", { class: "htw-h-[1px] htw-bg-gray-500/10 htw-mx-6 htw-mb-2 group-first:htw-hidden" }, null, -1)),
|
|
32
|
+
createElementVNode("div", {
|
|
33
|
+
role: "button",
|
|
34
|
+
tabindex: "0",
|
|
35
|
+
class: "htw-px-0.5 htw-py-2 md:htw-py-1.5 htw-mx-1 htw-rounded-sm hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900 htw-cursor-pointer htw-select-none htw-flex htw-items-center htw-gap-2 htw-min-w-0 htw-opacity-50 hover:htw-opacity-100",
|
|
36
|
+
onClick: toggleOpen,
|
|
37
|
+
onKeyup: [
|
|
38
|
+
withKeys(toggleOpen, ["enter"]),
|
|
39
|
+
withKeys(toggleOpen, ["space"])
|
|
40
|
+
]
|
|
41
|
+
}, [
|
|
42
|
+
createVNode(unref(Icon), {
|
|
43
|
+
icon: isFolderOpen.value ? "ri:subtract-line" : "ri:add-line",
|
|
44
|
+
class: "htw-w-4 htw-h-4 htw-ml-4 htw-rounded-sm htw-border htw-border-gray-500/40"
|
|
45
|
+
}, null, 8, ["icon"]),
|
|
46
|
+
createElementVNode("span", _hoisted_2, toDisplayString(__props.group.title), 1)
|
|
47
|
+
], 32)
|
|
48
|
+
], 64)) : createCommentVNode("", true),
|
|
49
|
+
isFolderOpen.value ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
50
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.group.children, (element) => {
|
|
51
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
52
|
+
key: element.title
|
|
53
|
+
}, [
|
|
54
|
+
element.children ? (openBlock(), createBlock(StoryListFolder, {
|
|
55
|
+
key: 0,
|
|
56
|
+
path: folderPath.value,
|
|
57
|
+
folder: element,
|
|
58
|
+
stories: __props.stories,
|
|
59
|
+
depth: 0
|
|
60
|
+
}, null, 8, ["path", "folder", "stories"])) : (openBlock(), createBlock(StoryListItem, {
|
|
61
|
+
key: 1,
|
|
62
|
+
story: __props.stories[element.index],
|
|
63
|
+
depth: 0
|
|
64
|
+
}, null, 8, ["story"]))
|
|
65
|
+
], 64);
|
|
66
|
+
}), 128))
|
|
67
|
+
])) : createCommentVNode("", true)
|
|
68
|
+
]);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
export {
|
|
73
|
+
_sfc_main as default
|
|
74
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, Fragment, renderList, createBlock } from "@histoire/vendors/vue";
|
|
2
|
+
import "./StoryGroup.vue.js";
|
|
3
|
+
import StoryListFolder from "./StoryListFolder.vue.js";
|
|
4
|
+
import StoryListItem from "./StoryListItem.vue.js";
|
|
5
|
+
import _sfc_main$1 from "./StoryGroup.vue2.js";
|
|
6
|
+
"use strict";
|
|
7
|
+
const _hoisted_1 = { class: "histoire-story-list htw-overflow-y-auto" };
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "StoryList",
|
|
10
|
+
props: {
|
|
11
|
+
tree: {},
|
|
12
|
+
stories: {}
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
return (_ctx, _cache) => {
|
|
16
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
17
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.tree, (element) => {
|
|
18
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
19
|
+
key: element.title
|
|
20
|
+
}, [
|
|
21
|
+
element.group ? (openBlock(), createBlock(_sfc_main$1, {
|
|
22
|
+
key: 0,
|
|
23
|
+
group: element,
|
|
24
|
+
stories: __props.stories
|
|
25
|
+
}, null, 8, ["group", "stories"])) : element.children ? (openBlock(), createBlock(StoryListFolder, {
|
|
26
|
+
key: 1,
|
|
27
|
+
folder: element,
|
|
28
|
+
stories: __props.stories
|
|
29
|
+
}, null, 8, ["folder", "stories"])) : (openBlock(), createBlock(StoryListItem, {
|
|
30
|
+
key: 2,
|
|
31
|
+
story: __props.stories[element.index]
|
|
32
|
+
}, null, 8, ["story"]))
|
|
33
|
+
], 64);
|
|
34
|
+
}), 128))
|
|
35
|
+
]);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
_sfc_main as default
|
|
41
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _sfc_main from "./StoryListFolder.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
"use strict";
|
|
5
|
+
const StoryListFolder = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ee932a0c"]]);
|
|
6
|
+
export {
|
|
7
|
+
StoryListFolder as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { defineComponent, useCssVars, computed, resolveComponent, createElementBlock, openBlock, createElementVNode, createCommentVNode, withKeys, createVNode, unref, normalizeClass, toDisplayString, Fragment, renderList, createBlock } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import { useFolderStore } from "../../stores/folder.js";
|
|
4
|
+
import StoryListItem from "./StoryListItem.vue.js";
|
|
5
|
+
"use strict";
|
|
6
|
+
const _hoisted_1 = {
|
|
7
|
+
"data-test-id": "story-list-folder",
|
|
8
|
+
class: "histoire-story-list-folder"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_2 = { class: "bind-tree-padding htw-flex htw-items-center htw-gap-2 htw-min-w-0" };
|
|
11
|
+
const _hoisted_3 = { class: "htw-flex htw-flex-none htw-items-center htw-opacity-30 [.histoire-story-list-folder-button:hover_&]:htw-opacity-100 htw-ml-4 htw-w-4 htw-h-4 htw-rounded-sm htw-border htw-border-gray-500/40" };
|
|
12
|
+
const _hoisted_4 = { class: "htw-truncate" };
|
|
13
|
+
const _hoisted_5 = { key: 0 };
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
__name: "StoryListFolder",
|
|
16
|
+
props: {
|
|
17
|
+
path: { default: () => [] },
|
|
18
|
+
folder: {},
|
|
19
|
+
stories: {},
|
|
20
|
+
depth: { default: 0 }
|
|
21
|
+
},
|
|
22
|
+
setup(__props) {
|
|
23
|
+
useCssVars((_ctx) => ({
|
|
24
|
+
"v5352bb71": folderPadding.value
|
|
25
|
+
}));
|
|
26
|
+
const props = __props;
|
|
27
|
+
const folderStore = useFolderStore();
|
|
28
|
+
const folderPath = computed(() => [...props.path, props.folder.title]);
|
|
29
|
+
const isFolderOpen = computed(() => folderStore.isFolderOpened(folderPath.value));
|
|
30
|
+
function toggleOpen() {
|
|
31
|
+
folderStore.toggleFolder(folderPath.value);
|
|
32
|
+
}
|
|
33
|
+
const folderPadding = computed(() => {
|
|
34
|
+
return `${props.depth * 12}px`;
|
|
35
|
+
});
|
|
36
|
+
return (_ctx, _cache) => {
|
|
37
|
+
const _component_StoryListFolder = resolveComponent("StoryListFolder", true);
|
|
38
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
39
|
+
createElementVNode("div", {
|
|
40
|
+
role: "button",
|
|
41
|
+
tabindex: "0",
|
|
42
|
+
class: "histoire-story-list-folder-button htw-px-0.5 htw-py-2 md:htw-py-1.5 htw-mx-1 htw-rounded-sm hover:htw-bg-primary-100 dark:hover:htw-bg-primary-900 htw-cursor-pointer htw-select-none htw-flex",
|
|
43
|
+
onClick: toggleOpen,
|
|
44
|
+
onKeyup: [
|
|
45
|
+
withKeys(toggleOpen, ["enter"]),
|
|
46
|
+
withKeys(toggleOpen, ["space"])
|
|
47
|
+
]
|
|
48
|
+
}, [
|
|
49
|
+
createElementVNode("span", _hoisted_2, [
|
|
50
|
+
createElementVNode("span", _hoisted_3, [
|
|
51
|
+
createVNode(unref(Icon), {
|
|
52
|
+
icon: "carbon:caret-right",
|
|
53
|
+
class: normalizeClass(["htw-w-full htw-h-full htw-transition-transform htw-duration-150", {
|
|
54
|
+
"htw-rotate-90": isFolderOpen.value
|
|
55
|
+
}])
|
|
56
|
+
}, null, 8, ["class"])
|
|
57
|
+
]),
|
|
58
|
+
createElementVNode("span", _hoisted_4, toDisplayString(__props.folder.title), 1)
|
|
59
|
+
])
|
|
60
|
+
], 32),
|
|
61
|
+
isFolderOpen.value ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
62
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.folder.children, (element) => {
|
|
63
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
64
|
+
key: element.title
|
|
65
|
+
}, [
|
|
66
|
+
element.children ? (openBlock(), createBlock(_component_StoryListFolder, {
|
|
67
|
+
key: 0,
|
|
68
|
+
path: folderPath.value,
|
|
69
|
+
folder: element,
|
|
70
|
+
stories: __props.stories,
|
|
71
|
+
depth: __props.depth + 1
|
|
72
|
+
}, null, 8, ["path", "folder", "stories", "depth"])) : (openBlock(), createBlock(StoryListItem, {
|
|
73
|
+
key: 1,
|
|
74
|
+
story: __props.stories[element.index],
|
|
75
|
+
depth: __props.depth + 1
|
|
76
|
+
}, null, 8, ["story", "depth"]))
|
|
77
|
+
], 64);
|
|
78
|
+
}), 128))
|
|
79
|
+
])) : createCommentVNode("", true)
|
|
80
|
+
]);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
_sfc_main as default
|
|
86
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _sfc_main from "./StoryListItem.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
"use strict";
|
|
5
|
+
const StoryListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-64c2458f"]]);
|
|
6
|
+
export {
|
|
7
|
+
StoryListItem as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { defineComponent, useCssVars, computed, ref, createElementBlock, openBlock, createVNode, withCtx, createElementVNode, createCommentVNode, unref, normalizeClass, toDisplayString } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import { useRoute } from "@histoire/vendors/vue-router";
|
|
4
|
+
import { useScrollOnActive } from "../../util/scroll.js";
|
|
5
|
+
import BaseListItemLink from "../base/BaseListItemLink.vue.js";
|
|
6
|
+
"use strict";
|
|
7
|
+
const _hoisted_1 = { class: "bind-tree-margin htw-flex htw-items-center htw-gap-2 htw-pl-4 htw-min-w-0" };
|
|
8
|
+
const _hoisted_2 = { class: "htw-truncate" };
|
|
9
|
+
const _hoisted_3 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "htw-opacity-40 htw-text-sm"
|
|
12
|
+
};
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "StoryListItem",
|
|
15
|
+
props: {
|
|
16
|
+
story: {},
|
|
17
|
+
depth: { default: 0 }
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
useCssVars((_ctx) => ({
|
|
21
|
+
"v2562213a": filePadding.value,
|
|
22
|
+
"v1eff521f": _ctx.story.iconColor
|
|
23
|
+
}));
|
|
24
|
+
const props = __props;
|
|
25
|
+
const filePadding = computed(() => {
|
|
26
|
+
return `${props.depth * 12}px`;
|
|
27
|
+
});
|
|
28
|
+
const route = useRoute();
|
|
29
|
+
const isActive = computed(() => route.params.storyId === props.story.id);
|
|
30
|
+
const el = ref();
|
|
31
|
+
useScrollOnActive(isActive, el);
|
|
32
|
+
return (_ctx, _cache) => {
|
|
33
|
+
return openBlock(), createElementBlock("div", {
|
|
34
|
+
ref_key: "el",
|
|
35
|
+
ref: el,
|
|
36
|
+
"data-test-id": "story-list-item",
|
|
37
|
+
class: "histoire-story-list-item"
|
|
38
|
+
}, [
|
|
39
|
+
createVNode(BaseListItemLink, {
|
|
40
|
+
to: {
|
|
41
|
+
name: "story",
|
|
42
|
+
params: {
|
|
43
|
+
storyId: __props.story.id
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
class: "htw-pl-0.5 htw-pr-2 htw-py-2 md:htw-py-1.5 htw-mx-1 htw-rounded-sm"
|
|
47
|
+
}, {
|
|
48
|
+
default: withCtx(({ active }) => [
|
|
49
|
+
createElementVNode("span", _hoisted_1, [
|
|
50
|
+
createVNode(unref(Icon), {
|
|
51
|
+
icon: __props.story.icon ?? "carbon:cube",
|
|
52
|
+
class: normalizeClass(["htw-w-5 htw-h-5 sm:htw-w-4 sm:htw-h-4 htw-flex-none", {
|
|
53
|
+
"htw-text-primary-500": !active && !__props.story.iconColor,
|
|
54
|
+
"bind-icon-color": !active && __props.story.iconColor
|
|
55
|
+
}])
|
|
56
|
+
}, null, 8, ["icon", "class"]),
|
|
57
|
+
createElementVNode("span", _hoisted_2, toDisplayString(__props.story.title), 1)
|
|
58
|
+
]),
|
|
59
|
+
!__props.story.docsOnly ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.story.variants.length), 1)) : createCommentVNode("", true)
|
|
60
|
+
]),
|
|
61
|
+
_: 1
|
|
62
|
+
}, 8, ["to"])
|
|
63
|
+
], 512);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export {
|
|
68
|
+
_sfc_main as default
|
|
69
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "./_virtual/_node-dom-env.js";
|
|
2
|
+
import FloatingVue from "@histoire/vendors/floating-vue";
|
|
3
|
+
import { createPinia } from "@histoire/vendors/pinia";
|
|
4
|
+
import { createApp } from "@histoire/vendors/vue";
|
|
5
|
+
import "./App.vue.js";
|
|
6
|
+
import { setupPluginApi } from "./plugin.js";
|
|
7
|
+
import { router } from "./router.js";
|
|
8
|
+
import "./_virtual/histoire-theme.js";
|
|
9
|
+
import _sfc_main from "./App.vue2.js";
|
|
10
|
+
"use strict";
|
|
11
|
+
async function mountMainApp() {
|
|
12
|
+
const app = createApp(_sfc_main);
|
|
13
|
+
app.use(createPinia());
|
|
14
|
+
app.use(FloatingVue, {
|
|
15
|
+
overflowPadding: 4,
|
|
16
|
+
arrowPadding: 8,
|
|
17
|
+
themes: {
|
|
18
|
+
tooltip: {
|
|
19
|
+
distance: 8
|
|
20
|
+
},
|
|
21
|
+
dropdown: {
|
|
22
|
+
computeTransformOrigin: true,
|
|
23
|
+
distance: 8
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
app.use(router);
|
|
28
|
+
app.mount("#app");
|
|
29
|
+
if (import.meta.hot) {
|
|
30
|
+
import.meta.hot.send("histoire:mount", {});
|
|
31
|
+
/* @__PURE__ */ setupPluginApi();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
mountMainApp
|
|
36
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { router } from "./router.js";
|
|
2
|
+
"use strict";
|
|
3
|
+
function setupPluginApi() {
|
|
4
|
+
if (!import.meta.hot) return;
|
|
5
|
+
const listeners = {};
|
|
6
|
+
import.meta.hot.on("histoire:dev-event-result", ({ event, result }) => {
|
|
7
|
+
const set = listeners[event];
|
|
8
|
+
if (set) {
|
|
9
|
+
for (const listener of set) {
|
|
10
|
+
listener(result);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
function addDevEventListener(event, listener) {
|
|
15
|
+
let set = listeners[event];
|
|
16
|
+
if (!set) {
|
|
17
|
+
set = /* @__PURE__ */ new Set();
|
|
18
|
+
listeners[event] = set;
|
|
19
|
+
}
|
|
20
|
+
set.add(listener);
|
|
21
|
+
return () => {
|
|
22
|
+
set.delete(listener);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
window.__HST_PLUGIN_API__ = {
|
|
26
|
+
sendEvent: (event, payload) => {
|
|
27
|
+
return new Promise((resolve) => {
|
|
28
|
+
import.meta.hot.send(`histoire:dev-event`, {
|
|
29
|
+
event,
|
|
30
|
+
payload
|
|
31
|
+
});
|
|
32
|
+
if (event.startsWith("on")) {
|
|
33
|
+
resolve(void 0);
|
|
34
|
+
} else {
|
|
35
|
+
const off = addDevEventListener(event, (result) => {
|
|
36
|
+
off();
|
|
37
|
+
resolve(result);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
openStory: (storyId) => {
|
|
43
|
+
router.push({ name: "story", params: { storyId } });
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
setupPluginApi
|
|
49
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createWebHistory, createWebHashHistory, createRouter } from "@histoire/vendors/vue-router";
|
|
2
|
+
import { histoireConfig } from "./util/config.js";
|
|
3
|
+
"use strict";
|
|
4
|
+
const base = (typeof import.meta !== "undefined" && import.meta.env && import.meta.env.BASE_URL !== undefined) ? import.meta.env.BASE_URL : "/";
|
|
5
|
+
function createRouterHistory() {
|
|
6
|
+
switch (histoireConfig.routerMode) {
|
|
7
|
+
case "hash":
|
|
8
|
+
return createWebHashHistory(base);
|
|
9
|
+
case "history":
|
|
10
|
+
default:
|
|
11
|
+
return createWebHistory(base);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const router = createRouter({
|
|
15
|
+
history: createRouterHistory(),
|
|
16
|
+
routes: [
|
|
17
|
+
{
|
|
18
|
+
path: "/",
|
|
19
|
+
name: "home",
|
|
20
|
+
component: () => import("./components/HomeView.vue.js")
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
path: "/story/:storyId",
|
|
24
|
+
name: "story",
|
|
25
|
+
component: () => import("./components/story/StoryView.vue.js")
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
export {
|
|
30
|
+
base,
|
|
31
|
+
router
|
|
32
|
+
};
|