@pixerate/editor 0.227.0 → 0.228.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/dist/agent/index.cjs +3 -3
  2. package/dist/agent/index.js +2 -2
  3. package/dist/animation-editor/index.cjs +9 -9
  4. package/dist/animation-editor/index.js +1 -1
  5. package/dist/canvas/drawController.d.cts +6 -0
  6. package/dist/canvas/drawController.d.ts +6 -0
  7. package/dist/canvas/effects.d.cts +18 -0
  8. package/dist/canvas/effects.d.ts +18 -0
  9. package/dist/canvas/gestures.d.cts +87 -0
  10. package/dist/canvas/gestures.d.ts +87 -0
  11. package/dist/canvas/index.cjs +56 -9
  12. package/dist/canvas/index.d.cts +1 -0
  13. package/dist/canvas/index.d.ts +1 -0
  14. package/dist/canvas/index.js +50 -3
  15. package/dist/{chunk-ABQ2VGUB.cjs → chunk-5MQOBTNP.cjs} +13 -2
  16. package/dist/{chunk-53GOGBTM.cjs → chunk-CHAWTXBE.cjs} +243 -39
  17. package/dist/{chunk-C6CMQXMI.cjs → chunk-IGPEBXUD.cjs} +7 -7
  18. package/dist/{chunk-4PA6YS6W.cjs → chunk-K5GXW5TR.cjs} +14 -14
  19. package/dist/{chunk-7KZ2HKKC.js → chunk-LPFQHVCO.js} +244 -1
  20. package/dist/{chunk-56RFHF7O.js → chunk-LPTFDCJO.js} +1 -1
  21. package/dist/{chunk-4MDWEX44.js → chunk-PB6JV62G.js} +1 -1
  22. package/dist/{chunk-4EFNS2HV.cjs → chunk-T7QSEKDY.cjs} +248 -5
  23. package/dist/{chunk-7DZ55AIE.js → chunk-UGYUGZE2.js} +13 -2
  24. package/dist/{chunk-ZPJEH456.js → chunk-XVIK73LS.js} +206 -2
  25. package/dist/commands/agentTools.d.cts +14 -0
  26. package/dist/commands/agentTools.d.ts +14 -0
  27. package/dist/commands/builtins.d.cts +11 -1
  28. package/dist/commands/builtins.d.ts +11 -1
  29. package/dist/commands/index.cjs +23 -9
  30. package/dist/commands/index.js +17 -3
  31. package/dist/effects/index.cjs +44 -44
  32. package/dist/effects/index.js +2 -2
  33. package/dist/image-editor/index.cjs +13 -13
  34. package/dist/image-editor/index.js +1 -1
  35. package/dist/paint-editor/index.cjs +7 -7
  36. package/dist/paint-editor/index.js +2 -2
  37. package/dist/vector/index.cjs +6 -6
  38. package/dist/vector/index.js +1 -1
  39. package/dist/video-editor/index.cjs +309 -309
  40. package/dist/video-editor/index.js +3 -3
  41. package/package.json +1 -1
  42. package/skills/pixerate-agent-tools/SKILL.md +5 -0
  43. package/skills/pixerate-canvas/SKILL.md +41 -2
@@ -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.227.0",
3
+ "version": "0.228.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -165,6 +165,11 @@ Never repeat an identical failing call. Never work around a read-only refusal; t
165
165
  | `run_commands` | Run several commands in order as `steps`. A param string `"$0.id"` or `"$last.id"` is replaced by that path of an earlier step's result, so a step can use an id an earlier step created. Pass `atomic: true` and a `label` to make the batch one undo step that rolls back entirely on failure; without it, steps before a failure stay applied. |
166
166
  | `say` | Optional; only where the host shows your cursor. Put one short sentence (`text`, at most 200 characters) in the bubble beside your cursor so the user can follow why you are about to change something. Returns `shown` and the `surface` it appeared on (`shown: false`, `surface: null` when no cursor is on screen, which is not an error). Call it after a write on that editor, before the next one. Changes nothing. |
167
167
 
168
+ Some hosts also list chosen commands as tools of their own (for example `commands__canvas_circle`
169
+ for `canvas.circle`), with the command's params as the tool's arguments and its description. Call
170
+ those directly: they run the same command, are refused with the same reasons, and save a
171
+ `list_commands` round trip.
172
+
168
173
  ## Commands
169
174
 
170
175
  These history commands are registered wherever a host shares a history with its command
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pixerate-canvas
3
- description: How to build and edit a Pixerate design canvas or node graph through its agent tools - drawing freehand pen, highlighter and dry-brush strokes (canvas.drawFreehand), adding, connecting, updating and laying out nodes (canvas_add_node, canvas_layout), reading state with get_editor_state and looking at it with view_editor, reusable components with variants, instances and overrides (create_component, add_variant, set_instance_properties), align, distribute, lock and layer order, shape boolean operations (unite, subtract, offset path, outline stroke), auto layout frames, and keyframe animation with easing and CSS export. Use when working on a canvas, whiteboard, flow chart, node graph, frame, design system, component library, button variants, layout, alignment, z-order or a canvas animation in a Pixerate editor.
3
+ description: How to build and edit a Pixerate design canvas or node graph through its agent tools - drawing freehand pen, highlighter and dry-brush strokes (canvas.drawFreehand), annotating with hand-drawn circles, underlines, arrows, brackets, strikes, crosses and ticks (canvas.circle, canvas.arrow), adding, connecting, updating and laying out nodes (canvas_add_node, canvas_layout), reading state with get_editor_state and looking at it with view_editor, reusable components with variants, instances and overrides (create_component, add_variant, set_instance_properties), align, distribute, lock and layer order, shape boolean operations (unite, subtract, offset path, outline stroke), auto layout frames, and keyframe animation with easing and CSS export. Use when working on a canvas, whiteboard, flow chart, node graph, frame, design system, component library, button variants, layout, alignment, z-order or a canvas animation in a Pixerate editor.
4
4
  ---
5
5
 
6
6
  # Pixerate canvas
@@ -90,6 +90,21 @@ the pitfalls, and uses the tools below.
90
90
  pen are clean, the airbrush is a soft spray. The grain and jitter are seeded per stroke, so a
91
91
  stroke always looks the same, and neighbouring strokes share one sheet of paper. Pick the brush
92
92
  for the look, then the colour; for a sketch, use one or two brushes rather than all of them.
93
+ - **Annotate with gestures, not points.** To mark up work the way a designer marks up a print,
94
+ use the gesture commands (`canvas.circle`, `canvas.underline`, `canvas.arrow`,
95
+ `canvas.bracket`, `canvas.strike`, `canvas.cross`, `canvas.check`) with node ids
96
+ (`{ "nodeId": "..." }`) or boxes, rather than working out points for `canvas.drawFreehand`. One
97
+ call draws one hand-drawn mark. An annotation helps when you are pointing at something on the
98
+ canvas while you talk about it: circle the pick, underline the line that matters, draw an
99
+ arrow from a swatch to where it is used, bracket a group you are describing, strike or cross
100
+ out a rejected option, tick an approved one. Skip it when nothing on the canvas is being
101
+ referred to, and keep it to a few marks per point: a page covered in marks says nothing.
102
+ - **Gesture style.** Use one colour for one review pass (a red or a strong blue pen reads as
103
+ markup over most designs), the highlighter only for circles and underlines, and the same
104
+ `brush` (`marker` or `ink-pen`) for every mark of a pass if you want them to look hand-drawn.
105
+ Marks are seeded by their request, so asking again draws the same mark; pass another `seed`
106
+ for a different take. Put a margin note (a text node) beside a bracket or at an arrow's tail
107
+ when the mark needs words.
93
108
 
94
109
  ## Tool reference
95
110
 
@@ -215,7 +230,25 @@ character: seeded jitter and the paper grain they catch) and, when a width was c
215
230
  | Command | Use it to |
216
231
  | --- | --- |
217
232
  | `canvas.drawFreehand` | Draw a pen or highlighter stroke through `points` (`[x, y]` pairs in canvas units, in drawing order; one undo step). `tool` picks the defaults (`pen`: blue, width 3; `highlighter`: yellow, width 24, opacity 0.35); `color`, `width`, `opacity` override them (with a `brush`, `width` is the brush diameter and defaults to the preset's own size). Pass `brush` (a preset id from `canvas.listBrushes`, or tip settings) to paint it with a dry brush, plus `pressure` / `tiltX` / `tiltY` profiles spread along its length (`[0.2, 1, 0.3]` swells in the middle). Add `paint` (only with `brush`) for gradient paint that changes colour along the stroke: `{ "type": "gradient", "stops": [...], "map": { "by": "distance", "length": 200 } }` (length in canvas units), or `by` `pressure`, `tilt`, `direction`, `across-tip`, `random`. Returns the node `id`, its `bounds` and the stored `brush` (with `paint` normalised: defaults filled in, colours lowercased). |
218
- | `canvas.listBrushes` | Read-only: the dry paint presets `canvas.drawFreehand` accepts as `brush` (`id`, `name`, `category`, the preset's own `size`, which a stroke uses unless you pass `width`). Call it before the first brushed stroke instead of guessing ids. |
233
+ | `canvas.listBrushes` | Read-only: the dry paint presets `canvas.drawFreehand` and the gestures accept as `brush` (`id`, `name`, `category`, the preset's own `size`, which a stroke uses unless you pass `width`). Call it before the first brushed stroke instead of guessing ids. |
234
+
235
+ Gestures draw one hand-drawn stroke node each (one undo step) through the same path as
236
+ `canvas.drawFreehand`, and the agent's cursor traces them. Targets are boxes
237
+ `{ x, y, width, height }` in canvas units, nodes `{ nodeId }` (where the host can look nodes up)
238
+ or, where noted, points `[x, y]`. Every gesture also takes `tool`, `color`, `width`, `opacity`,
239
+ `brush` (brushed marks get an uneven hand pressure) and `seed` (default: derived from the
240
+ request). Each returns the node `id`, its `bounds`, the `brush` when brushed and the `seed` used;
241
+ pass the `id` to `canvas_remove_nodes` (or undo) to take a mark away.
242
+
243
+ | Command | Use it to |
244
+ | --- | --- |
245
+ | `canvas.circle` | Circle the pick or the subject: `around` is a list of boxes or nodes, ringed together by a loose, slightly open ellipse that never cuts into them; `padding` (default 8) widens it. |
246
+ | `canvas.underline` | Stress a line of text or a value: a stroke just under `under`'s bottom edge (`offset`, default 4), a little longer or shorter than it; `wave: true` for a squiggle. |
247
+ | `canvas.arrow` | Point from one thing to another (a swatch to where it is used, a note to its subject): `from` and `to` are boxes, nodes or points; boxes are reached at their nearest edge, `gap` (default 6) clear of it. `curve` −1..1 bends the shaft (0 straight). Ends that overlap are refused. |
248
+ | `canvas.bracket` | Group items or a range of lines: a curly (default) or `shape: "square"` bracket on one `side` (`left`, `right`, `top`, `bottom`) of `around`, spanning them end to end, `padding` (default 8) away; `depth` sets how far it reaches out. Add a note beside it. |
249
+ | `canvas.strike` | Strike a line through the middle of `over` (text or a value to drop). It only marks it; nothing is deleted. |
250
+ | `canvas.cross` | Cross out a rejected option with an X over `over`. One stroke, so the pen runs back over part of the first diagonal. Nothing is deleted. |
251
+ | `canvas.check` | Tick an approved option or a done item: `at` is a box or node (ticked in its middle) or a point; `size` is the tick's height (default from the box, 20 at a point). |
219
252
 
220
253
  ### Components (command form)
221
254
 
@@ -301,6 +334,12 @@ effects provider (for example Flair); without one the read tools say so and the
301
334
  length near the stroke's to go from one end to the other once.
302
335
  - A canvas gradient in `color` does not reach the brush: a brushed stroke with a gradient
303
336
  `color` and no `paint` uses its first stop. Pass `paint` instead.
337
+ - **Gestures need a lookup for node ids.** Where the host's draw target has no `nodeBounds`, a
338
+ `{ nodeId }` target is refused with that reason: pass the node's box from `get_editor_state`.
339
+ A point is refused where a box is needed (`around`, `under`, `over`).
340
+ - **Gestures are marks, not edits.** A strike or a cross does not delete or change the node under
341
+ it, and a mark does not move with the node; take it away (`canvas_remove_nodes` with its `id`)
342
+ and draw it again after moving things.
304
343
  - **Shape operations drop the brush.** Unite, subtract, offset path and outline stroke turn
305
344
  brushed strokes into plain filled or stroked paths.
306
345
  - `canvas_*` tools validate ids against the current state; an "Unknown node id" error means call