@pixerate/flair 0.14.0 → 0.16.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.
@@ -0,0 +1,135 @@
1
+ import { ActionReturn } from 'svelte/action';
2
+ import { V as VectorEffect } from '../types-9J6NWaN3.js';
3
+ import { C as ControlValue } from '../controls-Syr6drzO.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
+ /** Wait to start until scrolled into view. */
53
+ playOnEnter?: boolean;
54
+ /** Hide the picture while paused or reset. */
55
+ hideWhenPaused?: boolean;
56
+ /** Time source (default animation frames); a `ManualClock` steps frames yourself. */
57
+ clock?: Clock;
58
+ /** Called with the id of the innermost element with an id that is clicked. */
59
+ onPick?: (id: string) => void;
60
+ /** Called with the player once it is made, and `undefined` when it is disposed. */
61
+ onPlayer?: (player: SvgPlayer | undefined) => void;
62
+ /**
63
+ * The still shown before the player starts and instead of it under reduced
64
+ * motion: `"last"` (default; the rest frame, `"first"` for a hover or press
65
+ * trigger), `"first"` or a time in ms.
66
+ */
67
+ poster?: "first" | "last" | number;
68
+ /**
69
+ * `"user"` (default) shows the still when the visitor prefers reduced
70
+ * motion, `"always"` always does, `"never"` always plays.
71
+ */
72
+ reducedMotion?: ReducedMotion;
73
+ /**
74
+ * Size it as a word in a line of text: `display: inline-block` with the
75
+ * viewBox's aspect ratio and `height` 0.72em (the cap height of a heavy
76
+ * sans; pass a CSS length for another). Default: the effect's `inline`
77
+ * control. Otherwise it is a block as wide as its container with the
78
+ * viewBox's aspect ratio.
79
+ */
80
+ inline?: boolean | string;
81
+ }
82
+ /** A catalog vector effect by id (or the effect itself), with its values. */
83
+ interface VectorEffectByIdParams extends SvgPlayerParams {
84
+ /** A vector effect's catalog id (`"drip-text"`), or the effect itself. */
85
+ id: string | VectorEffect;
86
+ /** Control values; missing ones take the preset's, then the defaults. Compared by content. */
87
+ values?: Record<string, ControlValue>;
88
+ /** A preset's name to start from. */
89
+ preset?: string;
90
+ motion?: never;
91
+ }
92
+ /** Any {@link SvgMotion}; a new object restarts the player. */
93
+ interface SvgMotionParams extends SvgPlayerParams {
94
+ /** The picture and its animations. */
95
+ motion: SvgMotion;
96
+ id?: never;
97
+ values?: never;
98
+ preset?: never;
99
+ }
100
+ /** What `vectorEffect` and `vectorEffectStill` take: an effect by `id`, or a `motion`. */
101
+ type VectorEffectParams = VectorEffectByIdParams | SvgMotionParams;
102
+ /** A still of the picture, for `{@html markup}` inside an element with `style`. */
103
+ interface VectorEffectStill {
104
+ /** The still's layer: safe `<svg>` markup (see `svgFrameMarkup`) in an absolutely placed `<span>`. */
105
+ markup: string;
106
+ /** The host's inline style: its position and size from the viewBox. */
107
+ style: string;
108
+ }
109
+ /**
110
+ * The still of an effect or motion, for server rendering: put `markup` in the
111
+ * element that has the `vectorEffect` action, with `style` as its style, so
112
+ * the page shows the picture before the player starts (and instead of it
113
+ * under reduced motion), in the room the player will take.
114
+ * Throws when `id` is not a vector effect.
115
+ */
116
+ declare function vectorEffectStill(params: VectorEffectParams): VectorEffectStill;
117
+ /**
118
+ * A Svelte action that plays a vector effect in its element:
119
+ * `<span use:vectorEffect={{ id: "drip-text", values: { word: "Slop" }, loop: false }} />`.
120
+ *
121
+ * It makes an `SvgPlayer` in a layer of its own, remakes it when the params
122
+ * change (values by content; `speed` without remaking) and disposes it on
123
+ * destroy. A still from {@link vectorEffectStill} in the element is hidden
124
+ * while the player runs and shown again after; without one, the action makes
125
+ * its own (so reduced motion still shows the picture) and sizes the element
126
+ * from the viewBox, leaving alone any of `position`, `display`, `height` and
127
+ * `aspect-ratio` the element's style already sets.
128
+ *
129
+ * For an attachment, `{@attach fromAction(vectorEffect, () => params)}`
130
+ * (`fromAction` is from `svelte/attachments`). Throws when `id` is not a
131
+ * vector effect.
132
+ */
133
+ declare function vectorEffect(node: HTMLElement, initial: VectorEffectParams): ActionReturn<VectorEffectParams>;
134
+
135
+ export { type ReducedMotion, SvgMotion, type SvgMotionParams, SvgPlayer, type SvgPlayerParams, SvgTrigger, type VectorEffectByIdParams, type VectorEffectParams, type VectorEffectStill, vectorEffect, vectorEffectStill };
@@ -0,0 +1,190 @@
1
+ import {
2
+ effectDefaults,
3
+ getEffect,
4
+ renderVectorEffect
5
+ } from "../chunk-KWNFZ5NC.js";
6
+ import {
7
+ svgFrameMarkup,
8
+ svgViewBox
9
+ } from "../chunk-DVVQRZJ5.js";
10
+ import {
11
+ SvgPlayer
12
+ } from "../chunk-4RGHZWQC.js";
13
+ import "../chunk-OHW7UG6D.js";
14
+ import "../chunk-EHDJ3CPJ.js";
15
+ import "../chunk-WMZQCUFJ.js";
16
+ import "../chunk-WC3VADZC.js";
17
+
18
+ // src/svelte/index.ts
19
+ var CAP_HEIGHT = "0.72em";
20
+ var STILL_ATTR = "data-flair-still";
21
+ var LAYER = "position:absolute;inset:0;display:block";
22
+ function resolve(params, cache) {
23
+ if (params.motion) return { motion: params.motion, hold: params.hold, trigger: params.trigger, inline: params.inline };
24
+ const { id, values, preset } = params;
25
+ const effect = typeof id === "string" ? getEffect(id) : id;
26
+ if (!effect || effect.kind !== "vector")
27
+ throw new Error(
28
+ `"${typeof id === "string" ? id : effect?.id ?? id}" is not a vector effect; pick one from findEffects({ kind: "vector" }), or pass a motion`
29
+ );
30
+ const key = JSON.stringify([preset ?? null, values ?? {}]);
31
+ let motion;
32
+ if (cache?.current && cache.current.effect === effect && cache.current.key === key) motion = cache.current.motion;
33
+ else {
34
+ motion = renderVectorEffect(effect, effectDefaults(effect, { preset, values }));
35
+ if (cache) cache.current = { key, effect, motion };
36
+ }
37
+ return {
38
+ motion,
39
+ hold: params.hold ?? effect.hold,
40
+ trigger: params.trigger ?? effect.trigger,
41
+ inline: params.inline ?? values?.inline === true
42
+ };
43
+ }
44
+ function hostStyle(svg, inline) {
45
+ const box = svgViewBox(svg);
46
+ const style = [
47
+ ["position", "relative"],
48
+ ["display", inline ? "inline-block" : "block"]
49
+ ];
50
+ if (inline) style.push(["height", typeof inline === "string" ? inline : CAP_HEIGHT]);
51
+ if (box) style.push(["aspect-ratio", `${box[2]} / ${box[3]}`]);
52
+ return style;
53
+ }
54
+ function stillMarkup(r, params) {
55
+ const at = params.poster ?? (r.trigger === "hover" || r.trigger === "press" ? "first" : "last");
56
+ return svgFrameMarkup(r.motion, { at, steps: params.steps }) ?? "";
57
+ }
58
+ function vectorEffectStill(params) {
59
+ const r = resolve(params);
60
+ return {
61
+ markup: `<span ${STILL_ATTR} aria-hidden="true" style="${LAYER}">${stillMarkup(r, params)}</span>`,
62
+ style: hostStyle(r.motion.svg, r.inline).map(([k, v]) => `${k}: ${v}`).join("; ")
63
+ };
64
+ }
65
+ function prefersReducedMotion() {
66
+ return typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
67
+ }
68
+ function playerKey(r, p) {
69
+ return [
70
+ r.motion,
71
+ p.loop,
72
+ p.autoplay,
73
+ r.hold,
74
+ p.duration,
75
+ p.steps?.join(","),
76
+ r.trigger,
77
+ p.pauseWhenHidden,
78
+ p.playOnEnter,
79
+ p.hideWhenPaused,
80
+ p.clock,
81
+ p.reducedMotion ?? "user"
82
+ ];
83
+ }
84
+ function vectorEffect(node, initial) {
85
+ const cache = {};
86
+ const doc = node.ownerDocument;
87
+ const mount = doc.createElement("span");
88
+ mount.style.cssText = LAYER;
89
+ node.appendChild(mount);
90
+ let params = initial;
91
+ let resolved = resolve(params, cache);
92
+ let player;
93
+ let key = [];
94
+ let ownStill;
95
+ const sized = /* @__PURE__ */ new Set();
96
+ const stills = () => node.querySelectorAll(`:scope > [${STILL_ATTR}]`);
97
+ const showStills = (show) => {
98
+ for (const s of stills()) s.style.display = show ? "block" : "none";
99
+ };
100
+ const reattach = () => {
101
+ if (mount.parentNode !== node) node.appendChild(mount);
102
+ if (player) showStills(false);
103
+ };
104
+ const observer = typeof MutationObserver === "function" ? new MutationObserver(reattach) : void 0;
105
+ observer?.observe(node, { childList: true });
106
+ const size = () => {
107
+ const style = hostStyle(resolved.motion.svg, resolved.inline);
108
+ for (const [prop, value] of style) {
109
+ if (!sized.has(prop) && node.style.getPropertyValue(prop)) continue;
110
+ node.style.setProperty(prop, value);
111
+ sized.add(prop);
112
+ }
113
+ for (const prop of sized)
114
+ if (!style.some(([p]) => p === prop)) {
115
+ node.style.removeProperty(prop);
116
+ sized.delete(prop);
117
+ }
118
+ };
119
+ if (stills().length === 0) {
120
+ ownStill = doc.createElement("span");
121
+ ownStill.setAttribute(STILL_ATTR, "");
122
+ ownStill.setAttribute("aria-hidden", "true");
123
+ ownStill.style.cssText = LAYER;
124
+ node.insertBefore(ownStill, mount);
125
+ size();
126
+ }
127
+ const stop = () => {
128
+ if (!player) return;
129
+ player.dispose();
130
+ player = void 0;
131
+ showStills(true);
132
+ params.onPlayer?.(void 0);
133
+ };
134
+ const start = () => {
135
+ const reduced = params.reducedMotion ?? "user";
136
+ if (reduced === "always" || reduced === "user" && prefersReducedMotion()) return;
137
+ player = new SvgPlayer(mount, resolved.motion, {
138
+ loop: params.loop,
139
+ autoplay: params.autoplay,
140
+ speed: params.speed,
141
+ hold: resolved.hold,
142
+ duration: params.duration,
143
+ steps: params.steps,
144
+ trigger: resolved.trigger,
145
+ pauseWhenHidden: params.pauseWhenHidden,
146
+ playOnEnter: params.playOnEnter,
147
+ hideWhenPaused: params.hideWhenPaused,
148
+ clock: params.clock,
149
+ // The latest params' callback, without remaking the player.
150
+ onPick: (id) => params.onPick?.(id)
151
+ });
152
+ showStills(false);
153
+ params.onPlayer?.(player);
154
+ };
155
+ const apply = () => {
156
+ reattach();
157
+ if (ownStill) {
158
+ ownStill.innerHTML = stillMarkup(resolved, params);
159
+ size();
160
+ }
161
+ const next = playerKey(resolved, params);
162
+ if (player && next.every((v, i) => v === key[i])) {
163
+ player.setSpeed(params.speed ?? 1);
164
+ return;
165
+ }
166
+ key = next;
167
+ stop();
168
+ start();
169
+ };
170
+ apply();
171
+ return {
172
+ update(next) {
173
+ params = next;
174
+ resolved = resolve(params, cache);
175
+ apply();
176
+ },
177
+ destroy() {
178
+ observer?.disconnect();
179
+ stop();
180
+ mount.remove();
181
+ ownStill?.remove();
182
+ for (const prop of sized) node.style.removeProperty(prop);
183
+ }
184
+ };
185
+ }
186
+ export {
187
+ vectorEffect,
188
+ vectorEffectStill
189
+ };
190
+ //# 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, 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 /** Wait to start until scrolled into view. */\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\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}\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 };\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 };\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): [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 return style;\n}\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)\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 p.playOnEnter,\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` and\n * `aspect-ratio` 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);\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: params.playOnEnter,\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;AA+Fd,SAAS,QAAQ,QAA4B,OAA6C;AACxF,MAAI,OAAO,OAAQ,QAAO,EAAE,QAAQ,OAAO,QAAQ,MAAM,OAAO,MAAM,SAAS,OAAO,SAAS,QAAQ,OAAO,OAAO;AACrH,QAAM,EAAE,IAAI,QAAQ,OAAO,IAAI;AAC/B,QAAM,SAAS,OAAO,OAAO,WAAW,UAAU,EAAE,IAAI;AACxD,MAAI,CAAC,UAAU,OAAO,SAAS;AAC7B,UAAM,IAAI;AAAA,MACR,IAAI,OAAO,OAAO,WAAW,KAAM,QAAQ,MAAM,EAAG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ACpC,CAAC;AACD,eAAW,KAAK;AAChB,WAAO,WAAW,MAAM;AAAA,EAC1B;AAEA,QAAM,QAAQ,MAAM;AAClB,aAAS;AACT,QAAI,UAAU;AACZ,eAAS,YAAY,YAAY,UAAU,MAAM;AACjD,WAAK;AAAA,IACP;AACA,UAAM,OAAO,UAAU,UAAU,MAAM;AACvC,QAAI,UAAU,KAAK,MAAM,CAAC,GAAG,MAAM,MAAM,IAAI,CAAC,CAAC,GAAG;AAChD,aAAO,SAAS,OAAO,SAAS,CAAC;AACjC;AAAA,IACF;AACA,UAAM;AACN,SAAK;AACL,UAAM;AAAA,EACR;AAEA,QAAM;AAEN,SAAO;AAAA,IACL,OAAO,MAAM;AACX,eAAS;AACT,iBAAW,QAAQ,QAAQ,KAAK;AAChC,YAAM;AAAA,IACR;AAAA,IACA,UAAU;AACR,gBAAU,WAAW;AACrB,WAAK;AACL,YAAM,OAAO;AACb,gBAAU,OAAO;AACjB,iBAAW,QAAQ,MAAO,MAAK,MAAM,eAAe,IAAI;AAAA,IAC1D;AAAA,EACF;AACF;","names":[]}
@@ -382,4 +382,4 @@ interface AnimateCountOptions {
382
382
  */
383
383
  declare function animateCount(options: AnimateCountOptions): () => void;
384
384
 
385
- export { type AnimateCountOptions as A, svgMotionIssues as B, type Clock as C, type DataKey as D, EASES as E, svgOpeningTag as F, svgView as G, writtenText as H, ManualClock as M, type SvgMotion as S, type SvgTrigger as a, type EaseName as b, SCRAMBLE_MS as c, STEP_MS as d, SVG_PICTURE as e, type SvgAnimation as f, type SvgBox as g, type SvgElementFrame as h, SvgPlayer as i, type SvgPlayerOptions as j, type SvgView as k, type SvgViewOptions as l, animateCount as m, defaultDataKey as n, formatCount as o, jitter as p, lerpAttr as q, lerpData as r, pageHidden as s, parseSvg as t, realClock as u, stepData as v, stepProgress as w, stepStart as x, svgDuration as y, svgFrame as z };
385
+ export { type AnimateCountOptions as A, svgMotionIssues as B, type Clock as C, type DataKey as D, EASES as E, svgOpeningTag as F, svgView as G, writtenText as H, ManualClock as M, type SvgMotion as S, type SvgTrigger as a, SvgPlayer as b, type EaseName as c, SCRAMBLE_MS as d, STEP_MS as e, SVG_PICTURE as f, type SvgAnimation as g, type SvgBox as h, type SvgElementFrame as i, type SvgPlayerOptions as j, type SvgView as k, type SvgViewOptions as l, animateCount as m, defaultDataKey as n, formatCount as o, jitter as p, lerpAttr as q, lerpData as r, pageHidden as s, parseSvg as t, realClock as u, stepData as v, stepProgress as w, stepStart as x, svgDuration as y, svgFrame as z };
@@ -1,5 +1,5 @@
1
1
  import { C as ControlValue, a as ControlDef } from './controls-Syr6drzO.js';
2
- import { S as SvgMotion, a as SvgTrigger } from './svg-C_TWBtEN.js';
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. */
5
5
  type EffectCategory = "gradient" | "organic" | "pattern" | "light" | "space" | "retro" | "image" | "overlay" | "text" | "morph" | "interaction" | "pyrotechnics" | "timewarp" | "melt" | "electric" | "transition" | "loader" | "data" | "icon";
@@ -111,4 +111,4 @@ declare function colorControl(name: string, hex: string, label?: string): Vector
111
111
  /** A number control for vector effects. */
112
112
  declare function numberControl(name: string, value: number, min: number, max: number, label?: string, step?: number): VectorControl;
113
113
 
114
- export { type EffectDefinition as E, type ShaderEffect as S, VECTOR_CONTROL_TYPES as V, type EffectCategory as a, EFFECT_CATEGORIES as b, type EffectPreset as c, type VectorControl as d, type VectorEffect as e, colorControl as f, vectorControlIssues as g, vectorControls as h, vectorEffectControls as i, numberControl as n, renderVectorEffect as r, vectorControlDef as v };
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 };
@@ -1,5 +1,5 @@
1
- import { g as SvgBox } from '../svg-C_TWBtEN.js';
2
- export { A as AnimateCountOptions, D as DataKey, E as EASES, b as EaseName, c as SCRAMBLE_MS, d as STEP_MS, e as SVG_PICTURE, f as SvgAnimation, h as SvgElementFrame, S as SvgMotion, i as SvgPlayer, j as SvgPlayerOptions, a as SvgTrigger, k as SvgView, l as SvgViewOptions, m as animateCount, n as defaultDataKey, o as formatCount, q as lerpAttr, r as lerpData, t as parseSvg, v as stepData, w as stepProgress, x as stepStart, y as svgDuration, z as svgFrame, B as svgMotionIssues, F as svgOpeningTag, G as svgView, H as writtenText } from '../svg-C_TWBtEN.js';
1
+ import { h as SvgBox, S as SvgMotion } from '../svg-XugR-6Ec.js';
2
+ export { A as AnimateCountOptions, D as DataKey, E as EASES, c as EaseName, d as SCRAMBLE_MS, e as STEP_MS, f as SVG_PICTURE, g as SvgAnimation, i as SvgElementFrame, b as SvgPlayer, j as SvgPlayerOptions, a as SvgTrigger, k as SvgView, l as SvgViewOptions, m as animateCount, n as defaultDataKey, o as formatCount, q as lerpAttr, r as lerpData, t as parseSvg, v as stepData, w as stepProgress, x as stepStart, y as svgDuration, z as svgFrame, B as svgMotionIssues, F as svgOpeningTag, G as svgView, H as writtenText } from '../svg-XugR-6Ec.js';
3
3
 
4
4
  /**
5
5
  * Shape morphing: any SVG paths turned into paths with the same structure, so
@@ -28,6 +28,38 @@ declare function morphSequence(paths: readonly string[], options?: MorphOptions)
28
28
  */
29
29
  declare function morphPaths(from: string, to: string, options?: MorphOptions): [string, string];
30
30
 
31
+ /**
32
+ * An {@link SvgMotion}'s frame as markup, with no DOM: for server rendering
33
+ * (a still that hydrates without a blank flash), reduced motion and other
34
+ * places a live player is not wanted.
35
+ */
36
+
37
+ /** A `viewBox` attribute's box, or undefined when it has none or it is malformed. */
38
+ declare function parseViewBox(value: string | null | undefined): SvgBox | undefined;
39
+ /** The `viewBox` on an SVG's opening tag (see {@link parseViewBox}). */
40
+ declare function svgViewBox(markup: string): SvgBox | undefined;
41
+ interface SvgFrameMarkupOptions {
42
+ /**
43
+ * The time shown, in ms: a number, `"first"` (0) or `"last"` (the end of
44
+ * its last change, see `svgDuration`; the default).
45
+ */
46
+ at?: number | "first" | "last";
47
+ /** Step start times in ms, as a player's `steps` (default none). */
48
+ steps?: readonly number[];
49
+ }
50
+ /**
51
+ * The picture of an {@link SvgMotion} at a moment, as `<svg>` markup made safe
52
+ * the way `parseSvg` makes it (no scripts, handlers, `<foreignObject>` or
53
+ * outside links), with no DOM needed: render it on a server, show it under
54
+ * `prefers-reduced-motion`, or anywhere a still will do. It is sized to fill
55
+ * its container, as `SvgPlayer` draws it.
56
+ *
57
+ * It matches the player's frame except where that needs layout: a change
58
+ * `along` a path, and a `view` that frames an element by id, stay where the
59
+ * markup puts them. Undefined when `motion.svg` is not an `<svg>`.
60
+ */
61
+ declare function svgFrameMarkup(motion: SvgMotion, options?: SvgFrameMarkupOptions): string | undefined;
62
+
31
63
  type BoxFit = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
32
64
  type BoxAlignment = 'topLeft' | 'topCenter' | 'topRight' | 'centerLeft' | 'center' | 'centerRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
33
65
  interface FittedBoxResult {
@@ -81,4 +113,4 @@ interface FormatUnitOptions {
81
113
  */
82
114
  declare function formatUnit(value: number, format?: UnitFormat, options?: FormatUnitOptions): string;
83
115
 
84
- export { type BoxAlignment, type BoxFit, type FittedBoxResult, type FormatUnitOptions, type MorphOptions, type StackLayoutOptions, SvgBox, type UnitFormat, computeBoxFit, formatUnit, layoutStack, morphPaths, morphSequence, remap, stepVariant };
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 };
@@ -4,7 +4,12 @@ import {
4
4
  layoutStack,
5
5
  remap,
6
6
  stepVariant
7
- } from "../chunk-H355R6U4.js";
7
+ } from "../chunk-VP6IEWIK.js";
8
+ import {
9
+ parseViewBox,
10
+ svgFrameMarkup,
11
+ svgViewBox
12
+ } from "../chunk-DVVQRZJ5.js";
8
13
  import {
9
14
  EASES,
10
15
  SCRAMBLE_MS,
@@ -49,6 +54,7 @@ export {
49
54
  morphPaths,
50
55
  morphSequence,
51
56
  parseSvg,
57
+ parseViewBox,
52
58
  remap,
53
59
  stepData,
54
60
  stepProgress,
@@ -56,9 +62,11 @@ export {
56
62
  stepVariant,
57
63
  svgDuration,
58
64
  svgFrame,
65
+ svgFrameMarkup,
59
66
  svgMotionIssues,
60
67
  svgOpeningTag,
61
68
  svgView,
69
+ svgViewBox,
62
70
  writtenText
63
71
  };
64
72
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/flair",
3
- "version": "0.14.0",
3
+ "version": "0.16.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",
@@ -38,6 +38,14 @@
38
38
  "types": "./dist/vector/index.d.ts",
39
39
  "import": "./dist/vector/index.js"
40
40
  },
41
+ "./react": {
42
+ "types": "./dist/react/index.d.ts",
43
+ "import": "./dist/react/index.js"
44
+ },
45
+ "./svelte": {
46
+ "types": "./dist/svelte/index.d.ts",
47
+ "import": "./dist/svelte/index.js"
48
+ },
41
49
  "./node": {
42
50
  "types": "./dist/node.d.ts",
43
51
  "import": "./dist/node.js"
@@ -57,25 +65,40 @@
57
65
  "effects",
58
66
  "generative",
59
67
  "editor",
60
- "ai-agents"
68
+ "ai-agents",
69
+ "react",
70
+ "svelte"
61
71
  ],
62
72
  "dependencies": {
63
73
  "commander": "^12.0.0",
64
74
  "gifenc": "^1.0.3"
65
75
  },
66
76
  "peerDependencies": {
67
- "@pixerate/editor": ">=0.29.0 <1"
77
+ "@pixerate/editor": ">=0.29.0 <1",
78
+ "react": ">=18",
79
+ "svelte": ">=5"
68
80
  },
69
81
  "peerDependenciesMeta": {
70
82
  "@pixerate/editor": {
71
83
  "optional": true
84
+ },
85
+ "react": {
86
+ "optional": true
87
+ },
88
+ "svelte": {
89
+ "optional": true
72
90
  }
73
91
  },
74
92
  "devDependencies": {
75
93
  "@changesets/cli": "^2.27.12",
76
94
  "@pixerate/editor": "^0.29.0",
77
95
  "@types/node": "^24.19.2",
96
+ "@types/react": "^19.3.0",
97
+ "@types/react-dom": "^19.3.0",
78
98
  "jsdom": "^30.1.3",
99
+ "react": "^19.3.1",
100
+ "react-dom": "^19.3.1",
101
+ "svelte": "^5.57.2",
79
102
  "tsup": "^8.5",
80
103
  "typescript": "^5.9",
81
104
  "vitest": "^4.1.11"