@mkbabb/glass-ui 3.6.0 → 3.8.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/dist/CardAction-q2qHCJFG.js +157 -0
- package/dist/CollapsibleContent-CP9qF1v4.js +63 -0
- package/dist/{CommandShortcut-BiVyqipe.js → CommandShortcut-SzWRhROC.js} +4 -4
- package/dist/{ContextMenuContent-De01_83g.js → ContextMenuContent-DDa0v27s.js} +1 -1
- package/dist/{ContextMenuSubContent-DrWkXKQP.js → ContextMenuSubContent-Do977Cbf.js} +4 -4
- package/dist/{DataTable-BGVXx0Ww.js → DataTable-CvlWXz65.js} +14 -7
- package/dist/DeckProgress-AVgbIULY.js +23 -0
- package/dist/{DialogContent-IQ8_BRrC.js → DialogContent-DjZWT3lK.js} +24 -24
- package/dist/{DialogFooter-Er0wA3K6.js → DialogFooter-Gprw8H_A.js} +2 -2
- package/dist/{DiscoGlyph-BaZ8OawK.js → DiscoGlyph-CG0F410s.js} +1 -1
- package/dist/{GlyphFace-B_7vOmYn.js → GlyphFace-DRjDkB0s.js} +1 -1
- package/dist/{HoverCardContent-ICfIMZX1.js → HoverCardContent-B6CcQ8He.js} +1 -1
- package/dist/{HoverPopover-DTSYkJtw.js → HoverPopover-D56O6Ylp.js} +1 -1
- package/dist/{IconTooltip-DZlCkU-0.js → IconTooltip-D2T5nYOM.js} +1 -1
- package/dist/{Input-CRJ2owjN.js → Input-DVG_J0ne.js} +4 -1
- package/dist/{Label-CZk-3nTc.js → Label-zRfbQdCn.js} +1 -1
- package/dist/{MetricBadge-BlrdbOGN.js → MetricBadge-lTc002u2.js} +1 -1
- package/dist/{Notification-DP_ApJLo.js → Notification-BxK8LZMw.js} +5 -4
- package/dist/{NumberFieldContent-Bhhmk95p.js → NumberFieldContent-CLNVR1iY.js} +5 -5
- package/dist/{PopoverContent-B8WtJECb.js → PopoverContent-BId6ggf_.js} +2 -2
- package/dist/{Progress-DjM86vfb.js → Progress-iEuD9pxG.js} +7 -7
- package/dist/{ScrollingText-P9o_DuMn.js → ScrollingText-CVyqxvfv.js} +2 -2
- package/dist/{SelectScrollDownButton-BGn3rjs9.js → SelectScrollDownButton-C7TRe-ep.js} +8 -7
- package/dist/{Separator-C2XtAXRp.js → Separator-D7sD7RKj.js} +1 -1
- package/dist/{Switch-x8n6husW.js → Switch-LDKLmmgx.js} +8 -2
- package/dist/TabsList-qyHZ2lKY.js +101 -0
- package/dist/{Toaster-DdhMKfus.js → Toaster-CabYEEF_.js} +54 -60
- package/dist/{ToggleGroupItem-gyXj998A.js → ToggleGroupItem-CkXUcBlt.js} +13 -5
- package/dist/{TooltipProvider-D-JrSqDu.js → TooltipProvider-CmZzCuaG.js} +1 -1
- package/dist/{UnderlineTabs-CuIK16JI.js → UnderlineTabs-Uxn-R3MT.js} +2 -2
- package/dist/animated-digit.js +2 -2
- package/dist/api/index.d.ts +4 -2
- package/dist/api.js +1 -1
- package/dist/aurora.js +753 -359
- package/dist/{badge-Cl6JZ1B7.js → badge-DHQrc_GQ.js} +13 -9
- package/dist/badge.js +1 -1
- package/dist/{button-BcMzVrqs.js → button-CAywcrhO.js} +6 -3
- package/dist/button.js +1 -1
- package/dist/canvas.d.ts +1 -0
- package/dist/canvas.js +3 -0
- package/dist/card.js +2 -2
- package/dist/carousel.js +110 -109
- package/dist/{check-CdkxGxXJ.js → check-BBKKKSTf.js} +1 -1
- package/dist/{chevron-down-pBY8sYfV.js → chevron-down-BSkTP2aL.js} +1 -1
- package/dist/{chevron-right-BjeKC22V.js → chevron-right-sDM0Yvrf.js} +1 -1
- package/dist/{chevron-up-DBeNHUm1.js → chevron-up-CCOD_FTz.js} +1 -1
- package/dist/collapsible.js +1 -1
- package/dist/color-DMLTunJK.js +84 -0
- package/dist/color.js +2 -2
- package/dist/command.js +1 -1
- package/dist/compile-BBTRjvQS.js +158 -0
- package/dist/components/custom/aurora/Aurora.vue.d.ts +1 -0
- package/dist/components/custom/aurora/composables/atoms.d.ts +125 -0
- package/dist/components/custom/aurora/composables/color.d.ts +7 -25
- package/dist/components/custom/aurora/composables/cursorModel.d.ts +35 -2
- package/dist/components/custom/aurora/composables/glSetup.d.ts +1 -1
- package/dist/components/custom/aurora/composables/gpuRuntime.d.ts +16 -0
- package/dist/components/custom/aurora/composables/runtime.d.ts +18 -0
- package/dist/components/custom/aurora/composables/uniformBridge.d.ts +46 -12
- package/dist/components/custom/aurora/composables/useAurora.d.ts +6 -0
- package/dist/components/custom/aurora/composables/useCursorInteraction.d.ts +8 -0
- package/dist/components/custom/aurora/constants/presets.d.ts +60 -4
- package/dist/components/custom/aurora/constants/renderMode.d.ts +32 -0
- package/dist/components/custom/aurora/constants/shaders/aurora.wgsl.d.ts +7 -0
- package/dist/components/custom/aurora/constants/shaders/brush.glsl.d.ts +1 -1
- package/dist/components/custom/aurora/constants/shaders/composition.glsl.d.ts +1 -1
- package/dist/components/custom/aurora/constants/shaders/flow.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/painterly.wgsl.d.ts +7 -0
- package/dist/components/custom/aurora/constants/shaders/wake.wgsl.d.ts +4 -0
- package/dist/components/custom/aurora/index.d.ts +4 -3
- package/dist/components/custom/constellation/Constellation.vue.d.ts +40 -5
- package/dist/components/custom/constellation/constellationField.d.ts +110 -5
- package/dist/components/custom/constellation/index.d.ts +2 -2
- package/dist/components/custom/dock/GlassDock.vue.d.ts +12 -4
- package/dist/components/custom/dock/composables/dockMorphContext.d.ts +57 -0
- package/dist/components/custom/dock/composables/index.d.ts +3 -0
- package/dist/components/custom/dock/composables/useDockHold.d.ts +61 -0
- package/dist/components/custom/dock/composables/useLayerTransition.d.ts +13 -59
- package/dist/components/custom/dock/index.d.ts +2 -0
- package/dist/components/custom/fourier-field/FourierField.vue.d.ts +38 -0
- package/dist/components/custom/fourier-field/index.d.ts +2 -0
- package/dist/components/custom/fourier-field/math.d.ts +57 -0
- package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +15 -0
- package/dist/components/custom/goo-blob/composables/useBlobMood.d.ts +18 -2
- package/dist/components/custom/goo-blob/composables/useBlobPointer.d.ts +47 -4
- package/dist/components/custom/goo-blob/composables/useBlobSatellites.d.ts +2 -0
- package/dist/components/custom/goo-blob/composables/useMetaballRenderer.d.ts +19 -4
- package/dist/components/custom/goo-blob/index.d.ts +1 -1
- package/dist/components/custom/goo-blob/shaders/sdf-body.glsl.d.ts +1 -1
- package/dist/components/custom/goo-blob/shaders/watercolor-edges.glsl.d.ts +2 -2
- package/dist/components/custom/goo-blob/types.d.ts +48 -0
- package/dist/components/custom/metric-cell/MetricCell.vue.d.ts +1 -1
- package/dist/components/custom/metric-stack/MetricStack.vue.d.ts +1 -1
- package/dist/components/ui/_shared/ModalOverlay.vue.d.ts +1 -1
- package/dist/components/ui/alert/index.d.ts +1 -1
- package/dist/components/ui/card/Card.vue.d.ts +26 -3
- package/dist/components/ui/card/CardAction.vue.d.ts +24 -0
- package/dist/components/ui/card/index.d.ts +2 -1
- package/dist/components/ui/collapsible/CollapsibleTrigger.vue.d.ts +5 -1
- package/dist/components/ui/progress/ProgressDefault.vue.d.ts +14 -4
- package/dist/components/ui/slider/Slider.vue.d.ts +3 -1
- package/dist/components/ui/tabs/TabsList.vue.d.ts +13 -3
- package/dist/components/ui/toast/Toast.vue.d.ts +5 -5
- package/dist/components/ui/toast/use-toast.d.ts +1 -1
- package/dist/composables/color/index.d.ts +69 -0
- package/dist/composables/dom/index.d.ts +1 -1
- package/dist/composables/dom/useResolveTokenColor.d.ts +27 -0
- package/dist/composables/glass/canvas2d/index.d.ts +2 -1
- package/dist/composables/glass/canvas2d/resolveCanvasColor.d.ts +20 -0
- package/dist/composables/glass/canvas2d/useCanvas2D.d.ts +15 -1
- package/dist/composables/glass/createGPUCanvas.d.ts +40 -0
- package/dist/composables/glass/index.d.ts +3 -1
- package/dist/composables/glass/useSpecularTracking.d.ts +33 -0
- package/dist/composables/glass/webgl/createCanvasLifecycle.d.ts +45 -0
- package/dist/composables/glass/webgl/shaders/procedural-color.glsl.d.ts +7 -0
- package/dist/composables/glass/webgl/useWebGLCanvas.d.ts +5 -5
- package/dist/composables/motion/core/index.d.ts +1 -0
- package/dist/configurator.js +1 -1
- package/dist/confirm-dialog.js +3 -3
- package/dist/constellation.js +144 -75
- package/dist/context-menu.js +2 -2
- package/dist/controls.js +2 -2
- package/dist/dark.js +1 -1
- package/dist/data-table.js +1 -1
- package/dist/deck-progress.d.ts +1 -0
- package/dist/deck-progress.js +2 -0
- package/dist/dialog.js +2 -2
- package/dist/disco-glyph.js +1 -1
- package/dist/dock.js +388 -287
- package/dist/{dockContext-spUj_-E5.js → dockContext-BKeIMmNk.js} +1 -1
- package/dist/dom.js +6 -6
- package/dist/{dropdown-menu-EFjl5iKo.js → dropdown-menu-B_4bWyyG.js} +5 -5
- package/dist/dropdown-menu.js +1 -1
- package/dist/expandable-container.js +2 -2
- package/dist/fonts/README.md +26 -18
- package/dist/forms.js +10 -7
- package/dist/fourier-field.d.ts +1 -0
- package/dist/fourier-field.js +166 -0
- package/dist/glass-carousel.js +12 -7
- package/dist/glass-panel.js +7 -7
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +209 -206
- package/dist/glyph-face.js +2 -2
- package/dist/goo-blob.js +485 -300
- package/dist/header-ribbon.js +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/hover-popover.js +1 -1
- package/dist/icon-tooltip.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/instrument-chassis.js +1 -1
- package/dist/instrument-rail.js +1 -1
- package/dist/keyboard.js +1 -1
- package/dist/{keys-BFoma9vm.js → keys-BsYjEFOW.js} +1 -1
- package/dist/label.js +1 -1
- package/dist/labeled-field.js +6 -6
- package/dist/metric-badge.js +1 -1
- package/dist/metric-stack.js +1 -1
- package/dist/{minimize-2-BP27-qBY.js → minimize-2-lcXOuc6V.js} +1 -1
- package/dist/motion-core.js +68 -98
- package/dist/motion.js +3 -3
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/paper-backdrop.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 +2 -2
- package/dist/resolveCanvasColor-BBiYfp8g.js +11 -0
- package/dist/responsive-tabs.js +2 -2
- package/dist/scrolling-text.js +1 -1
- package/dist/{search-DBG8qaRs.js → search-nbkvr2dC.js} +1 -1
- package/dist/search.js +12 -12
- package/dist/select.js +3 -3
- package/dist/separator.js +1 -1
- package/dist/{sheet-CQYYrkr9.js → sheet-VZEtNFvO.js} +4 -4
- package/dist/sheet.js +1 -1
- package/dist/slider-D9puf-Ko.js +142 -0
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +3 -3
- package/dist/styles/components.css +1 -1
- package/dist/styles/dock-controls.css +21 -18
- package/dist/styles/dock.css +415 -224
- package/dist/styles/fonts.css +0 -25
- package/dist/styles/glass.css +100 -41
- package/dist/styles/theme.css +58 -2
- package/dist/styles/tokens.css +139 -32
- package/dist/styles/typography.css +55 -72
- package/dist/styles/utilities.css +19 -14
- package/dist/styles/view-transition.css +12 -40
- package/dist/supportsCssTimeline-C5oe0lnD.js +12 -0
- package/dist/switch.js +1 -1
- package/dist/tabs.js +5 -5
- package/dist/timeline.js +3 -3
- package/dist/toast.js +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{useAnimatedNumber-DfVgP4te.js → useAnimatedNumber-C_3wZLx4.js} +1 -1
- package/dist/{useCanvas2D-BeNJqqIS.js → useCanvas2D-ClrQuZtp.js} +2 -1
- package/dist/{useConfiguratorState-DUtC1jxr.js → useConfiguratorState-CMff4GzH.js} +5 -5
- package/dist/useResolveTokenColor-r9pnNjqK.js +24 -0
- package/dist/useScrollProgress-C9ysDic5.js +35 -0
- package/dist/useSpecularTracking-BVRZsRHA.js +26 -0
- package/dist/{useTextHighlight-Dmtofpk2.js → useTextHighlight-9nMW23Qb.js} +1 -1
- package/dist/{useTouchGate-CS5Csc2h.js → useTouchGate-WFyJYsth.js} +1 -1
- package/dist/vReveal-CqaCz_mC.js +44 -0
- package/dist/watercolor-dot.js +2 -2
- package/dist/{x-C4pz9nbD.js → x-Dfsegz9Y.js} +1 -1
- package/package.json +64 -4
- package/src/fonts/README.md +26 -18
- package/src/styles/dock-controls.css +21 -18
- package/src/styles/dock.css +415 -224
- package/src/styles/fonts.css +0 -25
- package/src/styles/glass.css +100 -41
- package/src/styles/theme.css +58 -2
- package/src/styles/tokens.css +139 -32
- package/src/styles/typography.css +55 -72
- package/src/styles/utilities.css +19 -14
- package/src/styles/view-transition.css +12 -40
- package/dist/CardFooter-C390imy7.js +0 -129
- package/dist/CollapsibleContent-cauTbZEM.js +0 -52
- package/dist/TabsIndicator-DA0x9gPr.js +0 -97
- package/dist/color-DS-iLRVM.js +0 -33
- package/dist/compile-C62K_FpC.js +0 -106
- package/dist/fonts/fraunces/fraunces-latin.woff2 +0 -0
- package/dist/slider-CgNzRSh6.js +0 -129
- package/dist/useViewTransition-DI0Rs2rV.js +0 -21
- package/dist/vReveal-u2wSG2El.js +0 -35
- package/src/fonts/fraunces/fraunces-latin.woff2 +0 -0
- /package/dist/{InstrumentChassis-DaHIZCqy.js → InstrumentChassis-C2f6cBaQ.js} +0 -0
- /package/dist/{InstrumentRail-B0qqLFN0.js → InstrumentRail-CUJ05YVG.js} +0 -0
- /package/dist/{ModalOverlay-B_CBtqcE.js → ModalOverlay-B1GkAjNb.js} +0 -0
- /package/dist/{PaperBackdrop-D_YZW47j.js → PaperBackdrop-CqwjnfLv.js} +0 -0
- /package/dist/{SelectGroup-CMdoCjRE.js → SelectGroup-BFiod7X2.js} +0 -0
- /package/dist/{SelectSeparator-CaJnPF3_.js → SelectSeparator-L8pPEn4L.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-C1je1s0u.js → _plugin-vue_export-helper-ok8pgSl5.js} +0 -0
- /package/dist/composables/{dom → motion}/useTextHighlight.d.ts +0 -0
- /package/dist/{constants-C8NMonuo.js → constants-BPOqYJAm.js} +0 -0
- /package/dist/{createContext-DBMGRlx4.js → createContext-B44Sah_H.js} +0 -0
- /package/dist/{createLucideIcon-DuDoe_ra.js → createLucideIcon-B6uNAU9G.js} +0 -0
- /package/dist/{menuItemVariants-C2QlXqT3.js → menuItemVariants-DKM85SNE.js} +0 -0
- /package/dist/{presets-Dyv9Zl7W.js → presets-D1XPuTj-.js} +0 -0
- /package/dist/{prng-CjVgzjQT.js → prng-COGhh02-.js} +0 -0
- /package/dist/{useGlassRenderer-Dn3WpfG-.js → useGlassRenderer-5I0YkI4t.js} +0 -0
- /package/dist/{useGlobalDark-D7R9OypB.js → useGlobalDark-D3EBWzXK.js} +0 -0
- /package/dist/{useIntersectionPause-DsQYGc8V.js → useIntersectionPause-Bj4sPkMh.js} +0 -0
- /package/dist/{useInterval-CHVYFpXV.js → useInterval-CcLfq2WU.js} +0 -0
- /package/dist/{useKeyboardShortcuts-i8tHd5WO.js → useKeyboardShortcuts-BXWXOZ-9.js} +0 -0
- /package/dist/{useResizeObserver-DX-STszm.js → useResizeObserver-CWCbk5Px.js} +0 -0
- /package/dist/{useSortable-muI29agz.js → useSortable-MGAbCGVJ.js} +0 -0
- /package/dist/{useSpringMount-CnizvZGm.js → useSpringMount-BJSHcLl3.js} +0 -0
- /package/dist/{useTimer-DGgoxTXL.js → useTimer-3xqf_54b.js} +0 -0
- /package/dist/{useUserInvalidAria-DmvZ_6Dx.js → useUserInvalidAria-DoJKMZ3s.js} +0 -0
- /package/dist/{useViewportReady-Dcvf0c4p.js → useViewportReady-RIr5Wgkh.js} +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { colorUnit2 as e, gamutMapOKLab as t, interpolateHue as n, isInSRGBGamut as r, oklabToLinearSRGB as i, oklabToRgb255 as a, parseCSSColor as o, rawOklabToOklch as s, rawOklchToOklab as c, srgbToOKLab as l } from "@mkbabb/value.js";
|
|
2
|
+
//#region src/composables/color/index.ts
|
|
3
|
+
function u(e) {
|
|
4
|
+
let [t, n, r] = c(e.L, e.C, e.h), [a, o, s] = i(t, n, r);
|
|
5
|
+
return [
|
|
6
|
+
Math.max(0, a),
|
|
7
|
+
Math.max(0, o),
|
|
8
|
+
Math.max(0, s)
|
|
9
|
+
];
|
|
10
|
+
}
|
|
11
|
+
function d(e, t, n) {
|
|
12
|
+
if (!Number.isFinite(e) || !Number.isFinite(t) || !Number.isFinite(n)) throw Error(`warmCatchLight: non-finite OKLCh anchor (L=${e}, C=${t}, h=${n})`);
|
|
13
|
+
return u({
|
|
14
|
+
L: e,
|
|
15
|
+
C: t,
|
|
16
|
+
h: n
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function f(e) {
|
|
20
|
+
let [t, n, r] = c(e.L, e.C, e.h), [i, o, s] = a(t, n, r), l = (e) => Math.min(1, Math.max(0, e / 255));
|
|
21
|
+
return [
|
|
22
|
+
l(i),
|
|
23
|
+
l(o),
|
|
24
|
+
l(s)
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
function p(t) {
|
|
28
|
+
let n = e(o(t), "rgb").value, [r, i, a] = l(Number(n.r), Number(n.g), Number(n.b)), [c, u, d] = s(r, i, a);
|
|
29
|
+
return {
|
|
30
|
+
L: c,
|
|
31
|
+
C: u,
|
|
32
|
+
h: d
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function m(e) {
|
|
36
|
+
let [t, n, r] = c(e.L, e.C, e.h), [i, o, s] = a(t, n, r), l = (e) => Math.round(e).toString(16).padStart(2, "0");
|
|
37
|
+
return `#${l(i)}${l(o)}${l(s)}`;
|
|
38
|
+
}
|
|
39
|
+
var h = (e) => f(p(e)), g = {
|
|
40
|
+
complementary: "longer",
|
|
41
|
+
"split-complementary": "longer",
|
|
42
|
+
analogous: "shorter",
|
|
43
|
+
monochrome: "shorter",
|
|
44
|
+
triad: "increasing",
|
|
45
|
+
tetradic: "increasing"
|
|
46
|
+
}, _ = (e) => (e % 360 + 360) % 360;
|
|
47
|
+
function v(e, t, r, i) {
|
|
48
|
+
let a = g[t], o = (e, t) => _(n(_(e) / 360, _(t) / 360, i, a) * 360);
|
|
49
|
+
switch (t) {
|
|
50
|
+
case "monochrome": return _(e);
|
|
51
|
+
case "complementary": return o(e, e + 180);
|
|
52
|
+
case "split-complementary": return o(e + 150, e + 210);
|
|
53
|
+
case "triad": return o(e, e + 240);
|
|
54
|
+
case "tetradic": return o(e, e + 270);
|
|
55
|
+
default: return o(e - r, e + r);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function y(e) {
|
|
59
|
+
let [n, a, o] = c(e.L, e.C, e.h), [l, u, d] = t(n, a, o), [f, p, m] = s(l, u, d), h = p;
|
|
60
|
+
for (let e = 0; e < 6; e++) {
|
|
61
|
+
let [e, t, n] = c(f, h, m), [a, o, s] = i(e, t, n);
|
|
62
|
+
if (r(a, o, s)) break;
|
|
63
|
+
h *= .999;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
L: f,
|
|
67
|
+
C: h,
|
|
68
|
+
h: m
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function b(e, t = {}) {
|
|
72
|
+
let n = typeof e == "string" ? p(e) : e, { stopCount: r = 3, harmony: i = "analogous", lightnessSpread: a = .18, hueSpread: o = 24, chromaBump: s = .03 } = t, c = Math.max(2, Math.min(4, Math.round(r))), l = [];
|
|
73
|
+
for (let e = 0; e < c; e++) {
|
|
74
|
+
let t = c === 1 ? 0 : e / (c - 1), r = n.L - a / 2 + a * t, u = Math.max(0, n.C + s * Math.sin(Math.PI * t)), d = v(n.h, i, o, t);
|
|
75
|
+
l.push(y({
|
|
76
|
+
L: Math.min(.98, Math.max(.05, r)),
|
|
77
|
+
C: u,
|
|
78
|
+
h: d
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
return l;
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { y as a, u as c, v as i, d as l, h as n, m as o, b as r, f as s, p as t };
|
package/dist/color.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e,
|
|
2
|
-
export {
|
|
1
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./color-DMLTunJK.js";
|
|
2
|
+
export { c as cssToOklch, i as defaultBlobColorResolver, o as deriveBlobPalette, n as deriveHue, e as gamutMapStop, a as oklchStopToHex, s as oklchToGammaRgb, t as oklchToLinear, r as warmCatchLight };
|
package/dist/command.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./CommandShortcut-
|
|
1
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./CommandShortcut-SzWRhROC.js";
|
|
2
2
|
export { r as Command, t as CommandDialog, s as CommandEmpty, a as CommandGroup, e as CommandInput, n as CommandItem, o as CommandList, i as CommandSeparator, c as CommandShortcut };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
//#region src/composables/glass/webgl/shaders/procedural-color.glsl.ts
|
|
2
|
+
var e = "\nfloat srgbToLinearCh(float c) {\n return c <= 0.04045 ? c / 12.92 : pow((c + 0.055) / 1.055, 2.4);\n}\nvec3 srgbToLinear(vec3 c) {\n return vec3(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfloat linearToSrgbCh(float c) {\n return c <= 0.0031308 ? c * 12.92 : 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nvec3 linearToSrgb(vec3 c) {\n return vec3(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}", t = "const mat2 FBM_ROT = mat2(0.8, 0.6, -0.6, 0.8);", n = "\n// value.js LINEAR_SRGB_TO_LMS (constants.ts), row-major; written here as GLSL\n// columns (= the transpose) so mat3 * vec3 evaluates the row-major M·v.\nconst mat3 LINEAR_SRGB_TO_LMS = mat3(\n 0.4122214708, 0.2119034982, 0.0883024619,\n 0.5363325363, 0.6806995451, 0.2817188376,\n 0.0514459929, 0.1073969566, 0.6299787005\n);\n\n// value.js srgbToOKLab's INLINE LMS→OKLab coefficients (gamut.ts lines 295-297 —\n// these differ at the ~1e-9 digit from LMS_TO_OKLAB_MATRIX; use the inline ones to\n// mirror the exact value.js path), row-major → GLSL columns.\nconst mat3 LMS_TO_OKLAB = mat3(\n 0.2104542553, 1.9779984951, 0.0259040371,\n 0.7936177850, -2.4285922050, 0.7827717662,\n -0.0040720468, 0.4505937099, -0.8086757660\n);\n\n// value.js OKLAB_TO_LMS_COEFF (constants.ts), row-major → GLSL columns. Rows:\n// l = [1, 0.3963377774, 0.2158037573], m = [1, -0.1055613458, -0.0638541728],\n// s = [1, -0.0894841775, -1.2914855480].\nconst mat3 OKLAB_TO_LMS = mat3(\n 1.0, 1.0, 1.0,\n 0.3963377774, -0.1055613458, -0.0894841775,\n 0.2158037573, -0.0638541728, -1.2914855480\n);\n\n// value.js LMS_TO_LINEAR_SRGB (constants.ts), row-major → GLSL columns.\nconst mat3 LMS_TO_LINEAR_SRGB = mat3(\n 4.0767416621, -1.2684380046, -0.0041960863,\n -3.3077115913, 2.6097574011, -0.7034186147,\n 0.2309699292, -0.3413193965, 1.7076147010\n);\n\n// Gamma sRGB → raw OKLab (L, a, b). Mirrors value.js srgbToOKLab.\nvec3 srgbToOklab(vec3 c) {\n vec3 lin = srgbToLinear(c);\n vec3 lms = LINEAR_SRGB_TO_LMS * lin;\n vec3 lmsCbrt = sign(lms) * pow(abs(lms), vec3(1.0 / 3.0));\n return LMS_TO_OKLAB * lmsCbrt;\n}\n\n// Raw OKLab (L, a, b) → linear sRGB. Mirrors value.js oklabToLinearSRGB.\nvec3 oklabToLinearSrgb(vec3 lab) {\n vec3 lms_ = OKLAB_TO_LMS * lab;\n vec3 lms = lms_ * lms_ * lms_;\n return LMS_TO_LINEAR_SRGB * lms;\n}\n\n// OKLab → OKLCh: H in RADIANS. Mirrors value.js rawOklabToOklch (which returns\n// degrees; we stay in radians and only fold to [0, 2pi)).\nvec3 oklabToOklch(vec3 lab) {\n float C = length(lab.yz);\n float H = atan(lab.z, lab.y);\n if (H < 0.0) H += 2.0 * PI;\n return vec3(lab.x, C, H);\n}\n\n// OKLCh (H radians) → OKLab. Mirrors value.js rawOklchToOklab.\nvec3 oklchToOklab(vec3 lch) {\n return vec3(lch.x, lch.y * cos(lch.z), lch.y * sin(lch.z));\n}", r = "\n// value.js interpolateHue in the NORMALIZED-TURNS domain (h_rad/TAU → turns, the\n// exact .5/+1.0 branch per method, fract() wrap, *TAU back). A radians-native port\n// (PI thresholds / +TAU wrap) diverges 180° at the antipode. methods: 0 shorter,\n// 1 longer, 2 increasing, 3 decreasing.\nfloat interpolateHueTurns(float h0, float h1, float t, int method) {\n float TAU = 2.0 * PI;\n float a = h0 / TAU;\n float b = h1 / TAU;\n float i = b - a;\n if (method == 0) { // shorter\n if (i > 0.5) a += 1.0; else if (i < -0.5) b += 1.0;\n } else if (method == 1) { // longer\n if (i > 0.0 && i < 0.5) a += 1.0; else if (i > -0.5 && i <= 0.0) b += 1.0;\n } else if (method == 2) { // increasing\n if (i < 0.0) b += 1.0;\n } else { // decreasing\n if (i > 0.0) a += 1.0;\n }\n float r = a + t * (b - a);\n r = fract(r); // (r % 1 + 1) % 1 — fract is non-negative in GLSL\n return r * TAU; // back to radians\n}\n\n// Linear-sRGB endpoint pair → OKLab-rectangular interpolation → linear sRGB. Holds\n// chroma across the ramp (no grey midpoint). The default/shorter ramp path.\nvec3 mixPaletteOklab(vec3 linA, vec3 linB, float t) {\n vec3 labA = LMS_TO_OKLAB * (sign(LINEAR_SRGB_TO_LMS * linA) * pow(abs(LINEAR_SRGB_TO_LMS * linA), vec3(1.0 / 3.0)));\n vec3 labB = LMS_TO_OKLAB * (sign(LINEAR_SRGB_TO_LMS * linB) * pow(abs(LINEAR_SRGB_TO_LMS * linB), vec3(1.0 / 3.0)));\n vec3 lab = mix(labA, labB, t);\n return oklabToLinearSrgb(lab);\n}\n\n// Linear-sRGB endpoint pair → OKLCh interpolation along the huePath arc → linear\n// sRGB. L and C lerp; H walks the chosen arc. The deliberate-rainbow path.\nvec3 mixPaletteOklchArc(vec3 linA, vec3 linB, float t, int method) {\n vec3 labA = LMS_TO_OKLAB * (sign(LINEAR_SRGB_TO_LMS * linA) * pow(abs(LINEAR_SRGB_TO_LMS * linA), vec3(1.0 / 3.0)));\n vec3 labB = LMS_TO_OKLAB * (sign(LINEAR_SRGB_TO_LMS * linB) * pow(abs(LINEAR_SRGB_TO_LMS * linB), vec3(1.0 / 3.0)));\n vec3 lchA = oklabToOklch(labA);\n vec3 lchB = oklabToOklch(labB);\n float L = mix(lchA.x, lchB.x, t);\n float C = mix(lchA.y, lchB.y, t);\n float H = interpolateHueTurns(lchA.z, lchB.z, t, method);\n return oklabToLinearSrgb(oklchToOklab(vec3(L, C, H)));\n}\n\n// The ramp dispatcher both samplePalette ports splice. tRaw is the raw inter-stop\n// parameter [0,1]; the smoothstep ease + the huePath branch live HERE so the GLSL\n// and WGSL ramps are character-for-character one source. increasing(2)/decreasing(3)\n// take the OKLCh hue-arc (rainbow sweep); every other method takes the OKLab-\n// rectangular straight line (no hue detour).\nvec3 samplePaletteRamp(vec3 a, vec3 b, float tRaw, int huePath) {\n float t = smoothstep(0.0, 1.0, tRaw);\n if (huePath == 2 || huePath == 3) {\n return mixPaletteOklchArc(a, b, t, huePath);\n }\n return mixPaletteOklab(a, b, t);\n}", i = "\n// Jarzynski PCG2D — uvec2 → uvec2 permuted-congruential hash (JCGT 2020).\nuvec2 pcg2d(uvec2 v) {\n v = v * 1664525u + 1013904223u;\n v.x += v.y * 1664525u;\n v.y += v.x * 1664525u;\n v = v ^ (v >> 16u);\n v.x += v.y * 1664525u;\n v.y += v.x * 1664525u;\n v = v ^ (v >> 16u);\n return v;\n}\n\n// Float→[0,1) scalar hash: bit-reinterpret the lattice coordinate, pcg2d it, take the\n// high word back to [0,1). Integer-bit — no sin() periodicity, no float-fract lattice.\nfloat pcgHash2(vec2 p) {\n uvec2 u = floatBitsToUint(p);\n return float(pcg2d(u).x) * (1.0 / 4294967296.0);\n}\n\n// Integer-lattice gradient: pcg2d the integer cell, fold the hash to an angle, return\n// the unit gradient vector. The gradient basis (not a scalar value) is what makes the\n// noise zero at the nodes (no value-noise plateaus).\nvec2 pcgGrad2(ivec2 cell) {\n uvec2 h = pcg2d(uvec2(cell));\n float ang = float(h.x) * (1.0 / 4294967296.0) * 6.28318530717958647692;\n return vec2(cos(ang), sin(ang));\n}\n\n// 2D SIMPLEX gradient noise (Gustavson skew). The skew transform F2/G2 maps the square\n// lattice onto a simplex (triangular) grid — no axis-aligned directional bias. Each of\n// the three simplex corners contributes grad·offset shaped by a radial (0.5 - r²)⁴\n// falloff. Output is ~[-1, 1]; callers remap to [0,1] via 0.5 + 0.5*gnoise.\nfloat gnoise(vec2 p) {\n const float F2 = 0.36602540378443864676; // (sqrt(3) - 1) / 2\n const float G2 = 0.21132486540518711775; // (3 - sqrt(3)) / 6\n float s = (p.x + p.y) * F2;\n vec2 i = floor(p + s);\n float tt = (i.x + i.y) * G2;\n vec2 x0 = p - (i - tt); // offset from the simplex origin corner\n ivec2 i1 = (x0.x > x0.y) ? ivec2(1, 0) : ivec2(0, 1);\n vec2 x1 = x0 - vec2(i1) + G2;\n vec2 x2 = x0 - 1.0 + 2.0 * G2;\n ivec2 ii = ivec2(i);\n float n = 0.0;\n float t0 = 0.5 - dot(x0, x0);\n if (t0 > 0.0) { t0 *= t0; n += t0 * t0 * dot(pcgGrad2(ii), x0); }\n float t1 = 0.5 - dot(x1, x1);\n if (t1 > 0.0) { t1 *= t1; n += t1 * t1 * dot(pcgGrad2(ii + i1), x1); }\n float t2 = 0.5 - dot(x2, x2);\n if (t2 > 0.0) { t2 *= t2; n += t2 * t2 * dot(pcgGrad2(ii + ivec2(1, 1)), x2); }\n return 70.0 * n; // normalize to ~[-1, 1]\n}", a = "\nfn srgbToLinearCh(c: f32) -> f32 {\n return select(pow((c + 0.055) / 1.055, 2.4), c / 12.92, c <= 0.04045);\n}\nfn srgbToLinear(c: vec3f) -> vec3f {\n return vec3f(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\nfn linearToSrgbCh(c: f32) -> f32 {\n return select(1.055 * pow(c, 1.0 / 2.4) - 0.055, c * 12.92, c <= 0.0031308);\n}\nfn linearToSrgb(c: vec3f) -> vec3f {\n return vec3f(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}", o = "const FBM_ROT: mat2x2f = mat2x2f(0.8, 0.6, -0.6, 0.8);", s = "\nconst LINEAR_SRGB_TO_LMS: mat3x3f = mat3x3f(\n 0.4122214708, 0.2119034982, 0.0883024619,\n 0.5363325363, 0.6806995451, 0.2817188376,\n 0.0514459929, 0.1073969566, 0.6299787005\n);\nconst LMS_TO_OKLAB: mat3x3f = mat3x3f(\n 0.2104542553, 1.9779984951, 0.0259040371,\n 0.7936177850, -2.4285922050, 0.7827717662,\n -0.0040720468, 0.4505937099, -0.8086757660\n);\nconst OKLAB_TO_LMS: mat3x3f = mat3x3f(\n 1.0, 1.0, 1.0,\n 0.3963377774, -0.1055613458, -0.0894841775,\n 0.2158037573, -0.0638541728, -1.2914855480\n);\nconst LMS_TO_LINEAR_SRGB: mat3x3f = mat3x3f(\n 4.0767416621, -1.2684380046, -0.0041960863,\n -3.3077115913, 2.6097574011, -0.7034186147,\n 0.2309699292, -0.3413193965, 1.7076147010\n);\n\nfn srgbToOklab(c: vec3f) -> vec3f {\n let lin = srgbToLinear(c);\n let lms = LINEAR_SRGB_TO_LMS * lin;\n let lmsCbrt = sign(lms) * pow(abs(lms), vec3f(1.0 / 3.0));\n return LMS_TO_OKLAB * lmsCbrt;\n}\nfn oklabToLinearSrgb(lab: vec3f) -> vec3f {\n let lms_ = OKLAB_TO_LMS * lab;\n let lms = lms_ * lms_ * lms_;\n return LMS_TO_LINEAR_SRGB * lms;\n}\nfn oklabToOklch(lab: vec3f) -> vec3f {\n let C = length(lab.yz);\n var H = atan2(lab.z, lab.y);\n if (H < 0.0) { H = H + 2.0 * PI; }\n return vec3f(lab.x, C, H);\n}\nfn oklchToOklab(lch: vec3f) -> vec3f {\n return vec3f(lch.x, lch.y * cos(lch.z), lch.y * sin(lch.z));\n}", c = "\nfn interpolateHueTurns(h0: f32, h1: f32, t: f32, method: i32) -> f32 {\n let TAU = 2.0 * PI;\n var a = h0 / TAU;\n var b = h1 / TAU;\n let i = b - a;\n if (method == 0) { // shorter\n if (i > 0.5) { a = a + 1.0; } else if (i < -0.5) { b = b + 1.0; }\n } else if (method == 1) { // longer\n if (i > 0.0 && i < 0.5) { a = a + 1.0; } else if (i > -0.5 && i <= 0.0) { b = b + 1.0; }\n } else if (method == 2) { // increasing\n if (i < 0.0) { b = b + 1.0; }\n } else { // decreasing\n if (i > 0.0) { a = a + 1.0; }\n }\n let r = fract(a + t * (b - a));\n return r * TAU;\n}\n\nfn mixPaletteOklab(linA: vec3f, linB: vec3f, t: f32) -> vec3f {\n let labA = LMS_TO_OKLAB * (sign(LINEAR_SRGB_TO_LMS * linA) * pow(abs(LINEAR_SRGB_TO_LMS * linA), vec3f(1.0 / 3.0)));\n let labB = LMS_TO_OKLAB * (sign(LINEAR_SRGB_TO_LMS * linB) * pow(abs(LINEAR_SRGB_TO_LMS * linB), vec3f(1.0 / 3.0)));\n let lab = mix(labA, labB, vec3f(t));\n return oklabToLinearSrgb(lab);\n}\n\nfn mixPaletteOklchArc(linA: vec3f, linB: vec3f, t: f32, method: i32) -> vec3f {\n let labA = LMS_TO_OKLAB * (sign(LINEAR_SRGB_TO_LMS * linA) * pow(abs(LINEAR_SRGB_TO_LMS * linA), vec3f(1.0 / 3.0)));\n let labB = LMS_TO_OKLAB * (sign(LINEAR_SRGB_TO_LMS * linB) * pow(abs(LINEAR_SRGB_TO_LMS * linB), vec3f(1.0 / 3.0)));\n let lchA = oklabToOklch(labA);\n let lchB = oklabToOklch(labB);\n let L = mix(lchA.x, lchB.x, t);\n let C = mix(lchA.y, lchB.y, t);\n let H = interpolateHueTurns(lchA.z, lchB.z, t, method);\n return oklabToLinearSrgb(oklchToOklab(vec3f(L, C, H)));\n}\n\nfn samplePaletteRamp(a: vec3f, b: vec3f, tRaw: f32, huePath: i32) -> vec3f {\n let t = smoothstep(0.0, 1.0, tRaw);\n if (huePath == 2 || huePath == 3) {\n return mixPaletteOklchArc(a, b, t, huePath);\n }\n return mixPaletteOklab(a, b, t);\n}", l = "\nfn pcg2d(v0: vec2u) -> vec2u {\n var v = v0 * 1664525u + vec2u(1013904223u);\n v.x = v.x + v.y * 1664525u;\n v.y = v.y + v.x * 1664525u;\n v = v ^ (v >> vec2u(16u));\n v.x = v.x + v.y * 1664525u;\n v.y = v.y + v.x * 1664525u;\n v = v ^ (v >> vec2u(16u));\n return v;\n}\n\nfn pcgHash2(p: vec2f) -> f32 {\n let u = bitcast<vec2u>(p);\n return f32(pcg2d(u).x) * (1.0 / 4294967296.0);\n}\n\nfn pcgGrad2(cell: vec2i) -> vec2f {\n let h = pcg2d(bitcast<vec2u>(cell));\n let ang = f32(h.x) * (1.0 / 4294967296.0) * 6.28318530717958647692;\n return vec2f(cos(ang), sin(ang));\n}\n\nfn gnoise(p: vec2f) -> f32 {\n let F2 = 0.36602540378443864676;\n let G2 = 0.21132486540518711775;\n let s = (p.x + p.y) * F2;\n let i = floor(p + vec2f(s));\n let tt = (i.x + i.y) * G2;\n let x0 = p - (i - vec2f(tt));\n var i1 = vec2i(0, 1);\n if (x0.x > x0.y) { i1 = vec2i(1, 0); }\n let x1 = x0 - vec2f(i1) + vec2f(G2);\n let x2 = x0 - vec2f(1.0) + vec2f(2.0 * G2);\n let ii = vec2i(i);\n var n = 0.0;\n var t0 = 0.5 - dot(x0, x0);\n if (t0 > 0.0) { t0 = t0 * t0; n = n + t0 * t0 * dot(pcgGrad2(ii), x0); }\n var t1 = 0.5 - dot(x1, x1);\n if (t1 > 0.0) { t1 = t1 * t1; n = n + t1 * t1 * dot(pcgGrad2(ii + i1), x1); }\n var t2 = 0.5 - dot(x2, x2);\n if (t2 > 0.0) { t2 = t2 * t2; n = n + t2 * t2 * dot(pcgGrad2(ii + vec2i(1, 1)), x2); }\n return 70.0 * n;\n}";
|
|
3
|
+
function u(e, t, n) {
|
|
4
|
+
return Math.max(t, Math.min(n, e));
|
|
5
|
+
}
|
|
6
|
+
function d() {
|
|
7
|
+
let e = typeof window < "u" && window.devicePixelRatio || 1;
|
|
8
|
+
return Math.min(e, 2);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/composables/glass/webgl/createCanvasLifecycle.ts
|
|
12
|
+
function f(e) {
|
|
13
|
+
let { canvas: t, buildContext: n, resize: r } = e, i = e.respectReducedMotion ?? e.mode !== "capture", a = /* @__PURE__ */ new Set();
|
|
14
|
+
e.mode === "capture" && a.add("manual");
|
|
15
|
+
let o = () => a.size === 0, s = 0, c = typeof performance < "u" ? performance.now() : 0, l = null, u = !1, d = !1, f = i && typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-reduced-motion: reduce)") : null, p = f?.matches ?? !1;
|
|
16
|
+
function m() {
|
|
17
|
+
if (!o() || !l) return;
|
|
18
|
+
let e = (performance.now() - c) / 1e3, t = l.time ? l.time(e) : e;
|
|
19
|
+
l.frame(t), s = !p && l.shouldContinue() ? requestAnimationFrame(m) : 0;
|
|
20
|
+
}
|
|
21
|
+
function h() {
|
|
22
|
+
u && o() && !s && l && (s = requestAnimationFrame(m));
|
|
23
|
+
}
|
|
24
|
+
function g() {
|
|
25
|
+
let e = f?.matches ?? !1;
|
|
26
|
+
e !== p && (p = e, e || (c = performance.now()), h());
|
|
27
|
+
}
|
|
28
|
+
f?.addEventListener("change", g);
|
|
29
|
+
function _(e = "manual") {
|
|
30
|
+
let t = o();
|
|
31
|
+
a.add(e), t && !o() && (cancelAnimationFrame(s), s = 0);
|
|
32
|
+
}
|
|
33
|
+
function v(e = "manual") {
|
|
34
|
+
let t = !o();
|
|
35
|
+
a.delete(e), t && o() && u && l && (c = performance.now() - 1e3, m());
|
|
36
|
+
}
|
|
37
|
+
let y = typeof document < "u";
|
|
38
|
+
function b() {
|
|
39
|
+
document.hidden ? _("tab-hidden") : v("tab-hidden");
|
|
40
|
+
}
|
|
41
|
+
y && document.addEventListener("visibilitychange", b), y && document.hidden && a.add("tab-hidden");
|
|
42
|
+
let x = null;
|
|
43
|
+
function S(e) {
|
|
44
|
+
e.skipped ? _("off-screen") : v("off-screen");
|
|
45
|
+
}
|
|
46
|
+
function C() {
|
|
47
|
+
if (x) return;
|
|
48
|
+
let e = t.parentElement;
|
|
49
|
+
e && (x = e, e.addEventListener("contentvisibilityautostatechange", S));
|
|
50
|
+
}
|
|
51
|
+
function w() {
|
|
52
|
+
x?.removeEventListener("contentvisibilityautostatechange", S), x = null;
|
|
53
|
+
}
|
|
54
|
+
function T() {
|
|
55
|
+
l = n(), r();
|
|
56
|
+
}
|
|
57
|
+
function E() {
|
|
58
|
+
u || d || (e.bindContextEvents?.(() => {
|
|
59
|
+
d || (T(), o() && h());
|
|
60
|
+
}, () => {
|
|
61
|
+
l = null, cancelAnimationFrame(s), s = 0;
|
|
62
|
+
}), T(), C(), u = !0, c = performance.now(), o() && (s = requestAnimationFrame(m)));
|
|
63
|
+
}
|
|
64
|
+
function D(e) {
|
|
65
|
+
u || E(), l?.frame(e);
|
|
66
|
+
}
|
|
67
|
+
function O() {
|
|
68
|
+
d = !0, cancelAnimationFrame(s), s = 0, y && document.removeEventListener("visibilitychange", b), f?.removeEventListener("change", g), w(), e.unbindContextEvents?.(), l?.teardown?.(), l = null, a.clear();
|
|
69
|
+
}
|
|
70
|
+
return e.mode === "capture" && E(), {
|
|
71
|
+
arm: E,
|
|
72
|
+
suspend: _,
|
|
73
|
+
resume: v,
|
|
74
|
+
wake: h,
|
|
75
|
+
renderAt: D,
|
|
76
|
+
dispose: O,
|
|
77
|
+
get armed() {
|
|
78
|
+
return u;
|
|
79
|
+
},
|
|
80
|
+
get disposed() {
|
|
81
|
+
return d;
|
|
82
|
+
},
|
|
83
|
+
get running() {
|
|
84
|
+
return o();
|
|
85
|
+
},
|
|
86
|
+
get reducedMotion() {
|
|
87
|
+
return p;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/composables/glass/webgl/useWebGLCanvas.ts
|
|
93
|
+
function p(e, t) {
|
|
94
|
+
let { setup: n, contextAttrs: r } = t, i = null, a = null, o = null;
|
|
95
|
+
function s() {
|
|
96
|
+
let t = e.getContext("webgl2", r ?? void 0);
|
|
97
|
+
if (!t) throw Error("[useWebGLCanvas] WebGL2 unavailable");
|
|
98
|
+
return i = t, o = n(i), a || (a = new ResizeObserver(() => o?.resize()), a.observe(e)), {
|
|
99
|
+
frame: o.frame,
|
|
100
|
+
shouldContinue: o.shouldContinue,
|
|
101
|
+
time: o.time,
|
|
102
|
+
teardown: () => {
|
|
103
|
+
o?.teardown?.(), i?.getExtension("WEBGL_lose_context")?.loseContext(), a?.disconnect(), a = null, i = null, o = null;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
let c = null, l = null;
|
|
108
|
+
function u(e) {
|
|
109
|
+
e.preventDefault(), i = null, o = null, l?.();
|
|
110
|
+
}
|
|
111
|
+
let d = f({
|
|
112
|
+
canvas: e,
|
|
113
|
+
mode: t.mode,
|
|
114
|
+
respectReducedMotion: t.respectReducedMotion,
|
|
115
|
+
buildContext: s,
|
|
116
|
+
resize: () => o?.resize(),
|
|
117
|
+
bindContextEvents: (t, n) => {
|
|
118
|
+
c = t, l = n, e.addEventListener("webglcontextlost", u, !1), e.addEventListener("webglcontextrestored", c, !1);
|
|
119
|
+
},
|
|
120
|
+
unbindContextEvents: () => {
|
|
121
|
+
e.removeEventListener("webglcontextlost", u, !1), c && e.removeEventListener("webglcontextrestored", c, !1);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
arm: d.arm,
|
|
126
|
+
suspend: d.suspend,
|
|
127
|
+
resume: d.resume,
|
|
128
|
+
wake: d.wake,
|
|
129
|
+
renderAt: d.renderAt,
|
|
130
|
+
dispose: d.dispose,
|
|
131
|
+
get gl() {
|
|
132
|
+
return i;
|
|
133
|
+
},
|
|
134
|
+
get reducedMotion() {
|
|
135
|
+
return d.reducedMotion;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region src/composables/glass/webgl/compile.ts
|
|
141
|
+
function m(e, t, n, r = "[glass-ui:webgl]") {
|
|
142
|
+
let i = e.createShader(t);
|
|
143
|
+
if (e.shaderSource(i, n), e.compileShader(i), !e.getShaderParameter(i, e.COMPILE_STATUS)) {
|
|
144
|
+
let t = e.getShaderInfoLog(i) ?? "unknown";
|
|
145
|
+
throw e.deleteShader(i), Error(`${r} shader compile failed:\n${t}`);
|
|
146
|
+
}
|
|
147
|
+
return i;
|
|
148
|
+
}
|
|
149
|
+
function h(e, t, n, r = "[glass-ui:webgl]") {
|
|
150
|
+
let i = e.createProgram();
|
|
151
|
+
if (e.attachShader(i, t), e.attachShader(i, n), e.linkProgram(i), !e.getProgramParameter(i, e.LINK_STATUS)) {
|
|
152
|
+
let t = e.getProgramInfoLog(i) ?? "unknown";
|
|
153
|
+
throw e.deleteProgram(i), Error(`${r} program link failed:\n${t}`);
|
|
154
|
+
}
|
|
155
|
+
return i;
|
|
156
|
+
}
|
|
157
|
+
//#endregion
|
|
158
|
+
export { u as a, o as c, n as d, s as f, l as g, i as h, f as i, e as l, c as m, h as n, d as o, r as p, p as r, t as s, m as t, a as u };
|
|
@@ -82,6 +82,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
82
82
|
setCursor: (x: number, y: number, strength?: number) => void;
|
|
83
83
|
clearCursor: () => void;
|
|
84
84
|
setCursorRadius: (r: number) => void;
|
|
85
|
+
injectCursorVelocity: (dx: number, dy: number) => void;
|
|
85
86
|
renderAt: (t: number) => void;
|
|
86
87
|
pause: () => void;
|
|
87
88
|
resume: () => void;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AX.W10 — the aurora "atoms of control" door: the ONE consumer-facing surface
|
|
3
|
+
* over the ~28-field author schema. `AuroraConfig` is the INTERNAL author schema
|
|
4
|
+
* (the full escape hatch a preset author types against); `resolveAtoms` is the
|
|
5
|
+
* SIMPLIFIED door the live config UI + every consumer drives.
|
|
6
|
+
*
|
|
7
|
+
* The atoms are the user's named control elements (§2.7) — COLOR, ZONES, NOISE,
|
|
8
|
+
* MEDIUM(+texture), MOTION — ≤7 intuitive knobs, each normalized and total
|
|
9
|
+
* (Burley's "Principled" 5-rule discipline: intuitive, few, normalized, robust for
|
|
10
|
+
* EVERY combination). Each atom maps to a co-varying cluster of config fields so one
|
|
11
|
+
* knob moves the entangled axes together (a single COLOR-energy knob co-varies
|
|
12
|
+
* saturation + valueVariance + breath + the warm/cool temperature, because moving any
|
|
13
|
+
* one alone reads as a defect).
|
|
14
|
+
*
|
|
15
|
+
* Contract (machine-asserted by proof:aurora-atoms-roundtrip):
|
|
16
|
+
* - TOTAL — every atom combination (incl. out-of-range/adversarial inputs) produces
|
|
17
|
+
* a VALID in-range `AuroraConfig` respecting every `budget.ts` cap (no NaN, no
|
|
18
|
+
* out-of-range field). Clamp/saturate, never garbage.
|
|
19
|
+
* - DEFAULT-PRESERVING — `resolveAtoms(DEFAULT_ATOMS)` deep-equals
|
|
20
|
+
* `DEFAULT_AURORA_CONFIG` (the wispy-sky default survives the door).
|
|
21
|
+
*
|
|
22
|
+
* Mechanism: clone `DEFAULT_AURORA_CONFIG` and apply ONLY the atoms that are PRESENT
|
|
23
|
+
* as clamped overrides. An absent atom keeps the default's value, so the empty atom
|
|
24
|
+
* set (`DEFAULT_ATOMS`) resolves to exactly the wispy-sky default by construction.
|
|
25
|
+
*/
|
|
26
|
+
import { type AuroraConfig, type AuroraMedium, type OklchStop } from "../constants/presets";
|
|
27
|
+
import { type AuroraHarmony } from "./color";
|
|
28
|
+
/** The motion atom — the three motion registers. */
|
|
29
|
+
export type AuroraMotionAtom = "still" | "breathing" | "drifting";
|
|
30
|
+
/**
|
|
31
|
+
* The ZONES arrangement character — selects the nuclei placement prior. NOT a bare
|
|
32
|
+
* integer count: the same count reads as a different field per arrangement.
|
|
33
|
+
* - `scattered` — radial-ish spread off the centre (loose, atmospheric).
|
|
34
|
+
* - `composed` — the rule-of-thirds prior (the deliberate, balanced field).
|
|
35
|
+
* - `centred` — a tight central cluster (one dominant glow, calm).
|
|
36
|
+
*/
|
|
37
|
+
export type AuroraZoneArrangement = "scattered" | "composed" | "centred";
|
|
38
|
+
/** The ZONES atom — a count + an arrangement character (default `composed`). */
|
|
39
|
+
export interface AuroraZones {
|
|
40
|
+
/** 1..MAX_NUCLEI — the number of color zones (nuclei). Clamped. */
|
|
41
|
+
count: number;
|
|
42
|
+
/** The placement prior. Default `composed` (rule-of-thirds). */
|
|
43
|
+
arrangement?: AuroraZoneArrangement;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The MEDIUM atom — the painterly medium + (only for a TEXTURED medium) its dominant
|
|
47
|
+
* texture amount. `amount` is STRUCTURALLY ABSENT for `smooth`: a smooth medium has
|
|
48
|
+
* no dominant texture knob, so the door does not offer/accept one (no silent-inert
|
|
49
|
+
* arm). For a textured medium `amount` (0..1) drives the medium's signature knob.
|
|
50
|
+
*/
|
|
51
|
+
export type AuroraMediumAtom = {
|
|
52
|
+
kind: "smooth";
|
|
53
|
+
} | {
|
|
54
|
+
kind: Exclude<AuroraMedium, "smooth">;
|
|
55
|
+
amount?: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* The interactivity atom — ONLY the wired axes ship. `light` (cursor-as-light) and
|
|
59
|
+
* `scroll` (scroll-coupled palette/breath) are wired downstream
|
|
60
|
+
* (`frameLoop.ts`/`useAurora.ts`); the declared-but-unwired `flow`/`wake` axes are
|
|
61
|
+
* EXCISED from the shipped atom shape (no declared-but-dead axis — excise-or-wire).
|
|
62
|
+
*/
|
|
63
|
+
export interface AuroraInteractivityAtom {
|
|
64
|
+
/** cursor drives the impasto light direction (cursor-as-light + idle orbit). */
|
|
65
|
+
light?: boolean;
|
|
66
|
+
/** palette/breath progress couples to scroll (via useScrollProgress). */
|
|
67
|
+
scroll?: boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The Tier-1 atoms of control (≤7) — the user's named control elements. EVERY atom is
|
|
71
|
+
* OPTIONAL; an absent atom keeps the wispy-sky default for the fields it would drive,
|
|
72
|
+
* so `DEFAULT_ATOMS` (the empty set) resolves to `DEFAULT_AURORA_CONFIG`.
|
|
73
|
+
*/
|
|
74
|
+
export interface AuroraAtoms {
|
|
75
|
+
/** A seed color (CSS string or an OklchStop anchor) → drives the derived palette. */
|
|
76
|
+
seed?: string | OklchStop;
|
|
77
|
+
/** The hue scheme across the derived ramp. Default `analogous` (when a seed is set). */
|
|
78
|
+
harmony?: AuroraHarmony;
|
|
79
|
+
/**
|
|
80
|
+
* 0..1 — the color ENERGY knob. One scalar co-varies the entangled chroma/value
|
|
81
|
+
* cluster: saturation, valueVariance, breath, AND the warm-light/cool-shadow
|
|
82
|
+
* temperature on the derived palette. 0 = calm/muted, 1 = vivid/charged. A
|
|
83
|
+
* continuous curve, not a 3-point named LUT.
|
|
84
|
+
*/
|
|
85
|
+
colorEnergy?: number;
|
|
86
|
+
/** The color zones (nuclei) — a count + an arrangement character. */
|
|
87
|
+
zones?: AuroraZones;
|
|
88
|
+
/**
|
|
89
|
+
* 0..1 — the NOISE knob. One scalar fans to the organic-boundary cluster:
|
|
90
|
+
* warpAmount (how much the zones distort), warpScale (the distortion frequency),
|
|
91
|
+
* warpMode (smooth fBm → cellular as it climbs), and noiseOctaves (detail). 0 =
|
|
92
|
+
* clean isotropic zones, 1 = turbulent organic edges.
|
|
93
|
+
*/
|
|
94
|
+
noise?: number;
|
|
95
|
+
/** The painterly medium + (textured mediums only) its dominant texture amount. */
|
|
96
|
+
medium?: AuroraMediumAtom;
|
|
97
|
+
/** still | breathing | drifting — the three motion registers. */
|
|
98
|
+
motion?: AuroraMotionAtom;
|
|
99
|
+
/** The pointer/scroll interactivity axes (default OFF). Only `light`/`scroll` ship. */
|
|
100
|
+
interactivity?: AuroraInteractivityAtom;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The default atoms — the EMPTY set. `resolveAtoms(DEFAULT_ATOMS)` deep-equals the
|
|
104
|
+
* wispy-sky `DEFAULT_AURORA_CONFIG` (machine-asserted). The user explicitly asked the
|
|
105
|
+
* default to be preserved; the empty-atom pass-through is how the door honors it.
|
|
106
|
+
*/
|
|
107
|
+
export declare const DEFAULT_ATOMS: AuroraAtoms;
|
|
108
|
+
/**
|
|
109
|
+
* The deterministic nuclei prior for `count` zones under an `arrangement` character.
|
|
110
|
+
* ONE home for the rule-of-thirds prior (the AW duplicated prior pair is gone). Total:
|
|
111
|
+
* clamps `count` to `[1, MAX_NUCLEI]`; every arrangement yields a valid in-range nuclei
|
|
112
|
+
* array.
|
|
113
|
+
*
|
|
114
|
+
* - `composed` — the rule-of-thirds anchor table (the deliberate balanced field).
|
|
115
|
+
* - `scattered` — a golden-angle (φ⁻¹) low-discrepancy spread off-centre (loose).
|
|
116
|
+
* - `centred` — a tight cluster around the centre (one dominant glow).
|
|
117
|
+
*/
|
|
118
|
+
export declare function nucleiPrior(count: number, arrangement?: AuroraZoneArrangement): AuroraConfig["nuclei"];
|
|
119
|
+
/**
|
|
120
|
+
* Expand the ≤7 Tier-1 atoms into a full, valid, in-range `AuroraConfig`. A PURE,
|
|
121
|
+
* TOTAL function: clones the wispy-sky default and applies ONLY the present atoms as
|
|
122
|
+
* clamped overrides, so the empty atom set resolves to exactly `DEFAULT_AURORA_CONFIG`
|
|
123
|
+
* and every atom combination yields a config respecting every `budget.ts` cap.
|
|
124
|
+
*/
|
|
125
|
+
export declare function resolveAtoms(atoms?: AuroraAtoms): AuroraConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type OklchStop } from "../../../../composables/color";
|
|
1
|
+
import { type ColorHarmony, type OklchStop } from "../../../../composables/color";
|
|
3
2
|
export { cssToOklch, oklchStopToHex, oklchToLinear, } from "../../../../composables/color";
|
|
4
3
|
export type { OklchStop } from "../../../../composables/color";
|
|
4
|
+
export type { ColorHarmony } from "../../../../composables/color";
|
|
5
5
|
/**
|
|
6
6
|
* Pack up to `maxStops` OklchStops into linear-sRGB triples. When `out` is
|
|
7
7
|
* provided the buffer is filled in place (no allocation) — the runtime owns a
|
|
@@ -26,19 +26,12 @@ export declare function flattenPalette(stops: OklchStop[], maxStops?: number, ou
|
|
|
26
26
|
export declare function paletteToCssGradient(stops: OklchStop[]): string;
|
|
27
27
|
export declare function hexToOklchStop(hex: string): OklchStop;
|
|
28
28
|
/**
|
|
29
|
-
* Harmony schemes for {@link deriveAurora}
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* - `complementary` — stops travel from the seed hue toward its opposite (+180°)
|
|
34
|
-
* along the LONG arc (keeps the ramp saturated; the short arc cuts through grey
|
|
35
|
-
* on a warm→cool pair — the muddy-midtone defect).
|
|
36
|
-
* - `split-complementary` — anchor + the two hues flanking the complement (±150/210).
|
|
37
|
-
* - `triad` — stops distributed across the seed hue and its two 120° partners.
|
|
38
|
-
* - `tetradic` — anchor + the three 90° partners (90/180/270).
|
|
39
|
-
* - `monochrome` — every stop holds the seed hue; only L and C travel.
|
|
29
|
+
* Harmony schemes for {@link deriveAurora} — the PUBLIC alias of the shared
|
|
30
|
+
* `ColorHarmony` vocabulary hoisted to the `/color` leaf (AW.W11.b). The blob and
|
|
31
|
+
* aurora derive from this ONE union; aurora keeps the `AuroraHarmony` name for
|
|
32
|
+
* surface preservation. See `ColorHarmony` for the per-scheme semantics.
|
|
40
33
|
*/
|
|
41
|
-
export type AuroraHarmony =
|
|
34
|
+
export type AuroraHarmony = ColorHarmony;
|
|
42
35
|
/**
|
|
43
36
|
* Eased L/C journey shapes for the derived ramp. `bell` (the W5 default for chroma)
|
|
44
37
|
* peaks the chroma in the mids and desaturates the extremes — the painterly
|
|
@@ -85,14 +78,3 @@ export interface DeriveAuroraOptions {
|
|
|
85
78
|
* @param options ramp shape — stop count, harmony, L/C/h spreads.
|
|
86
79
|
*/
|
|
87
80
|
export declare function deriveAurora(seed: string | OklchStop, options?: DeriveAuroraOptions): OklchStop[];
|
|
88
|
-
/** Atmospheric mood words for {@link deriveScene}. */
|
|
89
|
-
export type AuroraMood = "atmospheric" | "painterly" | "vivid" | "muted";
|
|
90
|
-
/**
|
|
91
|
-
* Seed ONE color + a mood word into a WHOLE `AuroraConfig` — palette (via
|
|
92
|
-
* `deriveAurora`), nuclei layout (a rule-of-thirds/golden prior), medium, and the
|
|
93
|
-
* motion/output knobs the mood implies. A SUPERSET front door over `deriveAurora`:
|
|
94
|
-
* a consumer hands a seed + `"painterly"` and gets a coherent backdrop, not just a
|
|
95
|
-
* palette. The base is the wispy-sky `DEFAULT_AURORA_CONFIG` (every field the mood
|
|
96
|
-
* does not touch stays the library default).
|
|
97
|
-
*/
|
|
98
|
-
export declare function deriveScene(seed: string | OklchStop, mood?: AuroraMood): AuroraConfig;
|
|
@@ -20,6 +20,14 @@ export declare const CURSOR_DECAY_PER_FRAME = 0.992;
|
|
|
20
20
|
* below this the next frame is visually identical, so the loop may park.
|
|
21
21
|
*/
|
|
22
22
|
export declare const CURSOR_REST_EPSILON = 0.001;
|
|
23
|
+
/**
|
|
24
|
+
* AW.W8.1 — the velocity-burst decay per frame. A fast pointer flick injects a
|
|
25
|
+
* transient `burst` that eases out over ~1s (≈0.96^60 ≈ 0.09 after 1s at 60fps),
|
|
26
|
+
* distinct from the steady attraction. The velocity itself eases faster (it tracks
|
|
27
|
+
* the live pointer delta, not a lingering field).
|
|
28
|
+
*/
|
|
29
|
+
export declare const CURSOR_BURST_DECAY_PER_FRAME = 0.96;
|
|
30
|
+
export declare const CURSOR_VELOCITY_LERP = 0.3;
|
|
23
31
|
/** The mutable eased-cursor state. `strength` ramps in; `targetStrength` decays. */
|
|
24
32
|
export interface CursorState {
|
|
25
33
|
x: number;
|
|
@@ -29,14 +37,39 @@ export interface CursorState {
|
|
|
29
37
|
strength: number;
|
|
30
38
|
targetStrength: number;
|
|
31
39
|
radius: number;
|
|
40
|
+
/**
|
|
41
|
+
* AW.W8.1 — the smoothed pointer velocity (delta per move, eased). The
|
|
42
|
+
* velocity-reactive flow consumes its magnitude; a fast flick spikes it. Units
|
|
43
|
+
* are normalized-screen per move (clamped to avoid a teleport spike).
|
|
44
|
+
*/
|
|
45
|
+
velX: number;
|
|
46
|
+
velY: number;
|
|
47
|
+
/**
|
|
48
|
+
* AW.W8.1 — the transient swirl-BURST a fast flick injects (decays over ~1s).
|
|
49
|
+
* The flow shader reads this as a decaying velocity-driven term, distinct from
|
|
50
|
+
* the steady `strength` attraction.
|
|
51
|
+
*/
|
|
52
|
+
burst: number;
|
|
32
53
|
}
|
|
33
54
|
/** A fresh at-rest cursor (centred, no attraction, default radius). */
|
|
34
55
|
export declare function createCursorState(): CursorState;
|
|
35
56
|
/**
|
|
36
57
|
* Advance the cursor easing one frame — snappy approach toward the target
|
|
37
|
-
* position, gentle decay of the attraction strength when idle.
|
|
58
|
+
* position, gentle decay of the attraction strength when idle. AW.W8.1: also eases
|
|
59
|
+
* the velocity toward zero and decays the swirl-burst. `tempo` (the master tempo
|
|
60
|
+
* scalar, default 1; 0 under PRM/pause) scales the velocity + burst toward stillness
|
|
61
|
+
* so the whole interactive stack freezes when tempo is 0 — `tempo` multiplies the
|
|
62
|
+
* retained fraction, NOT `uTime` (scaling the clock makes the flow jump; the
|
|
63
|
+
* integration step scales, the absolute clock keeps marching — the W11 discipline).
|
|
64
|
+
*/
|
|
65
|
+
export declare function advanceCursor(cursor: CursorState, tempo?: number): void;
|
|
66
|
+
/**
|
|
67
|
+
* AW.W8.1 — feed a pointer delta into the velocity + burst. Called from the
|
|
68
|
+
* `pointermove` listener, which MUST early-out on reduced-motion BEFORE calling this
|
|
69
|
+
* (the cursor write-path PRM check — the listener fires independent of the rAF loop).
|
|
70
|
+
* The delta is clamped so a teleport (tab-in, scroll jump) does not spike a giant burst.
|
|
38
71
|
*/
|
|
39
|
-
export declare function
|
|
72
|
+
export declare function injectCursorVelocity(cursor: CursorState, dx: number, dy: number): void;
|
|
40
73
|
/**
|
|
41
74
|
* True while the cursor is still easing (position not yet at target, or strength
|
|
42
75
|
* not yet decayed below ε). The render-demand gate ORs this with the config drift
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* shader-uniform boundary: a NEW uniform name must be added here, and the cache is
|
|
10
10
|
* keyed off it, so a fresh uniform always gets a location slot.
|
|
11
11
|
*/
|
|
12
|
-
export declare const UNIFORM_NAMES: readonly ["uTime", "uPalette", "uStopCount", "uNucleiCount", "uNucleiPos", "uNucleiRadius", "uNucleiPaletteBias", "uNucleiValueBias", "uNucleiDriftRadius", "uNucleiDriftPhase", "uNucleiElong", "uNucleiAngle", "uSoftmaxBeta", "uValueVariance", "uWarpAmount", "uWarpScale", "uWarpDrift", "uWarpMode", "uNoiseOctaves", "uMedium", "uHuePath", "uFlowPattern", "uFlowFocal", "uFlowAngle", "uFlowCurl", "uCursor", "uCursorStrength", "uCursorRadius", "uStrokeAmount", "uStrokeScale", "uStrokeAnisotropy", "uStrokeLayers", "uStrokeMode", "uWetEdge", "uGranulation", "uImpasto", "uBrokenColor", "uCanvasGrain", "uNucleiDrift", "uPaletteDrift", "uBreathDepth", "uBreathPeriod", "uSaturation", "uPaperGrain", "uAlpha"];
|
|
12
|
+
export declare const UNIFORM_NAMES: readonly ["uTime", "uPalette", "uStopCount", "uNucleiCount", "uNucleiPos", "uNucleiRadius", "uNucleiPaletteBias", "uNucleiValueBias", "uNucleiDriftRadius", "uNucleiDriftPhase", "uNucleiElong", "uNucleiAngle", "uSoftmaxBeta", "uValueVariance", "uWarpAmount", "uWarpScale", "uWarpDrift", "uWarpMode", "uNoiseOctaves", "uMedium", "uHuePath", "uFlowPattern", "uFlowFocal", "uFlowAngle", "uFlowCurl", "uCursor", "uCursorStrength", "uCursorRadius", "uCursorVelocity", "uCursorBurst", "uStrokeAmount", "uStrokeScale", "uStrokeAnisotropy", "uStrokeLayers", "uStrokeMode", "uStrokeOrient", "uLightDir", "uLightColor", "uWetEdge", "uGranulation", "uImpasto", "uBrokenColor", "uCanvasGrain", "uNucleiDrift", "uPaletteDrift", "uBreathDepth", "uBreathPeriod", "uSaturation", "uPaperGrain", "uAlpha"];
|
|
13
13
|
export type UniformName = (typeof UNIFORM_NAMES)[number];
|
|
14
14
|
export type UniformLocations = Record<UniformName, WebGLUniformLocation | null>;
|
|
15
15
|
export interface GlProgram {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GPUCanvasFrame, GPUCanvasSetupArgs } from "../../../../composables/glass/createGPUCanvas";
|
|
2
|
+
import type { CursorState } from "./cursorModel";
|
|
3
|
+
import type { AuroraConfig } from "../constants/presets";
|
|
4
|
+
export interface GPUAuroraDeps {
|
|
5
|
+
canvas: HTMLCanvasElement;
|
|
6
|
+
getConfig: () => AuroraConfig;
|
|
7
|
+
cursor: CursorState;
|
|
8
|
+
getReducedMotion: () => boolean;
|
|
9
|
+
/** The frozen frame-time offset under reduced motion (matches the WebGL2 path). */
|
|
10
|
+
frozenOffset: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The `setup` callback for `createGPUCanvas`. Builds the pipeline once on the device,
|
|
14
|
+
* returns the frame hooks. The single render pass draws the WGSL aurora base field.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createGPUAuroraSetup(deps: GPUAuroraDeps): ({ device, context, format }: GPUCanvasSetupArgs) => GPUCanvasFrame;
|
|
@@ -72,6 +72,15 @@ export interface AuroraRuntimeOptions {
|
|
|
72
72
|
* `instance.arm()` on the deferred path — rethrows from `arm()`.
|
|
73
73
|
*/
|
|
74
74
|
onInitError?: (err: Error) => void;
|
|
75
|
+
/**
|
|
76
|
+
* AW.W7b — the WebGPU backend route. When a `GPUDevice` is supplied (the
|
|
77
|
+
* `resolveRenderModeAsync` probe resolved a non-fallback adapter), the runtime
|
|
78
|
+
* routes to `createGPUCanvas` drawing the SAME single-pass aurora over WebGPU;
|
|
79
|
+
* otherwise the WebGL2 fragment path is the universal fallback. `useAurora` runs
|
|
80
|
+
* the probe past first paint (the CSS placeholder paints first) and threads the
|
|
81
|
+
* device here. `null`/absent → the WebGL2 path (the zero-regression default).
|
|
82
|
+
*/
|
|
83
|
+
gpuDevice?: GPUDevice | null;
|
|
75
84
|
}
|
|
76
85
|
/**
|
|
77
86
|
* The concrete `createAurora` return shape. It IS an {@link AuroraInstance}
|
|
@@ -83,5 +92,14 @@ export interface AuroraRuntimeOptions {
|
|
|
83
92
|
export interface AuroraRuntime extends Omit<AuroraInstance, "pause" | "resume"> {
|
|
84
93
|
pause(reason?: SuspendReason): void;
|
|
85
94
|
resume(reason?: SuspendReason): void;
|
|
95
|
+
/**
|
|
96
|
+
* AW.W8.1 — feed a pointer delta into the velocity-reactive flow (a fast flick →
|
|
97
|
+
* a transient swirl-burst). The PRM early-out lives here: the injection is
|
|
98
|
+
* suppressed when the substrate reports reduced-motion (the cursor write-path
|
|
99
|
+
* fires from the pointermove listener, INDEPENDENT of the parked rAF loop).
|
|
100
|
+
*/
|
|
101
|
+
injectCursorVelocity(dx: number, dy: number): void;
|
|
102
|
+
/** AW.W8.1 — the live reduced-motion state (the cursor listener early-outs on it). */
|
|
103
|
+
readonly reducedMotion: boolean;
|
|
86
104
|
}
|
|
87
105
|
export declare function createAurora(canvas: HTMLCanvasElement, initial: AuroraConfig, options?: AuroraRuntimeOptions): AuroraRuntime;
|