@pixerate/editor 0.226.0 → 0.227.1

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 (60) hide show
  1. package/dist/animation-editor/index.cjs +66 -66
  2. package/dist/animation-editor/index.js +4 -4
  3. package/dist/{brushstrokeRender-C3UU6GVC.js → brushstrokeRender-MAHOXL7K.js} +2 -2
  4. package/dist/{brushstrokeRender-EAJNE6WP.cjs → brushstrokeRender-WDTKD54B.cjs} +5 -5
  5. package/dist/canvas/effects.d.cts +18 -0
  6. package/dist/canvas/effects.d.ts +18 -0
  7. package/dist/canvas/index.cjs +34 -15
  8. package/dist/canvas/index.js +21 -2
  9. package/dist/{chunk-ABQ2VGUB.cjs → chunk-5MQOBTNP.cjs} +13 -2
  10. package/dist/{chunk-LCCMOWR7.cjs → chunk-ATKKG76G.cjs} +23 -23
  11. package/dist/{chunk-QAUIZPYI.cjs → chunk-BQE3Y6ZO.cjs} +2 -2
  12. package/dist/{chunk-G4E6RUPC.js → chunk-CDP2AKMA.js} +1 -1
  13. package/dist/{chunk-NDMXB4PR.js → chunk-CU6ANS5L.js} +1 -1
  14. package/dist/{chunk-ROVK6AXX.cjs → chunk-GNZI3KYK.cjs} +95 -23
  15. package/dist/{chunk-I7G3RSUJ.cjs → chunk-GXLZZVR5.cjs} +35 -35
  16. package/dist/{chunk-C6CMQXMI.cjs → chunk-IGPEBXUD.cjs} +7 -7
  17. package/dist/{chunk-4PA6YS6W.cjs → chunk-K5GXW5TR.cjs} +14 -14
  18. package/dist/{chunk-5YLOU7VF.js → chunk-KN3Y3FRY.js} +1 -1
  19. package/dist/{chunk-56RFHF7O.js → chunk-LPTFDCJO.js} +1 -1
  20. package/dist/{chunk-IWMDW7LB.cjs → chunk-MXJP77K4.cjs} +86 -86
  21. package/dist/{chunk-4MDWEX44.js → chunk-PB6JV62G.js} +1 -1
  22. package/dist/{chunk-F7YA3MMC.js → chunk-TQOL6CF7.js} +76 -4
  23. package/dist/{chunk-7DZ55AIE.js → chunk-UGYUGZE2.js} +13 -2
  24. package/dist/{chunk-ZMHPQ6HP.cjs → chunk-V3L7U63N.cjs} +1 -1
  25. package/dist/{chunk-DJBYJOHM.js → chunk-XSVUNSDJ.js} +1 -1
  26. package/dist/{chunk-BGOCAUXH.js → chunk-YMREOA67.js} +1 -1
  27. package/dist/effects/index.cjs +44 -44
  28. package/dist/effects/index.js +2 -2
  29. package/dist/image-editor/index.cjs +784 -784
  30. package/dist/image-editor/index.js +5 -5
  31. package/dist/paint-editor/controller.d.cts +54 -3
  32. package/dist/paint-editor/controller.d.ts +54 -3
  33. package/dist/paint-editor/dab-stroke.d.cts +3 -0
  34. package/dist/paint-editor/dab-stroke.d.ts +3 -0
  35. package/dist/paint-editor/effect-paint.d.cts +47 -0
  36. package/dist/paint-editor/effect-paint.d.ts +47 -0
  37. package/dist/paint-editor/effect-tools.d.cts +4 -2
  38. package/dist/paint-editor/effect-tools.d.ts +4 -2
  39. package/dist/paint-editor/effects.d.cts +3 -0
  40. package/dist/paint-editor/effects.d.ts +3 -0
  41. package/dist/paint-editor/engine.d.cts +4 -0
  42. package/dist/paint-editor/engine.d.ts +4 -0
  43. package/dist/paint-editor/index.cjs +542 -315
  44. package/dist/paint-editor/index.d.cts +1 -0
  45. package/dist/paint-editor/index.d.ts +1 -0
  46. package/dist/paint-editor/index.js +252 -25
  47. package/dist/paint-editor/procedural.d.cts +4 -0
  48. package/dist/paint-editor/procedural.d.ts +4 -0
  49. package/dist/paint-editor/stroke.d.cts +9 -0
  50. package/dist/paint-editor/stroke.d.ts +9 -0
  51. package/dist/paint-editor/strokes.d.cts +6 -2
  52. package/dist/paint-editor/strokes.d.ts +6 -2
  53. package/dist/vector/index.cjs +968 -968
  54. package/dist/vector/index.js +5 -5
  55. package/dist/video-editor/index.cjs +309 -309
  56. package/dist/video-editor/index.js +3 -3
  57. package/package.json +1 -1
  58. package/skills/pixerate-canvas/SKILL.md +2 -1
  59. package/skills/pixerate-paint-editor/SKILL.md +42 -6
  60. package/skills/pixerate-paint-sketch-to-finish/SKILL.md +7 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createEffectAuthoringSession
3
- } from "../chunk-4MDWEX44.js";
3
+ } from "../chunk-PB6JV62G.js";
4
4
  import {
5
5
  VIDEO_ADJUSTMENT_SCOPES,
6
6
  VIDEO_BLEND_MODES,
@@ -148,7 +148,7 @@ import {
148
148
  videoTransitionEase,
149
149
  videoValueAt,
150
150
  videoWipeRect
151
- } from "../chunk-56RFHF7O.js";
151
+ } from "../chunk-LPTFDCJO.js";
152
152
  import "../chunk-EHLOCVWB.js";
153
153
  import {
154
154
  namedWithSuggestion
@@ -157,7 +157,7 @@ import {
157
157
  EffectsSlot,
158
158
  createEffectToolProvider,
159
159
  isEffectError
160
- } from "../chunk-7DZ55AIE.js";
160
+ } from "../chunk-UGYUGZE2.js";
161
161
  import "../chunk-V2ZCJRDM.js";
162
162
  import {
163
163
  defineEditorDocument
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.226.0",
3
+ "version": "0.227.1",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -277,7 +277,7 @@ effects provider (for example Flair); without one the read tools say so and the
277
277
  | --- | --- |
278
278
  | `search_effects` | Find effects: use `generator` for fills, `overlay`, `title` or `interactive` for overlays, and `transition` for scene transitions. |
279
279
  | `describe_effect` | Read an effect's controls, ranges, defaults and presets before applying it. |
280
- | `list_applied_effects` | List the shape nodes that carry effects, with each effect's role (fill or overlay), opacity and values. |
280
+ | `list_applied_effects` | List the shape nodes that carry effects, with each effect's role (fill or overlay), opacity and values. `available` false with a `reason` means the registered provider cannot draw it (it was saved from another provider, or the provider lacks it): the node shows a hatch until you re-apply one from `search_effects`. |
281
281
  | `apply_effect` | Put an effect on a shape node: a generator fills the shape (clipped to its outline), anything else draws over its box. This replaces any effect already there. Returns the effect. |
282
282
  | `update_effect` | Change a node's effect (`effect` is "effect"): `values` (`null` resets a control), `opacity`, and `enabled` (false holds the first frame). |
283
283
  | `remove_effect` | Take the effect off a node. |
@@ -288,6 +288,7 @@ effects provider (for example Flair); without one the read tools say so and the
288
288
  ## Pitfalls
289
289
 
290
290
  - **A shape node holds one effect.** `apply_effect` replaces the effect that is there. Effects draw on shape nodes only (nodes with `data.shape`).
291
+ - **Effects belong to the provider they came from.** Each saved effect keeps its provider id. After the provider changes (another effects library), check `list_applied_effects` for `available: false` and re-apply those effects with ids from the new provider's `search_effects`; the old effect ids mean nothing to it.
291
292
 
292
293
  - **Brushes are dry only.** Wet presets (watercolour, gouache, wet oils), mixer, blender, smudge and
293
294
  eraser presets are refused: wet paint needs an area to flow in, and the others need paint under
@@ -225,6 +225,31 @@ for the controls and presets.
225
225
  - **Light on dried paint** (`apply_effect`): a filter (light, glow, grade) run on a layer's paint
226
226
  and baked in, at `opacity` strength. Transparent areas stay transparent, and thick paint keeps
227
227
  its relief and stays lit by the editor's light. Dry wet paint first (`dry_paint`).
228
+ - **Effect paint** (`set_effect_paint`): brushes paint with the effect itself; see below.
229
+
230
+ ## Effect paint
231
+
232
+ `set_effect_paint` makes a generator, overlay or title effect the paint. It is rendered once at
233
+ the canvas size, and every stroke then takes each pixel's colour from that picture, fixed to the
234
+ canvas: painting reveals a hidden image where the brush goes. Its transparency paints nothing, so
235
+ an overlay paints only where it has pixels.
236
+
237
+ 1. `search_effects` (`use` generator, overlay or title) and `describe_effect` for the controls.
238
+ 2. `set_effect_paint` with `effect`, `values` and `time` (ms, default 0). Wait for it: strokes that
239
+ would use it are refused while it renders.
240
+ 3. Paint with a dry brush: dab, particle and bristle brushes take the colour per pixel (the most
241
+ faithful), the Mixer Brush and dab brushes with `behavior.pickup` take it per dab at the dab's
242
+ centre and mix it with what they pick up. Brush opacity, flow, grain and pressure still apply.
243
+ 4. `set_color` or `set_paint` goes back to colour; `remove_effect` (target and effect `paint`)
244
+ does too, and `update_effect` (target and effect `paint`, `values`) renders new values.
245
+
246
+ When to use which:
247
+
248
+ | Want | Use |
249
+ | --- | --- |
250
+ | The effect inside brushed marks, hand-painted edges | `set_effect_paint` and a dry brush |
251
+ | The effect inside an exact shape, or in wet / thick paint | Paint the shape, dry it, then `fill_layer_with_effect` with `lockTransparency: true` |
252
+ | The effect over the whole sheet | `set_paper_effect` or `add_effect_layer` |
228
253
 
229
254
  ## Canvas-hosted layer
230
255
 
@@ -283,8 +308,8 @@ view), so work with the tools you are given.
283
308
  | Tool | Use |
284
309
  | --- | --- |
285
310
  | `mix_colors` | Predict a mix: `colors` with `weight` parts (and optional tinting `strength`), `model` `pigment` (default, Kubelka-Munk: what pigment blends, the Mixer Brush, pigment blending tools and the pad do) or `rgb` (what normal blending and rgb mixing do). Returns `mixed` by the model plus `pigment` and `rgbLerp` for comparison. Changes nothing. Use it to choose stroke colours. |
286
- | `set_color` | Set the default paint `color` (and `secondaryColor`); back to one colour after gradient paint. |
287
- | `set_paint` | Set the paint: one colour, or gradient paint (`stops`, `space`, `map`, `softness`; see Gradient paint). Errors say what is wrong (unsorted stops, a bad mapping). Returns `paint`, `color`, `secondaryColor`. |
311
+ | `set_color` | Set the default paint `color` (and `secondaryColor`); back to one colour after gradient paint or effect paint. |
312
+ | `set_paint` | Set the paint: one colour, or gradient paint (`stops`, `space`, `map`, `softness`; see Gradient paint). Ends effect paint. Errors say what is wrong (unsorted stops, a bad mapping). Returns `paint`, `color`, `secondaryColor`. |
288
313
  | `pick_color` | Read the colour at `x`, `y`: of the painting with its paper, or of one layer (with alpha). |
289
314
  | `get_mixer_brush` | Read what the brush carries: the Mixer Brush `reservoir` and `amount` left, and `pickup` (paint picked up, kept by dirty brushes). |
290
315
  | `load_mixer_brush` | Fill the Mixer Brush reservoir with a colour (keeps its pickup). |
@@ -352,13 +377,14 @@ view), so work with the tools you are given.
352
377
  | --- | --- |
353
378
  | `search_effects` | Find provider effects by `query`, `kind`, `category` and `use` (`generator` for paper and layers, `overlay` / `title` for layers and fills, `filter` for light on paint). `available: false` when no provider is registered. Call before the tools below. |
354
379
  | `describe_effect` | Read an effect's controls (types, ranges, defaults), presets and inputs. Call before passing `values`. |
355
- | `list_applied_effects` | Read the effect paper (target `paper`) and every effect layer with its effect and values; with `target`, one of them. Baked light and fills are pixels and are not listed. Works without a provider. |
380
+ | `list_applied_effects` | Read the effect paint (target `paint`), the effect paper (target `paper`) and every effect layer with its effect and values; with `target`, one of them. Baked light and fills are pixels and are not listed. Works without a provider. |
356
381
  | `apply_effect` | Light on dried paint: run a `filter` effect on a layer's paint and bake it in (`values`, `opacity` = strength 0..1). Refused on empty, wet, locked or hidden layers, with the fix. One undo step; undo takes it back. Returns the effect used and `baked: true`. |
357
- | `update_effect` | Change the effect paper (`target` and `effect` "paper": `values`, `opacity`) or draw an effect layer again (`effect` "effect": `values`; `null` resets a control). Returns the effect. |
358
- | `remove_effect` | Remove the effect paper, or turn an effect layer into a plain layer keeping its pixels (`keptPixels`). |
382
+ | `update_effect` | Change the effect paint (`target` and `effect` "paint": `values`), the effect paper (`target` and `effect` "paper": `values`, `opacity`) or draw an effect layer again (`effect` "effect": `values`; `null` resets a control). Returns the effect. |
383
+ | `remove_effect` | End the effect paint (back to the paint colour), remove the effect paper, or turn an effect layer into a plain layer keeping its pixels (`keptPixels`). |
359
384
  | `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. |
360
385
  | `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. |
361
386
  | `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. |
387
+ | `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. Call after `describe_effect`, then `paint_stroke` with a dry brush. Editor state, not an undo step. Returns `effectPaint` (`effect`, `provider`, `values`, `time`). |
362
388
 
363
389
  ### Guides
364
390
 
@@ -447,6 +473,16 @@ The host may add the shared document tools (see `pixerate-agent-tools`). A paint
447
473
  `export_high_res` start those layers empty; paint with strokes when the replay matters.
448
474
  - **Effects are pixels in replays.** Effect paper, effect layers, effect fills and baked light
449
475
  need the provider when they are made; replays and time-lapses do not repeat them. Add them
450
- after the painting, or keep the effect layer and redraw it.
476
+ after the painting, or keep the effect layer and redraw it. Effect paint is the exception:
477
+ strokes record it, and replays render it again first, so they need the same provider (an
478
+ error names the effect and provider when it is missing; `color` on `replay_strokes` repaints
479
+ in one colour instead).
480
+ - **Effect paint refuses wet, impasto and sticker brushes** (they carry one colour as pigment,
481
+ thick paint or stamps). Paint the shape, dry it, and `fill_layer_with_effect` with
482
+ `lockTransparency: true`. Erasers, blenders and smudges ignore it, and a brush with its own
483
+ gradient, a stroke `color` or `paint`, or `set_color` / `set_paint` paints colour instead.
484
+ - **Effect paint is fixed to the canvas, not the stroke**: a replayed or moved stroke shows the
485
+ part of the effect under its new place. Wait for `set_effect_paint` to return before painting;
486
+ strokes are refused while it renders.
451
487
  - **Recorded strokes are kept in saved documents** (`save_paint_document`, `get_paint_document`),
452
488
  so a painting can be replayed and repainted at a higher resolution.
@@ -62,6 +62,7 @@ This skill is the method. `pixerate-paint-editor` has the full tool reference.
62
62
  | Sketch | `pencil-hb`, light colour, own layer, hidden at the end |
63
63
  | Line art | `ink-pen` (even), `brush-pen` (swelling); own layer on top |
64
64
  | Flats | `marker` or a flat brush on a layer under the ink |
65
+ | Patterned or textured flats (sky, gradient, galaxy) | `set_effect_paint` with a provider generator, then a flat dry brush on the Flats layer; `set_color` after |
65
66
  | Shadows | Clipped layer, `multiply` or `shadow`, a cool colour |
66
67
  | Light, glow | Clipped layer, `highlight` or `screen` |
67
68
  | Warm or cool a whole area | Clipped layer in `tint` |
@@ -72,6 +73,11 @@ This skill is the method. `pixerate-paint-editor` has the full tool reference.
72
73
  **Flats under ink.** `add_layer` "Flats" → `move_layer` with the new layer's id and `index` below
73
74
  the Ink layer → `set_brush` `marker` → `set_color` → strokes inside the shape.
74
75
 
76
+ **Effect flats.** With an effects provider: `search_effects` (`use` generator) → `describe_effect`
77
+ → `set_effect_paint` → `marker` strokes inside the shape on the Flats layer (the effect shows
78
+ where the brush goes, fixed to the canvas) → `set_color` to go back to plain colour. Wet,
79
+ impasto and sticker brushes refuse effect paint.
80
+
75
81
  **Clipped shading.** `add_layer` "Shading" above Flats → `update_layer` `{ blend: "multiply",
76
82
  clipped: true }` → `set_brush` `airbrush` → paint the shadow side.
77
83
 
@@ -92,6 +98,7 @@ clipped: true }` → `set_brush` `airbrush` → paint the shadow side.
92
98
  - `set_paper`, `fill_layer`: the ground and backgrounds
93
99
  - `add_layer`, `update_layer`, `move_layer`, `remove_layer`: one layer per pass; hide, clip, blend
94
100
  - `set_brush`, `set_color`, `paint_stroke`, `replay_strokes`: sketch, ink, flats and shading
101
+ - `search_effects`, `describe_effect`, `set_effect_paint`: flats painted with a provider effect
95
102
  - `set_symmetry`, `set_perspective_guide`, `set_tracing_image`: construction guides
96
103
  - `undo_paint`: take back a step
97
104
  - `export_image`, `export_psd`: deliver