@mkbabb/glass-ui 10.1.0 → 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 +70 -0
- package/dist/aurora.js +29 -29
- package/dist/{command-C-5xSEJ2.js → command-CatrAsrl.js} +1 -1
- package/dist/command.js +1 -1
- package/dist/components/_shared/overlay/participation.d.ts +13 -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/GlassDock.vue.d.ts +5 -5
- package/dist/components/dock/composables/dockContext.d.ts +16 -2
- 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/components/sheet/styles.css +1 -1
- package/dist/components/skeleton/Skeleton.vue.d.ts +6 -0
- package/dist/content-BhcJH1bI.js +22 -0
- package/dist/data-table-Cs93-uY7.js +511 -0
- package/dist/data-table.js +1 -1
- package/dist/dock.js +631 -479
- package/dist/easing.js +3 -3
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +8 -8
- package/dist/labeled-field.js +1 -1
- package/dist/{menu-BnmCOa3y.js → menu-DaYAZiVW.js} +6 -3
- package/dist/menu.js +1 -1
- package/dist/motion-core.js +11 -11
- package/dist/participation-B7UFdgXB.js +55 -0
- package/dist/{popover-DA87hFBx.js → popover-BdpoE4Ar.js} +9 -4
- package/dist/popover.js +1 -1
- package/dist/{select-fy3vtArm.js → select-BiF0FCZf.js} +26 -24
- package/dist/select.js +1 -1
- package/dist/{sheet-BQJyER59.js → sheet-DmJxgAHc.js} +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-5ChjjWSR.js → slider-5uoY-cLG.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{tabs-rdRXKXxd.js → tabs-C5sC0fBE.js} +1 -1
- package/dist/tabs.js +1 -1
- package/dist/{tooltip-DhTHhtJN.js → tooltip-CZVubnJf.js} +3 -3
- package/dist/tooltip.js +1 -1
- package/package.json +1 -1
- package/dist/content-So3j6SOe.js +0 -18
- package/dist/data-table-Ba_uTfPc.js +0 -493
- package/dist/participation-Di4UHbzk.js +0 -42
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, 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 {
|
|
17
|
-
import { n as
|
|
18
|
-
import { t 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 ye(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 Ce(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 we(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 je(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();
|
|
@@ -175,7 +175,7 @@ function je(e, n = {}) {
|
|
|
175
175
|
height: t.height
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function v(e, t, n, i) {
|
|
179
179
|
let o = e.luma;
|
|
180
180
|
l.value = o;
|
|
181
181
|
let s = o >= r ? "light" : "dark";
|
|
@@ -188,7 +188,7 @@ function je(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,
|
|
@@ -199,67 +199,67 @@ function je(e, n = {}) {
|
|
|
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
201
|
let x = 0;
|
|
202
|
-
function
|
|
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 ?
|
|
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
|
|
209
|
-
f.value || e - x < o ||
|
|
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
|
-
}),
|
|
215
|
-
pause: () =>
|
|
214
|
+
}), T = S(() => e.value, {
|
|
215
|
+
pause: () => w.pause(),
|
|
216
216
|
resume: () => {
|
|
217
217
|
let t = e.value;
|
|
218
|
-
t && c(t) || g() && !f.value &&
|
|
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();
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
|
-
f.value ? (
|
|
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
|
-
|
|
233
|
+
C(), D();
|
|
234
234
|
}
|
|
235
235
|
}, {
|
|
236
236
|
immediate: !0,
|
|
237
237
|
flush: "post"
|
|
238
238
|
});
|
|
239
239
|
function j() {
|
|
240
|
-
A(), k(),
|
|
240
|
+
A(), k(), w.dispose(), T.dispose(), E.stop(), p = null, m = null;
|
|
241
241
|
}
|
|
242
|
-
return
|
|
242
|
+
return W(j), {
|
|
243
243
|
luma: K(l),
|
|
244
244
|
bucket: K(u),
|
|
245
245
|
sample: K(d),
|
|
246
|
-
sampleNow:
|
|
246
|
+
sampleNow: C,
|
|
247
247
|
dispose: j
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
250
|
//#endregion
|
|
251
251
|
//#region src/components/dock/composables/useDockState.ts
|
|
252
|
-
function
|
|
253
|
-
let { collapseDelay: t =
|
|
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
|
}
|
|
257
|
-
let w =
|
|
257
|
+
let w = d.value;
|
|
258
258
|
function T() {
|
|
259
|
-
c() && (
|
|
259
|
+
c() && (d.value = "pinned"), s && w !== d.value && s(d.value, w), w = d.value;
|
|
260
260
|
}
|
|
261
261
|
function E() {
|
|
262
|
-
|
|
262
|
+
m &&= (clearTimeout(m), null);
|
|
263
263
|
}
|
|
264
264
|
function D() {
|
|
265
265
|
b !== null && (cancelAnimationFrame(b), b = null);
|
|
@@ -267,85 +267,85 @@ function Me(e) {
|
|
|
267
267
|
function O() {
|
|
268
268
|
D(), y?.();
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
l() ||
|
|
272
|
-
|
|
270
|
+
function k() {
|
|
271
|
+
l() || h.value > 0 || (E(), m = setTimeout(() => {
|
|
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;
|
|
279
279
|
}
|
|
280
|
-
x ||= (x = !0, E(), C(),
|
|
280
|
+
x ||= (x = !0, E(), C(), d.value = "collapsed", T(), !1);
|
|
281
281
|
}
|
|
282
282
|
function M() {
|
|
283
283
|
if (c()) {
|
|
284
|
-
|
|
284
|
+
d.value = "pinned", T();
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
|
-
E(), C(),
|
|
287
|
+
E(), C(), d.value = "hover", T();
|
|
288
288
|
}
|
|
289
289
|
function N() {
|
|
290
|
-
l() || (E(),
|
|
291
|
-
S = null, !l() &&
|
|
290
|
+
l() || (E(), d.value === "collapsed" && (C(), S = setTimeout(() => {
|
|
291
|
+
S = null, !l() && d.value === "collapsed" && (d.value = "hover", T());
|
|
292
292
|
}, 60)));
|
|
293
293
|
}
|
|
294
294
|
function P(e) {
|
|
295
|
-
if (!l() && (C(),
|
|
296
|
-
if (
|
|
295
|
+
if (!l() && (C(), d.value === "hover")) {
|
|
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
|
}
|
|
303
303
|
}
|
|
304
304
|
function F() {
|
|
305
|
-
l() || (E(),
|
|
305
|
+
l() || (E(), d.value === "collapsed" && (d.value = "hover", T()));
|
|
306
306
|
}
|
|
307
307
|
function I(e) {
|
|
308
|
-
if (l() ||
|
|
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
|
-
l() || (E(), C(),
|
|
313
|
+
l() || (E(), C(), d.value = "pinned", T());
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
|
|
315
|
+
function ee(e = "morph") {
|
|
316
|
+
h.value++, e === "grasp" && g.value++, E();
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
e === "grasp" && (
|
|
320
|
-
|
|
318
|
+
function R(e = "morph") {
|
|
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
|
+
h.value === 0 && d.value === "hover" && k();
|
|
321
321
|
}, Math.min(t, 800)));
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
if (l() ||
|
|
323
|
+
function z(e) {
|
|
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
|
-
return Z(
|
|
328
|
+
return Z(f, (e) => {
|
|
329
329
|
if (e) {
|
|
330
330
|
if (typeof document > "u") return;
|
|
331
331
|
O(), b = requestAnimationFrame(() => {
|
|
332
|
-
b = null,
|
|
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();
|
|
337
|
-
}, { immediate: !0 }), typeof r == "boolean" ? r && (
|
|
337
|
+
}, { immediate: !0 }), typeof r == "boolean" ? r && (d.value = "pinned", T()) : Z(r, (e) => {
|
|
338
338
|
if (e) {
|
|
339
|
-
E(),
|
|
339
|
+
E(), d.value = "pinned", T();
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
|
|
343
|
-
}),
|
|
342
|
+
d.value = "collapsed", T();
|
|
343
|
+
}), ne(() => {
|
|
344
344
|
E(), C(), O();
|
|
345
345
|
}), {
|
|
346
|
-
state:
|
|
347
|
-
expanded:
|
|
348
|
-
isPinned:
|
|
346
|
+
state: d,
|
|
347
|
+
expanded: f,
|
|
348
|
+
isPinned: p,
|
|
349
349
|
isHeld: _,
|
|
350
350
|
graspHeld: v,
|
|
351
351
|
onMouseEnter: N,
|
|
@@ -353,15 +353,15 @@ function Me(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 Ne(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 Ne(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 Pe(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 W(() => {
|
|
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 Pe(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 Ie(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;
|
|
@@ -570,7 +643,7 @@ function Re(e) {
|
|
|
570
643
|
}
|
|
571
644
|
e.stopPropagation(), e.preventDefault(), r = null;
|
|
572
645
|
}
|
|
573
|
-
return
|
|
646
|
+
return H(() => {
|
|
574
647
|
f(), u();
|
|
575
648
|
}), {
|
|
576
649
|
onPointerDownCapture: _,
|
|
@@ -582,93 +655,109 @@ function Re(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
|
-
function
|
|
599
|
-
return e.
|
|
671
|
+
function Je(e) {
|
|
672
|
+
return e.hasAttribute(y);
|
|
600
673
|
}
|
|
601
|
-
function
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
674
|
+
function Ye(e) {
|
|
675
|
+
return Ke(e).filter(Je);
|
|
676
|
+
}
|
|
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
|
|
605
686
|
});
|
|
606
|
-
function
|
|
687
|
+
function o() {
|
|
607
688
|
return r.value === "vertical";
|
|
608
689
|
}
|
|
609
|
-
function
|
|
610
|
-
return
|
|
690
|
+
function s(e) {
|
|
691
|
+
return o() ? e.scrollTop : e.scrollLeft;
|
|
611
692
|
}
|
|
612
|
-
function
|
|
613
|
-
|
|
693
|
+
function c(e, t) {
|
|
694
|
+
o() ? e.scrollTop = t : e.scrollLeft = t;
|
|
614
695
|
}
|
|
615
|
-
function
|
|
616
|
-
return
|
|
617
|
-
}
|
|
618
|
-
function l(e, t) {
|
|
619
|
-
let n = Be(e), r = n.indexOf(t);
|
|
620
|
-
if (r < 0) return o(e);
|
|
621
|
-
let i = ze(e, "--dock-pitch");
|
|
622
|
-
if (i <= 0) return o(e);
|
|
623
|
-
let a = Math.max(1, ze(e, "--dock-open-pitches")), s = Ve(n), l = s >= 0 && s < r ? (a - 1) * i : 0, u = r * i + l - i / 2;
|
|
624
|
-
return Math.min(Math.max(u, 0), c(e));
|
|
696
|
+
function l(e) {
|
|
697
|
+
return o() ? e.scrollHeight - e.clientHeight : e.scrollWidth - e.clientWidth;
|
|
625
698
|
}
|
|
626
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) {
|
|
627
708
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
628
|
-
return
|
|
709
|
+
return o() ? r.top < n.top - 1 || r.bottom > n.bottom + 1 : r.left < n.left - 1 || r.right > n.right + 1;
|
|
629
710
|
}
|
|
630
|
-
function
|
|
711
|
+
function p(e) {
|
|
631
712
|
let t = n.value;
|
|
632
713
|
if (!t) return;
|
|
633
|
-
let r =
|
|
714
|
+
let r = Je(e) ? e : e.querySelector(C) ?? e, i = r.getAttribute("aria-label") ?? r.getAttribute("title") ?? r.textContent?.trim();
|
|
634
715
|
i && (t.textContent = i);
|
|
635
716
|
}
|
|
636
|
-
function
|
|
717
|
+
function m(e) {
|
|
637
718
|
let n = t.value;
|
|
638
|
-
if (!n || (
|
|
639
|
-
let r =
|
|
640
|
-
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) => {
|
|
641
722
|
let n = t.value;
|
|
642
|
-
n &&
|
|
723
|
+
n && c(n, r + (i - r) * e);
|
|
643
724
|
} });
|
|
644
725
|
}
|
|
645
|
-
|
|
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() {
|
|
646
736
|
let e = t.value;
|
|
647
737
|
if (!e) return;
|
|
648
|
-
|
|
738
|
+
i.value = Qe(e);
|
|
739
|
+
for (let t of Ke(e)) Je(t) || _(t);
|
|
740
|
+
let n = Ye(e);
|
|
649
741
|
if (n.length === 0) return;
|
|
650
|
-
let r =
|
|
742
|
+
let r = qe(n), a = n.findIndex((e) => e.contains(document.activeElement)), o = a >= 0 ? a : r >= 0 ? r : 0;
|
|
651
743
|
n.forEach((e, t) => {
|
|
652
|
-
|
|
653
|
-
n && (n.tabIndex = t === a ? 0 : -1);
|
|
744
|
+
g(e, t === o ? 0 : -1);
|
|
654
745
|
});
|
|
655
746
|
}
|
|
656
|
-
function
|
|
747
|
+
function b(e, t) {
|
|
657
748
|
let n = e[t];
|
|
658
|
-
|
|
659
|
-
let r = He(n);
|
|
660
|
-
r && (p(n), r.tabIndex = 0, r.focus({ preventScroll: !0 }), m());
|
|
749
|
+
n && (m(n), g(n, 0), n.focus({ preventScroll: !0 }), v());
|
|
661
750
|
}
|
|
662
|
-
function
|
|
751
|
+
function x(e) {
|
|
663
752
|
let n = t.value;
|
|
664
753
|
if (!n) return;
|
|
665
|
-
let r =
|
|
754
|
+
let r = Ye(n);
|
|
666
755
|
if (r.length === 0) return;
|
|
667
756
|
let i = r.findIndex((t) => t.contains(e.target));
|
|
668
757
|
if (i < 0) return;
|
|
669
|
-
let [
|
|
758
|
+
let [a, s] = o() ? ["ArrowUp", "ArrowDown"] : ["ArrowLeft", "ArrowRight"], c;
|
|
670
759
|
switch (e.key) {
|
|
671
|
-
case
|
|
760
|
+
case a:
|
|
672
761
|
c = i - 1;
|
|
673
762
|
break;
|
|
674
763
|
case s:
|
|
@@ -682,41 +771,55 @@ function Ue(e) {
|
|
|
682
771
|
break;
|
|
683
772
|
default: return;
|
|
684
773
|
}
|
|
685
|
-
c < 0 || c >= r.length || (e.preventDefault(),
|
|
774
|
+
c < 0 || c >= r.length || (e.preventDefault(), b(r, c));
|
|
686
775
|
}
|
|
687
|
-
function
|
|
776
|
+
function S(e) {
|
|
688
777
|
let n = t.value;
|
|
689
778
|
if (!n) return;
|
|
690
|
-
let r =
|
|
691
|
-
r &&
|
|
779
|
+
let r = Ke(n).find((t) => t.contains(e.target));
|
|
780
|
+
r && m(r);
|
|
692
781
|
}
|
|
693
|
-
let
|
|
694
|
-
|
|
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);
|
|
787
|
+
}
|
|
788
|
+
return U(() => {
|
|
695
789
|
let e = t.value;
|
|
696
|
-
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, {
|
|
697
793
|
childList: !0,
|
|
698
794
|
subtree: !0,
|
|
699
795
|
attributes: !0,
|
|
700
|
-
attributeFilter: [
|
|
796
|
+
attributeFilter: [
|
|
797
|
+
"aria-current",
|
|
798
|
+
y,
|
|
799
|
+
"aria-hidden",
|
|
800
|
+
"tabindex"
|
|
801
|
+
]
|
|
701
802
|
}));
|
|
702
|
-
}),
|
|
803
|
+
}), ne(() => {
|
|
703
804
|
let e = t.value;
|
|
704
|
-
e?.removeEventListener("keydown",
|
|
705
|
-
}), Z(r, () =>
|
|
706
|
-
reach:
|
|
707
|
-
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
|
|
708
810
|
};
|
|
709
811
|
}
|
|
710
812
|
//#endregion
|
|
711
813
|
//#region src/components/dock/GlassDock.vue?vue&type=script&setup=true&lang.ts
|
|
712
|
-
var
|
|
814
|
+
var et = ["data-backdrop-mode", "data-held"], tt = ["data-held"], nt = { class: "dock-controls" }, rt = {
|
|
713
815
|
key: 0,
|
|
714
816
|
class: "dock-persistent"
|
|
715
|
-
},
|
|
817
|
+
}, it = [
|
|
716
818
|
"id",
|
|
819
|
+
"role",
|
|
717
820
|
"aria-orientation",
|
|
718
821
|
"inert"
|
|
719
|
-
],
|
|
822
|
+
], at = [
|
|
720
823
|
"id",
|
|
721
824
|
"inert",
|
|
722
825
|
"role",
|
|
@@ -724,13 +827,13 @@ var We = ["data-backdrop-mode", "data-held"], Ge = ["data-held"], Ke = { class:
|
|
|
724
827
|
"aria-label",
|
|
725
828
|
"aria-expanded",
|
|
726
829
|
"aria-controls"
|
|
727
|
-
],
|
|
830
|
+
], ot = {
|
|
728
831
|
key: 0,
|
|
729
832
|
class: "dock-search-field"
|
|
730
|
-
},
|
|
833
|
+
}, st = {
|
|
731
834
|
key: 1,
|
|
732
835
|
class: "dock-persistent dock-persistent-end"
|
|
733
|
-
},
|
|
836
|
+
}, ct = /* @__PURE__ */ L({
|
|
734
837
|
inheritAttrs: !1,
|
|
735
838
|
__name: "GlassDock",
|
|
736
839
|
props: {
|
|
@@ -745,81 +848,85 @@ var We = ["data-backdrop-mode", "data-held"], Ge = ["data-held"], Ke = { class:
|
|
|
745
848
|
backgroundCanvas: {}
|
|
746
849
|
},
|
|
747
850
|
setup(e, { expose: t }) {
|
|
748
|
-
let n = e, { startCollapsed: r, shape: i, orientation: a, alwaysExpanded: o, fitContent: s } =
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
statusEl: 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,
|
|
853
|
+
statusEl: h,
|
|
752
854
|
orientation: a
|
|
753
|
-
})
|
|
855
|
+
});
|
|
856
|
+
n.backdropMode === "live" && Pe(c, { backgroundCanvas: () => {
|
|
754
857
|
let e = n.backgroundCanvas;
|
|
755
858
|
return typeof e == "function" ? e() : e instanceof HTMLCanvasElement ? e : null;
|
|
756
859
|
} });
|
|
757
|
-
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({
|
|
758
861
|
rootEl: c,
|
|
759
862
|
alwaysExpanded: o,
|
|
760
863
|
initialExpanded: !r.value,
|
|
761
|
-
isTransitioning:
|
|
762
|
-
dockId:
|
|
763
|
-
});
|
|
764
|
-
|
|
765
|
-
id:
|
|
864
|
+
isTransitioning: _,
|
|
865
|
+
dockId: v
|
|
866
|
+
}), R = j(() => o.value || y.value);
|
|
867
|
+
l({
|
|
868
|
+
id: v,
|
|
766
869
|
orientation: a,
|
|
767
|
-
keepOpen:
|
|
768
|
-
release:
|
|
769
|
-
held:
|
|
870
|
+
keepOpen: k,
|
|
871
|
+
release: M,
|
|
872
|
+
held: S,
|
|
873
|
+
expanded: R
|
|
770
874
|
});
|
|
771
|
-
let
|
|
772
|
-
Ie({
|
|
875
|
+
let { measure: te } = He({
|
|
773
876
|
rootEl: c,
|
|
774
|
-
contentEl:
|
|
775
|
-
expandedEl:
|
|
776
|
-
collapsedEl:
|
|
777
|
-
axis: a
|
|
778
|
-
|
|
779
|
-
});
|
|
780
|
-
let { outerCurrentLayer: B, outerLeavingLayer: V } = Pe({
|
|
877
|
+
contentEl: u,
|
|
878
|
+
expandedEl: d,
|
|
879
|
+
collapsedEl: m,
|
|
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
|
-
|
|
794
|
-
F(), await R();
|
|
795
|
-
let n = f.value;
|
|
796
|
-
n && !n.hasAttribute("inert") && n.focus({ preventScroll: !0 });
|
|
894
|
+
let t = e.target?.closest?.(f);
|
|
895
|
+
t && d.value?.contains(t) || ee();
|
|
797
896
|
}
|
|
798
|
-
|
|
897
|
+
Z(R, async (e, t) => {
|
|
898
|
+
if (!t || e) return;
|
|
899
|
+
let n = document.activeElement;
|
|
900
|
+
if (!(n && d.value?.contains(n) || n?.closest("[data-glass-dock-face]")?.getAttribute("data-glass-dock-owner") === v)) return;
|
|
901
|
+
await B();
|
|
902
|
+
let r = m.value;
|
|
903
|
+
r && !r.hasAttribute("inert") && r.focus({ preventScroll: !0 });
|
|
904
|
+
});
|
|
905
|
+
let { onPointerDownCapture: re, onPointerCancelCapture: ie, onClickCapture: ae, markExpandFlip: se, pressKeepaliveLayer: $ } = We({
|
|
799
906
|
rootEl: c,
|
|
800
|
-
visualExpanded:
|
|
907
|
+
visualExpanded: R
|
|
801
908
|
});
|
|
802
|
-
Z(
|
|
803
|
-
e &&
|
|
909
|
+
Z(R, (e) => {
|
|
910
|
+
e && se();
|
|
804
911
|
});
|
|
805
|
-
let
|
|
806
|
-
Z(
|
|
807
|
-
e && (
|
|
912
|
+
let le = q(!1);
|
|
913
|
+
Z(S, (e) => {
|
|
914
|
+
e && (le.value = !0);
|
|
808
915
|
});
|
|
809
|
-
function
|
|
810
|
-
e.propertyName === "opacity" && !
|
|
916
|
+
function ue(e) {
|
|
917
|
+
e.propertyName === "opacity" && !S.value && (le.value = !1);
|
|
811
918
|
}
|
|
812
919
|
return t({
|
|
813
|
-
expanded:
|
|
814
|
-
isPinned:
|
|
815
|
-
isHeld:
|
|
816
|
-
graspHeld:
|
|
817
|
-
isTransitioning:
|
|
818
|
-
expand:
|
|
819
|
-
collapse:
|
|
820
|
-
keepOpen:
|
|
821
|
-
release:
|
|
822
|
-
}), (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({
|
|
823
930
|
ref_key: "dockEl",
|
|
824
931
|
ref: c
|
|
825
932
|
}, e.$attrs, {
|
|
@@ -827,104 +934,107 @@ var We = ["data-backdrop-mode", "data-held"], Ge = ["data-held"], Ke = { class:
|
|
|
827
934
|
Y(a),
|
|
828
935
|
`shape-${Y(i)}`,
|
|
829
936
|
{
|
|
830
|
-
expanded:
|
|
831
|
-
collapsed: !
|
|
832
|
-
pinned: Y(
|
|
937
|
+
expanded: R.value,
|
|
938
|
+
collapsed: !R.value,
|
|
939
|
+
pinned: Y(b),
|
|
833
940
|
"fit-content": Y(s),
|
|
834
941
|
"always-expanded": Y(o)
|
|
835
942
|
}
|
|
836
943
|
]],
|
|
837
944
|
"data-backdrop-mode": n.backdropMode,
|
|
838
|
-
"data-held": Y(
|
|
839
|
-
onMouseenter: t[2] ||= (...e) => Y(
|
|
840
|
-
onMouseleave: t[3] ||= (e) => Y(
|
|
841
|
-
onFocusin: t[4] ||= (...e) => Y(
|
|
842
|
-
onFocusout: t[5] ||= (...e) => Y(
|
|
843
|
-
onPointerdownCapture: t[6] ||= (...e) => Y(
|
|
844
|
-
onPointercancelCapture: t[7] ||= (...e) => Y(
|
|
845
|
-
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)
|
|
846
953
|
}), [
|
|
847
|
-
|
|
954
|
+
F("div", {
|
|
848
955
|
class: "dock-plate",
|
|
849
956
|
"aria-hidden": "true",
|
|
850
|
-
"data-held": Y(
|
|
851
|
-
}, [
|
|
957
|
+
"data-held": Y(S) || void 0
|
|
958
|
+
}, [le.value ? (G(), P(A, { key: 0 }, [t[9] ||= F("span", {
|
|
852
959
|
class: "glass-grasp-carrier",
|
|
853
960
|
"data-grasp": "rest"
|
|
854
|
-
}, null, -1),
|
|
961
|
+
}, null, -1), F("span", {
|
|
855
962
|
class: "glass-grasp-carrier",
|
|
856
963
|
"data-grasp": "grasp",
|
|
857
|
-
onTransitionend:
|
|
858
|
-
}, null, 32)], 64)) :
|
|
859
|
-
|
|
860
|
-
e.$slots.persistent ? (G(),
|
|
861
|
-
|
|
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", {
|
|
862
969
|
ref_key: "layersEl",
|
|
863
|
-
ref:
|
|
970
|
+
ref: u,
|
|
864
971
|
class: "dock-layers"
|
|
865
972
|
}, [
|
|
866
|
-
|
|
973
|
+
F("div", {
|
|
867
974
|
ref_key: "fullEl",
|
|
868
|
-
ref:
|
|
869
|
-
id: `${
|
|
870
|
-
role: "toolbar",
|
|
871
|
-
"aria-orientation": Y(a),
|
|
872
|
-
class:
|
|
873
|
-
"is-active": Y(
|
|
874
|
-
"is-leaving": Y(
|
|
875
|
-
"is-press-keepalive": Y(
|
|
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", {
|
|
980
|
+
"is-active": Y(H) === "full",
|
|
981
|
+
"is-leaving": Y(U) === "full" || Y($) === "full" && Y(H) !== "full",
|
|
982
|
+
"is-press-keepalive": Y($) === "full"
|
|
876
983
|
}]),
|
|
877
|
-
inert: Y(
|
|
984
|
+
inert: Y(H) !== "full" && Y($) !== "full" || void 0,
|
|
878
985
|
tabindex: "-1",
|
|
879
|
-
onKeydown:
|
|
880
|
-
}, [
|
|
881
|
-
|
|
986
|
+
onKeydown: K
|
|
987
|
+
}, [I(Y(p), null, {
|
|
988
|
+
default: Q(() => [J(e.$slots, "default")]),
|
|
989
|
+
_: 3
|
|
990
|
+
})], 42, it),
|
|
991
|
+
F("div", {
|
|
882
992
|
ref_key: "summaryEl",
|
|
883
|
-
ref:
|
|
884
|
-
id: `${
|
|
885
|
-
class:
|
|
886
|
-
"is-active": Y(
|
|
887
|
-
"is-leaving": Y(
|
|
993
|
+
ref: m,
|
|
994
|
+
id: `${v}-summary`,
|
|
995
|
+
class: V(["dock-layer dock-layer--summary", {
|
|
996
|
+
"is-active": Y(H) === "summary",
|
|
997
|
+
"is-leaving": Y(U) === "summary"
|
|
888
998
|
}]),
|
|
889
|
-
inert: Y(
|
|
890
|
-
role:
|
|
891
|
-
tabindex:
|
|
892
|
-
"aria-label":
|
|
893
|
-
"aria-expanded":
|
|
894
|
-
"aria-controls":
|
|
895
|
-
onFocusin: t[0] ||=
|
|
896
|
-
onKeydown:
|
|
897
|
-
onClick: t[1] ||= (...e) => Y(
|
|
898
|
-
}, [J(e.$slots, "collapsed")], 42,
|
|
899
|
-
e.$slots.search ? (G(),
|
|
999
|
+
inert: Y(H) !== "summary" || void 0,
|
|
1000
|
+
role: W.value ? "button" : void 0,
|
|
1001
|
+
tabindex: W.value ? 0 : void 0,
|
|
1002
|
+
"aria-label": W.value ? "Expand dock" : void 0,
|
|
1003
|
+
"aria-expanded": W.value ? "false" : void 0,
|
|
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)
|
|
900
1010
|
], 512),
|
|
901
|
-
e.$slots["persistent-end"] ? (G(),
|
|
1011
|
+
e.$slots["persistent-end"] ? (G(), P("div", st, [J(e.$slots, "persistent-end")])) : N("", !0)
|
|
902
1012
|
]),
|
|
903
|
-
|
|
1013
|
+
F("div", {
|
|
904
1014
|
ref_key: "statusEl",
|
|
905
|
-
ref:
|
|
1015
|
+
ref: h,
|
|
906
1016
|
class: "dock-run-status",
|
|
907
1017
|
role: "status",
|
|
908
1018
|
"aria-live": "polite"
|
|
909
1019
|
}, null, 512)
|
|
910
|
-
], 16,
|
|
1020
|
+
], 16, et));
|
|
911
1021
|
}
|
|
912
|
-
}),
|
|
913
|
-
function
|
|
914
|
-
|
|
1022
|
+
}), lt = c("glass-ui:dock-switcher-tablist"), { KEY: ut } = lt;
|
|
1023
|
+
function dt(e) {
|
|
1024
|
+
lt.provide(e);
|
|
915
1025
|
}
|
|
916
|
-
var
|
|
917
|
-
function
|
|
918
|
-
|
|
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);
|
|
919
1029
|
}
|
|
920
|
-
var
|
|
1030
|
+
var gt = pt.use, _t = /* @__PURE__ */ L({
|
|
921
1031
|
__name: "DockCrossfade",
|
|
922
1032
|
props: {
|
|
923
1033
|
active: {},
|
|
924
1034
|
reserve: { default: "block" }
|
|
925
1035
|
},
|
|
926
1036
|
setup(e, { expose: t }) {
|
|
927
|
-
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 }) => ({
|
|
928
1038
|
id: e,
|
|
929
1039
|
label: t,
|
|
930
1040
|
icon: n
|
|
@@ -938,15 +1048,15 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
938
1048
|
let t = new Map(i.value);
|
|
939
1049
|
t.delete(e), i.value = t, p();
|
|
940
1050
|
}
|
|
941
|
-
let c =
|
|
942
|
-
|
|
1051
|
+
let c = j(() => n.active), l = q(null);
|
|
1052
|
+
ht({
|
|
943
1053
|
register: o,
|
|
944
1054
|
unregister: s,
|
|
945
1055
|
activeId: c,
|
|
946
1056
|
leavingId: l,
|
|
947
1057
|
faces: a
|
|
948
1058
|
});
|
|
949
|
-
let u = q(0),
|
|
1059
|
+
let u = q(0), f = j(() => n.reserve === "inline" ? "min-inline-size" : "min-block-size");
|
|
950
1060
|
function p() {
|
|
951
1061
|
let e = 0;
|
|
952
1062
|
for (let { el: t } of i.value.values()) {
|
|
@@ -955,14 +1065,14 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
955
1065
|
}
|
|
956
1066
|
e > u.value && (u.value = e);
|
|
957
1067
|
}
|
|
958
|
-
let m =
|
|
959
|
-
[
|
|
1068
|
+
let m = j(() => u.value > 0 ? {
|
|
1069
|
+
[f.value]: `${u.value}px`,
|
|
960
1070
|
"--dock-crossfade-peak": `${u.value}px`
|
|
961
1071
|
} : void 0);
|
|
962
|
-
|
|
963
|
-
let h =
|
|
964
|
-
response:
|
|
965
|
-
dampingFraction:
|
|
1072
|
+
b(r, () => p());
|
|
1073
|
+
let h = Ie({
|
|
1074
|
+
response: d.response,
|
|
1075
|
+
dampingFraction: d.dampingFraction
|
|
966
1076
|
});
|
|
967
1077
|
function g(e) {
|
|
968
1078
|
return e ? i.value.get(e)?.el : void 0;
|
|
@@ -970,33 +1080,33 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
970
1080
|
function _(e, t) {
|
|
971
1081
|
g(e)?.style.setProperty("--dock-t", `${t}`);
|
|
972
1082
|
}
|
|
973
|
-
function
|
|
1083
|
+
function v(e) {
|
|
974
1084
|
g(e)?.style.removeProperty("--dock-t");
|
|
975
1085
|
}
|
|
976
|
-
function
|
|
1086
|
+
function y(e) {
|
|
977
1087
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
978
1088
|
}
|
|
979
|
-
let x =
|
|
1089
|
+
let x = _e("(prefers-reduced-motion: reduce)"), S = null, C = 1;
|
|
980
1090
|
Z(x, (e) => {
|
|
981
1091
|
e && (h.dispose(), S?.());
|
|
982
1092
|
});
|
|
983
1093
|
async function w(e, t) {
|
|
984
1094
|
if (typeof document > "u") return;
|
|
985
1095
|
let n = g(e), r = document.activeElement;
|
|
986
|
-
!n || !r || !n.contains(r) || (await
|
|
1096
|
+
!n || !r || !n.contains(r) || (await B(), (g(t) ?? document.body).focus?.());
|
|
987
1097
|
}
|
|
988
1098
|
return Z(c, (e, t) => {
|
|
989
1099
|
if (e === t) return;
|
|
990
1100
|
p();
|
|
991
1101
|
let n = g(e), i = g(t);
|
|
992
1102
|
if (!n || !i) {
|
|
993
|
-
l.value = null,
|
|
1103
|
+
l.value = null, v(e), C = 1;
|
|
994
1104
|
return;
|
|
995
1105
|
}
|
|
996
|
-
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 -
|
|
997
|
-
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", "");
|
|
998
1108
|
let d = () => {
|
|
999
|
-
|
|
1109
|
+
v(e), v(t), r.value?.removeAttribute("data-crossfading"), l.value = null, C = 1, S === d && (S = null);
|
|
1000
1110
|
};
|
|
1001
1111
|
if (S = d, x.value) {
|
|
1002
1112
|
d();
|
|
@@ -1006,28 +1116,28 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1006
1116
|
C = 1 - c, h.playTo(0, 1, {
|
|
1007
1117
|
inheritVelocityScale: f,
|
|
1008
1118
|
onFrame: (n) => {
|
|
1009
|
-
_(e,
|
|
1119
|
+
_(e, y(c + (1 - c) * n)), _(t, y(1 - u * (1 - n)));
|
|
1010
1120
|
},
|
|
1011
1121
|
onSettle: d
|
|
1012
1122
|
});
|
|
1013
|
-
}),
|
|
1123
|
+
}), H(() => {
|
|
1014
1124
|
h.dispose(), S = null;
|
|
1015
|
-
}), t({ faces: a }), (e, t) => (G(),
|
|
1125
|
+
}), t({ faces: a }), (e, t) => (G(), P("div", {
|
|
1016
1126
|
ref_key: "rootEl",
|
|
1017
1127
|
ref: r,
|
|
1018
1128
|
class: "dock-crossfade",
|
|
1019
|
-
style:
|
|
1129
|
+
style: te(m.value)
|
|
1020
1130
|
}, [J(e.$slots, "default")], 4));
|
|
1021
1131
|
}
|
|
1022
|
-
}),
|
|
1132
|
+
}), vt = ["data-motion"], yt = ["aria-orientation"], bt = [
|
|
1023
1133
|
"id",
|
|
1024
1134
|
"tabindex",
|
|
1025
1135
|
"aria-controls",
|
|
1026
1136
|
"aria-label",
|
|
1027
1137
|
"onClick"
|
|
1028
|
-
],
|
|
1138
|
+
], xt = { key: 1 }, St = { key: 2 }, Ct = /* @__PURE__ */ L({
|
|
1029
1139
|
__name: "DockLayerGroup",
|
|
1030
|
-
props: /*@__PURE__*/
|
|
1140
|
+
props: /*@__PURE__*/ R({
|
|
1031
1141
|
orientation: {},
|
|
1032
1142
|
showSwitcher: {
|
|
1033
1143
|
type: Boolean,
|
|
@@ -1041,39 +1151,39 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1041
1151
|
}),
|
|
1042
1152
|
emits: ["update:active"],
|
|
1043
1153
|
setup(e) {
|
|
1044
|
-
let t = e, n = o(() => t.motion), r =
|
|
1045
|
-
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 }))),
|
|
1046
1156
|
model: r,
|
|
1047
1157
|
mode: "single",
|
|
1048
1158
|
role: "tablist",
|
|
1049
1159
|
vertical: u,
|
|
1050
1160
|
containerRef: d,
|
|
1051
1161
|
indicatorRef: f,
|
|
1052
|
-
buttonRefs:
|
|
1053
|
-
}),
|
|
1054
|
-
|
|
1055
|
-
isTablist:
|
|
1162
|
+
buttonRefs: p
|
|
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({
|
|
1165
|
+
isTablist: g,
|
|
1056
1166
|
tabId: b,
|
|
1057
1167
|
panelId: x
|
|
1058
1168
|
});
|
|
1059
|
-
let
|
|
1060
|
-
function
|
|
1169
|
+
let S = j(() => u.value ? "y" : "x");
|
|
1170
|
+
function C() {
|
|
1061
1171
|
let e = d.value;
|
|
1062
1172
|
if (!e) return [];
|
|
1063
1173
|
let t = Array.from(e.querySelectorAll(".dock-layer-tab"));
|
|
1064
1174
|
return c.value.map((e, n) => {
|
|
1065
|
-
let r = t[n]?.getBoundingClientRect(), i = r ?
|
|
1175
|
+
let r = t[n]?.getBoundingClientRect(), i = r ? S.value === "y" ? r.top + r.height / 2 : r.left + r.width / 2 : 0;
|
|
1066
1176
|
return {
|
|
1067
1177
|
value: e.id,
|
|
1068
1178
|
center: i
|
|
1069
1179
|
};
|
|
1070
1180
|
});
|
|
1071
1181
|
}
|
|
1072
|
-
let
|
|
1182
|
+
let w = E({
|
|
1073
1183
|
handle: d,
|
|
1074
1184
|
surface: f,
|
|
1075
|
-
axis: () =>
|
|
1076
|
-
snapTargets:
|
|
1185
|
+
axis: () => S.value,
|
|
1186
|
+
snapTargets: C,
|
|
1077
1187
|
onSnap: (e) => {
|
|
1078
1188
|
n.armed.value && r.value !== e && (r.value = e);
|
|
1079
1189
|
}
|
|
@@ -1083,75 +1193,75 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1083
1193
|
l.value,
|
|
1084
1194
|
n.armed.value
|
|
1085
1195
|
], () => {
|
|
1086
|
-
n.armed.value &&
|
|
1087
|
-
}),
|
|
1088
|
-
n.armed.value &&
|
|
1196
|
+
n.armed.value && B(() => w.refresh());
|
|
1197
|
+
}), U(() => {
|
|
1198
|
+
n.armed.value && B(() => w.refresh());
|
|
1089
1199
|
});
|
|
1090
1200
|
function D(e) {
|
|
1091
1201
|
return typeof e == "object" && !!e || typeof e == "function";
|
|
1092
1202
|
}
|
|
1093
|
-
let
|
|
1094
|
-
function
|
|
1095
|
-
|
|
1203
|
+
let O = h(() => i);
|
|
1204
|
+
function k() {
|
|
1205
|
+
O.acquire();
|
|
1096
1206
|
}
|
|
1097
|
-
function
|
|
1207
|
+
function L(e) {
|
|
1098
1208
|
let t = e.relatedTarget, n = e.currentTarget;
|
|
1099
|
-
t && n?.contains(t) ||
|
|
1209
|
+
t && n?.contains(t) || O.release();
|
|
1100
1210
|
}
|
|
1101
|
-
return (t, i) => (G(),
|
|
1102
|
-
class:
|
|
1211
|
+
return (t, i) => (G(), P("div", {
|
|
1212
|
+
class: V(["dock-layer-group", [a.value, `switcher-${e.switcherPosition}`]]),
|
|
1103
1213
|
"data-motion": Y(n).dataMotion.value,
|
|
1104
|
-
style:
|
|
1105
|
-
}, [
|
|
1214
|
+
style: te(Y(n).hostStyle.value)
|
|
1215
|
+
}, [g.value ? (G(), P("div", {
|
|
1106
1216
|
key: 0,
|
|
1107
1217
|
ref_key: "switcherListEl",
|
|
1108
1218
|
ref: d,
|
|
1109
1219
|
role: "tablist",
|
|
1110
|
-
class:
|
|
1220
|
+
class: V(["dock-layer-switcher", [e.switcherPosition, Y(n).armed.value && "glass-drag-grabbable"]]),
|
|
1111
1221
|
"aria-orientation": l.value,
|
|
1112
|
-
onKeydown: i[0] ||= (...e) => Y(
|
|
1113
|
-
onFocusin:
|
|
1114
|
-
onFocusout:
|
|
1115
|
-
}, [(G(!0),
|
|
1222
|
+
onKeydown: i[0] ||= (...e) => Y(m).onKeydown && Y(m).onKeydown(...e),
|
|
1223
|
+
onFocusin: k,
|
|
1224
|
+
onFocusout: L
|
|
1225
|
+
}, [(G(!0), P(A, null, re(c.value, (e, t) => (G(), P("button", z({
|
|
1116
1226
|
key: e.id,
|
|
1117
1227
|
ref_for: !0,
|
|
1118
1228
|
ref: (e) => {
|
|
1119
|
-
e && (
|
|
1229
|
+
e && (p.value[t] = e);
|
|
1120
1230
|
},
|
|
1121
1231
|
type: "button",
|
|
1122
1232
|
class: "dock-layer-tab",
|
|
1123
1233
|
id: b(e.id),
|
|
1124
|
-
tabindex: Y(
|
|
1125
|
-
}, { ref_for: !0 }, Y(
|
|
1234
|
+
tabindex: Y(m).rovingTabindex(t)
|
|
1235
|
+
}, { ref_for: !0 }, Y(m).itemAttrs(e.id), {
|
|
1126
1236
|
"aria-controls": x(e.id),
|
|
1127
1237
|
"aria-label": e.label ?? e.id,
|
|
1128
|
-
onClick: (n) => Y(
|
|
1129
|
-
}), [D(e.icon) ? (G(),
|
|
1238
|
+
onClick: (n) => Y(m).select(e.id, t)
|
|
1239
|
+
}), [D(e.icon) ? (G(), M(ie(e.icon), {
|
|
1130
1240
|
key: 0,
|
|
1131
1241
|
class: "size-4"
|
|
1132
|
-
})) : 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", {
|
|
1133
1243
|
ref_key: "switcherIndicatorEl",
|
|
1134
1244
|
ref: f,
|
|
1135
|
-
class:
|
|
1136
|
-
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),
|
|
1137
1247
|
"aria-hidden": "true"
|
|
1138
|
-
}, null, 6)], 42,
|
|
1248
|
+
}, null, 6)], 42, yt)) : N("", !0), I(_t, {
|
|
1139
1249
|
ref_key: "crossfade",
|
|
1140
1250
|
ref: s,
|
|
1141
1251
|
active: r.value
|
|
1142
1252
|
}, {
|
|
1143
1253
|
default: Q(() => [J(t.$slots, "default")]),
|
|
1144
1254
|
_: 3
|
|
1145
|
-
}, 8, ["active"])], 14,
|
|
1255
|
+
}, 8, ["active"])], 14, vt));
|
|
1146
1256
|
}
|
|
1147
|
-
}),
|
|
1257
|
+
}), wt = [
|
|
1148
1258
|
"role",
|
|
1149
1259
|
"id",
|
|
1150
1260
|
"aria-labelledby",
|
|
1151
1261
|
"inert",
|
|
1152
1262
|
"aria-hidden",
|
|
1153
1263
|
"tabindex"
|
|
1154
|
-
],
|
|
1264
|
+
], Tt = { class: "dock-face-content" }, Et = /* @__PURE__ */ L({
|
|
1155
1265
|
__name: "DockLayer",
|
|
1156
1266
|
props: {
|
|
1157
1267
|
id: {},
|
|
@@ -1159,8 +1269,8 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1159
1269
|
icon: {}
|
|
1160
1270
|
},
|
|
1161
1271
|
setup(e) {
|
|
1162
|
-
let t = e, n =
|
|
1163
|
-
|
|
1272
|
+
let t = e, n = gt(), r = X("hostEl");
|
|
1273
|
+
U(() => {
|
|
1164
1274
|
r.value && n.register({
|
|
1165
1275
|
id: t.id,
|
|
1166
1276
|
label: t.label,
|
|
@@ -1178,12 +1288,12 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1178
1288
|
icon: t.icon,
|
|
1179
1289
|
el: r.value
|
|
1180
1290
|
});
|
|
1181
|
-
}),
|
|
1182
|
-
let i =
|
|
1183
|
-
return (e, t) => (G(),
|
|
1291
|
+
}), H(() => n.unregister(t.id));
|
|
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", {
|
|
1184
1294
|
ref_key: "hostEl",
|
|
1185
1295
|
ref: r,
|
|
1186
|
-
class:
|
|
1296
|
+
class: V(["dock-face", {
|
|
1187
1297
|
"is-active": i.value,
|
|
1188
1298
|
"is-leaving": a.value
|
|
1189
1299
|
}]),
|
|
@@ -1193,9 +1303,9 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1193
1303
|
inert: !i.value || void 0,
|
|
1194
1304
|
"aria-hidden": !i.value || void 0,
|
|
1195
1305
|
tabindex: i.value ? -1 : void 0
|
|
1196
|
-
}, [
|
|
1306
|
+
}, [F("div", Tt, [J(e.$slots, "default")])], 10, wt));
|
|
1197
1307
|
}
|
|
1198
|
-
}),
|
|
1308
|
+
}), Dt = /* @__PURE__ */ L({
|
|
1199
1309
|
__name: "DockControl",
|
|
1200
1310
|
props: {
|
|
1201
1311
|
shape: { default: "icon" },
|
|
@@ -1226,13 +1336,14 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1226
1336
|
] }
|
|
1227
1337
|
},
|
|
1228
1338
|
setup(t) {
|
|
1229
|
-
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]: "",
|
|
1230
1341
|
...r.active === void 0 ? {} : {
|
|
1231
1342
|
"aria-pressed": String(r.active),
|
|
1232
1343
|
...r.active ? { "data-active": "" } : {}
|
|
1233
1344
|
},
|
|
1234
1345
|
...r.disabled ? { "aria-disabled": "true" } : {}
|
|
1235
|
-
})), l =
|
|
1346
|
+
})), l = j(() => !r.asChild && r.as === "button" ? { type: r.type } : {}), u = i("press"), d = a({
|
|
1236
1347
|
disabled: () => r.disabled || o.value,
|
|
1237
1348
|
squish: !0,
|
|
1238
1349
|
response: u.response,
|
|
@@ -1240,11 +1351,11 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1240
1351
|
pressVar: "--dock-press-t",
|
|
1241
1352
|
shrinkDepth: .04,
|
|
1242
1353
|
maxStretch: 1.03
|
|
1243
|
-
}), f =
|
|
1354
|
+
}), f = j(() => o.value ? {} : { ...d.pressStyle.value });
|
|
1244
1355
|
function p(e) {
|
|
1245
1356
|
r.disabled && (e.preventDefault(), e.stopImmediatePropagation());
|
|
1246
1357
|
}
|
|
1247
|
-
return (e, r) => $((G(),
|
|
1358
|
+
return (e, r) => $((G(), M(Y(ue), z({
|
|
1248
1359
|
as: t.as,
|
|
1249
1360
|
"as-child": t.asChild
|
|
1250
1361
|
}, {
|
|
@@ -1282,7 +1393,7 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1282
1393
|
"onBlur"
|
|
1283
1394
|
])), [[Y(n)]]);
|
|
1284
1395
|
}
|
|
1285
|
-
}),
|
|
1396
|
+
}), Ot = /* @__PURE__ */ L({
|
|
1286
1397
|
inheritAttrs: !1,
|
|
1287
1398
|
__name: "DockTrigger",
|
|
1288
1399
|
props: {
|
|
@@ -1296,28 +1407,69 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1296
1407
|
] }
|
|
1297
1408
|
},
|
|
1298
1409
|
setup(t) {
|
|
1299
|
-
let r = t, i =
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
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
|
+
})]),
|
|
1306
1442
|
_: 3
|
|
1307
1443
|
})]),
|
|
1308
1444
|
_: 3
|
|
1309
|
-
}, 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": "",
|
|
1310
1450
|
action: "pointerdown",
|
|
1311
|
-
class:
|
|
1451
|
+
class: s.value
|
|
1312
1452
|
}), {
|
|
1313
|
-
default: Q(() => [
|
|
1453
|
+
default: Q(() => [I(o, null, {
|
|
1454
|
+
default: Q(() => [J(e.$slots, "default")]),
|
|
1455
|
+
_: 3
|
|
1456
|
+
})]),
|
|
1314
1457
|
_: 3
|
|
1315
|
-
}, 16, ["class"])), [[Y(n)]]) : $((G(),
|
|
1316
|
-
|
|
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
|
+
})]),
|
|
1317
1469
|
_: 3
|
|
1318
1470
|
}, 16, ["class"])), [[Y(n)]]);
|
|
1319
1471
|
}
|
|
1320
|
-
}),
|
|
1472
|
+
}), kt = /* @__PURE__ */ L({
|
|
1321
1473
|
__name: "DockBackgroundToggle",
|
|
1322
1474
|
props: {
|
|
1323
1475
|
paused: {
|
|
@@ -1329,22 +1481,22 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1329
1481
|
},
|
|
1330
1482
|
emits: ["update:paused"],
|
|
1331
1483
|
setup(e, { emit: t }) {
|
|
1332
|
-
let n = e, r = t, i =
|
|
1484
|
+
let n = e, r = t, i = j(() => n.paused ? n.playLabel : n.pauseLabel);
|
|
1333
1485
|
function a() {
|
|
1334
1486
|
r("update:paused", !n.paused);
|
|
1335
1487
|
}
|
|
1336
|
-
return (t, n) => (G(),
|
|
1488
|
+
return (t, n) => (G(), M(Dt, {
|
|
1337
1489
|
type: "button",
|
|
1338
1490
|
active: e.paused,
|
|
1339
1491
|
"aria-pressed": e.paused,
|
|
1340
1492
|
"aria-label": i.value,
|
|
1341
1493
|
onClick: a
|
|
1342
1494
|
}, {
|
|
1343
|
-
default: Q(() => [e.paused ? (G(),
|
|
1495
|
+
default: Q(() => [e.paused ? (G(), M(Y(he), {
|
|
1344
1496
|
key: 0,
|
|
1345
1497
|
size: 18,
|
|
1346
1498
|
"aria-hidden": "true"
|
|
1347
|
-
})) : (G(),
|
|
1499
|
+
})) : (G(), M(Y(me), {
|
|
1348
1500
|
key: 1,
|
|
1349
1501
|
size: 18,
|
|
1350
1502
|
"aria-hidden": "true"
|
|
@@ -1356,30 +1508,30 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1356
1508
|
"aria-label"
|
|
1357
1509
|
]));
|
|
1358
1510
|
}
|
|
1359
|
-
}),
|
|
1511
|
+
}), At = [
|
|
1360
1512
|
"data-orientation",
|
|
1361
1513
|
"data-dock-hairline",
|
|
1362
1514
|
"aria-orientation"
|
|
1363
|
-
],
|
|
1515
|
+
], jt = /* @__PURE__ */ L({
|
|
1364
1516
|
__name: "DockSeparator",
|
|
1365
1517
|
props: { anchor: {
|
|
1366
1518
|
type: Boolean,
|
|
1367
1519
|
default: !1
|
|
1368
1520
|
} },
|
|
1369
1521
|
setup(e) {
|
|
1370
|
-
let t =
|
|
1371
|
-
return (t, n) => (G(),
|
|
1372
|
-
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 }]),
|
|
1373
1525
|
role: "separator",
|
|
1374
1526
|
"data-orientation": r.value,
|
|
1375
1527
|
"data-dock-hairline": e.anchor || void 0,
|
|
1376
1528
|
"aria-orientation": i.value
|
|
1377
|
-
}, null, 10,
|
|
1529
|
+
}, null, 10, At));
|
|
1378
1530
|
}
|
|
1379
1531
|
});
|
|
1380
1532
|
//#endregion
|
|
1381
1533
|
//#region src/composables/search/match.ts
|
|
1382
|
-
function
|
|
1534
|
+
function Mt(e, t) {
|
|
1383
1535
|
let n = e.length, r = t.length;
|
|
1384
1536
|
if (n === 0) return {
|
|
1385
1537
|
score: 0,
|
|
@@ -1403,11 +1555,11 @@ function St(e, t) {
|
|
|
1403
1555
|
matches: i
|
|
1404
1556
|
});
|
|
1405
1557
|
}
|
|
1406
|
-
function
|
|
1558
|
+
function Nt(e, t) {
|
|
1407
1559
|
if (!t) return null;
|
|
1408
1560
|
let n = 0, r = [];
|
|
1409
1561
|
for (let i of e) {
|
|
1410
|
-
let e =
|
|
1562
|
+
let e = Mt(i, t);
|
|
1411
1563
|
if (!e) return null;
|
|
1412
1564
|
n += e.score;
|
|
1413
1565
|
for (let t of e.matches) r.push(t);
|
|
@@ -1417,7 +1569,7 @@ function Ct(e, t) {
|
|
|
1417
1569
|
matches: r
|
|
1418
1570
|
};
|
|
1419
1571
|
}
|
|
1420
|
-
function
|
|
1572
|
+
function Pt(e, t) {
|
|
1421
1573
|
let n = null, r = [], i = [
|
|
1422
1574
|
[t._lc.label, 12],
|
|
1423
1575
|
[t._lc.type, 10],
|
|
@@ -1425,7 +1577,7 @@ function wt(e, t) {
|
|
|
1425
1577
|
];
|
|
1426
1578
|
for (let [a, o] of i) {
|
|
1427
1579
|
if (!a) continue;
|
|
1428
|
-
let i =
|
|
1580
|
+
let i = Nt(e, a);
|
|
1429
1581
|
if (!i) continue;
|
|
1430
1582
|
let s = i.score * o;
|
|
1431
1583
|
(n === null || s > n) && (n = s, r = a === t._lc.label ? i.matches : []);
|
|
@@ -1435,7 +1587,7 @@ function wt(e, t) {
|
|
|
1435
1587
|
matches: r
|
|
1436
1588
|
};
|
|
1437
1589
|
}
|
|
1438
|
-
function
|
|
1590
|
+
function Ft(e) {
|
|
1439
1591
|
return e.map((e) => ({
|
|
1440
1592
|
item: e,
|
|
1441
1593
|
_lc: {
|
|
@@ -1445,15 +1597,15 @@ function Tt(e) {
|
|
|
1445
1597
|
}
|
|
1446
1598
|
}));
|
|
1447
1599
|
}
|
|
1448
|
-
var
|
|
1449
|
-
function
|
|
1450
|
-
let t =
|
|
1451
|
-
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;
|
|
1452
1604
|
}
|
|
1453
|
-
function
|
|
1605
|
+
function Rt(e, t, n = 30) {
|
|
1454
1606
|
let r = t.toLowerCase().trim();
|
|
1455
1607
|
if (!r) return [];
|
|
1456
|
-
let i =
|
|
1608
|
+
let i = Lt(e), a = i.get(r);
|
|
1457
1609
|
if (a) return a.slice(0, n);
|
|
1458
1610
|
i.size > 200 && i.clear();
|
|
1459
1611
|
let o = r.split(/\s+/).filter(Boolean);
|
|
@@ -1472,7 +1624,7 @@ function Ot(e, t, n = 30) {
|
|
|
1472
1624
|
}
|
|
1473
1625
|
let c = [];
|
|
1474
1626
|
for (let e of s) {
|
|
1475
|
-
let t =
|
|
1627
|
+
let t = Pt(o, e);
|
|
1476
1628
|
t && c.push({
|
|
1477
1629
|
item: e.item,
|
|
1478
1630
|
score: t.score,
|
|
@@ -1481,17 +1633,17 @@ function Ot(e, t, n = 30) {
|
|
|
1481
1633
|
}
|
|
1482
1634
|
return c.sort((e, t) => t.score - e.score), i.set(r, c), c.slice(0, n);
|
|
1483
1635
|
}
|
|
1484
|
-
function
|
|
1636
|
+
function zt(e) {
|
|
1485
1637
|
if (e) {
|
|
1486
|
-
|
|
1638
|
+
It.delete(e);
|
|
1487
1639
|
return;
|
|
1488
1640
|
}
|
|
1489
|
-
|
|
1641
|
+
It = /* @__PURE__ */ new WeakMap();
|
|
1490
1642
|
}
|
|
1491
1643
|
//#endregion
|
|
1492
1644
|
//#region src/composables/search/useFuzzySearch.ts
|
|
1493
|
-
function
|
|
1494
|
-
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;
|
|
1495
1647
|
function f(e = d) {
|
|
1496
1648
|
e !== void 0 && (clearTimeout(e), d === e && (d = void 0));
|
|
1497
1649
|
}
|
|
@@ -1507,7 +1659,7 @@ function At(e) {
|
|
|
1507
1659
|
}), Z(l, () => {
|
|
1508
1660
|
f(), c.value = i.value, s.value = 0;
|
|
1509
1661
|
}, { deep: !0 });
|
|
1510
|
-
let p =
|
|
1662
|
+
let p = j(() => Rt(u.value, c.value, r));
|
|
1511
1663
|
Z(p, () => {
|
|
1512
1664
|
s.value = 0;
|
|
1513
1665
|
});
|
|
@@ -1515,7 +1667,7 @@ function At(e) {
|
|
|
1515
1667
|
e.onSelect?.(t), h();
|
|
1516
1668
|
}
|
|
1517
1669
|
function h() {
|
|
1518
|
-
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);
|
|
1519
1671
|
}
|
|
1520
1672
|
function g() {
|
|
1521
1673
|
a.value = !0;
|
|
@@ -1539,8 +1691,8 @@ function At(e) {
|
|
|
1539
1691
|
break;
|
|
1540
1692
|
}
|
|
1541
1693
|
}
|
|
1542
|
-
return
|
|
1543
|
-
f(),
|
|
1694
|
+
return W(() => {
|
|
1695
|
+
f(), zt(u.value);
|
|
1544
1696
|
}, !0), {
|
|
1545
1697
|
query: i,
|
|
1546
1698
|
results: p,
|
|
@@ -1556,13 +1708,13 @@ function At(e) {
|
|
|
1556
1708
|
}
|
|
1557
1709
|
//#endregion
|
|
1558
1710
|
//#region src/components/dock/composables/useDockSearch.ts
|
|
1559
|
-
function
|
|
1711
|
+
function Vt(e) {
|
|
1560
1712
|
let { dockState: t } = e, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i = q([]), a = null, o = e.items ? e.items : () => i.value;
|
|
1561
1713
|
function s(t) {
|
|
1562
1714
|
let n = t.item.id;
|
|
1563
1715
|
e.ensureTargetWindow?.(n), e.scrollTo?.(n), e.onResultSelect?.(t);
|
|
1564
1716
|
}
|
|
1565
|
-
let c =
|
|
1717
|
+
let c = Bt({
|
|
1566
1718
|
items: o,
|
|
1567
1719
|
debounceMs: n,
|
|
1568
1720
|
maxResults: r,
|
|
@@ -1583,7 +1735,7 @@ function jt(e) {
|
|
|
1583
1735
|
});
|
|
1584
1736
|
});
|
|
1585
1737
|
}
|
|
1586
|
-
let l =
|
|
1738
|
+
let l = j(() => {
|
|
1587
1739
|
let e = c.query.value;
|
|
1588
1740
|
if (!e) return "";
|
|
1589
1741
|
let t = c.results.value[0];
|
|
@@ -1595,28 +1747,28 @@ function jt(e) {
|
|
|
1595
1747
|
let e = l.value;
|
|
1596
1748
|
e && (c.query.value = c.query.value + e);
|
|
1597
1749
|
}
|
|
1598
|
-
let d =
|
|
1599
|
-
function
|
|
1750
|
+
let d = h(() => t), f = d.isHeld;
|
|
1751
|
+
function p() {
|
|
1600
1752
|
f.value || (t.expand(), d.acquire(), c.open());
|
|
1601
1753
|
}
|
|
1602
|
-
function
|
|
1754
|
+
function m() {
|
|
1603
1755
|
f.value && (c.close(), d.release());
|
|
1604
1756
|
}
|
|
1605
1757
|
let g = null;
|
|
1606
|
-
return e.collapseOnScroll && e.scrollContainer && (g =
|
|
1758
|
+
return e.collapseOnScroll && e.scrollContainer && (g = k(e.scrollContainer, {
|
|
1607
1759
|
collapseOnScroll: !0,
|
|
1608
1760
|
chromeRef: e.chromeRef
|
|
1609
|
-
})),
|
|
1761
|
+
})), W(() => {
|
|
1610
1762
|
a?.abort(), a = null;
|
|
1611
1763
|
}), {
|
|
1612
1764
|
fuzzy: c,
|
|
1613
1765
|
autocompleteText: l,
|
|
1614
1766
|
scrollChrome: g,
|
|
1615
|
-
armSearch:
|
|
1616
|
-
disarmSearch:
|
|
1767
|
+
armSearch: p,
|
|
1768
|
+
disarmSearch: m,
|
|
1617
1769
|
acceptAutocomplete: u,
|
|
1618
1770
|
isSearchArmed: f
|
|
1619
1771
|
};
|
|
1620
1772
|
}
|
|
1621
1773
|
//#endregion
|
|
1622
|
-
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 };
|