@mkbabb/glass-ui 3.1.1 → 3.2.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 (158) hide show
  1. package/dist/{CardFooter-CSGcJkqa.js → CardFooter-3-VGho1J.js} +1 -1
  2. package/dist/{CommandShortcut-DWT19a2Y.js → CommandShortcut-C6lsz3pG.js} +3 -3
  3. package/dist/{ContextMenuSubContent-gAFxJ-qi.js → ContextMenuSubContent-DrWkXKQP.js} +4 -4
  4. package/dist/{DataTable-R8-Zidms.js → DataTable-BsrDYdoE.js} +3 -3
  5. package/dist/{DialogContent-2fALDSvc.js → DialogContent-B61rP8lj.js} +3 -3
  6. package/dist/{DialogFooter-ClrNEOVU.js → DialogFooter-Er0wA3K6.js} +2 -2
  7. package/dist/{DiscoGlyph-C3JfMnRV.js → DiscoGlyph-B7YooI2-.js} +1 -1
  8. package/dist/{GlyphFace-BRS8vUb7.js → GlyphFace-Bvk6OIas.js} +1 -1
  9. package/dist/{HoverPopover-CWFCfLx3.js → HoverPopover-BlEwqG7S.js} +1 -1
  10. package/dist/{IconTooltip-BkaA7tZ2.js → IconTooltip-DXveGjx7.js} +1 -1
  11. package/dist/{MetricBadge-DmAihkXd.js → MetricBadge-J_GBCb8e.js} +1 -1
  12. package/dist/{Notification-OqIpADml.js → Notification-DP_ApJLo.js} +3 -3
  13. package/dist/{NumberFieldContent-DTH9gb_N.js → NumberFieldContent-B6L6YrQz.js} +2 -2
  14. package/dist/{PopoverContent-EiklFrna.js → PopoverContent-CxEEUL7Y.js} +1 -1
  15. package/dist/{Progress-FApA9fm_.js → Progress-Bs44qWEM.js} +1 -1
  16. package/dist/{ScrollingText-BFd0i2zJ.js → ScrollingText-1Qjnwz6H.js} +2 -2
  17. package/dist/{SelectScrollDownButton-Dth8-wXQ.js → SelectScrollDownButton-BvvvAbuh.js} +4 -4
  18. package/dist/{Toaster-Bjlunvq4.js → Toaster-Brs6QjBU.js} +1 -1
  19. package/dist/{UnderlineTabs-DAWMLmJG.js → UnderlineTabs-B4FV2zi_.js} +1 -1
  20. package/dist/animated-digit.js +2 -2
  21. package/dist/api.js +1 -1
  22. package/dist/aurora.js +118 -150
  23. package/dist/badge.js +1 -1
  24. package/dist/button.js +1 -1
  25. package/dist/card.js +1 -1
  26. package/dist/carousel.js +5 -5
  27. package/dist/{check-dwgetki8.js → check-CdkxGxXJ.js} +1 -1
  28. package/dist/{chevron-down-DILQA1t6.js → chevron-down-pBY8sYfV.js} +1 -1
  29. package/dist/{chevron-right-fS7fal2t.js → chevron-right-BjeKC22V.js} +1 -1
  30. package/dist/{chevron-up-BtYjYQOS.js → chevron-up-DBeNHUm1.js} +1 -1
  31. package/dist/collapsible.js +1 -1
  32. package/dist/command.js +1 -1
  33. package/dist/components/custom/aurora/composables/color.d.ts +56 -8
  34. package/dist/components/custom/aurora/index.d.ts +2 -1
  35. package/dist/components/custom/aurora/presets.d.ts +1 -1
  36. package/dist/components/custom/aurora/shaders/aurora.frag.d.ts +1 -1
  37. package/dist/components/custom/configurator/Configurator.vue.d.ts +26 -0
  38. package/dist/components/custom/configurator/index.d.ts +1 -1
  39. package/dist/components/custom/dock/DockIconButton.vue.d.ts +14 -3
  40. package/dist/components/custom/dock/GlassDock.vue.d.ts +17 -0
  41. package/dist/composables/dom/index.d.ts +1 -0
  42. package/dist/composables/dom/useTextHighlight.d.ts +40 -0
  43. package/dist/composables/motion/core/index.d.ts +1 -0
  44. package/dist/composables/motion/usePrioritizedTask.d.ts +41 -0
  45. package/dist/composables/sortable/useSortable.d.ts +13 -0
  46. package/dist/configurator.js +1 -1
  47. package/dist/confirm-dialog.js +3 -3
  48. package/dist/context-menu.js +2 -2
  49. package/dist/controls.js +2 -2
  50. package/dist/dark.js +1 -1
  51. package/dist/data-table.js +1 -1
  52. package/dist/dialog.js +2 -2
  53. package/dist/disco-glyph.js +1 -1
  54. package/dist/dock.js +98 -81
  55. package/dist/dom.js +6 -5
  56. package/dist/{dropdown-menu-BvRUamNs.js → dropdown-menu-naE0skDg.js} +4 -4
  57. package/dist/dropdown-menu.js +1 -1
  58. package/dist/expandable-container.js +2 -2
  59. package/dist/forms.js +4 -4
  60. package/dist/glass-carousel.js +59 -52
  61. package/dist/glass-panel.js +2 -2
  62. package/dist/glass-ui.css +1 -1
  63. package/dist/glass-ui.js +231 -224
  64. package/dist/glyph-face.js +2 -2
  65. package/dist/header-ribbon.js +1 -1
  66. package/dist/hover-card.js +1 -1
  67. package/dist/hover-popover.js +1 -1
  68. package/dist/icon-tooltip.js +1 -1
  69. package/dist/instrument-chassis.js +1 -1
  70. package/dist/instrument-rail.js +1 -1
  71. package/dist/keyboard.js +1 -1
  72. package/dist/label.js +1 -1
  73. package/dist/labeled-field.js +6 -6
  74. package/dist/metric-badge.js +1 -1
  75. package/dist/metric-stack.js +1 -1
  76. package/dist/{minimize-2-LsCJ_eNt.js → minimize-2-BP27-qBY.js} +1 -1
  77. package/dist/motion-core.js +155 -95
  78. package/dist/motion.js +3 -3
  79. package/dist/notification.js +1 -1
  80. package/dist/number-field.js +1 -1
  81. package/dist/paper-backdrop.js +1 -1
  82. package/dist/popover.js +1 -1
  83. package/dist/{presets-a-D93K1S.js → presets-BpTf63Hp.js} +4 -4
  84. package/dist/progress.js +1 -1
  85. package/dist/pulse.js +1 -1
  86. package/dist/reactive.js +2 -2
  87. package/dist/responsive-tabs.js +2 -2
  88. package/dist/scrolling-text.js +1 -1
  89. package/dist/{search-DBAiUABx.js → search-DBG8qaRs.js} +1 -1
  90. package/dist/search.js +153 -149
  91. package/dist/select.js +3 -3
  92. package/dist/separator.js +1 -1
  93. package/dist/{sheet-CukNDezz.js → sheet-BnvZRXPq.js} +3 -3
  94. package/dist/sheet.js +1 -1
  95. package/dist/{slider-DJvHkTRe.js → slider-wx8ifVFB.js} +3 -3
  96. package/dist/slider.js +1 -1
  97. package/dist/sortable-list.js +2 -2
  98. package/dist/styles/components.css +45 -0
  99. package/dist/styles/dock.css +71 -2
  100. package/dist/styles/index.css +5 -1
  101. package/dist/styles/tokens.css +11 -0
  102. package/dist/styles/utilities.css +56 -0
  103. package/dist/supportsCssTimeline-IQY3gfKD.js +12 -0
  104. package/dist/switch.js +1 -1
  105. package/dist/tabs.js +25 -10
  106. package/dist/timeline.js +2 -2
  107. package/dist/toast.js +1 -1
  108. package/dist/toggle-group.js +1 -1
  109. package/dist/tooltip.js +1 -1
  110. package/dist/typewriter.js +1 -1
  111. package/dist/{useAnimatedNumber-DKQYVB7s.js → useAnimatedNumber-BOxrS3a6.js} +1 -1
  112. package/dist/{useConfiguratorState-CtRBE0m_.js → useConfiguratorState-Dq2gNv4A.js} +52 -40
  113. package/dist/{useIdleReady-Cmkhm03v.js → useIdleReady-sLhGo6CL.js} +1 -1
  114. package/dist/useSortable-DLK9kwZp.js +189 -0
  115. package/dist/useTextHighlight-CLST6an0.js +72 -0
  116. package/dist/{useTouchGate-D9Zvrzyc.js → useTouchGate-XX8gHfay.js} +1 -1
  117. package/dist/{useViewTransition-DYIK6Gzb.js → useViewTransition-CUJM7fXT.js} +5 -3
  118. package/dist/utils/index.d.ts +2 -1
  119. package/dist/utils/platformSupport.d.ts +8 -0
  120. package/dist/{x-q7pJa83X.js → x-C4pz9nbD.js} +1 -1
  121. package/package.json +13 -3
  122. package/src/styles/dock.css +71 -2
  123. package/src/styles/index.css +1 -1
  124. package/src/styles/tokens.css +11 -0
  125. package/src/styles/utilities.css +56 -0
  126. package/dist/useSortable-Cq2Y1JLO.js +0 -175
  127. /package/dist/{CollapsibleContent-CVMOcYlV.js → CollapsibleContent-wlmlDujU.js} +0 -0
  128. /package/dist/{ContextMenuContent-otjFIu8v.js → ContextMenuContent-De01_83g.js} +0 -0
  129. /package/dist/{HoverCardContent-DaGrgJBO.js → HoverCardContent-DGUhpRVt.js} +0 -0
  130. /package/dist/{Input-DDpFn568.js → Input-IFsIzId2.js} +0 -0
  131. /package/dist/{InstrumentChassis-CnHTMxds.js → InstrumentChassis-CqKPBNqp.js} +0 -0
  132. /package/dist/{InstrumentRail-C6dEbi8E.js → InstrumentRail-CCjvKkpB.js} +0 -0
  133. /package/dist/{Label-DJty89bp.js → Label-D53EOwLE.js} +0 -0
  134. /package/dist/{ModalOverlay-iWiAgbYH.js → ModalOverlay-B_CBtqcE.js} +0 -0
  135. /package/dist/{PaperBackdrop-CeZ-w0R0.js → PaperBackdrop-Ds-wDsKf.js} +0 -0
  136. /package/dist/{SelectGroup-DdR4tdDY.js → SelectGroup-DAgcsfFw.js} +0 -0
  137. /package/dist/{SelectSeparator-CXm_hlqA.js → SelectSeparator-DN1jzLaI.js} +0 -0
  138. /package/dist/{Separator-D8AUMhxY.js → Separator-DXxac0j8.js} +0 -0
  139. /package/dist/{Switch-Cr1t_F_U.js → Switch-imA0Hdjs.js} +0 -0
  140. /package/dist/{ToggleGroupItem-OesUouE7.js → ToggleGroupItem-Cy7xHFEo.js} +0 -0
  141. /package/dist/{TooltipProvider-DE78vbEP.js → TooltipProvider-MZFRxOvT.js} +0 -0
  142. /package/dist/{_plugin-vue_export-helper-Dq1MygBL.js → _plugin-vue_export-helper-C1je1s0u.js} +0 -0
  143. /package/dist/{badge-x46my_Fo.js → badge-Cl6JZ1B7.js} +0 -0
  144. /package/dist/{button-C0aHmBbt.js → button-DS3ULf5i.js} +0 -0
  145. /package/dist/{constants-DwBwnG8N.js → constants-DfWPi8kh.js} +0 -0
  146. /package/dist/{createLucideIcon-Bn9a1b70.js → createLucideIcon-DuDoe_ra.js} +0 -0
  147. /package/dist/{dockContext-D5NZCWJs.js → dockContext-DM58L1Jt.js} +0 -0
  148. /package/dist/{keys-CaTQS-vx.js → keys-SIKQYNx1.js} +0 -0
  149. /package/dist/{menuItemVariants-BsbGNq9C.js → menuItemVariants-C2QlXqT3.js} +0 -0
  150. /package/dist/{useGlassRenderer-Ds-nmrGz.js → useGlassRenderer-C98tZnJ7.js} +0 -0
  151. /package/dist/{useGlobalDark-B0WvLJE3.js → useGlobalDark-BUUTZvkU.js} +0 -0
  152. /package/dist/{useIntersectionPause-IY2CwPQb.js → useIntersectionPause-CUmANkoc.js} +0 -0
  153. /package/dist/{useInterval-DVgGUf_y.js → useInterval-B58LmYth.js} +0 -0
  154. /package/dist/{useKeyboardShortcuts-Dpw_RUcB.js → useKeyboardShortcuts-BQfnAHHW.js} +0 -0
  155. /package/dist/{useResizeObserver-Cg9npuM3.js → useResizeObserver-C_7GjpRn.js} +0 -0
  156. /package/dist/{useSpringMount-Cfk1XK1R.js → useSpringMount-CnizvZGm.js} +0 -0
  157. /package/dist/{useTimer-NAaj9zNq.js → useTimer-6FoosoDY.js} +0 -0
  158. /package/dist/{useUserInvalidAria-DVu1eTXG.js → useUserInvalidAria-BW5iyqWR.js} +0 -0
package/dist/carousel.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { t as e } from "./cn-DJXf4yaB.js";
2
- import { t } from "./createLucideIcon-Bn9a1b70.js";
3
- import { t as n } from "./chevron-down-DILQA1t6.js";
4
- import { t as r } from "./chevron-right-fS7fal2t.js";
5
- import { t as i } from "./chevron-up-BtYjYQOS.js";
6
- import { n as a } from "./button-C0aHmBbt.js";
2
+ import { t } from "./createLucideIcon-DuDoe_ra.js";
3
+ import { t as n } from "./chevron-down-pBY8sYfV.js";
4
+ import { t as r } from "./chevron-right-BjeKC22V.js";
5
+ import { t as i } from "./chevron-up-DBeNHUm1.js";
6
+ import { n as a } from "./button-DS3ULf5i.js";
7
7
  import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, mergeProps as m, normalizeClass as h, onMounted as g, openBlock as _, ref as v, renderList as y, renderSlot as b, resolveDynamicComponent as x, toDisplayString as S, unref as C, watch as w, withCtx as T } from "vue";
8
8
  import { createInjectionState as E } from "@vueuse/core";
9
9
  import D from "embla-carousel-vue";
@@ -1,4 +1,4 @@
1
- import { t as e } from "./createLucideIcon-Bn9a1b70.js";
1
+ import { t as e } from "./createLucideIcon-DuDoe_ra.js";
2
2
  var t = e("check", [["path", {
3
3
  d: "M20 6 9 17l-5-5",
4
4
  key: "1gmf2c"
@@ -1,4 +1,4 @@
1
- import { t as e } from "./createLucideIcon-Bn9a1b70.js";
1
+ import { t as e } from "./createLucideIcon-DuDoe_ra.js";
2
2
  var t = e("chevron-down", [["path", {
3
3
  d: "m6 9 6 6 6-6",
4
4
  key: "qrunsl"
@@ -1,4 +1,4 @@
1
- import { t as e } from "./createLucideIcon-Bn9a1b70.js";
1
+ import { t as e } from "./createLucideIcon-DuDoe_ra.js";
2
2
  var t = e("chevron-right", [["path", {
3
3
  d: "m9 18 6-6-6-6",
4
4
  key: "mthhwq"
@@ -1,4 +1,4 @@
1
- import { t as e } from "./createLucideIcon-Bn9a1b70.js";
1
+ import { t as e } from "./createLucideIcon-DuDoe_ra.js";
2
2
  var t = e("chevron-up", [["path", {
3
3
  d: "m18 15-6-6-6 6",
4
4
  key: "153udz"
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "./CollapsibleContent-CVMOcYlV.js";
1
+ import { n as e, r as t, t as n } from "./CollapsibleContent-wlmlDujU.js";
2
2
  export { t as Collapsible, n as CollapsibleContent, e as CollapsibleTrigger };
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-DWT19a2Y.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 "./CommandShortcut-C6lsz3pG.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,14 +1,13 @@
1
1
  import type { OklchStop } from "../presets";
2
- export declare function clamp(v: number, min: number, max: number): number;
3
- export declare function srgbToOKLab(r: number, g: number, b: number): [number, number, number];
4
- export declare function oklabToOklch(L: number, a: number, b: number): [number, number, number];
5
- export declare function oklchToOklab(L: number, C: number, H: number): [number, number, number];
6
- export declare function oklabToRgb255(L: number, a: number, b: number): [number, number, number];
7
- export declare function rgbToOklch(r: number, g: number, b: number): [number, number, number];
8
- export declare function oklchToRgb(L: number, C: number, H: number): [number, number, number];
9
2
  /**
10
3
  * OKLCh stop to linear-sRGB in [0, 1] — bundle-canonical bake target.
11
4
  * The shader ACES-tonemaps in linear, so the LUT must stay linear.
5
+ *
6
+ * The OKLCh→linear math is value.js's canonical Ottosson path
7
+ * (`rawOklchToOklab` → `oklabToLinearSRGB`, inv-K-2). The `Math.max(0, ·)` wrap
8
+ * is aurora's OWN ACES-in-linear contract — value.js's `oklabToLinearSRGB` does
9
+ * not clamp negative linear (an out-of-gamut stop yields negatives; the wrap
10
+ * keeps them off the GPU). The equivalence test asserts the COMPOSED path.
12
11
  */
13
12
  export declare function oklchToLinear(stop: OklchStop): [number, number, number];
14
13
  /**
@@ -35,5 +34,54 @@ export declare function flattenPalette(stops: OklchStop[], maxStops?: number, ou
35
34
  export declare function paletteToCssGradient(stops: OklchStop[]): string;
36
35
  export declare function oklchStopToHex(s: OklchStop): string;
37
36
  export declare function hexToOklchStop(hex: string): OklchStop;
38
- export declare function cssToRgb(css: string): [number, number, number];
37
+ /**
38
+ * Resolve any CSS color string to an OKLCh stop via value.js's parser — the
39
+ * single canonical core (inv-K-2). Replaces the former 1×1-canvas `cssToRgb`
40
+ * DOM trick, so this now works in SSR / happy-dom (no `document` required).
41
+ *
42
+ * Semantics differ from the old canvas path (which masked them): an INVALID
43
+ * string THROWS (the canvas silently returned gray); ALPHA is dropped (OklchStop
44
+ * has no alpha; the canvas blended against a gray pre-fill); out-of-gamut inputs
45
+ * are NOT byte-clamped. Callers feeding user-supplied / possibly-transparent
46
+ * strings should wrap in try/catch and decide an alpha policy.
47
+ */
39
48
  export declare function cssToOklch(css: string): OklchStop;
49
+ /**
50
+ * Harmony schemes for {@link deriveAurora}. Each maps the seed hue onto the
51
+ * derived stops differently:
52
+ * - `analogous` — the ramp walks the seed hue ± a small spread (neighbouring
53
+ * hues; the painterly default).
54
+ * - `complementary` — stops split between the seed hue and its opposite (+180°).
55
+ * - `triad` — stops distributed across the seed hue and its two 120° partners.
56
+ * - `monochrome` — every stop holds the seed hue; only L and C travel.
57
+ */
58
+ export type AuroraHarmony = "analogous" | "complementary" | "triad" | "monochrome";
59
+ export interface DeriveAuroraOptions {
60
+ /** Number of stops to produce. Default 4; clamped to [2, MAX_STOPS]. */
61
+ stopCount?: number;
62
+ /** Hue scheme across the ramp. Default "analogous". */
63
+ harmony?: AuroraHarmony;
64
+ /** Total L travel across the ramp, in OKLCh L units. Default ~0.32. */
65
+ lightnessSpread?: number;
66
+ /** C multiplier at the pale apex (toward 1 = no falloff). Default ~0.85. */
67
+ chromaFalloff?: number;
68
+ /** Hue walk in degrees for analogous; ignored by monochrome. Default ~28. */
69
+ hueSpread?: number;
70
+ }
71
+ /**
72
+ * Seed ONE color into a harmonious, gamut-safe N-stop aurora palette.
73
+ *
74
+ * A thin COMPOSING producer over the shipped value.js Ottosson core (inv J-10:
75
+ * no color math is re-implemented here). The seed's `{L,C,h}` is the anchor; the
76
+ * ramp spreads L across a painterly band, falls C off toward the pale apex, and
77
+ * walks the hue per `harmony`. EVERY derived stop is gamut-mapped through
78
+ * value.js's `gamutMapOKLab` so none falls outside sRGB.
79
+ *
80
+ * Deterministic and DOM-free (SSR / happy-dom safe — `cssToOklch` is the only
81
+ * string path and it parses via value.js, not a canvas). The returned length is
82
+ * clamped to `[2, MAX_STOPS]`; L is monotonic ascending across the ramp.
83
+ *
84
+ * @param seed any CSS color string OR an `OklchStop` anchor.
85
+ * @param options ramp shape — stop count, harmony, L/C/h spreads.
86
+ */
87
+ export declare function deriveAurora(seed: string | OklchStop, options?: DeriveAuroraOptions): OklchStop[];
@@ -6,4 +6,5 @@ export { useCursorInteraction } from "./composables/useCursorInteraction";
6
6
  export { createAurora } from "./composables/runtime";
7
7
  export type { AuroraRuntimeMode, AuroraRuntimeOptions } from "./composables/runtime";
8
8
  export { DEFAULT_AURORA_CONFIG, MAX_NUCLEI, MAX_STOPS, type AuroraConfig, type AuroraCursorApi, type AuroraFlow, type AuroraInstance, type AuroraMedium, type AuroraNucleus, type FlowPattern, type OklchStop, type StrokeMode, type WarpMode, } from "./presets";
9
- export { cssToOklch, flattenPalette, hexToOklchStop, oklchStopToHex, oklchToLinear, paletteToCssGradient, } from "./composables/color";
9
+ export { cssToOklch, deriveAurora, flattenPalette, hexToOklchStop, oklchStopToHex, oklchToLinear, paletteToCssGradient, } from "./composables/color";
10
+ export type { AuroraHarmony, DeriveAuroraOptions } from "./composables/color";
@@ -25,7 +25,7 @@ export interface AuroraNucleus {
25
25
  paletteBias: number;
26
26
  /** -0.3..0.3 — lightness pull within the nucleus's zone of influence. */
27
27
  valueBias: number;
28
- /** 0..0.03 — orbit amplitude for slow drift. */
28
+ /** 0..0.08 — orbit amplitude for slow drift (the visible-travel gate). */
29
29
  driftRadius: number;
30
30
  /** 0..2π — phase seed. */
31
31
  driftPhase: number;
@@ -1 +1 @@
1
- export declare const FRAGMENT_SRC = "#version 300 es\nprecision highp float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\n#define MAX_NUCLEI 6\n#define MAX_STOPS 8\n\n// \u2500\u2500 Uniforms \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nuniform float uTime;\n\n// Palette baked CPU-side to linear-sRGB\nuniform vec3 uPalette[MAX_STOPS];\nuniform int uStopCount;\n\n// Nuclei (parallel arrays)\nuniform int uNucleiCount;\nuniform vec2 uNucleiPos[MAX_NUCLEI];\nuniform float uNucleiRadius[MAX_NUCLEI];\nuniform float uNucleiPaletteBias[MAX_NUCLEI];\nuniform float uNucleiValueBias[MAX_NUCLEI];\nuniform float uNucleiDriftRadius[MAX_NUCLEI];\nuniform float uNucleiDriftPhase[MAX_NUCLEI];\n// Anisotropy: per-nucleus elongation (1.0 = isotropic) and major-axis angle (radians).\n// Defaults (1.0 / 0.0) reduce to the original circular Gaussian.\nuniform float uNucleiElong[MAX_NUCLEI];\nuniform float uNucleiAngle[MAX_NUCLEI];\nuniform float uSoftmaxBeta;\nuniform float uValueVariance;\n\n// Warp\nuniform float uWarpAmount;\nuniform float uWarpScale;\nuniform float uWarpDrift;\nuniform int uWarpMode; // 0=fbm 1=cellular 2=hybrid\nuniform int uNoiseOctaves;\n\n// Medium\n// 0 smooth, 1 pastel, 2 watercolor, 3 oil\nuniform int uMedium;\nuniform int uFlowPattern; // 0 none, 1 radial, 2 swirl, 3 diagonal, 4 multi\nuniform vec2 uFlowFocal;\nuniform float uFlowAngle;\nuniform float uFlowCurl;\nuniform vec2 uCursor; // in 0..1 screen space (matches pN)\nuniform float uCursorStrength; // 0..1 attraction amount\nuniform float uCursorRadius; // radius of influence (0.05..0.5)\nuniform float uStrokeAmount;\nuniform float uStrokeScale;\nuniform float uStrokeAnisotropy;\nuniform int uStrokeLayers; // 1 or 2 (crosshatch)\nuniform int uStrokeMode; // 0 oil (modern gestural), 1 palette-knife, 2 crayon/oil-pastel, 3 modern-chunky\nuniform float uWetEdge;\nuniform float uGranulation;\nuniform float uImpasto;\nuniform float uBrokenColor;\nuniform float uCanvasGrain;\n\n// Motion\nuniform float uNucleiDrift;\nuniform float uPaletteDrift;\nuniform float uBreathDepth;\nuniform float uBreathPeriod;\n\n// Output\nuniform float uSaturation;\nuniform float uPaperGrain;\nuniform float uAlpha;\n\n// \u2500\u2500 Noise \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nfloat hash21(vec2 p) {\n p = fract(p * vec2(123.34, 456.21));\n p += dot(p, p + 45.32);\n return fract(p.x * p.y);\n}\n\nvec2 hash22(vec2 p) {\n p = vec2(dot(p, vec2(127.1, 311.7)),\n dot(p, vec2(269.5, 183.3)));\n return fract(sin(p) * 43758.5453);\n}\n\nfloat vnoise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u = f * f * (3.0 - 2.0 * f);\n float a = hash21(i);\n float b = hash21(i + vec2(1.0, 0.0));\n float c = hash21(i + vec2(0.0, 1.0));\n float d = hash21(i + vec2(1.0, 1.0));\n return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);\n}\n\nfloat fbm(vec2 p) {\n float v = 0.0;\n float a = 0.5;\n mat2 r = mat2(0.8, 0.6, -0.6, 0.8);\n for (int i = 0; i < 5; i++) {\n if (i >= uNoiseOctaves) break;\n v += a * vnoise(p);\n p = r * p * 2.02;\n a *= 0.5;\n }\n return v;\n}\n\n// Cellular / Worley f1\nfloat cellular(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n float m = 1e9;\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n vec2 g = vec2(float(x), float(y));\n vec2 o = hash22(i + g);\n vec2 r = g + o - f;\n m = min(m, dot(r, r));\n }\n }\n return sqrt(m);\n}\n\n// \u2500\u2500 Warp \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvec2 domainWarp(vec2 p, float t) {\n // Quilez canonical double warp\n vec2 q = vec2(fbm(p * uWarpScale + vec2(0.0, 0.0) + t * uWarpDrift),\n fbm(p * uWarpScale + vec2(5.2, 1.3) + t * uWarpDrift));\n vec2 r = vec2(fbm(p * uWarpScale + 4.0 * q + vec2(1.7, 9.2)),\n fbm(p * uWarpScale + 4.0 * q + vec2(8.3, 2.8)));\n\n vec2 warp = r;\n if (uWarpMode == 1) {\n // cellular \u2014 chunky territories (MEADOW block-like)\n float c1 = cellular(p * uWarpScale * 1.5 + vec2(t * uWarpDrift * 2.0, 0.0));\n float c2 = cellular(p * uWarpScale * 1.5 + vec2(11.0, 7.0 + t * uWarpDrift * 2.0));\n warp = vec2(c1, c2);\n } else if (uWarpMode == 2) {\n // hybrid \u2014 fbm + cellular averaged\n float c1 = cellular(p * uWarpScale * 1.2);\n float c2 = cellular(p * uWarpScale * 1.2 + vec2(11.0, 7.0));\n warp = mix(r, vec2(c1, c2), 0.5);\n }\n vec2 warped = p + uWarpAmount * warp;\n\n // Cursor swirl \u2014 rotate p around uCursor with radial falloff.\n // This warps the underlying color field so the bands sweep around the pointer.\n if (uCursorStrength > 0.001) {\n vec2 toP = p - uCursor;\n float d = length(toP);\n float r = max(uCursorRadius, 0.01);\n // Smooth falloff; strong near cursor, zero beyond ~1.5\u00D7 radius.\n float w = exp(-(d * d) / (r * r * 0.45));\n // Max rotation ~120\u00B0 at cursor center, scaled by strength\n float ang = w * uCursorStrength * 2.1;\n float ca = cos(ang), sa = sin(ang);\n vec2 rotated = vec2(ca * toP.x - sa * toP.y, sa * toP.x + ca * toP.y) + uCursor;\n // Also pinch slightly toward the cursor (gravity) \u2014 adds depth to swirl\n float pinch = w * uCursorStrength * 0.08;\n rotated = mix(rotated, uCursor, pinch);\n // Blend original warped position with cursor-rotated version\n warped = mix(warped, rotated + uWarpAmount * warp * 0.7, w * uCursorStrength);\n }\n\n return warped;\n}\n\n// \u2500\u2500 Palette LUT \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvec3 samplePalette(float id) {\n id = clamp(id, 0.0, 1.0);\n float scaled = id * float(uStopCount - 1);\n int i0 = int(floor(scaled));\n int i1 = min(i0 + 1, uStopCount - 1);\n float t = fract(scaled);\n t = smoothstep(0.0, 1.0, t);\n return mix(uPalette[i0], uPalette[i1], t);\n}\n\n// \u2500\u2500 Nuclei field \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvoid nucleiField(vec2 p, float t, out float paletteId, out float valueMod) {\n float accumBias = 0.0;\n float accumValue = 0.0;\n float accumW = 0.0;\n for (int i = 0; i < MAX_NUCLEI; i++) {\n if (i >= uNucleiCount) break;\n vec2 posI = uNucleiPos[i]\n + uNucleiDriftRadius[i] * vec2(\n cos(t * uNucleiDrift + uNucleiDriftPhase[i]),\n sin(t * uNucleiDrift + uNucleiDriftPhase[i] * 1.13)\n );\n vec2 diff = p - posI;\n // Anisotropic Gaussian: rotate diff into the nucleus's local frame\n // (major axis along uNucleiAngle), then scale the major-axis component by\n // 1/elongation so the squared distance describes an ellipse. Defaults\n // 1.0/0.0 reduce to the isotropic dot(diff, diff).\n float ca = cos(uNucleiAngle[i]);\n float sa = sin(uNucleiAngle[i]);\n vec2 local = vec2( ca * diff.x + sa * diff.y,\n -sa * diff.x + ca * diff.y);\n float along = local.x / max(uNucleiElong[i], 0.01);\n float across = local.y;\n float d2 = along * along + across * across;\n float r = max(uNucleiRadius[i], 0.01);\n float w = exp(-uSoftmaxBeta * d2 / (r * r));\n accumBias += w * uNucleiPaletteBias[i];\n accumValue += w * uNucleiValueBias[i];\n accumW += w;\n }\n paletteId = accumBias / max(accumW, 1e-4);\n valueMod = accumValue / max(accumW, 1e-4);\n\n // Palette drift \u2014 subtle global paletteId shift\n paletteId += 0.04 * sin(t * uPaletteDrift * 6.2831) * uPaletteDrift * 20.0;\n paletteId = clamp(paletteId, 0.0, 1.0);\n}\n\n// \u2500\u2500 Flow field \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvec2 flowField(vec2 p, float t) {\n vec2 dir = vec2(1.0, 0.0);\n if (uFlowPattern == 1) {\n // radial\n dir = normalize(p - uFlowFocal + 1e-4);\n } else if (uFlowPattern == 2) {\n // swirl \u2014 tangent to radial\n vec2 rad = normalize(p - uFlowFocal + 1e-4);\n dir = vec2(-rad.y, rad.x);\n } else if (uFlowPattern == 3) {\n // diagonal\n float a = radians(uFlowAngle);\n dir = vec2(cos(a), sin(a));\n } else if (uFlowPattern == 4) {\n // multi \u2014 curl-noise driven\n float n = fbm(p * 2.0 + t * 0.02);\n float a = n * 6.2831;\n dir = vec2(cos(a), sin(a));\n }\n // curl \u2014 perturb by noise. Radial gets much less curl so rays stay clean.\n if (uFlowCurl > 0.0) {\n float n = fbm(p * 3.0) - 0.5;\n float curlAmt = uFlowCurl;\n if (uFlowPattern == 1) curlAmt *= 0.25; // radial: preserve ray clarity\n if (uFlowPattern == 2) curlAmt *= 0.55; // swirl: allow moderate curl\n float a = atan(dir.y, dir.x) + n * 3.14159 * curlAmt;\n dir = vec2(cos(a), sin(a));\n }\n // cursor influence \u2014 swirl around the cursor position\n if (uCursorStrength > 0.001) {\n vec2 toCur = uCursor - p;\n float d = length(toCur);\n float r = max(uCursorRadius, 0.01);\n float w = exp(-(d * d) / (r * r * 0.5));\n // swirl tangent\n vec2 tangent = vec2(-toCur.y, toCur.x) / max(d, 1e-4);\n float a0 = atan(dir.y, dir.x);\n float a1 = atan(tangent.y, tangent.x);\n // blend angle\n float da = a1 - a0;\n da = atan(sin(da), cos(da)); // wrap to [-pi, pi]\n float a = a0 + da * w * uCursorStrength;\n dir = vec2(cos(a), sin(a));\n }\n return dir;\n}\n\n// \u2500\u2500 Color utils \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nconst vec3 W_LUMA = vec3(0.2126, 0.7152, 0.0722);\n\nvec3 hueShift(vec3 c, float degrees) {\n float a = radians(degrees);\n float co = cos(a), si = sin(a);\n mat3 m = mat3(\n 0.299 + 0.701 * co + 0.168 * si,\n 0.587 - 0.587 * co + 0.330 * si,\n 0.114 - 0.114 * co - 0.497 * si,\n\n 0.299 - 0.299 * co - 0.328 * si,\n 0.587 + 0.413 * co + 0.035 * si,\n 0.114 - 0.114 * co + 0.292 * si,\n\n 0.299 - 0.300 * co + 1.250 * si,\n 0.587 - 0.588 * co - 1.050 * si,\n 0.114 + 0.886 * co - 0.203 * si\n );\n return m * c;\n}\n\nvec3 brokenColorJitter(vec3 c, float hueSeed, float valueSeed, float strength) {\n float amt = clamp(uBrokenColor * strength, 0.0, 1.0);\n if (amt <= 0.001) return c;\n float hueDeg = (hueSeed - 0.5) * 32.0 * amt;\n float valueMul = 1.0 + (valueSeed - 0.5) * 0.28 * amt;\n return max(hueShift(c, hueDeg) * valueMul, vec3(0.0));\n}\n\nvec3 saturate3(vec3 c, float amt) {\n float l = dot(c, W_LUMA);\n return mix(vec3(l), c, amt);\n}\n\n// ACES approximation\nvec3 aces(vec3 x) {\n float a = 2.51;\n float b = 0.03;\n float c = 2.43;\n float d = 0.59;\n float e = 0.14;\n return clamp((x * (a * x + b)) / (x * (c * x + d) + e), 0.0, 1.0);\n}\n\n// \u2500\u2500 Medium overlays \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// A quick re-computation of base color for edge-mask sampling\nvec3 sampleBase(vec2 p, float t) {\n vec2 pw = domainWarp(p, t);\n float id; float vm;\n nucleiField(pw, t, id, vm);\n vec3 c = samplePalette(id);\n c *= 1.0 + uValueVariance * vm;\n return c;\n}\n\nvec3 mediumWatercolor(vec3 col, vec2 p, float t) {\n // Wet-edge cauliflowers via luma-gradient magnitude\n float eps = 0.004;\n vec3 cx1 = sampleBase(p + vec2(eps, 0.0), t);\n vec3 cx2 = sampleBase(p - vec2(eps, 0.0), t);\n vec3 cy1 = sampleBase(p + vec2(0.0, eps), t);\n vec3 cy2 = sampleBase(p - vec2(0.0, eps), t);\n float gx = dot(cx1 - cx2, W_LUMA);\n float gy = dot(cy1 - cy2, W_LUMA);\n float edge = sqrt(gx * gx + gy * gy) / (2.0 * eps);\n float mask = smoothstep(0.0, 2.5, edge);\n col *= mix(1.0, 0.78, mask * uWetEdge);\n\n // Granulation \u2014 pigment settles in paper tooth\n float paper = 0.5 * vnoise(p * 160.0) + 0.5 * vnoise(p * 360.0);\n float pigLoad = 1.0 - dot(col, W_LUMA);\n col *= 1.0 - uGranulation * pigLoad * (paper - 0.5);\n\n // Wash banding \u2014 faint horizontal wet gradient\n float band = fbm(vec2(p.x * 1.5, p.y * 0.4));\n col *= 1.0 + 0.04 * (band - 0.5);\n return col;\n}\n\nvec3 mediumPastel(vec3 col, vec2 p, float t) {\n vec2 flow = flowField(p, t);\n vec2 perp = vec2(-flow.y, flow.x);\n float along = dot(p, flow) * uStrokeScale;\n float across = dot(p, perp) * uStrokeScale;\n across += 0.03 * (vnoise(p * 260.0) - 0.5);\n\n float aniso = mix(1.0, 0.18, uStrokeAnisotropy);\n float stroke = fbm(vec2(along * aniso, across));\n col *= mix(1.0, 0.82 + 0.32 * stroke, uStrokeAmount);\n\n // Pastel tooth \u2014 tiny high-frequency grain\n float tooth = vnoise(p * 800.0);\n col *= 1.0 - 0.08 * uStrokeAmount * (tooth - 0.5);\n return col;\n}\n\n// \u2500\u2500 Curved swept brushstroke primitive \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// A stroke is a curved spine from A to B with quadratic bulge K (sideways offset\n// at midpoint). Width varies along length via a shape profile. Edge is ragged\n// (bristle-modulated), ends are rounded blobs, inside has streak modulation.\n//\n// For pixel p, we invert an approximate projection onto the curved spine:\n// 1) project p onto straight AB axis -> along0, cross0\n// 2) at parameter along0, spine offset = 4\u00B7K\u00B7along0\u00B7(1-along0) perpendicular\n// 3) cross = cross0 - spineOffset, refine along one iteration\n// Coverage blends paint atop col based on per-stroke color sampled from the\n// underlying base at spine midpoint \u2014 so overlapping strokes from different\n// palette regions meet at hard, ragged demarcations.\n\nstruct StrokeHit {\n float coverage; // 0..1\n vec3 color;\n float alongT; // 0..1 along spine, for internal modulation\n float crossN; // cross distance / current half-width, signed\n float edgeN; // distance to edge in half-widths (0 = at edge, 1 = at spine)\n};\n\nStrokeHit noHit() { return StrokeHit(0.0, vec3(0.0), 0.0, 0.0, 0.0); }\n\nvec2 rotateDir(vec2 dir, float angle) {\n float ca = cos(angle), sa = sin(angle);\n return vec2(dir.x * ca - dir.y * sa, dir.x * sa + dir.y * ca);\n}\n\nvec2 safeDir(vec2 dir) {\n float len = length(dir);\n return len > 1e-4 ? dir / len : vec2(1.0, 0.0);\n}\n\n// Shape profile along the stroke. type:\n// 0 tapered \u2014 thin-fat-thin (classic brush)\n// 1 load-drag \u2014 fat start, tapers to a point\n// 2 dab \u2014 ellipse-like, round center\n// 3 even \u2014 near-constant, slight end taper\nfloat strokeShape(float t, int type) {\n t = clamp(t, 0.0, 1.0);\n if (type == 1) {\n // loaded at t=0, tapering\n return pow(1.0 - t, 0.55) * smoothstep(0.0, 0.08, t);\n } else if (type == 2) {\n // dab / blob\n float d = t - 0.5;\n return exp(-d * d * 12.0);\n } else if (type == 3) {\n // mostly even, slight end softening\n return smoothstep(0.0, 0.08, t) * smoothstep(1.0, 0.92, t) * 0.95 + 0.05;\n }\n // 0 tapered\n return smoothstep(0.0, 0.22, t) * smoothstep(1.0, 0.78, t);\n}\n\n// A single curved stroke.\n// a, b \u2014 endpoints\n// halfW \u2014 base half-width (world units)\n// bulge \u2014 signed perpendicular midpoint offset, in world units\n// shapeType \u2014 0..3\n// bristleFreq \u2014 spatial frequency of edge raggedness\n// bristleAmp \u2014 0..0.5 fraction of halfW chewed away at edge extrema\n// streakSeed \u2014 uniqueness seed for internal streaks\n// colAtMid \u2014 pre-sampled color at midpoint\nStrokeHit curvedStroke(vec2 p, vec2 a, vec2 b, float halfW,\n float bulge, int shapeType,\n float bristleFreq, float bristleAmp,\n float streakSeed, vec3 colAtMid) {\n vec2 ab = b - a;\n float L = length(ab);\n if (L < 1e-5) return noHit();\n vec2 tang = ab / L;\n vec2 norm = vec2(-tang.y, tang.x);\n\n vec2 rel = p - a;\n float along0 = dot(rel, tang) / L; // straight projection 0..1 along AB\n float cross0 = dot(rel, norm); // signed cross\n\n // Spine sideways offset due to bulge (parabolic)\n float bend = 4.0 * bulge * along0 * (1.0 - along0);\n float cross1 = cross0 - bend;\n\n // One refinement step: as the spine bends, the closest-point along shifts.\n // Spine tangent differs from straight tangent; first-order correction:\n float dBend = 4.0 * bulge * (1.0 - 2.0 * along0); // d(bend)/d(along)\n float along1 = along0 + (cross1 * dBend) / (L * (1.0 + dBend * dBend / (L * L)));\n\n // Bristle-ragged edge: half-width gets chewed by 1D noise along the spine\n float edgeNoise = fbm(vec2(along1 * bristleFreq, streakSeed * 7.3)) - 0.5;\n float edgeNoise2 = fbm(vec2(along1 * bristleFreq * 2.3, streakSeed * 3.1 + 17.0)) - 0.5;\n float edgeMod = 1.0 - bristleAmp * (0.6 + 0.4 * edgeNoise) * (0.5 + edgeNoise2);\n\n // Width profile along the stroke\n float shape = strokeShape(along1, shapeType);\n float halfWNow = halfW * shape * edgeMod;\n\n // Inside-segment coverage\n float cov = 0.0;\n if (along1 >= 0.0 && along1 <= 1.0 && halfWNow > 1e-6) {\n float cn = abs(cross1) / halfWNow;\n // razor-hard edge with tiny aa\n cov = 1.0 - smoothstep(0.88, 1.02, cn);\n }\n\n // End-cap blobs (rounded tips, not perpendicular cuts)\n float capA = 0.0, capB = 0.0;\n {\n vec2 capCenterA = a + norm * (bulge * 0.0); // at a\n vec2 capCenterB = a + tang * L + norm * bend * 0.0 + norm * 0.0; // at b; bend is 0 at endpoints\n capCenterB = b;\n float endShapeA = strokeShape(0.02, shapeType);\n float endShapeB = strokeShape(0.98, shapeType);\n float rA = halfW * endShapeA * (0.9 + 0.2 * fbm(vec2(streakSeed * 13.0)));\n float rB = halfW * endShapeB * (0.9 + 0.2 * fbm(vec2(streakSeed * 19.0 + 5.0)));\n float dA = length(p - capCenterA);\n float dB = length(p - capCenterB);\n capA = 1.0 - smoothstep(rA * 0.85, rA * 1.05, dA);\n capB = 1.0 - smoothstep(rB * 0.85, rB * 1.05, dB);\n // Only apply caps if we're BEYOND the segment; otherwise the segment wins.\n capA *= (along1 < 0.05) ? 1.0 : 0.0;\n capB *= (along1 > 0.95) ? 1.0 : 0.0;\n }\n\n float coverage = max(cov, max(capA, capB));\n if (coverage < 0.002) return noHit();\n\n // Edge distance (for impasto later): 0 at edge, 1 at spine\n float edgeDist = halfWNow > 1e-6 ? clamp(1.0 - abs(cross1) / halfWNow, 0.0, 1.0) : 0.0;\n\n return StrokeHit(\n coverage,\n colAtMid,\n clamp(along1, 0.0, 1.0),\n halfWNow > 1e-6 ? cross1 / halfWNow : 0.0,\n edgeDist\n );\n}\n\n// Composite stroke over col with internal streaking + impasto edge highlight.\n// streakAmp \u2014 0..0.2 how much internal streaks darken/lighten\n// impastoAmp \u2014 0..1 edge catch-light strength\n// hardness \u2014 0..1 how crisp the compositing transition is (1 = razor, 0 = creamy)\nvoid paintOver(inout vec3 col, StrokeHit s, float streakFreq, float streakAmp,\n float impastoAmp, float hardness, float streakSeed) {\n if (s.coverage < 0.002) return;\n float strokeOpacity = clamp(uStrokeAmount, 0.0, 1.0);\n if (strokeOpacity <= 0.001) return;\n vec3 c = s.color;\n\n // Internal streaks \u2014 fbm along spine, modulated by cross position. Gives\n // the loaded-brush look: some bristles carry more pigment than others.\n float streakA = fbm(vec2(s.alongT * streakFreq, s.crossN * 2.7 + streakSeed));\n float streakB = fbm(vec2(s.alongT * streakFreq * 0.6 + streakSeed * 3.7, s.crossN * 4.1));\n float streak = 0.6 * (streakA - 0.5) + 0.4 * (streakB - 0.5);\n c *= 1.0 + streak * streakAmp * 2.0;\n\n // Subtle value variance across width (hollow-center catch-light)\n float crossShade = smoothstep(0.0, 0.4, s.edgeN) * (1.0 - smoothstep(0.65, 1.0, s.edgeN));\n c *= 1.0 + crossShade * 0.05;\n\n // Impasto edge highlight \u2014 bright rim on one side of the stroke\n float rim = smoothstep(0.85, 1.0, 1.0 - s.edgeN) * step(0.0, s.crossN);\n c += impastoAmp * rim * vec3(0.18, 0.15, 0.11);\n // Shadow on the other side (darker, cooler)\n float shadow = smoothstep(0.85, 1.0, 1.0 - s.edgeN) * step(0.0, -s.crossN);\n c -= impastoAmp * shadow * 0.25 * vec3(0.10, 0.09, 0.07);\n\n float softLimit = mix(0.35, 0.98, hardness);\n float alpha = smoothstep(0.0, 1.0 - softLimit, s.coverage) * strokeOpacity;\n col = mix(col, c, alpha);\n}\n\n// Best-of-9-neighbor placement: sample 3x3 surrounding cells and take the\n// stroke that covers this pixel most. Breaks the grid by per-cell jitter and\n// sparse density via noise thresholding.\nStrokeHit bestOil(vec2 p, float cellSize, float lenMul, float halfWMul,\n float jitterAmt, float density, int shapeType,\n float bristleAmp, vec2 flow, float t, float seed) {\n vec2 cell = floor(p / cellSize);\n\n StrokeHit best = noHit();\n // 3x3 neighborhood\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cc = cell + vec2(float(dx), float(dy));\n vec2 hh = hash22(cc + seed) - 0.5;\n // Density gate \u2014 noise threshold; sparse placement.\n float gate = hash21(cc * 1.7 + seed * 0.3);\n if (gate > density) continue;\n\n vec2 center = (cc + 0.5 + hh * jitterAmt) * cellSize;\n\n // Per-stroke direction: consume the layer-provided flow, then add only\n // deterministic local perturbation so alternate stroke layers stay live.\n vec2 f = safeDir(flow);\n float angJ = (hash21(cc + seed + 11.0) - 0.5) * 0.9; // +/- 0.45 rad\n float localCurl = (fbm(center * (2.6 + seed * 0.11) + seed * 1.9) - 0.5) * 0.55 * uFlowCurl;\n vec2 dir = rotateDir(f, angJ + localCurl);\n\n float lenV = cellSize * lenMul * (0.65 + 0.55 * hash21(cc + seed + 23.0));\n float halfW = cellSize * halfWMul * (0.70 + 0.55 * hash21(cc + seed + 41.0));\n float bulge = (hash21(cc + seed + 53.0) - 0.5) * lenV * 0.35;\n\n vec2 a = center - dir * (lenV * 0.5);\n vec2 b = center + dir * (lenV * 0.5);\n\n vec3 colMid = brokenColorJitter(\n sampleBase(center, t),\n hash21(cc + seed + 89.0),\n hash21(cc * 2.3 + seed + 97.0),\n 1.0\n );\n\n StrokeHit h = curvedStroke(p, a, b, halfW, bulge, shapeType,\n 7.0, bristleAmp,\n hash21(cc + seed + 67.0), colMid);\n if (h.coverage > best.coverage) best = h;\n }\n }\n return best;\n}\n\n// \u2500\u2500 Crayon / oil-pastel \u2014 paper tooth \u00D7 wax pigment \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Crayon is not strokes. It's pigment crumbs dragged across paper tooth.\n// Model: heavy 2D tooth noise at multiple scales, anisotropically stretched\n// along flow direction, multiplied into the base color. Add a slow \"waxy\n// film\" that slightly unifies hues, and occasional darker \"pressed\" spots\n// where the crayon dug in. NO straight segments.\nvec3 mediumOil_crayon(vec3 col, vec2 p, float t) {\n vec2 flow = flowField(p, t);\n float ang = atan(flow.y, flow.x);\n float ca = cos(-ang), sa = sin(-ang);\n vec2 pr = vec2(p.x * ca - p.y * sa, p.x * sa + p.y * ca);\n\n // Anisotropic tooth \u2014 squished along flow, coarse cross flow.\n float aniso = mix(0.45, 0.95, uStrokeAnisotropy);\n float scale = max(uStrokeScale * 1.6, 180.0);\n\n float t1 = vnoise(vec2(pr.x * scale * aniso, pr.y * scale));\n float t2 = vnoise(vec2(pr.x * scale * aniso * 0.4, pr.y * scale * 0.4) + 11.0);\n float t3 = vnoise(vec2(pr.x * scale * aniso * 2.1, pr.y * scale * 2.1) + 23.0);\n float tooth = 0.55 * t1 + 0.30 * t2 + 0.15 * t3;\n // Center at 0, amplify\n tooth = (tooth - 0.5) * 1.4;\n\n // Multiplicative darkening where tooth is low (pigment skipped paper valleys)\n float lay = 1.0 + tooth * 0.32 * uStrokeAmount;\n vec3 result = col * lay;\n\n // Occasional pressed-in crumbs \u2014 rare darker crumbs\n float crumbs = smoothstep(0.78, 0.95, vnoise(pr * scale * 3.0));\n result *= 1.0 - crumbs * 0.18 * uStrokeAmount;\n\n // Waxy highlight film \u2014 slight lightening on tooth peaks\n float waxy = smoothstep(0.55, 0.85, t1);\n result += waxy * 0.04 * vec3(1.0);\n\n // Paper tooth overlay (subtler than oil's canvas)\n float paperTooth = vnoise(p * 340.0) - 0.5;\n result *= 1.0 + paperTooth * 0.14 * uCanvasGrain;\n\n // Broken-color pigment: stable wax/pigment patches, not temporal flicker.\n vec2 pigmentCell = floor(pr * max(scale * 0.18, 32.0));\n float pigmentMask = smoothstep(0.28, 0.82, vnoise(pr * scale * 0.21 + 19.0));\n result = brokenColorJitter(\n result,\n hash21(pigmentCell + 17.0),\n hash21(pigmentCell * 2.1 + 31.0),\n 0.45 + 0.55 * pigmentMask\n );\n\n // Crayon is saturation-amplified\n result = saturate3(result, 1.12);\n\n return result;\n}\n\nvec3 mediumOil(vec3 col, vec2 p, float t) {\n // Mode knobs (uStrokeMode):\n // 0 oil \u2014 balanced modern-abstract/palette-knife hybrid\n // 1 knife \u2014 palette-knife impasto: razor edges, heavy bristle/shadow\n // 2 crayon \u2014 soft-edged wax smudges on tooth (no straight segments)\n // 3 brushwork \u2014 thick bristle brush\n int mode = uStrokeMode;\n\n // Per-mode parameters\n int shapeType = 0; // tapered\n float bristleAmp = 0.25; // 0..0.5\n float streakFreq = 9.0;\n float streakAmp = 0.09;\n float impastoAmp = 0.9;\n float hardness = 0.80; // edge compositing\n float toothScale = 240.0;\n float toothAmp = 0.09;\n float pigmentSat = 1.03;\n float densityBig = 0.65;\n float densityMed = 0.78;\n float densitySml = 0.90;\n\n if (mode == 1) { // palette knife\n shapeType = 3; // flat, even\n bristleAmp = 0.12;\n streakFreq = 4.0; streakAmp = 0.05;\n impastoAmp = 1.6;\n hardness = 0.95;\n toothAmp = 0.04;\n densityBig = 0.80; densityMed = 0.88; densitySml = 0.70;\n } else if (mode == 2) { // crayon \u2014 handled specially below\n return mediumOil_crayon(col, p, t);\n } else if (mode == 3) { // thick brushwork\n shapeType = 0; // tapered\n bristleAmp = 0.32;\n streakFreq = 14.0; streakAmp = 0.14;\n impastoAmp = 1.2;\n hardness = 0.85;\n toothAmp = 0.07;\n }\n\n // Scales & multipliers from uniforms\n float baseScale = max(uStrokeScale * 0.006, 0.008);\n // Three layers: big gestural, medium body, small dabs\n float sBig = baseScale * 2.4;\n float sMed = baseScale * 1.1;\n float sSml = baseScale * 0.45;\n\n float lenMulBig = mix(2.2, 3.8, uStrokeAnisotropy);\n float widMulBig = mix(0.55, 0.32, uStrokeAnisotropy);\n float lenMulMed = mix(2.0, 3.4, uStrokeAnisotropy);\n float widMulMed = mix(0.50, 0.30, uStrokeAnisotropy);\n float lenMulSml = mix(1.6, 2.6, uStrokeAnisotropy);\n float widMulSml = mix(0.45, 0.32, uStrokeAnisotropy);\n\n float jitterAmt = 0.75; // large jitter \u2014 no grid\n vec2 flow = flowField(p, t);\n\n vec3 result = col;\n\n // Layer 1 \u2014 big gestural strokes (sparse, shaping)\n StrokeHit hBig = bestOil(p, sBig, lenMulBig, widMulBig, jitterAmt * 0.55,\n densityBig, shapeType, bristleAmp, flow, t, 1.3);\n paintOver(result, hBig, streakFreq * 0.7, streakAmp,\n uImpasto * impastoAmp * uStrokeAmount, hardness, 1.3);\n\n // Layer 2 \u2014 medium body strokes\n StrokeHit hMed = bestOil(p + vec2(11.3, 3.7), sMed, lenMulMed, widMulMed,\n jitterAmt, densityMed, shapeType, bristleAmp, flow, t, 2.7);\n paintOver(result, hMed, streakFreq, streakAmp,\n uImpasto * impastoAmp * uStrokeAmount, hardness, 2.7);\n\n // Layer 3 \u2014 small dabs (more frequent, smaller)\n int smlShape = (mode == 1) ? 2 : shapeType; // knife uses dabs for sparkle\n StrokeHit hSml = bestOil(p + vec2(-5.1, 8.4), sSml, lenMulSml, widMulSml,\n jitterAmt * 1.3, densitySml, smlShape,\n bristleAmp * 0.85, flow, t, 4.1);\n paintOver(result, hSml, streakFreq * 1.4, streakAmp * 0.8,\n uImpasto * impastoAmp * 0.65 * uStrokeAmount, hardness, 4.1);\n\n // Layer 4 \u2014 fill dabs (very dense, very small) \u2014 covers bald spots\n float sFill = baseScale * 0.22;\n float lenMulFill = mix(1.4, 2.0, uStrokeAnisotropy);\n float widMulFill = mix(0.50, 0.38, uStrokeAnisotropy);\n int fillShape = (mode == 1) ? 3 : 2; // knife=even, others=dab (round fills)\n StrokeHit hFill = bestOil(p + vec2(3.9, -6.2), sFill, lenMulFill, widMulFill,\n jitterAmt * 1.5, 0.95, fillShape,\n bristleAmp * 0.6, flow, t, 8.9);\n paintOver(result, hFill, streakFreq * 1.8, streakAmp * 0.6,\n uImpasto * impastoAmp * 0.4 * uStrokeAmount, hardness * 0.9, 8.9);\n\n // Optional crosshatch layer\n if (uStrokeLayers == 2) {\n vec2 flow2 = vec2(-flow.y, flow.x);\n StrokeHit hX = bestOil(p + vec2(7.3, -2.1), sMed, lenMulMed * 0.9, widMulMed,\n jitterAmt, densityMed * 0.7, shapeType, bristleAmp, flow2, t, 6.5);\n paintOver(result, hX, streakFreq, streakAmp * 0.85,\n uImpasto * impastoAmp * 0.55 * uStrokeAmount, hardness, 6.5);\n }\n\n // Canvas tooth \u2014 linen weave\n float tooth1 = vnoise(p * toothScale);\n float tooth2 = vnoise(p * toothScale * vec2(0.6, 2.4) + 37.0);\n float tooth = (0.6 * tooth1 + 0.4 * tooth2) - 0.5;\n result *= 1.0 + tooth * toothAmp * uCanvasGrain;\n\n // Pigment saturation boost\n result = saturate3(result, pigmentSat);\n\n return result;\n}\n\n// \u2500\u2500 Main \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvoid main() {\n // Normalized 0..1 coordinates for nuclei, domain warp, and medium sampling.\n vec2 uv = vUv;\n vec2 pN = uv;\n\n float t = uTime;\n\n // Warp in pN space\n vec2 p_warp = domainWarp(pN, t);\n\n // Composition\n float paletteId; float valueMod;\n nucleiField(p_warp, t, paletteId, valueMod);\n vec3 col = samplePalette(paletteId);\n col *= 1.0 + uValueVariance * valueMod;\n\n // Breath \u2014 slow global luminance wobble\n float breath = sin(t * 6.2831 / max(uBreathPeriod, 1.0));\n col *= 1.0 + uBreathDepth * breath * 0.5;\n\n // Medium\n if (uMedium == 1) col = mediumPastel(col, pN, t);\n else if (uMedium == 2) col = mediumWatercolor(col, pN, t);\n else if (uMedium == 3) col = mediumOil(col, pN, t);\n\n // Saturation trim\n col = saturate3(col, uSaturation);\n\n // Tonemap + film grain\n col = aces(col);\n float grain = hash21(gl_FragCoord.xy + t * 17.0);\n col += (grain - 0.5) * uPaperGrain;\n\n col = clamp(col * 0.985 + 0.008, 0.0, 1.0);\n fragColor = vec4(col * uAlpha, uAlpha);\n}\n";
1
+ export declare const FRAGMENT_SRC = "#version 300 es\nprecision highp float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\n#define MAX_NUCLEI 6\n#define MAX_STOPS 8\n\n// \u2500\u2500 Uniforms \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nuniform float uTime;\n\n// Palette baked CPU-side to linear-sRGB\nuniform vec3 uPalette[MAX_STOPS];\nuniform int uStopCount;\n\n// Nuclei (parallel arrays)\nuniform int uNucleiCount;\nuniform vec2 uNucleiPos[MAX_NUCLEI];\nuniform float uNucleiRadius[MAX_NUCLEI];\nuniform float uNucleiPaletteBias[MAX_NUCLEI];\nuniform float uNucleiValueBias[MAX_NUCLEI];\nuniform float uNucleiDriftRadius[MAX_NUCLEI];\nuniform float uNucleiDriftPhase[MAX_NUCLEI];\n// Anisotropy: per-nucleus elongation (1.0 = isotropic) and major-axis angle (radians).\n// Defaults (1.0 / 0.0) reduce to the original circular Gaussian.\nuniform float uNucleiElong[MAX_NUCLEI];\nuniform float uNucleiAngle[MAX_NUCLEI];\nuniform float uSoftmaxBeta;\nuniform float uValueVariance;\n\n// Warp\nuniform float uWarpAmount;\nuniform float uWarpScale;\nuniform float uWarpDrift;\nuniform int uWarpMode; // 0=fbm 1=cellular 2=hybrid\nuniform int uNoiseOctaves;\n\n// Medium\n// 0 smooth, 1 pastel, 2 watercolor, 3 oil\nuniform int uMedium;\nuniform int uFlowPattern; // 0 none, 1 radial, 2 swirl, 3 diagonal, 4 multi\nuniform vec2 uFlowFocal;\nuniform float uFlowAngle;\nuniform float uFlowCurl;\nuniform vec2 uCursor; // in 0..1 screen space (matches pN)\nuniform float uCursorStrength; // 0..1 attraction amount\nuniform float uCursorRadius; // radius of influence (0.05..0.5)\nuniform float uStrokeAmount;\nuniform float uStrokeScale;\nuniform float uStrokeAnisotropy;\nuniform int uStrokeLayers; // 1 or 2 (crosshatch)\nuniform int uStrokeMode; // 0 oil (modern gestural), 1 palette-knife, 2 crayon/oil-pastel, 3 modern-chunky\nuniform float uWetEdge;\nuniform float uGranulation;\nuniform float uImpasto;\nuniform float uBrokenColor;\nuniform float uCanvasGrain;\n\n// Motion\nuniform float uNucleiDrift;\nuniform float uPaletteDrift;\nuniform float uBreathDepth;\nuniform float uBreathPeriod;\n\n// Output\nuniform float uSaturation;\nuniform float uPaperGrain;\nuniform float uAlpha;\n\n// \u2500\u2500 Time rate \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// The authoring coefficients (uNucleiDrift, uPaletteDrift, uWarpDrift) live in a\n// human-friendly 0..~0.05 band \u2014 that scale is what the config schema and every\n// demo preset are tuned against. But that band, multiplied straight into uTime\n// (seconds), yields rad/sec rates so small the field reads visually static (one\n// nuclei orbit took ~10 min at the old default). These K_* constants decouple\n// the AUTHORING scale from the RAD/SEC scale: each time term wraps its coefficient\n// in the matching K_, lifting the same authored value to a perceptible period\n// without touching any preset. Tuned so the field reads SLOWLY ALIVE \u2014 drift over\n// a ~5\u201315s window, never a frantic pan. These are downstream of uTime, which the\n// runtime FREEZES under reduced-motion (t = frozenOffset) before the shader sees\n// it, so the lift cannot leak motion into the reduced-motion path.\nconst float K_NUCLEI = 14.0; // nuclei orbit: ~one cycle per ~45s at default 0.01\nconst float K_PAL = 24.0; // palette hue breathe: ~one cycle per ~33s at default\nconst float K_WARP = 5.0; // domain warp scroll: a perceptible fbm-cell traverse\n\n// \u2500\u2500 Noise \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nfloat hash21(vec2 p) {\n p = fract(p * vec2(123.34, 456.21));\n p += dot(p, p + 45.32);\n return fract(p.x * p.y);\n}\n\nvec2 hash22(vec2 p) {\n p = vec2(dot(p, vec2(127.1, 311.7)),\n dot(p, vec2(269.5, 183.3)));\n return fract(sin(p) * 43758.5453);\n}\n\nfloat vnoise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u = f * f * (3.0 - 2.0 * f);\n float a = hash21(i);\n float b = hash21(i + vec2(1.0, 0.0));\n float c = hash21(i + vec2(0.0, 1.0));\n float d = hash21(i + vec2(1.0, 1.0));\n return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);\n}\n\nfloat fbm(vec2 p) {\n float v = 0.0;\n float a = 0.5;\n mat2 r = mat2(0.8, 0.6, -0.6, 0.8);\n for (int i = 0; i < 5; i++) {\n if (i >= uNoiseOctaves) break;\n v += a * vnoise(p);\n p = r * p * 2.02;\n a *= 0.5;\n }\n return v;\n}\n\n// Cellular / Worley f1\nfloat cellular(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n float m = 1e9;\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n vec2 g = vec2(float(x), float(y));\n vec2 o = hash22(i + g);\n vec2 r = g + o - f;\n m = min(m, dot(r, r));\n }\n }\n return sqrt(m);\n}\n\n// \u2500\u2500 Warp \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvec2 domainWarp(vec2 p, float t) {\n // Quilez canonical double warp\n vec2 q = vec2(fbm(p * uWarpScale + vec2(0.0, 0.0) + t * uWarpDrift * K_WARP),\n fbm(p * uWarpScale + vec2(5.2, 1.3) + t * uWarpDrift * K_WARP));\n vec2 r = vec2(fbm(p * uWarpScale + 4.0 * q + vec2(1.7, 9.2)),\n fbm(p * uWarpScale + 4.0 * q + vec2(8.3, 2.8)));\n\n vec2 warp = r;\n if (uWarpMode == 1) {\n // cellular \u2014 chunky territories (MEADOW block-like)\n float c1 = cellular(p * uWarpScale * 1.5 + vec2(t * uWarpDrift * K_WARP * 2.0, 0.0));\n float c2 = cellular(p * uWarpScale * 1.5 + vec2(11.0, 7.0 + t * uWarpDrift * K_WARP * 2.0));\n warp = vec2(c1, c2);\n } else if (uWarpMode == 2) {\n // hybrid \u2014 fbm + cellular averaged\n float c1 = cellular(p * uWarpScale * 1.2);\n float c2 = cellular(p * uWarpScale * 1.2 + vec2(11.0, 7.0));\n warp = mix(r, vec2(c1, c2), 0.5);\n }\n vec2 warped = p + uWarpAmount * warp;\n\n // Cursor swirl \u2014 rotate p around uCursor with radial falloff.\n // This warps the underlying color field so the bands sweep around the pointer.\n if (uCursorStrength > 0.001) {\n vec2 toP = p - uCursor;\n float d = length(toP);\n float r = max(uCursorRadius, 0.01);\n // Smooth falloff; strong near cursor, zero beyond ~1.5\u00D7 radius.\n float w = exp(-(d * d) / (r * r * 0.45));\n // Max rotation ~120\u00B0 at cursor center, scaled by strength\n float ang = w * uCursorStrength * 2.1;\n float ca = cos(ang), sa = sin(ang);\n vec2 rotated = vec2(ca * toP.x - sa * toP.y, sa * toP.x + ca * toP.y) + uCursor;\n // Also pinch slightly toward the cursor (gravity) \u2014 adds depth to swirl\n float pinch = w * uCursorStrength * 0.08;\n rotated = mix(rotated, uCursor, pinch);\n // Blend original warped position with cursor-rotated version\n warped = mix(warped, rotated + uWarpAmount * warp * 0.7, w * uCursorStrength);\n }\n\n return warped;\n}\n\n// \u2500\u2500 Palette LUT \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvec3 samplePalette(float id) {\n id = clamp(id, 0.0, 1.0);\n float scaled = id * float(uStopCount - 1);\n int i0 = int(floor(scaled));\n int i1 = min(i0 + 1, uStopCount - 1);\n float t = fract(scaled);\n t = smoothstep(0.0, 1.0, t);\n return mix(uPalette[i0], uPalette[i1], t);\n}\n\n// \u2500\u2500 Nuclei field \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvoid nucleiField(vec2 p, float t, out float paletteId, out float valueMod) {\n float accumBias = 0.0;\n float accumValue = 0.0;\n float accumW = 0.0;\n for (int i = 0; i < MAX_NUCLEI; i++) {\n if (i >= uNucleiCount) break;\n vec2 posI = uNucleiPos[i]\n + uNucleiDriftRadius[i] * vec2(\n cos(t * uNucleiDrift * K_NUCLEI + uNucleiDriftPhase[i]),\n sin(t * uNucleiDrift * K_NUCLEI + uNucleiDriftPhase[i] * 1.13)\n );\n vec2 diff = p - posI;\n // Anisotropic Gaussian: rotate diff into the nucleus's local frame\n // (major axis along uNucleiAngle), then scale the major-axis component by\n // 1/elongation so the squared distance describes an ellipse. Defaults\n // 1.0/0.0 reduce to the isotropic dot(diff, diff).\n float ca = cos(uNucleiAngle[i]);\n float sa = sin(uNucleiAngle[i]);\n vec2 local = vec2( ca * diff.x + sa * diff.y,\n -sa * diff.x + ca * diff.y);\n float along = local.x / max(uNucleiElong[i], 0.01);\n float across = local.y;\n float d2 = along * along + across * across;\n float r = max(uNucleiRadius[i], 0.01);\n float w = exp(-uSoftmaxBeta * d2 / (r * r));\n accumBias += w * uNucleiPaletteBias[i];\n accumValue += w * uNucleiValueBias[i];\n accumW += w;\n }\n paletteId = accumBias / max(accumW, 1e-4);\n valueMod = accumValue / max(accumW, 1e-4);\n\n // Palette drift \u2014 slow global paletteId breathe between adjacent stops. The\n // rate rides K_PAL (perceptible ~30\u201360s hue cycle at the default coefficient);\n // the amplitude lifts the authored coefficient into a 0.03..0.06 paletteId band\n // so the palette visibly travels rather than dithering within one stop.\n float palAmp = clamp(uPaletteDrift * 6.0, 0.0, 0.06);\n paletteId += palAmp * sin(t * uPaletteDrift * K_PAL);\n paletteId = clamp(paletteId, 0.0, 1.0);\n}\n\n// \u2500\u2500 Flow field \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvec2 flowField(vec2 p, float t) {\n vec2 dir = vec2(1.0, 0.0);\n if (uFlowPattern == 1) {\n // radial\n dir = normalize(p - uFlowFocal + 1e-4);\n } else if (uFlowPattern == 2) {\n // swirl \u2014 tangent to radial\n vec2 rad = normalize(p - uFlowFocal + 1e-4);\n dir = vec2(-rad.y, rad.x);\n } else if (uFlowPattern == 3) {\n // diagonal\n float a = radians(uFlowAngle);\n dir = vec2(cos(a), sin(a));\n } else if (uFlowPattern == 4) {\n // multi \u2014 curl-noise driven\n float n = fbm(p * 2.0 + t * 0.02);\n float a = n * 6.2831;\n dir = vec2(cos(a), sin(a));\n }\n // curl \u2014 perturb by noise. Radial gets much less curl so rays stay clean.\n if (uFlowCurl > 0.0) {\n float n = fbm(p * 3.0) - 0.5;\n float curlAmt = uFlowCurl;\n if (uFlowPattern == 1) curlAmt *= 0.25; // radial: preserve ray clarity\n if (uFlowPattern == 2) curlAmt *= 0.55; // swirl: allow moderate curl\n float a = atan(dir.y, dir.x) + n * 3.14159 * curlAmt;\n dir = vec2(cos(a), sin(a));\n }\n // cursor influence \u2014 swirl around the cursor position\n if (uCursorStrength > 0.001) {\n vec2 toCur = uCursor - p;\n float d = length(toCur);\n float r = max(uCursorRadius, 0.01);\n float w = exp(-(d * d) / (r * r * 0.5));\n // swirl tangent\n vec2 tangent = vec2(-toCur.y, toCur.x) / max(d, 1e-4);\n float a0 = atan(dir.y, dir.x);\n float a1 = atan(tangent.y, tangent.x);\n // blend angle\n float da = a1 - a0;\n da = atan(sin(da), cos(da)); // wrap to [-pi, pi]\n float a = a0 + da * w * uCursorStrength;\n dir = vec2(cos(a), sin(a));\n }\n return dir;\n}\n\n// \u2500\u2500 Color utils \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nconst vec3 W_LUMA = vec3(0.2126, 0.7152, 0.0722);\n\nvec3 hueShift(vec3 c, float degrees) {\n float a = radians(degrees);\n float co = cos(a), si = sin(a);\n mat3 m = mat3(\n 0.299 + 0.701 * co + 0.168 * si,\n 0.587 - 0.587 * co + 0.330 * si,\n 0.114 - 0.114 * co - 0.497 * si,\n\n 0.299 - 0.299 * co - 0.328 * si,\n 0.587 + 0.413 * co + 0.035 * si,\n 0.114 - 0.114 * co + 0.292 * si,\n\n 0.299 - 0.300 * co + 1.250 * si,\n 0.587 - 0.588 * co - 1.050 * si,\n 0.114 + 0.886 * co - 0.203 * si\n );\n return m * c;\n}\n\nvec3 brokenColorJitter(vec3 c, float hueSeed, float valueSeed, float strength) {\n float amt = clamp(uBrokenColor * strength, 0.0, 1.0);\n if (amt <= 0.001) return c;\n float hueDeg = (hueSeed - 0.5) * 32.0 * amt;\n float valueMul = 1.0 + (valueSeed - 0.5) * 0.28 * amt;\n return max(hueShift(c, hueDeg) * valueMul, vec3(0.0));\n}\n\nvec3 saturate3(vec3 c, float amt) {\n float l = dot(c, W_LUMA);\n return mix(vec3(l), c, amt);\n}\n\n// ACES approximation\nvec3 aces(vec3 x) {\n float a = 2.51;\n float b = 0.03;\n float c = 2.43;\n float d = 0.59;\n float e = 0.14;\n return clamp((x * (a * x + b)) / (x * (c * x + d) + e), 0.0, 1.0);\n}\n\n// \u2500\u2500 Medium overlays \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// A quick re-computation of base color for edge-mask sampling\nvec3 sampleBase(vec2 p, float t) {\n vec2 pw = domainWarp(p, t);\n float id; float vm;\n nucleiField(pw, t, id, vm);\n vec3 c = samplePalette(id);\n c *= 1.0 + uValueVariance * vm;\n return c;\n}\n\nvec3 mediumWatercolor(vec3 col, vec2 p, float t) {\n // Wet-edge cauliflowers via luma-gradient magnitude\n float eps = 0.004;\n vec3 cx1 = sampleBase(p + vec2(eps, 0.0), t);\n vec3 cx2 = sampleBase(p - vec2(eps, 0.0), t);\n vec3 cy1 = sampleBase(p + vec2(0.0, eps), t);\n vec3 cy2 = sampleBase(p - vec2(0.0, eps), t);\n float gx = dot(cx1 - cx2, W_LUMA);\n float gy = dot(cy1 - cy2, W_LUMA);\n float edge = sqrt(gx * gx + gy * gy) / (2.0 * eps);\n float mask = smoothstep(0.0, 2.5, edge);\n col *= mix(1.0, 0.78, mask * uWetEdge);\n\n // Granulation \u2014 pigment settles in paper tooth\n float paper = 0.5 * vnoise(p * 160.0) + 0.5 * vnoise(p * 360.0);\n float pigLoad = 1.0 - dot(col, W_LUMA);\n col *= 1.0 - uGranulation * pigLoad * (paper - 0.5);\n\n // Wash banding \u2014 faint horizontal wet gradient\n float band = fbm(vec2(p.x * 1.5, p.y * 0.4));\n col *= 1.0 + 0.04 * (band - 0.5);\n return col;\n}\n\nvec3 mediumPastel(vec3 col, vec2 p, float t) {\n vec2 flow = flowField(p, t);\n vec2 perp = vec2(-flow.y, flow.x);\n float along = dot(p, flow) * uStrokeScale;\n float across = dot(p, perp) * uStrokeScale;\n across += 0.03 * (vnoise(p * 260.0) - 0.5);\n\n float aniso = mix(1.0, 0.18, uStrokeAnisotropy);\n float stroke = fbm(vec2(along * aniso, across));\n col *= mix(1.0, 0.82 + 0.32 * stroke, uStrokeAmount);\n\n // Pastel tooth \u2014 tiny high-frequency grain\n float tooth = vnoise(p * 800.0);\n col *= 1.0 - 0.08 * uStrokeAmount * (tooth - 0.5);\n return col;\n}\n\n// \u2500\u2500 Curved swept brushstroke primitive \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// A stroke is a curved spine from A to B with quadratic bulge K (sideways offset\n// at midpoint). Width varies along length via a shape profile. Edge is ragged\n// (bristle-modulated), ends are rounded blobs, inside has streak modulation.\n//\n// For pixel p, we invert an approximate projection onto the curved spine:\n// 1) project p onto straight AB axis -> along0, cross0\n// 2) at parameter along0, spine offset = 4\u00B7K\u00B7along0\u00B7(1-along0) perpendicular\n// 3) cross = cross0 - spineOffset, refine along one iteration\n// Coverage blends paint atop col based on per-stroke color sampled from the\n// underlying base at spine midpoint \u2014 so overlapping strokes from different\n// palette regions meet at hard, ragged demarcations.\n\nstruct StrokeHit {\n float coverage; // 0..1\n vec3 color;\n float alongT; // 0..1 along spine, for internal modulation\n float crossN; // cross distance / current half-width, signed\n float edgeN; // distance to edge in half-widths (0 = at edge, 1 = at spine)\n};\n\nStrokeHit noHit() { return StrokeHit(0.0, vec3(0.0), 0.0, 0.0, 0.0); }\n\nvec2 rotateDir(vec2 dir, float angle) {\n float ca = cos(angle), sa = sin(angle);\n return vec2(dir.x * ca - dir.y * sa, dir.x * sa + dir.y * ca);\n}\n\nvec2 safeDir(vec2 dir) {\n float len = length(dir);\n return len > 1e-4 ? dir / len : vec2(1.0, 0.0);\n}\n\n// Shape profile along the stroke. type:\n// 0 tapered \u2014 thin-fat-thin (classic brush)\n// 1 load-drag \u2014 fat start, tapers to a point\n// 2 dab \u2014 ellipse-like, round center\n// 3 even \u2014 near-constant, slight end taper\nfloat strokeShape(float t, int type) {\n t = clamp(t, 0.0, 1.0);\n if (type == 1) {\n // loaded at t=0, tapering\n return pow(1.0 - t, 0.55) * smoothstep(0.0, 0.08, t);\n } else if (type == 2) {\n // dab / blob\n float d = t - 0.5;\n return exp(-d * d * 12.0);\n } else if (type == 3) {\n // mostly even, slight end softening\n return smoothstep(0.0, 0.08, t) * smoothstep(1.0, 0.92, t) * 0.95 + 0.05;\n }\n // 0 tapered\n return smoothstep(0.0, 0.22, t) * smoothstep(1.0, 0.78, t);\n}\n\n// A single curved stroke.\n// a, b \u2014 endpoints\n// halfW \u2014 base half-width (world units)\n// bulge \u2014 signed perpendicular midpoint offset, in world units\n// shapeType \u2014 0..3\n// bristleFreq \u2014 spatial frequency of edge raggedness\n// bristleAmp \u2014 0..0.5 fraction of halfW chewed away at edge extrema\n// streakSeed \u2014 uniqueness seed for internal streaks\n// colAtMid \u2014 pre-sampled color at midpoint\nStrokeHit curvedStroke(vec2 p, vec2 a, vec2 b, float halfW,\n float bulge, int shapeType,\n float bristleFreq, float bristleAmp,\n float streakSeed, vec3 colAtMid) {\n vec2 ab = b - a;\n float L = length(ab);\n if (L < 1e-5) return noHit();\n vec2 tang = ab / L;\n vec2 norm = vec2(-tang.y, tang.x);\n\n vec2 rel = p - a;\n float along0 = dot(rel, tang) / L; // straight projection 0..1 along AB\n float cross0 = dot(rel, norm); // signed cross\n\n // Spine sideways offset due to bulge (parabolic)\n float bend = 4.0 * bulge * along0 * (1.0 - along0);\n float cross1 = cross0 - bend;\n\n // One refinement step: as the spine bends, the closest-point along shifts.\n // Spine tangent differs from straight tangent; first-order correction:\n float dBend = 4.0 * bulge * (1.0 - 2.0 * along0); // d(bend)/d(along)\n float along1 = along0 + (cross1 * dBend) / (L * (1.0 + dBend * dBend / (L * L)));\n\n // Bristle-ragged edge: half-width gets chewed by 1D noise along the spine\n float edgeNoise = fbm(vec2(along1 * bristleFreq, streakSeed * 7.3)) - 0.5;\n float edgeNoise2 = fbm(vec2(along1 * bristleFreq * 2.3, streakSeed * 3.1 + 17.0)) - 0.5;\n float edgeMod = 1.0 - bristleAmp * (0.6 + 0.4 * edgeNoise) * (0.5 + edgeNoise2);\n\n // Width profile along the stroke\n float shape = strokeShape(along1, shapeType);\n float halfWNow = halfW * shape * edgeMod;\n\n // Inside-segment coverage\n float cov = 0.0;\n if (along1 >= 0.0 && along1 <= 1.0 && halfWNow > 1e-6) {\n float cn = abs(cross1) / halfWNow;\n // razor-hard edge with tiny aa\n cov = 1.0 - smoothstep(0.88, 1.02, cn);\n }\n\n // End-cap blobs (rounded tips, not perpendicular cuts)\n float capA = 0.0, capB = 0.0;\n {\n vec2 capCenterA = a + norm * (bulge * 0.0); // at a\n vec2 capCenterB = a + tang * L + norm * bend * 0.0 + norm * 0.0; // at b; bend is 0 at endpoints\n capCenterB = b;\n float endShapeA = strokeShape(0.02, shapeType);\n float endShapeB = strokeShape(0.98, shapeType);\n float rA = halfW * endShapeA * (0.9 + 0.2 * fbm(vec2(streakSeed * 13.0)));\n float rB = halfW * endShapeB * (0.9 + 0.2 * fbm(vec2(streakSeed * 19.0 + 5.0)));\n float dA = length(p - capCenterA);\n float dB = length(p - capCenterB);\n capA = 1.0 - smoothstep(rA * 0.85, rA * 1.05, dA);\n capB = 1.0 - smoothstep(rB * 0.85, rB * 1.05, dB);\n // Only apply caps if we're BEYOND the segment; otherwise the segment wins.\n capA *= (along1 < 0.05) ? 1.0 : 0.0;\n capB *= (along1 > 0.95) ? 1.0 : 0.0;\n }\n\n float coverage = max(cov, max(capA, capB));\n if (coverage < 0.002) return noHit();\n\n // Edge distance (for impasto later): 0 at edge, 1 at spine\n float edgeDist = halfWNow > 1e-6 ? clamp(1.0 - abs(cross1) / halfWNow, 0.0, 1.0) : 0.0;\n\n return StrokeHit(\n coverage,\n colAtMid,\n clamp(along1, 0.0, 1.0),\n halfWNow > 1e-6 ? cross1 / halfWNow : 0.0,\n edgeDist\n );\n}\n\n// Composite stroke over col with internal streaking + impasto edge highlight.\n// streakAmp \u2014 0..0.2 how much internal streaks darken/lighten\n// impastoAmp \u2014 0..1 edge catch-light strength\n// hardness \u2014 0..1 how crisp the compositing transition is (1 = razor, 0 = creamy)\nvoid paintOver(inout vec3 col, StrokeHit s, float streakFreq, float streakAmp,\n float impastoAmp, float hardness, float streakSeed) {\n if (s.coverage < 0.002) return;\n float strokeOpacity = clamp(uStrokeAmount, 0.0, 1.0);\n if (strokeOpacity <= 0.001) return;\n vec3 c = s.color;\n\n // Internal streaks \u2014 fbm along spine, modulated by cross position. Gives\n // the loaded-brush look: some bristles carry more pigment than others.\n float streakA = fbm(vec2(s.alongT * streakFreq, s.crossN * 2.7 + streakSeed));\n float streakB = fbm(vec2(s.alongT * streakFreq * 0.6 + streakSeed * 3.7, s.crossN * 4.1));\n float streak = 0.6 * (streakA - 0.5) + 0.4 * (streakB - 0.5);\n c *= 1.0 + streak * streakAmp * 2.0;\n\n // Subtle value variance across width (hollow-center catch-light)\n float crossShade = smoothstep(0.0, 0.4, s.edgeN) * (1.0 - smoothstep(0.65, 1.0, s.edgeN));\n c *= 1.0 + crossShade * 0.05;\n\n // Impasto edge highlight \u2014 bright rim on one side of the stroke\n float rim = smoothstep(0.85, 1.0, 1.0 - s.edgeN) * step(0.0, s.crossN);\n c += impastoAmp * rim * vec3(0.18, 0.15, 0.11);\n // Shadow on the other side (darker, cooler)\n float shadow = smoothstep(0.85, 1.0, 1.0 - s.edgeN) * step(0.0, -s.crossN);\n c -= impastoAmp * shadow * 0.25 * vec3(0.10, 0.09, 0.07);\n\n float softLimit = mix(0.35, 0.98, hardness);\n float alpha = smoothstep(0.0, 1.0 - softLimit, s.coverage) * strokeOpacity;\n col = mix(col, c, alpha);\n}\n\n// Best-of-9-neighbor placement: sample 3x3 surrounding cells and take the\n// stroke that covers this pixel most. Breaks the grid by per-cell jitter and\n// sparse density via noise thresholding.\nStrokeHit bestOil(vec2 p, float cellSize, float lenMul, float halfWMul,\n float jitterAmt, float density, int shapeType,\n float bristleAmp, vec2 flow, float t, float seed) {\n vec2 cell = floor(p / cellSize);\n\n StrokeHit best = noHit();\n // 3x3 neighborhood\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cc = cell + vec2(float(dx), float(dy));\n vec2 hh = hash22(cc + seed) - 0.5;\n // Density gate \u2014 noise threshold; sparse placement.\n float gate = hash21(cc * 1.7 + seed * 0.3);\n if (gate > density) continue;\n\n vec2 center = (cc + 0.5 + hh * jitterAmt) * cellSize;\n\n // Per-stroke direction: consume the layer-provided flow, then add only\n // deterministic local perturbation so alternate stroke layers stay live.\n vec2 f = safeDir(flow);\n float angJ = (hash21(cc + seed + 11.0) - 0.5) * 0.9; // +/- 0.45 rad\n float localCurl = (fbm(center * (2.6 + seed * 0.11) + seed * 1.9) - 0.5) * 0.55 * uFlowCurl;\n vec2 dir = rotateDir(f, angJ + localCurl);\n\n float lenV = cellSize * lenMul * (0.65 + 0.55 * hash21(cc + seed + 23.0));\n float halfW = cellSize * halfWMul * (0.70 + 0.55 * hash21(cc + seed + 41.0));\n float bulge = (hash21(cc + seed + 53.0) - 0.5) * lenV * 0.35;\n\n vec2 a = center - dir * (lenV * 0.5);\n vec2 b = center + dir * (lenV * 0.5);\n\n vec3 colMid = brokenColorJitter(\n sampleBase(center, t),\n hash21(cc + seed + 89.0),\n hash21(cc * 2.3 + seed + 97.0),\n 1.0\n );\n\n StrokeHit h = curvedStroke(p, a, b, halfW, bulge, shapeType,\n 7.0, bristleAmp,\n hash21(cc + seed + 67.0), colMid);\n if (h.coverage > best.coverage) best = h;\n }\n }\n return best;\n}\n\n// \u2500\u2500 Crayon / oil-pastel \u2014 paper tooth \u00D7 wax pigment \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Crayon is not strokes. It's pigment crumbs dragged across paper tooth.\n// Model: heavy 2D tooth noise at multiple scales, anisotropically stretched\n// along flow direction, multiplied into the base color. Add a slow \"waxy\n// film\" that slightly unifies hues, and occasional darker \"pressed\" spots\n// where the crayon dug in. NO straight segments.\nvec3 mediumOil_crayon(vec3 col, vec2 p, float t) {\n vec2 flow = flowField(p, t);\n float ang = atan(flow.y, flow.x);\n float ca = cos(-ang), sa = sin(-ang);\n vec2 pr = vec2(p.x * ca - p.y * sa, p.x * sa + p.y * ca);\n\n // Anisotropic tooth \u2014 squished along flow, coarse cross flow.\n float aniso = mix(0.45, 0.95, uStrokeAnisotropy);\n float scale = max(uStrokeScale * 1.6, 180.0);\n\n float t1 = vnoise(vec2(pr.x * scale * aniso, pr.y * scale));\n float t2 = vnoise(vec2(pr.x * scale * aniso * 0.4, pr.y * scale * 0.4) + 11.0);\n float t3 = vnoise(vec2(pr.x * scale * aniso * 2.1, pr.y * scale * 2.1) + 23.0);\n float tooth = 0.55 * t1 + 0.30 * t2 + 0.15 * t3;\n // Center at 0, amplify\n tooth = (tooth - 0.5) * 1.4;\n\n // Multiplicative darkening where tooth is low (pigment skipped paper valleys)\n float lay = 1.0 + tooth * 0.32 * uStrokeAmount;\n vec3 result = col * lay;\n\n // Occasional pressed-in crumbs \u2014 rare darker crumbs\n float crumbs = smoothstep(0.78, 0.95, vnoise(pr * scale * 3.0));\n result *= 1.0 - crumbs * 0.18 * uStrokeAmount;\n\n // Waxy highlight film \u2014 slight lightening on tooth peaks\n float waxy = smoothstep(0.55, 0.85, t1);\n result += waxy * 0.04 * vec3(1.0);\n\n // Paper tooth overlay (subtler than oil's canvas)\n float paperTooth = vnoise(p * 340.0) - 0.5;\n result *= 1.0 + paperTooth * 0.14 * uCanvasGrain;\n\n // Broken-color pigment: stable wax/pigment patches, not temporal flicker.\n vec2 pigmentCell = floor(pr * max(scale * 0.18, 32.0));\n float pigmentMask = smoothstep(0.28, 0.82, vnoise(pr * scale * 0.21 + 19.0));\n result = brokenColorJitter(\n result,\n hash21(pigmentCell + 17.0),\n hash21(pigmentCell * 2.1 + 31.0),\n 0.45 + 0.55 * pigmentMask\n );\n\n // Crayon is saturation-amplified\n result = saturate3(result, 1.12);\n\n return result;\n}\n\nvec3 mediumOil(vec3 col, vec2 p, float t) {\n // Mode knobs (uStrokeMode):\n // 0 oil \u2014 balanced modern-abstract/palette-knife hybrid\n // 1 knife \u2014 palette-knife impasto: razor edges, heavy bristle/shadow\n // 2 crayon \u2014 soft-edged wax smudges on tooth (no straight segments)\n // 3 brushwork \u2014 thick bristle brush\n int mode = uStrokeMode;\n\n // Per-mode parameters\n int shapeType = 0; // tapered\n float bristleAmp = 0.25; // 0..0.5\n float streakFreq = 9.0;\n float streakAmp = 0.09;\n float impastoAmp = 0.9;\n float hardness = 0.80; // edge compositing\n float toothScale = 240.0;\n float toothAmp = 0.09;\n float pigmentSat = 1.03;\n float densityBig = 0.65;\n float densityMed = 0.78;\n float densitySml = 0.90;\n\n if (mode == 1) { // palette knife\n shapeType = 3; // flat, even\n bristleAmp = 0.12;\n streakFreq = 4.0; streakAmp = 0.05;\n impastoAmp = 1.6;\n hardness = 0.95;\n toothAmp = 0.04;\n densityBig = 0.80; densityMed = 0.88; densitySml = 0.70;\n } else if (mode == 2) { // crayon \u2014 handled specially below\n return mediumOil_crayon(col, p, t);\n } else if (mode == 3) { // thick brushwork\n shapeType = 0; // tapered\n bristleAmp = 0.32;\n streakFreq = 14.0; streakAmp = 0.14;\n impastoAmp = 1.2;\n hardness = 0.85;\n toothAmp = 0.07;\n }\n\n // Scales & multipliers from uniforms\n float baseScale = max(uStrokeScale * 0.006, 0.008);\n // Three layers: big gestural, medium body, small dabs\n float sBig = baseScale * 2.4;\n float sMed = baseScale * 1.1;\n float sSml = baseScale * 0.45;\n\n float lenMulBig = mix(2.2, 3.8, uStrokeAnisotropy);\n float widMulBig = mix(0.55, 0.32, uStrokeAnisotropy);\n float lenMulMed = mix(2.0, 3.4, uStrokeAnisotropy);\n float widMulMed = mix(0.50, 0.30, uStrokeAnisotropy);\n float lenMulSml = mix(1.6, 2.6, uStrokeAnisotropy);\n float widMulSml = mix(0.45, 0.32, uStrokeAnisotropy);\n\n float jitterAmt = 0.75; // large jitter \u2014 no grid\n vec2 flow = flowField(p, t);\n\n vec3 result = col;\n\n // Layer 1 \u2014 big gestural strokes (sparse, shaping)\n StrokeHit hBig = bestOil(p, sBig, lenMulBig, widMulBig, jitterAmt * 0.55,\n densityBig, shapeType, bristleAmp, flow, t, 1.3);\n paintOver(result, hBig, streakFreq * 0.7, streakAmp,\n uImpasto * impastoAmp * uStrokeAmount, hardness, 1.3);\n\n // Layer 2 \u2014 medium body strokes\n StrokeHit hMed = bestOil(p + vec2(11.3, 3.7), sMed, lenMulMed, widMulMed,\n jitterAmt, densityMed, shapeType, bristleAmp, flow, t, 2.7);\n paintOver(result, hMed, streakFreq, streakAmp,\n uImpasto * impastoAmp * uStrokeAmount, hardness, 2.7);\n\n // Layer 3 \u2014 small dabs (more frequent, smaller)\n int smlShape = (mode == 1) ? 2 : shapeType; // knife uses dabs for sparkle\n StrokeHit hSml = bestOil(p + vec2(-5.1, 8.4), sSml, lenMulSml, widMulSml,\n jitterAmt * 1.3, densitySml, smlShape,\n bristleAmp * 0.85, flow, t, 4.1);\n paintOver(result, hSml, streakFreq * 1.4, streakAmp * 0.8,\n uImpasto * impastoAmp * 0.65 * uStrokeAmount, hardness, 4.1);\n\n // Layer 4 \u2014 fill dabs (very dense, very small) \u2014 covers bald spots\n float sFill = baseScale * 0.22;\n float lenMulFill = mix(1.4, 2.0, uStrokeAnisotropy);\n float widMulFill = mix(0.50, 0.38, uStrokeAnisotropy);\n int fillShape = (mode == 1) ? 3 : 2; // knife=even, others=dab (round fills)\n StrokeHit hFill = bestOil(p + vec2(3.9, -6.2), sFill, lenMulFill, widMulFill,\n jitterAmt * 1.5, 0.95, fillShape,\n bristleAmp * 0.6, flow, t, 8.9);\n paintOver(result, hFill, streakFreq * 1.8, streakAmp * 0.6,\n uImpasto * impastoAmp * 0.4 * uStrokeAmount, hardness * 0.9, 8.9);\n\n // Optional crosshatch layer\n if (uStrokeLayers == 2) {\n vec2 flow2 = vec2(-flow.y, flow.x);\n StrokeHit hX = bestOil(p + vec2(7.3, -2.1), sMed, lenMulMed * 0.9, widMulMed,\n jitterAmt, densityMed * 0.7, shapeType, bristleAmp, flow2, t, 6.5);\n paintOver(result, hX, streakFreq, streakAmp * 0.85,\n uImpasto * impastoAmp * 0.55 * uStrokeAmount, hardness, 6.5);\n }\n\n // Canvas tooth \u2014 linen weave\n float tooth1 = vnoise(p * toothScale);\n float tooth2 = vnoise(p * toothScale * vec2(0.6, 2.4) + 37.0);\n float tooth = (0.6 * tooth1 + 0.4 * tooth2) - 0.5;\n result *= 1.0 + tooth * toothAmp * uCanvasGrain;\n\n // Pigment saturation boost\n result = saturate3(result, pigmentSat);\n\n return result;\n}\n\n// \u2500\u2500 Main \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nvoid main() {\n // Normalized 0..1 coordinates for nuclei, domain warp, and medium sampling.\n vec2 uv = vUv;\n vec2 pN = uv;\n\n float t = uTime;\n\n // Warp in pN space\n vec2 p_warp = domainWarp(pN, t);\n\n // Composition\n float paletteId; float valueMod;\n nucleiField(p_warp, t, paletteId, valueMod);\n vec3 col = samplePalette(paletteId);\n col *= 1.0 + uValueVariance * valueMod;\n\n // Breath \u2014 slow global luminance wobble\n float breath = sin(t * 6.2831 / max(uBreathPeriod, 1.0));\n col *= 1.0 + uBreathDepth * breath * 0.5;\n\n // Medium\n if (uMedium == 1) col = mediumPastel(col, pN, t);\n else if (uMedium == 2) col = mediumWatercolor(col, pN, t);\n else if (uMedium == 3) col = mediumOil(col, pN, t);\n\n // Saturation trim\n col = saturate3(col, uSaturation);\n\n // Tonemap + film grain\n col = aces(col);\n float grain = hash21(gl_FragCoord.xy + t * 17.0);\n col += (grain - 0.5) * uPaperGrain;\n\n col = clamp(col * 0.985 + 0.008, 0.0, 1.0);\n fragColor = vec4(col * uAlpha, uAlpha);\n}\n";
@@ -13,6 +13,16 @@ import { type ConfiguratorDensity } from "./density";
13
13
  * overflow.
14
14
  */
15
15
  export type ConfiguratorScrollMode = "auto" | "always" | "never";
16
+ /**
17
+ * Which side the aside (preset row + controls) sits on at `lg`+ width.
18
+ *
19
+ * `right` (default) is the inspector idiom — stage left, controls right.
20
+ * `left` is a reversible, taste-level flip: the aside renders on the
21
+ * left while DOM/tab order stays stage→aside (the flip is grid-column
22
+ * placement + border-side only, no source reorder — no a11y regression).
23
+ * Below `lg` the layout is a single column and the side has no meaning.
24
+ */
25
+ export type ConfiguratorAsideSide = "left" | "right";
16
26
  /**
17
27
  * Generic preset descriptor. Consumers pass `T` as the live config shape.
18
28
  * The primitive carries no preset semantics beyond `key + label` for
@@ -51,6 +61,22 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
51
61
  * `gap-1.5 py-2` recipe exactly.
52
62
  */
53
63
  density?: ConfiguratorDensity;
64
+ /**
65
+ * Which side the aside sits on at `lg`+ width. Default `"right"`
66
+ * (the inspector idiom). `"left"` flips the visual column via
67
+ * grid-column placement + border-side swap only — DOM/tab order
68
+ * stays stage→aside. No effect below `lg` (single-column).
69
+ */
70
+ asideSide?: ConfiguratorAsideSide;
71
+ /**
72
+ * Aside width band at `lg`+ width, as a CSS length pair driving
73
+ * `minmax(--configurator-aside-min, --configurator-aside-max)`. The
74
+ * prop sets the two inline custom properties; consumers may instead
75
+ * (or also) set `--configurator-aside-min` / `--configurator-aside-max`
76
+ * via the cascade. Default band is `280px`/`360px`. Pass a single
77
+ * length to pin the band (`min === max`), or a `[min, max]` pair.
78
+ */
79
+ asideWidth?: string | readonly [min: string, max: string];
54
80
  /** Optional outer container override. */
55
81
  class?: HTMLAttributes["class"];
56
82
  } & {
@@ -1,6 +1,6 @@
1
1
  export { default as Configurator } from "./Configurator.vue";
2
2
  export { default as ConfiguratorLayer } from "./ConfiguratorLayer.vue";
3
3
  export { default as ConfiguratorRow } from "./ConfiguratorRow.vue";
4
- export type { ConfiguratorPreset, ConfiguratorScrollMode, } from "./Configurator.vue";
4
+ export type { ConfiguratorAsideSide, ConfiguratorPreset, ConfiguratorScrollMode, } from "./Configurator.vue";
5
5
  export { CONFIGURATOR_DENSITY_KEY, provideConfiguratorDensity, useOptionalConfiguratorDensity, type ConfiguratorDensity, } from "./density";
6
6
  export { useConfiguratorState, type ConfiguratorCloneMode, type ConfiguratorState, type ConfiguratorStateOptions, } from "./useConfiguratorState";
@@ -1,23 +1,34 @@
1
- import { type ButtonHTMLAttributes, type HTMLAttributes } from "vue";
1
+ import { type ButtonHTMLAttributes, type Component, type HTMLAttributes } from "vue";
2
2
  /**
3
3
  * <DockIconButton> — fixed-square icon button for use inside GlassDock.
4
4
  *
5
5
  * Emits the dock icon-button class contract. Interactive styling is owned by
6
6
  * src/styles/dock.css so all dock controls share one public style authority.
7
+ *
8
+ * Use `as`/`as-child` to render as a <RouterLink> or <a> without a wrapper:
9
+ * `as="a"` swaps the host tag, `as-child` merges the dock class onto a slotted
10
+ * child (the reka-ui Primitive idiom). `type` is emitted only on a <button>
11
+ * host (an anchor/RouterLink carries no `type`).
7
12
  */
8
13
  type __VLS_Props = {
9
14
  /** Compact variant: auto-sized instead of fixed 2.5rem square. */
10
15
  compact?: boolean;
11
16
  /** Button type attribute (default: "button" to prevent form submission). */
12
17
  type?: ButtonHTMLAttributes["type"];
18
+ /** Host tag/component (reka-ui Primitive `as`; default "button"). */
19
+ as?: string | Component;
20
+ /** Merge props onto a slotted child instead of rendering a host tag. */
21
+ asChild?: boolean;
13
22
  class?: HTMLAttributes["class"];
14
23
  };
15
- declare var __VLS_1: {};
24
+ declare var __VLS_8: {};
16
25
  type __VLS_Slots = {} & {
17
- default?: (props: typeof __VLS_1) => any;
26
+ default?: (props: typeof __VLS_8) => any;
18
27
  };
19
28
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
20
29
  type: "button" | "reset" | "submit";
30
+ asChild: boolean;
31
+ as: string | Component;
21
32
  compact: boolean;
22
33
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
34
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -43,6 +43,22 @@ type __VLS_Props = {
43
43
  * dock control sizing. Root CSS variables can override each density.
44
44
  */
45
45
  density?: DockDensity;
46
+ /**
47
+ * Overflow strategy when the expanded content exceeds the dock's
48
+ * axis cap (`--dock-max-inline-size` horizontally,
49
+ * `--dock-max-block-size` vertically).
50
+ * `"grow"` — content grows to fit then overflows visibly past
51
+ * the cap (the historical default; nothing clips or
52
+ * scrolls).
53
+ * `"scroll"` — the dock becomes the scroll port. Horizontal docks
54
+ * scroll the active layer on the inline axis
55
+ * (`.dock-scroll-x`); vertical rails scroll on the
56
+ * block axis (`.dock-scroll-y`), keeping the
57
+ * `max-block-size` cap. The rounded pill masks the
58
+ * scroll edge; the scrollbar is hidden. The axis is
59
+ * chosen automatically from `orientation`.
60
+ */
61
+ overflow?: "grow" | "scroll";
46
62
  /**
47
63
  * When set, the dock root establishes an inline-size container query
48
64
  * subject (`container-type: inline-size; container-name: <value>`)
@@ -76,6 +92,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
76
92
  release: () => void;
77
93
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
78
94
  position: "fixed" | "inline" | "sticky";
95
+ overflow: "grow" | "scroll";
79
96
  variant: "dock" | "rail" | "instrument-strip";
80
97
  orientation: "horizontal" | "vertical";
81
98
  wrap: boolean;
@@ -6,3 +6,4 @@ export * from "./useViewportReady";
6
6
  export * from "./useBreakpoint";
7
7
  export * from "./useIdleReady";
8
8
  export * from "./useUserInvalidAria";
9
+ export * from "./useTextHighlight";
@@ -0,0 +1,40 @@
1
+ /** Match a query against a text-node's content, returning matched char ranges. */
2
+ export type HighlightMatcher = (
3
+ /** The text-node's full string content. */
4
+ text: string,
5
+ /** The active query (already passed through to the matcher unchanged). */
6
+ query: string) => Array<{
7
+ start: number;
8
+ end: number;
9
+ }>;
10
+ export interface UseTextHighlightControls {
11
+ /** Replace the highlight's range set. Empty array clears the paint. */
12
+ set: (ranges: Range[]) => void;
13
+ /**
14
+ * Walk every text node under `container`, run `matcher` per node, and
15
+ * highlight the returned `[start, end)` char spans. Replaces the prior set.
16
+ * The default matcher is a case-insensitive substring scan over `query`.
17
+ */
18
+ setFromMatches: (container: HTMLElement, query: string, matcher?: HighlightMatcher) => void;
19
+ /** Drop every range — the named highlight stops painting. */
20
+ clear: () => void;
21
+ /** True when the CSS Custom Highlight API is available (else every op no-ops). */
22
+ readonly supported: boolean;
23
+ }
24
+ /**
25
+ * Drive a named CSS Custom Highlight reactively.
26
+ *
27
+ * @param name registry key — must match a `::highlight(<name>)` style rule.
28
+ * Instances sharing a name multiplex: each contributes its own ranges and
29
+ * the shared paint is their union (last to dispose drops the registry entry).
30
+ *
31
+ * @example
32
+ * const hl = useTextHighlight("fuzzy-search");
33
+ * watch([query, listEl], ([q, el]) => {
34
+ * if (el) hl.setFromMatches(el, q, fuzzyRanges);
35
+ * });
36
+ *
37
+ * // Or hand it pre-built ranges directly:
38
+ * hl.set([range]);
39
+ */
40
+ export declare function useTextHighlight(name: string): UseTextHighlightControls;
@@ -5,4 +5,5 @@ export * from "../useRAFLoop";
5
5
  export * from "../useIntersectionPause";
6
6
  export * from "../useStagger";
7
7
  export * from "../useYieldToMain";
8
+ export * from "../usePrioritizedTask";
8
9
  export * from "../useViewTransition";
@@ -0,0 +1,41 @@
1
+ export type TaskPriority = "user-blocking" | "user-visible" | "background";
2
+ export interface PostTaskOptions {
3
+ /** Scheduling priority. Defaults to the platform default ('user-visible'). */
4
+ priority?: TaskPriority;
5
+ /** Abort the task before it runs (rejects the returned promise). */
6
+ signal?: AbortSignal;
7
+ /** Delay in ms before the task becomes eligible to run. */
8
+ delay?: number;
9
+ }
10
+ /**
11
+ * Schedule `callback` at an explicit priority, resolving with its result.
12
+ * Native `scheduler.postTask` when available; otherwise a `MessageChannel`
13
+ * macrotask (honouring `delay` via `setTimeout`, and `signal` via a plain
14
+ * `AbortSignal` check) that cannot order by priority but still runs off the
15
+ * current task.
16
+ *
17
+ * @example
18
+ * await postTaskSafe(() => recomputeHistory(), { priority: "background" });
19
+ */
20
+ export declare function postTaskSafe<T>(callback: () => T, options?: PostTaskOptions): Promise<T>;
21
+ export interface UsePrioritizedTaskReturn {
22
+ /**
23
+ * Schedule a unit of work. The controller's `signal` is merged in (its own
24
+ * `abort()` cancels every task it scheduled), and an explicit `options.signal`
25
+ * still applies on the fallback path.
26
+ */
27
+ postTask: <T>(callback: () => T, options?: PostTaskOptions) => Promise<T>;
28
+ /** Abort every task scheduled through this controller. */
29
+ abort: (reason?: unknown) => void;
30
+ }
31
+ /**
32
+ * Composable wrapper over {@link postTaskSafe} that owns a `TaskController`
33
+ * (when supported) so a single `abort()` cancels every task it scheduled — the
34
+ * controller a consumer constructs once and tears down on unmount. When
35
+ * `TaskController` is absent the controller is a no-op shell and per-task
36
+ * `options.signal` is the only cancellation channel.
37
+ *
38
+ * Pure-native (no `vue` import) — owns no reactive state and no lifecycle, so it
39
+ * has no cleanup obligation beyond the `abort()` the consumer calls itself.
40
+ */
41
+ export declare function usePrioritizedTask(priority?: TaskPriority): UsePrioritizedTaskReturn;
@@ -145,5 +145,18 @@ export interface UseSortableReturn {
145
145
  /** Index the drop will land at, or null when no target. */
146
146
  dropIndex: ComputedRef<number | null>;
147
147
  }
148
+ /**
149
+ * True when a computed `border-radius` string has any non-zero
150
+ * corner. Computed values resolve to space-separated lengths
151
+ * (e.g. `"0px"`, `"6px"`, `"12px 12px 0px 0px"`) with an optional
152
+ * `/` separating the horizontal/vertical radii of elliptical
153
+ * corners. A radius is "zero" only when every numeric component
154
+ * parses to 0; a non-length token (`%`, `auto`) counts as
155
+ * non-zero so we never miss a rounded corner.
156
+ *
157
+ * Exported (not re-exported from the package barrel) for the D9 drag-ring
158
+ * regression test — keep it a pure string predicate.
159
+ */
160
+ export declare function isNonZeroRadius(radius: string): boolean;
148
161
  export declare function useSortable<T>(options: SortableOptions<T>): UseSortableReturn;
149
162
  export {};
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./useConfiguratorState-CtRBE0m_.js";
1
+ import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./useConfiguratorState-Dq2gNv4A.js";
2
2
  export { e as CONFIGURATOR_DENSITY_KEY, t as Configurator, i as ConfiguratorLayer, n as ConfiguratorRow, r as provideConfiguratorDensity, o as useConfiguratorState, a as useOptionalConfiguratorDensity };
@@ -1,6 +1,6 @@
1
- import { t as e } from "./createLucideIcon-Bn9a1b70.js";
2
- import { n as t } from "./button-C0aHmBbt.js";
3
- import { t as n } from "./_plugin-vue_export-helper-Dq1MygBL.js";
1
+ import { t as e } from "./createLucideIcon-DuDoe_ra.js";
2
+ import { n as t } from "./button-DS3ULf5i.js";
3
+ import { t as n } from "./_plugin-vue_export-helper-C1je1s0u.js";
4
4
  import { Transition as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeModels as d, openBlock as f, renderSlot as p, toDisplayString as m, unref as h, useModel as g, withCtx as _, withKeys as v, withModifiers as y } from "vue";
5
5
  var b = e("loader-circle", [["path", {
6
6
  d: "M21 12a9 9 0 1 1-6.219-8.56",
@@ -1,3 +1,3 @@
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 "./ContextMenuSubContent-gAFxJ-qi.js";
2
- import { n as l, r as u, t as d } from "./ContextMenuContent-otjFIu8v.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 "./ContextMenuSubContent-DrWkXKQP.js";
2
+ import { n as l, r as u, t as d } from "./ContextMenuContent-De01_83g.js";
3
3
  export { u as ContextMenu, s as ContextMenuCheckboxItem, d as ContextMenuContent, t as ContextMenuItem, o as ContextMenuLabel, r as ContextMenuRadioGroup, a as ContextMenuRadioItem, n as ContextMenuSeparator, e as ContextMenuShortcut, c as ContextMenuSubContent, i as ContextMenuSubTrigger, l as ContextMenuTrigger };
package/dist/controls.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./cn-DJXf4yaB.js";
2
- import { t } from "./_plugin-vue_export-helper-Dq1MygBL.js";
3
- import { t as n } from "./useGlobalDark-B0WvLJE3.js";
2
+ import { t } from "./_plugin-vue_export-helper-C1je1s0u.js";
3
+ import { t as n } from "./useGlobalDark-BUUTZvkU.js";
4
4
  import { computed as r, createBlock as i, createElementVNode as a, defineComponent as o, mergeProps as s, openBlock as c, resolveDynamicComponent as l, unref as u, useAttrs as d, watchEffect as f, withCtx as p } from "vue";
5
5
  //#endregion
6
6
  //#region src/components/custom/controls/DarkModeToggle.vue
package/dist/dark.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./useGlobalDark-B0WvLJE3.js";
1
+ import { t as e } from "./useGlobalDark-BUUTZvkU.js";
2
2
  import { nextTick as t, watch as n } from "vue";
3
3
  //#region src/composables/dark/installDarkModeSync.ts
4
4
  function r(r) {
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./DataTable-R8-Zidms.js";
1
+ import { n as e, t } from "./DataTable-BsrDYdoE.js";
2
2
  export { t as DataTable, e as DataTablePagination };
package/dist/dialog.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as e, t } from "./DialogContent-2fALDSvc.js";
2
- import { a as n, i as r, n as i, o as a, r as o, s, t as c } from "./DialogFooter-ClrNEOVU.js";
1
+ import { n as e, t } from "./DialogContent-B61rP8lj.js";
2
+ import { a as n, i as r, n as i, o as a, r as o, s, t as c } from "./DialogFooter-Er0wA3K6.js";
3
3
  export { e as Dialog, s as DialogClose, t as DialogContent, o as DialogDescription, c as DialogFooter, n as DialogHeader, i as DialogScrollContent, r as DialogTitle, a as DialogTrigger };
@@ -1,2 +1,2 @@
1
- import { t as e } from "./DiscoGlyph-C3JfMnRV.js";
1
+ import { t as e } from "./DiscoGlyph-B7YooI2-.js";
2
2
  export { e as DiscoGlyph };