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