@mkbabb/glass-ui 10.0.1 → 10.1.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/MIGRATION.md +25 -0
- package/dist/aurora.js +29 -29
- package/dist/{command-C-5xSEJ2.js → command-CTQCaHVA.js} +1 -1
- package/dist/command.js +1 -1
- package/dist/components/_shared/overlay/participation.d.ts +13 -1
- package/dist/components/configurator/Configurator.vue.d.ts +20 -0
- package/dist/components/configurator/ConfiguratorLayer.vue.d.ts +12 -2
- package/dist/components/configurator/index.d.ts +1 -1
- package/dist/components/configurator/styles.css +1 -1
- package/dist/components/dock/GlassDock.vue.d.ts +5 -5
- package/dist/components/dock/composables/dockContext.d.ts +16 -2
- package/dist/components/sheet/styles.css +1 -1
- package/dist/components/skeleton/Skeleton.vue.d.ts +6 -0
- package/dist/{configurator-DiwVN573.js → configurator-CPxIo3q2.js} +85 -71
- package/dist/configurator.js +1 -1
- 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 +417 -409
- package/dist/easing.js +3 -3
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +9 -9
- package/dist/index.d.ts +1 -1
- package/dist/labeled-field.js +1 -1
- package/dist/{menu-BnmCOa3y.js → menu-DN29N6KR.js} +6 -3
- package/dist/menu.js +1 -1
- package/dist/motion-core.js +11 -11
- package/dist/participation-Cs_UX_Dc.js +55 -0
- package/dist/{popover-DA87hFBx.js → popover-CJpvT2E6.js} +9 -4
- package/dist/popover.js +1 -1
- package/dist/{select-fy3vtArm.js → select-5QMeUAU6.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-D1zkobtO.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{tabs-rdRXKXxd.js → tabs-C0PYq3Tb.js} +1 -1
- package/dist/tabs.js +1 -1
- package/dist/{tooltip-DhTHhtJN.js → tooltip-D7j6TsE4.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 {
|
|
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, i as f, l as p, n as m, o as h, r as g, s as _, u as v } from "./participation-Cs_UX_Dc.js";
|
|
10
|
+
import { t as y } from "./useResizeObserver-CdUlm2QZ.js";
|
|
11
|
+
import { n as b } from "./useResolveTokenColor-B2FfJnd9.js";
|
|
12
|
+
import { t as x } from "./useIntersectionPause-CzKR3EyP.js";
|
|
13
|
+
import { t as S } from "./focus-Duf7EpUu.js";
|
|
14
|
+
import { t as C } from "./DropdownMenuTrigger-CKRnhDSQ.js";
|
|
15
|
+
import { t as w } from "./useSelectionGroup-zsEwitF6.js";
|
|
16
|
+
import { t as T } from "./useDragMorph-B363RUbF.js";
|
|
17
|
+
import { n as E } from "./useDockCtaReceive-BSSgD6mu.js";
|
|
18
|
+
import { n as D, t as O } from "./useScrollChrome-BJbWV32F.js";
|
|
19
|
+
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 U, onScopeDispose as W, onUnmounted as ee, openBlock as G, readonly as K, ref as q, renderList as te, renderSlot as J, resolveDynamicComponent as ne, toDisplayString as re, unref as Y, useId as ie, useModel as ae, useTemplateRef as X, watch as Z, withCtx as Q, withDirectives as $, withModifiers as oe } from "vue";
|
|
20
|
+
import { PopoverTrigger as se, Primitive as ce, SelectIcon as le, SelectTrigger as ue } from "reka-ui";
|
|
21
|
+
import { ChevronDown as de, Pause as fe, Play as pe } from "@lucide/vue";
|
|
22
|
+
import { SpringProgress as me } from "@mkbabb/keyframes.js";
|
|
23
|
+
import { useMediaQuery as he } from "@vueuse/core";
|
|
24
24
|
//#region src/components/_shared/overlay/isTeleportedTarget.ts
|
|
25
|
-
function
|
|
25
|
+
function ge(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 _e(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 ve(e, t, n) {
|
|
37
|
+
return .2126 * _e(e) + .7152 * _e(t) + .0722 * _e(n);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function ye(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 be(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 xe(e) {
|
|
56
56
|
return typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement;
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
function
|
|
58
|
+
var Se = "[data-glass-field-canvas] canvas, canvas[data-glass-field-canvas]";
|
|
59
|
+
function Ce(e) {
|
|
60
60
|
if (!e) {
|
|
61
61
|
if (typeof document < "u") {
|
|
62
|
-
let e = document.querySelector(
|
|
63
|
-
if (
|
|
62
|
+
let e = document.querySelector(Se);
|
|
63
|
+
if (xe(e)) return e;
|
|
64
64
|
}
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
67
|
-
if (
|
|
67
|
+
if (xe(e)) return e;
|
|
68
68
|
if (typeof e == "function") {
|
|
69
69
|
let t = e();
|
|
70
|
-
return
|
|
70
|
+
return xe(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 xe(t) ? t : null;
|
|
75
75
|
}
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
let n =
|
|
78
|
+
function we(e, t) {
|
|
79
|
+
let n = be(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 Te(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] = ye(e[t], e[t + 1], e[t + 2], n, r);
|
|
106
|
+
i += ve(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 Ee(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 = we(b(r, e), t);
|
|
118
118
|
if (i && !(i[3] < .5)) return i;
|
|
119
119
|
}
|
|
120
|
-
return
|
|
120
|
+
return we(b(getComputedStyle(document.body).backgroundColor, e), t);
|
|
121
121
|
}
|
|
122
|
-
var
|
|
122
|
+
var De = [
|
|
123
123
|
255,
|
|
124
124
|
255,
|
|
125
125
|
255
|
|
126
126
|
];
|
|
127
|
-
function
|
|
128
|
-
let n =
|
|
127
|
+
function Oe(e, t) {
|
|
128
|
+
let n = Ee(e, t);
|
|
129
129
|
return n && n[3] >= .5 ? [
|
|
130
130
|
n[0],
|
|
131
131
|
n[1],
|
|
132
132
|
n[2]
|
|
133
|
-
] : [...
|
|
133
|
+
] : [...De];
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
let n =
|
|
137
|
-
return n ?
|
|
135
|
+
function ke(e, t) {
|
|
136
|
+
let n = Ee(e, t);
|
|
137
|
+
return n ? Ae(n) : null;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
return { luma:
|
|
139
|
+
function Ae(e) {
|
|
140
|
+
return { luma: ve(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 je = "data-glass-backdrop-shared";
|
|
145
|
+
function Me(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(`[${je}]`) !== 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 || Ce(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";
|
|
@@ -198,68 +198,68 @@ function je(e, n = {}) {
|
|
|
198
198
|
targetRect: _(e)
|
|
199
199
|
}, e.style.removeProperty("--glass-backdrop-luma"), e.style.removeProperty("--glass-backdrop-sampled"), a && e.style.removeProperty("--glass-backdrop"), e.removeAttribute("data-backdrop-sampled"), e.setAttribute("data-backdrop-sample-state", "unavailable"), e.setAttribute("data-backdrop-sample-source", t === "live" ? "canvas" : "elements"), e.setAttribute("data-backdrop-sample-reason", n);
|
|
200
200
|
}
|
|
201
|
-
let
|
|
202
|
-
function
|
|
201
|
+
let S = 0;
|
|
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" ? Ce(n.backgroundCanvas) : null, o = i === "live" ? Te(t, a, r, Oe(t, r)) : ke(t, r), s = Date.now();
|
|
206
|
+
o ? v(o, t, i, s) : b(t, i, i === "live" && !a ? "source-unavailable" : "sample-unavailable", s), S = typeof performance < "u" ? performance.now() : s;
|
|
207
207
|
}
|
|
208
|
-
let
|
|
209
|
-
f.value || e -
|
|
208
|
+
let w = D(({ now: e }) => {
|
|
209
|
+
f.value || e - S < o || C();
|
|
210
210
|
}, {
|
|
211
211
|
immediate: !1,
|
|
212
212
|
pauseWhenHidden: !0,
|
|
213
213
|
respectReducedMotion: !0
|
|
214
|
-
}),
|
|
215
|
-
pause: () =>
|
|
214
|
+
}), T = x(() => 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 =
|
|
220
|
+
}, { rootMargin: "200px" }), E = y(e, () => C());
|
|
221
221
|
function O() {
|
|
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
229
|
let k = Z(f, O, { flush: "sync" }), A = Z(() => e.value, (e) => {
|
|
230
230
|
if (e) {
|
|
231
|
-
if (s) e.setAttribute(
|
|
231
|
+
if (s) e.setAttribute(je, "");
|
|
232
232
|
else if (c(e)) return;
|
|
233
|
-
|
|
233
|
+
C(), O();
|
|
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 Ne(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 = A(() => d.value !== "collapsed"), p = A(() => d.value === "pinned"), m = null, h = q(0), g = q(0), _ = A(() => h.value > 0), v = A(() => g.value > 0), y = null, b = null, x = !1, S = null;
|
|
254
254
|
function C() {
|
|
255
255
|
S &&= (clearTimeout(S), null);
|
|
256
256
|
}
|
|
257
|
-
let w =
|
|
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
275
|
function j() {
|
|
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) || ge(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) || ge(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
315
|
function R(e = "morph") {
|
|
316
|
-
|
|
316
|
+
h.value++, e === "grasp" && g.value++, E();
|
|
317
317
|
}
|
|
318
318
|
function z(e = "morph") {
|
|
319
|
-
e === "grasp" && (
|
|
320
|
-
|
|
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
323
|
function B(e) {
|
|
324
|
-
if (l() ||
|
|
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) || ge(e.target, o) || j();
|
|
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,
|
|
332
|
+
b = null, f.value && (document.addEventListener("pointerdown", B, !0), y = () => {
|
|
333
333
|
document.removeEventListener("pointerdown", B, !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
|
+
}), ee(() => {
|
|
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,
|
|
@@ -361,7 +361,7 @@ function Me(e) {
|
|
|
361
361
|
}
|
|
362
362
|
//#endregion
|
|
363
363
|
//#region src/components/dock/composables/useDockSpring.ts
|
|
364
|
-
function
|
|
364
|
+
function Pe(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 me({
|
|
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 Fe(e) {
|
|
400
|
+
let { rootEl: t, outerActiveLayer: n } = e, r = q(n.value), i = q(null), a = Pe({
|
|
401
|
+
response: v.response,
|
|
402
|
+
dampingFraction: v.dampingFraction
|
|
403
|
+
}), o = he("(prefers-reduced-motion: reduce)");
|
|
404
404
|
function s() {
|
|
405
405
|
return t.value;
|
|
406
406
|
}
|
|
@@ -434,7 +434,7 @@ function Pe(e) {
|
|
|
434
434
|
}
|
|
435
435
|
i.value = t, l();
|
|
436
436
|
});
|
|
437
|
-
return
|
|
437
|
+
return ee(() => {
|
|
438
438
|
u(), a.dispose();
|
|
439
439
|
}), {
|
|
440
440
|
outerCurrentLayer: K(r),
|
|
@@ -443,15 +443,15 @@ function Pe(e) {
|
|
|
443
443
|
}
|
|
444
444
|
//#endregion
|
|
445
445
|
//#region src/components/dock/composables/dockMorphMeasure.ts
|
|
446
|
-
function
|
|
446
|
+
function Ie(e, t) {
|
|
447
447
|
return t === "vertical" ? e.offsetHeight : e.offsetWidth;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function Le(e) {
|
|
450
450
|
let { rootEl: t, contentEl: n, expandedEl: r, collapsedEl: i, axis: a, expanded: o } = e, s = null, c = 0, l = 0, u = !1;
|
|
451
451
|
function d(e = "layout") {
|
|
452
452
|
let s = t.value, u = n.value, d = r.value, f = i.value;
|
|
453
453
|
if (!s || !u || !d || !f || s.hasAttribute("data-morphing")) return;
|
|
454
|
-
let p = a.value, m =
|
|
454
|
+
let p = a.value, m = Ie(s, p), h = Ie(d, p), g = Ie(f, p);
|
|
455
455
|
if (m <= 0 || h < 0 || g < 0) return;
|
|
456
456
|
e === "layout" && (o.value ? c = m : l = m);
|
|
457
457
|
let _ = o.value ? h : g, v = Math.max(0, m - _), y = c || v + h, b = l || v + g;
|
|
@@ -481,25 +481,25 @@ function Ie(e) {
|
|
|
481
481
|
a
|
|
482
482
|
], f, { immediate: !0 }), Z(o, () => d("flip"));
|
|
483
483
|
let p = typeof document < "u" ? document.fonts : void 0;
|
|
484
|
-
p && p.ready.then(() => !u && d("layout")),
|
|
484
|
+
p && p.ready.then(() => !u && d("layout")), W(() => {
|
|
485
485
|
u = !0, s?.disconnect(), s = null;
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
488
|
//#endregion
|
|
489
489
|
//#region src/components/dock/composables/useDockShellProps.ts
|
|
490
|
-
function
|
|
491
|
-
let t =
|
|
490
|
+
function Re(e) {
|
|
491
|
+
let t = A(() => e.shape ?? "pill"), n = A(() => e.orientation ?? "horizontal"), r = A(() => e.collapse === !1);
|
|
492
492
|
return {
|
|
493
|
-
startCollapsed:
|
|
493
|
+
startCollapsed: A(() => !r.value && (e.collapse ?? "closed") === "closed"),
|
|
494
494
|
shape: t,
|
|
495
495
|
orientation: n,
|
|
496
496
|
alwaysExpanded: r,
|
|
497
|
-
fitContent:
|
|
497
|
+
fitContent: A(() => e.fitContent ?? !1)
|
|
498
498
|
};
|
|
499
499
|
}
|
|
500
500
|
//#endregion
|
|
501
501
|
//#region src/components/dock/composables/useDockClickIntegrity.ts
|
|
502
|
-
function
|
|
502
|
+
function ze(e) {
|
|
503
503
|
let { rootEl: t, visualExpanded: n } = e, r = null, i = !1, a = 0, o = null, s = q(null), c = null, l = [];
|
|
504
504
|
function u() {
|
|
505
505
|
c?.removeAttribute("data-dock-press-origin"), c = null;
|
|
@@ -570,7 +570,7 @@ function Re(e) {
|
|
|
570
570
|
}
|
|
571
571
|
e.stopPropagation(), e.preventDefault(), r = null;
|
|
572
572
|
}
|
|
573
|
-
return
|
|
573
|
+
return H(() => {
|
|
574
574
|
f(), u();
|
|
575
575
|
}), {
|
|
576
576
|
onPointerDownCapture: _,
|
|
@@ -582,26 +582,30 @@ function Re(e) {
|
|
|
582
582
|
}
|
|
583
583
|
//#endregion
|
|
584
584
|
//#region src/components/dock/composables/useDockRun.ts
|
|
585
|
-
function
|
|
585
|
+
function Be(e, t) {
|
|
586
586
|
let n = getComputedStyle(e).getPropertyValue(t).trim(), r = Number.parseFloat(n);
|
|
587
587
|
return Number.isFinite(r) ? r : 0;
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function Ve(e) {
|
|
590
590
|
return Array.from(e.children).filter((e) => e instanceof HTMLElement);
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function He(e) {
|
|
593
593
|
return e.findIndex((e) => {
|
|
594
594
|
let t = (e.matches("[aria-current]") ? e : e.querySelector("[aria-current]"))?.getAttribute("aria-current");
|
|
595
595
|
return t != null && t !== "false";
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
|
-
|
|
599
|
-
|
|
598
|
+
var Ue = `${S}, [tabindex]`;
|
|
599
|
+
function We(e) {
|
|
600
|
+
return (e.matches(S) || e.hasAttribute("tabindex")) && !e.querySelector(Ue);
|
|
601
|
+
}
|
|
602
|
+
function Ge(e) {
|
|
603
|
+
return Ve(e).filter(We);
|
|
600
604
|
}
|
|
601
|
-
function
|
|
602
|
-
let { runEl: t, statusEl: n, orientation: r } = e, i =
|
|
603
|
-
response:
|
|
604
|
-
dampingFraction:
|
|
605
|
+
function Ke(e) {
|
|
606
|
+
let { runEl: t, statusEl: n, orientation: r } = e, i = Pe({
|
|
607
|
+
response: v.response,
|
|
608
|
+
dampingFraction: v.dampingFraction
|
|
605
609
|
});
|
|
606
610
|
function a() {
|
|
607
611
|
return r.value === "vertical";
|
|
@@ -616,11 +620,11 @@ function Ue(e) {
|
|
|
616
620
|
return a() ? e.scrollHeight - e.clientHeight : e.scrollWidth - e.clientWidth;
|
|
617
621
|
}
|
|
618
622
|
function l(e, t) {
|
|
619
|
-
let n =
|
|
623
|
+
let n = Ve(e), r = n.indexOf(t);
|
|
620
624
|
if (r < 0) return o(e);
|
|
621
|
-
let i =
|
|
625
|
+
let i = Be(e, "--dock-pitch");
|
|
622
626
|
if (i <= 0) return o(e);
|
|
623
|
-
let a = Math.max(1,
|
|
627
|
+
let a = Math.max(1, Be(e, "--dock-open-pitches")), s = He(n), l = s >= 0 && s < r ? (a - 1) * i : 0, u = r * i + l - i / 2;
|
|
624
628
|
return Math.min(Math.max(u, 0), c(e));
|
|
625
629
|
}
|
|
626
630
|
function u(e, t) {
|
|
@@ -630,10 +634,10 @@ function Ue(e) {
|
|
|
630
634
|
function d(e) {
|
|
631
635
|
let t = n.value;
|
|
632
636
|
if (!t) return;
|
|
633
|
-
let r =
|
|
637
|
+
let r = We(e) ? e : e.querySelector(S) ?? e, i = r.getAttribute("aria-label") ?? r.getAttribute("title") ?? r.textContent?.trim();
|
|
634
638
|
i && (t.textContent = i);
|
|
635
639
|
}
|
|
636
|
-
function
|
|
640
|
+
function f(e) {
|
|
637
641
|
let n = t.value;
|
|
638
642
|
if (!n || (d(e), !u(n, e))) return;
|
|
639
643
|
let r = o(n), a = l(n, e);
|
|
@@ -642,27 +646,24 @@ function Ue(e) {
|
|
|
642
646
|
n && s(n, r + (a - r) * e);
|
|
643
647
|
} });
|
|
644
648
|
}
|
|
645
|
-
function
|
|
649
|
+
function p() {
|
|
646
650
|
let e = t.value;
|
|
647
651
|
if (!e) return;
|
|
648
|
-
let n =
|
|
652
|
+
let n = Ge(e);
|
|
649
653
|
if (n.length === 0) return;
|
|
650
|
-
let r =
|
|
654
|
+
let r = He(n), i = n.findIndex((e) => e.contains(document.activeElement)), a = i >= 0 ? i : r >= 0 ? r : 0;
|
|
651
655
|
n.forEach((e, t) => {
|
|
652
|
-
|
|
653
|
-
n && (n.tabIndex = t === a ? 0 : -1);
|
|
656
|
+
e.tabIndex = t === a ? 0 : -1;
|
|
654
657
|
});
|
|
655
658
|
}
|
|
656
|
-
function
|
|
659
|
+
function m(e, t) {
|
|
657
660
|
let n = e[t];
|
|
658
|
-
|
|
659
|
-
let r = He(n);
|
|
660
|
-
r && (p(n), r.tabIndex = 0, r.focus({ preventScroll: !0 }), m());
|
|
661
|
+
n && (f(n), n.tabIndex = 0, n.focus({ preventScroll: !0 }), p());
|
|
661
662
|
}
|
|
662
|
-
function
|
|
663
|
+
function h(e) {
|
|
663
664
|
let n = t.value;
|
|
664
665
|
if (!n) return;
|
|
665
|
-
let r =
|
|
666
|
+
let r = Ge(n);
|
|
666
667
|
if (r.length === 0) return;
|
|
667
668
|
let i = r.findIndex((t) => t.contains(e.target));
|
|
668
669
|
if (i < 0) return;
|
|
@@ -682,41 +683,41 @@ function Ue(e) {
|
|
|
682
683
|
break;
|
|
683
684
|
default: return;
|
|
684
685
|
}
|
|
685
|
-
c < 0 || c >= r.length || (e.preventDefault(),
|
|
686
|
+
c < 0 || c >= r.length || (e.preventDefault(), m(r, c));
|
|
686
687
|
}
|
|
687
|
-
function
|
|
688
|
+
function g(e) {
|
|
688
689
|
let n = t.value;
|
|
689
690
|
if (!n) return;
|
|
690
|
-
let r =
|
|
691
|
-
r &&
|
|
691
|
+
let r = Ve(n).find((t) => t.contains(e.target));
|
|
692
|
+
r && f(r);
|
|
692
693
|
}
|
|
693
|
-
let
|
|
694
|
-
return
|
|
694
|
+
let _ = null;
|
|
695
|
+
return U(() => {
|
|
695
696
|
let e = t.value;
|
|
696
|
-
e && (e.addEventListener("keydown",
|
|
697
|
+
e && (e.addEventListener("keydown", h), e.addEventListener("click", g, { capture: !0 }), e.addEventListener("focusin", g, { capture: !0 }), p(), _ = new MutationObserver(() => p()), _.observe(e, {
|
|
697
698
|
childList: !0,
|
|
698
699
|
subtree: !0,
|
|
699
700
|
attributes: !0,
|
|
700
701
|
attributeFilter: ["aria-current"]
|
|
701
702
|
}));
|
|
702
|
-
}),
|
|
703
|
+
}), ee(() => {
|
|
703
704
|
let e = t.value;
|
|
704
|
-
e?.removeEventListener("keydown",
|
|
705
|
-
}), Z(r, () =>
|
|
706
|
-
reach:
|
|
707
|
-
syncRoving:
|
|
705
|
+
e?.removeEventListener("keydown", h), e?.removeEventListener("click", g, { capture: !0 }), e?.removeEventListener("focusin", g, { capture: !0 }), _?.disconnect(), i.dispose();
|
|
706
|
+
}), Z(r, () => p()), {
|
|
707
|
+
reach: f,
|
|
708
|
+
syncRoving: p
|
|
708
709
|
};
|
|
709
710
|
}
|
|
710
711
|
//#endregion
|
|
711
712
|
//#region src/components/dock/GlassDock.vue?vue&type=script&setup=true&lang.ts
|
|
712
|
-
var
|
|
713
|
+
var qe = ["data-backdrop-mode", "data-held"], Je = ["data-held"], Ye = { class: "dock-controls" }, Xe = {
|
|
713
714
|
key: 0,
|
|
714
715
|
class: "dock-persistent"
|
|
715
|
-
},
|
|
716
|
+
}, Ze = [
|
|
716
717
|
"id",
|
|
717
718
|
"aria-orientation",
|
|
718
719
|
"inert"
|
|
719
|
-
],
|
|
720
|
+
], Qe = [
|
|
720
721
|
"id",
|
|
721
722
|
"inert",
|
|
722
723
|
"role",
|
|
@@ -724,13 +725,13 @@ var We = ["data-backdrop-mode", "data-held"], Ge = ["data-held"], Ke = { class:
|
|
|
724
725
|
"aria-label",
|
|
725
726
|
"aria-expanded",
|
|
726
727
|
"aria-controls"
|
|
727
|
-
],
|
|
728
|
+
], $e = {
|
|
728
729
|
key: 0,
|
|
729
730
|
class: "dock-search-field"
|
|
730
|
-
},
|
|
731
|
+
}, et = {
|
|
731
732
|
key: 1,
|
|
732
733
|
class: "dock-persistent dock-persistent-end"
|
|
733
|
-
},
|
|
734
|
+
}, tt = /* @__PURE__ */ I({
|
|
734
735
|
inheritAttrs: !1,
|
|
735
736
|
__name: "GlassDock",
|
|
736
737
|
props: {
|
|
@@ -745,81 +746,85 @@ var We = ["data-backdrop-mode", "data-held"], Ge = ["data-held"], Ke = { class:
|
|
|
745
746
|
backgroundCanvas: {}
|
|
746
747
|
},
|
|
747
748
|
setup(e, { expose: t }) {
|
|
748
|
-
let n = e, { startCollapsed: r, shape: i, orientation: a, alwaysExpanded: o, fitContent: s } =
|
|
749
|
-
|
|
750
|
-
runEl:
|
|
751
|
-
statusEl:
|
|
749
|
+
let n = e, { startCollapsed: r, shape: i, orientation: a, alwaysExpanded: o, fitContent: s } = Re(n), c = X("dockEl"), u = X("layersEl"), p = X("fullEl"), m = X("summaryEl"), h = X("statusEl");
|
|
750
|
+
Ke({
|
|
751
|
+
runEl: p,
|
|
752
|
+
statusEl: h,
|
|
752
753
|
orientation: a
|
|
753
|
-
}), n.backdropMode === "live" &&
|
|
754
|
+
}), n.backdropMode === "live" && Me(c, { backgroundCanvas: () => {
|
|
754
755
|
let e = n.backgroundCanvas;
|
|
755
756
|
return typeof e == "function" ? e() : e instanceof HTMLCanvasElement ? e : null;
|
|
756
757
|
} });
|
|
757
|
-
let
|
|
758
|
+
let g = q(!1), _ = `glass-dock-${ie()}`, { expanded: v, isPinned: y, isHeld: b, graspHeld: x, onMouseEnter: C, onMouseLeave: w, onFocusIn: T, onFocusOut: E, onClickCollapsed: D, keepOpen: O, release: j, expand: I, collapse: L } = Ne({
|
|
758
759
|
rootEl: c,
|
|
759
760
|
alwaysExpanded: o,
|
|
760
761
|
initialExpanded: !r.value,
|
|
761
|
-
isTransitioning:
|
|
762
|
-
dockId:
|
|
763
|
-
});
|
|
764
|
-
|
|
765
|
-
id:
|
|
762
|
+
isTransitioning: g,
|
|
763
|
+
dockId: _
|
|
764
|
+
}), V = A(() => o.value || v.value);
|
|
765
|
+
l({
|
|
766
|
+
id: _,
|
|
766
767
|
orientation: a,
|
|
767
|
-
keepOpen:
|
|
768
|
-
release:
|
|
769
|
-
held: x
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
Ie({
|
|
768
|
+
keepOpen: O,
|
|
769
|
+
release: j,
|
|
770
|
+
held: x,
|
|
771
|
+
expanded: V
|
|
772
|
+
}), Le({
|
|
773
773
|
rootEl: c,
|
|
774
|
-
contentEl:
|
|
775
|
-
expandedEl:
|
|
776
|
-
collapsedEl:
|
|
774
|
+
contentEl: u,
|
|
775
|
+
expandedEl: p,
|
|
776
|
+
collapsedEl: m,
|
|
777
777
|
axis: a,
|
|
778
|
-
expanded:
|
|
778
|
+
expanded: V
|
|
779
779
|
});
|
|
780
|
-
let { outerCurrentLayer:
|
|
780
|
+
let { outerCurrentLayer: H, outerLeavingLayer: U } = Fe({
|
|
781
781
|
rootEl: c,
|
|
782
|
-
outerActiveLayer:
|
|
782
|
+
outerActiveLayer: A(() => V.value ? "full" : "summary"),
|
|
783
783
|
onMorphActiveChange: (e) => {
|
|
784
|
-
|
|
784
|
+
g.value = e;
|
|
785
785
|
}
|
|
786
|
-
}),
|
|
787
|
-
async function
|
|
788
|
-
!
|
|
786
|
+
}), W = A(() => H.value === "summary");
|
|
787
|
+
async function ee(e) {
|
|
788
|
+
!W.value || !["Enter", " "].includes(e.key) || (e.preventDefault(), D(), await z(), (p.value?.querySelector(S) ?? p.value)?.focus({ preventScroll: !0 }));
|
|
789
789
|
}
|
|
790
|
-
|
|
790
|
+
function K(e) {
|
|
791
791
|
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 });
|
|
792
|
+
let t = e.target?.closest?.(d);
|
|
793
|
+
t && p.value?.contains(t) || L();
|
|
797
794
|
}
|
|
798
|
-
|
|
795
|
+
Z(V, async (e, t) => {
|
|
796
|
+
if (!t || e) return;
|
|
797
|
+
let n = document.activeElement;
|
|
798
|
+
if (!(n && p.value?.contains(n) || n?.closest("[data-glass-dock-face]")?.getAttribute("data-glass-dock-owner") === _)) return;
|
|
799
|
+
await z();
|
|
800
|
+
let r = m.value;
|
|
801
|
+
r && !r.hasAttribute("inert") && r.focus({ preventScroll: !0 });
|
|
802
|
+
});
|
|
803
|
+
let { onPointerDownCapture: te, onPointerCancelCapture: ne, onClickCapture: re, markExpandFlip: ae, pressKeepaliveLayer: $ } = ze({
|
|
799
804
|
rootEl: c,
|
|
800
|
-
visualExpanded:
|
|
805
|
+
visualExpanded: V
|
|
801
806
|
});
|
|
802
|
-
Z(
|
|
803
|
-
e &&
|
|
807
|
+
Z(V, (e) => {
|
|
808
|
+
e && ae();
|
|
804
809
|
});
|
|
805
|
-
let
|
|
810
|
+
let se = q(!1);
|
|
806
811
|
Z(x, (e) => {
|
|
807
|
-
e && (
|
|
812
|
+
e && (se.value = !0);
|
|
808
813
|
});
|
|
809
|
-
function
|
|
810
|
-
e.propertyName === "opacity" && !x.value && (
|
|
814
|
+
function ce(e) {
|
|
815
|
+
e.propertyName === "opacity" && !x.value && (se.value = !1);
|
|
811
816
|
}
|
|
812
817
|
return t({
|
|
813
|
-
expanded:
|
|
814
|
-
isPinned:
|
|
815
|
-
isHeld:
|
|
818
|
+
expanded: v,
|
|
819
|
+
isPinned: y,
|
|
820
|
+
isHeld: b,
|
|
816
821
|
graspHeld: x,
|
|
817
|
-
isTransitioning:
|
|
818
|
-
expand:
|
|
819
|
-
collapse:
|
|
820
|
-
keepOpen:
|
|
821
|
-
release:
|
|
822
|
-
}), (e, t) => (G(),
|
|
822
|
+
isTransitioning: g,
|
|
823
|
+
expand: I,
|
|
824
|
+
collapse: L,
|
|
825
|
+
keepOpen: O,
|
|
826
|
+
release: j
|
|
827
|
+
}), (e, t) => (G(), N("div", R({
|
|
823
828
|
ref_key: "dockEl",
|
|
824
829
|
ref: c
|
|
825
830
|
}, e.$attrs, {
|
|
@@ -827,127 +832,130 @@ var We = ["data-backdrop-mode", "data-held"], Ge = ["data-held"], Ke = { class:
|
|
|
827
832
|
Y(a),
|
|
828
833
|
`shape-${Y(i)}`,
|
|
829
834
|
{
|
|
830
|
-
expanded:
|
|
831
|
-
collapsed: !
|
|
832
|
-
pinned: Y(
|
|
835
|
+
expanded: V.value,
|
|
836
|
+
collapsed: !V.value,
|
|
837
|
+
pinned: Y(y),
|
|
833
838
|
"fit-content": Y(s),
|
|
834
839
|
"always-expanded": Y(o)
|
|
835
840
|
}
|
|
836
841
|
]],
|
|
837
842
|
"data-backdrop-mode": n.backdropMode,
|
|
838
843
|
"data-held": Y(x) || void 0,
|
|
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(
|
|
844
|
+
onMouseenter: t[2] ||= (...e) => Y(C) && Y(C)(...e),
|
|
845
|
+
onMouseleave: t[3] ||= (e) => Y(w)(e),
|
|
846
|
+
onFocusin: t[4] ||= (...e) => Y(T) && Y(T)(...e),
|
|
847
|
+
onFocusout: t[5] ||= (...e) => Y(E) && Y(E)(...e),
|
|
848
|
+
onPointerdownCapture: t[6] ||= (...e) => Y(te) && Y(te)(...e),
|
|
849
|
+
onPointercancelCapture: t[7] ||= (...e) => Y(ne) && Y(ne)(...e),
|
|
850
|
+
onClickCapture: t[8] ||= (...e) => Y(re) && Y(re)(...e)
|
|
846
851
|
}), [
|
|
847
|
-
|
|
852
|
+
P("div", {
|
|
848
853
|
class: "dock-plate",
|
|
849
854
|
"aria-hidden": "true",
|
|
850
855
|
"data-held": Y(x) || void 0
|
|
851
|
-
}, [
|
|
856
|
+
}, [se.value ? (G(), N(k, { key: 0 }, [t[9] ||= P("span", {
|
|
852
857
|
class: "glass-grasp-carrier",
|
|
853
858
|
"data-grasp": "rest"
|
|
854
|
-
}, null, -1),
|
|
859
|
+
}, null, -1), P("span", {
|
|
855
860
|
class: "glass-grasp-carrier",
|
|
856
861
|
"data-grasp": "grasp",
|
|
857
|
-
onTransitionend:
|
|
858
|
-
}, null, 32)], 64)) :
|
|
859
|
-
|
|
860
|
-
e.$slots.persistent ? (G(),
|
|
861
|
-
|
|
862
|
+
onTransitionend: ce
|
|
863
|
+
}, null, 32)], 64)) : M("", !0)], 8, Je),
|
|
864
|
+
P("div", Ye, [
|
|
865
|
+
e.$slots.persistent ? (G(), N("div", Xe, [J(e.$slots, "persistent")])) : M("", !0),
|
|
866
|
+
P("div", {
|
|
862
867
|
ref_key: "layersEl",
|
|
863
|
-
ref:
|
|
868
|
+
ref: u,
|
|
864
869
|
class: "dock-layers"
|
|
865
870
|
}, [
|
|
866
|
-
|
|
871
|
+
P("div", {
|
|
867
872
|
ref_key: "fullEl",
|
|
868
|
-
ref:
|
|
869
|
-
id: `${
|
|
873
|
+
ref: p,
|
|
874
|
+
id: `${_}-full`,
|
|
870
875
|
role: "toolbar",
|
|
871
876
|
"aria-orientation": Y(a),
|
|
872
|
-
class:
|
|
873
|
-
"is-active": Y(
|
|
874
|
-
"is-leaving": Y(
|
|
875
|
-
"is-press-keepalive": Y(
|
|
877
|
+
class: B(["dock-layer dock-layer--full dock-run", {
|
|
878
|
+
"is-active": Y(H) === "full",
|
|
879
|
+
"is-leaving": Y(U) === "full" || Y($) === "full" && Y(H) !== "full",
|
|
880
|
+
"is-press-keepalive": Y($) === "full"
|
|
876
881
|
}]),
|
|
877
|
-
inert: Y(
|
|
882
|
+
inert: Y(H) !== "full" && Y($) !== "full" || void 0,
|
|
878
883
|
tabindex: "-1",
|
|
879
|
-
onKeydown:
|
|
880
|
-
}, [
|
|
881
|
-
|
|
884
|
+
onKeydown: K
|
|
885
|
+
}, [F(Y(f), null, {
|
|
886
|
+
default: Q(() => [J(e.$slots, "default")]),
|
|
887
|
+
_: 3
|
|
888
|
+
})], 42, Ze),
|
|
889
|
+
P("div", {
|
|
882
890
|
ref_key: "summaryEl",
|
|
883
|
-
ref:
|
|
884
|
-
id: `${
|
|
885
|
-
class:
|
|
886
|
-
"is-active": Y(
|
|
887
|
-
"is-leaving": Y(
|
|
891
|
+
ref: m,
|
|
892
|
+
id: `${_}-summary`,
|
|
893
|
+
class: B(["dock-layer dock-layer--summary", {
|
|
894
|
+
"is-active": Y(H) === "summary",
|
|
895
|
+
"is-leaving": Y(U) === "summary"
|
|
888
896
|
}]),
|
|
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(),
|
|
897
|
+
inert: Y(H) !== "summary" || void 0,
|
|
898
|
+
role: W.value ? "button" : void 0,
|
|
899
|
+
tabindex: W.value ? 0 : void 0,
|
|
900
|
+
"aria-label": W.value ? "Expand dock" : void 0,
|
|
901
|
+
"aria-expanded": W.value ? "false" : void 0,
|
|
902
|
+
"aria-controls": W.value ? `${_}-full` : void 0,
|
|
903
|
+
onFocusin: t[0] ||= oe(() => {}, ["stop"]),
|
|
904
|
+
onKeydown: ee,
|
|
905
|
+
onClick: t[1] ||= (...e) => Y(D) && Y(D)(...e)
|
|
906
|
+
}, [J(e.$slots, "collapsed")], 42, Qe),
|
|
907
|
+
e.$slots.search ? (G(), N("div", $e, [J(e.$slots, "search")])) : M("", !0)
|
|
900
908
|
], 512),
|
|
901
|
-
e.$slots["persistent-end"] ? (G(),
|
|
909
|
+
e.$slots["persistent-end"] ? (G(), N("div", et, [J(e.$slots, "persistent-end")])) : M("", !0)
|
|
902
910
|
]),
|
|
903
|
-
|
|
911
|
+
P("div", {
|
|
904
912
|
ref_key: "statusEl",
|
|
905
|
-
ref:
|
|
913
|
+
ref: h,
|
|
906
914
|
class: "dock-run-status",
|
|
907
915
|
role: "status",
|
|
908
916
|
"aria-live": "polite"
|
|
909
917
|
}, null, 512)
|
|
910
|
-
], 16,
|
|
918
|
+
], 16, qe));
|
|
911
919
|
}
|
|
912
|
-
}),
|
|
913
|
-
function
|
|
914
|
-
|
|
920
|
+
}), nt = c("glass-ui:dock-switcher-tablist"), { KEY: rt } = nt;
|
|
921
|
+
function it(e) {
|
|
922
|
+
nt.provide(e);
|
|
915
923
|
}
|
|
916
|
-
var
|
|
917
|
-
function
|
|
918
|
-
|
|
924
|
+
var at = nt.use, ot = s(p, "[glass-ui:dock] <DockLayer> must be used inside <DockCrossfade> (or <DockLayerGroup>)"), { KEY: st } = ot;
|
|
925
|
+
function ct(e) {
|
|
926
|
+
ot.provide(e);
|
|
919
927
|
}
|
|
920
|
-
var
|
|
928
|
+
var lt = ot.use, ut = /* @__PURE__ */ I({
|
|
921
929
|
__name: "DockCrossfade",
|
|
922
930
|
props: {
|
|
923
931
|
active: {},
|
|
924
932
|
reserve: { default: "block" }
|
|
925
933
|
},
|
|
926
934
|
setup(e, { expose: t }) {
|
|
927
|
-
let n = e, r = q(null), i = q(/* @__PURE__ */ new Map()), a =
|
|
935
|
+
let n = e, r = q(null), i = q(/* @__PURE__ */ new Map()), a = A(() => [...i.value.values()].map(({ id: e, label: t, icon: n }) => ({
|
|
928
936
|
id: e,
|
|
929
937
|
label: t,
|
|
930
938
|
icon: n
|
|
931
939
|
})));
|
|
932
940
|
function o(e) {
|
|
933
941
|
let t = new Map(i.value);
|
|
934
|
-
t.set(e.id, e), i.value = t,
|
|
942
|
+
t.set(e.id, e), i.value = t, f();
|
|
935
943
|
}
|
|
936
944
|
function s(e) {
|
|
937
945
|
if (!i.value.has(e)) return;
|
|
938
946
|
let t = new Map(i.value);
|
|
939
|
-
t.delete(e), i.value = t,
|
|
947
|
+
t.delete(e), i.value = t, f();
|
|
940
948
|
}
|
|
941
|
-
let c =
|
|
942
|
-
|
|
949
|
+
let c = A(() => n.active), l = q(null);
|
|
950
|
+
ct({
|
|
943
951
|
register: o,
|
|
944
952
|
unregister: s,
|
|
945
953
|
activeId: c,
|
|
946
954
|
leavingId: l,
|
|
947
955
|
faces: a
|
|
948
956
|
});
|
|
949
|
-
let u = q(0), d =
|
|
950
|
-
function
|
|
957
|
+
let u = q(0), d = A(() => n.reserve === "inline" ? "min-inline-size" : "min-block-size");
|
|
958
|
+
function f() {
|
|
951
959
|
let e = 0;
|
|
952
960
|
for (let { el: t } of i.value.values()) {
|
|
953
961
|
let r = n.reserve === "inline" ? t.scrollWidth : t.scrollHeight;
|
|
@@ -955,79 +963,79 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
955
963
|
}
|
|
956
964
|
e > u.value && (u.value = e);
|
|
957
965
|
}
|
|
958
|
-
let
|
|
966
|
+
let p = A(() => u.value > 0 ? {
|
|
959
967
|
[d.value]: `${u.value}px`,
|
|
960
968
|
"--dock-crossfade-peak": `${u.value}px`
|
|
961
969
|
} : void 0);
|
|
962
|
-
|
|
963
|
-
let
|
|
964
|
-
response:
|
|
965
|
-
dampingFraction:
|
|
970
|
+
y(r, () => f());
|
|
971
|
+
let m = Pe({
|
|
972
|
+
response: v.response,
|
|
973
|
+
dampingFraction: v.dampingFraction
|
|
966
974
|
});
|
|
967
|
-
function
|
|
975
|
+
function h(e) {
|
|
968
976
|
return e ? i.value.get(e)?.el : void 0;
|
|
969
977
|
}
|
|
970
|
-
function
|
|
971
|
-
|
|
978
|
+
function g(e, t) {
|
|
979
|
+
h(e)?.style.setProperty("--dock-t", `${t}`);
|
|
972
980
|
}
|
|
973
|
-
function
|
|
974
|
-
|
|
981
|
+
function _(e) {
|
|
982
|
+
h(e)?.style.removeProperty("--dock-t");
|
|
975
983
|
}
|
|
976
984
|
function b(e) {
|
|
977
985
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
978
986
|
}
|
|
979
|
-
let x =
|
|
987
|
+
let x = he("(prefers-reduced-motion: reduce)"), S = null, C = 1;
|
|
980
988
|
Z(x, (e) => {
|
|
981
|
-
e && (
|
|
989
|
+
e && (m.dispose(), S?.());
|
|
982
990
|
});
|
|
983
991
|
async function w(e, t) {
|
|
984
992
|
if (typeof document > "u") return;
|
|
985
|
-
let n =
|
|
986
|
-
!n || !r || !n.contains(r) || (await
|
|
993
|
+
let n = h(e), r = document.activeElement;
|
|
994
|
+
!n || !r || !n.contains(r) || (await z(), (h(t) ?? document.body).focus?.());
|
|
987
995
|
}
|
|
988
996
|
return Z(c, (e, t) => {
|
|
989
997
|
if (e === t) return;
|
|
990
|
-
|
|
991
|
-
let n =
|
|
998
|
+
f();
|
|
999
|
+
let n = h(e), i = h(t);
|
|
992
1000
|
if (!n || !i) {
|
|
993
|
-
l.value = null,
|
|
1001
|
+
l.value = null, _(e), C = 1;
|
|
994
1002
|
return;
|
|
995
1003
|
}
|
|
996
1004
|
let a = l.value, o = Number.parseFloat(n.style.getPropertyValue("--dock-t")), s = Number.parseFloat(i.style.getPropertyValue("--dock-t")), c = a === e && Number.isFinite(o) ? 1 - b(o) : 0, u = Number.isFinite(s) ? b(s) : 1;
|
|
997
|
-
a && a !== e && a !== t &&
|
|
1005
|
+
a && a !== e && a !== t && _(a), l.value = t, g(e, c), g(t, 1 - u), w(t, e), r.value?.setAttribute("data-crossfading", "");
|
|
998
1006
|
let d = () => {
|
|
999
|
-
|
|
1007
|
+
_(e), _(t), r.value?.removeAttribute("data-crossfading"), l.value = null, C = 1, S === d && (S = null);
|
|
1000
1008
|
};
|
|
1001
1009
|
if (S = d, x.value) {
|
|
1002
1010
|
d();
|
|
1003
1011
|
return;
|
|
1004
1012
|
}
|
|
1005
|
-
let
|
|
1006
|
-
C = 1 - c,
|
|
1007
|
-
inheritVelocityScale:
|
|
1013
|
+
let p = u > .001 ? -C / u : 0;
|
|
1014
|
+
C = 1 - c, m.playTo(0, 1, {
|
|
1015
|
+
inheritVelocityScale: p,
|
|
1008
1016
|
onFrame: (n) => {
|
|
1009
|
-
|
|
1017
|
+
g(e, b(c + (1 - c) * n)), g(t, b(1 - u * (1 - n)));
|
|
1010
1018
|
},
|
|
1011
1019
|
onSettle: d
|
|
1012
1020
|
});
|
|
1013
|
-
}),
|
|
1014
|
-
|
|
1015
|
-
}), t({ faces: a }), (e, t) => (G(),
|
|
1021
|
+
}), H(() => {
|
|
1022
|
+
m.dispose(), S = null;
|
|
1023
|
+
}), t({ faces: a }), (e, t) => (G(), N("div", {
|
|
1016
1024
|
ref_key: "rootEl",
|
|
1017
1025
|
ref: r,
|
|
1018
1026
|
class: "dock-crossfade",
|
|
1019
|
-
style:
|
|
1027
|
+
style: V(p.value)
|
|
1020
1028
|
}, [J(e.$slots, "default")], 4));
|
|
1021
1029
|
}
|
|
1022
|
-
}),
|
|
1030
|
+
}), dt = ["data-motion"], ft = ["aria-orientation"], pt = [
|
|
1023
1031
|
"id",
|
|
1024
1032
|
"tabindex",
|
|
1025
1033
|
"aria-controls",
|
|
1026
1034
|
"aria-label",
|
|
1027
1035
|
"onClick"
|
|
1028
|
-
],
|
|
1036
|
+
], mt = { key: 1 }, ht = { key: 2 }, gt = /* @__PURE__ */ I({
|
|
1029
1037
|
__name: "DockLayerGroup",
|
|
1030
|
-
props: /*@__PURE__*/
|
|
1038
|
+
props: /*@__PURE__*/ L({
|
|
1031
1039
|
orientation: {},
|
|
1032
1040
|
showSwitcher: {
|
|
1033
1041
|
type: Boolean,
|
|
@@ -1041,39 +1049,39 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1041
1049
|
}),
|
|
1042
1050
|
emits: ["update:active"],
|
|
1043
1051
|
setup(e) {
|
|
1044
|
-
let t = e, n = o(() => t.motion), r =
|
|
1045
|
-
options:
|
|
1052
|
+
let t = e, n = o(() => t.motion), r = ae(e, "active"), i = _(), a = A(() => t.orientation ?? i?.orientation.value ?? "horizontal"), s = X("crossfade"), c = A(() => s.value?.faces ?? []), l = A(() => a.value === "vertical" ? "horizontal" : "vertical"), u = A(() => l.value === "vertical"), d = q(null), f = q(null), p = q([]), h = w({
|
|
1053
|
+
options: A(() => c.value.map((e) => ({ value: e.id }))),
|
|
1046
1054
|
model: r,
|
|
1047
1055
|
mode: "single",
|
|
1048
1056
|
role: "tablist",
|
|
1049
1057
|
vertical: u,
|
|
1050
1058
|
containerRef: d,
|
|
1051
1059
|
indicatorRef: f,
|
|
1052
|
-
buttonRefs:
|
|
1053
|
-
}),
|
|
1054
|
-
|
|
1055
|
-
isTablist:
|
|
1060
|
+
buttonRefs: p
|
|
1061
|
+
}), g = A(() => t.showSwitcher && c.value.length > 1), v = ie(), y = (e) => e.replace(/[^a-zA-Z0-9_-]/g, ""), b = (e) => `dock-tab-${v}-${y(e)}`, x = (e) => `dock-panel-${v}-${y(e)}`;
|
|
1062
|
+
it({
|
|
1063
|
+
isTablist: g,
|
|
1056
1064
|
tabId: b,
|
|
1057
1065
|
panelId: x
|
|
1058
1066
|
});
|
|
1059
|
-
let
|
|
1060
|
-
function
|
|
1067
|
+
let S = A(() => u.value ? "y" : "x");
|
|
1068
|
+
function C() {
|
|
1061
1069
|
let e = d.value;
|
|
1062
1070
|
if (!e) return [];
|
|
1063
1071
|
let t = Array.from(e.querySelectorAll(".dock-layer-tab"));
|
|
1064
1072
|
return c.value.map((e, n) => {
|
|
1065
|
-
let r = t[n]?.getBoundingClientRect(), i = r ?
|
|
1073
|
+
let r = t[n]?.getBoundingClientRect(), i = r ? S.value === "y" ? r.top + r.height / 2 : r.left + r.width / 2 : 0;
|
|
1066
1074
|
return {
|
|
1067
1075
|
value: e.id,
|
|
1068
1076
|
center: i
|
|
1069
1077
|
};
|
|
1070
1078
|
});
|
|
1071
1079
|
}
|
|
1072
|
-
let E =
|
|
1080
|
+
let E = T({
|
|
1073
1081
|
handle: d,
|
|
1074
1082
|
surface: f,
|
|
1075
|
-
axis: () =>
|
|
1076
|
-
snapTargets:
|
|
1083
|
+
axis: () => S.value,
|
|
1084
|
+
snapTargets: C,
|
|
1077
1085
|
onSnap: (e) => {
|
|
1078
1086
|
n.armed.value && r.value !== e && (r.value = e);
|
|
1079
1087
|
}
|
|
@@ -1083,75 +1091,75 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1083
1091
|
l.value,
|
|
1084
1092
|
n.armed.value
|
|
1085
1093
|
], () => {
|
|
1086
|
-
n.armed.value &&
|
|
1087
|
-
}),
|
|
1088
|
-
n.armed.value &&
|
|
1094
|
+
n.armed.value && z(() => E.refresh());
|
|
1095
|
+
}), U(() => {
|
|
1096
|
+
n.armed.value && z(() => E.refresh());
|
|
1089
1097
|
});
|
|
1090
1098
|
function D(e) {
|
|
1091
1099
|
return typeof e == "object" && !!e || typeof e == "function";
|
|
1092
1100
|
}
|
|
1093
|
-
let
|
|
1101
|
+
let O = m(() => i);
|
|
1094
1102
|
function I() {
|
|
1095
|
-
|
|
1103
|
+
O.acquire();
|
|
1096
1104
|
}
|
|
1097
|
-
function
|
|
1105
|
+
function L(e) {
|
|
1098
1106
|
let t = e.relatedTarget, n = e.currentTarget;
|
|
1099
|
-
t && n?.contains(t) ||
|
|
1107
|
+
t && n?.contains(t) || O.release();
|
|
1100
1108
|
}
|
|
1101
|
-
return (t, i) => (G(),
|
|
1102
|
-
class:
|
|
1109
|
+
return (t, i) => (G(), N("div", {
|
|
1110
|
+
class: B(["dock-layer-group", [a.value, `switcher-${e.switcherPosition}`]]),
|
|
1103
1111
|
"data-motion": Y(n).dataMotion.value,
|
|
1104
|
-
style:
|
|
1105
|
-
}, [
|
|
1112
|
+
style: V(Y(n).hostStyle.value)
|
|
1113
|
+
}, [g.value ? (G(), N("div", {
|
|
1106
1114
|
key: 0,
|
|
1107
1115
|
ref_key: "switcherListEl",
|
|
1108
1116
|
ref: d,
|
|
1109
1117
|
role: "tablist",
|
|
1110
|
-
class:
|
|
1118
|
+
class: B(["dock-layer-switcher", [e.switcherPosition, Y(n).armed.value && "glass-drag-grabbable"]]),
|
|
1111
1119
|
"aria-orientation": l.value,
|
|
1112
|
-
onKeydown: i[0] ||= (...e) => Y(
|
|
1120
|
+
onKeydown: i[0] ||= (...e) => Y(h).onKeydown && Y(h).onKeydown(...e),
|
|
1113
1121
|
onFocusin: I,
|
|
1114
|
-
onFocusout:
|
|
1115
|
-
}, [(G(!0),
|
|
1122
|
+
onFocusout: L
|
|
1123
|
+
}, [(G(!0), N(k, null, te(c.value, (e, t) => (G(), N("button", R({
|
|
1116
1124
|
key: e.id,
|
|
1117
1125
|
ref_for: !0,
|
|
1118
1126
|
ref: (e) => {
|
|
1119
|
-
e && (
|
|
1127
|
+
e && (p.value[t] = e);
|
|
1120
1128
|
},
|
|
1121
1129
|
type: "button",
|
|
1122
1130
|
class: "dock-layer-tab",
|
|
1123
1131
|
id: b(e.id),
|
|
1124
|
-
tabindex: Y(
|
|
1125
|
-
}, { ref_for: !0 }, Y(
|
|
1132
|
+
tabindex: Y(h).rovingTabindex(t)
|
|
1133
|
+
}, { ref_for: !0 }, Y(h).itemAttrs(e.id), {
|
|
1126
1134
|
"aria-controls": x(e.id),
|
|
1127
1135
|
"aria-label": e.label ?? e.id,
|
|
1128
|
-
onClick: (n) => Y(
|
|
1129
|
-
}), [D(e.icon) ? (G(),
|
|
1136
|
+
onClick: (n) => Y(h).select(e.id, t)
|
|
1137
|
+
}), [D(e.icon) ? (G(), j(ne(e.icon), {
|
|
1130
1138
|
key: 0,
|
|
1131
1139
|
class: "size-4"
|
|
1132
|
-
})) : typeof e.icon == "string" ? (G(),
|
|
1140
|
+
})) : typeof e.icon == "string" ? (G(), N("span", mt, re(e.icon), 1)) : (G(), N("span", ht, re((e.label ?? e.id).charAt(0)), 1))], 16, pt))), 128)), P("div", {
|
|
1133
1141
|
ref_key: "switcherIndicatorEl",
|
|
1134
1142
|
ref: f,
|
|
1135
|
-
class:
|
|
1136
|
-
style:
|
|
1143
|
+
class: B(["dock-layer-tab-indicator", Y(n).armed.value && Y(E).dragging.value && "glass-drag-lift"]),
|
|
1144
|
+
style: V(Y(h).singleSliderStyle.value),
|
|
1137
1145
|
"aria-hidden": "true"
|
|
1138
|
-
}, null, 6)], 42,
|
|
1146
|
+
}, null, 6)], 42, ft)) : M("", !0), F(ut, {
|
|
1139
1147
|
ref_key: "crossfade",
|
|
1140
1148
|
ref: s,
|
|
1141
1149
|
active: r.value
|
|
1142
1150
|
}, {
|
|
1143
1151
|
default: Q(() => [J(t.$slots, "default")]),
|
|
1144
1152
|
_: 3
|
|
1145
|
-
}, 8, ["active"])], 14,
|
|
1153
|
+
}, 8, ["active"])], 14, dt));
|
|
1146
1154
|
}
|
|
1147
|
-
}),
|
|
1155
|
+
}), _t = [
|
|
1148
1156
|
"role",
|
|
1149
1157
|
"id",
|
|
1150
1158
|
"aria-labelledby",
|
|
1151
1159
|
"inert",
|
|
1152
1160
|
"aria-hidden",
|
|
1153
1161
|
"tabindex"
|
|
1154
|
-
],
|
|
1162
|
+
], vt = { class: "dock-face-content" }, yt = /* @__PURE__ */ I({
|
|
1155
1163
|
__name: "DockLayer",
|
|
1156
1164
|
props: {
|
|
1157
1165
|
id: {},
|
|
@@ -1159,8 +1167,8 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1159
1167
|
icon: {}
|
|
1160
1168
|
},
|
|
1161
1169
|
setup(e) {
|
|
1162
|
-
let t = e, n =
|
|
1163
|
-
|
|
1170
|
+
let t = e, n = lt(), r = X("hostEl");
|
|
1171
|
+
U(() => {
|
|
1164
1172
|
r.value && n.register({
|
|
1165
1173
|
id: t.id,
|
|
1166
1174
|
label: t.label,
|
|
@@ -1178,12 +1186,12 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1178
1186
|
icon: t.icon,
|
|
1179
1187
|
el: r.value
|
|
1180
1188
|
});
|
|
1181
|
-
}),
|
|
1182
|
-
let i =
|
|
1183
|
-
return (e, t) => (G(),
|
|
1189
|
+
}), H(() => n.unregister(t.id));
|
|
1190
|
+
let i = A(() => n.activeId.value === t.id), a = A(() => n.leavingId.value === t.id), o = at(), 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);
|
|
1191
|
+
return (e, t) => (G(), N("div", {
|
|
1184
1192
|
ref_key: "hostEl",
|
|
1185
1193
|
ref: r,
|
|
1186
|
-
class:
|
|
1194
|
+
class: B(["dock-face", {
|
|
1187
1195
|
"is-active": i.value,
|
|
1188
1196
|
"is-leaving": a.value
|
|
1189
1197
|
}]),
|
|
@@ -1193,9 +1201,9 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1193
1201
|
inert: !i.value || void 0,
|
|
1194
1202
|
"aria-hidden": !i.value || void 0,
|
|
1195
1203
|
tabindex: i.value ? -1 : void 0
|
|
1196
|
-
}, [
|
|
1204
|
+
}, [P("div", vt, [J(e.$slots, "default")])], 10, _t));
|
|
1197
1205
|
}
|
|
1198
|
-
}),
|
|
1206
|
+
}), bt = /* @__PURE__ */ I({
|
|
1199
1207
|
__name: "DockControl",
|
|
1200
1208
|
props: {
|
|
1201
1209
|
shape: { default: "icon" },
|
|
@@ -1226,13 +1234,13 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1226
1234
|
] }
|
|
1227
1235
|
},
|
|
1228
1236
|
setup(t) {
|
|
1229
|
-
let r = t, o =
|
|
1237
|
+
let r = t, o = A(() => r.shape === "tab"), s = A(() => o.value ? e("dock-tab-button glass-specular-track", r.class) : e("dock-icon-button glass-specular-track glass-capsule-hover", { "glass-capsule": r.active }, { "dock-icon-button--compact": r.compact }, r.class)), c = A(() => ({
|
|
1230
1238
|
...r.active === void 0 ? {} : {
|
|
1231
1239
|
"aria-pressed": String(r.active),
|
|
1232
1240
|
...r.active ? { "data-active": "" } : {}
|
|
1233
1241
|
},
|
|
1234
1242
|
...r.disabled ? { "aria-disabled": "true" } : {}
|
|
1235
|
-
})), l =
|
|
1243
|
+
})), l = A(() => !r.asChild && r.as === "button" ? { type: r.type } : {}), u = i("press"), d = a({
|
|
1236
1244
|
disabled: () => r.disabled || o.value,
|
|
1237
1245
|
squish: !0,
|
|
1238
1246
|
response: u.response,
|
|
@@ -1240,11 +1248,11 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1240
1248
|
pressVar: "--dock-press-t",
|
|
1241
1249
|
shrinkDepth: .04,
|
|
1242
1250
|
maxStretch: 1.03
|
|
1243
|
-
}), f =
|
|
1251
|
+
}), f = A(() => o.value ? {} : { ...d.pressStyle.value });
|
|
1244
1252
|
function p(e) {
|
|
1245
1253
|
r.disabled && (e.preventDefault(), e.stopImmediatePropagation());
|
|
1246
1254
|
}
|
|
1247
|
-
return (e, r) => $((G(),
|
|
1255
|
+
return (e, r) => $((G(), j(Y(ce), R({
|
|
1248
1256
|
as: t.as,
|
|
1249
1257
|
"as-child": t.asChild
|
|
1250
1258
|
}, {
|
|
@@ -1282,7 +1290,7 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1282
1290
|
"onBlur"
|
|
1283
1291
|
])), [[Y(n)]]);
|
|
1284
1292
|
}
|
|
1285
|
-
}),
|
|
1293
|
+
}), xt = /* @__PURE__ */ I({
|
|
1286
1294
|
inheritAttrs: !1,
|
|
1287
1295
|
__name: "DockTrigger",
|
|
1288
1296
|
props: {
|
|
@@ -1296,28 +1304,28 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1296
1304
|
] }
|
|
1297
1305
|
},
|
|
1298
1306
|
setup(t) {
|
|
1299
|
-
let r = t, i =
|
|
1300
|
-
return (e, t) => r.for === "select" ? $((G(),
|
|
1301
|
-
default: Q(() => [J(e.$slots, "default"),
|
|
1302
|
-
default: Q(() => [J(e.$slots, "icon", {}, () => [
|
|
1307
|
+
let r = t, i = A(() => e("dock-trigger", r.for === "select" && "dock-select-trigger", r.for !== "select" && "dock-dropdown-trigger", r.class));
|
|
1308
|
+
return (e, t) => r.for === "select" ? $((G(), j(Y(ue), R({ key: 0 }, e.$attrs, { class: i.value }), {
|
|
1309
|
+
default: Q(() => [J(e.$slots, "default"), F(Y(le), { "as-child": "" }, {
|
|
1310
|
+
default: Q(() => [J(e.$slots, "icon", {}, () => [F(Y(de), {
|
|
1303
1311
|
class: "dock-select-trigger__chevron",
|
|
1304
1312
|
"aria-hidden": "true"
|
|
1305
1313
|
})])]),
|
|
1306
1314
|
_: 3
|
|
1307
1315
|
})]),
|
|
1308
1316
|
_: 3
|
|
1309
|
-
}, 16, ["class"])), [[Y(n)]]) : r.for === "dropdown" ? $((G(),
|
|
1317
|
+
}, 16, ["class"])), [[Y(n)]]) : r.for === "dropdown" ? $((G(), j(C, R({ key: 1 }, e.$attrs, {
|
|
1310
1318
|
action: "pointerdown",
|
|
1311
1319
|
class: i.value
|
|
1312
1320
|
}), {
|
|
1313
1321
|
default: Q(() => [J(e.$slots, "default")]),
|
|
1314
1322
|
_: 3
|
|
1315
|
-
}, 16, ["class"])), [[Y(n)]]) : $((G(),
|
|
1323
|
+
}, 16, ["class"])), [[Y(n)]]) : $((G(), j(Y(se), R({ key: 2 }, e.$attrs, { class: i.value }), {
|
|
1316
1324
|
default: Q(() => [J(e.$slots, "default")]),
|
|
1317
1325
|
_: 3
|
|
1318
1326
|
}, 16, ["class"])), [[Y(n)]]);
|
|
1319
1327
|
}
|
|
1320
|
-
}),
|
|
1328
|
+
}), St = /* @__PURE__ */ I({
|
|
1321
1329
|
__name: "DockBackgroundToggle",
|
|
1322
1330
|
props: {
|
|
1323
1331
|
paused: {
|
|
@@ -1329,22 +1337,22 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1329
1337
|
},
|
|
1330
1338
|
emits: ["update:paused"],
|
|
1331
1339
|
setup(e, { emit: t }) {
|
|
1332
|
-
let n = e, r = t, i =
|
|
1340
|
+
let n = e, r = t, i = A(() => n.paused ? n.playLabel : n.pauseLabel);
|
|
1333
1341
|
function a() {
|
|
1334
1342
|
r("update:paused", !n.paused);
|
|
1335
1343
|
}
|
|
1336
|
-
return (t, n) => (G(),
|
|
1344
|
+
return (t, n) => (G(), j(bt, {
|
|
1337
1345
|
type: "button",
|
|
1338
1346
|
active: e.paused,
|
|
1339
1347
|
"aria-pressed": e.paused,
|
|
1340
1348
|
"aria-label": i.value,
|
|
1341
1349
|
onClick: a
|
|
1342
1350
|
}, {
|
|
1343
|
-
default: Q(() => [e.paused ? (G(),
|
|
1351
|
+
default: Q(() => [e.paused ? (G(), j(Y(pe), {
|
|
1344
1352
|
key: 0,
|
|
1345
1353
|
size: 18,
|
|
1346
1354
|
"aria-hidden": "true"
|
|
1347
|
-
})) : (G(),
|
|
1355
|
+
})) : (G(), j(Y(fe), {
|
|
1348
1356
|
key: 1,
|
|
1349
1357
|
size: 18,
|
|
1350
1358
|
"aria-hidden": "true"
|
|
@@ -1356,30 +1364,30 @@ var ot = rt.use, st = /* @__PURE__ */ F({
|
|
|
1356
1364
|
"aria-label"
|
|
1357
1365
|
]));
|
|
1358
1366
|
}
|
|
1359
|
-
}),
|
|
1367
|
+
}), Ct = [
|
|
1360
1368
|
"data-orientation",
|
|
1361
1369
|
"data-dock-hairline",
|
|
1362
1370
|
"aria-orientation"
|
|
1363
|
-
],
|
|
1371
|
+
], wt = /* @__PURE__ */ I({
|
|
1364
1372
|
__name: "DockSeparator",
|
|
1365
1373
|
props: { anchor: {
|
|
1366
1374
|
type: Boolean,
|
|
1367
1375
|
default: !1
|
|
1368
1376
|
} },
|
|
1369
1377
|
setup(e) {
|
|
1370
|
-
let t =
|
|
1371
|
-
return (t, n) => (G(),
|
|
1372
|
-
class:
|
|
1378
|
+
let t = _(), n = A(() => t?.orientation.value ?? "horizontal"), r = A(() => n.value), i = A(() => n.value === "vertical" ? "horizontal" : "vertical");
|
|
1379
|
+
return (t, n) => (G(), N("div", {
|
|
1380
|
+
class: B(["dock-separator", { "dock-hairline": e.anchor }]),
|
|
1373
1381
|
role: "separator",
|
|
1374
1382
|
"data-orientation": r.value,
|
|
1375
1383
|
"data-dock-hairline": e.anchor || void 0,
|
|
1376
1384
|
"aria-orientation": i.value
|
|
1377
|
-
}, null, 10,
|
|
1385
|
+
}, null, 10, Ct));
|
|
1378
1386
|
}
|
|
1379
1387
|
});
|
|
1380
1388
|
//#endregion
|
|
1381
1389
|
//#region src/composables/search/match.ts
|
|
1382
|
-
function
|
|
1390
|
+
function Tt(e, t) {
|
|
1383
1391
|
let n = e.length, r = t.length;
|
|
1384
1392
|
if (n === 0) return {
|
|
1385
1393
|
score: 0,
|
|
@@ -1403,11 +1411,11 @@ function St(e, t) {
|
|
|
1403
1411
|
matches: i
|
|
1404
1412
|
});
|
|
1405
1413
|
}
|
|
1406
|
-
function
|
|
1414
|
+
function Et(e, t) {
|
|
1407
1415
|
if (!t) return null;
|
|
1408
1416
|
let n = 0, r = [];
|
|
1409
1417
|
for (let i of e) {
|
|
1410
|
-
let e =
|
|
1418
|
+
let e = Tt(i, t);
|
|
1411
1419
|
if (!e) return null;
|
|
1412
1420
|
n += e.score;
|
|
1413
1421
|
for (let t of e.matches) r.push(t);
|
|
@@ -1417,7 +1425,7 @@ function Ct(e, t) {
|
|
|
1417
1425
|
matches: r
|
|
1418
1426
|
};
|
|
1419
1427
|
}
|
|
1420
|
-
function
|
|
1428
|
+
function Dt(e, t) {
|
|
1421
1429
|
let n = null, r = [], i = [
|
|
1422
1430
|
[t._lc.label, 12],
|
|
1423
1431
|
[t._lc.type, 10],
|
|
@@ -1425,7 +1433,7 @@ function wt(e, t) {
|
|
|
1425
1433
|
];
|
|
1426
1434
|
for (let [a, o] of i) {
|
|
1427
1435
|
if (!a) continue;
|
|
1428
|
-
let i =
|
|
1436
|
+
let i = Et(e, a);
|
|
1429
1437
|
if (!i) continue;
|
|
1430
1438
|
let s = i.score * o;
|
|
1431
1439
|
(n === null || s > n) && (n = s, r = a === t._lc.label ? i.matches : []);
|
|
@@ -1435,7 +1443,7 @@ function wt(e, t) {
|
|
|
1435
1443
|
matches: r
|
|
1436
1444
|
};
|
|
1437
1445
|
}
|
|
1438
|
-
function
|
|
1446
|
+
function Ot(e) {
|
|
1439
1447
|
return e.map((e) => ({
|
|
1440
1448
|
item: e,
|
|
1441
1449
|
_lc: {
|
|
@@ -1445,15 +1453,15 @@ function Tt(e) {
|
|
|
1445
1453
|
}
|
|
1446
1454
|
}));
|
|
1447
1455
|
}
|
|
1448
|
-
var
|
|
1449
|
-
function
|
|
1450
|
-
let t =
|
|
1451
|
-
return t || (t = /* @__PURE__ */ new Map(),
|
|
1456
|
+
var kt = /* @__PURE__ */ new WeakMap();
|
|
1457
|
+
function At(e) {
|
|
1458
|
+
let t = kt.get(e);
|
|
1459
|
+
return t || (t = /* @__PURE__ */ new Map(), kt.set(e, t)), t;
|
|
1452
1460
|
}
|
|
1453
|
-
function
|
|
1461
|
+
function jt(e, t, n = 30) {
|
|
1454
1462
|
let r = t.toLowerCase().trim();
|
|
1455
1463
|
if (!r) return [];
|
|
1456
|
-
let i =
|
|
1464
|
+
let i = At(e), a = i.get(r);
|
|
1457
1465
|
if (a) return a.slice(0, n);
|
|
1458
1466
|
i.size > 200 && i.clear();
|
|
1459
1467
|
let o = r.split(/\s+/).filter(Boolean);
|
|
@@ -1472,7 +1480,7 @@ function Ot(e, t, n = 30) {
|
|
|
1472
1480
|
}
|
|
1473
1481
|
let c = [];
|
|
1474
1482
|
for (let e of s) {
|
|
1475
|
-
let t =
|
|
1483
|
+
let t = Dt(o, e);
|
|
1476
1484
|
t && c.push({
|
|
1477
1485
|
item: e.item,
|
|
1478
1486
|
score: t.score,
|
|
@@ -1481,17 +1489,17 @@ function Ot(e, t, n = 30) {
|
|
|
1481
1489
|
}
|
|
1482
1490
|
return c.sort((e, t) => t.score - e.score), i.set(r, c), c.slice(0, n);
|
|
1483
1491
|
}
|
|
1484
|
-
function
|
|
1492
|
+
function Mt(e) {
|
|
1485
1493
|
if (e) {
|
|
1486
|
-
|
|
1494
|
+
kt.delete(e);
|
|
1487
1495
|
return;
|
|
1488
1496
|
}
|
|
1489
|
-
|
|
1497
|
+
kt = /* @__PURE__ */ new WeakMap();
|
|
1490
1498
|
}
|
|
1491
1499
|
//#endregion
|
|
1492
1500
|
//#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 =
|
|
1501
|
+
function Nt(e) {
|
|
1502
|
+
let t = typeof e.items == "function" ? e.items : () => e.items, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i = q(""), a = q(!1), o = q(!1), s = q(0), c = q(""), l = A(() => t()), u = A(() => Ot(l.value)), d;
|
|
1495
1503
|
function f(e = d) {
|
|
1496
1504
|
e !== void 0 && (clearTimeout(e), d === e && (d = void 0));
|
|
1497
1505
|
}
|
|
@@ -1507,7 +1515,7 @@ function At(e) {
|
|
|
1507
1515
|
}), Z(l, () => {
|
|
1508
1516
|
f(), c.value = i.value, s.value = 0;
|
|
1509
1517
|
}, { deep: !0 });
|
|
1510
|
-
let p =
|
|
1518
|
+
let p = A(() => jt(u.value, c.value, r));
|
|
1511
1519
|
Z(p, () => {
|
|
1512
1520
|
s.value = 0;
|
|
1513
1521
|
});
|
|
@@ -1515,7 +1523,7 @@ function At(e) {
|
|
|
1515
1523
|
e.onSelect?.(t), h();
|
|
1516
1524
|
}
|
|
1517
1525
|
function h() {
|
|
1518
|
-
a.value = !1, o.value = !1, f(), i.value = "", c.value = "", s.value = 0,
|
|
1526
|
+
a.value = !1, o.value = !1, f(), i.value = "", c.value = "", s.value = 0, Mt(u.value);
|
|
1519
1527
|
}
|
|
1520
1528
|
function g() {
|
|
1521
1529
|
a.value = !0;
|
|
@@ -1539,8 +1547,8 @@ function At(e) {
|
|
|
1539
1547
|
break;
|
|
1540
1548
|
}
|
|
1541
1549
|
}
|
|
1542
|
-
return
|
|
1543
|
-
f(),
|
|
1550
|
+
return W(() => {
|
|
1551
|
+
f(), Mt(u.value);
|
|
1544
1552
|
}, !0), {
|
|
1545
1553
|
query: i,
|
|
1546
1554
|
results: p,
|
|
@@ -1556,13 +1564,13 @@ function At(e) {
|
|
|
1556
1564
|
}
|
|
1557
1565
|
//#endregion
|
|
1558
1566
|
//#region src/components/dock/composables/useDockSearch.ts
|
|
1559
|
-
function
|
|
1567
|
+
function Pt(e) {
|
|
1560
1568
|
let { dockState: t } = e, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i = q([]), a = null, o = e.items ? e.items : () => i.value;
|
|
1561
1569
|
function s(t) {
|
|
1562
1570
|
let n = t.item.id;
|
|
1563
1571
|
e.ensureTargetWindow?.(n), e.scrollTo?.(n), e.onResultSelect?.(t);
|
|
1564
1572
|
}
|
|
1565
|
-
let c =
|
|
1573
|
+
let c = Nt({
|
|
1566
1574
|
items: o,
|
|
1567
1575
|
debounceMs: n,
|
|
1568
1576
|
maxResults: r,
|
|
@@ -1583,7 +1591,7 @@ function jt(e) {
|
|
|
1583
1591
|
});
|
|
1584
1592
|
});
|
|
1585
1593
|
}
|
|
1586
|
-
let l =
|
|
1594
|
+
let l = A(() => {
|
|
1587
1595
|
let e = c.query.value;
|
|
1588
1596
|
if (!e) return "";
|
|
1589
1597
|
let t = c.results.value[0];
|
|
@@ -1595,28 +1603,28 @@ function jt(e) {
|
|
|
1595
1603
|
let e = l.value;
|
|
1596
1604
|
e && (c.query.value = c.query.value + e);
|
|
1597
1605
|
}
|
|
1598
|
-
let d =
|
|
1599
|
-
function
|
|
1606
|
+
let d = m(() => t), f = d.isHeld;
|
|
1607
|
+
function p() {
|
|
1600
1608
|
f.value || (t.expand(), d.acquire(), c.open());
|
|
1601
1609
|
}
|
|
1602
1610
|
function h() {
|
|
1603
1611
|
f.value && (c.close(), d.release());
|
|
1604
1612
|
}
|
|
1605
1613
|
let g = null;
|
|
1606
|
-
return e.collapseOnScroll && e.scrollContainer && (g =
|
|
1614
|
+
return e.collapseOnScroll && e.scrollContainer && (g = O(e.scrollContainer, {
|
|
1607
1615
|
collapseOnScroll: !0,
|
|
1608
1616
|
chromeRef: e.chromeRef
|
|
1609
|
-
})),
|
|
1617
|
+
})), W(() => {
|
|
1610
1618
|
a?.abort(), a = null;
|
|
1611
1619
|
}), {
|
|
1612
1620
|
fuzzy: c,
|
|
1613
1621
|
autocompleteText: l,
|
|
1614
1622
|
scrollChrome: g,
|
|
1615
|
-
armSearch:
|
|
1623
|
+
armSearch: p,
|
|
1616
1624
|
disarmSearch: h,
|
|
1617
1625
|
acceptAutocomplete: u,
|
|
1618
1626
|
isSearchArmed: f
|
|
1619
1627
|
};
|
|
1620
1628
|
}
|
|
1621
1629
|
//#endregion
|
|
1622
|
-
export {
|
|
1630
|
+
export { g as DOCK_CONTEXT_KEY, St as DockBackgroundToggle, bt as DockControl, ut as DockCrossfade, yt as DockLayer, gt as DockLayerGroup, wt as DockSeparator, xt as DockTrigger, tt as GlassDock, l as provideDockContext, h as useDockContext, E as useDockCtaReceive, Pt as useDockSearch, _ as useOptionalDockContext };
|