@mkbabb/glass-ui 10.1.3 → 11.0.0
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 +1024 -1461
- package/README.md +2 -2
- package/dist/DialogContent-DG5kseRQ.js +159 -0
- package/dist/DropdownMenuTrigger-uhSXgEfK.js +76 -0
- package/dist/{Surface-1nPoabc3.js → Surface-C7wq2j0A.js} +3 -0
- package/dist/aurora.css +1 -0
- package/dist/aurora.js +246 -2472
- package/dist/auroraImageSource-xNLDUjcy.js +30 -0
- package/dist/axes.js +8 -8
- package/dist/blob.css +1 -0
- package/dist/blob.js +57 -54
- package/dist/budget-CJfhLIIV.js +13 -0
- package/dist/button-CAKhiOZy.js +113 -0
- package/dist/button.js +1 -1
- package/dist/{card-ByyqRBvK.js → card-D_uXphvL.js} +4 -1
- package/dist/card.js +1 -1
- package/dist/carousel.js +3 -2
- package/dist/{checkbox-B1qn65se.js → checkbox-COLnvULu.js} +1 -0
- package/dist/checkbox.css +1 -0
- package/dist/checkbox.js +1 -1
- package/dist/{collapsible-DFzK29Oh.js → collapsible-Bd4Et730.js} +1 -0
- package/dist/collapsible.css +1 -0
- package/dist/collapsible.js +1 -1
- package/dist/color-HkUaTAJj.js +270 -0
- package/dist/{color.glsl-DTJhdekG.js → color.glsl-bFJm8k5R.js} +4 -16
- package/dist/color.wgsl-B-qDJ_OM.js +4 -0
- package/dist/{command-CatrAsrl.js → command-BsFOGZwB.js} +3 -2
- package/dist/command.css +1 -0
- package/dist/command.js +1 -1
- package/dist/component-styles.css +0 -1
- package/dist/components/_shared/axes.d.ts +7 -0
- package/dist/components/_shared/feedback/dot-ring.css +1 -1
- package/dist/components/_shared/overlay/focus-return.d.ts +9 -0
- package/dist/components/_shared/overlay/index.d.ts +3 -0
- package/dist/components/_shared/overlay/root-scroll-lock.d.ts +4 -0
- package/dist/components/_shared/overlay/sheet-width.d.ts +2 -0
- package/dist/components/_shared/shape/useBarShape.d.ts +4 -0
- package/dist/components/aurora/composables/auroraFallbackGround.d.ts +12 -0
- package/dist/components/aurora/constants/presets.d.ts +21 -0
- package/dist/components/aurora/index.d.ts +2 -2
- package/dist/components/button/styles.css +1 -1
- package/dist/components/dark-mode-toggle/dark-mode-toggle.css +1 -1
- package/dist/components/data-table/composables/useDataTableResponsive.d.ts +2 -0
- package/dist/components/deck/styles/capture.css +1 -1
- package/dist/components/dialog/DialogContent.vue.d.ts +2 -2
- package/dist/components/dialog/ModalOverlay.vue.d.ts +2 -2
- package/dist/components/dialog/ModalScrim.vue.d.ts +26 -0
- package/dist/components/dialog/styles.css +1 -1
- package/dist/components/dock/GlassDock.vue.d.ts +4 -1
- package/dist/components/dock/composables/useDockClickIntegrity.d.ts +4 -0
- package/dist/components/dock/composables/useDockShellProps.d.ts +34 -2
- package/dist/components/dock/composables/useDockState.d.ts +5 -0
- package/dist/components/dock/index.d.ts +1 -2
- package/dist/components/dock/styles/controls/icon-button.css +1 -1
- package/dist/components/dock/styles/controls/tab-button.css +1 -1
- package/dist/components/dock/styles/morph.css +1 -1
- package/dist/components/dock/styles/run.css +1 -1
- package/dist/components/dock/trigger.d.ts +1 -0
- package/dist/components/expandable-container/ExpandableContainer.vue.d.ts +30 -29
- package/dist/components/menu/ContextMenu.vue.d.ts +27 -0
- package/dist/components/menu/DropdownMenu.vue.d.ts +5 -23
- package/dist/components/menu/context.d.ts +18 -5
- package/dist/components/menu/family-click.d.ts +2 -0
- package/dist/components/menu/family-context.d.ts +2 -0
- package/dist/components/menu/index.d.ts +1 -1
- package/dist/components/sheet/SheetContent.vue.d.ts +2 -2
- package/dist/components/sortable-list/styles.css +1 -0
- package/dist/components/surface/Surface.vue.d.ts +4 -1
- package/dist/components/tabs/composables/useTabDragMorph.d.ts +4 -7
- package/dist/components/tabs/styles/segmented.css +1 -1
- package/dist/components/tabs/types.d.ts +7 -8
- package/dist/composables/dom/useResizeObserver.d.ts +3 -1
- package/dist/composables/glass/fieldPaint.d.ts +4 -0
- package/dist/composables/glass/useGlassBackdropLuminance.d.ts +7 -6
- package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +8 -0
- package/dist/composables/motion/core/motionTempo.d.ts +2 -1
- package/dist/composables/motion/morph/useDragMorph.d.ts +2 -2
- package/dist/composables/motion/morph/useSelectionGroup.d.ts +6 -25
- package/dist/composables/motion/morph/useSelectionIndicator.d.ts +8 -54
- package/dist/composables/motion/spring/useLiquidFlex.d.ts +3 -5
- package/dist/composables/motion/spring/useSpringMount.d.ts +0 -9
- package/dist/{configurator-CPxIo3q2.js → configurator-C1ZKEf1b.js} +7 -5
- package/dist/configurator.css +1 -0
- package/dist/configurator.js +1 -1
- package/dist/constants-DfrO-IaH.js +8 -0
- package/dist/constellation.css +1 -0
- package/dist/constellation.js +2 -1
- package/dist/control.css +1 -0
- package/dist/{control.css_vue_type_style_index_0_src_true_lang-BIdufaDG.js → control.css_vue_type_style_index_0_src_true_lang-D2hdtjs4.js} +1 -0
- package/dist/{createCanvasLifecycle-hJHobVTn.js → createCanvasLifecycle-DS0vEs_G.js} +76 -75
- package/dist/dark-mode-toggle.js +1 -1
- package/dist/{data-table-Cs93-uY7.js → data-table-lDykVYuo.js} +113 -107
- package/dist/data-table.css +1 -0
- package/dist/data-table.js +1 -1
- package/dist/{deck-Cm_VmyNL.js → deck-Bc-2mEKE.js} +1 -0
- package/dist/deck.js +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dock-trigger.d.ts +1 -0
- package/dist/dock-trigger.js +88 -0
- package/dist/dock.js +677 -689
- package/dist/dom.js +1 -1
- package/dist/easing.js +4 -4
- package/dist/expandable-container-wS1awXGd.js +135 -0
- package/dist/expandable-container.css +1 -0
- package/dist/expandable-container.js +1 -1
- package/dist/{fading-scroll-CTeW3KNS.js → fading-scroll-D3Y20ibL.js} +2 -2
- package/dist/fading-scroll.js +1 -1
- package/dist/fieldPaint-Ci77oajZ.js +7 -0
- package/dist/fourier-field.css +1 -0
- package/dist/fourier-field.js +15 -13
- package/dist/glSetup-DMaDgrEj.js +577 -0
- package/dist/glass-ui.js +67 -66
- package/dist/handmark.css +1 -0
- package/dist/handmark.js +82 -71
- package/dist/index.css +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/{input-eLZ_AU7l.js → input-BLF2pMHE.js} +1 -1
- package/dist/input.js +1 -1
- package/dist/{label-CE03H1KL.js → label-ryNPL7e6.js} +1 -0
- package/dist/label.css +1 -0
- package/dist/label.js +1 -1
- package/dist/labeled-field.css +1 -0
- package/dist/labeled-field.js +5 -4
- package/dist/{menu-DaYAZiVW.js → menu-C_l2Sslf.js} +162 -112
- package/dist/menu.js +3 -3
- package/dist/metric.js +1 -0
- package/dist/motion-core.js +138 -44
- package/dist/motion-lHDAQHEE.js +91 -0
- package/dist/motion.js +5 -5
- package/dist/motionTempo-DXdVbCWr.js +13 -0
- package/dist/music-staff.js +1 -0
- package/dist/{number-field-RP89046a.js → number-field-BXFUP49Z.js} +3 -2
- package/dist/number-field.css +1 -0
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.css +1 -0
- package/dist/pager-dots.js +4 -3
- package/dist/participation-C5y5VZTN.js +52 -0
- package/dist/{popover-BdpoE4Ar.js → popover-DQUmwuAa.js} +3 -2
- package/dist/popover.js +1 -1
- package/dist/{progress-eVa-mc7J.js → progress-BUn0Bw7Z.js} +1 -0
- package/dist/progress.css +1 -0
- package/dist/progress.js +1 -1
- package/dist/{radio-group-B58Bz16F.js → radio-group-xdEy2tdi.js} +1 -0
- package/dist/radio-group.css +1 -0
- package/dist/radio-group.js +1 -1
- package/dist/root-scroll-lock-DJFrQhMa.js +22 -0
- package/dist/select-Dt5dXm87.js +309 -0
- package/dist/select.js +1 -1
- package/dist/{separator-D4EZM10u.js → separator-C4y9p_ky.js} +1 -0
- package/dist/separator.css +1 -0
- package/dist/separator.js +1 -1
- package/dist/sheet-DLqNUIZl.js +347 -0
- package/dist/sheet-width-DgXgJNa5.js +18 -0
- package/dist/sheet.js +2 -2
- package/dist/{slider-5uoY-cLG.js → slider-CZiKrWGg.js} +8 -8
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +2 -1
- package/dist/{status-dot-W4LFiJps.js → status-dot-BDZKcRxy.js} +2 -1
- package/dist/status-dot.css +1 -0
- package/dist/status-dot.js +1 -1
- package/dist/styles/components.css +1 -1
- package/dist/styles/glass/glass-capsule.css +1 -1
- package/dist/styles/glass/glass-chip.css +1 -1
- package/dist/styles/glass/mark.css +1 -1
- package/dist/styles/glass/overlay-plate.css +1 -1
- package/dist/styles/glass/surface-axis.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/theme/radius.css +1 -1
- package/dist/styles/tokens/color-radius.css +1 -1
- package/dist/styles/tokens/manifest.d.ts +1 -1
- package/dist/styles/tokens/scale-paper.css +1 -1
- package/dist/styles/utilities/base-misc.css +1 -1
- package/dist/surface.js +1 -1
- package/dist/{switch-BYUZ6g9G.js → switch-DLfGYU35.js} +1 -0
- package/dist/switch.css +1 -0
- package/dist/switch.js +1 -1
- package/dist/tabs-NgTRPGZx.js +229 -0
- package/dist/tabs.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.css +1 -0
- package/dist/timeline.js +4 -3
- package/dist/toggle-group-DgXcJGD6.js +129 -0
- package/dist/toggle-group.css +1 -0
- package/dist/toggle-group.js +1 -1
- package/dist/tokens.js +2 -0
- package/dist/{tooltip-CZVubnJf.js → tooltip-Do3qCw0r.js} +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.css +1 -0
- package/dist/typewriter.js +1 -0
- package/dist/uniformBridge-CJyy7NOn.js +150 -0
- package/dist/useBarShape-CmP35Z8o.js +24 -0
- package/dist/{useCanvas2D-CQRElMyE.js → useCanvas2D-Bhpwua98.js} +1 -1
- package/dist/{useDockCtaReceive-BSSgD6mu.js → useDockCtaReceive-Dn_-paqP.js} +1 -1
- package/dist/{useDragMorph-B363RUbF.js → useDragMorph-BEI74U0t.js} +51 -40
- package/dist/{color.wgsl-BTszLY39.js → useGpuSubstrate-Y5XAdU8d.js} +7 -7
- package/dist/{useLiquidPress-h1scrPtP.js → useLiquidPress-D5mjZC6U.js} +2 -2
- package/dist/{useResizeObserver-CdUlm2QZ.js → useResizeObserver-Bv3nN46q.js} +4 -7
- package/dist/useScrollChrome-DMP6kDI9.js +67 -0
- package/dist/useSelectionGroup-DAQv5Lb5.js +186 -0
- package/dist/{useSpring-9u2_shxV.js → useSpring-Aof0nTRt.js} +1 -1
- package/dist/useSpringMount-jgNkymRl.js +73 -0
- package/dist/wgpuSetup-CFuqd_RP.js +1278 -0
- package/package.json +8 -1
- package/dist/DialogContent-CwIBvou_.js +0 -157
- package/dist/DropdownMenuTrigger-CKRnhDSQ.js +0 -93
- package/dist/button-BOFTUPyU.js +0 -110
- package/dist/composables/motion/morph/eyeglass.d.ts +0 -141
- package/dist/expandable-container-CZUj9BzY.js +0 -142
- package/dist/glass-ui.css +0 -2
- package/dist/motion-BvV1_24p.js +0 -61
- package/dist/motionTempo-tscp92Nm.js +0 -7
- package/dist/participation-B7UFdgXB.js +0 -55
- package/dist/select-BiF0FCZf.js +0 -292
- package/dist/sheet-DmJxgAHc.js +0 -345
- package/dist/tabs-C5sC0fBE.js +0 -269
- package/dist/toggle-group-CC5b3o1R.js +0 -125
- package/dist/useScrollChrome-BJbWV32F.js +0 -162
- package/dist/useSelectionGroup-zsEwitF6.js +0 -291
- package/dist/useSpringMount-OA-0mTNv.js +0 -73
package/dist/dock.js
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
1
|
import { t as e } from "./class-names-FlXcvRRT.js";
|
|
2
2
|
import { n as t } from "./useReducedMotion-vCXA_vyM.js";
|
|
3
3
|
import { t as n } from "./vSpecular-DMJo8pfD.js";
|
|
4
|
-
import { t as r } from "./
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as o } from "./
|
|
4
|
+
import { t as r } from "./fieldPaint-Ci77oajZ.js";
|
|
5
|
+
import { t as i } from "./motionTempo-DXdVbCWr.js";
|
|
6
|
+
import { n as a } from "./springPresets-Cbe0Voqg.js";
|
|
7
|
+
import { t as o } from "./useLiquidPress-D5mjZC6U.js";
|
|
8
8
|
import { n as s, t as c } from "./createContext-BhkE9mLH.js";
|
|
9
|
-
import { a as l,
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
17
|
-
import {
|
|
18
|
-
import { n as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
9
|
+
import { a as l, i as u, o as d, r as f, t as p } from "./constants-DfrO-IaH.js";
|
|
10
|
+
import { a as m, i as h, n as g, o as _, r as v, s as y } from "./participation-C5y5VZTN.js";
|
|
11
|
+
import { t as b } from "./useMotionAxis-D-rtIhca.js";
|
|
12
|
+
import { t as x } from "./useResizeObserver-Bv3nN46q.js";
|
|
13
|
+
import { n as S } from "./useResolveTokenColor-B2FfJnd9.js";
|
|
14
|
+
import { t as C } from "./useIntersectionPause-CzKR3EyP.js";
|
|
15
|
+
import { t as w } from "./focus-Duf7EpUu.js";
|
|
16
|
+
import { t as T } from "./useSelectionGroup-DAQv5Lb5.js";
|
|
17
|
+
import { t as E } from "./useDragMorph-BEI74U0t.js";
|
|
18
|
+
import { n as D } from "./useDockCtaReceive-Dn_-paqP.js";
|
|
19
|
+
import { t as O } from "./useScrollChrome-DMP6kDI9.js";
|
|
20
|
+
import { Fragment as k, computed as A, createBlock as j, createCommentVNode as M, createElementBlock as N, createElementVNode as P, createVNode as F, defineComponent as I, mergeModels as L, mergeProps as R, nextTick as z, normalizeClass as B, normalizeStyle as V, onBeforeUnmount as H, onMounted as U, onScopeDispose as W, onUnmounted as G, openBlock as K, readonly as q, ref as J, renderList as ee, renderSlot as Y, resolveDynamicComponent as te, toDisplayString as ne, unref as X, useId as re, useModel as ie, useTemplateRef as Z, watch as Q, withCtx as ae, withDirectives as oe, withModifiers as se } from "vue";
|
|
21
|
+
import { Primitive as ce } from "reka-ui";
|
|
22
|
+
import { Pause as le, Play as ue } from "@lucide/vue";
|
|
23
|
+
import { SpringProgress as de } from "@mkbabb/keyframes.js";
|
|
24
|
+
import { useMediaQuery as fe } from "@vueuse/core";
|
|
24
25
|
//#region src/components/_shared/overlay/isTeleportedTarget.ts
|
|
25
|
-
function
|
|
26
|
+
function pe(e, t) {
|
|
26
27
|
if (!(e instanceof Element)) return !1;
|
|
27
28
|
let n = e.closest("[data-glass-dock-portal]");
|
|
28
29
|
return n ? !t || n.getAttribute("data-glass-dock-owner") === t : !1;
|
|
29
30
|
}
|
|
30
31
|
//#endregion
|
|
31
32
|
//#region src/composables/glass/backdropSampleMath.ts
|
|
32
|
-
function
|
|
33
|
+
function me(e) {
|
|
33
34
|
let t = e / 255;
|
|
34
35
|
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
return .2126 *
|
|
37
|
+
function he(e, t, n) {
|
|
38
|
+
return .2126 * me(e) + .7152 * me(t) + .0722 * me(n);
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function ge(e, t, n, r, i) {
|
|
40
41
|
return [
|
|
41
42
|
e * r + i[0] * (1 - r),
|
|
42
43
|
t * r + i[1] * (1 - r),
|
|
43
44
|
n * r + i[2] * (1 - r)
|
|
44
45
|
];
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function _e(e) {
|
|
47
48
|
let t = e.match(/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+))?/i);
|
|
48
49
|
return t ? [
|
|
49
50
|
Number(t[1]),
|
|
@@ -52,31 +53,31 @@ function Ce(e) {
|
|
|
52
53
|
t[4] === void 0 ? 1 : Number(t[4])
|
|
53
54
|
] : null;
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
+
function ve(e) {
|
|
56
57
|
return typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement;
|
|
57
58
|
}
|
|
58
|
-
var
|
|
59
|
-
function
|
|
59
|
+
var ye = "[data-glass-field-canvas] canvas, canvas[data-glass-field-canvas]";
|
|
60
|
+
function be(e) {
|
|
60
61
|
if (!e) {
|
|
61
62
|
if (typeof document < "u") {
|
|
62
|
-
let e = document.querySelector(
|
|
63
|
-
if (
|
|
63
|
+
let e = document.querySelector(ye);
|
|
64
|
+
if (ve(e)) return e;
|
|
64
65
|
}
|
|
65
66
|
return null;
|
|
66
67
|
}
|
|
67
|
-
if (
|
|
68
|
+
if (ve(e)) return e;
|
|
68
69
|
if (typeof e == "function") {
|
|
69
70
|
let t = e();
|
|
70
|
-
return
|
|
71
|
+
return ve(t) ? t : null;
|
|
71
72
|
}
|
|
72
73
|
if (typeof e == "string" && typeof document < "u") {
|
|
73
74
|
let t = document.querySelector(e);
|
|
74
|
-
return
|
|
75
|
+
return ve(t) ? t : null;
|
|
75
76
|
}
|
|
76
77
|
return null;
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
let n =
|
|
79
|
+
function xe(e, t) {
|
|
80
|
+
let n = _e(e);
|
|
80
81
|
if (n) return n;
|
|
81
82
|
if (!t) return null;
|
|
82
83
|
try {
|
|
@@ -92,7 +93,7 @@ function De(e, t) {
|
|
|
92
93
|
return null;
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
|
-
function
|
|
96
|
+
function Se(e, t, n, r) {
|
|
96
97
|
if (!t || t.width === 0 || t.height === 0 || !n) return null;
|
|
97
98
|
let i = e.getBoundingClientRect(), a = t.getBoundingClientRect();
|
|
98
99
|
if (a.width === 0 || a.height === 0) return null;
|
|
@@ -102,71 +103,71 @@ function Oe(e, t, n, r) {
|
|
|
102
103
|
n.clearRect(0, 0, 32, 32), n.drawImage(t, c, l, u, d, 0, 0, 32, 32);
|
|
103
104
|
let e = n.getImageData(0, 0, 32, 32).data, i = 0, a = 0, o = 0;
|
|
104
105
|
for (let t = 0; t < e.length; t += 4) {
|
|
105
|
-
let n = e[t + 3] / 255, [s, c, l] =
|
|
106
|
-
i +=
|
|
106
|
+
let n = e[t + 3] / 255, [s, c, l] = ge(e[t], e[t + 1], e[t + 2], n, r);
|
|
107
|
+
i += he(s, c, l), a += n, o++;
|
|
107
108
|
}
|
|
108
109
|
return o === 0 || a / o < .02 ? null : { luma: i / o };
|
|
109
110
|
} catch {
|
|
110
111
|
return null;
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
|
-
function
|
|
114
|
+
function Ce(e, t) {
|
|
114
115
|
let n = e.getBoundingClientRect(), r = n.left + n.width / 2, i = n.top + n.height / 2, a = document.elementsFromPoint(r, i);
|
|
115
116
|
for (let n of a) {
|
|
116
117
|
if (!(n instanceof HTMLElement) || n === e || e.contains(n)) continue;
|
|
117
|
-
let r = getComputedStyle(n).backgroundColor, i =
|
|
118
|
+
let r = getComputedStyle(n).backgroundColor, i = xe(S(r, e), t);
|
|
118
119
|
if (i && !(i[3] < .5)) return i;
|
|
119
120
|
}
|
|
120
|
-
return
|
|
121
|
+
return xe(S(getComputedStyle(document.body).backgroundColor, e), t);
|
|
121
122
|
}
|
|
122
|
-
var
|
|
123
|
+
var we = [
|
|
123
124
|
255,
|
|
124
125
|
255,
|
|
125
126
|
255
|
|
126
127
|
];
|
|
127
|
-
function
|
|
128
|
-
let n =
|
|
128
|
+
function Te(e, t) {
|
|
129
|
+
let n = Ce(e, t);
|
|
129
130
|
return n && n[3] >= .5 ? [
|
|
130
131
|
n[0],
|
|
131
132
|
n[1],
|
|
132
133
|
n[2]
|
|
133
|
-
] : [...
|
|
134
|
+
] : [...we];
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
-
let n =
|
|
137
|
-
return n ?
|
|
136
|
+
function Ee(e, t) {
|
|
137
|
+
let n = Ce(e, t);
|
|
138
|
+
return n ? De(n) : null;
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
-
return { luma:
|
|
140
|
+
function De(e) {
|
|
141
|
+
return { luma: he(e[0], e[1], e[2]) };
|
|
141
142
|
}
|
|
142
143
|
//#endregion
|
|
143
144
|
//#region src/composables/glass/useGlassBackdropLuminance.ts
|
|
144
|
-
var
|
|
145
|
-
function
|
|
146
|
-
let { lightThreshold:
|
|
147
|
-
function
|
|
148
|
-
return !
|
|
145
|
+
var Oe = "data-glass-backdrop-shared";
|
|
146
|
+
function ke(e, n = {}) {
|
|
147
|
+
let { lightThreshold: i = .6, minSampleIntervalMs: a = 250, writeBucket: o = !0 } = n, s = Math.max(250, a), c = n.shared === !0;
|
|
148
|
+
function l(e) {
|
|
149
|
+
return !c && e.closest(`[${Oe}]`) !== null;
|
|
149
150
|
}
|
|
150
|
-
let
|
|
151
|
+
let u = J(null), d = J(null), f = J({
|
|
151
152
|
state: "pending",
|
|
152
153
|
mode: n.live === !0 ? "live" : "static",
|
|
153
154
|
source: n.live === !0 ? "canvas" : "elements"
|
|
154
155
|
});
|
|
155
156
|
if (typeof window > "u") return {
|
|
156
|
-
luma:
|
|
157
|
-
bucket:
|
|
158
|
-
sample:
|
|
157
|
+
luma: q(u),
|
|
158
|
+
bucket: q(d),
|
|
159
|
+
sample: q(f),
|
|
159
160
|
sampleNow: () => {},
|
|
160
161
|
dispose: () => {}
|
|
161
162
|
};
|
|
162
|
-
let
|
|
163
|
-
function h() {
|
|
164
|
-
return p || (p = document.createElement("canvas"), p.width = 32, p.height = 32), m ||= p.getContext("2d", { willReadFrequently: !0 }), m;
|
|
165
|
-
}
|
|
163
|
+
let p = t(), m = null, h = null;
|
|
166
164
|
function g() {
|
|
167
|
-
return
|
|
165
|
+
return m || (m = document.createElement("canvas"), m.width = 32, m.height = 32), h ||= m.getContext("2d", { willReadFrequently: !0 }), h;
|
|
166
|
+
}
|
|
167
|
+
function _() {
|
|
168
|
+
return n.live === void 0 ? e.value?.dataset.glassSample === "live" || n.backgroundCanvas != null || be(void 0) !== null : n.live;
|
|
168
169
|
}
|
|
169
|
-
function
|
|
170
|
+
function v(e) {
|
|
170
171
|
let t = e.getBoundingClientRect();
|
|
171
172
|
return {
|
|
172
173
|
x: t.x,
|
|
@@ -175,262 +176,298 @@ function Fe(e, n = {}) {
|
|
|
175
176
|
height: t.height
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
|
-
function
|
|
179
|
-
let
|
|
180
|
-
|
|
181
|
-
let s =
|
|
182
|
-
|
|
179
|
+
function y(e, t, n, r) {
|
|
180
|
+
let a = e.luma;
|
|
181
|
+
u.value = a;
|
|
182
|
+
let s = a >= i ? "light" : "dark";
|
|
183
|
+
d.value = s, f.value = {
|
|
183
184
|
state: "sampled",
|
|
184
185
|
mode: n,
|
|
185
186
|
source: n === "live" ? "canvas" : "elements",
|
|
186
|
-
luma:
|
|
187
|
-
sampledAt:
|
|
188
|
-
targetRect:
|
|
189
|
-
}, t.style.setProperty("--glass-backdrop-luma",
|
|
187
|
+
luma: a,
|
|
188
|
+
sampledAt: r,
|
|
189
|
+
targetRect: v(t)
|
|
190
|
+
}, t.style.setProperty("--glass-backdrop-luma", a.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"), o && t.style.setProperty("--glass-backdrop", s);
|
|
190
191
|
}
|
|
191
|
-
function
|
|
192
|
-
|
|
192
|
+
function b(e, t, n, r) {
|
|
193
|
+
u.value = null, d.value = null, f.value = {
|
|
193
194
|
state: "unavailable",
|
|
194
195
|
mode: t,
|
|
195
196
|
source: t === "live" ? "canvas" : "elements",
|
|
196
197
|
reason: n,
|
|
197
198
|
sampledAt: r,
|
|
198
|
-
targetRect:
|
|
199
|
-
}, e.style.removeProperty("--glass-backdrop-luma"), e.style.removeProperty("--glass-backdrop-sampled"),
|
|
199
|
+
targetRect: v(e)
|
|
200
|
+
}, e.style.removeProperty("--glass-backdrop-luma"), e.style.removeProperty("--glass-backdrop-sampled"), o && 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
201
|
}
|
|
201
|
-
let
|
|
202
|
-
function
|
|
202
|
+
let S = 0;
|
|
203
|
+
function w() {
|
|
203
204
|
let t = e.value;
|
|
204
|
-
if (!t ||
|
|
205
|
-
let r =
|
|
206
|
-
o ?
|
|
205
|
+
if (!t || l(t)) return;
|
|
206
|
+
let r = g(), i = _() ? "live" : "static", a = i === "live" ? be(n.backgroundCanvas) : null, o = i === "live" ? Se(t, a, r, Te(t, r)) : Ee(t, r), s = Date.now();
|
|
207
|
+
o ? y(o, t, i, s) : b(t, i, i === "live" && !a ? "source-unavailable" : "sample-unavailable", s), S = typeof performance < "u" ? performance.now() : s;
|
|
207
208
|
}
|
|
208
|
-
let
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
209
|
+
let T = !1, E = !1, D = null;
|
|
210
|
+
function O() {
|
|
211
|
+
D !== null && clearTimeout(D), D = null;
|
|
212
|
+
}
|
|
213
|
+
function k() {
|
|
214
|
+
if (!T || E || D !== null) return;
|
|
215
|
+
let e = performance.now(), t = Math.max(0, S + s - e);
|
|
216
|
+
D = setTimeout(() => {
|
|
217
|
+
D = null, T && !E && w();
|
|
218
|
+
}, t);
|
|
219
|
+
}
|
|
220
|
+
function A(e) {
|
|
221
|
+
!T || D !== null || e.target === be(n.backgroundCanvas) && k();
|
|
222
|
+
}
|
|
223
|
+
function j(e) {
|
|
224
|
+
if (!T || D !== null) return;
|
|
225
|
+
let t = be(n.backgroundCanvas), r = e.target;
|
|
226
|
+
t && r instanceof Node && r.contains(t) && k();
|
|
227
|
+
}
|
|
228
|
+
let M = null, N = null;
|
|
229
|
+
function P() {
|
|
230
|
+
T || (T = !0, document.addEventListener(r, A, !0), document.addEventListener("scroll", k, {
|
|
231
|
+
capture: !0,
|
|
232
|
+
passive: !0
|
|
233
|
+
}), document.addEventListener("transitionend", j, !0), document.addEventListener("animationend", j, !0), typeof MutationObserver < "u" && (M = new MutationObserver(k), M.observe(document.documentElement, {
|
|
234
|
+
attributes: !0,
|
|
235
|
+
attributeFilter: [
|
|
236
|
+
"class",
|
|
237
|
+
"data-theme",
|
|
238
|
+
"data-color-scheme"
|
|
239
|
+
]
|
|
240
|
+
})), typeof matchMedia == "function" && (N = matchMedia("(prefers-color-scheme: dark)"), N.addEventListener("change", k)));
|
|
241
|
+
}
|
|
242
|
+
function F() {
|
|
243
|
+
T && (T = !1, O(), document.removeEventListener(r, A, !0), document.removeEventListener("scroll", k, !0), document.removeEventListener("transitionend", j, !0), document.removeEventListener("animationend", j, !0), M?.disconnect(), M = null, N?.removeEventListener("change", k), N = null);
|
|
244
|
+
}
|
|
245
|
+
let I = C(() => e.value, {
|
|
246
|
+
pause: () => {
|
|
247
|
+
E = !0, O();
|
|
248
|
+
},
|
|
216
249
|
resume: () => {
|
|
217
|
-
|
|
218
|
-
t && c(t) || g() && !f.value && w.resume();
|
|
250
|
+
E = !1, k();
|
|
219
251
|
}
|
|
220
|
-
}, { rootMargin: "200px" }),
|
|
221
|
-
function
|
|
252
|
+
}, { rootMargin: "200px" }), L = x(e, () => w());
|
|
253
|
+
function R() {
|
|
222
254
|
let t = e.value;
|
|
223
|
-
if (t &&
|
|
224
|
-
|
|
255
|
+
if (t && l(t)) {
|
|
256
|
+
F();
|
|
225
257
|
return;
|
|
226
258
|
}
|
|
227
|
-
|
|
259
|
+
p.value ? (F(), w()) : _() && P();
|
|
228
260
|
}
|
|
229
|
-
let
|
|
261
|
+
let z = Q(p, R, { flush: "sync" }), B = Q(() => e.value, (e) => {
|
|
230
262
|
if (e) {
|
|
231
|
-
if (
|
|
232
|
-
else if (
|
|
233
|
-
|
|
263
|
+
if (c) e.setAttribute(Oe, "");
|
|
264
|
+
else if (l(e)) return;
|
|
265
|
+
w(), R();
|
|
234
266
|
}
|
|
235
267
|
}, {
|
|
236
268
|
immediate: !0,
|
|
237
269
|
flush: "post"
|
|
238
270
|
});
|
|
239
|
-
function
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
return
|
|
243
|
-
luma:
|
|
244
|
-
bucket:
|
|
245
|
-
sample:
|
|
246
|
-
sampleNow:
|
|
247
|
-
dispose:
|
|
271
|
+
function V() {
|
|
272
|
+
B(), z(), F(), I.dispose(), L.stop(), m = null, h = null;
|
|
273
|
+
}
|
|
274
|
+
return W(V), {
|
|
275
|
+
luma: q(u),
|
|
276
|
+
bucket: q(d),
|
|
277
|
+
sample: q(f),
|
|
278
|
+
sampleNow: w,
|
|
279
|
+
dispose: V
|
|
248
280
|
};
|
|
249
281
|
}
|
|
250
282
|
//#endregion
|
|
251
283
|
//#region src/components/dock/composables/useDockState.ts
|
|
252
|
-
function
|
|
253
|
-
let { collapseDelay: t =
|
|
254
|
-
function
|
|
255
|
-
|
|
284
|
+
function Ae(e) {
|
|
285
|
+
let { collapseDelay: t = p, rootEl: n, alwaysExpanded: r = !1, expandOn: i = "hover", initialExpanded: a = !1, isTransitioning: o, dockId: s, onStateChange: c } = e, l = () => typeof r == "boolean" ? r : r.value, u = () => l(), d = () => (typeof i == "string" ? i : i.value) === "press", f = J(l() ? "pinned" : a ? "hover" : "collapsed"), m = A(() => f.value !== "collapsed"), h = A(() => f.value === "pinned"), g = null, _ = J(0), v = J(0), y = A(() => _.value > 0), b = A(() => v.value > 0), x = null, S = null, C = !1, w = null;
|
|
286
|
+
function T() {
|
|
287
|
+
w &&= (clearTimeout(w), null);
|
|
288
|
+
}
|
|
289
|
+
let E = null, D = null, O = null, k = () => E === "down" || E === "compat";
|
|
290
|
+
function j() {
|
|
291
|
+
if (!E) return;
|
|
292
|
+
E = null, O &&= (clearTimeout(O), null);
|
|
293
|
+
for (let [e, t] of P) window.removeEventListener(e, t, !0);
|
|
294
|
+
let e = D;
|
|
295
|
+
D = null, e && !u() && f.value === "collapsed" && (R(), f.value = "hover", L());
|
|
256
296
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
if (!w) return;
|
|
260
|
-
w = null, E &&= (clearTimeout(E), null);
|
|
261
|
-
for (let [e, t] of j) window.removeEventListener(e, t, !0);
|
|
262
|
-
let e = T;
|
|
263
|
-
T = null, e && !l() && d.value === "collapsed" && (F(), d.value = "hover", P());
|
|
264
|
-
}
|
|
265
|
-
function k() {
|
|
266
|
-
E ??= setTimeout(O, 0);
|
|
297
|
+
function M() {
|
|
298
|
+
O ??= setTimeout(j, 0);
|
|
267
299
|
}
|
|
268
|
-
function
|
|
269
|
-
|
|
300
|
+
function N() {
|
|
301
|
+
D = null, j();
|
|
270
302
|
}
|
|
271
|
-
let
|
|
272
|
-
["click", () =>
|
|
273
|
-
["pointercancel", () =>
|
|
274
|
-
["dragstart", () =>
|
|
275
|
-
["contextmenu", () =>
|
|
303
|
+
let P = [
|
|
304
|
+
["click", () => j()],
|
|
305
|
+
["pointercancel", () => j()],
|
|
306
|
+
["dragstart", () => j()],
|
|
307
|
+
["contextmenu", () => j()],
|
|
276
308
|
["pointerup", (e) => {
|
|
277
|
-
|
|
309
|
+
E === "down" && (e.pointerType === "touch" ? E = "tap" : M());
|
|
278
310
|
}],
|
|
279
311
|
["mousedown", () => {
|
|
280
|
-
|
|
312
|
+
E === "tap" && (E = "compat");
|
|
281
313
|
}],
|
|
282
314
|
["mouseup", () => {
|
|
283
|
-
|
|
315
|
+
E === "compat" && M();
|
|
284
316
|
}],
|
|
285
317
|
["pointerdown", (e) => {
|
|
286
|
-
(
|
|
318
|
+
(E === "tap" || e.isPrimary) && N();
|
|
287
319
|
}]
|
|
288
320
|
];
|
|
289
|
-
function
|
|
290
|
-
|
|
291
|
-
for (let [e, t] of
|
|
321
|
+
function F() {
|
|
322
|
+
E && N(), E = "down";
|
|
323
|
+
for (let [e, t] of P) window.addEventListener(e, t, !0);
|
|
292
324
|
}
|
|
293
|
-
|
|
294
|
-
e && (e.addEventListener("pointerdown",
|
|
325
|
+
Q(n, (e, t, n) => {
|
|
326
|
+
e && (e.addEventListener("pointerdown", F, !0), n(() => e.removeEventListener("pointerdown", F, !0)));
|
|
295
327
|
}, {
|
|
296
328
|
immediate: !0,
|
|
297
329
|
flush: "sync"
|
|
298
330
|
});
|
|
299
|
-
let
|
|
300
|
-
function
|
|
301
|
-
|
|
331
|
+
let I = f.value;
|
|
332
|
+
function L() {
|
|
333
|
+
l() && (f.value = "pinned"), c && I !== f.value && c(f.value, I), I = f.value;
|
|
302
334
|
}
|
|
303
|
-
function
|
|
304
|
-
|
|
335
|
+
function R() {
|
|
336
|
+
g &&= (clearTimeout(g), null);
|
|
305
337
|
}
|
|
306
|
-
function
|
|
307
|
-
|
|
338
|
+
function z() {
|
|
339
|
+
S !== null && (cancelAnimationFrame(S), S = null);
|
|
308
340
|
}
|
|
309
|
-
function
|
|
310
|
-
|
|
341
|
+
function B() {
|
|
342
|
+
z(), x?.();
|
|
311
343
|
}
|
|
312
|
-
function
|
|
313
|
-
|
|
314
|
-
|
|
344
|
+
function V() {
|
|
345
|
+
u() || _.value > 0 || (R(), g = setTimeout(() => {
|
|
346
|
+
f.value = "collapsed", L();
|
|
315
347
|
}, t));
|
|
316
348
|
}
|
|
317
|
-
function
|
|
318
|
-
if (
|
|
319
|
-
|
|
349
|
+
function H() {
|
|
350
|
+
if (l()) {
|
|
351
|
+
f.value = "pinned", L();
|
|
320
352
|
return;
|
|
321
353
|
}
|
|
322
|
-
|
|
354
|
+
C ||= (C = !0, R(), T(), f.value = "collapsed", L(), !1);
|
|
323
355
|
}
|
|
324
|
-
function
|
|
325
|
-
if (
|
|
326
|
-
|
|
356
|
+
function U() {
|
|
357
|
+
if (l()) {
|
|
358
|
+
f.value = "pinned", L();
|
|
327
359
|
return;
|
|
328
360
|
}
|
|
329
|
-
|
|
361
|
+
R(), T(), f.value = "hover", L();
|
|
330
362
|
}
|
|
331
|
-
function
|
|
332
|
-
|
|
333
|
-
if (
|
|
334
|
-
if (
|
|
335
|
-
|
|
363
|
+
function W() {
|
|
364
|
+
u() || d() || (R(), f.value === "collapsed" && (T(), w = setTimeout(() => {
|
|
365
|
+
if (w = null, !u() && f.value === "collapsed") {
|
|
366
|
+
if (k()) {
|
|
367
|
+
D ??= "hover";
|
|
336
368
|
return;
|
|
337
369
|
}
|
|
338
|
-
|
|
370
|
+
f.value = "hover", L();
|
|
339
371
|
}
|
|
340
372
|
}, 60)));
|
|
341
373
|
}
|
|
342
|
-
function
|
|
343
|
-
if (!
|
|
344
|
-
if (
|
|
374
|
+
function K(e) {
|
|
375
|
+
if (!(u() || d()) && (T(), D === "hover" && (D = null), f.value === "hover")) {
|
|
376
|
+
if (_.value > 0) return;
|
|
345
377
|
if (e) {
|
|
346
378
|
let t = n.value;
|
|
347
|
-
if (t && e.relatedTarget instanceof Node && t.contains(e.relatedTarget) ||
|
|
379
|
+
if (t && e.relatedTarget instanceof Node && t.contains(e.relatedTarget) || pe(e.relatedTarget, s)) return;
|
|
348
380
|
}
|
|
349
|
-
|
|
381
|
+
V();
|
|
350
382
|
}
|
|
351
383
|
}
|
|
352
|
-
function
|
|
353
|
-
if (!
|
|
354
|
-
if (
|
|
355
|
-
|
|
384
|
+
function q() {
|
|
385
|
+
if (!(u() || d()) && (R(), f.value === "collapsed")) {
|
|
386
|
+
if (k()) {
|
|
387
|
+
D = "focus";
|
|
356
388
|
return;
|
|
357
389
|
}
|
|
358
|
-
|
|
390
|
+
f.value = "hover", L();
|
|
359
391
|
}
|
|
360
392
|
}
|
|
361
|
-
function
|
|
362
|
-
if (
|
|
363
|
-
let t = e.currentTarget, n = !!e.relatedTarget && t.contains(e.relatedTarget) ||
|
|
364
|
-
!n &&
|
|
393
|
+
function ee(e) {
|
|
394
|
+
if (u()) return;
|
|
395
|
+
let t = e.currentTarget, n = !!e.relatedTarget && t.contains(e.relatedTarget) || pe(e.relatedTarget, s);
|
|
396
|
+
if (!n && D === "focus" && (D = null), d()) {
|
|
397
|
+
if (!m.value || _.value > 0 || n || !e.relatedTarget) return;
|
|
398
|
+
H();
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
f.value === "hover" && (_.value > 0 || n || V());
|
|
365
402
|
}
|
|
366
|
-
function
|
|
367
|
-
|
|
403
|
+
function Y() {
|
|
404
|
+
u() || (R(), T(), f.value = "pinned", L());
|
|
368
405
|
}
|
|
369
|
-
function
|
|
370
|
-
|
|
406
|
+
function te(e = "morph") {
|
|
407
|
+
_.value++, e === "grasp" && v.value++, R();
|
|
371
408
|
}
|
|
372
|
-
function
|
|
373
|
-
e === "grasp" && (
|
|
374
|
-
|
|
409
|
+
function ne(e = "morph") {
|
|
410
|
+
e === "grasp" && (v.value = Math.max(0, v.value - 1)), _.value = Math.max(0, _.value - 1), _.value === 0 && f.value === "hover" && (R(), g = setTimeout(() => {
|
|
411
|
+
_.value === 0 && f.value === "hover" && V();
|
|
375
412
|
}, Math.min(t, 800)));
|
|
376
413
|
}
|
|
377
|
-
function
|
|
378
|
-
if (
|
|
414
|
+
function X(e) {
|
|
415
|
+
if (u() || _.value > 0 || o?.value) return;
|
|
379
416
|
let t = n.value;
|
|
380
|
-
!t || t.contains(e.target) ||
|
|
417
|
+
!t || t.contains(e.target) || pe(e.target, s) || H();
|
|
381
418
|
}
|
|
382
|
-
return
|
|
419
|
+
return Q(m, (e) => {
|
|
383
420
|
if (e) {
|
|
384
421
|
if (typeof document > "u") return;
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
document.removeEventListener("pointerdown",
|
|
422
|
+
B(), S = requestAnimationFrame(() => {
|
|
423
|
+
S = null, m.value && (document.addEventListener("pointerdown", X, !0), x = () => {
|
|
424
|
+
document.removeEventListener("pointerdown", X, !0), x = null;
|
|
388
425
|
});
|
|
389
426
|
});
|
|
390
|
-
} else
|
|
391
|
-
}, { immediate: !0 }), typeof r == "boolean" ? r && (
|
|
427
|
+
} else B();
|
|
428
|
+
}, { immediate: !0 }), typeof r == "boolean" ? r && (f.value = "pinned", L()) : Q(r, (e) => {
|
|
392
429
|
if (e) {
|
|
393
|
-
|
|
430
|
+
R(), f.value = "pinned", L();
|
|
394
431
|
return;
|
|
395
432
|
}
|
|
396
|
-
|
|
397
|
-
}),
|
|
398
|
-
|
|
433
|
+
f.value = "collapsed", L();
|
|
434
|
+
}), G(() => {
|
|
435
|
+
R(), T(), B(), N();
|
|
399
436
|
}), {
|
|
400
|
-
state:
|
|
401
|
-
expanded:
|
|
402
|
-
isPinned:
|
|
403
|
-
isHeld:
|
|
404
|
-
graspHeld:
|
|
405
|
-
onMouseEnter:
|
|
406
|
-
onMouseLeave:
|
|
407
|
-
onFocusIn:
|
|
408
|
-
onFocusOut:
|
|
409
|
-
onClickCollapsed:
|
|
410
|
-
keepOpen:
|
|
411
|
-
release:
|
|
412
|
-
expand:
|
|
413
|
-
collapse:
|
|
437
|
+
state: f,
|
|
438
|
+
expanded: m,
|
|
439
|
+
isPinned: h,
|
|
440
|
+
isHeld: y,
|
|
441
|
+
graspHeld: b,
|
|
442
|
+
onMouseEnter: W,
|
|
443
|
+
onMouseLeave: K,
|
|
444
|
+
onFocusIn: q,
|
|
445
|
+
onFocusOut: ee,
|
|
446
|
+
onClickCollapsed: Y,
|
|
447
|
+
keepOpen: te,
|
|
448
|
+
release: ne,
|
|
449
|
+
expand: U,
|
|
450
|
+
collapse: H
|
|
414
451
|
};
|
|
415
452
|
}
|
|
416
453
|
//#endregion
|
|
417
454
|
//#region src/components/dock/composables/useDockSpring.ts
|
|
418
|
-
function
|
|
455
|
+
function je(e) {
|
|
419
456
|
let t = null, n = () => t !== null && !t.settled;
|
|
420
|
-
function
|
|
457
|
+
function r() {
|
|
421
458
|
t &&= (t.dispose(), null);
|
|
422
459
|
}
|
|
423
460
|
function a(a, o, s) {
|
|
424
461
|
let c = n() ? t.velocity * (s.inheritVelocityScale ?? 1) : 0;
|
|
425
|
-
|
|
426
|
-
let l = new
|
|
427
|
-
response: e.response *
|
|
462
|
+
r();
|
|
463
|
+
let l = new de({
|
|
464
|
+
response: e.response * i(),
|
|
428
465
|
dampingFraction: e.dampingFraction,
|
|
429
466
|
initial: a,
|
|
430
467
|
respectReducedMotion: !0
|
|
431
468
|
});
|
|
432
469
|
t = l, l.reset(a, c), l.target = o, l.play((e, n) => {
|
|
433
|
-
s.onFrame(e, n), l.settled && (s.onSettle?.(), t === l &&
|
|
470
|
+
s.onFrame(e, n), l.settled && (s.onSettle?.(), t === l && r());
|
|
434
471
|
});
|
|
435
472
|
}
|
|
436
473
|
function o(e) {
|
|
@@ -445,28 +482,28 @@ function Le(e) {
|
|
|
445
482
|
get velocity() {
|
|
446
483
|
return n() ? t.velocity : 0;
|
|
447
484
|
},
|
|
448
|
-
dispose:
|
|
485
|
+
dispose: r
|
|
449
486
|
};
|
|
450
487
|
}
|
|
451
488
|
//#endregion
|
|
452
489
|
//#region src/components/dock/composables/useDockMorph.ts
|
|
453
|
-
function
|
|
454
|
-
let { rootEl: t, outerActiveLayer: n, geometry: r } = e, i =
|
|
455
|
-
response:
|
|
456
|
-
dampingFraction:
|
|
457
|
-
}), s =
|
|
490
|
+
function Me(e) {
|
|
491
|
+
let { rootEl: t, outerActiveLayer: n, geometry: r } = e, i = J(n.value), a = J(null), o = je({
|
|
492
|
+
response: l.response,
|
|
493
|
+
dampingFraction: l.dampingFraction
|
|
494
|
+
}), s = fe("(prefers-reduced-motion: reduce)");
|
|
458
495
|
function c() {
|
|
459
496
|
return t.value;
|
|
460
497
|
}
|
|
461
|
-
function
|
|
498
|
+
function u() {
|
|
462
499
|
a.value = null;
|
|
463
500
|
let t = c();
|
|
464
501
|
t && (t.removeAttribute("data-morphing"), t.style.removeProperty("--dock-morph-t"), r.release()), e.onMorphActiveChange?.(!1), o.dispose();
|
|
465
502
|
}
|
|
466
|
-
|
|
467
|
-
e && c()?.hasAttribute("data-morphing") &&
|
|
503
|
+
Q(s, (e) => {
|
|
504
|
+
e && c()?.hasAttribute("data-morphing") && u();
|
|
468
505
|
});
|
|
469
|
-
function
|
|
506
|
+
function d() {
|
|
470
507
|
let t = c();
|
|
471
508
|
if (!t) return;
|
|
472
509
|
e.onMorphActiveChange?.(!0), t.setAttribute("data-morphing", "");
|
|
@@ -476,19 +513,19 @@ function Re(e) {
|
|
|
476
513
|
onFrame: (e) => {
|
|
477
514
|
c()?.style.setProperty("--dock-morph-t", `${e}`);
|
|
478
515
|
},
|
|
479
|
-
onSettle:
|
|
516
|
+
onSettle: u
|
|
480
517
|
});
|
|
481
518
|
}
|
|
482
|
-
let f =
|
|
519
|
+
let f = Q(n, (e, t) => {
|
|
483
520
|
e !== t && (c() && r.first(), i.value = e, a.value = c() ? t : null);
|
|
484
|
-
}), p =
|
|
485
|
-
e === t || !c() || (r.measure(),
|
|
521
|
+
}), p = Q(n, (e, t) => {
|
|
522
|
+
e === t || !c() || (r.measure(), d());
|
|
486
523
|
}, { flush: "post" });
|
|
487
|
-
return
|
|
524
|
+
return G(() => {
|
|
488
525
|
f(), p(), o.dispose();
|
|
489
526
|
}), {
|
|
490
|
-
outerCurrentLayer:
|
|
491
|
-
outerLeavingLayer:
|
|
527
|
+
outerCurrentLayer: q(i),
|
|
528
|
+
outerLeavingLayer: q(a)
|
|
492
529
|
};
|
|
493
530
|
}
|
|
494
531
|
//#endregion
|
|
@@ -496,7 +533,7 @@ function Re(e) {
|
|
|
496
533
|
function $(e, t) {
|
|
497
534
|
return t === "vertical" ? e.offsetHeight : e.offsetWidth;
|
|
498
535
|
}
|
|
499
|
-
function
|
|
536
|
+
function Ne(e, t) {
|
|
500
537
|
let n = e.map(([e, t]) => [
|
|
501
538
|
e,
|
|
502
539
|
t,
|
|
@@ -510,7 +547,7 @@ function ze(e, t) {
|
|
|
510
547
|
for (let [e, t, r, i] of n.reverse()) r ? e.style.setProperty(t, r, i) : e.style.removeProperty(t);
|
|
511
548
|
}
|
|
512
549
|
}
|
|
513
|
-
function
|
|
550
|
+
function Pe(e, t) {
|
|
514
551
|
let n = e.scrollLeft, r = e.scrollTop;
|
|
515
552
|
try {
|
|
516
553
|
return t();
|
|
@@ -522,9 +559,9 @@ function Be(e, t) {
|
|
|
522
559
|
});
|
|
523
560
|
}
|
|
524
561
|
}
|
|
525
|
-
function
|
|
562
|
+
function Fe(e, t, n, r, i) {
|
|
526
563
|
let a = r === "vertical" ? "margin-block-end" : "margin-inline-end";
|
|
527
|
-
return
|
|
564
|
+
return Ne([
|
|
528
565
|
[
|
|
529
566
|
e,
|
|
530
567
|
"--dock-expanded-px",
|
|
@@ -551,14 +588,14 @@ function Ve(e, t, n, r, i) {
|
|
|
551
588
|
let o = i - (n - $(t, r));
|
|
552
589
|
if (Math.abs(o) < .5) return n;
|
|
553
590
|
let s = Number.parseFloat(getComputedStyle(t).getPropertyValue(a)) || 0;
|
|
554
|
-
return
|
|
591
|
+
return Ne([[
|
|
555
592
|
t,
|
|
556
593
|
a,
|
|
557
594
|
`${s + o}px`
|
|
558
595
|
]], () => $(e, r));
|
|
559
596
|
});
|
|
560
597
|
}
|
|
561
|
-
function
|
|
598
|
+
function Ie(e, t) {
|
|
562
599
|
let n = e.getBoundingClientRect();
|
|
563
600
|
return t === "vertical" ? {
|
|
564
601
|
start: n.top,
|
|
@@ -568,19 +605,19 @@ function He(e, t) {
|
|
|
568
605
|
size: n.width
|
|
569
606
|
};
|
|
570
607
|
}
|
|
571
|
-
var
|
|
572
|
-
function
|
|
608
|
+
var Le = "--dock-morph-origin", Re = "--dock-pane-shift";
|
|
609
|
+
function ze(e) {
|
|
573
610
|
let { rootEl: t, contentEl: n, expandedEl: r, collapsedEl: i, axis: a } = e, o = null, s = null, c = null, l = null, u = null, d = !1;
|
|
574
611
|
function f() {
|
|
575
612
|
let e = t.value, o = r.value, s = i.value;
|
|
576
613
|
if (!e || !n.value || !o || !s) return;
|
|
577
|
-
let d = a.value, f = o.classList.contains("is-active");
|
|
578
|
-
if (
|
|
579
|
-
let
|
|
580
|
-
f ? c =
|
|
614
|
+
let d = a.value, f = o.classList.contains("is-active"), p = !e.hasAttribute("data-morphing"), m = p ? $(e, d) : 0;
|
|
615
|
+
if (p) {
|
|
616
|
+
let e = m - $(f ? o : s, d);
|
|
617
|
+
f ? c = e : l = e;
|
|
581
618
|
}
|
|
582
|
-
let
|
|
583
|
-
f || (u =
|
|
619
|
+
let h = p && f ? m : Pe(o, () => Fe(e, o, s, d, c));
|
|
620
|
+
f || (u = p ? m : Pe(o, () => Fe(e, s, o, d, l))), !(h <= 0) && (u !== null && u > 0 && e.style.setProperty("--dock-collapsed-px", `${u}px`), e.style.setProperty("--dock-expanded-px", `${Math.max(h, u ?? 0)}px`));
|
|
584
621
|
}
|
|
585
622
|
function p() {
|
|
586
623
|
if (!o) return;
|
|
@@ -598,7 +635,7 @@ function Ge(e) {
|
|
|
598
635
|
if (o?.disconnect(), o = null, s?.disconnect(), s = null, t.value) {
|
|
599
636
|
if (typeof ResizeObserver < "u" && (o = new ResizeObserver(() => f()), p()), typeof MutationObserver < "u") {
|
|
600
637
|
s = new MutationObserver(() => {
|
|
601
|
-
p(), f();
|
|
638
|
+
p(), o || f();
|
|
602
639
|
});
|
|
603
640
|
for (let e of [r.value, i.value]) e && s.observe(e, {
|
|
604
641
|
childList: !0,
|
|
@@ -606,10 +643,10 @@ function Ge(e) {
|
|
|
606
643
|
characterData: !0
|
|
607
644
|
});
|
|
608
645
|
}
|
|
609
|
-
f();
|
|
646
|
+
o || f();
|
|
610
647
|
}
|
|
611
648
|
}
|
|
612
|
-
|
|
649
|
+
Q([
|
|
613
650
|
t,
|
|
614
651
|
n,
|
|
615
652
|
r,
|
|
@@ -619,7 +656,7 @@ function Ge(e) {
|
|
|
619
656
|
let h = () => f();
|
|
620
657
|
typeof window < "u" && window.addEventListener("resize", h);
|
|
621
658
|
let g = typeof document < "u" ? document.fonts : void 0;
|
|
622
|
-
g && g.ready.then(() => !d && f()),
|
|
659
|
+
g && g.ready.then(() => !d && f()), W(() => {
|
|
623
660
|
d = !0, o?.disconnect(), o = null, s?.disconnect(), s = null, typeof window < "u" && window.removeEventListener("resize", h);
|
|
624
661
|
});
|
|
625
662
|
let _ = null;
|
|
@@ -637,7 +674,7 @@ function Ge(e) {
|
|
|
637
674
|
e,
|
|
638
675
|
...v(e),
|
|
639
676
|
...y()
|
|
640
|
-
].map((e) => [e,
|
|
677
|
+
].map((e) => [e, Ie(e, n)]));
|
|
641
678
|
}
|
|
642
679
|
function x() {
|
|
643
680
|
let e = t.value;
|
|
@@ -646,14 +683,14 @@ function Ge(e) {
|
|
|
646
683
|
e,
|
|
647
684
|
...v(e),
|
|
648
685
|
n.value
|
|
649
|
-
]) t?.style.removeProperty(
|
|
650
|
-
for (let e of y()) e.style.removeProperty(
|
|
686
|
+
]) t?.style.removeProperty(Le);
|
|
687
|
+
for (let e of y()) e.style.removeProperty(Re);
|
|
651
688
|
}
|
|
652
689
|
}
|
|
653
690
|
function S() {
|
|
654
691
|
let e = t.value, i = n.value, o = _;
|
|
655
692
|
if (_ = null, x(), !e || !i || !o || !o.get(e)) return;
|
|
656
|
-
let s = a.value, c = v(e), l =
|
|
693
|
+
let s = a.value, c = v(e), l = Ie(e, s), u = [
|
|
657
694
|
e,
|
|
658
695
|
...c,
|
|
659
696
|
i
|
|
@@ -666,9 +703,9 @@ function Ge(e) {
|
|
|
666
703
|
...c,
|
|
667
704
|
i,
|
|
668
705
|
...y()
|
|
669
|
-
].map((e) => [e,
|
|
706
|
+
].map((e) => [e, Ie(e, s)])), f = Ne(u, d), p = f.get(e), m = $(e, s), h = p.size / m;
|
|
670
707
|
if (!(h > 0)) return;
|
|
671
|
-
let g = (e) => Math.abs(1 - e) < 1e-4, b = l.size / p.size, S = !r.value?.classList.contains("is-active") || g(b) ?
|
|
708
|
+
let g = (e) => Math.abs(1 - e) < 1e-4, b = l.size / p.size, S = !r.value?.classList.contains("is-active") || g(b) ? Ne([
|
|
672
709
|
...u,
|
|
673
710
|
[
|
|
674
711
|
e,
|
|
@@ -683,24 +720,24 @@ function Ge(e) {
|
|
|
683
720
|
], d) : null, C = o;
|
|
684
721
|
if (S && g(b) && (C = S, b = S.get(e).size / p.size), !Number.isFinite(b)) return;
|
|
685
722
|
let w = (e) => (e - p.start) / h, T = (e, t) => g(b) ? null : (e - t) / (1 - b), E = (e) => w(e.start + e.size / 2), D = T(w(C.get(e).start), 0) ?? m / 2, O = (e, t) => `${e / t * 100}%`;
|
|
686
|
-
e.style.setProperty(
|
|
723
|
+
e.style.setProperty(Le, O(D, m));
|
|
687
724
|
for (let e of c) {
|
|
688
725
|
let t = C.get(e), n = f.get(e), r = $(e, s);
|
|
689
726
|
if (!t || !(r > 0)) continue;
|
|
690
727
|
let i = T(E(t), E(n));
|
|
691
|
-
e.style.setProperty(
|
|
728
|
+
e.style.setProperty(Le, O((i === null ? D : D - i) - w(n.start), r));
|
|
692
729
|
}
|
|
693
730
|
let k = $(i, s);
|
|
694
|
-
k > 0 && i.style.setProperty(
|
|
731
|
+
k > 0 && i.style.setProperty(Le, O(D - w(f.get(i).start), k));
|
|
695
732
|
for (let t of y()) {
|
|
696
733
|
let n = t.classList.contains("is-leaving"), r = n ? o.get(t) : S?.get(t), i = $(t, s);
|
|
697
734
|
if (!r || !(i > 0)) continue;
|
|
698
|
-
let a = n ? f.get(t) :
|
|
735
|
+
let a = n ? f.get(t) : Ne([[
|
|
699
736
|
e,
|
|
700
737
|
"--dock-morph-t",
|
|
701
738
|
"1"
|
|
702
|
-
]], () =>
|
|
703
|
-
a && t.style.setProperty(
|
|
739
|
+
]], () => Ie(t, s));
|
|
740
|
+
a && t.style.setProperty(Re, O((r.start - a.start) / h, i));
|
|
704
741
|
}
|
|
705
742
|
}
|
|
706
743
|
return {
|
|
@@ -712,7 +749,7 @@ function Ge(e) {
|
|
|
712
749
|
}
|
|
713
750
|
//#endregion
|
|
714
751
|
//#region src/components/dock/composables/useDockShellProps.ts
|
|
715
|
-
function
|
|
752
|
+
function Be(e) {
|
|
716
753
|
let t = A(() => e.shape ?? "pill"), n = A(() => e.orientation ?? "horizontal"), r = A(() => e.collapse === !1);
|
|
717
754
|
return {
|
|
718
755
|
startCollapsed: A(() => !r.value && (e.collapse ?? "closed") === "closed"),
|
|
@@ -724,21 +761,21 @@ function Ke(e) {
|
|
|
724
761
|
}
|
|
725
762
|
//#endregion
|
|
726
763
|
//#region src/components/dock/composables/useDockClickIntegrity.ts
|
|
727
|
-
function
|
|
728
|
-
let { rootEl: t, visualExpanded: n } = e, r = null, i = !1, a = 0, o = null, s =
|
|
729
|
-
function
|
|
730
|
-
|
|
731
|
-
for (let { element: e, wasInert: t } of
|
|
764
|
+
function Ve(e) {
|
|
765
|
+
let { rootEl: t, visualExpanded: n } = e, r = null, i = !1, a = 0, o = null, s = J(null), c = !1, l = !0, u = null, d = [];
|
|
766
|
+
function f() {
|
|
767
|
+
u?.removeAttribute("data-dock-press-origin"), u = null;
|
|
768
|
+
for (let { element: e, wasInert: t } of d.splice(0)) e.toggleAttribute("inert", t);
|
|
732
769
|
s.value = null;
|
|
733
770
|
}
|
|
734
|
-
function
|
|
771
|
+
function p(e) {
|
|
735
772
|
let n = (e instanceof Element ? e : null)?.closest("button, a[href], input, select, textarea, [role='button'], [tabindex]"), r = n?.closest(".dock-layer--full");
|
|
736
773
|
if (!(!n || !r || !t.value?.contains(r))) {
|
|
737
|
-
|
|
774
|
+
u = n, n.setAttribute("data-dock-press-origin", ""), s.value = "full";
|
|
738
775
|
for (let e = n; e !== r;) {
|
|
739
776
|
let t = e.parentElement;
|
|
740
777
|
if (!t) break;
|
|
741
|
-
for (let n of t.children) n === e || !(n instanceof HTMLElement) || (
|
|
778
|
+
for (let n of t.children) n === e || !(n instanceof HTMLElement) || (d.push({
|
|
742
779
|
element: n,
|
|
743
780
|
wasInert: n.inert
|
|
744
781
|
}), n.inert = !0);
|
|
@@ -746,95 +783,103 @@ function qe(e) {
|
|
|
746
783
|
}
|
|
747
784
|
}
|
|
748
785
|
}
|
|
749
|
-
function
|
|
786
|
+
function m() {
|
|
750
787
|
o !== null && (clearTimeout(o), o = null);
|
|
751
788
|
}
|
|
752
|
-
function
|
|
753
|
-
a =
|
|
789
|
+
function h() {
|
|
790
|
+
l = c, a = g() + 840, m(), o = setTimeout(() => {
|
|
754
791
|
o = null;
|
|
755
792
|
}, 840);
|
|
756
793
|
}
|
|
757
|
-
function
|
|
794
|
+
function g() {
|
|
758
795
|
return typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now();
|
|
759
796
|
}
|
|
760
|
-
function
|
|
797
|
+
function _() {
|
|
761
798
|
let e = t.value;
|
|
762
|
-
return e && e.hasAttribute("data-morphing") ? !0 :
|
|
799
|
+
return e && e.hasAttribute("data-morphing") ? !0 : g() < a;
|
|
763
800
|
}
|
|
764
|
-
function
|
|
801
|
+
function v() {
|
|
765
802
|
let e = t.value;
|
|
766
803
|
return !!e && e.hasAttribute("data-morphing");
|
|
767
804
|
}
|
|
768
|
-
function
|
|
769
|
-
|
|
805
|
+
function y(e) {
|
|
806
|
+
c = e.pointerType === "mouse";
|
|
807
|
+
}
|
|
808
|
+
function b() {
|
|
809
|
+
c = !1;
|
|
810
|
+
}
|
|
811
|
+
function x(e) {
|
|
812
|
+
c = !1, f(), r = e.target, i = v();
|
|
770
813
|
}
|
|
771
|
-
|
|
772
|
-
t && !e && r &&
|
|
814
|
+
Q(n, (e, t) => {
|
|
815
|
+
t && !e && r && p(r);
|
|
773
816
|
});
|
|
774
|
-
function
|
|
775
|
-
|
|
817
|
+
function S() {
|
|
818
|
+
f(), r = null, i = !1;
|
|
776
819
|
}
|
|
777
|
-
function
|
|
820
|
+
function C(e) {
|
|
778
821
|
if (!r || !e) return !1;
|
|
779
822
|
if (e === r) return !0;
|
|
780
823
|
let t = r instanceof Node ? r : null, n = e instanceof Node ? e : null;
|
|
781
824
|
return !t || !n ? !1 : t.contains(n) || n.contains(t);
|
|
782
825
|
}
|
|
783
|
-
function
|
|
784
|
-
|
|
826
|
+
function w(e) {
|
|
827
|
+
f();
|
|
785
828
|
let t = i;
|
|
786
|
-
if (i = !1, !
|
|
829
|
+
if (i = !1, !_()) {
|
|
787
830
|
r = null;
|
|
788
831
|
return;
|
|
789
832
|
}
|
|
790
833
|
if (!r && !t) return;
|
|
791
834
|
let n = r instanceof Element && r.closest(".dock-persistent") !== null;
|
|
792
|
-
if ((!t || n) &&
|
|
835
|
+
if ((!t || n || !l) && C(e.target)) {
|
|
793
836
|
r = null;
|
|
794
837
|
return;
|
|
795
838
|
}
|
|
796
839
|
e.stopPropagation(), e.preventDefault(), r = null;
|
|
797
840
|
}
|
|
798
|
-
return
|
|
799
|
-
|
|
841
|
+
return H(() => {
|
|
842
|
+
m(), f();
|
|
800
843
|
}), {
|
|
801
|
-
onPointerDownCapture:
|
|
802
|
-
onPointerCancelCapture:
|
|
803
|
-
onClickCapture:
|
|
804
|
-
markExpandFlip:
|
|
805
|
-
|
|
844
|
+
onPointerDownCapture: x,
|
|
845
|
+
onPointerCancelCapture: S,
|
|
846
|
+
onClickCapture: w,
|
|
847
|
+
markExpandFlip: h,
|
|
848
|
+
onPointerEnter: y,
|
|
849
|
+
onPointerLeave: b,
|
|
850
|
+
pressKeepaliveLayer: q(s)
|
|
806
851
|
};
|
|
807
852
|
}
|
|
808
853
|
//#endregion
|
|
809
854
|
//#region src/components/dock/composables/useDockRun.ts
|
|
810
|
-
function
|
|
855
|
+
function He(e, t) {
|
|
811
856
|
let n = getComputedStyle(e).getPropertyValue(t).trim(), r = Number.parseFloat(n);
|
|
812
857
|
return Number.isFinite(r) ? r : 0;
|
|
813
858
|
}
|
|
814
|
-
function
|
|
859
|
+
function Ue(e) {
|
|
815
860
|
return Array.from(e.children).filter((e) => e instanceof HTMLElement);
|
|
816
861
|
}
|
|
817
|
-
function
|
|
862
|
+
function We(e) {
|
|
818
863
|
return e.findIndex((e) => {
|
|
819
864
|
let t = (e.matches("[aria-current]") ? e : e.querySelector("[aria-current]"))?.getAttribute("aria-current");
|
|
820
865
|
return t != null && t !== "false";
|
|
821
866
|
});
|
|
822
867
|
}
|
|
823
|
-
function
|
|
824
|
-
return e.hasAttribute(
|
|
868
|
+
function Ge(e) {
|
|
869
|
+
return e.hasAttribute(u);
|
|
825
870
|
}
|
|
826
|
-
function
|
|
827
|
-
return
|
|
871
|
+
function Ke(e) {
|
|
872
|
+
return Ue(e).filter(Ge);
|
|
828
873
|
}
|
|
829
|
-
var
|
|
830
|
-
function
|
|
831
|
-
let t =
|
|
832
|
-
return t.length > 0 && t.every(
|
|
874
|
+
var qe = ".dock-separator", Je = "select[aria-hidden=\"true\"][tabindex=\"-1\"]";
|
|
875
|
+
function Ye(e) {
|
|
876
|
+
let t = Ue(e).filter((e) => !e.matches(qe) && !e.matches(Je));
|
|
877
|
+
return t.length > 0 && t.every(Ge);
|
|
833
878
|
}
|
|
834
|
-
function
|
|
835
|
-
let { runEl: t, statusEl: n, orientation: r } = e, i =
|
|
836
|
-
response:
|
|
837
|
-
dampingFraction:
|
|
879
|
+
function Xe(e) {
|
|
880
|
+
let { runEl: t, statusEl: n, orientation: r } = e, i = J(!1), a = je({
|
|
881
|
+
response: l.response,
|
|
882
|
+
dampingFraction: l.dampingFraction
|
|
838
883
|
});
|
|
839
884
|
function o() {
|
|
840
885
|
return r.value === "vertical";
|
|
@@ -845,65 +890,65 @@ function nt(e) {
|
|
|
845
890
|
function c(e, t) {
|
|
846
891
|
o() ? e.scrollTop = t : e.scrollLeft = t;
|
|
847
892
|
}
|
|
848
|
-
function
|
|
893
|
+
function d(e) {
|
|
849
894
|
return o() ? e.scrollHeight - e.clientHeight : e.scrollWidth - e.clientWidth;
|
|
850
895
|
}
|
|
851
|
-
function
|
|
852
|
-
let n =
|
|
896
|
+
function f(e, t) {
|
|
897
|
+
let n = Ue(e), r = n.indexOf(t);
|
|
853
898
|
if (r < 0) return s(e);
|
|
854
|
-
let i =
|
|
899
|
+
let i = He(e, "--dock-pitch");
|
|
855
900
|
if (i <= 0) return s(e);
|
|
856
|
-
let a = Math.max(1,
|
|
857
|
-
return Math.min(Math.max(
|
|
901
|
+
let a = Math.max(1, He(e, "--dock-open-pitches")), o = We(n), c = o >= 0 && o < r ? (a - 1) * i : 0, l = r * i + c - i / 2;
|
|
902
|
+
return Math.min(Math.max(l, 0), d(e));
|
|
858
903
|
}
|
|
859
|
-
function
|
|
904
|
+
function p(e, t) {
|
|
860
905
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
861
906
|
return o() ? r.top < n.top - 1 || r.bottom > n.bottom + 1 : r.left < n.left - 1 || r.right > n.right + 1;
|
|
862
907
|
}
|
|
863
|
-
function
|
|
908
|
+
function m(e) {
|
|
864
909
|
let t = n.value;
|
|
865
910
|
if (!t) return;
|
|
866
|
-
let r =
|
|
911
|
+
let r = Ge(e) ? e : e.querySelector(w) ?? e, i = r.getAttribute("aria-label") ?? r.getAttribute("title") ?? r.textContent?.trim();
|
|
867
912
|
i && (t.textContent = i);
|
|
868
913
|
}
|
|
869
|
-
function
|
|
914
|
+
function h(e) {
|
|
870
915
|
let n = t.value;
|
|
871
|
-
if (!n || (
|
|
872
|
-
let r = s(n), i =
|
|
916
|
+
if (!n || (m(e), !p(n, e))) return;
|
|
917
|
+
let r = s(n), i = f(n, e);
|
|
873
918
|
Math.abs(i - r) < 1 || a.playTo(0, 1, { onFrame: (e) => {
|
|
874
919
|
let n = t.value;
|
|
875
920
|
n && c(n, r + (i - r) * e);
|
|
876
921
|
} });
|
|
877
922
|
}
|
|
878
|
-
let
|
|
879
|
-
function
|
|
880
|
-
|
|
923
|
+
let g = /* @__PURE__ */ new WeakMap();
|
|
924
|
+
function _(e, t) {
|
|
925
|
+
g.has(e) || g.set(e, e.getAttribute("tabindex")), e.tabIndex = t;
|
|
881
926
|
}
|
|
882
|
-
function
|
|
883
|
-
if (!
|
|
884
|
-
let t =
|
|
885
|
-
|
|
927
|
+
function v(e) {
|
|
928
|
+
if (!g.has(e)) return;
|
|
929
|
+
let t = g.get(e) ?? null;
|
|
930
|
+
g.delete(e), t === null ? e.removeAttribute("tabindex") : e.setAttribute("tabindex", t);
|
|
886
931
|
}
|
|
887
|
-
function
|
|
932
|
+
function y() {
|
|
888
933
|
let e = t.value;
|
|
889
934
|
if (!e) return;
|
|
890
|
-
i.value =
|
|
891
|
-
for (let t of
|
|
892
|
-
let n =
|
|
935
|
+
i.value = Ye(e);
|
|
936
|
+
for (let t of Ue(e)) Ge(t) || v(t);
|
|
937
|
+
let n = Ke(e);
|
|
893
938
|
if (n.length === 0) return;
|
|
894
|
-
let r =
|
|
939
|
+
let r = We(n), a = n.findIndex((e) => e.contains(document.activeElement)), o = a >= 0 ? a : r >= 0 ? r : 0;
|
|
895
940
|
n.forEach((e, t) => {
|
|
896
|
-
|
|
941
|
+
_(e, t === o ? 0 : -1);
|
|
897
942
|
});
|
|
898
943
|
}
|
|
899
944
|
function b(e, t) {
|
|
900
945
|
let n = e[t];
|
|
901
|
-
n && (
|
|
946
|
+
n && (h(n), _(n, 0), n.focus({ preventScroll: !0 }), y());
|
|
902
947
|
}
|
|
903
948
|
function x(e) {
|
|
904
949
|
let n = t.value;
|
|
905
950
|
if (!n) return;
|
|
906
|
-
let r =
|
|
951
|
+
let r = Ke(n);
|
|
907
952
|
if (r.length === 0) return;
|
|
908
953
|
let i = r.findIndex((t) => t.contains(e.target));
|
|
909
954
|
if (i < 0) return;
|
|
@@ -928,50 +973,62 @@ function nt(e) {
|
|
|
928
973
|
function S(e) {
|
|
929
974
|
let n = t.value;
|
|
930
975
|
if (!n) return;
|
|
931
|
-
let r =
|
|
932
|
-
r &&
|
|
976
|
+
let r = Ue(n).find((t) => t.contains(e.target));
|
|
977
|
+
r && h(r);
|
|
933
978
|
}
|
|
934
|
-
|
|
935
|
-
|
|
979
|
+
function C(e) {
|
|
980
|
+
let n = t.value;
|
|
981
|
+
if (!n || e.ctrlKey) return;
|
|
982
|
+
let i = r.value === "vertical", a = i ? e.deltaY : e.deltaX;
|
|
983
|
+
if (a === 0) return;
|
|
984
|
+
let o = i ? n.scrollTop : n.scrollLeft, s = i ? n.scrollHeight - n.clientHeight : n.scrollWidth - n.clientWidth;
|
|
985
|
+
s <= 0 || (a > 0 && o >= s - .5 || a < 0 && o <= .5) && e.preventDefault();
|
|
986
|
+
}
|
|
987
|
+
let T = null;
|
|
988
|
+
function E(e, t) {
|
|
936
989
|
if (t.type !== "attributes" || t.attributeName === "aria-current" || t.attributeName === "data-glass-dock-seat") return !0;
|
|
937
990
|
let n = t.target;
|
|
938
|
-
return n.parentElement === e && !
|
|
991
|
+
return n.parentElement === e && !Ge(n);
|
|
939
992
|
}
|
|
940
|
-
return
|
|
993
|
+
return U(() => {
|
|
941
994
|
let e = t.value;
|
|
942
|
-
e && (e.addEventListener("keydown", x), e.addEventListener("click", S, { capture: !0 }), e.addEventListener("focusin", S, { capture: !0 }),
|
|
943
|
-
t.some((t) =>
|
|
944
|
-
}),
|
|
995
|
+
e && (e.addEventListener("keydown", x), e.addEventListener("wheel", C, { passive: !1 }), e.addEventListener("click", S, { capture: !0 }), e.addEventListener("focusin", S, { capture: !0 }), y(), T = new MutationObserver((t) => {
|
|
996
|
+
t.some((t) => E(e, t)) && y();
|
|
997
|
+
}), T.observe(e, {
|
|
945
998
|
childList: !0,
|
|
946
999
|
subtree: !0,
|
|
947
1000
|
attributes: !0,
|
|
948
1001
|
attributeFilter: [
|
|
949
1002
|
"aria-current",
|
|
950
|
-
|
|
1003
|
+
u,
|
|
951
1004
|
"aria-hidden",
|
|
952
1005
|
"tabindex"
|
|
953
1006
|
]
|
|
954
1007
|
}));
|
|
955
|
-
}),
|
|
1008
|
+
}), G(() => {
|
|
956
1009
|
let e = t.value;
|
|
957
|
-
e?.removeEventListener("keydown", x), e?.removeEventListener("click", S, { capture: !0 }), e?.removeEventListener("focusin", S, { capture: !0 }),
|
|
958
|
-
}),
|
|
959
|
-
reach:
|
|
960
|
-
syncRoving:
|
|
1010
|
+
e?.removeEventListener("keydown", x), e?.removeEventListener("wheel", C), e?.removeEventListener("click", S, { capture: !0 }), e?.removeEventListener("focusin", S, { capture: !0 }), T?.disconnect(), a.dispose();
|
|
1011
|
+
}), Q(r, () => y()), {
|
|
1012
|
+
reach: h,
|
|
1013
|
+
syncRoving: y,
|
|
961
1014
|
toolbar: i
|
|
962
1015
|
};
|
|
963
1016
|
}
|
|
964
1017
|
//#endregion
|
|
965
1018
|
//#region src/components/dock/GlassDock.vue?vue&type=script&setup=true&lang.ts
|
|
966
|
-
var
|
|
1019
|
+
var Ze = [
|
|
1020
|
+
"data-backdrop-mode",
|
|
1021
|
+
"data-anchor",
|
|
1022
|
+
"data-held"
|
|
1023
|
+
], Qe = ["data-held"], $e = { class: "dock-controls" }, et = {
|
|
967
1024
|
key: 0,
|
|
968
1025
|
class: "dock-persistent"
|
|
969
|
-
},
|
|
1026
|
+
}, tt = [
|
|
970
1027
|
"id",
|
|
971
1028
|
"role",
|
|
972
1029
|
"aria-orientation",
|
|
973
1030
|
"inert"
|
|
974
|
-
],
|
|
1031
|
+
], nt = [
|
|
975
1032
|
"id",
|
|
976
1033
|
"inert",
|
|
977
1034
|
"role",
|
|
@@ -979,13 +1036,13 @@ var rt = ["data-backdrop-mode", "data-held"], it = ["data-held"], at = { class:
|
|
|
979
1036
|
"aria-label",
|
|
980
1037
|
"aria-expanded",
|
|
981
1038
|
"aria-controls"
|
|
982
|
-
],
|
|
1039
|
+
], rt = {
|
|
983
1040
|
key: 0,
|
|
984
1041
|
class: "dock-search-field"
|
|
985
|
-
},
|
|
1042
|
+
}, it = {
|
|
986
1043
|
key: 1,
|
|
987
1044
|
class: "dock-persistent dock-persistent-end"
|
|
988
|
-
},
|
|
1045
|
+
}, at = /* @__PURE__ */ I({
|
|
989
1046
|
inheritAttrs: !1,
|
|
990
1047
|
__name: "GlassDock",
|
|
991
1048
|
props: {
|
|
@@ -997,76 +1054,80 @@ var rt = ["data-backdrop-mode", "data-held"], it = ["data-held"], at = { class:
|
|
|
997
1054
|
type: [Boolean, String],
|
|
998
1055
|
default: "closed"
|
|
999
1056
|
},
|
|
1057
|
+
expandOn: { default: "hover" },
|
|
1058
|
+
anchor: { default: "center" },
|
|
1059
|
+
collapsedLabel: { default: "Expand dock" },
|
|
1000
1060
|
backgroundCanvas: {}
|
|
1001
1061
|
},
|
|
1002
1062
|
setup(e, { expose: t }) {
|
|
1003
|
-
let n = e, { startCollapsed: r, shape: i, orientation: a, alwaysExpanded: o, fitContent: s } =
|
|
1004
|
-
runEl:
|
|
1005
|
-
statusEl:
|
|
1063
|
+
let n = e, { startCollapsed: r, shape: i, orientation: a, alwaysExpanded: o, fitContent: s } = Be(n), c = Z("dockEl"), l = Z("layersEl"), u = Z("fullEl"), f = Z("summaryEl"), p = Z("statusEl"), { toolbar: g } = Xe({
|
|
1064
|
+
runEl: u,
|
|
1065
|
+
statusEl: p,
|
|
1006
1066
|
orientation: a
|
|
1007
1067
|
});
|
|
1008
|
-
n.backdropMode === "live" &&
|
|
1068
|
+
n.backdropMode === "live" && ke(c, { backgroundCanvas: () => {
|
|
1009
1069
|
let e = n.backgroundCanvas;
|
|
1010
1070
|
return typeof e == "function" ? e() : e instanceof HTMLCanvasElement ? e : null;
|
|
1011
1071
|
} });
|
|
1012
|
-
let _ =
|
|
1072
|
+
let _ = J(!1), v = `glass-dock-${re()}`, { expanded: y, isPinned: b, isHeld: x, graspHeld: S, onMouseEnter: C, onMouseLeave: T, onFocusIn: E, onFocusOut: D, onClickCollapsed: O, keepOpen: j, release: I, expand: L, collapse: V } = Ae({
|
|
1013
1073
|
rootEl: c,
|
|
1014
1074
|
alwaysExpanded: o,
|
|
1075
|
+
expandOn: A(() => n.expandOn),
|
|
1015
1076
|
initialExpanded: !r.value,
|
|
1016
1077
|
isTransitioning: _,
|
|
1017
1078
|
dockId: v
|
|
1018
|
-
}),
|
|
1019
|
-
|
|
1079
|
+
}), H = A(() => o.value || y.value);
|
|
1080
|
+
m({
|
|
1020
1081
|
id: v,
|
|
1021
1082
|
orientation: a,
|
|
1022
|
-
keepOpen:
|
|
1023
|
-
release:
|
|
1083
|
+
keepOpen: j,
|
|
1084
|
+
release: I,
|
|
1024
1085
|
held: S,
|
|
1025
|
-
expanded:
|
|
1086
|
+
expanded: H
|
|
1026
1087
|
});
|
|
1027
|
-
let
|
|
1088
|
+
let U = ze({
|
|
1028
1089
|
rootEl: c,
|
|
1029
|
-
contentEl:
|
|
1030
|
-
expandedEl:
|
|
1031
|
-
collapsedEl:
|
|
1090
|
+
contentEl: l,
|
|
1091
|
+
expandedEl: u,
|
|
1092
|
+
collapsedEl: f,
|
|
1032
1093
|
axis: a
|
|
1033
|
-
}), { outerCurrentLayer:
|
|
1094
|
+
}), { outerCurrentLayer: W, outerLeavingLayer: G } = Me({
|
|
1034
1095
|
rootEl: c,
|
|
1035
|
-
outerActiveLayer: A(() =>
|
|
1096
|
+
outerActiveLayer: A(() => H.value ? "full" : "summary"),
|
|
1036
1097
|
onMorphActiveChange: (e) => {
|
|
1037
1098
|
_.value = e;
|
|
1038
1099
|
},
|
|
1039
|
-
geometry:
|
|
1040
|
-
}),
|
|
1041
|
-
async function
|
|
1042
|
-
!
|
|
1100
|
+
geometry: U
|
|
1101
|
+
}), q = A(() => W.value === "summary");
|
|
1102
|
+
async function ee(e) {
|
|
1103
|
+
!q.value || !["Enter", " "].includes(e.key) || (e.preventDefault(), O(), await z(), (u.value?.querySelector(w) ?? u.value)?.focus({ preventScroll: !0 }));
|
|
1043
1104
|
}
|
|
1044
|
-
function
|
|
1105
|
+
function te(e) {
|
|
1045
1106
|
if (e.key !== "Escape") return;
|
|
1046
|
-
let t = e.target?.closest?.(
|
|
1047
|
-
t &&
|
|
1107
|
+
let t = e.target?.closest?.(d);
|
|
1108
|
+
t && u.value?.contains(t) || V();
|
|
1048
1109
|
}
|
|
1049
|
-
|
|
1110
|
+
Q(H, async (e, t) => {
|
|
1050
1111
|
if (!t || e) return;
|
|
1051
1112
|
let n = document.activeElement;
|
|
1052
|
-
if (!(n &&
|
|
1113
|
+
if (!(n && u.value?.contains(n) || n?.closest("[data-glass-dock-face]")?.getAttribute("data-glass-dock-owner") === v)) return;
|
|
1053
1114
|
await z();
|
|
1054
|
-
let r =
|
|
1115
|
+
let r = f.value;
|
|
1055
1116
|
r && !r.hasAttribute("inert") && r.focus({ preventScroll: !0 });
|
|
1056
1117
|
});
|
|
1057
|
-
let { onPointerDownCapture:
|
|
1118
|
+
let { onPointerDownCapture: ne, onPointerCancelCapture: ie, onClickCapture: oe, markExpandFlip: ce, onPointerEnter: le, onPointerLeave: ue, pressKeepaliveLayer: de } = Ve({
|
|
1058
1119
|
rootEl: c,
|
|
1059
|
-
visualExpanded:
|
|
1120
|
+
visualExpanded: H
|
|
1060
1121
|
});
|
|
1061
|
-
|
|
1122
|
+
Q(H, (e) => {
|
|
1062
1123
|
e && ce();
|
|
1063
1124
|
});
|
|
1064
|
-
let
|
|
1065
|
-
|
|
1066
|
-
e && (
|
|
1125
|
+
let fe = J(!1);
|
|
1126
|
+
Q(S, (e) => {
|
|
1127
|
+
e && (fe.value = !0);
|
|
1067
1128
|
});
|
|
1068
|
-
function
|
|
1069
|
-
e.propertyName === "opacity" && !S.value && (
|
|
1129
|
+
function pe(e) {
|
|
1130
|
+
e.propertyName === "opacity" && !S.value && (fe.value = !1);
|
|
1070
1131
|
}
|
|
1071
1132
|
return t({
|
|
1072
1133
|
expanded: y,
|
|
@@ -1074,119 +1135,122 @@ var rt = ["data-backdrop-mode", "data-held"], it = ["data-held"], at = { class:
|
|
|
1074
1135
|
isHeld: x,
|
|
1075
1136
|
graspHeld: S,
|
|
1076
1137
|
isTransitioning: _,
|
|
1077
|
-
expand:
|
|
1078
|
-
collapse:
|
|
1079
|
-
keepOpen:
|
|
1080
|
-
release:
|
|
1081
|
-
}), (e, t) => (
|
|
1138
|
+
expand: L,
|
|
1139
|
+
collapse: V,
|
|
1140
|
+
keepOpen: j,
|
|
1141
|
+
release: I
|
|
1142
|
+
}), (e, t) => (K(), N("div", R({
|
|
1082
1143
|
ref_key: "dockEl",
|
|
1083
1144
|
ref: c
|
|
1084
1145
|
}, e.$attrs, {
|
|
1085
1146
|
class: ["glass-dock", [
|
|
1086
|
-
|
|
1087
|
-
`shape-${
|
|
1147
|
+
X(a),
|
|
1148
|
+
`shape-${X(i)}`,
|
|
1088
1149
|
{
|
|
1089
|
-
expanded:
|
|
1090
|
-
collapsed: !
|
|
1091
|
-
pinned:
|
|
1092
|
-
"fit-content":
|
|
1093
|
-
"always-expanded":
|
|
1150
|
+
expanded: H.value,
|
|
1151
|
+
collapsed: !H.value,
|
|
1152
|
+
pinned: X(b),
|
|
1153
|
+
"fit-content": X(s),
|
|
1154
|
+
"always-expanded": X(o)
|
|
1094
1155
|
}
|
|
1095
1156
|
]],
|
|
1096
1157
|
"data-backdrop-mode": n.backdropMode,
|
|
1097
|
-
"data-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1158
|
+
"data-anchor": n.anchor === "center" ? void 0 : n.anchor,
|
|
1159
|
+
"data-held": X(S) || void 0,
|
|
1160
|
+
onMouseenter: t[2] ||= (...e) => X(C) && X(C)(...e),
|
|
1161
|
+
onMouseleave: t[3] ||= (e) => X(T)(e),
|
|
1162
|
+
onFocusin: t[4] ||= (...e) => X(E) && X(E)(...e),
|
|
1163
|
+
onFocusout: t[5] ||= (...e) => X(D) && X(D)(...e),
|
|
1164
|
+
onPointerenter: t[6] ||= (...e) => X(le) && X(le)(...e),
|
|
1165
|
+
onPointerleave: t[7] ||= (...e) => X(ue) && X(ue)(...e),
|
|
1166
|
+
onPointerdownCapture: t[8] ||= (...e) => X(ne) && X(ne)(...e),
|
|
1167
|
+
onPointercancelCapture: t[9] ||= (...e) => X(ie) && X(ie)(...e),
|
|
1168
|
+
onClickCapture: t[10] ||= (...e) => X(oe) && X(oe)(...e)
|
|
1105
1169
|
}), [
|
|
1106
1170
|
P("div", {
|
|
1107
1171
|
class: "dock-plate",
|
|
1108
1172
|
"aria-hidden": "true",
|
|
1109
|
-
"data-held":
|
|
1110
|
-
}, [
|
|
1173
|
+
"data-held": X(S) || void 0
|
|
1174
|
+
}, [fe.value ? (K(), N(k, { key: 0 }, [t[11] ||= P("span", {
|
|
1111
1175
|
class: "glass-grasp-carrier",
|
|
1112
1176
|
"data-grasp": "rest"
|
|
1113
1177
|
}, null, -1), P("span", {
|
|
1114
1178
|
class: "glass-grasp-carrier",
|
|
1115
1179
|
"data-grasp": "grasp",
|
|
1116
|
-
onTransitionend:
|
|
1117
|
-
}, null, 32)], 64)) : M("", !0)], 8,
|
|
1118
|
-
P("div",
|
|
1119
|
-
e.$slots.persistent ? (
|
|
1180
|
+
onTransitionend: pe
|
|
1181
|
+
}, null, 32)], 64)) : M("", !0)], 8, Qe),
|
|
1182
|
+
P("div", $e, [
|
|
1183
|
+
e.$slots.persistent ? (K(), N("div", et, [Y(e.$slots, "persistent")])) : M("", !0),
|
|
1120
1184
|
P("div", {
|
|
1121
1185
|
ref_key: "layersEl",
|
|
1122
|
-
ref:
|
|
1186
|
+
ref: l,
|
|
1123
1187
|
class: "dock-layers"
|
|
1124
1188
|
}, [
|
|
1125
1189
|
P("div", {
|
|
1126
1190
|
ref_key: "fullEl",
|
|
1127
|
-
ref:
|
|
1191
|
+
ref: u,
|
|
1128
1192
|
id: `${v}-full`,
|
|
1129
|
-
role:
|
|
1130
|
-
"aria-orientation":
|
|
1193
|
+
role: X(g) ? "toolbar" : void 0,
|
|
1194
|
+
"aria-orientation": X(g) ? X(a) : void 0,
|
|
1131
1195
|
class: B(["dock-layer dock-layer--full dock-run", {
|
|
1132
|
-
"is-active":
|
|
1133
|
-
"is-leaving":
|
|
1134
|
-
"is-press-keepalive":
|
|
1196
|
+
"is-active": X(W) === "full",
|
|
1197
|
+
"is-leaving": X(G) === "full" || X(de) === "full" && X(W) !== "full",
|
|
1198
|
+
"is-press-keepalive": X(de) === "full"
|
|
1135
1199
|
}]),
|
|
1136
|
-
inert:
|
|
1200
|
+
inert: X(W) !== "full" && X(de) !== "full" || void 0,
|
|
1137
1201
|
tabindex: "-1",
|
|
1138
|
-
onKeydown:
|
|
1139
|
-
}, [F(
|
|
1140
|
-
default:
|
|
1202
|
+
onKeydown: te
|
|
1203
|
+
}, [F(X(h), null, {
|
|
1204
|
+
default: ae(() => [Y(e.$slots, "default")]),
|
|
1141
1205
|
_: 3
|
|
1142
|
-
})], 42,
|
|
1206
|
+
})], 42, tt),
|
|
1143
1207
|
P("div", {
|
|
1144
1208
|
ref_key: "summaryEl",
|
|
1145
|
-
ref:
|
|
1209
|
+
ref: f,
|
|
1146
1210
|
id: `${v}-summary`,
|
|
1147
1211
|
class: B(["dock-layer dock-layer--summary", {
|
|
1148
|
-
"is-active":
|
|
1149
|
-
"is-leaving":
|
|
1212
|
+
"is-active": X(W) === "summary",
|
|
1213
|
+
"is-leaving": X(G) === "summary"
|
|
1150
1214
|
}]),
|
|
1151
|
-
inert:
|
|
1152
|
-
role:
|
|
1153
|
-
tabindex:
|
|
1154
|
-
"aria-label":
|
|
1155
|
-
"aria-expanded":
|
|
1156
|
-
"aria-controls":
|
|
1157
|
-
onFocusin: t[0] ||=
|
|
1158
|
-
onKeydown:
|
|
1159
|
-
onClick: t[1] ||= (...e) =>
|
|
1160
|
-
}, [
|
|
1161
|
-
e.$slots.search ? (
|
|
1215
|
+
inert: X(W) !== "summary" || void 0,
|
|
1216
|
+
role: q.value ? "button" : void 0,
|
|
1217
|
+
tabindex: q.value ? 0 : void 0,
|
|
1218
|
+
"aria-label": q.value ? n.collapsedLabel : void 0,
|
|
1219
|
+
"aria-expanded": q.value ? "false" : void 0,
|
|
1220
|
+
"aria-controls": q.value ? `${v}-full` : void 0,
|
|
1221
|
+
onFocusin: t[0] ||= se(() => {}, ["stop"]),
|
|
1222
|
+
onKeydown: ee,
|
|
1223
|
+
onClick: t[1] ||= (...e) => X(O) && X(O)(...e)
|
|
1224
|
+
}, [Y(e.$slots, "collapsed")], 42, nt),
|
|
1225
|
+
e.$slots.search ? (K(), N("div", rt, [Y(e.$slots, "search")])) : M("", !0)
|
|
1162
1226
|
], 512),
|
|
1163
|
-
e.$slots["persistent-end"] ? (
|
|
1227
|
+
e.$slots["persistent-end"] ? (K(), N("div", it, [Y(e.$slots, "persistent-end")])) : M("", !0)
|
|
1164
1228
|
]),
|
|
1165
1229
|
P("div", {
|
|
1166
1230
|
ref_key: "statusEl",
|
|
1167
|
-
ref:
|
|
1231
|
+
ref: p,
|
|
1168
1232
|
class: "dock-run-status",
|
|
1169
1233
|
role: "status",
|
|
1170
1234
|
"aria-live": "polite"
|
|
1171
1235
|
}, null, 512)
|
|
1172
|
-
], 16,
|
|
1236
|
+
], 16, Ze));
|
|
1173
1237
|
}
|
|
1174
|
-
}),
|
|
1175
|
-
function
|
|
1176
|
-
|
|
1238
|
+
}), ot = c("glass-ui:dock-switcher-tablist"), { KEY: st } = ot;
|
|
1239
|
+
function ct(e) {
|
|
1240
|
+
ot.provide(e);
|
|
1177
1241
|
}
|
|
1178
|
-
var
|
|
1179
|
-
function
|
|
1180
|
-
|
|
1242
|
+
var lt = ot.use, ut = s(f, "[glass-ui:dock] <DockLayer> must be used inside <DockCrossfade> (or <DockLayerGroup>)"), { KEY: dt } = ut;
|
|
1243
|
+
function ft(e) {
|
|
1244
|
+
ut.provide(e);
|
|
1181
1245
|
}
|
|
1182
|
-
var
|
|
1246
|
+
var pt = ut.use, mt = /* @__PURE__ */ I({
|
|
1183
1247
|
__name: "DockCrossfade",
|
|
1184
1248
|
props: {
|
|
1185
1249
|
active: {},
|
|
1186
1250
|
reserve: { default: "block" }
|
|
1187
1251
|
},
|
|
1188
1252
|
setup(e, { expose: t }) {
|
|
1189
|
-
let n = e, r =
|
|
1253
|
+
let n = e, r = J(null), i = J(/* @__PURE__ */ new Map()), a = A(() => [...i.value.values()].map(({ id: e, label: t, icon: n }) => ({
|
|
1190
1254
|
id: e,
|
|
1191
1255
|
label: t,
|
|
1192
1256
|
icon: n
|
|
@@ -1200,31 +1264,31 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1200
1264
|
let t = new Map(i.value);
|
|
1201
1265
|
t.delete(e), i.value = t, p();
|
|
1202
1266
|
}
|
|
1203
|
-
let c = A(() => n.active),
|
|
1204
|
-
|
|
1267
|
+
let c = A(() => n.active), u = J(null);
|
|
1268
|
+
ft({
|
|
1205
1269
|
register: o,
|
|
1206
1270
|
unregister: s,
|
|
1207
1271
|
activeId: c,
|
|
1208
|
-
leavingId:
|
|
1272
|
+
leavingId: u,
|
|
1209
1273
|
faces: a
|
|
1210
1274
|
});
|
|
1211
|
-
let
|
|
1275
|
+
let d = J(0), f = A(() => n.reserve === "inline" ? "min-inline-size" : "min-block-size");
|
|
1212
1276
|
function p() {
|
|
1213
1277
|
let e = 0;
|
|
1214
1278
|
for (let { el: t } of i.value.values()) {
|
|
1215
1279
|
let r = n.reserve === "inline" ? t.scrollWidth : t.scrollHeight;
|
|
1216
1280
|
r > e && (e = r);
|
|
1217
1281
|
}
|
|
1218
|
-
e >
|
|
1282
|
+
e > d.value && (d.value = e);
|
|
1219
1283
|
}
|
|
1220
|
-
let m = A(() =>
|
|
1221
|
-
[f.value]: `${
|
|
1222
|
-
"--dock-crossfade-peak": `${
|
|
1284
|
+
let m = A(() => d.value > 0 ? {
|
|
1285
|
+
[f.value]: `${d.value}px`,
|
|
1286
|
+
"--dock-crossfade-peak": `${d.value}px`
|
|
1223
1287
|
} : void 0);
|
|
1224
|
-
|
|
1225
|
-
let h =
|
|
1226
|
-
response:
|
|
1227
|
-
dampingFraction:
|
|
1288
|
+
x(r, () => p());
|
|
1289
|
+
let h = je({
|
|
1290
|
+
response: l.response,
|
|
1291
|
+
dampingFraction: l.dampingFraction
|
|
1228
1292
|
});
|
|
1229
1293
|
function g(e) {
|
|
1230
1294
|
return e ? i.value.get(e)?.el : void 0;
|
|
@@ -1238,8 +1302,8 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1238
1302
|
function y(e) {
|
|
1239
1303
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
1240
1304
|
}
|
|
1241
|
-
let
|
|
1242
|
-
|
|
1305
|
+
let b = fe("(prefers-reduced-motion: reduce)"), S = null, C = 1;
|
|
1306
|
+
Q(b, (e) => {
|
|
1243
1307
|
e && (h.dispose(), S?.());
|
|
1244
1308
|
});
|
|
1245
1309
|
async function w(e, t) {
|
|
@@ -1247,47 +1311,47 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1247
1311
|
let n = g(e), r = document.activeElement;
|
|
1248
1312
|
!n || !r || !n.contains(r) || (await z(), (g(t) ?? document.body).focus?.());
|
|
1249
1313
|
}
|
|
1250
|
-
return
|
|
1314
|
+
return Q(c, (e, t) => {
|
|
1251
1315
|
if (e === t) return;
|
|
1252
1316
|
p();
|
|
1253
1317
|
let n = g(e), i = g(t);
|
|
1254
1318
|
if (!n || !i) {
|
|
1255
|
-
|
|
1319
|
+
u.value = null, v(e), C = 1;
|
|
1256
1320
|
return;
|
|
1257
1321
|
}
|
|
1258
|
-
let a =
|
|
1259
|
-
a && a !== e && a !== t && v(a),
|
|
1322
|
+
let a = u.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, l = Number.isFinite(s) ? y(s) : 1;
|
|
1323
|
+
a && a !== e && a !== t && v(a), u.value = t, _(e, c), _(t, 1 - l), w(t, e), r.value?.setAttribute("data-crossfading", "");
|
|
1260
1324
|
let d = () => {
|
|
1261
|
-
v(e), v(t), r.value?.removeAttribute("data-crossfading"),
|
|
1325
|
+
v(e), v(t), r.value?.removeAttribute("data-crossfading"), u.value = null, C = 1, S === d && (S = null);
|
|
1262
1326
|
};
|
|
1263
|
-
if (S = d,
|
|
1327
|
+
if (S = d, b.value) {
|
|
1264
1328
|
d();
|
|
1265
1329
|
return;
|
|
1266
1330
|
}
|
|
1267
|
-
let f =
|
|
1331
|
+
let f = l > .001 ? -C / l : 0;
|
|
1268
1332
|
C = 1 - c, h.playTo(0, 1, {
|
|
1269
1333
|
inheritVelocityScale: f,
|
|
1270
1334
|
onFrame: (n) => {
|
|
1271
|
-
_(e, y(c + (1 - c) * n)), _(t, y(1 -
|
|
1335
|
+
_(e, y(c + (1 - c) * n)), _(t, y(1 - l * (1 - n)));
|
|
1272
1336
|
},
|
|
1273
1337
|
onSettle: d
|
|
1274
1338
|
});
|
|
1275
|
-
}),
|
|
1339
|
+
}), H(() => {
|
|
1276
1340
|
h.dispose(), S = null;
|
|
1277
|
-
}), t({ faces: a }), (e, t) => (
|
|
1341
|
+
}), t({ faces: a }), (e, t) => (K(), N("div", {
|
|
1278
1342
|
ref_key: "rootEl",
|
|
1279
1343
|
ref: r,
|
|
1280
1344
|
class: "dock-crossfade",
|
|
1281
|
-
style:
|
|
1282
|
-
}, [
|
|
1345
|
+
style: V(m.value)
|
|
1346
|
+
}, [Y(e.$slots, "default")], 4));
|
|
1283
1347
|
}
|
|
1284
|
-
}),
|
|
1348
|
+
}), ht = ["data-motion"], gt = ["aria-orientation"], _t = [
|
|
1285
1349
|
"id",
|
|
1286
1350
|
"tabindex",
|
|
1287
1351
|
"aria-controls",
|
|
1288
1352
|
"aria-label",
|
|
1289
1353
|
"onClick"
|
|
1290
|
-
],
|
|
1354
|
+
], vt = { key: 1 }, yt = { key: 2 }, bt = /* @__PURE__ */ I({
|
|
1291
1355
|
__name: "DockLayerGroup",
|
|
1292
1356
|
props: /*@__PURE__*/ L({
|
|
1293
1357
|
orientation: {},
|
|
@@ -1303,27 +1367,27 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1303
1367
|
}),
|
|
1304
1368
|
emits: ["update:active"],
|
|
1305
1369
|
setup(e) {
|
|
1306
|
-
let t = e, n =
|
|
1307
|
-
options: A(() =>
|
|
1370
|
+
let t = e, n = b(() => t.motion), r = ie(e, "active"), i = y(), a = A(() => t.orientation ?? i?.orientation.value ?? "horizontal"), o = Z("crossfade"), s = A(() => o.value?.faces ?? []), c = A(() => a.value === "vertical" ? "horizontal" : "vertical"), l = A(() => c.value === "vertical"), u = J(null), d = J(null), f = J([]), p = T({
|
|
1371
|
+
options: A(() => s.value.map((e) => ({ value: e.id }))),
|
|
1308
1372
|
model: r,
|
|
1309
1373
|
mode: "single",
|
|
1310
1374
|
role: "tablist",
|
|
1311
|
-
vertical:
|
|
1312
|
-
containerRef:
|
|
1313
|
-
indicatorRef:
|
|
1314
|
-
buttonRefs:
|
|
1315
|
-
}),
|
|
1316
|
-
|
|
1317
|
-
isTablist:
|
|
1318
|
-
tabId:
|
|
1375
|
+
vertical: l,
|
|
1376
|
+
containerRef: u,
|
|
1377
|
+
indicatorRef: d,
|
|
1378
|
+
buttonRefs: f
|
|
1379
|
+
}), m = A(() => t.showSwitcher && s.value.length > 1), h = re(), _ = (e) => e.replace(/[^a-zA-Z0-9_-]/g, ""), v = (e) => `dock-tab-${h}-${_(e)}`, x = (e) => `dock-panel-${h}-${_(e)}`;
|
|
1380
|
+
ct({
|
|
1381
|
+
isTablist: m,
|
|
1382
|
+
tabId: v,
|
|
1319
1383
|
panelId: x
|
|
1320
1384
|
});
|
|
1321
|
-
let S = A(() =>
|
|
1385
|
+
let S = A(() => l.value ? "y" : "x");
|
|
1322
1386
|
function C() {
|
|
1323
|
-
let e =
|
|
1387
|
+
let e = u.value;
|
|
1324
1388
|
if (!e) return [];
|
|
1325
1389
|
let t = Array.from(e.querySelectorAll(".dock-layer-tab"));
|
|
1326
|
-
return
|
|
1390
|
+
return s.value.map((e, n) => {
|
|
1327
1391
|
let r = t[n]?.getBoundingClientRect(), i = r ? S.value === "y" ? r.top + r.height / 2 : r.left + r.width / 2 : 0;
|
|
1328
1392
|
return {
|
|
1329
1393
|
value: e.id,
|
|
@@ -1332,88 +1396,88 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1332
1396
|
});
|
|
1333
1397
|
}
|
|
1334
1398
|
let w = E({
|
|
1335
|
-
handle:
|
|
1336
|
-
surface:
|
|
1399
|
+
handle: u,
|
|
1400
|
+
surface: d,
|
|
1337
1401
|
axis: () => S.value,
|
|
1338
1402
|
snapTargets: C,
|
|
1339
1403
|
onSnap: (e) => {
|
|
1340
1404
|
n.armed.value && r.value !== e && (r.value = e);
|
|
1341
1405
|
}
|
|
1342
1406
|
});
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1407
|
+
Q(() => [
|
|
1408
|
+
s.value.length,
|
|
1409
|
+
c.value,
|
|
1346
1410
|
n.armed.value
|
|
1347
1411
|
], () => {
|
|
1348
1412
|
n.armed.value && z(() => w.refresh());
|
|
1349
|
-
}),
|
|
1413
|
+
}), U(() => {
|
|
1350
1414
|
n.armed.value && z(() => w.refresh());
|
|
1351
1415
|
});
|
|
1352
1416
|
function D(e) {
|
|
1353
1417
|
return typeof e == "object" && !!e || typeof e == "function";
|
|
1354
1418
|
}
|
|
1355
|
-
let O =
|
|
1356
|
-
function
|
|
1419
|
+
let O = g(() => i);
|
|
1420
|
+
function I() {
|
|
1357
1421
|
O.acquire();
|
|
1358
1422
|
}
|
|
1359
|
-
function
|
|
1423
|
+
function L(e) {
|
|
1360
1424
|
let t = e.relatedTarget, n = e.currentTarget;
|
|
1361
1425
|
t && n?.contains(t) || O.release();
|
|
1362
1426
|
}
|
|
1363
|
-
return (t, i) => (
|
|
1427
|
+
return (t, i) => (K(), N("div", {
|
|
1364
1428
|
class: B(["dock-layer-group", [a.value, `switcher-${e.switcherPosition}`]]),
|
|
1365
|
-
"data-motion":
|
|
1366
|
-
style:
|
|
1367
|
-
}, [
|
|
1429
|
+
"data-motion": X(n).dataMotion.value,
|
|
1430
|
+
style: V(X(n).hostStyle.value)
|
|
1431
|
+
}, [m.value ? (K(), N("div", {
|
|
1368
1432
|
key: 0,
|
|
1369
1433
|
ref_key: "switcherListEl",
|
|
1370
|
-
ref:
|
|
1434
|
+
ref: u,
|
|
1371
1435
|
role: "tablist",
|
|
1372
|
-
class: B(["dock-layer-switcher", [e.switcherPosition,
|
|
1373
|
-
"aria-orientation":
|
|
1374
|
-
onKeydown: i[0] ||= (...e) =>
|
|
1375
|
-
onFocusin:
|
|
1376
|
-
onFocusout:
|
|
1377
|
-
}, [(
|
|
1436
|
+
class: B(["dock-layer-switcher", [e.switcherPosition, X(n).armed.value && "glass-drag-grabbable"]]),
|
|
1437
|
+
"aria-orientation": c.value,
|
|
1438
|
+
onKeydown: i[0] ||= (...e) => X(p).onKeydown && X(p).onKeydown(...e),
|
|
1439
|
+
onFocusin: I,
|
|
1440
|
+
onFocusout: L
|
|
1441
|
+
}, [(K(!0), N(k, null, ee(s.value, (e, t) => (K(), N("button", R({
|
|
1378
1442
|
key: e.id,
|
|
1379
1443
|
ref_for: !0,
|
|
1380
1444
|
ref: (e) => {
|
|
1381
|
-
e && (
|
|
1445
|
+
e && (f.value[t] = e);
|
|
1382
1446
|
},
|
|
1383
1447
|
type: "button",
|
|
1384
1448
|
class: "dock-layer-tab",
|
|
1385
|
-
id:
|
|
1386
|
-
tabindex:
|
|
1387
|
-
}, { ref_for: !0 },
|
|
1449
|
+
id: v(e.id),
|
|
1450
|
+
tabindex: X(p).rovingTabindex(t)
|
|
1451
|
+
}, { ref_for: !0 }, X(p).itemAttrs(e.id), {
|
|
1388
1452
|
"aria-controls": x(e.id),
|
|
1389
1453
|
"aria-label": e.label ?? e.id,
|
|
1390
|
-
onClick: (n) =>
|
|
1391
|
-
}), [D(e.icon) ? (
|
|
1454
|
+
onClick: (n) => X(p).select(e.id, t)
|
|
1455
|
+
}), [D(e.icon) ? (K(), j(te(e.icon), {
|
|
1392
1456
|
key: 0,
|
|
1393
1457
|
class: "size-4"
|
|
1394
|
-
})) : typeof e.icon == "string" ? (
|
|
1458
|
+
})) : typeof e.icon == "string" ? (K(), N("span", vt, ne(e.icon), 1)) : (K(), N("span", yt, ne((e.label ?? e.id).charAt(0)), 1))], 16, _t))), 128)), P("div", {
|
|
1395
1459
|
ref_key: "switcherIndicatorEl",
|
|
1396
|
-
ref:
|
|
1397
|
-
class: B(["dock-layer-tab-indicator",
|
|
1398
|
-
style:
|
|
1460
|
+
ref: d,
|
|
1461
|
+
class: B(["dock-layer-tab-indicator", X(n).armed.value && X(w).dragging.value && "glass-drag-lift"]),
|
|
1462
|
+
style: V(X(p).singleSliderStyle.value),
|
|
1399
1463
|
"aria-hidden": "true"
|
|
1400
|
-
}, null, 6)], 42,
|
|
1464
|
+
}, null, 6)], 42, gt)) : M("", !0), F(mt, {
|
|
1401
1465
|
ref_key: "crossfade",
|
|
1402
|
-
ref:
|
|
1466
|
+
ref: o,
|
|
1403
1467
|
active: r.value
|
|
1404
1468
|
}, {
|
|
1405
|
-
default:
|
|
1469
|
+
default: ae(() => [Y(t.$slots, "default")]),
|
|
1406
1470
|
_: 3
|
|
1407
|
-
}, 8, ["active"])], 14,
|
|
1471
|
+
}, 8, ["active"])], 14, ht));
|
|
1408
1472
|
}
|
|
1409
|
-
}),
|
|
1473
|
+
}), xt = [
|
|
1410
1474
|
"role",
|
|
1411
1475
|
"id",
|
|
1412
1476
|
"aria-labelledby",
|
|
1413
1477
|
"inert",
|
|
1414
1478
|
"aria-hidden",
|
|
1415
1479
|
"tabindex"
|
|
1416
|
-
],
|
|
1480
|
+
], St = { class: "dock-face-content" }, Ct = /* @__PURE__ */ I({
|
|
1417
1481
|
__name: "DockLayer",
|
|
1418
1482
|
props: {
|
|
1419
1483
|
id: {},
|
|
@@ -1421,15 +1485,15 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1421
1485
|
icon: {}
|
|
1422
1486
|
},
|
|
1423
1487
|
setup(e) {
|
|
1424
|
-
let t = e, n =
|
|
1425
|
-
|
|
1488
|
+
let t = e, n = pt(), r = Z("hostEl");
|
|
1489
|
+
U(() => {
|
|
1426
1490
|
r.value && n.register({
|
|
1427
1491
|
id: t.id,
|
|
1428
1492
|
label: t.label,
|
|
1429
1493
|
icon: t.icon,
|
|
1430
1494
|
el: r.value
|
|
1431
1495
|
});
|
|
1432
|
-
}),
|
|
1496
|
+
}), Q(() => [
|
|
1433
1497
|
t.id,
|
|
1434
1498
|
t.label,
|
|
1435
1499
|
t.icon
|
|
@@ -1440,9 +1504,9 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1440
1504
|
icon: t.icon,
|
|
1441
1505
|
el: r.value
|
|
1442
1506
|
});
|
|
1443
|
-
}),
|
|
1444
|
-
let i = A(() => n.activeId.value === t.id), a = A(() => n.leavingId.value === t.id), o =
|
|
1445
|
-
return (e, t) => (
|
|
1507
|
+
}), H(() => n.unregister(t.id));
|
|
1508
|
+
let i = A(() => n.activeId.value === t.id), a = A(() => n.leavingId.value === t.id), o = lt(), 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);
|
|
1509
|
+
return (e, t) => (K(), N("div", {
|
|
1446
1510
|
ref_key: "hostEl",
|
|
1447
1511
|
ref: r,
|
|
1448
1512
|
class: B(["dock-face", {
|
|
@@ -1455,9 +1519,9 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1455
1519
|
inert: !i.value || void 0,
|
|
1456
1520
|
"aria-hidden": !i.value || void 0,
|
|
1457
1521
|
tabindex: i.value ? -1 : void 0
|
|
1458
|
-
}, [P("div",
|
|
1522
|
+
}, [P("div", St, [Y(e.$slots, "default")])], 10, xt));
|
|
1459
1523
|
}
|
|
1460
|
-
}),
|
|
1524
|
+
}), wt = /* @__PURE__ */ I({
|
|
1461
1525
|
__name: "DockControl",
|
|
1462
1526
|
props: {
|
|
1463
1527
|
shape: { default: "icon" },
|
|
@@ -1488,26 +1552,26 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1488
1552
|
] }
|
|
1489
1553
|
},
|
|
1490
1554
|
setup(t) {
|
|
1491
|
-
let r = t,
|
|
1492
|
-
[
|
|
1555
|
+
let r = t, i = A(() => r.shape === "tab"), s = A(() => i.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(() => ({
|
|
1556
|
+
[u]: "",
|
|
1493
1557
|
...r.active === void 0 ? {} : {
|
|
1494
1558
|
"aria-pressed": String(r.active),
|
|
1495
1559
|
...r.active ? { "data-active": "" } : {}
|
|
1496
1560
|
},
|
|
1497
1561
|
...r.disabled ? { "aria-disabled": "true" } : {}
|
|
1498
|
-
})), l = A(() => !r.asChild && r.as === "button" ? { type: r.type } : {}),
|
|
1499
|
-
disabled: () => r.disabled ||
|
|
1562
|
+
})), l = A(() => !r.asChild && r.as === "button" ? { type: r.type } : {}), d = a("press"), f = o({
|
|
1563
|
+
disabled: () => r.disabled || i.value,
|
|
1500
1564
|
squish: !0,
|
|
1501
|
-
response:
|
|
1502
|
-
dampingFraction:
|
|
1565
|
+
response: d.response,
|
|
1566
|
+
dampingFraction: d.dampingFraction,
|
|
1503
1567
|
pressVar: "--dock-press-t",
|
|
1504
1568
|
shrinkDepth: .04,
|
|
1505
1569
|
maxStretch: 1.03
|
|
1506
|
-
}),
|
|
1507
|
-
function
|
|
1570
|
+
}), p = A(() => i.value ? {} : { ...f.pressStyle.value });
|
|
1571
|
+
function m(e) {
|
|
1508
1572
|
r.disabled && (e.preventDefault(), e.stopImmediatePropagation());
|
|
1509
1573
|
}
|
|
1510
|
-
return (e, r) =>
|
|
1574
|
+
return (e, r) => oe((K(), j(X(ce), R({
|
|
1511
1575
|
as: t.as,
|
|
1512
1576
|
"as-child": t.asChild
|
|
1513
1577
|
}, {
|
|
@@ -1515,19 +1579,19 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1515
1579
|
...c.value
|
|
1516
1580
|
}, {
|
|
1517
1581
|
class: s.value,
|
|
1518
|
-
style:
|
|
1519
|
-
"data-press-armed": !
|
|
1520
|
-
onPointerdown:
|
|
1521
|
-
onPointerup:
|
|
1522
|
-
onPointercancel:
|
|
1523
|
-
onPointerleave:
|
|
1524
|
-
onPointerenter:
|
|
1525
|
-
onKeydown:
|
|
1526
|
-
onKeyup:
|
|
1527
|
-
onBlur:
|
|
1528
|
-
onClickCapture:
|
|
1582
|
+
style: p.value,
|
|
1583
|
+
"data-press-armed": !i.value && X(f).armed ? "" : void 0,
|
|
1584
|
+
onPointerdown: X(f).handlers.onPointerdown,
|
|
1585
|
+
onPointerup: X(f).handlers.onPointerup,
|
|
1586
|
+
onPointercancel: X(f).handlers.onPointercancel,
|
|
1587
|
+
onPointerleave: X(f).handlers.onPointerleave,
|
|
1588
|
+
onPointerenter: X(f).handlers.onPointerenter,
|
|
1589
|
+
onKeydown: X(f).handlers.onKeydown,
|
|
1590
|
+
onKeyup: X(f).handlers.onKeyup,
|
|
1591
|
+
onBlur: X(f).handlers.onBlur,
|
|
1592
|
+
onClickCapture: m
|
|
1529
1593
|
}), {
|
|
1530
|
-
default:
|
|
1594
|
+
default: ae(() => [Y(e.$slots, "default")]),
|
|
1531
1595
|
_: 3
|
|
1532
1596
|
}, 16, [
|
|
1533
1597
|
"as",
|
|
@@ -1543,85 +1607,9 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1543
1607
|
"onKeydown",
|
|
1544
1608
|
"onKeyup",
|
|
1545
1609
|
"onBlur"
|
|
1546
|
-
])), [[
|
|
1547
|
-
}
|
|
1548
|
-
}), jt = /* @__PURE__ */ I({
|
|
1549
|
-
inheritAttrs: !1,
|
|
1550
|
-
__name: "DockTrigger",
|
|
1551
|
-
props: {
|
|
1552
|
-
for: { default: "select" },
|
|
1553
|
-
class: { type: [
|
|
1554
|
-
Boolean,
|
|
1555
|
-
null,
|
|
1556
|
-
String,
|
|
1557
|
-
Object,
|
|
1558
|
-
Array
|
|
1559
|
-
] }
|
|
1560
|
-
},
|
|
1561
|
-
setup(t) {
|
|
1562
|
-
let r = t, i = { [y]: "" };
|
|
1563
|
-
function a(e) {
|
|
1564
|
-
e.preventDefault(), e.stopImmediatePropagation();
|
|
1565
|
-
}
|
|
1566
|
-
let o = (e, { attrs: t, slots: n }) => {
|
|
1567
|
-
let { disabled: r, ...i } = t, o = r != null && r !== !1;
|
|
1568
|
-
return te("button", {
|
|
1569
|
-
...i,
|
|
1570
|
-
type: i.type ?? "button",
|
|
1571
|
-
...o ? {
|
|
1572
|
-
"aria-disabled": "true",
|
|
1573
|
-
onClickCapture: a
|
|
1574
|
-
} : {}
|
|
1575
|
-
}, n.default?.());
|
|
1576
|
-
};
|
|
1577
|
-
o.inheritAttrs = !1;
|
|
1578
|
-
let s = A(() => e("dock-trigger", r.for === "select" && "dock-select-trigger", r.for !== "select" && "dock-dropdown-trigger", r.class));
|
|
1579
|
-
return (e, t) => r.for === "select" ? Q((W(), j(J(pe), R({ key: 0 }, {
|
|
1580
|
-
...e.$attrs,
|
|
1581
|
-
...i
|
|
1582
|
-
}, {
|
|
1583
|
-
"as-child": "",
|
|
1584
|
-
class: s.value
|
|
1585
|
-
}), {
|
|
1586
|
-
default: Z(() => [F(o, null, {
|
|
1587
|
-
default: Z(() => [q(e.$slots, "default"), F(J(fe), { "as-child": "" }, {
|
|
1588
|
-
default: Z(() => [q(e.$slots, "icon", {}, () => [F(J(me), {
|
|
1589
|
-
class: "dock-select-trigger__chevron",
|
|
1590
|
-
"aria-hidden": "true"
|
|
1591
|
-
})])]),
|
|
1592
|
-
_: 3
|
|
1593
|
-
})]),
|
|
1594
|
-
_: 3
|
|
1595
|
-
})]),
|
|
1596
|
-
_: 3
|
|
1597
|
-
}, 16, ["class"])), [[J(n)]]) : r.for === "dropdown" ? Q((W(), j(w, R({ key: 1 }, {
|
|
1598
|
-
...e.$attrs,
|
|
1599
|
-
...i
|
|
1600
|
-
}, {
|
|
1601
|
-
"as-child": "",
|
|
1602
|
-
action: "pointerdown",
|
|
1603
|
-
class: s.value
|
|
1604
|
-
}), {
|
|
1605
|
-
default: Z(() => [F(o, null, {
|
|
1606
|
-
default: Z(() => [q(e.$slots, "default")]),
|
|
1607
|
-
_: 3
|
|
1608
|
-
})]),
|
|
1609
|
-
_: 3
|
|
1610
|
-
}, 16, ["class"])), [[J(n)]]) : Q((W(), j(J(ue), R({ key: 2 }, {
|
|
1611
|
-
...e.$attrs,
|
|
1612
|
-
...i
|
|
1613
|
-
}, {
|
|
1614
|
-
"as-child": "",
|
|
1615
|
-
class: s.value
|
|
1616
|
-
}), {
|
|
1617
|
-
default: Z(() => [F(o, null, {
|
|
1618
|
-
default: Z(() => [q(e.$slots, "default")]),
|
|
1619
|
-
_: 3
|
|
1620
|
-
})]),
|
|
1621
|
-
_: 3
|
|
1622
|
-
}, 16, ["class"])), [[J(n)]]);
|
|
1610
|
+
])), [[X(n)]]);
|
|
1623
1611
|
}
|
|
1624
|
-
}),
|
|
1612
|
+
}), Tt = /* @__PURE__ */ I({
|
|
1625
1613
|
__name: "DockBackgroundToggle",
|
|
1626
1614
|
props: {
|
|
1627
1615
|
paused: {
|
|
@@ -1637,18 +1625,18 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1637
1625
|
function a() {
|
|
1638
1626
|
r("update:paused", !n.paused);
|
|
1639
1627
|
}
|
|
1640
|
-
return (t, n) => (
|
|
1628
|
+
return (t, n) => (K(), j(wt, {
|
|
1641
1629
|
type: "button",
|
|
1642
1630
|
active: e.paused,
|
|
1643
1631
|
"aria-pressed": e.paused,
|
|
1644
1632
|
"aria-label": i.value,
|
|
1645
1633
|
onClick: a
|
|
1646
1634
|
}, {
|
|
1647
|
-
default:
|
|
1635
|
+
default: ae(() => [e.paused ? (K(), j(X(ue), {
|
|
1648
1636
|
key: 0,
|
|
1649
1637
|
size: 18,
|
|
1650
1638
|
"aria-hidden": "true"
|
|
1651
|
-
})) : (
|
|
1639
|
+
})) : (K(), j(X(le), {
|
|
1652
1640
|
key: 1,
|
|
1653
1641
|
size: 18,
|
|
1654
1642
|
"aria-hidden": "true"
|
|
@@ -1660,30 +1648,30 @@ var yt = gt.use, bt = /* @__PURE__ */ I({
|
|
|
1660
1648
|
"aria-label"
|
|
1661
1649
|
]));
|
|
1662
1650
|
}
|
|
1663
|
-
}),
|
|
1651
|
+
}), Et = [
|
|
1664
1652
|
"data-orientation",
|
|
1665
1653
|
"data-dock-hairline",
|
|
1666
1654
|
"aria-orientation"
|
|
1667
|
-
],
|
|
1655
|
+
], Dt = /* @__PURE__ */ I({
|
|
1668
1656
|
__name: "DockSeparator",
|
|
1669
1657
|
props: { anchor: {
|
|
1670
1658
|
type: Boolean,
|
|
1671
1659
|
default: !1
|
|
1672
1660
|
} },
|
|
1673
1661
|
setup(e) {
|
|
1674
|
-
let t =
|
|
1675
|
-
return (t, n) => (
|
|
1662
|
+
let t = y(), n = A(() => t?.orientation.value ?? "horizontal"), r = A(() => n.value), i = A(() => n.value === "vertical" ? "horizontal" : "vertical");
|
|
1663
|
+
return (t, n) => (K(), N("div", {
|
|
1676
1664
|
class: B(["dock-separator", { "dock-hairline": e.anchor }]),
|
|
1677
1665
|
role: "separator",
|
|
1678
1666
|
"data-orientation": r.value,
|
|
1679
1667
|
"data-dock-hairline": e.anchor || void 0,
|
|
1680
1668
|
"aria-orientation": i.value
|
|
1681
|
-
}, null, 10,
|
|
1669
|
+
}, null, 10, Et));
|
|
1682
1670
|
}
|
|
1683
1671
|
});
|
|
1684
1672
|
//#endregion
|
|
1685
1673
|
//#region src/composables/search/match.ts
|
|
1686
|
-
function
|
|
1674
|
+
function Ot(e, t) {
|
|
1687
1675
|
let n = e.length, r = t.length;
|
|
1688
1676
|
if (n === 0) return {
|
|
1689
1677
|
score: 0,
|
|
@@ -1707,11 +1695,11 @@ function Ft(e, t) {
|
|
|
1707
1695
|
matches: i
|
|
1708
1696
|
});
|
|
1709
1697
|
}
|
|
1710
|
-
function
|
|
1698
|
+
function kt(e, t) {
|
|
1711
1699
|
if (!t) return null;
|
|
1712
1700
|
let n = 0, r = [];
|
|
1713
1701
|
for (let i of e) {
|
|
1714
|
-
let e =
|
|
1702
|
+
let e = Ot(i, t);
|
|
1715
1703
|
if (!e) return null;
|
|
1716
1704
|
n += e.score;
|
|
1717
1705
|
for (let t of e.matches) r.push(t);
|
|
@@ -1721,7 +1709,7 @@ function It(e, t) {
|
|
|
1721
1709
|
matches: r
|
|
1722
1710
|
};
|
|
1723
1711
|
}
|
|
1724
|
-
function
|
|
1712
|
+
function At(e, t) {
|
|
1725
1713
|
let n = null, r = [], i = [
|
|
1726
1714
|
[t._lc.label, 12],
|
|
1727
1715
|
[t._lc.type, 10],
|
|
@@ -1729,7 +1717,7 @@ function Lt(e, t) {
|
|
|
1729
1717
|
];
|
|
1730
1718
|
for (let [a, o] of i) {
|
|
1731
1719
|
if (!a) continue;
|
|
1732
|
-
let i =
|
|
1720
|
+
let i = kt(e, a);
|
|
1733
1721
|
if (!i) continue;
|
|
1734
1722
|
let s = i.score * o;
|
|
1735
1723
|
(n === null || s > n) && (n = s, r = a === t._lc.label ? i.matches : []);
|
|
@@ -1739,7 +1727,7 @@ function Lt(e, t) {
|
|
|
1739
1727
|
matches: r
|
|
1740
1728
|
};
|
|
1741
1729
|
}
|
|
1742
|
-
function
|
|
1730
|
+
function jt(e) {
|
|
1743
1731
|
return e.map((e) => ({
|
|
1744
1732
|
item: e,
|
|
1745
1733
|
_lc: {
|
|
@@ -1749,15 +1737,15 @@ function Rt(e) {
|
|
|
1749
1737
|
}
|
|
1750
1738
|
}));
|
|
1751
1739
|
}
|
|
1752
|
-
var
|
|
1753
|
-
function
|
|
1754
|
-
let t =
|
|
1755
|
-
return t || (t = /* @__PURE__ */ new Map(),
|
|
1740
|
+
var Mt = /* @__PURE__ */ new WeakMap();
|
|
1741
|
+
function Nt(e) {
|
|
1742
|
+
let t = Mt.get(e);
|
|
1743
|
+
return t || (t = /* @__PURE__ */ new Map(), Mt.set(e, t)), t;
|
|
1756
1744
|
}
|
|
1757
|
-
function
|
|
1745
|
+
function Pt(e, t, n = 30) {
|
|
1758
1746
|
let r = t.toLowerCase().trim();
|
|
1759
1747
|
if (!r) return [];
|
|
1760
|
-
let i =
|
|
1748
|
+
let i = Nt(e), a = i.get(r);
|
|
1761
1749
|
if (a) return a.slice(0, n);
|
|
1762
1750
|
i.size > 200 && i.clear();
|
|
1763
1751
|
let o = r.split(/\s+/).filter(Boolean);
|
|
@@ -1776,7 +1764,7 @@ function Vt(e, t, n = 30) {
|
|
|
1776
1764
|
}
|
|
1777
1765
|
let c = [];
|
|
1778
1766
|
for (let e of s) {
|
|
1779
|
-
let t =
|
|
1767
|
+
let t = At(o, e);
|
|
1780
1768
|
t && c.push({
|
|
1781
1769
|
item: e.item,
|
|
1782
1770
|
score: t.score,
|
|
@@ -1785,21 +1773,21 @@ function Vt(e, t, n = 30) {
|
|
|
1785
1773
|
}
|
|
1786
1774
|
return c.sort((e, t) => t.score - e.score), i.set(r, c), c.slice(0, n);
|
|
1787
1775
|
}
|
|
1788
|
-
function
|
|
1776
|
+
function Ft(e) {
|
|
1789
1777
|
if (e) {
|
|
1790
|
-
|
|
1778
|
+
Mt.delete(e);
|
|
1791
1779
|
return;
|
|
1792
1780
|
}
|
|
1793
|
-
|
|
1781
|
+
Mt = /* @__PURE__ */ new WeakMap();
|
|
1794
1782
|
}
|
|
1795
1783
|
//#endregion
|
|
1796
1784
|
//#region src/composables/search/useFuzzySearch.ts
|
|
1797
|
-
function
|
|
1798
|
-
let t = typeof e.items == "function" ? e.items : () => e.items, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i =
|
|
1785
|
+
function It(e) {
|
|
1786
|
+
let t = typeof e.items == "function" ? e.items : () => e.items, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i = J(""), a = J(!1), o = J(!1), s = J(0), c = J(""), l = A(() => t()), u = A(() => jt(l.value)), d;
|
|
1799
1787
|
function f(e = d) {
|
|
1800
1788
|
e !== void 0 && (clearTimeout(e), d === e && (d = void 0));
|
|
1801
1789
|
}
|
|
1802
|
-
|
|
1790
|
+
Q(i, (e, t, r) => {
|
|
1803
1791
|
if (f(), !e || n <= 0) {
|
|
1804
1792
|
c.value = e;
|
|
1805
1793
|
return;
|
|
@@ -1808,18 +1796,18 @@ function Ut(e) {
|
|
|
1808
1796
|
d === i && (c.value = e, d = void 0);
|
|
1809
1797
|
}, n);
|
|
1810
1798
|
d = i, r(() => f(i));
|
|
1811
|
-
}),
|
|
1799
|
+
}), Q(l, () => {
|
|
1812
1800
|
f(), c.value = i.value, s.value = 0;
|
|
1813
1801
|
}, { deep: !0 });
|
|
1814
|
-
let p = A(() =>
|
|
1815
|
-
|
|
1802
|
+
let p = A(() => Pt(u.value, c.value, r));
|
|
1803
|
+
Q(p, () => {
|
|
1816
1804
|
s.value = 0;
|
|
1817
1805
|
});
|
|
1818
1806
|
function m(t) {
|
|
1819
1807
|
e.onSelect?.(t), h();
|
|
1820
1808
|
}
|
|
1821
1809
|
function h() {
|
|
1822
|
-
a.value = !1, o.value = !1, f(), i.value = "", c.value = "", s.value = 0,
|
|
1810
|
+
a.value = !1, o.value = !1, f(), i.value = "", c.value = "", s.value = 0, Ft(u.value);
|
|
1823
1811
|
}
|
|
1824
1812
|
function g() {
|
|
1825
1813
|
a.value = !0;
|
|
@@ -1843,8 +1831,8 @@ function Ut(e) {
|
|
|
1843
1831
|
break;
|
|
1844
1832
|
}
|
|
1845
1833
|
}
|
|
1846
|
-
return
|
|
1847
|
-
f(),
|
|
1834
|
+
return W(() => {
|
|
1835
|
+
f(), Ft(u.value);
|
|
1848
1836
|
}, !0), {
|
|
1849
1837
|
query: i,
|
|
1850
1838
|
results: p,
|
|
@@ -1860,13 +1848,13 @@ function Ut(e) {
|
|
|
1860
1848
|
}
|
|
1861
1849
|
//#endregion
|
|
1862
1850
|
//#region src/components/dock/composables/useDockSearch.ts
|
|
1863
|
-
function
|
|
1864
|
-
let { dockState: t } = e, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i =
|
|
1851
|
+
function Lt(e) {
|
|
1852
|
+
let { dockState: t } = e, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i = J([]), a = null, o = e.items ? e.items : () => i.value;
|
|
1865
1853
|
function s(t) {
|
|
1866
1854
|
let n = t.item.id;
|
|
1867
1855
|
e.ensureTargetWindow?.(n), e.scrollTo?.(n), e.onResultSelect?.(t);
|
|
1868
1856
|
}
|
|
1869
|
-
let c =
|
|
1857
|
+
let c = It({
|
|
1870
1858
|
items: o,
|
|
1871
1859
|
debounceMs: n,
|
|
1872
1860
|
maxResults: r,
|
|
@@ -1874,7 +1862,7 @@ function Wt(e) {
|
|
|
1874
1862
|
});
|
|
1875
1863
|
if (e.onSearch) {
|
|
1876
1864
|
let t = e.onSearch;
|
|
1877
|
-
|
|
1865
|
+
Q(() => c.query.value, (e) => {
|
|
1878
1866
|
if (a?.abort(), !e) {
|
|
1879
1867
|
i.value = [];
|
|
1880
1868
|
return;
|
|
@@ -1899,23 +1887,23 @@ function Wt(e) {
|
|
|
1899
1887
|
let e = l.value;
|
|
1900
1888
|
e && (c.query.value = c.query.value + e);
|
|
1901
1889
|
}
|
|
1902
|
-
let d =
|
|
1890
|
+
let d = g(() => t), f = d.isHeld;
|
|
1903
1891
|
function p() {
|
|
1904
1892
|
f.value || (t.expand(), d.acquire(), c.open());
|
|
1905
1893
|
}
|
|
1906
1894
|
function m() {
|
|
1907
1895
|
f.value && (c.close(), d.release());
|
|
1908
1896
|
}
|
|
1909
|
-
let
|
|
1910
|
-
return e.collapseOnScroll && e.scrollContainer && (
|
|
1897
|
+
let h = null;
|
|
1898
|
+
return e.collapseOnScroll && e.scrollContainer && (h = O(e.scrollContainer, {
|
|
1911
1899
|
collapseOnScroll: !0,
|
|
1912
1900
|
chromeRef: e.chromeRef
|
|
1913
|
-
})),
|
|
1901
|
+
})), W(() => {
|
|
1914
1902
|
a?.abort(), a = null;
|
|
1915
1903
|
}), {
|
|
1916
1904
|
fuzzy: c,
|
|
1917
1905
|
autocompleteText: l,
|
|
1918
|
-
scrollChrome:
|
|
1906
|
+
scrollChrome: h,
|
|
1919
1907
|
armSearch: p,
|
|
1920
1908
|
disarmSearch: m,
|
|
1921
1909
|
acceptAutocomplete: u,
|
|
@@ -1923,4 +1911,4 @@ function Wt(e) {
|
|
|
1923
1911
|
};
|
|
1924
1912
|
}
|
|
1925
1913
|
//#endregion
|
|
1926
|
-
export {
|
|
1914
|
+
export { v as DOCK_CONTEXT_KEY, Tt as DockBackgroundToggle, wt as DockControl, mt as DockCrossfade, Ct as DockLayer, bt as DockLayerGroup, Dt as DockSeparator, at as GlassDock, m as provideDockContext, _ as useDockContext, D as useDockCtaReceive, Lt as useDockSearch, y as useOptionalDockContext };
|