@mkbabb/glass-ui 10.1.4 → 10.1.5
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/components/dark-mode-toggle/dark-mode-toggle.css +1 -1
- package/dist/components/dock/composables/dockMorphMeasure.d.ts +1 -1
- package/dist/components/dock/styles/adaptive-legibility.css +1 -1
- package/dist/components/dock/styles/controls/icon-button.css +1 -1
- package/dist/components/dock/styles/controls/tab-button.css +1 -1
- package/dist/components/dock/styles/controls/triggers.css +1 -1
- package/dist/components/dock/styles/crossfade.css +1 -1
- package/dist/components/dock/styles/layer-group.css +1 -1
- package/dist/components/dock/styles/morph.css +1 -1
- package/dist/components/dock/styles/run.css +1 -1
- package/dist/components/dock/styles/shell-regions.css +1 -1
- package/dist/components/slider/styles.css +1 -1
- package/dist/components/slider/types.d.ts +2 -2
- package/dist/components/tabs/styles/drag.css +1 -1
- package/dist/components/tabs/styles/segmented.css +1 -1
- package/dist/{data-table-DQuWkiwL.js → data-table-8y6fbyOB.js} +2 -2
- package/dist/data-table.js +1 -1
- package/dist/dock.js +684 -543
- package/dist/easing.js +1 -1
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +2 -2
- package/dist/labeled-field.js +1 -1
- package/dist/{slider-5uoY-cLG.js → slider-Dg3Qqdyo.js} +75 -63
- package/dist/slider.js +1 -1
- package/dist/styles/components.css +1 -1
- package/dist/styles/glass/control-surfaces.css +1 -1
- package/dist/styles/glass/glass-capsule.css +1 -1
- package/dist/styles/glass/overlay-plate.css +1 -1
- package/dist/styles/glass/value-marks.css +1 -1
- package/dist/styles/tokens/dark-arm.css +1 -1
- package/dist/styles/tokens/light-dark.css +1 -1
- package/dist/styles/tokens/sizing.css +1 -1
- package/dist/styles/utilities/components.css +1 -1
- package/package.json +1 -1
package/dist/dock.js
CHANGED
|
@@ -16,34 +16,34 @@ import { t as T } from "./useSelectionGroup-zsEwitF6.js";
|
|
|
16
16
|
import { t as E } from "./useDragMorph-B363RUbF.js";
|
|
17
17
|
import { n as D } from "./useDockCtaReceive-BSSgD6mu.js";
|
|
18
18
|
import { n as O, t as k } from "./useScrollChrome-BJbWV32F.js";
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { PopoverTrigger as
|
|
21
|
-
import { ChevronDown as
|
|
22
|
-
import { SpringProgress as
|
|
23
|
-
import { useMediaQuery as
|
|
19
|
+
import { Fragment as A, computed as j, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createVNode as I, defineComponent as L, h as R, mergeModels as z, mergeProps as B, nextTick as V, normalizeClass as H, normalizeStyle as ee, onBeforeUnmount as U, onMounted as te, onScopeDispose as W, onUnmounted as ne, openBlock as G, readonly as K, ref as q, renderList as re, renderSlot as J, resolveDynamicComponent as ie, toDisplayString as ae, unref as Y, useId as oe, useModel as se, useTemplateRef as X, watch as Z, withCtx as Q, withDirectives as ce } from "vue";
|
|
20
|
+
import { PopoverTrigger as le, Primitive as ue, SelectIcon as de, SelectTrigger as fe } from "reka-ui";
|
|
21
|
+
import { ChevronDown as pe, Pause as me, Play as he } from "@lucide/vue";
|
|
22
|
+
import { SpringProgress as ge } from "@mkbabb/keyframes.js";
|
|
23
|
+
import { useMediaQuery as _e } from "@vueuse/core";
|
|
24
24
|
//#region src/components/_shared/overlay/isTeleportedTarget.ts
|
|
25
|
-
function
|
|
25
|
+
function ve(e, t) {
|
|
26
26
|
if (!(e instanceof Element)) return !1;
|
|
27
27
|
let n = e.closest("[data-glass-dock-portal]");
|
|
28
28
|
return n ? !t || n.getAttribute("data-glass-dock-owner") === t : !1;
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/composables/glass/backdropSampleMath.ts
|
|
32
|
-
function
|
|
32
|
+
function ye(e) {
|
|
33
33
|
let t = e / 255;
|
|
34
34
|
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return .2126 *
|
|
36
|
+
function be(e, t, n) {
|
|
37
|
+
return .2126 * ye(e) + .7152 * ye(t) + .0722 * ye(n);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function xe(e, t, n, r, i) {
|
|
40
40
|
return [
|
|
41
41
|
e * r + i[0] * (1 - r),
|
|
42
42
|
t * r + i[1] * (1 - r),
|
|
43
43
|
n * r + i[2] * (1 - r)
|
|
44
44
|
];
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Se(e) {
|
|
47
47
|
let t = e.match(/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+))?/i);
|
|
48
48
|
return t ? [
|
|
49
49
|
Number(t[1]),
|
|
@@ -52,31 +52,31 @@ function Ce(e) {
|
|
|
52
52
|
t[4] === void 0 ? 1 : Number(t[4])
|
|
53
53
|
] : null;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Ce(e) {
|
|
56
56
|
return typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement;
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
function
|
|
58
|
+
var we = "[data-glass-field-canvas] canvas, canvas[data-glass-field-canvas]";
|
|
59
|
+
function Te(e) {
|
|
60
60
|
if (!e) {
|
|
61
61
|
if (typeof document < "u") {
|
|
62
|
-
let e = document.querySelector(
|
|
63
|
-
if (
|
|
62
|
+
let e = document.querySelector(we);
|
|
63
|
+
if (Ce(e)) return e;
|
|
64
64
|
}
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
67
|
-
if (
|
|
67
|
+
if (Ce(e)) return e;
|
|
68
68
|
if (typeof e == "function") {
|
|
69
69
|
let t = e();
|
|
70
|
-
return
|
|
70
|
+
return Ce(t) ? t : null;
|
|
71
71
|
}
|
|
72
72
|
if (typeof e == "string" && typeof document < "u") {
|
|
73
73
|
let t = document.querySelector(e);
|
|
74
|
-
return
|
|
74
|
+
return Ce(t) ? t : null;
|
|
75
75
|
}
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
let n =
|
|
78
|
+
function Ee(e, t) {
|
|
79
|
+
let n = Se(e);
|
|
80
80
|
if (n) return n;
|
|
81
81
|
if (!t) return null;
|
|
82
82
|
try {
|
|
@@ -92,7 +92,7 @@ function De(e, t) {
|
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function De(e, t, n, r) {
|
|
96
96
|
if (!t || t.width === 0 || t.height === 0 || !n) return null;
|
|
97
97
|
let i = e.getBoundingClientRect(), a = t.getBoundingClientRect();
|
|
98
98
|
if (a.width === 0 || a.height === 0) return null;
|
|
@@ -102,60 +102,60 @@ function Oe(e, t, n, r) {
|
|
|
102
102
|
n.clearRect(0, 0, 32, 32), n.drawImage(t, c, l, u, d, 0, 0, 32, 32);
|
|
103
103
|
let e = n.getImageData(0, 0, 32, 32).data, i = 0, a = 0, o = 0;
|
|
104
104
|
for (let t = 0; t < e.length; t += 4) {
|
|
105
|
-
let n = e[t + 3] / 255, [s, c, l] =
|
|
106
|
-
i +=
|
|
105
|
+
let n = e[t + 3] / 255, [s, c, l] = xe(e[t], e[t + 1], e[t + 2], n, r);
|
|
106
|
+
i += be(s, c, l), a += n, o++;
|
|
107
107
|
}
|
|
108
108
|
return o === 0 || a / o < .02 ? null : { luma: i / o };
|
|
109
109
|
} catch {
|
|
110
110
|
return null;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function Oe(e, t) {
|
|
114
114
|
let n = e.getBoundingClientRect(), r = n.left + n.width / 2, i = n.top + n.height / 2, a = document.elementsFromPoint(r, i);
|
|
115
115
|
for (let n of a) {
|
|
116
116
|
if (!(n instanceof HTMLElement) || n === e || e.contains(n)) continue;
|
|
117
|
-
let r = getComputedStyle(n).backgroundColor, i =
|
|
117
|
+
let r = getComputedStyle(n).backgroundColor, i = Ee(x(r, e), t);
|
|
118
118
|
if (i && !(i[3] < .5)) return i;
|
|
119
119
|
}
|
|
120
|
-
return
|
|
120
|
+
return Ee(x(getComputedStyle(document.body).backgroundColor, e), t);
|
|
121
121
|
}
|
|
122
|
-
var
|
|
122
|
+
var ke = [
|
|
123
123
|
255,
|
|
124
124
|
255,
|
|
125
125
|
255
|
|
126
126
|
];
|
|
127
|
-
function
|
|
128
|
-
let n =
|
|
127
|
+
function Ae(e, t) {
|
|
128
|
+
let n = Oe(e, t);
|
|
129
129
|
return n && n[3] >= .5 ? [
|
|
130
130
|
n[0],
|
|
131
131
|
n[1],
|
|
132
132
|
n[2]
|
|
133
|
-
] : [...
|
|
133
|
+
] : [...ke];
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
let n =
|
|
137
|
-
return n ?
|
|
135
|
+
function je(e, t) {
|
|
136
|
+
let n = Oe(e, t);
|
|
137
|
+
return n ? Me(n) : null;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
return { luma:
|
|
139
|
+
function Me(e) {
|
|
140
|
+
return { luma: be(e[0], e[1], e[2]) };
|
|
141
141
|
}
|
|
142
142
|
//#endregion
|
|
143
143
|
//#region src/composables/glass/useGlassBackdropLuminance.ts
|
|
144
|
-
var
|
|
145
|
-
function
|
|
144
|
+
var Ne = "data-glass-backdrop-shared";
|
|
145
|
+
function Pe(e, n = {}) {
|
|
146
146
|
let { lightThreshold: r = .6, minSampleIntervalMs: i = 250, writeBucket: a = !0 } = n, o = Math.max(250, i), s = n.shared === !0;
|
|
147
147
|
function c(e) {
|
|
148
|
-
return !s && e.closest(`[${
|
|
148
|
+
return !s && e.closest(`[${Ne}]`) !== null;
|
|
149
149
|
}
|
|
150
|
-
let l =
|
|
150
|
+
let l = q(null), u = q(null), d = q({
|
|
151
151
|
state: "pending",
|
|
152
152
|
mode: n.live === !0 ? "live" : "static",
|
|
153
153
|
source: n.live === !0 ? "canvas" : "elements"
|
|
154
154
|
});
|
|
155
155
|
if (typeof window > "u") return {
|
|
156
|
-
luma:
|
|
157
|
-
bucket:
|
|
158
|
-
sample:
|
|
156
|
+
luma: K(l),
|
|
157
|
+
bucket: K(u),
|
|
158
|
+
sample: K(d),
|
|
159
159
|
sampleNow: () => {},
|
|
160
160
|
dispose: () => {}
|
|
161
161
|
};
|
|
@@ -164,7 +164,7 @@ function Fe(e, n = {}) {
|
|
|
164
164
|
return p || (p = document.createElement("canvas"), p.width = 32, p.height = 32), m ||= p.getContext("2d", { willReadFrequently: !0 }), m;
|
|
165
165
|
}
|
|
166
166
|
function g() {
|
|
167
|
-
return n.live === void 0 ? e.value?.dataset.glassSample === "live" || n.backgroundCanvas != null ||
|
|
167
|
+
return n.live === void 0 ? e.value?.dataset.glassSample === "live" || n.backgroundCanvas != null || Te(void 0) !== null : n.live;
|
|
168
168
|
}
|
|
169
169
|
function _(e) {
|
|
170
170
|
let t = e.getBoundingClientRect();
|
|
@@ -202,7 +202,7 @@ function Fe(e, n = {}) {
|
|
|
202
202
|
function C() {
|
|
203
203
|
let t = e.value;
|
|
204
204
|
if (!t || c(t)) return;
|
|
205
|
-
let r = h(), i = g() ? "live" : "static", a = i === "live" ?
|
|
205
|
+
let r = h(), i = g() ? "live" : "static", a = i === "live" ? Te(n.backgroundCanvas) : null, o = i === "live" ? De(t, a, r, Ae(t, r)) : je(t, r), s = Date.now();
|
|
206
206
|
o ? v(o, t, i, s) : y(t, i, i === "live" && !a ? "source-unavailable" : "sample-unavailable", s), x = typeof performance < "u" ? performance.now() : s;
|
|
207
207
|
}
|
|
208
208
|
let w = O(({ now: e }) => {
|
|
@@ -226,9 +226,9 @@ function Fe(e, n = {}) {
|
|
|
226
226
|
}
|
|
227
227
|
f.value ? (w.stop(), C()) : g() && w.start();
|
|
228
228
|
}
|
|
229
|
-
let k =
|
|
229
|
+
let k = Z(f, D, { flush: "sync" }), A = Z(() => e.value, (e) => {
|
|
230
230
|
if (e) {
|
|
231
|
-
if (s) e.setAttribute(
|
|
231
|
+
if (s) e.setAttribute(Ne, "");
|
|
232
232
|
else if (c(e)) return;
|
|
233
233
|
C(), D();
|
|
234
234
|
}
|
|
@@ -236,21 +236,21 @@ function Fe(e, n = {}) {
|
|
|
236
236
|
immediate: !0,
|
|
237
237
|
flush: "post"
|
|
238
238
|
});
|
|
239
|
-
function
|
|
240
|
-
|
|
239
|
+
function j() {
|
|
240
|
+
A(), k(), w.dispose(), T.dispose(), E.stop(), p = null, m = null;
|
|
241
241
|
}
|
|
242
|
-
return
|
|
243
|
-
luma:
|
|
244
|
-
bucket:
|
|
245
|
-
sample:
|
|
242
|
+
return W(j), {
|
|
243
|
+
luma: K(l),
|
|
244
|
+
bucket: K(u),
|
|
245
|
+
sample: K(d),
|
|
246
246
|
sampleNow: C,
|
|
247
|
-
dispose:
|
|
247
|
+
dispose: j
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
250
|
//#endregion
|
|
251
251
|
//#region src/components/dock/composables/useDockState.ts
|
|
252
|
-
function
|
|
253
|
-
let { collapseDelay: t = u, rootEl: n, alwaysExpanded: r = !1, initialExpanded: i = !1, isTransitioning: a, dockId: o, onStateChange: s } = e, c = () => typeof r == "boolean" ? r : r.value, l = () => c(), d =
|
|
252
|
+
function Fe(e) {
|
|
253
|
+
let { collapseDelay: t = u, rootEl: n, alwaysExpanded: r = !1, initialExpanded: i = !1, isTransitioning: a, dockId: o, onStateChange: s } = e, c = () => typeof r == "boolean" ? r : r.value, l = () => c(), d = q(c() ? "pinned" : i ? "hover" : "collapsed"), f = j(() => d.value !== "collapsed"), p = j(() => d.value === "pinned"), m = null, h = q(0), g = q(0), _ = j(() => h.value > 0), v = j(() => g.value > 0), y = null, b = null, x = !1, S = null;
|
|
254
254
|
function C() {
|
|
255
255
|
S &&= (clearTimeout(S), null);
|
|
256
256
|
}
|
|
@@ -258,17 +258,17 @@ function Ie(e) {
|
|
|
258
258
|
function O() {
|
|
259
259
|
if (!w) return;
|
|
260
260
|
w = null, E &&= (clearTimeout(E), null);
|
|
261
|
-
for (let [e, t] of
|
|
261
|
+
for (let [e, t] of M) window.removeEventListener(e, t, !0);
|
|
262
262
|
let e = T;
|
|
263
|
-
T = null, e && !l() && d.value === "collapsed" && (
|
|
263
|
+
T = null, e && !l() && d.value === "collapsed" && (I(), d.value = "hover", F());
|
|
264
264
|
}
|
|
265
265
|
function k() {
|
|
266
266
|
E ??= setTimeout(O, 0);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function A() {
|
|
269
269
|
T = null, O();
|
|
270
270
|
}
|
|
271
|
-
let
|
|
271
|
+
let M = [
|
|
272
272
|
["click", () => O()],
|
|
273
273
|
["pointercancel", () => O()],
|
|
274
274
|
["dragstart", () => O()],
|
|
@@ -283,139 +283,139 @@ function Ie(e) {
|
|
|
283
283
|
w === "compat" && k();
|
|
284
284
|
}],
|
|
285
285
|
["pointerdown", (e) => {
|
|
286
|
-
(w === "tap" || e.isPrimary) &&
|
|
286
|
+
(w === "tap" || e.isPrimary) && A();
|
|
287
287
|
}]
|
|
288
288
|
];
|
|
289
|
-
function
|
|
290
|
-
w &&
|
|
291
|
-
for (let [e, t] of
|
|
289
|
+
function N() {
|
|
290
|
+
w && A(), w = "down";
|
|
291
|
+
for (let [e, t] of M) window.addEventListener(e, t, !0);
|
|
292
292
|
}
|
|
293
|
-
|
|
294
|
-
e && (e.addEventListener("pointerdown",
|
|
293
|
+
Z(n, (e, t, n) => {
|
|
294
|
+
e && (e.addEventListener("pointerdown", N, !0), n(() => e.removeEventListener("pointerdown", N, !0)));
|
|
295
295
|
}, {
|
|
296
296
|
immediate: !0,
|
|
297
297
|
flush: "sync"
|
|
298
298
|
});
|
|
299
|
-
let
|
|
300
|
-
function P() {
|
|
301
|
-
c() && (d.value = "pinned"), s && N !== d.value && s(d.value, N), N = d.value;
|
|
302
|
-
}
|
|
299
|
+
let P = d.value;
|
|
303
300
|
function F() {
|
|
304
|
-
|
|
301
|
+
c() && (d.value = "pinned"), s && P !== d.value && s(d.value, P), P = d.value;
|
|
305
302
|
}
|
|
306
303
|
function I() {
|
|
304
|
+
m &&= (clearTimeout(m), null);
|
|
305
|
+
}
|
|
306
|
+
function L() {
|
|
307
307
|
b !== null && (cancelAnimationFrame(b), b = null);
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
|
|
309
|
+
function R() {
|
|
310
|
+
L(), y?.();
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
l() || h.value > 0 || (
|
|
314
|
-
d.value = "collapsed",
|
|
312
|
+
function z() {
|
|
313
|
+
l() || h.value > 0 || (I(), m = setTimeout(() => {
|
|
314
|
+
d.value = "collapsed", F();
|
|
315
315
|
}, t));
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function B() {
|
|
318
318
|
if (c()) {
|
|
319
|
-
d.value = "pinned",
|
|
319
|
+
d.value = "pinned", F();
|
|
320
320
|
return;
|
|
321
321
|
}
|
|
322
|
-
x ||= (x = !0,
|
|
322
|
+
x ||= (x = !0, I(), C(), d.value = "collapsed", F(), !1);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function V() {
|
|
325
325
|
if (c()) {
|
|
326
|
-
d.value = "pinned",
|
|
326
|
+
d.value = "pinned", F();
|
|
327
327
|
return;
|
|
328
328
|
}
|
|
329
|
-
|
|
329
|
+
I(), C(), d.value = "hover", F();
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
l() || (
|
|
331
|
+
function H() {
|
|
332
|
+
l() || (I(), d.value === "collapsed" && (C(), S = setTimeout(() => {
|
|
333
333
|
if (S = null, !l() && d.value === "collapsed") {
|
|
334
334
|
if (D()) {
|
|
335
335
|
T ??= "hover";
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
|
-
d.value = "hover",
|
|
338
|
+
d.value = "hover", F();
|
|
339
339
|
}
|
|
340
340
|
}, 60)));
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function ee(e) {
|
|
343
343
|
if (!l() && (C(), T === "hover" && (T = null), d.value === "hover")) {
|
|
344
344
|
if (h.value > 0) return;
|
|
345
345
|
if (e) {
|
|
346
346
|
let t = n.value;
|
|
347
|
-
if (t && e.relatedTarget instanceof Node && t.contains(e.relatedTarget) ||
|
|
347
|
+
if (t && e.relatedTarget instanceof Node && t.contains(e.relatedTarget) || ve(e.relatedTarget, o)) return;
|
|
348
348
|
}
|
|
349
|
-
|
|
349
|
+
z();
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
if (!l() && (
|
|
352
|
+
function U() {
|
|
353
|
+
if (!l() && (I(), d.value === "collapsed")) {
|
|
354
354
|
if (D()) {
|
|
355
355
|
T = "focus";
|
|
356
356
|
return;
|
|
357
357
|
}
|
|
358
|
-
d.value = "hover",
|
|
358
|
+
d.value = "hover", F();
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function te(e) {
|
|
362
362
|
if (l()) return;
|
|
363
|
-
let t = e.currentTarget, n = !!e.relatedTarget && t.contains(e.relatedTarget) ||
|
|
364
|
-
!n && T === "focus" && (T = null), d.value === "hover" && (h.value > 0 || n ||
|
|
365
|
-
}
|
|
366
|
-
function U() {
|
|
367
|
-
l() || (F(), C(), d.value = "pinned", P());
|
|
363
|
+
let t = e.currentTarget, n = !!e.relatedTarget && t.contains(e.relatedTarget) || ve(e.relatedTarget, o);
|
|
364
|
+
!n && T === "focus" && (T = null), d.value === "hover" && (h.value > 0 || n || z());
|
|
368
365
|
}
|
|
369
|
-
function W(
|
|
370
|
-
|
|
366
|
+
function W() {
|
|
367
|
+
l() || (I(), C(), d.value = "pinned", F());
|
|
371
368
|
}
|
|
372
369
|
function G(e = "morph") {
|
|
373
|
-
e === "grasp" &&
|
|
374
|
-
|
|
370
|
+
h.value++, e === "grasp" && g.value++, I();
|
|
371
|
+
}
|
|
372
|
+
function K(e = "morph") {
|
|
373
|
+
e === "grasp" && (g.value = Math.max(0, g.value - 1)), h.value = Math.max(0, h.value - 1), h.value === 0 && d.value === "hover" && (I(), m = setTimeout(() => {
|
|
374
|
+
h.value === 0 && d.value === "hover" && z();
|
|
375
375
|
}, Math.min(t, 800)));
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function re(e) {
|
|
378
378
|
if (l() || h.value > 0 || a?.value) return;
|
|
379
379
|
let t = n.value;
|
|
380
|
-
!t || t.contains(e.target) ||
|
|
380
|
+
!t || t.contains(e.target) || ve(e.target, o) || B();
|
|
381
381
|
}
|
|
382
|
-
return
|
|
382
|
+
return Z(f, (e) => {
|
|
383
383
|
if (e) {
|
|
384
384
|
if (typeof document > "u") return;
|
|
385
|
-
|
|
386
|
-
b = null, f.value && (document.addEventListener("pointerdown",
|
|
387
|
-
document.removeEventListener("pointerdown",
|
|
385
|
+
R(), b = requestAnimationFrame(() => {
|
|
386
|
+
b = null, f.value && (document.addEventListener("pointerdown", re, !0), y = () => {
|
|
387
|
+
document.removeEventListener("pointerdown", re, !0), y = null;
|
|
388
388
|
});
|
|
389
389
|
});
|
|
390
|
-
} else
|
|
391
|
-
}, { immediate: !0 }), typeof r == "boolean" ? r && (d.value = "pinned",
|
|
390
|
+
} else R();
|
|
391
|
+
}, { immediate: !0 }), typeof r == "boolean" ? r && (d.value = "pinned", F()) : Z(r, (e) => {
|
|
392
392
|
if (e) {
|
|
393
|
-
|
|
393
|
+
I(), d.value = "pinned", F();
|
|
394
394
|
return;
|
|
395
395
|
}
|
|
396
|
-
d.value = "collapsed",
|
|
397
|
-
}),
|
|
398
|
-
|
|
396
|
+
d.value = "collapsed", F();
|
|
397
|
+
}), d.value === "hover" && z(), ne(() => {
|
|
398
|
+
I(), C(), R(), A();
|
|
399
399
|
}), {
|
|
400
400
|
state: d,
|
|
401
401
|
expanded: f,
|
|
402
402
|
isPinned: p,
|
|
403
403
|
isHeld: _,
|
|
404
404
|
graspHeld: v,
|
|
405
|
-
onMouseEnter:
|
|
406
|
-
onMouseLeave:
|
|
407
|
-
onFocusIn:
|
|
408
|
-
onFocusOut:
|
|
409
|
-
onClickCollapsed:
|
|
410
|
-
keepOpen:
|
|
411
|
-
release:
|
|
412
|
-
expand:
|
|
413
|
-
collapse:
|
|
405
|
+
onMouseEnter: H,
|
|
406
|
+
onMouseLeave: ee,
|
|
407
|
+
onFocusIn: U,
|
|
408
|
+
onFocusOut: te,
|
|
409
|
+
onClickCollapsed: W,
|
|
410
|
+
keepOpen: G,
|
|
411
|
+
release: K,
|
|
412
|
+
expand: V,
|
|
413
|
+
collapse: B
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
416
|
//#endregion
|
|
417
417
|
//#region src/components/dock/composables/useDockSpring.ts
|
|
418
|
-
function
|
|
418
|
+
function Ie(e) {
|
|
419
419
|
let t = null, n = () => t !== null && !t.settled;
|
|
420
420
|
function i() {
|
|
421
421
|
t &&= (t.dispose(), null);
|
|
@@ -423,7 +423,7 @@ function Le(e) {
|
|
|
423
423
|
function a(a, o, s) {
|
|
424
424
|
let c = n() ? t.velocity * (s.inheritVelocityScale ?? 1) : 0;
|
|
425
425
|
i();
|
|
426
|
-
let l = new
|
|
426
|
+
let l = new ge({
|
|
427
427
|
response: e.response * r(),
|
|
428
428
|
dampingFraction: e.dampingFraction,
|
|
429
429
|
initial: a,
|
|
@@ -450,11 +450,11 @@ function Le(e) {
|
|
|
450
450
|
}
|
|
451
451
|
//#endregion
|
|
452
452
|
//#region src/components/dock/composables/useDockMorph.ts
|
|
453
|
-
function
|
|
454
|
-
let { rootEl: t, outerActiveLayer: n, geometry: r } = e, i =
|
|
453
|
+
function Le(e) {
|
|
454
|
+
let { rootEl: t, outerActiveLayer: n, geometry: r } = e, i = q(n.value), a = q(null), o = Ie({
|
|
455
455
|
response: d.response,
|
|
456
456
|
dampingFraction: d.dampingFraction
|
|
457
|
-
}), s =
|
|
457
|
+
}), s = _e("(prefers-reduced-motion: reduce)");
|
|
458
458
|
function c() {
|
|
459
459
|
return t.value;
|
|
460
460
|
}
|
|
@@ -463,7 +463,7 @@ function Re(e) {
|
|
|
463
463
|
let t = c();
|
|
464
464
|
t && (t.removeAttribute("data-morphing"), t.style.removeProperty("--dock-morph-t"), r.release()), e.onMorphActiveChange?.(!1), o.dispose();
|
|
465
465
|
}
|
|
466
|
-
|
|
466
|
+
Z(s, (e) => {
|
|
467
467
|
e && c()?.hasAttribute("data-morphing") && l();
|
|
468
468
|
});
|
|
469
469
|
function u() {
|
|
@@ -479,16 +479,16 @@ function Re(e) {
|
|
|
479
479
|
onSettle: l
|
|
480
480
|
});
|
|
481
481
|
}
|
|
482
|
-
let f =
|
|
482
|
+
let f = Z(n, (e, t) => {
|
|
483
483
|
e !== t && (c() && r.first(), i.value = e, a.value = c() ? t : null);
|
|
484
|
-
}), p =
|
|
484
|
+
}), p = Z(n, (e, t) => {
|
|
485
485
|
e === t || !c() || (r.measure(), u());
|
|
486
486
|
}, { flush: "post" });
|
|
487
|
-
return
|
|
487
|
+
return ne(() => {
|
|
488
488
|
f(), p(), o.dispose();
|
|
489
489
|
}), {
|
|
490
|
-
outerCurrentLayer:
|
|
491
|
-
outerLeavingLayer:
|
|
490
|
+
outerCurrentLayer: K(i),
|
|
491
|
+
outerLeavingLayer: K(a)
|
|
492
492
|
};
|
|
493
493
|
}
|
|
494
494
|
//#endregion
|
|
@@ -496,7 +496,7 @@ function Re(e) {
|
|
|
496
496
|
function $(e, t) {
|
|
497
497
|
return t === "vertical" ? e.offsetHeight : e.offsetWidth;
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function Re(e, t) {
|
|
500
500
|
let n = e.map(([e, t]) => [
|
|
501
501
|
e,
|
|
502
502
|
t,
|
|
@@ -510,7 +510,7 @@ function ze(e, t) {
|
|
|
510
510
|
for (let [e, t, r, i] of n.reverse()) r ? e.style.setProperty(t, r, i) : e.style.removeProperty(t);
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function ze(e, t) {
|
|
514
514
|
let n = e.scrollLeft, r = e.scrollTop;
|
|
515
515
|
try {
|
|
516
516
|
return t();
|
|
@@ -522,43 +522,43 @@ function Be(e, t) {
|
|
|
522
522
|
});
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
526
|
-
let
|
|
527
|
-
return
|
|
525
|
+
function Be(e, t, n, r, i, a) {
|
|
526
|
+
let o = i === "vertical" ? "margin-block-end" : "margin-inline-end";
|
|
527
|
+
return Re([
|
|
528
528
|
[
|
|
529
529
|
e,
|
|
530
530
|
"--dock-expanded-px",
|
|
531
531
|
"initial"
|
|
532
532
|
],
|
|
533
533
|
[
|
|
534
|
-
|
|
534
|
+
n,
|
|
535
535
|
"position",
|
|
536
536
|
"relative"
|
|
537
537
|
],
|
|
538
538
|
[
|
|
539
|
-
|
|
539
|
+
n,
|
|
540
540
|
"inset",
|
|
541
541
|
"auto"
|
|
542
542
|
],
|
|
543
543
|
[
|
|
544
|
-
|
|
544
|
+
r,
|
|
545
545
|
"position",
|
|
546
546
|
"absolute"
|
|
547
547
|
]
|
|
548
548
|
], () => {
|
|
549
|
-
let
|
|
550
|
-
if (
|
|
551
|
-
let
|
|
552
|
-
if (Math.abs(
|
|
553
|
-
let
|
|
554
|
-
return
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
`${
|
|
558
|
-
]], () => $(e,
|
|
549
|
+
let r = $(e, i);
|
|
550
|
+
if (a === null) return r;
|
|
551
|
+
let s = a - (r - $(t, i));
|
|
552
|
+
if (Math.abs(s) < .5) return r;
|
|
553
|
+
let c = Number.parseFloat(getComputedStyle(n).getPropertyValue(o)) || 0;
|
|
554
|
+
return Re([[
|
|
555
|
+
n,
|
|
556
|
+
o,
|
|
557
|
+
`${c + s}px`
|
|
558
|
+
]], () => $(e, i));
|
|
559
559
|
});
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Ve(e, t) {
|
|
562
562
|
let n = e.getBoundingClientRect();
|
|
563
563
|
return t === "vertical" ? {
|
|
564
564
|
start: n.top,
|
|
@@ -568,21 +568,48 @@ function He(e, t) {
|
|
|
568
568
|
size: n.width
|
|
569
569
|
};
|
|
570
570
|
}
|
|
571
|
-
var
|
|
572
|
-
function Ge(e) {
|
|
573
|
-
let
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
571
|
+
var He = "--dock-morph-origin", Ue = "--dock-pane-shift", We = 2;
|
|
572
|
+
function Ge(e, t) {
|
|
573
|
+
let n = getComputedStyle(e), r = e.parentElement;
|
|
574
|
+
if (!r) return "";
|
|
575
|
+
let i = getComputedStyle(r);
|
|
576
|
+
return t === "vertical" ? `${r.clientHeight - parseFloat(i.paddingTop) - parseFloat(i.paddingBottom)} ${n.minHeight} ${n.maxHeight} ${window.innerHeight}` : `${r.clientWidth - parseFloat(i.paddingLeft) - parseFloat(i.paddingRight)} ${n.minWidth} ${n.maxWidth} ${window.innerWidth}`;
|
|
577
|
+
}
|
|
578
|
+
function Ke(e) {
|
|
579
|
+
let { rootEl: t, contentEl: n, expandedEl: r, collapsedEl: i, axis: a } = e, o = null, s = null, c = null, l = /* @__PURE__ */ new Map(), u = null, d = null, f = null, p = null, m = null, h = null, g = "", _ = !1, v = !1;
|
|
580
|
+
function b() {
|
|
581
|
+
let e = t.value, o = n.value, s = r.value, c = i.value;
|
|
582
|
+
if (!e || !o || !s || !c) return;
|
|
583
|
+
let l = a.value, u = s.classList.contains("is-active"), d = e.hasAttribute("data-morphing");
|
|
584
|
+
if (!d) {
|
|
585
|
+
let t = $(e, l) - $(o, l);
|
|
586
|
+
u ? f = t : p = t;
|
|
581
587
|
}
|
|
582
|
-
let
|
|
583
|
-
|
|
588
|
+
let v = ze(s, () => Be(e, o, s, c, l, f));
|
|
589
|
+
if (!d) h = v, g = "", _ = !1;
|
|
590
|
+
else {
|
|
591
|
+
let t = Ge(e, l);
|
|
592
|
+
g ||= t, _ ||= t !== g, !_ && h !== null && Math.abs(v - h) <= We && (v = h);
|
|
593
|
+
}
|
|
594
|
+
C(e, s, d && v !== h && f !== null && S !== null ? v - f - S : void 0), u || (m = ze(s, () => Be(e, o, c, s, l, p))), !(v <= 0) && (m !== null && m > 0 && e.style.setProperty("--dock-collapsed-px", `${m}px`), e.style.setProperty("--dock-expanded-px", `${Math.max(v, m ?? 0)}px`));
|
|
595
|
+
}
|
|
596
|
+
let x = "", S = null;
|
|
597
|
+
function C(e, t, r) {
|
|
598
|
+
if (!t.classList.contains("is-active")) return;
|
|
599
|
+
let i = e.hasAttribute("data-morphing");
|
|
600
|
+
if (i && r === void 0) return;
|
|
601
|
+
let o = a.value === "horizontal", s = Infinity, c = -Infinity;
|
|
602
|
+
for (let e of t.children) {
|
|
603
|
+
if (!(e instanceof HTMLElement) || e.offsetParent !== t) continue;
|
|
604
|
+
let n = o ? e.offsetLeft : e.offsetTop;
|
|
605
|
+
s = Math.min(s, n), c = Math.max(c, n + (o ? e.offsetWidth : e.offsetHeight));
|
|
606
|
+
}
|
|
607
|
+
let l = o ? t.clientWidth : t.clientHeight, u = n.value;
|
|
608
|
+
!i && u && (S = $(u, a.value) - l);
|
|
609
|
+
let d = r ?? l, f = c > s && c - s <= d, p = !o && f ? `${Math.floor((d - (c - s)) / 2 * 100) / 100}px` : "", m = `${f ? "1" : "0"} ${p}`;
|
|
610
|
+
m !== x && (x = m, p ? e.style.setProperty("--dock-run-room-block", p) : e.style.removeProperty("--dock-run-room-block"), e.toggleAttribute("data-run-fits", f));
|
|
584
611
|
}
|
|
585
|
-
function
|
|
612
|
+
function w() {
|
|
586
613
|
if (!o) return;
|
|
587
614
|
o.disconnect();
|
|
588
615
|
let e = [r.value, i.value], a = t.value;
|
|
@@ -594,66 +621,132 @@ function Ge(e) {
|
|
|
594
621
|
]) t && o.observe(t);
|
|
595
622
|
for (let t of e) for (let e of t?.children ?? []) o.observe(e);
|
|
596
623
|
}
|
|
597
|
-
function
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
624
|
+
function T(e, t, n) {
|
|
625
|
+
let r = a.value === "vertical" ? t : n;
|
|
626
|
+
e.style.setProperty("--dock-plate-cross-px", `${r}px`);
|
|
627
|
+
}
|
|
628
|
+
function E(e) {
|
|
629
|
+
let t = e.querySelector(":scope > .dock-plate");
|
|
630
|
+
t && (T(e, t.offsetWidth, t.offsetHeight), !(typeof ResizeObserver > "u") && (s = new ResizeObserver(([t]) => {
|
|
631
|
+
let n = t?.borderBoxSize?.[0];
|
|
632
|
+
n && T(e, n.inlineSize, n.blockSize);
|
|
633
|
+
}), s.observe(t)));
|
|
634
|
+
}
|
|
635
|
+
let D = `[${y}]:not(.dock-trigger)`, O = "";
|
|
636
|
+
function k(e) {
|
|
637
|
+
let t = 0, n = 0;
|
|
638
|
+
for (let e of l.values()) t = Math.max(t, e.inline), n = Math.max(n, e.block);
|
|
639
|
+
let r = `${t} ${n}`;
|
|
640
|
+
r !== O && (O = r, e.style.setProperty("--dock-seat-max-inline-px", `${t}px`), e.style.setProperty("--dock-seat-max-block-px", `${n}px`));
|
|
641
|
+
}
|
|
642
|
+
function A() {
|
|
643
|
+
let e = t.value, n = r.value;
|
|
644
|
+
if (!e || !n) return;
|
|
645
|
+
let i = new Set(n.querySelectorAll(D));
|
|
646
|
+
i.size > 0 && !c && typeof ResizeObserver < "u" && (c = new ResizeObserver((t) => {
|
|
647
|
+
for (let e of t) {
|
|
648
|
+
let t = e.borderBoxSize?.[0];
|
|
649
|
+
t && l.has(e.target) && l.set(e.target, {
|
|
650
|
+
inline: t.inlineSize,
|
|
651
|
+
block: t.blockSize
|
|
602
652
|
});
|
|
603
|
-
|
|
653
|
+
}
|
|
654
|
+
k(e);
|
|
655
|
+
}));
|
|
656
|
+
for (let e of l.keys()) i.has(e) || (c?.unobserve(e), l.delete(e));
|
|
657
|
+
for (let e of i) l.has(e) || (l.set(e, {
|
|
658
|
+
inline: e.offsetWidth,
|
|
659
|
+
block: e.offsetHeight
|
|
660
|
+
}), c?.observe(e));
|
|
661
|
+
k(e);
|
|
662
|
+
}
|
|
663
|
+
function j() {
|
|
664
|
+
o?.disconnect(), o = null, s?.disconnect(), s = null, c?.disconnect(), c = null, u?.disconnect(), u = null, d?.disconnect(), d = null, l.clear(), O = "", x = "", S = null, h = null, g = "", _ = !1;
|
|
665
|
+
let e = t.value;
|
|
666
|
+
if (e) {
|
|
667
|
+
if (typeof ResizeObserver < "u" && (o = new ResizeObserver(() => b()), w()), E(e), A(), typeof MutationObserver < "u") {
|
|
668
|
+
u = new MutationObserver(() => {
|
|
669
|
+
w(), A(), b();
|
|
670
|
+
});
|
|
671
|
+
for (let e of [r.value, i.value]) e && u.observe(e, {
|
|
604
672
|
childList: !0,
|
|
605
673
|
subtree: !0,
|
|
606
674
|
characterData: !0
|
|
607
675
|
});
|
|
676
|
+
d = new MutationObserver(() => {
|
|
677
|
+
_ || !g || !e.hasAttribute("data-morphing") || Ge(e, a.value) !== g && b();
|
|
678
|
+
}), d.observe(e, {
|
|
679
|
+
attributes: !0,
|
|
680
|
+
attributeFilter: ["style", "class"]
|
|
681
|
+
});
|
|
608
682
|
}
|
|
609
|
-
|
|
683
|
+
b();
|
|
610
684
|
}
|
|
611
685
|
}
|
|
612
|
-
|
|
686
|
+
Z([
|
|
613
687
|
t,
|
|
614
688
|
n,
|
|
615
689
|
r,
|
|
616
690
|
i,
|
|
617
691
|
a
|
|
618
|
-
],
|
|
619
|
-
let
|
|
620
|
-
typeof window < "u" && window.addEventListener("resize",
|
|
621
|
-
let
|
|
622
|
-
|
|
623
|
-
|
|
692
|
+
], j, { immediate: !0 });
|
|
693
|
+
let M = () => b();
|
|
694
|
+
typeof window < "u" && window.addEventListener("resize", M);
|
|
695
|
+
let N = typeof document < "u" ? document.fonts : void 0;
|
|
696
|
+
N && N.ready.then(() => !v && b()), W(() => {
|
|
697
|
+
v = !0, o?.disconnect(), o = null, s?.disconnect(), s = null, c?.disconnect(), c = null, u?.disconnect(), u = null, d?.disconnect(), d = null, typeof window < "u" && window.removeEventListener("resize", M);
|
|
624
698
|
});
|
|
625
|
-
let
|
|
626
|
-
function
|
|
699
|
+
let P = null, F = null;
|
|
700
|
+
function I(e) {
|
|
627
701
|
return [...e.querySelectorAll(":scope > .dock-controls > .dock-persistent")];
|
|
628
702
|
}
|
|
629
|
-
function
|
|
703
|
+
function L() {
|
|
630
704
|
return [r.value, i.value].filter((e) => !!e);
|
|
631
705
|
}
|
|
632
|
-
function
|
|
706
|
+
function R() {
|
|
633
707
|
let e = t.value;
|
|
634
708
|
if (!e) return;
|
|
635
709
|
let n = a.value;
|
|
636
|
-
|
|
710
|
+
P = new Map([
|
|
637
711
|
e,
|
|
638
|
-
...
|
|
639
|
-
...
|
|
640
|
-
].map((e) => [e,
|
|
712
|
+
...I(e),
|
|
713
|
+
...L()
|
|
714
|
+
].map((e) => [e, Ve(e, n)]));
|
|
715
|
+
let i = r.value;
|
|
716
|
+
F = i ? {
|
|
717
|
+
left: i.scrollLeft,
|
|
718
|
+
top: i.scrollTop
|
|
719
|
+
} : null;
|
|
641
720
|
}
|
|
642
|
-
function
|
|
721
|
+
function z() {
|
|
643
722
|
let e = t.value;
|
|
644
723
|
if (e) {
|
|
645
724
|
for (let t of [
|
|
646
725
|
e,
|
|
647
|
-
...
|
|
726
|
+
...I(e),
|
|
648
727
|
n.value
|
|
649
|
-
]) t?.style.removeProperty(
|
|
650
|
-
for (let e of
|
|
728
|
+
]) t?.style.removeProperty(He);
|
|
729
|
+
for (let e of L()) e.style.removeProperty(Ue);
|
|
730
|
+
r.value && C(e, r.value);
|
|
651
731
|
}
|
|
652
732
|
}
|
|
653
|
-
function
|
|
654
|
-
let e =
|
|
655
|
-
|
|
656
|
-
|
|
733
|
+
function B() {
|
|
734
|
+
let e = r.value, t = F;
|
|
735
|
+
F = null;
|
|
736
|
+
try {
|
|
737
|
+
V();
|
|
738
|
+
} finally {
|
|
739
|
+
e?.classList.contains("is-leaving") && t && (e.scrollLeft !== t.left || e.scrollTop !== t.top) && e.scrollTo({
|
|
740
|
+
left: t.left,
|
|
741
|
+
top: t.top,
|
|
742
|
+
behavior: "instant"
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
function V() {
|
|
747
|
+
let e = t.value, i = n.value, o = P;
|
|
748
|
+
if (P = null, z(), !e || !i || !o || !o.get(e)) return;
|
|
749
|
+
let s = a.value, c = I(e), l = Ve(e, s), u = [
|
|
657
750
|
e,
|
|
658
751
|
...c,
|
|
659
752
|
i
|
|
@@ -665,10 +758,10 @@ function Ge(e) {
|
|
|
665
758
|
e,
|
|
666
759
|
...c,
|
|
667
760
|
i,
|
|
668
|
-
...
|
|
669
|
-
].map((e) => [e,
|
|
761
|
+
...L()
|
|
762
|
+
].map((e) => [e, Ve(e, s)])), f = Re(u, d), p = f.get(e), m = $(e, s), h = p.size / m;
|
|
670
763
|
if (!(h > 0)) return;
|
|
671
|
-
let g = (e) => Math.abs(1 - e) < 1e-4,
|
|
764
|
+
let g = (e) => Math.abs(1 - e) < 1e-4, _ = l.size / p.size, v = !r.value?.classList.contains("is-active") || g(_) ? Re([
|
|
672
765
|
...u,
|
|
673
766
|
[
|
|
674
767
|
e,
|
|
@@ -680,65 +773,85 @@ function Ge(e) {
|
|
|
680
773
|
"--dock-morph-t",
|
|
681
774
|
"1"
|
|
682
775
|
]
|
|
683
|
-
], d) : null,
|
|
684
|
-
if (
|
|
685
|
-
let
|
|
686
|
-
e.style.setProperty(
|
|
776
|
+
], d) : null, y = o;
|
|
777
|
+
if (v && g(_) && (y = v, _ = v.get(e).size / p.size), !Number.isFinite(_)) return;
|
|
778
|
+
let b = (e) => (e - p.start) / h, x = (e, t) => g(_) ? null : (e - t) / (1 - _), S = (e) => b(e.start + e.size / 2), C = x(b(y.get(e).start), 0) ?? m / 2, w = (e, t) => `${e / t * 100}%`;
|
|
779
|
+
e.style.setProperty(He, w(C, m));
|
|
687
780
|
for (let e of c) {
|
|
688
|
-
let t =
|
|
781
|
+
let t = y.get(e), n = f.get(e), r = $(e, s);
|
|
689
782
|
if (!t || !(r > 0)) continue;
|
|
690
|
-
let i =
|
|
691
|
-
e.style.setProperty(
|
|
783
|
+
let i = x(S(t), S(n));
|
|
784
|
+
e.style.setProperty(He, w((i === null ? C : C - i) - b(n.start), r));
|
|
692
785
|
}
|
|
693
|
-
let
|
|
694
|
-
|
|
695
|
-
for (let t of
|
|
696
|
-
let n = t.classList.contains("is-leaving"), r = n ? o.get(t) :
|
|
786
|
+
let T = $(i, s);
|
|
787
|
+
T > 0 && i.style.setProperty(He, w(C - b(f.get(i).start), T));
|
|
788
|
+
for (let t of L()) {
|
|
789
|
+
let n = t.classList.contains("is-leaving"), r = n ? o.get(t) : v?.get(t), i = $(t, s);
|
|
697
790
|
if (!r || !(i > 0)) continue;
|
|
698
|
-
let a = n ? f.get(t) :
|
|
791
|
+
let a = n ? f.get(t) : Re([[
|
|
699
792
|
e,
|
|
700
793
|
"--dock-morph-t",
|
|
701
794
|
"1"
|
|
702
|
-
]], () =>
|
|
703
|
-
a && t.style.setProperty(
|
|
795
|
+
]], () => Ve(t, s));
|
|
796
|
+
a && t.style.setProperty(Ue, w((r.start - a.start) / h, i));
|
|
704
797
|
}
|
|
705
798
|
}
|
|
706
799
|
return {
|
|
707
|
-
measure:
|
|
708
|
-
first:
|
|
709
|
-
anchor:
|
|
710
|
-
release:
|
|
800
|
+
measure: b,
|
|
801
|
+
first: R,
|
|
802
|
+
anchor: B,
|
|
803
|
+
release: z
|
|
711
804
|
};
|
|
712
805
|
}
|
|
713
806
|
//#endregion
|
|
714
807
|
//#region src/components/dock/composables/useDockShellProps.ts
|
|
715
|
-
function
|
|
716
|
-
let t =
|
|
808
|
+
function qe(e) {
|
|
809
|
+
let t = j(() => e.shape ?? "pill"), n = j(() => e.orientation ?? "horizontal"), r = j(() => e.collapse === !1);
|
|
717
810
|
return {
|
|
718
|
-
startCollapsed:
|
|
811
|
+
startCollapsed: j(() => !r.value && (e.collapse ?? "closed") === "closed"),
|
|
719
812
|
shape: t,
|
|
720
813
|
orientation: n,
|
|
721
814
|
alwaysExpanded: r,
|
|
722
|
-
fitContent:
|
|
815
|
+
fitContent: j(() => e.fitContent ?? !1)
|
|
723
816
|
};
|
|
724
817
|
}
|
|
725
818
|
//#endregion
|
|
726
819
|
//#region src/components/dock/composables/useDockClickIntegrity.ts
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
820
|
+
var Je = 6;
|
|
821
|
+
function Ye(e) {
|
|
822
|
+
let { rootEl: t, visualExpanded: n } = e, r = null, i = !1, a = 0, o = null, s = q(null), c = null, l = null, u = -Infinity, d = !1, f = !1;
|
|
823
|
+
function p(e) {
|
|
824
|
+
c = {
|
|
825
|
+
x: e.clientX,
|
|
826
|
+
y: e.clientY
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
Z(t, (e, t, n) => {
|
|
830
|
+
e && (e.addEventListener("pointermove", p, {
|
|
831
|
+
capture: !0,
|
|
832
|
+
passive: !0
|
|
833
|
+
}), n(() => e.removeEventListener("pointermove", p, !0)));
|
|
834
|
+
}, {
|
|
835
|
+
immediate: !0,
|
|
836
|
+
flush: "sync"
|
|
837
|
+
});
|
|
838
|
+
function m(e) {
|
|
839
|
+
return f ? d || !l ? !0 : Math.hypot(e.clientX - l.x, e.clientY - l.y) > Je : !1;
|
|
840
|
+
}
|
|
841
|
+
let h = null, g = [];
|
|
842
|
+
function _() {
|
|
843
|
+
h?.removeAttribute("data-dock-press-origin"), h = null;
|
|
844
|
+
for (let { element: e, wasInert: t } of g.splice(0)) e.toggleAttribute("inert", t);
|
|
732
845
|
s.value = null;
|
|
733
846
|
}
|
|
734
|
-
function
|
|
847
|
+
function v(e) {
|
|
735
848
|
let n = (e instanceof Element ? e : null)?.closest("button, a[href], input, select, textarea, [role='button'], [tabindex]"), r = n?.closest(".dock-layer--full");
|
|
736
849
|
if (!(!n || !r || !t.value?.contains(r))) {
|
|
737
|
-
|
|
850
|
+
h = n, n.setAttribute("data-dock-press-origin", ""), s.value = "full";
|
|
738
851
|
for (let e = n; e !== r;) {
|
|
739
852
|
let t = e.parentElement;
|
|
740
853
|
if (!t) break;
|
|
741
|
-
for (let n of t.children) n === e || !(n instanceof HTMLElement) || (
|
|
854
|
+
for (let n of t.children) n === e || !(n instanceof HTMLElement) || (g.push({
|
|
742
855
|
element: n,
|
|
743
856
|
wasInert: n.inert
|
|
744
857
|
}), n.inert = !0);
|
|
@@ -746,93 +859,92 @@ function qe(e) {
|
|
|
746
859
|
}
|
|
747
860
|
}
|
|
748
861
|
}
|
|
749
|
-
function
|
|
862
|
+
function y() {
|
|
750
863
|
o !== null && (clearTimeout(o), o = null);
|
|
751
864
|
}
|
|
752
|
-
function
|
|
753
|
-
a =
|
|
865
|
+
function b() {
|
|
866
|
+
f = !0, l = c, d = x() - u < 100, a = x() + 840, y(), o = setTimeout(() => {
|
|
754
867
|
o = null;
|
|
755
868
|
}, 840);
|
|
756
869
|
}
|
|
757
|
-
function
|
|
870
|
+
function x() {
|
|
758
871
|
return typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now();
|
|
759
872
|
}
|
|
760
|
-
function
|
|
873
|
+
function S() {
|
|
761
874
|
let e = t.value;
|
|
762
|
-
return e && e.hasAttribute("data-morphing") ? !0 :
|
|
875
|
+
return e && e.hasAttribute("data-morphing") ? !0 : x() < a;
|
|
763
876
|
}
|
|
764
|
-
function
|
|
877
|
+
function C() {
|
|
765
878
|
let e = t.value;
|
|
766
879
|
return !!e && e.hasAttribute("data-morphing");
|
|
767
880
|
}
|
|
768
|
-
function
|
|
769
|
-
|
|
881
|
+
function w(e) {
|
|
882
|
+
_(), r = e.target, c = {
|
|
883
|
+
x: e.clientX,
|
|
884
|
+
y: e.clientY
|
|
885
|
+
}, i = C() && !m(e);
|
|
770
886
|
}
|
|
771
|
-
|
|
772
|
-
t && !e && r &&
|
|
887
|
+
Z(n, (e, t) => {
|
|
888
|
+
t && !e && r && v(r);
|
|
773
889
|
});
|
|
774
|
-
function
|
|
775
|
-
|
|
890
|
+
function T() {
|
|
891
|
+
_(), r = null, i = !1;
|
|
776
892
|
}
|
|
777
|
-
function
|
|
893
|
+
function E(e) {
|
|
778
894
|
if (!r || !e) return !1;
|
|
779
895
|
if (e === r) return !0;
|
|
780
896
|
let t = r instanceof Node ? r : null, n = e instanceof Node ? e : null;
|
|
781
897
|
return !t || !n ? !1 : t.contains(n) || n.contains(t);
|
|
782
898
|
}
|
|
783
|
-
function
|
|
784
|
-
u();
|
|
899
|
+
function D(e) {
|
|
900
|
+
u = x(), _();
|
|
785
901
|
let t = i;
|
|
786
|
-
if (i = !1, !
|
|
902
|
+
if (i = !1, !S()) {
|
|
787
903
|
r = null;
|
|
788
904
|
return;
|
|
789
905
|
}
|
|
790
906
|
if (!r && !t) return;
|
|
791
907
|
let n = r instanceof Element && r.closest(".dock-persistent") !== null;
|
|
792
|
-
if ((!t || n) &&
|
|
908
|
+
if ((!t || n) && E(e.target)) {
|
|
793
909
|
r = null;
|
|
794
910
|
return;
|
|
795
911
|
}
|
|
796
912
|
e.stopPropagation(), e.preventDefault(), r = null;
|
|
797
913
|
}
|
|
798
|
-
return
|
|
799
|
-
|
|
914
|
+
return U(() => {
|
|
915
|
+
y(), _();
|
|
800
916
|
}), {
|
|
801
|
-
onPointerDownCapture:
|
|
802
|
-
onPointerCancelCapture:
|
|
803
|
-
onClickCapture:
|
|
804
|
-
markExpandFlip:
|
|
805
|
-
pressKeepaliveLayer:
|
|
917
|
+
onPointerDownCapture: w,
|
|
918
|
+
onPointerCancelCapture: T,
|
|
919
|
+
onClickCapture: D,
|
|
920
|
+
markExpandFlip: b,
|
|
921
|
+
pressKeepaliveLayer: K(s)
|
|
806
922
|
};
|
|
807
923
|
}
|
|
808
924
|
//#endregion
|
|
809
925
|
//#region src/components/dock/composables/useDockRun.ts
|
|
810
|
-
function
|
|
811
|
-
let n = getComputedStyle(e).getPropertyValue(t).trim(), r = Number.parseFloat(n);
|
|
812
|
-
return Number.isFinite(r) ? r : 0;
|
|
813
|
-
}
|
|
814
|
-
function Ye(e) {
|
|
926
|
+
function Xe(e) {
|
|
815
927
|
return Array.from(e.children).filter((e) => e instanceof HTMLElement);
|
|
816
928
|
}
|
|
817
|
-
function
|
|
929
|
+
function Ze(e) {
|
|
818
930
|
return e.findIndex((e) => {
|
|
819
931
|
let t = (e.matches("[aria-current]") ? e : e.querySelector("[aria-current]"))?.getAttribute("aria-current");
|
|
820
932
|
return t != null && t !== "false";
|
|
821
933
|
});
|
|
822
934
|
}
|
|
823
|
-
function Ze(e) {
|
|
824
|
-
return e.hasAttribute(y);
|
|
825
|
-
}
|
|
826
935
|
function Qe(e) {
|
|
827
|
-
return
|
|
936
|
+
return e.hasAttribute(y);
|
|
828
937
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
let t = Ye(e).filter((e) => !e.matches($e) && !e.matches(et));
|
|
832
|
-
return t.length > 0 && t.every(Ze);
|
|
938
|
+
function $e(e) {
|
|
939
|
+
return Xe(e).filter(Qe);
|
|
833
940
|
}
|
|
941
|
+
var et = ".dock-separator", tt = "select[aria-hidden=\"true\"][tabindex=\"-1\"]";
|
|
834
942
|
function nt(e) {
|
|
835
|
-
let
|
|
943
|
+
let t = Xe(e).filter((e) => !e.matches(et) && !e.matches(tt));
|
|
944
|
+
return t.length > 0 && t.every(Qe);
|
|
945
|
+
}
|
|
946
|
+
function rt(e) {
|
|
947
|
+
let { runEl: t, statusEl: n, orientation: r } = e, i = q(!1), a = Ie({
|
|
836
948
|
response: d.response,
|
|
837
949
|
dampingFraction: d.dampingFraction
|
|
838
950
|
});
|
|
@@ -849,61 +961,78 @@ function nt(e) {
|
|
|
849
961
|
return o() ? e.scrollHeight - e.clientHeight : e.scrollWidth - e.clientWidth;
|
|
850
962
|
}
|
|
851
963
|
function u(e, t) {
|
|
852
|
-
let n =
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
964
|
+
let n = 0;
|
|
965
|
+
for (let r = t; r && r !== e;) {
|
|
966
|
+
n += o() ? r.offsetTop : r.offsetLeft;
|
|
967
|
+
let t = r.offsetParent;
|
|
968
|
+
t && t !== e && (n += o() ? t.clientTop : t.clientLeft), r = t;
|
|
969
|
+
}
|
|
970
|
+
return [n, n + (o() ? t.offsetHeight : t.offsetWidth)];
|
|
858
971
|
}
|
|
859
|
-
function f(e
|
|
860
|
-
let
|
|
861
|
-
return o() ?
|
|
972
|
+
function f(e) {
|
|
973
|
+
let t = getComputedStyle(e);
|
|
974
|
+
return Number.parseFloat(o() ? t.paddingBlockStart : t.paddingInlineStart) || 0;
|
|
862
975
|
}
|
|
863
|
-
function p(e) {
|
|
976
|
+
function p(e, t) {
|
|
977
|
+
let n = getComputedStyle(e), r = Number.parseFloat(o() ? n.scrollPaddingBlockStart : n.scrollPaddingInlineStart) || 0, [i] = u(e, t);
|
|
978
|
+
return Math.min(Math.max(i - r, 0), l(e));
|
|
979
|
+
}
|
|
980
|
+
function m(e, t) {
|
|
981
|
+
let n = s(e), r = o() ? e.clientHeight : e.clientWidth, i = f(e), [a, c] = u(e, t);
|
|
982
|
+
return a < n + i - 1 || c > n + r - i + 1;
|
|
983
|
+
}
|
|
984
|
+
function h(e) {
|
|
864
985
|
let t = n.value;
|
|
865
986
|
if (!t) return;
|
|
866
|
-
let r =
|
|
987
|
+
let r = Qe(e) ? e : e.querySelector(C) ?? e, i = r.getAttribute("aria-label") ?? r.getAttribute("title") ?? r.textContent?.trim();
|
|
867
988
|
i && (t.textContent = i);
|
|
868
989
|
}
|
|
869
|
-
function
|
|
990
|
+
function g(e) {
|
|
870
991
|
let n = t.value;
|
|
871
|
-
if (!n
|
|
872
|
-
|
|
873
|
-
|
|
992
|
+
if (!n) return;
|
|
993
|
+
if (h(e), !m(n, e)) {
|
|
994
|
+
a.dispose();
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
997
|
+
let r = s(n), i = p(n, e);
|
|
998
|
+
if (Math.abs(i - r) < 1) {
|
|
999
|
+
a.dispose();
|
|
1000
|
+
return;
|
|
1001
|
+
}
|
|
1002
|
+
a.playTo(0, 1, { onFrame: (e) => {
|
|
874
1003
|
let n = t.value;
|
|
875
1004
|
n && c(n, r + (i - r) * e);
|
|
876
1005
|
} });
|
|
877
1006
|
}
|
|
878
|
-
let
|
|
879
|
-
function
|
|
880
|
-
|
|
1007
|
+
let _ = /* @__PURE__ */ new WeakMap();
|
|
1008
|
+
function v(e, t) {
|
|
1009
|
+
_.has(e) || _.set(e, e.getAttribute("tabindex")), e.tabIndex = t;
|
|
881
1010
|
}
|
|
882
|
-
function
|
|
883
|
-
if (!
|
|
884
|
-
let t =
|
|
885
|
-
|
|
1011
|
+
function b(e) {
|
|
1012
|
+
if (!_.has(e)) return;
|
|
1013
|
+
let t = _.get(e) ?? null;
|
|
1014
|
+
_.delete(e), t === null ? e.removeAttribute("tabindex") : e.setAttribute("tabindex", t);
|
|
886
1015
|
}
|
|
887
|
-
function
|
|
1016
|
+
function x() {
|
|
888
1017
|
let e = t.value;
|
|
889
1018
|
if (!e) return;
|
|
890
|
-
i.value =
|
|
891
|
-
for (let t of
|
|
892
|
-
let n =
|
|
1019
|
+
i.value = nt(e);
|
|
1020
|
+
for (let t of Xe(e)) Qe(t) || b(t);
|
|
1021
|
+
let n = $e(e);
|
|
893
1022
|
if (n.length === 0) return;
|
|
894
|
-
let r =
|
|
1023
|
+
let r = Ze(n), a = n.findIndex((e) => e.contains(document.activeElement)), o = a >= 0 ? a : r >= 0 ? r : 0;
|
|
895
1024
|
n.forEach((e, t) => {
|
|
896
|
-
|
|
1025
|
+
v(e, t === o ? 0 : -1);
|
|
897
1026
|
});
|
|
898
1027
|
}
|
|
899
|
-
function
|
|
1028
|
+
function S(e, t) {
|
|
900
1029
|
let n = e[t];
|
|
901
|
-
n && (
|
|
1030
|
+
n && (g(n), v(n, 0), n.focus({ preventScroll: !0 }), x());
|
|
902
1031
|
}
|
|
903
|
-
function
|
|
1032
|
+
function w(e) {
|
|
904
1033
|
let n = t.value;
|
|
905
1034
|
if (!n) return;
|
|
906
|
-
let r =
|
|
1035
|
+
let r = $e(n);
|
|
907
1036
|
if (r.length === 0) return;
|
|
908
1037
|
let i = r.findIndex((t) => t.contains(e.target));
|
|
909
1038
|
if (i < 0) return;
|
|
@@ -923,25 +1052,29 @@ function nt(e) {
|
|
|
923
1052
|
break;
|
|
924
1053
|
default: return;
|
|
925
1054
|
}
|
|
926
|
-
c < 0 || c >= r.length || (e.preventDefault(),
|
|
1055
|
+
c < 0 || c >= r.length || (e.preventDefault(), S(r, c));
|
|
1056
|
+
}
|
|
1057
|
+
function T(e, t) {
|
|
1058
|
+
let n = (t instanceof Element ? t : t.parentElement)?.closest(`[${y}]`);
|
|
1059
|
+
return n && n !== e && e.contains(n) ? n : Xe(e).find((e) => e.contains(t));
|
|
927
1060
|
}
|
|
928
|
-
function
|
|
1061
|
+
function E(e) {
|
|
929
1062
|
let n = t.value;
|
|
930
1063
|
if (!n) return;
|
|
931
|
-
let r =
|
|
932
|
-
r &&
|
|
1064
|
+
let r = T(n, e.target);
|
|
1065
|
+
r && g(r);
|
|
933
1066
|
}
|
|
934
|
-
let
|
|
935
|
-
function
|
|
1067
|
+
let D = null;
|
|
1068
|
+
function O(e, t) {
|
|
936
1069
|
if (t.type !== "attributes" || t.attributeName === "aria-current" || t.attributeName === "data-glass-dock-seat") return !0;
|
|
937
1070
|
let n = t.target;
|
|
938
|
-
return n.parentElement === e && !
|
|
1071
|
+
return n.parentElement === e && !Qe(n);
|
|
939
1072
|
}
|
|
940
|
-
return
|
|
1073
|
+
return te(() => {
|
|
941
1074
|
let e = t.value;
|
|
942
|
-
e && (e.addEventListener("keydown",
|
|
943
|
-
t.some((t) =>
|
|
944
|
-
}),
|
|
1075
|
+
e && (e.addEventListener("keydown", w), e.addEventListener("click", E, { capture: !0 }), e.addEventListener("focusin", E, { capture: !0 }), x(), D = new MutationObserver((t) => {
|
|
1076
|
+
t.some((t) => O(e, t)) && x();
|
|
1077
|
+
}), D.observe(e, {
|
|
945
1078
|
childList: !0,
|
|
946
1079
|
subtree: !0,
|
|
947
1080
|
attributes: !0,
|
|
@@ -952,26 +1085,26 @@ function nt(e) {
|
|
|
952
1085
|
"tabindex"
|
|
953
1086
|
]
|
|
954
1087
|
}));
|
|
955
|
-
}),
|
|
1088
|
+
}), ne(() => {
|
|
956
1089
|
let e = t.value;
|
|
957
|
-
e?.removeEventListener("keydown",
|
|
958
|
-
}),
|
|
959
|
-
reach:
|
|
960
|
-
syncRoving:
|
|
1090
|
+
e?.removeEventListener("keydown", w), e?.removeEventListener("click", E, { capture: !0 }), e?.removeEventListener("focusin", E, { capture: !0 }), D?.disconnect(), a.dispose();
|
|
1091
|
+
}), Z(r, () => x()), {
|
|
1092
|
+
reach: g,
|
|
1093
|
+
syncRoving: x,
|
|
961
1094
|
toolbar: i
|
|
962
1095
|
};
|
|
963
1096
|
}
|
|
964
1097
|
//#endregion
|
|
965
1098
|
//#region src/components/dock/GlassDock.vue?vue&type=script&setup=true&lang.ts
|
|
966
|
-
var
|
|
1099
|
+
var it = ["data-backdrop-mode", "data-held"], at = ["data-held"], ot = { class: "dock-controls" }, st = {
|
|
967
1100
|
key: 0,
|
|
968
1101
|
class: "dock-persistent"
|
|
969
|
-
},
|
|
1102
|
+
}, ct = [
|
|
970
1103
|
"id",
|
|
971
1104
|
"role",
|
|
972
1105
|
"aria-orientation",
|
|
973
1106
|
"inert"
|
|
974
|
-
],
|
|
1107
|
+
], lt = [
|
|
975
1108
|
"id",
|
|
976
1109
|
"inert",
|
|
977
1110
|
"role",
|
|
@@ -979,13 +1112,13 @@ var rt = ["data-backdrop-mode", "data-held"], it = ["data-held"], at = { class:
|
|
|
979
1112
|
"aria-label",
|
|
980
1113
|
"aria-expanded",
|
|
981
1114
|
"aria-controls"
|
|
982
|
-
],
|
|
1115
|
+
], ut = {
|
|
983
1116
|
key: 0,
|
|
984
1117
|
class: "dock-search-field"
|
|
985
|
-
},
|
|
1118
|
+
}, dt = {
|
|
986
1119
|
key: 1,
|
|
987
1120
|
class: "dock-persistent dock-persistent-end"
|
|
988
|
-
},
|
|
1121
|
+
}, ft = /* @__PURE__ */ L({
|
|
989
1122
|
inheritAttrs: !1,
|
|
990
1123
|
__name: "GlassDock",
|
|
991
1124
|
props: {
|
|
@@ -1000,73 +1133,81 @@ var rt = ["data-backdrop-mode", "data-held"], it = ["data-held"], at = { class:
|
|
|
1000
1133
|
backgroundCanvas: {}
|
|
1001
1134
|
},
|
|
1002
1135
|
setup(e, { expose: t }) {
|
|
1003
|
-
let n = e, { startCollapsed: r, shape: i, orientation: a, alwaysExpanded: o, fitContent: s } =
|
|
1136
|
+
let n = e, { startCollapsed: r, shape: i, orientation: a, alwaysExpanded: o, fitContent: s } = qe(n), c = X("dockEl"), u = X("layersEl"), d = X("fullEl"), m = X("summaryEl"), h = X("statusEl"), { toolbar: g } = rt({
|
|
1004
1137
|
runEl: d,
|
|
1005
1138
|
statusEl: h,
|
|
1006
1139
|
orientation: a
|
|
1007
1140
|
});
|
|
1008
|
-
n.backdropMode === "live" &&
|
|
1141
|
+
n.backdropMode === "live" && Pe(c, { backgroundCanvas: () => {
|
|
1009
1142
|
let e = n.backgroundCanvas;
|
|
1010
1143
|
return typeof e == "function" ? e() : e instanceof HTMLCanvasElement ? e : null;
|
|
1011
1144
|
} });
|
|
1012
|
-
let _ =
|
|
1145
|
+
let _ = q(!1), v = `glass-dock-${oe()}`, { expanded: y, isPinned: b, isHeld: x, graspHeld: S, onMouseEnter: w, onMouseLeave: T, onFocusIn: E, onFocusOut: D, onClickCollapsed: O, keepOpen: k, release: M, expand: L, collapse: R } = Fe({
|
|
1013
1146
|
rootEl: c,
|
|
1014
1147
|
alwaysExpanded: o,
|
|
1015
1148
|
initialExpanded: !r.value,
|
|
1016
1149
|
isTransitioning: _,
|
|
1017
1150
|
dockId: v
|
|
1018
|
-
}),
|
|
1151
|
+
}), z = j(() => o.value || y.value);
|
|
1019
1152
|
l({
|
|
1020
1153
|
id: v,
|
|
1021
1154
|
orientation: a,
|
|
1022
1155
|
keepOpen: k,
|
|
1023
|
-
release:
|
|
1156
|
+
release: M,
|
|
1024
1157
|
held: S,
|
|
1025
|
-
expanded:
|
|
1158
|
+
expanded: z
|
|
1026
1159
|
});
|
|
1027
|
-
let
|
|
1160
|
+
let ee = Ke({
|
|
1028
1161
|
rootEl: c,
|
|
1029
1162
|
contentEl: u,
|
|
1030
1163
|
expandedEl: d,
|
|
1031
1164
|
collapsedEl: m,
|
|
1032
1165
|
axis: a
|
|
1033
|
-
}), { outerCurrentLayer:
|
|
1166
|
+
}), { outerCurrentLayer: U, outerLeavingLayer: te } = Le({
|
|
1034
1167
|
rootEl: c,
|
|
1035
|
-
outerActiveLayer:
|
|
1168
|
+
outerActiveLayer: j(() => z.value ? "full" : "summary"),
|
|
1036
1169
|
onMorphActiveChange: (e) => {
|
|
1037
1170
|
_.value = e;
|
|
1038
1171
|
},
|
|
1039
|
-
geometry:
|
|
1040
|
-
}),
|
|
1041
|
-
async function
|
|
1042
|
-
|
|
1172
|
+
geometry: ee
|
|
1173
|
+
}), W = j(() => U.value === "summary");
|
|
1174
|
+
async function ne() {
|
|
1175
|
+
await V(), (d.value?.querySelector(C) ?? d.value)?.focus({ preventScroll: !0 });
|
|
1176
|
+
}
|
|
1177
|
+
async function K(e) {
|
|
1178
|
+
!W.value || !["Enter", " "].includes(e.key) || (e.preventDefault(), O(), await ne());
|
|
1043
1179
|
}
|
|
1044
|
-
|
|
1180
|
+
let re = !1;
|
|
1181
|
+
function ie(e) {
|
|
1182
|
+
let t = !re && W.value && !!m.value?.matches(":focus-visible");
|
|
1183
|
+
e.stopPropagation(), t && (E(), ne());
|
|
1184
|
+
}
|
|
1185
|
+
function ae(e) {
|
|
1045
1186
|
if (e.key !== "Escape") return;
|
|
1046
1187
|
let t = e.target?.closest?.(f);
|
|
1047
|
-
t && d.value?.contains(t) ||
|
|
1188
|
+
t && d.value?.contains(t) || R();
|
|
1048
1189
|
}
|
|
1049
|
-
|
|
1190
|
+
Z(z, async (e, t) => {
|
|
1050
1191
|
if (!t || e) return;
|
|
1051
1192
|
let n = document.activeElement;
|
|
1052
1193
|
if (!(n && d.value?.contains(n) || n?.closest("[data-glass-dock-face]")?.getAttribute("data-glass-dock-owner") === v)) return;
|
|
1053
|
-
await
|
|
1194
|
+
await V();
|
|
1054
1195
|
let r = m.value;
|
|
1055
|
-
r
|
|
1196
|
+
!r || r.hasAttribute("inert") || (re = !0, r.focus({ preventScroll: !0 }), re = !1);
|
|
1056
1197
|
});
|
|
1057
|
-
let { onPointerDownCapture:
|
|
1198
|
+
let { onPointerDownCapture: se, onPointerCancelCapture: ce, onClickCapture: le, markExpandFlip: ue, pressKeepaliveLayer: de } = Ye({
|
|
1058
1199
|
rootEl: c,
|
|
1059
|
-
visualExpanded:
|
|
1200
|
+
visualExpanded: z
|
|
1060
1201
|
});
|
|
1061
|
-
|
|
1062
|
-
e &&
|
|
1202
|
+
Z(z, (e) => {
|
|
1203
|
+
e && ue();
|
|
1063
1204
|
});
|
|
1064
|
-
let
|
|
1065
|
-
|
|
1066
|
-
e && (
|
|
1205
|
+
let fe = q(!1);
|
|
1206
|
+
Z(S, (e) => {
|
|
1207
|
+
e && (fe.value = !0);
|
|
1067
1208
|
});
|
|
1068
|
-
function
|
|
1069
|
-
e.propertyName === "opacity" && !S.value && (
|
|
1209
|
+
function pe(e) {
|
|
1210
|
+
e.propertyName === "opacity" && !S.value && (fe.value = !1);
|
|
1070
1211
|
}
|
|
1071
1212
|
return t({
|
|
1072
1213
|
expanded: y,
|
|
@@ -1074,119 +1215,119 @@ var rt = ["data-backdrop-mode", "data-held"], it = ["data-held"], at = { class:
|
|
|
1074
1215
|
isHeld: x,
|
|
1075
1216
|
graspHeld: S,
|
|
1076
1217
|
isTransitioning: _,
|
|
1077
|
-
expand:
|
|
1078
|
-
collapse:
|
|
1218
|
+
expand: L,
|
|
1219
|
+
collapse: R,
|
|
1079
1220
|
keepOpen: k,
|
|
1080
|
-
release:
|
|
1081
|
-
}), (e, t) => (
|
|
1221
|
+
release: M
|
|
1222
|
+
}), (e, t) => (G(), P("div", B({
|
|
1082
1223
|
ref_key: "dockEl",
|
|
1083
1224
|
ref: c
|
|
1084
1225
|
}, e.$attrs, {
|
|
1085
1226
|
class: ["glass-dock", [
|
|
1086
|
-
|
|
1087
|
-
`shape-${
|
|
1227
|
+
Y(a),
|
|
1228
|
+
`shape-${Y(i)}`,
|
|
1088
1229
|
{
|
|
1089
|
-
expanded:
|
|
1090
|
-
collapsed: !
|
|
1091
|
-
pinned:
|
|
1092
|
-
"fit-content":
|
|
1093
|
-
"always-expanded":
|
|
1230
|
+
expanded: z.value,
|
|
1231
|
+
collapsed: !z.value,
|
|
1232
|
+
pinned: Y(b),
|
|
1233
|
+
"fit-content": Y(s),
|
|
1234
|
+
"always-expanded": Y(o)
|
|
1094
1235
|
}
|
|
1095
1236
|
]],
|
|
1096
1237
|
"data-backdrop-mode": n.backdropMode,
|
|
1097
|
-
"data-held":
|
|
1098
|
-
onMouseenter: t[
|
|
1099
|
-
onMouseleave: t[
|
|
1100
|
-
onFocusin: t[
|
|
1101
|
-
onFocusout: t[
|
|
1102
|
-
onPointerdownCapture: t[
|
|
1103
|
-
onPointercancelCapture: t[
|
|
1104
|
-
onClickCapture: t[
|
|
1238
|
+
"data-held": Y(S) || void 0,
|
|
1239
|
+
onMouseenter: t[1] ||= (...e) => Y(w) && Y(w)(...e),
|
|
1240
|
+
onMouseleave: t[2] ||= (e) => Y(T)(e),
|
|
1241
|
+
onFocusin: t[3] ||= (...e) => Y(E) && Y(E)(...e),
|
|
1242
|
+
onFocusout: t[4] ||= (...e) => Y(D) && Y(D)(...e),
|
|
1243
|
+
onPointerdownCapture: t[5] ||= (...e) => Y(se) && Y(se)(...e),
|
|
1244
|
+
onPointercancelCapture: t[6] ||= (...e) => Y(ce) && Y(ce)(...e),
|
|
1245
|
+
onClickCapture: t[7] ||= (...e) => Y(le) && Y(le)(...e)
|
|
1105
1246
|
}), [
|
|
1106
|
-
|
|
1247
|
+
F("div", {
|
|
1107
1248
|
class: "dock-plate",
|
|
1108
1249
|
"aria-hidden": "true",
|
|
1109
|
-
"data-held":
|
|
1110
|
-
}, [
|
|
1250
|
+
"data-held": Y(S) || void 0
|
|
1251
|
+
}, [fe.value ? (G(), P(A, { key: 0 }, [t[8] ||= F("span", {
|
|
1111
1252
|
class: "glass-grasp-carrier",
|
|
1112
1253
|
"data-grasp": "rest"
|
|
1113
|
-
}, null, -1),
|
|
1254
|
+
}, null, -1), F("span", {
|
|
1114
1255
|
class: "glass-grasp-carrier",
|
|
1115
1256
|
"data-grasp": "grasp",
|
|
1116
|
-
onTransitionend:
|
|
1117
|
-
}, null, 32)], 64)) :
|
|
1118
|
-
|
|
1119
|
-
e.$slots.persistent ? (
|
|
1120
|
-
|
|
1257
|
+
onTransitionend: pe
|
|
1258
|
+
}, null, 32)], 64)) : N("", !0)], 8, at),
|
|
1259
|
+
F("div", ot, [
|
|
1260
|
+
e.$slots.persistent ? (G(), P("div", st, [J(e.$slots, "persistent")])) : N("", !0),
|
|
1261
|
+
F("div", {
|
|
1121
1262
|
ref_key: "layersEl",
|
|
1122
1263
|
ref: u,
|
|
1123
1264
|
class: "dock-layers"
|
|
1124
1265
|
}, [
|
|
1125
|
-
|
|
1266
|
+
F("div", {
|
|
1126
1267
|
ref_key: "fullEl",
|
|
1127
1268
|
ref: d,
|
|
1128
1269
|
id: `${v}-full`,
|
|
1129
|
-
role:
|
|
1130
|
-
"aria-orientation":
|
|
1131
|
-
class:
|
|
1132
|
-
"is-active":
|
|
1133
|
-
"is-leaving":
|
|
1134
|
-
"is-press-keepalive":
|
|
1270
|
+
role: Y(g) ? "toolbar" : void 0,
|
|
1271
|
+
"aria-orientation": Y(g) ? Y(a) : void 0,
|
|
1272
|
+
class: H(["dock-layer dock-layer--full dock-run", {
|
|
1273
|
+
"is-active": Y(U) === "full",
|
|
1274
|
+
"is-leaving": Y(te) === "full" || Y(de) === "full" && Y(U) !== "full",
|
|
1275
|
+
"is-press-keepalive": Y(de) === "full"
|
|
1135
1276
|
}]),
|
|
1136
|
-
inert:
|
|
1277
|
+
inert: Y(U) !== "full" && Y(de) !== "full" || void 0,
|
|
1137
1278
|
tabindex: "-1",
|
|
1138
|
-
onKeydown:
|
|
1139
|
-
}, [
|
|
1140
|
-
default:
|
|
1279
|
+
onKeydown: ae
|
|
1280
|
+
}, [I(Y(p), null, {
|
|
1281
|
+
default: Q(() => [J(e.$slots, "default")]),
|
|
1141
1282
|
_: 3
|
|
1142
|
-
})], 42,
|
|
1143
|
-
|
|
1283
|
+
})], 42, ct),
|
|
1284
|
+
F("div", {
|
|
1144
1285
|
ref_key: "summaryEl",
|
|
1145
1286
|
ref: m,
|
|
1146
1287
|
id: `${v}-summary`,
|
|
1147
|
-
class:
|
|
1148
|
-
"is-active":
|
|
1149
|
-
"is-leaving":
|
|
1288
|
+
class: H(["dock-layer dock-layer--summary", {
|
|
1289
|
+
"is-active": Y(U) === "summary",
|
|
1290
|
+
"is-leaving": Y(te) === "summary"
|
|
1150
1291
|
}]),
|
|
1151
|
-
inert:
|
|
1152
|
-
role:
|
|
1153
|
-
tabindex:
|
|
1154
|
-
"aria-label":
|
|
1155
|
-
"aria-expanded":
|
|
1156
|
-
"aria-controls":
|
|
1157
|
-
onFocusin:
|
|
1158
|
-
onKeydown:
|
|
1159
|
-
onClick: t[
|
|
1160
|
-
}, [
|
|
1161
|
-
e.$slots.search ? (
|
|
1292
|
+
inert: Y(U) !== "summary" || void 0,
|
|
1293
|
+
role: W.value ? "button" : void 0,
|
|
1294
|
+
tabindex: W.value ? 0 : void 0,
|
|
1295
|
+
"aria-label": W.value ? "Expand dock" : void 0,
|
|
1296
|
+
"aria-expanded": W.value ? "false" : void 0,
|
|
1297
|
+
"aria-controls": W.value ? `${v}-full` : void 0,
|
|
1298
|
+
onFocusin: ie,
|
|
1299
|
+
onKeydown: K,
|
|
1300
|
+
onClick: t[0] ||= (...e) => Y(O) && Y(O)(...e)
|
|
1301
|
+
}, [J(e.$slots, "collapsed")], 42, lt),
|
|
1302
|
+
e.$slots.search ? (G(), P("div", ut, [J(e.$slots, "search")])) : N("", !0)
|
|
1162
1303
|
], 512),
|
|
1163
|
-
e.$slots["persistent-end"] ? (
|
|
1304
|
+
e.$slots["persistent-end"] ? (G(), P("div", dt, [J(e.$slots, "persistent-end")])) : N("", !0)
|
|
1164
1305
|
]),
|
|
1165
|
-
|
|
1306
|
+
F("div", {
|
|
1166
1307
|
ref_key: "statusEl",
|
|
1167
1308
|
ref: h,
|
|
1168
1309
|
class: "dock-run-status",
|
|
1169
1310
|
role: "status",
|
|
1170
1311
|
"aria-live": "polite"
|
|
1171
1312
|
}, null, 512)
|
|
1172
|
-
], 16,
|
|
1313
|
+
], 16, it));
|
|
1173
1314
|
}
|
|
1174
|
-
}),
|
|
1175
|
-
function
|
|
1176
|
-
|
|
1315
|
+
}), pt = c("glass-ui:dock-switcher-tablist"), { KEY: mt } = pt;
|
|
1316
|
+
function ht(e) {
|
|
1317
|
+
pt.provide(e);
|
|
1177
1318
|
}
|
|
1178
|
-
var
|
|
1179
|
-
function
|
|
1180
|
-
|
|
1319
|
+
var gt = pt.use, _t = s(m, "[glass-ui:dock] <DockLayer> must be used inside <DockCrossfade> (or <DockLayerGroup>)"), { KEY: vt } = _t;
|
|
1320
|
+
function yt(e) {
|
|
1321
|
+
_t.provide(e);
|
|
1181
1322
|
}
|
|
1182
|
-
var
|
|
1323
|
+
var bt = _t.use, xt = /* @__PURE__ */ L({
|
|
1183
1324
|
__name: "DockCrossfade",
|
|
1184
1325
|
props: {
|
|
1185
1326
|
active: {},
|
|
1186
1327
|
reserve: { default: "block" }
|
|
1187
1328
|
},
|
|
1188
1329
|
setup(e, { expose: t }) {
|
|
1189
|
-
let n = e, r =
|
|
1330
|
+
let n = e, r = q(null), i = q(/* @__PURE__ */ new Map()), a = j(() => [...i.value.values()].map(({ id: e, label: t, icon: n }) => ({
|
|
1190
1331
|
id: e,
|
|
1191
1332
|
label: t,
|
|
1192
1333
|
icon: n
|
|
@@ -1200,15 +1341,15 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1200
1341
|
let t = new Map(i.value);
|
|
1201
1342
|
t.delete(e), i.value = t, p();
|
|
1202
1343
|
}
|
|
1203
|
-
let c =
|
|
1204
|
-
|
|
1344
|
+
let c = j(() => n.active), l = q(null);
|
|
1345
|
+
yt({
|
|
1205
1346
|
register: o,
|
|
1206
1347
|
unregister: s,
|
|
1207
1348
|
activeId: c,
|
|
1208
1349
|
leavingId: l,
|
|
1209
1350
|
faces: a
|
|
1210
1351
|
});
|
|
1211
|
-
let u =
|
|
1352
|
+
let u = q(0), f = j(() => n.reserve === "inline" ? "min-inline-size" : "min-block-size");
|
|
1212
1353
|
function p() {
|
|
1213
1354
|
let e = 0;
|
|
1214
1355
|
for (let { el: t } of i.value.values()) {
|
|
@@ -1217,12 +1358,12 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1217
1358
|
}
|
|
1218
1359
|
e > u.value && (u.value = e);
|
|
1219
1360
|
}
|
|
1220
|
-
let m =
|
|
1361
|
+
let m = j(() => u.value > 0 ? {
|
|
1221
1362
|
[f.value]: `${u.value}px`,
|
|
1222
1363
|
"--dock-crossfade-peak": `${u.value}px`
|
|
1223
1364
|
} : void 0);
|
|
1224
1365
|
b(r, () => p());
|
|
1225
|
-
let h =
|
|
1366
|
+
let h = Ie({
|
|
1226
1367
|
response: d.response,
|
|
1227
1368
|
dampingFraction: d.dampingFraction
|
|
1228
1369
|
});
|
|
@@ -1238,16 +1379,16 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1238
1379
|
function y(e) {
|
|
1239
1380
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
1240
1381
|
}
|
|
1241
|
-
let x =
|
|
1242
|
-
|
|
1382
|
+
let x = _e("(prefers-reduced-motion: reduce)"), S = null, C = 1;
|
|
1383
|
+
Z(x, (e) => {
|
|
1243
1384
|
e && (h.dispose(), S?.());
|
|
1244
1385
|
});
|
|
1245
1386
|
async function w(e, t) {
|
|
1246
1387
|
if (typeof document > "u") return;
|
|
1247
1388
|
let n = g(e), r = document.activeElement;
|
|
1248
|
-
!n || !r || !n.contains(r) || (await
|
|
1389
|
+
!n || !r || !n.contains(r) || (await V(), (g(t) ?? document.body).focus?.());
|
|
1249
1390
|
}
|
|
1250
|
-
return
|
|
1391
|
+
return Z(c, (e, t) => {
|
|
1251
1392
|
if (e === t) return;
|
|
1252
1393
|
p();
|
|
1253
1394
|
let n = g(e), i = g(t);
|
|
@@ -1272,24 +1413,24 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1272
1413
|
},
|
|
1273
1414
|
onSettle: d
|
|
1274
1415
|
});
|
|
1275
|
-
}),
|
|
1416
|
+
}), U(() => {
|
|
1276
1417
|
h.dispose(), S = null;
|
|
1277
|
-
}), t({ faces: a }), (e, t) => (
|
|
1418
|
+
}), t({ faces: a }), (e, t) => (G(), P("div", {
|
|
1278
1419
|
ref_key: "rootEl",
|
|
1279
1420
|
ref: r,
|
|
1280
1421
|
class: "dock-crossfade",
|
|
1281
|
-
style:
|
|
1282
|
-
}, [
|
|
1422
|
+
style: ee(m.value)
|
|
1423
|
+
}, [J(e.$slots, "default")], 4));
|
|
1283
1424
|
}
|
|
1284
|
-
}),
|
|
1425
|
+
}), St = ["data-motion"], Ct = ["aria-orientation"], wt = [
|
|
1285
1426
|
"id",
|
|
1286
1427
|
"tabindex",
|
|
1287
1428
|
"aria-controls",
|
|
1288
1429
|
"aria-label",
|
|
1289
1430
|
"onClick"
|
|
1290
|
-
],
|
|
1431
|
+
], Tt = { key: 1 }, Et = { key: 2 }, Dt = /* @__PURE__ */ L({
|
|
1291
1432
|
__name: "DockLayerGroup",
|
|
1292
|
-
props: /*@__PURE__*/
|
|
1433
|
+
props: /*@__PURE__*/ z({
|
|
1293
1434
|
orientation: {},
|
|
1294
1435
|
showSwitcher: {
|
|
1295
1436
|
type: Boolean,
|
|
@@ -1303,8 +1444,8 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1303
1444
|
}),
|
|
1304
1445
|
emits: ["update:active"],
|
|
1305
1446
|
setup(e) {
|
|
1306
|
-
let t = e, n = o(() => t.motion), r =
|
|
1307
|
-
options:
|
|
1447
|
+
let t = e, n = o(() => t.motion), r = se(e, "active"), i = v(), a = j(() => t.orientation ?? i?.orientation.value ?? "horizontal"), s = X("crossfade"), c = j(() => s.value?.faces ?? []), l = j(() => a.value === "vertical" ? "horizontal" : "vertical"), u = j(() => l.value === "vertical"), d = q(null), f = q(null), p = q([]), m = T({
|
|
1448
|
+
options: j(() => c.value.map((e) => ({ value: e.id }))),
|
|
1308
1449
|
model: r,
|
|
1309
1450
|
mode: "single",
|
|
1310
1451
|
role: "tablist",
|
|
@@ -1312,13 +1453,13 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1312
1453
|
containerRef: d,
|
|
1313
1454
|
indicatorRef: f,
|
|
1314
1455
|
buttonRefs: p
|
|
1315
|
-
}), g =
|
|
1316
|
-
|
|
1456
|
+
}), g = j(() => t.showSwitcher && c.value.length > 1), _ = oe(), y = (e) => e.replace(/[^a-zA-Z0-9_-]/g, ""), b = (e) => `dock-tab-${_}-${y(e)}`, x = (e) => `dock-panel-${_}-${y(e)}`;
|
|
1457
|
+
ht({
|
|
1317
1458
|
isTablist: g,
|
|
1318
1459
|
tabId: b,
|
|
1319
1460
|
panelId: x
|
|
1320
1461
|
});
|
|
1321
|
-
let S =
|
|
1462
|
+
let S = j(() => u.value ? "y" : "x");
|
|
1322
1463
|
function C() {
|
|
1323
1464
|
let e = d.value;
|
|
1324
1465
|
if (!e) return [];
|
|
@@ -1340,14 +1481,14 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1340
1481
|
n.armed.value && r.value !== e && (r.value = e);
|
|
1341
1482
|
}
|
|
1342
1483
|
});
|
|
1343
|
-
|
|
1484
|
+
Z(() => [
|
|
1344
1485
|
c.value.length,
|
|
1345
1486
|
l.value,
|
|
1346
1487
|
n.armed.value
|
|
1347
1488
|
], () => {
|
|
1348
|
-
n.armed.value &&
|
|
1349
|
-
}),
|
|
1350
|
-
n.armed.value &&
|
|
1489
|
+
n.armed.value && V(() => w.refresh());
|
|
1490
|
+
}), te(() => {
|
|
1491
|
+
n.armed.value && V(() => w.refresh());
|
|
1351
1492
|
});
|
|
1352
1493
|
function D(e) {
|
|
1353
1494
|
return typeof e == "object" && !!e || typeof e == "function";
|
|
@@ -1356,25 +1497,25 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1356
1497
|
function k() {
|
|
1357
1498
|
O.acquire();
|
|
1358
1499
|
}
|
|
1359
|
-
function
|
|
1500
|
+
function L(e) {
|
|
1360
1501
|
let t = e.relatedTarget, n = e.currentTarget;
|
|
1361
1502
|
t && n?.contains(t) || O.release();
|
|
1362
1503
|
}
|
|
1363
|
-
return (t, i) => (
|
|
1364
|
-
class:
|
|
1365
|
-
"data-motion":
|
|
1366
|
-
style:
|
|
1367
|
-
}, [g.value ? (
|
|
1504
|
+
return (t, i) => (G(), P("div", {
|
|
1505
|
+
class: H(["dock-layer-group", [a.value, `switcher-${e.switcherPosition}`]]),
|
|
1506
|
+
"data-motion": Y(n).dataMotion.value,
|
|
1507
|
+
style: ee(Y(n).hostStyle.value)
|
|
1508
|
+
}, [g.value ? (G(), P("div", {
|
|
1368
1509
|
key: 0,
|
|
1369
1510
|
ref_key: "switcherListEl",
|
|
1370
1511
|
ref: d,
|
|
1371
1512
|
role: "tablist",
|
|
1372
|
-
class:
|
|
1513
|
+
class: H(["dock-layer-switcher", [e.switcherPosition, Y(n).armed.value && "glass-drag-grabbable"]]),
|
|
1373
1514
|
"aria-orientation": l.value,
|
|
1374
|
-
onKeydown: i[0] ||= (...e) =>
|
|
1515
|
+
onKeydown: i[0] ||= (...e) => Y(m).onKeydown && Y(m).onKeydown(...e),
|
|
1375
1516
|
onFocusin: k,
|
|
1376
|
-
onFocusout:
|
|
1377
|
-
}, [(
|
|
1517
|
+
onFocusout: L
|
|
1518
|
+
}, [(G(!0), P(A, null, re(c.value, (e, t) => (G(), P("button", B({
|
|
1378
1519
|
key: e.id,
|
|
1379
1520
|
ref_for: !0,
|
|
1380
1521
|
ref: (e) => {
|
|
@@ -1383,37 +1524,37 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1383
1524
|
type: "button",
|
|
1384
1525
|
class: "dock-layer-tab",
|
|
1385
1526
|
id: b(e.id),
|
|
1386
|
-
tabindex:
|
|
1387
|
-
}, { ref_for: !0 },
|
|
1527
|
+
tabindex: Y(m).rovingTabindex(t)
|
|
1528
|
+
}, { ref_for: !0 }, Y(m).itemAttrs(e.id), {
|
|
1388
1529
|
"aria-controls": x(e.id),
|
|
1389
1530
|
"aria-label": e.label ?? e.id,
|
|
1390
|
-
onClick: (n) =>
|
|
1391
|
-
}), [D(e.icon) ? (
|
|
1531
|
+
onClick: (n) => Y(m).select(e.id, t)
|
|
1532
|
+
}), [D(e.icon) ? (G(), M(ie(e.icon), {
|
|
1392
1533
|
key: 0,
|
|
1393
1534
|
class: "size-4"
|
|
1394
|
-
})) : typeof e.icon == "string" ? (
|
|
1535
|
+
})) : typeof e.icon == "string" ? (G(), P("span", Tt, ae(e.icon), 1)) : (G(), P("span", Et, ae((e.label ?? e.id).charAt(0)), 1))], 16, wt))), 128)), F("div", {
|
|
1395
1536
|
ref_key: "switcherIndicatorEl",
|
|
1396
1537
|
ref: f,
|
|
1397
|
-
class:
|
|
1398
|
-
style:
|
|
1538
|
+
class: H(["dock-layer-tab-indicator", Y(n).armed.value && Y(w).dragging.value && "glass-drag-lift"]),
|
|
1539
|
+
style: ee(Y(m).singleSliderStyle.value),
|
|
1399
1540
|
"aria-hidden": "true"
|
|
1400
|
-
}, null, 6)], 42,
|
|
1541
|
+
}, null, 6)], 42, Ct)) : N("", !0), I(xt, {
|
|
1401
1542
|
ref_key: "crossfade",
|
|
1402
1543
|
ref: s,
|
|
1403
1544
|
active: r.value
|
|
1404
1545
|
}, {
|
|
1405
|
-
default:
|
|
1546
|
+
default: Q(() => [J(t.$slots, "default")]),
|
|
1406
1547
|
_: 3
|
|
1407
|
-
}, 8, ["active"])], 14,
|
|
1548
|
+
}, 8, ["active"])], 14, St));
|
|
1408
1549
|
}
|
|
1409
|
-
}),
|
|
1550
|
+
}), Ot = [
|
|
1410
1551
|
"role",
|
|
1411
1552
|
"id",
|
|
1412
1553
|
"aria-labelledby",
|
|
1413
1554
|
"inert",
|
|
1414
1555
|
"aria-hidden",
|
|
1415
1556
|
"tabindex"
|
|
1416
|
-
],
|
|
1557
|
+
], kt = { class: "dock-face-content" }, At = /* @__PURE__ */ L({
|
|
1417
1558
|
__name: "DockLayer",
|
|
1418
1559
|
props: {
|
|
1419
1560
|
id: {},
|
|
@@ -1421,15 +1562,15 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1421
1562
|
icon: {}
|
|
1422
1563
|
},
|
|
1423
1564
|
setup(e) {
|
|
1424
|
-
let t = e, n =
|
|
1425
|
-
|
|
1565
|
+
let t = e, n = bt(), r = X("hostEl");
|
|
1566
|
+
te(() => {
|
|
1426
1567
|
r.value && n.register({
|
|
1427
1568
|
id: t.id,
|
|
1428
1569
|
label: t.label,
|
|
1429
1570
|
icon: t.icon,
|
|
1430
1571
|
el: r.value
|
|
1431
1572
|
});
|
|
1432
|
-
}),
|
|
1573
|
+
}), Z(() => [
|
|
1433
1574
|
t.id,
|
|
1434
1575
|
t.label,
|
|
1435
1576
|
t.icon
|
|
@@ -1440,12 +1581,12 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1440
1581
|
icon: t.icon,
|
|
1441
1582
|
el: r.value
|
|
1442
1583
|
});
|
|
1443
|
-
}),
|
|
1444
|
-
let i =
|
|
1445
|
-
return (e, t) => (
|
|
1584
|
+
}), U(() => n.unregister(t.id));
|
|
1585
|
+
let i = j(() => n.activeId.value === t.id), a = j(() => n.leavingId.value === t.id), o = gt(), s = j(() => o?.isTablist.value ?? !1), c = j(() => s.value ? o.panelId(t.id) : void 0), l = j(() => s.value ? o.tabId(t.id) : void 0);
|
|
1586
|
+
return (e, t) => (G(), P("div", {
|
|
1446
1587
|
ref_key: "hostEl",
|
|
1447
1588
|
ref: r,
|
|
1448
|
-
class:
|
|
1589
|
+
class: H(["dock-face", {
|
|
1449
1590
|
"is-active": i.value,
|
|
1450
1591
|
"is-leaving": a.value
|
|
1451
1592
|
}]),
|
|
@@ -1455,9 +1596,9 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1455
1596
|
inert: !i.value || void 0,
|
|
1456
1597
|
"aria-hidden": !i.value || void 0,
|
|
1457
1598
|
tabindex: i.value ? -1 : void 0
|
|
1458
|
-
}, [
|
|
1599
|
+
}, [F("div", kt, [J(e.$slots, "default")])], 10, Ot));
|
|
1459
1600
|
}
|
|
1460
|
-
}),
|
|
1601
|
+
}), jt = /* @__PURE__ */ L({
|
|
1461
1602
|
__name: "DockControl",
|
|
1462
1603
|
props: {
|
|
1463
1604
|
shape: { default: "icon" },
|
|
@@ -1488,14 +1629,14 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1488
1629
|
] }
|
|
1489
1630
|
},
|
|
1490
1631
|
setup(t) {
|
|
1491
|
-
let r = t, o =
|
|
1632
|
+
let r = t, o = j(() => r.shape === "tab"), s = j(() => o.value ? e("dock-tab-button glass-specular-track", r.class) : e("dock-icon-button glass-specular-track glass-capsule-hover", { "glass-capsule": r.active }, { "dock-icon-button--compact": r.compact }, r.class)), c = j(() => ({
|
|
1492
1633
|
[y]: "",
|
|
1493
1634
|
...r.active === void 0 ? {} : {
|
|
1494
1635
|
"aria-pressed": String(r.active),
|
|
1495
1636
|
...r.active ? { "data-active": "" } : {}
|
|
1496
1637
|
},
|
|
1497
1638
|
...r.disabled ? { "aria-disabled": "true" } : {}
|
|
1498
|
-
})), l =
|
|
1639
|
+
})), l = j(() => !r.asChild && r.as === "button" ? { type: r.type } : {}), u = i("press"), d = a({
|
|
1499
1640
|
disabled: () => r.disabled || o.value,
|
|
1500
1641
|
squish: !0,
|
|
1501
1642
|
response: u.response,
|
|
@@ -1503,11 +1644,11 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1503
1644
|
pressVar: "--dock-press-t",
|
|
1504
1645
|
shrinkDepth: .04,
|
|
1505
1646
|
maxStretch: 1.03
|
|
1506
|
-
}), f =
|
|
1647
|
+
}), f = j(() => o.value ? {} : { ...d.pressStyle.value });
|
|
1507
1648
|
function p(e) {
|
|
1508
1649
|
r.disabled && (e.preventDefault(), e.stopImmediatePropagation());
|
|
1509
1650
|
}
|
|
1510
|
-
return (e, r) =>
|
|
1651
|
+
return (e, r) => ce((G(), M(Y(ue), B({
|
|
1511
1652
|
as: t.as,
|
|
1512
1653
|
"as-child": t.asChild
|
|
1513
1654
|
}, {
|
|
@@ -1516,18 +1657,18 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1516
1657
|
}, {
|
|
1517
1658
|
class: s.value,
|
|
1518
1659
|
style: f.value,
|
|
1519
|
-
"data-press-armed": !o.value &&
|
|
1520
|
-
onPointerdown:
|
|
1521
|
-
onPointerup:
|
|
1522
|
-
onPointercancel:
|
|
1523
|
-
onPointerleave:
|
|
1524
|
-
onPointerenter:
|
|
1525
|
-
onKeydown:
|
|
1526
|
-
onKeyup:
|
|
1527
|
-
onBlur:
|
|
1660
|
+
"data-press-armed": !o.value && Y(d).armed ? "" : void 0,
|
|
1661
|
+
onPointerdown: Y(d).handlers.onPointerdown,
|
|
1662
|
+
onPointerup: Y(d).handlers.onPointerup,
|
|
1663
|
+
onPointercancel: Y(d).handlers.onPointercancel,
|
|
1664
|
+
onPointerleave: Y(d).handlers.onPointerleave,
|
|
1665
|
+
onPointerenter: Y(d).handlers.onPointerenter,
|
|
1666
|
+
onKeydown: Y(d).handlers.onKeydown,
|
|
1667
|
+
onKeyup: Y(d).handlers.onKeyup,
|
|
1668
|
+
onBlur: Y(d).handlers.onBlur,
|
|
1528
1669
|
onClickCapture: p
|
|
1529
1670
|
}), {
|
|
1530
|
-
default:
|
|
1671
|
+
default: Q(() => [J(e.$slots, "default")]),
|
|
1531
1672
|
_: 3
|
|
1532
1673
|
}, 16, [
|
|
1533
1674
|
"as",
|
|
@@ -1543,9 +1684,9 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1543
1684
|
"onKeydown",
|
|
1544
1685
|
"onKeyup",
|
|
1545
1686
|
"onBlur"
|
|
1546
|
-
])), [[
|
|
1687
|
+
])), [[Y(n)]]);
|
|
1547
1688
|
}
|
|
1548
|
-
}),
|
|
1689
|
+
}), Mt = /* @__PURE__ */ L({
|
|
1549
1690
|
inheritAttrs: !1,
|
|
1550
1691
|
__name: "DockTrigger",
|
|
1551
1692
|
props: {
|
|
@@ -1565,7 +1706,7 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1565
1706
|
}
|
|
1566
1707
|
let o = (e, { attrs: t, slots: n }) => {
|
|
1567
1708
|
let { disabled: r, ...i } = t, o = r != null && r !== !1;
|
|
1568
|
-
return
|
|
1709
|
+
return R("button", {
|
|
1569
1710
|
...i,
|
|
1570
1711
|
type: i.type ?? "button",
|
|
1571
1712
|
...o ? {
|
|
@@ -1575,17 +1716,17 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1575
1716
|
}, n.default?.());
|
|
1576
1717
|
};
|
|
1577
1718
|
o.inheritAttrs = !1;
|
|
1578
|
-
let s =
|
|
1579
|
-
return (e, t) => r.for === "select" ?
|
|
1719
|
+
let s = j(() => e("dock-trigger", r.for === "select" && "dock-select-trigger", r.for !== "select" && "dock-dropdown-trigger", r.class));
|
|
1720
|
+
return (e, t) => r.for === "select" ? ce((G(), M(Y(fe), B({ key: 0 }, {
|
|
1580
1721
|
...e.$attrs,
|
|
1581
1722
|
...i
|
|
1582
1723
|
}, {
|
|
1583
1724
|
"as-child": "",
|
|
1584
1725
|
class: s.value
|
|
1585
1726
|
}), {
|
|
1586
|
-
default:
|
|
1587
|
-
default:
|
|
1588
|
-
default:
|
|
1727
|
+
default: Q(() => [I(o, null, {
|
|
1728
|
+
default: Q(() => [J(e.$slots, "default"), I(Y(de), { "as-child": "" }, {
|
|
1729
|
+
default: Q(() => [J(e.$slots, "icon", {}, () => [I(Y(pe), {
|
|
1589
1730
|
class: "dock-select-trigger__chevron",
|
|
1590
1731
|
"aria-hidden": "true"
|
|
1591
1732
|
})])]),
|
|
@@ -1594,7 +1735,7 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1594
1735
|
_: 3
|
|
1595
1736
|
})]),
|
|
1596
1737
|
_: 3
|
|
1597
|
-
}, 16, ["class"])), [[
|
|
1738
|
+
}, 16, ["class"])), [[Y(n)]]) : r.for === "dropdown" ? ce((G(), M(w, B({ key: 1 }, {
|
|
1598
1739
|
...e.$attrs,
|
|
1599
1740
|
...i
|
|
1600
1741
|
}, {
|
|
@@ -1602,26 +1743,26 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1602
1743
|
action: "pointerdown",
|
|
1603
1744
|
class: s.value
|
|
1604
1745
|
}), {
|
|
1605
|
-
default:
|
|
1606
|
-
default:
|
|
1746
|
+
default: Q(() => [I(o, null, {
|
|
1747
|
+
default: Q(() => [J(e.$slots, "default")]),
|
|
1607
1748
|
_: 3
|
|
1608
1749
|
})]),
|
|
1609
1750
|
_: 3
|
|
1610
|
-
}, 16, ["class"])), [[
|
|
1751
|
+
}, 16, ["class"])), [[Y(n)]]) : ce((G(), M(Y(le), B({ key: 2 }, {
|
|
1611
1752
|
...e.$attrs,
|
|
1612
1753
|
...i
|
|
1613
1754
|
}, {
|
|
1614
1755
|
"as-child": "",
|
|
1615
1756
|
class: s.value
|
|
1616
1757
|
}), {
|
|
1617
|
-
default:
|
|
1618
|
-
default:
|
|
1758
|
+
default: Q(() => [I(o, null, {
|
|
1759
|
+
default: Q(() => [J(e.$slots, "default")]),
|
|
1619
1760
|
_: 3
|
|
1620
1761
|
})]),
|
|
1621
1762
|
_: 3
|
|
1622
|
-
}, 16, ["class"])), [[
|
|
1763
|
+
}, 16, ["class"])), [[Y(n)]]);
|
|
1623
1764
|
}
|
|
1624
|
-
}),
|
|
1765
|
+
}), Nt = /* @__PURE__ */ L({
|
|
1625
1766
|
__name: "DockBackgroundToggle",
|
|
1626
1767
|
props: {
|
|
1627
1768
|
paused: {
|
|
@@ -1633,22 +1774,22 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1633
1774
|
},
|
|
1634
1775
|
emits: ["update:paused"],
|
|
1635
1776
|
setup(e, { emit: t }) {
|
|
1636
|
-
let n = e, r = t, i =
|
|
1777
|
+
let n = e, r = t, i = j(() => n.paused ? n.playLabel : n.pauseLabel);
|
|
1637
1778
|
function a() {
|
|
1638
1779
|
r("update:paused", !n.paused);
|
|
1639
1780
|
}
|
|
1640
|
-
return (t, n) => (
|
|
1781
|
+
return (t, n) => (G(), M(jt, {
|
|
1641
1782
|
type: "button",
|
|
1642
1783
|
active: e.paused,
|
|
1643
1784
|
"aria-pressed": e.paused,
|
|
1644
1785
|
"aria-label": i.value,
|
|
1645
1786
|
onClick: a
|
|
1646
1787
|
}, {
|
|
1647
|
-
default:
|
|
1788
|
+
default: Q(() => [e.paused ? (G(), M(Y(he), {
|
|
1648
1789
|
key: 0,
|
|
1649
1790
|
size: 18,
|
|
1650
1791
|
"aria-hidden": "true"
|
|
1651
|
-
})) : (
|
|
1792
|
+
})) : (G(), M(Y(me), {
|
|
1652
1793
|
key: 1,
|
|
1653
1794
|
size: 18,
|
|
1654
1795
|
"aria-hidden": "true"
|
|
@@ -1660,30 +1801,30 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1660
1801
|
"aria-label"
|
|
1661
1802
|
]));
|
|
1662
1803
|
}
|
|
1663
|
-
}),
|
|
1804
|
+
}), Pt = [
|
|
1664
1805
|
"data-orientation",
|
|
1665
1806
|
"data-dock-hairline",
|
|
1666
1807
|
"aria-orientation"
|
|
1667
|
-
],
|
|
1808
|
+
], Ft = /* @__PURE__ */ L({
|
|
1668
1809
|
__name: "DockSeparator",
|
|
1669
1810
|
props: { anchor: {
|
|
1670
1811
|
type: Boolean,
|
|
1671
1812
|
default: !1
|
|
1672
1813
|
} },
|
|
1673
1814
|
setup(e) {
|
|
1674
|
-
let t = v(), n =
|
|
1675
|
-
return (t, n) => (
|
|
1676
|
-
class:
|
|
1815
|
+
let t = v(), n = j(() => t?.orientation.value ?? "horizontal"), r = j(() => n.value), i = j(() => n.value === "vertical" ? "horizontal" : "vertical");
|
|
1816
|
+
return (t, n) => (G(), P("div", {
|
|
1817
|
+
class: H(["dock-separator", { "dock-hairline": e.anchor }]),
|
|
1677
1818
|
role: "separator",
|
|
1678
1819
|
"data-orientation": r.value,
|
|
1679
1820
|
"data-dock-hairline": e.anchor || void 0,
|
|
1680
1821
|
"aria-orientation": i.value
|
|
1681
|
-
}, null, 10,
|
|
1822
|
+
}, null, 10, Pt));
|
|
1682
1823
|
}
|
|
1683
1824
|
});
|
|
1684
1825
|
//#endregion
|
|
1685
1826
|
//#region src/composables/search/match.ts
|
|
1686
|
-
function
|
|
1827
|
+
function It(e, t) {
|
|
1687
1828
|
let n = e.length, r = t.length;
|
|
1688
1829
|
if (n === 0) return {
|
|
1689
1830
|
score: 0,
|
|
@@ -1707,11 +1848,11 @@ function Ft(e, t) {
|
|
|
1707
1848
|
matches: i
|
|
1708
1849
|
});
|
|
1709
1850
|
}
|
|
1710
|
-
function
|
|
1851
|
+
function Lt(e, t) {
|
|
1711
1852
|
if (!t) return null;
|
|
1712
1853
|
let n = 0, r = [];
|
|
1713
1854
|
for (let i of e) {
|
|
1714
|
-
let e =
|
|
1855
|
+
let e = It(i, t);
|
|
1715
1856
|
if (!e) return null;
|
|
1716
1857
|
n += e.score;
|
|
1717
1858
|
for (let t of e.matches) r.push(t);
|
|
@@ -1721,7 +1862,7 @@ function It(e, t) {
|
|
|
1721
1862
|
matches: r
|
|
1722
1863
|
};
|
|
1723
1864
|
}
|
|
1724
|
-
function
|
|
1865
|
+
function Rt(e, t) {
|
|
1725
1866
|
let n = null, r = [], i = [
|
|
1726
1867
|
[t._lc.label, 12],
|
|
1727
1868
|
[t._lc.type, 10],
|
|
@@ -1729,7 +1870,7 @@ function Lt(e, t) {
|
|
|
1729
1870
|
];
|
|
1730
1871
|
for (let [a, o] of i) {
|
|
1731
1872
|
if (!a) continue;
|
|
1732
|
-
let i =
|
|
1873
|
+
let i = Lt(e, a);
|
|
1733
1874
|
if (!i) continue;
|
|
1734
1875
|
let s = i.score * o;
|
|
1735
1876
|
(n === null || s > n) && (n = s, r = a === t._lc.label ? i.matches : []);
|
|
@@ -1739,7 +1880,7 @@ function Lt(e, t) {
|
|
|
1739
1880
|
matches: r
|
|
1740
1881
|
};
|
|
1741
1882
|
}
|
|
1742
|
-
function
|
|
1883
|
+
function zt(e) {
|
|
1743
1884
|
return e.map((e) => ({
|
|
1744
1885
|
item: e,
|
|
1745
1886
|
_lc: {
|
|
@@ -1749,15 +1890,15 @@ function Rt(e) {
|
|
|
1749
1890
|
}
|
|
1750
1891
|
}));
|
|
1751
1892
|
}
|
|
1752
|
-
var
|
|
1753
|
-
function
|
|
1754
|
-
let t =
|
|
1755
|
-
return t || (t = /* @__PURE__ */ new Map(),
|
|
1893
|
+
var Bt = /* @__PURE__ */ new WeakMap();
|
|
1894
|
+
function Vt(e) {
|
|
1895
|
+
let t = Bt.get(e);
|
|
1896
|
+
return t || (t = /* @__PURE__ */ new Map(), Bt.set(e, t)), t;
|
|
1756
1897
|
}
|
|
1757
|
-
function
|
|
1898
|
+
function Ht(e, t, n = 30) {
|
|
1758
1899
|
let r = t.toLowerCase().trim();
|
|
1759
1900
|
if (!r) return [];
|
|
1760
|
-
let i =
|
|
1901
|
+
let i = Vt(e), a = i.get(r);
|
|
1761
1902
|
if (a) return a.slice(0, n);
|
|
1762
1903
|
i.size > 200 && i.clear();
|
|
1763
1904
|
let o = r.split(/\s+/).filter(Boolean);
|
|
@@ -1776,7 +1917,7 @@ function Vt(e, t, n = 30) {
|
|
|
1776
1917
|
}
|
|
1777
1918
|
let c = [];
|
|
1778
1919
|
for (let e of s) {
|
|
1779
|
-
let t =
|
|
1920
|
+
let t = Rt(o, e);
|
|
1780
1921
|
t && c.push({
|
|
1781
1922
|
item: e.item,
|
|
1782
1923
|
score: t.score,
|
|
@@ -1785,21 +1926,21 @@ function Vt(e, t, n = 30) {
|
|
|
1785
1926
|
}
|
|
1786
1927
|
return c.sort((e, t) => t.score - e.score), i.set(r, c), c.slice(0, n);
|
|
1787
1928
|
}
|
|
1788
|
-
function
|
|
1929
|
+
function Ut(e) {
|
|
1789
1930
|
if (e) {
|
|
1790
|
-
|
|
1931
|
+
Bt.delete(e);
|
|
1791
1932
|
return;
|
|
1792
1933
|
}
|
|
1793
|
-
|
|
1934
|
+
Bt = /* @__PURE__ */ new WeakMap();
|
|
1794
1935
|
}
|
|
1795
1936
|
//#endregion
|
|
1796
1937
|
//#region src/composables/search/useFuzzySearch.ts
|
|
1797
|
-
function
|
|
1798
|
-
let t = typeof e.items == "function" ? e.items : () => e.items, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i =
|
|
1938
|
+
function Wt(e) {
|
|
1939
|
+
let t = typeof e.items == "function" ? e.items : () => e.items, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i = q(""), a = q(!1), o = q(!1), s = q(0), c = q(""), l = j(() => t()), u = j(() => zt(l.value)), d;
|
|
1799
1940
|
function f(e = d) {
|
|
1800
1941
|
e !== void 0 && (clearTimeout(e), d === e && (d = void 0));
|
|
1801
1942
|
}
|
|
1802
|
-
|
|
1943
|
+
Z(i, (e, t, r) => {
|
|
1803
1944
|
if (f(), !e || n <= 0) {
|
|
1804
1945
|
c.value = e;
|
|
1805
1946
|
return;
|
|
@@ -1808,18 +1949,18 @@ function Ut(e) {
|
|
|
1808
1949
|
d === i && (c.value = e, d = void 0);
|
|
1809
1950
|
}, n);
|
|
1810
1951
|
d = i, r(() => f(i));
|
|
1811
|
-
}),
|
|
1952
|
+
}), Z(l, () => {
|
|
1812
1953
|
f(), c.value = i.value, s.value = 0;
|
|
1813
1954
|
}, { deep: !0 });
|
|
1814
|
-
let p =
|
|
1815
|
-
|
|
1955
|
+
let p = j(() => Ht(u.value, c.value, r));
|
|
1956
|
+
Z(p, () => {
|
|
1816
1957
|
s.value = 0;
|
|
1817
1958
|
});
|
|
1818
1959
|
function m(t) {
|
|
1819
1960
|
e.onSelect?.(t), h();
|
|
1820
1961
|
}
|
|
1821
1962
|
function h() {
|
|
1822
|
-
a.value = !1, o.value = !1, f(), i.value = "", c.value = "", s.value = 0,
|
|
1963
|
+
a.value = !1, o.value = !1, f(), i.value = "", c.value = "", s.value = 0, Ut(u.value);
|
|
1823
1964
|
}
|
|
1824
1965
|
function g() {
|
|
1825
1966
|
a.value = !0;
|
|
@@ -1843,8 +1984,8 @@ function Ut(e) {
|
|
|
1843
1984
|
break;
|
|
1844
1985
|
}
|
|
1845
1986
|
}
|
|
1846
|
-
return
|
|
1847
|
-
f(),
|
|
1987
|
+
return W(() => {
|
|
1988
|
+
f(), Ut(u.value);
|
|
1848
1989
|
}, !0), {
|
|
1849
1990
|
query: i,
|
|
1850
1991
|
results: p,
|
|
@@ -1860,13 +2001,13 @@ function Ut(e) {
|
|
|
1860
2001
|
}
|
|
1861
2002
|
//#endregion
|
|
1862
2003
|
//#region src/components/dock/composables/useDockSearch.ts
|
|
1863
|
-
function
|
|
1864
|
-
let { dockState: t } = e, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i =
|
|
2004
|
+
function Gt(e) {
|
|
2005
|
+
let { dockState: t } = e, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i = q([]), a = null, o = e.items ? e.items : () => i.value;
|
|
1865
2006
|
function s(t) {
|
|
1866
2007
|
let n = t.item.id;
|
|
1867
2008
|
e.ensureTargetWindow?.(n), e.scrollTo?.(n), e.onResultSelect?.(t);
|
|
1868
2009
|
}
|
|
1869
|
-
let c =
|
|
2010
|
+
let c = Wt({
|
|
1870
2011
|
items: o,
|
|
1871
2012
|
debounceMs: n,
|
|
1872
2013
|
maxResults: r,
|
|
@@ -1874,7 +2015,7 @@ function Wt(e) {
|
|
|
1874
2015
|
});
|
|
1875
2016
|
if (e.onSearch) {
|
|
1876
2017
|
let t = e.onSearch;
|
|
1877
|
-
|
|
2018
|
+
Z(() => c.query.value, (e) => {
|
|
1878
2019
|
if (a?.abort(), !e) {
|
|
1879
2020
|
i.value = [];
|
|
1880
2021
|
return;
|
|
@@ -1887,7 +2028,7 @@ function Wt(e) {
|
|
|
1887
2028
|
});
|
|
1888
2029
|
});
|
|
1889
2030
|
}
|
|
1890
|
-
let l =
|
|
2031
|
+
let l = j(() => {
|
|
1891
2032
|
let e = c.query.value;
|
|
1892
2033
|
if (!e) return "";
|
|
1893
2034
|
let t = c.results.value[0];
|
|
@@ -1910,7 +2051,7 @@ function Wt(e) {
|
|
|
1910
2051
|
return e.collapseOnScroll && e.scrollContainer && (g = k(e.scrollContainer, {
|
|
1911
2052
|
collapseOnScroll: !0,
|
|
1912
2053
|
chromeRef: e.chromeRef
|
|
1913
|
-
})),
|
|
2054
|
+
})), W(() => {
|
|
1914
2055
|
a?.abort(), a = null;
|
|
1915
2056
|
}), {
|
|
1916
2057
|
fuzzy: c,
|
|
@@ -1923,4 +2064,4 @@ function Wt(e) {
|
|
|
1923
2064
|
};
|
|
1924
2065
|
}
|
|
1925
2066
|
//#endregion
|
|
1926
|
-
export { _ as DOCK_CONTEXT_KEY,
|
|
2067
|
+
export { _ as DOCK_CONTEXT_KEY, Nt as DockBackgroundToggle, jt as DockControl, xt as DockCrossfade, At as DockLayer, Dt as DockLayerGroup, Ft as DockSeparator, Mt as DockTrigger, ft as GlassDock, l as provideDockContext, g as useDockContext, D as useDockCtaReceive, Gt as useDockSearch, v as useOptionalDockContext };
|