@mkbabb/glass-ui 10.1.2 → 10.1.4
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/data-table/composables/useDataTableResponsive.d.ts +2 -0
- package/dist/components/deck/styles/capture.css +1 -1
- package/dist/components/dock/composables/dockMorphMeasure.d.ts +13 -0
- package/dist/components/dock/composables/useDockMorph.d.ts +7 -3
- package/dist/components/dock/styles/index.css +1 -1
- package/dist/components/dock/styles/layers.css +1 -1
- package/dist/components/dock/styles/shape.css +1 -1
- package/dist/components/dock/styles/shell.css +1 -1
- package/dist/composables/dom/useResizeObserver.d.ts +3 -1
- package/dist/{configurator-CPxIo3q2.js → configurator-Dl10mc3L.js} +1 -1
- package/dist/configurator.js +1 -1
- package/dist/{data-table-Cs93-uY7.js → data-table-DQuWkiwL.js} +112 -107
- package/dist/data-table.js +1 -1
- package/dist/dock.js +564 -412
- package/dist/dom.js +1 -1
- package/dist/{fading-scroll-CTeW3KNS.js → fading-scroll-ClCPooXb.js} +1 -1
- package/dist/fading-scroll.js +1 -1
- package/dist/glass-ui.js +3 -3
- package/dist/pager-dots.js +1 -1
- package/dist/{useResizeObserver-CdUlm2QZ.js → useResizeObserver-Bv3nN46q.js} +4 -7
- package/package.json +1 -1
package/dist/dock.js
CHANGED
|
@@ -7,7 +7,7 @@ import { t as a } from "./useLiquidPress-h1scrPtP.js";
|
|
|
7
7
|
import { t as o } from "./useMotionAxis-D-rtIhca.js";
|
|
8
8
|
import { n as s, t as c } from "./createContext-BhkE9mLH.js";
|
|
9
9
|
import { a as l, c as u, d, f, i as p, l as m, n as h, o as g, r as _, s as v, u as y } from "./participation-B7UFdgXB.js";
|
|
10
|
-
import { t as b } from "./useResizeObserver-
|
|
10
|
+
import { t as b } from "./useResizeObserver-Bv3nN46q.js";
|
|
11
11
|
import { n as x } from "./useResolveTokenColor-B2FfJnd9.js";
|
|
12
12
|
import { t as S } from "./useIntersectionPause-CzKR3EyP.js";
|
|
13
13
|
import { t as C } from "./focus-Duf7EpUu.js";
|
|
@@ -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 ee, computed as A, createBlock as j, createCommentVNode as M, createElementBlock as N, createElementVNode as P, createVNode as F, defineComponent as I, h as te, mergeModels as L, mergeProps as R, nextTick as z, normalizeClass as B, normalizeStyle as ne, onBeforeUnmount as V, onMounted as H, onScopeDispose as U, onUnmounted as re, openBlock as W, readonly as G, ref as K, renderList as ie, renderSlot as q, resolveDynamicComponent as ae, toDisplayString as oe, unref as J, useId as se, useModel as ce, useTemplateRef as Y, watch as X, withCtx as Z, withDirectives as Q, withModifiers as le } from "vue";
|
|
20
|
+
import { PopoverTrigger as ue, Primitive as de, SelectIcon as fe, SelectTrigger as pe } from "reka-ui";
|
|
21
|
+
import { ChevronDown as me, Pause as he, Play as ge } from "@lucide/vue";
|
|
22
|
+
import { SpringProgress as _e } from "@mkbabb/keyframes.js";
|
|
23
|
+
import { useMediaQuery as ve } from "@vueuse/core";
|
|
24
24
|
//#region src/components/_shared/overlay/isTeleportedTarget.ts
|
|
25
|
-
function
|
|
25
|
+
function ye(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 be(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 xe(e, t, n) {
|
|
37
|
+
return .2126 * be(e) + .7152 * be(t) + .0722 * be(n);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Se(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 Ce(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 Se(e) {
|
|
|
52
52
|
t[4] === void 0 ? 1 : Number(t[4])
|
|
53
53
|
] : null;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function we(e) {
|
|
56
56
|
return typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement;
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
function
|
|
58
|
+
var Te = "[data-glass-field-canvas] canvas, canvas[data-glass-field-canvas]";
|
|
59
|
+
function Ee(e) {
|
|
60
60
|
if (!e) {
|
|
61
61
|
if (typeof document < "u") {
|
|
62
|
-
let e = document.querySelector(
|
|
63
|
-
if (
|
|
62
|
+
let e = document.querySelector(Te);
|
|
63
|
+
if (we(e)) return e;
|
|
64
64
|
}
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
67
|
-
if (
|
|
67
|
+
if (we(e)) return e;
|
|
68
68
|
if (typeof e == "function") {
|
|
69
69
|
let t = e();
|
|
70
|
-
return
|
|
70
|
+
return we(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 we(t) ? t : null;
|
|
75
75
|
}
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
let n =
|
|
78
|
+
function De(e, t) {
|
|
79
|
+
let n = Ce(e);
|
|
80
80
|
if (n) return n;
|
|
81
81
|
if (!t) return null;
|
|
82
82
|
try {
|
|
@@ -92,7 +92,7 @@ function Ee(e, t) {
|
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function Oe(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 De(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] = Se(e[t], e[t + 1], e[t + 2], n, r);
|
|
106
|
+
i += xe(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 ke(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 = De(x(r, e), t);
|
|
118
118
|
if (i && !(i[3] < .5)) return i;
|
|
119
119
|
}
|
|
120
|
-
return
|
|
120
|
+
return De(x(getComputedStyle(document.body).backgroundColor, e), t);
|
|
121
121
|
}
|
|
122
|
-
var
|
|
122
|
+
var Ae = [
|
|
123
123
|
255,
|
|
124
124
|
255,
|
|
125
125
|
255
|
|
126
126
|
];
|
|
127
|
-
function
|
|
128
|
-
let n =
|
|
127
|
+
function je(e, t) {
|
|
128
|
+
let n = ke(e, t);
|
|
129
129
|
return n && n[3] >= .5 ? [
|
|
130
130
|
n[0],
|
|
131
131
|
n[1],
|
|
132
132
|
n[2]
|
|
133
|
-
] : [...
|
|
133
|
+
] : [...Ae];
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
let n =
|
|
137
|
-
return n ?
|
|
135
|
+
function Me(e, t) {
|
|
136
|
+
let n = ke(e, t);
|
|
137
|
+
return n ? Ne(n) : null;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
return { luma:
|
|
139
|
+
function Ne(e) {
|
|
140
|
+
return { luma: xe(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 Pe = "data-glass-backdrop-shared";
|
|
145
|
+
function Fe(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(`[${Pe}]`) !== null;
|
|
149
149
|
}
|
|
150
|
-
let l =
|
|
150
|
+
let l = K(null), u = K(null), d = K({
|
|
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: G(l),
|
|
157
|
+
bucket: G(u),
|
|
158
|
+
sample: G(d),
|
|
159
159
|
sampleNow: () => {},
|
|
160
160
|
dispose: () => {}
|
|
161
161
|
};
|
|
@@ -164,7 +164,7 @@ function Pe(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 || Ee(void 0) !== null : n.live;
|
|
168
168
|
}
|
|
169
169
|
function _(e) {
|
|
170
170
|
let t = e.getBoundingClientRect();
|
|
@@ -202,7 +202,7 @@ function Pe(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" ? Ee(n.backgroundCanvas) : null, o = i === "live" ? Oe(t, a, r, je(t, r)) : Me(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 Pe(e, n = {}) {
|
|
|
226
226
|
}
|
|
227
227
|
f.value ? (w.stop(), C()) : g() && w.start();
|
|
228
228
|
}
|
|
229
|
-
let k =
|
|
229
|
+
let k = X(f, D, { flush: "sync" }), ee = X(() => e.value, (e) => {
|
|
230
230
|
if (e) {
|
|
231
|
-
if (s) e.setAttribute(
|
|
231
|
+
if (s) e.setAttribute(Pe, "");
|
|
232
232
|
else if (c(e)) return;
|
|
233
233
|
C(), D();
|
|
234
234
|
}
|
|
@@ -236,132 +236,186 @@ function Pe(e, n = {}) {
|
|
|
236
236
|
immediate: !0,
|
|
237
237
|
flush: "post"
|
|
238
238
|
});
|
|
239
|
-
function
|
|
240
|
-
|
|
239
|
+
function A() {
|
|
240
|
+
ee(), k(), w.dispose(), T.dispose(), E.stop(), p = null, m = null;
|
|
241
241
|
}
|
|
242
|
-
return
|
|
243
|
-
luma:
|
|
244
|
-
bucket:
|
|
245
|
-
sample:
|
|
242
|
+
return U(A), {
|
|
243
|
+
luma: G(l),
|
|
244
|
+
bucket: G(u),
|
|
245
|
+
sample: G(d),
|
|
246
246
|
sampleNow: C,
|
|
247
|
-
dispose:
|
|
247
|
+
dispose: A
|
|
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 Ie(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 = K(c() ? "pinned" : i ? "hover" : "collapsed"), f = A(() => d.value !== "collapsed"), p = A(() => d.value === "pinned"), m = null, h = K(0), g = K(0), _ = A(() => h.value > 0), v = A(() => g.value > 0), y = null, b = null, x = !1, S = null;
|
|
254
254
|
function C() {
|
|
255
255
|
S &&= (clearTimeout(S), null);
|
|
256
256
|
}
|
|
257
|
-
let w =
|
|
258
|
-
function
|
|
259
|
-
|
|
257
|
+
let w = null, T = null, E = null, D = () => w === "down" || w === "compat";
|
|
258
|
+
function O() {
|
|
259
|
+
if (!w) return;
|
|
260
|
+
w = null, E &&= (clearTimeout(E), null);
|
|
261
|
+
for (let [e, t] of j) window.removeEventListener(e, t, !0);
|
|
262
|
+
let e = T;
|
|
263
|
+
T = null, e && !l() && d.value === "collapsed" && (F(), d.value = "hover", P());
|
|
264
|
+
}
|
|
265
|
+
function k() {
|
|
266
|
+
E ??= setTimeout(O, 0);
|
|
267
|
+
}
|
|
268
|
+
function ee() {
|
|
269
|
+
T = null, O();
|
|
270
|
+
}
|
|
271
|
+
let j = [
|
|
272
|
+
["click", () => O()],
|
|
273
|
+
["pointercancel", () => O()],
|
|
274
|
+
["dragstart", () => O()],
|
|
275
|
+
["contextmenu", () => O()],
|
|
276
|
+
["pointerup", (e) => {
|
|
277
|
+
w === "down" && (e.pointerType === "touch" ? w = "tap" : k());
|
|
278
|
+
}],
|
|
279
|
+
["mousedown", () => {
|
|
280
|
+
w === "tap" && (w = "compat");
|
|
281
|
+
}],
|
|
282
|
+
["mouseup", () => {
|
|
283
|
+
w === "compat" && k();
|
|
284
|
+
}],
|
|
285
|
+
["pointerdown", (e) => {
|
|
286
|
+
(w === "tap" || e.isPrimary) && ee();
|
|
287
|
+
}]
|
|
288
|
+
];
|
|
289
|
+
function M() {
|
|
290
|
+
w && ee(), w = "down";
|
|
291
|
+
for (let [e, t] of j) window.addEventListener(e, t, !0);
|
|
292
|
+
}
|
|
293
|
+
X(n, (e, t, n) => {
|
|
294
|
+
e && (e.addEventListener("pointerdown", M, !0), n(() => e.removeEventListener("pointerdown", M, !0)));
|
|
295
|
+
}, {
|
|
296
|
+
immediate: !0,
|
|
297
|
+
flush: "sync"
|
|
298
|
+
});
|
|
299
|
+
let N = d.value;
|
|
300
|
+
function P() {
|
|
301
|
+
c() && (d.value = "pinned"), s && N !== d.value && s(d.value, N), N = d.value;
|
|
260
302
|
}
|
|
261
|
-
function
|
|
303
|
+
function F() {
|
|
262
304
|
m &&= (clearTimeout(m), null);
|
|
263
305
|
}
|
|
264
|
-
function
|
|
306
|
+
function I() {
|
|
265
307
|
b !== null && (cancelAnimationFrame(b), b = null);
|
|
266
308
|
}
|
|
267
|
-
function
|
|
268
|
-
|
|
309
|
+
function te() {
|
|
310
|
+
I(), y?.();
|
|
269
311
|
}
|
|
270
|
-
function
|
|
271
|
-
l() || h.value > 0 || (
|
|
272
|
-
d.value = "collapsed",
|
|
312
|
+
function L() {
|
|
313
|
+
l() || h.value > 0 || (F(), m = setTimeout(() => {
|
|
314
|
+
d.value = "collapsed", P();
|
|
273
315
|
}, t));
|
|
274
316
|
}
|
|
275
|
-
function
|
|
317
|
+
function R() {
|
|
276
318
|
if (c()) {
|
|
277
|
-
d.value = "pinned",
|
|
319
|
+
d.value = "pinned", P();
|
|
278
320
|
return;
|
|
279
321
|
}
|
|
280
|
-
x ||= (x = !0,
|
|
322
|
+
x ||= (x = !0, F(), C(), d.value = "collapsed", P(), !1);
|
|
281
323
|
}
|
|
282
|
-
function
|
|
324
|
+
function z() {
|
|
283
325
|
if (c()) {
|
|
284
|
-
d.value = "pinned",
|
|
326
|
+
d.value = "pinned", P();
|
|
285
327
|
return;
|
|
286
328
|
}
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
function
|
|
290
|
-
l() || (
|
|
291
|
-
S = null, !l() && d.value === "collapsed"
|
|
329
|
+
F(), C(), d.value = "hover", P();
|
|
330
|
+
}
|
|
331
|
+
function B() {
|
|
332
|
+
l() || (F(), d.value === "collapsed" && (C(), S = setTimeout(() => {
|
|
333
|
+
if (S = null, !l() && d.value === "collapsed") {
|
|
334
|
+
if (D()) {
|
|
335
|
+
T ??= "hover";
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
d.value = "hover", P();
|
|
339
|
+
}
|
|
292
340
|
}, 60)));
|
|
293
341
|
}
|
|
294
|
-
function
|
|
295
|
-
if (!l() && (C(), d.value === "hover")) {
|
|
342
|
+
function ne(e) {
|
|
343
|
+
if (!l() && (C(), T === "hover" && (T = null), d.value === "hover")) {
|
|
296
344
|
if (h.value > 0) return;
|
|
297
345
|
if (e) {
|
|
298
346
|
let t = n.value;
|
|
299
|
-
if (t && e.relatedTarget instanceof Node && t.contains(e.relatedTarget) ||
|
|
347
|
+
if (t && e.relatedTarget instanceof Node && t.contains(e.relatedTarget) || ye(e.relatedTarget, o)) return;
|
|
300
348
|
}
|
|
301
|
-
|
|
349
|
+
L();
|
|
302
350
|
}
|
|
303
351
|
}
|
|
304
|
-
function
|
|
305
|
-
l()
|
|
352
|
+
function V() {
|
|
353
|
+
if (!l() && (F(), d.value === "collapsed")) {
|
|
354
|
+
if (D()) {
|
|
355
|
+
T = "focus";
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
d.value = "hover", P();
|
|
359
|
+
}
|
|
306
360
|
}
|
|
307
|
-
function
|
|
308
|
-
if (l()
|
|
309
|
-
let t = e.currentTarget;
|
|
310
|
-
|
|
361
|
+
function H(e) {
|
|
362
|
+
if (l()) return;
|
|
363
|
+
let t = e.currentTarget, n = !!e.relatedTarget && t.contains(e.relatedTarget) || ye(e.relatedTarget, o);
|
|
364
|
+
!n && T === "focus" && (T = null), d.value === "hover" && (h.value > 0 || n || L());
|
|
311
365
|
}
|
|
312
|
-
function
|
|
313
|
-
l() || (
|
|
366
|
+
function U() {
|
|
367
|
+
l() || (F(), C(), d.value = "pinned", P());
|
|
314
368
|
}
|
|
315
|
-
function
|
|
316
|
-
h.value++, e === "grasp" && g.value++,
|
|
369
|
+
function W(e = "morph") {
|
|
370
|
+
h.value++, e === "grasp" && g.value++, F();
|
|
317
371
|
}
|
|
318
|
-
function
|
|
319
|
-
e === "grasp" && (g.value = Math.max(0, g.value - 1)), h.value = Math.max(0, h.value - 1), h.value === 0 && d.value === "hover" && (
|
|
320
|
-
h.value === 0 && d.value === "hover" &&
|
|
372
|
+
function G(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" && (F(), m = setTimeout(() => {
|
|
374
|
+
h.value === 0 && d.value === "hover" && L();
|
|
321
375
|
}, Math.min(t, 800)));
|
|
322
376
|
}
|
|
323
|
-
function
|
|
377
|
+
function ie(e) {
|
|
324
378
|
if (l() || h.value > 0 || a?.value) return;
|
|
325
379
|
let t = n.value;
|
|
326
|
-
!t || t.contains(e.target) ||
|
|
380
|
+
!t || t.contains(e.target) || ye(e.target, o) || R();
|
|
327
381
|
}
|
|
328
|
-
return
|
|
382
|
+
return X(f, (e) => {
|
|
329
383
|
if (e) {
|
|
330
384
|
if (typeof document > "u") return;
|
|
331
|
-
|
|
332
|
-
b = null, f.value && (document.addEventListener("pointerdown",
|
|
333
|
-
document.removeEventListener("pointerdown",
|
|
385
|
+
te(), b = requestAnimationFrame(() => {
|
|
386
|
+
b = null, f.value && (document.addEventListener("pointerdown", ie, !0), y = () => {
|
|
387
|
+
document.removeEventListener("pointerdown", ie, !0), y = null;
|
|
334
388
|
});
|
|
335
389
|
});
|
|
336
|
-
} else
|
|
337
|
-
}, { immediate: !0 }), typeof r == "boolean" ? r && (d.value = "pinned",
|
|
390
|
+
} else te();
|
|
391
|
+
}, { immediate: !0 }), typeof r == "boolean" ? r && (d.value = "pinned", P()) : X(r, (e) => {
|
|
338
392
|
if (e) {
|
|
339
|
-
|
|
393
|
+
F(), d.value = "pinned", P();
|
|
340
394
|
return;
|
|
341
395
|
}
|
|
342
|
-
d.value = "collapsed",
|
|
343
|
-
}),
|
|
344
|
-
|
|
396
|
+
d.value = "collapsed", P();
|
|
397
|
+
}), re(() => {
|
|
398
|
+
F(), C(), te(), ee();
|
|
345
399
|
}), {
|
|
346
400
|
state: d,
|
|
347
401
|
expanded: f,
|
|
348
402
|
isPinned: p,
|
|
349
403
|
isHeld: _,
|
|
350
404
|
graspHeld: v,
|
|
351
|
-
onMouseEnter:
|
|
352
|
-
onMouseLeave:
|
|
353
|
-
onFocusIn:
|
|
354
|
-
onFocusOut:
|
|
355
|
-
onClickCollapsed:
|
|
356
|
-
keepOpen:
|
|
357
|
-
release:
|
|
358
|
-
expand:
|
|
359
|
-
collapse:
|
|
405
|
+
onMouseEnter: B,
|
|
406
|
+
onMouseLeave: ne,
|
|
407
|
+
onFocusIn: V,
|
|
408
|
+
onFocusOut: H,
|
|
409
|
+
onClickCollapsed: U,
|
|
410
|
+
keepOpen: W,
|
|
411
|
+
release: G,
|
|
412
|
+
expand: z,
|
|
413
|
+
collapse: R
|
|
360
414
|
};
|
|
361
415
|
}
|
|
362
416
|
//#endregion
|
|
363
417
|
//#region src/components/dock/composables/useDockSpring.ts
|
|
364
|
-
function
|
|
418
|
+
function Le(e) {
|
|
365
419
|
let t = null, n = () => t !== null && !t.settled;
|
|
366
420
|
function i() {
|
|
367
421
|
t &&= (t.dispose(), null);
|
|
@@ -369,7 +423,7 @@ function Ie(e) {
|
|
|
369
423
|
function a(a, o, s) {
|
|
370
424
|
let c = n() ? t.velocity * (s.inheritVelocityScale ?? 1) : 0;
|
|
371
425
|
i();
|
|
372
|
-
let l = new
|
|
426
|
+
let l = new _e({
|
|
373
427
|
response: e.response * r(),
|
|
374
428
|
dampingFraction: e.dampingFraction,
|
|
375
429
|
initial: a,
|
|
@@ -396,50 +450,50 @@ function Ie(e) {
|
|
|
396
450
|
}
|
|
397
451
|
//#endregion
|
|
398
452
|
//#region src/components/dock/composables/useDockMorph.ts
|
|
399
|
-
function
|
|
400
|
-
let { rootEl: t, outerActiveLayer: n } = e,
|
|
453
|
+
function Re(e) {
|
|
454
|
+
let { rootEl: t, outerActiveLayer: n, geometry: r } = e, i = K(n.value), a = K(null), o = Le({
|
|
401
455
|
response: d.response,
|
|
402
456
|
dampingFraction: d.dampingFraction
|
|
403
|
-
}),
|
|
404
|
-
function
|
|
457
|
+
}), s = ve("(prefers-reduced-motion: reduce)");
|
|
458
|
+
function c() {
|
|
405
459
|
return t.value;
|
|
406
460
|
}
|
|
407
|
-
function
|
|
408
|
-
|
|
409
|
-
let t =
|
|
410
|
-
t && (t.removeAttribute("data-morphing"), t.style.removeProperty("--dock-morph-t")), e.onMorphActiveChange?.(!1),
|
|
461
|
+
function l() {
|
|
462
|
+
a.value = null;
|
|
463
|
+
let t = c();
|
|
464
|
+
t && (t.removeAttribute("data-morphing"), t.style.removeProperty("--dock-morph-t"), r.release()), e.onMorphActiveChange?.(!1), o.dispose();
|
|
411
465
|
}
|
|
412
|
-
|
|
413
|
-
e &&
|
|
466
|
+
X(s, (e) => {
|
|
467
|
+
e && c()?.hasAttribute("data-morphing") && l();
|
|
414
468
|
});
|
|
415
|
-
function
|
|
416
|
-
let t =
|
|
469
|
+
function u() {
|
|
470
|
+
let t = c();
|
|
417
471
|
if (!t) return;
|
|
418
472
|
e.onMorphActiveChange?.(!0), t.setAttribute("data-morphing", "");
|
|
419
|
-
let n = Number.parseFloat(t.style.getPropertyValue("--dock-morph-t")),
|
|
420
|
-
t.style.setProperty("--dock-morph-t", `${
|
|
421
|
-
inheritVelocityScale:
|
|
473
|
+
let n = Number.parseFloat(t.style.getPropertyValue("--dock-morph-t")), i = o.live && !Number.isNaN(n), a = i ? 1 - n : 0;
|
|
474
|
+
t.style.setProperty("--dock-morph-t", `${a}`), r.anchor(), o.playTo(a, 1, {
|
|
475
|
+
inheritVelocityScale: i ? -1 : 1,
|
|
422
476
|
onFrame: (e) => {
|
|
423
|
-
|
|
477
|
+
c()?.style.setProperty("--dock-morph-t", `${e}`);
|
|
424
478
|
},
|
|
425
|
-
onSettle:
|
|
479
|
+
onSettle: l
|
|
426
480
|
});
|
|
427
481
|
}
|
|
428
|
-
let
|
|
429
|
-
e !== t && (r.value = e,
|
|
430
|
-
}),
|
|
431
|
-
|
|
482
|
+
let f = X(n, (e, t) => {
|
|
483
|
+
e !== t && (c() && r.first(), i.value = e, a.value = c() ? t : null);
|
|
484
|
+
}), p = X(n, (e, t) => {
|
|
485
|
+
e === t || !c() || (r.measure(), u());
|
|
432
486
|
}, { flush: "post" });
|
|
433
|
-
return
|
|
434
|
-
|
|
487
|
+
return re(() => {
|
|
488
|
+
f(), p(), o.dispose();
|
|
435
489
|
}), {
|
|
436
|
-
outerCurrentLayer:
|
|
437
|
-
outerLeavingLayer:
|
|
490
|
+
outerCurrentLayer: G(i),
|
|
491
|
+
outerLeavingLayer: G(a)
|
|
438
492
|
};
|
|
439
493
|
}
|
|
440
494
|
//#endregion
|
|
441
495
|
//#region src/components/dock/composables/dockMorphMeasure.ts
|
|
442
|
-
function
|
|
496
|
+
function $(e, t) {
|
|
443
497
|
return t === "vertical" ? e.offsetHeight : e.offsetWidth;
|
|
444
498
|
}
|
|
445
499
|
function ze(e, t) {
|
|
@@ -492,26 +546,37 @@ function Ve(e, t, n, r, i) {
|
|
|
492
546
|
"absolute"
|
|
493
547
|
]
|
|
494
548
|
], () => {
|
|
495
|
-
let n =
|
|
549
|
+
let n = $(e, r);
|
|
496
550
|
if (i === null) return n;
|
|
497
|
-
let o = i - (n -
|
|
551
|
+
let o = i - (n - $(t, r));
|
|
498
552
|
if (Math.abs(o) < .5) return n;
|
|
499
553
|
let s = Number.parseFloat(getComputedStyle(t).getPropertyValue(a)) || 0;
|
|
500
554
|
return ze([[
|
|
501
555
|
t,
|
|
502
556
|
a,
|
|
503
557
|
`${s + o}px`
|
|
504
|
-
]], () =>
|
|
558
|
+
]], () => $(e, r));
|
|
505
559
|
});
|
|
506
560
|
}
|
|
507
|
-
function He(e) {
|
|
561
|
+
function He(e, t) {
|
|
562
|
+
let n = e.getBoundingClientRect();
|
|
563
|
+
return t === "vertical" ? {
|
|
564
|
+
start: n.top,
|
|
565
|
+
size: n.height
|
|
566
|
+
} : {
|
|
567
|
+
start: n.left,
|
|
568
|
+
size: n.width
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
var Ue = "--dock-morph-origin", We = "--dock-pane-shift";
|
|
572
|
+
function Ge(e) {
|
|
508
573
|
let { rootEl: t, contentEl: n, expandedEl: r, collapsedEl: i, axis: a } = e, o = null, s = null, c = null, l = null, u = null, d = !1;
|
|
509
574
|
function f() {
|
|
510
575
|
let e = t.value, o = r.value, s = i.value;
|
|
511
576
|
if (!e || !n.value || !o || !s) return;
|
|
512
577
|
let d = a.value, f = o.classList.contains("is-active");
|
|
513
578
|
if (!e.hasAttribute("data-morphing")) {
|
|
514
|
-
let t =
|
|
579
|
+
let t = $(e, d) - $(f ? o : s, d);
|
|
515
580
|
f ? c = t : l = t;
|
|
516
581
|
}
|
|
517
582
|
let p = Be(o, () => Ve(e, o, s, d, c));
|
|
@@ -544,7 +609,7 @@ function He(e) {
|
|
|
544
609
|
f();
|
|
545
610
|
}
|
|
546
611
|
}
|
|
547
|
-
|
|
612
|
+
X([
|
|
548
613
|
t,
|
|
549
614
|
n,
|
|
550
615
|
r,
|
|
@@ -554,26 +619,113 @@ function He(e) {
|
|
|
554
619
|
let h = () => f();
|
|
555
620
|
typeof window < "u" && window.addEventListener("resize", h);
|
|
556
621
|
let g = typeof document < "u" ? document.fonts : void 0;
|
|
557
|
-
|
|
622
|
+
g && g.ready.then(() => !d && f()), U(() => {
|
|
558
623
|
d = !0, o?.disconnect(), o = null, s?.disconnect(), s = null, typeof window < "u" && window.removeEventListener("resize", h);
|
|
559
|
-
})
|
|
624
|
+
});
|
|
625
|
+
let _ = null;
|
|
626
|
+
function v(e) {
|
|
627
|
+
return [...e.querySelectorAll(":scope > .dock-controls > .dock-persistent")];
|
|
628
|
+
}
|
|
629
|
+
function y() {
|
|
630
|
+
return [r.value, i.value].filter((e) => !!e);
|
|
631
|
+
}
|
|
632
|
+
function b() {
|
|
633
|
+
let e = t.value;
|
|
634
|
+
if (!e) return;
|
|
635
|
+
let n = a.value;
|
|
636
|
+
_ = new Map([
|
|
637
|
+
e,
|
|
638
|
+
...v(e),
|
|
639
|
+
...y()
|
|
640
|
+
].map((e) => [e, He(e, n)]));
|
|
641
|
+
}
|
|
642
|
+
function x() {
|
|
643
|
+
let e = t.value;
|
|
644
|
+
if (e) {
|
|
645
|
+
for (let t of [
|
|
646
|
+
e,
|
|
647
|
+
...v(e),
|
|
648
|
+
n.value
|
|
649
|
+
]) t?.style.removeProperty(Ue);
|
|
650
|
+
for (let e of y()) e.style.removeProperty(We);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
function S() {
|
|
654
|
+
let e = t.value, i = n.value, o = _;
|
|
655
|
+
if (_ = null, x(), !e || !i || !o || !o.get(e)) return;
|
|
656
|
+
let s = a.value, c = v(e), l = He(e, s), u = [
|
|
657
|
+
e,
|
|
658
|
+
...c,
|
|
659
|
+
i
|
|
660
|
+
].map((e) => [
|
|
661
|
+
e,
|
|
662
|
+
"scale",
|
|
663
|
+
"none"
|
|
664
|
+
]), d = () => new Map([
|
|
665
|
+
e,
|
|
666
|
+
...c,
|
|
667
|
+
i,
|
|
668
|
+
...y()
|
|
669
|
+
].map((e) => [e, He(e, s)])), f = ze(u, d), p = f.get(e), m = $(e, s), h = p.size / m;
|
|
670
|
+
if (!(h > 0)) return;
|
|
671
|
+
let g = (e) => Math.abs(1 - e) < 1e-4, b = l.size / p.size, S = !r.value?.classList.contains("is-active") || g(b) ? ze([
|
|
672
|
+
...u,
|
|
673
|
+
[
|
|
674
|
+
e,
|
|
675
|
+
"--dock-expanded-px",
|
|
676
|
+
"initial"
|
|
677
|
+
],
|
|
678
|
+
[
|
|
679
|
+
e,
|
|
680
|
+
"--dock-morph-t",
|
|
681
|
+
"1"
|
|
682
|
+
]
|
|
683
|
+
], d) : null, C = o;
|
|
684
|
+
if (S && g(b) && (C = S, b = S.get(e).size / p.size), !Number.isFinite(b)) return;
|
|
685
|
+
let w = (e) => (e - p.start) / h, T = (e, t) => g(b) ? null : (e - t) / (1 - b), E = (e) => w(e.start + e.size / 2), D = T(w(C.get(e).start), 0) ?? m / 2, O = (e, t) => `${e / t * 100}%`;
|
|
686
|
+
e.style.setProperty(Ue, O(D, m));
|
|
687
|
+
for (let e of c) {
|
|
688
|
+
let t = C.get(e), n = f.get(e), r = $(e, s);
|
|
689
|
+
if (!t || !(r > 0)) continue;
|
|
690
|
+
let i = T(E(t), E(n));
|
|
691
|
+
e.style.setProperty(Ue, O((i === null ? D : D - i) - w(n.start), r));
|
|
692
|
+
}
|
|
693
|
+
let k = $(i, s);
|
|
694
|
+
k > 0 && i.style.setProperty(Ue, O(D - w(f.get(i).start), k));
|
|
695
|
+
for (let t of y()) {
|
|
696
|
+
let n = t.classList.contains("is-leaving"), r = n ? o.get(t) : S?.get(t), i = $(t, s);
|
|
697
|
+
if (!r || !(i > 0)) continue;
|
|
698
|
+
let a = n ? f.get(t) : ze([[
|
|
699
|
+
e,
|
|
700
|
+
"--dock-morph-t",
|
|
701
|
+
"1"
|
|
702
|
+
]], () => He(t, s));
|
|
703
|
+
a && t.style.setProperty(We, O((r.start - a.start) / h, i));
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
return {
|
|
707
|
+
measure: f,
|
|
708
|
+
first: b,
|
|
709
|
+
anchor: S,
|
|
710
|
+
release: x
|
|
711
|
+
};
|
|
560
712
|
}
|
|
561
713
|
//#endregion
|
|
562
714
|
//#region src/components/dock/composables/useDockShellProps.ts
|
|
563
|
-
function
|
|
564
|
-
let t =
|
|
715
|
+
function Ke(e) {
|
|
716
|
+
let t = A(() => e.shape ?? "pill"), n = A(() => e.orientation ?? "horizontal"), r = A(() => e.collapse === !1);
|
|
565
717
|
return {
|
|
566
|
-
startCollapsed:
|
|
718
|
+
startCollapsed: A(() => !r.value && (e.collapse ?? "closed") === "closed"),
|
|
567
719
|
shape: t,
|
|
568
720
|
orientation: n,
|
|
569
721
|
alwaysExpanded: r,
|
|
570
|
-
fitContent:
|
|
722
|
+
fitContent: A(() => e.fitContent ?? !1)
|
|
571
723
|
};
|
|
572
724
|
}
|
|
573
725
|
//#endregion
|
|
574
726
|
//#region src/components/dock/composables/useDockClickIntegrity.ts
|
|
575
|
-
function
|
|
576
|
-
let { rootEl: t, visualExpanded: n } = e, r = null, i = !1, a = 0, o = null, s =
|
|
727
|
+
function qe(e) {
|
|
728
|
+
let { rootEl: t, visualExpanded: n } = e, r = null, i = !1, a = 0, o = null, s = K(null), c = null, l = [];
|
|
577
729
|
function u() {
|
|
578
730
|
c?.removeAttribute("data-dock-press-origin"), c = null;
|
|
579
731
|
for (let { element: e, wasInert: t } of l.splice(0)) e.toggleAttribute("inert", t);
|
|
@@ -616,7 +768,7 @@ function We(e) {
|
|
|
616
768
|
function _(e) {
|
|
617
769
|
u(), r = e.target, i = g();
|
|
618
770
|
}
|
|
619
|
-
|
|
771
|
+
X(n, (e, t) => {
|
|
620
772
|
t && !e && r && d(r);
|
|
621
773
|
});
|
|
622
774
|
function v() {
|
|
@@ -643,44 +795,44 @@ function We(e) {
|
|
|
643
795
|
}
|
|
644
796
|
e.stopPropagation(), e.preventDefault(), r = null;
|
|
645
797
|
}
|
|
646
|
-
return
|
|
798
|
+
return V(() => {
|
|
647
799
|
f(), u();
|
|
648
800
|
}), {
|
|
649
801
|
onPointerDownCapture: _,
|
|
650
802
|
onPointerCancelCapture: v,
|
|
651
803
|
onClickCapture: b,
|
|
652
804
|
markExpandFlip: p,
|
|
653
|
-
pressKeepaliveLayer:
|
|
805
|
+
pressKeepaliveLayer: G(s)
|
|
654
806
|
};
|
|
655
807
|
}
|
|
656
808
|
//#endregion
|
|
657
809
|
//#region src/components/dock/composables/useDockRun.ts
|
|
658
|
-
function
|
|
810
|
+
function Je(e, t) {
|
|
659
811
|
let n = getComputedStyle(e).getPropertyValue(t).trim(), r = Number.parseFloat(n);
|
|
660
812
|
return Number.isFinite(r) ? r : 0;
|
|
661
813
|
}
|
|
662
|
-
function
|
|
814
|
+
function Ye(e) {
|
|
663
815
|
return Array.from(e.children).filter((e) => e instanceof HTMLElement);
|
|
664
816
|
}
|
|
665
|
-
function
|
|
817
|
+
function Xe(e) {
|
|
666
818
|
return e.findIndex((e) => {
|
|
667
819
|
let t = (e.matches("[aria-current]") ? e : e.querySelector("[aria-current]"))?.getAttribute("aria-current");
|
|
668
820
|
return t != null && t !== "false";
|
|
669
821
|
});
|
|
670
822
|
}
|
|
671
|
-
function
|
|
823
|
+
function Ze(e) {
|
|
672
824
|
return e.hasAttribute(y);
|
|
673
825
|
}
|
|
674
|
-
function Ye(e) {
|
|
675
|
-
return Ke(e).filter(Je);
|
|
676
|
-
}
|
|
677
|
-
var Xe = ".dock-separator", Ze = "select[aria-hidden=\"true\"][tabindex=\"-1\"]";
|
|
678
826
|
function Qe(e) {
|
|
679
|
-
|
|
680
|
-
|
|
827
|
+
return Ye(e).filter(Ze);
|
|
828
|
+
}
|
|
829
|
+
var $e = ".dock-separator", et = "select[aria-hidden=\"true\"][tabindex=\"-1\"]";
|
|
830
|
+
function tt(e) {
|
|
831
|
+
let t = Ye(e).filter((e) => !e.matches($e) && !e.matches(et));
|
|
832
|
+
return t.length > 0 && t.every(Ze);
|
|
681
833
|
}
|
|
682
|
-
function
|
|
683
|
-
let { runEl: t, statusEl: n, orientation: r } = e, i =
|
|
834
|
+
function nt(e) {
|
|
835
|
+
let { runEl: t, statusEl: n, orientation: r } = e, i = K(!1), a = Le({
|
|
684
836
|
response: d.response,
|
|
685
837
|
dampingFraction: d.dampingFraction
|
|
686
838
|
});
|
|
@@ -697,11 +849,11 @@ function $e(e) {
|
|
|
697
849
|
return o() ? e.scrollHeight - e.clientHeight : e.scrollWidth - e.clientWidth;
|
|
698
850
|
}
|
|
699
851
|
function u(e, t) {
|
|
700
|
-
let n =
|
|
852
|
+
let n = Ye(e), r = n.indexOf(t);
|
|
701
853
|
if (r < 0) return s(e);
|
|
702
|
-
let i =
|
|
854
|
+
let i = Je(e, "--dock-pitch");
|
|
703
855
|
if (i <= 0) return s(e);
|
|
704
|
-
let a = Math.max(1,
|
|
856
|
+
let a = Math.max(1, Je(e, "--dock-open-pitches")), o = Xe(n), c = o >= 0 && o < r ? (a - 1) * i : 0, u = r * i + c - i / 2;
|
|
705
857
|
return Math.min(Math.max(u, 0), l(e));
|
|
706
858
|
}
|
|
707
859
|
function f(e, t) {
|
|
@@ -711,7 +863,7 @@ function $e(e) {
|
|
|
711
863
|
function p(e) {
|
|
712
864
|
let t = n.value;
|
|
713
865
|
if (!t) return;
|
|
714
|
-
let r =
|
|
866
|
+
let r = Ze(e) ? e : e.querySelector(C) ?? e, i = r.getAttribute("aria-label") ?? r.getAttribute("title") ?? r.textContent?.trim();
|
|
715
867
|
i && (t.textContent = i);
|
|
716
868
|
}
|
|
717
869
|
function m(e) {
|
|
@@ -735,11 +887,11 @@ function $e(e) {
|
|
|
735
887
|
function v() {
|
|
736
888
|
let e = t.value;
|
|
737
889
|
if (!e) return;
|
|
738
|
-
i.value =
|
|
739
|
-
for (let t of
|
|
740
|
-
let n =
|
|
890
|
+
i.value = tt(e);
|
|
891
|
+
for (let t of Ye(e)) Ze(t) || _(t);
|
|
892
|
+
let n = Qe(e);
|
|
741
893
|
if (n.length === 0) return;
|
|
742
|
-
let r =
|
|
894
|
+
let r = Xe(n), a = n.findIndex((e) => e.contains(document.activeElement)), o = a >= 0 ? a : r >= 0 ? r : 0;
|
|
743
895
|
n.forEach((e, t) => {
|
|
744
896
|
g(e, t === o ? 0 : -1);
|
|
745
897
|
});
|
|
@@ -751,7 +903,7 @@ function $e(e) {
|
|
|
751
903
|
function x(e) {
|
|
752
904
|
let n = t.value;
|
|
753
905
|
if (!n) return;
|
|
754
|
-
let r =
|
|
906
|
+
let r = Qe(n);
|
|
755
907
|
if (r.length === 0) return;
|
|
756
908
|
let i = r.findIndex((t) => t.contains(e.target));
|
|
757
909
|
if (i < 0) return;
|
|
@@ -776,16 +928,16 @@ function $e(e) {
|
|
|
776
928
|
function S(e) {
|
|
777
929
|
let n = t.value;
|
|
778
930
|
if (!n) return;
|
|
779
|
-
let r =
|
|
931
|
+
let r = Ye(n).find((t) => t.contains(e.target));
|
|
780
932
|
r && m(r);
|
|
781
933
|
}
|
|
782
934
|
let w = null;
|
|
783
935
|
function T(e, t) {
|
|
784
936
|
if (t.type !== "attributes" || t.attributeName === "aria-current" || t.attributeName === "data-glass-dock-seat") return !0;
|
|
785
937
|
let n = t.target;
|
|
786
|
-
return n.parentElement === e && !
|
|
938
|
+
return n.parentElement === e && !Ze(n);
|
|
787
939
|
}
|
|
788
|
-
return
|
|
940
|
+
return H(() => {
|
|
789
941
|
let e = t.value;
|
|
790
942
|
e && (e.addEventListener("keydown", x), e.addEventListener("click", S, { capture: !0 }), e.addEventListener("focusin", S, { capture: !0 }), v(), w = new MutationObserver((t) => {
|
|
791
943
|
t.some((t) => T(e, t)) && v();
|
|
@@ -800,10 +952,10 @@ function $e(e) {
|
|
|
800
952
|
"tabindex"
|
|
801
953
|
]
|
|
802
954
|
}));
|
|
803
|
-
}),
|
|
955
|
+
}), re(() => {
|
|
804
956
|
let e = t.value;
|
|
805
957
|
e?.removeEventListener("keydown", x), e?.removeEventListener("click", S, { capture: !0 }), e?.removeEventListener("focusin", S, { capture: !0 }), w?.disconnect(), a.dispose();
|
|
806
|
-
}),
|
|
958
|
+
}), X(r, () => v()), {
|
|
807
959
|
reach: m,
|
|
808
960
|
syncRoving: v,
|
|
809
961
|
toolbar: i
|
|
@@ -811,15 +963,15 @@ function $e(e) {
|
|
|
811
963
|
}
|
|
812
964
|
//#endregion
|
|
813
965
|
//#region src/components/dock/GlassDock.vue?vue&type=script&setup=true&lang.ts
|
|
814
|
-
var
|
|
966
|
+
var rt = ["data-backdrop-mode", "data-held"], it = ["data-held"], at = { class: "dock-controls" }, ot = {
|
|
815
967
|
key: 0,
|
|
816
968
|
class: "dock-persistent"
|
|
817
|
-
},
|
|
969
|
+
}, st = [
|
|
818
970
|
"id",
|
|
819
971
|
"role",
|
|
820
972
|
"aria-orientation",
|
|
821
973
|
"inert"
|
|
822
|
-
],
|
|
974
|
+
], ct = [
|
|
823
975
|
"id",
|
|
824
976
|
"inert",
|
|
825
977
|
"role",
|
|
@@ -827,13 +979,13 @@ var et = ["data-backdrop-mode", "data-held"], tt = ["data-held"], nt = { class:
|
|
|
827
979
|
"aria-label",
|
|
828
980
|
"aria-expanded",
|
|
829
981
|
"aria-controls"
|
|
830
|
-
],
|
|
982
|
+
], lt = {
|
|
831
983
|
key: 0,
|
|
832
984
|
class: "dock-search-field"
|
|
833
|
-
},
|
|
985
|
+
}, ut = {
|
|
834
986
|
key: 1,
|
|
835
987
|
class: "dock-persistent dock-persistent-end"
|
|
836
|
-
},
|
|
988
|
+
}, dt = /* @__PURE__ */ I({
|
|
837
989
|
inheritAttrs: !1,
|
|
838
990
|
__name: "GlassDock",
|
|
839
991
|
props: {
|
|
@@ -848,73 +1000,73 @@ var et = ["data-backdrop-mode", "data-held"], tt = ["data-held"], nt = { class:
|
|
|
848
1000
|
backgroundCanvas: {}
|
|
849
1001
|
},
|
|
850
1002
|
setup(e, { expose: t }) {
|
|
851
|
-
let n = e, { startCollapsed: r, shape: i, orientation: a, alwaysExpanded: o, fitContent: s } =
|
|
1003
|
+
let n = e, { startCollapsed: r, shape: i, orientation: a, alwaysExpanded: o, fitContent: s } = Ke(n), c = Y("dockEl"), u = Y("layersEl"), d = Y("fullEl"), m = Y("summaryEl"), h = Y("statusEl"), { toolbar: g } = nt({
|
|
852
1004
|
runEl: d,
|
|
853
1005
|
statusEl: h,
|
|
854
1006
|
orientation: a
|
|
855
1007
|
});
|
|
856
|
-
n.backdropMode === "live" &&
|
|
1008
|
+
n.backdropMode === "live" && Fe(c, { backgroundCanvas: () => {
|
|
857
1009
|
let e = n.backgroundCanvas;
|
|
858
1010
|
return typeof e == "function" ? e() : e instanceof HTMLCanvasElement ? e : null;
|
|
859
1011
|
} });
|
|
860
|
-
let _ =
|
|
1012
|
+
let _ = K(!1), v = `glass-dock-${se()}`, { expanded: y, isPinned: b, isHeld: x, graspHeld: S, onMouseEnter: w, onMouseLeave: T, onFocusIn: E, onFocusOut: D, onClickCollapsed: O, keepOpen: k, release: j, expand: I, collapse: te } = Ie({
|
|
861
1013
|
rootEl: c,
|
|
862
1014
|
alwaysExpanded: o,
|
|
863
1015
|
initialExpanded: !r.value,
|
|
864
1016
|
isTransitioning: _,
|
|
865
1017
|
dockId: v
|
|
866
|
-
}),
|
|
1018
|
+
}), L = A(() => o.value || y.value);
|
|
867
1019
|
l({
|
|
868
1020
|
id: v,
|
|
869
1021
|
orientation: a,
|
|
870
1022
|
keepOpen: k,
|
|
871
|
-
release:
|
|
1023
|
+
release: j,
|
|
872
1024
|
held: S,
|
|
873
|
-
expanded:
|
|
1025
|
+
expanded: L
|
|
874
1026
|
});
|
|
875
|
-
let
|
|
1027
|
+
let ne = Ge({
|
|
876
1028
|
rootEl: c,
|
|
877
1029
|
contentEl: u,
|
|
878
1030
|
expandedEl: d,
|
|
879
1031
|
collapsedEl: m,
|
|
880
1032
|
axis: a
|
|
881
|
-
}), { outerCurrentLayer:
|
|
1033
|
+
}), { outerCurrentLayer: V, outerLeavingLayer: H } = Re({
|
|
882
1034
|
rootEl: c,
|
|
883
|
-
outerActiveLayer:
|
|
1035
|
+
outerActiveLayer: A(() => L.value ? "full" : "summary"),
|
|
884
1036
|
onMorphActiveChange: (e) => {
|
|
885
1037
|
_.value = e;
|
|
886
1038
|
},
|
|
887
|
-
|
|
888
|
-
}),
|
|
889
|
-
async function
|
|
890
|
-
!
|
|
1039
|
+
geometry: ne
|
|
1040
|
+
}), U = A(() => V.value === "summary");
|
|
1041
|
+
async function re(e) {
|
|
1042
|
+
!U.value || !["Enter", " "].includes(e.key) || (e.preventDefault(), O(), await z(), (d.value?.querySelector(C) ?? d.value)?.focus({ preventScroll: !0 }));
|
|
891
1043
|
}
|
|
892
|
-
function
|
|
1044
|
+
function G(e) {
|
|
893
1045
|
if (e.key !== "Escape") return;
|
|
894
1046
|
let t = e.target?.closest?.(f);
|
|
895
|
-
t && d.value?.contains(t) ||
|
|
1047
|
+
t && d.value?.contains(t) || te();
|
|
896
1048
|
}
|
|
897
|
-
|
|
1049
|
+
X(L, async (e, t) => {
|
|
898
1050
|
if (!t || e) return;
|
|
899
1051
|
let n = document.activeElement;
|
|
900
1052
|
if (!(n && d.value?.contains(n) || n?.closest("[data-glass-dock-face]")?.getAttribute("data-glass-dock-owner") === v)) return;
|
|
901
|
-
await
|
|
1053
|
+
await z();
|
|
902
1054
|
let r = m.value;
|
|
903
1055
|
r && !r.hasAttribute("inert") && r.focus({ preventScroll: !0 });
|
|
904
1056
|
});
|
|
905
|
-
let { onPointerDownCapture:
|
|
1057
|
+
let { onPointerDownCapture: ie, onPointerCancelCapture: ae, onClickCapture: oe, markExpandFlip: ce, pressKeepaliveLayer: Q } = qe({
|
|
906
1058
|
rootEl: c,
|
|
907
|
-
visualExpanded:
|
|
1059
|
+
visualExpanded: L
|
|
908
1060
|
});
|
|
909
|
-
|
|
910
|
-
e &&
|
|
1061
|
+
X(L, (e) => {
|
|
1062
|
+
e && ce();
|
|
911
1063
|
});
|
|
912
|
-
let
|
|
913
|
-
|
|
914
|
-
e && (
|
|
1064
|
+
let ue = K(!1);
|
|
1065
|
+
X(S, (e) => {
|
|
1066
|
+
e && (ue.value = !0);
|
|
915
1067
|
});
|
|
916
|
-
function
|
|
917
|
-
e.propertyName === "opacity" && !S.value && (
|
|
1068
|
+
function de(e) {
|
|
1069
|
+
e.propertyName === "opacity" && !S.value && (ue.value = !1);
|
|
918
1070
|
}
|
|
919
1071
|
return t({
|
|
920
1072
|
expanded: y,
|
|
@@ -922,119 +1074,119 @@ var et = ["data-backdrop-mode", "data-held"], tt = ["data-held"], nt = { class:
|
|
|
922
1074
|
isHeld: x,
|
|
923
1075
|
graspHeld: S,
|
|
924
1076
|
isTransitioning: _,
|
|
925
|
-
expand:
|
|
926
|
-
collapse:
|
|
1077
|
+
expand: I,
|
|
1078
|
+
collapse: te,
|
|
927
1079
|
keepOpen: k,
|
|
928
|
-
release:
|
|
929
|
-
}), (e, t) => (
|
|
1080
|
+
release: j
|
|
1081
|
+
}), (e, t) => (W(), N("div", R({
|
|
930
1082
|
ref_key: "dockEl",
|
|
931
1083
|
ref: c
|
|
932
1084
|
}, e.$attrs, {
|
|
933
1085
|
class: ["glass-dock", [
|
|
934
|
-
|
|
935
|
-
`shape-${
|
|
1086
|
+
J(a),
|
|
1087
|
+
`shape-${J(i)}`,
|
|
936
1088
|
{
|
|
937
|
-
expanded:
|
|
938
|
-
collapsed: !
|
|
939
|
-
pinned:
|
|
940
|
-
"fit-content":
|
|
941
|
-
"always-expanded":
|
|
1089
|
+
expanded: L.value,
|
|
1090
|
+
collapsed: !L.value,
|
|
1091
|
+
pinned: J(b),
|
|
1092
|
+
"fit-content": J(s),
|
|
1093
|
+
"always-expanded": J(o)
|
|
942
1094
|
}
|
|
943
1095
|
]],
|
|
944
1096
|
"data-backdrop-mode": n.backdropMode,
|
|
945
|
-
"data-held":
|
|
946
|
-
onMouseenter: t[2] ||= (...e) =>
|
|
947
|
-
onMouseleave: t[3] ||= (e) =>
|
|
948
|
-
onFocusin: t[4] ||= (...e) =>
|
|
949
|
-
onFocusout: t[5] ||= (...e) =>
|
|
950
|
-
onPointerdownCapture: t[6] ||= (...e) =>
|
|
951
|
-
onPointercancelCapture: t[7] ||= (...e) =>
|
|
952
|
-
onClickCapture: t[8] ||= (...e) =>
|
|
1097
|
+
"data-held": J(S) || void 0,
|
|
1098
|
+
onMouseenter: t[2] ||= (...e) => J(w) && J(w)(...e),
|
|
1099
|
+
onMouseleave: t[3] ||= (e) => J(T)(e),
|
|
1100
|
+
onFocusin: t[4] ||= (...e) => J(E) && J(E)(...e),
|
|
1101
|
+
onFocusout: t[5] ||= (...e) => J(D) && J(D)(...e),
|
|
1102
|
+
onPointerdownCapture: t[6] ||= (...e) => J(ie) && J(ie)(...e),
|
|
1103
|
+
onPointercancelCapture: t[7] ||= (...e) => J(ae) && J(ae)(...e),
|
|
1104
|
+
onClickCapture: t[8] ||= (...e) => J(oe) && J(oe)(...e)
|
|
953
1105
|
}), [
|
|
954
|
-
|
|
1106
|
+
P("div", {
|
|
955
1107
|
class: "dock-plate",
|
|
956
1108
|
"aria-hidden": "true",
|
|
957
|
-
"data-held":
|
|
958
|
-
}, [
|
|
1109
|
+
"data-held": J(S) || void 0
|
|
1110
|
+
}, [ue.value ? (W(), N(ee, { key: 0 }, [t[9] ||= P("span", {
|
|
959
1111
|
class: "glass-grasp-carrier",
|
|
960
1112
|
"data-grasp": "rest"
|
|
961
|
-
}, null, -1),
|
|
1113
|
+
}, null, -1), P("span", {
|
|
962
1114
|
class: "glass-grasp-carrier",
|
|
963
1115
|
"data-grasp": "grasp",
|
|
964
|
-
onTransitionend:
|
|
965
|
-
}, null, 32)], 64)) :
|
|
966
|
-
|
|
967
|
-
e.$slots.persistent ? (
|
|
968
|
-
|
|
1116
|
+
onTransitionend: de
|
|
1117
|
+
}, null, 32)], 64)) : M("", !0)], 8, it),
|
|
1118
|
+
P("div", at, [
|
|
1119
|
+
e.$slots.persistent ? (W(), N("div", ot, [q(e.$slots, "persistent")])) : M("", !0),
|
|
1120
|
+
P("div", {
|
|
969
1121
|
ref_key: "layersEl",
|
|
970
1122
|
ref: u,
|
|
971
1123
|
class: "dock-layers"
|
|
972
1124
|
}, [
|
|
973
|
-
|
|
1125
|
+
P("div", {
|
|
974
1126
|
ref_key: "fullEl",
|
|
975
1127
|
ref: d,
|
|
976
1128
|
id: `${v}-full`,
|
|
977
|
-
role:
|
|
978
|
-
"aria-orientation":
|
|
979
|
-
class:
|
|
980
|
-
"is-active":
|
|
981
|
-
"is-leaving":
|
|
982
|
-
"is-press-keepalive":
|
|
1129
|
+
role: J(g) ? "toolbar" : void 0,
|
|
1130
|
+
"aria-orientation": J(g) ? J(a) : void 0,
|
|
1131
|
+
class: B(["dock-layer dock-layer--full dock-run", {
|
|
1132
|
+
"is-active": J(V) === "full",
|
|
1133
|
+
"is-leaving": J(H) === "full" || J(Q) === "full" && J(V) !== "full",
|
|
1134
|
+
"is-press-keepalive": J(Q) === "full"
|
|
983
1135
|
}]),
|
|
984
|
-
inert:
|
|
1136
|
+
inert: J(V) !== "full" && J(Q) !== "full" || void 0,
|
|
985
1137
|
tabindex: "-1",
|
|
986
|
-
onKeydown:
|
|
987
|
-
}, [
|
|
988
|
-
default:
|
|
1138
|
+
onKeydown: G
|
|
1139
|
+
}, [F(J(p), null, {
|
|
1140
|
+
default: Z(() => [q(e.$slots, "default")]),
|
|
989
1141
|
_: 3
|
|
990
|
-
})], 42,
|
|
991
|
-
|
|
1142
|
+
})], 42, st),
|
|
1143
|
+
P("div", {
|
|
992
1144
|
ref_key: "summaryEl",
|
|
993
1145
|
ref: m,
|
|
994
1146
|
id: `${v}-summary`,
|
|
995
|
-
class:
|
|
996
|
-
"is-active":
|
|
997
|
-
"is-leaving":
|
|
1147
|
+
class: B(["dock-layer dock-layer--summary", {
|
|
1148
|
+
"is-active": J(V) === "summary",
|
|
1149
|
+
"is-leaving": J(H) === "summary"
|
|
998
1150
|
}]),
|
|
999
|
-
inert:
|
|
1000
|
-
role:
|
|
1001
|
-
tabindex:
|
|
1002
|
-
"aria-label":
|
|
1003
|
-
"aria-expanded":
|
|
1004
|
-
"aria-controls":
|
|
1005
|
-
onFocusin: t[0] ||=
|
|
1006
|
-
onKeydown:
|
|
1007
|
-
onClick: t[1] ||= (...e) =>
|
|
1008
|
-
}, [
|
|
1009
|
-
e.$slots.search ? (
|
|
1151
|
+
inert: J(V) !== "summary" || void 0,
|
|
1152
|
+
role: U.value ? "button" : void 0,
|
|
1153
|
+
tabindex: U.value ? 0 : void 0,
|
|
1154
|
+
"aria-label": U.value ? "Expand dock" : void 0,
|
|
1155
|
+
"aria-expanded": U.value ? "false" : void 0,
|
|
1156
|
+
"aria-controls": U.value ? `${v}-full` : void 0,
|
|
1157
|
+
onFocusin: t[0] ||= le(() => {}, ["stop"]),
|
|
1158
|
+
onKeydown: re,
|
|
1159
|
+
onClick: t[1] ||= (...e) => J(O) && J(O)(...e)
|
|
1160
|
+
}, [q(e.$slots, "collapsed")], 42, ct),
|
|
1161
|
+
e.$slots.search ? (W(), N("div", lt, [q(e.$slots, "search")])) : M("", !0)
|
|
1010
1162
|
], 512),
|
|
1011
|
-
e.$slots["persistent-end"] ? (
|
|
1163
|
+
e.$slots["persistent-end"] ? (W(), N("div", ut, [q(e.$slots, "persistent-end")])) : M("", !0)
|
|
1012
1164
|
]),
|
|
1013
|
-
|
|
1165
|
+
P("div", {
|
|
1014
1166
|
ref_key: "statusEl",
|
|
1015
1167
|
ref: h,
|
|
1016
1168
|
class: "dock-run-status",
|
|
1017
1169
|
role: "status",
|
|
1018
1170
|
"aria-live": "polite"
|
|
1019
1171
|
}, null, 512)
|
|
1020
|
-
], 16,
|
|
1172
|
+
], 16, rt));
|
|
1021
1173
|
}
|
|
1022
|
-
}),
|
|
1023
|
-
function
|
|
1024
|
-
|
|
1174
|
+
}), ft = c("glass-ui:dock-switcher-tablist"), { KEY: pt } = ft;
|
|
1175
|
+
function mt(e) {
|
|
1176
|
+
ft.provide(e);
|
|
1025
1177
|
}
|
|
1026
|
-
var
|
|
1027
|
-
function
|
|
1028
|
-
|
|
1178
|
+
var ht = ft.use, gt = s(m, "[glass-ui:dock] <DockLayer> must be used inside <DockCrossfade> (or <DockLayerGroup>)"), { KEY: _t } = gt;
|
|
1179
|
+
function vt(e) {
|
|
1180
|
+
gt.provide(e);
|
|
1029
1181
|
}
|
|
1030
|
-
var
|
|
1182
|
+
var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
1031
1183
|
__name: "DockCrossfade",
|
|
1032
1184
|
props: {
|
|
1033
1185
|
active: {},
|
|
1034
1186
|
reserve: { default: "block" }
|
|
1035
1187
|
},
|
|
1036
1188
|
setup(e, { expose: t }) {
|
|
1037
|
-
let n = e, r =
|
|
1189
|
+
let n = e, r = K(null), i = K(/* @__PURE__ */ new Map()), a = A(() => [...i.value.values()].map(({ id: e, label: t, icon: n }) => ({
|
|
1038
1190
|
id: e,
|
|
1039
1191
|
label: t,
|
|
1040
1192
|
icon: n
|
|
@@ -1048,15 +1200,15 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1048
1200
|
let t = new Map(i.value);
|
|
1049
1201
|
t.delete(e), i.value = t, p();
|
|
1050
1202
|
}
|
|
1051
|
-
let c =
|
|
1052
|
-
|
|
1203
|
+
let c = A(() => n.active), l = K(null);
|
|
1204
|
+
vt({
|
|
1053
1205
|
register: o,
|
|
1054
1206
|
unregister: s,
|
|
1055
1207
|
activeId: c,
|
|
1056
1208
|
leavingId: l,
|
|
1057
1209
|
faces: a
|
|
1058
1210
|
});
|
|
1059
|
-
let u =
|
|
1211
|
+
let u = K(0), f = A(() => n.reserve === "inline" ? "min-inline-size" : "min-block-size");
|
|
1060
1212
|
function p() {
|
|
1061
1213
|
let e = 0;
|
|
1062
1214
|
for (let { el: t } of i.value.values()) {
|
|
@@ -1065,12 +1217,12 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1065
1217
|
}
|
|
1066
1218
|
e > u.value && (u.value = e);
|
|
1067
1219
|
}
|
|
1068
|
-
let m =
|
|
1220
|
+
let m = A(() => u.value > 0 ? {
|
|
1069
1221
|
[f.value]: `${u.value}px`,
|
|
1070
1222
|
"--dock-crossfade-peak": `${u.value}px`
|
|
1071
1223
|
} : void 0);
|
|
1072
1224
|
b(r, () => p());
|
|
1073
|
-
let h =
|
|
1225
|
+
let h = Le({
|
|
1074
1226
|
response: d.response,
|
|
1075
1227
|
dampingFraction: d.dampingFraction
|
|
1076
1228
|
});
|
|
@@ -1086,16 +1238,16 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1086
1238
|
function y(e) {
|
|
1087
1239
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
1088
1240
|
}
|
|
1089
|
-
let x =
|
|
1090
|
-
|
|
1241
|
+
let x = ve("(prefers-reduced-motion: reduce)"), S = null, C = 1;
|
|
1242
|
+
X(x, (e) => {
|
|
1091
1243
|
e && (h.dispose(), S?.());
|
|
1092
1244
|
});
|
|
1093
1245
|
async function w(e, t) {
|
|
1094
1246
|
if (typeof document > "u") return;
|
|
1095
1247
|
let n = g(e), r = document.activeElement;
|
|
1096
|
-
!n || !r || !n.contains(r) || (await
|
|
1248
|
+
!n || !r || !n.contains(r) || (await z(), (g(t) ?? document.body).focus?.());
|
|
1097
1249
|
}
|
|
1098
|
-
return
|
|
1250
|
+
return X(c, (e, t) => {
|
|
1099
1251
|
if (e === t) return;
|
|
1100
1252
|
p();
|
|
1101
1253
|
let n = g(e), i = g(t);
|
|
@@ -1120,24 +1272,24 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1120
1272
|
},
|
|
1121
1273
|
onSettle: d
|
|
1122
1274
|
});
|
|
1123
|
-
}),
|
|
1275
|
+
}), V(() => {
|
|
1124
1276
|
h.dispose(), S = null;
|
|
1125
|
-
}), t({ faces: a }), (e, t) => (
|
|
1277
|
+
}), t({ faces: a }), (e, t) => (W(), N("div", {
|
|
1126
1278
|
ref_key: "rootEl",
|
|
1127
1279
|
ref: r,
|
|
1128
1280
|
class: "dock-crossfade",
|
|
1129
|
-
style:
|
|
1130
|
-
}, [
|
|
1281
|
+
style: ne(m.value)
|
|
1282
|
+
}, [q(e.$slots, "default")], 4));
|
|
1131
1283
|
}
|
|
1132
|
-
}),
|
|
1284
|
+
}), xt = ["data-motion"], St = ["aria-orientation"], Ct = [
|
|
1133
1285
|
"id",
|
|
1134
1286
|
"tabindex",
|
|
1135
1287
|
"aria-controls",
|
|
1136
1288
|
"aria-label",
|
|
1137
1289
|
"onClick"
|
|
1138
|
-
],
|
|
1290
|
+
], wt = { key: 1 }, Tt = { key: 2 }, Et = /* @__PURE__ */ I({
|
|
1139
1291
|
__name: "DockLayerGroup",
|
|
1140
|
-
props: /*@__PURE__*/
|
|
1292
|
+
props: /*@__PURE__*/ L({
|
|
1141
1293
|
orientation: {},
|
|
1142
1294
|
showSwitcher: {
|
|
1143
1295
|
type: Boolean,
|
|
@@ -1151,8 +1303,8 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1151
1303
|
}),
|
|
1152
1304
|
emits: ["update:active"],
|
|
1153
1305
|
setup(e) {
|
|
1154
|
-
let t = e, n = o(() => t.motion), r =
|
|
1155
|
-
options:
|
|
1306
|
+
let t = e, n = o(() => t.motion), r = ce(e, "active"), i = v(), a = A(() => t.orientation ?? i?.orientation.value ?? "horizontal"), s = Y("crossfade"), c = A(() => s.value?.faces ?? []), l = A(() => a.value === "vertical" ? "horizontal" : "vertical"), u = A(() => l.value === "vertical"), d = K(null), f = K(null), p = K([]), m = T({
|
|
1307
|
+
options: A(() => c.value.map((e) => ({ value: e.id }))),
|
|
1156
1308
|
model: r,
|
|
1157
1309
|
mode: "single",
|
|
1158
1310
|
role: "tablist",
|
|
@@ -1160,13 +1312,13 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1160
1312
|
containerRef: d,
|
|
1161
1313
|
indicatorRef: f,
|
|
1162
1314
|
buttonRefs: p
|
|
1163
|
-
}), g =
|
|
1164
|
-
|
|
1315
|
+
}), g = A(() => t.showSwitcher && c.value.length > 1), _ = se(), y = (e) => e.replace(/[^a-zA-Z0-9_-]/g, ""), b = (e) => `dock-tab-${_}-${y(e)}`, x = (e) => `dock-panel-${_}-${y(e)}`;
|
|
1316
|
+
mt({
|
|
1165
1317
|
isTablist: g,
|
|
1166
1318
|
tabId: b,
|
|
1167
1319
|
panelId: x
|
|
1168
1320
|
});
|
|
1169
|
-
let S =
|
|
1321
|
+
let S = A(() => u.value ? "y" : "x");
|
|
1170
1322
|
function C() {
|
|
1171
1323
|
let e = d.value;
|
|
1172
1324
|
if (!e) return [];
|
|
@@ -1188,14 +1340,14 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1188
1340
|
n.armed.value && r.value !== e && (r.value = e);
|
|
1189
1341
|
}
|
|
1190
1342
|
});
|
|
1191
|
-
|
|
1343
|
+
X(() => [
|
|
1192
1344
|
c.value.length,
|
|
1193
1345
|
l.value,
|
|
1194
1346
|
n.armed.value
|
|
1195
1347
|
], () => {
|
|
1196
|
-
n.armed.value &&
|
|
1197
|
-
}),
|
|
1198
|
-
n.armed.value &&
|
|
1348
|
+
n.armed.value && z(() => w.refresh());
|
|
1349
|
+
}), H(() => {
|
|
1350
|
+
n.armed.value && z(() => w.refresh());
|
|
1199
1351
|
});
|
|
1200
1352
|
function D(e) {
|
|
1201
1353
|
return typeof e == "object" && !!e || typeof e == "function";
|
|
@@ -1204,25 +1356,25 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1204
1356
|
function k() {
|
|
1205
1357
|
O.acquire();
|
|
1206
1358
|
}
|
|
1207
|
-
function
|
|
1359
|
+
function I(e) {
|
|
1208
1360
|
let t = e.relatedTarget, n = e.currentTarget;
|
|
1209
1361
|
t && n?.contains(t) || O.release();
|
|
1210
1362
|
}
|
|
1211
|
-
return (t, i) => (
|
|
1212
|
-
class:
|
|
1213
|
-
"data-motion":
|
|
1214
|
-
style:
|
|
1215
|
-
}, [g.value ? (
|
|
1363
|
+
return (t, i) => (W(), N("div", {
|
|
1364
|
+
class: B(["dock-layer-group", [a.value, `switcher-${e.switcherPosition}`]]),
|
|
1365
|
+
"data-motion": J(n).dataMotion.value,
|
|
1366
|
+
style: ne(J(n).hostStyle.value)
|
|
1367
|
+
}, [g.value ? (W(), N("div", {
|
|
1216
1368
|
key: 0,
|
|
1217
1369
|
ref_key: "switcherListEl",
|
|
1218
1370
|
ref: d,
|
|
1219
1371
|
role: "tablist",
|
|
1220
|
-
class:
|
|
1372
|
+
class: B(["dock-layer-switcher", [e.switcherPosition, J(n).armed.value && "glass-drag-grabbable"]]),
|
|
1221
1373
|
"aria-orientation": l.value,
|
|
1222
|
-
onKeydown: i[0] ||= (...e) =>
|
|
1374
|
+
onKeydown: i[0] ||= (...e) => J(m).onKeydown && J(m).onKeydown(...e),
|
|
1223
1375
|
onFocusin: k,
|
|
1224
|
-
onFocusout:
|
|
1225
|
-
}, [(
|
|
1376
|
+
onFocusout: I
|
|
1377
|
+
}, [(W(!0), N(ee, null, ie(c.value, (e, t) => (W(), N("button", R({
|
|
1226
1378
|
key: e.id,
|
|
1227
1379
|
ref_for: !0,
|
|
1228
1380
|
ref: (e) => {
|
|
@@ -1231,37 +1383,37 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1231
1383
|
type: "button",
|
|
1232
1384
|
class: "dock-layer-tab",
|
|
1233
1385
|
id: b(e.id),
|
|
1234
|
-
tabindex:
|
|
1235
|
-
}, { ref_for: !0 },
|
|
1386
|
+
tabindex: J(m).rovingTabindex(t)
|
|
1387
|
+
}, { ref_for: !0 }, J(m).itemAttrs(e.id), {
|
|
1236
1388
|
"aria-controls": x(e.id),
|
|
1237
1389
|
"aria-label": e.label ?? e.id,
|
|
1238
|
-
onClick: (n) =>
|
|
1239
|
-
}), [D(e.icon) ? (
|
|
1390
|
+
onClick: (n) => J(m).select(e.id, t)
|
|
1391
|
+
}), [D(e.icon) ? (W(), j(ae(e.icon), {
|
|
1240
1392
|
key: 0,
|
|
1241
1393
|
class: "size-4"
|
|
1242
|
-
})) : typeof e.icon == "string" ? (
|
|
1394
|
+
})) : typeof e.icon == "string" ? (W(), N("span", wt, oe(e.icon), 1)) : (W(), N("span", Tt, oe((e.label ?? e.id).charAt(0)), 1))], 16, Ct))), 128)), P("div", {
|
|
1243
1395
|
ref_key: "switcherIndicatorEl",
|
|
1244
1396
|
ref: f,
|
|
1245
|
-
class:
|
|
1246
|
-
style:
|
|
1397
|
+
class: B(["dock-layer-tab-indicator", J(n).armed.value && J(w).dragging.value && "glass-drag-lift"]),
|
|
1398
|
+
style: ne(J(m).singleSliderStyle.value),
|
|
1247
1399
|
"aria-hidden": "true"
|
|
1248
|
-
}, null, 6)], 42,
|
|
1400
|
+
}, null, 6)], 42, St)) : M("", !0), F(bt, {
|
|
1249
1401
|
ref_key: "crossfade",
|
|
1250
1402
|
ref: s,
|
|
1251
1403
|
active: r.value
|
|
1252
1404
|
}, {
|
|
1253
|
-
default:
|
|
1405
|
+
default: Z(() => [q(t.$slots, "default")]),
|
|
1254
1406
|
_: 3
|
|
1255
|
-
}, 8, ["active"])], 14,
|
|
1407
|
+
}, 8, ["active"])], 14, xt));
|
|
1256
1408
|
}
|
|
1257
|
-
}),
|
|
1409
|
+
}), Dt = [
|
|
1258
1410
|
"role",
|
|
1259
1411
|
"id",
|
|
1260
1412
|
"aria-labelledby",
|
|
1261
1413
|
"inert",
|
|
1262
1414
|
"aria-hidden",
|
|
1263
1415
|
"tabindex"
|
|
1264
|
-
],
|
|
1416
|
+
], Ot = { class: "dock-face-content" }, kt = /* @__PURE__ */ I({
|
|
1265
1417
|
__name: "DockLayer",
|
|
1266
1418
|
props: {
|
|
1267
1419
|
id: {},
|
|
@@ -1269,15 +1421,15 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1269
1421
|
icon: {}
|
|
1270
1422
|
},
|
|
1271
1423
|
setup(e) {
|
|
1272
|
-
let t = e, n =
|
|
1273
|
-
|
|
1424
|
+
let t = e, n = yt(), r = Y("hostEl");
|
|
1425
|
+
H(() => {
|
|
1274
1426
|
r.value && n.register({
|
|
1275
1427
|
id: t.id,
|
|
1276
1428
|
label: t.label,
|
|
1277
1429
|
icon: t.icon,
|
|
1278
1430
|
el: r.value
|
|
1279
1431
|
});
|
|
1280
|
-
}),
|
|
1432
|
+
}), X(() => [
|
|
1281
1433
|
t.id,
|
|
1282
1434
|
t.label,
|
|
1283
1435
|
t.icon
|
|
@@ -1288,12 +1440,12 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1288
1440
|
icon: t.icon,
|
|
1289
1441
|
el: r.value
|
|
1290
1442
|
});
|
|
1291
|
-
}),
|
|
1292
|
-
let i =
|
|
1293
|
-
return (e, t) => (
|
|
1443
|
+
}), V(() => n.unregister(t.id));
|
|
1444
|
+
let i = A(() => n.activeId.value === t.id), a = A(() => n.leavingId.value === t.id), o = ht(), s = A(() => o?.isTablist.value ?? !1), c = A(() => s.value ? o.panelId(t.id) : void 0), l = A(() => s.value ? o.tabId(t.id) : void 0);
|
|
1445
|
+
return (e, t) => (W(), N("div", {
|
|
1294
1446
|
ref_key: "hostEl",
|
|
1295
1447
|
ref: r,
|
|
1296
|
-
class:
|
|
1448
|
+
class: B(["dock-face", {
|
|
1297
1449
|
"is-active": i.value,
|
|
1298
1450
|
"is-leaving": a.value
|
|
1299
1451
|
}]),
|
|
@@ -1303,9 +1455,9 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1303
1455
|
inert: !i.value || void 0,
|
|
1304
1456
|
"aria-hidden": !i.value || void 0,
|
|
1305
1457
|
tabindex: i.value ? -1 : void 0
|
|
1306
|
-
}, [
|
|
1458
|
+
}, [P("div", Ot, [q(e.$slots, "default")])], 10, Dt));
|
|
1307
1459
|
}
|
|
1308
|
-
}),
|
|
1460
|
+
}), At = /* @__PURE__ */ I({
|
|
1309
1461
|
__name: "DockControl",
|
|
1310
1462
|
props: {
|
|
1311
1463
|
shape: { default: "icon" },
|
|
@@ -1336,14 +1488,14 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1336
1488
|
] }
|
|
1337
1489
|
},
|
|
1338
1490
|
setup(t) {
|
|
1339
|
-
let r = t, o =
|
|
1491
|
+
let r = t, o = A(() => r.shape === "tab"), s = A(() => 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 = A(() => ({
|
|
1340
1492
|
[y]: "",
|
|
1341
1493
|
...r.active === void 0 ? {} : {
|
|
1342
1494
|
"aria-pressed": String(r.active),
|
|
1343
1495
|
...r.active ? { "data-active": "" } : {}
|
|
1344
1496
|
},
|
|
1345
1497
|
...r.disabled ? { "aria-disabled": "true" } : {}
|
|
1346
|
-
})), l =
|
|
1498
|
+
})), l = A(() => !r.asChild && r.as === "button" ? { type: r.type } : {}), u = i("press"), d = a({
|
|
1347
1499
|
disabled: () => r.disabled || o.value,
|
|
1348
1500
|
squish: !0,
|
|
1349
1501
|
response: u.response,
|
|
@@ -1351,11 +1503,11 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1351
1503
|
pressVar: "--dock-press-t",
|
|
1352
1504
|
shrinkDepth: .04,
|
|
1353
1505
|
maxStretch: 1.03
|
|
1354
|
-
}), f =
|
|
1506
|
+
}), f = A(() => o.value ? {} : { ...d.pressStyle.value });
|
|
1355
1507
|
function p(e) {
|
|
1356
1508
|
r.disabled && (e.preventDefault(), e.stopImmediatePropagation());
|
|
1357
1509
|
}
|
|
1358
|
-
return (e, r) =>
|
|
1510
|
+
return (e, r) => Q((W(), j(J(de), R({
|
|
1359
1511
|
as: t.as,
|
|
1360
1512
|
"as-child": t.asChild
|
|
1361
1513
|
}, {
|
|
@@ -1364,18 +1516,18 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1364
1516
|
}, {
|
|
1365
1517
|
class: s.value,
|
|
1366
1518
|
style: f.value,
|
|
1367
|
-
"data-press-armed": !o.value &&
|
|
1368
|
-
onPointerdown:
|
|
1369
|
-
onPointerup:
|
|
1370
|
-
onPointercancel:
|
|
1371
|
-
onPointerleave:
|
|
1372
|
-
onPointerenter:
|
|
1373
|
-
onKeydown:
|
|
1374
|
-
onKeyup:
|
|
1375
|
-
onBlur:
|
|
1519
|
+
"data-press-armed": !o.value && J(d).armed ? "" : void 0,
|
|
1520
|
+
onPointerdown: J(d).handlers.onPointerdown,
|
|
1521
|
+
onPointerup: J(d).handlers.onPointerup,
|
|
1522
|
+
onPointercancel: J(d).handlers.onPointercancel,
|
|
1523
|
+
onPointerleave: J(d).handlers.onPointerleave,
|
|
1524
|
+
onPointerenter: J(d).handlers.onPointerenter,
|
|
1525
|
+
onKeydown: J(d).handlers.onKeydown,
|
|
1526
|
+
onKeyup: J(d).handlers.onKeyup,
|
|
1527
|
+
onBlur: J(d).handlers.onBlur,
|
|
1376
1528
|
onClickCapture: p
|
|
1377
1529
|
}), {
|
|
1378
|
-
default:
|
|
1530
|
+
default: Z(() => [q(e.$slots, "default")]),
|
|
1379
1531
|
_: 3
|
|
1380
1532
|
}, 16, [
|
|
1381
1533
|
"as",
|
|
@@ -1391,9 +1543,9 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1391
1543
|
"onKeydown",
|
|
1392
1544
|
"onKeyup",
|
|
1393
1545
|
"onBlur"
|
|
1394
|
-
])), [[
|
|
1546
|
+
])), [[J(n)]]);
|
|
1395
1547
|
}
|
|
1396
|
-
}),
|
|
1548
|
+
}), jt = /* @__PURE__ */ I({
|
|
1397
1549
|
inheritAttrs: !1,
|
|
1398
1550
|
__name: "DockTrigger",
|
|
1399
1551
|
props: {
|
|
@@ -1413,7 +1565,7 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1413
1565
|
}
|
|
1414
1566
|
let o = (e, { attrs: t, slots: n }) => {
|
|
1415
1567
|
let { disabled: r, ...i } = t, o = r != null && r !== !1;
|
|
1416
|
-
return
|
|
1568
|
+
return te("button", {
|
|
1417
1569
|
...i,
|
|
1418
1570
|
type: i.type ?? "button",
|
|
1419
1571
|
...o ? {
|
|
@@ -1423,17 +1575,17 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1423
1575
|
}, n.default?.());
|
|
1424
1576
|
};
|
|
1425
1577
|
o.inheritAttrs = !1;
|
|
1426
|
-
let s =
|
|
1427
|
-
return (e, t) => r.for === "select" ?
|
|
1578
|
+
let s = A(() => e("dock-trigger", r.for === "select" && "dock-select-trigger", r.for !== "select" && "dock-dropdown-trigger", r.class));
|
|
1579
|
+
return (e, t) => r.for === "select" ? Q((W(), j(J(pe), R({ key: 0 }, {
|
|
1428
1580
|
...e.$attrs,
|
|
1429
1581
|
...i
|
|
1430
1582
|
}, {
|
|
1431
1583
|
"as-child": "",
|
|
1432
1584
|
class: s.value
|
|
1433
1585
|
}), {
|
|
1434
|
-
default:
|
|
1435
|
-
default:
|
|
1436
|
-
default:
|
|
1586
|
+
default: Z(() => [F(o, null, {
|
|
1587
|
+
default: Z(() => [q(e.$slots, "default"), F(J(fe), { "as-child": "" }, {
|
|
1588
|
+
default: Z(() => [q(e.$slots, "icon", {}, () => [F(J(me), {
|
|
1437
1589
|
class: "dock-select-trigger__chevron",
|
|
1438
1590
|
"aria-hidden": "true"
|
|
1439
1591
|
})])]),
|
|
@@ -1442,7 +1594,7 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1442
1594
|
_: 3
|
|
1443
1595
|
})]),
|
|
1444
1596
|
_: 3
|
|
1445
|
-
}, 16, ["class"])), [[
|
|
1597
|
+
}, 16, ["class"])), [[J(n)]]) : r.for === "dropdown" ? Q((W(), j(w, R({ key: 1 }, {
|
|
1446
1598
|
...e.$attrs,
|
|
1447
1599
|
...i
|
|
1448
1600
|
}, {
|
|
@@ -1450,26 +1602,26 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1450
1602
|
action: "pointerdown",
|
|
1451
1603
|
class: s.value
|
|
1452
1604
|
}), {
|
|
1453
|
-
default:
|
|
1454
|
-
default:
|
|
1605
|
+
default: Z(() => [F(o, null, {
|
|
1606
|
+
default: Z(() => [q(e.$slots, "default")]),
|
|
1455
1607
|
_: 3
|
|
1456
1608
|
})]),
|
|
1457
1609
|
_: 3
|
|
1458
|
-
}, 16, ["class"])), [[
|
|
1610
|
+
}, 16, ["class"])), [[J(n)]]) : Q((W(), j(J(ue), R({ key: 2 }, {
|
|
1459
1611
|
...e.$attrs,
|
|
1460
1612
|
...i
|
|
1461
1613
|
}, {
|
|
1462
1614
|
"as-child": "",
|
|
1463
1615
|
class: s.value
|
|
1464
1616
|
}), {
|
|
1465
|
-
default:
|
|
1466
|
-
default:
|
|
1617
|
+
default: Z(() => [F(o, null, {
|
|
1618
|
+
default: Z(() => [q(e.$slots, "default")]),
|
|
1467
1619
|
_: 3
|
|
1468
1620
|
})]),
|
|
1469
1621
|
_: 3
|
|
1470
|
-
}, 16, ["class"])), [[
|
|
1622
|
+
}, 16, ["class"])), [[J(n)]]);
|
|
1471
1623
|
}
|
|
1472
|
-
}),
|
|
1624
|
+
}), Mt = /* @__PURE__ */ I({
|
|
1473
1625
|
__name: "DockBackgroundToggle",
|
|
1474
1626
|
props: {
|
|
1475
1627
|
paused: {
|
|
@@ -1481,22 +1633,22 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1481
1633
|
},
|
|
1482
1634
|
emits: ["update:paused"],
|
|
1483
1635
|
setup(e, { emit: t }) {
|
|
1484
|
-
let n = e, r = t, i =
|
|
1636
|
+
let n = e, r = t, i = A(() => n.paused ? n.playLabel : n.pauseLabel);
|
|
1485
1637
|
function a() {
|
|
1486
1638
|
r("update:paused", !n.paused);
|
|
1487
1639
|
}
|
|
1488
|
-
return (t, n) => (
|
|
1640
|
+
return (t, n) => (W(), j(At, {
|
|
1489
1641
|
type: "button",
|
|
1490
1642
|
active: e.paused,
|
|
1491
1643
|
"aria-pressed": e.paused,
|
|
1492
1644
|
"aria-label": i.value,
|
|
1493
1645
|
onClick: a
|
|
1494
1646
|
}, {
|
|
1495
|
-
default:
|
|
1647
|
+
default: Z(() => [e.paused ? (W(), j(J(ge), {
|
|
1496
1648
|
key: 0,
|
|
1497
1649
|
size: 18,
|
|
1498
1650
|
"aria-hidden": "true"
|
|
1499
|
-
})) : (
|
|
1651
|
+
})) : (W(), j(J(he), {
|
|
1500
1652
|
key: 1,
|
|
1501
1653
|
size: 18,
|
|
1502
1654
|
"aria-hidden": "true"
|
|
@@ -1508,30 +1660,30 @@ var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
|
1508
1660
|
"aria-label"
|
|
1509
1661
|
]));
|
|
1510
1662
|
}
|
|
1511
|
-
}),
|
|
1663
|
+
}), Nt = [
|
|
1512
1664
|
"data-orientation",
|
|
1513
1665
|
"data-dock-hairline",
|
|
1514
1666
|
"aria-orientation"
|
|
1515
|
-
],
|
|
1667
|
+
], Pt = /* @__PURE__ */ I({
|
|
1516
1668
|
__name: "DockSeparator",
|
|
1517
1669
|
props: { anchor: {
|
|
1518
1670
|
type: Boolean,
|
|
1519
1671
|
default: !1
|
|
1520
1672
|
} },
|
|
1521
1673
|
setup(e) {
|
|
1522
|
-
let t = v(), n =
|
|
1523
|
-
return (t, n) => (
|
|
1524
|
-
class:
|
|
1674
|
+
let t = v(), n = A(() => t?.orientation.value ?? "horizontal"), r = A(() => n.value), i = A(() => n.value === "vertical" ? "horizontal" : "vertical");
|
|
1675
|
+
return (t, n) => (W(), N("div", {
|
|
1676
|
+
class: B(["dock-separator", { "dock-hairline": e.anchor }]),
|
|
1525
1677
|
role: "separator",
|
|
1526
1678
|
"data-orientation": r.value,
|
|
1527
1679
|
"data-dock-hairline": e.anchor || void 0,
|
|
1528
1680
|
"aria-orientation": i.value
|
|
1529
|
-
}, null, 10,
|
|
1681
|
+
}, null, 10, Nt));
|
|
1530
1682
|
}
|
|
1531
1683
|
});
|
|
1532
1684
|
//#endregion
|
|
1533
1685
|
//#region src/composables/search/match.ts
|
|
1534
|
-
function
|
|
1686
|
+
function Ft(e, t) {
|
|
1535
1687
|
let n = e.length, r = t.length;
|
|
1536
1688
|
if (n === 0) return {
|
|
1537
1689
|
score: 0,
|
|
@@ -1555,11 +1707,11 @@ function Mt(e, t) {
|
|
|
1555
1707
|
matches: i
|
|
1556
1708
|
});
|
|
1557
1709
|
}
|
|
1558
|
-
function
|
|
1710
|
+
function It(e, t) {
|
|
1559
1711
|
if (!t) return null;
|
|
1560
1712
|
let n = 0, r = [];
|
|
1561
1713
|
for (let i of e) {
|
|
1562
|
-
let e =
|
|
1714
|
+
let e = Ft(i, t);
|
|
1563
1715
|
if (!e) return null;
|
|
1564
1716
|
n += e.score;
|
|
1565
1717
|
for (let t of e.matches) r.push(t);
|
|
@@ -1569,7 +1721,7 @@ function Nt(e, t) {
|
|
|
1569
1721
|
matches: r
|
|
1570
1722
|
};
|
|
1571
1723
|
}
|
|
1572
|
-
function
|
|
1724
|
+
function Lt(e, t) {
|
|
1573
1725
|
let n = null, r = [], i = [
|
|
1574
1726
|
[t._lc.label, 12],
|
|
1575
1727
|
[t._lc.type, 10],
|
|
@@ -1577,7 +1729,7 @@ function Pt(e, t) {
|
|
|
1577
1729
|
];
|
|
1578
1730
|
for (let [a, o] of i) {
|
|
1579
1731
|
if (!a) continue;
|
|
1580
|
-
let i =
|
|
1732
|
+
let i = It(e, a);
|
|
1581
1733
|
if (!i) continue;
|
|
1582
1734
|
let s = i.score * o;
|
|
1583
1735
|
(n === null || s > n) && (n = s, r = a === t._lc.label ? i.matches : []);
|
|
@@ -1587,7 +1739,7 @@ function Pt(e, t) {
|
|
|
1587
1739
|
matches: r
|
|
1588
1740
|
};
|
|
1589
1741
|
}
|
|
1590
|
-
function
|
|
1742
|
+
function Rt(e) {
|
|
1591
1743
|
return e.map((e) => ({
|
|
1592
1744
|
item: e,
|
|
1593
1745
|
_lc: {
|
|
@@ -1597,15 +1749,15 @@ function Ft(e) {
|
|
|
1597
1749
|
}
|
|
1598
1750
|
}));
|
|
1599
1751
|
}
|
|
1600
|
-
var
|
|
1601
|
-
function
|
|
1602
|
-
let t =
|
|
1603
|
-
return t || (t = /* @__PURE__ */ new Map(),
|
|
1752
|
+
var zt = /* @__PURE__ */ new WeakMap();
|
|
1753
|
+
function Bt(e) {
|
|
1754
|
+
let t = zt.get(e);
|
|
1755
|
+
return t || (t = /* @__PURE__ */ new Map(), zt.set(e, t)), t;
|
|
1604
1756
|
}
|
|
1605
|
-
function
|
|
1757
|
+
function Vt(e, t, n = 30) {
|
|
1606
1758
|
let r = t.toLowerCase().trim();
|
|
1607
1759
|
if (!r) return [];
|
|
1608
|
-
let i =
|
|
1760
|
+
let i = Bt(e), a = i.get(r);
|
|
1609
1761
|
if (a) return a.slice(0, n);
|
|
1610
1762
|
i.size > 200 && i.clear();
|
|
1611
1763
|
let o = r.split(/\s+/).filter(Boolean);
|
|
@@ -1624,7 +1776,7 @@ function Rt(e, t, n = 30) {
|
|
|
1624
1776
|
}
|
|
1625
1777
|
let c = [];
|
|
1626
1778
|
for (let e of s) {
|
|
1627
|
-
let t =
|
|
1779
|
+
let t = Lt(o, e);
|
|
1628
1780
|
t && c.push({
|
|
1629
1781
|
item: e.item,
|
|
1630
1782
|
score: t.score,
|
|
@@ -1633,21 +1785,21 @@ function Rt(e, t, n = 30) {
|
|
|
1633
1785
|
}
|
|
1634
1786
|
return c.sort((e, t) => t.score - e.score), i.set(r, c), c.slice(0, n);
|
|
1635
1787
|
}
|
|
1636
|
-
function
|
|
1788
|
+
function Ht(e) {
|
|
1637
1789
|
if (e) {
|
|
1638
|
-
|
|
1790
|
+
zt.delete(e);
|
|
1639
1791
|
return;
|
|
1640
1792
|
}
|
|
1641
|
-
|
|
1793
|
+
zt = /* @__PURE__ */ new WeakMap();
|
|
1642
1794
|
}
|
|
1643
1795
|
//#endregion
|
|
1644
1796
|
//#region src/composables/search/useFuzzySearch.ts
|
|
1645
|
-
function
|
|
1646
|
-
let t = typeof e.items == "function" ? e.items : () => e.items, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i =
|
|
1797
|
+
function Ut(e) {
|
|
1798
|
+
let t = typeof e.items == "function" ? e.items : () => e.items, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i = K(""), a = K(!1), o = K(!1), s = K(0), c = K(""), l = A(() => t()), u = A(() => Rt(l.value)), d;
|
|
1647
1799
|
function f(e = d) {
|
|
1648
1800
|
e !== void 0 && (clearTimeout(e), d === e && (d = void 0));
|
|
1649
1801
|
}
|
|
1650
|
-
|
|
1802
|
+
X(i, (e, t, r) => {
|
|
1651
1803
|
if (f(), !e || n <= 0) {
|
|
1652
1804
|
c.value = e;
|
|
1653
1805
|
return;
|
|
@@ -1656,18 +1808,18 @@ function Bt(e) {
|
|
|
1656
1808
|
d === i && (c.value = e, d = void 0);
|
|
1657
1809
|
}, n);
|
|
1658
1810
|
d = i, r(() => f(i));
|
|
1659
|
-
}),
|
|
1811
|
+
}), X(l, () => {
|
|
1660
1812
|
f(), c.value = i.value, s.value = 0;
|
|
1661
1813
|
}, { deep: !0 });
|
|
1662
|
-
let p =
|
|
1663
|
-
|
|
1814
|
+
let p = A(() => Vt(u.value, c.value, r));
|
|
1815
|
+
X(p, () => {
|
|
1664
1816
|
s.value = 0;
|
|
1665
1817
|
});
|
|
1666
1818
|
function m(t) {
|
|
1667
1819
|
e.onSelect?.(t), h();
|
|
1668
1820
|
}
|
|
1669
1821
|
function h() {
|
|
1670
|
-
a.value = !1, o.value = !1, f(), i.value = "", c.value = "", s.value = 0,
|
|
1822
|
+
a.value = !1, o.value = !1, f(), i.value = "", c.value = "", s.value = 0, Ht(u.value);
|
|
1671
1823
|
}
|
|
1672
1824
|
function g() {
|
|
1673
1825
|
a.value = !0;
|
|
@@ -1691,8 +1843,8 @@ function Bt(e) {
|
|
|
1691
1843
|
break;
|
|
1692
1844
|
}
|
|
1693
1845
|
}
|
|
1694
|
-
return
|
|
1695
|
-
f(),
|
|
1846
|
+
return U(() => {
|
|
1847
|
+
f(), Ht(u.value);
|
|
1696
1848
|
}, !0), {
|
|
1697
1849
|
query: i,
|
|
1698
1850
|
results: p,
|
|
@@ -1708,13 +1860,13 @@ function Bt(e) {
|
|
|
1708
1860
|
}
|
|
1709
1861
|
//#endregion
|
|
1710
1862
|
//#region src/components/dock/composables/useDockSearch.ts
|
|
1711
|
-
function
|
|
1712
|
-
let { dockState: t } = e, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i =
|
|
1863
|
+
function Wt(e) {
|
|
1864
|
+
let { dockState: t } = e, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i = K([]), a = null, o = e.items ? e.items : () => i.value;
|
|
1713
1865
|
function s(t) {
|
|
1714
1866
|
let n = t.item.id;
|
|
1715
1867
|
e.ensureTargetWindow?.(n), e.scrollTo?.(n), e.onResultSelect?.(t);
|
|
1716
1868
|
}
|
|
1717
|
-
let c =
|
|
1869
|
+
let c = Ut({
|
|
1718
1870
|
items: o,
|
|
1719
1871
|
debounceMs: n,
|
|
1720
1872
|
maxResults: r,
|
|
@@ -1722,7 +1874,7 @@ function Vt(e) {
|
|
|
1722
1874
|
});
|
|
1723
1875
|
if (e.onSearch) {
|
|
1724
1876
|
let t = e.onSearch;
|
|
1725
|
-
|
|
1877
|
+
X(() => c.query.value, (e) => {
|
|
1726
1878
|
if (a?.abort(), !e) {
|
|
1727
1879
|
i.value = [];
|
|
1728
1880
|
return;
|
|
@@ -1735,7 +1887,7 @@ function Vt(e) {
|
|
|
1735
1887
|
});
|
|
1736
1888
|
});
|
|
1737
1889
|
}
|
|
1738
|
-
let l =
|
|
1890
|
+
let l = A(() => {
|
|
1739
1891
|
let e = c.query.value;
|
|
1740
1892
|
if (!e) return "";
|
|
1741
1893
|
let t = c.results.value[0];
|
|
@@ -1758,7 +1910,7 @@ function Vt(e) {
|
|
|
1758
1910
|
return e.collapseOnScroll && e.scrollContainer && (g = k(e.scrollContainer, {
|
|
1759
1911
|
collapseOnScroll: !0,
|
|
1760
1912
|
chromeRef: e.chromeRef
|
|
1761
|
-
})),
|
|
1913
|
+
})), U(() => {
|
|
1762
1914
|
a?.abort(), a = null;
|
|
1763
1915
|
}), {
|
|
1764
1916
|
fuzzy: c,
|
|
@@ -1771,4 +1923,4 @@ function Vt(e) {
|
|
|
1771
1923
|
};
|
|
1772
1924
|
}
|
|
1773
1925
|
//#endregion
|
|
1774
|
-
export { _ as DOCK_CONTEXT_KEY,
|
|
1926
|
+
export { _ as DOCK_CONTEXT_KEY, Mt as DockBackgroundToggle, At as DockControl, bt as DockCrossfade, kt as DockLayer, Et as DockLayerGroup, Pt as DockSeparator, jt as DockTrigger, dt as GlassDock, l as provideDockContext, g as useDockContext, D as useDockCtaReceive, Wt as useDockSearch, v as useOptionalDockContext };
|