@poveste/app 0.1.2 → 0.2.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/dist/app/style/floating.pcss +4 -4
- package/dist/app/style/main.pcss +2 -2
- package/dist/app/style/sandbox.css +1 -1
- package/dist/bundle-main.js +2 -0
- package/dist/bundled/App.vue2.js +81 -37
- package/dist/bundled/app.css +51 -46
- package/dist/bundled/components/HomeView.vue2.js +3 -3
- package/dist/bundled/components/app/AppActions.vue.js +5 -0
- package/dist/bundled/components/app/AppActions.vue2.js +76 -0
- package/dist/bundled/components/app/AppHeader.vue2.js +5 -47
- package/dist/bundled/components/app/Breadcrumb.vue.js +1 -1
- package/dist/bundled/components/app/Breadcrumb.vue2.js +9 -9
- package/dist/bundled/components/app/HomeCounter.vue2.js +5 -5
- package/dist/bundled/components/app/InitialLoading.vue2.js +5 -5
- package/dist/bundled/components/app/MobileOverlay.vue2.js +5 -5
- package/dist/bundled/components/app/TopBar.vue.js +5 -0
- package/dist/bundled/components/app/TopBar.vue2.js +73 -0
- package/dist/bundled/components/app/TopBarChip.vue.js +13 -0
- package/dist/bundled/components/app/TopBarChipItem.vue.js +13 -0
- package/dist/bundled/components/base/BaseButton.vue2.js +3 -3
- package/dist/bundled/components/base/BaseCheckbox.vue2.js +8 -8
- package/dist/bundled/components/base/BaseEmpty.vue.js +2 -2
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue2.js +1 -1
- package/dist/bundled/components/base/BaseListItem.vue2.js +2 -2
- package/dist/bundled/components/base/BaseListItemLink.vue.js +2 -2
- package/dist/bundled/components/base/BaseOverflowMenu.vue2.js +4 -4
- package/dist/bundled/components/base/BaseOverflowTab.vue.js +3 -3
- package/dist/bundled/components/base/BaseSelect.vue2.js +6 -6
- package/dist/bundled/components/base/BaseSplitPane.vue.js +1 -1
- package/dist/bundled/components/base/BaseSplitPane.vue2.js +20 -16
- package/dist/bundled/components/base/BaseTab.vue.js +3 -3
- package/dist/bundled/components/base/BaseTag.vue.js +1 -1
- package/dist/bundled/components/command/CommandPrompts.vue2.js +5 -5
- package/dist/bundled/components/command/CommandPromptsModal.vue2.js +3 -3
- package/dist/bundled/components/command/PromptSelect.vue2.js +12 -12
- package/dist/bundled/components/command/PromptText.vue2.js +4 -4
- package/dist/bundled/components/layout/LayoutItem.vue.js +5 -0
- package/dist/bundled/components/layout/LayoutItem.vue2.js +44 -0
- package/dist/bundled/components/layout/LayoutItemGroup.vue.js +5 -0
- package/dist/bundled/components/layout/LayoutItemGroup.vue2.js +25 -0
- package/dist/bundled/components/layout/LayoutModal.vue.js +5 -0
- package/dist/bundled/components/layout/LayoutModal.vue2.js +68 -0
- package/dist/bundled/components/layout/LayoutPane.vue.js +5 -0
- package/dist/bundled/components/layout/LayoutPane.vue2.js +59 -0
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue2.js +2 -2
- package/dist/bundled/components/panel/ControlsComponentProps.vue2.js +4 -4
- package/dist/bundled/components/panel/ControlsComponentState.vue2.js +2 -2
- package/dist/bundled/components/panel/PaneTabs.vue2.js +4 -4
- package/dist/bundled/components/panel/StatePresets.vue2.js +13 -13
- package/dist/bundled/components/panel/StoryControls.vue2.js +6 -6
- package/dist/bundled/components/panel/StoryDocs.vue2.js +4 -4
- package/dist/bundled/components/panel/StoryEvent.vue2.js +7 -7
- package/dist/bundled/components/panel/StoryEvents.vue2.js +1 -1
- package/dist/bundled/components/panel/StorySidePanel.vue2.js +58 -47
- package/dist/bundled/components/panel/StorySourceCode.vue.js +1 -1
- package/dist/bundled/components/panel/StorySourceCode.vue2.js +19 -19
- package/dist/bundled/components/search/SearchItem.vue.js +1 -1
- package/dist/bundled/components/search/SearchItem.vue2.js +3 -3
- package/dist/bundled/components/search/SearchItemContent.vue2.js +9 -9
- package/dist/bundled/components/search/SearchLoading.vue2.js +2 -2
- package/dist/bundled/components/search/SearchModal.vue2.js +3 -3
- package/dist/bundled/components/search/SearchPane.vue2.js +4 -4
- package/dist/bundled/components/story/StoryResponsivePreview.vue.js +1 -1
- package/dist/bundled/components/story/StoryResponsivePreview.vue2.js +21 -21
- package/dist/bundled/components/story/StoryVariantGrid.vue2.js +7 -26
- package/dist/bundled/components/story/StoryVariantGridItem.vue.js +1 -1
- package/dist/bundled/components/story/StoryVariantGridItem.vue2.js +36 -21
- package/dist/bundled/components/story/StoryVariantListItem.vue.js +1 -1
- package/dist/bundled/components/story/StoryVariantListItem.vue2.js +5 -5
- package/dist/bundled/components/story/StoryVariantSingle.vue.js +1 -1
- package/dist/bundled/components/story/StoryVariantSingle.vue2.js +10 -10
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue2.js +6 -5
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue2.js +33 -8
- package/dist/bundled/components/story/StoryVariantSingleView.vue2.js +8 -39
- package/dist/bundled/components/story/StoryView.vue2.js +21 -11
- package/dist/bundled/components/story/StoryViewer.vue.js +1 -1
- package/dist/bundled/components/story/StoryViewer.vue2.js +2 -2
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue2.js +13 -9
- package/dist/bundled/components/toolbar/ToolbarBackground.vue.js +1 -1
- package/dist/bundled/components/toolbar/ToolbarBackground.vue2.js +62 -33
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue2.js +13 -10
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue2.js +14 -14
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue2.js +13 -9
- package/dist/bundled/components/toolbar/ToolbarTitle.vue.js +4 -1
- package/dist/bundled/components/toolbar/ToolbarTitle.vue2.js +30 -7
- package/dist/bundled/components/tree/StoryGroup.vue2.js +5 -5
- package/dist/bundled/components/tree/StoryList.vue2.js +1 -1
- package/dist/bundled/components/tree/StoryListFolder.vue.js +1 -1
- package/dist/bundled/components/tree/StoryListFolder.vue2.js +7 -7
- package/dist/bundled/components/tree/StoryListItem.vue.js +1 -1
- package/dist/bundled/components/tree/StoryListItem.vue2.js +8 -8
- package/dist/bundled/index.js +3 -0
- package/dist/bundled/sandbox.js +41 -15
- package/dist/bundled/stores/layout.js +16 -0
- package/dist/bundled/stores/preview-settings.js +19 -4
- package/dist/bundled/util/color-scheme.js +27 -0
- package/dist/bundled/util/const.js +2 -0
- package/dist/bundled/util/dark.js +3 -3
- package/dist/bundled/util/keyboard.js +60 -32
- package/dist/bundled/util/preview-settings.js +11 -0
- package/dist/bundled/util/tooltip.js +2 -2
- package/dist/style.css +644 -529
- package/package.json +8 -8
- package/src/app/App.vue +109 -66
- package/src/app/components/HomeView.vue +3 -3
- package/src/app/components/app/AppActions.vue +58 -0
- package/src/app/components/app/AppHeader.vue +4 -47
- package/src/app/components/app/Breadcrumb.vue +8 -8
- package/src/app/components/app/HomeCounter.vue +5 -5
- package/src/app/components/app/InitialLoading.vue +5 -5
- package/src/app/components/app/MobileOverlay.vue +5 -5
- package/src/app/components/app/TopBar.vue +60 -0
- package/src/app/components/app/TopBarChip.vue +5 -0
- package/src/app/components/app/TopBarChipItem.vue +7 -0
- package/src/app/components/base/BaseButton.vue +3 -3
- package/src/app/components/base/BaseCheckbox.vue +9 -9
- package/src/app/components/base/BaseCopyIcon.vue +1 -1
- package/src/app/components/base/BaseEmpty.vue +4 -4
- package/src/app/components/base/BaseKeyboardShortcut.vue +1 -1
- package/src/app/components/base/BaseListItem.vue +3 -3
- package/src/app/components/base/BaseListItemLink.vue +3 -3
- package/src/app/components/base/BaseOverflowMenu.vue +4 -4
- package/src/app/components/base/BaseOverflowTab.vue +3 -3
- package/src/app/components/base/BaseSelect.vue +6 -6
- package/src/app/components/base/BaseSplitPane.vue +21 -16
- package/src/app/components/base/BaseTab.vue +3 -3
- package/src/app/components/base/BaseTag.vue +1 -1
- package/src/app/components/command/CommandPrompts.vue +5 -5
- package/src/app/components/command/CommandPromptsModal.vue +3 -3
- package/src/app/components/command/PromptSelect.vue +14 -14
- package/src/app/components/command/PromptText.vue +4 -4
- package/src/app/components/layout/LayoutItem.vue +36 -0
- package/src/app/components/layout/LayoutItemGroup.vue +18 -0
- package/src/app/components/layout/LayoutModal.vue +60 -0
- package/src/app/components/layout/LayoutPane.vue +45 -0
- package/src/app/components/panel/ControlsComponentPropItem.vue +2 -2
- package/src/app/components/panel/ControlsComponentProps.vue +3 -3
- package/src/app/components/panel/ControlsComponentState.vue +2 -2
- package/src/app/components/panel/PaneTabs.vue +4 -4
- package/src/app/components/panel/StatePresets.vue +13 -13
- package/src/app/components/panel/StoryControls.vue +6 -6
- package/src/app/components/panel/StoryDocs.vue +4 -4
- package/src/app/components/panel/StoryEvent.vue +7 -7
- package/src/app/components/panel/StoryEvents.vue +1 -1
- package/src/app/components/panel/StorySidePanel.vue +51 -41
- package/src/app/components/panel/StorySourceCode.vue +19 -19
- package/src/app/components/search/SearchItem.vue +2 -2
- package/src/app/components/search/SearchItemContent.vue +9 -9
- package/src/app/components/search/SearchLoading.vue +2 -2
- package/src/app/components/search/SearchModal.vue +3 -3
- package/src/app/components/search/SearchPane.vue +4 -4
- package/src/app/components/story/StoryResponsivePreview.vue +27 -27
- package/src/app/components/story/StoryVariantGrid.vue +5 -24
- package/src/app/components/story/StoryVariantGridItem.vue +36 -17
- package/src/app/components/story/StoryVariantListItem.vue +4 -4
- package/src/app/components/story/StoryVariantSingle.vue +9 -9
- package/src/app/components/story/StoryVariantSinglePreviewNative.vue +7 -5
- package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +37 -7
- package/src/app/components/story/StoryVariantSingleView.vue +1 -34
- package/src/app/components/story/StoryView.vue +23 -8
- package/src/app/components/story/StoryViewer.vue +1 -1
- package/src/app/components/toolbar/DevOnlyToolbarOpenInEditor.vue +5 -4
- package/src/app/components/toolbar/ToolbarBackground.vue +62 -25
- package/src/app/components/toolbar/ToolbarNewTab.vue +5 -4
- package/src/app/components/toolbar/ToolbarResponsiveSize.vue +15 -15
- package/src/app/components/toolbar/ToolbarTextDirection.vue +5 -4
- package/src/app/components/toolbar/ToolbarTitle.vue +32 -8
- package/src/app/components/tree/StoryGroup.vue +5 -5
- package/src/app/components/tree/StoryList.vue +1 -1
- package/src/app/components/tree/StoryListFolder.vue +6 -6
- package/src/app/components/tree/StoryListItem.vue +6 -6
- package/src/app/index.ts +3 -0
- package/src/app/sandbox.ts +59 -15
- package/src/app/stores/layout.ts +22 -0
- package/src/app/stores/preview-settings.ts +26 -2
- package/src/app/style/floating.pcss +4 -4
- package/src/app/style/main.pcss +2 -2
- package/src/app/style/sandbox.css +1 -1
- package/src/app/types.ts +49 -0
- package/src/app/util/color-scheme.ts +36 -0
- package/src/app/util/const.ts +1 -0
- package/src/app/util/dark.ts +3 -3
- package/src/app/util/keyboard.ts +65 -32
- package/src/app/util/preview-settings.ts +16 -0
- package/src/app/util/tooltip.ts +2 -2
- package/src/bundle-main.js +2 -0
- package/src/shim.d.ts +2 -2
|
@@ -1,43 +1,85 @@
|
|
|
1
|
-
import { defineComponent, useCssVars,
|
|
1
|
+
import { defineComponent, useCssVars, unref, resolveComponent, resolveDirective, createBlock, createCommentVNode, openBlock, withCtx, createElementVNode, createElementBlock, createVNode, Fragment, renderList, normalizeClass, toDisplayString, createTextVNode, normalizeStyle, withDirectives } from "@poveste/vendors/vue";
|
|
2
2
|
import { Icon } from "@poveste/vendors/iconify";
|
|
3
3
|
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
4
4
|
import { povesteConfig } from "../../util/config.js";
|
|
5
|
-
import { getContrastColor } from "../../util/preview-settings.js";
|
|
6
5
|
import "../base/BaseCheckbox.vue.js";
|
|
7
6
|
import _sfc_main$1 from "../base/BaseCheckbox.vue2.js";
|
|
8
7
|
"use strict";
|
|
9
|
-
const _hoisted_1 = { class: "
|
|
10
|
-
const _hoisted_2 = {
|
|
11
|
-
|
|
12
|
-
const _hoisted_4 = {
|
|
13
|
-
class: "htw-flex htw-flex-col htw-items-stretch",
|
|
8
|
+
const _hoisted_1 = { class: "ptw-flex ptw-items-center ptw-gap-1 ptw-px-2.5 ptw-py-1.5 hover:ptw-bg-white/50 dark:hover:ptw-bg-white/10 hover:ptw-text-primary-500 dark:hover:ptw-text-primary-400 ptw-cursor-pointer ptw-text-gray-900 dark:ptw-text-gray-100 ptw-transition-colors ptw-group" };
|
|
9
|
+
const _hoisted_2 = {
|
|
10
|
+
class: "ptw-flex ptw-flex-col ptw-items-stretch",
|
|
14
11
|
"data-test-id": "background-popper"
|
|
15
12
|
};
|
|
13
|
+
const _hoisted_3 = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "ptw-flex ptw-items-stretch ptw-gap-1 ptw-px-2 ptw-pt-2",
|
|
16
|
+
"data-test-id": "sandbox-color-scheme"
|
|
17
|
+
};
|
|
18
|
+
const _hoisted_4 = ["data-test-id", "onClick"];
|
|
16
19
|
const _hoisted_5 = ["onClick"];
|
|
17
|
-
const _hoisted_6 = { class: "
|
|
18
|
-
const _hoisted_7 = { class: "
|
|
20
|
+
const _hoisted_6 = { class: "ptw-mr-auto" };
|
|
21
|
+
const _hoisted_7 = { class: "ptw-ml-auto ptw-opacity-70" };
|
|
19
22
|
const _hoisted_8 = { key: 0 };
|
|
20
23
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
21
24
|
__name: "ToolbarBackground",
|
|
22
25
|
setup(__props) {
|
|
23
26
|
useCssVars((_ctx) => ({
|
|
24
|
-
"
|
|
25
|
-
"
|
|
27
|
+
"v2708c2ed": unref(settings).backgroundColor,
|
|
28
|
+
"v4a6df57e": _ctx.contrastColor
|
|
26
29
|
}));
|
|
27
|
-
const
|
|
28
|
-
const
|
|
30
|
+
const previewSettings = usePreviewSettingsStore();
|
|
31
|
+
const settings = previewSettings.currentSettings;
|
|
32
|
+
const colorSchemeOptions = [
|
|
33
|
+
{ value: "auto", label: "System", icon: "carbon:screen" },
|
|
34
|
+
{ value: "light", label: "Light", icon: "carbon:sun" },
|
|
35
|
+
{ value: "dark", label: "Dark", icon: "carbon:moon" }
|
|
36
|
+
];
|
|
37
|
+
const showColorScheme = !povesteConfig.theme.hideColorSchemeSwitch;
|
|
38
|
+
const showDropdown = showColorScheme || !!povesteConfig.backgroundPresets.length;
|
|
29
39
|
return (_ctx, _cache) => {
|
|
30
40
|
const _component_VDropdown = resolveComponent("VDropdown");
|
|
31
41
|
const _directive_tooltip = resolveDirective("tooltip");
|
|
32
|
-
return unref(
|
|
42
|
+
return unref(showDropdown) ? (openBlock(), createBlock(_component_VDropdown, {
|
|
33
43
|
key: 0,
|
|
34
44
|
placement: "bottom-end",
|
|
35
45
|
skidding: 6,
|
|
36
|
-
class: "poveste-toolbar-background
|
|
46
|
+
class: "poveste-toolbar-background ptw-flex-none",
|
|
37
47
|
"data-test-id": "toolbar-background"
|
|
38
48
|
}, {
|
|
49
|
+
default: withCtx(({ shown }) => [
|
|
50
|
+
withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
|
|
51
|
+
createVNode(unref(Icon), {
|
|
52
|
+
icon: "carbon:color-palette",
|
|
53
|
+
class: "ptw-w-4 ptw-h-4"
|
|
54
|
+
}),
|
|
55
|
+
createVNode(unref(Icon), {
|
|
56
|
+
icon: "carbon:chevron-down",
|
|
57
|
+
class: "ptw-w-3 ptw-h-3 ptw-opacity-40 group-hover:ptw-opacity-70"
|
|
58
|
+
})
|
|
59
|
+
])), [
|
|
60
|
+
[_directive_tooltip, shown ? "" : "Preview appearance"]
|
|
61
|
+
])
|
|
62
|
+
]),
|
|
39
63
|
popper: withCtx(({ hide }) => [
|
|
40
|
-
createElementVNode("div",
|
|
64
|
+
createElementVNode("div", _hoisted_2, [
|
|
65
|
+
showColorScheme ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
66
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(colorSchemeOptions, (option) => {
|
|
67
|
+
return createElementVNode("button", {
|
|
68
|
+
key: option.value,
|
|
69
|
+
"data-test-id": `sandbox-color-scheme-${option.value}`,
|
|
70
|
+
class: normalizeClass(["ptw-flex-1 ptw-px-3 ptw-py-1.5 ptw-rounded ptw-flex ptw-items-center ptw-justify-center ptw-gap-1.5 ptw-cursor-pointer ptw-text-sm", [
|
|
71
|
+
unref(settings).colorScheme === option.value ? "ptw-bg-primary-500 hover:ptw-bg-primary-600 ptw-text-white dark:ptw-text-black" : "ptw-bg-transparent hover:ptw-bg-primary-100 dark:hover:ptw-bg-primary-700"
|
|
72
|
+
]]),
|
|
73
|
+
onClick: ($event) => unref(settings).colorScheme = option.value
|
|
74
|
+
}, [
|
|
75
|
+
createVNode(unref(Icon), {
|
|
76
|
+
icon: option.icon,
|
|
77
|
+
class: "ptw-w-4 ptw-h-4"
|
|
78
|
+
}, null, 8, ["icon"]),
|
|
79
|
+
createElementVNode("span", null, toDisplayString(option.label), 1)
|
|
80
|
+
], 10, _hoisted_4);
|
|
81
|
+
}), 64))
|
|
82
|
+
])) : createCommentVNode("", true),
|
|
41
83
|
createVNode(_sfc_main$1, {
|
|
42
84
|
modelValue: unref(settings).checkerboard,
|
|
43
85
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(settings).checkerboard = $event)
|
|
@@ -50,11 +92,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
92
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(povesteConfig).backgroundPresets, (option, index) => {
|
|
51
93
|
return openBlock(), createElementBlock("button", {
|
|
52
94
|
key: index,
|
|
53
|
-
class: normalizeClass(["
|
|
54
|
-
unref(settings).backgroundColor === option.color ? "
|
|
95
|
+
class: normalizeClass(["ptw-px-4 ptw-py-3 ptw-cursor-pointer ptw-text-left ptw-flex ptw-items-baseline ptw-gap-4", [
|
|
96
|
+
unref(settings).backgroundColor === option.color ? "ptw-bg-primary-500 hover:ptw-bg-primary-600 ptw-text-white dark:ptw-text-black" : "ptw-bg-transparent hover:ptw-bg-primary-100 dark:hover:ptw-bg-primary-700"
|
|
55
97
|
]]),
|
|
56
98
|
onClick: ($event) => {
|
|
57
|
-
unref(
|
|
99
|
+
unref(previewSettings).setBackgroundColor(option.color);
|
|
58
100
|
hide();
|
|
59
101
|
}
|
|
60
102
|
}, [
|
|
@@ -62,7 +104,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
104
|
option.color !== "$checkerboard" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
63
105
|
createElementVNode("span", _hoisted_7, toDisplayString(option.color), 1),
|
|
64
106
|
createElementVNode("div", {
|
|
65
|
-
class: "
|
|
107
|
+
class: "ptw-w-4 ptw-h-4 ptw-rounded-full ptw-border ptw-border-black/20 dark:ptw-border-white/20 ptw-flex ptw-items-center ptw-justify-center ptw-text-xs",
|
|
66
108
|
style: normalizeStyle({
|
|
67
109
|
backgroundColor: option.color,
|
|
68
110
|
color: option.contrastColor
|
|
@@ -75,19 +117,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
75
117
|
}), 128))
|
|
76
118
|
])
|
|
77
119
|
]),
|
|
78
|
-
default: withCtx(() => [
|
|
79
|
-
withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
|
|
80
|
-
createElementVNode("div", _hoisted_2, [
|
|
81
|
-
contrastColor.value ? (openBlock(), createElementBlock("span", _hoisted_3, "a")) : createCommentVNode("", true)
|
|
82
|
-
]),
|
|
83
|
-
createVNode(unref(Icon), {
|
|
84
|
-
icon: "carbon:caret-down",
|
|
85
|
-
class: "htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
|
|
86
|
-
})
|
|
87
|
-
])), [
|
|
88
|
-
[_directive_tooltip, "Background color"]
|
|
89
|
-
])
|
|
90
|
-
]),
|
|
91
120
|
_: 1
|
|
92
121
|
})) : createCommentVNode("", true);
|
|
93
122
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent, computed, resolveDirective, withDirectives,
|
|
1
|
+
import { defineComponent, computed, resolveDirective, withDirectives, createBlock, openBlock, withCtx, createVNode, unref } from "@poveste/vendors/vue";
|
|
2
2
|
import { Icon } from "@poveste/vendors/iconify";
|
|
3
3
|
import { getSandboxUrl } from "../../util/sandbox.js";
|
|
4
|
+
import TopBarChipItem from "../app/TopBarChipItem.vue.js";
|
|
4
5
|
"use strict";
|
|
5
|
-
const _hoisted_1 = ["href"];
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "ToolbarNewTab",
|
|
8
8
|
props: {
|
|
@@ -16,16 +16,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
16
16
|
});
|
|
17
17
|
return (_ctx, _cache) => {
|
|
18
18
|
const _directive_tooltip = resolveDirective("tooltip");
|
|
19
|
-
return withDirectives((openBlock(),
|
|
19
|
+
return withDirectives((openBlock(), createBlock(TopBarChipItem, {
|
|
20
20
|
href: sandboxUrl.value,
|
|
21
21
|
target: "_blank",
|
|
22
|
-
class: "poveste-toolbar-new-tab
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
class: "poveste-toolbar-new-tab"
|
|
23
|
+
}, {
|
|
24
|
+
default: withCtx(() => [
|
|
25
|
+
createVNode(unref(Icon), {
|
|
26
|
+
icon: "carbon:launch",
|
|
27
|
+
class: "ptw-w-4 ptw-h-4"
|
|
28
|
+
})
|
|
29
|
+
]),
|
|
30
|
+
_: 1
|
|
31
|
+
}, 8, ["href"])), [
|
|
29
32
|
[_directive_tooltip, "Open variant in new tab"]
|
|
30
33
|
]);
|
|
31
34
|
};
|
|
@@ -5,10 +5,10 @@ import { povesteConfig } from "../../util/config.js";
|
|
|
5
5
|
import "../base/BaseCheckbox.vue.js";
|
|
6
6
|
import _sfc_main$1 from "../base/BaseCheckbox.vue2.js";
|
|
7
7
|
"use strict";
|
|
8
|
-
const _hoisted_1 = { class: "
|
|
9
|
-
const _hoisted_2 = { class: "
|
|
8
|
+
const _hoisted_1 = { class: "ptw-flex ptw-flex-col ptw-items-stretch" };
|
|
9
|
+
const _hoisted_2 = { class: "ptw-flex ptw-items-center ptw-gap-2 ptw-px-4 ptw-py-3" };
|
|
10
10
|
const _hoisted_3 = ["onClick"];
|
|
11
|
-
const _hoisted_4 = { class: "
|
|
11
|
+
const _hoisted_4 = { class: "ptw-ml-auto ptw-opacity-70 ptw-flex ptw-gap-1" };
|
|
12
12
|
const _hoisted_5 = { key: 0 };
|
|
13
13
|
const _hoisted_6 = { key: 0 };
|
|
14
14
|
const _hoisted_7 = { key: 1 };
|
|
@@ -25,7 +25,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
25
|
placement: "bottom-end",
|
|
26
26
|
skidding: 6,
|
|
27
27
|
disabled: !unref(povesteConfig).responsivePresets?.length,
|
|
28
|
-
class: "poveste-toolbar-responsive-size
|
|
28
|
+
class: "poveste-toolbar-responsive-size ptw-flex-none"
|
|
29
29
|
}, {
|
|
30
30
|
popper: withCtx(({ hide }) => [
|
|
31
31
|
createElementVNode("div", _hoisted_1, [
|
|
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
withDirectives(createElementVNode("input", {
|
|
43
43
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(settings).responsiveWidth = $event),
|
|
44
44
|
type: "number",
|
|
45
|
-
class: "
|
|
45
|
+
class: "ptw-bg-transparent ptw-border ptw-border-gray-200 dark:ptw-border-gray-850 ptw-rounded ptw-w-20 ptw-opacity-50 focus:ptw-opacity-100 ptw-flex-1 ptw-min-w-0",
|
|
46
46
|
step: "16",
|
|
47
47
|
placeholder: "Auto"
|
|
48
48
|
}, null, 512), [
|
|
@@ -54,11 +54,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
54
54
|
],
|
|
55
55
|
[_directive_tooltip, "Responsive width (px)"]
|
|
56
56
|
]),
|
|
57
|
-
_cache[4] || (_cache[4] = createElementVNode("span", { class: "
|
|
57
|
+
_cache[4] || (_cache[4] = createElementVNode("span", { class: "ptw-opacity-50" }, "×", -1)),
|
|
58
58
|
withDirectives(createElementVNode("input", {
|
|
59
59
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(settings).responsiveHeight = $event),
|
|
60
60
|
type: "number",
|
|
61
|
-
class: "
|
|
61
|
+
class: "ptw-bg-transparent ptw-border ptw-border-gray-200 dark:ptw-border-gray-850 ptw-rounded ptw-w-20 ptw-opacity-50 focus:ptw-opacity-100 ptw-flex-1 ptw-min-w-0",
|
|
62
62
|
step: "16",
|
|
63
63
|
placeholder: "Auto"
|
|
64
64
|
}, null, 512), [
|
|
@@ -74,8 +74,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
74
74
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(povesteConfig).responsivePresets, (preset, index) => {
|
|
75
75
|
return openBlock(), createElementBlock("button", {
|
|
76
76
|
key: index,
|
|
77
|
-
class: normalizeClass(["
|
|
78
|
-
unref(settings).responsiveWidth === preset.width && unref(settings).responsiveHeight === preset.height ? "
|
|
77
|
+
class: normalizeClass(["ptw-px-4 ptw-py-3 ptw-cursor-pointer ptw-text-left ptw-flex ptw-gap-4", [
|
|
78
|
+
unref(settings).responsiveWidth === preset.width && unref(settings).responsiveHeight === preset.height ? "ptw-bg-primary-500 hover:ptw-bg-primary-600 ptw-text-white dark:ptw-text-black" : "ptw-bg-transparent hover:ptw-bg-primary-100 dark:hover:ptw-bg-primary-700"
|
|
79
79
|
]]),
|
|
80
80
|
onClick: ($event) => {
|
|
81
81
|
unref(settings).responsiveWidth = preset.width;
|
|
@@ -101,17 +101,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
101
101
|
]),
|
|
102
102
|
default: withCtx(() => [
|
|
103
103
|
withDirectives((openBlock(), createElementBlock("div", {
|
|
104
|
-
class: normalizeClass(["
|
|
105
|
-
"
|
|
104
|
+
class: normalizeClass(["ptw-flex ptw-items-center ptw-gap-1 ptw-px-2.5 ptw-py-1.5 ptw-text-gray-900 dark:ptw-text-gray-100 ptw-transition-colors ptw-group", {
|
|
105
|
+
"hover:ptw-bg-white/50 dark:hover:ptw-bg-white/10 hover:ptw-text-primary-500 dark:hover:ptw-text-primary-400 ptw-cursor-pointer": unref(povesteConfig).responsivePresets?.length
|
|
106
106
|
}])
|
|
107
107
|
}, [
|
|
108
108
|
createVNode(unref(Icon), {
|
|
109
109
|
icon: "carbon:devices",
|
|
110
|
-
class: "
|
|
110
|
+
class: "ptw-w-4 ptw-h-4"
|
|
111
111
|
}),
|
|
112
112
|
createVNode(unref(Icon), {
|
|
113
|
-
icon: "carbon:
|
|
114
|
-
class: "
|
|
113
|
+
icon: "carbon:chevron-down",
|
|
114
|
+
class: "ptw-w-3 ptw-h-3 ptw-opacity-40 group-hover:ptw-opacity-70"
|
|
115
115
|
})
|
|
116
116
|
], 2)), [
|
|
117
117
|
[_directive_tooltip, "Responsive sizes"]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent, resolveDirective, withDirectives,
|
|
1
|
+
import { defineComponent, resolveDirective, withDirectives, openBlock, createBlock, unref, withCtx, createVNode } from "@poveste/vendors/vue";
|
|
2
2
|
import { Icon } from "@poveste/vendors/iconify";
|
|
3
3
|
import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
4
|
+
import TopBarChipItem from "../app/TopBarChipItem.vue.js";
|
|
4
5
|
"use strict";
|
|
5
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
7
|
__name: "ToolbarTextDirection",
|
|
@@ -8,15 +9,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8
9
|
const settings = usePreviewSettingsStore().currentSettings;
|
|
9
10
|
return (_ctx, _cache) => {
|
|
10
11
|
const _directive_tooltip = resolveDirective("tooltip");
|
|
11
|
-
return withDirectives((openBlock(),
|
|
12
|
-
class: "poveste-toolbar-text-direction
|
|
12
|
+
return withDirectives((openBlock(), createBlock(TopBarChipItem, {
|
|
13
|
+
class: "poveste-toolbar-text-direction",
|
|
13
14
|
onClick: _cache[0] || (_cache[0] = ($event) => unref(settings).textDirection = unref(settings).textDirection === "ltr" ? "rtl" : "ltr")
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
}, {
|
|
16
|
+
default: withCtx(() => [
|
|
17
|
+
createVNode(unref(Icon), {
|
|
18
|
+
icon: unref(settings).textDirection === "ltr" ? "fluent:text-paragraph-direction-right-16-regular" : "fluent:text-paragraph-direction-left-16-regular",
|
|
19
|
+
class: "ptw-w-4 ptw-h-4"
|
|
20
|
+
}, null, 8, ["icon"])
|
|
21
|
+
]),
|
|
22
|
+
_: 1
|
|
23
|
+
})), [
|
|
20
24
|
[_directive_tooltip, `Switch to text direction ${unref(settings).textDirection === "ltr" ? "Right to Left" : "Left to Right"}`]
|
|
21
25
|
]);
|
|
22
26
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _sfc_main from "./ToolbarTitle.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
4
|
"use strict";
|
|
5
|
+
const ToolbarTitle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ced59894"]]);
|
|
3
6
|
export {
|
|
4
|
-
|
|
7
|
+
ToolbarTitle as default
|
|
5
8
|
};
|
|
@@ -1,22 +1,45 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, createVNode, createElementVNode, unref, normalizeClass, toDisplayString } from "@poveste/vendors/vue";
|
|
1
|
+
import { defineComponent, useCssVars, computed, createElementBlock, openBlock, createVNode, createElementVNode, unref, normalizeClass, createCommentVNode, toDisplayString } from "@poveste/vendors/vue";
|
|
2
2
|
import { Icon } from "@poveste/vendors/iconify";
|
|
3
3
|
"use strict";
|
|
4
|
-
const _hoisted_1 = { class: "poveste-toolbar-title
|
|
4
|
+
const _hoisted_1 = { class: "poveste-toolbar-title ptw-flex ptw-items-center ptw-gap-2 ptw-min-w-0" };
|
|
5
|
+
const _hoisted_2 = { class: "ptw-flex ptw-flex-col ptw-justify-center ptw-min-w-0 ptw-leading-tight ptw-text-center ptw-h-[2.25rem]" };
|
|
6
|
+
const _hoisted_3 = { class: "ptw-truncate ptw-text-sm ptw-font-medium ptw-text-gray-900 dark:ptw-text-gray-100" };
|
|
7
|
+
const _hoisted_4 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "ptw-truncate ptw-text-xs ptw-text-gray-500 dark:ptw-text-gray-400"
|
|
10
|
+
};
|
|
5
11
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
12
|
__name: "ToolbarTitle",
|
|
7
13
|
props: {
|
|
8
|
-
variant: {}
|
|
14
|
+
variant: {},
|
|
15
|
+
story: {}
|
|
9
16
|
},
|
|
10
17
|
setup(__props) {
|
|
18
|
+
useCssVars((_ctx) => ({
|
|
19
|
+
"b13fe2b2": iconColor.value
|
|
20
|
+
}));
|
|
21
|
+
const props = __props;
|
|
22
|
+
const icon = computed(() => props.variant?.icon ?? props.story?.icon ?? "carbon:cube");
|
|
23
|
+
const iconColor = computed(() => props.variant?.iconColor ?? props.story?.iconColor);
|
|
24
|
+
const title = computed(() => props.variant?.title ?? props.story?.title ?? "");
|
|
25
|
+
const subtitle = computed(() => {
|
|
26
|
+
if (props.variant && props.story && props.story.title !== props.variant.title) {
|
|
27
|
+
return props.story.title;
|
|
28
|
+
}
|
|
29
|
+
return void 0;
|
|
30
|
+
});
|
|
11
31
|
return (_ctx, _cache) => {
|
|
12
32
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
13
33
|
createVNode(unref(Icon), {
|
|
14
|
-
icon:
|
|
15
|
-
class: normalizeClass(["
|
|
16
|
-
|
|
34
|
+
icon: icon.value,
|
|
35
|
+
class: normalizeClass(["ptw-w-4 ptw-h-4 ptw-flex-none", [
|
|
36
|
+
iconColor.value ? "bind-icon-color" : "ptw-text-gray-500 dark:ptw-text-gray-400"
|
|
17
37
|
]])
|
|
18
38
|
}, null, 8, ["icon", "class"]),
|
|
19
|
-
createElementVNode("
|
|
39
|
+
createElementVNode("div", _hoisted_2, [
|
|
40
|
+
createElementVNode("span", _hoisted_3, toDisplayString(title.value), 1),
|
|
41
|
+
subtitle.value ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(subtitle.value), 1)) : createCommentVNode("", true)
|
|
42
|
+
])
|
|
20
43
|
]);
|
|
21
44
|
};
|
|
22
45
|
}
|
|
@@ -6,9 +6,9 @@ import StoryListItem from "./StoryListItem.vue.js";
|
|
|
6
6
|
"use strict";
|
|
7
7
|
const _hoisted_1 = {
|
|
8
8
|
"data-test-id": "story-group",
|
|
9
|
-
class: "poveste-story-group
|
|
9
|
+
class: "poveste-story-group ptw-my-2 first:ptw-mt-0 last:ptw-mb-0 ptw-group"
|
|
10
10
|
};
|
|
11
|
-
const _hoisted_2 = { class: "
|
|
11
|
+
const _hoisted_2 = { class: "ptw-truncate" };
|
|
12
12
|
const _hoisted_3 = { key: 1 };
|
|
13
13
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
14
|
__name: "StoryGroup",
|
|
@@ -28,11 +28,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
28
28
|
return (_ctx, _cache) => {
|
|
29
29
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
30
30
|
__props.group.title ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
31
|
-
_cache[0] || (_cache[0] = createElementVNode("div", { class: "
|
|
31
|
+
_cache[0] || (_cache[0] = createElementVNode("div", { class: "ptw-h-[1px] ptw-bg-gray-500/10 ptw-mx-6 ptw-mb-2 group-first:ptw-hidden" }, null, -1)),
|
|
32
32
|
createElementVNode("div", {
|
|
33
33
|
role: "button",
|
|
34
34
|
tabindex: "0",
|
|
35
|
-
class: "
|
|
35
|
+
class: "ptw-px-0.5 ptw-py-2 md:ptw-py-1.5 ptw-mx-1 ptw-rounded-sm hover:ptw-bg-primary-100 dark:hover:ptw-bg-primary-900 ptw-cursor-pointer ptw-select-none ptw-flex ptw-items-center ptw-gap-2 ptw-min-w-0 ptw-opacity-50 hover:ptw-opacity-100",
|
|
36
36
|
onClick: toggleOpen,
|
|
37
37
|
onKeyup: [
|
|
38
38
|
withKeys(toggleOpen, ["enter"]),
|
|
@@ -41,7 +41,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
41
|
}, [
|
|
42
42
|
createVNode(unref(Icon), {
|
|
43
43
|
icon: isFolderOpen.value ? "ri:subtract-line" : "ri:add-line",
|
|
44
|
-
class: "
|
|
44
|
+
class: "ptw-w-4 ptw-h-4 ptw-ml-4 ptw-rounded-sm ptw-border ptw-border-gray-500/40"
|
|
45
45
|
}, null, 8, ["icon"]),
|
|
46
46
|
createElementVNode("span", _hoisted_2, toDisplayString(__props.group.title), 1)
|
|
47
47
|
], 32)
|
|
@@ -4,7 +4,7 @@ import StoryListFolder from "./StoryListFolder.vue.js";
|
|
|
4
4
|
import StoryListItem from "./StoryListItem.vue.js";
|
|
5
5
|
import _sfc_main$1 from "./StoryGroup.vue2.js";
|
|
6
6
|
"use strict";
|
|
7
|
-
const _hoisted_1 = { class: "poveste-story-list
|
|
7
|
+
const _hoisted_1 = { class: "poveste-story-list ptw-overflow-y-auto" };
|
|
8
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
9
|
__name: "StoryList",
|
|
10
10
|
props: {
|
|
@@ -2,7 +2,7 @@ import _sfc_main from "./StoryListFolder.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
"use strict";
|
|
5
|
-
const StoryListFolder = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const StoryListFolder = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5a91a083"]]);
|
|
6
6
|
export {
|
|
7
7
|
StoryListFolder as default
|
|
8
8
|
};
|
|
@@ -7,9 +7,9 @@ const _hoisted_1 = {
|
|
|
7
7
|
"data-test-id": "story-list-folder",
|
|
8
8
|
class: "poveste-story-list-folder"
|
|
9
9
|
};
|
|
10
|
-
const _hoisted_2 = { class: "bind-tree-padding
|
|
11
|
-
const _hoisted_3 = { class: "
|
|
12
|
-
const _hoisted_4 = { class: "
|
|
10
|
+
const _hoisted_2 = { class: "bind-tree-padding ptw-flex ptw-items-center ptw-gap-2 ptw-min-w-0" };
|
|
11
|
+
const _hoisted_3 = { class: "ptw-flex ptw-flex-none ptw-items-center ptw-opacity-30 [.poveste-story-list-folder-button:hover_&]:ptw-opacity-100 ptw-ml-4 ptw-w-4 ptw-h-4 ptw-rounded-sm ptw-border ptw-border-gray-500/40" };
|
|
12
|
+
const _hoisted_4 = { class: "ptw-truncate" };
|
|
13
13
|
const _hoisted_5 = { key: 0 };
|
|
14
14
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
15
|
__name: "StoryListFolder",
|
|
@@ -21,7 +21,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21
21
|
},
|
|
22
22
|
setup(__props) {
|
|
23
23
|
useCssVars((_ctx) => ({
|
|
24
|
-
"
|
|
24
|
+
"v32f93782": folderPadding.value
|
|
25
25
|
}));
|
|
26
26
|
const props = __props;
|
|
27
27
|
const folderStore = useFolderStore();
|
|
@@ -39,7 +39,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
39
39
|
createElementVNode("div", {
|
|
40
40
|
role: "button",
|
|
41
41
|
tabindex: "0",
|
|
42
|
-
class: "poveste-story-list-folder-button
|
|
42
|
+
class: "poveste-story-list-folder-button ptw-px-0.5 ptw-py-2 md:ptw-py-1.5 ptw-mx-1 ptw-rounded-sm hover:ptw-bg-primary-100 dark:hover:ptw-bg-primary-900 ptw-cursor-pointer ptw-select-none ptw-flex",
|
|
43
43
|
onClick: toggleOpen,
|
|
44
44
|
onKeyup: [
|
|
45
45
|
withKeys(toggleOpen, ["enter"]),
|
|
@@ -50,8 +50,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
50
|
createElementVNode("span", _hoisted_3, [
|
|
51
51
|
createVNode(unref(Icon), {
|
|
52
52
|
icon: "carbon:caret-right",
|
|
53
|
-
class: normalizeClass(["
|
|
54
|
-
"
|
|
53
|
+
class: normalizeClass(["ptw-w-full ptw-h-full ptw-transition-transform ptw-duration-150", {
|
|
54
|
+
"ptw-rotate-90": isFolderOpen.value
|
|
55
55
|
}])
|
|
56
56
|
}, null, 8, ["class"])
|
|
57
57
|
]),
|
|
@@ -2,7 +2,7 @@ import _sfc_main from "./StoryListItem.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
"use strict";
|
|
5
|
-
const StoryListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const StoryListItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8b5cda46"]]);
|
|
6
6
|
export {
|
|
7
7
|
StoryListItem as default
|
|
8
8
|
};
|
|
@@ -4,11 +4,11 @@ import { useRoute } from "@poveste/vendors/vue-router";
|
|
|
4
4
|
import { useScrollOnActive } from "../../util/scroll.js";
|
|
5
5
|
import BaseListItemLink from "../base/BaseListItemLink.vue.js";
|
|
6
6
|
"use strict";
|
|
7
|
-
const _hoisted_1 = { class: "bind-tree-margin
|
|
8
|
-
const _hoisted_2 = { class: "
|
|
7
|
+
const _hoisted_1 = { class: "bind-tree-margin ptw-flex ptw-items-center ptw-gap-2 ptw-pl-4 ptw-min-w-0" };
|
|
8
|
+
const _hoisted_2 = { class: "ptw-truncate" };
|
|
9
9
|
const _hoisted_3 = {
|
|
10
10
|
key: 0,
|
|
11
|
-
class: "
|
|
11
|
+
class: "ptw-opacity-40 ptw-text-sm"
|
|
12
12
|
};
|
|
13
13
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
14
|
__name: "StoryListItem",
|
|
@@ -18,8 +18,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18
18
|
},
|
|
19
19
|
setup(__props) {
|
|
20
20
|
useCssVars((_ctx) => ({
|
|
21
|
-
"
|
|
22
|
-
"
|
|
21
|
+
"v09275fa8": filePadding.value,
|
|
22
|
+
"v8627d038": _ctx.story.iconColor
|
|
23
23
|
}));
|
|
24
24
|
const props = __props;
|
|
25
25
|
const filePadding = computed(() => {
|
|
@@ -43,14 +43,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
43
43
|
storyId: __props.story.id
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
class: "
|
|
46
|
+
class: "ptw-pl-0.5 ptw-pr-2 ptw-py-2 md:ptw-py-1.5 ptw-mx-1 ptw-rounded-sm"
|
|
47
47
|
}, {
|
|
48
48
|
default: withCtx(({ active }) => [
|
|
49
49
|
createElementVNode("span", _hoisted_1, [
|
|
50
50
|
createVNode(unref(Icon), {
|
|
51
51
|
icon: __props.story.icon ?? "carbon:cube",
|
|
52
|
-
class: normalizeClass(["
|
|
53
|
-
"
|
|
52
|
+
class: normalizeClass(["ptw-w-5 ptw-h-5 sm:ptw-w-4 sm:ptw-h-4 ptw-flex-none", {
|
|
53
|
+
"ptw-text-primary-500": !active && !__props.story.iconColor,
|
|
54
54
|
"bind-icon-color": !active && __props.story.iconColor
|
|
55
55
|
}])
|
|
56
56
|
}, null, 8, ["icon", "class"]),
|
package/dist/bundled/index.js
CHANGED
|
@@ -11,6 +11,9 @@ async function mountMainApp() {
|
|
|
11
11
|
const app = createApp(_sfc_main);
|
|
12
12
|
app.use(createPinia());
|
|
13
13
|
app.use(FloatingVue, {
|
|
14
|
+
// Anchor poppers inside the chrome scope so the @scope-wrapped chrome CSS
|
|
15
|
+
// reaches them. The default <body> teleport target is outside the scope.
|
|
16
|
+
container: ".poveste-app-root",
|
|
14
17
|
overflowPadding: 4,
|
|
15
18
|
arrowPadding: 8,
|
|
16
19
|
themes: {
|
package/dist/bundled/sandbox.js
CHANGED
|
@@ -1,22 +1,41 @@
|
|
|
1
1
|
import { applyState } from "@poveste/shared";
|
|
2
|
+
import { usePreferredDark } from "@poveste/vendors/vue-use";
|
|
2
3
|
import { createPinia } from "@poveste/vendors/pinia";
|
|
3
4
|
import { files } from "virtual:$poveste-stories";
|
|
4
|
-
import { ref,
|
|
5
|
+
import { ref, computed, watch, createApp, h, onMounted } from "@poveste/vendors/vue";
|
|
5
6
|
import { parseQuery } from "@poveste/vendors/vue-router";
|
|
6
7
|
import "./components/story/GenericMountStory.vue.js";
|
|
7
8
|
import "./components/story/GenericRenderStory.vue.js";
|
|
8
9
|
import { setupPluginApi } from "./plugin.js";
|
|
10
|
+
import { resolvePreviewDark } from "./util/color-scheme.js";
|
|
9
11
|
import { povesteConfig } from "./util/config.js";
|
|
10
|
-
import { SANDBOX_READY, STATE_SYNC, PREVIEW_SETTINGS_SYNC } from "./util/const.js";
|
|
12
|
+
import { SANDBOX_READY, STATE_SYNC, PREVIEW_SETTINGS_SYNC, SANDBOX_HEIGHT } from "./util/const.js";
|
|
11
13
|
import { isDark } from "./util/dark.js";
|
|
12
14
|
import { mapFile } from "./util/mapping.js";
|
|
13
|
-
import { applyPreviewSettings } from "./util/preview-settings.js";
|
|
15
|
+
import { loadStoredPreviewSettings, applyPreviewSettings, receivedSettings } from "./util/preview-settings.js";
|
|
14
16
|
import { toRawDeep } from "./util/state.js";
|
|
15
17
|
import _sfc_main from "./components/story/GenericMountStory.vue2.js";
|
|
16
18
|
import _sfc_main$1 from "./components/story/GenericRenderStory.vue2.js";
|
|
17
19
|
"use strict";
|
|
18
20
|
const query = parseQuery(window.location.search);
|
|
19
21
|
const file = ref(mapFile(files.find((f) => f.id === query.storyId)));
|
|
22
|
+
const storedSettings = loadStoredPreviewSettings();
|
|
23
|
+
if (storedSettings) {
|
|
24
|
+
applyPreviewSettings(storedSettings);
|
|
25
|
+
}
|
|
26
|
+
const prefersDark = usePreferredDark();
|
|
27
|
+
const previewDark = computed(() => resolvePreviewDark(receivedSettings.colorScheme, prefersDark.value, isDark.value));
|
|
28
|
+
watch(previewDark, (value) => {
|
|
29
|
+
if (value) {
|
|
30
|
+
document.documentElement.classList.add(povesteConfig.sandboxDarkClass);
|
|
31
|
+
document.documentElement.classList.add(povesteConfig.theme.darkClass);
|
|
32
|
+
} else {
|
|
33
|
+
document.documentElement.classList.remove(povesteConfig.sandboxDarkClass);
|
|
34
|
+
document.documentElement.classList.remove(povesteConfig.theme.darkClass);
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
immediate: true
|
|
38
|
+
});
|
|
20
39
|
const app = createApp({
|
|
21
40
|
name: "SandboxApp",
|
|
22
41
|
setup() {
|
|
@@ -55,7 +74,7 @@ const app = createApp({
|
|
|
55
74
|
},
|
|
56
75
|
render() {
|
|
57
76
|
return [
|
|
58
|
-
h("div", { class: "
|
|
77
|
+
h("div", { class: "ptw-sandbox-hidden" }, [
|
|
59
78
|
h(_sfc_main, {
|
|
60
79
|
key: file.value.story.id,
|
|
61
80
|
story: file.value.story
|
|
@@ -71,17 +90,24 @@ const app = createApp({
|
|
|
71
90
|
});
|
|
72
91
|
app.use(createPinia());
|
|
73
92
|
app.mount("#app");
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
93
|
+
document.body.classList.add("__poveste-render-story", "__poveste-render-custom-controls");
|
|
94
|
+
let pendingFrame = null;
|
|
95
|
+
let lastReportedHeight = -1;
|
|
96
|
+
function reportHeight() {
|
|
97
|
+
pendingFrame = null;
|
|
98
|
+
const renderRoot = document.querySelector(".__poveste-render-story");
|
|
99
|
+
const h2 = renderRoot ? Math.ceil(renderRoot.getBoundingClientRect().height) : Math.ceil(document.body.scrollHeight);
|
|
100
|
+
if (h2 === lastReportedHeight) return;
|
|
101
|
+
lastReportedHeight = h2;
|
|
102
|
+
window.parent?.postMessage({ type: SANDBOX_HEIGHT, h: h2 }, window.location.origin);
|
|
103
|
+
}
|
|
104
|
+
function scheduleReport() {
|
|
105
|
+
if (pendingFrame !== null) return;
|
|
106
|
+
pendingFrame = requestAnimationFrame(reportHeight);
|
|
107
|
+
}
|
|
108
|
+
const ro = new ResizeObserver(scheduleReport);
|
|
109
|
+
ro.observe(document.body);
|
|
110
|
+
requestAnimationFrame(scheduleReport);
|
|
85
111
|
if (import.meta.hot) {
|
|
86
112
|
/* @__PURE__ */ setupPluginApi();
|
|
87
113
|
}
|