@pixerate/editor 0.262.1 → 0.263.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 (68) 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 +52 -52
  4. package/dist/brushes/index.js +4 -4
  5. package/dist/{brushstrokeRender-N6UPZSQS.cjs → brushstrokeRender-2GBME4XD.cjs} +13 -13
  6. package/dist/{brushstrokeRender-25Q5BEY6.js → brushstrokeRender-S5DABANG.js} +3 -3
  7. package/dist/canvas/index.cjs +15 -14
  8. package/dist/canvas/index.js +3 -2
  9. package/dist/canvas/stickers.d.cts +5 -1
  10. package/dist/canvas/stickers.d.ts +5 -1
  11. package/dist/{chunk-6NZL24W4.js → chunk-34HIZXFX.js} +1 -1
  12. package/dist/{chunk-UVZ7RQOE.cjs → chunk-4E6BGHWN.cjs} +1 -1
  13. package/dist/{chunk-J5UQHWVL.js → chunk-6JL2D5SG.js} +27 -15
  14. package/dist/{chunk-QAR2N7HZ.js → chunk-6XX7E7O2.js} +1 -1
  15. package/dist/{chunk-3TQW5MPW.cjs → chunk-73QFSPDG.cjs} +23 -23
  16. package/dist/{chunk-APX63ILU.js → chunk-ACFSFUQH.js} +31 -0
  17. package/dist/{chunk-X2EXYY4J.js → chunk-CNLO6E2K.js} +2 -2
  18. package/dist/{chunk-F7CPSRLN.js → chunk-DOZ6F2K2.js} +12 -4
  19. package/dist/{chunk-CQVTGBQI.js → chunk-JGI4PZWO.js} +1 -1
  20. package/dist/{chunk-EHALWBBD.js → chunk-LG6MEEV7.js} +1 -1
  21. package/dist/{chunk-7AUQ2UJ3.cjs → chunk-LWHUU6A6.cjs} +10 -10
  22. package/dist/{chunk-JSDND7DF.cjs → chunk-OTN6VB5S.cjs} +32 -1
  23. package/dist/{chunk-5IW65VQ6.js → chunk-P5343XZO.js} +1 -1
  24. package/dist/{chunk-AVTPZO4Z.cjs → chunk-PE6YJMQT.cjs} +37 -25
  25. package/dist/{chunk-D4TE5JNW.js → chunk-QW7LKWKE.js} +1 -1
  26. package/dist/{chunk-YLUIFXSL.cjs → chunk-TIHW7CUY.cjs} +35 -35
  27. package/dist/{chunk-PYTJBVW5.cjs → chunk-TILEUVRO.cjs} +31 -31
  28. package/dist/{chunk-RVGP2XLF.cjs → chunk-XORJ7UZO.cjs} +21 -13
  29. package/dist/{chunk-43NT242D.cjs → chunk-XQW6R7VW.cjs} +86 -86
  30. package/dist/{chunk-TZOX7KWV.cjs → chunk-ZBACQHW3.cjs} +8 -8
  31. package/dist/image-editor/index.cjs +789 -788
  32. package/dist/image-editor/index.js +7 -6
  33. package/dist/image-editor/stickers.d.cts +7 -2
  34. package/dist/image-editor/stickers.d.ts +7 -2
  35. package/dist/paint-editor/controller.d.cts +7 -2
  36. package/dist/paint-editor/controller.d.ts +7 -2
  37. package/dist/paint-editor/index.cjs +574 -521
  38. package/dist/paint-editor/index.js +97 -44
  39. package/dist/paint-editor/sticker-art.d.cts +20 -10
  40. package/dist/paint-editor/sticker-art.d.ts +20 -10
  41. package/dist/paint-editor/stickers.d.cts +8 -1
  42. package/dist/paint-editor/stickers.d.ts +8 -1
  43. package/dist/paint-editor/stroke.d.cts +2 -0
  44. package/dist/paint-editor/stroke.d.ts +2 -0
  45. package/dist/stickers/browser.d.cts +10 -3
  46. package/dist/stickers/browser.d.ts +10 -3
  47. package/dist/stickers/combine.d.cts +2 -0
  48. package/dist/stickers/combine.d.ts +2 -0
  49. package/dist/stickers/conformance.d.cts +1 -1
  50. package/dist/stickers/conformance.d.ts +1 -1
  51. package/dist/stickers/errors.d.cts +1 -1
  52. package/dist/stickers/errors.d.ts +1 -1
  53. package/dist/stickers/fake.d.cts +4 -2
  54. package/dist/stickers/fake.d.ts +4 -2
  55. package/dist/stickers/helpers.d.cts +16 -2
  56. package/dist/stickers/helpers.d.ts +16 -2
  57. package/dist/stickers/index.cjs +116 -29
  58. package/dist/stickers/index.js +106 -19
  59. package/dist/stickers/tools.d.cts +9 -2
  60. package/dist/stickers/tools.d.ts +9 -2
  61. package/dist/stickers/types.d.cts +32 -5
  62. package/dist/stickers/types.d.ts +32 -5
  63. package/dist/vector/index.cjs +972 -971
  64. package/dist/vector/index.js +7 -6
  65. package/dist/vector/stickers.d.cts +7 -2
  66. package/dist/vector/stickers.d.ts +7 -2
  67. package/package.json +1 -1
  68. package/skills/pixerate-stickers/SKILL.md +20 -9
@@ -8,7 +8,7 @@ import {
8
8
  parseOpenTypeFont,
9
9
  removeAnchorsKeepingShape,
10
10
  traceField
11
- } from "../chunk-CQVTGBQI.js";
11
+ } from "../chunk-JGI4PZWO.js";
12
12
  import {
13
13
  ADJUSTMENT_KEYS,
14
14
  ADJUSTMENT_KINDS,
@@ -410,7 +410,7 @@ import {
410
410
  writePsd,
411
411
  xyToTempTint,
412
412
  xyToUv
413
- } from "../chunk-D4TE5JNW.js";
413
+ } from "../chunk-QW7LKWKE.js";
414
414
  import {
415
415
  ColorGmm,
416
416
  DEFAULT_REFINE_EDGE_PARAMS,
@@ -770,15 +770,15 @@ import {
770
770
  warpMeshParamAt,
771
771
  warpMeshRows,
772
772
  warpPresetMesh
773
- } from "../chunk-6NZL24W4.js";
773
+ } from "../chunk-34HIZXFX.js";
774
774
  import {
775
775
  IMAGE_PROFILE,
776
776
  checkBrush,
777
777
  closest,
778
778
  createBrushLibrary,
779
779
  resolveBrush
780
- } from "../chunk-5IW65VQ6.js";
781
- import "../chunk-APX63ILU.js";
780
+ } from "../chunk-P5343XZO.js";
781
+ import "../chunk-ACFSFUQH.js";
782
782
  import "../chunk-M6DNZNVY.js";
783
783
  import {
784
784
  bezierPathToSvg,
@@ -21482,10 +21482,11 @@ var ContentAwareFillSession = class _ContentAwareFillSession {
21482
21482
  };
21483
21483
 
21484
21484
  // src/image-editor/stickers.ts
21485
- function createImageStickerHost(controller) {
21485
+ function createImageStickerHost(controller, options = {}) {
21486
21486
  return {
21487
21487
  noun: "pixel layer",
21488
21488
  format: "png",
21489
+ ...options.dark ? { dark: options.dark } : {},
21489
21490
  defaultCentre: () => {
21490
21491
  const { width, height } = controller.getCanvasSize();
21491
21492
  return { x: width / 2, y: height / 2 };
@@ -5,5 +5,10 @@
5
5
  */
6
6
  import type { StickerInsertHost } from '../stickers/tools.cjs';
7
7
  import type { ImageEditorController } from './controller.cjs';
8
- /** `insert_sticker` for an image editor: a new pixel layer named after the sticker, one undo step. */
9
- export declare function createImageStickerHost(controller: ImageEditorController): StickerInsertHost;
8
+ /**
9
+ * `insert_sticker` for an image editor: a new pixel layer named after the sticker, one undo step.
10
+ * With `dark` (the host's dark theme or picture), stickers that have a dark variant use it.
11
+ */
12
+ export declare function createImageStickerHost(controller: ImageEditorController, options?: {
13
+ dark?: () => boolean;
14
+ }): StickerInsertHost;
@@ -5,5 +5,10 @@
5
5
  */
6
6
  import type { StickerInsertHost } from '../stickers/tools.js';
7
7
  import type { ImageEditorController } from './controller.js';
8
- /** `insert_sticker` for an image editor: a new pixel layer named after the sticker, one undo step. */
9
- export declare function createImageStickerHost(controller: ImageEditorController): StickerInsertHost;
8
+ /**
9
+ * `insert_sticker` for an image editor: a new pixel layer named after the sticker, one undo step.
10
+ * With `dark` (the host's dark theme or picture), stickers that have a dark variant use it.
11
+ */
12
+ export declare function createImageStickerHost(controller: ImageEditorController, options?: {
13
+ dark?: () => boolean;
14
+ }): StickerInsertHost;
@@ -1289,15 +1289,20 @@ export declare class PaintEditorController {
1289
1289
  setStickersProvider(provider: StickerProvider | null): void;
1290
1290
  /**
1291
1291
  * Loads the art of `refs` (provider stickers; editor stamps need none) so sprays and placements
1292
- * can draw them. Rejects with a `PaintEditorError` naming an unknown ref and the closest known
1292
+ * can draw them: their dark variants when the colour scheme is dark and they have one. Rejects with a `PaintEditorError` naming an unknown ref and the closest known
1293
1293
  * ones, or a sticker whose art failed. Emits when art arrives, so views redraw.
1294
1294
  */
1295
1295
  prepareStickers(refs: readonly StickerRef[]): Promise<void>;
1296
- /** Whether a sticker's art is ready to draw: `ready` (always for editor stamps), `loading`, `failed` (with why) or `none`. */
1296
+ /** Whether a sticker's art is ready to draw in the variant the colour scheme picks: `ready` (always for editor stamps), `loading`, `failed` (with why) or `none`. */
1297
1297
  stickerArtStatus(ref: StickerRef): {
1298
1298
  status: 'ready' | 'loading' | 'failed' | 'none';
1299
1299
  error?: string;
1300
1300
  };
1301
+ /**
1302
+ * A sticker whose ref is new (placed or restamped) in the variant the colour scheme picks: `dark`
1303
+ * on a dark scheme when its sticker has one (known once its art was asked for).
1304
+ */
1305
+ private withStickerVariant;
1301
1306
  private readStickerRef;
1302
1307
  /** Refuses to redraw stickers whose art has not loaded (they would vanish), naming them and what to call. */
1303
1308
  private requireStickerArt;
@@ -1289,15 +1289,20 @@ export declare class PaintEditorController {
1289
1289
  setStickersProvider(provider: StickerProvider | null): void;
1290
1290
  /**
1291
1291
  * Loads the art of `refs` (provider stickers; editor stamps need none) so sprays and placements
1292
- * can draw them. Rejects with a `PaintEditorError` naming an unknown ref and the closest known
1292
+ * can draw them: their dark variants when the colour scheme is dark and they have one. Rejects with a `PaintEditorError` naming an unknown ref and the closest known
1293
1293
  * ones, or a sticker whose art failed. Emits when art arrives, so views redraw.
1294
1294
  */
1295
1295
  prepareStickers(refs: readonly StickerRef[]): Promise<void>;
1296
- /** Whether a sticker's art is ready to draw: `ready` (always for editor stamps), `loading`, `failed` (with why) or `none`. */
1296
+ /** Whether a sticker's art is ready to draw in the variant the colour scheme picks: `ready` (always for editor stamps), `loading`, `failed` (with why) or `none`. */
1297
1297
  stickerArtStatus(ref: StickerRef): {
1298
1298
  status: 'ready' | 'loading' | 'failed' | 'none';
1299
1299
  error?: string;
1300
1300
  };
1301
+ /**
1302
+ * A sticker whose ref is new (placed or restamped) in the variant the colour scheme picks: `dark`
1303
+ * on a dark scheme when its sticker has one (known once its art was asked for).
1304
+ */
1305
+ private withStickerVariant;
1301
1306
  private readStickerRef;
1302
1307
  /** Refuses to redraw stickers whose art has not loaded (they would vanish), naming them and what to call. */
1303
1308
  private requireStickerArt;