@pixerate/flair 0.15.0 → 0.17.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 (43) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +33 -6
  3. package/dist/catalog/index.d.ts +3 -3
  4. package/dist/catalog/index.js +6 -2
  5. package/dist/{chunk-SHHAIWUR.js → chunk-LKQM3GSQ.js} +12 -12
  6. package/dist/{chunk-KWNFZ5NC.js → chunk-LURJMWYM.js} +237 -185
  7. package/dist/{chunk-KWNFZ5NC.js.map → chunk-LURJMWYM.js.map} +1 -1
  8. package/dist/{chunk-DVVQRZJ5.js → chunk-MILF5MRS.js} +11 -2
  9. package/dist/chunk-MILF5MRS.js.map +1 -0
  10. package/dist/{chunk-YLJWC4N2.js → chunk-PMVJP5I4.js} +2 -2
  11. package/dist/{chunk-4RGHZWQC.js → chunk-RM3I6WZH.js} +2 -2
  12. package/dist/{chunk-4RGHZWQC.js.map → chunk-RM3I6WZH.js.map} +1 -1
  13. package/dist/{chunk-FIJOMGPG.js → chunk-UP6QQVRS.js} +2 -2
  14. package/dist/{chunk-WC3VADZC.js → chunk-VYOMXE6I.js} +46 -4
  15. package/dist/chunk-VYOMXE6I.js.map +1 -0
  16. package/dist/cli.js +7 -7
  17. package/dist/{controls-Syr6drzO.d.ts → controls-Ec6P0Vpy.d.ts} +9 -2
  18. package/dist/editor/index.d.ts +3 -3
  19. package/dist/editor/index.js +7 -7
  20. package/dist/index.d.ts +4 -4
  21. package/dist/index.js +80 -76
  22. package/dist/index.js.map +1 -1
  23. package/dist/node.d.ts +1 -1
  24. package/dist/node.js +2 -2
  25. package/dist/react/index.d.ts +14 -3
  26. package/dist/react/index.js +18 -9
  27. package/dist/react/index.js.map +1 -1
  28. package/dist/recorder-HKFFHQES.js +10 -0
  29. package/dist/{renderer-SNYZu__R.d.ts → renderer-Bm0oQ7Bw.d.ts} +1 -1
  30. package/dist/svelte/index.d.ts +146 -0
  31. package/dist/svelte/index.js +195 -0
  32. package/dist/svelte/index.js.map +1 -0
  33. package/dist/{types-9J6NWaN3.d.ts → types-C7g8-lTX.d.ts} +9 -3
  34. package/dist/vector/index.d.ts +27 -1
  35. package/dist/vector/index.js +4 -2
  36. package/package.json +13 -3
  37. package/dist/chunk-DVVQRZJ5.js.map +0 -1
  38. package/dist/chunk-WC3VADZC.js.map +0 -1
  39. package/dist/recorder-KEX3U35D.js +0 -10
  40. /package/dist/{chunk-SHHAIWUR.js.map → chunk-LKQM3GSQ.js.map} +0 -0
  41. /package/dist/{chunk-YLJWC4N2.js.map → chunk-PMVJP5I4.js.map} +0 -0
  42. /package/dist/{chunk-FIJOMGPG.js.map → chunk-UP6QQVRS.js.map} +0 -0
  43. /package/dist/{recorder-KEX3U35D.js.map → recorder-HKFFHQES.js.map} +0 -0
@@ -0,0 +1,146 @@
1
+ import { ActionReturn } from 'svelte/action';
2
+ import { V as VectorEffect } from '../types-C7g8-lTX.js';
3
+ import { C as ControlValue } from '../controls-Ec6P0Vpy.js';
4
+ import { a as SvgTrigger, C as Clock, b as SvgPlayer, S as SvgMotion } from '../svg-XugR-6Ec.js';
5
+
6
+ /**
7
+ * Svelte 5 bindings for Flair's vector effects, written as plain TypeScript so
8
+ * they need no Svelte compiler: the `vectorEffect` action plays a catalog
9
+ * effect (or any {@link SvgMotion}) in an element, and `vectorEffectStill`
10
+ * gives the markup and style of its still for server rendering.
11
+ *
12
+ * ```svelte
13
+ * <script>
14
+ * import { vectorEffect, vectorEffectStill } from "@pixerate/flair/svelte";
15
+ * const params = { id: "drip-text", values: { word: "Slop" }, loop: false };
16
+ * const still = vectorEffectStill(params);
17
+ * </script>
18
+ *
19
+ * <span use:vectorEffect={params} style={still.style}>{@html still.markup}</span>
20
+ * ```
21
+ *
22
+ * The still is in place from the first paint; the live `SvgPlayer` takes over
23
+ * after mount and is disposed on destroy. Under `prefers-reduced-motion:
24
+ * reduce` the still stays.
25
+ *
26
+ * Needs Svelte 5 (an optional peer dependency of the package); only its types
27
+ * are imported.
28
+ *
29
+ * @packageDocumentation
30
+ */
31
+
32
+ /** When to leave the still in place of the animation. */
33
+ type ReducedMotion = "user" | "always" | "never";
34
+ /** Options shared by an effect by id and a motion of your own. */
35
+ interface SvgPlayerParams {
36
+ /** Start again at the end (default `true`); `false` plays once and stays on the last frame. */
37
+ loop?: boolean;
38
+ /** Start playing at once (default `true`). */
39
+ autoplay?: boolean;
40
+ /** Playback speed (default 1); changed without remaking the player. */
41
+ speed?: number;
42
+ /** Ms to rest on the last frame before looping (default 600, or the effect's). */
43
+ hold?: number;
44
+ /** Loop length in ms (default: the picture's own, plus `hold`). */
45
+ duration?: number;
46
+ /** Step start times in ms, for pictures that change on steps. */
47
+ steps?: readonly number[];
48
+ /** Plays in answer to the pointer (see `SvgTrigger`; default the effect's). */
49
+ trigger?: SvgTrigger;
50
+ /** Pause while scrolled out of view. */
51
+ pauseWhenHidden?: boolean;
52
+ /**
53
+ * Wait to start until scrolled into view. Default `true` when it plays once
54
+ * (`loop: false`, no trigger), so a one-shot further down the page does not
55
+ * finish before anyone sees it; `false` plays at mount.
56
+ */
57
+ playOnEnter?: boolean;
58
+ /** Hide the picture while paused or reset. */
59
+ hideWhenPaused?: boolean;
60
+ /** Time source (default animation frames); a `ManualClock` steps frames yourself. */
61
+ clock?: Clock;
62
+ /** Called with the id of the innermost element with an id that is clicked. */
63
+ onPick?: (id: string) => void;
64
+ /** Called with the player once it is made, and `undefined` when it is disposed. */
65
+ onPlayer?: (player: SvgPlayer | undefined) => void;
66
+ /**
67
+ * The still shown before the player starts and instead of it under reduced
68
+ * motion: `"last"` (default; the rest frame, `"first"` for a hover or press
69
+ * trigger), `"first"` or a time in ms.
70
+ */
71
+ poster?: "first" | "last" | number;
72
+ /**
73
+ * `"user"` (default) shows the still when the visitor prefers reduced
74
+ * motion, `"always"` always does, `"never"` always plays.
75
+ */
76
+ reducedMotion?: ReducedMotion;
77
+ /**
78
+ * Size it as a word in a line of text: `display: inline-block` with the
79
+ * viewBox's aspect ratio and `height` 0.72em (the cap height of a heavy
80
+ * sans; pass a CSS length for another). Default: the effect's `inline`
81
+ * control. Otherwise it is a block as wide as its container with the
82
+ * viewBox's aspect ratio.
83
+ */
84
+ inline?: boolean | string;
85
+ /**
86
+ * With `inline`, keep room for what spills past the word (descenders,
87
+ * outlines, glows, drips): a margin of the picture's `data-overhang` (see
88
+ * `svgInlineLayout`), so the lines around it make space instead of being
89
+ * painted over. Default `false`.
90
+ */
91
+ contain?: boolean;
92
+ }
93
+ /** A catalog vector effect by id (or the effect itself), with its values. */
94
+ interface VectorEffectByIdParams extends SvgPlayerParams {
95
+ /** A vector effect's catalog id (`"drip-text"`), or the effect itself. */
96
+ id: string | VectorEffect;
97
+ /** Control values; missing ones take the preset's, then the defaults. Compared by content. */
98
+ values?: Record<string, ControlValue>;
99
+ /** A preset's name to start from. */
100
+ preset?: string;
101
+ motion?: never;
102
+ }
103
+ /** Any {@link SvgMotion}; a new object restarts the player. */
104
+ interface SvgMotionParams extends SvgPlayerParams {
105
+ /** The picture and its animations. */
106
+ motion: SvgMotion;
107
+ id?: never;
108
+ values?: never;
109
+ preset?: never;
110
+ }
111
+ /** What `vectorEffect` and `vectorEffectStill` take: an effect by `id`, or a `motion`. */
112
+ type VectorEffectParams = VectorEffectByIdParams | SvgMotionParams;
113
+ /** A still of the picture, for `{@html markup}` inside an element with `style`. */
114
+ interface VectorEffectStill {
115
+ /** The still's layer: safe `<svg>` markup (see `svgFrameMarkup`) in an absolutely placed `<span>`. */
116
+ markup: string;
117
+ /** The host's inline style: its position and size from the viewBox. */
118
+ style: string;
119
+ }
120
+ /**
121
+ * The still of an effect or motion, for server rendering: put `markup` in the
122
+ * element that has the `vectorEffect` action, with `style` as its style, so
123
+ * the page shows the picture before the player starts (and instead of it
124
+ * under reduced motion), in the room the player will take.
125
+ * Throws when `id` is not a vector effect.
126
+ */
127
+ declare function vectorEffectStill(params: VectorEffectParams): VectorEffectStill;
128
+ /**
129
+ * A Svelte action that plays a vector effect in its element:
130
+ * `<span use:vectorEffect={{ id: "drip-text", values: { word: "Slop" }, loop: false }} />`.
131
+ *
132
+ * It makes an `SvgPlayer` in a layer of its own, remakes it when the params
133
+ * change (values by content; `speed` without remaking) and disposes it on
134
+ * destroy. A still from {@link vectorEffectStill} in the element is hidden
135
+ * while the player runs and shown again after; without one, the action makes
136
+ * its own (so reduced motion still shows the picture) and sizes the element
137
+ * from the viewBox, leaving alone any of `position`, `display`, `height`,
138
+ * `aspect-ratio` and `margin` the element's style already sets.
139
+ *
140
+ * For an attachment, `{@attach fromAction(vectorEffect, () => params)}`
141
+ * (`fromAction` is from `svelte/attachments`). Throws when `id` is not a
142
+ * vector effect.
143
+ */
144
+ declare function vectorEffect(node: HTMLElement, initial: VectorEffectParams): ActionReturn<VectorEffectParams>;
145
+
146
+ export { type ReducedMotion, SvgMotion, type SvgMotionParams, SvgPlayer, type SvgPlayerParams, SvgTrigger, type VectorEffectByIdParams, type VectorEffectParams, type VectorEffectStill, vectorEffect, vectorEffectStill };
@@ -0,0 +1,195 @@
1
+ import {
2
+ effectDefaults,
3
+ getEffect,
4
+ renderVectorEffect
5
+ } from "../chunk-LURJMWYM.js";
6
+ import {
7
+ svgFrameMarkup,
8
+ svgInlineLayout,
9
+ svgViewBox
10
+ } from "../chunk-MILF5MRS.js";
11
+ import {
12
+ SvgPlayer
13
+ } from "../chunk-RM3I6WZH.js";
14
+ import "../chunk-OHW7UG6D.js";
15
+ import "../chunk-EHDJ3CPJ.js";
16
+ import "../chunk-WMZQCUFJ.js";
17
+ import "../chunk-VYOMXE6I.js";
18
+
19
+ // src/svelte/index.ts
20
+ var CAP_HEIGHT = "0.72em";
21
+ var STILL_ATTR = "data-flair-still";
22
+ var LAYER = "position:absolute;inset:0;display:block";
23
+ function resolve(params, cache) {
24
+ if (params.motion) return { motion: params.motion, hold: params.hold, trigger: params.trigger, inline: params.inline, contain: params.contain };
25
+ const { id, values, preset } = params;
26
+ const effect = typeof id === "string" ? getEffect(id) : id;
27
+ if (!effect || effect.kind !== "vector")
28
+ throw new Error(
29
+ `"${typeof id === "string" ? id : effect?.id ?? id}" is not a vector effect; pick one from findEffects({ kind: "vector" }), or pass a motion`
30
+ );
31
+ const key = JSON.stringify([preset ?? null, values ?? {}]);
32
+ let motion;
33
+ if (cache?.current && cache.current.effect === effect && cache.current.key === key) motion = cache.current.motion;
34
+ else {
35
+ motion = renderVectorEffect(effect, effectDefaults(effect, { preset, values }));
36
+ if (cache) cache.current = { key, effect, motion };
37
+ }
38
+ return {
39
+ motion,
40
+ hold: params.hold ?? effect.hold,
41
+ trigger: params.trigger ?? effect.trigger,
42
+ inline: params.inline ?? values?.inline === true,
43
+ contain: params.contain
44
+ };
45
+ }
46
+ function hostStyle(svg, inline, contain) {
47
+ const box = svgViewBox(svg);
48
+ const style = [
49
+ ["position", "relative"],
50
+ ["display", inline ? "inline-block" : "block"]
51
+ ];
52
+ if (inline) style.push(["height", typeof inline === "string" ? inline : CAP_HEIGHT]);
53
+ if (box) style.push(["aspect-ratio", `${box[2]} / ${box[3]}`]);
54
+ const spill = inline && contain ? svgInlineLayout(svg)?.overhang : void 0;
55
+ if (spill) style.push(["margin", `${spill.top}em ${spill.right}em ${spill.bottom}em ${spill.left}em`]);
56
+ return style;
57
+ }
58
+ var enters = (r, p) => p.playOnEnter ?? (p.loop === false && !r.trigger);
59
+ function stillMarkup(r, params) {
60
+ const at = params.poster ?? (r.trigger === "hover" || r.trigger === "press" ? "first" : "last");
61
+ return svgFrameMarkup(r.motion, { at, steps: params.steps }) ?? "";
62
+ }
63
+ function vectorEffectStill(params) {
64
+ const r = resolve(params);
65
+ return {
66
+ markup: `<span ${STILL_ATTR} aria-hidden="true" style="${LAYER}">${stillMarkup(r, params)}</span>`,
67
+ style: hostStyle(r.motion.svg, r.inline, r.contain).map(([k, v]) => `${k}: ${v}`).join("; ")
68
+ };
69
+ }
70
+ function prefersReducedMotion() {
71
+ return typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
72
+ }
73
+ function playerKey(r, p) {
74
+ return [
75
+ r.motion,
76
+ p.loop,
77
+ p.autoplay,
78
+ r.hold,
79
+ p.duration,
80
+ p.steps?.join(","),
81
+ r.trigger,
82
+ p.pauseWhenHidden,
83
+ enters(r, p),
84
+ p.hideWhenPaused,
85
+ p.clock,
86
+ p.reducedMotion ?? "user"
87
+ ];
88
+ }
89
+ function vectorEffect(node, initial) {
90
+ const cache = {};
91
+ const doc = node.ownerDocument;
92
+ const mount = doc.createElement("span");
93
+ mount.style.cssText = LAYER;
94
+ node.appendChild(mount);
95
+ let params = initial;
96
+ let resolved = resolve(params, cache);
97
+ let player;
98
+ let key = [];
99
+ let ownStill;
100
+ const sized = /* @__PURE__ */ new Set();
101
+ const stills = () => node.querySelectorAll(`:scope > [${STILL_ATTR}]`);
102
+ const showStills = (show) => {
103
+ for (const s of stills()) s.style.display = show ? "block" : "none";
104
+ };
105
+ const reattach = () => {
106
+ if (mount.parentNode !== node) node.appendChild(mount);
107
+ if (player) showStills(false);
108
+ };
109
+ const observer = typeof MutationObserver === "function" ? new MutationObserver(reattach) : void 0;
110
+ observer?.observe(node, { childList: true });
111
+ const size = () => {
112
+ const style = hostStyle(resolved.motion.svg, resolved.inline, resolved.contain);
113
+ for (const [prop, value] of style) {
114
+ if (!sized.has(prop) && node.style.getPropertyValue(prop)) continue;
115
+ node.style.setProperty(prop, value);
116
+ sized.add(prop);
117
+ }
118
+ for (const prop of sized)
119
+ if (!style.some(([p]) => p === prop)) {
120
+ node.style.removeProperty(prop);
121
+ sized.delete(prop);
122
+ }
123
+ };
124
+ if (stills().length === 0) {
125
+ ownStill = doc.createElement("span");
126
+ ownStill.setAttribute(STILL_ATTR, "");
127
+ ownStill.setAttribute("aria-hidden", "true");
128
+ ownStill.style.cssText = LAYER;
129
+ node.insertBefore(ownStill, mount);
130
+ size();
131
+ }
132
+ const stop = () => {
133
+ if (!player) return;
134
+ player.dispose();
135
+ player = void 0;
136
+ showStills(true);
137
+ params.onPlayer?.(void 0);
138
+ };
139
+ const start = () => {
140
+ const reduced = params.reducedMotion ?? "user";
141
+ if (reduced === "always" || reduced === "user" && prefersReducedMotion()) return;
142
+ player = new SvgPlayer(mount, resolved.motion, {
143
+ loop: params.loop,
144
+ autoplay: params.autoplay,
145
+ speed: params.speed,
146
+ hold: resolved.hold,
147
+ duration: params.duration,
148
+ steps: params.steps,
149
+ trigger: resolved.trigger,
150
+ pauseWhenHidden: params.pauseWhenHidden,
151
+ playOnEnter: enters(resolved, params),
152
+ hideWhenPaused: params.hideWhenPaused,
153
+ clock: params.clock,
154
+ // The latest params' callback, without remaking the player.
155
+ onPick: (id) => params.onPick?.(id)
156
+ });
157
+ showStills(false);
158
+ params.onPlayer?.(player);
159
+ };
160
+ const apply = () => {
161
+ reattach();
162
+ if (ownStill) {
163
+ ownStill.innerHTML = stillMarkup(resolved, params);
164
+ size();
165
+ }
166
+ const next = playerKey(resolved, params);
167
+ if (player && next.every((v, i) => v === key[i])) {
168
+ player.setSpeed(params.speed ?? 1);
169
+ return;
170
+ }
171
+ key = next;
172
+ stop();
173
+ start();
174
+ };
175
+ apply();
176
+ return {
177
+ update(next) {
178
+ params = next;
179
+ resolved = resolve(params, cache);
180
+ apply();
181
+ },
182
+ destroy() {
183
+ observer?.disconnect();
184
+ stop();
185
+ mount.remove();
186
+ ownStill?.remove();
187
+ for (const prop of sized) node.style.removeProperty(prop);
188
+ }
189
+ };
190
+ }
191
+ export {
192
+ vectorEffect,
193
+ vectorEffectStill
194
+ };
195
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/svelte/index.ts"],"sourcesContent":["/**\n * Svelte 5 bindings for Flair's vector effects, written as plain TypeScript so\n * they need no Svelte compiler: the `vectorEffect` action plays a catalog\n * effect (or any {@link SvgMotion}) in an element, and `vectorEffectStill`\n * gives the markup and style of its still for server rendering.\n *\n * ```svelte\n * <script>\n * import { vectorEffect, vectorEffectStill } from \"@pixerate/flair/svelte\";\n * const params = { id: \"drip-text\", values: { word: \"Slop\" }, loop: false };\n * const still = vectorEffectStill(params);\n * </script>\n *\n * <span use:vectorEffect={params} style={still.style}>{@html still.markup}</span>\n * ```\n *\n * The still is in place from the first paint; the live `SvgPlayer` takes over\n * after mount and is disposed on destroy. Under `prefers-reduced-motion:\n * reduce` the still stays.\n *\n * Needs Svelte 5 (an optional peer dependency of the package); only its types\n * are imported.\n *\n * @packageDocumentation\n */\n\nimport type { ActionReturn } from \"svelte/action\";\nimport { getEffect, effectDefaults } from \"../catalog/index.js\";\nimport { renderVectorEffect, type VectorEffect as VectorEffectDefinition } from \"../catalog/types.js\";\nimport type { ControlValue } from \"../shader/controls.js\";\nimport type { Clock } from \"../time/clock.js\";\nimport type { SvgMotion } from \"../vector/motion.js\";\nimport { svgFrameMarkup, svgInlineLayout, svgViewBox } from \"../vector/static.js\";\nimport { SvgPlayer, type SvgTrigger } from \"../vector/svg.js\";\n\n/** Cap height of a heavy sans, as a share of its font size: what an inline word is framed to. */\nconst CAP_HEIGHT = \"0.72em\";\n\n/** Marks the still's layer, so the action can find it (and hide it while the player runs). */\nconst STILL_ATTR = \"data-flair-still\";\n\nconst LAYER = \"position:absolute;inset:0;display:block\";\n\n/** When to leave the still in place of the animation. */\nexport type ReducedMotion = \"user\" | \"always\" | \"never\";\n\n/** Options shared by an effect by id and a motion of your own. */\nexport interface SvgPlayerParams {\n /** Start again at the end (default `true`); `false` plays once and stays on the last frame. */\n loop?: boolean;\n /** Start playing at once (default `true`). */\n autoplay?: boolean;\n /** Playback speed (default 1); changed without remaking the player. */\n speed?: number;\n /** Ms to rest on the last frame before looping (default 600, or the effect's). */\n hold?: number;\n /** Loop length in ms (default: the picture's own, plus `hold`). */\n duration?: number;\n /** Step start times in ms, for pictures that change on steps. */\n steps?: readonly number[];\n /** Plays in answer to the pointer (see `SvgTrigger`; default the effect's). */\n trigger?: SvgTrigger;\n /** Pause while scrolled out of view. */\n pauseWhenHidden?: boolean;\n /**\n * Wait to start until scrolled into view. Default `true` when it plays once\n * (`loop: false`, no trigger), so a one-shot further down the page does not\n * finish before anyone sees it; `false` plays at mount.\n */\n playOnEnter?: boolean;\n /** Hide the picture while paused or reset. */\n hideWhenPaused?: boolean;\n /** Time source (default animation frames); a `ManualClock` steps frames yourself. */\n clock?: Clock;\n /** Called with the id of the innermost element with an id that is clicked. */\n onPick?: (id: string) => void;\n /** Called with the player once it is made, and `undefined` when it is disposed. */\n onPlayer?: (player: SvgPlayer | undefined) => void;\n /**\n * The still shown before the player starts and instead of it under reduced\n * motion: `\"last\"` (default; the rest frame, `\"first\"` for a hover or press\n * trigger), `\"first\"` or a time in ms.\n */\n poster?: \"first\" | \"last\" | number;\n /**\n * `\"user\"` (default) shows the still when the visitor prefers reduced\n * motion, `\"always\"` always does, `\"never\"` always plays.\n */\n reducedMotion?: ReducedMotion;\n /**\n * Size it as a word in a line of text: `display: inline-block` with the\n * viewBox's aspect ratio and `height` 0.72em (the cap height of a heavy\n * sans; pass a CSS length for another). Default: the effect's `inline`\n * control. Otherwise it is a block as wide as its container with the\n * viewBox's aspect ratio.\n */\n inline?: boolean | string;\n /**\n * With `inline`, keep room for what spills past the word (descenders,\n * outlines, glows, drips): a margin of the picture's `data-overhang` (see\n * `svgInlineLayout`), so the lines around it make space instead of being\n * painted over. Default `false`.\n */\n contain?: boolean;\n}\n\n/** A catalog vector effect by id (or the effect itself), with its values. */\nexport interface VectorEffectByIdParams extends SvgPlayerParams {\n /** A vector effect's catalog id (`\"drip-text\"`), or the effect itself. */\n id: string | VectorEffectDefinition;\n /** Control values; missing ones take the preset's, then the defaults. Compared by content. */\n values?: Record<string, ControlValue>;\n /** A preset's name to start from. */\n preset?: string;\n motion?: never;\n}\n\n/** Any {@link SvgMotion}; a new object restarts the player. */\nexport interface SvgMotionParams extends SvgPlayerParams {\n /** The picture and its animations. */\n motion: SvgMotion;\n id?: never;\n values?: never;\n preset?: never;\n}\n\n/** What `vectorEffect` and `vectorEffectStill` take: an effect by `id`, or a `motion`. */\nexport type VectorEffectParams = VectorEffectByIdParams | SvgMotionParams;\n\n/** A still of the picture, for `{@html markup}` inside an element with `style`. */\nexport interface VectorEffectStill {\n /** The still's layer: safe `<svg>` markup (see `svgFrameMarkup`) in an absolutely placed `<span>`. */\n markup: string;\n /** The host's inline style: its position and size from the viewBox. */\n style: string;\n}\n\ninterface Resolved {\n motion: SvgMotion;\n hold?: number;\n trigger?: SvgTrigger;\n inline?: boolean | string;\n contain?: boolean;\n}\n\n/** Remembers the last motion made from an effect, so values compared by content do not remake it. */\ntype MotionCache = { key: string; effect: VectorEffectDefinition; motion: SvgMotion };\n\nfunction resolve(params: VectorEffectParams, cache?: { current?: MotionCache }): Resolved {\n if (params.motion) return { motion: params.motion, hold: params.hold, trigger: params.trigger, inline: params.inline, contain: params.contain };\n const { id, values, preset } = params as VectorEffectByIdParams;\n const effect = typeof id === \"string\" ? getEffect(id) : id;\n if (!effect || effect.kind !== \"vector\")\n throw new Error(\n `\"${typeof id === \"string\" ? id : (effect?.id ?? id)}\" is not a vector effect; pick one from findEffects({ kind: \"vector\" }), or pass a motion`,\n );\n const key = JSON.stringify([preset ?? null, values ?? {}]);\n let motion: SvgMotion;\n if (cache?.current && cache.current.effect === effect && cache.current.key === key) motion = cache.current.motion;\n else {\n motion = renderVectorEffect(effect, effectDefaults(effect, { preset, values }));\n if (cache) cache.current = { key, effect, motion };\n }\n return {\n motion,\n hold: params.hold ?? effect.hold,\n trigger: params.trigger ?? effect.trigger,\n inline: params.inline ?? values?.inline === true,\n contain: params.contain,\n };\n}\n\n/** The host's sizing from the picture's viewBox, so the still and the player take the same room. */\nfunction hostStyle(svg: string, inline: boolean | string | undefined, contain?: boolean): [string, string][] {\n const box = svgViewBox(svg);\n const style: [string, string][] = [\n [\"position\", \"relative\"],\n [\"display\", inline ? \"inline-block\" : \"block\"],\n ];\n if (inline) style.push([\"height\", typeof inline === \"string\" ? inline : CAP_HEIGHT]);\n if (box) style.push([\"aspect-ratio\", `${box[2]} / ${box[3]}`]);\n const spill = inline && contain ? svgInlineLayout(svg)?.overhang : undefined;\n if (spill) style.push([\"margin\", `${spill.top}em ${spill.right}em ${spill.bottom}em ${spill.left}em`]);\n return style;\n}\n\n/** Whether to wait until scrolled into view: as asked, else when it plays once. */\nconst enters = (r: Resolved, p: SvgPlayerParams) => p.playOnEnter ?? (p.loop === false && !r.trigger);\n\nfunction stillMarkup(r: Resolved, params: SvgPlayerParams): string {\n const at = params.poster ?? (r.trigger === \"hover\" || r.trigger === \"press\" ? \"first\" : \"last\");\n return svgFrameMarkup(r.motion, { at, steps: params.steps }) ?? \"\";\n}\n\n/**\n * The still of an effect or motion, for server rendering: put `markup` in the\n * element that has the `vectorEffect` action, with `style` as its style, so\n * the page shows the picture before the player starts (and instead of it\n * under reduced motion), in the room the player will take.\n * Throws when `id` is not a vector effect.\n */\nexport function vectorEffectStill(params: VectorEffectParams): VectorEffectStill {\n const r = resolve(params);\n return {\n markup: `<span ${STILL_ATTR} aria-hidden=\"true\" style=\"${LAYER}\">${stillMarkup(r, params)}</span>`,\n style: hostStyle(r.motion.svg, r.inline, r.contain)\n .map(([k, v]) => `${k}: ${v}`)\n .join(\"; \"),\n };\n}\n\nfunction prefersReducedMotion(): boolean {\n return typeof matchMedia === \"function\" && matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n}\n\n/** The options whose change remakes the player (`speed` is set on it instead). */\nfunction playerKey(r: Resolved, p: SvgPlayerParams): unknown[] {\n return [\n r.motion,\n p.loop,\n p.autoplay,\n r.hold,\n p.duration,\n p.steps?.join(\",\"),\n r.trigger,\n p.pauseWhenHidden,\n enters(r, p),\n p.hideWhenPaused,\n p.clock,\n p.reducedMotion ?? \"user\",\n ];\n}\n\n/**\n * A Svelte action that plays a vector effect in its element:\n * `<span use:vectorEffect={{ id: \"drip-text\", values: { word: \"Slop\" }, loop: false }} />`.\n *\n * It makes an `SvgPlayer` in a layer of its own, remakes it when the params\n * change (values by content; `speed` without remaking) and disposes it on\n * destroy. A still from {@link vectorEffectStill} in the element is hidden\n * while the player runs and shown again after; without one, the action makes\n * its own (so reduced motion still shows the picture) and sizes the element\n * from the viewBox, leaving alone any of `position`, `display`, `height`,\n * `aspect-ratio` and `margin` the element's style already sets.\n *\n * For an attachment, `{@attach fromAction(vectorEffect, () => params)}`\n * (`fromAction` is from `svelte/attachments`). Throws when `id` is not a\n * vector effect.\n */\nexport function vectorEffect(node: HTMLElement, initial: VectorEffectParams): ActionReturn<VectorEffectParams> {\n const cache: { current?: MotionCache } = {};\n const doc = node.ownerDocument;\n const mount = doc.createElement(\"span\");\n mount.style.cssText = LAYER;\n node.appendChild(mount);\n\n let params = initial;\n let resolved = resolve(params, cache);\n let player: SvgPlayer | undefined;\n let key: unknown[] = [];\n /** The still the action made itself, when the element had none. */\n let ownStill: HTMLElement | undefined;\n /** Sizing properties the action set (the element's own style had them empty). */\n const sized = new Set<string>();\n\n const stills = () => node.querySelectorAll<HTMLElement>(`:scope > [${STILL_ATTR}]`);\n const showStills = (show: boolean) => {\n for (const s of stills()) s.style.display = show ? \"block\" : \"none\";\n };\n // When the params change Svelte replaces a server still (`{@html}`), and when\n // it is the element's only child, by setting `innerHTML`, which takes the\n // player's layer out too: put the layer back, and keep a new still hidden.\n const reattach = () => {\n if (mount.parentNode !== node) node.appendChild(mount);\n if (player) showStills(false);\n };\n const observer = typeof MutationObserver === \"function\" ? new MutationObserver(reattach) : undefined;\n observer?.observe(node, { childList: true });\n\n const size = () => {\n const style = hostStyle(resolved.motion.svg, resolved.inline, resolved.contain);\n for (const [prop, value] of style) {\n if (!sized.has(prop) && node.style.getPropertyValue(prop)) continue;\n node.style.setProperty(prop, value);\n sized.add(prop);\n }\n // A property the new sizing drops (`height` when no longer inline) is cleared.\n for (const prop of sized)\n if (!style.some(([p]) => p === prop)) {\n node.style.removeProperty(prop);\n sized.delete(prop);\n }\n };\n\n if (stills().length === 0) {\n ownStill = doc.createElement(\"span\");\n ownStill.setAttribute(STILL_ATTR, \"\");\n ownStill.setAttribute(\"aria-hidden\", \"true\");\n ownStill.style.cssText = LAYER;\n node.insertBefore(ownStill, mount);\n size();\n }\n\n const stop = () => {\n if (!player) return;\n player.dispose();\n player = undefined;\n showStills(true);\n params.onPlayer?.(undefined);\n };\n\n const start = () => {\n const reduced = params.reducedMotion ?? \"user\";\n if (reduced === \"always\" || (reduced === \"user\" && prefersReducedMotion())) return;\n player = new SvgPlayer(mount, resolved.motion, {\n loop: params.loop,\n autoplay: params.autoplay,\n speed: params.speed,\n hold: resolved.hold,\n duration: params.duration,\n steps: params.steps,\n trigger: resolved.trigger,\n pauseWhenHidden: params.pauseWhenHidden,\n playOnEnter: enters(resolved, params),\n hideWhenPaused: params.hideWhenPaused,\n clock: params.clock,\n // The latest params' callback, without remaking the player.\n onPick: (id) => params.onPick?.(id),\n });\n showStills(false);\n params.onPlayer?.(player);\n };\n\n const apply = () => {\n reattach();\n if (ownStill) {\n ownStill.innerHTML = stillMarkup(resolved, params);\n size();\n }\n const next = playerKey(resolved, params);\n if (player && next.every((v, i) => v === key[i])) {\n player.setSpeed(params.speed ?? 1);\n return;\n }\n key = next;\n stop();\n start();\n };\n\n apply();\n\n return {\n update(next) {\n params = next;\n resolved = resolve(params, cache);\n apply();\n },\n destroy() {\n observer?.disconnect();\n stop();\n mount.remove();\n ownStill?.remove();\n for (const prop of sized) node.style.removeProperty(prop);\n },\n };\n}\n\nexport type { SvgPlayer, SvgMotion, SvgTrigger };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoCA,IAAM,aAAa;AAGnB,IAAM,aAAa;AAEnB,IAAM,QAAQ;AA2Gd,SAAS,QAAQ,QAA4B,OAA6C;AACxF,MAAI,OAAO,OAAQ,QAAO,EAAE,QAAQ,OAAO,QAAQ,MAAM,OAAO,MAAM,SAAS,OAAO,SAAS,QAAQ,OAAO,QAAQ,SAAS,OAAO,QAAQ;AAC9I,QAAM,EAAE,IAAI,QAAQ,OAAO,IAAI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lDef } from './controls-Syr6drzO.js';
1
+ import { C as ControlValue, a as ControlDef } from './controls-Ec6P0Vpy.js';
2
2
  import { S as SvgMotion, a as SvgTrigger } from './svg-XugR-6Ec.js';
3
3
 
4
4
  /** What an effect is for, used to group the catalog. */
@@ -96,12 +96,18 @@ declare function vectorEffectControls(effect: Pick<VectorEffect, "motion" | "con
96
96
  declare function vectorControlIssues(motion: SvgMotion): string[];
97
97
  /** A vector control as a full `ControlDef`, so editors treat both kinds of effect alike. */
98
98
  declare function vectorControlDef(control: VectorControl, line?: number): ControlDef;
99
+ /** What a vector effect's colour control takes to paint in the surrounding text's colour (CSS `color`). */
100
+ declare const CURRENT_COLOR = "currentColor";
101
+ /** Whether a colour value is `currentColor` (in any case), which vector effects keep as it is. */
102
+ declare function isCurrentColor(value: unknown): value is string;
99
103
  /**
100
104
  * A vector effect's motion with its controls filled in. A string that is
101
105
  * only a placeholder (an animation's `"{{width}}"`) becomes the value
102
106
  * itself, so numbers stay numbers; elsewhere a placeholder becomes its text,
103
107
  * escaped in the markup so any text is safe to show. Comments are dropped
104
- * from the markup. Colours also take "#RRGGBB"; missing values, and values a
108
+ * from the markup. Colours also take CSS colours (see `parseColor`) and
109
+ * `currentColor`, which paints in the surrounding text's colour (`derived`
110
+ * then sees the string "currentColor"); missing values, and values a
105
111
  * control cannot take, use defaults. Placeholders no control or derived
106
112
  * value fills stay put.
107
113
  */
@@ -111,4 +117,4 @@ declare function colorControl(name: string, hex: string, label?: string): Vector
111
117
  /** A number control for vector effects. */
112
118
  declare function numberControl(name: string, value: number, min: number, max: number, label?: string, step?: number): VectorControl;
113
119
 
114
- export { type EffectDefinition as E, type ShaderEffect as S, type VectorEffect as V, type EffectCategory as a, EFFECT_CATEGORIES as b, type EffectPreset as c, VECTOR_CONTROL_TYPES as d, type VectorControl as e, colorControl as f, vectorControlIssues as g, vectorControls as h, vectorEffectControls as i, numberControl as n, renderVectorEffect as r, vectorControlDef as v };
120
+ export { CURRENT_COLOR as C, type EffectDefinition as E, type ShaderEffect as S, type VectorEffect as V, type EffectCategory as a, EFFECT_CATEGORIES as b, type EffectPreset as c, VECTOR_CONTROL_TYPES as d, type VectorControl as e, colorControl as f, vectorControlIssues as g, vectorControls as h, isCurrentColor as i, vectorEffectControls as j, numberControl as n, renderVectorEffect as r, vectorControlDef as v };
@@ -38,6 +38,32 @@ declare function morphPaths(from: string, to: string, options?: MorphOptions): [
38
38
  declare function parseViewBox(value: string | null | undefined): SvgBox | undefined;
39
39
  /** The `viewBox` on an SVG's opening tag (see {@link parseViewBox}). */
40
40
  declare function svgViewBox(markup: string): SvgBox | undefined;
41
+ /** How a picture framed for a line of text (a text effect's `inline`) sits in it; see {@link svgInlineLayout}. */
42
+ interface SvgInlineLayout {
43
+ /** Its viewBox: x, y, width, height. */
44
+ viewBox: SvgBox;
45
+ /** Width over height, for its host's CSS `aspect-ratio`. */
46
+ aspectRatio: number;
47
+ /**
48
+ * How far it reaches past its box at rest (descenders, outlines, glows,
49
+ * drips), in ems of the font size it is set at; 0 where the picture says
50
+ * nothing (no `data-overhang`).
51
+ */
52
+ overhang: {
53
+ top: number;
54
+ right: number;
55
+ bottom: number;
56
+ left: number;
57
+ };
58
+ }
59
+ /**
60
+ * The box and overhang on an SVG's opening tag: its `viewBox`, and
61
+ * `data-overhang="top right bottom left"` (ems), which text effects write.
62
+ * Set inline (`height: 0.72em`, the cap height they frame), give the host a
63
+ * margin of the overhang to keep room for what spills out:
64
+ * `margin: ${top}em ${right}em ${bottom}em ${left}em`.
65
+ */
66
+ declare function svgInlineLayout(markup: string): SvgInlineLayout | undefined;
41
67
  interface SvgFrameMarkupOptions {
42
68
  /**
43
69
  * The time shown, in ms: a number, `"first"` (0) or `"last"` (the end of
@@ -113,4 +139,4 @@ interface FormatUnitOptions {
113
139
  */
114
140
  declare function formatUnit(value: number, format?: UnitFormat, options?: FormatUnitOptions): string;
115
141
 
116
- export { type BoxAlignment, type BoxFit, type FittedBoxResult, type FormatUnitOptions, type MorphOptions, type StackLayoutOptions, SvgBox, type SvgFrameMarkupOptions, SvgMotion, type UnitFormat, computeBoxFit, formatUnit, layoutStack, morphPaths, morphSequence, parseViewBox, remap, stepVariant, svgFrameMarkup, svgViewBox };
142
+ export { type BoxAlignment, type BoxFit, type FittedBoxResult, type FormatUnitOptions, type MorphOptions, type StackLayoutOptions, SvgBox, type SvgFrameMarkupOptions, type SvgInlineLayout, SvgMotion, type UnitFormat, computeBoxFit, formatUnit, layoutStack, morphPaths, morphSequence, parseViewBox, remap, stepVariant, svgFrameMarkup, svgInlineLayout, svgViewBox };
@@ -8,8 +8,9 @@ import {
8
8
  import {
9
9
  parseViewBox,
10
10
  svgFrameMarkup,
11
+ svgInlineLayout,
11
12
  svgViewBox
12
- } from "../chunk-DVVQRZJ5.js";
13
+ } from "../chunk-MILF5MRS.js";
13
14
  import {
14
15
  EASES,
15
16
  SCRAMBLE_MS,
@@ -31,7 +32,7 @@ import {
31
32
  svgOpeningTag,
32
33
  svgView,
33
34
  writtenText
34
- } from "../chunk-4RGHZWQC.js";
35
+ } from "../chunk-RM3I6WZH.js";
35
36
  import {
36
37
  morphPaths,
37
38
  morphSequence
@@ -63,6 +64,7 @@ export {
63
64
  svgDuration,
64
65
  svgFrame,
65
66
  svgFrameMarkup,
67
+ svgInlineLayout,
66
68
  svgMotionIssues,
67
69
  svgOpeningTag,
68
70
  svgView,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/flair",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "description": "Web visual effects and motion graphics: WebGL2 shader effects, animated vector effects, a catalog of ready-made effects, and a UI-agnostic, agent-ready effect editor.",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -42,6 +42,10 @@
42
42
  "types": "./dist/react/index.d.ts",
43
43
  "import": "./dist/react/index.js"
44
44
  },
45
+ "./svelte": {
46
+ "types": "./dist/svelte/index.d.ts",
47
+ "import": "./dist/svelte/index.js"
48
+ },
45
49
  "./node": {
46
50
  "types": "./dist/node.d.ts",
47
51
  "import": "./dist/node.js"
@@ -62,7 +66,8 @@
62
66
  "generative",
63
67
  "editor",
64
68
  "ai-agents",
65
- "react"
69
+ "react",
70
+ "svelte"
66
71
  ],
67
72
  "dependencies": {
68
73
  "commander": "^12.0.0",
@@ -70,7 +75,8 @@
70
75
  },
71
76
  "peerDependencies": {
72
77
  "@pixerate/editor": ">=0.29.0 <1",
73
- "react": ">=18"
78
+ "react": ">=18",
79
+ "svelte": ">=5"
74
80
  },
75
81
  "peerDependenciesMeta": {
76
82
  "@pixerate/editor": {
@@ -78,6 +84,9 @@
78
84
  },
79
85
  "react": {
80
86
  "optional": true
87
+ },
88
+ "svelte": {
89
+ "optional": true
81
90
  }
82
91
  },
83
92
  "devDependencies": {
@@ -89,6 +98,7 @@
89
98
  "jsdom": "^30.1.3",
90
99
  "react": "^19.3.1",
91
100
  "react-dom": "^19.3.1",
101
+ "svelte": "^5.57.2",
92
102
  "tsup": "^8.5",
93
103
  "typescript": "^5.9",
94
104
  "vitest": "^4.1.11"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/vector/static.ts"],"sourcesContent":["/**\n * An {@link SvgMotion}'s frame as markup, with no DOM: for server rendering\n * (a still that hydrates without a blank flash), reduced motion and other\n * places a live player is not wanted.\n */\n\nimport { SVG_PICTURE, svgFrame, type SvgBox, type SvgMotion } from \"./motion.js\";\nimport { svgDuration } from \"./svg.js\";\n\ninterface Node {\n tag: string;\n attrs: [string, string][];\n children: (Node | string)[];\n}\n\n/** Elements dropped with all they hold: they run code or show outside markup. */\nconst DROPPED = new Set([\"script\", \"foreignobject\", \"iframe\", \"object\", \"embed\"]);\nconst ATTR = /([^\\s=/>\"']+)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s>\"']+)))?/g;\nconst TOKEN = /<!--[\\s\\S]*?(?:-->|$)|<!\\[CDATA\\[([\\s\\S]*?)(?:\\]\\]>|$)|<[!?][^>]*>|<\\/\\s*([\\w:.-]+)\\s*>|<([\\w:.-]+)((?:\\s+[^\\s=/>\"']+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s>\"']+))?)*)\\s*(\\/?)>/g;\n\nconst ENTITIES: Record<string, string> = { amp: \"&\", lt: \"<\", gt: \">\", quot: '\"', apos: \"'\", nbsp: \" \" };\nconst decode = (s: string) =>\n s.replace(/&(#x[0-9a-f]+|#\\d+|\\w+);/gi, (match, e: string) => {\n if (e[0] !== \"#\") return ENTITIES[e.toLowerCase()] ?? match;\n const code = e[1] === \"x\" || e[1] === \"X\" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10);\n return code > 0 && code <= 0x10ffff ? String.fromCodePoint(code) : \"\";\n });\nconst escapeText = (s: string) => s.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\nconst escapeAttr = (s: string) => escapeText(s).replace(/\"/g, \"&quot;\");\n\n/** Safe as `parseSvg` keeps it: no handlers, and links only within the picture or to data images. */\nfunction safeAttr(name: string, value: string): boolean {\n const n = name.toLowerCase();\n if (n.startsWith(\"on\") || !/^[a-z_][\\w:.-]*$/i.test(n)) return false;\n if (n === \"href\" || n === \"xlink:href\" || n === \"src\") return /^(#|data:image\\/)/i.test(value.trim());\n return true;\n}\n\n/** The `<svg>` in `markup` as a tree, without anything `parseSvg` would remove. */\nfunction parse(markup: string): Node | undefined {\n const root: Node = { tag: \"\", attrs: [], children: [] };\n const stack = [root];\n let dropping = 0;\n let at = 0;\n const text = (s: string) => {\n if (!dropping && s) stack[stack.length - 1]!.children.push(decode(s));\n };\n for (const m of markup.matchAll(TOKEN)) {\n text(markup.slice(at, m.index));\n at = m.index + m[0].length;\n const [, cdata, close, open, attrs = \"\", selfClosing] = m;\n if (cdata !== undefined) {\n if (!dropping) stack[stack.length - 1]!.children.push(cdata);\n } else if (close) {\n const tag = close.toLowerCase();\n if (dropping) {\n if (DROPPED.has(tag)) dropping--;\n continue;\n }\n // Close up to the matching element; a stray closing tag is ignored.\n let i = stack.length - 1;\n while (i > 0 && stack[i]!.tag.toLowerCase() !== tag) i--;\n if (i > 0) stack.length = i;\n } else if (open) {\n if (DROPPED.has(open.toLowerCase())) {\n if (!selfClosing) dropping++;\n continue;\n }\n if (dropping) continue;\n const node: Node = { tag: open, attrs: [], children: [] };\n for (const a of attrs.matchAll(ATTR)) {\n const value = decode(a[2] ?? a[3] ?? a[4] ?? \"\");\n if (safeAttr(a[1]!, value)) node.attrs.push([a[1]!, value]);\n }\n stack[stack.length - 1]!.children.push(node);\n if (!selfClosing) stack.push(node);\n }\n }\n text(markup.slice(at));\n const svg = root.children.find((c): c is Node => typeof c !== \"string\");\n return svg && svg.tag.toLowerCase() === \"svg\" ? svg : undefined;\n}\n\nfunction serialize(node: Node | string): string {\n if (typeof node === \"string\") return escapeText(node);\n const attrs = node.attrs.map(([k, v]) => ` ${k}=\"${escapeAttr(v)}\"`).join(\"\");\n return `<${node.tag}${attrs}>${node.children.map(serialize).join(\"\")}</${node.tag}>`;\n}\n\nfunction setAttr(node: Node, name: string, value: string | undefined) {\n const i = node.attrs.findIndex(([k]) => k === name);\n if (value === undefined) {\n if (i >= 0) node.attrs.splice(i, 1);\n } else if (!safeAttr(name, value)) return;\n else if (i >= 0) node.attrs[i]![1] = value;\n else node.attrs.push([name, value]);\n}\n\nconst getAttr = (node: Node, name: string) => node.attrs.find(([k]) => k === name)?.[1];\n\n/** A `viewBox` attribute's box, or undefined when it has none or it is malformed. */\nexport function parseViewBox(value: string | null | undefined): SvgBox | undefined {\n const box = (value ?? \"\").trim().split(/[\\s,]+/).map(Number);\n return box.length === 4 && box.every(Number.isFinite) && box[2]! > 0 && box[3]! > 0\n ? (box as unknown as SvgBox)\n : undefined;\n}\n\n/** The `viewBox` on an SVG's opening tag (see {@link parseViewBox}). */\nexport function svgViewBox(markup: string): SvgBox | undefined {\n const open = /<svg\\b[^>]*>/i.exec(markup)?.[0] ?? \"\";\n return parseViewBox(/\\sviewBox\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/i.exec(open)?.slice(1).find((v) => v !== undefined));\n}\n\nexport interface SvgFrameMarkupOptions {\n /**\n * The time shown, in ms: a number, `\"first\"` (0) or `\"last\"` (the end of\n * its last change, see `svgDuration`; the default).\n */\n at?: number | \"first\" | \"last\";\n /** Step start times in ms, as a player's `steps` (default none). */\n steps?: readonly number[];\n}\n\n/**\n * The picture of an {@link SvgMotion} at a moment, as `<svg>` markup made safe\n * the way `parseSvg` makes it (no scripts, handlers, `<foreignObject>` or\n * outside links), with no DOM needed: render it on a server, show it under\n * `prefers-reduced-motion`, or anywhere a still will do. It is sized to fill\n * its container, as `SvgPlayer` draws it.\n *\n * It matches the player's frame except where that needs layout: a change\n * `along` a path, and a `view` that frames an element by id, stay where the\n * markup puts them. Undefined when `motion.svg` is not an `<svg>`.\n */\nexport function svgFrameMarkup(motion: SvgMotion, options: SvgFrameMarkupOptions = {}): string | undefined {\n const svg = parse(motion.svg.trim());\n if (!svg) return undefined;\n const steps = options.steps ?? [];\n const at = options.at ?? \"last\";\n const time = at === \"first\" ? 0 : at === \"last\" ? svgDuration(motion, steps) : at;\n const byId = new Map<string, Node>();\n const index = (node: Node) => {\n const id = getAttr(node, \"id\");\n if (id && !byId.has(id)) byId.set(id, node);\n for (const c of node.children) if (typeof c !== \"string\") index(c);\n };\n index(svg);\n const whole = parseViewBox(getAttr(svg, \"viewBox\"));\n for (const [id, frame] of svgFrame(motion.animate ?? [], steps, time)) {\n if (id === SVG_PICTURE && frame.view) {\n const { from, to, u } = frame.view;\n const a = from === null ? whole : typeof from === \"string\" ? undefined : from;\n const b = typeof to === \"string\" ? undefined : to;\n if (a && b) setAttr(svg, \"viewBox\", a.map((n, i) => +(n + (b[i]! - n) * u).toFixed(2)).join(\" \"));\n continue;\n }\n const el = byId.get(id);\n if (!el) continue;\n for (const [name, value] of Object.entries(frame.attrs)) setAttr(el, name, value);\n if (frame.draw !== undefined) {\n setAttr(el, \"pathLength\", \"1\");\n setAttr(el, \"stroke-dasharray\", \"1 1\");\n setAttr(el, \"stroke-dashoffset\", String(1 - frame.draw));\n }\n if (frame.text !== undefined) el.children = [frame.text];\n if (frame.solo !== undefined) {\n let i = 0;\n for (const child of el.children)\n if (typeof child !== \"string\") setAttr(child, \"display\", i++ === frame.solo ? undefined : \"none\");\n }\n }\n setAttr(svg, \"width\", \"100%\");\n setAttr(svg, \"height\", \"100%\");\n if (!getAttr(svg, \"xmlns\")) setAttr(svg, \"xmlns\", \"http://www.w3.org/2000/svg\");\n return serialize(svg);\n}\n"],"mappings":";;;;;;;AAgBA,IAAM,UAAU,oBAAI,IAAI,CAAC,UAAU,iBAAiB,UAAU,UAAU,OAAO,CAAC;AAChF,IAAM,OAAO;AACb,IAAM,QAAQ;AAEd,IAAM,WAAmC,EAAE,KAAK,KAAK,IAAI,KAAK,IAAI,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,OAAI;AACvG,IAAM,SAAS,CAAC,MACd,EAAE,QAAQ,8BAA8B,CAAC,OAAO,MAAc;AAC5D,MAAI,EAAE,CAAC,MAAM,IAAK,QAAO,SAAS,EAAE,YAAY,CAAC,KAAK;AACtD,QAAM,OAAO,EAAE,CAAC,MAAM,OAAO,EAAE,CAAC,MAAM,MAAM,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,IAAI,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE;AAC9F,SAAO,OAAO,KAAK,QAAQ,UAAW,OAAO,cAAc,IAAI,IAAI;AACrE,CAAC;AACH,IAAM,aAAa,CAAC,MAAc,EAAE,QAAQ,MAAM,OAAO,EAAE,QAAQ,MAAM,MAAM,EAAE,QAAQ,MAAM,MAAM;AACrG,IAAM,aAAa,CAAC,MAAc,WAAW,CAAC,EAAE,QAAQ,MAAM,QAAQ;AAGtE,SAAS,SAAS,MAAc,OAAwB;AACtD,QAAM,IAAI,KAAK,YAAY;AAC3B,MAAI,EAAE,WAAW,IAAI,KAAK,CAAC,oBAAo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AS,OAAO,QAAQ,OAAO,SAAS,WAAW,SAAY;AACzE,YAAM,IAAI,OAAO,OAAO,WAAW,SAAY;AAC/C,UAAI,KAAK,EAAG,SAAQ,KAAK,WAAW,EAAE,IAAI,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,IAAK,KAAK,GAAG,QAAQ,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC;AAChG;AAAA,IACF;AACA,UAAM,KAAK,KAAK,IAAI,EAAE;AACtB,QAAI,CAAC,GAAI;AACT,eAAW,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,MAAM,KAAK,EAAG,SAAQ,IAAI,MAAM,KAAK;AAChF,QAAI,MAAM,SAAS,QAAW;AAC5B,cAAQ,IAAI,cAAc,GAAG;AAC7B,cAAQ,IAAI,oBAAoB,KAAK;AACrC,cAAQ,IAAI,qBAAqB,OAAO,IAAI,MAAM,IAAI,CAAC;AAAA,IACzD;AACA,QAAI,MAAM,SAAS,OAAW,IAAG,WAAW,CAAC,MAAM,IAAI;AACvD,QAAI,MAAM,SAAS,QAAW;AAC5B,UAAI,IAAI;AACR,iBAAW,SAAS,GAAG;AACrB,YAAI,OAAO,UAAU,SAAU,SAAQ,OAAO,WAAW,QAAQ,MAAM,OAAO,SAAY,MAAM;AAAA,IACpG;AAAA,EACF;AACA,UAAQ,KAAK,SAAS,MAAM;AAC5B,UAAQ,KAAK,UAAU,MAAM;AAC7B,MAAI,CAAC,QAAQ,KAAK,OAAO,EAAG,SAAQ,KAAK,SAAS,4BAA4B;AAC9E,SAAO,UAAU,GAAG;AACtB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shader/controls.ts"],"sourcesContent":["/**\n * Controls declared in a shader's source. A uniform becomes a control when\n * its declaration carries an `@control` comment on the same line:\n *\n * uniform float uSpeed; // @control min=0 max=4 default=1 label=\"Speed\"\n * uniform int uSteps; // @control min=1 max=64 default=16\n * uniform bool uGrain; // @control default=true label=\"Film grain\"\n * uniform vec2 uCenter; // @control min=-1 max=1 default=0,0\n * uniform vec3 uTint; // @control color default=#77C16A label=\"Tint\"\n * uniform sampler2D uPhoto; // @control filter=linear wrap=clamp label=\"Photo\"\n *\n * The source is the single source of truth for which controls exist and\n * their defaults; values someone picks are stored next to it.\n */\n\n/** The uniform types a control can have. */\nexport type ControlType = \"float\" | \"int\" | \"bool\" | \"vec2\" | \"vec3\" | \"vec4\" | \"sampler2D\" | \"text\";\n\n/**\n * A control's value: a number (`float`, `int`), a boolean (`bool`), the\n * components of a vector, an image URL (`sampler2D`; \"\" for none), or a\n * string (`text`, vector effects only: shaders cannot take text).\n */\nexport type ControlValue = number | boolean | number[] | string;\n\n/** How an image is sampled: Shadertoy's channel settings. */\nexport interface TextureSettings {\n /** `mipmap` (the default), `linear` or `nearest` (pixelated). */\n filter: \"mipmap\" | \"linear\" | \"nearest\";\n /** Outside 0–1: `repeat` (the default), `clamp` to the edge, or `mirror`. */\n wrap: \"repeat\" | \"clamp\" | \"mirror\";\n}\n\n/** A control parsed from an annotated uniform. */\nexport interface ControlDef {\n /** The uniform's name. */\n name: string;\n type: ControlType;\n /** `label=\"…\"`, or the name made readable (\"uFlowSpeed\" → \"Flow speed\"). */\n label: string;\n /** A `vec3` or `vec4` shown as a colour picker. */\n color: boolean;\n min: number;\n /** Always greater than `min`. */\n max: number;\n step: number;\n default: ControlValue;\n /** 1-based line of the declaration. */\n line: number;\n /** Sampling settings, for `sampler2D` controls only. */\n texture?: TextureSettings;\n}\n\nconst DECLARATION =\n /^\\s*uniform\\s+(float|int|bool|vec2|vec3|vec4|sampler2D)\\s+([A-Za-z_]\\w*)\\s*;\\s*\\/\\/\\s*@control\\b(.*)$/;\nconst ATTRIBUTE = /([a-z]+)(?:=(\"[^\"]*\"|'[^']*'|\\S+))?/gi;\n\nconst COMPONENTS: Record<ControlType, number> = {\n float: 1,\n int: 1,\n bool: 1,\n vec2: 2,\n vec3: 3,\n vec4: 4,\n sampler2D: 1,\n text: 1,\n};\n\n/** The number of components a control type has: 1 for scalars, `bool`, `sampler2D` and `text`, else the vector size. */\nexport function componentCount(type: ControlType): number {\n return COMPONENTS[type];\n}\n\n/** \"uFlowSpeed\" → \"Flow speed\". */\nexport function humanise(name: string): string {\n const words = name\n .replace(/^u(?=[A-Z])/, \"\")\n .replace(/_/g, \" \")\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .trim()\n .toLowerCase();\n return words.charAt(0).toUpperCase() + words.slice(1);\n}\n\n/** \"#77C16A\" (or \"#7c6\") → [0.467, 0.757, 0.416]; null when it is not a hex colour. */\nexport function hexToRgb(hex: string): number[] | null {\n const m = /^#?([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(hex.trim());\n if (!m) return null;\n const digits = m[1]!;\n const h =\n digits.length === 3\n ? digits\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : digits;\n return [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16) / 255);\n}\n\n/** [0.467, 0.757, 0.416] → \"#77c16a\". Components are clamped to 0–1; a fourth (alpha) is ignored. */\nexport function rgbToHex(rgb: number[]): string {\n return (\n \"#\" +\n rgb\n .slice(0, 3)\n .map((c) =>\n Math.round(Math.min(1, Math.max(0, c)) * 255)\n .toString(16)\n .padStart(2, \"0\"),\n )\n .join(\"\")\n );\n}\n\nfunction parseDefault(raw: string | undefined, type: ControlType, color: boolean): ControlValue {\n const n = COMPONENTS[type];\n if (type === \"bool\") return raw === \"true\" || raw === \"1\";\n if (type === \"sampler2D\" || type === \"text\") return raw ?? \"\";\n // Without a default, numbers start at 0 and colours at white.\n if (raw === undefined) return n === 1 ? 0 : Array.from({ length: n }, () => (color ? 1 : 0));\n if (color && raw.startsWith(\"#\")) {\n const rgb = hexToRgb(raw) ?? [1, 1, 1];\n return type === \"vec4\" ? [...rgb, 1] : rgb;\n }\n const parts = raw\n .split(\",\")\n .map(Number)\n .map((v) => (Number.isFinite(v) ? v : 0));\n if (n === 1) return parts[0] ?? 0;\n // A short list repeats its last component: `default=0.5` on a vec3 is (0.5, 0.5, 0.5).\n return Array.from({ length: n }, (_, i) => parts[i] ?? parts[parts.length - 1] ?? 0);\n}\n\n/**\n * A control from its declaration's attributes (the text after `@control`):\n * `min`, `max`, `step`, `default`, `label`, `color`, and for images `filter`\n * and `wrap`. Values with spaces are quoted, in double or single quotes.\n * Shared by shader sources and vector effects' `{{name: type …}}` placeholders.\n */\nexport function controlFromDeclaration(name: string, type: ControlType, attributes: string, line: number): ControlDef {\n const attrs: Record<string, string | undefined> = {};\n for (const a of attributes.matchAll(ATTRIBUTE)) {\n attrs[a[1]!.toLowerCase()] = a[2]?.replace(/^([\"'])(.*)\\1$/s, \"$2\");\n }\n const color = \"color\" in attrs && (type === \"vec3\" || type === \"vec4\");\n const num = (v: string | undefined, fallback: number) =>\n v !== undefined && Number.isFinite(Number(v)) ? Number(v) : fallback;\n const min = num(attrs.min, 0);\n const rawMax = num(attrs.max, type === \"int\" ? 10 : 1);\n const max = rawMax > min ? rawMax : min + 1;\n const control: ControlDef = {\n name,\n type,\n label: attrs.label ?? humanise(name),\n color,\n min,\n max,\n step: num(attrs.step, type === \"int\" ? 1 : (max - min) / 200),\n default: parseDefault(attrs.default, type, color),\n line,\n };\n if (type === \"sampler2D\") {\n const pick = <T extends string>(v: string | undefined, options: readonly T[]): T =>\n options.find((o) => o === v?.toLowerCase()) ?? options[0]!;\n control.texture = {\n filter: pick(attrs.filter, [\"mipmap\", \"linear\", \"nearest\"] as const),\n wrap: pick(attrs.wrap, [\"repeat\", \"clamp\", \"mirror\"] as const),\n };\n }\n return control;\n}\n\n/**\n * The controls a source declares, in source order. A uniform declared twice\n * counts once (the first wins). Unknown attributes are ignored, and missing\n * or malformed ones fall back to defaults: `min=0`, `max=1` (10 for `int`),\n * a step of 1/200 of the range (1 for `int`).\n */\nexport function parseControls(source: string): ControlDef[] {\n const controls: ControlDef[] = [];\n const seen = new Set<string>();\n source.split(\"\\n\").forEach((text, index) => {\n const m = DECLARATION.exec(text);\n if (!m || seen.has(m[2]!)) return;\n seen.add(m[2]!);\n controls.push(controlFromDeclaration(m[2]!, m[1] as ControlType, m[3]!, index + 1));\n });\n return controls;\n}\n\n/** The value a control has: the stored one when it still fits the declaration, else the default. */\nexport function controlValue(\n control: ControlDef,\n values: Record<string, ControlValue> | undefined,\n): ControlValue {\n const v = values?.[control.name];\n if (v === undefined) return control.default;\n if (control.type === \"bool\") return typeof v === \"boolean\" ? v : control.default;\n if (control.type === \"sampler2D\" || control.type === \"text\") return typeof v === \"string\" ? v : control.default;\n const n = COMPONENTS[control.type];\n if (n === 1) return typeof v === \"number\" ? v : control.default;\n return Array.isArray(v) && v.length === n ? v : control.default;\n}\n\n/** What {@link checkControlValue} decides: the value to store, or a sentence saying what the control takes. */\nexport type ControlCheck = { ok: true; value: ControlValue } | { ok: false; message: string };\n\n/**\n * Checks a value from outside (an agent's tool call, a URL, a form) against a\n * control. Colours also accept \"#RRGGBB\"; `int` values are rounded. Images\n * take a URL: `https:`, `http:`, `data:image/…`, `blob:` or a relative path\n * (\"\" for none).\n */\nexport function checkControlValue(control: ControlDef, raw: unknown): ControlCheck {\n const fail = (message: string): ControlCheck => ({ ok: false, message });\n const n = COMPONENTS[control.type];\n if (control.type === \"bool\") {\n return typeof raw === \"boolean\"\n ? { ok: true, value: raw }\n : fail(`${control.name} takes true or false.`);\n }\n if (control.type === \"sampler2D\") {\n return typeof raw === \"string\" && (raw === \"\" || isImageUrl(raw))\n ? { ok: true, value: raw }\n : fail(`${control.name} takes an image URL: https://…, data:image/… or blob:….`);\n }\n if (control.type === \"text\") {\n return typeof raw === \"string\" ? { ok: true, value: raw } : fail(`${control.name} takes text.`);\n }\n if (control.color && typeof raw === \"string\") {\n const rgb = hexToRgb(raw);\n if (!rgb) return fail(`${control.name} takes a colour like \"#77C16A\".`);\n return { ok: true, value: control.type === \"vec4\" ? [...rgb, 1] : rgb };\n }\n if (n === 1) {\n if (typeof raw !== \"number\" || !Number.isFinite(raw)) {\n return fail(`${control.name} takes a number.`);\n }\n return { ok: true, value: control.type === \"int\" ? Math.round(raw) : raw };\n }\n if (\n !Array.isArray(raw) ||\n raw.length !== n ||\n !raw.every((x) => typeof x === \"number\" && Number.isFinite(x))\n ) {\n return fail(\n `${control.name} takes ${n} numbers${control.color ? ' (or a colour like \"#77C16A\")' : \"\"}.`,\n );\n }\n return { ok: true, value: raw as number[] };\n}\n\n/**\n * {@link checkControlValue} for controls whose values are never strings:\n * returns the value to store, or the message. An image control's value is a\n * string too, so use `checkControlValue` where images can appear.\n */\nexport function coerceControlValue(control: ControlDef, raw: unknown): ControlValue | string {\n const check = checkControlValue(control, raw);\n return check.ok ? check.value : check.message;\n}\n\n/** Whether a string is a URL an image control can load: `http(s):`, `data:image/`, `blob:` or a relative path. */\nexport function isImageUrl(url: string): boolean {\n const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(url.trim())?.[1]?.toLowerCase();\n if (scheme === undefined) return url.trim() !== \"\";\n if (scheme === \"data\") return /^data:image\\//i.test(url.trim());\n return scheme === \"http\" || scheme === \"https\" || scheme === \"blob\";\n}\n\n/** The image URLs the controls show with these values, without duplicates or empty ones. */\nexport function imageUrls(\n controls: ControlDef[],\n values: Record<string, ControlValue> | undefined,\n): string[] {\n const urls = new Set<string>();\n for (const control of controls) {\n if (control.type !== \"sampler2D\") continue;\n const url = controlValue(control, values) as string;\n if (url) urls.add(url);\n }\n return [...urls];\n}\n\n/**\n * A value as compact, JSON-friendly data: colours as hex, numbers to three\n * decimals. A long `data:` URL is shortened to its type and size, which\n * keeps it out of an agent's context but cannot be stored back.\n */\nexport function describeValue(control: ControlDef, value: ControlValue): unknown {\n if (typeof value === \"string\" && value.startsWith(\"data:\") && value.length > 100) {\n const kb = Math.round((value.length * 3) / 4 / 1024);\n return `${value.slice(0, value.indexOf(\",\") + 1)}… (about ${kb} kB)`;\n }\n if (control.color && Array.isArray(value)) return rgbToHex(value);\n if (Array.isArray(value)) return value.map((v) => Math.round(v * 1000) / 1000);\n if (type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AChE,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,MAAM,IAAI,CAAC,MAAM,KAAK,MAAM,IAAI,GAAI,IAAI,GAAI;AAC7E,MAAI,OAAO,UAAU,SAAU,QAAO,KAAK,MAAM,QAAQ,GAAI,IAAI;AACjE,SAAO;AACT;","names":[]}
@@ -1,10 +0,0 @@
1
- import {
2
- exportMotionGraphic,
3
- findChrome
4
- } from "./chunk-FIJOMGPG.js";
5
- import "./chunk-WC3VADZC.js";
6
- export {
7
- exportMotionGraphic,
8
- findChrome
9
- };
10
- //# sourceMappingURL=recorder-KEX3U35D.js.map