@mkbabb/glass-ui 8.0.0 → 10.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 +4768 -0
- package/README.md +57 -13
- package/dist/DialogContent-CwIBvou_.js +157 -0
- package/dist/{DropdownMenuTrigger-8UZsBtZ8.js → DropdownMenuTrigger-CKRnhDSQ.js} +1 -1
- package/dist/{Surface-i1tWC-Ga.js → Surface-1nPoabc3.js} +1 -1
- package/dist/{accent-tone-solve-Cw7WkRD9.js → accent-tone-solve-5H6FY2QO.js} +1 -1
- package/dist/aurora.js +386 -355
- package/dist/{badge-owUOaaba.js → badge-BO6BC4G5.js} +1 -1
- package/dist/badge.js +1 -1
- package/dist/blob.js +44 -44
- package/dist/{button-yvGPb0Bx.js → button-BOFTUPyU.js} +1 -1
- package/dist/button.js +1 -1
- package/dist/{card-3HFFpC7_.js → card-ByyqRBvK.js} +2 -2
- package/dist/card.js +1 -1
- package/dist/carousel.js +3 -3
- package/dist/{checkbox-BnXuGgJ3.js → checkbox-B1qn65se.js} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip.js +8 -3
- package/dist/{class-names-q-UGOkHH.js → class-names-FlXcvRRT.js} +65 -18
- package/dist/{collapsible-B7O6m-Ch.js → collapsible-DFzK29Oh.js} +5 -2
- package/dist/collapsible.js +1 -1
- package/dist/color.glsl-DTJhdekG.js +34 -0
- package/dist/color.js +11 -11
- package/dist/color.wgsl-BTszLY39.js +398 -0
- package/dist/{command-BuBnYpxF.js → command-C-5xSEJ2.js} +8 -8
- package/dist/command.js +1 -1
- package/dist/component-styles.css +1 -0
- package/dist/components/_shared/class-names.d.ts +10 -1
- package/dist/components/_shared/control.d.ts +0 -1
- package/dist/components/_shared/index.d.ts +0 -1
- package/dist/components/_shared/menu/menu.css +1 -1
- package/dist/components/_shared/overlay/index.d.ts +1 -0
- package/dist/components/_shared/overlay/shortcuts.d.ts +12 -0
- package/dist/components/aurora/Aurora.vue.d.ts +1 -0
- package/dist/components/aurora/composables/atoms.d.ts +22 -6
- package/dist/components/aurora/composables/frameLoop.d.ts +6 -5
- package/dist/components/aurora/composables/runtime.d.ts +28 -1
- package/dist/components/aurora/composables/useAurora.d.ts +28 -0
- package/dist/components/aurora/composables/wgpuSetup.d.ts +1 -1
- package/dist/components/aurora/constants/presets.d.ts +62 -5
- package/dist/components/aurora/index.d.ts +1 -1
- package/dist/components/blob/Blob.vue.d.ts +3 -3
- package/dist/components/card/Card.vue.d.ts +8 -2
- package/dist/components/chip/Chip.vue.d.ts +1 -7
- package/dist/components/chip/chipVariants.d.ts +1 -0
- package/dist/components/collapsible/Collapsible.vue.d.ts +1 -0
- package/dist/components/command/CommandDialog.vue.d.ts +1 -1
- package/dist/components/configurator/Configurator.vue.d.ts +25 -2
- package/dist/components/configurator/ConfiguratorRow.vue.d.ts +4 -2
- package/dist/components/configurator/styles.css +1 -1
- package/dist/components/dark-mode-toggle/dark-mode-toggle.css +1 -1
- package/dist/components/deck/styles/capture.css +1 -1
- package/dist/components/dialog/styles.css +1 -1
- package/dist/components/dock/DockSeparator.vue.d.ts +2 -3
- package/dist/components/dock/GlassDock.vue.d.ts +1 -0
- package/dist/components/dock/composables/dockContext.d.ts +1 -8
- package/dist/components/dock/composables/dockCrossfadeContext.d.ts +0 -2
- package/dist/components/dock/composables/index.d.ts +1 -1
- package/dist/components/dock/composables/useDockHold.d.ts +16 -12
- package/dist/components/dock/composables/useDockRun.d.ts +20 -0
- package/dist/components/dock/composables/useDockSearch.d.ts +1 -1
- package/dist/components/dock/composables/useDockShellProps.d.ts +18 -101
- package/dist/components/dock/composables/useDockState.d.ts +2 -9
- package/dist/components/dock/constants.d.ts +15 -0
- package/dist/components/dock/index.d.ts +2 -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/controls/triggers.css +1 -1
- package/dist/components/dock/styles/controls.css +1 -1
- package/dist/components/dock/styles/density.css +1 -1
- package/dist/components/dock/styles/index.css +1 -1
- package/dist/components/dock/styles/layer-group.css +1 -1
- package/dist/components/dock/styles/layers.css +1 -1
- package/dist/components/dock/styles/morph.css +1 -1
- package/dist/components/dock/styles/run.css +1 -0
- package/dist/components/dock/styles/search.css +1 -1
- package/dist/components/dock/styles/shape.css +1 -1
- package/dist/components/dock/styles/shell-regions.css +1 -1
- package/dist/components/dock/styles/shell.css +1 -1
- package/dist/components/fourier-field/FourierField.vue.d.ts +29 -26
- package/dist/components/fourier-field/clock.d.ts +35 -0
- package/dist/components/fourier-field/constants.d.ts +80 -104
- package/dist/components/fourier-field/index.d.ts +3 -28
- package/dist/components/fourier-field/math.d.ts +69 -77
- package/dist/components/fourier-field/renderer/mint.d.ts +50 -0
- package/dist/components/fourier-field/renderer/uniforms.d.ts +84 -0
- package/dist/components/fourier-field/renderer/wgpu.d.ts +28 -0
- package/dist/components/fourier-field/shaders/compute.wgsl.d.ts +1 -0
- package/dist/components/fourier-field/shaders/render.wgsl.d.ts +1 -0
- package/dist/components/fourier-field/useFourierField.d.ts +49 -0
- package/dist/components/handmark/HandMark.vue.d.ts +18 -14
- package/dist/components/handmark/index.d.ts +4 -23
- package/dist/components/handmark/stroke.d.ts +92 -0
- package/dist/components/labeled-field/LabeledSwitch.vue.d.ts +3 -1
- package/dist/components/labeled-field/types.d.ts +1 -1
- package/dist/components/menu/DropdownMenu.vue.d.ts +1 -1
- package/dist/components/metric/coalesce-metric.d.ts +6 -1
- package/dist/components/metric/styles.css +1 -1
- package/dist/components/popover/Popover.vue.d.ts +1 -1
- package/dist/components/scroll-progress-rim/styles.css +1 -1
- package/dist/components/sheet/styles.css +1 -1
- package/dist/components/slider/styles.css +1 -1
- package/dist/components/tabs/SegmentedTabs.vue.d.ts +25 -112
- package/dist/components/tabs/composables/useTabDragMorph.d.ts +1 -1
- package/dist/components/tabs/composables/useTabResponsive.d.ts +11 -11
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/styles/drag.css +1 -1
- package/dist/components/tabs/styles/segmented.css +1 -1
- package/dist/components/tabs/types.d.ts +85 -0
- package/dist/components/timeline/index.d.ts +2 -0
- package/dist/components/toast/Toast.vue.d.ts +2 -2
- package/dist/composables/color/index.d.ts +0 -15
- package/dist/composables/dark/darkModeSyncScript.d.ts +42 -0
- package/dist/composables/dom/useResolveTokenColor.d.ts +1 -1
- package/dist/composables/glass/index.d.ts +2 -0
- package/dist/composables/keyboard/useKeyboardShortcuts.d.ts +47 -1
- package/dist/composables/motion/pointer/pointerFieldMappings.d.ts +0 -41
- package/dist/{components/search/composables → composables/search}/index.d.ts +2 -2
- package/dist/{components/search/composables/fuzzySearchIndex.d.ts → composables/search/match.d.ts} +8 -3
- package/dist/composables/sidebar/types.d.ts +5 -1
- package/dist/configurator-DiwVN573.js +339 -0
- package/dist/configurator.js +1 -1
- package/dist/constellation.js +5 -5
- package/dist/{content-CWO-XL7o.js → content-So3j6SOe.js} +1 -1
- package/dist/control-DJp15L4U.js +7 -0
- package/dist/dark-mode-toggle.js +2 -2
- package/dist/{dark-z_P5QwqI.js → dark-pONY3x93.js} +2 -2
- package/dist/dark.js +1 -1
- package/dist/{data-table-_RrOEdiw.js → data-table-Ba_uTfPc.js} +3 -3
- package/dist/data-table.js +1 -1
- package/dist/{deck-Ci6YjB5e.js → deck-Cm_VmyNL.js} +1 -1
- package/dist/deck.js +1 -1
- package/dist/{dialog-CbRnTRtg.js → dialog-BZoFG0j8.js} +1 -1
- package/dist/dialog.js +2 -2
- package/dist/dock.js +718 -496
- package/dist/dom.js +90 -8
- package/dist/easing.js +5 -5
- package/dist/expandable-container-CZUj9BzY.js +142 -0
- package/dist/expandable-container.js +2 -142
- package/dist/fourier-field.js +638 -855
- package/dist/fourier-math.js +6 -6
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +88 -75
- package/dist/handmark.js +330 -718
- package/dist/index.d.ts +2 -2
- package/dist/infinite-scroll.js +16 -17
- package/dist/{input-Bls2A4Tt.js → input-eLZ_AU7l.js} +1 -1
- package/dist/input.js +1 -1
- package/dist/keyboard.js +64 -21
- package/dist/{label-BQEZhnK_.js → label-CE03H1KL.js} +2 -2
- package/dist/label.js +1 -1
- package/dist/labeled-field.js +9 -6
- package/dist/{menu-wLu1XGKn.js → menu-BnmCOa3y.js} +93 -90
- package/dist/menu.js +2 -2
- package/dist/metric.js +12 -7
- package/dist/{motion-D4uYE0UM.js → motion-BvV1_24p.js} +1 -1
- package/dist/motion-core.js +35 -35
- package/dist/{number-field-NFAwQ0HK.js → number-field-RP89046a.js} +2 -2
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.js +3 -3
- package/dist/{participation-B0hdsIRo.js → participation-Di4UHbzk.js} +8 -8
- package/dist/{pointerFieldMappings-DP5tla5z.js → pointerFieldMappings-DXwlU5uj.js} +7 -23
- package/dist/popover-DA87hFBx.js +184 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-DF8dWZIX.js → progress-eVa-mc7J.js} +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radio-group-Ci8o-pDx.js → radio-group-B58Bz16F.js} +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/{select-CDgwGH_P.js → select-fy3vtArm.js} +13 -13
- package/dist/select.js +1 -1
- package/dist/{separator-CN11t406.js → separator-D4EZM10u.js} +2 -2
- package/dist/separator.js +1 -1
- package/dist/{sheet-BEFvnO_u.js → sheet-BQJyER59.js} +120 -115
- package/dist/sheet.js +2 -2
- package/dist/shortcuts-DGGWNRNe.js +13 -0
- package/dist/sidebar.js +4 -4
- package/dist/{slider-gsc8jDIo.js → slider-5ChjjWSR.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{status-dot-BpnqOP5N.js → status-dot-W4LFiJps.js} +2 -2
- package/dist/status-dot.js +1 -1
- package/dist/styles/accessibility.css +1 -1
- package/dist/styles/animations.css +1 -1
- package/dist/styles/components.css +1 -1
- package/dist/styles/glass/a11y-fallback.css +1 -1
- package/dist/styles/glass/dissolve.css +1 -1
- package/dist/styles/glass/focus-veil.css +1 -1
- package/dist/styles/glass/ladder.css +1 -1
- package/dist/styles/glass/material.css +1 -1
- package/dist/styles/glass/overlay-plate.css +1 -1
- package/dist/styles/glass/reveal.css +1 -1
- package/dist/styles/glass-specular-track.css +1 -1
- package/dist/styles/paper.css +1 -1
- package/dist/styles/scroll-choreography.css +1 -1
- package/dist/styles/scroll-chrome.css +1 -1
- package/dist/styles/scroll-driven.css +1 -1
- package/dist/styles/theme/literals.css +1 -1
- package/dist/styles/tokens/color-radius.css +1 -1
- package/dist/styles/tokens/dark-arm-glass.css +1 -1
- package/dist/styles/tokens/light-dark.css +1 -1
- package/dist/styles/tokens/offsets.css +1 -1
- package/dist/styles/tokens/scheme-motion.css +1 -1
- package/dist/styles/tokens/sizing.css +1 -1
- package/dist/styles/typography/semantic.css +1 -1
- package/dist/styles/typography/utilities.css +1 -1
- package/dist/styles/utilities/a11y-overrides.css +1 -1
- package/dist/styles/utilities/responsive.css +1 -1
- package/dist/styles/view-transition.css +1 -1
- package/dist/styles/viz-reveal.css +1 -1
- package/dist/surface.js +1 -1
- package/dist/{switch-DxZzDrmV.js → switch-BYUZ6g9G.js} +2 -2
- package/dist/switch.js +1 -1
- package/dist/{tabs-CYscnq5H.js → tabs-rdRXKXxd.js} +4 -3
- package/dist/tabs.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +44 -42
- package/dist/{toast-9c6Kp58L.js → toast-DVOwo6GB.js} +1 -1
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-11aPGMfE.js → toggle-group-CC5b3o1R.js} +2 -2
- package/dist/toggle-group.js +1 -1
- package/dist/{tooltip-DqKMZ4dn.js → tooltip-DhTHhtJN.js} +2 -2
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{useAccentTone-DFAh1osB.js → useAccentTone-DitmKfGL.js} +1 -1
- package/dist/{resolveCanvasColor-6MCrswTB.js → useCanvas2D-CQRElMyE.js} +1 -11
- package/dist/{usePointerVelocityField-DsIf7yyq.js → usePointerVelocityField-Lx26_Yap.js} +1 -1
- package/dist/useResolveTokenColor-B2FfJnd9.js +24 -0
- package/package.json +5 -21
- package/dist/DialogContent-4hzLiaCQ.js +0 -152
- package/dist/canvas.d.ts +0 -1
- package/dist/canvas.js +0 -2
- package/dist/color.wgsl-B0N3mKMb.js +0 -412
- package/dist/compile-D7VYG3gi.js +0 -19
- package/dist/components/dock/composables/useDockOverflowFit.d.ts +0 -20
- package/dist/components/dock/composables/useDockTouchGate.d.ts +0 -42
- package/dist/components/dock/styles/overflow.css +0 -1
- package/dist/components/fourier-field/composables/fourierFieldGLSetup.d.ts +0 -24
- package/dist/components/fourier-field/composables/fourierFieldWGPUSetup.d.ts +0 -31
- package/dist/components/fourier-field/composables/uniformBridgeWGPU.d.ts +0 -39
- package/dist/components/fourier-field/composables/useFourierField.d.ts +0 -56
- package/dist/components/fourier-field/shaders/fourier-field.compute.wgsl.d.ts +0 -1
- package/dist/components/fourier-field/shaders/fourier-field.glsl.d.ts +0 -4
- package/dist/components/fourier-field/shaders/fourier-field.render.wgsl.d.ts +0 -1
- package/dist/components/fourier-field/shaders/fourier-field.ribbon.d.ts +0 -51
- package/dist/components/handmark/brush.d.ts +0 -269
- package/dist/components/handmark/composables/useHandMark.d.ts +0 -99
- package/dist/components/handmark/constants.d.ts +0 -69
- package/dist/components/handmark/freehand.d.ts +0 -69
- package/dist/components/handmark/geometry.d.ts +0 -62
- package/dist/components/handmark/ink.d.ts +0 -11
- package/dist/components/handmark/noise.d.ts +0 -30
- package/dist/components/handmark/texture.d.ts +0 -39
- package/dist/components/handmark/types.d.ts +0 -70
- package/dist/components/search/SearchBar.vue.d.ts +0 -38
- package/dist/components/search/index.d.ts +0 -8
- package/dist/components/search/searchVariants.d.ts +0 -16
- package/dist/configurator-BoeScnDL.js +0 -311
- package/dist/control-Da4XeT43.js +0 -11
- package/dist/popover-DBMKTPkL.js +0 -181
- package/dist/search.d.ts +0 -1
- package/dist/search.js +0 -61
- package/dist/useFuzzySearch-CUnZknpm.js +0 -177
- package/dist/useResolveTokenColor-CspQv_ik.js +0 -107
- /package/dist/{components/search/composables → composables/search}/types.d.ts +0 -0
- /package/dist/{components/search/composables → composables/search}/useFuzzySearch.d.ts +0 -0
package/dist/dock.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./class-names-
|
|
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
4
|
import { t as r } from "./motionTempo-tscp92Nm.js";
|
|
@@ -6,45 +6,44 @@ import { n as i } from "./springPresets-Cbe0Voqg.js";
|
|
|
6
6
|
import { t as a } from "./useLiquidPress-h1scrPtP.js";
|
|
7
7
|
import { t as o } from "./useMotionAxis-D-rtIhca.js";
|
|
8
8
|
import { n as s, t as c } from "./createContext-BhkE9mLH.js";
|
|
9
|
-
import { a as l, c as u, i as d, l as f, n as p, o as m, r as h, s as g } from "./participation-
|
|
10
|
-
import { t as
|
|
11
|
-
import { n as
|
|
9
|
+
import { a as l, c as u, i as d, l as f, n as p, o as m, r as h, s as g, u as _ } from "./participation-Di4UHbzk.js";
|
|
10
|
+
import { t as v } from "./useResizeObserver-CdUlm2QZ.js";
|
|
11
|
+
import { n as y } from "./useResolveTokenColor-B2FfJnd9.js";
|
|
12
12
|
import { t as b } from "./focus-Duf7EpUu.js";
|
|
13
|
-
import { t as x } from "./DropdownMenuTrigger-
|
|
13
|
+
import { t as x } from "./DropdownMenuTrigger-CKRnhDSQ.js";
|
|
14
14
|
import { t as S } from "./useSelectionGroup-zsEwitF6.js";
|
|
15
15
|
import { t as C } from "./useDragMorph-B363RUbF.js";
|
|
16
16
|
import { n as w } from "./useDockCtaReceive-BSSgD6mu.js";
|
|
17
17
|
import { n as T, t as E } from "./useScrollChrome-BJbWV32F.js";
|
|
18
18
|
import { t as D } from "./useIntersectionPause-CzKR3EyP.js";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { useMediaQuery as ge } from "@vueuse/core";
|
|
19
|
+
import { Fragment as O, computed as k, createBlock as A, createCommentVNode as j, createElementBlock as M, createElementVNode as N, createVNode as P, defineComponent as F, mergeModels as I, mergeProps as L, nextTick as R, normalizeClass as z, normalizeStyle as B, onBeforeUnmount as V, onMounted as H, onScopeDispose as U, onUnmounted as W, openBlock as G, readonly as K, ref as q, renderList as ee, renderSlot as J, resolveDynamicComponent as te, toDisplayString as ne, unref as Y, useId as re, useModel as ie, useTemplateRef as X, watch as Z, withCtx as Q, withDirectives as $, withModifiers as ae } from "vue";
|
|
20
|
+
import { PopoverTrigger as oe, Primitive as se, SelectIcon as ce, SelectTrigger as le } from "reka-ui";
|
|
21
|
+
import { ChevronDown as ue, Pause as de, Play as fe } from "@lucide/vue";
|
|
22
|
+
import { SpringProgress as pe } from "@mkbabb/keyframes.js";
|
|
23
|
+
import { useMediaQuery as me } from "@vueuse/core";
|
|
25
24
|
//#region src/components/_shared/overlay/isTeleportedTarget.ts
|
|
26
|
-
function
|
|
25
|
+
function he(e, t) {
|
|
27
26
|
if (!(e instanceof Element)) return !1;
|
|
28
27
|
let n = e.closest("[data-glass-dock-portal]");
|
|
29
28
|
return n ? !t || n.getAttribute("data-glass-dock-owner") === t : !1;
|
|
30
29
|
}
|
|
31
30
|
//#endregion
|
|
32
31
|
//#region src/composables/glass/backdropSampleMath.ts
|
|
33
|
-
function
|
|
32
|
+
function ge(e) {
|
|
34
33
|
let t = e / 255;
|
|
35
34
|
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
36
35
|
}
|
|
37
|
-
function
|
|
38
|
-
return .2126 *
|
|
36
|
+
function _e(e, t, n) {
|
|
37
|
+
return .2126 * ge(e) + .7152 * ge(t) + .0722 * ge(n);
|
|
39
38
|
}
|
|
40
|
-
function
|
|
39
|
+
function ve(e, t, n, r, i) {
|
|
41
40
|
return [
|
|
42
41
|
e * r + i[0] * (1 - r),
|
|
43
42
|
t * r + i[1] * (1 - r),
|
|
44
43
|
n * r + i[2] * (1 - r)
|
|
45
44
|
];
|
|
46
45
|
}
|
|
47
|
-
function
|
|
46
|
+
function ye(e) {
|
|
48
47
|
let t = e.match(/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+))?/i);
|
|
49
48
|
return t ? [
|
|
50
49
|
Number(t[1]),
|
|
@@ -53,31 +52,31 @@ function be(e) {
|
|
|
53
52
|
t[4] === void 0 ? 1 : Number(t[4])
|
|
54
53
|
] : null;
|
|
55
54
|
}
|
|
56
|
-
function
|
|
55
|
+
function be(e) {
|
|
57
56
|
return typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement;
|
|
58
57
|
}
|
|
59
|
-
var
|
|
60
|
-
function
|
|
58
|
+
var xe = "[data-glass-field-canvas] canvas, canvas[data-glass-field-canvas]";
|
|
59
|
+
function Se(e) {
|
|
61
60
|
if (!e) {
|
|
62
61
|
if (typeof document < "u") {
|
|
63
|
-
let e = document.querySelector(
|
|
64
|
-
if (
|
|
62
|
+
let e = document.querySelector(xe);
|
|
63
|
+
if (be(e)) return e;
|
|
65
64
|
}
|
|
66
65
|
return null;
|
|
67
66
|
}
|
|
68
|
-
if (
|
|
67
|
+
if (be(e)) return e;
|
|
69
68
|
if (typeof e == "function") {
|
|
70
69
|
let t = e();
|
|
71
|
-
return
|
|
70
|
+
return be(t) ? t : null;
|
|
72
71
|
}
|
|
73
72
|
if (typeof e == "string" && typeof document < "u") {
|
|
74
73
|
let t = document.querySelector(e);
|
|
75
|
-
return
|
|
74
|
+
return be(t) ? t : null;
|
|
76
75
|
}
|
|
77
76
|
return null;
|
|
78
77
|
}
|
|
79
|
-
function
|
|
80
|
-
let n =
|
|
78
|
+
function Ce(e, t) {
|
|
79
|
+
let n = ye(e);
|
|
81
80
|
if (n) return n;
|
|
82
81
|
if (!t) return null;
|
|
83
82
|
try {
|
|
@@ -93,7 +92,7 @@ function we(e, t) {
|
|
|
93
92
|
return null;
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
|
-
function
|
|
95
|
+
function we(e, t, n, r) {
|
|
97
96
|
if (!t || t.width === 0 || t.height === 0 || !n) return null;
|
|
98
97
|
let i = e.getBoundingClientRect(), a = t.getBoundingClientRect();
|
|
99
98
|
if (a.width === 0 || a.height === 0) return null;
|
|
@@ -103,60 +102,60 @@ function Te(e, t, n, r) {
|
|
|
103
102
|
n.clearRect(0, 0, 32, 32), n.drawImage(t, c, l, u, d, 0, 0, 32, 32);
|
|
104
103
|
let e = n.getImageData(0, 0, 32, 32).data, i = 0, a = 0, o = 0;
|
|
105
104
|
for (let t = 0; t < e.length; t += 4) {
|
|
106
|
-
let n = e[t + 3] / 255, [s, c, l] =
|
|
107
|
-
i +=
|
|
105
|
+
let n = e[t + 3] / 255, [s, c, l] = ve(e[t], e[t + 1], e[t + 2], n, r);
|
|
106
|
+
i += _e(s, c, l), a += n, o++;
|
|
108
107
|
}
|
|
109
108
|
return o === 0 || a / o < .02 ? null : { luma: i / o };
|
|
110
109
|
} catch {
|
|
111
110
|
return null;
|
|
112
111
|
}
|
|
113
112
|
}
|
|
114
|
-
function
|
|
113
|
+
function Te(e, t) {
|
|
115
114
|
let n = e.getBoundingClientRect(), r = n.left + n.width / 2, i = n.top + n.height / 2, a = document.elementsFromPoint(r, i);
|
|
116
115
|
for (let n of a) {
|
|
117
116
|
if (!(n instanceof HTMLElement) || n === e || e.contains(n)) continue;
|
|
118
|
-
let r = getComputedStyle(n).backgroundColor, i =
|
|
117
|
+
let r = getComputedStyle(n).backgroundColor, i = Ce(y(r, e), t);
|
|
119
118
|
if (i && !(i[3] < .5)) return i;
|
|
120
119
|
}
|
|
121
|
-
return
|
|
120
|
+
return Ce(y(getComputedStyle(document.body).backgroundColor, e), t);
|
|
122
121
|
}
|
|
123
|
-
var
|
|
122
|
+
var Ee = [
|
|
124
123
|
255,
|
|
125
124
|
255,
|
|
126
125
|
255
|
|
127
126
|
];
|
|
128
|
-
function
|
|
129
|
-
let n =
|
|
127
|
+
function De(e, t) {
|
|
128
|
+
let n = Te(e, t);
|
|
130
129
|
return n && n[3] >= .5 ? [
|
|
131
130
|
n[0],
|
|
132
131
|
n[1],
|
|
133
132
|
n[2]
|
|
134
|
-
] : [...
|
|
133
|
+
] : [...Ee];
|
|
135
134
|
}
|
|
136
|
-
function
|
|
137
|
-
let n =
|
|
138
|
-
return n ?
|
|
135
|
+
function Oe(e, t) {
|
|
136
|
+
let n = Te(e, t);
|
|
137
|
+
return n ? ke(n) : null;
|
|
139
138
|
}
|
|
140
|
-
function
|
|
141
|
-
return { luma:
|
|
139
|
+
function ke(e) {
|
|
140
|
+
return { luma: _e(e[0], e[1], e[2]) };
|
|
142
141
|
}
|
|
143
142
|
//#endregion
|
|
144
143
|
//#region src/composables/glass/useGlassBackdropLuminance.ts
|
|
145
|
-
var
|
|
146
|
-
function
|
|
144
|
+
var Ae = "data-glass-backdrop-shared";
|
|
145
|
+
function je(e, n = {}) {
|
|
147
146
|
let { lightThreshold: r = .6, minSampleIntervalMs: i = 250, writeBucket: a = !0 } = n, o = Math.max(250, i), s = n.shared === !0;
|
|
148
147
|
function c(e) {
|
|
149
|
-
return !s && e.closest(`[${
|
|
148
|
+
return !s && e.closest(`[${Ae}]`) !== null;
|
|
150
149
|
}
|
|
151
|
-
let l =
|
|
150
|
+
let l = q(null), u = q(null), d = q({
|
|
152
151
|
state: "pending",
|
|
153
152
|
mode: n.live === !0 ? "live" : "static",
|
|
154
153
|
source: n.live === !0 ? "canvas" : "elements"
|
|
155
154
|
});
|
|
156
155
|
if (typeof window > "u") return {
|
|
157
|
-
luma:
|
|
158
|
-
bucket:
|
|
159
|
-
sample:
|
|
156
|
+
luma: K(l),
|
|
157
|
+
bucket: K(u),
|
|
158
|
+
sample: K(d),
|
|
160
159
|
sampleNow: () => {},
|
|
161
160
|
dispose: () => {}
|
|
162
161
|
};
|
|
@@ -165,9 +164,9 @@ function Me(e, n = {}) {
|
|
|
165
164
|
return p || (p = document.createElement("canvas"), p.width = 32, p.height = 32), m ||= p.getContext("2d", { willReadFrequently: !0 }), m;
|
|
166
165
|
}
|
|
167
166
|
function g() {
|
|
168
|
-
return n.live === void 0 ? e.value?.dataset.glassSample === "live" || n.backgroundCanvas != null ||
|
|
167
|
+
return n.live === void 0 ? e.value?.dataset.glassSample === "live" || n.backgroundCanvas != null || Se(void 0) !== null : n.live;
|
|
169
168
|
}
|
|
170
|
-
function
|
|
169
|
+
function _(e) {
|
|
171
170
|
let t = e.getBoundingClientRect();
|
|
172
171
|
return {
|
|
173
172
|
x: t.x,
|
|
@@ -186,7 +185,7 @@ function Me(e, n = {}) {
|
|
|
186
185
|
source: n === "live" ? "canvas" : "elements",
|
|
187
186
|
luma: o,
|
|
188
187
|
sampledAt: i,
|
|
189
|
-
targetRect:
|
|
188
|
+
targetRect: _(t)
|
|
190
189
|
}, t.style.setProperty("--glass-backdrop-luma", o.toFixed(3)), t.setAttribute("data-backdrop-sampled", ""), t.setAttribute("data-backdrop-sample-state", "sampled"), t.setAttribute("data-backdrop-sample-source", n === "live" ? "canvas" : "elements"), t.removeAttribute("data-backdrop-sample-reason"), t.style.setProperty("--glass-backdrop-sampled", "1"), a && t.style.setProperty("--glass-backdrop", s);
|
|
191
190
|
}
|
|
192
191
|
function b(e, t, n, r) {
|
|
@@ -196,14 +195,14 @@ function Me(e, n = {}) {
|
|
|
196
195
|
source: t === "live" ? "canvas" : "elements",
|
|
197
196
|
reason: n,
|
|
198
197
|
sampledAt: r,
|
|
199
|
-
targetRect:
|
|
198
|
+
targetRect: _(e)
|
|
200
199
|
}, e.style.removeProperty("--glass-backdrop-luma"), e.style.removeProperty("--glass-backdrop-sampled"), a && e.style.removeProperty("--glass-backdrop"), e.removeAttribute("data-backdrop-sampled"), e.setAttribute("data-backdrop-sample-state", "unavailable"), e.setAttribute("data-backdrop-sample-source", t === "live" ? "canvas" : "elements"), e.setAttribute("data-backdrop-sample-reason", n);
|
|
201
200
|
}
|
|
202
201
|
let x = 0;
|
|
203
202
|
function S() {
|
|
204
203
|
let t = e.value;
|
|
205
204
|
if (!t || c(t)) return;
|
|
206
|
-
let r = h(), i = g() ? "live" : "static", a = i === "live" ?
|
|
205
|
+
let r = h(), i = g() ? "live" : "static", a = i === "live" ? Se(n.backgroundCanvas) : null, o = i === "live" ? we(t, a, r, De(t, r)) : Oe(t, r), s = Date.now();
|
|
207
206
|
o ? y(o, t, i, s) : b(t, i, i === "live" && !a ? "source-unavailable" : "sample-unavailable", s), x = typeof performance < "u" ? performance.now() : s;
|
|
208
207
|
}
|
|
209
208
|
let C = T(({ now: e }) => {
|
|
@@ -218,7 +217,7 @@ function Me(e, n = {}) {
|
|
|
218
217
|
let t = e.value;
|
|
219
218
|
t && c(t) || g() && !f.value && C.resume();
|
|
220
219
|
}
|
|
221
|
-
}, { rootMargin: "200px" }), E =
|
|
220
|
+
}, { rootMargin: "200px" }), E = v(e, () => S());
|
|
222
221
|
function O() {
|
|
223
222
|
let t = e.value;
|
|
224
223
|
if (t && c(t)) {
|
|
@@ -229,7 +228,7 @@ function Me(e, n = {}) {
|
|
|
229
228
|
}
|
|
230
229
|
let k = Z(f, O, { flush: "sync" }), A = Z(() => e.value, (e) => {
|
|
231
230
|
if (e) {
|
|
232
|
-
if (s) e.setAttribute(
|
|
231
|
+
if (s) e.setAttribute(Ae, "");
|
|
233
232
|
else if (c(e)) return;
|
|
234
233
|
S(), O();
|
|
235
234
|
}
|
|
@@ -240,131 +239,129 @@ function Me(e, n = {}) {
|
|
|
240
239
|
function j() {
|
|
241
240
|
A(), k(), C.dispose(), w.dispose(), E.stop(), p = null, m = null;
|
|
242
241
|
}
|
|
243
|
-
return
|
|
244
|
-
luma:
|
|
245
|
-
bucket:
|
|
246
|
-
sample:
|
|
242
|
+
return U(j), {
|
|
243
|
+
luma: K(l),
|
|
244
|
+
bucket: K(u),
|
|
245
|
+
sample: K(d),
|
|
247
246
|
sampleNow: S,
|
|
248
247
|
dispose: j
|
|
249
248
|
};
|
|
250
249
|
}
|
|
251
250
|
//#endregion
|
|
252
251
|
//#region src/components/dock/composables/useDockState.ts
|
|
253
|
-
function
|
|
254
|
-
let { collapseDelay: t =
|
|
255
|
-
function
|
|
256
|
-
|
|
252
|
+
function Me(e) {
|
|
253
|
+
let { collapseDelay: t = g, rootEl: n, alwaysExpanded: r = !1, initialExpanded: i = !1, isTransitioning: a, dockId: o, onStateChange: s } = e, c = () => typeof r == "boolean" ? r : r.value, l = () => c(), u = q(c() ? "pinned" : i ? "hover" : "collapsed"), d = k(() => u.value !== "collapsed"), f = k(() => u.value === "pinned"), p = null, m = q(0), h = q(0), _ = k(() => m.value > 0), v = k(() => h.value > 0), y = null, b = null, x = !1, S = null;
|
|
254
|
+
function C() {
|
|
255
|
+
S &&= (clearTimeout(S), null);
|
|
256
|
+
}
|
|
257
|
+
let w = u.value;
|
|
258
|
+
function T() {
|
|
259
|
+
c() && (u.value = "pinned"), s && w !== u.value && s(u.value, w), w = u.value;
|
|
257
260
|
}
|
|
258
|
-
let T = f.value;
|
|
259
261
|
function E() {
|
|
260
|
-
|
|
262
|
+
p &&= (clearTimeout(p), null);
|
|
261
263
|
}
|
|
262
264
|
function D() {
|
|
263
|
-
|
|
265
|
+
b !== null && (cancelAnimationFrame(b), b = null);
|
|
264
266
|
}
|
|
265
267
|
function O() {
|
|
266
|
-
|
|
268
|
+
D(), y?.();
|
|
267
269
|
}
|
|
268
|
-
function
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
function j() {
|
|
272
|
-
d() || g.value > 0 || (D(), h = setTimeout(() => {
|
|
273
|
-
f.value = "collapsed", E();
|
|
270
|
+
function A() {
|
|
271
|
+
l() || m.value > 0 || (E(), p = setTimeout(() => {
|
|
272
|
+
u.value = "collapsed", T();
|
|
274
273
|
}, t));
|
|
275
274
|
}
|
|
276
|
-
function
|
|
277
|
-
if (
|
|
278
|
-
|
|
275
|
+
function j() {
|
|
276
|
+
if (c()) {
|
|
277
|
+
u.value = "pinned", T();
|
|
279
278
|
return;
|
|
280
279
|
}
|
|
281
|
-
|
|
280
|
+
x ||= (x = !0, E(), C(), u.value = "collapsed", T(), !1);
|
|
282
281
|
}
|
|
283
|
-
function
|
|
284
|
-
if (
|
|
285
|
-
|
|
282
|
+
function M() {
|
|
283
|
+
if (c()) {
|
|
284
|
+
u.value = "pinned", T();
|
|
286
285
|
return;
|
|
287
286
|
}
|
|
288
|
-
|
|
287
|
+
E(), C(), u.value = "hover", T();
|
|
289
288
|
}
|
|
290
|
-
function
|
|
291
|
-
|
|
292
|
-
|
|
289
|
+
function N() {
|
|
290
|
+
l() || (E(), u.value === "collapsed" && (C(), S = setTimeout(() => {
|
|
291
|
+
S = null, !l() && u.value === "collapsed" && (u.value = "hover", T());
|
|
293
292
|
}, 60)));
|
|
294
293
|
}
|
|
295
|
-
function
|
|
296
|
-
if (!
|
|
297
|
-
if (
|
|
294
|
+
function P(e) {
|
|
295
|
+
if (!l() && (C(), u.value === "hover")) {
|
|
296
|
+
if (m.value > 0) return;
|
|
298
297
|
if (e) {
|
|
299
298
|
let t = n.value;
|
|
300
|
-
if (t && e.relatedTarget instanceof Node && t.contains(e.relatedTarget) ||
|
|
299
|
+
if (t && e.relatedTarget instanceof Node && t.contains(e.relatedTarget) || he(e.relatedTarget, o)) return;
|
|
301
300
|
}
|
|
302
|
-
|
|
301
|
+
A();
|
|
303
302
|
}
|
|
304
303
|
}
|
|
305
|
-
function
|
|
306
|
-
|
|
304
|
+
function F() {
|
|
305
|
+
l() || (E(), u.value === "collapsed" && (u.value = "hover", T()));
|
|
307
306
|
}
|
|
308
|
-
function
|
|
309
|
-
if (
|
|
307
|
+
function I(e) {
|
|
308
|
+
if (l() || u.value !== "hover" || m.value > 0) return;
|
|
310
309
|
let t = e.currentTarget;
|
|
311
|
-
e.relatedTarget && t.contains(e.relatedTarget) ||
|
|
310
|
+
e.relatedTarget && t.contains(e.relatedTarget) || he(e.relatedTarget, o) || A();
|
|
312
311
|
}
|
|
313
312
|
function L() {
|
|
314
|
-
|
|
313
|
+
l() || (E(), C(), u.value = "pinned", T());
|
|
315
314
|
}
|
|
316
315
|
function R(e = "morph") {
|
|
317
|
-
|
|
316
|
+
m.value++, e === "grasp" && h.value++, E();
|
|
318
317
|
}
|
|
319
318
|
function z(e = "morph") {
|
|
320
|
-
e === "grasp" && (
|
|
321
|
-
|
|
319
|
+
e === "grasp" && (h.value = Math.max(0, h.value - 1)), m.value = Math.max(0, m.value - 1), m.value === 0 && u.value === "hover" && (E(), p = setTimeout(() => {
|
|
320
|
+
m.value === 0 && u.value === "hover" && A();
|
|
322
321
|
}, Math.min(t, 800)));
|
|
323
322
|
}
|
|
324
323
|
function B(e) {
|
|
325
|
-
if (
|
|
324
|
+
if (l() || m.value > 0 || a?.value) return;
|
|
326
325
|
let t = n.value;
|
|
327
|
-
!t || t.contains(e.target) ||
|
|
326
|
+
!t || t.contains(e.target) || he(e.target, o) || j();
|
|
328
327
|
}
|
|
329
|
-
return Z(
|
|
328
|
+
return Z(d, (e) => {
|
|
330
329
|
if (e) {
|
|
331
330
|
if (typeof document > "u") return;
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
document.removeEventListener("pointerdown", B, !0),
|
|
331
|
+
O(), b = requestAnimationFrame(() => {
|
|
332
|
+
b = null, d.value && (document.addEventListener("pointerdown", B, !0), y = () => {
|
|
333
|
+
document.removeEventListener("pointerdown", B, !0), y = null;
|
|
335
334
|
});
|
|
336
335
|
});
|
|
337
|
-
} else
|
|
338
|
-
}, { immediate: !0 }), typeof r == "boolean" ? r && (
|
|
336
|
+
} else O();
|
|
337
|
+
}, { immediate: !0 }), typeof r == "boolean" ? r && (u.value = "pinned", T()) : Z(r, (e) => {
|
|
339
338
|
if (e) {
|
|
340
|
-
|
|
339
|
+
E(), u.value = "pinned", T();
|
|
341
340
|
return;
|
|
342
341
|
}
|
|
343
|
-
|
|
344
|
-
}),
|
|
345
|
-
|
|
346
|
-
}), H(() => {
|
|
347
|
-
D(), w(), k();
|
|
342
|
+
u.value = "collapsed", T();
|
|
343
|
+
}), W(() => {
|
|
344
|
+
E(), C(), O();
|
|
348
345
|
}), {
|
|
349
|
-
state:
|
|
350
|
-
expanded:
|
|
351
|
-
isPinned:
|
|
352
|
-
isHeld:
|
|
353
|
-
graspHeld:
|
|
354
|
-
onMouseEnter:
|
|
355
|
-
onMouseLeave:
|
|
356
|
-
onFocusIn:
|
|
357
|
-
onFocusOut:
|
|
346
|
+
state: u,
|
|
347
|
+
expanded: d,
|
|
348
|
+
isPinned: f,
|
|
349
|
+
isHeld: _,
|
|
350
|
+
graspHeld: v,
|
|
351
|
+
onMouseEnter: N,
|
|
352
|
+
onMouseLeave: P,
|
|
353
|
+
onFocusIn: F,
|
|
354
|
+
onFocusOut: I,
|
|
358
355
|
onClickCollapsed: L,
|
|
359
356
|
keepOpen: R,
|
|
360
357
|
release: z,
|
|
361
|
-
expand:
|
|
362
|
-
collapse:
|
|
358
|
+
expand: M,
|
|
359
|
+
collapse: j
|
|
363
360
|
};
|
|
364
361
|
}
|
|
365
362
|
//#endregion
|
|
366
363
|
//#region src/components/dock/composables/useDockSpring.ts
|
|
367
|
-
function
|
|
364
|
+
function Ne(e) {
|
|
368
365
|
let t = null, n = () => t !== null && !t.settled;
|
|
369
366
|
function i() {
|
|
370
367
|
t &&= (t.dispose(), null);
|
|
@@ -372,7 +369,7 @@ function Pe(e) {
|
|
|
372
369
|
function a(a, o, s) {
|
|
373
370
|
let c = n() ? t.velocity * (s.inheritVelocityScale ?? 1) : 0;
|
|
374
371
|
i();
|
|
375
|
-
let l = new
|
|
372
|
+
let l = new pe({
|
|
376
373
|
response: e.response * r(),
|
|
377
374
|
dampingFraction: e.dampingFraction,
|
|
378
375
|
initial: a,
|
|
@@ -399,11 +396,11 @@ function Pe(e) {
|
|
|
399
396
|
}
|
|
400
397
|
//#endregion
|
|
401
398
|
//#region src/components/dock/composables/useDockMorph.ts
|
|
402
|
-
function
|
|
403
|
-
let { rootEl: t, outerActiveLayer: n } = e, r =
|
|
404
|
-
response:
|
|
405
|
-
dampingFraction:
|
|
406
|
-
}), o =
|
|
399
|
+
function Pe(e) {
|
|
400
|
+
let { rootEl: t, outerActiveLayer: n } = e, r = q(n.value), i = q(null), a = Ne({
|
|
401
|
+
response: f.response,
|
|
402
|
+
dampingFraction: f.dampingFraction
|
|
403
|
+
}), o = me("(prefers-reduced-motion: reduce)");
|
|
407
404
|
function s() {
|
|
408
405
|
return t.value;
|
|
409
406
|
}
|
|
@@ -428,7 +425,7 @@ function Fe(e) {
|
|
|
428
425
|
onSettle: c
|
|
429
426
|
});
|
|
430
427
|
}
|
|
431
|
-
let
|
|
428
|
+
let u = Z(n, (e, t) => {
|
|
432
429
|
if (e === t) return;
|
|
433
430
|
let n = s();
|
|
434
431
|
if (r.value = e, !n) {
|
|
@@ -437,35 +434,35 @@ function Fe(e) {
|
|
|
437
434
|
}
|
|
438
435
|
i.value = t, l();
|
|
439
436
|
});
|
|
440
|
-
return
|
|
441
|
-
|
|
437
|
+
return W(() => {
|
|
438
|
+
u(), a.dispose();
|
|
442
439
|
}), {
|
|
443
|
-
outerCurrentLayer:
|
|
444
|
-
outerLeavingLayer:
|
|
440
|
+
outerCurrentLayer: K(r),
|
|
441
|
+
outerLeavingLayer: K(i)
|
|
445
442
|
};
|
|
446
443
|
}
|
|
447
444
|
//#endregion
|
|
448
445
|
//#region src/components/dock/composables/dockMorphMeasure.ts
|
|
449
|
-
function
|
|
446
|
+
function Fe(e, t) {
|
|
450
447
|
return t === "vertical" ? e.offsetHeight : e.offsetWidth;
|
|
451
448
|
}
|
|
452
|
-
function
|
|
449
|
+
function Ie(e) {
|
|
453
450
|
let { rootEl: t, contentEl: n, expandedEl: r, collapsedEl: i, axis: a, expanded: o } = e, s = null, c = 0, l = 0, u = !1;
|
|
454
|
-
function d() {
|
|
455
|
-
let
|
|
456
|
-
if (!
|
|
457
|
-
let
|
|
458
|
-
if (
|
|
459
|
-
o.value ? c =
|
|
460
|
-
let
|
|
461
|
-
|
|
451
|
+
function d(e = "layout") {
|
|
452
|
+
let s = t.value, u = n.value, d = r.value, f = i.value;
|
|
453
|
+
if (!s || !u || !d || !f || s.hasAttribute("data-morphing")) return;
|
|
454
|
+
let p = a.value, m = Fe(s, p), h = Fe(d, p), g = Fe(f, p);
|
|
455
|
+
if (m <= 0 || h < 0 || g < 0) return;
|
|
456
|
+
e === "layout" && (o.value ? c = m : l = m);
|
|
457
|
+
let _ = o.value ? h : g, v = Math.max(0, m - _), y = c || v + h, b = l || v + g;
|
|
458
|
+
y <= 0 || b <= 0 || (s.style.setProperty("--dock-collapsed-px", `${b}px`), s.style.setProperty("--dock-expanded-px", `${Math.max(y, b)}px`));
|
|
462
459
|
}
|
|
463
460
|
function f() {
|
|
464
461
|
s?.disconnect(), s = null;
|
|
465
462
|
let e = t.value;
|
|
466
463
|
if (e) {
|
|
467
464
|
if (typeof ResizeObserver < "u") {
|
|
468
|
-
s = new ResizeObserver(d);
|
|
465
|
+
s = new ResizeObserver(() => d("layout"));
|
|
469
466
|
for (let t of [
|
|
470
467
|
e,
|
|
471
468
|
n.value,
|
|
@@ -482,33 +479,28 @@ function Le(e) {
|
|
|
482
479
|
r,
|
|
483
480
|
i,
|
|
484
481
|
a
|
|
485
|
-
], f, { immediate: !0 }), Z(o, d);
|
|
482
|
+
], f, { immediate: !0 }), Z(o, () => d("flip"));
|
|
486
483
|
let p = typeof document < "u" ? document.fonts : void 0;
|
|
487
|
-
p && p.ready.then(() => !u && d()),
|
|
484
|
+
p && p.ready.then(() => !u && d("layout")), U(() => {
|
|
488
485
|
u = !0, s?.disconnect(), s = null;
|
|
489
486
|
});
|
|
490
487
|
}
|
|
491
488
|
//#endregion
|
|
492
489
|
//#region src/components/dock/composables/useDockShellProps.ts
|
|
493
|
-
function
|
|
494
|
-
let t =
|
|
490
|
+
function Le(e) {
|
|
491
|
+
let t = k(() => e.shape ?? "pill"), n = k(() => e.orientation ?? "horizontal"), r = k(() => e.collapse === !1);
|
|
495
492
|
return {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
orientation: i,
|
|
502
|
-
size: a,
|
|
503
|
-
scrollClass: o,
|
|
504
|
-
alwaysExpanded: s,
|
|
505
|
-
fitContent: A(() => e.fitContent ?? !1)
|
|
493
|
+
startCollapsed: k(() => !r.value && (e.collapse ?? "closed") === "closed"),
|
|
494
|
+
shape: t,
|
|
495
|
+
orientation: n,
|
|
496
|
+
alwaysExpanded: r,
|
|
497
|
+
fitContent: k(() => e.fitContent ?? !1)
|
|
506
498
|
};
|
|
507
499
|
}
|
|
508
500
|
//#endregion
|
|
509
501
|
//#region src/components/dock/composables/useDockClickIntegrity.ts
|
|
510
|
-
function
|
|
511
|
-
let { rootEl: t, visualExpanded: n } = e, r = null, i = !1, a = 0, o = null, s =
|
|
502
|
+
function Re(e) {
|
|
503
|
+
let { rootEl: t, visualExpanded: n } = e, r = null, i = !1, a = 0, o = null, s = q(null), c = null, l = [];
|
|
512
504
|
function u() {
|
|
513
505
|
c?.removeAttribute("data-dock-press-origin"), c = null;
|
|
514
506
|
for (let { element: e, wasInert: t } of l.splice(0)) e.toggleAttribute("inert", t);
|
|
@@ -570,94 +562,161 @@ function ze(e) {
|
|
|
570
562
|
r = null;
|
|
571
563
|
return;
|
|
572
564
|
}
|
|
573
|
-
if (!
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
e.stopPropagation(), e.preventDefault(), r = null;
|
|
565
|
+
if (!r && !t) return;
|
|
566
|
+
let n = r instanceof Element && r.closest(".dock-persistent") !== null;
|
|
567
|
+
if ((!t || n) && y(e.target)) {
|
|
568
|
+
r = null;
|
|
569
|
+
return;
|
|
579
570
|
}
|
|
571
|
+
e.stopPropagation(), e.preventDefault(), r = null;
|
|
580
572
|
}
|
|
581
|
-
return
|
|
573
|
+
return V(() => {
|
|
582
574
|
f(), u();
|
|
583
575
|
}), {
|
|
584
576
|
onPointerDownCapture: _,
|
|
585
577
|
onPointerCancelCapture: v,
|
|
586
578
|
onClickCapture: b,
|
|
587
579
|
markExpandFlip: p,
|
|
588
|
-
pressKeepaliveLayer:
|
|
580
|
+
pressKeepaliveLayer: K(s)
|
|
589
581
|
};
|
|
590
582
|
}
|
|
591
583
|
//#endregion
|
|
592
|
-
//#region src/components/dock/composables/
|
|
584
|
+
//#region src/components/dock/composables/useDockRun.ts
|
|
585
|
+
function ze(e, t) {
|
|
586
|
+
let n = getComputedStyle(e).getPropertyValue(t).trim(), r = Number.parseFloat(n);
|
|
587
|
+
return Number.isFinite(r) ? r : 0;
|
|
588
|
+
}
|
|
593
589
|
function Be(e) {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
590
|
+
return Array.from(e.children).filter((e) => e instanceof HTMLElement);
|
|
591
|
+
}
|
|
592
|
+
function Ve(e) {
|
|
593
|
+
return e.findIndex((e) => {
|
|
594
|
+
let t = (e.matches("[aria-current]") ? e : e.querySelector("[aria-current]"))?.getAttribute("aria-current");
|
|
595
|
+
return t != null && t !== "false";
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
function He(e) {
|
|
599
|
+
return e.matches(b) ? e : e.querySelector(b);
|
|
600
|
+
}
|
|
601
|
+
function Ue(e) {
|
|
602
|
+
let { runEl: t, statusEl: n, orientation: r } = e, i = Ne({
|
|
603
|
+
response: f.response,
|
|
604
|
+
dampingFraction: f.dampingFraction
|
|
605
|
+
});
|
|
606
|
+
function a() {
|
|
607
|
+
return r.value === "vertical";
|
|
597
608
|
}
|
|
598
|
-
function
|
|
599
|
-
|
|
600
|
-
let t = n.value, r = e.touches[0];
|
|
601
|
-
!t || !r || l.handleTouchStart(t, r.clientY);
|
|
609
|
+
function o(e) {
|
|
610
|
+
return a() ? e.scrollTop : e.scrollLeft;
|
|
602
611
|
}
|
|
603
|
-
function
|
|
604
|
-
|
|
612
|
+
function s(e, t) {
|
|
613
|
+
a() ? e.scrollTop = t : e.scrollLeft = t;
|
|
605
614
|
}
|
|
606
|
-
function
|
|
607
|
-
|
|
608
|
-
let e = l.isActive.value;
|
|
609
|
-
l.handleTouchEnd(), !e && l.isActive.value && !i.value && s();
|
|
615
|
+
function c(e) {
|
|
616
|
+
return a() ? e.scrollHeight - e.clientHeight : e.scrollWidth - e.clientWidth;
|
|
610
617
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
};
|
|
619
|
-
}
|
|
620
|
-
//#endregion
|
|
621
|
-
//#region src/components/dock/composables/useDockOverflowFit.ts
|
|
622
|
-
function Ve(e) {
|
|
623
|
-
let t = null, n = null, r = 0;
|
|
624
|
-
function i() {
|
|
625
|
-
return e.value?.querySelector(".dock-layer--full") ?? null;
|
|
618
|
+
function l(e, t) {
|
|
619
|
+
let n = Be(e), r = n.indexOf(t);
|
|
620
|
+
if (r < 0) return o(e);
|
|
621
|
+
let i = ze(e, "--dock-pitch");
|
|
622
|
+
if (i <= 0) return o(e);
|
|
623
|
+
let a = Math.max(1, ze(e, "--dock-open-pitches")), s = Ve(n), l = s >= 0 && s < r ? (a - 1) * i : 0, u = r * i + l - i / 2;
|
|
624
|
+
return Math.min(Math.max(u, 0), c(e));
|
|
626
625
|
}
|
|
627
|
-
function
|
|
628
|
-
let
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
626
|
+
function u(e, t) {
|
|
627
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
628
|
+
return a() ? r.top < n.top - 1 || r.bottom > n.bottom + 1 : r.left < n.left - 1 || r.right > n.right + 1;
|
|
629
|
+
}
|
|
630
|
+
function d(e) {
|
|
631
|
+
let t = n.value;
|
|
632
|
+
if (!t) return;
|
|
633
|
+
let r = He(e) ?? e, i = r.getAttribute("aria-label") ?? r.getAttribute("title") ?? r.textContent?.trim();
|
|
634
|
+
i && (t.textContent = i);
|
|
635
|
+
}
|
|
636
|
+
function p(e) {
|
|
637
|
+
let n = t.value;
|
|
638
|
+
if (!n || (d(e), !u(n, e))) return;
|
|
639
|
+
let r = o(n), a = l(n, e);
|
|
640
|
+
Math.abs(a - r) < 1 || i.playTo(0, 1, { onFrame: (e) => {
|
|
641
|
+
let n = t.value;
|
|
642
|
+
n && s(n, r + (a - r) * e);
|
|
643
|
+
} });
|
|
632
644
|
}
|
|
633
|
-
function
|
|
634
|
-
|
|
645
|
+
function m() {
|
|
646
|
+
let e = t.value;
|
|
647
|
+
if (!e) return;
|
|
648
|
+
let n = Be(e);
|
|
649
|
+
if (n.length === 0) return;
|
|
650
|
+
let r = Ve(n), i = n.findIndex((e) => e.contains(document.activeElement)), a = i >= 0 ? i : r >= 0 ? r : 0;
|
|
651
|
+
n.forEach((e, t) => {
|
|
652
|
+
let n = He(e);
|
|
653
|
+
n && (n.tabIndex = t === a ? 0 : -1);
|
|
654
|
+
});
|
|
635
655
|
}
|
|
636
|
-
|
|
637
|
-
let
|
|
638
|
-
|
|
656
|
+
function h(e, t) {
|
|
657
|
+
let n = e[t];
|
|
658
|
+
if (!n) return;
|
|
659
|
+
let r = He(n);
|
|
660
|
+
r && (p(n), r.tabIndex = 0, r.focus({ preventScroll: !0 }), m());
|
|
661
|
+
}
|
|
662
|
+
function g(e) {
|
|
663
|
+
let n = t.value;
|
|
664
|
+
if (!n) return;
|
|
665
|
+
let r = Be(n);
|
|
666
|
+
if (r.length === 0) return;
|
|
667
|
+
let i = r.findIndex((t) => t.contains(e.target));
|
|
668
|
+
if (i < 0) return;
|
|
669
|
+
let [o, s] = a() ? ["ArrowUp", "ArrowDown"] : ["ArrowLeft", "ArrowRight"], c;
|
|
670
|
+
switch (e.key) {
|
|
671
|
+
case o:
|
|
672
|
+
c = i - 1;
|
|
673
|
+
break;
|
|
674
|
+
case s:
|
|
675
|
+
c = i + 1;
|
|
676
|
+
break;
|
|
677
|
+
case "Home":
|
|
678
|
+
c = 0;
|
|
679
|
+
break;
|
|
680
|
+
case "End":
|
|
681
|
+
c = r.length - 1;
|
|
682
|
+
break;
|
|
683
|
+
default: return;
|
|
684
|
+
}
|
|
685
|
+
c < 0 || c >= r.length || (e.preventDefault(), h(r, c));
|
|
686
|
+
}
|
|
687
|
+
function _(e) {
|
|
688
|
+
let n = t.value;
|
|
689
|
+
if (!n) return;
|
|
690
|
+
let r = Be(n).find((t) => t.contains(e.target));
|
|
691
|
+
r && p(r);
|
|
692
|
+
}
|
|
693
|
+
let v = null;
|
|
694
|
+
return H(() => {
|
|
695
|
+
let e = t.value;
|
|
696
|
+
e && (e.addEventListener("keydown", g), e.addEventListener("click", _, { capture: !0 }), e.addEventListener("focusin", _, { capture: !0 }), m(), v = new MutationObserver(() => m()), v.observe(e, {
|
|
639
697
|
childList: !0,
|
|
640
698
|
subtree: !0,
|
|
641
|
-
characterData: !0,
|
|
642
699
|
attributes: !0,
|
|
643
|
-
attributeFilter: ["
|
|
700
|
+
attributeFilter: ["aria-current"]
|
|
644
701
|
}));
|
|
645
|
-
}),
|
|
646
|
-
|
|
647
|
-
|
|
702
|
+
}), W(() => {
|
|
703
|
+
let e = t.value;
|
|
704
|
+
e?.removeEventListener("keydown", g), e?.removeEventListener("click", _, { capture: !0 }), e?.removeEventListener("focusin", _, { capture: !0 }), v?.disconnect(), i.dispose();
|
|
705
|
+
}), Z(r, () => m()), {
|
|
706
|
+
reach: p,
|
|
707
|
+
syncRoving: m
|
|
708
|
+
};
|
|
648
709
|
}
|
|
649
710
|
//#endregion
|
|
650
711
|
//#region src/components/dock/GlassDock.vue?vue&type=script&setup=true&lang.ts
|
|
651
|
-
var
|
|
652
|
-
"data-size",
|
|
653
|
-
"data-backdrop-mode",
|
|
654
|
-
"data-interaction",
|
|
655
|
-
"data-held",
|
|
656
|
-
"data-search"
|
|
657
|
-
], Ue = ["data-held"], We = { class: "dock-controls" }, Ge = {
|
|
712
|
+
var We = ["data-backdrop-mode", "data-held"], Ge = ["data-held"], Ke = { class: "dock-controls" }, qe = {
|
|
658
713
|
key: 0,
|
|
659
714
|
class: "dock-persistent"
|
|
660
|
-
},
|
|
715
|
+
}, Je = [
|
|
716
|
+
"id",
|
|
717
|
+
"aria-orientation",
|
|
718
|
+
"inert"
|
|
719
|
+
], Ye = [
|
|
661
720
|
"id",
|
|
662
721
|
"inert",
|
|
663
722
|
"role",
|
|
@@ -665,221 +724,207 @@ var He = [
|
|
|
665
724
|
"aria-label",
|
|
666
725
|
"aria-expanded",
|
|
667
726
|
"aria-controls"
|
|
668
|
-
],
|
|
727
|
+
], Xe = {
|
|
669
728
|
key: 0,
|
|
670
729
|
class: "dock-search-field"
|
|
671
|
-
},
|
|
730
|
+
}, Ze = {
|
|
672
731
|
key: 1,
|
|
673
732
|
class: "dock-persistent dock-persistent-end"
|
|
674
|
-
},
|
|
733
|
+
}, Qe = /* @__PURE__ */ F({
|
|
675
734
|
inheritAttrs: !1,
|
|
676
735
|
__name: "GlassDock",
|
|
677
736
|
props: {
|
|
678
737
|
fitContent: { type: Boolean },
|
|
679
|
-
position: {},
|
|
680
738
|
backdropMode: { default: "live" },
|
|
681
|
-
alwaysExpanded: { type: Boolean },
|
|
682
739
|
shape: {},
|
|
683
740
|
orientation: {},
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
layout: {},
|
|
690
|
-
backgroundCanvas: {},
|
|
691
|
-
search: { type: Boolean }
|
|
741
|
+
collapse: {
|
|
742
|
+
type: [Boolean, String],
|
|
743
|
+
default: "closed"
|
|
744
|
+
},
|
|
745
|
+
backgroundCanvas: {}
|
|
692
746
|
},
|
|
693
747
|
setup(e, { expose: t }) {
|
|
694
|
-
let n = e, {
|
|
695
|
-
|
|
748
|
+
let n = e, { startCollapsed: r, shape: i, orientation: a, alwaysExpanded: o, fitContent: s } = Le(n), c = X("dockEl"), l = X("layersEl"), u = X("fullEl"), f = X("summaryEl"), p = X("statusEl");
|
|
749
|
+
Ue({
|
|
750
|
+
runEl: u,
|
|
751
|
+
statusEl: p,
|
|
752
|
+
orientation: a
|
|
753
|
+
}), n.backdropMode === "live" && je(c, { backgroundCanvas: () => {
|
|
696
754
|
let e = n.backgroundCanvas;
|
|
697
755
|
return typeof e == "function" ? e() : e instanceof HTMLCanvasElement ? e : null;
|
|
698
756
|
} });
|
|
699
|
-
let
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
dockId: S
|
|
707
|
-
}), ne = A(() => p.value || a.value === "manual");
|
|
757
|
+
let m = q(!1), h = `glass-dock-${re()}`, { expanded: g, isPinned: v, isHeld: y, graspHeld: x, onMouseEnter: S, onMouseLeave: C, onFocusIn: w, onFocusOut: T, onClickCollapsed: E, keepOpen: D, release: A, expand: P, collapse: F } = Me({
|
|
758
|
+
rootEl: c,
|
|
759
|
+
alwaysExpanded: o,
|
|
760
|
+
initialExpanded: !r.value,
|
|
761
|
+
isTransitioning: m,
|
|
762
|
+
dockId: h
|
|
763
|
+
});
|
|
708
764
|
d({
|
|
709
|
-
id:
|
|
710
|
-
orientation:
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
held: E
|
|
765
|
+
id: h,
|
|
766
|
+
orientation: a,
|
|
767
|
+
keepOpen: D,
|
|
768
|
+
release: A,
|
|
769
|
+
held: x
|
|
715
770
|
});
|
|
716
|
-
let
|
|
717
|
-
|
|
718
|
-
|
|
771
|
+
let I = k(() => o.value || g.value);
|
|
772
|
+
Ie({
|
|
773
|
+
rootEl: c,
|
|
774
|
+
contentEl: l,
|
|
775
|
+
expandedEl: u,
|
|
776
|
+
collapsedEl: f,
|
|
777
|
+
axis: a,
|
|
778
|
+
expanded: I
|
|
779
|
+
});
|
|
780
|
+
let { outerCurrentLayer: B, outerLeavingLayer: V } = Pe({
|
|
781
|
+
rootEl: c,
|
|
782
|
+
outerActiveLayer: k(() => I.value ? "full" : "summary"),
|
|
719
783
|
onMorphActiveChange: (e) => {
|
|
720
|
-
|
|
784
|
+
m.value = e;
|
|
721
785
|
}
|
|
722
|
-
}),
|
|
723
|
-
async function
|
|
724
|
-
!
|
|
786
|
+
}), H = k(() => B.value === "summary");
|
|
787
|
+
async function U(e) {
|
|
788
|
+
!H.value || !["Enter", " "].includes(e.key) || (e.preventDefault(), E(), await R(), (u.value?.querySelector(b) ?? u.value)?.focus({ preventScroll: !0 }));
|
|
725
789
|
}
|
|
726
|
-
async function
|
|
727
|
-
if (
|
|
728
|
-
let t = e.target?.closest?.(
|
|
729
|
-
if (t &&
|
|
730
|
-
|
|
731
|
-
let n =
|
|
790
|
+
async function W(e) {
|
|
791
|
+
if (e.key !== "Escape") return;
|
|
792
|
+
let t = e.target?.closest?.(_);
|
|
793
|
+
if (t && u.value?.contains(t)) return;
|
|
794
|
+
F(), await R();
|
|
795
|
+
let n = f.value;
|
|
732
796
|
n && !n.hasAttribute("inert") && n.focus({ preventScroll: !0 });
|
|
733
797
|
}
|
|
734
|
-
|
|
735
|
-
rootEl:
|
|
736
|
-
|
|
737
|
-
expandedEl: v,
|
|
738
|
-
collapsedEl: y,
|
|
739
|
-
axis: re,
|
|
740
|
-
expanded: H
|
|
741
|
-
});
|
|
742
|
-
let { onPointerDownCapture: ce, onPointerCancelCapture: le, onClickCapture: ue, markExpandFlip: de, pressKeepaliveLayer: fe } = ze({
|
|
743
|
-
rootEl: g,
|
|
744
|
-
visualExpanded: H
|
|
745
|
-
}), { onTouchStart: pe, onTouchMove: me, onTouchEnd: he, deactivate: ge } = Be({
|
|
746
|
-
collapseDelay: r.value,
|
|
747
|
-
rootEl: g,
|
|
748
|
-
quiet: ne,
|
|
749
|
-
visualExpanded: H,
|
|
750
|
-
expanded: C,
|
|
751
|
-
isPinned: w,
|
|
752
|
-
expand: te,
|
|
753
|
-
collapse: V
|
|
798
|
+
let { onPointerDownCapture: K, onPointerCancelCapture: ee, onClickCapture: te, markExpandFlip: ne, pressKeepaliveLayer: ie } = Re({
|
|
799
|
+
rootEl: c,
|
|
800
|
+
visualExpanded: I
|
|
754
801
|
});
|
|
755
|
-
Z(
|
|
756
|
-
e
|
|
802
|
+
Z(I, (e) => {
|
|
803
|
+
e && ne();
|
|
757
804
|
});
|
|
758
|
-
let
|
|
759
|
-
Z(
|
|
760
|
-
e && (
|
|
805
|
+
let Q = q(!1);
|
|
806
|
+
Z(x, (e) => {
|
|
807
|
+
e && (Q.value = !0);
|
|
761
808
|
});
|
|
762
|
-
function
|
|
763
|
-
e.propertyName === "opacity" && !
|
|
809
|
+
function $(e) {
|
|
810
|
+
e.propertyName === "opacity" && !x.value && (Q.value = !1);
|
|
764
811
|
}
|
|
765
812
|
return t({
|
|
766
|
-
expanded:
|
|
767
|
-
isPinned:
|
|
768
|
-
isHeld:
|
|
769
|
-
graspHeld:
|
|
770
|
-
isTransitioning:
|
|
771
|
-
expand:
|
|
772
|
-
collapse:
|
|
773
|
-
keepOpen:
|
|
774
|
-
release:
|
|
775
|
-
}), (
|
|
813
|
+
expanded: g,
|
|
814
|
+
isPinned: v,
|
|
815
|
+
isHeld: y,
|
|
816
|
+
graspHeld: x,
|
|
817
|
+
isTransitioning: m,
|
|
818
|
+
expand: P,
|
|
819
|
+
collapse: F,
|
|
820
|
+
keepOpen: D,
|
|
821
|
+
release: A
|
|
822
|
+
}), (e, t) => (G(), M("div", L({
|
|
776
823
|
ref_key: "dockEl",
|
|
777
|
-
ref:
|
|
778
|
-
},
|
|
824
|
+
ref: c
|
|
825
|
+
}, e.$attrs, {
|
|
779
826
|
class: ["glass-dock", [
|
|
780
|
-
|
|
781
|
-
`shape-${
|
|
782
|
-
`layout-${J(h)}`,
|
|
783
|
-
J(u),
|
|
827
|
+
Y(a),
|
|
828
|
+
`shape-${Y(i)}`,
|
|
784
829
|
{
|
|
785
|
-
expanded:
|
|
786
|
-
collapsed: !
|
|
787
|
-
pinned:
|
|
788
|
-
"fit-content":
|
|
789
|
-
"always-expanded":
|
|
790
|
-
|
|
791
|
-
},
|
|
792
|
-
e.position === "fixed" ? "fixed bottom-(--dock-pos) inset-x-0 mx-auto w-max" : e.position === "sticky" ? "dock-sticky" : "dock-inline"
|
|
830
|
+
expanded: I.value,
|
|
831
|
+
collapsed: !I.value,
|
|
832
|
+
pinned: Y(v),
|
|
833
|
+
"fit-content": Y(s),
|
|
834
|
+
"always-expanded": Y(o)
|
|
835
|
+
}
|
|
793
836
|
]],
|
|
794
|
-
"data-size": J(l),
|
|
795
837
|
"data-backdrop-mode": n.backdropMode,
|
|
796
|
-
"data-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
838
|
+
"data-held": Y(x) || void 0,
|
|
839
|
+
onMouseenter: t[2] ||= (...e) => Y(S) && Y(S)(...e),
|
|
840
|
+
onMouseleave: t[3] ||= (e) => Y(C)(e),
|
|
841
|
+
onFocusin: t[4] ||= (...e) => Y(w) && Y(w)(...e),
|
|
842
|
+
onFocusout: t[5] ||= (...e) => Y(T) && Y(T)(...e),
|
|
843
|
+
onPointerdownCapture: t[6] ||= (...e) => Y(K) && Y(K)(...e),
|
|
844
|
+
onPointercancelCapture: t[7] ||= (...e) => Y(ee) && Y(ee)(...e),
|
|
845
|
+
onClickCapture: t[8] ||= (...e) => Y(te) && Y(te)(...e)
|
|
846
|
+
}), [
|
|
847
|
+
N("div", {
|
|
848
|
+
class: "dock-plate",
|
|
849
|
+
"aria-hidden": "true",
|
|
850
|
+
"data-held": Y(x) || void 0
|
|
851
|
+
}, [Q.value ? (G(), M(O, { key: 0 }, [t[9] ||= N("span", {
|
|
852
|
+
class: "glass-grasp-carrier",
|
|
853
|
+
"data-grasp": "rest"
|
|
854
|
+
}, null, -1), N("span", {
|
|
855
|
+
class: "glass-grasp-carrier",
|
|
856
|
+
"data-grasp": "grasp",
|
|
857
|
+
onTransitionend: $
|
|
858
|
+
}, null, 32)], 64)) : j("", !0)], 8, Ge),
|
|
859
|
+
N("div", Ke, [
|
|
860
|
+
e.$slots.persistent ? (G(), M("div", qe, [J(e.$slots, "persistent")])) : j("", !0),
|
|
861
|
+
N("div", {
|
|
862
|
+
ref_key: "layersEl",
|
|
863
|
+
ref: l,
|
|
864
|
+
class: "dock-layers"
|
|
865
|
+
}, [
|
|
866
|
+
N("div", {
|
|
867
|
+
ref_key: "fullEl",
|
|
868
|
+
ref: u,
|
|
869
|
+
id: `${h}-full`,
|
|
870
|
+
role: "toolbar",
|
|
871
|
+
"aria-orientation": Y(a),
|
|
872
|
+
class: z(["dock-layer dock-layer--full dock-run", {
|
|
873
|
+
"is-active": Y(B) === "full",
|
|
874
|
+
"is-leaving": Y(V) === "full" || Y(ie) === "full" && Y(B) !== "full",
|
|
875
|
+
"is-press-keepalive": Y(ie) === "full"
|
|
876
|
+
}]),
|
|
877
|
+
inert: Y(B) !== "full" && Y(ie) !== "full" || void 0,
|
|
878
|
+
tabindex: "-1",
|
|
879
|
+
onKeydown: W
|
|
880
|
+
}, [J(e.$slots, "default")], 42, Je),
|
|
881
|
+
N("div", {
|
|
882
|
+
ref_key: "summaryEl",
|
|
883
|
+
ref: f,
|
|
884
|
+
id: `${h}-summary`,
|
|
885
|
+
class: z(["dock-layer dock-layer--summary", {
|
|
886
|
+
"is-active": Y(B) === "summary",
|
|
887
|
+
"is-leaving": Y(V) === "summary"
|
|
888
|
+
}]),
|
|
889
|
+
inert: Y(B) !== "summary" || void 0,
|
|
890
|
+
role: H.value ? "button" : void 0,
|
|
891
|
+
tabindex: H.value ? 0 : void 0,
|
|
892
|
+
"aria-label": H.value ? "Expand dock" : void 0,
|
|
893
|
+
"aria-expanded": H.value ? "false" : void 0,
|
|
894
|
+
"aria-controls": H.value ? `${h}-full` : void 0,
|
|
895
|
+
onFocusin: t[0] ||= ae(() => {}, ["stop"]),
|
|
896
|
+
onKeydown: U,
|
|
897
|
+
onClick: t[1] ||= (...e) => Y(E) && Y(E)(...e)
|
|
898
|
+
}, [J(e.$slots, "collapsed")], 42, Ye),
|
|
899
|
+
e.$slots.search ? (G(), M("div", Xe, [J(e.$slots, "search")])) : j("", !0)
|
|
900
|
+
], 512),
|
|
901
|
+
e.$slots["persistent-end"] ? (G(), M("div", Ze, [J(e.$slots, "persistent-end")])) : j("", !0)
|
|
902
|
+
]),
|
|
903
|
+
N("div", {
|
|
904
|
+
ref_key: "statusEl",
|
|
905
|
+
ref: p,
|
|
906
|
+
class: "dock-run-status",
|
|
907
|
+
role: "status",
|
|
908
|
+
"aria-live": "polite"
|
|
909
|
+
}, null, 512)
|
|
910
|
+
], 16, We));
|
|
911
|
+
}
|
|
912
|
+
}), $e = c("glass-ui:dock-switcher-tablist"), { KEY: et } = $e;
|
|
913
|
+
function tt(e) {
|
|
914
|
+
$e.provide(e);
|
|
866
915
|
}
|
|
867
|
-
var
|
|
868
|
-
function
|
|
869
|
-
|
|
916
|
+
var nt = $e.use, rt = s(u, "[glass-ui:dock] <DockLayer> must be used inside <DockCrossfade> (or <DockLayerGroup>)"), { KEY: it } = rt;
|
|
917
|
+
function at(e) {
|
|
918
|
+
rt.provide(e);
|
|
870
919
|
}
|
|
871
|
-
var
|
|
872
|
-
tt.useOptional;
|
|
873
|
-
//#endregion
|
|
874
|
-
//#region src/components/dock/DockCrossfade.vue
|
|
875
|
-
var at = /* @__PURE__ */ I({
|
|
920
|
+
var ot = rt.use, st = /* @__PURE__ */ F({
|
|
876
921
|
__name: "DockCrossfade",
|
|
877
922
|
props: {
|
|
878
923
|
active: {},
|
|
879
924
|
reserve: { default: "block" }
|
|
880
925
|
},
|
|
881
926
|
setup(e, { expose: t }) {
|
|
882
|
-
let n = e, r =
|
|
927
|
+
let n = e, r = q(null), i = q(/* @__PURE__ */ new Map()), a = k(() => [...i.value.values()].map(({ id: e, label: t, icon: n }) => ({
|
|
883
928
|
id: e,
|
|
884
929
|
label: t,
|
|
885
930
|
icon: n
|
|
@@ -893,36 +938,36 @@ var at = /* @__PURE__ */ I({
|
|
|
893
938
|
let t = new Map(i.value);
|
|
894
939
|
t.delete(e), i.value = t, p();
|
|
895
940
|
}
|
|
896
|
-
let c =
|
|
897
|
-
|
|
941
|
+
let c = k(() => n.active), l = q(null);
|
|
942
|
+
at({
|
|
898
943
|
register: o,
|
|
899
944
|
unregister: s,
|
|
900
945
|
activeId: c,
|
|
901
946
|
leavingId: l,
|
|
902
947
|
faces: a
|
|
903
948
|
});
|
|
904
|
-
let
|
|
949
|
+
let u = q(0), d = k(() => n.reserve === "inline" ? "min-inline-size" : "min-block-size");
|
|
905
950
|
function p() {
|
|
906
951
|
let e = 0;
|
|
907
952
|
for (let { el: t } of i.value.values()) {
|
|
908
953
|
let r = n.reserve === "inline" ? t.scrollWidth : t.scrollHeight;
|
|
909
954
|
r > e && (e = r);
|
|
910
955
|
}
|
|
911
|
-
e >
|
|
956
|
+
e > u.value && (u.value = e);
|
|
912
957
|
}
|
|
913
|
-
let m =
|
|
914
|
-
[
|
|
915
|
-
"--dock-crossfade-peak": `${
|
|
958
|
+
let m = k(() => u.value > 0 ? {
|
|
959
|
+
[d.value]: `${u.value}px`,
|
|
960
|
+
"--dock-crossfade-peak": `${u.value}px`
|
|
916
961
|
} : void 0);
|
|
917
|
-
|
|
918
|
-
let h =
|
|
919
|
-
response:
|
|
920
|
-
dampingFraction:
|
|
962
|
+
v(r, () => p());
|
|
963
|
+
let h = Ne({
|
|
964
|
+
response: f.response,
|
|
965
|
+
dampingFraction: f.dampingFraction
|
|
921
966
|
});
|
|
922
967
|
function g(e) {
|
|
923
968
|
return e ? i.value.get(e)?.el : void 0;
|
|
924
969
|
}
|
|
925
|
-
function
|
|
970
|
+
function _(e, t) {
|
|
926
971
|
g(e)?.style.setProperty("--dock-t", `${t}`);
|
|
927
972
|
}
|
|
928
973
|
function y(e) {
|
|
@@ -931,7 +976,7 @@ var at = /* @__PURE__ */ I({
|
|
|
931
976
|
function b(e) {
|
|
932
977
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
933
978
|
}
|
|
934
|
-
let x =
|
|
979
|
+
let x = me("(prefers-reduced-motion: reduce)"), S = null, C = 1;
|
|
935
980
|
Z(x, (e) => {
|
|
936
981
|
e && (h.dispose(), S?.());
|
|
937
982
|
});
|
|
@@ -949,7 +994,7 @@ var at = /* @__PURE__ */ I({
|
|
|
949
994
|
return;
|
|
950
995
|
}
|
|
951
996
|
let a = l.value, o = Number.parseFloat(n.style.getPropertyValue("--dock-t")), s = Number.parseFloat(i.style.getPropertyValue("--dock-t")), c = a === e && Number.isFinite(o) ? 1 - b(o) : 0, u = Number.isFinite(s) ? b(s) : 1;
|
|
952
|
-
a && a !== e && a !== t && y(a), l.value = t,
|
|
997
|
+
a && a !== e && a !== t && y(a), l.value = t, _(e, c), _(t, 1 - u), w(t, e), r.value?.setAttribute("data-crossfading", "");
|
|
953
998
|
let d = () => {
|
|
954
999
|
y(e), y(t), r.value?.removeAttribute("data-crossfading"), l.value = null, C = 1, S === d && (S = null);
|
|
955
1000
|
};
|
|
@@ -961,28 +1006,28 @@ var at = /* @__PURE__ */ I({
|
|
|
961
1006
|
C = 1 - c, h.playTo(0, 1, {
|
|
962
1007
|
inheritVelocityScale: f,
|
|
963
1008
|
onFrame: (n) => {
|
|
964
|
-
|
|
1009
|
+
_(e, b(c + (1 - c) * n)), _(t, b(1 - u * (1 - n)));
|
|
965
1010
|
},
|
|
966
1011
|
onSettle: d
|
|
967
1012
|
});
|
|
968
|
-
}),
|
|
1013
|
+
}), V(() => {
|
|
969
1014
|
h.dispose(), S = null;
|
|
970
|
-
}), t({ faces: a }), (e, t) => (
|
|
1015
|
+
}), t({ faces: a }), (e, t) => (G(), M("div", {
|
|
971
1016
|
ref_key: "rootEl",
|
|
972
1017
|
ref: r,
|
|
973
1018
|
class: "dock-crossfade",
|
|
974
1019
|
style: B(m.value)
|
|
975
|
-
}, [
|
|
1020
|
+
}, [J(e.$slots, "default")], 4));
|
|
976
1021
|
}
|
|
977
|
-
}),
|
|
1022
|
+
}), ct = ["data-motion"], lt = ["aria-orientation"], ut = [
|
|
978
1023
|
"id",
|
|
979
1024
|
"tabindex",
|
|
980
1025
|
"aria-controls",
|
|
981
1026
|
"aria-label",
|
|
982
1027
|
"onClick"
|
|
983
|
-
],
|
|
1028
|
+
], dt = { key: 1 }, ft = { key: 2 }, pt = /* @__PURE__ */ F({
|
|
984
1029
|
__name: "DockLayerGroup",
|
|
985
|
-
props: /*@__PURE__*/
|
|
1030
|
+
props: /*@__PURE__*/ I({
|
|
986
1031
|
orientation: {},
|
|
987
1032
|
showSwitcher: {
|
|
988
1033
|
type: Boolean,
|
|
@@ -996,8 +1041,8 @@ var at = /* @__PURE__ */ I({
|
|
|
996
1041
|
}),
|
|
997
1042
|
emits: ["update:active"],
|
|
998
1043
|
setup(e) {
|
|
999
|
-
let t = e, n = o(() => t.motion), r =
|
|
1000
|
-
options:
|
|
1044
|
+
let t = e, n = o(() => t.motion), r = ie(e, "active"), i = m(), a = k(() => t.orientation ?? i?.orientation.value ?? "horizontal"), s = X("crossfade"), c = k(() => s.value?.faces ?? []), l = k(() => a.value === "vertical" ? "horizontal" : "vertical"), u = k(() => l.value === "vertical"), d = q(null), f = q(null), h = q([]), g = S({
|
|
1045
|
+
options: k(() => c.value.map((e) => ({ value: e.id }))),
|
|
1001
1046
|
model: r,
|
|
1002
1047
|
mode: "single",
|
|
1003
1048
|
role: "tablist",
|
|
@@ -1005,13 +1050,13 @@ var at = /* @__PURE__ */ I({
|
|
|
1005
1050
|
containerRef: d,
|
|
1006
1051
|
indicatorRef: f,
|
|
1007
1052
|
buttonRefs: h
|
|
1008
|
-
}), _ =
|
|
1009
|
-
|
|
1053
|
+
}), _ = k(() => t.showSwitcher && c.value.length > 1), v = re(), y = (e) => e.replace(/[^a-zA-Z0-9_-]/g, ""), b = (e) => `dock-tab-${v}-${y(e)}`, x = (e) => `dock-panel-${v}-${y(e)}`;
|
|
1054
|
+
tt({
|
|
1010
1055
|
isTablist: _,
|
|
1011
1056
|
tabId: b,
|
|
1012
1057
|
panelId: x
|
|
1013
1058
|
});
|
|
1014
|
-
let w =
|
|
1059
|
+
let w = k(() => u.value ? "y" : "x");
|
|
1015
1060
|
function T() {
|
|
1016
1061
|
let e = d.value;
|
|
1017
1062
|
if (!e) return [];
|
|
@@ -1039,35 +1084,35 @@ var at = /* @__PURE__ */ I({
|
|
|
1039
1084
|
n.armed.value
|
|
1040
1085
|
], () => {
|
|
1041
1086
|
n.armed.value && R(() => E.refresh());
|
|
1042
|
-
}),
|
|
1087
|
+
}), H(() => {
|
|
1043
1088
|
n.armed.value && R(() => E.refresh());
|
|
1044
1089
|
});
|
|
1045
1090
|
function D(e) {
|
|
1046
1091
|
return typeof e == "object" && !!e || typeof e == "function";
|
|
1047
1092
|
}
|
|
1048
|
-
let
|
|
1093
|
+
let F = p(() => i);
|
|
1049
1094
|
function I() {
|
|
1050
|
-
|
|
1095
|
+
F.acquire();
|
|
1051
1096
|
}
|
|
1052
|
-
function
|
|
1097
|
+
function V(e) {
|
|
1053
1098
|
let t = e.relatedTarget, n = e.currentTarget;
|
|
1054
|
-
t && n?.contains(t) ||
|
|
1099
|
+
t && n?.contains(t) || F.release();
|
|
1055
1100
|
}
|
|
1056
|
-
return (t, i) => (
|
|
1101
|
+
return (t, i) => (G(), M("div", {
|
|
1057
1102
|
class: z(["dock-layer-group", [a.value, `switcher-${e.switcherPosition}`]]),
|
|
1058
|
-
"data-motion":
|
|
1059
|
-
style: B(
|
|
1060
|
-
}, [_.value ? (
|
|
1103
|
+
"data-motion": Y(n).dataMotion.value,
|
|
1104
|
+
style: B(Y(n).hostStyle.value)
|
|
1105
|
+
}, [_.value ? (G(), M("div", {
|
|
1061
1106
|
key: 0,
|
|
1062
1107
|
ref_key: "switcherListEl",
|
|
1063
1108
|
ref: d,
|
|
1064
1109
|
role: "tablist",
|
|
1065
|
-
class: z(["dock-layer-switcher", [e.switcherPosition,
|
|
1110
|
+
class: z(["dock-layer-switcher", [e.switcherPosition, Y(n).armed.value && "glass-drag-grabbable"]]),
|
|
1066
1111
|
"aria-orientation": l.value,
|
|
1067
|
-
onKeydown: i[0] ||= (...e) =>
|
|
1112
|
+
onKeydown: i[0] ||= (...e) => Y(g).onKeydown && Y(g).onKeydown(...e),
|
|
1068
1113
|
onFocusin: I,
|
|
1069
|
-
onFocusout:
|
|
1070
|
-
}, [(
|
|
1114
|
+
onFocusout: V
|
|
1115
|
+
}, [(G(!0), M(O, null, ee(c.value, (e, t) => (G(), M("button", L({
|
|
1071
1116
|
key: e.id,
|
|
1072
1117
|
ref_for: !0,
|
|
1073
1118
|
ref: (e) => {
|
|
@@ -1076,37 +1121,37 @@ var at = /* @__PURE__ */ I({
|
|
|
1076
1121
|
type: "button",
|
|
1077
1122
|
class: "dock-layer-tab",
|
|
1078
1123
|
id: b(e.id),
|
|
1079
|
-
tabindex:
|
|
1080
|
-
}, { ref_for: !0 },
|
|
1124
|
+
tabindex: Y(g).rovingTabindex(t)
|
|
1125
|
+
}, { ref_for: !0 }, Y(g).itemAttrs(e.id), {
|
|
1081
1126
|
"aria-controls": x(e.id),
|
|
1082
1127
|
"aria-label": e.label ?? e.id,
|
|
1083
|
-
onClick: (n) =>
|
|
1084
|
-
}), [D(e.icon) ? (
|
|
1128
|
+
onClick: (n) => Y(g).select(e.id, t)
|
|
1129
|
+
}), [D(e.icon) ? (G(), A(te(e.icon), {
|
|
1085
1130
|
key: 0,
|
|
1086
1131
|
class: "size-4"
|
|
1087
|
-
})) : typeof e.icon == "string" ? (
|
|
1132
|
+
})) : typeof e.icon == "string" ? (G(), M("span", dt, ne(e.icon), 1)) : (G(), M("span", ft, ne((e.label ?? e.id).charAt(0)), 1))], 16, ut))), 128)), N("div", {
|
|
1088
1133
|
ref_key: "switcherIndicatorEl",
|
|
1089
1134
|
ref: f,
|
|
1090
|
-
class: z(["dock-layer-tab-indicator",
|
|
1091
|
-
style: B(
|
|
1135
|
+
class: z(["dock-layer-tab-indicator", Y(n).armed.value && Y(E).dragging.value && "glass-drag-lift"]),
|
|
1136
|
+
style: B(Y(g).singleSliderStyle.value),
|
|
1092
1137
|
"aria-hidden": "true"
|
|
1093
|
-
}, null, 6)], 42,
|
|
1138
|
+
}, null, 6)], 42, lt)) : j("", !0), P(st, {
|
|
1094
1139
|
ref_key: "crossfade",
|
|
1095
1140
|
ref: s,
|
|
1096
1141
|
active: r.value
|
|
1097
1142
|
}, {
|
|
1098
|
-
default: Q(() => [
|
|
1143
|
+
default: Q(() => [J(t.$slots, "default")]),
|
|
1099
1144
|
_: 3
|
|
1100
|
-
}, 8, ["active"])], 14,
|
|
1145
|
+
}, 8, ["active"])], 14, ct));
|
|
1101
1146
|
}
|
|
1102
|
-
}),
|
|
1147
|
+
}), mt = [
|
|
1103
1148
|
"role",
|
|
1104
1149
|
"id",
|
|
1105
1150
|
"aria-labelledby",
|
|
1106
1151
|
"inert",
|
|
1107
1152
|
"aria-hidden",
|
|
1108
1153
|
"tabindex"
|
|
1109
|
-
],
|
|
1154
|
+
], ht = { class: "dock-face-content" }, gt = /* @__PURE__ */ F({
|
|
1110
1155
|
__name: "DockLayer",
|
|
1111
1156
|
props: {
|
|
1112
1157
|
id: {},
|
|
@@ -1114,8 +1159,8 @@ var at = /* @__PURE__ */ I({
|
|
|
1114
1159
|
icon: {}
|
|
1115
1160
|
},
|
|
1116
1161
|
setup(e) {
|
|
1117
|
-
let t = e, n =
|
|
1118
|
-
|
|
1162
|
+
let t = e, n = ot(), r = X("hostEl");
|
|
1163
|
+
H(() => {
|
|
1119
1164
|
r.value && n.register({
|
|
1120
1165
|
id: t.id,
|
|
1121
1166
|
label: t.label,
|
|
@@ -1133,9 +1178,9 @@ var at = /* @__PURE__ */ I({
|
|
|
1133
1178
|
icon: t.icon,
|
|
1134
1179
|
el: r.value
|
|
1135
1180
|
});
|
|
1136
|
-
}),
|
|
1137
|
-
let i =
|
|
1138
|
-
return (e, t) => (
|
|
1181
|
+
}), V(() => n.unregister(t.id));
|
|
1182
|
+
let i = k(() => n.activeId.value === t.id), a = k(() => n.leavingId.value === t.id), o = nt(), s = k(() => o?.isTablist.value ?? !1), c = k(() => s.value ? o.panelId(t.id) : void 0), l = k(() => s.value ? o.tabId(t.id) : void 0);
|
|
1183
|
+
return (e, t) => (G(), M("div", {
|
|
1139
1184
|
ref_key: "hostEl",
|
|
1140
1185
|
ref: r,
|
|
1141
1186
|
class: z(["dock-face", {
|
|
@@ -1148,9 +1193,9 @@ var at = /* @__PURE__ */ I({
|
|
|
1148
1193
|
inert: !i.value || void 0,
|
|
1149
1194
|
"aria-hidden": !i.value || void 0,
|
|
1150
1195
|
tabindex: i.value ? -1 : void 0
|
|
1151
|
-
}, [
|
|
1196
|
+
}, [N("div", ht, [J(e.$slots, "default")])], 10, mt));
|
|
1152
1197
|
}
|
|
1153
|
-
}),
|
|
1198
|
+
}), _t = /* @__PURE__ */ F({
|
|
1154
1199
|
__name: "DockControl",
|
|
1155
1200
|
props: {
|
|
1156
1201
|
shape: { default: "icon" },
|
|
@@ -1181,13 +1226,13 @@ var at = /* @__PURE__ */ I({
|
|
|
1181
1226
|
] }
|
|
1182
1227
|
},
|
|
1183
1228
|
setup(t) {
|
|
1184
|
-
let r = t, o =
|
|
1229
|
+
let r = t, o = k(() => r.shape === "tab"), s = k(() => o.value ? e("dock-tab-button glass-specular-track", r.class) : e("dock-icon-button glass-specular-track glass-capsule-hover", { "glass-capsule": r.active }, { "dock-icon-button--compact": r.compact }, r.class)), c = k(() => ({
|
|
1185
1230
|
...r.active === void 0 ? {} : {
|
|
1186
1231
|
"aria-pressed": String(r.active),
|
|
1187
1232
|
...r.active ? { "data-active": "" } : {}
|
|
1188
1233
|
},
|
|
1189
1234
|
...r.disabled ? { "aria-disabled": "true" } : {}
|
|
1190
|
-
})), l =
|
|
1235
|
+
})), l = k(() => !r.asChild && r.as === "button" ? { type: r.type } : {}), u = i("press"), d = a({
|
|
1191
1236
|
disabled: () => r.disabled || o.value,
|
|
1192
1237
|
squish: !0,
|
|
1193
1238
|
response: u.response,
|
|
@@ -1195,11 +1240,11 @@ var at = /* @__PURE__ */ I({
|
|
|
1195
1240
|
pressVar: "--dock-press-t",
|
|
1196
1241
|
shrinkDepth: .04,
|
|
1197
1242
|
maxStretch: 1.03
|
|
1198
|
-
}), f =
|
|
1243
|
+
}), f = k(() => o.value ? {} : { ...d.pressStyle.value });
|
|
1199
1244
|
function p(e) {
|
|
1200
1245
|
r.disabled && (e.preventDefault(), e.stopImmediatePropagation());
|
|
1201
1246
|
}
|
|
1202
|
-
return (e, r) =>
|
|
1247
|
+
return (e, r) => $((G(), A(Y(se), L({
|
|
1203
1248
|
as: t.as,
|
|
1204
1249
|
"as-child": t.asChild
|
|
1205
1250
|
}, {
|
|
@@ -1208,18 +1253,18 @@ var at = /* @__PURE__ */ I({
|
|
|
1208
1253
|
}, {
|
|
1209
1254
|
class: s.value,
|
|
1210
1255
|
style: f.value,
|
|
1211
|
-
"data-press-armed": !o.value &&
|
|
1212
|
-
onPointerdown:
|
|
1213
|
-
onPointerup:
|
|
1214
|
-
onPointercancel:
|
|
1215
|
-
onPointerleave:
|
|
1216
|
-
onPointerenter:
|
|
1217
|
-
onKeydown:
|
|
1218
|
-
onKeyup:
|
|
1219
|
-
onBlur:
|
|
1256
|
+
"data-press-armed": !o.value && Y(d).armed ? "" : void 0,
|
|
1257
|
+
onPointerdown: Y(d).handlers.onPointerdown,
|
|
1258
|
+
onPointerup: Y(d).handlers.onPointerup,
|
|
1259
|
+
onPointercancel: Y(d).handlers.onPointercancel,
|
|
1260
|
+
onPointerleave: Y(d).handlers.onPointerleave,
|
|
1261
|
+
onPointerenter: Y(d).handlers.onPointerenter,
|
|
1262
|
+
onKeydown: Y(d).handlers.onKeydown,
|
|
1263
|
+
onKeyup: Y(d).handlers.onKeyup,
|
|
1264
|
+
onBlur: Y(d).handlers.onBlur,
|
|
1220
1265
|
onClickCapture: p
|
|
1221
1266
|
}), {
|
|
1222
|
-
default: Q(() => [
|
|
1267
|
+
default: Q(() => [J(e.$slots, "default")]),
|
|
1223
1268
|
_: 3
|
|
1224
1269
|
}, 16, [
|
|
1225
1270
|
"as",
|
|
@@ -1235,9 +1280,9 @@ var at = /* @__PURE__ */ I({
|
|
|
1235
1280
|
"onKeydown",
|
|
1236
1281
|
"onKeyup",
|
|
1237
1282
|
"onBlur"
|
|
1238
|
-
])), [[
|
|
1283
|
+
])), [[Y(n)]]);
|
|
1239
1284
|
}
|
|
1240
|
-
}),
|
|
1285
|
+
}), vt = /* @__PURE__ */ F({
|
|
1241
1286
|
inheritAttrs: !1,
|
|
1242
1287
|
__name: "DockTrigger",
|
|
1243
1288
|
props: {
|
|
@@ -1251,28 +1296,28 @@ var at = /* @__PURE__ */ I({
|
|
|
1251
1296
|
] }
|
|
1252
1297
|
},
|
|
1253
1298
|
setup(t) {
|
|
1254
|
-
let r = t, i =
|
|
1255
|
-
return (e, t) => r.for === "select" ?
|
|
1256
|
-
default: Q(() => [
|
|
1257
|
-
default: Q(() => [
|
|
1299
|
+
let r = t, i = k(() => e("dock-trigger", r.for === "select" && "dock-select-trigger", r.for !== "select" && "dock-dropdown-trigger", r.class));
|
|
1300
|
+
return (e, t) => r.for === "select" ? $((G(), A(Y(le), L({ key: 0 }, e.$attrs, { class: i.value }), {
|
|
1301
|
+
default: Q(() => [J(e.$slots, "default"), P(Y(ce), { "as-child": "" }, {
|
|
1302
|
+
default: Q(() => [J(e.$slots, "icon", {}, () => [P(Y(ue), {
|
|
1258
1303
|
class: "dock-select-trigger__chevron",
|
|
1259
1304
|
"aria-hidden": "true"
|
|
1260
1305
|
})])]),
|
|
1261
1306
|
_: 3
|
|
1262
1307
|
})]),
|
|
1263
1308
|
_: 3
|
|
1264
|
-
}, 16, ["class"])), [[
|
|
1309
|
+
}, 16, ["class"])), [[Y(n)]]) : r.for === "dropdown" ? $((G(), A(x, L({ key: 1 }, e.$attrs, {
|
|
1265
1310
|
action: "pointerdown",
|
|
1266
1311
|
class: i.value
|
|
1267
1312
|
}), {
|
|
1268
|
-
default: Q(() => [
|
|
1313
|
+
default: Q(() => [J(e.$slots, "default")]),
|
|
1269
1314
|
_: 3
|
|
1270
|
-
}, 16, ["class"])), [[
|
|
1271
|
-
default: Q(() => [
|
|
1315
|
+
}, 16, ["class"])), [[Y(n)]]) : $((G(), A(Y(oe), L({ key: 2 }, e.$attrs, { class: i.value }), {
|
|
1316
|
+
default: Q(() => [J(e.$slots, "default")]),
|
|
1272
1317
|
_: 3
|
|
1273
|
-
}, 16, ["class"])), [[
|
|
1318
|
+
}, 16, ["class"])), [[Y(n)]]);
|
|
1274
1319
|
}
|
|
1275
|
-
}),
|
|
1320
|
+
}), yt = /* @__PURE__ */ F({
|
|
1276
1321
|
__name: "DockBackgroundToggle",
|
|
1277
1322
|
props: {
|
|
1278
1323
|
paused: {
|
|
@@ -1284,22 +1329,22 @@ var at = /* @__PURE__ */ I({
|
|
|
1284
1329
|
},
|
|
1285
1330
|
emits: ["update:paused"],
|
|
1286
1331
|
setup(e, { emit: t }) {
|
|
1287
|
-
let n = e, r = t, i =
|
|
1332
|
+
let n = e, r = t, i = k(() => n.paused ? n.playLabel : n.pauseLabel);
|
|
1288
1333
|
function a() {
|
|
1289
1334
|
r("update:paused", !n.paused);
|
|
1290
1335
|
}
|
|
1291
|
-
return (t, n) => (
|
|
1336
|
+
return (t, n) => (G(), A(_t, {
|
|
1292
1337
|
type: "button",
|
|
1293
1338
|
active: e.paused,
|
|
1294
1339
|
"aria-pressed": e.paused,
|
|
1295
1340
|
"aria-label": i.value,
|
|
1296
1341
|
onClick: a
|
|
1297
1342
|
}, {
|
|
1298
|
-
default: Q(() => [e.paused ? (
|
|
1343
|
+
default: Q(() => [e.paused ? (G(), A(Y(fe), {
|
|
1299
1344
|
key: 0,
|
|
1300
1345
|
size: 18,
|
|
1301
1346
|
"aria-hidden": "true"
|
|
1302
|
-
})) : (
|
|
1347
|
+
})) : (G(), A(Y(de), {
|
|
1303
1348
|
key: 1,
|
|
1304
1349
|
size: 18,
|
|
1305
1350
|
"aria-hidden": "true"
|
|
@@ -1311,36 +1356,213 @@ var at = /* @__PURE__ */ I({
|
|
|
1311
1356
|
"aria-label"
|
|
1312
1357
|
]));
|
|
1313
1358
|
}
|
|
1314
|
-
}),
|
|
1359
|
+
}), bt = [
|
|
1315
1360
|
"data-orientation",
|
|
1316
1361
|
"data-dock-hairline",
|
|
1317
1362
|
"aria-orientation"
|
|
1318
|
-
],
|
|
1363
|
+
], xt = /* @__PURE__ */ F({
|
|
1319
1364
|
__name: "DockSeparator",
|
|
1320
1365
|
props: { anchor: {
|
|
1321
1366
|
type: Boolean,
|
|
1322
1367
|
default: !1
|
|
1323
1368
|
} },
|
|
1324
1369
|
setup(e) {
|
|
1325
|
-
let t = m(), n =
|
|
1326
|
-
return (t, n) => (
|
|
1370
|
+
let t = m(), n = k(() => t?.orientation.value ?? "horizontal"), r = k(() => n.value), i = k(() => n.value === "vertical" ? "horizontal" : "vertical");
|
|
1371
|
+
return (t, n) => (G(), M("div", {
|
|
1327
1372
|
class: z(["dock-separator", { "dock-hairline": e.anchor }]),
|
|
1328
1373
|
role: "separator",
|
|
1329
1374
|
"data-orientation": r.value,
|
|
1330
1375
|
"data-dock-hairline": e.anchor || void 0,
|
|
1331
1376
|
"aria-orientation": i.value
|
|
1332
|
-
}, null, 10,
|
|
1377
|
+
}, null, 10, bt));
|
|
1333
1378
|
}
|
|
1334
1379
|
});
|
|
1335
1380
|
//#endregion
|
|
1381
|
+
//#region src/composables/search/match.ts
|
|
1382
|
+
function St(e, t) {
|
|
1383
|
+
let n = e.length, r = t.length;
|
|
1384
|
+
if (n === 0) return {
|
|
1385
|
+
score: 0,
|
|
1386
|
+
matches: []
|
|
1387
|
+
};
|
|
1388
|
+
if (n > r) return null;
|
|
1389
|
+
let i = [], a = 0, o = 0, s = -2;
|
|
1390
|
+
for (let c = 0; c < r && a < n; c++) {
|
|
1391
|
+
if (e[a] !== t[c]) continue;
|
|
1392
|
+
i.push(c);
|
|
1393
|
+
let n = 1;
|
|
1394
|
+
if (s === c - 1 && (n += 5), c === 0) n += 8;
|
|
1395
|
+
else {
|
|
1396
|
+
let e = t[c - 1];
|
|
1397
|
+
" -_./\\:()".includes(e) ? n += 7 : t[c] >= "A" && t[c] <= "Z" && e >= "a" && e <= "z" && (n += 6);
|
|
1398
|
+
}
|
|
1399
|
+
a === c && (n += 3), o += n, s = c, a++;
|
|
1400
|
+
}
|
|
1401
|
+
return a < n ? null : (o -= Math.max(0, (r - n) * .1), {
|
|
1402
|
+
score: o,
|
|
1403
|
+
matches: i
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1406
|
+
function Ct(e, t) {
|
|
1407
|
+
if (!t) return null;
|
|
1408
|
+
let n = 0, r = [];
|
|
1409
|
+
for (let i of e) {
|
|
1410
|
+
let e = St(i, t);
|
|
1411
|
+
if (!e) return null;
|
|
1412
|
+
n += e.score;
|
|
1413
|
+
for (let t of e.matches) r.push(t);
|
|
1414
|
+
}
|
|
1415
|
+
return {
|
|
1416
|
+
score: n,
|
|
1417
|
+
matches: r
|
|
1418
|
+
};
|
|
1419
|
+
}
|
|
1420
|
+
function wt(e, t) {
|
|
1421
|
+
let n = null, r = [], i = [
|
|
1422
|
+
[t._lc.label, 12],
|
|
1423
|
+
[t._lc.type, 10],
|
|
1424
|
+
[t._lc.text, 3]
|
|
1425
|
+
];
|
|
1426
|
+
for (let [a, o] of i) {
|
|
1427
|
+
if (!a) continue;
|
|
1428
|
+
let i = Ct(e, a);
|
|
1429
|
+
if (!i) continue;
|
|
1430
|
+
let s = i.score * o;
|
|
1431
|
+
(n === null || s > n) && (n = s, r = a === t._lc.label ? i.matches : []);
|
|
1432
|
+
}
|
|
1433
|
+
return n === null ? null : {
|
|
1434
|
+
score: n,
|
|
1435
|
+
matches: r
|
|
1436
|
+
};
|
|
1437
|
+
}
|
|
1438
|
+
function Tt(e) {
|
|
1439
|
+
return e.map((e) => ({
|
|
1440
|
+
item: e,
|
|
1441
|
+
_lc: {
|
|
1442
|
+
label: e.label.toLowerCase(),
|
|
1443
|
+
text: e.text.toLowerCase(),
|
|
1444
|
+
type: e.type?.toLowerCase() ?? ""
|
|
1445
|
+
}
|
|
1446
|
+
}));
|
|
1447
|
+
}
|
|
1448
|
+
var Et = /* @__PURE__ */ new WeakMap();
|
|
1449
|
+
function Dt(e) {
|
|
1450
|
+
let t = Et.get(e);
|
|
1451
|
+
return t || (t = /* @__PURE__ */ new Map(), Et.set(e, t)), t;
|
|
1452
|
+
}
|
|
1453
|
+
function Ot(e, t, n = 30) {
|
|
1454
|
+
let r = t.toLowerCase().trim();
|
|
1455
|
+
if (!r) return [];
|
|
1456
|
+
let i = Dt(e), a = i.get(r);
|
|
1457
|
+
if (a) return a.slice(0, n);
|
|
1458
|
+
i.size > 200 && i.clear();
|
|
1459
|
+
let o = r.split(/\s+/).filter(Boolean);
|
|
1460
|
+
if (o.length === 0) return [];
|
|
1461
|
+
let s = e;
|
|
1462
|
+
if (r.length > 1) {
|
|
1463
|
+
let e = r.slice(0, -1), t = i.get(e);
|
|
1464
|
+
t && (s = t.map((e) => ({
|
|
1465
|
+
item: e.item,
|
|
1466
|
+
_lc: {
|
|
1467
|
+
label: e.item.label.toLowerCase(),
|
|
1468
|
+
text: e.item.text.toLowerCase(),
|
|
1469
|
+
type: e.item.type?.toLowerCase() ?? ""
|
|
1470
|
+
}
|
|
1471
|
+
})));
|
|
1472
|
+
}
|
|
1473
|
+
let c = [];
|
|
1474
|
+
for (let e of s) {
|
|
1475
|
+
let t = wt(o, e);
|
|
1476
|
+
t && c.push({
|
|
1477
|
+
item: e.item,
|
|
1478
|
+
score: t.score,
|
|
1479
|
+
matchIndices: t.matches
|
|
1480
|
+
});
|
|
1481
|
+
}
|
|
1482
|
+
return c.sort((e, t) => t.score - e.score), i.set(r, c), c.slice(0, n);
|
|
1483
|
+
}
|
|
1484
|
+
function kt(e) {
|
|
1485
|
+
if (e) {
|
|
1486
|
+
Et.delete(e);
|
|
1487
|
+
return;
|
|
1488
|
+
}
|
|
1489
|
+
Et = /* @__PURE__ */ new WeakMap();
|
|
1490
|
+
}
|
|
1491
|
+
//#endregion
|
|
1492
|
+
//#region src/composables/search/useFuzzySearch.ts
|
|
1493
|
+
function At(e) {
|
|
1494
|
+
let t = typeof e.items == "function" ? e.items : () => e.items, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i = q(""), a = q(!1), o = q(!1), s = q(0), c = q(""), l = k(() => t()), u = k(() => Tt(l.value)), d;
|
|
1495
|
+
function f(e = d) {
|
|
1496
|
+
e !== void 0 && (clearTimeout(e), d === e && (d = void 0));
|
|
1497
|
+
}
|
|
1498
|
+
Z(i, (e, t, r) => {
|
|
1499
|
+
if (f(), !e || n <= 0) {
|
|
1500
|
+
c.value = e;
|
|
1501
|
+
return;
|
|
1502
|
+
}
|
|
1503
|
+
let i = setTimeout(() => {
|
|
1504
|
+
d === i && (c.value = e, d = void 0);
|
|
1505
|
+
}, n);
|
|
1506
|
+
d = i, r(() => f(i));
|
|
1507
|
+
}), Z(l, () => {
|
|
1508
|
+
f(), c.value = i.value, s.value = 0;
|
|
1509
|
+
}, { deep: !0 });
|
|
1510
|
+
let p = k(() => Ot(u.value, c.value, r));
|
|
1511
|
+
Z(p, () => {
|
|
1512
|
+
s.value = 0;
|
|
1513
|
+
});
|
|
1514
|
+
function m(t) {
|
|
1515
|
+
e.onSelect?.(t), h();
|
|
1516
|
+
}
|
|
1517
|
+
function h() {
|
|
1518
|
+
a.value = !1, o.value = !1, f(), i.value = "", c.value = "", s.value = 0, kt(u.value);
|
|
1519
|
+
}
|
|
1520
|
+
function g() {
|
|
1521
|
+
a.value = !0;
|
|
1522
|
+
}
|
|
1523
|
+
function _() {
|
|
1524
|
+
o.value = !o.value;
|
|
1525
|
+
}
|
|
1526
|
+
function v(e) {
|
|
1527
|
+
switch (e.key) {
|
|
1528
|
+
case "ArrowDown":
|
|
1529
|
+
e.preventDefault(), s.value < p.value.length - 1 && s.value++;
|
|
1530
|
+
break;
|
|
1531
|
+
case "ArrowUp":
|
|
1532
|
+
e.preventDefault(), s.value > 0 && s.value--;
|
|
1533
|
+
break;
|
|
1534
|
+
case "Enter":
|
|
1535
|
+
e.preventDefault(), p.value[s.value] && m(p.value[s.value]);
|
|
1536
|
+
break;
|
|
1537
|
+
case "Escape":
|
|
1538
|
+
e.preventDefault(), o.value ? o.value = !1 : h();
|
|
1539
|
+
break;
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
return U(() => {
|
|
1543
|
+
f(), kt(u.value);
|
|
1544
|
+
}, !0), {
|
|
1545
|
+
query: i,
|
|
1546
|
+
results: p,
|
|
1547
|
+
isOpen: a,
|
|
1548
|
+
isExpanded: o,
|
|
1549
|
+
selectedIndex: s,
|
|
1550
|
+
selectResult: m,
|
|
1551
|
+
close: h,
|
|
1552
|
+
open: g,
|
|
1553
|
+
toggleExpanded: _,
|
|
1554
|
+
onKeydown: v
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1557
|
+
//#endregion
|
|
1336
1558
|
//#region src/components/dock/composables/useDockSearch.ts
|
|
1337
|
-
function
|
|
1338
|
-
let { dockState: t } = e, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i =
|
|
1559
|
+
function jt(e) {
|
|
1560
|
+
let { dockState: t } = e, n = e.debounceMs ?? 120, r = e.maxResults ?? 30, i = q([]), a = null, o = e.items ? e.items : () => i.value;
|
|
1339
1561
|
function s(t) {
|
|
1340
1562
|
let n = t.item.id;
|
|
1341
1563
|
e.ensureTargetWindow?.(n), e.scrollTo?.(n), e.onResultSelect?.(t);
|
|
1342
1564
|
}
|
|
1343
|
-
let c =
|
|
1565
|
+
let c = At({
|
|
1344
1566
|
items: o,
|
|
1345
1567
|
debounceMs: n,
|
|
1346
1568
|
maxResults: r,
|
|
@@ -1361,7 +1583,7 @@ function bt(e) {
|
|
|
1361
1583
|
});
|
|
1362
1584
|
});
|
|
1363
1585
|
}
|
|
1364
|
-
let l =
|
|
1586
|
+
let l = k(() => {
|
|
1365
1587
|
let e = c.query.value;
|
|
1366
1588
|
if (!e) return "";
|
|
1367
1589
|
let t = c.results.value[0];
|
|
@@ -1384,7 +1606,7 @@ function bt(e) {
|
|
|
1384
1606
|
return e.collapseOnScroll && e.scrollContainer && (g = E(e.scrollContainer, {
|
|
1385
1607
|
collapseOnScroll: !0,
|
|
1386
1608
|
chromeRef: e.chromeRef
|
|
1387
|
-
})),
|
|
1609
|
+
})), U(() => {
|
|
1388
1610
|
a?.abort(), a = null;
|
|
1389
1611
|
}), {
|
|
1390
1612
|
fuzzy: c,
|
|
@@ -1397,4 +1619,4 @@ function bt(e) {
|
|
|
1397
1619
|
};
|
|
1398
1620
|
}
|
|
1399
1621
|
//#endregion
|
|
1400
|
-
export { h as DOCK_CONTEXT_KEY,
|
|
1622
|
+
export { h as DOCK_CONTEXT_KEY, yt as DockBackgroundToggle, _t as DockControl, st as DockCrossfade, gt as DockLayer, pt as DockLayerGroup, xt as DockSeparator, vt as DockTrigger, Qe as GlassDock, d as provideDockContext, l as useDockContext, w as useDockCtaReceive, jt as useDockSearch, m as useOptionalDockContext };
|