@pixerate/editor 0.248.0 → 0.249.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 (89) hide show
  1. package/README.md +1 -0
  2. package/dist/animation-editor/index.cjs +64 -61
  3. package/dist/animation-editor/index.js +8 -5
  4. package/dist/{brushstrokeRender-DTDPFBLC.cjs → brushstrokeRender-GCKK7V2I.cjs} +14 -11
  5. package/dist/{brushstrokeRender-QLCXROJK.js → brushstrokeRender-T3JZST44.js} +7 -4
  6. package/dist/canvas/index.cjs +8 -8
  7. package/dist/canvas/index.js +1 -1
  8. package/dist/{chunk-IBDU6EGZ.cjs → chunk-2SMMZDMG.cjs} +35 -35
  9. package/dist/{chunk-SC2RZ5EF.js → chunk-2VJAVXLI.js} +2 -2
  10. package/dist/{chunk-OLNIPTB3.cjs → chunk-2VX55NFM.cjs} +1 -320
  11. package/dist/chunk-3K6HWEXZ.cjs +92 -0
  12. package/dist/{chunk-UOOK7HTX.js → chunk-3PPJRMIG.js} +1 -1
  13. package/dist/chunk-4D6KP5BV.js +92 -0
  14. package/dist/chunk-5RH3VXAK.js +269 -0
  15. package/dist/{chunk-NZ3O3A5C.js → chunk-6BIDVPED.js} +1 -1
  16. package/dist/{chunk-2ONK3ERD.cjs → chunk-75K3W4D6.cjs} +20 -20
  17. package/dist/{chunk-7T7JWTVE.cjs → chunk-BOHDJJ2O.cjs} +8 -8
  18. package/dist/{chunk-2PBZBRP5.js → chunk-D5KGAO4Z.js} +10 -92
  19. package/dist/{chunk-5GLYUSNT.js → chunk-DOIU7VJG.js} +1 -1
  20. package/dist/{chunk-HB4ICNNA.cjs → chunk-DPYAO5U6.cjs} +42 -42
  21. package/dist/chunk-EJLRBS5Q.js +301 -0
  22. package/dist/{chunk-6G6ZDDDB.cjs → chunk-H4AOUUBE.cjs} +301 -149
  23. package/dist/{chunk-PQ3H2AAN.cjs → chunk-I7NJPHWV.cjs} +122 -204
  24. package/dist/{chunk-L6REDLNB.cjs → chunk-IOFVM3L3.cjs} +7 -7
  25. package/dist/{chunk-42TWUPNJ.js → chunk-IRSTHLQQ.js} +1 -320
  26. package/dist/{chunk-VNBUDVD4.js → chunk-J7T5QZ45.js} +226 -74
  27. package/dist/{chunk-VMROIWLL.cjs → chunk-KBYB7OWB.cjs} +3 -3
  28. package/dist/{chunk-TPWB4Y6L.cjs → chunk-KYX7NZ5V.cjs} +1 -1
  29. package/dist/chunk-LJRCU3BJ.cjs +301 -0
  30. package/dist/{chunk-WVS5KQDH.cjs → chunk-LP2MCSBE.cjs} +246 -244
  31. package/dist/{chunk-XNRBMYNB.js → chunk-O75V4ZS3.js} +1 -1
  32. package/dist/chunk-OTTT5N3K.js +322 -0
  33. package/dist/{chunk-Q2HA52V4.js → chunk-PZP2SZIZ.js} +2 -2
  34. package/dist/{chunk-ZFSLEOSQ.js → chunk-UBRJOIR5.js} +11 -9
  35. package/dist/chunk-W5M3J7PV.cjs +322 -0
  36. package/dist/{chunk-4P6H35HU.js → chunk-WA44NKPF.js} +2 -2
  37. package/dist/{chunk-XWTRATIM.cjs → chunk-WLJZZHUZ.cjs} +23 -23
  38. package/dist/{chunk-P3NIPIKS.js → chunk-WQCNC4DK.js} +1 -1
  39. package/dist/chunk-ZEYMKDYS.cjs +269 -0
  40. package/dist/image-editor/index.cjs +1055 -1050
  41. package/dist/image-editor/index.js +28 -23
  42. package/dist/paint/index.cjs +8 -5
  43. package/dist/paint/index.js +13 -10
  44. package/dist/paint-editor/controller.d.cts +37 -1
  45. package/dist/paint-editor/controller.d.ts +37 -1
  46. package/dist/paint-editor/index.cjs +745 -602
  47. package/dist/paint-editor/index.d.cts +3 -0
  48. package/dist/paint-editor/index.d.ts +3 -0
  49. package/dist/paint-editor/index.js +184 -41
  50. package/dist/paint-editor/sticker-art.d.cts +55 -0
  51. package/dist/paint-editor/sticker-art.d.ts +55 -0
  52. package/dist/paint-editor/stickers.d.cts +30 -17
  53. package/dist/paint-editor/stickers.d.ts +30 -17
  54. package/dist/paint-editor/stroke.d.cts +4 -0
  55. package/dist/paint-editor/stroke.d.ts +4 -0
  56. package/dist/paint-editor/ui.d.cts +10 -2
  57. package/dist/paint-editor/ui.d.ts +10 -2
  58. package/dist/raster/index.cjs +6 -4
  59. package/dist/raster/index.js +12 -10
  60. package/dist/stickers/browser.d.cts +48 -0
  61. package/dist/stickers/browser.d.ts +48 -0
  62. package/dist/stickers/combine.d.cts +10 -0
  63. package/dist/stickers/combine.d.ts +10 -0
  64. package/dist/stickers/conformance.d.cts +18 -0
  65. package/dist/stickers/conformance.d.ts +18 -0
  66. package/dist/stickers/editor.d.cts +14 -0
  67. package/dist/stickers/editor.d.ts +14 -0
  68. package/dist/stickers/errors.d.cts +6 -0
  69. package/dist/stickers/errors.d.ts +6 -0
  70. package/dist/stickers/fake.d.cts +16 -0
  71. package/dist/stickers/fake.d.ts +16 -0
  72. package/dist/stickers/helpers.d.cts +51 -0
  73. package/dist/stickers/helpers.d.ts +51 -0
  74. package/dist/stickers/index.cjs +331 -0
  75. package/dist/stickers/index.d.cts +16 -0
  76. package/dist/stickers/index.d.ts +16 -0
  77. package/dist/stickers/index.js +331 -0
  78. package/dist/stickers/stamps.d.cts +13 -0
  79. package/dist/stickers/stamps.d.ts +13 -0
  80. package/dist/stickers/tools.d.cts +25 -0
  81. package/dist/stickers/tools.d.ts +25 -0
  82. package/dist/stickers/types.d.cts +123 -0
  83. package/dist/stickers/types.d.ts +123 -0
  84. package/dist/vector/index.cjs +978 -975
  85. package/dist/vector/index.js +9 -6
  86. package/package.json +11 -1
  87. package/skills/README.md +1 -0
  88. package/skills/pixerate-paint-editor/SKILL.md +8 -5
  89. package/skills/pixerate-stickers/SKILL.md +45 -0
@@ -26,7 +26,7 @@ import {
26
26
  traceField,
27
27
  traceVectorImage,
28
28
  vectorTraceContours
29
- } from "../chunk-5GLYUSNT.js";
29
+ } from "../chunk-DOIU7VJG.js";
30
30
  import {
31
31
  applyHomography,
32
32
  homographyFromPoints,
@@ -53,7 +53,7 @@ import {
53
53
  reverseMorphContour,
54
54
  subpathToMorphContour,
55
55
  turnMorphContour
56
- } from "../chunk-XNRBMYNB.js";
56
+ } from "../chunk-O75V4ZS3.js";
57
57
  import {
58
58
  DEFAULT_VECTOR_FONT,
59
59
  IDENTITY_MATRIX,
@@ -526,8 +526,9 @@ import {
526
526
  withVectorStrokes,
527
527
  withVectorTargetPaint,
528
528
  zigzagPaths
529
- } from "../chunk-Q2HA52V4.js";
530
- import "../chunk-VNBUDVD4.js";
529
+ } from "../chunk-PZP2SZIZ.js";
530
+ import "../chunk-J7T5QZ45.js";
531
+ import "../chunk-5RH3VXAK.js";
531
532
  import {
532
533
  createProvenance
533
534
  } from "../chunk-M6DNZNVY.js";
@@ -562,14 +563,16 @@ import {
562
563
  import "../chunk-V2ZCJRDM.js";
563
564
  import {
564
565
  GRAIN_PATTERNS
565
- } from "../chunk-2PBZBRP5.js";
566
+ } from "../chunk-D5KGAO4Z.js";
567
+ import "../chunk-4D6KP5BV.js";
566
568
  import "../chunk-ODBT55Q7.js";
569
+ import "../chunk-IRSTHLQQ.js";
567
570
  import {
568
571
  bytesToBase64,
569
572
  decodePng,
570
573
  isPng,
571
574
  parseDataUrl
572
- } from "../chunk-42TWUPNJ.js";
575
+ } from "../chunk-OTTT5N3K.js";
573
576
  import "../chunk-HVVR5PZW.js";
574
577
  import {
575
578
  deflate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.248.0",
3
+ "version": "0.249.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -334,6 +334,16 @@
334
334
  "default": "./dist/effects/index.cjs"
335
335
  }
336
336
  },
337
+ "./stickers": {
338
+ "import": {
339
+ "types": "./dist/stickers/index.d.ts",
340
+ "default": "./dist/stickers/index.js"
341
+ },
342
+ "require": {
343
+ "types": "./dist/stickers/index.d.cts",
344
+ "default": "./dist/stickers/index.cjs"
345
+ }
346
+ },
337
347
  "./diagram": {
338
348
  "import": {
339
349
  "types": "./dist/diagram/index.d.ts",
package/skills/README.md CHANGED
@@ -29,6 +29,7 @@ model and its general practice.
29
29
  | [`pixerate-effect-authoring`](pixerate-effect-authoring/SKILL.md) | Authoring shaders and procedural effects: inspecting parameters and source code, setting values and presets, keyframing animation tracks, playback timing, and previewing. |
30
30
  | [`pixerate-color`](pixerate-color/SKILL.md) | Colour inspection, WCAG accessibility and contrast optimization, CVD simulation, palette audits, harmonies, and OKLab/OKLCH blends. |
31
31
  | [`pixerate-typography`](pixerate-typography/SKILL.md) | Fonts and fallback stacks, font loading, modular type scales and hierarchies, fluid sizes, readability and type-aware contrast audits, text segmentation, the font picker. |
32
+ | [`pixerate-stickers`](pixerate-stickers/SKILL.md) | Sticker libraries: finding stickers by ref (`provider:id`), categories, tags, tintable art and licences, for the editors that spray or place them. |
32
33
 
33
34
  ## Workflow skills
34
35
 
@@ -184,8 +184,9 @@ inner glow, shadows, stroke, bevel, satin and overlays, as in the image editor
184
184
  - **Bristle brushes** (category `bristle`): `bristle-round`, `bristle-flat`, `dry-brush`. Every
185
185
  bristle draws its own line: press harder to splay the tuft, tilt to flatten it; soft bristles
186
186
  bend into curves at turns; a low `bristle.load` runs dry into broken streaks.
187
- - **Sticker spray** (category `sticker`): stamps (`star`, `leaf`, `confetti`, `flower`, `heart`,
188
- `splat`, `sparkle`, `ring`, `dot`) sprayed onto an **empty layer**, each staying an object:
187
+ - **Sticker spray** (category `sticker`): stickers by ref (`editor:star`, `editor:leaf`… or any
188
+ from the host's library: `find_stickers`; tintable ones take the paint colour) sprayed onto an
189
+ **empty layer**, each staying an object:
189
190
  `add_stickers` (exact places), `sticker_at`, `list_stickers`, `update_sticker`, `arrange_stickers`,
190
191
  `remove_stickers`. A sticker layer takes no other paint; sprays are refused under an enabled
191
192
  mask stencil (hide it with `update_stencil` `enabled` false, then remove unwanted stickers).
@@ -372,10 +373,12 @@ is a canvas coordinate: read [references/canvas-hosted.md](references/canvas-hos
372
373
 
373
374
  | Tool | Use |
374
375
  | --- | --- |
375
- | `list_stickers` | Read a layer's stickers bottom first: id, stamp, x, y, size, rotation, color, opacity. |
376
- | `add_stickers` | Place stickers exactly (`stamp`, `x`, `y`, optional `size`, `rotation`, `color`, `opacity`, `seed`) on a sticker layer or an empty layer. Use it for deliberate placement, a sticker brush for a scatter. One undo step. Returns the new stickers with ids. |
376
+ | `list_stickers` | Read a layer's stickers bottom first: id, `ref` (and `stamp` for the editor's own), x, y, size, rotation, color, opacity. |
377
+ | `add_stickers` | Place stickers exactly (`ref` from `find_stickers`, `x`, `y`, optional `size`, `rotation`, `color`, `opacity`, `seed`) on a sticker layer or an empty layer; a provider's art loads first. Use it for deliberate placement, a sticker brush for a scatter. One undo step. Returns the new stickers with ids. |
377
378
  | `sticker_at` | Read the top-most sticker under a point (`x`, `y`), or null. Use it to pick one sticker among many similar ones before `update_sticker`, `arrange_stickers` or `remove_stickers`. |
378
- | `update_sticker` | Change one sticker by `id`: `stamp`, `x`, `y`, `size`, `rotation`, `color`, `opacity`. One undo step. Returns it. |
379
+ | `update_sticker` | Change one sticker by `id`: `ref`, `x`, `y`, `size`, `rotation`, `color`, `opacity`. One undo step. Returns it. |
380
+ | `find_stickers` | Search the sticker library (the editor's stamps unless the host plugged in its own) by words, category, tags and commercial licence, a page at a time. Returns refs (`provider:id`) for sticker brushes (`set_brush` `sticker.stamps`) and `add_stickers`, with tintable and licence. |
381
+ | `describe_sticker` | One sticker by `ref`: licence and attribution, colours, outline. Unknown refs are refused with the closest ones. |
379
382
  | `arrange_stickers` | Move stickers (`ids`) to the `front` or `back` of their layer. One undo step. |
380
383
  | `remove_stickers` | Delete stickers by `ids`, or all on the layer. One undo step. |
381
384
 
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: pixerate-stickers
3
+ description: How to find, check and use stickers from the Pixerate sticker library through find_stickers and describe_sticker - the editor's own stamps (editor:star, editor:heart, ...) or any library a host plugged in (brand packs, uploads, third-party APIs), with refs (provider:id), categories, tags, tintable art and licences. Use when asked to add, spray, place, search for or credit stickers, or when find_stickers or describe_sticker are available.
4
+ ---
5
+
6
+ # Stickers
7
+
8
+ A sticker library is a `StickerProvider` the host plugs in (`@pixerate/editor/stickers`); with
9
+ none, it is the editor's own stamps (`editorStickers()`: `editor:dot`, `editor:star`,
10
+ `editor:heart`, `editor:leaf`, `editor:flower`, `editor:confetti`, `editor:splat`,
11
+ `editor:sparkle`, `editor:ring`, all MIT and tintable). Every sticker is named by a **ref**,
12
+ `provider:id`; the editors' sticker tools take refs.
13
+
14
+ ## Working method
15
+
16
+ 1. **Find.** `find_stickers` with a few words (`query`) and, when the result's `categories`
17
+ suggest one, a `category`. Pages are small: pass `next` as `after` for more, or narrow the
18
+ query. Filter with `commercial: true` for anything that will be sold or used in marketing.
19
+ 2. **Check.** `describe_sticker` when the choice matters: its licence (and the attribution line
20
+ it asks for), dominant colours, variants and outline.
21
+ 3. **Use.** Pass refs to the editor that places them: in the paint editor, a sticker brush
22
+ (`set_brush` `sticker.stamps`, then `paint_stroke`) sprays them and `add_stickers` places
23
+ them exactly. A provider's art loads before it is drawn.
24
+ 4. **Colour.** Tintable stickers (flat, single-colour art) take the paint colour or a sticker's
25
+ `color`; the rest keep their own colours.
26
+
27
+ ## Best practices
28
+
29
+ - Keep refs exactly as `find_stickers` returns them; a bare editor stamp (`star`) also works
30
+ and means `editor:star`.
31
+ - Credit stickers whose licence has an `attribution` wherever the work is published.
32
+ - Prefer tintable stickers when they must match a palette.
33
+
34
+ ## Pitfalls
35
+
36
+ - An unknown ref is refused with the closest refs: pick one of those or search again.
37
+ - A category that the library doesn't have is refused with the list of its categories.
38
+ - `limit` is 1..100; results beyond a page need `after`, not a larger limit.
39
+
40
+ ## Tool reference
41
+
42
+ | Tool | Use |
43
+ | --- | --- |
44
+ | `find_stickers` | Search or list the library: `query`, `category`, `tags`, `commercial`, `limit`, `after`. Returns `items` (each `ref`, name, category, tags, width, height, formats, tintable, licence), `total`, `next`, `categories`. Changes nothing. |
45
+ | `describe_sticker` | One sticker by `ref`: everything `find_stickers` returns plus `silhouette` (SVG path data), `colours` and `variants`. Unknown refs are refused with the closest ones. Changes nothing. |