@pixerate/editor 0.256.0 → 0.257.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 (122) hide show
  1. package/dist/agent/index.cjs +40 -38
  2. package/dist/agent/index.js +9 -7
  3. package/dist/animation/index.cjs +4 -2
  4. package/dist/animation/index.js +4 -2
  5. package/dist/animation-editor/index.cjs +63 -61
  6. package/dist/animation-editor/index.js +7 -5
  7. package/dist/brushes/colour.d.cts +11 -0
  8. package/dist/brushes/colour.d.ts +11 -0
  9. package/dist/brushes/index.cjs +51 -30
  10. package/dist/brushes/index.d.cts +1 -0
  11. package/dist/brushes/index.d.ts +1 -0
  12. package/dist/brushes/index.js +25 -4
  13. package/dist/brushes/resolve.d.cts +2 -0
  14. package/dist/brushes/resolve.d.ts +2 -0
  15. package/dist/brushes/schema.d.cts +1 -0
  16. package/dist/brushes/schema.d.ts +1 -0
  17. package/dist/brushes/tools.d.cts +7 -0
  18. package/dist/brushes/tools.d.ts +7 -0
  19. package/dist/brushes/types.d.cts +10 -2
  20. package/dist/brushes/types.d.ts +10 -2
  21. package/dist/brushes/ui.d.cts +14 -3
  22. package/dist/brushes/ui.d.ts +14 -3
  23. package/dist/{brushstrokeRender-HCOQUSWW.js → brushstrokeRender-JI4W6F2G.js} +2 -2
  24. package/dist/{brushstrokeRender-ZZOXI5O5.cjs → brushstrokeRender-MQ6PSDM5.cjs} +11 -11
  25. package/dist/canvas/index.cjs +20 -18
  26. package/dist/canvas/index.js +7 -5
  27. package/dist/chart/index.cjs +159 -157
  28. package/dist/chart/index.js +9 -7
  29. package/dist/{chunk-7272D3K2.js → chunk-2EUW2XZX.js} +27 -276
  30. package/dist/{chunk-L6Y7TSQ4.js → chunk-2VJ6OVJV.js} +1 -1
  31. package/dist/{chunk-6ZZKRH7R.js → chunk-47V3WXDG.js} +2 -2
  32. package/dist/{chunk-H7ET2ISK.cjs → chunk-4IMD2TLY.cjs} +52 -52
  33. package/dist/{chunk-VUKUTT2W.js → chunk-4M4E3N6X.js} +1 -1
  34. package/dist/{chunk-TBAVCLEQ.cjs → chunk-5Q5MLXAD.cjs} +23 -23
  35. package/dist/{chunk-MONXNVZK.js → chunk-6I23ZCGK.js} +5 -3
  36. package/dist/{chunk-GOBOCZZI.js → chunk-6NQPKNUZ.js} +1 -1
  37. package/dist/{chunk-WYGSR3IJ.js → chunk-AORZ5M5C.js} +1 -1
  38. package/dist/chunk-AVTPZO4Z.cjs +142 -0
  39. package/dist/{chunk-WKMUBATU.js → chunk-C2WEIEUB.js} +1 -1
  40. package/dist/{chunk-P3K2JCJA.js → chunk-D5BXSOSU.js} +3 -3
  41. package/dist/chunk-E2V5DA3W.js +36 -0
  42. package/dist/{chunk-WZOGDKCQ.js → chunk-F7CPSRLN.js} +0 -133
  43. package/dist/chunk-FJBQTZS4.js +17 -0
  44. package/dist/{chunk-SOSBOS5T.cjs → chunk-G23BTQA5.cjs} +22 -22
  45. package/dist/{chunk-EUIDTZNQ.cjs → chunk-I3Y2Q3PM.cjs} +59 -308
  46. package/dist/{chunk-YHUMGBZD.js → chunk-ICTPLVSR.js} +22 -4
  47. package/dist/{chunk-LRNUZKWV.cjs → chunk-IPUTIUGQ.cjs} +1 -1
  48. package/dist/{chunk-6GRUVGKU.js → chunk-ITURMC2M.js} +3 -3
  49. package/dist/{chunk-HYWRU5VX.js → chunk-IXQZHCOF.js} +1 -1
  50. package/dist/chunk-J5UQHWVL.js +142 -0
  51. package/dist/{chunk-YBAPT7NL.js → chunk-JC2SHA4A.js} +1 -23
  52. package/dist/chunk-LRTR4ASZ.cjs +17 -0
  53. package/dist/{chunk-HUAISCUX.cjs → chunk-M2HG5DJ2.cjs} +18 -18
  54. package/dist/{chunk-N76AMOKE.cjs → chunk-MDLEGVEN.cjs} +42 -42
  55. package/dist/chunk-MEGSQUQO.cjs +36 -0
  56. package/dist/chunk-MLLTWAXH.cjs +276 -0
  57. package/dist/{chunk-RHPSE2YR.js → chunk-MQ6MGIQM.js} +2 -2
  58. package/dist/{chunk-PGPFWC35.cjs → chunk-MQGQTKVW.cjs} +51 -33
  59. package/dist/{chunk-5YWWQ36H.cjs → chunk-O3ZVZSNJ.cjs} +9 -9
  60. package/dist/{chunk-GCTUOTCW.cjs → chunk-P3PZ63M3.cjs} +35 -35
  61. package/dist/{chunk-WRZ6C4TU.cjs → chunk-P6WYDBTH.cjs} +4 -4
  62. package/dist/{chunk-CJ6TBL2N.cjs → chunk-RHEMMGCN.cjs} +16 -16
  63. package/dist/{chunk-HIMGBZAM.cjs → chunk-RSIKDWOP.cjs} +201 -38
  64. package/dist/{chunk-SABJMH6M.cjs → chunk-RVGP2XLF.cjs} +2 -135
  65. package/dist/{chunk-JVRLGV3C.js → chunk-SMTUQWGY.js} +184 -21
  66. package/dist/{chunk-DMTEQ6SH.js → chunk-SSFMWJDK.js} +4 -4
  67. package/dist/{chunk-TFF2GTGN.cjs → chunk-SXQHWXEL.cjs} +2 -24
  68. package/dist/{chunk-IWEVV63O.cjs → chunk-UEYLANO3.cjs} +18 -16
  69. package/dist/chunk-VR6OGHU5.js +276 -0
  70. package/dist/{chunk-AF23QK5F.js → chunk-YQ4PQTBB.js} +1 -1
  71. package/dist/{chunk-B7V34GIH.cjs → chunk-YSGW7VV4.cjs} +88 -88
  72. package/dist/{chunk-3NS5C7FB.cjs → chunk-YYBW6DF2.cjs} +76 -76
  73. package/dist/{chunk-UFEDHACQ.js → chunk-Z7BX4TWO.js} +2 -2
  74. package/dist/{chunk-RUONPPMC.cjs → chunk-ZSE25IZA.cjs} +8 -8
  75. package/dist/color/index.cjs +7 -3
  76. package/dist/color/index.js +18 -14
  77. package/dist/export/index.cjs +8 -6
  78. package/dist/export/index.js +7 -5
  79. package/dist/extensions/index.cjs +11 -9
  80. package/dist/extensions/index.js +10 -8
  81. package/dist/gradient/index.cjs +33 -31
  82. package/dist/gradient/index.js +5 -3
  83. package/dist/image-editor/brush-presets.d.cts +4 -1
  84. package/dist/image-editor/brush-presets.d.ts +4 -1
  85. package/dist/image-editor/controller.d.cts +10 -5
  86. package/dist/image-editor/controller.d.ts +10 -5
  87. package/dist/image-editor/index.cjs +1090 -1073
  88. package/dist/image-editor/index.js +37 -20
  89. package/dist/index.cjs +17 -15
  90. package/dist/index.js +11 -9
  91. package/dist/paint-editor/brushes.d.cts +18 -1
  92. package/dist/paint-editor/brushes.d.ts +18 -1
  93. package/dist/paint-editor/controller.d.cts +29 -0
  94. package/dist/paint-editor/controller.d.ts +29 -0
  95. package/dist/paint-editor/engine.d.cts +7 -0
  96. package/dist/paint-editor/engine.d.ts +7 -0
  97. package/dist/paint-editor/index.cjs +1443 -1280
  98. package/dist/paint-editor/index.js +1117 -954
  99. package/dist/paint-editor/mark-settings.d.cts +1 -1
  100. package/dist/paint-editor/mark-settings.d.ts +1 -1
  101. package/dist/paint-editor/procedural.d.cts +4 -2
  102. package/dist/paint-editor/procedural.d.ts +4 -2
  103. package/dist/paint-editor/stamp-tip.d.cts +45 -0
  104. package/dist/paint-editor/stamp-tip.d.ts +45 -0
  105. package/dist/paint-editor/stroke.d.cts +2 -0
  106. package/dist/paint-editor/stroke.d.ts +2 -0
  107. package/dist/stickers/index.cjs +4 -2
  108. package/dist/stickers/index.js +6 -4
  109. package/dist/typography/index.cjs +3 -2
  110. package/dist/typography/index.js +2 -1
  111. package/dist/vector/index.cjs +971 -969
  112. package/dist/vector/index.js +8 -6
  113. package/dist/video-editor/index.cjs +4 -2
  114. package/dist/video-editor/index.js +4 -2
  115. package/package.json +1 -1
  116. package/skills/pixerate-brushes/SKILL.md +21 -11
  117. package/skills/pixerate-brushes-design/SKILL.md +6 -2
  118. package/skills/pixerate-brushes-design/evals/canvas-chalk.json +8 -8
  119. package/skills/pixerate-canvas/SKILL.md +3 -2
  120. package/skills/pixerate-image-editor/SKILL.md +1 -1
  121. package/skills/pixerate-paint-editor/SKILL.md +4 -1
  122. package/skills/pixerate-vector/SKILL.md +1 -1
@@ -22,6 +22,7 @@ import { type PaintBrushInput, type PaintBrush } from './brushes.js';
22
22
  import { type BrushLibrary, type BrushLibraryFile } from '../brushes/library.js';
23
23
  import { type BrushPatch, type UnsettableBrushFacet } from '../brushes/patch.js';
24
24
  import type { Brush } from '../brushes/types.js';
25
+ import type { ColorScheme } from '../color/dual.js';
25
26
  import { type PaintCanvas, type PaintDocumentState, type PaintLayer } from './document.js';
26
27
  import { type ImageEncoder, type ImageFormat } from './encode.js';
27
28
  import type { PenPoint } from './engine.js';
@@ -67,6 +68,11 @@ export interface PaintEditorOptions extends Partial<PaintCanvas> {
67
68
  brushLibrary?: BrushLibrary;
68
69
  /** Saved user brushes to start the default library with (or to add to `brushLibrary`). */
69
70
  brushes?: readonly PaintBrush[];
71
+ /**
72
+ * The host's colour scheme (default `light`): a brush's light / dark default colour resolves to
73
+ * its side when the brush is chosen and when a stroke starts. Follow the host with `setColorScheme`.
74
+ */
75
+ colorScheme?: ColorScheme;
70
76
  /** Paint colour #rrggbb (default #1f2937). */
71
77
  color?: string;
72
78
  hand?: Hand;
@@ -114,6 +120,10 @@ export interface PaintEditorState {
114
120
  brushes: readonly PaintBrush[];
115
121
  /** Paint colour #rrggbb. */
116
122
  color: string;
123
+ /** The colour scheme light / dark brush colours resolve for. */
124
+ colorScheme: ColorScheme;
125
+ /** Locked: choosing a brush with a default colour keeps the paint colour. */
126
+ colorLocked: boolean;
117
127
  /** The second colour (swap with `swapColors`). */
118
128
  secondaryColor: string;
119
129
  /**
@@ -825,6 +835,25 @@ export declare class PaintEditorController {
825
835
  height?: number;
826
836
  color?: string;
827
837
  }): BrushThumbnail;
838
+ private colorScheme;
839
+ private colorLocked;
840
+ /** The brush default colour the paint colour came from (resolved again when the scheme changes), or `null`. */
841
+ private brushColour;
842
+ /**
843
+ * The host's colour scheme: a paint colour that came from a brush's light / dark default
844
+ * resolves to the new side. Editor state, not an undo step.
845
+ */
846
+ setColorScheme(scheme: ColorScheme): void;
847
+ /** Locks the paint colour: choosing a brush with a default colour keeps it. Editor state, not an undo step. */
848
+ setColorLocked(locked: boolean): void;
849
+ /**
850
+ * After the user chooses a brush: its solid or light / dark default colour becomes the paint
851
+ * colour (resolved for the colour scheme), unless the colour is locked. Gradient defaults are the
852
+ * brush's own paint already; effect defaults stay a suggestion.
853
+ */
854
+ private takeBrushColour;
855
+ /** A brush that always paints its own colour (`colour.own`): that colour, resolved for the scheme now; else `null`. */
856
+ private ownColour;
828
857
  /** Sets the paint colour (and goes back to one colour from gradient paint). */
829
858
  setColor(color: string): string;
830
859
  /**
@@ -18,6 +18,7 @@ import { CoverageMap, type BrushSettings, type Dab, type StrokePoint } from '../
18
18
  import type { RasterRect } from '../raster/surface.cjs';
19
19
  import type { PaintBrush } from './brushes.cjs';
20
20
  import { type EffectPaintPixels } from './effect-paint.cjs';
21
+ import type { StickerArtLookup } from './sticker-art.cjs';
21
22
  import { type PaperGrain } from './paper.cjs';
22
23
  /** One pen sample in document pixels. Every channel but x and y is optional. */
23
24
  export interface PenPoint {
@@ -126,6 +127,8 @@ export interface DryStrokeOptions {
126
127
  copies?: readonly StrokeCopy[];
127
128
  /** Effect paint: each pixel takes its colour (and alpha) from these canvas-sized pixels. */
128
129
  effect?: EffectPaintPixels | null;
130
+ /** Loaded sticker art, for a stamp tip of a sticker from the sticker library (`brush.stamp`); without it such a tip paints round. */
131
+ stampArt?: StickerArtLookup;
129
132
  }
130
133
  /**
131
134
  * One dab-engine stroke (dab and eraser brushes): smoothing, the dab walk of every copy, grain and
@@ -144,12 +147,16 @@ export declare class DryStroke {
144
147
  private field;
145
148
  private lastRaw;
146
149
  private lastFed;
150
+ /** The stamp tip's shape, or `null` for the round computed tip. */
151
+ private readonly stamp;
147
152
  constructor(brush: PaintBrush, options: DryStrokeOptions);
148
153
  /** Feeds raw pen samples; returns the document rectangles the new dabs touched. */
149
154
  push(points: readonly PenPoint[]): RasterRect[];
150
155
  /** Ends the stroke: the smoothed path catches up with the last raw sample; a single tap paints one dab. */
151
156
  finish(): RasterRect[];
152
157
  private paint;
158
+ /** Lays one mark (a dab, or a spray droplet of dab `d`): the round tip or the stamp, the paper grain, effect paint. */
159
+ private mark;
153
160
  }
154
161
  /** The shared engine's tip for the Mixer Brush engine (it smooths and walks by itself, so smoothing is applied before). */
155
162
  export declare function mixerTip(brush: PaintBrush): BrushSettings;
@@ -18,6 +18,7 @@ import { CoverageMap, type BrushSettings, type Dab, type StrokePoint } from '../
18
18
  import type { RasterRect } from '../raster/surface.js';
19
19
  import type { PaintBrush } from './brushes.js';
20
20
  import { type EffectPaintPixels } from './effect-paint.js';
21
+ import type { StickerArtLookup } from './sticker-art.js';
21
22
  import { type PaperGrain } from './paper.js';
22
23
  /** One pen sample in document pixels. Every channel but x and y is optional. */
23
24
  export interface PenPoint {
@@ -126,6 +127,8 @@ export interface DryStrokeOptions {
126
127
  copies?: readonly StrokeCopy[];
127
128
  /** Effect paint: each pixel takes its colour (and alpha) from these canvas-sized pixels. */
128
129
  effect?: EffectPaintPixels | null;
130
+ /** Loaded sticker art, for a stamp tip of a sticker from the sticker library (`brush.stamp`); without it such a tip paints round. */
131
+ stampArt?: StickerArtLookup;
129
132
  }
130
133
  /**
131
134
  * One dab-engine stroke (dab and eraser brushes): smoothing, the dab walk of every copy, grain and
@@ -144,12 +147,16 @@ export declare class DryStroke {
144
147
  private field;
145
148
  private lastRaw;
146
149
  private lastFed;
150
+ /** The stamp tip's shape, or `null` for the round computed tip. */
151
+ private readonly stamp;
147
152
  constructor(brush: PaintBrush, options: DryStrokeOptions);
148
153
  /** Feeds raw pen samples; returns the document rectangles the new dabs touched. */
149
154
  push(points: readonly PenPoint[]): RasterRect[];
150
155
  /** Ends the stroke: the smoothed path catches up with the last raw sample; a single tap paints one dab. */
151
156
  finish(): RasterRect[];
152
157
  private paint;
158
+ /** Lays one mark (a dab, or a spray droplet of dab `d`): the round tip or the stamp, the paper grain, effect paint. */
159
+ private mark;
153
160
  }
154
161
  /** The shared engine's tip for the Mixer Brush engine (it smooths and walks by itself, so smoothing is applied before). */
155
162
  export declare function mixerTip(brush: PaintBrush): BrushSettings;