@mtngtools/frame-vue 0.0.26-experimental.0 → 0.0.28-experimental.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/{FetchCard-BM8A35iP.js → FetchCard-DzxFG2eb.js} +298 -258
- package/dist/components/live/LiveFrame/LiveFrame.vue.d.ts +5 -0
- package/dist/components/live/LiveFrame/LiveFrame.vue.d.ts.map +1 -1
- package/dist/components/live/LiveFrame/helpers.test.d.ts +120 -6
- package/dist/components/live/LiveFrame/helpers.test.d.ts.map +1 -1
- package/dist/components.js +2 -2
- package/dist/frame-vue.css +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- /package/dist/{IconClose-7R37a2Ma.js → IconClose-B7WnTow-.js} +0 -0
|
@@ -1,6 +1,171 @@
|
|
|
1
|
-
import { i as IconPanelRight_default, n as IconPanelFull_default, r as IconPanelBottom_default, t as IconClose_default } from "./IconClose-
|
|
1
|
+
import { i as IconPanelRight_default, n as IconPanelFull_default, r as IconPanelBottom_default, t as IconClose_default } from "./IconClose-B7WnTow-.js";
|
|
2
2
|
import { n as useSimpleLoggedIn } from "./useSimpleLoggedIn-DT4aMAWu.js";
|
|
3
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, getCurrentScope, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowReadonly, shallowRef, toDisplayString, toRaw, toValue, unref, useSlots, vModelCheckbox, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, getCurrentScope, isRef, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowReadonly, shallowRef, toDisplayString, toRaw, toValue, unref, useSlots, vModelCheckbox, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
4
|
+
function tryOnScopeDispose(e, t) {
|
|
5
|
+
return getCurrentScope() ? (onScopeDispose(e, t), !0) : !1;
|
|
6
|
+
}
|
|
7
|
+
var isClient = typeof window < "u" && typeof document < "u";
|
|
8
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
9
|
+
var toString = Object.prototype.toString, isObject = (e) => toString.call(e) === "[object Object]";
|
|
10
|
+
function createSingletonPromise(e) {
|
|
11
|
+
let t;
|
|
12
|
+
function n() {
|
|
13
|
+
return t ||= e(), t;
|
|
14
|
+
}
|
|
15
|
+
return n.reset = async () => {
|
|
16
|
+
let e = t;
|
|
17
|
+
t = void 0, e && await e;
|
|
18
|
+
}, n;
|
|
19
|
+
}
|
|
20
|
+
function toArray(e) {
|
|
21
|
+
return Array.isArray(e) ? e : [e];
|
|
22
|
+
}
|
|
23
|
+
function useIntervalFn(e, t = 1e3, n = {}) {
|
|
24
|
+
let { immediate: r = !0, immediateCallback: i = !1 } = n, a = null, o = shallowRef(!1);
|
|
25
|
+
function s() {
|
|
26
|
+
a &&= (clearInterval(a), null);
|
|
27
|
+
}
|
|
28
|
+
function c() {
|
|
29
|
+
o.value = !1, s();
|
|
30
|
+
}
|
|
31
|
+
function l() {
|
|
32
|
+
let n = toValue(t);
|
|
33
|
+
n <= 0 || (o.value = !0, i && e(), s(), o.value && (a = setInterval(e, n)));
|
|
34
|
+
}
|
|
35
|
+
return r && isClient && l(), (isRef(t) || typeof t == "function") && tryOnScopeDispose(watch(t, () => {
|
|
36
|
+
o.value && isClient && l();
|
|
37
|
+
})), tryOnScopeDispose(c), {
|
|
38
|
+
isActive: shallowReadonly(o),
|
|
39
|
+
pause: c,
|
|
40
|
+
resume: l
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function useTimeoutFn(e, t, n = {}) {
|
|
44
|
+
let { immediate: r = !0, immediateCallback: i = !1 } = n, a = shallowRef(!1), o;
|
|
45
|
+
function s() {
|
|
46
|
+
o &&= (clearTimeout(o), void 0);
|
|
47
|
+
}
|
|
48
|
+
function c() {
|
|
49
|
+
a.value = !1, s();
|
|
50
|
+
}
|
|
51
|
+
function l(...n) {
|
|
52
|
+
i && e(), s(), a.value = !0, o = setTimeout(() => {
|
|
53
|
+
a.value = !1, o = void 0, e(...n);
|
|
54
|
+
}, toValue(t));
|
|
55
|
+
}
|
|
56
|
+
return r && (a.value = !0, isClient && l()), tryOnScopeDispose(c), {
|
|
57
|
+
isPending: shallowReadonly(a),
|
|
58
|
+
start: l,
|
|
59
|
+
stop: c
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function watchImmediate(e, t, n) {
|
|
63
|
+
return watch(e, t, {
|
|
64
|
+
...n,
|
|
65
|
+
immediate: !0
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
var defaultWindow = isClient ? window : void 0;
|
|
69
|
+
isClient && window.document;
|
|
70
|
+
var defaultNavigator = isClient ? window.navigator : void 0;
|
|
71
|
+
isClient && window.location;
|
|
72
|
+
function unrefElement(e) {
|
|
73
|
+
let t = toValue(e);
|
|
74
|
+
return t?.$el ?? t;
|
|
75
|
+
}
|
|
76
|
+
function useEventListener(...e) {
|
|
77
|
+
let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = computed(() => {
|
|
78
|
+
let t = toArray(toValue(e[0])).filter((e) => e != null);
|
|
79
|
+
return t.every((e) => typeof e != "string") ? t : void 0;
|
|
80
|
+
});
|
|
81
|
+
return watchImmediate(() => [
|
|
82
|
+
n.value?.map((e) => unrefElement(e)) ?? [defaultWindow].filter((e) => e != null),
|
|
83
|
+
toArray(toValue(n.value ? e[1] : e[0])),
|
|
84
|
+
toArray(unref(n.value ? e[2] : e[1])),
|
|
85
|
+
toValue(n.value ? e[3] : e[2])
|
|
86
|
+
], ([e, n, r, i], a, o) => {
|
|
87
|
+
if (!e?.length || !n?.length || !r?.length) return;
|
|
88
|
+
let s = isObject(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
|
|
89
|
+
o(() => {
|
|
90
|
+
c.forEach((e) => e());
|
|
91
|
+
});
|
|
92
|
+
}, { flush: "post" });
|
|
93
|
+
}
|
|
94
|
+
function useMounted() {
|
|
95
|
+
let e = shallowRef(!1), t = getCurrentInstance();
|
|
96
|
+
return t && onMounted(() => {
|
|
97
|
+
e.value = !0;
|
|
98
|
+
}, t), e;
|
|
99
|
+
}
|
|
100
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
101
|
+
function useSupported(e) {
|
|
102
|
+
let t = useMounted();
|
|
103
|
+
return computed(() => (t.value, !!e()));
|
|
104
|
+
}
|
|
105
|
+
function usePermission(e, t = {}) {
|
|
106
|
+
let { controls: n = !1, navigator: r = defaultNavigator } = t, i = /* @__PURE__ */ useSupported(() => r && "permissions" in r), a = shallowRef(), o = typeof e == "string" ? { name: e } : e, s = shallowRef(), c = () => {
|
|
107
|
+
s.value = a.value?.state ?? "prompt";
|
|
108
|
+
};
|
|
109
|
+
useEventListener(a, "change", c, { passive: !0 });
|
|
110
|
+
let l = createSingletonPromise(async () => {
|
|
111
|
+
if (i.value) {
|
|
112
|
+
if (!a.value) try {
|
|
113
|
+
a.value = await r.permissions.query(o);
|
|
114
|
+
} catch {
|
|
115
|
+
a.value = void 0;
|
|
116
|
+
} finally {
|
|
117
|
+
c();
|
|
118
|
+
}
|
|
119
|
+
if (n) return toRaw(a.value);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return l(), n ? {
|
|
123
|
+
state: s,
|
|
124
|
+
isSupported: i,
|
|
125
|
+
query: l
|
|
126
|
+
} : s;
|
|
127
|
+
}
|
|
128
|
+
function useClipboard(e = {}) {
|
|
129
|
+
let { navigator: t = defaultNavigator, read: n = !1, source: r, copiedDuring: i = 1500, legacy: a = !1 } = e, s = /* @__PURE__ */ useSupported(() => t && "clipboard" in t), c = usePermission("clipboard-read"), l = usePermission("clipboard-write"), u = computed(() => s.value || a), d = shallowRef(""), f = shallowRef(!1), p = useTimeoutFn(() => f.value = !1, i, { immediate: !1 });
|
|
130
|
+
async function m() {
|
|
131
|
+
let e = !(s.value && v(c.value));
|
|
132
|
+
if (!e) try {
|
|
133
|
+
d.value = await t.clipboard.readText();
|
|
134
|
+
} catch {
|
|
135
|
+
e = !0;
|
|
136
|
+
}
|
|
137
|
+
e && (d.value = _());
|
|
138
|
+
}
|
|
139
|
+
u.value && n && useEventListener(["copy", "cut"], m, { passive: !0 });
|
|
140
|
+
async function h(e = toValue(r)) {
|
|
141
|
+
if (u.value && e != null) {
|
|
142
|
+
let n = !(s.value && v(l.value));
|
|
143
|
+
if (!n) try {
|
|
144
|
+
await t.clipboard.writeText(e);
|
|
145
|
+
} catch {
|
|
146
|
+
n = !0;
|
|
147
|
+
}
|
|
148
|
+
n && g(e), d.value = e, f.value = !0, p.start();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function g(e) {
|
|
152
|
+
let t = document.createElement("textarea");
|
|
153
|
+
t.value = e, t.style.position = "absolute", t.style.opacity = "0", t.setAttribute("readonly", ""), document.body.appendChild(t), t.select(), document.execCommand("copy"), t.remove();
|
|
154
|
+
}
|
|
155
|
+
function _() {
|
|
156
|
+
var e, t;
|
|
157
|
+
return ((e = document) == null || (t = e.getSelection) == null || (t = t.call(e)) == null ? void 0 : t.toString()) ?? "";
|
|
158
|
+
}
|
|
159
|
+
function v(e) {
|
|
160
|
+
return e === "granted" || e === "prompt";
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
isSupported: u,
|
|
164
|
+
text: readonly(d),
|
|
165
|
+
copied: readonly(f),
|
|
166
|
+
copy: h
|
|
167
|
+
};
|
|
168
|
+
}
|
|
4
169
|
var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ */ defineComponent({
|
|
5
170
|
__name: "SidePanelControlButton",
|
|
6
171
|
props: {
|
|
@@ -43,7 +208,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
43
208
|
return u.activeResolved ? `${e} text-accent-400/80 bg-accent/20 border-accent-900/10` : `${e} text-accent-200 bg-accent/50 hover:bg-accent/90 border-accent hover:text-white hover:border-white`;
|
|
44
209
|
}
|
|
45
210
|
});
|
|
46
|
-
function
|
|
211
|
+
function _() {
|
|
47
212
|
u.disabled || f("click", u.state);
|
|
48
213
|
}
|
|
49
214
|
return (e, t) => (openBlock(), createElementBlock("button", {
|
|
@@ -65,7 +230,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
65
230
|
lineHeight: "1.2rem",
|
|
66
231
|
textTransform: "uppercase"
|
|
67
232
|
},
|
|
68
|
-
onClick:
|
|
233
|
+
onClick: _
|
|
69
234
|
}, [renderSlot(e.$slots, "icon", { state: i.state }, () => [!i.hideIcon && m[i.state] ? (openBlock(), createBlock(resolveDynamicComponent(m[i.state]), {
|
|
70
235
|
key: 0,
|
|
71
236
|
style: {
|
|
@@ -384,7 +549,13 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
384
549
|
type: Boolean,
|
|
385
550
|
default: !1
|
|
386
551
|
},
|
|
387
|
-
enforceSlotSizingQuerySelector: {}
|
|
552
|
+
enforceSlotSizingQuerySelector: {},
|
|
553
|
+
autoRefresh: {
|
|
554
|
+
type: Boolean,
|
|
555
|
+
default: !1
|
|
556
|
+
},
|
|
557
|
+
autoRefreshInterval: { default: 2e3 },
|
|
558
|
+
refreshOnWindowEvent: {}
|
|
388
559
|
},
|
|
389
560
|
emits: [
|
|
390
561
|
"update:sidePanelPosition",
|
|
@@ -393,39 +564,39 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
393
564
|
"defaultSlotResize"
|
|
394
565
|
],
|
|
395
566
|
setup(e, { expose: t, emit: n }) {
|
|
396
|
-
let r = e, i = n, a = useSlots(), p = ref(null), m = ref(null), h = ref(null),
|
|
397
|
-
function
|
|
567
|
+
let r = e, i = n, a = useSlots(), p = ref(null), m = ref(null), h = ref(null), g = ref(0), v = ref(0), y = ref(0), b = ref(0), x = ref(0);
|
|
568
|
+
function S() {
|
|
398
569
|
let e = h.value;
|
|
399
570
|
if (!e) return;
|
|
400
|
-
let t = r.enforceSlotSizingQuerySelector ? Array.from(e.querySelectorAll(r.enforceSlotSizingQuerySelector)) : Array.from(e.children), n = `${
|
|
571
|
+
let t = r.enforceSlotSizingQuerySelector ? Array.from(e.querySelectorAll(r.enforceSlotSizingQuerySelector)) : Array.from(e.children), n = `${x.value}px`;
|
|
401
572
|
t.forEach((e) => {
|
|
402
|
-
e.style.height !== n && (e.style.height = n);
|
|
573
|
+
e.style.height !== n && (e.style.height = n, console.debug("[LiveFrame] enforceSlotChildSizing", n));
|
|
403
574
|
});
|
|
404
575
|
}
|
|
405
|
-
let w = ref("none"), T = ref("none"), E = ref([]),
|
|
576
|
+
let w = ref("none"), T = ref("none"), E = ref([]), D = ref("none"), O = ref(!0), k = ref(!1), A = {
|
|
406
577
|
sm: 640,
|
|
407
578
|
md: 768,
|
|
408
579
|
lg: 1024,
|
|
409
580
|
xl: 1280,
|
|
410
581
|
"2xl": 1536
|
|
411
|
-
},
|
|
582
|
+
}, j = computed(() => {
|
|
412
583
|
if (typeof window < "u" && r.displaySidePanelWindowFn && typeof window[r.displaySidePanelWindowFn] == "function") return !!window[r.displaySidePanelWindowFn]();
|
|
413
584
|
let e = unref(r.displaySidePanel);
|
|
414
585
|
return typeof e == "function" ? e() : !!e;
|
|
415
|
-
}),
|
|
586
|
+
}), M = computed(() => !!a.sidePanelContent && j.value), N = computed(() => !!a.header), oe = computed(() => E.value.filter((e) => e !== "auto")), P = computed(() => Math.max(0, v.value - y.value)), F = computed(() => g.value < Se(r.controlsOverlayOnly)), se = computed(() => g.value === 0 ? !1 : P.value / g.value > 1.1), ce = computed(() => T.value === "right" && D.value === "wide-right" ? r.sidePanelMaxRightWide : r.sidePanelMaxRight), I = computed(() => Ce(r.mainContentAspectRatio, 16 / 9)), le = computed(() => b.value > 0 ? b.value : Math.max(1, g.value)), ue = computed(() => le.value / I.value + 20), de = computed(() => Math.max(1, g.value) / I.value), fe = computed(() => K(r.sidePanelMinBottom, g.value, v.value)), pe = computed(() => {
|
|
416
587
|
let e = de.value + fe.value;
|
|
417
|
-
return
|
|
418
|
-
}), me = computed(() => Math.max(0,
|
|
588
|
+
return P.value >= e;
|
|
589
|
+
}), me = computed(() => Math.max(0, P.value - ue.value)), he = computed(() => {
|
|
419
590
|
if (T.value !== "bottom") return r.sidePanelMinBottom;
|
|
420
|
-
let e =
|
|
591
|
+
let e = K(r.sidePanelMinBottom, g.value, v.value), t = Math.min(e, L.value);
|
|
421
592
|
return `${Math.max(0, Math.floor(t))}px`;
|
|
422
|
-
}),
|
|
423
|
-
let e =
|
|
593
|
+
}), L = computed(() => {
|
|
594
|
+
let e = K(T.value === "bottom" && D.value === "tall-bottom" ? r.sidePanelMaxBottomTall : r.sidePanelMaxBottom, g.value, v.value);
|
|
424
595
|
return Math.max(0, Math.min(e, me.value));
|
|
425
|
-
}),
|
|
596
|
+
}), R = computed(() => T.value === "bottom" ? `${Math.max(0, Math.floor(L.value))}px` : r.sidePanelMaxBottom), ge = computed(() => T.value === "right" || T.value === "bottom" ? {} : T.value === "full" && !F.value ? {
|
|
426
597
|
opacity: 0,
|
|
427
598
|
pointerEvents: "none"
|
|
428
|
-
} : {}),
|
|
599
|
+
} : {}), z = computed(() => !M.value || F.value || T.value === "none" || T.value === "minimized" || T.value === "right" || T.value === "bottom" ? null : {
|
|
429
600
|
position: "absolute",
|
|
430
601
|
top: 0,
|
|
431
602
|
right: 0,
|
|
@@ -433,11 +604,11 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
433
604
|
left: 0,
|
|
434
605
|
zIndex: 10,
|
|
435
606
|
pointerEvents: "none"
|
|
436
|
-
}),
|
|
607
|
+
}), B = computed(() => !M.value || T.value === "none" || T.value === "full" ? { gridTemplate: "1fr / 1fr" } : T.value === "right" ? {
|
|
437
608
|
gridTemplateRows: "1fr",
|
|
438
609
|
gridTemplateColumns: `minmax(0, 1fr) max(${r.sidePanelMinRight}, ${ce.value})`
|
|
439
610
|
} : T.value === "bottom" ? {
|
|
440
|
-
gridTemplateRows: `minmax(0, 1fr) ${
|
|
611
|
+
gridTemplateRows: `minmax(0, 1fr) ${R.value}`,
|
|
441
612
|
gridTemplateColumns: "1fr"
|
|
442
613
|
} : T.value === "minimized" ? {
|
|
443
614
|
gridTemplateRows: "1fr max-content",
|
|
@@ -451,7 +622,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
451
622
|
placeSelf: "stretch",
|
|
452
623
|
zIndex: 20
|
|
453
624
|
};
|
|
454
|
-
if (
|
|
625
|
+
if (M.value) {
|
|
455
626
|
if (T.value === "right") return {
|
|
456
627
|
...e,
|
|
457
628
|
gridColumn: "2 / 3",
|
|
@@ -477,7 +648,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
477
648
|
left: 0,
|
|
478
649
|
overflow: "hidden"
|
|
479
650
|
};
|
|
480
|
-
return
|
|
651
|
+
return N.value ? {
|
|
481
652
|
...e,
|
|
482
653
|
display: "grid",
|
|
483
654
|
gridTemplateRows: "auto 1fr"
|
|
@@ -485,11 +656,11 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
485
656
|
...e,
|
|
486
657
|
display: "block"
|
|
487
658
|
};
|
|
488
|
-
}), ye = computed(() =>
|
|
659
|
+
}), ye = computed(() => N.value ? {
|
|
489
660
|
position: "relative",
|
|
490
661
|
zIndex: 0,
|
|
491
662
|
display: "grid",
|
|
492
|
-
...
|
|
663
|
+
...B.value,
|
|
493
664
|
gridRow: "2 / 3",
|
|
494
665
|
minWidth: 0,
|
|
495
666
|
minHeight: 0,
|
|
@@ -498,7 +669,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
498
669
|
position: "absolute",
|
|
499
670
|
zIndex: 0,
|
|
500
671
|
display: "grid",
|
|
501
|
-
...
|
|
672
|
+
...B.value,
|
|
502
673
|
minWidth: 0,
|
|
503
674
|
minHeight: 0,
|
|
504
675
|
overflow: "hidden",
|
|
@@ -506,9 +677,9 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
506
677
|
right: "0",
|
|
507
678
|
bottom: "0",
|
|
508
679
|
left: "0"
|
|
509
|
-
}), be = computed(() => !
|
|
680
|
+
}), be = computed(() => !F.value || O.value), V = null, H, U, W = null, xe = "", G = !1;
|
|
510
681
|
function Se(e) {
|
|
511
|
-
let t =
|
|
682
|
+
let t = A[e];
|
|
512
683
|
if (t !== void 0) return t;
|
|
513
684
|
if (e.endsWith("px")) {
|
|
514
685
|
let t = Number.parseFloat(e);
|
|
@@ -527,7 +698,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
527
698
|
let r = Number.parseFloat(n);
|
|
528
699
|
return Number.isFinite(r) && r > 0 ? r : t;
|
|
529
700
|
}
|
|
530
|
-
function
|
|
701
|
+
function K(e, t, n) {
|
|
531
702
|
let r = e.trim();
|
|
532
703
|
if (r.endsWith("px")) {
|
|
533
704
|
let e = Number.parseFloat(r);
|
|
@@ -545,8 +716,8 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
545
716
|
return Number.isFinite(i) ? i : 0;
|
|
546
717
|
}
|
|
547
718
|
function we() {
|
|
548
|
-
let e = Math.max(1,
|
|
549
|
-
return n < r.autoBottomAspectRatioBreakpoint && o ? (
|
|
719
|
+
let e = Math.max(1, g.value), t = Math.max(1, P.value), n = e / t, i = e / t, a = Se(r.sidePanelBreakpoint), o = pe.value;
|
|
720
|
+
return n < r.autoBottomAspectRatioBreakpoint && o ? (D.value = "tall-bottom", {
|
|
550
721
|
states: [
|
|
551
722
|
"auto",
|
|
552
723
|
"full",
|
|
@@ -554,7 +725,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
554
725
|
"minimized"
|
|
555
726
|
],
|
|
556
727
|
resolved: "bottom"
|
|
557
|
-
}) : i > r.autoRightAspectRatioBreakpoint ? (
|
|
728
|
+
}) : i > r.autoRightAspectRatioBreakpoint ? (D.value = "wide-right", {
|
|
558
729
|
states: [
|
|
559
730
|
"auto",
|
|
560
731
|
"full",
|
|
@@ -562,7 +733,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
562
733
|
"minimized"
|
|
563
734
|
],
|
|
564
735
|
resolved: "right"
|
|
565
|
-
}) : (
|
|
736
|
+
}) : (D.value = "mixed", e >= a ? {
|
|
566
737
|
states: o ? [
|
|
567
738
|
"auto",
|
|
568
739
|
"full",
|
|
@@ -586,70 +757,70 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
586
757
|
});
|
|
587
758
|
}
|
|
588
759
|
function Te(e, t, n) {
|
|
589
|
-
e === t || t === "none" || !
|
|
760
|
+
e === t || t === "none" || !M.value || i("sidePanelTransition", {
|
|
590
761
|
from: e,
|
|
591
762
|
to: t,
|
|
592
763
|
reason: n
|
|
593
764
|
});
|
|
594
765
|
}
|
|
595
|
-
function
|
|
766
|
+
function q(e = !1) {
|
|
596
767
|
let t = {
|
|
597
|
-
availableStates:
|
|
598
|
-
sidePanelMode:
|
|
599
|
-
sidePanelModeResolved:
|
|
600
|
-
overlayOnly:
|
|
768
|
+
availableStates: M.value ? [...oe.value] : [],
|
|
769
|
+
sidePanelMode: M.value ? w.value : "none",
|
|
770
|
+
sidePanelModeResolved: M.value ? T.value : "none",
|
|
771
|
+
overlayOnly: F.value
|
|
601
772
|
};
|
|
602
|
-
if (!
|
|
603
|
-
if (
|
|
604
|
-
|
|
773
|
+
if (!M.value) {
|
|
774
|
+
if (G) return;
|
|
775
|
+
G = !0, i("sidePanelAvailableStates", t);
|
|
605
776
|
return;
|
|
606
777
|
}
|
|
607
|
-
|
|
778
|
+
G = !1;
|
|
608
779
|
let n = JSON.stringify(t);
|
|
609
780
|
!e && n === xe || (xe = n, i("sidePanelAvailableStates", t));
|
|
610
781
|
}
|
|
611
|
-
function
|
|
782
|
+
function J(e) {
|
|
612
783
|
let t = T.value;
|
|
613
|
-
if (!
|
|
614
|
-
w.value = "none", T.value = "none", E.value = [],
|
|
784
|
+
if (!M.value) {
|
|
785
|
+
w.value = "none", T.value = "none", E.value = [], q();
|
|
615
786
|
return;
|
|
616
787
|
}
|
|
617
788
|
let n = we();
|
|
618
789
|
E.value = n.states;
|
|
619
790
|
let r = w.value === "none" ? "auto" : w.value;
|
|
620
|
-
r !== "auto" && !E.value.includes(r) ? (w.value = "auto", i("update:sidePanelPosition", "auto")) : w.value = r, T.value = w.value === "auto" ? n.resolved : w.value, Te(t, T.value, e),
|
|
791
|
+
r !== "auto" && !E.value.includes(r) ? (w.value = "auto", i("update:sidePanelPosition", "auto")) : w.value = r, T.value = w.value === "auto" ? n.resolved : w.value, Te(t, T.value, e), q(k.value === !1);
|
|
621
792
|
}
|
|
622
793
|
function Y(e, t = !1) {
|
|
623
|
-
if (
|
|
624
|
-
|
|
794
|
+
if (H &&= (clearTimeout(H), void 0), t || !k.value) {
|
|
795
|
+
J(e);
|
|
625
796
|
return;
|
|
626
797
|
}
|
|
627
|
-
|
|
628
|
-
|
|
798
|
+
H = setTimeout(() => {
|
|
799
|
+
J(e);
|
|
629
800
|
}, r.layoutDebounceMs);
|
|
630
801
|
}
|
|
631
|
-
function
|
|
632
|
-
if (!
|
|
802
|
+
function Ee(e) {
|
|
803
|
+
if (!M.value) return;
|
|
633
804
|
let t = E.value.includes(e) ? e : "auto";
|
|
634
805
|
t !== w.value && (w.value = t, i("update:sidePanelPosition", t)), Y("set-side-panel-mode", !0);
|
|
635
806
|
}
|
|
636
807
|
function De() {
|
|
637
|
-
!
|
|
808
|
+
!M.value || !F.value || Ee("minimized");
|
|
638
809
|
}
|
|
639
|
-
function
|
|
640
|
-
|
|
810
|
+
function X() {
|
|
811
|
+
U &&= (clearTimeout(U), void 0);
|
|
641
812
|
}
|
|
642
813
|
function Oe() {
|
|
643
|
-
if (
|
|
644
|
-
|
|
814
|
+
if (X(), !F.value || se.value || T.value === "none") {
|
|
815
|
+
O.value = !0;
|
|
645
816
|
return;
|
|
646
817
|
}
|
|
647
|
-
|
|
648
|
-
|
|
818
|
+
U = setTimeout(() => {
|
|
819
|
+
O.value = !1;
|
|
649
820
|
}, r.autoHideTimeout);
|
|
650
821
|
}
|
|
651
|
-
function
|
|
652
|
-
|
|
822
|
+
function Z() {
|
|
823
|
+
O.value = !0, Oe();
|
|
653
824
|
}
|
|
654
825
|
function ke() {
|
|
655
826
|
if (!p.value) return;
|
|
@@ -660,33 +831,48 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
660
831
|
"keydown",
|
|
661
832
|
"touchstart"
|
|
662
833
|
], t = () => {
|
|
663
|
-
|
|
834
|
+
Z();
|
|
664
835
|
};
|
|
665
836
|
for (let n of e) p.value.addEventListener(n, t, { passive: !0 });
|
|
666
|
-
|
|
837
|
+
W = () => {
|
|
667
838
|
if (p.value) for (let n of e) p.value.removeEventListener(n, t);
|
|
668
839
|
};
|
|
669
840
|
}
|
|
670
|
-
function
|
|
671
|
-
|
|
841
|
+
function Q() {
|
|
842
|
+
g.value = window.innerWidth, v.value = window.innerHeight, Y("viewport-resize");
|
|
672
843
|
}
|
|
673
|
-
function
|
|
674
|
-
|
|
844
|
+
function $() {
|
|
845
|
+
try {
|
|
846
|
+
if (typeof window > "u") return;
|
|
847
|
+
g.value = window.innerWidth, v.value = window.innerHeight, y.value = m.value?.offsetHeight ?? 0, b.value = h.value?.offsetWidth ?? 0, x.value = h.value?.offsetHeight ?? 0, console.debug("[LiveFrame] Refreshing frame", {
|
|
848
|
+
defaultWidth: b.value,
|
|
849
|
+
defaultHeight: x.value
|
|
850
|
+
}), S(), Y("manual-refresh", !0);
|
|
851
|
+
} catch (e) {
|
|
852
|
+
console.warn("[LiveFrame] Error during refresh cycle:", e);
|
|
853
|
+
}
|
|
675
854
|
}
|
|
676
|
-
|
|
677
|
-
|
|
855
|
+
t({ refresh: $ });
|
|
856
|
+
let { pause: Ae, resume: je } = useIntervalFn($, () => r.autoRefreshInterval, {
|
|
857
|
+
immediate: r.autoRefresh,
|
|
858
|
+
immediateCallback: !1
|
|
859
|
+
});
|
|
860
|
+
return watch(() => r.autoRefresh, (e) => {
|
|
861
|
+
e ? je() : Ae();
|
|
862
|
+
}), watch(() => r.sidePanelPosition, (e) => {
|
|
863
|
+
if (!M.value) {
|
|
678
864
|
w.value = "none";
|
|
679
865
|
return;
|
|
680
866
|
}
|
|
681
867
|
w.value = e, Y("prop-sync");
|
|
682
|
-
}, { immediate: !0 }), watch(
|
|
868
|
+
}, { immediate: !0 }), watch(M, (e) => {
|
|
683
869
|
if (!e) {
|
|
684
|
-
w.value = "none", T.value = "none", E.value = [],
|
|
870
|
+
w.value = "none", T.value = "none", E.value = [], q();
|
|
685
871
|
return;
|
|
686
872
|
}
|
|
687
873
|
w.value = r.sidePanelPosition, Y("slot-state-change", !0);
|
|
688
874
|
}, { immediate: !0 }), watch(() => [
|
|
689
|
-
|
|
875
|
+
F.value,
|
|
690
876
|
r.autoHideTimeout,
|
|
691
877
|
T.value
|
|
692
878
|
], () => {
|
|
@@ -694,35 +880,35 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
694
880
|
Oe();
|
|
695
881
|
return;
|
|
696
882
|
}
|
|
697
|
-
|
|
883
|
+
Z();
|
|
698
884
|
}), watch(se, (e, t) => {
|
|
699
885
|
if (e) {
|
|
700
|
-
|
|
886
|
+
O.value = !0, X();
|
|
701
887
|
return;
|
|
702
888
|
}
|
|
703
|
-
t &&
|
|
889
|
+
t && Z();
|
|
704
890
|
}), watch(() => [
|
|
891
|
+
b.value,
|
|
705
892
|
x.value,
|
|
706
|
-
S.value,
|
|
707
893
|
T.value,
|
|
708
|
-
|
|
894
|
+
M.value
|
|
709
895
|
], () => {
|
|
710
|
-
!
|
|
711
|
-
width:
|
|
712
|
-
height:
|
|
896
|
+
!M.value || T.value === "none" || i("defaultSlotResize", {
|
|
897
|
+
width: b.value,
|
|
898
|
+
height: x.value
|
|
713
899
|
});
|
|
714
900
|
}), onMounted(async () => {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}), m.value &&
|
|
901
|
+
k.value = !0, Q(), window.addEventListener("resize", Q), ke(), Z(), r.refreshOnWindowEvent && window.addEventListener(r.refreshOnWindowEvent, $), await nextTick(), V = new ResizeObserver(() => {
|
|
902
|
+
y.value = m.value?.offsetHeight ?? 0, b.value = h.value?.offsetWidth ?? 0, x.value = h.value?.offsetHeight ?? 0, S(), Y("slot-measure");
|
|
903
|
+
}), m.value && V.observe(m.value), h.value && (V.observe(h.value), b.value = h.value.offsetWidth, x.value = h.value.offsetHeight), y.value = m.value?.offsetHeight ?? 0, Y("mounted", !0);
|
|
718
904
|
}), onBeforeUnmount(() => {
|
|
719
|
-
window.removeEventListener("resize", $),
|
|
905
|
+
window.removeEventListener("resize", Q), r.refreshOnWindowEvent && window.removeEventListener(r.refreshOnWindowEvent, $), W?.(), W = null, V?.disconnect(), V = null, X(), H &&= (clearTimeout(H), void 0);
|
|
720
906
|
}), (t, n) => (openBlock(), createElementBlock("section", {
|
|
721
907
|
ref_key: "rootRef",
|
|
722
908
|
ref: p,
|
|
723
909
|
class: "bg-black text-neutral-100",
|
|
724
910
|
style: normalizeStyle({ ...ve.value })
|
|
725
|
-
}, [
|
|
911
|
+
}, [N.value ? withDirectives((openBlock(), createElementBlock("header", {
|
|
726
912
|
key: 0,
|
|
727
913
|
ref_key: "headerRef",
|
|
728
914
|
ref: m,
|
|
@@ -759,16 +945,16 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
759
945
|
...ge.value
|
|
760
946
|
})
|
|
761
947
|
}, [renderSlot(t.$slots, "default")], 4),
|
|
762
|
-
|
|
948
|
+
z.value ? (openBlock(), createElementBlock("div", {
|
|
763
949
|
key: 0,
|
|
764
950
|
class: "bg-black",
|
|
765
951
|
style: normalizeStyle({
|
|
766
|
-
...
|
|
952
|
+
...z.value,
|
|
767
953
|
gridColumn: "1 / 2",
|
|
768
954
|
gridRow: "1 / 2"
|
|
769
955
|
})
|
|
770
956
|
}, null, 4)) : createCommentVNode("", !0),
|
|
771
|
-
|
|
957
|
+
M.value && T.value !== "none" ? (openBlock(), createElementBlock("div", {
|
|
772
958
|
key: 1,
|
|
773
959
|
class: "",
|
|
774
960
|
style: normalizeStyle(_e.value)
|
|
@@ -776,13 +962,13 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
776
962
|
"side-panel-mode": w.value,
|
|
777
963
|
"side-panel-mode-resolved": T.value,
|
|
778
964
|
"available-states": oe.value,
|
|
779
|
-
"overlay-only":
|
|
965
|
+
"overlay-only": F.value,
|
|
780
966
|
"hide-icons": e.hideSidePanelIcons,
|
|
781
967
|
"min-width": e.sidePanelMinRight,
|
|
782
968
|
"max-width": ce.value,
|
|
783
969
|
"min-height": he.value,
|
|
784
|
-
"max-height":
|
|
785
|
-
onSetSidePanelMode:
|
|
970
|
+
"max-height": R.value,
|
|
971
|
+
onSetSidePanelMode: Ee,
|
|
786
972
|
onCloseSidePanel: De
|
|
787
973
|
}, {
|
|
788
974
|
default: withCtx(() => [renderSlot(t.$slots, "sidePanelContent")]),
|
|
@@ -800,7 +986,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
800
986
|
])], 4)) : createCommentVNode("", !0)
|
|
801
987
|
], 4)], 4));
|
|
802
988
|
}
|
|
803
|
-
}), [["__scopeId", "data-v-
|
|
989
|
+
}), [["__scopeId", "data-v-36a3bc77"]]), LoggedInOut_default = /* @__PURE__ */ defineComponent({
|
|
804
990
|
__name: "LoggedInOut",
|
|
805
991
|
props: {
|
|
806
992
|
initiallyLoggedIn: { type: Boolean },
|
|
@@ -1256,153 +1442,7 @@ var _globalThis = (function() {
|
|
|
1256
1442
|
fetch,
|
|
1257
1443
|
Headers: Headers$1,
|
|
1258
1444
|
AbortController: AbortController$1
|
|
1259
|
-
})
|
|
1260
|
-
function tryOnScopeDispose(e, t) {
|
|
1261
|
-
return getCurrentScope() ? (onScopeDispose(e, t), !0) : !1;
|
|
1262
|
-
}
|
|
1263
|
-
var isClient = typeof window < "u" && typeof document < "u";
|
|
1264
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
1265
|
-
var toString = Object.prototype.toString, isObject = (e) => toString.call(e) === "[object Object]";
|
|
1266
|
-
function createSingletonPromise(e) {
|
|
1267
|
-
let t;
|
|
1268
|
-
function n() {
|
|
1269
|
-
return t ||= e(), t;
|
|
1270
|
-
}
|
|
1271
|
-
return n.reset = async () => {
|
|
1272
|
-
let e = t;
|
|
1273
|
-
t = void 0, e && await e;
|
|
1274
|
-
}, n;
|
|
1275
|
-
}
|
|
1276
|
-
function toArray(e) {
|
|
1277
|
-
return Array.isArray(e) ? e : [e];
|
|
1278
|
-
}
|
|
1279
|
-
function useTimeoutFn(e, t, n = {}) {
|
|
1280
|
-
let { immediate: r = !0, immediateCallback: i = !1 } = n, a = shallowRef(!1), o;
|
|
1281
|
-
function s() {
|
|
1282
|
-
o &&= (clearTimeout(o), void 0);
|
|
1283
|
-
}
|
|
1284
|
-
function c() {
|
|
1285
|
-
a.value = !1, s();
|
|
1286
|
-
}
|
|
1287
|
-
function l(...n) {
|
|
1288
|
-
i && e(), s(), a.value = !0, o = setTimeout(() => {
|
|
1289
|
-
a.value = !1, o = void 0, e(...n);
|
|
1290
|
-
}, toValue(t));
|
|
1291
|
-
}
|
|
1292
|
-
return r && (a.value = !0, isClient && l()), tryOnScopeDispose(c), {
|
|
1293
|
-
isPending: shallowReadonly(a),
|
|
1294
|
-
start: l,
|
|
1295
|
-
stop: c
|
|
1296
|
-
};
|
|
1297
|
-
}
|
|
1298
|
-
function watchImmediate(e, t, n) {
|
|
1299
|
-
return watch(e, t, {
|
|
1300
|
-
...n,
|
|
1301
|
-
immediate: !0
|
|
1302
|
-
});
|
|
1303
|
-
}
|
|
1304
|
-
var defaultWindow = isClient ? window : void 0;
|
|
1305
|
-
isClient && window.document;
|
|
1306
|
-
var defaultNavigator = isClient ? window.navigator : void 0;
|
|
1307
|
-
isClient && window.location;
|
|
1308
|
-
function unrefElement(e) {
|
|
1309
|
-
let t = toValue(e);
|
|
1310
|
-
return t?.$el ?? t;
|
|
1311
|
-
}
|
|
1312
|
-
function useEventListener(...e) {
|
|
1313
|
-
let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = computed(() => {
|
|
1314
|
-
let t = toArray(toValue(e[0])).filter((e) => e != null);
|
|
1315
|
-
return t.every((e) => typeof e != "string") ? t : void 0;
|
|
1316
|
-
});
|
|
1317
|
-
return watchImmediate(() => [
|
|
1318
|
-
n.value?.map((e) => unrefElement(e)) ?? [defaultWindow].filter((e) => e != null),
|
|
1319
|
-
toArray(toValue(n.value ? e[1] : e[0])),
|
|
1320
|
-
toArray(unref(n.value ? e[2] : e[1])),
|
|
1321
|
-
toValue(n.value ? e[3] : e[2])
|
|
1322
|
-
], ([e, n, r, i], a, o) => {
|
|
1323
|
-
if (!e?.length || !n?.length || !r?.length) return;
|
|
1324
|
-
let s = isObject(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
|
|
1325
|
-
o(() => {
|
|
1326
|
-
c.forEach((e) => e());
|
|
1327
|
-
});
|
|
1328
|
-
}, { flush: "post" });
|
|
1329
|
-
}
|
|
1330
|
-
function useMounted() {
|
|
1331
|
-
let e = shallowRef(!1), t = getCurrentInstance();
|
|
1332
|
-
return t && onMounted(() => {
|
|
1333
|
-
e.value = !0;
|
|
1334
|
-
}, t), e;
|
|
1335
|
-
}
|
|
1336
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
1337
|
-
function useSupported(e) {
|
|
1338
|
-
let t = useMounted();
|
|
1339
|
-
return computed(() => (t.value, !!e()));
|
|
1340
|
-
}
|
|
1341
|
-
function usePermission(e, t = {}) {
|
|
1342
|
-
let { controls: n = !1, navigator: r = defaultNavigator } = t, i = /* @__PURE__ */ useSupported(() => r && "permissions" in r), a = shallowRef(), o = typeof e == "string" ? { name: e } : e, s = shallowRef(), c = () => {
|
|
1343
|
-
s.value = a.value?.state ?? "prompt";
|
|
1344
|
-
};
|
|
1345
|
-
useEventListener(a, "change", c, { passive: !0 });
|
|
1346
|
-
let l = createSingletonPromise(async () => {
|
|
1347
|
-
if (i.value) {
|
|
1348
|
-
if (!a.value) try {
|
|
1349
|
-
a.value = await r.permissions.query(o);
|
|
1350
|
-
} catch {
|
|
1351
|
-
a.value = void 0;
|
|
1352
|
-
} finally {
|
|
1353
|
-
c();
|
|
1354
|
-
}
|
|
1355
|
-
if (n) return toRaw(a.value);
|
|
1356
|
-
}
|
|
1357
|
-
});
|
|
1358
|
-
return l(), n ? {
|
|
1359
|
-
state: s,
|
|
1360
|
-
isSupported: i,
|
|
1361
|
-
query: l
|
|
1362
|
-
} : s;
|
|
1363
|
-
}
|
|
1364
|
-
function useClipboard(e = {}) {
|
|
1365
|
-
let { navigator: t = defaultNavigator, read: n = !1, source: r, copiedDuring: i = 1500, legacy: a = !1 } = e, s = /* @__PURE__ */ useSupported(() => t && "clipboard" in t), c = usePermission("clipboard-read"), l = usePermission("clipboard-write"), u = computed(() => s.value || a), d = shallowRef(""), f = shallowRef(!1), p = useTimeoutFn(() => f.value = !1, i, { immediate: !1 });
|
|
1366
|
-
async function m() {
|
|
1367
|
-
let e = !(s.value && v(c.value));
|
|
1368
|
-
if (!e) try {
|
|
1369
|
-
d.value = await t.clipboard.readText();
|
|
1370
|
-
} catch {
|
|
1371
|
-
e = !0;
|
|
1372
|
-
}
|
|
1373
|
-
e && (d.value = _());
|
|
1374
|
-
}
|
|
1375
|
-
u.value && n && useEventListener(["copy", "cut"], m, { passive: !0 });
|
|
1376
|
-
async function h(e = toValue(r)) {
|
|
1377
|
-
if (u.value && e != null) {
|
|
1378
|
-
let n = !(s.value && v(l.value));
|
|
1379
|
-
if (!n) try {
|
|
1380
|
-
await t.clipboard.writeText(e);
|
|
1381
|
-
} catch {
|
|
1382
|
-
n = !0;
|
|
1383
|
-
}
|
|
1384
|
-
n && g(e), d.value = e, f.value = !0, p.start();
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
function g(e) {
|
|
1388
|
-
let t = document.createElement("textarea");
|
|
1389
|
-
t.value = e, t.style.position = "absolute", t.style.opacity = "0", t.setAttribute("readonly", ""), document.body.appendChild(t), t.select(), document.execCommand("copy"), t.remove();
|
|
1390
|
-
}
|
|
1391
|
-
function _() {
|
|
1392
|
-
var e, t;
|
|
1393
|
-
return ((e = document) == null || (t = e.getSelection) == null || (t = t.call(e)) == null ? void 0 : t.toString()) ?? "";
|
|
1394
|
-
}
|
|
1395
|
-
function v(e) {
|
|
1396
|
-
return e === "granted" || e === "prompt";
|
|
1397
|
-
}
|
|
1398
|
-
return {
|
|
1399
|
-
isSupported: u,
|
|
1400
|
-
text: readonly(d),
|
|
1401
|
-
copied: readonly(f),
|
|
1402
|
-
copy: h
|
|
1403
|
-
};
|
|
1404
|
-
}
|
|
1405
|
-
var _hoisted_1 = { class: "border border-neutral-300 rounded-lg bg-white shadow-sm grid grid-rows-[min-content_auto_min-content] overflow-hidden" }, _hoisted_2 = { class: "flex items-center justify-between px-3 py-1 bg-neutral-900 border-b border-neutral-800" }, _hoisted_3 = { class: "px-2 py-0.5 bg-neutral-800 text-neutral-300 font-mono text-[10px] uppercase font-bold rounded" }, _hoisted_4 = {
|
|
1445
|
+
}), _hoisted_1 = { class: "border border-neutral-300 rounded-lg bg-white shadow-sm grid grid-rows-[min-content_auto_min-content] overflow-hidden" }, _hoisted_2 = { class: "flex items-center justify-between px-3 py-1 bg-neutral-900 border-b border-neutral-800" }, _hoisted_3 = { class: "px-2 py-0.5 bg-neutral-800 text-neutral-300 font-mono text-[10px] uppercase font-bold rounded" }, _hoisted_4 = {
|
|
1406
1446
|
key: 0,
|
|
1407
1447
|
class: "flex items-center gap-2"
|
|
1408
1448
|
}, _hoisted_5 = { class: "flex items-center gap-4 px-4 py-3 bg-white" }, _hoisted_6 = ["disabled"], _hoisted_7 = { key: 0 }, _hoisted_8 = { key: 1 }, _hoisted_9 = { class: "grid grid-cols-[10rem_1fr] bg-neutral-900 border-t border-neutral-800 group h-auto" }, _hoisted_10 = { class: "flex flex-col w-full min-w-0 p-3 relative h-max" }, _hoisted_11 = { class: "absolute top-2 right-2 flex justify-end z-10" }, _hoisted_12 = {
|
|
@@ -1439,11 +1479,11 @@ var _hoisted_1 = { class: "border border-neutral-300 rounded-lg bg-white shadow-
|
|
|
1439
1479
|
"onError"
|
|
1440
1480
|
],
|
|
1441
1481
|
setup(e, { emit: t }) {
|
|
1442
|
-
let n = e, r = t, i = ref(!1), s = ref(!1), d = ref(null), f = ref(null), p = ref(null), m = computed(() => toValue(n.requireCheckboxToEnable) ?? !1), h = computed(() => toValue(n.fetchOptions) ?? {}), g = computed(() => toValue(n.responseDisplayTimeout) ?? 2e4),
|
|
1443
|
-
|
|
1482
|
+
let n = e, r = t, i = ref(!1), s = ref(!1), d = ref(null), f = ref(null), p = ref(null), m = computed(() => toValue(n.requireCheckboxToEnable) ?? !1), h = computed(() => toValue(n.fetchOptions) ?? {}), g = computed(() => toValue(n.responseDisplayTimeout) ?? 2e4), _ = computed(() => toValue(n.fetchOnMount) ?? !1), ee = computed(() => toValue(n.fetchButtonText) ?? "Fetch"), y = computed(() => toValue(n.fetchButtonClass) ?? ""), b = computed(() => toValue(n.responseClass)), x = computed(() => toValue(n.responseMaxHeight) ?? "40vh"), te = computed(() => h.value.method || "GET"), C = computed(() => n.url === void 0 ? n.urlParts === void 0 ? "" : toValue(n.urlParts).join("") : toValue(n.url)), w = computed(() => m.value && !i.value ? !0 : s.value || !C.value), T = ref("neutral"), E = null, ne = () => {
|
|
1483
|
+
E && clearTimeout(E), E = setTimeout(() => {
|
|
1444
1484
|
T.value = "neutral";
|
|
1445
1485
|
}, g.value);
|
|
1446
|
-
},
|
|
1486
|
+
}, re = async () => {
|
|
1447
1487
|
if (!w.value) {
|
|
1448
1488
|
s.value = !0, T.value = "yellow", d.value = null, p.value = null, f.value = null, m.value && (i.value = !1), r("fetching", n);
|
|
1449
1489
|
try {
|
|
@@ -1452,24 +1492,24 @@ var _hoisted_1 = { class: "border border-neutral-300 rounded-lg bg-white shadow-
|
|
|
1452
1492
|
} catch (e) {
|
|
1453
1493
|
p.value = e.data || e.message || "Unknown error", f.value = e.status || 500, T.value = "red", r("onResult", n, e), r("onError", n, e);
|
|
1454
1494
|
} finally {
|
|
1455
|
-
s.value = !1,
|
|
1495
|
+
s.value = !1, ne();
|
|
1456
1496
|
}
|
|
1457
1497
|
}
|
|
1458
|
-
},
|
|
1498
|
+
}, ie = computed(() => {
|
|
1459
1499
|
switch (T.value) {
|
|
1460
1500
|
case "yellow": return "text-yellow-400 bg-yellow-900/30 border-yellow-700/50";
|
|
1461
1501
|
case "green": return "text-green-400 bg-green-900/30 border-green-700/50";
|
|
1462
1502
|
case "red": return "text-red-400 bg-red-900/30 border-red-700/50";
|
|
1463
1503
|
default: return "text-neutral-500 bg-neutral-800/50 border-neutral-700";
|
|
1464
1504
|
}
|
|
1465
|
-
}), { copy:
|
|
1505
|
+
}), { copy: ae, copied: A, isSupported: j } = useClipboard({ legacy: !0 }), M = () => {
|
|
1466
1506
|
let e = d.value || p.value;
|
|
1467
|
-
e &&
|
|
1507
|
+
e && ae(JSON.stringify(e, null, 2));
|
|
1468
1508
|
};
|
|
1469
1509
|
return onMounted(() => {
|
|
1470
|
-
C.value &&
|
|
1510
|
+
C.value && _.value && (!m.value || i.value) && re();
|
|
1471
1511
|
}), (e, t) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1472
|
-
createElementVNode("div", _hoisted_2, [createElementVNode("span", _hoisted_3, toDisplayString(
|
|
1512
|
+
createElementVNode("div", _hoisted_2, [createElementVNode("span", _hoisted_3, toDisplayString(te.value), 1), m.value ? (openBlock(), createElementBlock("div", _hoisted_4, [t[1] ||= createElementVNode("label", {
|
|
1473
1513
|
for: "enable-fetch",
|
|
1474
1514
|
class: "text-xs font-medium text-neutral-300 cursor-pointer select-none"
|
|
1475
1515
|
}, " Enable Request ", -1), withDirectives(createElementVNode("input", {
|
|
@@ -1488,17 +1528,17 @@ var _hoisted_1 = { class: "border border-neutral-300 rounded-lg bg-white shadow-
|
|
|
1488
1528
|
key: 0,
|
|
1489
1529
|
class: normalizeClass(["font-mono text-sm break-all text-neutral-600", toValue(n.urlClass)])
|
|
1490
1530
|
}, toDisplayString(C.value), 3))], 2), createElementVNode("button", {
|
|
1491
|
-
onClick:
|
|
1531
|
+
onClick: re,
|
|
1492
1532
|
disabled: w.value,
|
|
1493
|
-
class: normalizeClass(["shrink-0 px-4 py-2 text-sm font-medium rounded disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
1494
|
-
}, [s.value ? (openBlock(), createElementBlock("span", _hoisted_7, "Fetching...")) : (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(
|
|
1495
|
-
createElementVNode("div", _hoisted_9, [createElementVNode("div", { class: normalizeClass(["flex items-center justify-center font-mono text-2xl font-black shadow-sm transition-colors duration-300 h-16",
|
|
1533
|
+
class: normalizeClass(["shrink-0 px-4 py-2 text-sm font-medium rounded disabled:opacity-50 disabled:cursor-not-allowed transition-colors", y.value || "bg-indigo-600 text-white hover:bg-indigo-700"])
|
|
1534
|
+
}, [s.value ? (openBlock(), createElementBlock("span", _hoisted_7, "Fetching...")) : (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(ee.value), 1))], 10, _hoisted_6)]),
|
|
1535
|
+
createElementVNode("div", _hoisted_9, [createElementVNode("div", { class: normalizeClass(["flex items-center justify-center font-mono text-2xl font-black shadow-sm transition-colors duration-300 h-16", ie.value]) }, toDisplayString(f.value || "---"), 3), createElementVNode("div", _hoisted_10, [createElementVNode("div", _hoisted_11, [(d.value || p.value) && unref(j) ? (openBlock(), createElementBlock("button", {
|
|
1496
1536
|
key: 0,
|
|
1497
|
-
onClick: withModifiers(
|
|
1498
|
-
class: normalizeClass(["px-2.5 py-1.5 rounded-md text-xs font-bold font-mono border backdrop-blur-sm transition-all duration-200 opacity-0 transform -translate-y-1 group-hover:opacity-100 group-hover:translate-y-0 shadow shadow-neutral-900", unref(
|
|
1499
|
-
}, toDisplayString(unref(
|
|
1500
|
-
class: normalizeClass(["w-full overflow-y-auto transition-all duration-300 custom-scrollbar mt-1 overflow-x-hidden pr-16",
|
|
1501
|
-
style: normalizeStyle({ "--hover-max-h":
|
|
1537
|
+
onClick: withModifiers(M, ["prevent"]),
|
|
1538
|
+
class: normalizeClass(["px-2.5 py-1.5 rounded-md text-xs font-bold font-mono border backdrop-blur-sm transition-all duration-200 opacity-0 transform -translate-y-1 group-hover:opacity-100 group-hover:translate-y-0 shadow shadow-neutral-900", unref(A) ? "bg-emerald-900/80 text-emerald-300 border-emerald-700/50" : "bg-neutral-800/90 text-neutral-300 border-neutral-700 hover:bg-neutral-700"])
|
|
1539
|
+
}, toDisplayString(unref(A) ? "COPIED!" : "COPY"), 3)) : createCommentVNode("", !0)]), createElementVNode("div", {
|
|
1540
|
+
class: normalizeClass(["w-full overflow-y-auto transition-all duration-300 custom-scrollbar mt-1 overflow-x-hidden pr-16", b.value ? b.value : "max-h-12 hover:max-h-[var(--hover-max-h)]"]),
|
|
1541
|
+
style: normalizeStyle({ "--hover-max-h": x.value })
|
|
1502
1542
|
}, [d.value ? (openBlock(), createElementBlock("pre", _hoisted_12, toDisplayString(JSON.stringify(d.value, null, 2)), 1)) : p.value ? (openBlock(), createElementBlock("pre", _hoisted_13, toDisplayString(JSON.stringify(p.value, null, 2)), 1)) : (openBlock(), createElementBlock("div", _hoisted_14, "Awaiting request..."))], 6)])])
|
|
1503
1543
|
]));
|
|
1504
1544
|
}
|