@poveste/app 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/postcss.config.cjs +1 -1
- package/src/app/App.vue +9 -9
- package/src/app/assets/poveste-text-dark.svg +15 -0
- package/src/app/assets/poveste-text.svg +15 -0
- package/src/app/assets/poveste.svg +14 -0
- package/src/app/components/HomeView.vue +4 -4
- package/src/app/components/app/AppHeader.vue +4 -4
- package/src/app/components/app/AppLogo.vue +7 -7
- package/src/app/components/app/Breadcrumb.vue +1 -1
- package/src/app/components/app/InitialLoading.vue +3 -3
- package/src/app/components/app/MobileOverlay.vue +2 -2
- package/src/app/components/base/BaseButton.vue +1 -1
- package/src/app/components/base/BaseCheckbox.vue +1 -1
- package/src/app/components/base/BaseCopyIcon.vue +1 -1
- package/src/app/components/base/BaseEmpty.vue +1 -1
- package/src/app/components/base/BaseIcon.vue +2 -2
- package/src/app/components/base/BaseKeyboardShortcut.vue +1 -1
- package/src/app/components/base/BaseListItemLink.vue +1 -1
- package/src/app/components/base/BaseOverflowMenu.vue +1 -1
- package/src/app/components/base/BaseOverflowTab.vue +2 -2
- package/src/app/components/base/BaseSelect.vue +1 -1
- package/src/app/components/base/BaseSplitPane.vue +2 -2
- package/src/app/components/base/BaseTab.vue +2 -2
- package/src/app/components/base/BaseTag.vue +1 -1
- package/src/app/components/command/CommandPrompts.vue +1 -1
- package/src/app/components/command/CommandPromptsModal.vue +1 -1
- package/src/app/components/command/PromptSelect.vue +1 -1
- package/src/app/components/command/PromptText.vue +1 -1
- package/src/app/components/misc/HatchedPattern.vue +2 -2
- package/src/app/components/panel/ControlsComponentPropItem.vue +1 -1
- package/src/app/components/panel/ControlsComponentProps.vue +1 -1
- package/src/app/components/panel/ControlsComponentState.vue +1 -1
- package/src/app/components/panel/ControlsComponentStateItem.vue +1 -1
- package/src/app/components/panel/PaneTabs.vue +1 -1
- package/src/app/components/panel/StatePresets.vue +3 -3
- package/src/app/components/panel/StoryControls.vue +2 -2
- package/src/app/components/panel/StoryDocs.vue +6 -6
- package/src/app/components/panel/StoryEvent.vue +1 -1
- package/src/app/components/panel/StoryEvents.vue +1 -1
- package/src/app/components/panel/StorySidePanel.vue +3 -3
- package/src/app/components/panel/StorySourceCode.vue +5 -5
- package/src/app/components/search/SearchItem.vue +1 -1
- package/src/app/components/search/SearchLoading.vue +1 -1
- package/src/app/components/search/SearchModal.vue +1 -1
- package/src/app/components/search/SearchPane.vue +3 -3
- package/src/app/components/search/search-docs-data.ts +1 -1
- package/src/app/components/search/search-title-data.ts +1 -1
- package/src/app/components/story/GenericMountStory.vue +2 -2
- package/src/app/components/story/GenericRenderStory.vue +2 -2
- package/src/app/components/story/StoryResponsivePreview.vue +1 -1
- package/src/app/components/story/StoryVariantGrid.vue +2 -2
- package/src/app/components/story/StoryVariantGridItem.vue +6 -4
- package/src/app/components/story/StoryVariantListItem.vue +1 -1
- package/src/app/components/story/StoryVariantSingle.vue +2 -2
- package/src/app/components/story/StoryVariantSinglePreviewNative.vue +7 -5
- package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +1 -1
- package/src/app/components/story/StoryVariantSingleView.vue +2 -2
- package/src/app/components/story/StoryView.vue +2 -2
- package/src/app/components/story/StoryViewer.vue +1 -1
- package/src/app/components/toolbar/DevOnlyToolbarOpenInEditor.vue +1 -1
- package/src/app/components/toolbar/ToolbarBackground.vue +4 -4
- package/src/app/components/toolbar/ToolbarNewTab.vue +1 -1
- package/src/app/components/toolbar/ToolbarResponsiveSize.vue +5 -5
- package/src/app/components/toolbar/ToolbarTextDirection.vue +1 -1
- package/src/app/components/toolbar/ToolbarTitle.vue +1 -1
- package/src/app/components/tree/StoryGroup.vue +1 -1
- package/src/app/components/tree/StoryList.vue +1 -1
- package/src/app/components/tree/StoryListFolder.vue +3 -3
- package/src/app/components/tree/StoryListItem.vue +1 -1
- package/src/app/index.ts +2 -2
- package/src/app/plugin.ts +2 -2
- package/src/app/router.ts +2 -2
- package/src/app/sandbox.ts +6 -6
- package/src/app/stores/folder.ts +1 -1
- package/src/app/stores/preview-settings.ts +1 -1
- package/src/app/style/main.pcss +3 -3
- package/src/app/style/sandbox.css +1 -1
- package/src/app/style/transitions.pcss +4 -4
- package/src/app/types.ts +2 -2
- package/src/app/util/commands.ts +2 -2
- package/src/app/util/config.ts +2 -2
- package/src/app/util/const.ts +4 -4
- package/src/app/util/dark.ts +4 -4
- package/src/app/util/docs.ts +1 -1
- package/src/app/util/events.ts +1 -1
- package/src/app/util/preview-settings.ts +5 -3
- package/src/virtual.d.ts +1 -1
- package/tailwind.config.cjs +2 -2
- package/vite.config.ts +2 -2
- package/dist/app/assets/histoire-text-dark.svg +0 -89
- package/dist/app/assets/histoire-text.svg +0 -89
- package/dist/app/assets/histoire.svg +0 -51
- package/dist/app/style/floating.pcss +0 -34
- package/dist/app/style/main.pcss +0 -100
- package/dist/app/style/sandbox.css +0 -24
- package/dist/app/style/transitions.pcss +0 -51
- package/dist/bundle-index.js +0 -1
- package/dist/bundle-main-dev.js +0 -4
- package/dist/bundle-main.js +0 -5
- package/dist/bundle-sandbox-dev.js +0 -2
- package/dist/bundle-sandbox.js +0 -2
- package/dist/bundled/App.vue.js +0 -5
- package/dist/bundled/App.vue2.js +0 -167
- package/dist/bundled/_virtual/_plugin-vue_export-helper.js +0 -10
- package/dist/bundled/api.js +0 -12
- package/dist/bundled/app.css +0 -116
- package/dist/bundled/assets/histoire-text-dark.svg.js +0 -4
- package/dist/bundled/assets/histoire-text.svg.js +0 -4
- package/dist/bundled/assets/histoire.svg.js +0 -4
- package/dist/bundled/components/HomeView.vue.js +0 -5
- package/dist/bundled/components/HomeView.vue2.js +0 -66
- package/dist/bundled/components/app/AppHeader.vue.js +0 -5
- package/dist/bundled/components/app/AppHeader.vue2.js +0 -71
- package/dist/bundled/components/app/AppLogo.vue.js +0 -5
- package/dist/bundled/components/app/AppLogo.vue2.js +0 -29
- package/dist/bundled/components/app/Breadcrumb.vue.js +0 -8
- package/dist/bundled/components/app/Breadcrumb.vue2.js +0 -91
- package/dist/bundled/components/app/HomeCounter.vue.js +0 -5
- package/dist/bundled/components/app/HomeCounter.vue2.js +0 -42
- package/dist/bundled/components/app/InitialLoading.vue.js +0 -5
- package/dist/bundled/components/app/InitialLoading.vue2.js +0 -51
- package/dist/bundled/components/app/MobileOverlay.vue.js +0 -5
- package/dist/bundled/components/app/MobileOverlay.vue2.js +0 -45
- package/dist/bundled/components/base/BaseButton.vue.js +0 -5
- package/dist/bundled/components/base/BaseButton.vue2.js +0 -39
- package/dist/bundled/components/base/BaseCheckbox.vue.js +0 -5
- package/dist/bundled/components/base/BaseCheckbox.vue2.js +0 -78
- package/dist/bundled/components/base/BaseEmpty.vue.js +0 -14
- package/dist/bundled/components/base/BaseIcon.vue.js +0 -8
- package/dist/bundled/components/base/BaseIcon.vue2.js +0 -29
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue.js +0 -5
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue2.js +0 -20
- package/dist/bundled/components/base/BaseListItem.vue.js +0 -5
- package/dist/bundled/components/base/BaseListItem.vue2.js +0 -33
- package/dist/bundled/components/base/BaseListItemLink.vue.js +0 -33
- package/dist/bundled/components/base/BaseListItemLink.vue2.js +0 -26
- package/dist/bundled/components/base/BaseOverflowMenu.vue.js +0 -5
- package/dist/bundled/components/base/BaseOverflowMenu.vue2.js +0 -100
- package/dist/bundled/components/base/BaseOverflowTab.vue.js +0 -36
- package/dist/bundled/components/base/BaseOverflowTab.vue2.js +0 -18
- package/dist/bundled/components/base/BaseSelect.vue.js +0 -5
- package/dist/bundled/components/base/BaseSelect.vue2.js +0 -77
- package/dist/bundled/components/base/BaseSplitPane.vue.js +0 -8
- package/dist/bundled/components/base/BaseSplitPane.vue2.js +0 -183
- package/dist/bundled/components/base/BaseTab.vue.js +0 -36
- package/dist/bundled/components/base/BaseTab.vue2.js +0 -18
- package/dist/bundled/components/base/BaseTag.vue.js +0 -13
- package/dist/bundled/components/command/CommandPrompts.vue.js +0 -5
- package/dist/bundled/components/command/CommandPrompts.vue2.js +0 -91
- package/dist/bundled/components/command/CommandPromptsModal.vue.js +0 -5
- package/dist/bundled/components/command/CommandPromptsModal.vue2.js +0 -45
- package/dist/bundled/components/command/PromptSelect.vue.js +0 -5
- package/dist/bundled/components/command/PromptSelect.vue2.js +0 -142
- package/dist/bundled/components/command/PromptText.vue.js +0 -5
- package/dist/bundled/components/command/PromptText.vue2.js +0 -67
- package/dist/bundled/components/misc/CheckerboardPattern.vue.js +0 -40
- package/dist/bundled/components/misc/HatchedPattern.vue.js +0 -12
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue2.js +0 -72
- package/dist/bundled/components/panel/ControlsComponentProps.vue.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentProps.vue2.js +0 -45
- package/dist/bundled/components/panel/ControlsComponentState.vue.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentState.vue2.js +0 -41
- package/dist/bundled/components/panel/ControlsComponentStateItem.vue.js +0 -5
- package/dist/bundled/components/panel/ControlsComponentStateItem.vue2.js +0 -46
- package/dist/bundled/components/panel/PaneTabs.vue.js +0 -5
- package/dist/bundled/components/panel/PaneTabs.vue2.js +0 -114
- package/dist/bundled/components/panel/StatePresets.vue.js +0 -5
- package/dist/bundled/components/panel/StatePresets.vue2.js +0 -193
- package/dist/bundled/components/panel/StoryControls.vue.js +0 -5
- package/dist/bundled/components/panel/StoryControls.vue2.js +0 -87
- package/dist/bundled/components/panel/StoryDocs.vue.js +0 -7
- package/dist/bundled/components/panel/StoryDocs.vue2.js +0 -161
- package/dist/bundled/components/panel/StoryEvent.vue.js +0 -5
- package/dist/bundled/components/panel/StoryEvent.vue2.js +0 -59
- package/dist/bundled/components/panel/StoryEvents.vue.js +0 -5
- package/dist/bundled/components/panel/StoryEvents.vue2.js +0 -53
- package/dist/bundled/components/panel/StorySidePanel.vue.js +0 -5
- package/dist/bundled/components/panel/StorySidePanel.vue2.js +0 -83
- package/dist/bundled/components/panel/StorySourceCode.vue.js +0 -8
- package/dist/bundled/components/panel/StorySourceCode.vue2.js +0 -204
- package/dist/bundled/components/search/SearchItem.vue.js +0 -8
- package/dist/bundled/components/search/SearchItem.vue2.js +0 -93
- package/dist/bundled/components/search/SearchItemContent.vue.js +0 -5
- package/dist/bundled/components/search/SearchItemContent.vue2.js +0 -71
- package/dist/bundled/components/search/SearchLoading.vue.js +0 -5
- package/dist/bundled/components/search/SearchLoading.vue2.js +0 -21
- package/dist/bundled/components/search/SearchModal.vue.js +0 -5
- package/dist/bundled/components/search/SearchModal.vue2.js +0 -51
- package/dist/bundled/components/search/SearchPane.vue.js +0 -5
- package/dist/bundled/components/search/SearchPane.vue2.js +0 -272
- package/dist/bundled/components/search/search-docs-data.js +0 -11
- package/dist/bundled/components/search/search-title-data.js +0 -11
- package/dist/bundled/components/story/GenericMountStory.vue.js +0 -5
- package/dist/bundled/components/story/GenericMountStory.vue2.js +0 -34
- package/dist/bundled/components/story/GenericRenderStory.vue.js +0 -5
- package/dist/bundled/components/story/GenericRenderStory.vue2.js +0 -39
- package/dist/bundled/components/story/StoryResponsivePreview.vue.js +0 -8
- package/dist/bundled/components/story/StoryResponsivePreview.vue2.js +0 -207
- package/dist/bundled/components/story/StoryVariantGrid.vue.js +0 -5
- package/dist/bundled/components/story/StoryVariantGrid.vue2.js +0 -146
- package/dist/bundled/components/story/StoryVariantGridItem.vue.js +0 -8
- package/dist/bundled/components/story/StoryVariantGridItem.vue2.js +0 -153
- package/dist/bundled/components/story/StoryVariantListItem.vue.js +0 -8
- package/dist/bundled/components/story/StoryVariantListItem.vue2.js +0 -55
- package/dist/bundled/components/story/StoryVariantSingle.vue.js +0 -8
- package/dist/bundled/components/story/StoryVariantSingle.vue2.js +0 -107
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue.js +0 -5
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue2.js +0 -70
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue.js +0 -5
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue2.js +0 -128
- package/dist/bundled/components/story/StoryVariantSingleView.vue.js +0 -5
- package/dist/bundled/components/story/StoryVariantSingleView.vue2.js +0 -66
- package/dist/bundled/components/story/StoryView.vue.js +0 -5
- package/dist/bundled/components/story/StoryView.vue2.js +0 -104
- package/dist/bundled/components/story/StoryViewer.vue.js +0 -8
- package/dist/bundled/components/story/StoryViewer.vue2.js +0 -55
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue.js +0 -5
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue2.js +0 -31
- package/dist/bundled/components/toolbar/ToolbarBackground.vue.js +0 -8
- package/dist/bundled/components/toolbar/ToolbarBackground.vue2.js +0 -98
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue2.js +0 -36
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue2.js +0 -127
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue2.js +0 -27
- package/dist/bundled/components/toolbar/ToolbarTitle.vue.js +0 -5
- package/dist/bundled/components/toolbar/ToolbarTitle.vue2.js +0 -26
- package/dist/bundled/components/tree/StoryGroup.vue.js +0 -5
- package/dist/bundled/components/tree/StoryGroup.vue2.js +0 -74
- package/dist/bundled/components/tree/StoryList.vue.js +0 -5
- package/dist/bundled/components/tree/StoryList.vue2.js +0 -41
- package/dist/bundled/components/tree/StoryListFolder.vue.js +0 -8
- package/dist/bundled/components/tree/StoryListFolder.vue2.js +0 -86
- package/dist/bundled/components/tree/StoryListItem.vue.js +0 -8
- package/dist/bundled/components/tree/StoryListItem.vue2.js +0 -69
- package/dist/bundled/index.js +0 -35
- package/dist/bundled/plugin.js +0 -49
- package/dist/bundled/router.js +0 -32
- package/dist/bundled/sandbox.js +0 -87
- package/dist/bundled/stores/command.js +0 -25
- package/dist/bundled/stores/events.js +0 -29
- package/dist/bundled/stores/folder.js +0 -54
- package/dist/bundled/stores/preview-settings.js +0 -19
- package/dist/bundled/stores/story.js +0 -43
- package/dist/bundled/util/commands.js +0 -57
- package/dist/bundled/util/config.js +0 -8
- package/dist/bundled/util/const.js +0 -10
- package/dist/bundled/util/dark.js +0 -28
- package/dist/bundled/util/docs.js +0 -26
- package/dist/bundled/util/env.js +0 -4
- package/dist/bundled/util/events.js +0 -33
- package/dist/bundled/util/keyboard.js +0 -90
- package/dist/bundled/util/mapping.js +0 -70
- package/dist/bundled/util/open-in-editor.js +0 -6
- package/dist/bundled/util/preview-settings.js +0 -21
- package/dist/bundled/util/responsive.js +0 -6
- package/dist/bundled/util/sandbox.js +0 -11
- package/dist/bundled/util/scroll.js +0 -31
- package/dist/bundled/util/select.js +0 -28
- package/dist/bundled/util/state.js +0 -41
- package/dist/bundled/util/tooltip.js +0 -15
- package/dist/bundled/util/variant.js +0 -21
- package/dist/style.css +0 -2626
- package/src/app/assets/histoire-text-dark.svg +0 -89
- package/src/app/assets/histoire-text.svg +0 -89
- package/src/app/assets/histoire.svg +0 -51
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "@poveste/vendors/vue";
|
|
2
|
-
"use strict";
|
|
3
|
-
const _sfc_main = defineComponent({
|
|
4
|
-
inheritAttrs: false,
|
|
5
|
-
props: {
|
|
6
|
-
isActive: {
|
|
7
|
-
type: Boolean,
|
|
8
|
-
default: void 0
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
emits: {
|
|
12
|
-
navigate: () => true
|
|
13
|
-
},
|
|
14
|
-
setup(props, { emit }) {
|
|
15
|
-
function handleNavigate(event, navigate) {
|
|
16
|
-
emit("navigate");
|
|
17
|
-
navigate(event);
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
handleNavigate
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
export {
|
|
25
|
-
_sfc_main as default
|
|
26
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, resolveComponent, createElementBlock, openBlock, createVNode, createBlock, createCommentVNode, withCtx, renderSlot, createElementVNode, unref, reactive, onBeforeUnmount, h } from "@poveste/vendors/vue";
|
|
2
|
-
import { Icon } from "@poveste/vendors/iconify";
|
|
3
|
-
import { useResizeObserver } from "@poveste/vendors/vue-use";
|
|
4
|
-
"use strict";
|
|
5
|
-
const _hoisted_1 = {
|
|
6
|
-
role: "button",
|
|
7
|
-
class: "htw-cursor-pointer hover:htw-bg-primary-50 dark:hover:htw-bg-primary-900 htw-w-8 htw-h-full htw-flex htw-items-center htw-justify-center htw-absolute htw-top-0 htw-right-0"
|
|
8
|
-
};
|
|
9
|
-
const _hoisted_2 = { class: "htw-flex htw-flex-col htw-items-stretch" };
|
|
10
|
-
const overflowButtonWidth = 32;
|
|
11
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
-
__name: "BaseOverflowMenu",
|
|
13
|
-
setup(__props) {
|
|
14
|
-
const el = ref();
|
|
15
|
-
const availableWidth = ref(0);
|
|
16
|
-
useResizeObserver(el, (entries) => {
|
|
17
|
-
const containerWidth = entries[0].contentRect.width;
|
|
18
|
-
availableWidth.value = containerWidth - overflowButtonWidth;
|
|
19
|
-
});
|
|
20
|
-
const children = ref(/* @__PURE__ */ new Map());
|
|
21
|
-
const visibleChildrenCount = computed(() => {
|
|
22
|
-
let width = 0;
|
|
23
|
-
const c = [...children.value.values()].sort((a, b) => a.index - b.index);
|
|
24
|
-
for (let i = 0; i < c.length; i++) {
|
|
25
|
-
width += c[i].width;
|
|
26
|
-
if (width > availableWidth.value) {
|
|
27
|
-
return i;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return c.length;
|
|
31
|
-
});
|
|
32
|
-
const ChildWrapper = {
|
|
33
|
-
name: "ChildWrapper",
|
|
34
|
-
props: ["index"],
|
|
35
|
-
setup(props, { slots }) {
|
|
36
|
-
const el2 = ref();
|
|
37
|
-
const state = reactive({ width: 0, index: props.index });
|
|
38
|
-
useResizeObserver(el2, (entries) => {
|
|
39
|
-
const width = entries[0].contentRect.width;
|
|
40
|
-
if (!children.value.has(el2.value)) {
|
|
41
|
-
children.value.set(el2.value, state);
|
|
42
|
-
}
|
|
43
|
-
state.width = width;
|
|
44
|
-
});
|
|
45
|
-
onBeforeUnmount(() => {
|
|
46
|
-
children.value.delete(el2.value);
|
|
47
|
-
});
|
|
48
|
-
const visible = computed(() => visibleChildrenCount.value > state.index);
|
|
49
|
-
return () => h("div", { ref: el2, style: { visibility: visible.value ? "visible" : "hidden" } }, slots.default());
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
function ChildrenRender(props, { slots }) {
|
|
53
|
-
const [fragment] = slots.default();
|
|
54
|
-
return fragment.children.map((vnode, index) => h(ChildWrapper, { index }, () => [vnode]));
|
|
55
|
-
}
|
|
56
|
-
function ChildrenSlice(props, { slots }) {
|
|
57
|
-
const [fragment] = slots.default();
|
|
58
|
-
return fragment.children.slice(props.start, props.end);
|
|
59
|
-
}
|
|
60
|
-
return (_ctx, _cache) => {
|
|
61
|
-
const _component_VDropdown = resolveComponent("VDropdown");
|
|
62
|
-
return openBlock(), createElementBlock("div", {
|
|
63
|
-
ref_key: "el",
|
|
64
|
-
ref: el,
|
|
65
|
-
class: "histoire-base-overflow-menu htw-flex htw-overflow-hidden htw-relative"
|
|
66
|
-
}, [
|
|
67
|
-
createVNode(ChildrenRender, null, {
|
|
68
|
-
default: withCtx(() => [
|
|
69
|
-
renderSlot(_ctx.$slots, "default")
|
|
70
|
-
]),
|
|
71
|
-
_: 3
|
|
72
|
-
}),
|
|
73
|
-
visibleChildrenCount.value < children.value.size ? (openBlock(), createBlock(_component_VDropdown, { key: 0 }, {
|
|
74
|
-
popper: withCtx(() => [
|
|
75
|
-
createElementVNode("div", _hoisted_2, [
|
|
76
|
-
createVNode(ChildrenSlice, { start: visibleChildrenCount.value }, {
|
|
77
|
-
default: withCtx(() => [
|
|
78
|
-
renderSlot(_ctx.$slots, "overflow")
|
|
79
|
-
]),
|
|
80
|
-
_: 3
|
|
81
|
-
}, 8, ["start"])
|
|
82
|
-
])
|
|
83
|
-
]),
|
|
84
|
-
default: withCtx(() => [
|
|
85
|
-
createElementVNode("div", _hoisted_1, [
|
|
86
|
-
createVNode(unref(Icon), {
|
|
87
|
-
icon: "carbon:caret-down",
|
|
88
|
-
class: "htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
|
|
89
|
-
})
|
|
90
|
-
])
|
|
91
|
-
]),
|
|
92
|
-
_: 3
|
|
93
|
-
})) : createCommentVNode("", true)
|
|
94
|
-
], 512);
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
export {
|
|
99
|
-
_sfc_main as default
|
|
100
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import _sfc_main from "./BaseOverflowTab.vue2.js";
|
|
2
|
-
import { resolveComponent, createBlock, openBlock, mergeProps, withCtx, createElementVNode, renderSlot, createVNode, Transition, createElementBlock, createCommentVNode } from "@poveste/vendors/vue";
|
|
3
|
-
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
"use strict";
|
|
5
|
-
const _hoisted_1 = ["href", "onClick"];
|
|
6
|
-
const _hoisted_2 = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "htw-absolute htw-top-0 htw-left-0 htw-h-full htw-w-[2px] htw-bg-primary-500 dark:htw-bg-primary-400"
|
|
9
|
-
};
|
|
10
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11
|
-
const _component_router_link = resolveComponent("router-link");
|
|
12
|
-
return openBlock(), createBlock(_component_router_link, mergeProps({ class: "histoire-base-overflow-tab" }, _ctx.$attrs, { custom: "" }), {
|
|
13
|
-
default: withCtx(({ isActive, isExactActive, href, navigate }) => [
|
|
14
|
-
createElementVNode("a", mergeProps(_ctx.$attrs, {
|
|
15
|
-
href,
|
|
16
|
-
class: ["htw-px-4 htw-h-10 htw-min-w-[150px] htw-inline-flex htw-items-center hover:htw-bg-primary-50 dark:hover:htw-bg-primary-900 htw-relative htw-text-gray-900 dark:htw-text-gray-100", {
|
|
17
|
-
"htw-text-primary-500 dark:htw-text-primary-400": _ctx.matched != null ? _ctx.matched : _ctx.exact && isExactActive || !_ctx.exact && isActive
|
|
18
|
-
}],
|
|
19
|
-
onClick: navigate
|
|
20
|
-
}), [
|
|
21
|
-
renderSlot(_ctx.$slots, "default"),
|
|
22
|
-
createVNode(Transition, { name: "__histoire-scale-y" }, {
|
|
23
|
-
default: withCtx(() => [
|
|
24
|
-
(_ctx.matched != null ? _ctx.matched : _ctx.exact && isExactActive || !_ctx.exact && isActive) ? (openBlock(), createElementBlock("div", _hoisted_2)) : createCommentVNode("", true)
|
|
25
|
-
]),
|
|
26
|
-
_: 2
|
|
27
|
-
}, 1024)
|
|
28
|
-
], 16, _hoisted_1)
|
|
29
|
-
]),
|
|
30
|
-
_: 3
|
|
31
|
-
}, 16);
|
|
32
|
-
}
|
|
33
|
-
const BaseOverflowTab = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
34
|
-
export {
|
|
35
|
-
BaseOverflowTab as default
|
|
36
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "@poveste/vendors/vue";
|
|
2
|
-
"use strict";
|
|
3
|
-
const _sfc_main = defineComponent({
|
|
4
|
-
inheritAttrs: false,
|
|
5
|
-
props: {
|
|
6
|
-
exact: {
|
|
7
|
-
type: Boolean,
|
|
8
|
-
default: false
|
|
9
|
-
},
|
|
10
|
-
matched: {
|
|
11
|
-
type: Boolean,
|
|
12
|
-
default: null
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
export {
|
|
17
|
-
_sfc_main as default
|
|
18
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, createBlock, openBlock, unref, withCtx, createElementVNode, createVNode, renderSlot, createTextVNode, toDisplayString, createElementBlock, Fragment, renderList, mergeProps } from "@poveste/vendors/vue";
|
|
2
|
-
import { Icon } from "@poveste/vendors/iconify";
|
|
3
|
-
import { Dropdown } from "@poveste/vendors/floating-vue";
|
|
4
|
-
"use strict";
|
|
5
|
-
const _hoisted_1 = { class: "htw-cursor-pointer htw-w-full htw-outline-none htw-px-2 htw-h-[27px] -htw-my-1 htw-border htw-border-solid htw-border-black/25 dark:htw-border-white/25 hover:htw-border-primary-500 dark:hover:htw-border-primary-500 htw-rounded-sm htw-flex htw-gap-2 htw-items-center htw-leading-normal" };
|
|
6
|
-
const _hoisted_2 = { class: "htw-flex-1 htw-truncate" };
|
|
7
|
-
const _hoisted_3 = { class: "htw-flex htw-flex-col htw-bg-gray-50 dark:htw-bg-gray-700" };
|
|
8
|
-
const _hoisted_4 = ["onClick"];
|
|
9
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
-
__name: "BaseSelect",
|
|
11
|
-
props: {
|
|
12
|
-
modelValue: {},
|
|
13
|
-
options: {}
|
|
14
|
-
},
|
|
15
|
-
emits: ["update:modelValue", "select"],
|
|
16
|
-
setup(__props, { emit: __emit }) {
|
|
17
|
-
const props = __props;
|
|
18
|
-
const emit = __emit;
|
|
19
|
-
const formattedOptions = computed(() => {
|
|
20
|
-
if (Array.isArray(props.options)) {
|
|
21
|
-
return Object.fromEntries(props.options.map((value) => [value, value]));
|
|
22
|
-
}
|
|
23
|
-
return props.options;
|
|
24
|
-
});
|
|
25
|
-
const selectedLabel = computed(() => formattedOptions.value[props.modelValue]);
|
|
26
|
-
function selectValue(value, hide) {
|
|
27
|
-
emit("update:modelValue", value);
|
|
28
|
-
emit("select", value);
|
|
29
|
-
hide();
|
|
30
|
-
}
|
|
31
|
-
return (_ctx, _cache) => {
|
|
32
|
-
return openBlock(), createBlock(unref(Dropdown), {
|
|
33
|
-
class: "histoire-base-select",
|
|
34
|
-
"auto-size": "",
|
|
35
|
-
"auto-boundary-max-size": ""
|
|
36
|
-
}, {
|
|
37
|
-
popper: withCtx(({ hide }) => [
|
|
38
|
-
createElementVNode("div", _hoisted_3, [
|
|
39
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(formattedOptions.value, (label, value) => {
|
|
40
|
-
return openBlock(), createElementBlock("div", mergeProps({ ref_for: true }, { ..._ctx.$attrs, class: null, style: null }, {
|
|
41
|
-
key: label,
|
|
42
|
-
class: ["htw-px-2 htw-py-1 htw-cursor-pointer hover:htw-bg-primary-100 dark:hover:htw-bg-primary-700", {
|
|
43
|
-
"htw-bg-primary-200 dark:htw-bg-primary-800": props.modelValue === value
|
|
44
|
-
}],
|
|
45
|
-
onClick: ($event) => selectValue(value, hide)
|
|
46
|
-
}), [
|
|
47
|
-
renderSlot(_ctx.$slots, "option", {
|
|
48
|
-
label,
|
|
49
|
-
value
|
|
50
|
-
}, () => [
|
|
51
|
-
createTextVNode(toDisplayString(label), 1)
|
|
52
|
-
])
|
|
53
|
-
], 16, _hoisted_4);
|
|
54
|
-
}), 128))
|
|
55
|
-
])
|
|
56
|
-
]),
|
|
57
|
-
default: withCtx(() => [
|
|
58
|
-
createElementVNode("div", _hoisted_1, [
|
|
59
|
-
createElementVNode("div", _hoisted_2, [
|
|
60
|
-
renderSlot(_ctx.$slots, "default", { label: selectedLabel.value }, () => [
|
|
61
|
-
createTextVNode(toDisplayString(selectedLabel.value), 1)
|
|
62
|
-
])
|
|
63
|
-
]),
|
|
64
|
-
createVNode(unref(Icon), {
|
|
65
|
-
icon: "carbon:chevron-sort",
|
|
66
|
-
class: "htw-w-4 htw-h-4 htw-flex-none htw-ml-auto"
|
|
67
|
-
})
|
|
68
|
-
])
|
|
69
|
-
]),
|
|
70
|
-
_: 3
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
export {
|
|
76
|
-
_sfc_main as default
|
|
77
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import _sfc_main from "./BaseSplitPane.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
"use strict";
|
|
5
|
-
const BaseSplitPane = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4f40a1bb"]]);
|
|
6
|
-
export {
|
|
7
|
-
BaseSplitPane as default
|
|
8
|
-
};
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, computed, onUnmounted, createElementBlock, openBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot, withModifiers } from "@poveste/vendors/vue";
|
|
2
|
-
"use strict";
|
|
3
|
-
const SAVE_PREFIX = "__histoire";
|
|
4
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
-
__name: "BaseSplitPane",
|
|
6
|
-
props: {
|
|
7
|
-
orientation: {
|
|
8
|
-
type: String,
|
|
9
|
-
default: "landscape",
|
|
10
|
-
validator: (value) => ["landscape", "portrait"].includes(value)
|
|
11
|
-
},
|
|
12
|
-
defaultSplit: {
|
|
13
|
-
type: Number,
|
|
14
|
-
default: 50
|
|
15
|
-
},
|
|
16
|
-
split: {
|
|
17
|
-
type: Number,
|
|
18
|
-
default: void 0
|
|
19
|
-
},
|
|
20
|
-
min: {
|
|
21
|
-
type: Number,
|
|
22
|
-
default: 20
|
|
23
|
-
},
|
|
24
|
-
max: {
|
|
25
|
-
type: Number,
|
|
26
|
-
default: 80
|
|
27
|
-
},
|
|
28
|
-
draggerOffset: {
|
|
29
|
-
type: String,
|
|
30
|
-
default: "center",
|
|
31
|
-
validator: (value) => ["before", "center", "after"].includes(value)
|
|
32
|
-
},
|
|
33
|
-
saveId: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: null
|
|
36
|
-
},
|
|
37
|
-
fixed: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: false
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
emits: {
|
|
43
|
-
"update:split": (_value) => true
|
|
44
|
-
},
|
|
45
|
-
setup(__props, { emit: __emit }) {
|
|
46
|
-
const props = __props;
|
|
47
|
-
const emit = __emit;
|
|
48
|
-
const currentSplit = ref(props.defaultSplit);
|
|
49
|
-
watch(() => props.split, (value) => {
|
|
50
|
-
if (value !== void 0) {
|
|
51
|
-
currentSplit.value = value;
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
immediate: true
|
|
55
|
-
});
|
|
56
|
-
if (props.saveId) {
|
|
57
|
-
const storageKey = `${SAVE_PREFIX}-split-pane-${props.saveId}`;
|
|
58
|
-
const savedValue = localStorage.getItem(storageKey);
|
|
59
|
-
if (savedValue != null) {
|
|
60
|
-
let parsedValue;
|
|
61
|
-
try {
|
|
62
|
-
parsedValue = JSON.parse(savedValue);
|
|
63
|
-
} catch (e) {
|
|
64
|
-
console.error(e);
|
|
65
|
-
}
|
|
66
|
-
if (typeof parsedValue === "number") {
|
|
67
|
-
currentSplit.value = parsedValue;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
watch(currentSplit, (value) => {
|
|
71
|
-
localStorage.setItem(storageKey, JSON.stringify(value));
|
|
72
|
-
});
|
|
73
|
-
watch(currentSplit, (value) => {
|
|
74
|
-
if (value !== props.split) {
|
|
75
|
-
emit("update:split", value);
|
|
76
|
-
}
|
|
77
|
-
}, {
|
|
78
|
-
immediate: true
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
const boundSplit = computed(() => {
|
|
82
|
-
if (currentSplit.value < props.min) {
|
|
83
|
-
return props.min;
|
|
84
|
-
} else if (currentSplit.value > props.max) {
|
|
85
|
-
return props.max;
|
|
86
|
-
} else {
|
|
87
|
-
return currentSplit.value;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
const leftStyle = computed(() => ({
|
|
91
|
-
[props.orientation === "landscape" ? "width" : "height"]: props.fixed ? `${boundSplit.value}px` : `${boundSplit.value}%`
|
|
92
|
-
}));
|
|
93
|
-
const rightStyle = computed(() => ({
|
|
94
|
-
[props.orientation === "landscape" ? "width" : "height"]: props.fixed ? null : `${100 - boundSplit.value}%`
|
|
95
|
-
}));
|
|
96
|
-
const dragging = ref(false);
|
|
97
|
-
let startPosition = 0;
|
|
98
|
-
let startSplit = 0;
|
|
99
|
-
const el = ref(null);
|
|
100
|
-
function dragStart(e) {
|
|
101
|
-
dragging.value = true;
|
|
102
|
-
startPosition = props.orientation === "landscape" ? e.pageX : e.pageY;
|
|
103
|
-
startSplit = boundSplit.value;
|
|
104
|
-
window.addEventListener("mousemove", dragMove);
|
|
105
|
-
window.addEventListener("mouseup", dragEnd);
|
|
106
|
-
}
|
|
107
|
-
function dragMove(e) {
|
|
108
|
-
if (dragging.value) {
|
|
109
|
-
let position;
|
|
110
|
-
let totalSize;
|
|
111
|
-
if (props.orientation === "landscape") {
|
|
112
|
-
position = e.pageX;
|
|
113
|
-
totalSize = el.value.offsetWidth;
|
|
114
|
-
} else {
|
|
115
|
-
position = e.pageY;
|
|
116
|
-
totalSize = el.value.offsetHeight;
|
|
117
|
-
}
|
|
118
|
-
const dPosition = position - startPosition;
|
|
119
|
-
if (props.fixed) {
|
|
120
|
-
currentSplit.value = startSplit + dPosition;
|
|
121
|
-
} else {
|
|
122
|
-
currentSplit.value = startSplit + ~~(dPosition / totalSize * 200) / 2;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
function dragEnd() {
|
|
127
|
-
dragging.value = false;
|
|
128
|
-
removeDragListeners();
|
|
129
|
-
}
|
|
130
|
-
function removeDragListeners() {
|
|
131
|
-
window.removeEventListener("mousemove", dragMove);
|
|
132
|
-
window.removeEventListener("mouseup", dragEnd);
|
|
133
|
-
}
|
|
134
|
-
onUnmounted(() => {
|
|
135
|
-
removeDragListeners();
|
|
136
|
-
});
|
|
137
|
-
return (_ctx, _cache) => {
|
|
138
|
-
return openBlock(), createElementBlock("div", {
|
|
139
|
-
ref_key: "el",
|
|
140
|
-
ref: el,
|
|
141
|
-
class: normalizeClass(["histoire-base-split-pane htw-flex htw-h-full htw-isolate htw-overflow-auto", {
|
|
142
|
-
"htw-flex-col": __props.orientation === "portrait",
|
|
143
|
-
"htw-cursor-ew-resize": dragging.value && __props.orientation === "landscape",
|
|
144
|
-
"htw-cursor-ns-resize": dragging.value && __props.orientation === "portrait",
|
|
145
|
-
[__props.orientation]: true
|
|
146
|
-
}])
|
|
147
|
-
}, [
|
|
148
|
-
createElementVNode("div", {
|
|
149
|
-
class: normalizeClass(["htw-relative htw-top-0 htw-left-0 htw-z-20", {
|
|
150
|
-
"htw-pointer-events-none": dragging.value,
|
|
151
|
-
"htw-border-r htw-border-gray-300/30 dark:htw-border-gray-800": __props.orientation === "landscape",
|
|
152
|
-
"htw-flex-none": __props.fixed
|
|
153
|
-
}]),
|
|
154
|
-
style: normalizeStyle(leftStyle.value)
|
|
155
|
-
}, [
|
|
156
|
-
renderSlot(_ctx.$slots, "first", {}, void 0, true),
|
|
157
|
-
createElementVNode("div", {
|
|
158
|
-
class: normalizeClass(["dragger htw-absolute htw-z-100 hover:htw-bg-primary-500/50 htw-transition-colors htw-duration-150 htw-delay-150", {
|
|
159
|
-
"htw-top-0 htw-bottom-0 htw-cursor-ew-resize": __props.orientation === "landscape",
|
|
160
|
-
"htw-left-0 htw-right-0 htw-cursor-ns-resize": __props.orientation === "portrait",
|
|
161
|
-
[`dragger-offset-${__props.draggerOffset}`]: true,
|
|
162
|
-
"htw-bg-primary-500/25": dragging.value
|
|
163
|
-
}]),
|
|
164
|
-
onMousedown: withModifiers(dragStart, ["prevent"])
|
|
165
|
-
}, null, 34)
|
|
166
|
-
], 6),
|
|
167
|
-
createElementVNode("div", {
|
|
168
|
-
class: normalizeClass(["htw-relative htw-bottom-0 htw-right-0", {
|
|
169
|
-
"htw-pointer-events-none": dragging.value,
|
|
170
|
-
"htw-border-t htw-border-gray-300/30 dark:htw-border-gray-800": __props.orientation === "portrait",
|
|
171
|
-
"htw-flex-1": __props.fixed
|
|
172
|
-
}]),
|
|
173
|
-
style: normalizeStyle(rightStyle.value)
|
|
174
|
-
}, [
|
|
175
|
-
renderSlot(_ctx.$slots, "last", {}, void 0, true)
|
|
176
|
-
], 6)
|
|
177
|
-
], 2);
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
export {
|
|
182
|
-
_sfc_main as default
|
|
183
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import _sfc_main from "./BaseTab.vue2.js";
|
|
2
|
-
import { resolveComponent, createBlock, openBlock, mergeProps, withCtx, createElementVNode, renderSlot, createVNode, Transition, createElementBlock, createCommentVNode } from "@poveste/vendors/vue";
|
|
3
|
-
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
"use strict";
|
|
5
|
-
const _hoisted_1 = ["href", "onClick"];
|
|
6
|
-
const _hoisted_2 = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "htw-absolute htw-bottom-0 htw-left-0 htw-w-full htw-h-[2px] htw-bg-primary-500 dark:htw-bg-primary-400"
|
|
9
|
-
};
|
|
10
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11
|
-
const _component_router_link = resolveComponent("router-link");
|
|
12
|
-
return openBlock(), createBlock(_component_router_link, mergeProps({ class: "histoire-base-tab" }, _ctx.$attrs, { custom: "" }), {
|
|
13
|
-
default: withCtx(({ isActive, isExactActive, href, navigate }) => [
|
|
14
|
-
createElementVNode("a", mergeProps(_ctx.$attrs, {
|
|
15
|
-
href,
|
|
16
|
-
class: ["htw-px-4 htw-h-full htw-inline-flex htw-items-center hover:htw-bg-primary-50 dark:hover:htw-bg-primary-900 htw-relative htw-text-gray-900 dark:htw-text-gray-100", {
|
|
17
|
-
"htw-text-primary-500 dark:htw-text-primary-400": _ctx.matched != null ? _ctx.matched : _ctx.exact && isExactActive || !_ctx.exact && isActive
|
|
18
|
-
}],
|
|
19
|
-
onClick: navigate
|
|
20
|
-
}), [
|
|
21
|
-
renderSlot(_ctx.$slots, "default"),
|
|
22
|
-
createVNode(Transition, { name: "__histoire-scale-x" }, {
|
|
23
|
-
default: withCtx(() => [
|
|
24
|
-
(_ctx.matched != null ? _ctx.matched : _ctx.exact && isExactActive || !_ctx.exact && isActive) ? (openBlock(), createElementBlock("div", _hoisted_2)) : createCommentVNode("", true)
|
|
25
|
-
]),
|
|
26
|
-
_: 2
|
|
27
|
-
}, 1024)
|
|
28
|
-
], 16, _hoisted_1)
|
|
29
|
-
]),
|
|
30
|
-
_: 3
|
|
31
|
-
}, 16);
|
|
32
|
-
}
|
|
33
|
-
const BaseTab = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
34
|
-
export {
|
|
35
|
-
BaseTab as default
|
|
36
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "@poveste/vendors/vue";
|
|
2
|
-
"use strict";
|
|
3
|
-
const _sfc_main = defineComponent({
|
|
4
|
-
inheritAttrs: false,
|
|
5
|
-
props: {
|
|
6
|
-
exact: {
|
|
7
|
-
type: Boolean,
|
|
8
|
-
default: false
|
|
9
|
-
},
|
|
10
|
-
matched: {
|
|
11
|
-
type: Boolean,
|
|
12
|
-
default: null
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
export {
|
|
17
|
-
_sfc_main as default
|
|
18
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createElementBlock, openBlock, renderSlot } from "@poveste/vendors/vue";
|
|
2
|
-
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
const _sfc_main = {};
|
|
4
|
-
const _hoisted_1 = { class: "histoire-base-tag htw-text-center htw-text-xs htw-mx-1 htw-px-0.5 htw-h-4 htw-uppercase htw-min-w-4 htw-rounded-full htw-bg-primary-500 htw-text-white dark:htw-text-black" };
|
|
5
|
-
function _sfc_render(_ctx, _cache) {
|
|
6
|
-
return openBlock(), createElementBlock("span", _hoisted_1, [
|
|
7
|
-
renderSlot(_ctx.$slots, "default")
|
|
8
|
-
]);
|
|
9
|
-
}
|
|
10
|
-
const BaseTag = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
11
|
-
export {
|
|
12
|
-
BaseTag as default
|
|
13
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { defineComponent, reactive, ref, onMounted, createElementBlock, openBlock, withKeys, withModifiers, createElementVNode, toDisplayString, Fragment, renderList, createBlock, resolveDynamicComponent, createVNode, withCtx, nextTick } from "@poveste/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
|
-
};
|