@pixerate/editor 0.113.0 → 0.114.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 (124) hide show
  1. package/THIRD_PARTY_NOTICES.md +5 -0
  2. package/dist/animation-editor/index.cjs +60 -54
  3. package/dist/animation-editor/index.cjs.map +1 -1
  4. package/dist/animation-editor/index.d.cts +3 -3
  5. package/dist/animation-editor/index.d.ts +3 -3
  6. package/dist/animation-editor/index.js +14 -8
  7. package/dist/animation-editor/index.js.map +1 -1
  8. package/dist/builtin-CY97ppKM.d.cts +354 -0
  9. package/dist/builtin-CY97ppKM.d.ts +354 -0
  10. package/dist/canvas/index.cjs +3 -3
  11. package/dist/canvas/index.cjs.map +1 -1
  12. package/dist/canvas/index.js +9 -9
  13. package/dist/chunk-26PGXHY7.cjs +753 -0
  14. package/dist/chunk-26PGXHY7.cjs.map +1 -0
  15. package/dist/chunk-2OJACTPR.cjs +929 -0
  16. package/dist/chunk-2OJACTPR.cjs.map +1 -0
  17. package/dist/chunk-3UFGNHSP.js +929 -0
  18. package/dist/chunk-3UFGNHSP.js.map +1 -0
  19. package/dist/{chunk-YGIMK4NX.cjs → chunk-5OVJHMZQ.cjs} +757 -825
  20. package/dist/chunk-5OVJHMZQ.cjs.map +1 -0
  21. package/dist/chunk-643B2HKC.cjs +534 -0
  22. package/dist/chunk-643B2HKC.cjs.map +1 -0
  23. package/dist/chunk-6FCKOS2B.js +534 -0
  24. package/dist/chunk-6FCKOS2B.js.map +1 -0
  25. package/dist/chunk-BRLYOPLT.js +2574 -0
  26. package/dist/chunk-BRLYOPLT.js.map +1 -0
  27. package/dist/{chunk-LQEEDHOP.js → chunk-C6C5PDKU.js} +759 -761
  28. package/dist/chunk-C6C5PDKU.js.map +1 -0
  29. package/dist/{chunk-4KLT7ZYS.cjs → chunk-DFQEX3AM.cjs} +29 -29
  30. package/dist/{chunk-4KLT7ZYS.cjs.map → chunk-DFQEX3AM.cjs.map} +1 -1
  31. package/dist/{chunk-CZOXTEMN.js → chunk-EUVSQ25B.js} +336 -404
  32. package/dist/chunk-EUVSQ25B.js.map +1 -0
  33. package/dist/chunk-G5NMLUVF.cjs +2574 -0
  34. package/dist/chunk-G5NMLUVF.cjs.map +1 -0
  35. package/dist/{chunk-LPYOIVLA.js → chunk-LKCYANMW.js} +3 -3
  36. package/dist/{chunk-W3GXSUSQ.cjs → chunk-LPLCWZTM.cjs} +5087 -1283
  37. package/dist/chunk-LPLCWZTM.cjs.map +1 -0
  38. package/dist/chunk-MMVHBKMM.js +753 -0
  39. package/dist/chunk-MMVHBKMM.js.map +1 -0
  40. package/dist/{chunk-POGBUYWE.cjs → chunk-ST7E3NEE.cjs} +857 -859
  41. package/dist/chunk-ST7E3NEE.cjs.map +1 -0
  42. package/dist/{chunk-7VOHOPLW.cjs → chunk-TCKIXI46.cjs} +59 -59
  43. package/dist/{chunk-7VOHOPLW.cjs.map → chunk-TCKIXI46.cjs.map} +1 -1
  44. package/dist/{chunk-XIOMMGPD.cjs → chunk-TFOPHZ3U.cjs} +1 -1
  45. package/dist/chunk-TFOPHZ3U.cjs.map +1 -0
  46. package/dist/{chunk-Z4BC6M74.js → chunk-UBIXVXPR.js} +2 -2
  47. package/dist/{chunk-BLWCAQCW.js → chunk-VXR7XWMF.js} +4574 -770
  48. package/dist/chunk-VXR7XWMF.js.map +1 -0
  49. package/dist/{chunk-HNS7UHCM.js → chunk-XK5LZKBD.js} +1 -1
  50. package/dist/chunk-XK5LZKBD.js.map +1 -0
  51. package/dist/cms/index.cjs +146 -0
  52. package/dist/cms/index.cjs.map +1 -0
  53. package/dist/cms/index.d.cts +51 -0
  54. package/dist/cms/index.d.ts +51 -0
  55. package/dist/cms/index.js +146 -0
  56. package/dist/cms/index.js.map +1 -0
  57. package/dist/{export-DIkoK8-r.d.ts → export-_1dUKwpF.d.ts} +217 -191
  58. package/dist/{export-CEXEzqBf.d.cts → export-b6NjCZ5-.d.cts} +217 -191
  59. package/dist/image-editor/index.cjs +1779 -1280
  60. package/dist/image-editor/index.cjs.map +1 -1
  61. package/dist/image-editor/index.d.cts +77 -93
  62. package/dist/image-editor/index.d.ts +77 -93
  63. package/dist/image-editor/index.js +740 -241
  64. package/dist/image-editor/index.js.map +1 -1
  65. package/dist/opentype-BZEOSOX3.d.ts +188 -0
  66. package/dist/opentype-Dpe75vL5.d.cts +188 -0
  67. package/dist/paint/index.cjs +4 -4
  68. package/dist/paint/index.d.cts +2 -2
  69. package/dist/paint/index.d.ts +2 -2
  70. package/dist/paint/index.js +3 -3
  71. package/dist/paint-editor/index.cjs +146 -145
  72. package/dist/paint-editor/index.cjs.map +1 -1
  73. package/dist/paint-editor/index.d.cts +9 -8
  74. package/dist/paint-editor/index.d.ts +9 -8
  75. package/dist/paint-editor/index.js +6 -5
  76. package/dist/paint-editor/index.js.map +1 -1
  77. package/dist/raster/index.cjs +53 -3
  78. package/dist/raster/index.cjs.map +1 -1
  79. package/dist/raster/index.d.cts +62 -91
  80. package/dist/raster/index.d.ts +62 -91
  81. package/dist/raster/index.js +59 -9
  82. package/dist/{render-BEriFuqK.d.cts → render-B1K_OoLy.d.cts} +87 -2
  83. package/dist/{render-tjzKaik-.d.ts → render-CrmHOgpo.d.ts} +87 -2
  84. package/dist/{retouch-CEIKR22W.d.cts → retouch-Bxkuc0KH.d.cts} +1 -1
  85. package/dist/{retouch-BXmeSCaB.d.ts → retouch-Do6tBs2H.d.ts} +1 -1
  86. package/dist/{surface-C8RRg_Bh.d.cts → surface-Cn30xIV6.d.cts} +6 -1
  87. package/dist/{surface-C8RRg_Bh.d.ts → surface-Cn30xIV6.d.ts} +6 -1
  88. package/dist/{svg-D_cfkhlB.d.cts → svg-BnRj0q8i.d.cts} +16 -4
  89. package/dist/{svg-wIaKLrU0.d.ts → svg-CmmBFfGT.d.ts} +16 -4
  90. package/dist/{types-DtL_qLFz.d.ts → types-1SUQKDAw.d.ts} +273 -4
  91. package/dist/{types-DyQq-WPY.d.cts → types-yINF17Ta.d.cts} +273 -4
  92. package/dist/vector/index.cjs +12170 -7343
  93. package/dist/vector/index.cjs.map +1 -1
  94. package/dist/vector/index.d.cts +1579 -16
  95. package/dist/vector/index.d.ts +1579 -16
  96. package/dist/vector/index.js +6303 -1476
  97. package/dist/vector/index.js.map +1 -1
  98. package/dist/warp-B39VsOtd.d.cts +348 -0
  99. package/dist/warp-DMN30aY6.d.ts +348 -0
  100. package/dist/zlib-dxQdgHyN.d.cts +95 -0
  101. package/dist/zlib-dxQdgHyN.d.ts +95 -0
  102. package/package.json +6 -1
  103. package/skills/pixerate-image-editor/SKILL.md +12 -36
  104. package/skills/pixerate-image-editor/references/color-management.md +37 -0
  105. package/skills/pixerate-image-editor/references/photoshop-files.md +39 -0
  106. package/skills/pixerate-vector/SKILL.md +54 -2
  107. package/dist/chunk-BLWCAQCW.js.map +0 -1
  108. package/dist/chunk-CZOXTEMN.js.map +0 -1
  109. package/dist/chunk-HNS7UHCM.js.map +0 -1
  110. package/dist/chunk-JLYX4V57.cjs +0 -2001
  111. package/dist/chunk-JLYX4V57.cjs.map +0 -1
  112. package/dist/chunk-KB2YBCVS.js +0 -2001
  113. package/dist/chunk-KB2YBCVS.js.map +0 -1
  114. package/dist/chunk-LQEEDHOP.js.map +0 -1
  115. package/dist/chunk-POGBUYWE.cjs.map +0 -1
  116. package/dist/chunk-W3GXSUSQ.cjs.map +0 -1
  117. package/dist/chunk-XIOMMGPD.cjs.map +0 -1
  118. package/dist/chunk-YGIMK4NX.cjs.map +0 -1
  119. package/dist/homography-CZ-tFjay.d.cts +0 -50
  120. package/dist/homography-Ctfjoc1b.d.ts +0 -50
  121. package/dist/warp-CWHZzE3x.d.ts +0 -118
  122. package/dist/warp-D5jz_tN7.d.cts +0 -118
  123. /package/dist/{chunk-LPYOIVLA.js.map → chunk-LKCYANMW.js.map} +0 -0
  124. /package/dist/{chunk-Z4BC6M74.js.map → chunk-UBIXVXPR.js.map} +0 -0
@@ -0,0 +1,39 @@
1
+ # Photoshop files
2
+
3
+ 1. **Inspect before opening.** `inspect_psd` lists every layer with the type it would become and
4
+ a status: `mapped` (held exactly), `approximated` (type, fill and shape layers come in as their
5
+ stored pixels; linked smart objects as their stored pixels; Photoshop smart filters other than
6
+ Box Blur are kept but not drawn; Dissolve becomes Normal; effects with gradient midpoints or
7
+ smoothness, noise gradients, glow jitter, legacy bevels or patterns missing from the file are
8
+ drawn approximately) or
9
+ `dropped` (Brightness/Contrast, Exposure, Channel Mixer, Gradient Map, Selective Color and
10
+ Color Lookup adjustments). Tell the user what would be lost before `import_psd` when anything
11
+ is not `mapped`.
12
+ 2. **Layer effects come in live**: every Photoshop layer style maps to an effect you can read
13
+ with `list_layer_effects` and change as usual, with the file's patterns (listed in
14
+ `list_layer_effects.patterns`) and its global light. An effects block the editor cannot read
15
+ is kept and written back by `export_psd`, but not drawn; the warnings say so.
16
+ 3. **`import_psd` replaces the document** (one undo step). 16- and 32-bit files keep their
17
+ depth (`get_image_info.bitDepth`); CMYK, Lab, grayscale and indexed files are converted to
18
+ RGB; an RGB file's ICC profile becomes the document's colour profile. The warnings say what
19
+ changed. `export_psd` writes at the document's depth and embeds its profile. Change the depth
20
+ with `set_bit_depth`: 16-bit for smooth gradients and strong grades, 32-bit for linear-light
21
+ HDR (layers blend in linear light there). Adjustment layers, blend modes, merges and the
22
+ exported merged image keep the depth; layer effects, layer filters, painting and transforms
23
+ still work in 8 bits on what they change, so grade a deep file with adjustment layers rather
24
+ than repainting it when the depth matters. Afterwards work with `list_layers` as usual: there
25
+ is no Background source image, every pixel comes from the layers.
26
+ 4. **Smart objects come in live**: embedded contents (a PSB opens as a nested document you can
27
+ edit with `edit_smart_object_contents`, a PNG as raster contents), the placement and warp, the
28
+ smart filters and the filter mask; the layer shows Photoshop's own pixels until you change it.
29
+ JPEG, TIFF and SVG contents are decoded only in a browser, so elsewhere such a smart object
30
+ cannot be transformed (the error says so). Photoshop filters we do not model stay in the list
31
+ (kind `psd`): hide, reorder, re-blend or remove them, and `export_psd` writes them back.
32
+ 5. **`export_psd` writes the stack as it is**, in the source frame: crop and rotation are not
33
+ applied, layer filters and depth masks are baked, annotation layers are rasterized (only in
34
+ a browser). Effects are written as Photoshop layer styles: an effects block opened from a PSD
35
+ goes back byte for byte while its effects are unchanged, and the patterns effects use (the
36
+ built-in ones too) are embedded. Only the first outer glow, inner glow, bevel, satin and
37
+ pattern overlay of a layer fit in a PSD. Smart objects are written as smart objects (an
38
+ unchanged one byte for byte); a Develop smart filter has no Photoshop filter and is left out of
39
+ the list (the pixels still show it). Read its `warnings` and pass them on. The file comes back as base64 (`data`).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pixerate-vector
3
- description: How to draw and edit vector artwork in the Pixerate vector editor through its vector.* commands - adding shapes and SVG paths, text (point, area, on a path, styles, Create Outlines), symbols and instances, CAD constraints (parallel, tangent, dimensions, auto-constrain), fills, strokes, stacked fills and strokes with blend modes, drop shadows, glows and blurs, clipping masks and opacity masks, gradients (linear, radial, conic, Oklab interpolation), stroke alignment, arrowheads, variable-width and tapered strokes, live corner radii, boolean operations and Pathfinder (unite, subtract, divide, trim), Shape Builder, paint bucket, live path effects (trim paths, repeater, zig zag, offset), envelope warps and free distort, blends and morphing, anchor editing (join, smooth, simplify, scissors, knife, eraser), align, distribute, group, stacking order, and SVG import and export. Use when creating an icon, logo, illustration, glyph, badge or any Bezier path artwork, or editing an SVG in a Pixerate vector editor.
3
+ description: How to draw and edit vector artwork in the Pixerate vector editor through its vector.* commands - adding shapes and SVG paths, text (point, area, on a path, styles, Create Outlines), symbols and instances, CAD constraints (parallel, tangent, dimensions, auto-constrain), artboards and frames with resizing constraints, connectors, fills, strokes, stacked fills and strokes with blend modes, drop shadows, glows and blurs, clipping masks and opacity masks, gradients (linear, radial, conic, Oklab), stroke alignment, arrowheads, variable-width and tapered strokes, live corner radii, boolean operations and Pathfinder (unite, subtract, divide, trim), Shape Builder, paint bucket, path effects (trim, repeater, zig zag, offset), envelope warps and free distort, blends and morphing, anchor editing (join, smooth, simplify, knife, eraser), align, distribute, group, and SVG import and export. Use when creating an icon, logo, illustration, glyph, badge or any Bezier path artwork, or editing an SVG in a Pixerate vector editor.
4
4
  ---
5
5
 
6
6
  # Pixerate vector editor
@@ -38,6 +38,14 @@ carry a live effect stack. Every command is a `vector.*` command run with `run_c
38
38
  (`vector.editSymbol` … `vector.exitSymbolEdit`) changes every instance.
39
39
  - **Constraints** (CAD-style) keep geometric relations and dimensions between anchors, segments
40
40
  and round paths; they are solved after every edit, so later moves keep them.
41
+ - **Frames** are groups with a `frame` rectangle (`vector.listFrames`): they draw a background,
42
+ clip their children and select by their rectangle; top-level frames are **artboards**. When a
43
+ frame is resized its children follow their **resizing constraints** (horizontal `left` /
44
+ `right` / `leftRight` / `center` / `scale`, vertical `top` / `bottom` / `topBottom` / `center` /
45
+ `scale`) instead of scaling.
46
+ - **Connectors** are open paths with a `connector` whose ends are glued to other objects' sites
47
+ (the middle of a side, or the centre); they are routed again after every edit, so they follow
48
+ what they connect. A free end stays where it is.
41
49
  - Coordinates are document units. A rotated node stores its geometry in its own space: the
42
50
  `bounds` that `vector.list` reports are document-space, its `d` is the node's own.
43
51
 
@@ -64,6 +72,17 @@ Parameter details (gradient fields, effect parameters, width profiles, envelopes
64
72
 
65
73
  ## Best practices
66
74
 
75
+ - **Diagrams with connectors.** Lay the boxes out first, then `vector.connect` them (in one
76
+ `run_commands` batch) rather than drawing lines: connectors stay attached when boxes move, and
77
+ `route: "elbow"` with a small `radius` reads well in flowcharts. Leave sides `auto` unless a
78
+ connector must leave a particular side.
79
+
80
+ - **Frames for anything that resizes.** Build screens, cards, buttons and banners inside a frame
81
+ (`vector.addFrame` or `vector.frameSelection`), set each child's constraints with
82
+ `vector.setResizing` (backgrounds and dividers `leftRight`, icons pinned to their corner, titles
83
+ `center`), then resize with `vector.setFrame` to produce other sizes from one design. Export each
84
+ artboard with `vector.exportFrameSvg`.
85
+
67
86
  - **Constraints for precise, editable geometry.** For technical drawings, diagrams, floor plans or
68
87
  any shape that must keep exact relations, draw it roughly, run `vector.autoConstrain`, then add
69
88
  the dimensions that matter (`vector.addConstraint` distance / angle / radius) and name them so
@@ -151,6 +170,7 @@ Parameter details (gradient fields, effect parameters, width profiles, envelopes
151
170
 
152
171
  | Command | Use it to |
153
172
  | --- | --- |
173
+ | `vector.addPathByDimensions` | Draw a path the way a CAD user types it: from `start`, each step `{ length, angle }` (degrees counter-clockwise on the page: 0 right, 90 up), `{ dx, dy }` or `{ x, y }`; `closed` joins the ends. Use it for exact technical outlines (brackets, floor plans, given lengths and angles) instead of computing coordinates by hand. Returns `{ id, anchors }`. |
154
174
  | `vector.addShape` | Add a `kind` `rect`, `ellipse`, `polygon` (`sides`, at least 3), `star` (`points`, `innerRatio` 0 to 1) or `line` at `x`, `y`, `width`, `height` (all required; for a line, width and height are the end's offset). `cornerRadius` and `cornerKind` give live corners; any style field and `name` apply. Uses the editor's default style for anything not given. Returns `{ id }`. |
155
175
  | `vector.addPath` | Add a path from SVG path data `d` (absolute or relative M, L, H, V, C, S, Q, T, A, Z; arcs and quadratics become cubics) in document units, with `name` and style fields; unset style comes from the editor defaults. Fails when `d` has no points. Returns `{ id }`. |
156
176
  | `vector.importSvg` | Add the shapes of SVG markup `svg` on top of the document, or replace the document with `replace: true`. Reads paths, basic shapes, groups, transforms, linear and radial gradients, `clip-path` / `mask` references (as mask groups) `<text>` (as point text: content, font, anchor and fill) and `<use>` (as instances of symbols made from what they refer to); skips images and foreign filters. |
@@ -256,6 +276,26 @@ the browser's shaper they are kept but not drawn until outlines are available.
256
276
  | `vector.setConstraintValue` | Set a dimension's value (by id or name) or a named parameter (`null` removes a parameter); values are expressions. Returns the summary. |
257
277
  | `vector.autoConstrain` | Add what a sketch nearly satisfies (tolerances `distanceTolerance`, `angleTolerance`), skipping redundant or conflicting candidates. Returns `{ ids }`. |
258
278
 
279
+ ### Frames and artboards
280
+
281
+ | Command | Use it to |
282
+ | --- | --- |
283
+ | `vector.listFrames` | Read every frame: id, name, parent, whether it is an artboard (top-level), its rectangle, fill and clip, document bounds, and its children's resizing constraints. Call before resizing or exporting frames. |
284
+ | `vector.addFrame` | Add an empty artboard at `x, y, width, height` (white unless `fill`; `adopt: true` takes in the top-level objects it encloses). Use for screens, cards, pages and export areas. Returns the frame as listed. |
285
+ | `vector.frameSelection` | Put objects sharing a parent into a frame fitted to their bounds plus `padding` (no fill unless given), in their place. Use to turn finished art into a resizable component. Returns the frame as listed. |
286
+ | `vector.setFrame` | Move or resize a frame's rectangle (`x`, `y`, `width`, `height`; children follow their constraints) or change its `fill` / `clip`. Returns `{ frames }`. Set the children's constraints first. |
287
+ | `vector.setResizing` | Set how children of a frame follow it on resize (`horizontal`, `vertical`; a missing axis keeps its value). Fails on objects not directly inside a frame. Returns `{ nodes: [{ id, horizontal, vertical }] }`. |
288
+ | `vector.exportFrameSvg` | Export one frame as an SVG of its own size (its corner at the origin). Returns `{ svg, width, height }`; use it per artboard instead of `vector.exportSvg`. |
289
+
290
+ ### Connectors
291
+
292
+ | Command | Use it to |
293
+ | --- | --- |
294
+ | `vector.connect` | Join two objects (or free points) with a connector: `start` / `end` as `{ nodeId, side? }` (side `auto` by default: the side facing the other end) or `{ x, y }`, `route` straight / elbow / curved, elbow `radius`, `gap`, stroke and arrowheads (a triangle at the end by default). Use for flowcharts and diagrams instead of drawing lines. Returns the connector as listed. |
295
+ | `vector.setConnector` | Reglue an end (`{ nodeId, side? }`), unglue it (`null`), or change `route`, `radius`, `gap`; also turns a plain open path into a connector. Returns `{ connectors }`. |
296
+ | `vector.listConnectors` | Read every connector: route and each end's glued object, side setting, side in use and position. |
297
+ | `vector.listConnectionSites` | Read an object's sites (top, right, bottom, left, centre) with positions and outward normals, to pick a `side`. |
298
+
259
299
  ### Masks and clipping
260
300
 
261
301
  | Command | Use it to |
@@ -310,10 +350,22 @@ contents whole while you work, without losing the mask.
310
350
  | Command | Use it to |
311
351
  | --- | --- |
312
352
  | `vector.setEditing` | Set editing behaviour: `keepShapeOnDelete`, `curvatureMoves`, `pencilSmoothing` (0 to 1), `recognizeShapes`, `eraserSize`, `pencilPressure` (pen, all, off). Returns the settings. |
313
- | `vector.setTool` | Switch the interactive tool (select, direct, pen, pencil, rect, ellipse, polygon, star, line, scissors, knife, eraser, width, shapeBuilder, paintBucket, blend, gradient, envelope, type, typePath). Only for handing the canvas to the user in a given mode; commands do not need a tool. |
353
+ | `vector.getSnapOptions` | Read how drawing snaps for people at the pointer: grid, objects, guides, threshold, polar `angles`, object snap `tracking`, `trackPolar`, `polarRelative`. |
354
+ | `vector.setSnapOptions` | Set those options, e.g. `polarIncrement: 15` for 15° polar tracking, or a grid, before handing the canvas to the user. Moves nothing. Returns the options. |
355
+ | `vector.setTool` | Switch the interactive tool (select, direct, pen, pencil, rect, ellipse, polygon, star, line, scissors, knife, eraser, width, shapeBuilder, paintBucket, blend, gradient, envelope, type, typePath, frame, connector). Only for handing the canvas to the user in a given mode; commands do not need a tool. |
314
356
 
315
357
  ## Pitfalls
316
358
 
359
+ - A connector's geometry is regenerated after every edit while an end is glued: editing its
360
+ anchors directly does not stick. Unglue the end (`vector.setConnector` with `null`) or change
361
+ `route` instead. Connectors cannot be glued to connectors.
362
+
363
+ - Scaling a frame (`vector.scale`, the selection handles) lays its children out by their
364
+ constraints, so it is a resize, not a zoom; group the frame (or scale its children) to scale the
365
+ art itself. A frame clips by default: objects moved outside it disappear (`clip: false` shows
366
+ them). Moving an object over a frame does not put it inside; use `vector.frameSelection` or
367
+ `adopt`.
368
+
317
369
  - The `d` in `vector.list` draws live corners cut, which adds anchors. On a path with corner
318
370
  radii, anchor indices counted from `d` do not match the stored anchors; count anchors on a path
319
371
  without corners, or clear corners first.