@poveste/app 0.15.0 → 0.16.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/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 +80 -17
- 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/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/BaseOverflowMenu.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/bundled/components/base/BaseSelect.js +1 -0
- package/dist/bundled/components/base/BaseSelect.vue_vue_type_script_setup_true_lang.js +80 -51
- 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/panel/ControlsComponentPropItem.vue_vue_type_script_setup_true_lang.js +15 -13
- 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/StatePresets.vue_vue_type_script_setup_true_lang.js +69 -54
- 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 +1 -0
- package/dist/bundled/components/panel/StorySourceCode.js +1 -1
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_script_setup_true_lang.js +21 -16
- package/dist/bundled/components/story/StoryResponsivePreview.js +1 -1
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js +46 -43
- package/dist/bundled/components/story/StoryVariantGridItem.js +1 -1
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js +21 -19
- 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/StoryView.vue_vue_type_script_setup_true_lang.js +1 -0
- 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/index.js +0 -13
- package/dist/bundled/sandbox.js +2 -1
- package/dist/bundled/util/icons.generated.js +4 -2
- package/dist/bundled/util/scroll.js +26 -5
- package/dist/bundled/util/state.js +105 -5
- package/dist/style.css +731 -357
- package/package.json +19 -15
- package/src/__tests__/base-select.spec.ts +25 -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 +43 -34
- package/src/app/components/app/AppActions.vue +42 -30
- package/src/app/components/app/ShortcutTooltip.vue +29 -0
- package/src/app/components/base/BaseDropdown.vue +142 -0
- package/src/app/components/base/BaseOverflowMenu.vue +10 -5
- package/src/app/components/base/BaseSelect.vue +133 -60
- package/src/app/components/base/BaseSplitPane.vue +73 -2
- package/src/app/components/panel/ControlsComponentPropItem.vue +18 -17
- package/src/app/components/panel/ControlsComponentProps.vue +7 -5
- package/src/app/components/panel/ControlsComponentState.vue +7 -5
- package/src/app/components/panel/StatePresets.vue +82 -76
- package/src/app/components/panel/StoryEvent.vue +10 -9
- package/src/app/components/panel/StorySidePanel.vue +1 -0
- package/src/app/components/panel/StorySourceCode.vue +47 -41
- package/src/app/components/story/StoryResponsivePreview.vue +55 -27
- package/src/app/components/story/StoryVariantGridItem.vue +19 -18
- package/src/app/components/story/StoryVariantSingle.vue +1 -0
- package/src/app/components/story/StoryView.vue +1 -0
- 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/index.ts +0 -17
- package/src/app/sandbox.ts +8 -1
- package/src/app/style/main.pcss +18 -44
- package/src/app/util/icons.generated.ts +2 -2
- package/src/app/util/scroll.ts +47 -9
- package/src/app/util/state.ts +139 -6
- 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,7 +1,7 @@
|
|
|
1
1
|
import { refAutoReset } from "@poveste/vendors/vue-use";
|
|
2
|
-
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useId, withCtx, withModifiers } from "@poveste/vendors/vue";
|
|
2
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, normalizeClass, onMounted, openBlock, ref, renderList, renderSlot, shallowRef, toDisplayString, unref, useId, watch, withCtx, withModifiers } from "@poveste/vendors/vue";
|
|
3
3
|
import { Icon } from "@poveste/vendors/iconify";
|
|
4
|
-
import {
|
|
4
|
+
import { PopoverAnchor, PopoverContent, PopoverPortal, PopoverRoot, portalTarget } from "@poveste/controls";
|
|
5
5
|
//#region src/app/components/base/BaseSelect.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var _hoisted_1 = [
|
|
7
7
|
"aria-label",
|
|
@@ -131,59 +131,88 @@ var BaseSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
131
131
|
case "Tab": choose(activeIndex.value);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
+
const target = shallowRef();
|
|
135
|
+
onMounted(() => {
|
|
136
|
+
target.value = portalTarget();
|
|
137
|
+
});
|
|
138
|
+
function keepOpenOnTheTrigger(event) {
|
|
139
|
+
if (combobox.value?.contains(event.target)) event.preventDefault();
|
|
140
|
+
}
|
|
141
|
+
watch([open, activeIndex], async ([isOpen, index]) => {
|
|
142
|
+
if (!isOpen || index < 0) return;
|
|
143
|
+
await nextTick();
|
|
144
|
+
target.value?.ownerDocument.getElementById(optionId(index))?.scrollIntoView({ block: "nearest" });
|
|
145
|
+
});
|
|
134
146
|
__expose({ focus: () => combobox.value?.focus() });
|
|
135
147
|
return (_ctx, _cache) => {
|
|
136
|
-
return openBlock(), createBlock(unref(
|
|
137
|
-
|
|
138
|
-
"onUpdate:
|
|
139
|
-
class: "poveste-base-select",
|
|
140
|
-
triggers: [],
|
|
141
|
-
"no-auto-focus": "",
|
|
142
|
-
"auto-size": "",
|
|
143
|
-
"auto-boundary-max-size": ""
|
|
148
|
+
return openBlock(), createBlock(unref(PopoverRoot), {
|
|
149
|
+
open: open.value,
|
|
150
|
+
"onUpdate:open": _cache[4] || (_cache[4] = ($event) => open.value = $event)
|
|
144
151
|
}, {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
"aria-
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
152
|
+
default: withCtx(() => [createVNode(unref(PopoverAnchor), {
|
|
153
|
+
"as-child": "",
|
|
154
|
+
class: "poveste-base-select"
|
|
155
|
+
}, {
|
|
156
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
157
|
+
ref_key: "combobox",
|
|
158
|
+
ref: combobox,
|
|
159
|
+
role: "combobox",
|
|
160
|
+
tabindex: "0",
|
|
161
|
+
"aria-label": __props.label,
|
|
162
|
+
"aria-haspopup": "listbox",
|
|
163
|
+
"aria-expanded": open.value,
|
|
164
|
+
"aria-controls": open.value ? listboxId : void 0,
|
|
165
|
+
"aria-activedescendant": open.value && activeIndex.value >= 0 ? optionId(activeIndex.value) : void 0,
|
|
166
|
+
class: "cursor-pointer w-full outline-none focus-visible:border-primary-500 px-2 h-[27px] -my-1 border border-solid border-black/25 dark:border-white/25 hover:border-primary-500 dark:hover:border-primary-500 rounded-sm flex gap-2 items-center leading-normal",
|
|
167
|
+
onClick: _cache[0] || (_cache[0] = ($event) => open.value ? close() : openList()),
|
|
168
|
+
onKeydown
|
|
169
|
+
}, [createElementVNode("div", _hoisted_2, [renderSlot(_ctx.$slots, "default", { label: selectedLabel.value }, () => [createTextVNode(toDisplayString(selectedLabel.value), 1)])]), createVNode(unref(Icon), {
|
|
170
|
+
icon: "carbon:chevron-sort",
|
|
171
|
+
class: "w-4 h-4 flex-none ml-auto"
|
|
172
|
+
})], 40, _hoisted_1)]),
|
|
173
|
+
_: 3
|
|
174
|
+
}), target.value ? (openBlock(), createBlock(unref(PopoverPortal), {
|
|
175
|
+
key: 0,
|
|
176
|
+
to: target.value
|
|
177
|
+
}, {
|
|
178
|
+
default: withCtx(() => [createVNode(unref(PopoverContent), {
|
|
179
|
+
class: "poveste-base-select-popper",
|
|
180
|
+
align: "start",
|
|
181
|
+
"side-offset": 6,
|
|
182
|
+
"collision-padding": 8,
|
|
183
|
+
onOpenAutoFocus: _cache[2] || (_cache[2] = withModifiers(() => {}, ["prevent"])),
|
|
184
|
+
onCloseAutoFocus: _cache[3] || (_cache[3] = withModifiers(() => {}, ["prevent"])),
|
|
185
|
+
onInteractOutside: keepOpenOnTheTrigger
|
|
186
|
+
}, {
|
|
187
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
188
|
+
id: listboxId,
|
|
189
|
+
role: "listbox",
|
|
190
|
+
"aria-label": __props.label,
|
|
191
|
+
class: "poveste-base-select-options flex flex-col bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-gray-100"
|
|
192
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(entries.value, ([value, optionLabel], index) => {
|
|
193
|
+
return openBlock(), createElementBlock("div", {
|
|
194
|
+
id: optionId(index),
|
|
195
|
+
key: value,
|
|
196
|
+
role: "option",
|
|
197
|
+
"aria-selected": value === __props.modelValue,
|
|
198
|
+
class: normalizeClass(["px-2 py-1 cursor-pointer hover:bg-primary-100 dark:hover:bg-primary-700", {
|
|
199
|
+
"bg-primary-200 dark:bg-primary-800": value === __props.modelValue,
|
|
200
|
+
"outline outline-2 -outline-offset-2 outline-primary-500": index === activeIndex.value
|
|
201
|
+
}]),
|
|
202
|
+
onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {}, ["prevent"])),
|
|
203
|
+
onMousemove: ($event) => activeIndex.value = index,
|
|
204
|
+
onClick: ($event) => choose(index)
|
|
205
|
+
}, [renderSlot(_ctx.$slots, "option", {
|
|
206
|
+
label: optionLabel,
|
|
207
|
+
value
|
|
208
|
+
}, () => [createTextVNode(toDisplayString(optionLabel), 1)])], 42, _hoisted_4);
|
|
209
|
+
}), 128))], 8, _hoisted_3)]),
|
|
210
|
+
_: 3
|
|
211
|
+
})]),
|
|
212
|
+
_: 3
|
|
213
|
+
}, 8, ["to"])) : createCommentVNode("", true)]),
|
|
185
214
|
_: 3
|
|
186
|
-
}, 8, ["
|
|
215
|
+
}, 8, ["open"]);
|
|
187
216
|
};
|
|
188
217
|
}
|
|
189
218
|
});
|
|
@@ -2,6 +2,6 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
|
|
|
2
2
|
import BaseSplitPane_vue_vue_type_script_setup_true_lang_default from "./BaseSplitPane.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/app/components/base/BaseSplitPane.vue
|
|
5
|
-
var BaseSplitPane_default = /*#__PURE__*/ _plugin_vue_export_helper_default(BaseSplitPane_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var BaseSplitPane_default = /*#__PURE__*/ _plugin_vue_export_helper_default(BaseSplitPane_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-c01bd041"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { BaseSplitPane_default as default };
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import { computed, createCommentVNode, createElementBlock, defineComponent, normalizeClass, normalizeStyle, onUnmounted, openBlock, ref, renderSlot, watch, withModifiers } from "@poveste/vendors/vue";
|
|
1
|
+
import { computed, createCommentVNode, createElementBlock, defineComponent, normalizeClass, normalizeStyle, onUnmounted, openBlock, ref, renderSlot, unref, useId, watch, withModifiers } from "@poveste/vendors/vue";
|
|
2
2
|
//#region src/app/components/base/BaseSplitPane.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var _hoisted_1 = ["id"];
|
|
4
|
+
var _hoisted_2 = [
|
|
5
|
+
"aria-label",
|
|
6
|
+
"aria-orientation",
|
|
7
|
+
"aria-controls",
|
|
8
|
+
"aria-valuenow",
|
|
9
|
+
"aria-valuemin",
|
|
10
|
+
"aria-valuemax"
|
|
11
|
+
];
|
|
3
12
|
var SAVE_PREFIX = "__poveste";
|
|
13
|
+
var STEP = 1;
|
|
14
|
+
var PAGE_STEP = 10;
|
|
4
15
|
var BaseSplitPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
16
|
__name: "BaseSplitPane",
|
|
6
17
|
props: {
|
|
@@ -47,6 +58,16 @@ var BaseSplitPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
47
58
|
default: true
|
|
48
59
|
},
|
|
49
60
|
/**
|
|
61
|
+
* What the divider is called to a screen reader.
|
|
62
|
+
*
|
|
63
|
+
* Four are on screen at once and they resize different things, so a shared
|
|
64
|
+
* default would announce four identical separators.
|
|
65
|
+
*/
|
|
66
|
+
label: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: "Resize panels"
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
50
71
|
* Whether the first pane exists at all.
|
|
51
72
|
*
|
|
52
73
|
* Dropping it here rather than at the call site keeps the other slot at one
|
|
@@ -149,6 +170,36 @@ var BaseSplitPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
149
170
|
watch(hasBothPanes, (both) => {
|
|
150
171
|
if (!both && dragging.value) dragEnd();
|
|
151
172
|
});
|
|
173
|
+
function moveBy(amount) {
|
|
174
|
+
currentSplit.value = Math.min(props.max, Math.max(props.min, boundSplit.value + amount));
|
|
175
|
+
}
|
|
176
|
+
function onKeydown(event) {
|
|
177
|
+
const back = props.orientation === "landscape" ? "ArrowLeft" : "ArrowUp";
|
|
178
|
+
const forward = props.orientation === "landscape" ? "ArrowRight" : "ArrowDown";
|
|
179
|
+
switch (event.key) {
|
|
180
|
+
case back:
|
|
181
|
+
moveBy(-STEP);
|
|
182
|
+
break;
|
|
183
|
+
case forward:
|
|
184
|
+
moveBy(STEP);
|
|
185
|
+
break;
|
|
186
|
+
case "PageUp":
|
|
187
|
+
moveBy(-PAGE_STEP);
|
|
188
|
+
break;
|
|
189
|
+
case "PageDown":
|
|
190
|
+
moveBy(PAGE_STEP);
|
|
191
|
+
break;
|
|
192
|
+
case "Home":
|
|
193
|
+
currentSplit.value = props.min;
|
|
194
|
+
break;
|
|
195
|
+
case "End":
|
|
196
|
+
currentSplit.value = props.max;
|
|
197
|
+
break;
|
|
198
|
+
default: return;
|
|
199
|
+
}
|
|
200
|
+
event.preventDefault();
|
|
201
|
+
}
|
|
202
|
+
const firstPaneId = useId();
|
|
152
203
|
function removeDragListeners() {
|
|
153
204
|
window.removeEventListener("mousemove", dragMove);
|
|
154
205
|
window.removeEventListener("mouseup", dragEnd);
|
|
@@ -168,6 +219,7 @@ var BaseSplitPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
168
219
|
}])
|
|
169
220
|
}, [__props.showFirst ? (openBlock(), createElementBlock("div", {
|
|
170
221
|
key: 0,
|
|
222
|
+
id: unref(firstPaneId),
|
|
171
223
|
class: normalizeClass(["relative top-0 left-0 z-20", {
|
|
172
224
|
"pointer-events-none": dragging.value,
|
|
173
225
|
"border-r border-gray-300/30 dark:border-gray-800": __props.orientation === "landscape" && __props.showDivider && hasBothPanes.value,
|
|
@@ -176,14 +228,23 @@ var BaseSplitPane_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
176
228
|
style: normalizeStyle(leftStyle.value)
|
|
177
229
|
}, [renderSlot(_ctx.$slots, "first", {}, void 0, true), hasBothPanes.value ? (openBlock(), createElementBlock("div", {
|
|
178
230
|
key: 0,
|
|
179
|
-
|
|
231
|
+
role: "separator",
|
|
232
|
+
tabindex: "0",
|
|
233
|
+
"aria-label": __props.label,
|
|
234
|
+
"aria-orientation": __props.orientation === "landscape" ? "vertical" : "horizontal",
|
|
235
|
+
"aria-controls": unref(firstPaneId),
|
|
236
|
+
"aria-valuenow": Math.round(boundSplit.value),
|
|
237
|
+
"aria-valuemin": __props.min,
|
|
238
|
+
"aria-valuemax": __props.max,
|
|
239
|
+
class: normalizeClass(["dragger absolute z-100 hover:bg-primary-500/50 focus-visible:bg-primary-500/50 focus-visible:outline-2 focus-visible:outline-primary-500 transition-colors duration-150 delay-150", {
|
|
180
240
|
"top-0 bottom-0 cursor-ew-resize": __props.orientation === "landscape",
|
|
181
241
|
"left-0 right-0 cursor-ns-resize": __props.orientation === "portrait",
|
|
182
242
|
[`dragger-offset-${__props.draggerOffset}`]: true,
|
|
183
243
|
"bg-primary-500/25": dragging.value
|
|
184
244
|
}]),
|
|
185
|
-
onMousedown: withModifiers(dragStart, ["prevent"])
|
|
186
|
-
|
|
245
|
+
onMousedown: withModifiers(dragStart, ["prevent"]),
|
|
246
|
+
onKeydown
|
|
247
|
+
}, null, 42, _hoisted_2)) : createCommentVNode("", true)], 14, _hoisted_1)) : createCommentVNode("", true), __props.showLast ? (openBlock(), createElementBlock("div", {
|
|
187
248
|
key: 1,
|
|
188
249
|
class: normalizeClass(["relative bottom-0 right-0", {
|
|
189
250
|
"pointer-events-none": dragging.value,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, normalizeClass, openBlock,
|
|
1
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, resolveDynamicComponent, unref, withCtx } from "@poveste/vendors/vue";
|
|
2
2
|
import { Icon } from "@poveste/vendors/iconify";
|
|
3
|
-
import { HstCheckbox, HstJson, HstNumber, HstText } from "@poveste/controls";
|
|
3
|
+
import { HstCheckbox, HstJson, HstNumber, HstText, HstTooltip } from "@poveste/controls";
|
|
4
4
|
//#region src/app/components/panel/ControlsComponentPropItem.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var _hoisted_1 = {
|
|
6
6
|
key: 0,
|
|
@@ -38,7 +38,6 @@ var ControlsComponentPropItem_vue_vue_type_script_setup_true_lang_default = /*@_
|
|
|
38
38
|
}
|
|
39
39
|
const canReset = computed(() => props.variant.state?._hPropState?.[props.component.index] && props.definition.name in props.variant.state._hPropState[props.component.index]);
|
|
40
40
|
return (_ctx, _cache) => {
|
|
41
|
-
const _directive_tooltip = resolveDirective("tooltip");
|
|
42
41
|
return comp.value ? (openBlock(), createElementBlock("div", _hoisted_1, [(openBlock(), createBlock(resolveDynamicComponent(comp.value), {
|
|
43
42
|
modelValue: model.value,
|
|
44
43
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
@@ -49,16 +48,19 @@ var ControlsComponentPropItem_vue_vue_type_script_setup_true_lang_default = /*@_
|
|
|
49
48
|
"modelValue",
|
|
50
49
|
"placeholder",
|
|
51
50
|
"title"
|
|
52
|
-
])),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
])), createVNode(unref(HstTooltip), { content: "Remove override" }, {
|
|
52
|
+
default: withCtx(() => [createElementVNode("button", {
|
|
53
|
+
type: "button",
|
|
54
|
+
"aria-label": `Remove override of ${__props.definition.name}`,
|
|
55
|
+
disabled: !canReset.value,
|
|
56
|
+
class: normalizeClass(["flex-none flex mr-2 mb-[10px] p-0 bg-transparent border-0 cursor-pointer text-gray-900 dark:text-gray-100 hover:text-primary-500 dark:hover:text-primary-400", [canReset.value ? "opacity-50 hover:opacity-100 focus-visible:opacity-100" : "opacity-25 pointer-events-none"]]),
|
|
57
|
+
onClick: _cache[1] || (_cache[1] = ($event) => reset())
|
|
58
|
+
}, [createVNode(unref(Icon), {
|
|
59
|
+
icon: "carbon:erase",
|
|
60
|
+
class: "w-4 h-4"
|
|
61
|
+
})], 10, _hoisted_2)]),
|
|
62
|
+
_: 1
|
|
63
|
+
})])) : createCommentVNode("", true);
|
|
62
64
|
};
|
|
63
65
|
}
|
|
64
66
|
});
|
package/dist/bundled/components/panel/ControlsComponentProps.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ControlsComponentPropItem_default from "./ControlsComponentPropItem.js";
|
|
2
|
-
import { Fragment, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, renderList,
|
|
2
|
+
import { Fragment, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, renderList, toDisplayString, unref, withCtx } from "@poveste/vendors/vue";
|
|
3
3
|
import { Icon } from "@poveste/vendors/iconify";
|
|
4
|
+
import { HstTooltip } from "@poveste/controls";
|
|
4
5
|
//#region src/app/components/panel/ControlsComponentProps.vue?vue&type=script&setup=true&lang.ts
|
|
5
6
|
var _hoisted_1 = { class: "poveste-controls-component-props" };
|
|
6
7
|
var _hoisted_2 = { class: "font-mono p-2 flex items-center gap-1" };
|
|
@@ -12,11 +13,13 @@ var ControlsComponentProps_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
12
13
|
},
|
|
13
14
|
setup(__props) {
|
|
14
15
|
return (_ctx, _cache) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createVNode(unref(HstTooltip), { content: "Auto-detected props" }, {
|
|
17
|
+
default: withCtx(() => [createVNode(unref(Icon), {
|
|
18
|
+
icon: "carbon:flash",
|
|
19
|
+
class: "w-4 h-4 text-primary-500 flex-none"
|
|
20
|
+
})]),
|
|
21
|
+
_: 1
|
|
22
|
+
}), createElementVNode("div", null, [
|
|
20
23
|
_cache[0] || (_cache[0] = createElementVNode("span", { class: "opacity-30" }, "<", -1)),
|
|
21
24
|
createTextVNode(toDisplayString(__props.definition.name), 1),
|
|
22
25
|
_cache[1] || (_cache[1] = createElementVNode("span", { class: "opacity-30" }, ">", -1))
|
package/dist/bundled/components/panel/ControlsComponentState.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ControlsComponentStateItem_default from "./ControlsComponentStateItem.js";
|
|
2
|
-
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, renderList,
|
|
2
|
+
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, renderList, unref, withCtx } from "@poveste/vendors/vue";
|
|
3
3
|
import { Icon } from "@poveste/vendors/iconify";
|
|
4
|
+
import { HstTooltip } from "@poveste/controls";
|
|
4
5
|
//#region src/app/components/panel/ControlsComponentState.vue?vue&type=script&setup=true&lang.ts
|
|
5
6
|
var _hoisted_1 = { class: "poveste-controls-component-init-state" };
|
|
6
7
|
var _hoisted_2 = { class: "p-2 flex items-center gap-1" };
|
|
@@ -11,11 +12,13 @@ var ControlsComponentState_vue_vue_type_script_setup_true_lang_default = /*@__PU
|
|
|
11
12
|
const props = __props;
|
|
12
13
|
const stateKeys = computed(() => Object.keys(props.variant.state || {}).filter((key) => !key.startsWith("_h")));
|
|
13
14
|
return (_ctx, _cache) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createVNode(unref(HstTooltip), { content: "Auto-detected state" }, {
|
|
16
|
+
default: withCtx(() => [createVNode(unref(Icon), {
|
|
17
|
+
icon: "carbon:data-vis-1",
|
|
18
|
+
class: "w-4 h-4 text-primary-500 flex-none"
|
|
19
|
+
})]),
|
|
20
|
+
_: 1
|
|
21
|
+
}), _cache[0] || (_cache[0] = createElementVNode("div", null, " State ", -1))]), (openBlock(true), createElementBlock(Fragment, null, renderList(stateKeys.value, (key) => {
|
|
19
22
|
return openBlock(), createBlock(ControlsComponentStateItem_default, {
|
|
20
23
|
key,
|
|
21
24
|
item: key,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { toPresetState, toRawDeep } from "../../util/state.js";
|
|
2
2
|
import BaseSelect_default from "../base/BaseSelect.js";
|
|
3
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,
|
|
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" };
|
|
@@ -102,7 +103,6 @@ var StatePresets_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
102
103
|
}
|
|
103
104
|
onClickOutside(select, () => stopEditing());
|
|
104
105
|
return (_ctx, _cache) => {
|
|
105
|
-
const _directive_tooltip = resolveDirective("tooltip");
|
|
106
106
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
107
107
|
createElementVNode("div", {
|
|
108
108
|
ref_key: "select",
|
|
@@ -128,58 +128,73 @@ var StatePresets_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
128
128
|
onDblclick: _cache[4] || (_cache[4] = ($event) => startEditing()),
|
|
129
129
|
onSelect: _cache[5] || (_cache[5] = (id) => applyPreset(id))
|
|
130
130
|
}, null, 8, ["modelValue", "options"]))], 512),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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), {
|
|
140
|
+
icon: "carbon:edit",
|
|
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), {
|
|
154
|
+
icon: "carbon:trash-can",
|
|
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
|
+
})])]),
|
|
196
|
+
_: 1
|
|
197
|
+
})
|
|
183
198
|
]);
|
|
184
199
|
};
|
|
185
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
|
});
|
|
@@ -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 };
|