@pixerate/flair 0.2.0 → 0.4.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 (44) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +44 -8
  3. package/dist/catalog/index.d.ts +5 -4
  4. package/dist/catalog/index.js +12 -4
  5. package/dist/{chunk-3FAUZOGL.js → chunk-FIJOMGPG.js} +2 -2
  6. package/dist/{chunk-JWZCPMFG.js → chunk-GL37YCCM.js} +134 -680
  7. package/dist/chunk-GL37YCCM.js.map +1 -0
  8. package/dist/{chunk-UQQNZSYL.js → chunk-GTIAOYOK.js} +211 -7
  9. package/dist/chunk-GTIAOYOK.js.map +1 -0
  10. package/dist/{chunk-MWVTQFV5.js → chunk-IWKM5FJK.js} +410 -59
  11. package/dist/chunk-IWKM5FJK.js.map +1 -0
  12. package/dist/{chunk-HKXOHRCD.js → chunk-VA74HBPK.js} +2 -2
  13. package/dist/chunk-WAMA45G3.js +998 -0
  14. package/dist/chunk-WAMA45G3.js.map +1 -0
  15. package/dist/{chunk-J55UBNAT.js → chunk-WC3VADZC.js} +42 -36
  16. package/dist/chunk-WC3VADZC.js.map +1 -0
  17. package/dist/cli.js +12 -11
  18. package/dist/cli.js.map +1 -1
  19. package/dist/{controls-DdXMbovi.d.ts → controls-Syr6drzO.d.ts} +4 -3
  20. package/dist/editor/index.d.ts +12 -8
  21. package/dist/editor/index.js +26 -16
  22. package/dist/editor/index.js.map +1 -1
  23. package/dist/{export-FEBPEEO7.js → export-DH2HMACO.js} +4 -3
  24. package/dist/index.d.ts +193 -17
  25. package/dist/index.js +69 -33
  26. package/dist/index.js.map +1 -1
  27. package/dist/node.d.ts +1 -1
  28. package/dist/node.js +2 -2
  29. package/dist/recorder-KEX3U35D.js +10 -0
  30. package/dist/{renderer-Oyynz-fs.d.ts → renderer-DtnFkpkf.d.ts} +7 -3
  31. package/dist/types-CsFUZZIv.d.ts +102 -0
  32. package/package.json +1 -1
  33. package/dist/chunk-36DTNSHU.js +0 -160
  34. package/dist/chunk-36DTNSHU.js.map +0 -1
  35. package/dist/chunk-J55UBNAT.js.map +0 -1
  36. package/dist/chunk-JWZCPMFG.js.map +0 -1
  37. package/dist/chunk-MWVTQFV5.js.map +0 -1
  38. package/dist/chunk-UQQNZSYL.js.map +0 -1
  39. package/dist/recorder-WJTWMEQN.js +0 -10
  40. package/dist/types-CkKkavvB.d.ts +0 -71
  41. /package/dist/{chunk-3FAUZOGL.js.map → chunk-FIJOMGPG.js.map} +0 -0
  42. /package/dist/{chunk-HKXOHRCD.js.map → chunk-VA74HBPK.js.map} +0 -0
  43. /package/dist/{export-FEBPEEO7.js.map → export-DH2HMACO.js.map} +0 -0
  44. /package/dist/{recorder-WJTWMEQN.js.map → recorder-KEX3U35D.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @pixerate/flair
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7b06c4e: Allow `ShaderRenderer` to attach directly to an existing `HTMLCanvasElement`.
8
+
9
+ ## 0.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 10f02b2: The 3D camera now reaches layout checks, motion blur direction and the exporters. `checkShot` judges framing, edges, text size and the title on screen, through the camera's angle (`screenBox`). A pan's motion blur streaks along its direction (`View.blurAngle`, `cameraBlur` for an SVG blur, `moveBlur`), and the standalone player draws it that way. `cameraTrack` and `cameraSamples` lay the camera out on a timeline, and the exporters use them: Lottie gets a camera rig (in 3D with an AE camera when angled), Apple Motion a keyframed camera group, FCP7 XML a keyframed Distort corner pin with Motion Blur, and EDL a `* CAMERA:` note.
14
+ - 10f02b2: Scene cameras can turn in 3D and blur while they move. A shot's `camera` takes `tilt`, `turn` and `roll` (degrees), `perspective` and `motionBlur` alongside its framing, or on their own to change the angle in place, and angles carry over until a shot changes them. `playScene` passes views with the angle and a speed-based `blur`. New helpers: `cameraTransform` and `cameraFilter` (CSS for a board layer), `projectPoint`, `motionBlur`, `shotView`. `validateScene` checks the new fields, and the standalone scene player now plays camera moves (framing, angle and blur) and moves through shots when playing.
15
+ - 10f02b2: Add two catalog effects: `flow-network`, an animated SVG node graph whose links draw on before a glowing critical path races through it to a pulsing hub (its label is a text control), and `light-ribbons`, a shader of thin iridescent light strands weaving across a dark frame.
16
+ - 10f02b2: Add two catalog effects: `neon-circuit`, a shader of glowing neon traces routed up a circuit board with pulses running along them, and `drip-text`, an animated SVG title that pops in and oozes drips from its letters.
17
+ - 10f02b2: Vector effects declare their controls in their picture: the first `{{name: type …}}` placeholder (`float`, `int`, `bool`, `color` or `text`, with `@control`'s attributes) declares a control, and `vectorControls` reads them, the way `parseControls` reads a shader's. Adds a `text` control type (shown as a text field in the parameters panel), so a picture's words can be changed; text is escaped when filled in. `drip-text` now takes any word, with its drips following it. Every catalog vector effect declares its controls inline, and a vector effect's `controls` list is now optional (still read, for effects written before). `renderVectorEffect` drops comments from the markup and falls back to defaults for values a control cannot take.
18
+
3
19
  ## 0.2.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -19,20 +19,20 @@ Flair gives products a library of good-looking, configurable visual effects (her
19
19
 
20
20
  ### Core Capabilities
21
21
 
22
- - 🎨 **Effect catalog (`@pixerate/flair/catalog`)**: 59 effects, each with controls and presets. There are 44 WebGL2 shaders (gradients, organic textures, patterns, light, space, retro, image effects, transitions) and 15 animated SVG effects (loaders, status icons, charts, counters). [Browse them live](https://pixerate.github.io/flair/).
22
+ - 🎨 **Effect catalog (`@pixerate/flair/catalog`)**: 63 effects, each with controls and presets. There are 46 WebGL2 shaders (gradients, organic textures, patterns, light, space, retro, image effects, transitions) and 17 animated SVG effects (loaders, status icons, titles, charts, counters, node graphs). [Browse them live](https://pixerate.github.io/flair/).
23
23
  - ⚡ **Shader engine**:
24
24
  - Shadertoy-style GLSL ES 3.00 fragment shaders, with controls declared in the source (`// @control`), including image inputs.
25
25
  - Compile errors come back with line numbers that match the source.
26
26
  - Live previews (`ShaderRenderer`) and many animated thumbnails on one context (`ThumbnailPool`).
27
27
  - Frames at exact times (`ShaderFrames`), looping GIFs, and standalone HTML pages.
28
- - ✒️ **Vector motion (`@pixerate/flair/vector`)**: animated SVG described as data. It covers attribute tweens, draw-on strokes, motion along paths, counters and view zooms. Every frame is a pure function of time (`svgFrame`), and `SvgPlayer` plays it.
28
+ - ✒️ **Vector motion (`@pixerate/flair/vector`)**: animated SVG described as data. Catalog vector effects declare their controls in the picture (`{{name: type …}}`), text included. It covers attribute tweens, draw-on strokes, motion along paths, counters and view zooms. Every frame is a pure function of time (`svgFrame`), and `SvgPlayer` plays it.
29
29
  - 🎛️ **Effect editor (`@pixerate/flair/editor`)**:
30
30
  - A headless editor for an effect's source, values, keyframes, presets and timeline.
31
31
  - Built on [`@pixerate/editor`](https://github.com/Pixerate/editor)'s undo history and command registry, with no UI framework assumed.
32
32
  - 🤖 **Agent-native, bring your own model**:
33
33
  - Every editing action is a command, and the commands are exposed as MCP-shaped tools.
34
34
  - Ships instructions for the model. The host supplies the model, keys and agent loop.
35
- - 🎬 **Directing and interchange**: multi-shot scenes with camera moves, procedural effects, validation and fast headless simulation. Also blend modes, Oklab colour and grading, retiming, timecode, and export to Lottie, Apple Motion, FCP7 XML and CMX 3600 EDL.
35
+ - 🎬 **Directing and interchange**: multi-shot scenes with camera moves (3D tilt and motion blur included), procedural effects, validation and fast headless simulation. Also blend modes, Oklab colour and grading, retiming, timecode, and export to Lottie, Apple Motion, FCP7 XML and CMX 3600 EDL.
36
36
 
37
37
  ---
38
38
 
@@ -41,7 +41,7 @@ Flair gives products a library of good-looking, configurable visual effects (her
41
41
  | Import | What it provides | Runtime dependencies |
42
42
  | :--- | :--- | :--- |
43
43
  | `@pixerate/flair` | Shader engine, vector motion, time and easing, colour, blending, transitions, scenes, interchange exporters | None (browser-safe) |
44
- | `@pixerate/flair/catalog` | `EFFECTS`, `getEffect`, `findEffects`, `effectDefaults`, `renderVectorEffect`, GLSL helpers, sample images | None |
44
+ | `@pixerate/flair/catalog` | `EFFECTS`, `getEffect`, `findEffects`, `effectDefaults`, `renderVectorEffect`, `vectorControls`, GLSL helpers, sample images | None |
45
45
  | `@pixerate/flair/vector` | `SvgMotion`, `svgFrame`, `svgView`, `SvgPlayer`, `svgMotionIssues` | None |
46
46
  | `@pixerate/flair/editor` | `EffectEditor`, effect documents, keyframe tracks, renderer bindings, parameter-panel binding, agent tools and instructions | `@pixerate/editor` ≥ 0.29 (optional peer; only its dependency-free `/history`, `/commands`, `/tools`, `/animation` and `/parameters` subpaths) |
47
47
  | `@pixerate/flair/node` | `exportMotionGraphic`: renders a shader to GIF/MP4 through headless Chrome and ffmpeg | Node.js |
@@ -55,7 +55,7 @@ The `flair` CLI inspects shaders, writes standalone pages and directs scenes (se
55
55
  ```mermaid
56
56
  graph TD
57
57
  subgraph Effects["Effects (no dependencies)"]
58
- Catalog["catalog: 59 effects + presets"]
58
+ Catalog["catalog: 63 effects + presets"]
59
59
  Shader["shader engine: controls, compile, render, GIF, HTML"]
60
60
  Vector["vector motion: SvgMotion, SvgPlayer"]
61
61
  Time["time: clocks, easing, keyframes, noise"]
@@ -119,6 +119,15 @@ if (spinner.kind === "vector") {
119
119
 
120
120
  Find effects with `findEffects({ text: "glow", category: "light", kind: "shader" })`. Each effect has an `id`, `name`, `description`, `category`, `tags` and optional `presets`. Image effects default to built-in sample pictures, so they look right before you set `uImage` to your own URL.
121
121
 
122
+ A vector effect declares its controls in its picture, the way a shader declares its uniforms: the first `{{name: type …}}` declares a control (`float`, `int`, `bool`, `color` or `text`, with `@control`'s attributes; quote values with spaces in single quotes), and every `{{name}}` is filled with its value. Declarations can sit in an XML comment, which is dropped when the picture is filled in, and text is escaped, so any words are safe:
123
+
124
+ ```ts
125
+ const title = { motion: { svg: `<svg viewBox="0 0 200 60"><!-- {{title: text default='Hello' label='Title'}} {{ink: color default=#6366F1}} --><text x="10" y="40" fill="{{ink}}">{{title}}</text></svg>` } };
126
+ vectorControls(title.motion); // [{ name: "title", type: "text", default: "Hello", … }, { name: "ink", type: "vec3", color: true, … }]
127
+ renderVectorEffect(title, { title: "Fish & chips" }); // …<text …>Fish &amp; chips</text>…
128
+ renderVectorEffect(getEffect("drip-text")!, { word: "UNSTOPPABLE" }); // drips follow the word
129
+ ```
130
+
122
131
  ### 2. Write your own shader
123
132
 
124
133
  ```glsl
@@ -208,18 +217,45 @@ Every change is one undo step, and refusals come back as messages the model can
208
217
 
209
218
  ---
210
219
 
220
+ ## 🎬 Camera moves
221
+
222
+ A shot's `camera` frames a box (`{ x, y, width, height }`) or elements (`{ frame: ["card"] }`), and can turn in 3D and blur while it moves, like the product-video swoop onto a tilted screen:
223
+
224
+ ```json
225
+ { "camera": { "frame": ["dashboard"], "tilt": 35, "turn": -15, "motionBlur": 1.5 } }
226
+ ```
227
+
228
+ - `tilt` leans the board back (top away, like a desk seen from above), `turn` swings it round its vertical axis (left side nearer when positive), `roll` rolls it clockwise. Tilt and turn go up to ±75°.
229
+ - `perspective` is the lens distance as a multiple of the stage width (1.2 by default). Lower values look more dramatic.
230
+ - `motionBlur` (0 to 3, with 1 as natural) blurs the move in proportion to its speed, so the blur peaks mid-move and clears when the camera settles. A pan streaks along its direction (`View.blurAngle`), while a zoom or turn blurs in every direction.
231
+ - Angles carry over to later shots until a shot changes them. `{ "camera": { "tilt": 0, "turn": 0 } }` flattens the board in place.
232
+
233
+ `playScene` hands boards views with these fields (`View.tilt`, `View.blur`, `View.blurAngle`, …). For renderers:
234
+ - `cameraTransform(view, stage, width)` gives the CSS `transform` for a board layer.
235
+ - `cameraBlur(...)` gives the `stdDeviation` for an SVG `feGaussianBlur` that streaks, and `cameraFilter(...)` gives a CSS `blur()`.
236
+ - `projectPoint` gives where a scene point lands on screen.
237
+ - `cameraTrack` and `cameraSamples` lay the camera out on a timeline.
238
+
239
+ The standalone player (`flair scene html`) plays all of it. Layout checks (framing, edges, text size, the title) are judged on screen, where the angle puts each element.
240
+
241
+ The exporters carry the camera too:
242
+ - **Lottie:** a "Camera" null layer that the element layers hang off. When the camera is angled, it is a 3D layer with an AE camera (lottie-web draws it with its `html` renderer).
243
+ - **Apple Motion:** a keyframed "Camera" group around the shots.
244
+ - **FCP7 XML:** a keyframed Distort corner pin on each shot's clip, plus Motion Blur.
245
+ - **EDL:** a `* CAMERA:` note, since CMX 3600 has no transforms.
246
+
211
247
  ## 🎨 The catalog
212
248
 
213
249
  | Category | Effects |
214
250
  | :--- | :--- |
215
251
  | gradient | mesh gradient, aurora, gradient flow, conic sweep, silk |
216
252
  | organic | liquid marble, smoke, lava lamp, plasma, caustics, flames, blob morph |
217
- | pattern | dot wave, Truchet flow, hex pulse, living cells, moiré rings, kaleidoscope, stripes |
218
- | light / space | bokeh, god rays, sparkles, neon ripple, warp starfield, nebula, event horizon |
253
+ | pattern | dot wave, Truchet flow, hex pulse, living cells, moiré rings, kaleidoscope, stripes, neon circuit |
254
+ | light / space | bokeh, god rays, sparkles, neon ripple, light ribbons, warp starfield, nebula, event horizon |
219
255
  | retro | synthwave, digital rain, dithered gradient, TV static |
220
256
  | image | ripple, glitch, duotone, halftone, pixel reveal, CRT screen, film look |
221
257
  | transition | wipe, iris, block dissolve, grid wipe, glass wipe, twister, light leak, cross zoom |
222
- | loader / icon / data | spinner, bouncing dots, pulse ping, equalizer, progress ring, bar chart, line chart, stat counter, route, success check, error cross, heartbeat, signature, confetti |
258
+ | loader / icon / data | spinner, bouncing dots, pulse ping, equalizer, progress ring, bar chart, line chart, stat counter, route, success check, error cross, heartbeat, signature, confetti, drip text, flow network |
223
259
 
224
260
  Every shader is self-contained and compiles on WebGL2. Open [`#check`](https://pixerate.github.io/flair/#check) on the demo to compile the catalog on your own GPU.
225
261
 
@@ -1,6 +1,6 @@
1
- import { a as ControlDef, C as ControlValue } from '../controls-DdXMbovi.js';
2
- import { E as EffectDefinition, a as EffectCategory, S as ShaderEffect } from '../types-CkKkavvB.js';
3
- export { b as EFFECT_CATEGORIES, c as EffectPreset, V as VectorControl, d as VectorEffect, e as colorControl, n as numberControl, r as renderVectorEffect, v as vectorControlDef } from '../types-CkKkavvB.js';
1
+ import { a as ControlDef, C as ControlValue } from '../controls-Syr6drzO.js';
2
+ import { E as EffectDefinition, a as EffectCategory, S as ShaderEffect } from '../types-CsFUZZIv.js';
3
+ export { b as EFFECT_CATEGORIES, c as EffectPreset, V as VECTOR_CONTROL_TYPES, d as VectorControl, e as VectorEffect, f as colorControl, n as numberControl, r as renderVectorEffect, v as vectorControlDef, g as vectorControlIssues, h as vectorControls, i as vectorEffectControls } from '../types-CsFUZZIv.js';
4
4
  import '../motion-D0TVv2CF.js';
5
5
 
6
6
  /**
@@ -42,7 +42,8 @@ declare function glsl(...parts: string[]): string;
42
42
  *
43
43
  * - Browsing: `EFFECTS`, `getEffect`, `findEffects`, `EFFECT_CATEGORIES`.
44
44
  * - Controls: `effectControls`, `effectDefaults`.
45
- * - Vector effects: `renderVectorEffect` fills in their controls.
45
+ * - Vector effects: their pictures declare their controls (`vectorControls`),
46
+ * and `renderVectorEffect` fills them in.
46
47
  *
47
48
  * @packageDocumentation
48
49
  */
@@ -9,6 +9,7 @@ import {
9
9
  ROTATE,
10
10
  SAMPLE_IMAGES,
11
11
  SHADER_EFFECTS,
12
+ VECTOR_CONTROL_TYPES,
12
13
  colorControl,
13
14
  effectControls,
14
15
  effectDefaults,
@@ -18,10 +19,13 @@ import {
18
19
  numberControl,
19
20
  renderVectorEffect,
20
21
  svgDataUrl,
21
- vectorControlDef
22
- } from "../chunk-MWVTQFV5.js";
22
+ vectorControlDef,
23
+ vectorControlIssues,
24
+ vectorControls,
25
+ vectorEffectControls
26
+ } from "../chunk-IWKM5FJK.js";
23
27
  import "../chunk-EHDJ3CPJ.js";
24
- import "../chunk-J55UBNAT.js";
28
+ import "../chunk-WC3VADZC.js";
25
29
  export {
26
30
  EFFECTS,
27
31
  EFFECT_CATEGORIES,
@@ -33,6 +37,7 @@ export {
33
37
  ROTATE,
34
38
  SAMPLE_IMAGES,
35
39
  SHADER_EFFECTS,
40
+ VECTOR_CONTROL_TYPES,
36
41
  colorControl,
37
42
  effectControls,
38
43
  effectDefaults,
@@ -42,6 +47,9 @@ export {
42
47
  numberControl,
43
48
  renderVectorEffect,
44
49
  svgDataUrl,
45
- vectorControlDef
50
+ vectorControlDef,
51
+ vectorControlIssues,
52
+ vectorControls,
53
+ vectorEffectControls
46
54
  };
47
55
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  controlValue,
3
3
  parseControls
4
- } from "./chunk-J55UBNAT.js";
4
+ } from "./chunk-WC3VADZC.js";
5
5
 
6
6
  // src/export/recorder.ts
7
7
  import http from "http";
@@ -328,4 +328,4 @@ export {
328
328
  findChrome,
329
329
  exportMotionGraphic
330
330
  };
331
- //# sourceMappingURL=chunk-3FAUZOGL.js.map
331
+ //# sourceMappingURL=chunk-FIJOMGPG.js.map