@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,91 @@
|
|
|
1
|
+
import { defineComponent, reactive, ref, onMounted, createElementBlock, openBlock, withKeys, withModifiers, createElementVNode, toDisplayString, Fragment, renderList, createBlock, resolveDynamicComponent, createVNode, withCtx, nextTick } from "@histoire/vendors/vue";
|
|
2
|
+
import { getCommandContext, executeCommand } from "../../util/commands.js";
|
|
3
|
+
import "../base/BaseButton.vue.js";
|
|
4
|
+
import "../base/BaseKeyboardShortcut.vue.js";
|
|
5
|
+
import "./PromptSelect.vue.js";
|
|
6
|
+
import "./PromptText.vue.js";
|
|
7
|
+
import _sfc_main$1 from "./PromptSelect.vue2.js";
|
|
8
|
+
import _sfc_main$2 from "./PromptText.vue2.js";
|
|
9
|
+
import _sfc_main$3 from "../base/BaseButton.vue2.js";
|
|
10
|
+
import _sfc_main$4 from "../base/BaseKeyboardShortcut.vue2.js";
|
|
11
|
+
"use strict";
|
|
12
|
+
const _hoisted_1 = { class: "htw-p-4 htw-opacity-70" };
|
|
13
|
+
const _hoisted_2 = { class: "htw-flex htw-justify-end htw-gap-2 htw-p-2" };
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
__name: "CommandPrompts",
|
|
16
|
+
props: {
|
|
17
|
+
command: {}
|
|
18
|
+
},
|
|
19
|
+
emits: ["close"],
|
|
20
|
+
setup(__props, { emit: __emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const emit = __emit;
|
|
23
|
+
const promptTypes = {
|
|
24
|
+
text: _sfc_main$2,
|
|
25
|
+
select: _sfc_main$1
|
|
26
|
+
};
|
|
27
|
+
const answers = reactive({});
|
|
28
|
+
for (const prompt of props.command.prompts) {
|
|
29
|
+
let defaultValue;
|
|
30
|
+
if (typeof prompt.defaultValue === "function") {
|
|
31
|
+
defaultValue = prompt.defaultValue(answers);
|
|
32
|
+
} else {
|
|
33
|
+
defaultValue = prompt.defaultValue;
|
|
34
|
+
}
|
|
35
|
+
answers[prompt.field] = defaultValue;
|
|
36
|
+
}
|
|
37
|
+
function submit() {
|
|
38
|
+
const params = props.command.getParams ? props.command.getParams({ ...getCommandContext(), answers }) : answers;
|
|
39
|
+
executeCommand(props.command, params);
|
|
40
|
+
emit("close");
|
|
41
|
+
}
|
|
42
|
+
const promptComps = ref([]);
|
|
43
|
+
function focusPrompt(index) {
|
|
44
|
+
nextTick(() => {
|
|
45
|
+
promptComps.value[index]?.focus?.();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
onMounted(() => {
|
|
49
|
+
focusPrompt(0);
|
|
50
|
+
});
|
|
51
|
+
return (_ctx, _cache) => {
|
|
52
|
+
return openBlock(), createElementBlock("form", {
|
|
53
|
+
class: "histoire-command-prompts htw-flex htw-flex-col",
|
|
54
|
+
onSubmit: _cache[0] || (_cache[0] = withModifiers(($event) => submit(), ["prevent"])),
|
|
55
|
+
onKeyup: _cache[1] || (_cache[1] = withKeys(($event) => _ctx.$emit("close"), ["escape"]))
|
|
56
|
+
}, [
|
|
57
|
+
createElementVNode("div", _hoisted_1, toDisplayString(__props.command.label), 1),
|
|
58
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.command.prompts, (prompt, index) => {
|
|
59
|
+
return openBlock(), createBlock(resolveDynamicComponent(promptTypes[prompt.type]), {
|
|
60
|
+
key: prompt.field,
|
|
61
|
+
ref_for: true,
|
|
62
|
+
ref_key: "promptComps",
|
|
63
|
+
ref: promptComps,
|
|
64
|
+
modelValue: answers[prompt.field],
|
|
65
|
+
"onUpdate:modelValue": ($event) => answers[prompt.field] = $event,
|
|
66
|
+
prompt,
|
|
67
|
+
answers,
|
|
68
|
+
index,
|
|
69
|
+
class: "hover:htw-bg-gray-500/10 focus-within:htw-bg-gray-500/5",
|
|
70
|
+
onNext: ($event) => focusPrompt(index + 1)
|
|
71
|
+
}, null, 40, ["modelValue", "onUpdate:modelValue", "prompt", "answers", "index", "onNext"]);
|
|
72
|
+
}), 128)),
|
|
73
|
+
createElementVNode("div", _hoisted_2, [
|
|
74
|
+
createVNode(_sfc_main$3, {
|
|
75
|
+
type: "submit",
|
|
76
|
+
class: "htw-px-4 htw-py-2 htw-flex htw-items-start htw-gap-2"
|
|
77
|
+
}, {
|
|
78
|
+
default: withCtx(() => [
|
|
79
|
+
createVNode(_sfc_main$4, { shortcut: "Enter" }),
|
|
80
|
+
_cache[2] || (_cache[2] = createElementVNode("span", null, "Submit", -1))
|
|
81
|
+
]),
|
|
82
|
+
_: 1
|
|
83
|
+
})
|
|
84
|
+
])
|
|
85
|
+
], 32);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
_sfc_main as default
|
|
91
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineComponent, defineAsyncComponent, createElementBlock, createCommentVNode, openBlock, createElementVNode, createVNode, unref } from "@histoire/vendors/vue";
|
|
2
|
+
import { useCommandStore } from "../../stores/command.js";
|
|
3
|
+
"use strict";
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "histoire-command-prompts-modal htw-fixed htw-inset-0 htw-bg-white/80 dark:htw-bg-gray-900/80 htw-z-20"
|
|
7
|
+
};
|
|
8
|
+
const _hoisted_2 = { class: "htw-bg-white dark:htw-bg-gray-900 md:htw-mt-16 md:htw-mx-auto htw-w-screen htw-max-w-[512px] htw-max-h-[80vh] htw-overflow-y-auto htw-scroll-smooth htw-shadow-xl htw-border htw-border-gray-200 dark:htw-border-gray-750 htw-rounded-lg htw-relative htw-divide-y htw-divide-gray-200 dark:htw-divide-gray-850" };
|
|
9
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
+
__name: "CommandPromptsModal",
|
|
11
|
+
props: {
|
|
12
|
+
shown: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
emits: {
|
|
18
|
+
close: () => true
|
|
19
|
+
},
|
|
20
|
+
setup(__props, { emit: __emit }) {
|
|
21
|
+
const CommandPrompts = defineAsyncComponent(() => import("./CommandPrompts.vue.js"));
|
|
22
|
+
const emit = __emit;
|
|
23
|
+
function close() {
|
|
24
|
+
emit("close");
|
|
25
|
+
}
|
|
26
|
+
const commandStore = useCommandStore();
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
return __props.shown ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
29
|
+
createElementVNode("div", {
|
|
30
|
+
class: "htw-absolute htw-inset-0",
|
|
31
|
+
onClick: _cache[0] || (_cache[0] = ($event) => close())
|
|
32
|
+
}),
|
|
33
|
+
createElementVNode("div", _hoisted_2, [
|
|
34
|
+
createVNode(unref(CommandPrompts), {
|
|
35
|
+
command: unref(commandStore).selectedCommand,
|
|
36
|
+
onClose: _cache[1] || (_cache[1] = ($event) => close())
|
|
37
|
+
}, null, 8, ["command"])
|
|
38
|
+
])
|
|
39
|
+
])) : createCommentVNode("", true);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
_sfc_main as default
|
|
45
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, watchEffect, createElementBlock, openBlock, withDirectives, createElementVNode, vModelText, createCommentVNode, toDisplayString, createTextVNode, createVNode, withKeys, withModifiers, unref, Fragment, renderList, normalizeClass, createBlock } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import { useSelection } from "../../util/select.js";
|
|
4
|
+
import "../base/BaseKeyboardShortcut.vue.js";
|
|
5
|
+
import _sfc_main$1 from "../base/BaseKeyboardShortcut.vue2.js";
|
|
6
|
+
"use strict";
|
|
7
|
+
const _hoisted_1 = { class: "histoire-prompt-select htw-relative htw-group" };
|
|
8
|
+
const _hoisted_2 = ["required"];
|
|
9
|
+
const _hoisted_3 = { class: "htw-flex htw-flex-col htw-gap-2 htw-p-2" };
|
|
10
|
+
const _hoisted_4 = { class: "htw-px-2 htw-flex" };
|
|
11
|
+
const _hoisted_5 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "htw-opacity-70"
|
|
14
|
+
};
|
|
15
|
+
const _hoisted_6 = { class: "htw-opacity-40 htw-text-sm htw-ml-auto htw-invisible group-focus-within:htw-visible" };
|
|
16
|
+
const _hoisted_7 = { class: "htw-overflow-auto max-h-[300px] htw-mb-2" };
|
|
17
|
+
const _hoisted_8 = ["onClick"];
|
|
18
|
+
const _hoisted_9 = { class: "htw-flex-1" };
|
|
19
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
|
+
__name: "PromptSelect",
|
|
21
|
+
props: {
|
|
22
|
+
modelValue: {},
|
|
23
|
+
prompt: {},
|
|
24
|
+
answers: {}
|
|
25
|
+
},
|
|
26
|
+
emits: ["update:modelValue", "next"],
|
|
27
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const emit = __emit;
|
|
30
|
+
const model = computed({
|
|
31
|
+
get: () => props.modelValue,
|
|
32
|
+
set: (value) => {
|
|
33
|
+
emit("update:modelValue", value);
|
|
34
|
+
emit("next");
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const input = ref();
|
|
38
|
+
function focus() {
|
|
39
|
+
input.value?.focus();
|
|
40
|
+
input.value?.select();
|
|
41
|
+
}
|
|
42
|
+
__expose({
|
|
43
|
+
focus
|
|
44
|
+
});
|
|
45
|
+
const search = ref("");
|
|
46
|
+
const options = ref([]);
|
|
47
|
+
let requestId = 0;
|
|
48
|
+
watchEffect(async () => {
|
|
49
|
+
if (typeof props.prompt.options === "function") {
|
|
50
|
+
const rId = ++requestId;
|
|
51
|
+
const result = await props.prompt.options(search.value, props.answers);
|
|
52
|
+
if (rId === requestId) {
|
|
53
|
+
options.value = result;
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
options.value = props.prompt.options;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const formattedOptions = computed(() => {
|
|
60
|
+
return options.value.map((option) => {
|
|
61
|
+
if (typeof option === "string") {
|
|
62
|
+
return {
|
|
63
|
+
value: option,
|
|
64
|
+
label: option
|
|
65
|
+
};
|
|
66
|
+
} else {
|
|
67
|
+
return option;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
const {
|
|
72
|
+
selectedIndex,
|
|
73
|
+
selectNext,
|
|
74
|
+
selectPrevious
|
|
75
|
+
} = useSelection(formattedOptions);
|
|
76
|
+
function selectIndex(index) {
|
|
77
|
+
const result = formattedOptions.value[index].value;
|
|
78
|
+
if (result) {
|
|
79
|
+
model.value = result;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return (_ctx, _cache) => {
|
|
83
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
84
|
+
withDirectives(createElementVNode("input", {
|
|
85
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
86
|
+
required: __props.prompt.required,
|
|
87
|
+
tabindex: "-1",
|
|
88
|
+
class: "htw-absolute htw-inset-0 htw-opacity-0 htw-pointer-events-none"
|
|
89
|
+
}, null, 8, _hoisted_2), [
|
|
90
|
+
[vModelText, model.value]
|
|
91
|
+
]),
|
|
92
|
+
createElementVNode("label", _hoisted_3, [
|
|
93
|
+
createElementVNode("span", _hoisted_4, [
|
|
94
|
+
createElementVNode("span", null, toDisplayString(__props.prompt.label), 1),
|
|
95
|
+
__props.prompt.required ? (openBlock(), createElementBlock("span", _hoisted_5, "*")) : createCommentVNode("", true),
|
|
96
|
+
createElementVNode("span", _hoisted_6, [
|
|
97
|
+
_cache[5] || (_cache[5] = createTextVNode(" Press ", -1)),
|
|
98
|
+
createVNode(_sfc_main$1, { shortcut: "Space" }),
|
|
99
|
+
_cache[6] || (_cache[6] = createTextVNode(" to select ", -1))
|
|
100
|
+
])
|
|
101
|
+
]),
|
|
102
|
+
withDirectives(createElementVNode("input", {
|
|
103
|
+
ref_key: "input",
|
|
104
|
+
ref: input,
|
|
105
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => search.value = $event),
|
|
106
|
+
class: "htw-bg-transparent htw-w-full htw-p-2 htw-border htw-border-gray-500/50 focus:htw-border-primary-500/50 htw-rounded htw-outline-none",
|
|
107
|
+
onKeydown: [
|
|
108
|
+
_cache[2] || (_cache[2] = withKeys(withModifiers(($event) => unref(selectNext)(), ["prevent"]), ["down"])),
|
|
109
|
+
_cache[3] || (_cache[3] = withKeys(withModifiers(($event) => unref(selectPrevious)(), ["prevent"]), ["up"])),
|
|
110
|
+
_cache[4] || (_cache[4] = withKeys(withModifiers(($event) => selectIndex(unref(selectedIndex)), ["prevent"]), ["space"]))
|
|
111
|
+
]
|
|
112
|
+
}, null, 544), [
|
|
113
|
+
[vModelText, search.value]
|
|
114
|
+
])
|
|
115
|
+
]),
|
|
116
|
+
createElementVNode("div", _hoisted_7, [
|
|
117
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(formattedOptions.value, (option, index) => {
|
|
118
|
+
return openBlock(), createElementBlock("button", {
|
|
119
|
+
key: option.value,
|
|
120
|
+
type: "button",
|
|
121
|
+
tabindex: "-1",
|
|
122
|
+
class: normalizeClass([[
|
|
123
|
+
model.value === option.value ? "htw-bg-primary-500/20" : index === unref(selectedIndex) ? "htw-bg-primary-500/10" : "htw-bg-transparent"
|
|
124
|
+
], "htw-w-full htw-text-left htw-px-4 htw-py-2 hover:htw-bg-primary-500/10 htw-flex htw-items-center"]),
|
|
125
|
+
onClick: ($event) => model.value = option.value
|
|
126
|
+
}, [
|
|
127
|
+
createElementVNode("span", _hoisted_9, toDisplayString(option.label), 1),
|
|
128
|
+
model.value === option.value ? (openBlock(), createBlock(unref(Icon), {
|
|
129
|
+
key: 0,
|
|
130
|
+
icon: "carbon:checkmark",
|
|
131
|
+
class: "htw-w-4 htw-h-4 htw-text-primary-500"
|
|
132
|
+
})) : createCommentVNode("", true)
|
|
133
|
+
], 10, _hoisted_8);
|
|
134
|
+
}), 128))
|
|
135
|
+
])
|
|
136
|
+
]);
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
export {
|
|
141
|
+
_sfc_main as default
|
|
142
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, watch, createElementBlock, openBlock, createElementVNode, withDirectives, createCommentVNode, toDisplayString, vModelText } from "@histoire/vendors/vue";
|
|
2
|
+
"use strict";
|
|
3
|
+
const _hoisted_1 = { class: "histoire-prompt-text" };
|
|
4
|
+
const _hoisted_2 = { class: "htw-flex htw-flex-col htw-gap-2 htw-p-2" };
|
|
5
|
+
const _hoisted_3 = { class: "htw-px-2" };
|
|
6
|
+
const _hoisted_4 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "htw-opacity-70"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_5 = ["required"];
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
__name: "PromptText",
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: {},
|
|
15
|
+
prompt: {},
|
|
16
|
+
answers: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["update:modelValue"],
|
|
19
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const emit = __emit;
|
|
22
|
+
const model = computed({
|
|
23
|
+
get: () => props.modelValue,
|
|
24
|
+
set: (value) => emit("update:modelValue", value)
|
|
25
|
+
});
|
|
26
|
+
const input = ref();
|
|
27
|
+
function focus() {
|
|
28
|
+
input.value?.focus();
|
|
29
|
+
input.value?.select();
|
|
30
|
+
}
|
|
31
|
+
__expose({
|
|
32
|
+
focus
|
|
33
|
+
});
|
|
34
|
+
const defaultValue = computed(() => {
|
|
35
|
+
if (typeof props.prompt.defaultValue === "function") {
|
|
36
|
+
return props.prompt.defaultValue(props.answers);
|
|
37
|
+
} else {
|
|
38
|
+
return props.prompt.defaultValue;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
watch(defaultValue, (value) => {
|
|
42
|
+
model.value = value;
|
|
43
|
+
});
|
|
44
|
+
return (_ctx, _cache) => {
|
|
45
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
46
|
+
createElementVNode("label", _hoisted_2, [
|
|
47
|
+
createElementVNode("span", _hoisted_3, [
|
|
48
|
+
createElementVNode("span", null, toDisplayString(__props.prompt.label), 1),
|
|
49
|
+
__props.prompt.required ? (openBlock(), createElementBlock("span", _hoisted_4, "*")) : createCommentVNode("", true)
|
|
50
|
+
]),
|
|
51
|
+
withDirectives(createElementVNode("input", {
|
|
52
|
+
ref_key: "input",
|
|
53
|
+
ref: input,
|
|
54
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
55
|
+
class: "htw-bg-transparent htw-w-full htw-p-2 htw-border htw-border-gray-500/50 focus:htw-border-primary-500/50 htw-rounded htw-outline-none",
|
|
56
|
+
required: __props.prompt.required
|
|
57
|
+
}, null, 8, _hoisted_5), [
|
|
58
|
+
[vModelText, model.value]
|
|
59
|
+
])
|
|
60
|
+
])
|
|
61
|
+
]);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export {
|
|
66
|
+
_sfc_main as default
|
|
67
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createElementBlock, openBlock, createElementVNode } from "@histoire/vendors/vue";
|
|
2
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const _sfc_main = {};
|
|
4
|
+
const _hoisted_1 = { fill: "none" };
|
|
5
|
+
function _sfc_render(_ctx, _cache) {
|
|
6
|
+
return openBlock(), createElementBlock("svg", _hoisted_1, [..._cache[0] || (_cache[0] = [
|
|
7
|
+
createElementVNode("pattern", {
|
|
8
|
+
id: "checkerboard",
|
|
9
|
+
width: "64",
|
|
10
|
+
height: "64",
|
|
11
|
+
patternUnits: "userSpaceOnUse"
|
|
12
|
+
}, [
|
|
13
|
+
createElementVNode("rect", {
|
|
14
|
+
x: "0",
|
|
15
|
+
y: "0",
|
|
16
|
+
width: "32",
|
|
17
|
+
height: "32",
|
|
18
|
+
fill: "currentColor"
|
|
19
|
+
}),
|
|
20
|
+
createElementVNode("rect", {
|
|
21
|
+
x: "32",
|
|
22
|
+
y: "32",
|
|
23
|
+
width: "32",
|
|
24
|
+
height: "32",
|
|
25
|
+
fill: "currentColor"
|
|
26
|
+
})
|
|
27
|
+
], -1),
|
|
28
|
+
createElementVNode("rect", {
|
|
29
|
+
x: "0",
|
|
30
|
+
y: "0",
|
|
31
|
+
width: "100%",
|
|
32
|
+
height: "100%",
|
|
33
|
+
fill: "url(#checkerboard)"
|
|
34
|
+
}, null, -1)
|
|
35
|
+
])]);
|
|
36
|
+
}
|
|
37
|
+
const CheckerboardPattern = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
38
|
+
export {
|
|
39
|
+
CheckerboardPattern as default
|
|
40
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createElementBlock, openBlock } from "@histoire/vendors/vue";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const _sfc_main = {};
|
|
5
|
+
const _hoisted_1 = { class: "__histoire-hatched-pattern" };
|
|
6
|
+
function _sfc_render(_ctx, _cache) {
|
|
7
|
+
return openBlock(), createElementBlock("div", _hoisted_1);
|
|
8
|
+
}
|
|
9
|
+
const HatchedPattern = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-91561117"]]);
|
|
10
|
+
export {
|
|
11
|
+
HatchedPattern as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { defineComponent, computed, resolveDirective, createBlock, createCommentVNode, openBlock, resolveDynamicComponent, withCtx, withDirectives, createVNode, unref, withModifiers, normalizeClass } from "@histoire/vendors/vue";
|
|
2
|
+
import { HstJson, HstCheckbox, HstNumber, HstText } from "@histoire/controls";
|
|
3
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
4
|
+
"use strict";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "ControlsComponentPropItem",
|
|
7
|
+
props: {
|
|
8
|
+
variant: {},
|
|
9
|
+
component: {},
|
|
10
|
+
definition: {}
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const comp = computed(() => {
|
|
15
|
+
switch (props.definition.types?.[0]) {
|
|
16
|
+
case "string":
|
|
17
|
+
return HstText;
|
|
18
|
+
case "number":
|
|
19
|
+
return HstNumber;
|
|
20
|
+
case "boolean":
|
|
21
|
+
return HstCheckbox;
|
|
22
|
+
case "object":
|
|
23
|
+
default:
|
|
24
|
+
return HstJson;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const model = computed({
|
|
28
|
+
get: () => {
|
|
29
|
+
return props.variant.state._hPropState[props.component.index]?.[props.definition.name];
|
|
30
|
+
},
|
|
31
|
+
set: (value) => {
|
|
32
|
+
if (!props.variant.state._hPropState[props.component.index]) {
|
|
33
|
+
props.variant.state._hPropState[props.component.index] = {};
|
|
34
|
+
}
|
|
35
|
+
props.variant.state._hPropState[props.component.index][props.definition.name] = value;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
function reset() {
|
|
39
|
+
if (props.variant.state._hPropState[props.component.index]) {
|
|
40
|
+
delete props.variant.state._hPropState[props.component.index][props.definition.name];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const canReset = computed(() => props.variant.state?._hPropState?.[props.component.index] && props.definition.name in props.variant.state._hPropState[props.component.index]);
|
|
44
|
+
return (_ctx, _cache) => {
|
|
45
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
46
|
+
return comp.value ? (openBlock(), createBlock(resolveDynamicComponent(comp.value), {
|
|
47
|
+
key: 0,
|
|
48
|
+
modelValue: model.value,
|
|
49
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => model.value = $event),
|
|
50
|
+
placeholder: model.value === void 0 ? __props.definition?.default : null,
|
|
51
|
+
class: "histoire-controls-component-prop-item",
|
|
52
|
+
title: `${__props.definition.name}${canReset.value ? " *" : ""}`
|
|
53
|
+
}, {
|
|
54
|
+
actions: withCtx(() => [
|
|
55
|
+
withDirectives(createVNode(unref(Icon), {
|
|
56
|
+
icon: "carbon:erase",
|
|
57
|
+
class: normalizeClass(["htw-cursor-pointer htw-w-4 htw-h-4 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-text-gray-900 dark:htw-text-gray-100", [
|
|
58
|
+
canReset.value ? "htw-opacity-50 hover:htw-opacity-100" : "htw-opacity-25 htw-pointer-events-none"
|
|
59
|
+
]]),
|
|
60
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => reset(), ["stop"]))
|
|
61
|
+
}, null, 8, ["class"]), [
|
|
62
|
+
[_directive_tooltip, "Remove override"]
|
|
63
|
+
])
|
|
64
|
+
]),
|
|
65
|
+
_: 1
|
|
66
|
+
}, 8, ["modelValue", "placeholder", "title"])) : createCommentVNode("", true);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
_sfc_main as default
|
|
72
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineComponent, resolveDirective, createElementBlock, openBlock, createElementVNode, withDirectives, createVNode, unref, createTextVNode, toDisplayString, Fragment, renderList, createBlock } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import "./ControlsComponentPropItem.vue.js";
|
|
4
|
+
import _sfc_main$1 from "./ControlsComponentPropItem.vue2.js";
|
|
5
|
+
"use strict";
|
|
6
|
+
const _hoisted_1 = { class: "histoire-controls-component-props" };
|
|
7
|
+
const _hoisted_2 = { class: "htw-font-mono htw-p-2 htw-flex htw-items-center htw-gap-1" };
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "ControlsComponentProps",
|
|
10
|
+
props: {
|
|
11
|
+
variant: {},
|
|
12
|
+
definition: {}
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
return (_ctx, _cache) => {
|
|
16
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
17
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
18
|
+
createElementVNode("div", _hoisted_2, [
|
|
19
|
+
withDirectives(createVNode(unref(Icon), {
|
|
20
|
+
icon: "carbon:flash",
|
|
21
|
+
class: "htw-w-4 htw-h-4 htw-text-primary-500 htw-flex-none"
|
|
22
|
+
}, null, 512), [
|
|
23
|
+
[_directive_tooltip, "Auto-detected props"]
|
|
24
|
+
]),
|
|
25
|
+
createElementVNode("div", null, [
|
|
26
|
+
_cache[0] || (_cache[0] = createElementVNode("span", { class: "htw-opacity-30" }, "<", -1)),
|
|
27
|
+
createTextVNode(toDisplayString(__props.definition.name), 1),
|
|
28
|
+
_cache[1] || (_cache[1] = createElementVNode("span", { class: "htw-opacity-30" }, ">", -1))
|
|
29
|
+
])
|
|
30
|
+
]),
|
|
31
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.definition.props, (prop) => {
|
|
32
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
33
|
+
key: prop.name,
|
|
34
|
+
variant: __props.variant,
|
|
35
|
+
component: __props.definition,
|
|
36
|
+
definition: prop
|
|
37
|
+
}, null, 8, ["variant", "component", "definition"]);
|
|
38
|
+
}), 128))
|
|
39
|
+
]);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
_sfc_main as default
|
|
45
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineComponent, computed, resolveDirective, createElementBlock, openBlock, createElementVNode, withDirectives, createVNode, unref, Fragment, renderList, createBlock } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import "./ControlsComponentStateItem.vue.js";
|
|
4
|
+
import _sfc_main$1 from "./ControlsComponentStateItem.vue2.js";
|
|
5
|
+
"use strict";
|
|
6
|
+
const _hoisted_1 = { class: "histoire-controls-component-init-state" };
|
|
7
|
+
const _hoisted_2 = { class: "htw-p-2 htw-flex htw-items-center htw-gap-1" };
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "ControlsComponentState",
|
|
10
|
+
props: {
|
|
11
|
+
variant: {}
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const stateKeys = computed(() => Object.keys(props.variant.state || {}).filter((key) => !key.startsWith("_h")));
|
|
16
|
+
return (_ctx, _cache) => {
|
|
17
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
18
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
19
|
+
createElementVNode("div", _hoisted_2, [
|
|
20
|
+
withDirectives(createVNode(unref(Icon), {
|
|
21
|
+
icon: "carbon:data-vis-1",
|
|
22
|
+
class: "htw-w-4 htw-h-4 htw-text-primary-500 htw-flex-none"
|
|
23
|
+
}, null, 512), [
|
|
24
|
+
[_directive_tooltip, "Auto-detected state"]
|
|
25
|
+
]),
|
|
26
|
+
_cache[0] || (_cache[0] = createElementVNode("div", null, " State ", -1))
|
|
27
|
+
]),
|
|
28
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(stateKeys.value, (key) => {
|
|
29
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
30
|
+
key,
|
|
31
|
+
item: key,
|
|
32
|
+
variant: __props.variant
|
|
33
|
+
}, null, 8, ["item", "variant"]);
|
|
34
|
+
}), 128))
|
|
35
|
+
]);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
_sfc_main as default
|
|
41
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent, computed, createBlock, createCommentVNode, openBlock, resolveDynamicComponent } from "@histoire/vendors/vue";
|
|
2
|
+
import { HstJson, HstCheckbox, HstNumber, HstText } from "@histoire/controls";
|
|
3
|
+
"use strict";
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "ControlsComponentStateItem",
|
|
6
|
+
props: {
|
|
7
|
+
variant: {},
|
|
8
|
+
item: {}
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
const comp = computed(() => {
|
|
13
|
+
switch (typeof props.variant.state[props.item]) {
|
|
14
|
+
case "string":
|
|
15
|
+
return HstText;
|
|
16
|
+
case "number":
|
|
17
|
+
return HstNumber;
|
|
18
|
+
case "boolean":
|
|
19
|
+
return HstCheckbox;
|
|
20
|
+
case "object":
|
|
21
|
+
default:
|
|
22
|
+
return HstJson;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const model = computed({
|
|
26
|
+
get: () => {
|
|
27
|
+
return props.variant.state[props.item];
|
|
28
|
+
},
|
|
29
|
+
set: (value) => {
|
|
30
|
+
props.variant.state[props.item] = value;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return comp.value ? (openBlock(), createBlock(resolveDynamicComponent(comp.value), {
|
|
35
|
+
key: 0,
|
|
36
|
+
modelValue: model.value,
|
|
37
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
38
|
+
class: "histoire-controls-component-prop-item",
|
|
39
|
+
title: props.item
|
|
40
|
+
}, null, 8, ["modelValue", "title"])) : createCommentVNode("", true);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
_sfc_main as default
|
|
46
|
+
};
|