@mkbabb/glass-ui 10.1.1 → 10.1.2
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/MIGRATION.md +45 -0
- package/dist/{command-CTQCaHVA.js → command-CatrAsrl.js} +1 -1
- package/dist/command.js +1 -1
- package/dist/components/dock/DockControl.vue.d.ts +3 -0
- package/dist/components/dock/DockTrigger.vue.d.ts +5 -5
- package/dist/components/dock/composables/dockMorphMeasure.d.ts +31 -7
- package/dist/components/dock/composables/useDockMorph.d.ts +5 -0
- package/dist/components/dock/composables/useDockRun.d.ts +5 -0
- package/dist/components/dock/constants.d.ts +10 -0
- package/dist/components/dock/styles/controls/triggers.css +1 -1
- package/dist/components/dock/styles/index.css +1 -1
- package/dist/dock.js +561 -417
- package/dist/easing.js +3 -3
- package/dist/glass-ui.js +6 -6
- package/dist/labeled-field.js +1 -1
- package/dist/{menu-DN29N6KR.js → menu-DaYAZiVW.js} +1 -1
- package/dist/menu.js +1 -1
- package/dist/{participation-Cs_UX_Dc.js → participation-B7UFdgXB.js} +11 -11
- package/dist/{popover-CJpvT2E6.js → popover-BdpoE4Ar.js} +1 -1
- package/dist/popover.js +1 -1
- package/dist/{select-5QMeUAU6.js → select-BiF0FCZf.js} +1 -1
- package/dist/select.js +1 -1
- package/dist/{slider-D1zkobtO.js → slider-5uoY-cLG.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{tabs-C0PYq3Tb.js → tabs-C5sC0fBE.js} +1 -1
- package/dist/tabs.js +1 -1
- package/dist/{tooltip-D7j6TsE4.js → tooltip-CZVubnJf.js} +1 -1
- package/dist/tooltip.js +1 -1
- package/package.json +1 -1
package/dist/dock.js
CHANGED
|
@@ -6,44 +6,44 @@ import { n as i } from "./springPresets-Cbe0Voqg.js";
|
|
|
6
6
|
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
|
-
import { a as l, c as u, d, i as
|
|
10
|
-
import { t as
|
|
11
|
-
import { n as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
17
|
-
import { n as
|
|
18
|
-
import { n as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { PopoverTrigger as
|
|
21
|
-
import { ChevronDown as
|
|
22
|
-
import { SpringProgress as
|
|
23
|
-
import { useMediaQuery as
|
|
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-CdUlm2QZ.js";
|
|
11
|
+
import { n as x } from "./useResolveTokenColor-B2FfJnd9.js";
|
|
12
|
+
import { t as S } from "./useIntersectionPause-CzKR3EyP.js";
|
|
13
|
+
import { t as C } from "./focus-Duf7EpUu.js";
|
|
14
|
+
import { t as w } from "./DropdownMenuTrigger-CKRnhDSQ.js";
|
|
15
|
+
import { t as T } from "./useSelectionGroup-zsEwitF6.js";
|
|
16
|
+
import { t as E } from "./useDragMorph-B363RUbF.js";
|
|
17
|
+
import { n as D } from "./useDockCtaReceive-BSSgD6mu.js";
|
|
18
|
+
import { n as O, t as k } from "./useScrollChrome-BJbWV32F.js";
|
|
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 ee, mergeModels as R, mergeProps as z, nextTick as B, normalizeClass as V, normalizeStyle as te, onBeforeUnmount as H, onMounted as U, 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 $, withModifiers 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 be(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 we(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,50 +102,50 @@ function Te(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
150
|
let l = q(null), u = q(null), d = q({
|
|
151
151
|
state: "pending",
|
|
@@ -164,7 +164,7 @@ function Me(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();
|
|
@@ -188,7 +188,7 @@ function Me(e, n = {}) {
|
|
|
188
188
|
targetRect: _(t)
|
|
189
189
|
}, t.style.setProperty("--glass-backdrop-luma", o.toFixed(3)), t.setAttribute("data-backdrop-sampled", ""), t.setAttribute("data-backdrop-sample-state", "sampled"), t.setAttribute("data-backdrop-sample-source", n === "live" ? "canvas" : "elements"), t.removeAttribute("data-backdrop-sample-reason"), t.style.setProperty("--glass-backdrop-sampled", "1"), a && t.style.setProperty("--glass-backdrop", s);
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function y(e, t, n, r) {
|
|
192
192
|
l.value = null, u.value = null, d.value = {
|
|
193
193
|
state: "unavailable",
|
|
194
194
|
mode: t,
|
|
@@ -198,27 +198,27 @@ function Me(e, n = {}) {
|
|
|
198
198
|
targetRect: _(e)
|
|
199
199
|
}, e.style.removeProperty("--glass-backdrop-luma"), e.style.removeProperty("--glass-backdrop-sampled"), a && e.style.removeProperty("--glass-backdrop"), e.removeAttribute("data-backdrop-sampled"), e.setAttribute("data-backdrop-sample-state", "unavailable"), e.setAttribute("data-backdrop-sample-source", t === "live" ? "canvas" : "elements"), e.setAttribute("data-backdrop-sample-reason", n);
|
|
200
200
|
}
|
|
201
|
-
let
|
|
201
|
+
let x = 0;
|
|
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" ?
|
|
206
|
-
o ? v(o, t, i, s) :
|
|
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
|
+
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
|
-
let w =
|
|
209
|
-
f.value || e -
|
|
208
|
+
let w = O(({ now: e }) => {
|
|
209
|
+
f.value || e - x < o || C();
|
|
210
210
|
}, {
|
|
211
211
|
immediate: !1,
|
|
212
212
|
pauseWhenHidden: !0,
|
|
213
213
|
respectReducedMotion: !0
|
|
214
|
-
}), T =
|
|
214
|
+
}), T = S(() => e.value, {
|
|
215
215
|
pause: () => w.pause(),
|
|
216
216
|
resume: () => {
|
|
217
217
|
let t = e.value;
|
|
218
218
|
t && c(t) || g() && !f.value && w.resume();
|
|
219
219
|
}
|
|
220
|
-
}, { rootMargin: "200px" }), E =
|
|
221
|
-
function
|
|
220
|
+
}, { rootMargin: "200px" }), E = b(e, () => C());
|
|
221
|
+
function D() {
|
|
222
222
|
let t = e.value;
|
|
223
223
|
if (t && c(t)) {
|
|
224
224
|
w.stop();
|
|
@@ -226,11 +226,11 @@ function Me(e, n = {}) {
|
|
|
226
226
|
}
|
|
227
227
|
f.value ? (w.stop(), C()) : g() && w.start();
|
|
228
228
|
}
|
|
229
|
-
let k = Z(f,
|
|
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
|
-
C(),
|
|
233
|
+
C(), D();
|
|
234
234
|
}
|
|
235
235
|
}, {
|
|
236
236
|
immediate: !0,
|
|
@@ -249,8 +249,8 @@ function Me(e, n = {}) {
|
|
|
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 = q(c() ? "pinned" : i ? "hover" : "collapsed"), f =
|
|
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
|
}
|
|
@@ -272,7 +272,7 @@ function Ne(e) {
|
|
|
272
272
|
d.value = "collapsed", T();
|
|
273
273
|
}, t));
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function A() {
|
|
276
276
|
if (c()) {
|
|
277
277
|
d.value = "pinned", T();
|
|
278
278
|
return;
|
|
@@ -296,7 +296,7 @@ function Ne(e) {
|
|
|
296
296
|
if (h.value > 0) return;
|
|
297
297
|
if (e) {
|
|
298
298
|
let t = n.value;
|
|
299
|
-
if (t && e.relatedTarget instanceof Node && t.contains(e.relatedTarget) ||
|
|
299
|
+
if (t && e.relatedTarget instanceof Node && t.contains(e.relatedTarget) || ve(e.relatedTarget, o)) return;
|
|
300
300
|
}
|
|
301
301
|
k();
|
|
302
302
|
}
|
|
@@ -307,30 +307,30 @@ function Ne(e) {
|
|
|
307
307
|
function I(e) {
|
|
308
308
|
if (l() || d.value !== "hover" || h.value > 0) return;
|
|
309
309
|
let t = e.currentTarget;
|
|
310
|
-
e.relatedTarget && t.contains(e.relatedTarget) ||
|
|
310
|
+
e.relatedTarget && t.contains(e.relatedTarget) || ve(e.relatedTarget, o) || k();
|
|
311
311
|
}
|
|
312
312
|
function L() {
|
|
313
313
|
l() || (E(), C(), d.value = "pinned", T());
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function ee(e = "morph") {
|
|
316
316
|
h.value++, e === "grasp" && g.value++, E();
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function R(e = "morph") {
|
|
319
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" && (E(), m = setTimeout(() => {
|
|
320
320
|
h.value === 0 && d.value === "hover" && k();
|
|
321
321
|
}, Math.min(t, 800)));
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function z(e) {
|
|
324
324
|
if (l() || h.value > 0 || a?.value) return;
|
|
325
325
|
let t = n.value;
|
|
326
|
-
!t || t.contains(e.target) ||
|
|
326
|
+
!t || t.contains(e.target) || ve(e.target, o) || A();
|
|
327
327
|
}
|
|
328
328
|
return Z(f, (e) => {
|
|
329
329
|
if (e) {
|
|
330
330
|
if (typeof document > "u") return;
|
|
331
331
|
O(), b = requestAnimationFrame(() => {
|
|
332
|
-
b = null, f.value && (document.addEventListener("pointerdown",
|
|
333
|
-
document.removeEventListener("pointerdown",
|
|
332
|
+
b = null, f.value && (document.addEventListener("pointerdown", z, !0), y = () => {
|
|
333
|
+
document.removeEventListener("pointerdown", z, !0), y = null;
|
|
334
334
|
});
|
|
335
335
|
});
|
|
336
336
|
} else O();
|
|
@@ -340,7 +340,7 @@ function Ne(e) {
|
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
342
|
d.value = "collapsed", T();
|
|
343
|
-
}),
|
|
343
|
+
}), ne(() => {
|
|
344
344
|
E(), C(), O();
|
|
345
345
|
}), {
|
|
346
346
|
state: d,
|
|
@@ -353,15 +353,15 @@ function Ne(e) {
|
|
|
353
353
|
onFocusIn: F,
|
|
354
354
|
onFocusOut: I,
|
|
355
355
|
onClickCollapsed: L,
|
|
356
|
-
keepOpen:
|
|
357
|
-
release:
|
|
356
|
+
keepOpen: ee,
|
|
357
|
+
release: R,
|
|
358
358
|
expand: M,
|
|
359
|
-
collapse:
|
|
359
|
+
collapse: A
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
362
|
//#endregion
|
|
363
363
|
//#region src/components/dock/composables/useDockSpring.ts
|
|
364
|
-
function
|
|
364
|
+
function Ie(e) {
|
|
365
365
|
let t = null, n = () => t !== null && !t.settled;
|
|
366
366
|
function i() {
|
|
367
367
|
t &&= (t.dispose(), null);
|
|
@@ -369,7 +369,7 @@ function Pe(e) {
|
|
|
369
369
|
function a(a, o, s) {
|
|
370
370
|
let c = n() ? t.velocity * (s.inheritVelocityScale ?? 1) : 0;
|
|
371
371
|
i();
|
|
372
|
-
let l = new
|
|
372
|
+
let l = new ge({
|
|
373
373
|
response: e.response * r(),
|
|
374
374
|
dampingFraction: e.dampingFraction,
|
|
375
375
|
initial: a,
|
|
@@ -396,11 +396,11 @@ function Pe(e) {
|
|
|
396
396
|
}
|
|
397
397
|
//#endregion
|
|
398
398
|
//#region src/components/dock/composables/useDockMorph.ts
|
|
399
|
-
function
|
|
400
|
-
let { rootEl: t, outerActiveLayer: n } = e, r = q(n.value), i = q(null), a =
|
|
401
|
-
response:
|
|
402
|
-
dampingFraction:
|
|
403
|
-
}), o =
|
|
399
|
+
function Le(e) {
|
|
400
|
+
let { rootEl: t, outerActiveLayer: n } = e, r = q(n.value), i = q(null), a = Ie({
|
|
401
|
+
response: d.response,
|
|
402
|
+
dampingFraction: d.dampingFraction
|
|
403
|
+
}), o = _e("(prefers-reduced-motion: reduce)");
|
|
404
404
|
function s() {
|
|
405
405
|
return t.value;
|
|
406
406
|
}
|
|
@@ -426,16 +426,12 @@ function Fe(e) {
|
|
|
426
426
|
});
|
|
427
427
|
}
|
|
428
428
|
let u = Z(n, (e, t) => {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
i.value = t, l();
|
|
436
|
-
});
|
|
437
|
-
return ee(() => {
|
|
438
|
-
u(), a.dispose();
|
|
429
|
+
e !== t && (r.value = e, i.value = s() ? t : null);
|
|
430
|
+
}), f = Z(n, (t, n) => {
|
|
431
|
+
t === n || !s() || (e.measure(), l());
|
|
432
|
+
}, { flush: "post" });
|
|
433
|
+
return ne(() => {
|
|
434
|
+
u(), f(), a.dispose();
|
|
439
435
|
}), {
|
|
440
436
|
outerCurrentLayer: K(r),
|
|
441
437
|
outerLeavingLayer: K(i)
|
|
@@ -443,34 +439,109 @@ function Fe(e) {
|
|
|
443
439
|
}
|
|
444
440
|
//#endregion
|
|
445
441
|
//#region src/components/dock/composables/dockMorphMeasure.ts
|
|
446
|
-
function
|
|
442
|
+
function Re(e, t) {
|
|
447
443
|
return t === "vertical" ? e.offsetHeight : e.offsetWidth;
|
|
448
444
|
}
|
|
449
|
-
function
|
|
450
|
-
let
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
445
|
+
function ze(e, t) {
|
|
446
|
+
let n = e.map(([e, t]) => [
|
|
447
|
+
e,
|
|
448
|
+
t,
|
|
449
|
+
e.style.getPropertyValue(t),
|
|
450
|
+
e.style.getPropertyPriority(t)
|
|
451
|
+
]);
|
|
452
|
+
for (let [t, n, r] of e) t.style.setProperty(n, r, n.startsWith("--") ? "" : "important");
|
|
453
|
+
try {
|
|
454
|
+
return t();
|
|
455
|
+
} finally {
|
|
456
|
+
for (let [e, t, r, i] of n.reverse()) r ? e.style.setProperty(t, r, i) : e.style.removeProperty(t);
|
|
459
457
|
}
|
|
458
|
+
}
|
|
459
|
+
function Be(e, t) {
|
|
460
|
+
let n = e.scrollLeft, r = e.scrollTop;
|
|
461
|
+
try {
|
|
462
|
+
return t();
|
|
463
|
+
} finally {
|
|
464
|
+
(e.scrollLeft !== n || e.scrollTop !== r) && e.scrollTo({
|
|
465
|
+
left: n,
|
|
466
|
+
top: r,
|
|
467
|
+
behavior: "instant"
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
function Ve(e, t, n, r, i) {
|
|
472
|
+
let a = r === "vertical" ? "margin-block-end" : "margin-inline-end";
|
|
473
|
+
return ze([
|
|
474
|
+
[
|
|
475
|
+
e,
|
|
476
|
+
"--dock-expanded-px",
|
|
477
|
+
"initial"
|
|
478
|
+
],
|
|
479
|
+
[
|
|
480
|
+
t,
|
|
481
|
+
"position",
|
|
482
|
+
"relative"
|
|
483
|
+
],
|
|
484
|
+
[
|
|
485
|
+
t,
|
|
486
|
+
"inset",
|
|
487
|
+
"auto"
|
|
488
|
+
],
|
|
489
|
+
[
|
|
490
|
+
n,
|
|
491
|
+
"position",
|
|
492
|
+
"absolute"
|
|
493
|
+
]
|
|
494
|
+
], () => {
|
|
495
|
+
let n = Re(e, r);
|
|
496
|
+
if (i === null) return n;
|
|
497
|
+
let o = i - (n - Re(t, r));
|
|
498
|
+
if (Math.abs(o) < .5) return n;
|
|
499
|
+
let s = Number.parseFloat(getComputedStyle(t).getPropertyValue(a)) || 0;
|
|
500
|
+
return ze([[
|
|
501
|
+
t,
|
|
502
|
+
a,
|
|
503
|
+
`${s + o}px`
|
|
504
|
+
]], () => Re(e, r));
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
function He(e) {
|
|
508
|
+
let { rootEl: t, contentEl: n, expandedEl: r, collapsedEl: i, axis: a } = e, o = null, s = null, c = null, l = null, u = null, d = !1;
|
|
460
509
|
function f() {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
510
|
+
let e = t.value, o = r.value, s = i.value;
|
|
511
|
+
if (!e || !n.value || !o || !s) return;
|
|
512
|
+
let d = a.value, f = o.classList.contains("is-active");
|
|
513
|
+
if (!e.hasAttribute("data-morphing")) {
|
|
514
|
+
let t = Re(e, d) - Re(f ? o : s, d);
|
|
515
|
+
f ? c = t : l = t;
|
|
516
|
+
}
|
|
517
|
+
let p = Be(o, () => Ve(e, o, s, d, c));
|
|
518
|
+
f || (u = Be(o, () => Ve(e, s, o, d, l))), !(p <= 0) && (u !== null && u > 0 && e.style.setProperty("--dock-collapsed-px", `${u}px`), e.style.setProperty("--dock-expanded-px", `${Math.max(p, u ?? 0)}px`));
|
|
519
|
+
}
|
|
520
|
+
function p() {
|
|
521
|
+
if (!o) return;
|
|
522
|
+
o.disconnect();
|
|
523
|
+
let e = [r.value, i.value], a = t.value;
|
|
524
|
+
for (let t of [
|
|
525
|
+
a,
|
|
526
|
+
a?.parentElement,
|
|
527
|
+
n.value,
|
|
528
|
+
...e
|
|
529
|
+
]) t && o.observe(t);
|
|
530
|
+
for (let t of e) for (let e of t?.children ?? []) o.observe(e);
|
|
531
|
+
}
|
|
532
|
+
function m() {
|
|
533
|
+
if (o?.disconnect(), o = null, s?.disconnect(), s = null, t.value) {
|
|
534
|
+
if (typeof ResizeObserver < "u" && (o = new ResizeObserver(() => f()), p()), typeof MutationObserver < "u") {
|
|
535
|
+
s = new MutationObserver(() => {
|
|
536
|
+
p(), f();
|
|
537
|
+
});
|
|
538
|
+
for (let e of [r.value, i.value]) e && s.observe(e, {
|
|
539
|
+
childList: !0,
|
|
540
|
+
subtree: !0,
|
|
541
|
+
characterData: !0
|
|
542
|
+
});
|
|
472
543
|
}
|
|
473
|
-
|
|
544
|
+
f();
|
|
474
545
|
}
|
|
475
546
|
}
|
|
476
547
|
Z([
|
|
@@ -479,27 +550,29 @@ function Le(e) {
|
|
|
479
550
|
r,
|
|
480
551
|
i,
|
|
481
552
|
a
|
|
482
|
-
],
|
|
483
|
-
let
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
553
|
+
], m, { immediate: !0 });
|
|
554
|
+
let h = () => f();
|
|
555
|
+
typeof window < "u" && window.addEventListener("resize", h);
|
|
556
|
+
let g = typeof document < "u" ? document.fonts : void 0;
|
|
557
|
+
return g && g.ready.then(() => !d && f()), W(() => {
|
|
558
|
+
d = !0, o?.disconnect(), o = null, s?.disconnect(), s = null, typeof window < "u" && window.removeEventListener("resize", h);
|
|
559
|
+
}), { measure: f };
|
|
487
560
|
}
|
|
488
561
|
//#endregion
|
|
489
562
|
//#region src/components/dock/composables/useDockShellProps.ts
|
|
490
|
-
function
|
|
491
|
-
let t =
|
|
563
|
+
function Ue(e) {
|
|
564
|
+
let t = j(() => e.shape ?? "pill"), n = j(() => e.orientation ?? "horizontal"), r = j(() => e.collapse === !1);
|
|
492
565
|
return {
|
|
493
|
-
startCollapsed:
|
|
566
|
+
startCollapsed: j(() => !r.value && (e.collapse ?? "closed") === "closed"),
|
|
494
567
|
shape: t,
|
|
495
568
|
orientation: n,
|
|
496
569
|
alwaysExpanded: r,
|
|
497
|
-
fitContent:
|
|
570
|
+
fitContent: j(() => e.fitContent ?? !1)
|
|
498
571
|
};
|
|
499
572
|
}
|
|
500
573
|
//#endregion
|
|
501
574
|
//#region src/components/dock/composables/useDockClickIntegrity.ts
|
|
502
|
-
function
|
|
575
|
+
function We(e) {
|
|
503
576
|
let { rootEl: t, visualExpanded: n } = e, r = null, i = !1, a = 0, o = null, s = q(null), c = null, l = [];
|
|
504
577
|
function u() {
|
|
505
578
|
c?.removeAttribute("data-dock-press-origin"), c = null;
|
|
@@ -582,94 +655,109 @@ function ze(e) {
|
|
|
582
655
|
}
|
|
583
656
|
//#endregion
|
|
584
657
|
//#region src/components/dock/composables/useDockRun.ts
|
|
585
|
-
function
|
|
658
|
+
function Ge(e, t) {
|
|
586
659
|
let n = getComputedStyle(e).getPropertyValue(t).trim(), r = Number.parseFloat(n);
|
|
587
660
|
return Number.isFinite(r) ? r : 0;
|
|
588
661
|
}
|
|
589
|
-
function
|
|
662
|
+
function Ke(e) {
|
|
590
663
|
return Array.from(e.children).filter((e) => e instanceof HTMLElement);
|
|
591
664
|
}
|
|
592
|
-
function
|
|
665
|
+
function qe(e) {
|
|
593
666
|
return e.findIndex((e) => {
|
|
594
667
|
let t = (e.matches("[aria-current]") ? e : e.querySelector("[aria-current]"))?.getAttribute("aria-current");
|
|
595
668
|
return t != null && t !== "false";
|
|
596
669
|
});
|
|
597
670
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
return (e.matches(S) || e.hasAttribute("tabindex")) && !e.querySelector(Ue);
|
|
671
|
+
function Je(e) {
|
|
672
|
+
return e.hasAttribute(y);
|
|
601
673
|
}
|
|
602
|
-
function
|
|
603
|
-
return
|
|
674
|
+
function Ye(e) {
|
|
675
|
+
return Ke(e).filter(Je);
|
|
604
676
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
677
|
+
var Xe = ".dock-separator", Ze = "select[aria-hidden=\"true\"][tabindex=\"-1\"]";
|
|
678
|
+
function Qe(e) {
|
|
679
|
+
let t = Ke(e).filter((e) => !e.matches(Xe) && !e.matches(Ze));
|
|
680
|
+
return t.length > 0 && t.every(Je);
|
|
681
|
+
}
|
|
682
|
+
function $e(e) {
|
|
683
|
+
let { runEl: t, statusEl: n, orientation: r } = e, i = q(!1), a = Ie({
|
|
684
|
+
response: d.response,
|
|
685
|
+
dampingFraction: d.dampingFraction
|
|
609
686
|
});
|
|
610
|
-
function
|
|
687
|
+
function o() {
|
|
611
688
|
return r.value === "vertical";
|
|
612
689
|
}
|
|
613
|
-
function
|
|
614
|
-
return
|
|
690
|
+
function s(e) {
|
|
691
|
+
return o() ? e.scrollTop : e.scrollLeft;
|
|
615
692
|
}
|
|
616
|
-
function
|
|
617
|
-
|
|
618
|
-
}
|
|
619
|
-
function c(e) {
|
|
620
|
-
return a() ? e.scrollHeight - e.clientHeight : e.scrollWidth - e.clientWidth;
|
|
693
|
+
function c(e, t) {
|
|
694
|
+
o() ? e.scrollTop = t : e.scrollLeft = t;
|
|
621
695
|
}
|
|
622
|
-
function l(e
|
|
623
|
-
|
|
624
|
-
if (r < 0) return o(e);
|
|
625
|
-
let i = Be(e, "--dock-pitch");
|
|
626
|
-
if (i <= 0) return o(e);
|
|
627
|
-
let a = Math.max(1, Be(e, "--dock-open-pitches")), s = He(n), l = s >= 0 && s < r ? (a - 1) * i : 0, u = r * i + l - i / 2;
|
|
628
|
-
return Math.min(Math.max(u, 0), c(e));
|
|
696
|
+
function l(e) {
|
|
697
|
+
return o() ? e.scrollHeight - e.clientHeight : e.scrollWidth - e.clientWidth;
|
|
629
698
|
}
|
|
630
699
|
function u(e, t) {
|
|
700
|
+
let n = Ke(e), r = n.indexOf(t);
|
|
701
|
+
if (r < 0) return s(e);
|
|
702
|
+
let i = Ge(e, "--dock-pitch");
|
|
703
|
+
if (i <= 0) return s(e);
|
|
704
|
+
let a = Math.max(1, Ge(e, "--dock-open-pitches")), o = qe(n), c = o >= 0 && o < r ? (a - 1) * i : 0, u = r * i + c - i / 2;
|
|
705
|
+
return Math.min(Math.max(u, 0), l(e));
|
|
706
|
+
}
|
|
707
|
+
function f(e, t) {
|
|
631
708
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
632
|
-
return
|
|
709
|
+
return o() ? r.top < n.top - 1 || r.bottom > n.bottom + 1 : r.left < n.left - 1 || r.right > n.right + 1;
|
|
633
710
|
}
|
|
634
|
-
function
|
|
711
|
+
function p(e) {
|
|
635
712
|
let t = n.value;
|
|
636
713
|
if (!t) return;
|
|
637
|
-
let r =
|
|
714
|
+
let r = Je(e) ? e : e.querySelector(C) ?? e, i = r.getAttribute("aria-label") ?? r.getAttribute("title") ?? r.textContent?.trim();
|
|
638
715
|
i && (t.textContent = i);
|
|
639
716
|
}
|
|
640
|
-
function
|
|
717
|
+
function m(e) {
|
|
641
718
|
let n = t.value;
|
|
642
|
-
if (!n || (
|
|
643
|
-
let r =
|
|
644
|
-
Math.abs(
|
|
719
|
+
if (!n || (p(e), !f(n, e))) return;
|
|
720
|
+
let r = s(n), i = u(n, e);
|
|
721
|
+
Math.abs(i - r) < 1 || a.playTo(0, 1, { onFrame: (e) => {
|
|
645
722
|
let n = t.value;
|
|
646
|
-
n &&
|
|
723
|
+
n && c(n, r + (i - r) * e);
|
|
647
724
|
} });
|
|
648
725
|
}
|
|
649
|
-
|
|
726
|
+
let h = /* @__PURE__ */ new WeakMap();
|
|
727
|
+
function g(e, t) {
|
|
728
|
+
h.has(e) || h.set(e, e.getAttribute("tabindex")), e.tabIndex = t;
|
|
729
|
+
}
|
|
730
|
+
function _(e) {
|
|
731
|
+
if (!h.has(e)) return;
|
|
732
|
+
let t = h.get(e) ?? null;
|
|
733
|
+
h.delete(e), t === null ? e.removeAttribute("tabindex") : e.setAttribute("tabindex", t);
|
|
734
|
+
}
|
|
735
|
+
function v() {
|
|
650
736
|
let e = t.value;
|
|
651
737
|
if (!e) return;
|
|
652
|
-
|
|
738
|
+
i.value = Qe(e);
|
|
739
|
+
for (let t of Ke(e)) Je(t) || _(t);
|
|
740
|
+
let n = Ye(e);
|
|
653
741
|
if (n.length === 0) return;
|
|
654
|
-
let r =
|
|
742
|
+
let r = qe(n), a = n.findIndex((e) => e.contains(document.activeElement)), o = a >= 0 ? a : r >= 0 ? r : 0;
|
|
655
743
|
n.forEach((e, t) => {
|
|
656
|
-
e
|
|
744
|
+
g(e, t === o ? 0 : -1);
|
|
657
745
|
});
|
|
658
746
|
}
|
|
659
|
-
function
|
|
747
|
+
function b(e, t) {
|
|
660
748
|
let n = e[t];
|
|
661
|
-
n && (
|
|
749
|
+
n && (m(n), g(n, 0), n.focus({ preventScroll: !0 }), v());
|
|
662
750
|
}
|
|
663
|
-
function
|
|
751
|
+
function x(e) {
|
|
664
752
|
let n = t.value;
|
|
665
753
|
if (!n) return;
|
|
666
|
-
let r =
|
|
754
|
+
let r = Ye(n);
|
|
667
755
|
if (r.length === 0) return;
|
|
668
756
|
let i = r.findIndex((t) => t.contains(e.target));
|
|
669
757
|
if (i < 0) return;
|
|
670
|
-
let [
|
|
758
|
+
let [a, s] = o() ? ["ArrowUp", "ArrowDown"] : ["ArrowLeft", "ArrowRight"], c;
|
|
671
759
|
switch (e.key) {
|
|
672
|
-
case
|
|
760
|
+
case a:
|
|
673
761
|
c = i - 1;
|
|
674
762
|
break;
|
|
675
763
|
case s:
|
|
@@ -683,41 +771,55 @@ function Ke(e) {
|
|
|
683
771
|
break;
|
|
684
772
|
default: return;
|
|
685
773
|
}
|
|
686
|
-
c < 0 || c >= r.length || (e.preventDefault(),
|
|
774
|
+
c < 0 || c >= r.length || (e.preventDefault(), b(r, c));
|
|
687
775
|
}
|
|
688
|
-
function
|
|
776
|
+
function S(e) {
|
|
689
777
|
let n = t.value;
|
|
690
778
|
if (!n) return;
|
|
691
|
-
let r =
|
|
692
|
-
r &&
|
|
779
|
+
let r = Ke(n).find((t) => t.contains(e.target));
|
|
780
|
+
r && m(r);
|
|
781
|
+
}
|
|
782
|
+
let w = null;
|
|
783
|
+
function T(e, t) {
|
|
784
|
+
if (t.type !== "attributes" || t.attributeName === "aria-current" || t.attributeName === "data-glass-dock-seat") return !0;
|
|
785
|
+
let n = t.target;
|
|
786
|
+
return n.parentElement === e && !Je(n);
|
|
693
787
|
}
|
|
694
|
-
let _ = null;
|
|
695
788
|
return U(() => {
|
|
696
789
|
let e = t.value;
|
|
697
|
-
e && (e.addEventListener("keydown",
|
|
790
|
+
e && (e.addEventListener("keydown", x), e.addEventListener("click", S, { capture: !0 }), e.addEventListener("focusin", S, { capture: !0 }), v(), w = new MutationObserver((t) => {
|
|
791
|
+
t.some((t) => T(e, t)) && v();
|
|
792
|
+
}), w.observe(e, {
|
|
698
793
|
childList: !0,
|
|
699
794
|
subtree: !0,
|
|
700
795
|
attributes: !0,
|
|
701
|
-
attributeFilter: [
|
|
796
|
+
attributeFilter: [
|
|
797
|
+
"aria-current",
|
|
798
|
+
y,
|
|
799
|
+
"aria-hidden",
|
|
800
|
+
"tabindex"
|
|
801
|
+
]
|
|
702
802
|
}));
|
|
703
|
-
}),
|
|
803
|
+
}), ne(() => {
|
|
704
804
|
let e = t.value;
|
|
705
|
-
e?.removeEventListener("keydown",
|
|
706
|
-
}), Z(r, () =>
|
|
707
|
-
reach:
|
|
708
|
-
syncRoving:
|
|
805
|
+
e?.removeEventListener("keydown", x), e?.removeEventListener("click", S, { capture: !0 }), e?.removeEventListener("focusin", S, { capture: !0 }), w?.disconnect(), a.dispose();
|
|
806
|
+
}), Z(r, () => v()), {
|
|
807
|
+
reach: m,
|
|
808
|
+
syncRoving: v,
|
|
809
|
+
toolbar: i
|
|
709
810
|
};
|
|
710
811
|
}
|
|
711
812
|
//#endregion
|
|
712
813
|
//#region src/components/dock/GlassDock.vue?vue&type=script&setup=true&lang.ts
|
|
713
|
-
var
|
|
814
|
+
var et = ["data-backdrop-mode", "data-held"], tt = ["data-held"], nt = { class: "dock-controls" }, rt = {
|
|
714
815
|
key: 0,
|
|
715
816
|
class: "dock-persistent"
|
|
716
|
-
},
|
|
817
|
+
}, it = [
|
|
717
818
|
"id",
|
|
819
|
+
"role",
|
|
718
820
|
"aria-orientation",
|
|
719
821
|
"inert"
|
|
720
|
-
],
|
|
822
|
+
], at = [
|
|
721
823
|
"id",
|
|
722
824
|
"inert",
|
|
723
825
|
"role",
|
|
@@ -725,13 +827,13 @@ var qe = ["data-backdrop-mode", "data-held"], Je = ["data-held"], Ye = { class:
|
|
|
725
827
|
"aria-label",
|
|
726
828
|
"aria-expanded",
|
|
727
829
|
"aria-controls"
|
|
728
|
-
],
|
|
830
|
+
], ot = {
|
|
729
831
|
key: 0,
|
|
730
832
|
class: "dock-search-field"
|
|
731
|
-
},
|
|
833
|
+
}, st = {
|
|
732
834
|
key: 1,
|
|
733
835
|
class: "dock-persistent dock-persistent-end"
|
|
734
|
-
},
|
|
836
|
+
}, ct = /* @__PURE__ */ L({
|
|
735
837
|
inheritAttrs: !1,
|
|
736
838
|
__name: "GlassDock",
|
|
737
839
|
props: {
|
|
@@ -746,85 +848,85 @@ var qe = ["data-backdrop-mode", "data-held"], Je = ["data-held"], Ye = { class:
|
|
|
746
848
|
backgroundCanvas: {}
|
|
747
849
|
},
|
|
748
850
|
setup(e, { expose: t }) {
|
|
749
|
-
let n = e, { startCollapsed: r, shape: i, orientation: a, alwaysExpanded: o, fitContent: s } =
|
|
750
|
-
|
|
751
|
-
runEl: p,
|
|
851
|
+
let n = e, { startCollapsed: r, shape: i, orientation: a, alwaysExpanded: o, fitContent: s } = Ue(n), c = X("dockEl"), u = X("layersEl"), d = X("fullEl"), m = X("summaryEl"), h = X("statusEl"), { toolbar: g } = $e({
|
|
852
|
+
runEl: d,
|
|
752
853
|
statusEl: h,
|
|
753
854
|
orientation: a
|
|
754
|
-
})
|
|
855
|
+
});
|
|
856
|
+
n.backdropMode === "live" && Pe(c, { backgroundCanvas: () => {
|
|
755
857
|
let e = n.backgroundCanvas;
|
|
756
858
|
return typeof e == "function" ? e() : e instanceof HTMLCanvasElement ? e : null;
|
|
757
859
|
} });
|
|
758
|
-
let
|
|
860
|
+
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: ee } = Fe({
|
|
759
861
|
rootEl: c,
|
|
760
862
|
alwaysExpanded: o,
|
|
761
863
|
initialExpanded: !r.value,
|
|
762
|
-
isTransitioning:
|
|
763
|
-
dockId:
|
|
764
|
-
}),
|
|
864
|
+
isTransitioning: _,
|
|
865
|
+
dockId: v
|
|
866
|
+
}), R = j(() => o.value || y.value);
|
|
765
867
|
l({
|
|
766
|
-
id:
|
|
868
|
+
id: v,
|
|
767
869
|
orientation: a,
|
|
768
|
-
keepOpen:
|
|
769
|
-
release:
|
|
770
|
-
held:
|
|
771
|
-
expanded:
|
|
772
|
-
})
|
|
870
|
+
keepOpen: k,
|
|
871
|
+
release: M,
|
|
872
|
+
held: S,
|
|
873
|
+
expanded: R
|
|
874
|
+
});
|
|
875
|
+
let { measure: te } = He({
|
|
773
876
|
rootEl: c,
|
|
774
877
|
contentEl: u,
|
|
775
|
-
expandedEl:
|
|
878
|
+
expandedEl: d,
|
|
776
879
|
collapsedEl: m,
|
|
777
|
-
axis: a
|
|
778
|
-
|
|
779
|
-
});
|
|
780
|
-
let { outerCurrentLayer: H, outerLeavingLayer: U } = Fe({
|
|
880
|
+
axis: a
|
|
881
|
+
}), { outerCurrentLayer: H, outerLeavingLayer: U } = Le({
|
|
781
882
|
rootEl: c,
|
|
782
|
-
outerActiveLayer:
|
|
883
|
+
outerActiveLayer: j(() => R.value ? "full" : "summary"),
|
|
783
884
|
onMorphActiveChange: (e) => {
|
|
784
|
-
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
885
|
+
_.value = e;
|
|
886
|
+
},
|
|
887
|
+
measure: te
|
|
888
|
+
}), W = j(() => H.value === "summary");
|
|
889
|
+
async function ne(e) {
|
|
890
|
+
!W.value || !["Enter", " "].includes(e.key) || (e.preventDefault(), O(), await B(), (d.value?.querySelector(C) ?? d.value)?.focus({ preventScroll: !0 }));
|
|
789
891
|
}
|
|
790
892
|
function K(e) {
|
|
791
893
|
if (e.key !== "Escape") return;
|
|
792
|
-
let t = e.target?.closest?.(
|
|
793
|
-
t &&
|
|
894
|
+
let t = e.target?.closest?.(f);
|
|
895
|
+
t && d.value?.contains(t) || ee();
|
|
794
896
|
}
|
|
795
|
-
Z(
|
|
897
|
+
Z(R, async (e, t) => {
|
|
796
898
|
if (!t || e) return;
|
|
797
899
|
let n = document.activeElement;
|
|
798
|
-
if (!(n &&
|
|
799
|
-
await
|
|
900
|
+
if (!(n && d.value?.contains(n) || n?.closest("[data-glass-dock-face]")?.getAttribute("data-glass-dock-owner") === v)) return;
|
|
901
|
+
await B();
|
|
800
902
|
let r = m.value;
|
|
801
903
|
r && !r.hasAttribute("inert") && r.focus({ preventScroll: !0 });
|
|
802
904
|
});
|
|
803
|
-
let { onPointerDownCapture:
|
|
905
|
+
let { onPointerDownCapture: re, onPointerCancelCapture: ie, onClickCapture: ae, markExpandFlip: se, pressKeepaliveLayer: $ } = We({
|
|
804
906
|
rootEl: c,
|
|
805
|
-
visualExpanded:
|
|
907
|
+
visualExpanded: R
|
|
806
908
|
});
|
|
807
|
-
Z(
|
|
808
|
-
e &&
|
|
909
|
+
Z(R, (e) => {
|
|
910
|
+
e && se();
|
|
809
911
|
});
|
|
810
|
-
let
|
|
811
|
-
Z(
|
|
812
|
-
e && (
|
|
912
|
+
let le = q(!1);
|
|
913
|
+
Z(S, (e) => {
|
|
914
|
+
e && (le.value = !0);
|
|
813
915
|
});
|
|
814
|
-
function
|
|
815
|
-
e.propertyName === "opacity" && !
|
|
916
|
+
function ue(e) {
|
|
917
|
+
e.propertyName === "opacity" && !S.value && (le.value = !1);
|
|
816
918
|
}
|
|
817
919
|
return t({
|
|
818
|
-
expanded:
|
|
819
|
-
isPinned:
|
|
820
|
-
isHeld:
|
|
821
|
-
graspHeld:
|
|
822
|
-
isTransitioning:
|
|
823
|
-
expand:
|
|
824
|
-
collapse:
|
|
825
|
-
keepOpen:
|
|
826
|
-
release:
|
|
827
|
-
}), (e, t) => (G(),
|
|
920
|
+
expanded: y,
|
|
921
|
+
isPinned: b,
|
|
922
|
+
isHeld: x,
|
|
923
|
+
graspHeld: S,
|
|
924
|
+
isTransitioning: _,
|
|
925
|
+
expand: L,
|
|
926
|
+
collapse: ee,
|
|
927
|
+
keepOpen: k,
|
|
928
|
+
release: M
|
|
929
|
+
}), (e, t) => (G(), P("div", z({
|
|
828
930
|
ref_key: "dockEl",
|
|
829
931
|
ref: c
|
|
830
932
|
}, e.$attrs, {
|
|
@@ -832,49 +934,49 @@ var qe = ["data-backdrop-mode", "data-held"], Je = ["data-held"], Ye = { class:
|
|
|
832
934
|
Y(a),
|
|
833
935
|
`shape-${Y(i)}`,
|
|
834
936
|
{
|
|
835
|
-
expanded:
|
|
836
|
-
collapsed: !
|
|
837
|
-
pinned: Y(
|
|
937
|
+
expanded: R.value,
|
|
938
|
+
collapsed: !R.value,
|
|
939
|
+
pinned: Y(b),
|
|
838
940
|
"fit-content": Y(s),
|
|
839
941
|
"always-expanded": Y(o)
|
|
840
942
|
}
|
|
841
943
|
]],
|
|
842
944
|
"data-backdrop-mode": n.backdropMode,
|
|
843
|
-
"data-held": Y(
|
|
844
|
-
onMouseenter: t[2] ||= (...e) => Y(
|
|
845
|
-
onMouseleave: t[3] ||= (e) => Y(
|
|
846
|
-
onFocusin: t[4] ||= (...e) => Y(
|
|
847
|
-
onFocusout: t[5] ||= (...e) => Y(
|
|
848
|
-
onPointerdownCapture: t[6] ||= (...e) => Y(
|
|
849
|
-
onPointercancelCapture: t[7] ||= (...e) => Y(
|
|
850
|
-
onClickCapture: t[8] ||= (...e) => Y(
|
|
945
|
+
"data-held": Y(S) || void 0,
|
|
946
|
+
onMouseenter: t[2] ||= (...e) => Y(w) && Y(w)(...e),
|
|
947
|
+
onMouseleave: t[3] ||= (e) => Y(T)(e),
|
|
948
|
+
onFocusin: t[4] ||= (...e) => Y(E) && Y(E)(...e),
|
|
949
|
+
onFocusout: t[5] ||= (...e) => Y(D) && Y(D)(...e),
|
|
950
|
+
onPointerdownCapture: t[6] ||= (...e) => Y(re) && Y(re)(...e),
|
|
951
|
+
onPointercancelCapture: t[7] ||= (...e) => Y(ie) && Y(ie)(...e),
|
|
952
|
+
onClickCapture: t[8] ||= (...e) => Y(ae) && Y(ae)(...e)
|
|
851
953
|
}), [
|
|
852
|
-
|
|
954
|
+
F("div", {
|
|
853
955
|
class: "dock-plate",
|
|
854
956
|
"aria-hidden": "true",
|
|
855
|
-
"data-held": Y(
|
|
856
|
-
}, [
|
|
957
|
+
"data-held": Y(S) || void 0
|
|
958
|
+
}, [le.value ? (G(), P(A, { key: 0 }, [t[9] ||= F("span", {
|
|
857
959
|
class: "glass-grasp-carrier",
|
|
858
960
|
"data-grasp": "rest"
|
|
859
|
-
}, null, -1),
|
|
961
|
+
}, null, -1), F("span", {
|
|
860
962
|
class: "glass-grasp-carrier",
|
|
861
963
|
"data-grasp": "grasp",
|
|
862
|
-
onTransitionend:
|
|
863
|
-
}, null, 32)], 64)) :
|
|
864
|
-
|
|
865
|
-
e.$slots.persistent ? (G(),
|
|
866
|
-
|
|
964
|
+
onTransitionend: ue
|
|
965
|
+
}, null, 32)], 64)) : N("", !0)], 8, tt),
|
|
966
|
+
F("div", nt, [
|
|
967
|
+
e.$slots.persistent ? (G(), P("div", rt, [J(e.$slots, "persistent")])) : N("", !0),
|
|
968
|
+
F("div", {
|
|
867
969
|
ref_key: "layersEl",
|
|
868
970
|
ref: u,
|
|
869
971
|
class: "dock-layers"
|
|
870
972
|
}, [
|
|
871
|
-
|
|
973
|
+
F("div", {
|
|
872
974
|
ref_key: "fullEl",
|
|
873
|
-
ref:
|
|
874
|
-
id: `${
|
|
875
|
-
role: "toolbar",
|
|
876
|
-
"aria-orientation": Y(a),
|
|
877
|
-
class:
|
|
975
|
+
ref: d,
|
|
976
|
+
id: `${v}-full`,
|
|
977
|
+
role: Y(g) ? "toolbar" : void 0,
|
|
978
|
+
"aria-orientation": Y(g) ? Y(a) : void 0,
|
|
979
|
+
class: V(["dock-layer dock-layer--full dock-run", {
|
|
878
980
|
"is-active": Y(H) === "full",
|
|
879
981
|
"is-leaving": Y(U) === "full" || Y($) === "full" && Y(H) !== "full",
|
|
880
982
|
"is-press-keepalive": Y($) === "full"
|
|
@@ -882,15 +984,15 @@ var qe = ["data-backdrop-mode", "data-held"], Je = ["data-held"], Ye = { class:
|
|
|
882
984
|
inert: Y(H) !== "full" && Y($) !== "full" || void 0,
|
|
883
985
|
tabindex: "-1",
|
|
884
986
|
onKeydown: K
|
|
885
|
-
}, [
|
|
987
|
+
}, [I(Y(p), null, {
|
|
886
988
|
default: Q(() => [J(e.$slots, "default")]),
|
|
887
989
|
_: 3
|
|
888
|
-
})], 42,
|
|
889
|
-
|
|
990
|
+
})], 42, it),
|
|
991
|
+
F("div", {
|
|
890
992
|
ref_key: "summaryEl",
|
|
891
993
|
ref: m,
|
|
892
|
-
id: `${
|
|
893
|
-
class:
|
|
994
|
+
id: `${v}-summary`,
|
|
995
|
+
class: V(["dock-layer dock-layer--summary", {
|
|
894
996
|
"is-active": Y(H) === "summary",
|
|
895
997
|
"is-leaving": Y(U) === "summary"
|
|
896
998
|
}]),
|
|
@@ -899,63 +1001,63 @@ var qe = ["data-backdrop-mode", "data-held"], Je = ["data-held"], Ye = { class:
|
|
|
899
1001
|
tabindex: W.value ? 0 : void 0,
|
|
900
1002
|
"aria-label": W.value ? "Expand dock" : void 0,
|
|
901
1003
|
"aria-expanded": W.value ? "false" : void 0,
|
|
902
|
-
"aria-controls": W.value ? `${
|
|
903
|
-
onFocusin: t[0] ||=
|
|
904
|
-
onKeydown:
|
|
905
|
-
onClick: t[1] ||= (...e) => Y(
|
|
906
|
-
}, [J(e.$slots, "collapsed")], 42,
|
|
907
|
-
e.$slots.search ? (G(),
|
|
1004
|
+
"aria-controls": W.value ? `${v}-full` : void 0,
|
|
1005
|
+
onFocusin: t[0] ||= ce(() => {}, ["stop"]),
|
|
1006
|
+
onKeydown: ne,
|
|
1007
|
+
onClick: t[1] ||= (...e) => Y(O) && Y(O)(...e)
|
|
1008
|
+
}, [J(e.$slots, "collapsed")], 42, at),
|
|
1009
|
+
e.$slots.search ? (G(), P("div", ot, [J(e.$slots, "search")])) : N("", !0)
|
|
908
1010
|
], 512),
|
|
909
|
-
e.$slots["persistent-end"] ? (G(),
|
|
1011
|
+
e.$slots["persistent-end"] ? (G(), P("div", st, [J(e.$slots, "persistent-end")])) : N("", !0)
|
|
910
1012
|
]),
|
|
911
|
-
|
|
1013
|
+
F("div", {
|
|
912
1014
|
ref_key: "statusEl",
|
|
913
1015
|
ref: h,
|
|
914
1016
|
class: "dock-run-status",
|
|
915
1017
|
role: "status",
|
|
916
1018
|
"aria-live": "polite"
|
|
917
1019
|
}, null, 512)
|
|
918
|
-
], 16,
|
|
1020
|
+
], 16, et));
|
|
919
1021
|
}
|
|
920
|
-
}),
|
|
921
|
-
function
|
|
922
|
-
|
|
1022
|
+
}), lt = c("glass-ui:dock-switcher-tablist"), { KEY: ut } = lt;
|
|
1023
|
+
function dt(e) {
|
|
1024
|
+
lt.provide(e);
|
|
923
1025
|
}
|
|
924
|
-
var
|
|
925
|
-
function
|
|
926
|
-
|
|
1026
|
+
var ft = lt.use, pt = s(m, "[glass-ui:dock] <DockLayer> must be used inside <DockCrossfade> (or <DockLayerGroup>)"), { KEY: mt } = pt;
|
|
1027
|
+
function ht(e) {
|
|
1028
|
+
pt.provide(e);
|
|
927
1029
|
}
|
|
928
|
-
var
|
|
1030
|
+
var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
929
1031
|
__name: "DockCrossfade",
|
|
930
1032
|
props: {
|
|
931
1033
|
active: {},
|
|
932
1034
|
reserve: { default: "block" }
|
|
933
1035
|
},
|
|
934
1036
|
setup(e, { expose: t }) {
|
|
935
|
-
let n = e, r = q(null), i = q(/* @__PURE__ */ new Map()), a =
|
|
1037
|
+
let n = e, r = q(null), i = q(/* @__PURE__ */ new Map()), a = j(() => [...i.value.values()].map(({ id: e, label: t, icon: n }) => ({
|
|
936
1038
|
id: e,
|
|
937
1039
|
label: t,
|
|
938
1040
|
icon: n
|
|
939
1041
|
})));
|
|
940
1042
|
function o(e) {
|
|
941
1043
|
let t = new Map(i.value);
|
|
942
|
-
t.set(e.id, e), i.value = t,
|
|
1044
|
+
t.set(e.id, e), i.value = t, p();
|
|
943
1045
|
}
|
|
944
1046
|
function s(e) {
|
|
945
1047
|
if (!i.value.has(e)) return;
|
|
946
1048
|
let t = new Map(i.value);
|
|
947
|
-
t.delete(e), i.value = t,
|
|
1049
|
+
t.delete(e), i.value = t, p();
|
|
948
1050
|
}
|
|
949
|
-
let c =
|
|
950
|
-
|
|
1051
|
+
let c = j(() => n.active), l = q(null);
|
|
1052
|
+
ht({
|
|
951
1053
|
register: o,
|
|
952
1054
|
unregister: s,
|
|
953
1055
|
activeId: c,
|
|
954
1056
|
leavingId: l,
|
|
955
1057
|
faces: a
|
|
956
1058
|
});
|
|
957
|
-
let u = q(0),
|
|
958
|
-
function
|
|
1059
|
+
let u = q(0), f = j(() => n.reserve === "inline" ? "min-inline-size" : "min-block-size");
|
|
1060
|
+
function p() {
|
|
959
1061
|
let e = 0;
|
|
960
1062
|
for (let { el: t } of i.value.values()) {
|
|
961
1063
|
let r = n.reserve === "inline" ? t.scrollWidth : t.scrollHeight;
|
|
@@ -963,79 +1065,79 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
963
1065
|
}
|
|
964
1066
|
e > u.value && (u.value = e);
|
|
965
1067
|
}
|
|
966
|
-
let
|
|
967
|
-
[
|
|
1068
|
+
let m = j(() => u.value > 0 ? {
|
|
1069
|
+
[f.value]: `${u.value}px`,
|
|
968
1070
|
"--dock-crossfade-peak": `${u.value}px`
|
|
969
1071
|
} : void 0);
|
|
970
|
-
|
|
971
|
-
let
|
|
972
|
-
response:
|
|
973
|
-
dampingFraction:
|
|
1072
|
+
b(r, () => p());
|
|
1073
|
+
let h = Ie({
|
|
1074
|
+
response: d.response,
|
|
1075
|
+
dampingFraction: d.dampingFraction
|
|
974
1076
|
});
|
|
975
|
-
function
|
|
1077
|
+
function g(e) {
|
|
976
1078
|
return e ? i.value.get(e)?.el : void 0;
|
|
977
1079
|
}
|
|
978
|
-
function
|
|
979
|
-
|
|
1080
|
+
function _(e, t) {
|
|
1081
|
+
g(e)?.style.setProperty("--dock-t", `${t}`);
|
|
980
1082
|
}
|
|
981
|
-
function
|
|
982
|
-
|
|
1083
|
+
function v(e) {
|
|
1084
|
+
g(e)?.style.removeProperty("--dock-t");
|
|
983
1085
|
}
|
|
984
|
-
function
|
|
1086
|
+
function y(e) {
|
|
985
1087
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
986
1088
|
}
|
|
987
|
-
let x =
|
|
1089
|
+
let x = _e("(prefers-reduced-motion: reduce)"), S = null, C = 1;
|
|
988
1090
|
Z(x, (e) => {
|
|
989
|
-
e && (
|
|
1091
|
+
e && (h.dispose(), S?.());
|
|
990
1092
|
});
|
|
991
1093
|
async function w(e, t) {
|
|
992
1094
|
if (typeof document > "u") return;
|
|
993
|
-
let n =
|
|
994
|
-
!n || !r || !n.contains(r) || (await
|
|
1095
|
+
let n = g(e), r = document.activeElement;
|
|
1096
|
+
!n || !r || !n.contains(r) || (await B(), (g(t) ?? document.body).focus?.());
|
|
995
1097
|
}
|
|
996
1098
|
return Z(c, (e, t) => {
|
|
997
1099
|
if (e === t) return;
|
|
998
|
-
|
|
999
|
-
let n =
|
|
1100
|
+
p();
|
|
1101
|
+
let n = g(e), i = g(t);
|
|
1000
1102
|
if (!n || !i) {
|
|
1001
|
-
l.value = null,
|
|
1103
|
+
l.value = null, v(e), C = 1;
|
|
1002
1104
|
return;
|
|
1003
1105
|
}
|
|
1004
|
-
let a = l.value, o = Number.parseFloat(n.style.getPropertyValue("--dock-t")), s = Number.parseFloat(i.style.getPropertyValue("--dock-t")), c = a === e && Number.isFinite(o) ? 1 -
|
|
1005
|
-
a && a !== e && a !== t &&
|
|
1106
|
+
let a = l.value, o = Number.parseFloat(n.style.getPropertyValue("--dock-t")), s = Number.parseFloat(i.style.getPropertyValue("--dock-t")), c = a === e && Number.isFinite(o) ? 1 - y(o) : 0, u = Number.isFinite(s) ? y(s) : 1;
|
|
1107
|
+
a && a !== e && a !== t && v(a), l.value = t, _(e, c), _(t, 1 - u), w(t, e), r.value?.setAttribute("data-crossfading", "");
|
|
1006
1108
|
let d = () => {
|
|
1007
|
-
|
|
1109
|
+
v(e), v(t), r.value?.removeAttribute("data-crossfading"), l.value = null, C = 1, S === d && (S = null);
|
|
1008
1110
|
};
|
|
1009
1111
|
if (S = d, x.value) {
|
|
1010
1112
|
d();
|
|
1011
1113
|
return;
|
|
1012
1114
|
}
|
|
1013
|
-
let
|
|
1014
|
-
C = 1 - c,
|
|
1015
|
-
inheritVelocityScale:
|
|
1115
|
+
let f = u > .001 ? -C / u : 0;
|
|
1116
|
+
C = 1 - c, h.playTo(0, 1, {
|
|
1117
|
+
inheritVelocityScale: f,
|
|
1016
1118
|
onFrame: (n) => {
|
|
1017
|
-
|
|
1119
|
+
_(e, y(c + (1 - c) * n)), _(t, y(1 - u * (1 - n)));
|
|
1018
1120
|
},
|
|
1019
1121
|
onSettle: d
|
|
1020
1122
|
});
|
|
1021
1123
|
}), H(() => {
|
|
1022
|
-
|
|
1023
|
-
}), t({ faces: a }), (e, t) => (G(),
|
|
1124
|
+
h.dispose(), S = null;
|
|
1125
|
+
}), t({ faces: a }), (e, t) => (G(), P("div", {
|
|
1024
1126
|
ref_key: "rootEl",
|
|
1025
1127
|
ref: r,
|
|
1026
1128
|
class: "dock-crossfade",
|
|
1027
|
-
style:
|
|
1129
|
+
style: te(m.value)
|
|
1028
1130
|
}, [J(e.$slots, "default")], 4));
|
|
1029
1131
|
}
|
|
1030
|
-
}),
|
|
1132
|
+
}), vt = ["data-motion"], yt = ["aria-orientation"], bt = [
|
|
1031
1133
|
"id",
|
|
1032
1134
|
"tabindex",
|
|
1033
1135
|
"aria-controls",
|
|
1034
1136
|
"aria-label",
|
|
1035
1137
|
"onClick"
|
|
1036
|
-
],
|
|
1138
|
+
], xt = { key: 1 }, St = { key: 2 }, Ct = /* @__PURE__ */ L({
|
|
1037
1139
|
__name: "DockLayerGroup",
|
|
1038
|
-
props: /*@__PURE__*/
|
|
1140
|
+
props: /*@__PURE__*/ R({
|
|
1039
1141
|
orientation: {},
|
|
1040
1142
|
showSwitcher: {
|
|
1041
1143
|
type: Boolean,
|
|
@@ -1049,8 +1151,8 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1049
1151
|
}),
|
|
1050
1152
|
emits: ["update:active"],
|
|
1051
1153
|
setup(e) {
|
|
1052
|
-
let t = e, n = o(() => t.motion), r =
|
|
1053
|
-
options:
|
|
1154
|
+
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({
|
|
1155
|
+
options: j(() => c.value.map((e) => ({ value: e.id }))),
|
|
1054
1156
|
model: r,
|
|
1055
1157
|
mode: "single",
|
|
1056
1158
|
role: "tablist",
|
|
@@ -1058,13 +1160,13 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1058
1160
|
containerRef: d,
|
|
1059
1161
|
indicatorRef: f,
|
|
1060
1162
|
buttonRefs: p
|
|
1061
|
-
}), g =
|
|
1062
|
-
|
|
1163
|
+
}), 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)}`;
|
|
1164
|
+
dt({
|
|
1063
1165
|
isTablist: g,
|
|
1064
1166
|
tabId: b,
|
|
1065
1167
|
panelId: x
|
|
1066
1168
|
});
|
|
1067
|
-
let S =
|
|
1169
|
+
let S = j(() => u.value ? "y" : "x");
|
|
1068
1170
|
function C() {
|
|
1069
1171
|
let e = d.value;
|
|
1070
1172
|
if (!e) return [];
|
|
@@ -1077,7 +1179,7 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1077
1179
|
};
|
|
1078
1180
|
});
|
|
1079
1181
|
}
|
|
1080
|
-
let
|
|
1182
|
+
let w = E({
|
|
1081
1183
|
handle: d,
|
|
1082
1184
|
surface: f,
|
|
1083
1185
|
axis: () => S.value,
|
|
@@ -1091,36 +1193,36 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1091
1193
|
l.value,
|
|
1092
1194
|
n.armed.value
|
|
1093
1195
|
], () => {
|
|
1094
|
-
n.armed.value &&
|
|
1196
|
+
n.armed.value && B(() => w.refresh());
|
|
1095
1197
|
}), U(() => {
|
|
1096
|
-
n.armed.value &&
|
|
1198
|
+
n.armed.value && B(() => w.refresh());
|
|
1097
1199
|
});
|
|
1098
1200
|
function D(e) {
|
|
1099
1201
|
return typeof e == "object" && !!e || typeof e == "function";
|
|
1100
1202
|
}
|
|
1101
|
-
let O =
|
|
1102
|
-
function
|
|
1203
|
+
let O = h(() => i);
|
|
1204
|
+
function k() {
|
|
1103
1205
|
O.acquire();
|
|
1104
1206
|
}
|
|
1105
1207
|
function L(e) {
|
|
1106
1208
|
let t = e.relatedTarget, n = e.currentTarget;
|
|
1107
1209
|
t && n?.contains(t) || O.release();
|
|
1108
1210
|
}
|
|
1109
|
-
return (t, i) => (G(),
|
|
1110
|
-
class:
|
|
1211
|
+
return (t, i) => (G(), P("div", {
|
|
1212
|
+
class: V(["dock-layer-group", [a.value, `switcher-${e.switcherPosition}`]]),
|
|
1111
1213
|
"data-motion": Y(n).dataMotion.value,
|
|
1112
|
-
style:
|
|
1113
|
-
}, [g.value ? (G(),
|
|
1214
|
+
style: te(Y(n).hostStyle.value)
|
|
1215
|
+
}, [g.value ? (G(), P("div", {
|
|
1114
1216
|
key: 0,
|
|
1115
1217
|
ref_key: "switcherListEl",
|
|
1116
1218
|
ref: d,
|
|
1117
1219
|
role: "tablist",
|
|
1118
|
-
class:
|
|
1220
|
+
class: V(["dock-layer-switcher", [e.switcherPosition, Y(n).armed.value && "glass-drag-grabbable"]]),
|
|
1119
1221
|
"aria-orientation": l.value,
|
|
1120
|
-
onKeydown: i[0] ||= (...e) => Y(
|
|
1121
|
-
onFocusin:
|
|
1222
|
+
onKeydown: i[0] ||= (...e) => Y(m).onKeydown && Y(m).onKeydown(...e),
|
|
1223
|
+
onFocusin: k,
|
|
1122
1224
|
onFocusout: L
|
|
1123
|
-
}, [(G(!0),
|
|
1225
|
+
}, [(G(!0), P(A, null, re(c.value, (e, t) => (G(), P("button", z({
|
|
1124
1226
|
key: e.id,
|
|
1125
1227
|
ref_for: !0,
|
|
1126
1228
|
ref: (e) => {
|
|
@@ -1129,37 +1231,37 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1129
1231
|
type: "button",
|
|
1130
1232
|
class: "dock-layer-tab",
|
|
1131
1233
|
id: b(e.id),
|
|
1132
|
-
tabindex: Y(
|
|
1133
|
-
}, { ref_for: !0 }, Y(
|
|
1234
|
+
tabindex: Y(m).rovingTabindex(t)
|
|
1235
|
+
}, { ref_for: !0 }, Y(m).itemAttrs(e.id), {
|
|
1134
1236
|
"aria-controls": x(e.id),
|
|
1135
1237
|
"aria-label": e.label ?? e.id,
|
|
1136
|
-
onClick: (n) => Y(
|
|
1137
|
-
}), [D(e.icon) ? (G(),
|
|
1238
|
+
onClick: (n) => Y(m).select(e.id, t)
|
|
1239
|
+
}), [D(e.icon) ? (G(), M(ie(e.icon), {
|
|
1138
1240
|
key: 0,
|
|
1139
1241
|
class: "size-4"
|
|
1140
|
-
})) : typeof e.icon == "string" ? (G(),
|
|
1242
|
+
})) : typeof e.icon == "string" ? (G(), P("span", xt, ae(e.icon), 1)) : (G(), P("span", St, ae((e.label ?? e.id).charAt(0)), 1))], 16, bt))), 128)), F("div", {
|
|
1141
1243
|
ref_key: "switcherIndicatorEl",
|
|
1142
1244
|
ref: f,
|
|
1143
|
-
class:
|
|
1144
|
-
style:
|
|
1245
|
+
class: V(["dock-layer-tab-indicator", Y(n).armed.value && Y(w).dragging.value && "glass-drag-lift"]),
|
|
1246
|
+
style: te(Y(m).singleSliderStyle.value),
|
|
1145
1247
|
"aria-hidden": "true"
|
|
1146
|
-
}, null, 6)], 42,
|
|
1248
|
+
}, null, 6)], 42, yt)) : N("", !0), I(_t, {
|
|
1147
1249
|
ref_key: "crossfade",
|
|
1148
1250
|
ref: s,
|
|
1149
1251
|
active: r.value
|
|
1150
1252
|
}, {
|
|
1151
1253
|
default: Q(() => [J(t.$slots, "default")]),
|
|
1152
1254
|
_: 3
|
|
1153
|
-
}, 8, ["active"])], 14,
|
|
1255
|
+
}, 8, ["active"])], 14, vt));
|
|
1154
1256
|
}
|
|
1155
|
-
}),
|
|
1257
|
+
}), wt = [
|
|
1156
1258
|
"role",
|
|
1157
1259
|
"id",
|
|
1158
1260
|
"aria-labelledby",
|
|
1159
1261
|
"inert",
|
|
1160
1262
|
"aria-hidden",
|
|
1161
1263
|
"tabindex"
|
|
1162
|
-
],
|
|
1264
|
+
], Tt = { class: "dock-face-content" }, Et = /* @__PURE__ */ L({
|
|
1163
1265
|
__name: "DockLayer",
|
|
1164
1266
|
props: {
|
|
1165
1267
|
id: {},
|
|
@@ -1167,7 +1269,7 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1167
1269
|
icon: {}
|
|
1168
1270
|
},
|
|
1169
1271
|
setup(e) {
|
|
1170
|
-
let t = e, n =
|
|
1272
|
+
let t = e, n = gt(), r = X("hostEl");
|
|
1171
1273
|
U(() => {
|
|
1172
1274
|
r.value && n.register({
|
|
1173
1275
|
id: t.id,
|
|
@@ -1187,11 +1289,11 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1187
1289
|
el: r.value
|
|
1188
1290
|
});
|
|
1189
1291
|
}), H(() => n.unregister(t.id));
|
|
1190
|
-
let i =
|
|
1191
|
-
return (e, t) => (G(),
|
|
1292
|
+
let i = j(() => n.activeId.value === t.id), a = j(() => n.leavingId.value === t.id), o = ft(), 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);
|
|
1293
|
+
return (e, t) => (G(), P("div", {
|
|
1192
1294
|
ref_key: "hostEl",
|
|
1193
1295
|
ref: r,
|
|
1194
|
-
class:
|
|
1296
|
+
class: V(["dock-face", {
|
|
1195
1297
|
"is-active": i.value,
|
|
1196
1298
|
"is-leaving": a.value
|
|
1197
1299
|
}]),
|
|
@@ -1201,9 +1303,9 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1201
1303
|
inert: !i.value || void 0,
|
|
1202
1304
|
"aria-hidden": !i.value || void 0,
|
|
1203
1305
|
tabindex: i.value ? -1 : void 0
|
|
1204
|
-
}, [
|
|
1306
|
+
}, [F("div", Tt, [J(e.$slots, "default")])], 10, wt));
|
|
1205
1307
|
}
|
|
1206
|
-
}),
|
|
1308
|
+
}), Dt = /* @__PURE__ */ L({
|
|
1207
1309
|
__name: "DockControl",
|
|
1208
1310
|
props: {
|
|
1209
1311
|
shape: { default: "icon" },
|
|
@@ -1234,13 +1336,14 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1234
1336
|
] }
|
|
1235
1337
|
},
|
|
1236
1338
|
setup(t) {
|
|
1237
|
-
let r = t, o =
|
|
1339
|
+
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(() => ({
|
|
1340
|
+
[y]: "",
|
|
1238
1341
|
...r.active === void 0 ? {} : {
|
|
1239
1342
|
"aria-pressed": String(r.active),
|
|
1240
1343
|
...r.active ? { "data-active": "" } : {}
|
|
1241
1344
|
},
|
|
1242
1345
|
...r.disabled ? { "aria-disabled": "true" } : {}
|
|
1243
|
-
})), l =
|
|
1346
|
+
})), l = j(() => !r.asChild && r.as === "button" ? { type: r.type } : {}), u = i("press"), d = a({
|
|
1244
1347
|
disabled: () => r.disabled || o.value,
|
|
1245
1348
|
squish: !0,
|
|
1246
1349
|
response: u.response,
|
|
@@ -1248,11 +1351,11 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1248
1351
|
pressVar: "--dock-press-t",
|
|
1249
1352
|
shrinkDepth: .04,
|
|
1250
1353
|
maxStretch: 1.03
|
|
1251
|
-
}), f =
|
|
1354
|
+
}), f = j(() => o.value ? {} : { ...d.pressStyle.value });
|
|
1252
1355
|
function p(e) {
|
|
1253
1356
|
r.disabled && (e.preventDefault(), e.stopImmediatePropagation());
|
|
1254
1357
|
}
|
|
1255
|
-
return (e, r) => $((G(),
|
|
1358
|
+
return (e, r) => $((G(), M(Y(ue), z({
|
|
1256
1359
|
as: t.as,
|
|
1257
1360
|
"as-child": t.asChild
|
|
1258
1361
|
}, {
|
|
@@ -1290,7 +1393,7 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1290
1393
|
"onBlur"
|
|
1291
1394
|
])), [[Y(n)]]);
|
|
1292
1395
|
}
|
|
1293
|
-
}),
|
|
1396
|
+
}), Ot = /* @__PURE__ */ L({
|
|
1294
1397
|
inheritAttrs: !1,
|
|
1295
1398
|
__name: "DockTrigger",
|
|
1296
1399
|
props: {
|
|
@@ -1304,28 +1407,69 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1304
1407
|
] }
|
|
1305
1408
|
},
|
|
1306
1409
|
setup(t) {
|
|
1307
|
-
let r = t, i =
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1410
|
+
let r = t, i = { [y]: "" };
|
|
1411
|
+
function a(e) {
|
|
1412
|
+
e.preventDefault(), e.stopImmediatePropagation();
|
|
1413
|
+
}
|
|
1414
|
+
let o = (e, { attrs: t, slots: n }) => {
|
|
1415
|
+
let { disabled: r, ...i } = t, o = r != null && r !== !1;
|
|
1416
|
+
return ee("button", {
|
|
1417
|
+
...i,
|
|
1418
|
+
type: i.type ?? "button",
|
|
1419
|
+
...o ? {
|
|
1420
|
+
"aria-disabled": "true",
|
|
1421
|
+
onClickCapture: a
|
|
1422
|
+
} : {}
|
|
1423
|
+
}, n.default?.());
|
|
1424
|
+
};
|
|
1425
|
+
o.inheritAttrs = !1;
|
|
1426
|
+
let s = j(() => e("dock-trigger", r.for === "select" && "dock-select-trigger", r.for !== "select" && "dock-dropdown-trigger", r.class));
|
|
1427
|
+
return (e, t) => r.for === "select" ? $((G(), M(Y(fe), z({ key: 0 }, {
|
|
1428
|
+
...e.$attrs,
|
|
1429
|
+
...i
|
|
1430
|
+
}, {
|
|
1431
|
+
"as-child": "",
|
|
1432
|
+
class: s.value
|
|
1433
|
+
}), {
|
|
1434
|
+
default: Q(() => [I(o, null, {
|
|
1435
|
+
default: Q(() => [J(e.$slots, "default"), I(Y(de), { "as-child": "" }, {
|
|
1436
|
+
default: Q(() => [J(e.$slots, "icon", {}, () => [I(Y(pe), {
|
|
1437
|
+
class: "dock-select-trigger__chevron",
|
|
1438
|
+
"aria-hidden": "true"
|
|
1439
|
+
})])]),
|
|
1440
|
+
_: 3
|
|
1441
|
+
})]),
|
|
1314
1442
|
_: 3
|
|
1315
1443
|
})]),
|
|
1316
1444
|
_: 3
|
|
1317
|
-
}, 16, ["class"])), [[Y(n)]]) : r.for === "dropdown" ? $((G(),
|
|
1445
|
+
}, 16, ["class"])), [[Y(n)]]) : r.for === "dropdown" ? $((G(), M(w, z({ key: 1 }, {
|
|
1446
|
+
...e.$attrs,
|
|
1447
|
+
...i
|
|
1448
|
+
}, {
|
|
1449
|
+
"as-child": "",
|
|
1318
1450
|
action: "pointerdown",
|
|
1319
|
-
class:
|
|
1451
|
+
class: s.value
|
|
1320
1452
|
}), {
|
|
1321
|
-
default: Q(() => [
|
|
1453
|
+
default: Q(() => [I(o, null, {
|
|
1454
|
+
default: Q(() => [J(e.$slots, "default")]),
|
|
1455
|
+
_: 3
|
|
1456
|
+
})]),
|
|
1322
1457
|
_: 3
|
|
1323
|
-
}, 16, ["class"])), [[Y(n)]]) : $((G(),
|
|
1324
|
-
|
|
1458
|
+
}, 16, ["class"])), [[Y(n)]]) : $((G(), M(Y(le), z({ key: 2 }, {
|
|
1459
|
+
...e.$attrs,
|
|
1460
|
+
...i
|
|
1461
|
+
}, {
|
|
1462
|
+
"as-child": "",
|
|
1463
|
+
class: s.value
|
|
1464
|
+
}), {
|
|
1465
|
+
default: Q(() => [I(o, null, {
|
|
1466
|
+
default: Q(() => [J(e.$slots, "default")]),
|
|
1467
|
+
_: 3
|
|
1468
|
+
})]),
|
|
1325
1469
|
_: 3
|
|
1326
1470
|
}, 16, ["class"])), [[Y(n)]]);
|
|
1327
1471
|
}
|
|
1328
|
-
}),
|
|
1472
|
+
}), kt = /* @__PURE__ */ L({
|
|
1329
1473
|
__name: "DockBackgroundToggle",
|
|
1330
1474
|
props: {
|
|
1331
1475
|
paused: {
|
|
@@ -1337,22 +1481,22 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1337
1481
|
},
|
|
1338
1482
|
emits: ["update:paused"],
|
|
1339
1483
|
setup(e, { emit: t }) {
|
|
1340
|
-
let n = e, r = t, i =
|
|
1484
|
+
let n = e, r = t, i = j(() => n.paused ? n.playLabel : n.pauseLabel);
|
|
1341
1485
|
function a() {
|
|
1342
1486
|
r("update:paused", !n.paused);
|
|
1343
1487
|
}
|
|
1344
|
-
return (t, n) => (G(),
|
|
1488
|
+
return (t, n) => (G(), M(Dt, {
|
|
1345
1489
|
type: "button",
|
|
1346
1490
|
active: e.paused,
|
|
1347
1491
|
"aria-pressed": e.paused,
|
|
1348
1492
|
"aria-label": i.value,
|
|
1349
1493
|
onClick: a
|
|
1350
1494
|
}, {
|
|
1351
|
-
default: Q(() => [e.paused ? (G(),
|
|
1495
|
+
default: Q(() => [e.paused ? (G(), M(Y(he), {
|
|
1352
1496
|
key: 0,
|
|
1353
1497
|
size: 18,
|
|
1354
1498
|
"aria-hidden": "true"
|
|
1355
|
-
})) : (G(),
|
|
1499
|
+
})) : (G(), M(Y(me), {
|
|
1356
1500
|
key: 1,
|
|
1357
1501
|
size: 18,
|
|
1358
1502
|
"aria-hidden": "true"
|
|
@@ -1364,30 +1508,30 @@ var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
|
1364
1508
|
"aria-label"
|
|
1365
1509
|
]));
|
|
1366
1510
|
}
|
|
1367
|
-
}),
|
|
1511
|
+
}), At = [
|
|
1368
1512
|
"data-orientation",
|
|
1369
1513
|
"data-dock-hairline",
|
|
1370
1514
|
"aria-orientation"
|
|
1371
|
-
],
|
|
1515
|
+
], jt = /* @__PURE__ */ L({
|
|
1372
1516
|
__name: "DockSeparator",
|
|
1373
1517
|
props: { anchor: {
|
|
1374
1518
|
type: Boolean,
|
|
1375
1519
|
default: !1
|
|
1376
1520
|
} },
|
|
1377
1521
|
setup(e) {
|
|
1378
|
-
let t =
|
|
1379
|
-
return (t, n) => (G(),
|
|
1380
|
-
class:
|
|
1522
|
+
let t = v(), n = j(() => t?.orientation.value ?? "horizontal"), r = j(() => n.value), i = j(() => n.value === "vertical" ? "horizontal" : "vertical");
|
|
1523
|
+
return (t, n) => (G(), P("div", {
|
|
1524
|
+
class: V(["dock-separator", { "dock-hairline": e.anchor }]),
|
|
1381
1525
|
role: "separator",
|
|
1382
1526
|
"data-orientation": r.value,
|
|
1383
1527
|
"data-dock-hairline": e.anchor || void 0,
|
|
1384
1528
|
"aria-orientation": i.value
|
|
1385
|
-
}, null, 10,
|
|
1529
|
+
}, null, 10, At));
|
|
1386
1530
|
}
|
|
1387
1531
|
});
|
|
1388
1532
|
//#endregion
|
|
1389
1533
|
//#region src/composables/search/match.ts
|
|
1390
|
-
function
|
|
1534
|
+
function Mt(e, t) {
|
|
1391
1535
|
let n = e.length, r = t.length;
|
|
1392
1536
|
if (n === 0) return {
|
|
1393
1537
|
score: 0,
|
|
@@ -1411,11 +1555,11 @@ function Tt(e, t) {
|
|
|
1411
1555
|
matches: i
|
|
1412
1556
|
});
|
|
1413
1557
|
}
|
|
1414
|
-
function
|
|
1558
|
+
function Nt(e, t) {
|
|
1415
1559
|
if (!t) return null;
|
|
1416
1560
|
let n = 0, r = [];
|
|
1417
1561
|
for (let i of e) {
|
|
1418
|
-
let e =
|
|
1562
|
+
let e = Mt(i, t);
|
|
1419
1563
|
if (!e) return null;
|
|
1420
1564
|
n += e.score;
|
|
1421
1565
|
for (let t of e.matches) r.push(t);
|
|
@@ -1425,7 +1569,7 @@ function Et(e, t) {
|
|
|
1425
1569
|
matches: r
|
|
1426
1570
|
};
|
|
1427
1571
|
}
|
|
1428
|
-
function
|
|
1572
|
+
function Pt(e, t) {
|
|
1429
1573
|
let n = null, r = [], i = [
|
|
1430
1574
|
[t._lc.label, 12],
|
|
1431
1575
|
[t._lc.type, 10],
|
|
@@ -1433,7 +1577,7 @@ function Dt(e, t) {
|
|
|
1433
1577
|
];
|
|
1434
1578
|
for (let [a, o] of i) {
|
|
1435
1579
|
if (!a) continue;
|
|
1436
|
-
let i =
|
|
1580
|
+
let i = Nt(e, a);
|
|
1437
1581
|
if (!i) continue;
|
|
1438
1582
|
let s = i.score * o;
|
|
1439
1583
|
(n === null || s > n) && (n = s, r = a === t._lc.label ? i.matches : []);
|
|
@@ -1443,7 +1587,7 @@ function Dt(e, t) {
|
|
|
1443
1587
|
matches: r
|
|
1444
1588
|
};
|
|
1445
1589
|
}
|
|
1446
|
-
function
|
|
1590
|
+
function Ft(e) {
|
|
1447
1591
|
return e.map((e) => ({
|
|
1448
1592
|
item: e,
|
|
1449
1593
|
_lc: {
|
|
@@ -1453,15 +1597,15 @@ function Ot(e) {
|
|
|
1453
1597
|
}
|
|
1454
1598
|
}));
|
|
1455
1599
|
}
|
|
1456
|
-
var
|
|
1457
|
-
function
|
|
1458
|
-
let t =
|
|
1459
|
-
return t || (t = /* @__PURE__ */ new Map(),
|
|
1600
|
+
var It = /* @__PURE__ */ new WeakMap();
|
|
1601
|
+
function Lt(e) {
|
|
1602
|
+
let t = It.get(e);
|
|
1603
|
+
return t || (t = /* @__PURE__ */ new Map(), It.set(e, t)), t;
|
|
1460
1604
|
}
|
|
1461
|
-
function
|
|
1605
|
+
function Rt(e, t, n = 30) {
|
|
1462
1606
|
let r = t.toLowerCase().trim();
|
|
1463
1607
|
if (!r) return [];
|
|
1464
|
-
let i =
|
|
1608
|
+
let i = Lt(e), a = i.get(r);
|
|
1465
1609
|
if (a) return a.slice(0, n);
|
|
1466
1610
|
i.size > 200 && i.clear();
|
|
1467
1611
|
let o = r.split(/\s+/).filter(Boolean);
|
|
@@ -1480,7 +1624,7 @@ function jt(e, t, n = 30) {
|
|
|
1480
1624
|
}
|
|
1481
1625
|
let c = [];
|
|
1482
1626
|
for (let e of s) {
|
|
1483
|
-
let t =
|
|
1627
|
+
let t = Pt(o, e);
|
|
1484
1628
|
t && c.push({
|
|
1485
1629
|
item: e.item,
|
|
1486
1630
|
score: t.score,
|
|
@@ -1489,17 +1633,17 @@ function jt(e, t, n = 30) {
|
|
|
1489
1633
|
}
|
|
1490
1634
|
return c.sort((e, t) => t.score - e.score), i.set(r, c), c.slice(0, n);
|
|
1491
1635
|
}
|
|
1492
|
-
function
|
|
1636
|
+
function zt(e) {
|
|
1493
1637
|
if (e) {
|
|
1494
|
-
|
|
1638
|
+
It.delete(e);
|
|
1495
1639
|
return;
|
|
1496
1640
|
}
|
|
1497
|
-
|
|
1641
|
+
It = /* @__PURE__ */ new WeakMap();
|
|
1498
1642
|
}
|
|
1499
1643
|
//#endregion
|
|
1500
1644
|
//#region src/composables/search/useFuzzySearch.ts
|
|
1501
|
-
function
|
|
1502
|
-
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 =
|
|
1645
|
+
function Bt(e) {
|
|
1646
|
+
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(() => Ft(l.value)), d;
|
|
1503
1647
|
function f(e = d) {
|
|
1504
1648
|
e !== void 0 && (clearTimeout(e), d === e && (d = void 0));
|
|
1505
1649
|
}
|
|
@@ -1515,7 +1659,7 @@ function Nt(e) {
|
|
|
1515
1659
|
}), Z(l, () => {
|
|
1516
1660
|
f(), c.value = i.value, s.value = 0;
|
|
1517
1661
|
}, { deep: !0 });
|
|
1518
|
-
let p =
|
|
1662
|
+
let p = j(() => Rt(u.value, c.value, r));
|
|
1519
1663
|
Z(p, () => {
|
|
1520
1664
|
s.value = 0;
|
|
1521
1665
|
});
|
|
@@ -1523,7 +1667,7 @@ function Nt(e) {
|
|
|
1523
1667
|
e.onSelect?.(t), h();
|
|
1524
1668
|
}
|
|
1525
1669
|
function h() {
|
|
1526
|
-
a.value = !1, o.value = !1, f(), i.value = "", c.value = "", s.value = 0,
|
|
1670
|
+
a.value = !1, o.value = !1, f(), i.value = "", c.value = "", s.value = 0, zt(u.value);
|
|
1527
1671
|
}
|
|
1528
1672
|
function g() {
|
|
1529
1673
|
a.value = !0;
|
|
@@ -1548,7 +1692,7 @@ function Nt(e) {
|
|
|
1548
1692
|
}
|
|
1549
1693
|
}
|
|
1550
1694
|
return W(() => {
|
|
1551
|
-
f(),
|
|
1695
|
+
f(), zt(u.value);
|
|
1552
1696
|
}, !0), {
|
|
1553
1697
|
query: i,
|
|
1554
1698
|
results: p,
|
|
@@ -1564,13 +1708,13 @@ function Nt(e) {
|
|
|
1564
1708
|
}
|
|
1565
1709
|
//#endregion
|
|
1566
1710
|
//#region src/components/dock/composables/useDockSearch.ts
|
|
1567
|
-
function
|
|
1711
|
+
function Vt(e) {
|
|
1568
1712
|
let { dockState: t } = e, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i = q([]), a = null, o = e.items ? e.items : () => i.value;
|
|
1569
1713
|
function s(t) {
|
|
1570
1714
|
let n = t.item.id;
|
|
1571
1715
|
e.ensureTargetWindow?.(n), e.scrollTo?.(n), e.onResultSelect?.(t);
|
|
1572
1716
|
}
|
|
1573
|
-
let c =
|
|
1717
|
+
let c = Bt({
|
|
1574
1718
|
items: o,
|
|
1575
1719
|
debounceMs: n,
|
|
1576
1720
|
maxResults: r,
|
|
@@ -1591,7 +1735,7 @@ function Pt(e) {
|
|
|
1591
1735
|
});
|
|
1592
1736
|
});
|
|
1593
1737
|
}
|
|
1594
|
-
let l =
|
|
1738
|
+
let l = j(() => {
|
|
1595
1739
|
let e = c.query.value;
|
|
1596
1740
|
if (!e) return "";
|
|
1597
1741
|
let t = c.results.value[0];
|
|
@@ -1603,15 +1747,15 @@ function Pt(e) {
|
|
|
1603
1747
|
let e = l.value;
|
|
1604
1748
|
e && (c.query.value = c.query.value + e);
|
|
1605
1749
|
}
|
|
1606
|
-
let d =
|
|
1750
|
+
let d = h(() => t), f = d.isHeld;
|
|
1607
1751
|
function p() {
|
|
1608
1752
|
f.value || (t.expand(), d.acquire(), c.open());
|
|
1609
1753
|
}
|
|
1610
|
-
function
|
|
1754
|
+
function m() {
|
|
1611
1755
|
f.value && (c.close(), d.release());
|
|
1612
1756
|
}
|
|
1613
1757
|
let g = null;
|
|
1614
|
-
return e.collapseOnScroll && e.scrollContainer && (g =
|
|
1758
|
+
return e.collapseOnScroll && e.scrollContainer && (g = k(e.scrollContainer, {
|
|
1615
1759
|
collapseOnScroll: !0,
|
|
1616
1760
|
chromeRef: e.chromeRef
|
|
1617
1761
|
})), W(() => {
|
|
@@ -1621,10 +1765,10 @@ function Pt(e) {
|
|
|
1621
1765
|
autocompleteText: l,
|
|
1622
1766
|
scrollChrome: g,
|
|
1623
1767
|
armSearch: p,
|
|
1624
|
-
disarmSearch:
|
|
1768
|
+
disarmSearch: m,
|
|
1625
1769
|
acceptAutocomplete: u,
|
|
1626
1770
|
isSearchArmed: f
|
|
1627
1771
|
};
|
|
1628
1772
|
}
|
|
1629
1773
|
//#endregion
|
|
1630
|
-
export {
|
|
1774
|
+
export { _ as DOCK_CONTEXT_KEY, kt as DockBackgroundToggle, Dt as DockControl, _t as DockCrossfade, Et as DockLayer, Ct as DockLayerGroup, jt as DockSeparator, Ot as DockTrigger, ct as GlassDock, l as provideDockContext, g as useDockContext, D as useDockCtaReceive, Vt as useDockSearch, v as useOptionalDockContext };
|