@poveste/app 0.14.0 → 0.16.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/main.pcss +18 -44
- package/dist/bundled/App.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/bundled/app.css +91 -28
- package/dist/bundled/components/app/AppActions.vue_vue_type_script_setup_true_lang.js +44 -27
- package/dist/bundled/components/app/ShortcutTooltip.js +5 -0
- package/dist/bundled/components/app/ShortcutTooltip.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/bundled/components/app/TopBarChipItem.js +1 -1
- package/dist/bundled/components/base/BaseDropdown.js +6 -0
- package/dist/bundled/components/base/BaseDropdown.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/bundled/components/base/BaseEmpty.js +2 -2
- package/dist/bundled/components/base/BaseOverflowMenu.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/bundled/components/base/BaseSelect.js +1 -0
- package/dist/bundled/components/base/BaseSelect.vue_vue_type_script_setup_true_lang.js +194 -33
- package/dist/bundled/components/base/BaseSplitPane.js +1 -1
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_script_setup_true_lang.js +65 -4
- package/dist/bundled/components/command/PromptSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue_vue_type_script_setup_true_lang.js +24 -16
- package/dist/bundled/components/panel/ControlsComponentProps.vue_vue_type_script_setup_true_lang.js +9 -6
- package/dist/bundled/components/panel/ControlsComponentState.vue_vue_type_script_setup_true_lang.js +9 -6
- package/dist/bundled/components/panel/PaneTabs.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/bundled/components/panel/StatePresets.vue_vue_type_script_setup_true_lang.js +96 -52
- package/dist/bundled/components/panel/StoryEvent.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/bundled/components/panel/StorySidePanel.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/bundled/components/panel/StorySourceCode.js +1 -1
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_script_setup_true_lang.js +24 -18
- package/dist/bundled/components/search/SearchItemContent.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/bundled/components/search/SearchPane.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/bundled/components/story/StoryResponsivePreview.js +1 -1
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js +52 -45
- package/dist/bundled/components/story/StoryVariantGridItem.js +1 -1
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js +22 -20
- package/dist/bundled/components/story/StoryVariantSingle.js +1 -1
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue_vue_type_script_setup_true_lang.js +9 -6
- package/dist/bundled/components/story/StoryView.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue_vue_type_script_setup_true_lang.js +15 -12
- package/dist/bundled/components/toolbar/ToolbarBackground.vue_vue_type_script_setup_true_lang.js +20 -16
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue_vue_type_script_setup_true_lang.js +16 -13
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue_vue_type_script_setup_true_lang.js +35 -24
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue_vue_type_script_setup_true_lang.js +15 -12
- package/dist/bundled/components/toolbar/ToolbarTitle.js +1 -1
- package/dist/bundled/components/toolbar/ToolbarTitle.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/tree/StoryGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/bundled/components/tree/StoryList.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/bundled/components/tree/StoryListFolder.js +1 -1
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/bundled/components/tree/StoryListItem.js +1 -1
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/bundled/index.js +0 -13
- package/dist/bundled/sandbox.js +5 -3
- package/dist/bundled/stores/story.js +2 -2
- package/dist/bundled/util/commands.js +1 -1
- package/dist/bundled/util/dark.js +1 -1
- package/dist/bundled/util/events.js +1 -1
- package/dist/bundled/util/grid-slots.js +1 -1
- package/dist/bundled/util/icons.generated.js +4 -2
- package/dist/bundled/util/keyboard.js +8 -14
- package/dist/bundled/util/mapping.js +2 -2
- package/dist/bundled/util/render-tracker.js +33 -0
- package/dist/bundled/util/scroll.js +26 -5
- package/dist/bundled/util/state.js +105 -5
- package/dist/bundled/util/variant.js +12 -2
- package/dist/style.css +753 -357
- package/package.json +28 -28
- package/src/__tests__/base-select.spec.ts +25 -0
- package/src/__tests__/render-tracker.spec.ts +38 -0
- package/src/__tests__/reset.spec.ts +53 -0
- package/src/__tests__/state-clone.spec.ts +55 -1
- package/src/__tests__/state-types.spec.ts +175 -0
- package/src/app/App.vue +44 -35
- package/src/app/components/app/AppActions.vue +42 -30
- package/src/app/components/app/ShortcutTooltip.vue +29 -0
- package/src/app/components/app/TopBarChipItem.vue +1 -1
- package/src/app/components/base/BaseDropdown.vue +142 -0
- package/src/app/components/base/BaseEmpty.vue +1 -1
- package/src/app/components/base/BaseListItemLink.vue +4 -2
- package/src/app/components/base/BaseOverflowMenu.vue +27 -21
- package/src/app/components/base/BaseSelect.vue +270 -41
- package/src/app/components/base/BaseSplitPane.vue +75 -4
- package/src/app/components/command/PromptSelect.vue +1 -1
- package/src/app/components/panel/ControlsComponentPropItem.vue +29 -17
- package/src/app/components/panel/ControlsComponentProps.vue +7 -5
- package/src/app/components/panel/ControlsComponentState.vue +7 -5
- package/src/app/components/panel/PaneTabs.vue +6 -6
- package/src/app/components/panel/StatePresets.vue +116 -74
- package/src/app/components/panel/StoryEvent.vue +10 -9
- package/src/app/components/panel/StorySidePanel.vue +2 -1
- package/src/app/components/panel/StorySourceCode.vue +51 -44
- package/src/app/components/search/SearchItemContent.vue +2 -1
- package/src/app/components/search/SearchPane.vue +2 -3
- package/src/app/components/story/StoryResponsivePreview.vue +61 -29
- package/src/app/components/story/StoryVariantGridItem.vue +20 -19
- package/src/app/components/story/StoryVariantSingle.vue +1 -0
- package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +14 -8
- package/src/app/components/story/StoryView.vue +4 -1
- package/src/app/components/toolbar/DevOnlyToolbarOpenInEditor.vue +14 -12
- package/src/app/components/toolbar/ToolbarBackground.vue +22 -23
- package/src/app/components/toolbar/ToolbarNewTab.vue +14 -12
- package/src/app/components/toolbar/ToolbarResponsiveSize.vue +31 -25
- package/src/app/components/toolbar/ToolbarTextDirection.vue +14 -10
- package/src/app/components/toolbar/ToolbarTitle.vue +2 -2
- package/src/app/components/tree/StoryGroup.vue +2 -2
- package/src/app/components/tree/StoryList.vue +2 -2
- package/src/app/components/tree/StoryListFolder.vue +2 -2
- package/src/app/components/tree/StoryListItem.vue +1 -1
- package/src/app/index.ts +0 -17
- package/src/app/sandbox.ts +16 -3
- package/src/app/stores/story.ts +2 -2
- package/src/app/style/main.pcss +18 -44
- package/src/app/types.ts +4 -4
- package/src/app/util/commands.ts +1 -1
- package/src/app/util/dark.ts +1 -1
- package/src/app/util/env.ts +0 -1
- package/src/app/util/events.ts +6 -5
- package/src/app/util/grid-slots.ts +1 -1
- package/src/app/util/icons.generated.ts +2 -2
- package/src/app/util/keyboard.ts +7 -11
- package/src/app/util/mapping.ts +2 -2
- package/src/app/util/render-tracker.ts +31 -0
- package/src/app/util/scroll.ts +47 -9
- package/src/app/util/state.ts +141 -8
- package/src/app/util/variant.ts +12 -2
- package/dist/app/style/floating.pcss +0 -40
- package/dist/bundled/util/tooltip.js +0 -14
- package/src/app/style/floating.pcss +0 -40
- package/src/app/util/tooltip.ts +0 -13
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { toPresetState, toRawDeep } from "../../util/state.js";
|
|
2
2
|
import BaseSelect_default from "../base/BaseSelect.js";
|
|
3
|
-
import { onClickOutside, useStorage, useTimeoutFn } from "@poveste/vendors/vue-use";
|
|
4
|
-
import { computed, createBlock,
|
|
3
|
+
import { onClickOutside, useLiveAnnouncer, useStorage, useTimeoutFn } from "@poveste/vendors/vue-use";
|
|
4
|
+
import { computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, isRef, nextTick, normalizeClass, onMounted, openBlock, ref, unref, vModelText, withCtx, withDirectives, withKeys } from "@poveste/vendors/vue";
|
|
5
5
|
import { Icon } from "@poveste/vendors/iconify";
|
|
6
|
+
import { HstTooltip } from "@poveste/controls";
|
|
6
7
|
import { applyState, clone } from "@poveste/shared";
|
|
7
8
|
//#region src/app/components/panel/StatePresets.vue?vue&type=script&setup=true&lang.ts
|
|
8
9
|
var _hoisted_1 = { class: "poveste-state-presets flex gap-2 w-full items-center" };
|
|
9
|
-
var _hoisted_2 =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
var _hoisted_3 = { class: "flex-1 truncate" };
|
|
14
|
-
var _hoisted_4 = { class: "flex gap-2 items-center" };
|
|
15
|
-
var _hoisted_5 = { class: "flex-1 truncate" };
|
|
10
|
+
var _hoisted_2 = ["disabled"];
|
|
11
|
+
var _hoisted_3 = ["disabled"];
|
|
12
|
+
var _hoisted_4 = ["disabled"];
|
|
16
13
|
var DEFAULT_ID = "default";
|
|
17
14
|
var StatePresets_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
18
15
|
__name: "StatePresets",
|
|
@@ -50,6 +47,7 @@ var StatePresets_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
50
47
|
});
|
|
51
48
|
const input = ref();
|
|
52
49
|
const select = ref();
|
|
50
|
+
const picker = ref();
|
|
53
51
|
const canEdit = computed(() => selectedOption.value !== DEFAULT_ID);
|
|
54
52
|
const isEditing = ref(false);
|
|
55
53
|
async function createPreset() {
|
|
@@ -71,6 +69,7 @@ var StatePresets_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
71
69
|
}
|
|
72
70
|
});
|
|
73
71
|
const savedNotif = ref(false);
|
|
72
|
+
const { polite } = useLiveAnnouncer();
|
|
74
73
|
const savedTimeout = useTimeoutFn(() => {
|
|
75
74
|
savedNotif.value = false;
|
|
76
75
|
}, 1e3);
|
|
@@ -81,6 +80,7 @@ var StatePresets_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
81
80
|
preset.state = toPresetState(props.variant.state, omitKeys);
|
|
82
81
|
savedNotif.value = true;
|
|
83
82
|
savedTimeout.start();
|
|
83
|
+
polite("Preset saved");
|
|
84
84
|
}
|
|
85
85
|
function deletePreset(id) {
|
|
86
86
|
if (!confirm("Are you sure you want to delete this preset?")) return;
|
|
@@ -93,64 +93,108 @@ var StatePresets_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
93
93
|
await nextTick();
|
|
94
94
|
input.value?.select();
|
|
95
95
|
}
|
|
96
|
-
function stopEditing() {
|
|
96
|
+
async function stopEditing(refocus = false) {
|
|
97
|
+
if (!isEditing.value) return;
|
|
97
98
|
isEditing.value = false;
|
|
99
|
+
if (refocus) {
|
|
100
|
+
await nextTick();
|
|
101
|
+
picker.value?.focus();
|
|
102
|
+
}
|
|
98
103
|
}
|
|
99
|
-
onClickOutside(select, stopEditing);
|
|
104
|
+
onClickOutside(select, () => stopEditing());
|
|
100
105
|
return (_ctx, _cache) => {
|
|
101
|
-
const _directive_tooltip = resolveDirective("tooltip");
|
|
102
106
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
103
107
|
createElementVNode("div", {
|
|
104
108
|
ref_key: "select",
|
|
105
109
|
ref: select,
|
|
106
110
|
class: "flex-1 min-w-0"
|
|
107
|
-
}, [
|
|
111
|
+
}, [isEditing.value ? withDirectives((openBlock(), createElementBlock("input", {
|
|
112
|
+
key: 0,
|
|
113
|
+
ref_key: "input",
|
|
114
|
+
ref: input,
|
|
115
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => editingLabel.value = $event),
|
|
116
|
+
type: "text",
|
|
117
|
+
"aria-label": "Preset name",
|
|
118
|
+
class: "text-inherit bg-transparent w-full px-2 h-[27px] -my-1 border border-solid border-primary-500 rounded-sm outline-none",
|
|
119
|
+
onKeydown: [_cache[1] || (_cache[1] = withKeys(($event) => stopEditing(true), ["enter"])), _cache[2] || (_cache[2] = withKeys(($event) => stopEditing(true), ["escape"]))]
|
|
120
|
+
}, null, 544)), [[vModelText, editingLabel.value]]) : (openBlock(), createBlock(BaseSelect_default, {
|
|
121
|
+
key: 1,
|
|
122
|
+
ref_key: "picker",
|
|
123
|
+
ref: picker,
|
|
108
124
|
modelValue: unref(selectedOption),
|
|
109
125
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(selectedOption) ? selectedOption.value = $event : null),
|
|
126
|
+
label: "Preset",
|
|
110
127
|
options: presetsOptions.value,
|
|
111
128
|
onDblclick: _cache[4] || (_cache[4] = ($event) => startEditing()),
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}, {
|
|
115
|
-
default: withCtx((
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}, null, 512)), [[vModelText, editingLabel.value]]) : (openBlock(), createElementBlock("div", _hoisted_2, [createElementVNode("span", _hoisted_3, toDisplayString(label), 1), canEdit.value ? withDirectives((openBlock(), createBlock(unref(Icon), {
|
|
124
|
-
key: 0,
|
|
129
|
+
onSelect: _cache[5] || (_cache[5] = (id) => applyPreset(id))
|
|
130
|
+
}, null, 8, ["modelValue", "options"]))], 512),
|
|
131
|
+
createVNode(unref(HstTooltip), { content: canEdit.value ? "Rename this preset" : null }, {
|
|
132
|
+
default: withCtx(() => [createElementVNode("button", {
|
|
133
|
+
type: "button",
|
|
134
|
+
"data-testid": "preset-rename",
|
|
135
|
+
"aria-label": "Rename preset",
|
|
136
|
+
disabled: !canEdit.value,
|
|
137
|
+
class: normalizeClass(["flex-none flex p-0 bg-transparent border-0 cursor-pointer text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400", [canEdit.value ? "opacity-50 hover:opacity-100 focus-visible:opacity-100" : "opacity-25 pointer-events-none"]]),
|
|
138
|
+
onClick: _cache[6] || (_cache[6] = ($event) => startEditing())
|
|
139
|
+
}, [createVNode(unref(Icon), {
|
|
125
140
|
icon: "carbon:edit",
|
|
126
|
-
class: "
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
141
|
+
class: "w-4 h-4"
|
|
142
|
+
})], 10, _hoisted_2)]),
|
|
143
|
+
_: 1
|
|
144
|
+
}, 8, ["content"]),
|
|
145
|
+
createVNode(unref(HstTooltip), { content: canEdit.value ? "Delete this preset" : null }, {
|
|
146
|
+
default: withCtx(() => [createElementVNode("button", {
|
|
147
|
+
type: "button",
|
|
148
|
+
"data-testid": "preset-delete",
|
|
149
|
+
"aria-label": "Delete preset",
|
|
150
|
+
disabled: !canEdit.value,
|
|
151
|
+
class: normalizeClass(["flex-none flex p-0 bg-transparent border-0 cursor-pointer text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400", [canEdit.value ? "opacity-50 hover:opacity-100 focus-visible:opacity-100" : "opacity-25 pointer-events-none"]]),
|
|
152
|
+
onClick: _cache[7] || (_cache[7] = ($event) => deletePreset(unref(selectedOption)))
|
|
153
|
+
}, [createVNode(unref(Icon), {
|
|
131
154
|
icon: "carbon:trash-can",
|
|
132
|
-
class: "
|
|
133
|
-
|
|
134
|
-
|
|
155
|
+
class: "w-4 h-4"
|
|
156
|
+
})], 10, _hoisted_3)]),
|
|
157
|
+
_: 1
|
|
158
|
+
}, 8, ["content"]),
|
|
159
|
+
createVNode(unref(HstTooltip), { content: savedNotif.value ? "Saved!" : canEdit.value ? "Save to preset" : null }, {
|
|
160
|
+
default: withCtx(() => [createElementVNode("button", {
|
|
161
|
+
type: "button",
|
|
162
|
+
"data-testid": "preset-save",
|
|
163
|
+
"aria-label": "Save to preset",
|
|
164
|
+
disabled: !canEdit.value,
|
|
165
|
+
class: normalizeClass(["flex-none flex p-0 bg-transparent border-0 cursor-pointer text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400", [canEdit.value ? "opacity-50 hover:opacity-100 focus-visible:opacity-100" : "opacity-25 pointer-events-none"]]),
|
|
166
|
+
onClick: _cache[8] || (_cache[8] = ($event) => savePreset())
|
|
167
|
+
}, [createVNode(unref(Icon), {
|
|
168
|
+
icon: savedNotif.value ? "carbon:checkmark" : "carbon:save",
|
|
169
|
+
class: "w-4 h-4"
|
|
170
|
+
}, null, 8, ["icon"])], 10, _hoisted_4)]),
|
|
171
|
+
_: 1
|
|
172
|
+
}, 8, ["content"]),
|
|
173
|
+
createVNode(unref(HstTooltip), { content: "Create new preset" }, {
|
|
174
|
+
default: withCtx(() => [createElementVNode("button", {
|
|
175
|
+
type: "button",
|
|
176
|
+
"data-testid": "preset-create",
|
|
177
|
+
"aria-label": "Create new preset",
|
|
178
|
+
class: "flex-none flex p-0 bg-transparent border-0 cursor-pointer text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400 opacity-50 hover:opacity-100 focus-visible:opacity-100",
|
|
179
|
+
onClick: _cache[9] || (_cache[9] = ($event) => createPreset())
|
|
180
|
+
}, [createVNode(unref(Icon), {
|
|
181
|
+
icon: "carbon:add-alt",
|
|
182
|
+
class: "w-4 h-4"
|
|
183
|
+
})])]),
|
|
184
|
+
_: 1
|
|
185
|
+
}),
|
|
186
|
+
createVNode(unref(HstTooltip), { content: "Reset to initial state" }, {
|
|
187
|
+
default: withCtx(() => [createElementVNode("button", {
|
|
188
|
+
type: "button",
|
|
189
|
+
"aria-label": "Reset to initial state",
|
|
190
|
+
class: "flex-none flex p-0 bg-transparent border-0 cursor-pointer text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400 opacity-50 hover:opacity-100 focus-visible:opacity-100",
|
|
191
|
+
onClick: _cache[10] || (_cache[10] = ($event) => resetState())
|
|
192
|
+
}, [createVNode(unref(Icon), {
|
|
193
|
+
icon: "carbon:reset",
|
|
194
|
+
class: "w-4 h-4"
|
|
195
|
+
})])]),
|
|
135
196
|
_: 1
|
|
136
|
-
}
|
|
137
|
-
withDirectives(createVNode(unref(Icon), {
|
|
138
|
-
"data-testid": "preset-save",
|
|
139
|
-
icon: savedNotif.value ? "carbon:checkmark" : "carbon:save",
|
|
140
|
-
class: normalizeClass(["cursor-pointer w-4 h-4 hover:text-primary-500 dark:hover:text-primary-400 text-gray-900 dark:text-gray-100", [canEdit.value ? "opacity-50 hover:opacity-100" : "opacity-25 pointer-events-none"]]),
|
|
141
|
-
onClick: _cache[8] || (_cache[8] = ($event) => savePreset())
|
|
142
|
-
}, null, 8, ["icon", "class"]), [[_directive_tooltip, savedNotif.value ? "Saved!" : canEdit.value ? "Save to preset" : null]]),
|
|
143
|
-
withDirectives(createVNode(unref(Icon), {
|
|
144
|
-
"data-testid": "preset-create",
|
|
145
|
-
icon: "carbon:add-alt",
|
|
146
|
-
class: "cursor-pointer w-4 h-4 hover:text-primary-500 opacity-50 hover:opacity-100 dark:hover:text-primary-400 text-gray-900 dark:text-gray-100",
|
|
147
|
-
onClick: _cache[9] || (_cache[9] = ($event) => createPreset())
|
|
148
|
-
}, null, 512), [[_directive_tooltip, "Create new preset"]]),
|
|
149
|
-
withDirectives(createVNode(unref(Icon), {
|
|
150
|
-
icon: "carbon:reset",
|
|
151
|
-
class: "cursor-pointer w-4 h-4 hover:text-primary-500 opacity-50 hover:opacity-100 dark:hover:text-primary-400 text-gray-900 dark:text-gray-100",
|
|
152
|
-
onClick: _cache[10] || (_cache[10] = ($event) => resetState())
|
|
153
|
-
}, null, 512), [[_directive_tooltip, "Reset to initial state"]])
|
|
197
|
+
})
|
|
154
198
|
]);
|
|
155
199
|
};
|
|
156
200
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import BaseDropdown_default from "../base/BaseDropdown.js";
|
|
2
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, normalizeClass, openBlock, toDisplayString, withCtx } from "@poveste/vendors/vue";
|
|
2
3
|
//#region src/app/components/panel/StoryEvent.vue?vue&type=script&setup=true&lang.ts
|
|
3
4
|
var _hoisted_1 = {
|
|
4
5
|
key: 0,
|
|
@@ -23,13 +24,12 @@ var StoryEvent_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
23
24
|
}
|
|
24
25
|
});
|
|
25
26
|
return (_ctx, _cache) => {
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
return openBlock(), createBlock(BaseDropdown_default, {
|
|
28
|
+
side: "right",
|
|
28
29
|
class: "poveste-story-event group",
|
|
29
|
-
placement: "right",
|
|
30
30
|
"data-testid": "event-item"
|
|
31
31
|
}, {
|
|
32
|
-
default: withCtx(({
|
|
32
|
+
default: withCtx(({ open }) => [createElementVNode("button", { class: normalizeClass(["group-hover:bg-primary-100 dark:group-hover:bg-primary-700 cursor-pointer py-2 px-4 w-full text-left flex items-baseline gap-1 leading-normal", [open ? "bg-primary-50 dark:bg-primary-600" : "group-odd:bg-gray-100/50 dark:group-odd:bg-gray-750/40"]]) }, [createElementVNode("span", { class: normalizeClass({ "text-primary-500": open }) }, toDisplayString(__props.event.name), 3), __props.event.argument ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(formattedArgument.value), 1)) : createCommentVNode("", true)], 2)]),
|
|
33
33
|
popper: withCtx(() => [createElementVNode("div", _hoisted_2, [createElementVNode("pre", _hoisted_3, toDisplayString(__props.event.argument), 1)])]),
|
|
34
34
|
_: 1
|
|
35
35
|
});
|
|
@@ -21,7 +21,7 @@ var StorySidePanel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
21
21
|
const innerOrientation = computed(() => layoutStore.settings.storyOptionsPlacement === "bottom" ? "landscape" : "portrait");
|
|
22
22
|
const route = useRoute();
|
|
23
23
|
const panelContentComponent = computed(() => {
|
|
24
|
-
switch (route.query
|
|
24
|
+
switch (route.query["tab"]) {
|
|
25
25
|
case "docs": return StoryDocs_default;
|
|
26
26
|
case "events": return StoryEvents_default;
|
|
27
27
|
default: return StoryControls_default;
|
|
@@ -43,6 +43,7 @@ var StorySidePanel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
43
43
|
})) : (openBlock(), createBlock(BaseSplitPane_default, {
|
|
44
44
|
key: 2,
|
|
45
45
|
"save-id": `story-sidepane-${innerOrientation.value}`,
|
|
46
|
+
label: "Resize the controls panel",
|
|
46
47
|
orientation: innerOrientation.value,
|
|
47
48
|
class: "poveste-story-side-panel poveste-loaded h-full",
|
|
48
49
|
"data-testid": "story-side-panel"
|
|
@@ -2,6 +2,6 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
|
|
|
2
2
|
import StorySourceCode_vue_vue_type_script_setup_true_lang_default from "./StorySourceCode.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/app/components/panel/StorySourceCode.vue
|
|
5
|
-
var StorySourceCode_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StorySourceCode_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var StorySourceCode_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StorySourceCode_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-e112aa54"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { StorySourceCode_default as default };
|
package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { isDark } from "../../util/dark.js";
|
|
2
2
|
import BaseEmpty_default from "../base/BaseEmpty.js";
|
|
3
3
|
import { getHighlighter } from "../../util/highlighter.js";
|
|
4
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, markRaw, nextTick, normalizeClass, onMounted, openBlock, ref,
|
|
4
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, markRaw, nextTick, normalizeClass, onMounted, openBlock, ref, shallowRef, toDisplayString, unref, watch, watchEffect, withCtx } from "@poveste/vendors/vue";
|
|
5
5
|
import { Icon } from "@poveste/vendors/iconify";
|
|
6
|
+
import { HstCopyIcon, HstTooltip } from "@poveste/controls";
|
|
6
7
|
import { clientSupportPlugins } from "virtual:$poveste-support-plugins-client";
|
|
7
8
|
import { unindent } from "@poveste/shared";
|
|
8
|
-
import { HstCopyIcon } from "@poveste/controls";
|
|
9
9
|
//#region src/app/components/panel/StorySourceCode.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var _hoisted_1 = { class: "poveste-story-source-code bg-gray-50 dark:bg-gray-750 h-full overflow-hidden flex flex-col" };
|
|
11
11
|
var _hoisted_2 = {
|
|
@@ -52,7 +52,7 @@ var StorySourceCode_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
52
52
|
} else dynamicSourceCode.value = await generateSourceCodeFn.value(props.variant);
|
|
53
53
|
} catch (e) {
|
|
54
54
|
console.error(e);
|
|
55
|
-
error.value = e.message;
|
|
55
|
+
error.value = e instanceof Error ? e.message : String(e);
|
|
56
56
|
}
|
|
57
57
|
if (!dynamicSourceCode.value) displayedSource.value = "static";
|
|
58
58
|
}, {
|
|
@@ -86,30 +86,35 @@ var StorySourceCode_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
86
86
|
});
|
|
87
87
|
const scroller = ref();
|
|
88
88
|
function onScroll(event) {
|
|
89
|
-
if (sourceHtml.value) lastScroll = event.target.scrollTop;
|
|
89
|
+
if (sourceHtml.value && event.target instanceof HTMLElement) lastScroll = event.target.scrollTop;
|
|
90
90
|
}
|
|
91
91
|
watch(sourceHtml, async () => {
|
|
92
92
|
await nextTick();
|
|
93
93
|
if (scroller.value) scroller.value.scrollTop = lastScroll;
|
|
94
94
|
});
|
|
95
95
|
return (_ctx, _cache) => {
|
|
96
|
-
const _directive_tooltip = resolveDirective("tooltip");
|
|
97
96
|
return openBlock(), createElementBlock("div", _hoisted_1, [!error.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
98
97
|
_cache[2] || (_cache[2] = createElementVNode("div", { class: "text-gray-900 dark:text-gray-100" }, " Source ", -1)),
|
|
99
98
|
_cache[3] || (_cache[3] = createElementVNode("div", { class: "flex-1" }, null, -1)),
|
|
100
|
-
createElementVNode("div", _hoisted_3, [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
class: normalizeClass(["
|
|
108
|
-
|
|
109
|
-
}, [createVNode(unref(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
99
|
+
createElementVNode("div", _hoisted_3, [createVNode(unref(HstTooltip), { content: !dynamicSourceCode.value ? "Dynamic source code is not available" : displayedSource.value !== "dynamic" ? "Switch to dynamic source" : null }, {
|
|
100
|
+
default: withCtx(() => [createElementVNode("button", {
|
|
101
|
+
class: normalizeClass(["flex items-center gap-1 h-full px-1 bg-gray-500/10 rounded-l transition-all ease-[cubic-bezier(0,1,.6,1)] duration-300 overflow-hidden", [displayedSource.value !== "dynamic" ? "max-w-6 opacity-70" : "max-w-[82px] text-primary-800 dark:text-primary-400", dynamicSourceCode.value ? "cursor-pointer hover:bg-gray-500/30 active:bg-gray-600/50" : displayedSource.value !== "dynamic" && "opacity-50"]]),
|
|
102
|
+
onClick: _cache[0] || (_cache[0] = ($event) => dynamicSourceCode.value && (displayedSource.value = "dynamic"))
|
|
103
|
+
}, [createVNode(unref(Icon), {
|
|
104
|
+
icon: "carbon:flash",
|
|
105
|
+
class: "w-4 h-4 flex-none"
|
|
106
|
+
}), createElementVNode("span", { class: normalizeClass(["transition-opacity duration-300", { "opacity-0": displayedSource.value !== "dynamic" }]) }, " Dynamic ", 2)], 2)]),
|
|
107
|
+
_: 1
|
|
108
|
+
}, 8, ["content"]), createVNode(unref(HstTooltip), { content: !staticSourceCode.value ? "Static source code is not available" : displayedSource.value !== "static" ? "Switch to static source" : null }, {
|
|
109
|
+
default: withCtx(() => [createElementVNode("button", {
|
|
110
|
+
class: normalizeClass(["flex items-center gap-1 h-full px-1 bg-gray-500/10 rounded-r transition-all ease-[cubic-bezier(0,1,.6,1)] duration-300 overflow-hidden", [displayedSource.value !== "static" ? "max-w-6 opacity-70" : "max-w-[63px] text-primary-800 dark:text-primary-400", staticSourceCode.value ? "cursor-pointer hover:bg-gray-500/30 active:bg-gray-600/50" : displayedSource.value !== "static" && "opacity-50"]]),
|
|
111
|
+
onClick: _cache[1] || (_cache[1] = ($event) => staticSourceCode.value && (displayedSource.value = "static"))
|
|
112
|
+
}, [createVNode(unref(Icon), {
|
|
113
|
+
icon: "carbon:document",
|
|
114
|
+
class: "w-4 h-4 flex-none"
|
|
115
|
+
}), createElementVNode("span", { class: normalizeClass(["transition-opacity duration-300", { "opacity-0": displayedSource.value !== "static" }]) }, " Static ", 2)], 2)]),
|
|
116
|
+
_: 1
|
|
117
|
+
}, 8, ["content"])]),
|
|
113
118
|
createVNode(unref(HstCopyIcon), {
|
|
114
119
|
content: displayedSourceCode.value,
|
|
115
120
|
class: "flex-none"
|
|
@@ -126,6 +131,7 @@ var StorySourceCode_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
126
131
|
ref: scroller,
|
|
127
132
|
class: "__poveste-code-placeholder w-full h-full p-4 outline-none bg-transparent resize-none m-0",
|
|
128
133
|
value: displayedSourceCode.value,
|
|
134
|
+
"aria-label": "Source code",
|
|
129
135
|
readonly: "",
|
|
130
136
|
"data-testid": "story-source-code",
|
|
131
137
|
onScroll
|
package/dist/bundled/components/search/SearchItemContent.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -18,7 +18,8 @@ var SearchItemContent_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
18
18
|
setup(__props) {
|
|
19
19
|
const defaultIcons = {
|
|
20
20
|
story: "carbon:cube",
|
|
21
|
-
variant: "carbon:cube"
|
|
21
|
+
variant: "carbon:cube",
|
|
22
|
+
command: "carbon:chevron-right"
|
|
22
23
|
};
|
|
23
24
|
const kindLabels = {
|
|
24
25
|
story: "Story",
|
|
@@ -103,8 +103,7 @@ var SearchPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
105
105
|
case "variant": {
|
|
106
|
-
const
|
|
107
|
-
const story = storyStore.getStoryById(storyId);
|
|
106
|
+
const story = storyStore.getStoryById(idMapData.id.replace(/:.*$/s, ""));
|
|
108
107
|
const variant = storyStore.getVariantById(idMapData.id);
|
|
109
108
|
if (!story || !variant) continue;
|
|
110
109
|
list.push(variantResultFactory(story, variant, rank));
|
|
@@ -2,6 +2,6 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
|
|
|
2
2
|
import StoryResponsivePreview_vue_vue_type_script_setup_true_lang_default from "./StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/app/components/story/StoryResponsivePreview.vue
|
|
5
|
-
var StoryResponsivePreview_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StoryResponsivePreview_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var StoryResponsivePreview_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StoryResponsivePreview_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-a99edb14"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { StoryResponsivePreview_default as default };
|
package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -2,9 +2,9 @@ import { usePreviewSettingsStore } from "../../stores/preview-settings.js";
|
|
|
2
2
|
import CheckerboardPattern_default from "../misc/CheckerboardPattern.js";
|
|
3
3
|
import HatchedPattern_default from "../misc/HatchedPattern.js";
|
|
4
4
|
import { useEventListener } from "@poveste/vendors/vue-use";
|
|
5
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createStaticVNode, createVNode, defineComponent, normalizeClass, onUnmounted, openBlock, ref, renderSlot, unref, useCssVars,
|
|
5
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createStaticVNode, createVNode, defineComponent, normalizeClass, onUnmounted, openBlock, ref, renderSlot, unref, useCssVars, withCtx } from "@poveste/vendors/vue";
|
|
6
6
|
import { Icon } from "@poveste/vendors/iconify";
|
|
7
|
-
import {
|
|
7
|
+
import { HstTooltip } from "@poveste/controls";
|
|
8
8
|
//#region src/app/components/story/StoryResponsivePreview.vue?vue&type=script&setup=true&lang.ts
|
|
9
9
|
var _hoisted_1 = { class: "poveste-story-responsive-preview w-full h-full flex-1 rounded-lg relative overflow-hidden" };
|
|
10
10
|
var _hoisted_2 = {
|
|
@@ -12,7 +12,7 @@ var _hoisted_2 = {
|
|
|
12
12
|
class: "absolute inset-0 w-full h-full bg-gray-100 dark:bg-gray-750 rounded-r-lg border-l-2 border-gray-500/10 dark:border-gray-700/30 overflow-hidden"
|
|
13
13
|
};
|
|
14
14
|
var _hoisted_3 = ["data-testid"];
|
|
15
|
-
var _hoisted_4 = { class: "w-full
|
|
15
|
+
var _hoisted_4 = { class: "w-full flex-1 relative grid" };
|
|
16
16
|
var StoryResponsivePreview_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
17
17
|
__name: "StoryResponsivePreview",
|
|
18
18
|
props: {
|
|
@@ -23,7 +23,7 @@ var StoryResponsivePreview_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
setup(__props) {
|
|
26
|
-
useCssVars((_ctx) => ({ "
|
|
26
|
+
useCssVars((_ctx) => ({ "v4ce71e65": unref(settings).backgroundColor }));
|
|
27
27
|
const props = __props;
|
|
28
28
|
const settings = usePreviewSettingsStore().currentSettings;
|
|
29
29
|
const resizing = ref(false);
|
|
@@ -75,7 +75,9 @@ var StoryResponsivePreview_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
75
75
|
function onTouchStart(event) {
|
|
76
76
|
event.preventDefault();
|
|
77
77
|
event.stopPropagation();
|
|
78
|
-
const
|
|
78
|
+
const [touch] = event.touches;
|
|
79
|
+
if (!touch) return;
|
|
80
|
+
const start = axis === "x" ? touch.clientX : touch.clientY;
|
|
79
81
|
const startValue = startFrom();
|
|
80
82
|
resizing.value = true;
|
|
81
83
|
const removeListeners = [
|
|
@@ -84,7 +86,9 @@ var StoryResponsivePreview_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
84
86
|
addWindowListener("touchcancel", onTouchEnd)
|
|
85
87
|
];
|
|
86
88
|
function onTouchMove(event) {
|
|
87
|
-
const
|
|
89
|
+
const [touch] = event.touches;
|
|
90
|
+
if (!touch) return;
|
|
91
|
+
const delta = (axis === "x" ? touch.clientX : touch.clientY) - start;
|
|
88
92
|
value.value = Math.max(min, Math.min(max, startValue + delta));
|
|
89
93
|
}
|
|
90
94
|
function onTouchEnd() {
|
|
@@ -131,53 +135,56 @@ var StoryResponsivePreview_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
131
135
|
} : "h-full",
|
|
132
136
|
isResponsiveEnabled.value && finalHeight.value ? "overflow-hidden" : "overflow-auto"
|
|
133
137
|
]]) }, [createElementVNode("div", {
|
|
134
|
-
class: normalizeClass(["rounded-lg min-h-full relative", __props.responsive ? "bind-preview-bg" : ""]),
|
|
138
|
+
class: normalizeClass(["rounded-lg min-h-full relative flex flex-col", __props.responsive ? "bind-preview-bg" : ""]),
|
|
135
139
|
"data-testid": __props.responsive ? "responsive-preview-bg" : void 0
|
|
136
140
|
}, [unref(settings).checkerboard && __props.responsive ? (openBlock(), createBlock(CheckerboardPattern_default, {
|
|
137
141
|
key: 0,
|
|
138
142
|
class: "absolute inset-0 w-full h-full text-gray-500/20"
|
|
139
|
-
})) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(["
|
|
143
|
+
})) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(["flex-1 relative flex flex-col", __props.responsive ? "p-8" : ""]) }, [createElementVNode("div", _hoisted_4, [_cache[0] || (_cache[0] = createElementVNode("div", { class: "absolute inset-0" }, null, -1)), renderSlot(_ctx.$slots, "default", {
|
|
140
144
|
isResponsiveEnabled: isResponsiveEnabled.value,
|
|
141
145
|
finalWidth: finalWidth.value,
|
|
142
146
|
finalHeight: finalHeight.value,
|
|
143
147
|
resizing: resizing.value
|
|
144
|
-
}, void 0, true)]), isResponsiveEnabled.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[1] || (_cache[1] = createStaticVNode("<div class=\"absolute top-5 left-8 h-2 w-px bg-gray-400/25\" data-v-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
unref(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
148
|
+
}, void 0, true)]), isResponsiveEnabled.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[1] || (_cache[1] = createStaticVNode("<div class=\"absolute top-5 left-8 h-2 w-px bg-gray-400/25\" data-v-a99edb14></div><div class=\"absolute top-5 right-8 h-2 w-px bg-gray-400/25\" data-v-a99edb14></div><div class=\"absolute bottom-5 left-8 h-2 w-px bg-gray-400/25\" data-v-a99edb14></div><div class=\"absolute bottom-5 right-8 h-2 w-px bg-gray-400/25\" data-v-a99edb14></div><div class=\"absolute left-5 top-8 w-2 h-px bg-gray-400/25\" data-v-a99edb14></div><div class=\"absolute left-5 bottom-8 w-2 h-px bg-gray-400/25\" data-v-a99edb14></div><div class=\"absolute right-5 top-8 w-2 h-px bg-gray-400/25\" data-v-a99edb14></div><div class=\"absolute right-5 bottom-8 w-2 h-px bg-gray-400/25\" data-v-a99edb14></div>", 8))], 64)) : createCommentVNode("", true)], 2)], 10, _hoisted_3), isResponsiveEnabled.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
149
|
+
createVNode(unref(HstTooltip), {
|
|
150
|
+
content: sizeTooltip.value,
|
|
151
|
+
side: "right"
|
|
152
|
+
}, {
|
|
153
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
154
|
+
ref_key: "horizontalDragger",
|
|
155
|
+
ref: horizontalDragger,
|
|
156
|
+
class: "absolute w-4 top-0 bottom-4 right-0 hover:bg-primary-500/30 flex items-center justify-center cursor-ew-resize group hover:text-primary-500"
|
|
157
|
+
}, [createVNode(unref(Icon), {
|
|
158
|
+
icon: "mdi:drag-vertical-variant",
|
|
159
|
+
class: "w-4 h-4 opacity-20 group-hover:opacity-90"
|
|
160
|
+
})], 512)]),
|
|
161
|
+
_: 1
|
|
162
|
+
}, 8, ["content"]),
|
|
163
|
+
createVNode(unref(HstTooltip), {
|
|
164
|
+
content: sizeTooltip.value,
|
|
165
|
+
side: "bottom"
|
|
166
|
+
}, {
|
|
167
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
168
|
+
ref_key: "verticalDragger",
|
|
169
|
+
ref: verticalDragger,
|
|
170
|
+
class: "absolute h-4 left-0 right-4 bottom-0 hover:bg-primary-500/30 flex items-center justify-center cursor-ns-resize group hover:text-primary-500"
|
|
171
|
+
}, [createVNode(unref(Icon), {
|
|
172
|
+
icon: "mdi:drag-horizontal-variant",
|
|
173
|
+
class: "w-4 h-4 opacity-20 group-hover:opacity-90"
|
|
174
|
+
})], 512)]),
|
|
175
|
+
_: 1
|
|
176
|
+
}, 8, ["content"]),
|
|
177
|
+
createVNode(unref(HstTooltip), {
|
|
178
|
+
content: sizeTooltip.value,
|
|
179
|
+
side: "bottom"
|
|
180
|
+
}, {
|
|
181
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
182
|
+
ref_key: "cornerDragger",
|
|
183
|
+
ref: cornerDragger,
|
|
184
|
+
class: "absolute w-4 h-4 right-0 bottom-0 hover:bg-primary-500/30 flex items-center justify-center cursor-nwse-resize group hover:text-primary-500"
|
|
185
|
+
}, null, 512)]),
|
|
186
|
+
_: 1
|
|
187
|
+
}, 8, ["content"])
|
|
181
188
|
], 64)) : createCommentVNode("", true)], 2)], 512)]);
|
|
182
189
|
};
|
|
183
190
|
}
|
|
@@ -2,6 +2,6 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
|
|
|
2
2
|
import StoryVariantGridItem_vue_vue_type_script_setup_true_lang_default from "./StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/app/components/story/StoryVariantGridItem.vue
|
|
5
|
-
var StoryVariantGridItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StoryVariantGridItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var StoryVariantGridItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(StoryVariantGridItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-bfa057e9"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { StoryVariantGridItem_default as default };
|
package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -11,14 +11,14 @@ import { getSourceCode } from "../../util/docs.js";
|
|
|
11
11
|
import CheckerboardPattern_default from "../misc/CheckerboardPattern.js";
|
|
12
12
|
import StoryVariantSinglePreviewRemote_default from "./StoryVariantSinglePreviewRemote.js";
|
|
13
13
|
import { useResizeObserver } from "@poveste/vendors/vue-use";
|
|
14
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, openBlock, ref, resolveComponent,
|
|
14
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, openBlock, ref, resolveComponent, toDisplayString, toRefs, unref, useCssVars, watch, withCtx, withModifiers } from "@poveste/vendors/vue";
|
|
15
15
|
import { Icon } from "@poveste/vendors/iconify";
|
|
16
|
+
import { HstCopyIcon, HstTooltip } from "@poveste/controls";
|
|
16
17
|
import { useRouter } from "@poveste/vendors/vue-router";
|
|
17
|
-
import { HstCopyIcon } from "@poveste/controls";
|
|
18
18
|
//#region src/app/components/story/StoryVariantGridItem.vue?vue&type=script&setup=true&lang.ts
|
|
19
19
|
var _hoisted_1 = { class: "flex-none flex items-center" };
|
|
20
20
|
var _hoisted_2 = { class: "truncate flex-1" };
|
|
21
|
-
var _hoisted_3 = { class: "flex-none ml-auto hidden group-hover:flex items-center" };
|
|
21
|
+
var _hoisted_3 = { class: "flex-none ml-auto hidden group-hover:flex group-focus-within:flex items-center" };
|
|
22
22
|
var StoryVariantGridItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
23
23
|
__name: "StoryVariantGridItem",
|
|
24
24
|
props: {
|
|
@@ -34,8 +34,8 @@ var StoryVariantGridItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE
|
|
|
34
34
|
emits: { resize: (_width, _height) => true },
|
|
35
35
|
setup(__props, { emit: __emit }) {
|
|
36
36
|
useCssVars((_ctx) => ({
|
|
37
|
-
"
|
|
38
|
-
"
|
|
37
|
+
"v1061c03c": unref(variant).iconColor,
|
|
38
|
+
"v2d8b4c49": unref(settings).backgroundColor
|
|
39
39
|
}));
|
|
40
40
|
const props = __props;
|
|
41
41
|
const emit = __emit;
|
|
@@ -76,27 +76,29 @@ var StoryVariantGridItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE
|
|
|
76
76
|
});
|
|
77
77
|
return (_ctx, _cache) => {
|
|
78
78
|
const _component_RouterLink = resolveComponent("RouterLink");
|
|
79
|
-
const _directive_tooltip = resolveDirective("tooltip");
|
|
80
79
|
return openBlock(), createElementBlock("div", {
|
|
81
80
|
ref_key: "el",
|
|
82
81
|
ref: el,
|
|
83
82
|
class: "poveste-story-variant-grid-item cursor-default flex flex-col gap-y-1 group"
|
|
84
|
-
}, [createElementVNode("div", _hoisted_1, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}, {
|
|
91
|
-
default: withCtx(() => [createVNode(unref(Icon), {
|
|
92
|
-
icon: unref(variant).icon ?? "carbon:cube",
|
|
93
|
-
class: normalizeClass(["w-4 h-4 opacity-50", {
|
|
94
|
-
"text-gray-500": !unref(isActive) && !unref(variant).iconColor,
|
|
95
|
-
"bind-icon-color": !unref(isActive) && unref(variant).iconColor
|
|
83
|
+
}, [createElementVNode("div", _hoisted_1, [createVNode(unref(HstTooltip), { content: unref(variant).title }, {
|
|
84
|
+
default: withCtx(() => [createVNode(_component_RouterLink, {
|
|
85
|
+
to: unref(targetRoute),
|
|
86
|
+
class: normalizeClass(["rounded w-max px-2 py-0.5 min-w-16 cursor-pointer flex items-center gap-1 flex-shrink", {
|
|
87
|
+
"hover:bg-gray-200 text-gray-500 dark:hover:bg-gray-800": !unref(isActive),
|
|
88
|
+
"bg-primary-200 hover:bg-primary-300 text-primary-800 dark:bg-primary-700 dark:hover:bg-primary-800 dark:text-primary-200": unref(isActive)
|
|
96
89
|
}])
|
|
97
|
-
},
|
|
90
|
+
}, {
|
|
91
|
+
default: withCtx(() => [createVNode(unref(Icon), {
|
|
92
|
+
icon: unref(variant).icon ?? "carbon:cube",
|
|
93
|
+
class: normalizeClass(["w-4 h-4 opacity-50", {
|
|
94
|
+
"text-gray-500": !unref(isActive) && !unref(variant).iconColor,
|
|
95
|
+
"bind-icon-color": !unref(isActive) && unref(variant).iconColor
|
|
96
|
+
}])
|
|
97
|
+
}, null, 8, ["icon", "class"]), createElementVNode("span", _hoisted_2, toDisplayString(unref(variant).title), 1)]),
|
|
98
|
+
_: 1
|
|
99
|
+
}, 8, ["to", "class"])]),
|
|
98
100
|
_: 1
|
|
99
|
-
}, 8, ["
|
|
101
|
+
}, 8, ["content"]), createElementVNode("div", _hoisted_3, [createVNode(unref(HstCopyIcon), { content: () => unref(getSourceCode)(__props.story, unref(variant)) }, null, 8, ["content"]), createVNode(ToolbarNewTab_default, {
|
|
100
102
|
variant: unref(variant),
|
|
101
103
|
story: __props.story
|
|
102
104
|
}, null, 8, ["variant", "story"])])]), createElementVNode("div", {
|