@pixerate/editor 0.270.0 → 0.271.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 (41) hide show
  1. package/dist/animation-editor/index.cjs +60 -60
  2. package/dist/animation-editor/index.js +3 -3
  3. package/dist/canvas/index.cjs +2 -2
  4. package/dist/canvas/index.js +1 -1
  5. package/dist/{chunk-4YSPQGZW.js → chunk-B5W677L7.js} +1 -1
  6. package/dist/{chunk-4NMPUJUK.cjs → chunk-DDL3ZBHK.cjs} +86 -86
  7. package/dist/{chunk-PY4GWSE2.cjs → chunk-EBFPMSJO.cjs} +27 -5
  8. package/dist/{chunk-56RHCIJV.cjs → chunk-JJ2H25JG.cjs} +237 -170
  9. package/dist/{chunk-CBVNCWJM.cjs → chunk-LBDC5434.cjs} +2 -2
  10. package/dist/{chunk-BENSE3VX.cjs → chunk-M2ZVPU7L.cjs} +23 -23
  11. package/dist/{chunk-4CPOKP27.js → chunk-QYXUE37Q.js} +1 -1
  12. package/dist/{chunk-MWUZCEFT.js → chunk-S2XPXA47.js} +1 -1
  13. package/dist/{chunk-EHLOCVWB.js → chunk-T2URHAJX.js} +27 -5
  14. package/dist/{chunk-FUDP5QBB.js → chunk-TNHDCP4R.js} +70 -3
  15. package/dist/{chunk-VBRHE4AM.cjs → chunk-U2ASNGO6.cjs} +35 -35
  16. package/dist/{chunk-THBJHPUL.js → chunk-YNFSH72F.js} +1 -1
  17. package/dist/effects/index.cjs +5 -2
  18. package/dist/effects/index.js +4 -1
  19. package/dist/effects/pool.d.cts +9 -0
  20. package/dist/effects/pool.d.ts +9 -0
  21. package/dist/effects/types.d.cts +2 -0
  22. package/dist/effects/types.d.ts +2 -0
  23. package/dist/image-editor/index.cjs +784 -784
  24. package/dist/image-editor/index.js +4 -4
  25. package/dist/paint-editor/controller.d.cts +75 -4
  26. package/dist/paint-editor/controller.d.ts +75 -4
  27. package/dist/paint-editor/effect-paint.d.cts +33 -8
  28. package/dist/paint-editor/effect-paint.d.ts +33 -8
  29. package/dist/paint-editor/effects.d.cts +4 -0
  30. package/dist/paint-editor/effects.d.ts +4 -0
  31. package/dist/paint-editor/index.cjs +692 -398
  32. package/dist/paint-editor/index.js +362 -68
  33. package/dist/paint-editor/stroke.d.cts +13 -5
  34. package/dist/paint-editor/stroke.d.ts +13 -5
  35. package/dist/vector/index.cjs +996 -996
  36. package/dist/vector/index.js +3 -3
  37. package/dist/video-editor/index.cjs +317 -317
  38. package/dist/video-editor/index.js +2 -2
  39. package/package.json +1 -1
  40. package/skills/pixerate-paint-editor/SKILL.md +2 -2
  41. package/skills/pixerate-paint-editor/references/effect-paint.md +28 -6
@@ -149,7 +149,7 @@ import {
149
149
  videoTransitionEase,
150
150
  videoValueAt,
151
151
  videoWipeRect
152
- } from "../chunk-MWUZCEFT.js";
152
+ } from "../chunk-S2XPXA47.js";
153
153
  import {
154
154
  namedWithSuggestion
155
155
  } from "../chunk-EUKY4KFX.js";
@@ -160,7 +160,7 @@ import {
160
160
  effectTemplateTools,
161
161
  fillEffectTemplate
162
162
  } from "../chunk-DHQPRKXF.js";
163
- import "../chunk-EHLOCVWB.js";
163
+ import "../chunk-T2URHAJX.js";
164
164
  import {
165
165
  CAMERA_MOVE_MAX_MS,
166
166
  EffectsSlot,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.270.0",
3
+ "version": "0.271.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -235,7 +235,7 @@ When to use which:
235
235
  | The effect in a wash that flows, or in thick paint | `set_effect_paint` and a watercolour, gouache, oil or impasto brush |
236
236
  | The effect inside an exact shape, unchanged by water | Paint the shape, dry it, then `fill_layer_with_effect` with `lockTransparency: true` |
237
237
  | The effect over the whole sheet | `set_paper_effect` or `add_effect_layer` |
238
- | A pattern that follows the stroke, or paint that moves | `map: { by: "stroke" }`, `live: true` on a stroke layer |
238
+ | A pattern that follows the stroke, or paint that moves | `map: { by: "stroke" }` (bends any effect as a strip), or `map: { by: "path" }` for effects with a path control (`accepts: ["path"]`: beams, trails, signatures); `live: true` on a stroke layer |
239
239
 
240
240
  ## Canvas-hosted layer
241
241
 
@@ -394,7 +394,7 @@ Listing, saving, sharing and previewing brushes are the brush library's tools (`
394
394
  | `set_paper_effect` | Draw a generator over the paper (`values`, `opacity`, `blend` default `multiply`, `time`); `effect: null` removes it. One undo step. Returns the effect paper. |
395
395
  | `add_effect_layer` | Add a layer drawn by a generator, overlay or title effect (`values`, `name`, `aboveId`, `opacity`, `blend`, `time`); it becomes active. Returns the layer and its effect. |
396
396
  | `fill_layer_with_effect` | Composite a generator, overlay or title effect onto a layer (`layerId`, `values`, `opacity`, `lockTransparency`, `time`). One undo step. Returns the layer id and the effect. |
397
- | `set_effect_paint` | Paint with a generator, overlay or title effect (`effect`, `values`, `time` ms default 0): rendered once at the canvas size, strokes take each pixel's colour from it; `map` `{ by: "stroke", length, repeat }` lays it along each stroke; `live` keeps it playing on stroke layers. Call after `describe_effect`, then `paint_stroke`. Editor state, not an undo step. Returns `effectPaint`. |
397
+ | `set_effect_paint` | Paint with a generator, overlay or title effect (`effect`, `values`, `time` ms default 0): rendered once at the canvas size, strokes take each pixel's colour from it; `map` `{ by: "stroke", length, repeat }` bends a strip along each stroke, or `{ by: "path" }` passes the stroke's centreline to an effect with a path control (`format: "svg-path"`, `accepts: ["path"]`); `live` keeps it playing on stroke layers. Call after `describe_effect`, then `paint_stroke`. Editor state, not an undo step. Returns `effectPaint`. |
398
398
  | `set_effect_playback` | Play or pause live effect paint in the view (`playing`) and cap its frame rate (`fps` 1..60). Editor state. Returns `playing`, `fps`, `time` and `animation` (what plays, or null). Export a moment with `export_image` / `export_psd` `time`. |
399
399
 
400
400
  ### Guides
@@ -1,14 +1,36 @@
1
1
  # Effect paint along the stroke, and live effect paint
2
2
 
3
- - **Along the stroke** (`set_effect_paint` `map: { by: "stroke", length, repeat }`): the effect is
4
- rendered as a strip `length` px long (16..4096, default 300) and 256 px across. Each pixel takes
3
+ - **Along the stroke (native path)** (`set_effect_paint` `map: { by: "path" }`): when an effect has
4
+ a path control (`format: "svg-path"`, reported by `describe_effect` as `pathControls` and
5
+ `accepts: ["path"]`), each stroke passes its centreline `[x0, y0, x1, y1, …]` in canvas pixels
6
+ directly to that control and renders at the canvas size. The effect draws and lights itself along
7
+ the stroke's exact curve (e.g. a neon beam, laser trail or signature whose glow and lighting
8
+ belong to the path), while the brush's dabs and coverage still decide where paint lands. Strokes
9
+ with more than 256 points are evenly resampled to 256 points rather than refused. **Prefer
10
+ `by: "path"` over `by: "stroke"` whenever the effect has a path control** (`accepts: ["path"]`);
11
+ `set_effect_paint` refuses `by: "path"` on effects without a path control and tells you to use
12
+ `by: "stroke"` or `by: "canvas"`. Each stroke is a render of its own at the canvas size, so:
13
+ - A stroke painted by hand shows the effect along the path drawn so far while it is drawn,
14
+ re-rendered one render at a time, so it trails the pen by about one render. It is painted
15
+ again along its whole path when the pen lifts, as one undo step; if the preview already
16
+ rendered the whole path, at once. On a slow provider the editor is busy until that lands
17
+ (`effectPaintRendering`). `paint_stroke` and `stroke_path` know the path up front and paint
18
+ it at once.
19
+ - Wet brushes can't be painted by hand this way, as the simulation can't run twice; give them
20
+ the points through `paint_stroke`, or use `by: "stroke"`.
21
+ - With `live: true`, every stroke is a live source of its own, so at most 8 can play.
22
+ - Symmetry copies sample the same render, which only follows the original stroke: paint each
23
+ copy as its own stroke if it should draw too.
24
+ - **Along the stroke (strip)** (`set_effect_paint` `map: { by: "stroke", length, repeat }`): for
25
+ effects without a path control, the effect is rendered as a strip `length` px long (16..4096,
26
+ default 300) and 256 px across. Each pixel takes
5
27
  the colour at its distance along the stroke and its place across the tip, so the pattern follows
6
28
  the stroke's turns instead of staying fixed to the canvas. `repeat` starts the strip again
7
29
  (default), `mirror` runs it back, `clamp` holds the last colour. Use it for ribbons, ropes,
8
- flames and textures that should flow with the mark; use the default canvas mapping to reveal one
9
- hidden picture across many strokes. Every colour-laying brush takes it (watercolour, gouache, oil
10
- and impasto too; sprayed stickers at their centre); particle and bristle marks take the place of
11
- their pen dab.
30
+ flames and textures that have no path control of their own; use the default canvas mapping to
31
+ reveal one hidden picture across many strokes. Every colour-laying brush takes it (watercolour,
32
+ gouache, oil and impasto too; sprayed stickers at their centre); particle and bristle marks take
33
+ the place of their pen dab.
12
34
  Scaled replays (`export_high_res`) scale `length` with the canvas.
13
35
  - **Live** (`live: true`): on a stroke layer (`add_layer {type: "strokes"}`) each stroke keeps
14
36
  playing the effect, so the paint moves. Paint the strokes, then `set_effect_playback`