@mkbabb/glass-ui 8.0.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/aurora.js +371 -349
  2. package/dist/blob.js +42 -42
  3. package/dist/{checkbox-BnXuGgJ3.js → checkbox-B1qn65se.js} +1 -1
  4. package/dist/checkbox.js +1 -1
  5. package/dist/color.glsl-DTJhdekG.js +34 -0
  6. package/dist/color.wgsl-BTszLY39.js +398 -0
  7. package/dist/{command-BuBnYpxF.js → command-tEzAaVY_.js} +1 -1
  8. package/dist/command.js +1 -1
  9. package/dist/components/_shared/control.d.ts +0 -1
  10. package/dist/components/_shared/index.d.ts +0 -1
  11. package/dist/components/aurora/Aurora.vue.d.ts +1 -0
  12. package/dist/components/aurora/composables/frameLoop.d.ts +6 -5
  13. package/dist/components/aurora/composables/runtime.d.ts +26 -1
  14. package/dist/components/aurora/composables/useAurora.d.ts +28 -0
  15. package/dist/components/aurora/composables/wgpuSetup.d.ts +1 -1
  16. package/dist/components/aurora/constants/presets.d.ts +44 -5
  17. package/dist/components/aurora/index.d.ts +1 -1
  18. package/dist/components/configurator/Configurator.vue.d.ts +25 -2
  19. package/dist/components/configurator/ConfiguratorRow.vue.d.ts +4 -2
  20. package/dist/components/configurator/styles.css +1 -1
  21. package/dist/components/dock/DockSeparator.vue.d.ts +2 -3
  22. package/dist/components/dock/GlassDock.vue.d.ts +1 -0
  23. package/dist/components/dock/composables/dockContext.d.ts +1 -8
  24. package/dist/components/dock/composables/useDockRun.d.ts +20 -0
  25. package/dist/components/dock/composables/useDockSearch.d.ts +1 -1
  26. package/dist/components/dock/composables/useDockShellProps.d.ts +18 -101
  27. package/dist/components/dock/composables/useDockState.d.ts +2 -9
  28. package/dist/components/dock/constants.d.ts +15 -0
  29. package/dist/components/dock/index.d.ts +2 -2
  30. package/dist/components/dock/styles/controls/icon-button.css +1 -1
  31. package/dist/components/dock/styles/controls/tab-button.css +1 -1
  32. package/dist/components/dock/styles/controls/triggers.css +1 -1
  33. package/dist/components/dock/styles/controls.css +1 -1
  34. package/dist/components/dock/styles/density.css +1 -1
  35. package/dist/components/dock/styles/index.css +1 -1
  36. package/dist/components/dock/styles/layer-group.css +1 -1
  37. package/dist/components/dock/styles/layers.css +1 -1
  38. package/dist/components/dock/styles/morph.css +1 -1
  39. package/dist/components/dock/styles/run.css +1 -0
  40. package/dist/components/dock/styles/search.css +1 -1
  41. package/dist/components/dock/styles/shape.css +1 -1
  42. package/dist/components/dock/styles/shell-regions.css +1 -1
  43. package/dist/components/dock/styles/shell.css +1 -1
  44. package/dist/components/fourier-field/FourierField.vue.d.ts +28 -25
  45. package/dist/components/fourier-field/clock.d.ts +35 -0
  46. package/dist/components/fourier-field/constants.d.ts +78 -103
  47. package/dist/components/fourier-field/index.d.ts +3 -28
  48. package/dist/components/fourier-field/math.d.ts +69 -77
  49. package/dist/components/fourier-field/renderer/mint.d.ts +50 -0
  50. package/dist/components/fourier-field/renderer/uniforms.d.ts +84 -0
  51. package/dist/components/fourier-field/renderer/wgpu.d.ts +28 -0
  52. package/dist/components/fourier-field/shaders/compute.wgsl.d.ts +1 -0
  53. package/dist/components/fourier-field/shaders/render.wgsl.d.ts +1 -0
  54. package/dist/components/fourier-field/useFourierField.d.ts +49 -0
  55. package/dist/components/handmark/HandMark.vue.d.ts +18 -14
  56. package/dist/components/handmark/index.d.ts +4 -23
  57. package/dist/components/handmark/stroke.d.ts +92 -0
  58. package/dist/composables/dark/darkModeSyncScript.d.ts +19 -0
  59. package/dist/composables/motion/pointer/pointerFieldMappings.d.ts +0 -41
  60. package/dist/{components/search/composables → composables/search}/index.d.ts +2 -2
  61. package/dist/{components/search/composables/fuzzySearchIndex.d.ts → composables/search/match.d.ts} +8 -3
  62. package/dist/configurator-BHJymdrF.js +339 -0
  63. package/dist/configurator.js +1 -1
  64. package/dist/constellation.js +2 -2
  65. package/dist/control-DJp15L4U.js +7 -0
  66. package/dist/{dark-z_P5QwqI.js → dark-CLlmo7dD.js} +2 -2
  67. package/dist/dark-mode-toggle.js +1 -1
  68. package/dist/dark.js +1 -1
  69. package/dist/dock.js +712 -486
  70. package/dist/dom.js +90 -8
  71. package/dist/easing.js +3 -3
  72. package/dist/expandable-container-BY1hQXi4.js +142 -0
  73. package/dist/expandable-container.js +2 -142
  74. package/dist/fourier-field.js +643 -855
  75. package/dist/fourier-math.js +6 -6
  76. package/dist/glass-ui.css +1 -1
  77. package/dist/glass-ui.js +85 -72
  78. package/dist/handmark.js +330 -718
  79. package/dist/index.d.ts +1 -1
  80. package/dist/labeled-field.js +2 -2
  81. package/dist/{menu-wLu1XGKn.js → menu-TDMNtZjG.js} +1 -1
  82. package/dist/menu.js +1 -1
  83. package/dist/motion-core.js +34 -34
  84. package/dist/{participation-B0hdsIRo.js → participation-Di4UHbzk.js} +8 -8
  85. package/dist/{pointerFieldMappings-DP5tla5z.js → pointerFieldMappings-DXwlU5uj.js} +7 -23
  86. package/dist/{popover-DBMKTPkL.js → popover-C04Rrdcz.js} +1 -1
  87. package/dist/popover.js +1 -1
  88. package/dist/{radio-group-Ci8o-pDx.js → radio-group-BNV7PN1O.js} +1 -1
  89. package/dist/radio-group.js +1 -1
  90. package/dist/{select-CDgwGH_P.js → select-COox45Kv.js} +1 -1
  91. package/dist/select.js +1 -1
  92. package/dist/{slider-gsc8jDIo.js → slider-5ChjjWSR.js} +1 -1
  93. package/dist/slider.js +1 -1
  94. package/dist/styles/components.css +1 -1
  95. package/dist/styles/glass/material.css +1 -1
  96. package/dist/styles/glass/overlay-plate.css +1 -1
  97. package/dist/{switch-DxZzDrmV.js → switch-lLkbREB-.js} +1 -1
  98. package/dist/switch.js +1 -1
  99. package/dist/{tabs-CYscnq5H.js → tabs-DSJMd1Et.js} +1 -1
  100. package/dist/tabs.js +1 -1
  101. package/dist/{toggle-group-11aPGMfE.js → toggle-group-DUcmKnDw.js} +1 -1
  102. package/dist/toggle-group.js +1 -1
  103. package/dist/{tooltip-DqKMZ4dn.js → tooltip-BKk2qVDn.js} +1 -1
  104. package/dist/tooltip.js +1 -1
  105. package/dist/{resolveCanvasColor-6MCrswTB.js → useCanvas2D-CQRElMyE.js} +1 -11
  106. package/dist/useResolveTokenColor-B2FfJnd9.js +24 -0
  107. package/package.json +2 -20
  108. package/dist/canvas.d.ts +0 -1
  109. package/dist/canvas.js +0 -2
  110. package/dist/color.wgsl-B0N3mKMb.js +0 -412
  111. package/dist/compile-D7VYG3gi.js +0 -19
  112. package/dist/components/dock/composables/useDockOverflowFit.d.ts +0 -20
  113. package/dist/components/dock/composables/useDockTouchGate.d.ts +0 -42
  114. package/dist/components/dock/styles/overflow.css +0 -1
  115. package/dist/components/fourier-field/composables/fourierFieldGLSetup.d.ts +0 -24
  116. package/dist/components/fourier-field/composables/fourierFieldWGPUSetup.d.ts +0 -31
  117. package/dist/components/fourier-field/composables/uniformBridgeWGPU.d.ts +0 -39
  118. package/dist/components/fourier-field/composables/useFourierField.d.ts +0 -56
  119. package/dist/components/fourier-field/shaders/fourier-field.compute.wgsl.d.ts +0 -1
  120. package/dist/components/fourier-field/shaders/fourier-field.glsl.d.ts +0 -4
  121. package/dist/components/fourier-field/shaders/fourier-field.render.wgsl.d.ts +0 -1
  122. package/dist/components/fourier-field/shaders/fourier-field.ribbon.d.ts +0 -51
  123. package/dist/components/handmark/brush.d.ts +0 -269
  124. package/dist/components/handmark/composables/useHandMark.d.ts +0 -99
  125. package/dist/components/handmark/constants.d.ts +0 -69
  126. package/dist/components/handmark/freehand.d.ts +0 -69
  127. package/dist/components/handmark/geometry.d.ts +0 -62
  128. package/dist/components/handmark/ink.d.ts +0 -11
  129. package/dist/components/handmark/noise.d.ts +0 -30
  130. package/dist/components/handmark/texture.d.ts +0 -39
  131. package/dist/components/handmark/types.d.ts +0 -70
  132. package/dist/components/search/SearchBar.vue.d.ts +0 -38
  133. package/dist/components/search/index.d.ts +0 -8
  134. package/dist/components/search/searchVariants.d.ts +0 -16
  135. package/dist/configurator-BoeScnDL.js +0 -311
  136. package/dist/control-Da4XeT43.js +0 -11
  137. package/dist/search.d.ts +0 -1
  138. package/dist/search.js +0 -61
  139. package/dist/useFuzzySearch-CUnZknpm.js +0 -177
  140. package/dist/useResolveTokenColor-CspQv_ik.js +0 -107
  141. /package/dist/{components/search/composables → composables/search}/types.d.ts +0 -0
  142. /package/dist/{components/search/composables → composables/search}/useFuzzySearch.d.ts +0 -0
@@ -0,0 +1,398 @@
1
+ import { n as e, t } from "./createCanvasLifecycle-hJHobVTn.js";
2
+ import { a as n, i as r, o as i, r as a } from "./rendererStatus-BxUlBLVy.js";
3
+ //#region src/composables/glass/webgl/useWebGLCanvas.ts
4
+ function o() {
5
+ if (typeof document > "u") return null;
6
+ let e = null;
7
+ try {
8
+ if (e = document.createElement("canvas").getContext("webgl2"), !e) return null;
9
+ let t = e.getExtension("WEBGL_debug_renderer_info");
10
+ return t ? String(e.getParameter(t.UNMASKED_RENDERER_WEBGL) ?? "").toLowerCase() : null;
11
+ } catch {
12
+ return null;
13
+ } finally {
14
+ e?.getExtension("WEBGL_lose_context")?.loseContext();
15
+ }
16
+ }
17
+ function s(e, n) {
18
+ let { setup: r, contextAttrs: i } = n, a = null, o = null;
19
+ function s() {
20
+ let t = e.getContext("webgl2", i ?? void 0);
21
+ if (!t) throw Error("[useWebGLCanvas] WebGL2 unavailable");
22
+ return a = t, o = r(a), {
23
+ frame: o.frame,
24
+ shouldContinue: o.shouldContinue,
25
+ time: o.time,
26
+ teardown: () => {
27
+ o?.teardown?.(), a?.getExtension("WEBGL_lose_context")?.loseContext(), a = null, o = null;
28
+ }
29
+ };
30
+ }
31
+ let c = null, l = null;
32
+ function u(e) {
33
+ e.preventDefault(), a = null, o = null, l?.();
34
+ }
35
+ let d = t({
36
+ canvas: e,
37
+ mode: n.mode,
38
+ respectReducedMotion: n.respectReducedMotion,
39
+ dprPolicy: n.dprPolicy,
40
+ composeIntersectionPark: n.composeIntersectionPark,
41
+ intersectionRootMargin: n.intersectionRootMargin,
42
+ revealBloom: n.revealBloom,
43
+ onContextStateChange: n.onContextStateChange,
44
+ onContextError: n.onContextError,
45
+ buildContext: s,
46
+ resize: (e) => o?.resize(e),
47
+ bindContextEvents: (t, n) => {
48
+ c = t, l = n, e.addEventListener("webglcontextlost", u, !1), e.addEventListener("webglcontextrestored", c, !1);
49
+ },
50
+ unbindContextEvents: () => {
51
+ e.removeEventListener("webglcontextlost", u, !1), c && e.removeEventListener("webglcontextrestored", c, !1);
52
+ }
53
+ });
54
+ return {
55
+ arm: d.arm,
56
+ presize: d.presize,
57
+ suspend: d.suspend,
58
+ resume: d.resume,
59
+ wake: d.wake,
60
+ renderAt: d.renderAt,
61
+ dispose: d.dispose,
62
+ get gl() {
63
+ return a;
64
+ },
65
+ get reducedMotion() {
66
+ return d.reducedMotion;
67
+ }
68
+ };
69
+ }
70
+ //#endregion
71
+ //#region src/composables/glass/webgpu/webgpuDevice.ts
72
+ var c = class extends Error {
73
+ kind;
74
+ constructor(e, t, n) {
75
+ super(t), this.name = "WebGPUInitError", this.kind = e, n !== void 0 && (this.cause = n);
76
+ }
77
+ };
78
+ function l(e) {
79
+ try {
80
+ let t = e.info;
81
+ if (t?.isFallbackAdapter || e.isFallbackAdapter) return !0;
82
+ if (!t) return !1;
83
+ let n = [
84
+ t.vendor,
85
+ t.architecture,
86
+ t.description
87
+ ].filter((e) => typeof e == "string").join(" ").toLowerCase();
88
+ return n.includes("swiftshader") || n.includes("llvmpipe") || n.includes("software") || n.includes("basic render") || n.includes("microsoft basic");
89
+ } catch {
90
+ return !1;
91
+ }
92
+ }
93
+ var u = 6e3;
94
+ function d(e, t) {
95
+ if (typeof setTimeout > "u") return e;
96
+ let n, r = new Promise((e, r) => {
97
+ n = setTimeout(() => {
98
+ r(new c("acquire-timeout", `[useWebGPUCanvas] ${t}() did not settle within ${u}ms — falling to the WebGL2 net`));
99
+ }, u);
100
+ });
101
+ return Promise.race([e, r]).finally(() => clearTimeout(n));
102
+ }
103
+ //#endregion
104
+ //#region src/composables/glass/webgpu/useWebGPUCanvas.ts
105
+ function f() {
106
+ return typeof navigator < "u" && "gpu" in navigator && navigator.gpu != null;
107
+ }
108
+ var p = null;
109
+ function m(e, t) {
110
+ if (p) return p;
111
+ if (!f()) return Promise.reject(new c("no-navigator-gpu", "[useWebGPUCanvas] navigator.gpu unavailable"));
112
+ let n = (async () => {
113
+ let i = await d(navigator.gpu.requestAdapter(e), "requestAdapter");
114
+ if (!i) throw new c("no-adapter", "[useWebGPUCanvas] no GPU adapter");
115
+ if (l(i)) throw new c("software-adapter", "[useWebGPUCanvas] software WebGPU adapter (SwiftShader/llvmpipe/fallback) — falling to the WebGL2 net");
116
+ let a;
117
+ try {
118
+ a = await d(i.requestDevice(t), "requestDevice");
119
+ } catch (e) {
120
+ throw e instanceof c ? e : new c("device-request", "[useWebGPUCanvas] requestDevice rejected", e);
121
+ }
122
+ return a.lost.then(() => {
123
+ p === n && (p = null);
124
+ }), {
125
+ device: a,
126
+ adapterClass: r(i.info)
127
+ };
128
+ })();
129
+ return n.catch(() => {
130
+ p === n && (p = null);
131
+ }), p = n, n;
132
+ }
133
+ function h(n, r) {
134
+ let { setup: i } = r, a = r.alphaMode ?? "premultiplied", o = null, s = null, l = "bgra8unorm", u = null, d = !1, p = null, h = null, g = "Acquiring adapter", _ = null, v = null, y = null;
135
+ function b() {
136
+ if (!o) throw Error("[useWebGPUCanvas] device not acquired");
137
+ let e = n.getContext("webgpu");
138
+ if (!e) throw Error("[useWebGPUCanvas] WebGPU context unavailable");
139
+ return s = e, l = navigator.gpu.getPreferredCanvasFormat(), e.configure({
140
+ device: o,
141
+ format: l,
142
+ alphaMode: a
143
+ }), o.pushErrorScope("validation"), o.addEventListener("uncapturederror", x), u = i(o, s, l), C(), y = o.popErrorScope(), y.then((e) => {
144
+ e && r.onInitError?.(e);
145
+ }), {
146
+ frame: (e) => u?.frame(e),
147
+ shouldContinue: () => u?.shouldContinue() ?? !1,
148
+ time: (e) => u?.time?.(e) ?? e,
149
+ teardown: S
150
+ };
151
+ }
152
+ function x(e) {
153
+ let t = e.error;
154
+ r.onInitError?.(t);
155
+ }
156
+ function S() {
157
+ u?.teardown?.(), o?.removeEventListener("uncapturederror", x), s?.unconfigure(), s = null, u = null, y = null;
158
+ }
159
+ function C() {
160
+ try {
161
+ u?.resize(e(n, r.dprPolicy)), u?.frame(0);
162
+ } catch {}
163
+ }
164
+ let w = t({
165
+ canvas: n,
166
+ mode: r.mode,
167
+ respectReducedMotion: r.respectReducedMotion,
168
+ dprPolicy: r.dprPolicy,
169
+ composeIntersectionPark: r.composeIntersectionPark,
170
+ intersectionRootMargin: r.intersectionRootMargin,
171
+ revealBloom: r.revealBloom,
172
+ onContextStateChange: (e) => {
173
+ if (e === "lost") {
174
+ r.onContextStateChange?.(e);
175
+ return;
176
+ }
177
+ let t = y;
178
+ if (!t) {
179
+ r.onContextStateChange?.(e);
180
+ return;
181
+ }
182
+ t.then((n) => {
183
+ !d && !n && y === t && r.onContextStateChange?.(e);
184
+ });
185
+ },
186
+ onContextError: (e) => r.onInitError?.(e),
187
+ buildContext: b,
188
+ resize: (e) => u?.resize(e),
189
+ bindContextEvents: (e, t) => {
190
+ _ = e, v = t;
191
+ },
192
+ unbindContextEvents: () => {
193
+ _ = null, v = null;
194
+ }
195
+ });
196
+ async function T() {
197
+ if (!f()) throw new c("no-navigator-gpu", "[useWebGPUCanvas] navigator.gpu unavailable");
198
+ let e = await m(r.adapterOptions, r.deviceDescriptor);
199
+ o = e.device, g = e.adapterClass, E(e.device);
200
+ }
201
+ function E(e) {
202
+ e.lost.then((e) => {
203
+ if (!d) {
204
+ if (v?.(), S(), o = null, e.reason === "destroyed") {
205
+ let t = /* @__PURE__ */ Error(`[useWebGPUCanvas] device destroyed${e.message ? ` (${e.message})` : ""}`);
206
+ h = t, r.onInitError?.(t);
207
+ return;
208
+ }
209
+ T().then(() => {
210
+ d || _?.();
211
+ }).catch((e) => {
212
+ h = e, r.onInitError?.(e);
213
+ });
214
+ }
215
+ });
216
+ }
217
+ async function D() {
218
+ if (!d) {
219
+ if (h) throw h;
220
+ if (p) return p;
221
+ if (o) {
222
+ w.arm();
223
+ return;
224
+ }
225
+ return w.presize(), p = (async () => {
226
+ try {
227
+ if (await T(), d) return;
228
+ if (w.arm(), y) {
229
+ let e = r.mode !== "capture";
230
+ e && w.suspend("manual");
231
+ let t = await y;
232
+ if (d) return;
233
+ if (t) throw new c("pipeline-validation", `[useWebGPUCanvas] pipeline failed validation (${t.message})`);
234
+ e && w.resume("manual");
235
+ }
236
+ } catch (e) {
237
+ throw h = e, S(), e instanceof c || r.onInitError?.(e), e;
238
+ } finally {
239
+ p = null;
240
+ }
241
+ })(), p;
242
+ }
243
+ }
244
+ return {
245
+ armAsync: D,
246
+ arm: () => {
247
+ o && w.arm();
248
+ },
249
+ presize: w.presize,
250
+ suspend: w.suspend,
251
+ resume: w.resume,
252
+ wake: w.wake,
253
+ renderAt: w.renderAt,
254
+ dispose: () => {
255
+ d = !0, w.dispose(), o = null;
256
+ },
257
+ get device() {
258
+ return o;
259
+ },
260
+ get adapterClass() {
261
+ return g;
262
+ },
263
+ get reducedMotion() {
264
+ return w.reducedMotion;
265
+ }
266
+ };
267
+ }
268
+ //#endregion
269
+ //#region src/composables/glass/webgpu/useGpuSubstrate.ts
270
+ function g(e, t) {
271
+ let r;
272
+ return r = s(e, {
273
+ mode: t.mode,
274
+ respectReducedMotion: t.respectReducedMotion,
275
+ contextAttrs: t.contextAttrs,
276
+ dprPolicy: t.dprPolicy,
277
+ composeIntersectionPark: t.composeIntersectionPark,
278
+ intersectionRootMargin: t.intersectionRootMargin,
279
+ revealBloom: t.revealBloom,
280
+ onContextStateChange: (e) => {
281
+ t.onStatus?.(e === "lost" ? n("webgl2") : {
282
+ phase: "ready",
283
+ engine: "webgl2",
284
+ adapter: a(r.gl)
285
+ });
286
+ },
287
+ setup: t.setupGL,
288
+ onContextError: (e) => {
289
+ t.onStatus?.(i("webgl2", "WebGL 2 context", e)), t.onInitError?.(e);
290
+ }
291
+ }), r;
292
+ }
293
+ function _(e, t) {
294
+ let r = f() && t.setupWGPU != null, o = null, s = null, l = r ? "webgpu" : "webgl2", u = !1, d = (e) => t.onStatus?.(e), p = (e, t, r) => d(e === "lost" ? n(t) : {
295
+ phase: "ready",
296
+ engine: t,
297
+ adapter: r()
298
+ });
299
+ d(n(l)), r ? o = h(e, {
300
+ mode: t.mode,
301
+ respectReducedMotion: t.respectReducedMotion,
302
+ dprPolicy: t.dprPolicy,
303
+ composeIntersectionPark: t.composeIntersectionPark,
304
+ intersectionRootMargin: t.intersectionRootMargin,
305
+ revealBloom: t.revealBloom,
306
+ setup: t.setupWGPU,
307
+ alphaMode: t.alphaMode,
308
+ adapterOptions: t.adapterOptions,
309
+ deviceDescriptor: t.deviceDescriptor,
310
+ onContextStateChange: (e) => {
311
+ p(e, "webgpu", () => o?.adapterClass ?? "Hardware adapter");
312
+ },
313
+ onInitError: (e) => {
314
+ d(i("webgpu", o?.adapterClass ?? "Hardware adapter", e)), t.onInitError?.(e);
315
+ }
316
+ }) : s = g(e, t);
317
+ function m(r) {
318
+ o?.dispose(), o = null, l = "webgl2", d(n("webgl2")), t.onBackendFallback?.({
319
+ from: "webgpu",
320
+ to: "webgl2",
321
+ error: r
322
+ });
323
+ try {
324
+ s = g(e, t), s.arm(), d({
325
+ phase: "ready",
326
+ engine: "webgl2",
327
+ adapter: a(s.gl)
328
+ });
329
+ } catch (e) {
330
+ throw s = null, d(i("webgl2", "WebGL 2 context", e)), t.onInitError?.(e), e;
331
+ }
332
+ }
333
+ async function _() {
334
+ if (!u) {
335
+ if (v(), o) try {
336
+ await o.armAsync(), d({
337
+ phase: "ready",
338
+ engine: "webgpu",
339
+ adapter: o.adapterClass
340
+ });
341
+ return;
342
+ } catch (e) {
343
+ if (u) return;
344
+ if (e instanceof c && e.kind !== "pipeline-validation") {
345
+ m(e);
346
+ return;
347
+ }
348
+ throw d(i("webgpu", o.adapterClass, e)), e;
349
+ }
350
+ try {
351
+ s?.arm(), d({
352
+ phase: "ready",
353
+ engine: "webgl2",
354
+ adapter: a(s?.gl ?? null)
355
+ });
356
+ } catch (e) {
357
+ throw d(i("webgl2", "WebGL 2 context", e)), t.onInitError?.(e), e;
358
+ }
359
+ }
360
+ }
361
+ function v() {
362
+ u || (o?.presize(), s?.presize());
363
+ }
364
+ function y() {
365
+ u || (v(), o?.arm(), s?.arm());
366
+ }
367
+ return {
368
+ get backend() {
369
+ return l;
370
+ },
371
+ armAsync: _,
372
+ arm: y,
373
+ presize: v,
374
+ suspend: (e) => {
375
+ o?.suspend(e), s?.suspend(e);
376
+ },
377
+ resume: (e) => {
378
+ o?.resume(e), s?.resume(e);
379
+ },
380
+ wake: () => {
381
+ o?.wake(), s?.wake();
382
+ },
383
+ renderAt: (e) => {
384
+ o?.renderAt(e), s?.renderAt(e);
385
+ },
386
+ dispose: () => {
387
+ u = !0, o?.dispose(), s?.dispose(), o = null, s = null;
388
+ },
389
+ get reducedMotion() {
390
+ return (o ?? s)?.reducedMotion ?? !1;
391
+ }
392
+ };
393
+ }
394
+ //#endregion
395
+ //#region src/composables/glass/procedural/color.wgsl.ts
396
+ var v = "\nfn srgbToLinearCh(c: f32) -> f32 {\n if (c <= 0.04045) { return c / 12.92; }\n return pow((c + 0.055) / 1.055, 2.4);\n}\nfn srgbToLinear(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfn linearToSrgbCh(c: f32) -> f32 {\n if (c <= 0.0031308) { return c * 12.92; }\n return 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nfn linearToSrgb(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}", y = "const FBM_ROT: mat2x2<f32> = mat2x2<f32>(0.8, 0.6, -0.6, 0.8);", b = "\n// value.js LINEAR_SRGB_TO_LMS, row-major → WGSL columns (= the transpose).\nconst LINEAR_SRGB_TO_LMS: mat3x3<f32> = mat3x3<f32>(\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, row-major → WGSL columns.\nconst LMS_TO_OKLAB: mat3x3<f32> = mat3x3<f32>(\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, row-major → WGSL columns.\nconst OKLAB_TO_LMS: mat3x3<f32> = mat3x3<f32>(\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, row-major → WGSL columns.\nconst LMS_TO_LINEAR_SRGB: mat3x3<f32> = mat3x3<f32>(\n 4.0767416621, -1.2684380046, -0.0041960863,\n -3.3077115913, 2.6097574011, -0.7034186147,\n 0.2309699292, -0.3413193965, 1.7076147010\n);\n\nfn cbrt3(v: vec3<f32>) -> vec3<f32> {\n return sign(v) * pow(abs(v), vec3<f32>(1.0 / 3.0));\n}\n\n// Gamma sRGB → raw OKLab (L, a, b). Mirrors value.js srgbToOKLab.\nfn srgbToOklab(c: vec3<f32>) -> vec3<f32> {\n let lin = srgbToLinear(c);\n let lms = LINEAR_SRGB_TO_LMS * lin;\n return LMS_TO_OKLAB * cbrt3(lms);\n}\n\n// Raw OKLab (L, a, b) → linear sRGB. Mirrors value.js oklabToLinearSRGB.\nfn oklabToLinearSrgb(lab: vec3<f32>) -> vec3<f32> {\n let lms_ = OKLAB_TO_LMS * lab;\n let lms = lms_ * lms_ * lms_;\n return LMS_TO_LINEAR_SRGB * lms;\n}\n\n// OKLab → OKLCh: H in RADIANS, folded to [0, 2pi). Mirrors value.js rawOklabToOklch.\nfn oklabToOklch(lab: vec3<f32>) -> vec3<f32> {\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 vec3<f32>(lab.x, C, H);\n}\n\n// OKLCh (H radians) → OKLab. Mirrors value.js rawOklchToOklab.\nfn oklchToOklab(lch: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(lch.x, lch.y * cos(lch.z), lch.y * sin(lch.z));\n}", x = "\n// value.js interpolateHue in the NORMALIZED-TURNS domain. methods: 0 shorter,\n// 1 longer, 2 increasing, 3 decreasing.\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 var r = a + t * (b - a);\n r = fract(r); // fract is non-negative in WGSL\n return r * TAU; // back to radians\n}\n\n// Linear-sRGB endpoint pair → OKLab-rectangular interpolation → linear sRGB.\nfn mixPaletteOklab(linA: vec3<f32>, linB: vec3<f32>, t: f32) -> vec3<f32> {\n let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linA);\n let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linB);\n let lab = mix(labA, labB, t);\n return oklabToLinearSrgb(lab);\n}\n\n// Linear-sRGB endpoint pair → OKLCh hue-arc interpolation → linear sRGB.\nfn mixPaletteOklchArc(linA: vec3<f32>, linB: vec3<f32>, t: f32, method: i32) -> vec3<f32> {\n let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linA);\n let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * linB);\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(vec3<f32>(L, C, H)));\n}\n\n// The ramp dispatcher (the samplePalette splices it). tRaw is the raw inter-stop\n// parameter [0,1]; the smoothstep ease + the huePath branch live here so the ramp is\n// one source. increasing(2)/decreasing(3) take the OKLCh hue-arc; every other method\n// takes the OKLab-rectangular straight line.\nfn samplePaletteRamp(a: vec3<f32>, b: vec3<f32>, tRaw: f32, huePath: i32) -> vec3<f32> {\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}";
397
+ //#endregion
398
+ export { _ as a, x as i, v as n, o, b as r, y as t };
@@ -3,7 +3,7 @@ import { t } from "./primitive-B2t2jdqM.js";
3
3
  import { t as n } from "./selection-DqIULxRG.js";
4
4
  import { n as r, t as i } from "./DialogContent-4hzLiaCQ.js";
5
5
  import { t as a } from "./rowClass-DYOXwxhO.js";
6
- import { t as o } from "./participation-B0hdsIRo.js";
6
+ import { t as o } from "./participation-Di4UHbzk.js";
7
7
  import { computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createTextVNode as d, createVNode as f, defineComponent as p, mergeProps as m, normalizeClass as h, openBlock as g, renderSlot as _, toDisplayString as v, unref as y, useAttrs as b, withCtx as x } from "vue";
8
8
  import { ComboboxContent as S, ComboboxEmpty as C, ComboboxGroup as w, ComboboxInput as T, ComboboxItem as E, ComboboxLabel as D, ComboboxRoot as O, ComboboxSeparator as k } from "reka-ui";
9
9
  import { Search as A } from "@lucide/vue";
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 "./command-BuBnYpxF.js";
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 "./command-tEzAaVY_.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 };
@@ -1,5 +1,4 @@
1
1
  export type ControlSize = "sm" | "md" | "lg";
2
- export declare const controlSizeClass: (size?: ControlSize) => string;
3
2
  /** The state axis every binary control exposes. */
4
3
  export interface ControlProps {
5
4
  invalid?: boolean;
@@ -1,2 +1 @@
1
- export { controlSizeClass } from "./control.js";
2
1
  export type { ControlSize } from "./control.js";
@@ -91,6 +91,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
91
91
  pause: () => void;
92
92
  resume: () => void;
93
93
  isArmed: Readonly<import("vue").Ref<boolean, boolean>>;
94
+ isSettled: Readonly<import("vue").Ref<boolean, boolean>>;
94
95
  rendererStatus: Readonly<import("vue").Ref<RendererStatus, RendererStatus>>;
95
96
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
96
97
  rendererStatus: (status: RendererStatus) => any;
@@ -11,14 +11,15 @@
11
11
  *
12
12
  * `drawFrame` re-sends the per-frame cursor + time uniforms and issues the single
13
13
  * full-screen-triangle draw. `needsAnimation` is the demand gate: `false` under
14
- * reduced-motion (the static frame draws once, then parks), `false` at steady-state (all
15
- * four drift uniforms 0 AND the field settled — the next frame is pixel-identical), and
16
- * `true` while drift is live or the field is still easing (engagement, speed, burst,
17
- * attractor motion above ε).
14
+ * reduced-motion (the static frame draws once, then parks), `false` at steady-state (no
15
+ * drift axis above its own amplitude floor AND the field settled — the next frame is
16
+ * pixel-identical), and `true` while drift is live or the field is still easing
17
+ * (engagement, speed, burst, attractor motion above ε). The drift half is
18
+ * `isAuroraDriftLive` — the ONE predicate this loop and both WGSL loops share.
18
19
  */
19
20
  import type { UniformLocations } from "./glSetup.js";
20
21
  import type { AuroraCursorUniforms } from "./uniformBridge.js";
21
- import type { AuroraConfig } from "../constants/presets.js";
22
+ import { type AuroraConfig } from "../constants/presets.js";
22
23
  import type { UsePointerVelocityField } from "../../../composables/motion/pointer/usePointerVelocityField.js";
23
24
  /** The at-rest scalars a config-less cursor read seeds (strength ceiling + influence radius). */
24
25
  export interface AuroraCursorScalars {
@@ -75,6 +75,20 @@ export interface AuroraRuntimeOptions {
75
75
  * threaded through both seams.
76
76
  */
77
77
  forceWebGLUnderSoftwareRaster?: boolean;
78
+ /**
79
+ * Pin the render backend instead of letting the substrate picker choose.
80
+ *
81
+ * `"webgl2"` withholds the WGSL setup from `createGpuSubstrate`, which is the ONLY
82
+ * honest way to reach the WebGL2 arm in-app: the picker's `attemptWebGPU` reads
83
+ * `supportsWebGPU() && setupWGPU != null`, so a browser flag cannot express this and
84
+ * `renderMode: "webgl"` is a MODE (animate at all / never), not a backend.
85
+ *
86
+ * The capture harness drives it as `?engine=webgl2` so the GL arm can be archived
87
+ * before it is deleted. There is no `"webgpu"` member: forcing WebGPU on a host
88
+ * without an adapter would be a masking fallback — the picker already prefers it and
89
+ * falls loud when it cannot arm.
90
+ */
91
+ forceBackend?: "webgl2";
78
92
  /**
79
93
  * Reveal-bloom consumer door.
80
94
  *
@@ -131,7 +145,18 @@ export interface AuroraRuntime extends Omit<AuroraInstance, "pause" | "resume">
131
145
  /** Live reduced-motion state; the cursor listener early-outs on it. */
132
146
  readonly reducedMotion: boolean;
133
147
  }
134
- /** One medium-aware predicate shared by pointer writes and uniform projection. */
148
+ /**
149
+ * One medium-aware predicate shared by pointer writes and uniform projection.
150
+ *
151
+ * `swirl` is the DEFAULT-ON axis: every aurora shapes under the pointer unless its
152
+ * config says `swirl: false`. Suppression is not this predicate's job — the master
153
+ * tempo scalar zeroes the field tick under reduced motion and under the background
154
+ * pause, so a PRM reader never sees the cursor regardless of what this returns.
155
+ *
156
+ * `light` stays an explicit opt-in AND stays medium-aware: it steers the impasto light
157
+ * direction, and the smooth body has no impasto, so `light` alone over `smooth` shapes
158
+ * nothing and must not arm a pointer path.
159
+ */
135
160
  export declare function isAuroraPointerEnabled(config: AuroraConfig): boolean;
136
161
  /** One shader-time projection shared by the WebGPU and WebGL2 bridges. */
137
162
  export declare function resolveAuroraRenderTime(config: AuroraConfig, elapsedSec: number, progress: number, reducedMotion: boolean): number;
@@ -42,8 +42,36 @@ export interface UseAuroraReturn {
42
42
  * acquisition and flips only when the backend readiness promise resolves.
43
43
  */
44
44
  isArmed: Readonly<Ref<boolean>>;
45
+ /**
46
+ * The SETTLE BEACON. `true` once the runtime has armed, the current config has been
47
+ * applied, and the ground→field entrance has finished painting over it.
48
+ *
49
+ * `Aurora.vue` publishes it as `data-aurora-settled`; every capture — π, gate, or a
50
+ * consumer's own — waits on that attribute. A wall-clock sleep is not a substitute:
51
+ * inside the entrance the field paints medium-INDEPENDENTLY, so an early capture
52
+ * reads a picture that is identical across every medium and across page loads, with
53
+ * perfect confidence and no way to tell. Three seats measured that picture.
54
+ *
55
+ * Any config change re-opens it — a preset switch has its own entrance. So does a
56
+ * context LOSS: the field it witnesses is gone, and the restore replays the entrance,
57
+ * so the beacon never carries its pre-loss stamp across that replay.
58
+ */
59
+ isSettled: Readonly<Ref<boolean>>;
45
60
  rendererStatus: Readonly<Ref<RendererStatus>>;
46
61
  }
62
+ /**
63
+ * How long past the last applied config the field needs before a capture is admissible.
64
+ *
65
+ * The entrance is the ground→field CROSSFADE: `.aurora-canvas-layer` transitions opacity
66
+ * 0→1 over `--duration-slow` (0.45 s) once `isArmed` flips, dissolving the palette-derived
67
+ * frame-0 ground into the live field. Until that completes a capture reads a blend of the
68
+ * two, which is what makes it medium-independent. 500 ms clears the 450 ms token with the
69
+ * margin for the frame the config write lands on.
70
+ *
71
+ * The clock is advanced by `requestAnimationFrame`, not `setTimeout`, so a backgrounded
72
+ * or parked surface never stamps a beacon it has not painted.
73
+ */
74
+ export declare const AURORA_SETTLE_MS = 500;
47
75
  /**
48
76
  * Vue-side wrapper for the imperative `createAurora` runtime.
49
77
  *
@@ -15,7 +15,7 @@
15
15
  import type { WebGPUCanvasFrame } from "../../../composables/glass/webgpu/useWebGPUCanvas.js";
16
16
  import { type AuroraCursorScalars } from "./frameLoop.js";
17
17
  import { type UploadableImageSource } from "./textureUpload.js";
18
- import type { AuroraConfig } from "../constants/presets.js";
18
+ import { type AuroraConfig } from "../constants/presets.js";
19
19
  import type { UsePointerVelocityField } from "../../../composables/motion/pointer/usePointerVelocityField.js";
20
20
  export interface AuroraWGPUSetupDeps {
21
21
  canvas: HTMLCanvasElement;
@@ -68,8 +68,13 @@ export type WarpMode = "fbm" | "cellular" | "hybrid" | "curl";
68
68
  * - `swirl` — cursor-local warp and luminance lean on both engines.
69
69
  * - `amplitude` — sizes the transient burst folded into cursor strength on the CPU.
70
70
  * Every axis is suppressed under `prefers-reduced-motion` + the DockBackgroundToggle
71
- * pause (the master tempo scalar is the single suppression seam). The wispy-sky
72
- * default carries no `interactivity` (every axis OFF — the default stays static).
71
+ * pause (the master tempo scalar is the single suppression seam).
72
+ *
73
+ * `swirl` is ON by default — a config opts OUT with `swirl: false`. Every aurora is
74
+ * pointer-shapeable, and a capability parked behind an opt-in flag is a capability the
75
+ * surface does not have. `light` and `scroll` remain explicit opt-ins: `light` is only
76
+ * meaningful over a painterly body (smooth has no impasto to relight), and `scroll`
77
+ * re-times the shader clock against page position, which no surface should inherit.
73
78
  */
74
79
  export interface AuroraInteractivity {
75
80
  light?: boolean;
@@ -204,12 +209,46 @@ export interface AuroraConfig {
204
209
  */
205
210
  vividness?: number;
206
211
  /**
207
- * Pointer/scroll interactivity opt-in (default OFF — the wispy-sky
208
- * default stays static). Omitted = every
209
- * axis off. Aliased on `/api` as part of the `AuroraConfig` surface.
212
+ * Pointer/scroll interactivity. `swirl` is ON unless a config says
213
+ * `swirl: false` — the pointer shapes every aurora by default, PRM-guarded by the
214
+ * master tempo scalar. `light` and `scroll` stay explicit opt-ins.
215
+ * Aliased on `/api` as part of the `AuroraConfig` surface.
210
216
  */
211
217
  interactivity?: AuroraInteractivity;
212
218
  }
219
+ /**
220
+ * The per-axis liveness floor of the drift demand gate.
221
+ *
222
+ * The four drift axes do NOT share a domain — nuclei 0..0.05, palette 0..0.04, breath
223
+ * 0..0.15, warp 0..0.015 — so ONE flat epsilon over raw values would retire whole axes
224
+ * (any epsilon that reaches `paletteDrift` is above `warpDrift`'s entire range). Each
225
+ * axis therefore carries its own floor, seeded at 1% of that axis's authored domain.
226
+ *
227
+ * The floors are the SHAPE, not the cut. Cutting them where they would actually park a
228
+ * loop is a PAINT decision and it is `W-AURORA-FIELD`'s (π-FIELD), because the shipped
229
+ * configs do not separate in config space: the recessive shell field
230
+ * (`aurora-hero.ts` `nucleiDrift`/`paletteDrift` 0.012) and the focal studio default
231
+ * (0.015) sit 25% apart on both axes and are identical on the other two. What separates
232
+ * them is not the drift amplitude but the composited range their palettes can express —
233
+ * shell chroma ≤ 0.07 over an L span of 0.03 against the studio's C 0.16/0.13/0.095 —
234
+ * and that term is the field re-founding's to derive, not this gate's to guess.
235
+ */
236
+ export declare const AURORA_DRIFT_FLOOR: {
237
+ readonly nucleiDrift: 0.0005;
238
+ readonly paletteDrift: 0.0004;
239
+ readonly breathDepth: 0.0015;
240
+ readonly warpDrift: 0.00015;
241
+ };
242
+ /**
243
+ * The demand gate over the four drift axes — the ONE predicate the WebGL2 frame loop
244
+ * and BOTH WGSL loops consume.
245
+ *
246
+ * It was three copies of a `!== 0` ladder, and they had already diverged: the image
247
+ * pipeline's copy omitted `breathDepth`, so an image-source aurora carrying breath and
248
+ * no drift parked its loop and never rendered the breath. Liveness is an AMPLITUDE
249
+ * question against each axis's own domain, never a literal comparison against zero.
250
+ */
251
+ export declare function isAuroraDriftLive(config: AuroraConfig): boolean;
213
252
  /**
214
253
  * Pointer-cursor API exposed by `createAurora`. Values in 0..1 (CSS-top-origin).
215
254
  * Runtime flips Y and eases internally.
@@ -1,6 +1,6 @@
1
1
  export { default as Aurora } from "./Aurora.vue.js";
2
2
  export { resolveRenderMode, isSoftwareWebGLRenderer, type AuroraRenderMode, type ResolveRenderModeOptions, } from "./constants/renderMode.js";
3
- export { useAurora } from "./composables/useAurora.js";
3
+ export { useAurora, AURORA_SETTLE_MS } from "./composables/useAurora.js";
4
4
  export type { UseAuroraReturn } from "./composables/useAurora.js";
5
5
  export { useCursorInteraction } from "./composables/useCursorInteraction.js";
6
6
  export { createAurora } from "./composables/runtime.js";