@mkbabb/glass-ui 3.9.0 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CardAction-DuArVky-.js → CardAction-DrAcAV4d.js} +2 -2
- package/dist/{CommandShortcut-CefCj5mt.js → CommandShortcut-mV2e1aG6.js} +2 -2
- package/dist/{DataTable-CUHMukiQ.js → DataTable-C3E6jZ5B.js} +2 -2
- package/dist/{DialogContent-BRkT1cjP.js → DialogContent-BxaaafFi.js} +1 -1
- package/dist/{HoverPopover-2LOIW34a.js → HoverPopover-CDA_SaCe.js} +1 -1
- package/dist/{MetricBadge-lTc002u2.js → MetricBadge-idgrkqoP.js} +1 -1
- package/dist/{Notification-BxK8LZMw.js → Notification-Cu0nN17_.js} +3 -3
- package/dist/{NumberFieldContent-BbLOh8RU.js → NumberFieldContent-CHEWghnY.js} +2 -2
- package/dist/{PopoverContent-BId6ggf_.js → PopoverContent-DpUvdYY-.js} +1 -1
- package/dist/{Progress-iEuD9pxG.js → Progress-BW-StFw2.js} +1 -1
- package/dist/{ScrollingText-BPP84wKo.js → ScrollingText-DruYCni_.js} +1 -1
- package/dist/{SelectScrollDownButton-T32cVFeM.js → SelectScrollDownButton-pirzjm--.js} +3 -3
- package/dist/{Switch-LDKLmmgx.js → Switch-DeAqg6pi.js} +1 -1
- package/dist/{TabsList-B8CVOQPC.js → TabsList-BAVzOZpg.js} +2 -2
- package/dist/{Toaster-1rYWrmAm.js → Toaster-CvuuW_y9.js} +49 -46
- package/dist/{ToggleGroupItem-Cev4pOVK.js → ToggleGroupItem-DtD37b4G.js} +4 -4
- package/dist/animated-digit.js +2 -2
- package/dist/api/index.d.ts +4 -4
- package/dist/api.js +1 -1
- package/dist/aurora.js +238 -547
- package/dist/{badge-BvwvT50i.js → badge-NdCQMvvB.js} +2 -2
- package/dist/badge.js +1 -1
- package/dist/{button-DN39cGqL.js → button-DyiWFAOE.js} +12 -12
- package/dist/button.js +1 -1
- package/dist/canvas.js +2 -2
- package/dist/card.js +1 -1
- package/dist/carousel.js +5 -5
- package/dist/collapsible.js +1 -1
- package/dist/{color-8jBjWiJ6.js → color-B65wWyQz.js} +9 -7
- package/dist/color.js +1 -1
- package/dist/command.js +1 -1
- package/dist/{compile-DAjIoEy2.js → compile-Ce_V55zi.js} +23 -23
- package/dist/components/custom/aurora/composables/atoms.d.ts +21 -4
- package/dist/components/custom/aurora/composables/runtime.d.ts +0 -9
- package/dist/components/custom/aurora/composables/uniformBridge.d.ts +0 -11
- package/dist/components/custom/aurora/constants/renderMode.d.ts +0 -32
- package/dist/components/custom/aurora/constants/shaders/brush.glsl.d.ts +1 -1
- package/dist/components/custom/aurora/constants/shaders/mediums.glsl.d.ts +2 -2
- package/dist/components/custom/aurora/constants/shaders/tonemap.glsl.d.ts +1 -1
- package/dist/components/custom/aurora/constants/shaders/vangogh-medium.glsl.d.ts +1 -0
- package/dist/components/custom/aurora/index.d.ts +1 -1
- package/dist/components/custom/constellation/Constellation.vue.d.ts +85 -1
- package/dist/components/custom/constellation/composables/createConstellationField.d.ts +35 -0
- package/dist/components/custom/constellation/composables/useConstellationPointer.d.ts +35 -0
- package/dist/components/custom/constellation/constants.d.ts +36 -0
- package/dist/components/custom/constellation/constellationDraw.d.ts +18 -0
- package/dist/components/custom/constellation/constellationField.d.ts +174 -63
- package/dist/components/custom/constellation/constellationInteraction.d.ts +102 -0
- package/dist/components/custom/constellation/index.d.ts +4 -2
- package/dist/components/custom/controls/DarkModeToggle.vue.d.ts +11 -0
- package/dist/components/custom/dock/GlassDock.vue.d.ts +2 -110
- package/dist/components/custom/dock/composables/dockMorphContext.d.ts +36 -0
- package/dist/components/custom/dock/composables/useDockMorphWindow.d.ts +15 -0
- package/dist/components/custom/dock/composables/useDockShellProps.d.ts +131 -0
- package/dist/components/custom/dock/composables/useLayerTransition.d.ts +44 -0
- package/dist/components/custom/dock/constants.d.ts +23 -0
- package/dist/components/custom/fourier-field/FourierField.vue.d.ts +6 -0
- package/dist/components/custom/fourier-field/index.d.ts +25 -1
- package/dist/components/custom/fourier-field/math.d.ts +20 -8
- package/dist/components/custom/fourier-field/presets.d.ts +54 -0
- package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +8 -10
- package/dist/components/custom/goo-blob/composables/buildMetaballProgram.d.ts +18 -0
- package/dist/components/custom/goo-blob/composables/uploadBlobUniforms.d.ts +41 -0
- package/dist/components/custom/goo-blob/composables/useBlobPointer.d.ts +4 -3
- package/dist/components/custom/goo-blob/composables/useMetaballRenderer.d.ts +16 -21
- package/dist/components/custom/goo-blob/constants.d.ts +52 -0
- package/dist/components/custom/goo-blob/index.d.ts +1 -1
- package/dist/components/custom/goo-blob/shaders/metaball-uniforms.glsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/types.d.ts +59 -25
- package/dist/components/custom/instrument-chassis/InstrumentChassis.vue.d.ts +2 -2
- package/dist/components/custom/tabs/constants.d.ts +12 -0
- package/dist/components/custom/underline/GlassUnderline.vue.d.ts +84 -0
- package/dist/components/custom/underline/index.d.ts +2 -0
- package/dist/components/custom/underline/types.d.ts +56 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts +1 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +2 -2
- package/dist/components/ui/slider/index.d.ts +25 -18
- package/dist/components/ui/toast/use-toast.d.ts +2 -2
- package/dist/composables/color/index.d.ts +24 -7
- package/dist/composables/glass/useSpecularTracking.d.ts +12 -3
- package/dist/composables/glass/webgl/shaders/procedural-color.glsl.d.ts +1 -6
- package/dist/composables/motion/curves.d.ts +48 -0
- package/dist/composables/motion/index.d.ts +2 -0
- package/dist/composables/motion/springPresets.d.ts +33 -0
- package/dist/composables/motion/suite.d.ts +2 -0
- package/dist/composables/motion/useSpringMount.d.ts +1 -1
- package/dist/configurator.js +1 -1
- package/dist/confirm-dialog.js +2 -2
- package/dist/constellation.js +322 -147
- package/dist/controls.js +48 -14
- package/dist/dark.js +1 -1
- package/dist/data-table.js +1 -1
- package/dist/dialog.js +2 -2
- package/dist/dock.js +340 -327
- package/dist/dockContext-bho8B1A4.js +17 -0
- package/dist/{dropdown-menu-D77jX6Df.js → dropdown-menu-DVnQcA0E.js} +7 -4
- package/dist/dropdown-menu.js +1 -1
- package/dist/expandable-container.js +1 -1
- package/dist/forms.js +2 -2
- package/dist/fourier-field.js +147 -120
- package/dist/fourier-math.d.ts +1 -0
- package/dist/fourier-math.js +2 -0
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +286 -207
- package/dist/goo-blob.js +368 -322
- package/dist/hover-popover.js +1 -1
- package/dist/icon-tooltip.js +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/keyboard.js +1 -1
- package/dist/labeled-field.js +5 -5
- package/dist/math-BUU9hHID.js +43 -0
- package/dist/metric-badge.js +1 -1
- package/dist/metric-stack.js +2 -2
- package/dist/motion-core.js +4 -4
- package/dist/motion-curves.d.ts +1 -0
- package/dist/motion-curves.js +130 -0
- package/dist/motion.js +38 -37
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/progress.js +1 -1
- package/dist/pulse.js +1 -1
- package/dist/reactive.js +1 -1
- package/dist/scrolling-text.js +1 -1
- package/dist/search.js +6 -6
- package/dist/select.js +1 -1
- package/dist/{sheet-VZEtNFvO.js → sheet-ChSXcJpU.js} +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-DC2mwuoe.js → slider-sfl8gFDD.js} +8 -8
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +2 -2
- package/dist/springPresets-aRSm-4_k.js +40 -0
- package/dist/stacked-icons.js +6 -6
- package/dist/styles/cards.css +2 -2
- package/dist/styles/components.css +1 -1
- package/dist/styles/dock/layer-group.css +38 -4
- package/dist/styles/dock/layers.css +11 -1
- package/dist/styles/dock/morph.css +95 -19
- package/dist/styles/dock/shell.css +12 -0
- package/dist/styles/dock-controls.css +25 -12
- package/dist/styles/drawer.css +14 -4
- package/dist/styles/floating-panel.css +2 -0
- package/dist/styles/glass/a11y-fallback.css +245 -0
- package/dist/styles/glass/ladder.css +304 -0
- package/dist/styles/glass/material.css +238 -0
- package/dist/styles/glass/progress-rail.css +78 -0
- package/dist/styles/glass/squircle.css +66 -0
- package/dist/styles/glass/surfaces.css +306 -0
- package/dist/styles/glass-refract.css +2 -0
- package/dist/styles/glass.css +31 -1052
- package/dist/styles/hover-popover.css +2 -0
- package/dist/styles/index.css +24 -6
- package/dist/styles/instrument-chassis.css +4 -0
- package/dist/styles/theme.css +14 -14
- package/dist/styles/tokens/color-radius.css +250 -0
- package/dist/styles/tokens/dark-arm.css +194 -0
- package/dist/styles/tokens/glass.css +413 -0
- package/dist/styles/tokens/light-dark.css +158 -0
- package/dist/styles/tokens/offsets-sizing.css +406 -0
- package/dist/styles/tokens/property-regs.css +169 -0
- package/dist/styles/tokens/scale-paper.css +361 -0
- package/dist/styles/tokens/scheme-motion.css +334 -0
- package/dist/styles/tokens/shadow.css +132 -0
- package/dist/styles/tokens.css +22 -2269
- package/dist/styles/transitions.css +20 -2
- package/dist/styles/typography.css +18 -6
- package/dist/styles/utilities/a11y-overrides.css +140 -0
- package/dist/styles/utilities/animate.css +26 -0
- package/dist/styles/utilities/base.css +365 -0
- package/dist/styles/utilities/btn.css +399 -0
- package/dist/styles/utilities/components.css +317 -0
- package/dist/styles/utilities.css +19 -1170
- package/dist/switch.js +1 -1
- package/dist/tabs.js +98 -98
- package/dist/timeline.js +2 -2
- package/dist/toast.js +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/underline.d.ts +1 -0
- package/dist/underline.js +85 -0
- package/dist/{useAnimatedNumber-C5I3wWd8.js → useAnimatedNumber-DfVgP4te.js} +1 -1
- package/dist/{useConfiguratorState-DxAqksK6.js → useConfiguratorState-BdQXh9ie.js} +1 -1
- package/dist/useSpecularTracking-DFK_fhpG.js +32 -0
- package/dist/useSpringMount-DXUzxBjV.js +108 -0
- package/dist/watercolor-dot.js +2 -2
- package/package.json +62 -38
- package/src/styles/cards.css +2 -2
- package/src/styles/dock/layer-group.css +38 -4
- package/src/styles/dock/layers.css +11 -1
- package/src/styles/dock/morph.css +95 -19
- package/src/styles/dock/shell.css +12 -0
- package/src/styles/dock-controls.css +25 -12
- package/src/styles/drawer.css +12 -4
- package/src/styles/glass/a11y-fallback.css +245 -0
- package/src/styles/glass/ladder.css +304 -0
- package/src/styles/glass/material.css +238 -0
- package/src/styles/glass/progress-rail.css +78 -0
- package/src/styles/glass/squircle.css +66 -0
- package/src/styles/glass/surfaces.css +306 -0
- package/src/styles/glass.css +31 -1052
- package/src/styles/index.css +24 -6
- package/src/styles/theme.css +14 -14
- package/src/styles/tokens/color-radius.css +250 -0
- package/src/styles/tokens/dark-arm.css +194 -0
- package/src/styles/tokens/glass.css +413 -0
- package/src/styles/tokens/light-dark.css +158 -0
- package/src/styles/tokens/offsets-sizing.css +406 -0
- package/src/styles/tokens/property-regs.css +169 -0
- package/src/styles/tokens/scale-paper.css +361 -0
- package/src/styles/tokens/scheme-motion.css +334 -0
- package/src/styles/tokens/shadow.css +132 -0
- package/src/styles/tokens.css +22 -2269
- package/src/styles/transitions.css +20 -2
- package/src/styles/typography.css +18 -6
- package/src/styles/utilities/a11y-overrides.css +140 -0
- package/src/styles/utilities/animate.css +26 -0
- package/src/styles/utilities/base.css +365 -0
- package/src/styles/utilities/btn.css +399 -0
- package/src/styles/utilities/components.css +317 -0
- package/src/styles/utilities.css +19 -1170
- package/dist/DeckProgress-Dmk4_AKN.js +0 -23
- package/dist/InstrumentRail-CUJ05YVG.js +0 -44
- package/dist/components/custom/aurora/composables/gpuRuntime.d.ts +0 -16
- package/dist/components/custom/aurora/constants/shaders/aurora.wgsl.d.ts +0 -7
- package/dist/components/custom/deck-progress/DeckProgress.vue.d.ts +0 -27
- package/dist/components/custom/deck-progress/index.d.ts +0 -2
- package/dist/components/custom/dialog-native/GlassDialogNative.vue.d.ts +0 -57
- package/dist/components/custom/dialog-native/index.d.ts +0 -1
- package/dist/components/custom/glass-panel/GlassPanel.vue.d.ts +0 -41
- package/dist/components/custom/glass-panel/index.d.ts +0 -2
- package/dist/components/custom/header-ribbon/HeaderRibbon.vue.d.ts +0 -31
- package/dist/components/custom/header-ribbon/index.d.ts +0 -2
- package/dist/components/custom/header-ribbon/types.d.ts +0 -7
- package/dist/components/custom/instrument-rail/InstrumentRail.vue.d.ts +0 -91
- package/dist/components/custom/instrument-rail/index.d.ts +0 -2
- package/dist/composables/glass/createGPUCanvas.d.ts +0 -40
- package/dist/deck-progress.d.ts +0 -1
- package/dist/deck-progress.js +0 -2
- package/dist/dockContext-BKeIMmNk.js +0 -9
- package/dist/glass-panel.d.ts +0 -1
- package/dist/glass-panel.js +0 -44
- package/dist/header-ribbon.d.ts +0 -1
- package/dist/header-ribbon.js +0 -63
- package/dist/instrument-rail.d.ts +0 -1
- package/dist/instrument-rail.js +0 -2
- package/dist/useGlassRenderer-5I0YkI4t.js +0 -69
- package/dist/useSpecularTracking-BVRZsRHA.js +0 -26
- package/dist/useSpringMount-BJSHcLl3.js +0 -113
- /package/dist/{CollapsibleContent-CP9qF1v4.js → CollapsibleContent-Drow5WkV.js} +0 -0
- /package/dist/{DialogFooter-Gprw8H_A.js → DialogFooter-DufLHi0y.js} +0 -0
- /package/dist/{IconTooltip-yefK7cJc.js → IconTooltip-BrQ5p181.js} +0 -0
- /package/dist/{Input-DWQQIOC4.js → Input-B-F818RU.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-ok8pgSl5.js → _plugin-vue_export-helper-DWghtRt7.js} +0 -0
- /package/dist/{constants-CS75AWHG.js → constants-C8NMonuo.js} +0 -0
- /package/dist/{presets-BKVyQfbt.js → presets-1OhFpaIC.js} +0 -0
- /package/dist/{prng-wHuHlNHE.js → prng-CjVgzjQT.js} +0 -0
- /package/dist/{resolveCanvasColor-BBiYfp8g.js → resolveCanvasColor-CRvVzOvP.js} +0 -0
- /package/dist/{useCanvas2D-ClrQuZtp.js → useCanvas2D-CSeH8h16.js} +0 -0
- /package/dist/{useGlobalDark-yhL4Wp-s.js → useGlobalDark-D7R9OypB.js} +0 -0
- /package/dist/{useIntersectionPause-Cc-H9ees.js → useIntersectionPause-DAdVPVp4.js} +0 -0
- /package/dist/{useInterval-Dsmqwi03.js → useInterval-D3USn0yc.js} +0 -0
- /package/dist/{useKeyboardShortcuts-Be3w_Rwk.js → useKeyboardShortcuts-i8tHd5WO.js} +0 -0
- /package/dist/{useScrollProgress-CAH8Ofwt.js → useScrollProgress-CcgmgMQt.js} +0 -0
- /package/dist/{useSortable-C8ReQ50P.js → useSortable-DnyGXKKY.js} +0 -0
- /package/dist/{useTextHighlight-DON84L8w.js → useTextHighlight-B3b10W6r.js} +0 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { type ComputedRef } from "vue";
|
|
2
|
+
export type DockDensity = "compact" | "comfortable" | "spacious" | "audacious";
|
|
3
|
+
export interface DockCommonProps {
|
|
4
|
+
fitContent?: boolean;
|
|
5
|
+
position?: "fixed" | "inline" | "sticky";
|
|
6
|
+
alwaysExpanded?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Corner treatment.
|
|
9
|
+
* `"pill"` — the stadium silhouette (default).
|
|
10
|
+
* `"rounded"` — a finite rounded radius (`--radius-xl`).
|
|
11
|
+
* `"card"` — the AW.W3b big-dock card shell: a finite concentric
|
|
12
|
+
* radius (`--dock-card-radius`, default `--radius-3xl`)
|
|
13
|
+
* ABOVE 2xl, below pill — does NOT collapse to a stadium.
|
|
14
|
+
* Collapsed it returns to a pill; the pill↔card swap
|
|
15
|
+
* morphs on the `--dock-motion-resize` spring. AX.W56's
|
|
16
|
+
* squircle policy applies `corner-shape:
|
|
17
|
+
* var(--corner-shape-bigdock)` here under `@supports
|
|
18
|
+
* (corner-shape: superellipse(2))` — the big-dock is the ONE
|
|
19
|
+
* surface where the superellipse reads (cards/pills stay
|
|
20
|
+
* round); the border-radius arc is the cross-engine contract.
|
|
21
|
+
*
|
|
22
|
+
* `"pill"`/`"rounded"` previously bound ONLY under the vertical rail
|
|
23
|
+
* variant — on a horizontal dock the prop silently no-op'd. AW.W3b adds
|
|
24
|
+
* the horizontal-root shape rules (closing that documented-but-dead prop),
|
|
25
|
+
* so `shape` now paints on a horizontal dock too.
|
|
26
|
+
*/
|
|
27
|
+
shape?: "pill" | "rounded" | "card";
|
|
28
|
+
/**
|
|
29
|
+
* Layout axis of the dock. `"horizontal"` (default) lays items out
|
|
30
|
+
* left-to-right and animates `width`; `"vertical"` lays items out
|
|
31
|
+
* top-to-bottom and animates `height`. IGNORED under `variant="rail"` /
|
|
32
|
+
* `"instrument-strip"` (those force vertical by construction).
|
|
33
|
+
*/
|
|
34
|
+
orientation?: "horizontal" | "vertical";
|
|
35
|
+
/**
|
|
36
|
+
* Density controls dock padding, gaps, layer height, and inherited
|
|
37
|
+
* dock control sizing. Root CSS variables can override each density.
|
|
38
|
+
*/
|
|
39
|
+
density?: DockDensity;
|
|
40
|
+
/**
|
|
41
|
+
* Overflow strategy when the expanded content exceeds the dock's
|
|
42
|
+
* axis cap (`--dock-max-inline-size` horizontally,
|
|
43
|
+
* `--dock-max-block-size` vertically). The ONE knob governing every
|
|
44
|
+
* overflow behaviour (AT.W7-dock-a clean break — collapsed from the
|
|
45
|
+
* prior `wrap` boolean + `overflow` pair + `containerName` clip-lift,
|
|
46
|
+
* which all touched overflow divergently).
|
|
47
|
+
* `"grow"` — content grows to fit then overflows visibly past
|
|
48
|
+
* the cap (the default; nothing clips or scrolls).
|
|
49
|
+
* `"wrap"` — expanded content wraps to multiple rows via CONTENT-DRIVEN
|
|
50
|
+
* intrinsic flex-wrap (the `.dock-overflow-wrap` recipe). The
|
|
51
|
+
* dock shrink-wraps to content and caps that intrinsic width
|
|
52
|
+
* at `max-inline-size: var(--dock-max-inline-size)`, so the row
|
|
53
|
+
* reflows to N rows EXACTLY when its intrinsic width exceeds
|
|
54
|
+
* the cap — at ANY viewport width — and collapses to one row
|
|
55
|
+
* when it fits (no viewport breakpoint). The wrapped multi-row silhouette lifts
|
|
56
|
+
* onto the card/floating shadow tier as the dock expands.
|
|
57
|
+
* HORIZONTAL-ONLY: a vertical rail grows-to-fit + clamps via
|
|
58
|
+
* `--dock-max-block-size` (its own overflow story), so the
|
|
59
|
+
* `.dock-overflow-wrap` class is not emitted for a vertical
|
|
60
|
+
* orientation.
|
|
61
|
+
* `"scroll"` — the dock becomes the scroll port. Horizontal docks
|
|
62
|
+
* scroll the active layer on the inline axis
|
|
63
|
+
* (`.dock-scroll-x`); vertical rails scroll on the
|
|
64
|
+
* block axis (`.dock-scroll-y`), keeping the
|
|
65
|
+
* `max-block-size` cap. The rounded pill masks the
|
|
66
|
+
* scroll edge; the scrollbar is hidden. The axis is
|
|
67
|
+
* chosen automatically from `orientation`.
|
|
68
|
+
*/
|
|
69
|
+
overflow?: "grow" | "wrap" | "scroll";
|
|
70
|
+
/**
|
|
71
|
+
* When set, the dock root establishes an inline-size container query
|
|
72
|
+
* subject (`container-type: inline-size; container-name: <value>`) so
|
|
73
|
+
* descendants can query the named container via `@container <value>
|
|
74
|
+
* (...)` rules. ORTHOGONAL to the `overflow` clip: opting into a
|
|
75
|
+
* container subject does NOT silently change the dock's clip shell
|
|
76
|
+
* (AT.W7-dock-a — the prior clip-lift was folded out; use
|
|
77
|
+
* `overflow="wrap"` to allow multi-line content).
|
|
78
|
+
*
|
|
79
|
+
* T.B audit §1.3 cornerstone: the cluster's container subject must
|
|
80
|
+
* live on the dock primitive, never on a descendant whose intrinsic
|
|
81
|
+
* size the dock relies on.
|
|
82
|
+
*/
|
|
83
|
+
containerName?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface DockVariantProps extends DockCommonProps {
|
|
86
|
+
variant?: "dock";
|
|
87
|
+
/** Idle-collapse delay in ms (default 2000). DOCK-ONLY — a rail never collapses. */
|
|
88
|
+
collapseDelay?: number;
|
|
89
|
+
/** Start in the collapsed state (default true). DOCK-ONLY — a rail is always expanded. */
|
|
90
|
+
startCollapsed?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* In-cap arrangement. `"linear"` (default) lays the active layer out as a
|
|
93
|
+
* linear row/column. `"grid"` makes the active layer a self-wrapping tile
|
|
94
|
+
* grid (Launchpad/Stage-Manager track symmetry — `auto-fill` columns of
|
|
95
|
+
* `--dock-tile-min`). ORTHOGONAL to `overflow` (the OVER-cap strategy):
|
|
96
|
+
* `layout` is the IN-cap arrangement.
|
|
97
|
+
*
|
|
98
|
+
* Hard contract: a `layout="grid"` dock is `alwaysExpanded` (a 2D panel
|
|
99
|
+
* does not read as a collapsible pill, and no width morph means no
|
|
100
|
+
* per-frame grid reflow). The canonical pairing is
|
|
101
|
+
* `shape="card" layout="grid"` (the props stay independent — no
|
|
102
|
+
* auto-implication of `shape`). DOCK-ONLY — the grid is a horizontal big-dock
|
|
103
|
+
* arrangement, never a rail's.
|
|
104
|
+
*/
|
|
105
|
+
layout?: "linear" | "grid";
|
|
106
|
+
}
|
|
107
|
+
export interface DockRailProps extends DockCommonProps {
|
|
108
|
+
variant: "rail" | "instrument-strip";
|
|
109
|
+
}
|
|
110
|
+
export type DockProps = DockVariantProps | DockRailProps;
|
|
111
|
+
export declare function dockBranch(p: DockProps): p is DockVariantProps;
|
|
112
|
+
/** The resolved shell-prop computeds the GlassDock SFC binds. */
|
|
113
|
+
export interface DockShellProps {
|
|
114
|
+
containerStyle: ComputedRef<Record<string, string> | undefined>;
|
|
115
|
+
collapseDelay: ComputedRef<number>;
|
|
116
|
+
startCollapsed: ComputedRef<boolean>;
|
|
117
|
+
layoutValue: ComputedRef<"linear" | "grid">;
|
|
118
|
+
variant: ComputedRef<"dock" | "rail" | "instrument-strip">;
|
|
119
|
+
shape: ComputedRef<"pill" | "rounded" | "card">;
|
|
120
|
+
orientation: ComputedRef<"horizontal" | "vertical">;
|
|
121
|
+
density: ComputedRef<DockDensity>;
|
|
122
|
+
scrollClass: ComputedRef<string | null>;
|
|
123
|
+
alwaysExpanded: ComputedRef<boolean>;
|
|
124
|
+
fitContent: ComputedRef<boolean>;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Derive the dock's resolved shell props off the raw `props`. The defaults the
|
|
128
|
+
* prior `withDefaults` object held are applied at each read site via `?? default`
|
|
129
|
+
* (every shared default has exactly one resolution point — the one-path precept).
|
|
130
|
+
*/
|
|
131
|
+
export declare function useDockShellProps(props: DockProps): DockShellProps;
|
|
@@ -1,4 +1,48 @@
|
|
|
1
1
|
import type { Ref } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* AX.W01 — the dock single-scalar morph: ONE spring, ONE clock, the whole box.
|
|
4
|
+
*
|
|
5
|
+
* Re-derived from first principles (the e8380d7 single-clock high-water; the
|
|
6
|
+
* 479-line VT-fork accretion is gone). The collapse↔expand (and inner pane-swap)
|
|
7
|
+
* morph runs off ONE normalized analytic spring whose progress scalar (0→1) is
|
|
8
|
+
* written once per frame to `--dock-morph-t` on the `.glass-dock` root. EVERY
|
|
9
|
+
* animated axis — inline-size, padding, border-radius, scale, background / border
|
|
10
|
+
* color, AND the child stagger — is a pure `calc()` read off that one scalar in
|
|
11
|
+
* `dock.css`. NO CSS `transition` on the root morph props; NO View-Transitions
|
|
12
|
+
* fork: the live `SpringProgress` ODE is the single authority on every engine, so
|
|
13
|
+
* iOS interruptible-physics + velocity-continuity retarget are universal, not
|
|
14
|
+
* capability-gated.
|
|
15
|
+
*
|
|
16
|
+
* The morph is a FLIP — the from→to size is measured ONCE per swap (the allowed
|
|
17
|
+
* one-time measurement primitive, never a co-driver), written as `--dock-morph-from`
|
|
18
|
+
* / `--dock-morph-to` px vars on the morphing element, and the live scalar
|
|
19
|
+
* interpolates between them in CSS. Content lays out once at natural size;
|
|
20
|
+
* `overflow:clip` on the morph axis (dock.css, gated on `data-morphing`) makes the
|
|
21
|
+
* box the reveal aperture; the spring-keyed stagger fades the children in-step.
|
|
22
|
+
*
|
|
23
|
+
* Velocity-continuity (the ONE load-bearing iOS piece): a re-toggle mid-flight
|
|
24
|
+
* re-bases the live solver onto the new span from its current velocity (the
|
|
25
|
+
* analytic re-seat keyframes.js owns) — inertia carries, no snap-from-rest. The
|
|
26
|
+
* spring constant is the published `--spring-dock` (response 0.32, ζ 0.7, ~+4.6%
|
|
27
|
+
* overshoot), the SAME analytic ODE the build-time linear() token samples.
|
|
28
|
+
*
|
|
29
|
+
* LIGHT-surface only: `SpringProgress` owns its own rAF via `.play(onFrame)` and
|
|
30
|
+
* carries no static value.js edge. NEVER import `AnimationGroup` / the `./engine`
|
|
31
|
+
* boundary — that pulls value.js into the dock bundle.
|
|
32
|
+
*
|
|
33
|
+
* BOOKED: AY.W-GOD1 — the FLIP-engine FOLD. This standalone engine is a
|
|
34
|
+
* near-duplicate of the orchestrator's FLIP-pin-measure-arm dance
|
|
35
|
+
* (`dockMorphContext.ts:onSwap`), which is the SUPERSET (it carries sibling-rebase
|
|
36
|
+
* this copy lacks). W-DOCK2 found the duplication (H-dock §D3) and BOOKED the fold
|
|
37
|
+
* to W-GOD1 (the GlassDock.vue carve touches the same FLIP code, so the carve is
|
|
38
|
+
* cleaner over ONE engine; folding now would also break the `/dock` `useLayerTransition`
|
|
39
|
+
* public re-export an external consumer reads). Until W-GOD1 lands, `proof:dock-orchestrator-single`'s
|
|
40
|
+
* FLIP DRIFT-GUARD asserts this engine and the orchestrator stay byte-faithful on
|
|
41
|
+
* the load-bearing pin-measure-arm markers, so a divergence in the shared dance REDs.
|
|
42
|
+
* The CANONICAL `DOCK_SPRING` authority is `dock/constants.ts` (the colocation home
|
|
43
|
+
* BOTH this engine and the orchestrator import); `proof:spring-tokens-synced` reads
|
|
44
|
+
* it there, NOT a per-composable copy (W-COLOCATE — the dead-witness fix, continued).
|
|
45
|
+
*/
|
|
2
46
|
export interface UseLayerTransitionOptions {
|
|
3
47
|
/** The container element that owns the stacked layer panes. */
|
|
4
48
|
containerEl: Ref<HTMLElement | null>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE dock-morph spring authority — the iOS-26 interruptible-physics tuning the
|
|
3
|
+
* dock's single `SpringProgress` orchestrator (`dockMorphContext.ts`) AND the
|
|
4
|
+
* `useLayerTransition` engine both read. Co-located here so the `response`/`damping`
|
|
5
|
+
* pair is defined ONCE rather than duplicated at the top of each composable (the two
|
|
6
|
+
* prior copies were a DRY hazard — a re-tune had to touch both).
|
|
7
|
+
*/
|
|
8
|
+
export declare const DOCK_SPRING: {
|
|
9
|
+
readonly response: 0.32;
|
|
10
|
+
readonly dampingFraction: 0.7;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The CSS properties whose `transitionend` the dock-morph window watches to know a
|
|
14
|
+
* resize-morph has settled (`useDockMorphWindow.ts`). A `transitionend` on any other
|
|
15
|
+
* property is ignored.
|
|
16
|
+
*/
|
|
17
|
+
export declare const RESIZE_MORPH_PROPS: Set<string>;
|
|
18
|
+
/** `Symbol()` label for the `DockContext` injection key (`dockContext.ts`). */
|
|
19
|
+
export declare const DOCK_CONTEXT_LABEL = "glass-ui:dock-context";
|
|
20
|
+
/** `Symbol()` label for the `DockLayerGroupContext` injection key (`dockLayerContext.ts`). */
|
|
21
|
+
export declare const DOCK_LAYER_GROUP_LABEL = "glass-ui:dock-layer-group";
|
|
22
|
+
/** `Symbol()` label for the `DockMorphContext` injection key (`dockMorphContext.ts`). */
|
|
23
|
+
export declare const DOCK_MORPH_LABEL = "glass-ui:dock-morph-context";
|
|
@@ -32,6 +32,12 @@ type __VLS_Props = {
|
|
|
32
32
|
seed?: string;
|
|
33
33
|
/** When true, paint ONE static deterministic best-frame and never animate (the capture/export lever). Default false. */
|
|
34
34
|
freeze?: boolean;
|
|
35
|
+
/** Outer loudness envelope (the Aurora `opacityCeiling` shape). Scales the
|
|
36
|
+
* resolved `peakAlpha`/`headGlowAlpha` at the PAINT layer (a per-LAYER
|
|
37
|
+
* multiply, not a uniform CSS opacity). Default 1 (the bundle's resting
|
|
38
|
+
* loudness); clamped [0, 2] — the field's ~2 upper bound lets a hero push
|
|
39
|
+
* brighter than the recessed default without runaway. */
|
|
40
|
+
intensity?: number;
|
|
35
41
|
};
|
|
36
42
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
43
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,2 +1,26 @@
|
|
|
1
|
+
import type { ColorResolver } from "../../../composables/color";
|
|
1
2
|
export { default as FourierField } from "./FourierField.vue";
|
|
2
|
-
export { comp,
|
|
3
|
+
export { comp, positionsAt, dftFromPoints, makeEllipticSpectrum, type BasisComponent, type EllipticSpectrumOptions, } from "./math";
|
|
4
|
+
/** The configuration-BUNDLE axis — `hero` (epicycles on, fewer harmonics) vs
|
|
5
|
+
* `final` (epicycles off, denser). Not a recolour of one curve; one engine,
|
|
6
|
+
* two presets. */
|
|
7
|
+
export type FourierFieldVariant = "hero" | "final";
|
|
8
|
+
/** The props a consumer forwards when wrapping `<FourierField>` (the seeded
|
|
9
|
+
* inverse-DFT epicycle background; ships via `/fourier-field`). Mirrors the
|
|
10
|
+
* component's inline `defineProps` shape (an SFC cannot export its inline
|
|
11
|
+
* props type). */
|
|
12
|
+
export interface FourierFieldProps {
|
|
13
|
+
/** Configuration bundle. Default `hero`. */
|
|
14
|
+
variant?: FourierFieldVariant;
|
|
15
|
+
/** Base CSS color (a `var()`/`light-dark()` token resolves against the host). */
|
|
16
|
+
color: string;
|
|
17
|
+
/** REQUIRED color seam — resolves a concrete color to a gamma-sRGB [r,g,b] triple in [0,1]. */
|
|
18
|
+
colorResolver: ColorResolver;
|
|
19
|
+
/** Extra seed mixed into the spectrum PRNG for a unique-but-reproducible curve. Default "". */
|
|
20
|
+
seed?: string;
|
|
21
|
+
/** Paint ONE static deterministic best-frame and never animate (the capture lever). Default false. */
|
|
22
|
+
freeze?: boolean;
|
|
23
|
+
/** Outer loudness envelope (the Aurora `opacityCeiling` shape). Scales the
|
|
24
|
+
* resolved `peakAlpha`/`headGlowAlpha` at the paint layer. Default 1; clamped [0, 2]. */
|
|
25
|
+
intensity?: number;
|
|
26
|
+
}
|
|
@@ -15,19 +15,31 @@ export interface BasisComponent {
|
|
|
15
15
|
* coefficient `(re, im)`, deriving the polar `amplitude`/`phase`.
|
|
16
16
|
*/
|
|
17
17
|
export declare function comp(index: number, re: number, im: number): BasisComponent;
|
|
18
|
-
/**
|
|
19
|
-
* Sum `c_k * exp(2*pi*i*k*t)` — the curve point at parameter `t`. `maxTerms`
|
|
20
|
-
* truncates the series (the partial-sum read). Returns the complex value as
|
|
21
|
-
* `[re, im]` (the curve's `[x, y]` before view-fit).
|
|
22
|
-
*/
|
|
23
|
-
export declare function evalFourier(components: BasisComponent[], t: number, maxTerms?: number): [number, number];
|
|
24
18
|
/**
|
|
25
19
|
* The epicycle chain at parameter `t`: the running tip of each phasor stacked on
|
|
26
20
|
* the last, starting at the origin. `positions[0]` is `[0, 0]`; the final entry
|
|
27
|
-
* is the curve point
|
|
28
|
-
* truncates the chain (draw fewer arms than the spectrum
|
|
21
|
+
* is the curve point — the inverse-DFT sum `Σ c_k * exp(2*pi*i*k*t)` at the same
|
|
22
|
+
* `t`. `maxCircles` truncates the chain (draw fewer arms than the spectrum
|
|
23
|
+
* carries).
|
|
29
24
|
*/
|
|
30
25
|
export declare function positionsAt(components: BasisComponent[], t: number, maxCircles?: number): [number, number][];
|
|
26
|
+
/**
|
|
27
|
+
* The forward DFT — the inverse of {@link positionsAt}. Takes a closed sequence
|
|
28
|
+
* of `[x, y]` samples around a curve (treated as the complex signal `x + i·y`,
|
|
29
|
+
* uniformly spaced in the parameter `t ∈ [0, 1)`) and returns the
|
|
30
|
+
* {@link BasisComponent} spectrum that {@link positionsAt} reconstructs.
|
|
31
|
+
*
|
|
32
|
+
* Frequencies run symmetrically around 0 — `0, +1, -1, +2, -2, …` up to the
|
|
33
|
+
* Nyquist limit — which is the index ordering the epicycle chain wants (the big
|
|
34
|
+
* low-order phasors first). The DC term (`index 0`) is the curve's centroid; the
|
|
35
|
+
* caller can subtract it (draw the chain centered) or keep it (draw at the
|
|
36
|
+
* sampled position).
|
|
37
|
+
*
|
|
38
|
+
* General: any point set drives it (a glyph outline, a hand-traced path, a
|
|
39
|
+
* digitized signature). It is NOT a special case — it is the literal forward
|
|
40
|
+
* transform whose inverse already ships as `positionsAt`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function dftFromPoints(points: [number, number][]): BasisComponent[];
|
|
31
43
|
/** Tuning for {@link makeEllipticSpectrum}. */
|
|
32
44
|
export interface EllipticSpectrumOptions {
|
|
33
45
|
/**
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface VariantPreset {
|
|
2
|
+
/** Higher-order harmonics layered over the dominant counter-rotating pair. */
|
|
3
|
+
harmonics: number;
|
|
4
|
+
/** Peak magnitude of those harmonics relative to the dominant phasor. */
|
|
5
|
+
harmonicScale: number;
|
|
6
|
+
/** Draw the nested epicycle circles + arms underneath the curve. */
|
|
7
|
+
epicycles: boolean;
|
|
8
|
+
/** Comet-trail capacity (frames of head history). ~1/3 of the period so the
|
|
9
|
+
* comet reads as a substantial arc, not a stub (the fourier-analysis bar). */
|
|
10
|
+
trailLength: number;
|
|
11
|
+
/** Hue offset (degrees) of the epicycle second hue away from the outline hue. */
|
|
12
|
+
epicycleHueShift: number;
|
|
13
|
+
/** Forward-clock period for one full curve traversal, in ms. */
|
|
14
|
+
durationMs: number;
|
|
15
|
+
/** A constant per-variant seed used under `freeze` so a capture is deterministic. */
|
|
16
|
+
frozenSeed: string;
|
|
17
|
+
/** The parameter `t` of the static best-frame painted under `freeze`. */
|
|
18
|
+
frozenT: number;
|
|
19
|
+
/** Comet-trail PEAK alpha (the head segment). The reference trail rides ~0.9
|
|
20
|
+
* near-opaque — present, not the prior 0.45 hairline whisper. */
|
|
21
|
+
peakAlpha: number;
|
|
22
|
+
/** Trail stroke weight in CSS px (the reference is a BOLD 3.5px stroke, not
|
|
23
|
+
* the prior 1.6 hairline). The single biggest faintness lever. */
|
|
24
|
+
trailWidth: number;
|
|
25
|
+
/** Head-glow alpha — the STRONGEST layer (head-forward: > peakAlpha). */
|
|
26
|
+
headGlowAlpha: number;
|
|
27
|
+
/** Head-glow `shadowBlur` bloom radius, in px. */
|
|
28
|
+
headGlowBlur: number;
|
|
29
|
+
/** The comet HEAD DOT radius in CSS px (the reference's glowing tip — a
|
|
30
|
+
* saturated core + white highlight + soft halo). 0 disables it. */
|
|
31
|
+
headDotRadius: number;
|
|
32
|
+
/** Epicycle scaffolding alphas ÷ peak (hero only; {0,0} disables the scaffold).
|
|
33
|
+
* The reference circles/arms are PRESENT (≈0.5/0.75), not the prior 0.18 ghost. */
|
|
34
|
+
epicycleRatios: {
|
|
35
|
+
circle: number;
|
|
36
|
+
arm: number;
|
|
37
|
+
};
|
|
38
|
+
/** Epicycle circle / arm stroke weights in CSS px (the reference uses a bold
|
|
39
|
+
* ≈2.5/2 chain, the joints carry filled dots). */
|
|
40
|
+
epicycleWidths: {
|
|
41
|
+
circle: number;
|
|
42
|
+
arm: number;
|
|
43
|
+
};
|
|
44
|
+
/** Paint the epicycle chain as a rainbow across the spectrum (the
|
|
45
|
+
* fourier-analysis signature) vs one analogous second hue. Hero only. */
|
|
46
|
+
epicycleRainbow: boolean;
|
|
47
|
+
/** Trail persistence exponent — SOFT (1..2), never the quadratic that kills the body. */
|
|
48
|
+
trailFadeExp: number;
|
|
49
|
+
/** Min trail alpha ÷ peak — the body survives, never decays to 0. The
|
|
50
|
+
* reference body reads near-uniform; the floor sits HIGH (≈0.35) so the
|
|
51
|
+
* comet body has real presence on cream too (the light-mode floor fork). */
|
|
52
|
+
trailFloor: number;
|
|
53
|
+
}
|
|
54
|
+
export declare const PRESETS: Record<"hero" | "final", VariantPreset>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ColorResolver } from "../../../composables/color";
|
|
2
1
|
import type { BlobMood, BlobConfig } from "./types";
|
|
3
2
|
/**
|
|
4
3
|
* GooBlob — a gooey metaball creature on a WebGL2 canvas.
|
|
@@ -8,23 +7,22 @@ import type { BlobMood, BlobConfig } from "./types";
|
|
|
8
7
|
* satellite system drive the motion. The renderer composes the `useWebGLCanvas`
|
|
9
8
|
* substrate — it never bootstraps its own context.
|
|
10
9
|
*
|
|
11
|
-
* Color is resolved through
|
|
12
|
-
* paints the GAMMA-sRGB triple
|
|
13
|
-
* `
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
* Color is resolved INTERNALLY through the `/color` leaf (`cssToOklch →
|
|
11
|
+
* oklchToGammaRgb`): the blob paints the GAMMA-sRGB triple of the `color` prop. A
|
|
12
|
+
* `lab()`/`oklch()`/`hsl()`/hex string resolves correctly; a `var(--token)` is
|
|
13
|
+
* un-wrapped to a concrete string by the SFC's `resolveTokenColor` leaf BEFORE the
|
|
14
|
+
* renderer sees it (the DOM-free renderer contract).
|
|
16
15
|
*
|
|
17
|
-
* Config is resolved with
|
|
16
|
+
* Config is resolved with a loud discipline: either
|
|
18
17
|
* `provide(BLOB_CONFIG_KEY, cfg)` from an ancestor OR pass an explicit `config`
|
|
19
18
|
* prop. A mount with NEITHER throws — there is no silent reactive-defaults
|
|
20
19
|
* synthesis. A consumer that genuinely wants the stock tuning passes
|
|
21
20
|
* `BLOB_CONFIG_DEFAULTS` explicitly.
|
|
22
21
|
*/
|
|
23
22
|
type __VLS_Props = {
|
|
24
|
-
/** Base CSS color string (
|
|
23
|
+
/** Base CSS color string (a `var()`/`oklch()`/`lab()`/`hsl()`/hex form; resolved
|
|
24
|
+
* internally through the `/color` leaf to a gamma-sRGB triple). */
|
|
25
25
|
color: string;
|
|
26
|
-
/** REQUIRED color seam — resolves `color` to a gamma-sRGB [r,g,b] triple in [0,1]. */
|
|
27
|
-
colorResolver: ColorResolver;
|
|
28
26
|
/**
|
|
29
27
|
* REQUIRED unless an ancestor `provide(BLOB_CONFIG_KEY, …)` supplies it.
|
|
30
28
|
* The metaball tuning. Pass `BLOB_CONFIG_DEFAULTS` for the stock look.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type MetaballUniformLocations } from "./uploadBlobUniforms";
|
|
2
|
+
/** The compiled-program handles the renderer closes over + tears down. */
|
|
3
|
+
export interface MetaballProgram {
|
|
4
|
+
prog: WebGLProgram;
|
|
5
|
+
vs: WebGLShader;
|
|
6
|
+
fs: WebGLShader;
|
|
7
|
+
vao: WebGLVertexArrayObject;
|
|
8
|
+
buf: WebGLBuffer;
|
|
9
|
+
locs: MetaballUniformLocations;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Compile the metaball shader, build the full-quad VAO, and resolve the uniform
|
|
13
|
+
* location cache on a fresh context. Leaves `BLEND` enabled with the
|
|
14
|
+
* premultiplied-alpha `(ONE, ONE_MINUS_SRC_ALPHA)` blend func (the source's
|
|
15
|
+
* setup), `prog` in use, and the VAO bound — the caller's `resize`/`drawFrame`
|
|
16
|
+
* re-bind as needed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildMetaballProgram(gl: WebGL2RenderingContext): MetaballProgram;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { BlobConfig, MoodParams } from "../types";
|
|
2
|
+
import type { BlobPointer } from "./useBlobPointer";
|
|
3
|
+
import type { BlobSatelliteSystem } from "./useBlobSatellites";
|
|
4
|
+
import { MAX_SATS, TRAIL_N, MAX_BLOB_STOPS, POS_SCALE, UNIFORM_NAMES } from "../constants";
|
|
5
|
+
import type { UniformName } from "../constants";
|
|
6
|
+
export { MAX_SATS, TRAIL_N, MAX_BLOB_STOPS, POS_SCALE, UNIFORM_NAMES };
|
|
7
|
+
export type { UniformName };
|
|
8
|
+
/** The cached uniform-location set the GL setup builds once per context. */
|
|
9
|
+
export interface MetaballUniformLocations {
|
|
10
|
+
U: Record<UniformName, WebGLUniformLocation | null>;
|
|
11
|
+
satPosLocs: (WebGLUniformLocation | null)[];
|
|
12
|
+
satRadLocs: (WebGLUniformLocation | null)[];
|
|
13
|
+
satOpLocs: (WebGLUniformLocation | null)[];
|
|
14
|
+
trailPosLocs: (WebGLUniformLocation | null)[];
|
|
15
|
+
trailRadLocs: (WebGLUniformLocation | null)[];
|
|
16
|
+
paletteLocs: (WebGLUniformLocation | null)[];
|
|
17
|
+
}
|
|
18
|
+
/** The per-frame state the renderer resolves and hands to the upload leaf. */
|
|
19
|
+
export interface BlobFrameState {
|
|
20
|
+
/** The mood params for this frame (`mood.params.value`). */
|
|
21
|
+
params: MoodParams;
|
|
22
|
+
/** The resolved base-color gamma-sRGB triple. */
|
|
23
|
+
rgb: [number, number, number];
|
|
24
|
+
/** The tempo-integrated motion clock (ms). */
|
|
25
|
+
simTimeMs: number;
|
|
26
|
+
/** The substrate's seconds clock for this frame (the pulse-phase axis). */
|
|
27
|
+
timeSec: number;
|
|
28
|
+
/** A CONCRETE → gamma-sRGB triple resolver (the renderer's memoised `/color` leaf). */
|
|
29
|
+
resolveColor: (css: string) => [number, number, number];
|
|
30
|
+
/** The Fresnel rim color (CONCRETE — the SFC un-wrapped any var()-token). */
|
|
31
|
+
rimColor: string;
|
|
32
|
+
/** The multi-stop palette (CONCRETE strings; EMPTY → falls back to base). */
|
|
33
|
+
paletteStops: string[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Write the resolved frame state into the metaball program's uniforms and issue
|
|
37
|
+
* the draw call. Pure: it mutates GL state only (the bound program/VAO + the
|
|
38
|
+
* uniform values) and never reads the renderer's closure. The body is the
|
|
39
|
+
* byte-identical lift of the prior inline `drawFrame` uniform-upload section.
|
|
40
|
+
*/
|
|
41
|
+
export declare function uploadBlobUniforms(gl: WebGL2RenderingContext, prog: WebGLProgram, vao: WebGLVertexArrayObject, locs: MetaballUniformLocations, canvas: HTMLCanvasElement, config: BlobConfig, pointer: BlobPointer, satellites: BlobSatelliteSystem, frame: BlobFrameState): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Ref } from "vue";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { TRAIL_N } from "../constants";
|
|
3
|
+
/** Compile-time trail length — re-exported from the co-located shape budget (`../constants`). */
|
|
4
|
+
export { TRAIL_N };
|
|
4
5
|
/** A single trail sample — a decaying-radius metaball source the shader smin-merges. */
|
|
5
6
|
export interface TrailSample {
|
|
6
7
|
x: number;
|
|
@@ -13,7 +14,7 @@ export interface TrailSample {
|
|
|
13
14
|
* FRAME-RATE-INDEPENDENT critically-damped spring fed the renderer's per-frame
|
|
14
15
|
* `dtMs` (NOT a fixed-α lerp — the prior `SMOOTH_FACTOR = 0.12` was framerate
|
|
15
16
|
* dependent). The spring is `@mkbabb/keyframes.js` `SpringProgress` driven through
|
|
16
|
-
* its `
|
|
17
|
+
* its `tickDt(dtMs)` seam by the SUBSTRATE's single rAF — it does NOT call
|
|
17
18
|
* `SpringProgress.play()` (that would start a parallel rAF, the
|
|
18
19
|
* single-substrate-loop violation `proof:blob-interaction-prm` forbids).
|
|
19
20
|
*
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type Ref } from "vue";
|
|
2
|
-
import type { ColorResolver } from "../../../../composables/color";
|
|
3
2
|
import type { BlobConfig } from "../types";
|
|
4
3
|
import type { BlobMoodSystem } from "./useBlobMood";
|
|
5
4
|
import type { BlobPointer } from "./useBlobPointer";
|
|
@@ -24,34 +23,30 @@ export interface UseMetaballRendererOptions {
|
|
|
24
23
|
pointer: BlobPointer;
|
|
25
24
|
satellites: BlobSatelliteSystem;
|
|
26
25
|
config: BlobConfig;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* `defaultBlobColorResolver` from `@mkbabb/glass-ui/color` (or their own). The
|
|
33
|
-
* renderer is DOM-FREE: it never un-wraps a `var(--token)` — the SFC's
|
|
34
|
-
* `resolveTokenColor` leaf does that BEFORE handing strings here (inv-K-3 seam).
|
|
35
|
-
*/
|
|
36
|
-
colorResolver: ColorResolver;
|
|
26
|
+
}
|
|
27
|
+
/** The renderer's public control surface — pause/resume the demand loop. */
|
|
28
|
+
export interface UseMetaballRendererReturn {
|
|
29
|
+
pause: () => void;
|
|
30
|
+
resume: () => void;
|
|
37
31
|
}
|
|
38
32
|
/**
|
|
39
33
|
* The GooBlob WebGL renderer — composes the `useWebGLCanvas` substrate (AU.W6).
|
|
40
34
|
*
|
|
41
35
|
* This module owns ONLY the metaball-specific concerns: compiling the shader,
|
|
42
|
-
* building the quad + uniform cache
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
36
|
+
* building the quad + uniform cache (the `buildMetaballProgram` leaf), and
|
|
37
|
+
* uploading the per-frame uniforms (the `uploadBlobUniforms` leaf) derived from the
|
|
38
|
+
* mood / pointer / satellite systems and the resolved base color. The generic
|
|
39
|
+
* WebGL2 lifecycle — context creation, the suspend/resume model, the demand-driven
|
|
40
|
+
* rAF loop, the tab-visibility owner, the ResizeObserver, and the
|
|
46
41
|
* webglcontextlost/restored robustness — lives in the substrate; this renderer
|
|
47
42
|
* threads its behaviour through the substrate's
|
|
48
43
|
* `setup`/`frame`/`shouldContinue`/`resize`/`teardown` callbacks. It does NOT call
|
|
49
44
|
* `getContext("webgl2")` itself (the single-bootstrap contract).
|
|
50
45
|
*
|
|
51
|
-
*
|
|
52
|
-
* `
|
|
46
|
+
* Color is resolved INTERNALLY through the `/color` leaf (`cssToOklch →
|
|
47
|
+
* oklchToGammaRgb`) — the GAMMA-sRGB triple fed straight into the base-color uniform
|
|
48
|
+
* (the faithful AU.W7 lift paints gamma). The renderer is DOM-FREE: it never un-wraps
|
|
49
|
+
* a `var(--token)` — the SFC's `resolveTokenColor` leaf does that BEFORE handing
|
|
50
|
+
* concrete strings here (inv-K-3 seam); the value.js 1×1-canvas DOM probe is gone.
|
|
53
51
|
*/
|
|
54
|
-
export declare function useMetaballRenderer(options: UseMetaballRendererOptions):
|
|
55
|
-
pause: () => void;
|
|
56
|
-
resume: () => void;
|
|
57
|
-
};
|
|
52
|
+
export declare function useMetaballRenderer(options: UseMetaballRendererOptions): UseMetaballRendererReturn;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { BlobMood, MoodParams } from "./types";
|
|
2
|
+
/** Compile-time satellite cap — mirrors `uSat*[N]` in metaball.frag.ts. */
|
|
3
|
+
export declare const MAX_SATS = 4;
|
|
4
|
+
/** Compile-time trail length — mirrors the `uTrail*[N]` arrays in metaball.frag.ts. */
|
|
5
|
+
export declare const TRAIL_N = 15;
|
|
6
|
+
/** Compile-time palette cap — mirrors `#define MAX_BLOB_STOPS` in metaball-uniforms.glsl.ts. */
|
|
7
|
+
export declare const MAX_BLOB_STOPS = 4;
|
|
8
|
+
/**
|
|
9
|
+
* Canvas is CSS-sized 1.6x its layout wrapper (see GooBlob.vue). Positions are in
|
|
10
|
+
* [-0.5, 0.5] normalized space mapped to canvas UVs. To make the layout footprint
|
|
11
|
+
* represent the "visible blob region" and have the extra 60% of canvas serve as
|
|
12
|
+
* overflow margin for satellite orbits, scale all length-like uniforms by
|
|
13
|
+
* 1/1.6 = 0.625.
|
|
14
|
+
*/
|
|
15
|
+
export declare const POS_SCALE: number;
|
|
16
|
+
/** The full ordered scalar/vector uniform-name list the program builder caches a location per. */
|
|
17
|
+
/** A point in the 2-axis circumplex affect space. */
|
|
18
|
+
export interface AffectPoint {
|
|
19
|
+
/** Pleasantness, -1 (unpleasant) .. +1 (pleasant). */
|
|
20
|
+
valence: number;
|
|
21
|
+
/** Activation, 0 (calm/sleepy) .. 1 (energized/excited). */
|
|
22
|
+
arousal: number;
|
|
23
|
+
}
|
|
24
|
+
/** The five named moods as POINTS in the {valence, arousal} circumplex. */
|
|
25
|
+
export declare const MOOD_AVA: Record<BlobMood, AffectPoint>;
|
|
26
|
+
/**
|
|
27
|
+
* Derive the full MoodParams from a {valence, arousal} point. Arousal drives the
|
|
28
|
+
* motion energy (orbit speed, wobble, pulse rate/amp, noise, the iridescence/SSS
|
|
29
|
+
* sheen); valence warms the palette (hue range, chroma, brightness) and the
|
|
30
|
+
* pointer lean. ONE principled surface — the five named moods are samples of it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function paramsFor({ valence, arousal }: AffectPoint): MoodParams;
|
|
33
|
+
/** The resolved per-mood target params (samples of the `paramsFor` surface). */
|
|
34
|
+
export declare const MOOD_TARGETS: Record<BlobMood, MoodParams>;
|
|
35
|
+
/** The per-mood cross-fade duration (ms). */
|
|
36
|
+
export declare const TRANSITION_MS: Record<BlobMood, number>;
|
|
37
|
+
/** Idle timeout (ms of no pointer) after which the blob drifts to `sleepy`. */
|
|
38
|
+
export declare const IDLE_SLEEP_MS = 6000;
|
|
39
|
+
/** Click-impulse spring ring frequency (rad/s). */
|
|
40
|
+
export declare const PULSE_OMEGA = 18;
|
|
41
|
+
/** Click-impulse spring damping (< 1 = underdamped, overshoot-then-settle). */
|
|
42
|
+
export declare const PULSE_ZETA = 0.35;
|
|
43
|
+
/** The at-rest epsilon — velocity/position below this is "settled" (the park gate). */
|
|
44
|
+
export declare const REST_EPS = 0.001;
|
|
45
|
+
/** Base satellite opacity. */
|
|
46
|
+
export declare const BASE_OPACITY = 0.75;
|
|
47
|
+
/** Duration (ms) to blend from emerge endpoint into live orbit — eliminates snap. */
|
|
48
|
+
export declare const ORBIT_BLEND_MS = 2000;
|
|
49
|
+
/** Minimum spacing (ms) between satellite merge events. */
|
|
50
|
+
export declare const MERGE_STAGGER_MS = 3000;
|
|
51
|
+
export declare const UNIFORM_NAMES: readonly ["uResolution", "uTime", "uBaseColor", "uPointer", "uPointerActive", "uPointerAttraction", "uPointerStrength", "uBodyRadius", "uPulsePhase", "uPulseAmp", "uNoiseAmp", "uNoiseFreq", "uNoiseSpeed", "uWarpAmp", "uSmoothK", "uMerge", "uMaxReach", "uLit", "uRimColor", "uLightDir", "uSpecStrength", "uSpecShininess", "uRimPower", "uRimStrength", "uIridescence", "uIridHue", "uIridSpeed", "uSssScale", "uSssPower", "uCoreGlow", "uHueRange", "uSatShift", "uBrightnessShift", "uColorNoiseFreq", "uColorNoiseSpeed", "uStopCount", "uSatCount", "uTrailCount", "uVelocity", "uStretch"];
|
|
52
|
+
export type UniformName = (typeof UNIFORM_NAMES)[number];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as GooBlob } from "./GooBlob.vue";
|
|
2
|
-
export type { BlobMood, BlobMerge, BlobQuality, MoodParams, MetaballSource, BlobConfig, SatellitePhase, SatelliteInternal, } from "./types";
|
|
2
|
+
export type { BlobMood, BlobMerge, BlobQuality, MoodParams, MetaballSource, BlobConfig, BlobGeometry, BlobSatelliteTiming, BlobMembrane, BlobColor, BlobSurface, BlobInteraction, SatellitePhase, SatelliteInternal, } from "./types";
|
|
3
3
|
export { BLOB_CONFIG_DEFAULTS, BLOB_CONFIG_KEY } from "./types";
|
|
4
4
|
export { useBlobMood, type BlobMoodSystem } from "./composables/useBlobMood";
|
|
5
5
|
export { useBlobPointer, type BlobPointer } from "./composables/useBlobPointer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const METABALL_UNIFORMS_GLSL = "#version 300 es\nprecision highp float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform vec2 uResolution;\nuniform float uTime;\nuniform vec3 uBaseColor;\n\n// Multi-stop palette (W11.b) \u2014 2-4 in-family OKLCh stops (uploaded GAMMA sRGB, like\n// uBaseColor). uStopCount <= 1 falls back to uBaseColor (the single-color default,\n// zero regression). MAX_BLOB_STOPS is a compile-time #define.\n#define MAX_BLOB_STOPS 4\nuniform int uStopCount;\nuniform vec3 uPalette[MAX_BLOB_STOPS];\n\n// Pointer\nuniform vec2 uPointer;\nuniform float uPointerActive;\nuniform float uPointerAttraction;\nuniform float uPointerStrength;\n\n// Main body\nuniform float uBodyRadius;\n\n// Pulsation\nuniform float uPulsePhase;\nuniform float uPulseAmp;\n\n// Surface noise\nuniform float uNoiseAmp;\nuniform float uNoiseFreq;\nuniform float uNoiseSpeed;\n\n// Gooey\nuniform float uSmoothK;\nuniform float uMerge; // 0 = quadratic smin, 1 = circular smin (rounder menisci)\n\n// AX.W16 (arm 5) \u2014 the PRE-FBM bounding-discard radius (UV space). main() early-outs\n// to a transparent write for any fragment OUTSIDE this radius BEFORE the two 3-octave\n// FBM calls + the OKLCh round-trip. The renderer uploads it PADDED by every\n// outward-expanding term (body + eccentric orbit + sat radius + smin band + FBM edge\n// amplitude + click-pulse + a lean/squash safety pad) so it NEVER clips the wet\n// meniscus (IQ: inflate the bound to match any outward op).\nuniform float uMaxReach;\n\n// Membrane \u2014 domain-warp strength on the FBM edge displacement (0 = plain fbm).\nuniform float uWarpAmp;\n\n// Lit glass surface (W9.b) \u2014 gated behind uLit so the flat fill stays default.\nuniform float uLit; // 0 = flat fill (default), 1 = lit droplet\nuniform vec3 uRimColor; // Fresnel rim tint (GAMMA sRGB, via the /color leaf)\nuniform vec3 uLightDir; // normalized light direction (x, y, z)\nuniform float uSpecStrength; // Blinn-Phong specular weight\nuniform float uSpecShininess; // specular exponent (16-64, tight glint)\nuniform float uRimPower; // Fresnel/Schlick exponent (~2-3)\nuniform float uRimStrength; // Fresnel rim weight\n\n// Iridescence + fake subsurface (W11.a) \u2014 translucent-gel read.\nuniform float uIridescence; // warm-pearl rim sheen weight (0 = off)\nuniform float uIridHue; // base hue (radians) the cosine palette biases toward (warm)\nuniform float uIridSpeed; // animated-thickness scroll for the iridescent t\nuniform float uSssScale; // fast-SSS back-light weight\nuniform float uSssPower; // fast-SSS exponent\nuniform float uCoreGlow; // thickness-driven inner-luminosity lift\n\n// Color perturbation (perceptually uniform \u2014 OKLCh L/C/h)\nuniform float uHueRange; // degrees of hue swing (converted to radians)\nuniform float uSatShift; // OKLCh chroma swing\nuniform float uBrightnessShift; // OKLCh lightness bias\nuniform float uColorNoiseFreq;\nuniform float uColorNoiseSpeed;\n\n// Satellites (max 4)\n#define MAX_SATS 4\nuniform int uSatCount;\nuniform vec2 uSatPos[MAX_SATS];\nuniform float uSatRadius[MAX_SATS];\nuniform float uSatOpacity[MAX_SATS];\n\n// Pointer trail (W10) \u2014 a decaying-radius pseudopod toward the cursor. uTrail is a\n// COMPILE-TIME-SIZED array (GLSL ES 3.00 forbids a uniform-sized array) with a\n// DYNAMIC break on uTrailCount, mirroring the satellite loop. Later samples paint\n// smaller metaballs (r *= 1 - i/N) so the trail tapers into a tail.\n#define TRAIL_N 15\nuniform int uTrailCount;\nuniform vec2 uTrailPos[TRAIL_N];\nuniform float uTrailRadius[TRAIL_N];\n\n// Velocity-driven volume-preserving squash-and-stretch (W10).\nuniform vec2 uVelocity; // smoothed pointer velocity (motion direction + speed)\nuniform float uStretch; // squash-stretch magnitude (0 = off)\n\nconst float PI = 3.141592653589793;\n";
|