@pixerate/editor 0.262.1 → 0.264.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/dist/animation-editor/index.cjs +60 -60
  2. package/dist/animation-editor/index.js +4 -4
  3. package/dist/brushes/index.cjs +158 -71
  4. package/dist/brushes/index.d.cts +3 -3
  5. package/dist/brushes/index.d.ts +3 -3
  6. package/dist/brushes/index.js +113 -26
  7. package/dist/brushes/library.d.cts +2 -0
  8. package/dist/brushes/library.d.ts +2 -0
  9. package/dist/brushes/profiles.d.cts +21 -2
  10. package/dist/brushes/profiles.d.ts +21 -2
  11. package/dist/brushes/ui.d.cts +57 -4
  12. package/dist/brushes/ui.d.ts +57 -4
  13. package/dist/{brushstrokeRender-25Q5BEY6.js → brushstrokeRender-3MOI7PH4.js} +3 -3
  14. package/dist/{brushstrokeRender-N6UPZSQS.cjs → brushstrokeRender-SMMPIJF2.cjs} +13 -13
  15. package/dist/canvas/index.cjs +15 -14
  16. package/dist/canvas/index.js +3 -2
  17. package/dist/canvas/stickers.d.cts +5 -1
  18. package/dist/canvas/stickers.d.ts +5 -1
  19. package/dist/{chunk-X2EXYY4J.js → chunk-4OJC4MCD.js} +9 -8
  20. package/dist/{chunk-J5UQHWVL.js → chunk-6JL2D5SG.js} +27 -15
  21. package/dist/{chunk-APX63ILU.js → chunk-ACFSFUQH.js} +31 -0
  22. package/dist/{chunk-TZOX7KWV.cjs → chunk-BY5EBP26.cjs} +35 -14
  23. package/dist/{chunk-CQVTGBQI.js → chunk-CECCP2V7.js} +1 -1
  24. package/dist/{chunk-F7CPSRLN.js → chunk-DOZ6F2K2.js} +12 -4
  25. package/dist/{chunk-5IW65VQ6.js → chunk-EE7SAYBF.js} +24 -3
  26. package/dist/{chunk-PYTJBVW5.cjs → chunk-F3KKR6DD.cjs} +37 -36
  27. package/dist/{chunk-YLUIFXSL.cjs → chunk-FQC5TDB6.cjs} +35 -35
  28. package/dist/{chunk-UVZ7RQOE.cjs → chunk-G5ADO47G.cjs} +1 -1
  29. package/dist/{chunk-D4TE5JNW.js → chunk-HAUDEVMC.js} +1 -1
  30. package/dist/{chunk-EHALWBBD.js → chunk-JEML4FSA.js} +1 -1
  31. package/dist/{chunk-43NT242D.cjs → chunk-KXNZNOEF.cjs} +86 -86
  32. package/dist/{chunk-JSDND7DF.cjs → chunk-OTN6VB5S.cjs} +32 -1
  33. package/dist/{chunk-AVTPZO4Z.cjs → chunk-PE6YJMQT.cjs} +37 -25
  34. package/dist/{chunk-QAR2N7HZ.js → chunk-ROBSFJ6F.js} +1 -1
  35. package/dist/{chunk-7AUQ2UJ3.cjs → chunk-USJX5SW4.cjs} +10 -10
  36. package/dist/{chunk-3TQW5MPW.cjs → chunk-V7MJ4HIN.cjs} +23 -23
  37. package/dist/{chunk-6NZL24W4.js → chunk-WWI6FLH2.js} +1 -1
  38. package/dist/{chunk-RVGP2XLF.cjs → chunk-XORJ7UZO.cjs} +21 -13
  39. package/dist/image-editor/controller.d.cts +3 -0
  40. package/dist/image-editor/controller.d.ts +3 -0
  41. package/dist/image-editor/index.cjs +792 -788
  42. package/dist/image-editor/index.js +10 -6
  43. package/dist/image-editor/stickers.d.cts +7 -2
  44. package/dist/image-editor/stickers.d.ts +7 -2
  45. package/dist/image-editor/types.d.cts +7 -0
  46. package/dist/image-editor/types.d.ts +7 -0
  47. package/dist/paint-editor/brush-library-tools.d.cts +8 -1
  48. package/dist/paint-editor/brush-library-tools.d.ts +8 -1
  49. package/dist/paint-editor/controller.d.cts +7 -2
  50. package/dist/paint-editor/controller.d.ts +7 -2
  51. package/dist/paint-editor/index.cjs +581 -524
  52. package/dist/paint-editor/index.d.cts +1 -1
  53. package/dist/paint-editor/index.d.ts +1 -1
  54. package/dist/paint-editor/index.js +105 -48
  55. package/dist/paint-editor/sticker-art.d.cts +20 -10
  56. package/dist/paint-editor/sticker-art.d.ts +20 -10
  57. package/dist/paint-editor/stickers.d.cts +8 -1
  58. package/dist/paint-editor/stickers.d.ts +8 -1
  59. package/dist/paint-editor/stroke.d.cts +2 -0
  60. package/dist/paint-editor/stroke.d.ts +2 -0
  61. package/dist/stickers/browser.d.cts +10 -3
  62. package/dist/stickers/browser.d.ts +10 -3
  63. package/dist/stickers/combine.d.cts +2 -0
  64. package/dist/stickers/combine.d.ts +2 -0
  65. package/dist/stickers/conformance.d.cts +1 -1
  66. package/dist/stickers/conformance.d.ts +1 -1
  67. package/dist/stickers/errors.d.cts +1 -1
  68. package/dist/stickers/errors.d.ts +1 -1
  69. package/dist/stickers/fake.d.cts +4 -2
  70. package/dist/stickers/fake.d.ts +4 -2
  71. package/dist/stickers/helpers.d.cts +16 -2
  72. package/dist/stickers/helpers.d.ts +16 -2
  73. package/dist/stickers/index.cjs +116 -29
  74. package/dist/stickers/index.js +106 -19
  75. package/dist/stickers/tools.d.cts +9 -2
  76. package/dist/stickers/tools.d.ts +9 -2
  77. package/dist/stickers/types.d.cts +32 -5
  78. package/dist/stickers/types.d.ts +32 -5
  79. package/dist/vector/controller.d.cts +13 -0
  80. package/dist/vector/controller.d.ts +13 -0
  81. package/dist/vector/index.cjs +1218 -1207
  82. package/dist/vector/index.js +19 -8
  83. package/dist/vector/stickers.d.cts +7 -2
  84. package/dist/vector/stickers.d.ts +7 -2
  85. package/package.json +1 -1
  86. package/skills/pixerate-brushes/SKILL.md +11 -3
  87. package/skills/pixerate-brushes-design/SKILL.md +1 -0
  88. package/skills/pixerate-stickers/SKILL.md +20 -9
  89. package/skills/pixerate-vector/SKILL.md +1 -1
@@ -26,7 +26,7 @@ import {
26
26
  traceField,
27
27
  traceVectorImage,
28
28
  vectorTraceContours
29
- } from "../chunk-CQVTGBQI.js";
29
+ } from "../chunk-CECCP2V7.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-QAR2N7HZ.js";
56
+ } from "../chunk-ROBSFJ6F.js";
57
57
  import {
58
58
  DEFAULT_VECTOR_FONT,
59
59
  IDENTITY_MATRIX,
@@ -529,11 +529,11 @@ import {
529
529
  withVectorStrokes,
530
530
  withVectorTargetPaint,
531
531
  zigzagPaths
532
- } from "../chunk-6NZL24W4.js";
532
+ } from "../chunk-WWI6FLH2.js";
533
533
  import {
534
534
  snapshotBrushLibrary
535
- } from "../chunk-5IW65VQ6.js";
536
- import "../chunk-APX63ILU.js";
535
+ } from "../chunk-EE7SAYBF.js";
536
+ import "../chunk-ACFSFUQH.js";
537
537
  import {
538
538
  createProvenance
539
539
  } from "../chunk-M6DNZNVY.js";
@@ -6829,6 +6829,8 @@ var VectorEditorController = class _VectorEditorController {
6829
6829
  colorScheme;
6830
6830
  constructor(options = {}) {
6831
6831
  this.colorScheme = options.colorScheme ?? "light";
6832
+ this.brushLibrary = options.brushLibrary ?? null;
6833
+ this.brushPreview = options.brushPreview ?? null;
6832
6834
  this.brushes = options.brushLibrary ? snapshotBrushLibrary(options.brushLibrary, () => this.notify()) : null;
6833
6835
  this.history = options.history ?? new HistoryManager();
6834
6836
  this.doc = options.document ? loadedDocument(options.document) : { width: 800, height: 600, nodes: [] };
@@ -6867,6 +6869,14 @@ var VectorEditorController = class _VectorEditorController {
6867
6869
  */
6868
6870
  /** The saved brushes of the brush library as last read (empty without one). */
6869
6871
  brushes;
6872
+ /** The brush library brushstrokes use (`brushLibrary` option), or `null`. A full `BrushLibrary` lets the UI edit brushes (`isBrushLibrary`). */
6873
+ brushLibrary;
6874
+ /** The `brushPreview` option: draws the brush editor's preview stroke, or `null`. */
6875
+ brushPreview;
6876
+ /** Reads the brush library again now (it is also read after every change to it); resolves once read. */
6877
+ refreshBrushes() {
6878
+ return this.brushes?.refresh() ?? Promise.resolve();
6879
+ }
6870
6880
  /** The brushes a brushstroke can use: the presets, then the brush library's saved brushes the vector profile admits. */
6871
6881
  listBrushstrokeBrushes() {
6872
6882
  return vectorBrushstrokeBrushes(this.brushes?.user ?? []);
@@ -8236,7 +8246,7 @@ var VectorEditorController = class _VectorEditorController {
8236
8246
  (stack, path) => {
8237
8247
  const layer = stack[index];
8238
8248
  if (!layer || layer.kind !== "brushstroke" || !layer.brush) return `Path "${path.id}" has no brushstroke at stroke ${index} (vector.getAppearance lists its strokes; 0 is the bottom).`;
8239
- const brush = patch.brushId && patch.brushId !== layer.brush.brushId ? { ...layer.brush, brushId: patch.brushId, spec: void 0 } : { ...layer.brush };
8249
+ const brush = patch.brushId ? { ...layer.brush, brushId: patch.brushId, spec: void 0 } : { ...layer.brush };
8240
8250
  if (patch.size === null) delete brush.size;
8241
8251
  else if (patch.size !== void 0) brush.size = patch.size;
8242
8252
  if (patch.pressure === null) delete brush.pressure;
@@ -15985,7 +15995,7 @@ function createVectorCommands(controller, options = {}) {
15985
15995
  id: `${prefix}setBrushstroke`,
15986
15996
  label: "Edit Brushstroke\u2026",
15987
15997
  keywords: ["brushstroke", "brush", "size", "pressure", "taper"],
15988
- description: "Changes the brushstroke at stroke layer `index` of path `id` (vector.getAppearance lists strokes; 0 is the bottom): `brushId`, `size` (null: the brush's own), `pressure` (null: full pressure), `color`, `opacity`, `seed` (turns the brush's character on; null: plain dabs) and `paper` (replaced whole; null: no grain; {}: the default paper). Pass at least one. One undo step. Returns { id, strokes }.",
15998
+ description: "Changes the brushstroke at stroke layer `index` of path `id` (vector.getAppearance lists strokes; 0 is the bottom): `brushId` (the same id again takes that saved brush as the library has it now), `size` (null: the brush's own), `pressure` (null: full pressure), `color`, `opacity`, `seed` (turns the brush's character on; null: plain dabs) and `paper` (replaced whole; null: no grain; {}: the default paper). Pass at least one. One undo step. Returns { id, strokes }.",
15989
15999
  params: {
15990
16000
  type: "object",
15991
16001
  properties: {
@@ -18372,10 +18382,11 @@ function stickerVectorGroup(placement, id = "sticker") {
18372
18382
  const s = placement.width / box.width;
18373
18383
  return transformVectorNode(group, [s, 0, 0, s, placement.x - box.width * s / 2, placement.y - box.height * s / 2]);
18374
18384
  }
18375
- function createVectorStickerHost(controller) {
18385
+ function createVectorStickerHost(controller, options = {}) {
18376
18386
  return {
18377
18387
  noun: "group of editable paths",
18378
18388
  format: "svg",
18389
+ ...options.dark ? { dark: options.dark } : {},
18379
18390
  defaultCentre: () => {
18380
18391
  const d = controller.getDocument();
18381
18392
  return { x: d.width / 2, y: d.height / 2 };
@@ -7,5 +7,10 @@ import type { VectorEditorController } from './controller.cjs';
7
7
  import type { VectorGroupNode } from './types.cjs';
8
8
  /** A group of the sticker's paths, `placement.width` wide and centred on (`x`, `y`). */
9
9
  export declare function stickerVectorGroup(placement: StickerPlacement, id?: string): VectorGroupNode;
10
- /** `insert_sticker` for a vector editor: a group of editable paths, one undo step, selected. */
11
- export declare function createVectorStickerHost(controller: VectorEditorController): StickerInsertHost;
10
+ /**
11
+ * `insert_sticker` for a vector editor: a group of editable paths, one undo step, selected. With
12
+ * `dark` (the host's dark theme or artboard), stickers that have a dark variant use it.
13
+ */
14
+ export declare function createVectorStickerHost(controller: VectorEditorController, options?: {
15
+ dark?: () => boolean;
16
+ }): StickerInsertHost;
@@ -7,5 +7,10 @@ import type { VectorEditorController } from './controller.js';
7
7
  import type { VectorGroupNode } from './types.js';
8
8
  /** A group of the sticker's paths, `placement.width` wide and centred on (`x`, `y`). */
9
9
  export declare function stickerVectorGroup(placement: StickerPlacement, id?: string): VectorGroupNode;
10
- /** `insert_sticker` for a vector editor: a group of editable paths, one undo step, selected. */
11
- export declare function createVectorStickerHost(controller: VectorEditorController): StickerInsertHost;
10
+ /**
11
+ * `insert_sticker` for a vector editor: a group of editable paths, one undo step, selected. With
12
+ * `dark` (the host's dark theme or artboard), stickers that have a dark variant use it.
13
+ */
14
+ export declare function createVectorStickerHost(controller: VectorEditorController, options?: {
15
+ dark?: () => boolean;
16
+ }): StickerInsertHost;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.262.1",
3
+ "version": "0.264.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -47,6 +47,9 @@ paints without (warnings), each with a fix; lists and writes use the current hos
47
47
 
48
48
  Every host lists the presets its profile admits and the library's saved brushes it admits, and
49
49
  each registers these tools with its own profile, so `list_brush_presets` shows that host's brushes.
50
+ People edit brushes in every host with the same brush editor, scoped the same way: it shows only
51
+ the controls the host uses (no velocity on canvas, no grain in the image editor), and what the
52
+ brush has for other hosts is kept on save. The tools follow the same rule (see Pitfalls).
50
53
  A saved brush used in canvas or vector strokes is copied into the stroke, so the document renders
51
54
  where the library is not; changing the brush in the library later doesn't change strokes already
52
55
  drawn.
@@ -87,8 +90,13 @@ drawn.
87
90
 
88
91
  ## Pitfalls
89
92
 
90
- - **A facet the host refuses.** `create_brush` and `update_brush` refuse it with the facet and
91
- fix; `check_brush` returns `degraded`, the brush with those facets stripped, to start from.
93
+ - **A facet the host refuses.** `create_brush` refuses it, and `update_brush` refuses a change
94
+ that adds it, with the facet and fix; `check_brush` returns `degraded`, the brush with those
95
+ facets stripped, to start from.
96
+ - **Tuning a brush in a host that can't paint all of it.** `update_brush` keeps what the brush
97
+ already has for other hosts (a paint brush's light, changed from canvas) and lists it in
98
+ `kept`; it is not stripped. To make a copy for this host only, `create_brush` from
99
+ `check_brush`'s `degraded` brush instead.
92
100
  - **Ids.** Built-in ids can't be reused or changed; a taken id is refused (update it instead).
93
101
  - **Stamps.** Any marks take any sticker ref from `find_stickers`, or an editor stamp
94
102
  (`editor:star`…). A ref the host's sticker library can't load is refused with the closest
@@ -113,7 +121,7 @@ drawn.
113
121
  | `list_brush_presets` | Find brushes this host renders: `kind`, `medium`, `variety`, `tool`, `tag`, `text`, `source` (all, builtin, user), `all`, `offset`, `limit`. Returns `brushes` (id, name, builtin, kind, medium, variety or tool, category, engine, tip, size, marks, surface, light) and `total`. Call first. |
114
122
  | `describe_brush` | One brush by `id`: its full facet `brush` (with its `colour`: default, palette, own), `builtin`, `engine`, `category` and `check` for this host (stamp stickers included). Unknown ids are refused with the closest ones. |
115
123
  | `create_brush` | Save a new brush: `id`, `name`, optional `basedOn`, and the facets, `colour` included (to keep an editor's current brush, pass the `brush` its `get_brush` returns). Normalised and checked for this host (and its sticker library, for stamp tips); refused brushes save nothing. Returns `id`, `brush`, `engine`, `problems`, `warnings`. |
116
- | `update_brush` | Change a saved brush: facets to merge in, `unset` facets to drop. Refuses built-ins (duplicate first) and changes the host can't render. Returns `brush`, `changed` paths, `problems`, `warnings`. |
124
+ | `update_brush` | Change a saved brush: facets to merge in, `unset` facets to drop. Refuses built-ins (duplicate first) and changes that add what the host can't render; keeps what the brush already had for other hosts. Returns `brush`, `changed` paths, `problems`, `warnings` and, when there are any, `kept` (facets this host can't use, left as they were). |
117
125
  | `duplicate_brush` | Copy any brush, built-ins included, to a saved brush (`newId` default `<id>-copy`, `name`). Returns the new `id` and `brush`; then `update_brush` it. |
118
126
  | `remove_brush` | Delete a saved brush for good (export it first to keep a copy). Built-ins are refused. Returns `removed`. |
119
127
  | `check_brush` | Check a brush (`id`, or an unsaved `brush` spec) for a `host` (paint, image, canvas, vector). Returns `ok`, `issues` (facet, severity, reason, fix) and, when refused, `degraded`. |
@@ -61,6 +61,7 @@ Ask when you cannot tell from the request; say what you assumed when you can.
61
61
  | A shape as the tip (stars, leaves, a logo) | `tip.shape` stamp with `stamps` (an editor stamp or a ref from `find_stickers`), continuous marks; it paints in the user's colour. Keep the sticker's colours with `marks` objects. Paint editor only. |
62
62
  | A spray can or mist | `basedOn` `spray-can`, or `medium` spray with `marks` scatter (`density`, `size`). Paint editor only. |
63
63
  | A change to a built-in | `duplicate_brush`, then `update_brush` the copy. |
64
+ | Tune a brush from a host that can't paint all of it | `update_brush` there: what the host can't use is kept (`kept`), not stripped; refused only if the change adds it. |
64
65
 
65
66
  ## Recipes
66
67
 
@@ -1,6 +1,6 @@
1
1
  ---
2
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.
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, collections, tags, tintable art, light / dark variants, AI-generated labels and licences. Use when asked to add, spray, place, search for or credit stickers, or when find_stickers or describe_sticker are available.
4
4
  ---
5
5
 
6
6
  # Stickers
@@ -14,17 +14,22 @@ none, it is the editor's own stamps (`editorStickers()`: `editor:dot`, `editor:s
14
14
  ## Working method
15
15
 
16
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.
17
+ suggest one, a `category`. When the result lists `collections` (themed sets, such as one per
18
+ brand) and the job names one, pass its id as `collection`. Pages are small: pass `next` as
19
+ `after` for more, or narrow the query. Filter with `commercial: true` for anything that will
20
+ be sold or used in marketing.
19
21
  2. **Check.** `describe_sticker` when the choice matters: its licence (and the attribution line
20
- it asks for), dominant colours, variants and outline.
22
+ it asks for), whether the art is `aiGenerated`, its `variants`, dominant colours and outline.
21
23
  3. **Use.** Pass refs to the editor that places them: in the paint editor, a sticker brush
22
24
  (`set_brush` `tip.stamps`, then `paint_stroke`) sprays them and `add_stickers` places
23
25
  them exactly. In the vector, image and canvas editors, `insert_sticker` puts one in (`x`,
24
26
  `y` centre, `width`): vector, a group of editable paths; image, a pixel layer; canvas, a
25
27
  shape node from its outline in one colour. A provider's art loads before it is drawn.
26
28
  4. **Colour.** Tintable stickers (flat, single-colour art) take the paint colour or a sticker's
27
- `color`; the rest keep their own colours.
29
+ `color`; the rest keep their own colours. A sticker whose `variants` include `dark` has art
30
+ drawn for dark backgrounds: `insert_sticker` uses it when the host's canvas or theme is dark
31
+ (or pass `variant`), and the paint editor's sticker brush sprays it on a dark colour scheme
32
+ (each sticker keeps the variant it was drawn in).
28
33
  5. **Treat it with an effect.** In the image editor, `insert_sticker` returns the layer `id`;
29
34
  `apply_effect` with that `target` and any effect whose `describe_effect` inputs take an
30
35
  image (`appliesHere`) uses the sticker as its picture (holo foil, cut-out). For a whole set,
@@ -35,6 +40,10 @@ none, it is the editor's own stamps (`editorStickers()`: `editor:dot`, `editor:s
35
40
  - Keep refs exactly as `find_stickers` returns them; a bare editor stamp (`star`) also works
36
41
  and means `editor:star`.
37
42
  - Credit stickers whose licence has an `attribution` wherever the work is published.
43
+ - Say when art is `aiGenerated: true` if the user asked for hand-made art or must disclose AI
44
+ content; absent means the provider didn't say, not that it is hand-made.
45
+ - Leave `variant` out of `insert_sticker` unless the user asked for one: the default matches the
46
+ background.
38
47
  - Prefer tintable stickers when they must match a palette.
39
48
  - Vector stickers need SVG art and canvas stickers an outline (`silhouette`); `find_stickers`
40
49
  lists `formats`, and `describe_sticker` the outline. The image editor takes either.
@@ -42,7 +51,9 @@ none, it is the editor's own stamps (`editorStickers()`: `editor:dot`, `editor:s
42
51
  ## Pitfalls
43
52
 
44
53
  - An unknown ref is refused with the closest refs: pick one of those or search again.
45
- - A category that the library doesn't have is refused with the list of its categories.
54
+ - A category or collection that the library doesn't have is refused with the list of its
55
+ categories or collections. In a combined library, collection ids are `provider:collection`.
56
+ - `variant: "dark"` on a sticker without a dark variant is refused; check `variants` first.
46
57
  - `limit` is 1..100; results beyond a page need `after`, not a larger limit.
47
58
  - `color` on a sticker that is not tintable is refused; leave it out.
48
59
  - On the canvas, multi-colour art becomes its outline in its dominant colour; for the art itself,
@@ -52,6 +63,6 @@ none, it is the editor's own stamps (`editorStickers()`: `editor:dot`, `editor:s
52
63
 
53
64
  | Tool | Use |
54
65
  | --- | --- |
55
- | `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. |
56
- | `insert_sticker` | Put one sticker (`ref`) into the vector, image or canvas editor, centred at `x`, `y` (default the middle), `width` wide (default natural), tinted with `color` when tintable. One undo step. Returns the new group, layer or node `id`, the size and the licence. |
57
- | `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. |
66
+ | `find_stickers` | Search or list the library: `query`, `category`, `collection`, `tags`, `commercial`, `limit`, `after`. Returns `items` (each `ref`, name, category, collection, tags, width, height, formats, tintable, aiGenerated, variants, licence), `total`, `next`, `categories`, `collections`. Changes nothing. |
67
+ | `insert_sticker` | Put one sticker (`ref`) into the vector, image or canvas editor, centred at `x`, `y` (default the middle), `width` wide (default natural), tinted with `color` when tintable, in its dark `variant` on a dark background (or the one passed). One undo step. Returns the new group, layer or node `id`, the size, the `variant` used and the licence. |
68
+ | `describe_sticker` | One sticker by `ref`: everything `find_stickers` returns plus `silhouette` (SVG path data) and `colours`. Unknown refs are refused with the closest ones. Changes nothing. |
@@ -375,7 +375,7 @@ contents whole while you work, without losing the mask.
375
375
  | --- | --- |
376
376
  | `vector.listBrushes` | List the brushes a brushstroke can use: the dry presets (pencils, pastels, charcoal, crayon, chalk, markers, inks, ballpoint, gel pen, fineliner), then saved brushes from the brush library the vector profile admits, with their sizes and `builtin`. Brushes it refuses (wet, thick, particles, stickers, tools) are refused by `vector.addBrushstroke` with the reason. A saved brush is kept in the layer, so the document renders without the library. |
377
377
  | `vector.addBrushstroke` | Paint paths with a brush along their outline (`brushId`, `size`, `pressure` profile such as [0.2, 1, 0.2] for a taper, `color`, default the brush's default colour (ballpoint blue, chalk), else the path's stroke; `keepColour` keeps the path's colour): sketchy, hand-drawn or inked lines that stay editable. Pass a `seed` (any integer) so the brush gets its character, the seeded jitter and paper grain that make pencil, pastel and charcoal look real; `paper` picks the grain (`{ pattern, seed, scale, depth }`) or `null` turns it off. Returns the stroke stacks. |
378
- | `vector.setBrushstroke` | Change brushstroke layer `index` of path `id`: brush (another brush without `color` takes its default colour, unless `keepColour`), size, pressure, colour, opacity, `seed` (a new seed is a new take on the same stroke; null: plain dabs) and `paper` (replaced whole; null: no grain; {}: the default sanded paper). Remove it with `vector.removeStroke`. |
378
+ | `vector.setBrushstroke` | Change brushstroke layer `index` of path `id`: brush (another brush without `color` takes its default colour, unless `keepColour`; giving the same `brushId` again takes that saved brush as the library has it now), size, pressure, colour, opacity, `seed` (a new seed is a new take on the same stroke; null: plain dabs) and `paper` (replaced whole; null: no grain; {}: the default sanded paper). Remove it with `vector.removeStroke`. |
379
379
 
380
380
  Give brushstrokes a `seed` unless you want flat, even dabs: without one a charcoal or pastel line looks like a felt pen. Use different seeds on neighbouring strokes so they do not repeat each other, and `paper: null` for clean ink or marker lines that should not catch grain. The grain is laid in each path's own space, so it moves with the path.
381
381