@pixerate/editor 0.248.0 → 0.250.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/README.md +1 -0
  2. package/dist/animation-editor/index.cjs +118 -114
  3. package/dist/animation-editor/index.js +11 -7
  4. package/dist/{brushstrokeRender-QLCXROJK.js → brushstrokeRender-2FHFLSEG.js} +8 -4
  5. package/dist/{brushstrokeRender-DTDPFBLC.cjs → brushstrokeRender-QGRXOKDA.cjs} +15 -11
  6. package/dist/canvas/index.cjs +71 -15
  7. package/dist/canvas/index.d.cts +1 -0
  8. package/dist/canvas/index.d.ts +1 -0
  9. package/dist/canvas/index.js +58 -2
  10. package/dist/canvas/stickers.d.cts +35 -0
  11. package/dist/canvas/stickers.d.ts +35 -0
  12. package/dist/{chunk-RXZL4NG5.js → chunk-226QDRO3.js} +1 -1
  13. package/dist/{chunk-SC2RZ5EF.js → chunk-2VJAVXLI.js} +2 -2
  14. package/dist/{chunk-OLNIPTB3.cjs → chunk-2VX55NFM.cjs} +1 -320
  15. package/dist/chunk-3K6HWEXZ.cjs +92 -0
  16. package/dist/{chunk-UOOK7HTX.js → chunk-3PPJRMIG.js} +1 -1
  17. package/dist/{chunk-ZFSLEOSQ.js → chunk-3TWOCSCY.js} +11 -9
  18. package/dist/chunk-4D6KP5BV.js +92 -0
  19. package/dist/chunk-4JNWA3VT.cjs +302 -0
  20. package/dist/{chunk-L3JFOTBQ.js → chunk-5E2Q7ZHI.js} +1 -1
  21. package/dist/{chunk-2ONK3ERD.cjs → chunk-75K3W4D6.cjs} +20 -20
  22. package/dist/{chunk-AU6MWQKZ.js → chunk-ABL7IWFZ.js} +1 -1
  23. package/dist/chunk-ATK6ABN3.cjs +303 -0
  24. package/dist/{chunk-7T7JWTVE.cjs → chunk-BOHDJJ2O.cjs} +8 -8
  25. package/dist/{chunk-2PBZBRP5.js → chunk-D5KGAO4Z.js} +10 -92
  26. package/dist/{chunk-HB4ICNNA.cjs → chunk-DPYAO5U6.cjs} +42 -42
  27. package/dist/{chunk-6G6ZDDDB.cjs → chunk-GT77U7QG.cjs} +303 -149
  28. package/dist/{chunk-PQ3H2AAN.cjs → chunk-I7NJPHWV.cjs} +122 -204
  29. package/dist/{chunk-42TWUPNJ.js → chunk-IRSTHLQQ.js} +1 -320
  30. package/dist/{chunk-GHCSC2WP.cjs → chunk-ISIO63Q5.cjs} +21 -15
  31. package/dist/{chunk-OFH6Q67U.js → chunk-JA57JIT5.js} +9 -3
  32. package/dist/{chunk-VMROIWLL.cjs → chunk-KBYB7OWB.cjs} +3 -3
  33. package/dist/{chunk-Q2HA52V4.js → chunk-KDLBJ6QR.js} +2 -2
  34. package/dist/{chunk-WVS5KQDH.cjs → chunk-M2VKFE5L.cjs} +246 -244
  35. package/dist/{chunk-5GLYUSNT.js → chunk-NOHJP5TK.js} +1 -1
  36. package/dist/{chunk-XNRBMYNB.js → chunk-NTRAVM2I.js} +1 -1
  37. package/dist/{chunk-VNBUDVD4.js → chunk-OTEPAQJX.js} +228 -74
  38. package/dist/chunk-OTTT5N3K.js +322 -0
  39. package/dist/{chunk-QOBCBGGI.cjs → chunk-QKXO6JPP.cjs} +14 -14
  40. package/dist/{chunk-NZ3O3A5C.js → chunk-SMSGP2HQ.js} +1 -1
  41. package/dist/chunk-SZTI6EER.js +13 -0
  42. package/dist/chunk-U4NUOKBT.js +303 -0
  43. package/dist/chunk-U67EN7GG.cjs +13 -0
  44. package/dist/chunk-W5M3J7PV.cjs +322 -0
  45. package/dist/{chunk-4P6H35HU.js → chunk-WA44NKPF.js} +2 -2
  46. package/dist/chunk-WKH5ZAUA.js +302 -0
  47. package/dist/{chunk-L6REDLNB.cjs → chunk-WPUXGDH4.cjs} +7 -7
  48. package/dist/{chunk-P3NIPIKS.js → chunk-WQCNC4DK.js} +1 -1
  49. package/dist/{chunk-IBDU6EGZ.cjs → chunk-X7WRL5ZZ.cjs} +35 -35
  50. package/dist/{chunk-XWTRATIM.cjs → chunk-YM6ZBTXG.cjs} +23 -23
  51. package/dist/{chunk-TPWB4Y6L.cjs → chunk-YW43M56C.cjs} +1 -1
  52. package/dist/{chunk-K5DS2JTA.cjs → chunk-Z3BRH4JK.cjs} +6 -6
  53. package/dist/{chunk-XNZFVYC2.cjs → chunk-ZBCT5MEA.cjs} +7 -7
  54. package/dist/effects/helpers.d.cts +6 -0
  55. package/dist/effects/helpers.d.ts +6 -0
  56. package/dist/effects/index.cjs +62 -60
  57. package/dist/effects/index.js +5 -3
  58. package/dist/effects/tools.d.cts +6 -0
  59. package/dist/effects/tools.d.ts +6 -0
  60. package/dist/image-editor/effects.d.cts +1 -1
  61. package/dist/image-editor/effects.d.ts +1 -1
  62. package/dist/image-editor/index.cjs +1097 -1069
  63. package/dist/image-editor/index.d.cts +1 -0
  64. package/dist/image-editor/index.d.ts +1 -0
  65. package/dist/image-editor/index.js +58 -30
  66. package/dist/image-editor/stickers.d.cts +9 -0
  67. package/dist/image-editor/stickers.d.ts +9 -0
  68. package/dist/paint/index.cjs +8 -5
  69. package/dist/paint/index.js +13 -10
  70. package/dist/paint-editor/controller.d.cts +37 -1
  71. package/dist/paint-editor/controller.d.ts +37 -1
  72. package/dist/paint-editor/index.cjs +753 -609
  73. package/dist/paint-editor/index.d.cts +3 -0
  74. package/dist/paint-editor/index.d.ts +3 -0
  75. package/dist/paint-editor/index.js +187 -43
  76. package/dist/paint-editor/sticker-art.d.cts +55 -0
  77. package/dist/paint-editor/sticker-art.d.ts +55 -0
  78. package/dist/paint-editor/stickers.d.cts +30 -17
  79. package/dist/paint-editor/stickers.d.ts +30 -17
  80. package/dist/paint-editor/stroke.d.cts +4 -0
  81. package/dist/paint-editor/stroke.d.ts +4 -0
  82. package/dist/paint-editor/ui.d.cts +10 -2
  83. package/dist/paint-editor/ui.d.ts +10 -2
  84. package/dist/raster/index.cjs +6 -4
  85. package/dist/raster/index.js +12 -10
  86. package/dist/stickers/browser.d.cts +48 -0
  87. package/dist/stickers/browser.d.ts +48 -0
  88. package/dist/stickers/combine.d.cts +10 -0
  89. package/dist/stickers/combine.d.ts +10 -0
  90. package/dist/stickers/conformance.d.cts +18 -0
  91. package/dist/stickers/conformance.d.ts +18 -0
  92. package/dist/stickers/editor.d.cts +14 -0
  93. package/dist/stickers/editor.d.ts +14 -0
  94. package/dist/stickers/errors.d.cts +6 -0
  95. package/dist/stickers/errors.d.ts +6 -0
  96. package/dist/stickers/fake.d.cts +16 -0
  97. package/dist/stickers/fake.d.ts +16 -0
  98. package/dist/stickers/helpers.d.cts +51 -0
  99. package/dist/stickers/helpers.d.ts +51 -0
  100. package/dist/stickers/index.cjs +337 -0
  101. package/dist/stickers/index.d.cts +16 -0
  102. package/dist/stickers/index.d.ts +16 -0
  103. package/dist/stickers/index.js +337 -0
  104. package/dist/stickers/stamps.d.cts +13 -0
  105. package/dist/stickers/stamps.d.ts +13 -0
  106. package/dist/stickers/tools.d.cts +81 -0
  107. package/dist/stickers/tools.d.ts +81 -0
  108. package/dist/stickers/types.d.cts +123 -0
  109. package/dist/stickers/types.d.ts +123 -0
  110. package/dist/vector/index.cjs +1018 -981
  111. package/dist/vector/index.d.cts +1 -0
  112. package/dist/vector/index.d.ts +1 -0
  113. package/dist/vector/index.js +44 -7
  114. package/dist/vector/stickers.d.cts +11 -0
  115. package/dist/vector/stickers.d.ts +11 -0
  116. package/dist/video-editor/index.cjs +344 -344
  117. package/dist/video-editor/index.js +4 -4
  118. package/package.json +11 -1
  119. package/skills/README.md +1 -0
  120. package/skills/pixerate-image-editor/SKILL.md +1 -1
  121. package/skills/pixerate-paint-editor/SKILL.md +8 -5
  122. package/skills/pixerate-stickers/SKILL.md +57 -0
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Art for stickers from a sticker provider (anything but the editor's own procedural stamps): the
3
+ * spray brush draws while a stroke is in progress, so it can't wait for a provider. Each sticker
4
+ * is loaded once, rasterised to RGBA and kept here; drawing reads it synchronously.
5
+ *
6
+ * PNG art (`data:` URLs) is decoded here, in any environment. SVG and `https:` images need a
7
+ * rasteriser: the browser's (`createImageBitmap` and `OffscreenCanvas`) by default, or the
8
+ * host's (`PaintEditorOptions.rasterizeSticker`).
9
+ */
10
+ import type { StickerAsset, StickerProvider, StickerRef } from '../stickers/types.js';
11
+ /** Rasterised sticker art (straight RGBA) and whether to recolour it. */
12
+ export interface StickerArt {
13
+ width: number;
14
+ height: number;
15
+ data: Uint8ClampedArray;
16
+ /** Flat art: drawn in the sticker's colour, keeping its alpha. */
17
+ tintable: boolean;
18
+ }
19
+ /** The art for a ref, when it has loaded. */
20
+ export type StickerArtLookup = (ref: StickerRef) => StickerArt | undefined;
21
+ /** Turns a sticker asset into RGBA at about `size` px on its longest side. */
22
+ export type StickerRasterizer = (asset: StickerAsset, size: number) => Promise<{
23
+ width: number;
24
+ height: number;
25
+ data: Uint8ClampedArray;
26
+ }>;
27
+ /** Longest side sticker art is kept at (px); larger stickers are drawn from it, smoothly scaled. */
28
+ export declare const STICKER_ART_SIZE = 256;
29
+ /**
30
+ * Decodes PNG data URLs anywhere; draws SVG and other images with the browser's
31
+ * `createImageBitmap` and `OffscreenCanvas` when present, and otherwise refuses, naming the option
32
+ * that adds a rasteriser.
33
+ */
34
+ export declare const defaultStickerRasterizer: StickerRasterizer;
35
+ /** Loaded sticker art by ref, with the state of each load. */
36
+ export declare class StickerArtCache {
37
+ private readonly entries;
38
+ /** The art for `ref` when it has loaded (editor stamps never need any). */
39
+ get: StickerArtLookup;
40
+ /** `ready`, `loading`, `failed` (with the reason) or `none` (never asked for). Editor stamps are always `ready`. */
41
+ status(ref: StickerRef): {
42
+ status: 'ready' | 'loading' | 'failed' | 'none';
43
+ error?: string;
44
+ };
45
+ /**
46
+ * Loads and rasterises `ref` from `provider` once (later calls share the load). Unknown refs
47
+ * reject with the closest known ones; failures are kept so they are reported, and retried on
48
+ * the next call.
49
+ */
50
+ ensure(provider: StickerProvider, ref: StickerRef, rasterize: StickerRasterizer): Promise<StickerArt | null>;
51
+ /** Forgets every load (a new provider). */
52
+ clear(): void;
53
+ }
54
+ /** Bilinear RGBA sample of `art` at (x, y) in its pixels (straight alpha, colour weighted by alpha). */
55
+ export declare function sampleArt(art: StickerArt, x: number, y: number, out: number[]): number[];
@@ -14,13 +14,18 @@ import { TileMedium, type PaintTileTarget } from '../paint/exchange.cjs';
14
14
  import { type PaintGradientSource } from '../paint/gradient-paint.cjs';
15
15
  import type { PaintBrush } from './brushes.cjs';
16
16
  import { type PenPoint, type StrokeCopy } from './engine.cjs';
17
+ import { type StampKind } from '../stickers/stamps.cjs';
18
+ import type { StickerRef } from '../stickers/types.cjs';
19
+ import { type StickerArtLookup } from './sticker-art.cjs';
20
+ export { STAMP_KINDS, stampCoverage, type StampKind } from '../stickers/stamps.cjs';
17
21
  import { type EffectPaintPixels } from './effect-paint.cjs';
18
- export type StampKind = 'dot' | 'star' | 'heart' | 'leaf' | 'flower' | 'confetti' | 'splat' | 'sparkle' | 'ring';
19
- export declare const STAMP_KINDS: readonly StampKind[];
20
22
  /** One sticker (document pixels). */
21
23
  export interface Sticker {
22
24
  id: string;
23
- stamp: StampKind;
25
+ /** What it shows: a sticker ref (`provider:id`), e.g. `editor:star` or a host library's sticker. */
26
+ ref: StickerRef;
27
+ /** The editor stamp, when `ref` is one (`editor:star` → `star`); kept for documents and code that read it. */
28
+ stamp?: StampKind;
24
29
  x: number;
25
30
  y: number;
26
31
  /** Diameter in pixels. */
@@ -36,8 +41,11 @@ export interface Sticker {
36
41
  }
37
42
  /** Sticker spray settings (each 0..1 unless noted). */
38
43
  export interface StickerSettings {
39
- /** The stamps to spray (picked at random per sticker). */
40
- stamps: StampKind[];
44
+ /**
45
+ * The stickers to spray (one picked at random per sticker): refs `provider:id`. A bare editor
46
+ * stamp (`"star"`) is read as `editor:star`.
47
+ */
48
+ stamps: StickerRef[];
41
49
  /** How closely stickers follow each other: about `density × 4` per tip diameter of travel (0.25 ≈ one per diameter). */
42
50
  density: number;
43
51
  /** Random size change. */
@@ -49,20 +57,21 @@ export interface StickerSettings {
49
57
  /** Random colour change (hue and lightness). */
50
58
  colorJitter: number;
51
59
  }
60
+ /** At most this many stickers in a sticker brush. */
61
+ export declare const MAX_STICKER_STAMPS = 16;
52
62
  export declare const DEFAULT_STICKER: Readonly<StickerSettings>;
53
63
  export declare function normalizeStickerSettings(raw?: Partial<StickerSettings>, base?: StickerSettings): StickerSettings;
54
- /**
55
- * Coverage of a stamp at a point (u, v) of its unit square (−1..1, y down), 0..1, before shading.
56
- * `t` is the sticker's seed for shapes with random parts (splat, confetti).
57
- */
58
- export declare function stampCoverage(kind: StampKind, u: number, v: number, t: number): number;
59
64
  /** The pixel rectangle a sticker covers. */
60
65
  export declare function stickerRect(s: Sticker): RasterRect;
66
+ /** The editor stamp a sticker shows, or `null` for a provider's sticker. */
67
+ export declare function stickerStamp(s: Pick<Sticker, 'ref' | 'stamp'>): StampKind | null;
61
68
  /**
62
- * Draws one sticker through a `TileMedium` (straight source-over): the stamp's coverage, lit a
63
- * little from the top left and given a fine seeded texture, in its colour and opacity.
69
+ * Draws one sticker through a `TileMedium` (straight source-over). An editor stamp: its coverage,
70
+ * lit a little from the top left and given a fine seeded texture, in its colour and opacity. A
71
+ * provider's sticker: its loaded art (`art`), fitted into the sticker's size and turned, in its
72
+ * own colours or, when tintable, in the sticker's colour; nothing until the art has loaded.
64
73
  */
65
- export declare function drawSticker(medium: TileMedium, s: Sticker): RasterRect;
74
+ export declare function drawSticker(medium: TileMedium, s: Sticker, art?: StickerArtLookup): RasterRect;
66
75
  export interface StickerSprayInit {
67
76
  brush: PaintBrush;
68
77
  target: PaintTileTarget;
@@ -79,12 +88,16 @@ export interface StickerSprayInit {
79
88
  * stays recolourable); none lands where the effect is transparent.
80
89
  */
81
90
  effect?: EffectPaintPixels | null;
91
+ /** Loaded art for provider stickers; stickers without art yet are skipped (see `skipped`). */
92
+ art?: StickerArtLookup;
82
93
  }
83
94
  /** A sticker-spray stroke: drops stickers along the path and draws them as it goes. */
84
95
  export declare class StickerSpray {
85
96
  readonly init: StickerSprayInit;
86
97
  dabCount: number;
87
98
  readonly stickers: Sticker[];
99
+ /** Refs the spray picked but could not draw because their art had not loaded. */
100
+ readonly skipped: Set<string>;
88
101
  private readonly smoother;
89
102
  private readonly walkers;
90
103
  private readonly copies;
@@ -101,7 +114,7 @@ export declare class StickerSpray {
101
114
  private colorAt;
102
115
  }
103
116
  /** A sticker list rendered over a transparent layer, through a tile target. */
104
- export declare function renderStickers(stickers: readonly Sticker[], target: PaintTileTarget): void;
117
+ export declare function renderStickers(stickers: readonly Sticker[], target: PaintTileTarget, art?: StickerArtLookup): void;
105
118
  /** Checks and rounds a sticker change; throws a sentence naming the bad field. */
106
119
  export declare function normalizeStickerUpdate(u: Partial<Omit<Sticker, 'id'>>): Partial<Omit<Sticker, 'id'>>;
107
120
  /**
@@ -110,6 +123,6 @@ export declare function normalizeStickerUpdate(u: Partial<Omit<Sticker, 'id'>>):
110
123
  * drawn again, from the stickers that reach them; the rest are kept. The pixels are the same as a
111
124
  * full redraw, since a tile depends only on the stickers over it.
112
125
  */
113
- export declare function stickerSurface(stickers: readonly Sticker[], base?: TiledSurface, dirty?: readonly RasterRect[]): TiledSurface;
114
- /** The top-most sticker under a point (document pixels), by its stamp's shape, or `null`. */
115
- export declare function stickerAt(stickers: readonly Sticker[], x: number, y: number): Sticker | null;
126
+ export declare function stickerSurface(stickers: readonly Sticker[], base?: TiledSurface, dirty?: readonly RasterRect[], art?: StickerArtLookup): TiledSurface;
127
+ /** The top-most sticker under a point (document pixels), by its stamp's shape (or its art's alpha), or `null`. */
128
+ export declare function stickerAt(stickers: readonly Sticker[], x: number, y: number, art?: StickerArtLookup): Sticker | null;
@@ -14,13 +14,18 @@ import { TileMedium, type PaintTileTarget } from '../paint/exchange.js';
14
14
  import { type PaintGradientSource } from '../paint/gradient-paint.js';
15
15
  import type { PaintBrush } from './brushes.js';
16
16
  import { type PenPoint, type StrokeCopy } from './engine.js';
17
+ import { type StampKind } from '../stickers/stamps.js';
18
+ import type { StickerRef } from '../stickers/types.js';
19
+ import { type StickerArtLookup } from './sticker-art.js';
20
+ export { STAMP_KINDS, stampCoverage, type StampKind } from '../stickers/stamps.js';
17
21
  import { type EffectPaintPixels } from './effect-paint.js';
18
- export type StampKind = 'dot' | 'star' | 'heart' | 'leaf' | 'flower' | 'confetti' | 'splat' | 'sparkle' | 'ring';
19
- export declare const STAMP_KINDS: readonly StampKind[];
20
22
  /** One sticker (document pixels). */
21
23
  export interface Sticker {
22
24
  id: string;
23
- stamp: StampKind;
25
+ /** What it shows: a sticker ref (`provider:id`), e.g. `editor:star` or a host library's sticker. */
26
+ ref: StickerRef;
27
+ /** The editor stamp, when `ref` is one (`editor:star` → `star`); kept for documents and code that read it. */
28
+ stamp?: StampKind;
24
29
  x: number;
25
30
  y: number;
26
31
  /** Diameter in pixels. */
@@ -36,8 +41,11 @@ export interface Sticker {
36
41
  }
37
42
  /** Sticker spray settings (each 0..1 unless noted). */
38
43
  export interface StickerSettings {
39
- /** The stamps to spray (picked at random per sticker). */
40
- stamps: StampKind[];
44
+ /**
45
+ * The stickers to spray (one picked at random per sticker): refs `provider:id`. A bare editor
46
+ * stamp (`"star"`) is read as `editor:star`.
47
+ */
48
+ stamps: StickerRef[];
41
49
  /** How closely stickers follow each other: about `density × 4` per tip diameter of travel (0.25 ≈ one per diameter). */
42
50
  density: number;
43
51
  /** Random size change. */
@@ -49,20 +57,21 @@ export interface StickerSettings {
49
57
  /** Random colour change (hue and lightness). */
50
58
  colorJitter: number;
51
59
  }
60
+ /** At most this many stickers in a sticker brush. */
61
+ export declare const MAX_STICKER_STAMPS = 16;
52
62
  export declare const DEFAULT_STICKER: Readonly<StickerSettings>;
53
63
  export declare function normalizeStickerSettings(raw?: Partial<StickerSettings>, base?: StickerSettings): StickerSettings;
54
- /**
55
- * Coverage of a stamp at a point (u, v) of its unit square (−1..1, y down), 0..1, before shading.
56
- * `t` is the sticker's seed for shapes with random parts (splat, confetti).
57
- */
58
- export declare function stampCoverage(kind: StampKind, u: number, v: number, t: number): number;
59
64
  /** The pixel rectangle a sticker covers. */
60
65
  export declare function stickerRect(s: Sticker): RasterRect;
66
+ /** The editor stamp a sticker shows, or `null` for a provider's sticker. */
67
+ export declare function stickerStamp(s: Pick<Sticker, 'ref' | 'stamp'>): StampKind | null;
61
68
  /**
62
- * Draws one sticker through a `TileMedium` (straight source-over): the stamp's coverage, lit a
63
- * little from the top left and given a fine seeded texture, in its colour and opacity.
69
+ * Draws one sticker through a `TileMedium` (straight source-over). An editor stamp: its coverage,
70
+ * lit a little from the top left and given a fine seeded texture, in its colour and opacity. A
71
+ * provider's sticker: its loaded art (`art`), fitted into the sticker's size and turned, in its
72
+ * own colours or, when tintable, in the sticker's colour; nothing until the art has loaded.
64
73
  */
65
- export declare function drawSticker(medium: TileMedium, s: Sticker): RasterRect;
74
+ export declare function drawSticker(medium: TileMedium, s: Sticker, art?: StickerArtLookup): RasterRect;
66
75
  export interface StickerSprayInit {
67
76
  brush: PaintBrush;
68
77
  target: PaintTileTarget;
@@ -79,12 +88,16 @@ export interface StickerSprayInit {
79
88
  * stays recolourable); none lands where the effect is transparent.
80
89
  */
81
90
  effect?: EffectPaintPixels | null;
91
+ /** Loaded art for provider stickers; stickers without art yet are skipped (see `skipped`). */
92
+ art?: StickerArtLookup;
82
93
  }
83
94
  /** A sticker-spray stroke: drops stickers along the path and draws them as it goes. */
84
95
  export declare class StickerSpray {
85
96
  readonly init: StickerSprayInit;
86
97
  dabCount: number;
87
98
  readonly stickers: Sticker[];
99
+ /** Refs the spray picked but could not draw because their art had not loaded. */
100
+ readonly skipped: Set<string>;
88
101
  private readonly smoother;
89
102
  private readonly walkers;
90
103
  private readonly copies;
@@ -101,7 +114,7 @@ export declare class StickerSpray {
101
114
  private colorAt;
102
115
  }
103
116
  /** A sticker list rendered over a transparent layer, through a tile target. */
104
- export declare function renderStickers(stickers: readonly Sticker[], target: PaintTileTarget): void;
117
+ export declare function renderStickers(stickers: readonly Sticker[], target: PaintTileTarget, art?: StickerArtLookup): void;
105
118
  /** Checks and rounds a sticker change; throws a sentence naming the bad field. */
106
119
  export declare function normalizeStickerUpdate(u: Partial<Omit<Sticker, 'id'>>): Partial<Omit<Sticker, 'id'>>;
107
120
  /**
@@ -110,6 +123,6 @@ export declare function normalizeStickerUpdate(u: Partial<Omit<Sticker, 'id'>>):
110
123
  * drawn again, from the stickers that reach them; the rest are kept. The pixels are the same as a
111
124
  * full redraw, since a tile depends only on the stickers over it.
112
125
  */
113
- export declare function stickerSurface(stickers: readonly Sticker[], base?: TiledSurface, dirty?: readonly RasterRect[]): TiledSurface;
114
- /** The top-most sticker under a point (document pixels), by its stamp's shape, or `null`. */
115
- export declare function stickerAt(stickers: readonly Sticker[], x: number, y: number): Sticker | null;
126
+ export declare function stickerSurface(stickers: readonly Sticker[], base?: TiledSurface, dirty?: readonly RasterRect[], art?: StickerArtLookup): TiledSurface;
127
+ /** The top-most sticker under a point (document pixels), by its stamp's shape (or its art's alpha), or `null`. */
128
+ export declare function stickerAt(stickers: readonly Sticker[], x: number, y: number, art?: StickerArtLookup): Sticker | null;
@@ -20,6 +20,7 @@ import type { Affine } from './strokes.cjs';
20
20
  import type { WetStrokeDriver } from './wet.cjs';
21
21
  import { type ThickChannels } from './thick.cjs';
22
22
  import { type Sticker } from './stickers.cjs';
23
+ import type { StickerArtLookup } from './sticker-art.cjs';
23
24
  export interface StrokeSessionHost {
24
25
  /** Shows the layer's live surface (no history); `rects` are where it changed. */
25
26
  update(layerId: string, surface: TiledSurface, rects: RasterRect[]): void;
@@ -74,6 +75,7 @@ export interface StrokeSessionInit {
74
75
  /** Sticker brushes: the next sticker number on the layer. */
75
76
  sticker?: {
76
77
  nextId: number;
78
+ art?: StickerArtLookup;
77
79
  };
78
80
  /** Gradient paint (resolved: concrete colours), or `null` for the one colour. Recorded with the stroke. */
79
81
  paint?: PaintGradientSource | null;
@@ -104,6 +106,8 @@ export interface PaintStrokeResult {
104
106
  mixerLoad?: MixerLoad;
105
107
  /** Wet brushes: the paint is wet (it keeps moving until it dries; see dry_paint / advance_wet_paint). */
106
108
  wet?: boolean;
109
+ /** Sticker brushes: refs the spray picked but skipped because their art had not loaded yet. */
110
+ skippedStickers?: string[];
107
111
  }
108
112
  export declare class PaintStrokeSession {
109
113
  private readonly host;
@@ -20,6 +20,7 @@ import type { Affine } from './strokes.js';
20
20
  import type { WetStrokeDriver } from './wet.js';
21
21
  import { type ThickChannels } from './thick.js';
22
22
  import { type Sticker } from './stickers.js';
23
+ import type { StickerArtLookup } from './sticker-art.js';
23
24
  export interface StrokeSessionHost {
24
25
  /** Shows the layer's live surface (no history); `rects` are where it changed. */
25
26
  update(layerId: string, surface: TiledSurface, rects: RasterRect[]): void;
@@ -74,6 +75,7 @@ export interface StrokeSessionInit {
74
75
  /** Sticker brushes: the next sticker number on the layer. */
75
76
  sticker?: {
76
77
  nextId: number;
78
+ art?: StickerArtLookup;
77
79
  };
78
80
  /** Gradient paint (resolved: concrete colours), or `null` for the one colour. Recorded with the stroke. */
79
81
  paint?: PaintGradientSource | null;
@@ -104,6 +106,8 @@ export interface PaintStrokeResult {
104
106
  mixerLoad?: MixerLoad;
105
107
  /** Wet brushes: the paint is wet (it keeps moving until it dries; see dry_paint / advance_wet_paint). */
106
108
  wet?: boolean;
109
+ /** Sticker brushes: refs the spray picked but skipped because their art had not loaded yet. */
110
+ skippedStickers?: string[];
107
111
  }
108
112
  export declare class PaintStrokeSession {
109
113
  private readonly host;
@@ -16,7 +16,8 @@ import type { PenPoint } from './engine.cjs';
16
16
  import { type Point2 } from './guides.cjs';
17
17
  import { type StencilInput } from './stencils.cjs';
18
18
  import { type DotRotation, type DotTextureOrder, type ParticleKind, type ParticleRender, type RibbonPairs } from './procedural.cjs';
19
- import type { StampKind } from './stickers.cjs';
19
+ import { type StampKind } from './stickers.cjs';
20
+ import type { StickerRef } from '../stickers/types.cjs';
20
21
  import type { WetEngineInfo, WetGpuMode } from './wet.cjs';
21
22
  import { type PointerSample } from './input.cjs';
22
23
  import { type ColorWheel } from './color.cjs';
@@ -195,7 +196,7 @@ export interface BrushEngineControls {
195
196
  * (`particle.dotTextures` up to `MAX_DOT_TEXTURES` of `STAMP_KINDS`, `dotTextureOrder`, `dotRotation`).
196
197
  */
197
198
  particleMenus?: boolean;
198
- /** The sticker stamp toggles (`sticker.stamps`, `STAMP_KINDS`). */
199
+ /** The sticker picker for the brush's stickers (`sticker.stamps`, refs from the sticker library; `toggleStickerRef`). */
199
200
  stickerStamps?: boolean;
200
201
  /** Light paint: the "light follows pressure" toggle (`light.pressure`); the Light slider is in `sliders`. */
201
202
  light?: boolean;
@@ -264,6 +265,13 @@ export declare const DOT_ROTATION_LABELS: Readonly<Record<DotRotation, string>>;
264
265
  /** Labels of the sticker stamps. */
265
266
  export declare const STAMP_LABELS: Readonly<Record<StampKind, string>>;
266
267
  /** Toggles one stamp in a sticker brush's set (never leaving it empty). */
268
+ /**
269
+ * Toggles a sticker ref in a sticker brush's list (`sticker.stamps`): removes it when present (a
270
+ * brush keeps at least one), else adds it while there are fewer than `MAX_STICKER_STAMPS`.
271
+ */
272
+ export declare function toggleStickerRef(refs: readonly StickerRef[], ref: StickerRef): StickerRef[];
273
+ /** A short label for a sticker ref: the editor stamp's name, else the id after the provider. */
274
+ export declare function stickerRefLabel(ref: StickerRef): string;
267
275
  export declare function toggleStamp(stamps: readonly StampKind[], stamp: StampKind): StampKind[];
268
276
  /**
269
277
  * Toggles a textured-dot stamp (`particle.dotTextures`): removes it (every copy) when present,
@@ -16,7 +16,8 @@ import type { PenPoint } from './engine.js';
16
16
  import { type Point2 } from './guides.js';
17
17
  import { type StencilInput } from './stencils.js';
18
18
  import { type DotRotation, type DotTextureOrder, type ParticleKind, type ParticleRender, type RibbonPairs } from './procedural.js';
19
- import type { StampKind } from './stickers.js';
19
+ import { type StampKind } from './stickers.js';
20
+ import type { StickerRef } from '../stickers/types.js';
20
21
  import type { WetEngineInfo, WetGpuMode } from './wet.js';
21
22
  import { type PointerSample } from './input.js';
22
23
  import { type ColorWheel } from './color.js';
@@ -195,7 +196,7 @@ export interface BrushEngineControls {
195
196
  * (`particle.dotTextures` up to `MAX_DOT_TEXTURES` of `STAMP_KINDS`, `dotTextureOrder`, `dotRotation`).
196
197
  */
197
198
  particleMenus?: boolean;
198
- /** The sticker stamp toggles (`sticker.stamps`, `STAMP_KINDS`). */
199
+ /** The sticker picker for the brush's stickers (`sticker.stamps`, refs from the sticker library; `toggleStickerRef`). */
199
200
  stickerStamps?: boolean;
200
201
  /** Light paint: the "light follows pressure" toggle (`light.pressure`); the Light slider is in `sliders`. */
201
202
  light?: boolean;
@@ -264,6 +265,13 @@ export declare const DOT_ROTATION_LABELS: Readonly<Record<DotRotation, string>>;
264
265
  /** Labels of the sticker stamps. */
265
266
  export declare const STAMP_LABELS: Readonly<Record<StampKind, string>>;
266
267
  /** Toggles one stamp in a sticker brush's set (never leaving it empty). */
268
+ /**
269
+ * Toggles a sticker ref in a sticker brush's list (`sticker.stamps`): removes it when present (a
270
+ * brush keeps at least one), else adds it while there are fewer than `MAX_STICKER_STAMPS`.
271
+ */
272
+ export declare function toggleStickerRef(refs: readonly StickerRef[], ref: StickerRef): StickerRef[];
273
+ /** A short label for a sticker ref: the editor stamp's name, else the id after the provider. */
274
+ export declare function stickerRefLabel(ref: StickerRef): string;
267
275
  export declare function toggleStamp(stamps: readonly StampKind[], stamp: StampKind): StampKind[];
268
276
  /**
269
277
  * Toggles a textured-dot stamp (`particle.dotTextures`): removes it (every copy) when present,
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunk7T7JWTVEcjs = require('../chunk-7T7JWTVE.cjs');
7
+ var _chunkBOHDJJ2Ocjs = require('../chunk-BOHDJJ2O.cjs');
8
8
 
9
9
 
10
10
 
@@ -67,7 +67,7 @@ var _chunk7T7JWTVEcjs = require('../chunk-7T7JWTVE.cjs');
67
67
 
68
68
 
69
69
 
70
- var _chunkHB4ICNNAcjs = require('../chunk-HB4ICNNA.cjs');
70
+ var _chunkDPYAO5U6cjs = require('../chunk-DPYAO5U6.cjs');
71
71
  require('../chunk-QT26RHKK.cjs');
72
72
 
73
73
 
@@ -115,6 +115,7 @@ var _chunkK6PXS6DOcjs = require('../chunk-K6PXS6DO.cjs');
115
115
 
116
116
 
117
117
 
118
+ var _chunk2VX55NFMcjs = require('../chunk-2VX55NFM.cjs');
118
119
 
119
120
 
120
121
 
@@ -122,7 +123,8 @@ var _chunkK6PXS6DOcjs = require('../chunk-K6PXS6DO.cjs');
122
123
 
123
124
 
124
125
 
125
- var _chunkOLNIPTB3cjs = require('../chunk-OLNIPTB3.cjs');
126
+
127
+ var _chunkW5M3J7PVcjs = require('../chunk-W5M3J7PV.cjs');
126
128
 
127
129
 
128
130
 
@@ -528,4 +530,4 @@ function drawSurfaceToViewport(ctx, surface, mapping, view, options) {
528
530
 
529
531
 
530
532
 
531
- exports.BIT_DEPTHS = _chunkOLNIPTB3cjs.BIT_DEPTHS; exports.BLEND_MODES = _chunkOLNIPTB3cjs.BLEND_MODES; exports.CURVE_LUT_SIZE = _chunkHB4ICNNAcjs.CURVE_LUT_SIZE; exports.DEFAULT_GLOBAL_LIGHT = _chunkHB4ICNNAcjs.DEFAULT_GLOBAL_LIGHT; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkK6PXS6DOcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DeepCompositor = _chunkHB4ICNNAcjs.DeepCompositor; exports.INTERPOLATIONS = _chunkHB4ICNNAcjs.INTERPOLATIONS; exports.LAYER_EFFECT_KINDS = _chunkHB4ICNNAcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = _chunk7T7JWTVEcjs.LAYER_EFFECT_MENU; exports.LayerEffectError = _chunkHB4ICNNAcjs.LayerEffectError; exports.MAX_EFFECT_REACH = _chunkHB4ICNNAcjs.MAX_EFFECT_REACH; exports.MAX_TRANSFORM_PIXELS = _chunkHB4ICNNAcjs.MAX_TRANSFORM_PIXELS; exports.PAINTERLY_BLEND_MODES = _chunkOLNIPTB3cjs.PAINTERLY_BLEND_MODES; exports.PatternPlacement = _chunkHB4ICNNAcjs.PatternPlacement; exports.PatternTile = _chunkHB4ICNNAcjs.PatternTile; exports.RasterCompositor = _chunkHB4ICNNAcjs.RasterCompositor; exports.SHADOW_AMBIENT = _chunkOLNIPTB3cjs.SHADOW_AMBIENT; exports.STROKE_CHAMFER_MAX = _chunkHB4ICNNAcjs.STROKE_CHAMFER_MAX; exports.SurfaceDraft = _chunk474IQG74cjs.SurfaceDraft; exports.SurfaceViewportRenderer = SurfaceViewportRenderer; exports.TILE = _chunk474IQG74cjs.TILE; exports.TILE_SHIFT = _chunk474IQG74cjs.TILE_SHIFT; exports.TiledSurface = _chunk474IQG74cjs.TiledSurface; exports.TransformTooLargeError = _chunkHB4ICNNAcjs.TransformTooLargeError; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeEffectItems = _chunkHB4ICNNAcjs.activeEffectItems; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.applyEdgeAmbient = _chunkHB4ICNNAcjs.applyEdgeAmbient; exports.base64ToBytes = _chunkOLNIPTB3cjs.base64ToBytes; exports.blendChannel = _chunkOLNIPTB3cjs.blendChannel; exports.blendImageData = _chunkOLNIPTB3cjs.blendImageData; exports.blendLum = _chunkOLNIPTB3cjs.blendLum; exports.blendPixel = _chunkOLNIPTB3cjs.blendPixel; exports.blendRgb = _chunkOLNIPTB3cjs.blendRgb; exports.blendTile = _chunkHB4ICNNAcjs.blendTile; exports.buildEffectMaps = _chunkHB4ICNNAcjs.buildEffectMaps; exports.builtinPattern = _chunkHB4ICNNAcjs.builtinPattern; exports.builtinPatternIds = _chunkHB4ICNNAcjs.builtinPatternIds; exports.bytesToBase64 = _chunkOLNIPTB3cjs.bytesToBase64; exports.canvasCompositeOperation = _chunkOLNIPTB3cjs.canvasCompositeOperation; exports.changedTiles = _chunkHB4ICNNAcjs.changedTiles; exports.collectTiles = _chunk474IQG74cjs.collectTiles; exports.compositeLayerEffects = _chunkHB4ICNNAcjs.compositeLayerEffects; exports.compositeSurfaceOver = _chunkHB4ICNNAcjs.compositeSurfaceOver; exports.contentBounds = _chunk474IQG74cjs.contentBounds; exports.contourLut = _chunkHB4ICNNAcjs.contourLut; exports.convertSurfaceDepth = _chunkOLNIPTB3cjs.convertSurfaceDepth; exports.curveLut = _chunkHB4ICNNAcjs.curveLut; exports.decodePng = _chunkOLNIPTB3cjs.decodePng; exports.deepBytes = _chunkOLNIPTB3cjs.deepBytes; exports.deepTile = _chunkOLNIPTB3cjs.deepTile; exports.defaultEffectGradient = _chunkHB4ICNNAcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHB4ICNNAcjs.defaultLayerEffect; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthOf = _chunkOLNIPTB3cjs.depthOf; exports.drawSurfaceToViewport = drawSurfaceToViewport; exports.effectColorHex = _chunkHB4ICNNAcjs.effectColorHex; exports.effectControlChange = _chunk7T7JWTVEcjs.effectControlChange; exports.effectFillColors = _chunkHB4ICNNAcjs.effectFillColors; exports.effectReach = _chunkHB4ICNNAcjs.effectReach; exports.effectsAreLocal = _chunkHB4ICNNAcjs.effectsAreLocal; exports.effectsFingerprint = _chunkHB4ICNNAcjs.effectsFingerprint; exports.effectsMargin = _chunkHB4ICNNAcjs.effectsMargin; exports.effectsScale = _chunkHB4ICNNAcjs.effectsScale; exports.emptySurface = _chunk474IQG74cjs.emptySurface; exports.encodePng = _chunkOLNIPTB3cjs.encodePng; exports.fillRect = _chunk474IQG74cjs.fillRect; exports.findLayer = _chunkHB4ICNNAcjs.findLayer; exports.finishTile = _chunk474IQG74cjs.finishTile; exports.flattenLayers = _chunkHB4ICNNAcjs.flattenLayers; exports.gaussianBlur = _chunkK6PXS6DOcjs.gaussianBlur; exports.gradientT = _chunkHB4ICNNAcjs.gradientT; exports.hasActiveEffects = _chunkHB4ICNNAcjs.hasActiveEffects; exports.hashNoise = _chunkHB4ICNNAcjs.hashNoise; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertLayer = _chunkHB4ICNNAcjs.insertLayer; exports.isBitDepth = _chunkOLNIPTB3cjs.isBitDepth; exports.isBlendMode = _chunkOLNIPTB3cjs.isBlendMode; exports.isInterpolation = _chunkHB4ICNNAcjs.isInterpolation; exports.isLayerEffectKind = _chunkHB4ICNNAcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHB4ICNNAcjs.isLayerLocked; exports.isPainterlyBlendMode = _chunkOLNIPTB3cjs.isPainterlyBlendMode; exports.isPng = _chunkOLNIPTB3cjs.isPng; exports.isSeparableBlendMode = _chunkOLNIPTB3cjs.isSeparableBlendMode; exports.keepDeepSamples = _chunkOLNIPTB3cjs.keepDeepSamples; exports.keysWeight = _chunkHB4ICNNAcjs.keysWeight; exports.layerEffectControls = _chunk7T7JWTVEcjs.layerEffectControls; exports.layerEffectFields = _chunkHB4ICNNAcjs.layerEffectFields; exports.layerEffectLabel = _chunkHB4ICNNAcjs.layerEffectLabel; exports.layerEffectsBadge = _chunk7T7JWTVEcjs.layerEffectsBadge; exports.layerEffectsPanel = _chunk7T7JWTVEcjs.layerEffectsPanel; exports.mapLayer = _chunkHB4ICNNAcjs.mapLayer; exports.mergeLayerEffect = _chunkHB4ICNNAcjs.mergeLayerEffect; exports.mixPigment8 = _chunkOLNIPTB3cjs.mixPigment8; exports.mixPigmentRgb = _chunkOLNIPTB3cjs.mixPigmentRgb; exports.newEffectId = _chunkHB4ICNNAcjs.newEffectId; exports.normalizeBlendMode = _chunkOLNIPTB3cjs.normalizeBlendMode; exports.normalizeLayerEffects = _chunkHB4ICNNAcjs.normalizeLayerEffects; exports.packRgba = _chunk474IQG74cjs.packRgba; exports.parseDataUrl = _chunkOLNIPTB3cjs.parseDataUrl; exports.parseEffectColor = _chunkHB4ICNNAcjs.parseEffectColor; exports.patchEffectMaps = _chunkHB4ICNNAcjs.patchEffectMaps; exports.pigment8 = _chunkOLNIPTB3cjs.pigment8; exports.pngDataUrl = _chunkOLNIPTB3cjs.pngDataUrl; exports.proxyOf = _chunkOLNIPTB3cjs.proxyOf; exports.readDeepRegion = _chunkOLNIPTB3cjs.readDeepRegion; exports.readPixel = _chunk474IQG74cjs.readPixel; exports.readRegion = _chunk474IQG74cjs.readRegion; exports.reduceSurface = _chunkHB4ICNNAcjs.reduceSurface; exports.renderLayerEffects = _chunkHB4ICNNAcjs.renderLayerEffects; exports.scaleLayerEffect = _chunkHB4ICNNAcjs.scaleLayerEffect; exports.screenToWorld = screenToWorld; exports.setLum = _chunkOLNIPTB3cjs.setLum; exports.solidSurface = _chunk474IQG74cjs.solidSurface; exports.srgbDecode = _chunkOLNIPTB3cjs.srgbDecode; exports.srgbEncode = _chunkOLNIPTB3cjs.srgbEncode; exports.standardBlendMode = _chunkOLNIPTB3cjs.standardBlendMode; exports.surfaceBytes = _chunk474IQG74cjs.surfaceBytes; exports.surfaceDepth = _chunkOLNIPTB3cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkOLNIPTB3cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunk474IQG74cjs.surfaceFromPixels; exports.surfaceMipLevel = surfaceMipLevel; exports.surfaceResolutionForZoom = surfaceResolutionForZoom; exports.surfaceToWorld = surfaceToWorld; exports.surfacesEqual = _chunk474IQG74cjs.surfacesEqual; exports.tileCoord = _chunk474IQG74cjs.tileCoord; exports.tileKey = _chunk474IQG74cjs.tileKey; exports.tileRect = _chunk474IQG74cjs.tileRect; exports.tileSamples = _chunkOLNIPTB3cjs.tileSamples; exports.tileSamples16 = _chunkOLNIPTB3cjs.tileSamples16; exports.tileSamples32 = _chunkOLNIPTB3cjs.tileSamples32; exports.tilesInRect = _chunk474IQG74cjs.tilesInRect; exports.to16From32 = _chunkOLNIPTB3cjs.to16From32; exports.to16From8 = _chunkOLNIPTB3cjs.to16From8; exports.to32From16 = _chunkOLNIPTB3cjs.to32From16; exports.to32From8 = _chunkOLNIPTB3cjs.to32From8; exports.to8From16 = _chunkOLNIPTB3cjs.to8From16; exports.to8From32 = _chunkOLNIPTB3cjs.to8From32; exports.transformSurface = _chunkHB4ICNNAcjs.transformSurface; exports.transformedBounds = _chunkHB4ICNNAcjs.transformedBounds; exports.translateSurface = _chunk474IQG74cjs.translateSurface; exports.uniformTile = _chunk474IQG74cjs.uniformTile; exports.validateEffectGradient = _chunkHB4ICNNAcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHB4ICNNAcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHB4ICNNAcjs.validateLayerEffects; exports.visibleSurfaceRect = visibleSurfaceRect; exports.visibleWorldRect = visibleWorldRect; exports.warpSurface = _chunkHB4ICNNAcjs.warpSurface; exports.workingToSamples = _chunkHB4ICNNAcjs.workingToSamples; exports.worldRectToSurface = worldRectToSurface; exports.worldToSurface = worldToSurface; exports.writeDeepRegion = _chunkOLNIPTB3cjs.writeDeepRegion; exports.writeRegion = _chunk474IQG74cjs.writeRegion;
533
+ exports.BIT_DEPTHS = _chunk2VX55NFMcjs.BIT_DEPTHS; exports.BLEND_MODES = _chunk2VX55NFMcjs.BLEND_MODES; exports.CURVE_LUT_SIZE = _chunkDPYAO5U6cjs.CURVE_LUT_SIZE; exports.DEFAULT_GLOBAL_LIGHT = _chunkDPYAO5U6cjs.DEFAULT_GLOBAL_LIGHT; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkK6PXS6DOcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DeepCompositor = _chunkDPYAO5U6cjs.DeepCompositor; exports.INTERPOLATIONS = _chunkDPYAO5U6cjs.INTERPOLATIONS; exports.LAYER_EFFECT_KINDS = _chunkDPYAO5U6cjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = _chunkBOHDJJ2Ocjs.LAYER_EFFECT_MENU; exports.LayerEffectError = _chunkDPYAO5U6cjs.LayerEffectError; exports.MAX_EFFECT_REACH = _chunkDPYAO5U6cjs.MAX_EFFECT_REACH; exports.MAX_TRANSFORM_PIXELS = _chunkDPYAO5U6cjs.MAX_TRANSFORM_PIXELS; exports.PAINTERLY_BLEND_MODES = _chunk2VX55NFMcjs.PAINTERLY_BLEND_MODES; exports.PatternPlacement = _chunkDPYAO5U6cjs.PatternPlacement; exports.PatternTile = _chunkDPYAO5U6cjs.PatternTile; exports.RasterCompositor = _chunkDPYAO5U6cjs.RasterCompositor; exports.SHADOW_AMBIENT = _chunk2VX55NFMcjs.SHADOW_AMBIENT; exports.STROKE_CHAMFER_MAX = _chunkDPYAO5U6cjs.STROKE_CHAMFER_MAX; exports.SurfaceDraft = _chunk474IQG74cjs.SurfaceDraft; exports.SurfaceViewportRenderer = SurfaceViewportRenderer; exports.TILE = _chunk474IQG74cjs.TILE; exports.TILE_SHIFT = _chunk474IQG74cjs.TILE_SHIFT; exports.TiledSurface = _chunk474IQG74cjs.TiledSurface; exports.TransformTooLargeError = _chunkDPYAO5U6cjs.TransformTooLargeError; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeEffectItems = _chunkDPYAO5U6cjs.activeEffectItems; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.applyEdgeAmbient = _chunkDPYAO5U6cjs.applyEdgeAmbient; exports.base64ToBytes = _chunkW5M3J7PVcjs.base64ToBytes; exports.blendChannel = _chunk2VX55NFMcjs.blendChannel; exports.blendImageData = _chunk2VX55NFMcjs.blendImageData; exports.blendLum = _chunk2VX55NFMcjs.blendLum; exports.blendPixel = _chunk2VX55NFMcjs.blendPixel; exports.blendRgb = _chunk2VX55NFMcjs.blendRgb; exports.blendTile = _chunkDPYAO5U6cjs.blendTile; exports.buildEffectMaps = _chunkDPYAO5U6cjs.buildEffectMaps; exports.builtinPattern = _chunkDPYAO5U6cjs.builtinPattern; exports.builtinPatternIds = _chunkDPYAO5U6cjs.builtinPatternIds; exports.bytesToBase64 = _chunkW5M3J7PVcjs.bytesToBase64; exports.canvasCompositeOperation = _chunk2VX55NFMcjs.canvasCompositeOperation; exports.changedTiles = _chunkDPYAO5U6cjs.changedTiles; exports.collectTiles = _chunk474IQG74cjs.collectTiles; exports.compositeLayerEffects = _chunkDPYAO5U6cjs.compositeLayerEffects; exports.compositeSurfaceOver = _chunkDPYAO5U6cjs.compositeSurfaceOver; exports.contentBounds = _chunk474IQG74cjs.contentBounds; exports.contourLut = _chunkDPYAO5U6cjs.contourLut; exports.convertSurfaceDepth = _chunk2VX55NFMcjs.convertSurfaceDepth; exports.curveLut = _chunkDPYAO5U6cjs.curveLut; exports.decodePng = _chunkW5M3J7PVcjs.decodePng; exports.deepBytes = _chunk2VX55NFMcjs.deepBytes; exports.deepTile = _chunk2VX55NFMcjs.deepTile; exports.defaultEffectGradient = _chunkDPYAO5U6cjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkDPYAO5U6cjs.defaultLayerEffect; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthOf = _chunk2VX55NFMcjs.depthOf; exports.drawSurfaceToViewport = drawSurfaceToViewport; exports.effectColorHex = _chunkDPYAO5U6cjs.effectColorHex; exports.effectControlChange = _chunkBOHDJJ2Ocjs.effectControlChange; exports.effectFillColors = _chunkDPYAO5U6cjs.effectFillColors; exports.effectReach = _chunkDPYAO5U6cjs.effectReach; exports.effectsAreLocal = _chunkDPYAO5U6cjs.effectsAreLocal; exports.effectsFingerprint = _chunkDPYAO5U6cjs.effectsFingerprint; exports.effectsMargin = _chunkDPYAO5U6cjs.effectsMargin; exports.effectsScale = _chunkDPYAO5U6cjs.effectsScale; exports.emptySurface = _chunk474IQG74cjs.emptySurface; exports.encodePng = _chunkW5M3J7PVcjs.encodePng; exports.fillRect = _chunk474IQG74cjs.fillRect; exports.findLayer = _chunkDPYAO5U6cjs.findLayer; exports.finishTile = _chunk474IQG74cjs.finishTile; exports.flattenLayers = _chunkDPYAO5U6cjs.flattenLayers; exports.gaussianBlur = _chunkK6PXS6DOcjs.gaussianBlur; exports.gradientT = _chunkDPYAO5U6cjs.gradientT; exports.hasActiveEffects = _chunkDPYAO5U6cjs.hasActiveEffects; exports.hashNoise = _chunkDPYAO5U6cjs.hashNoise; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertLayer = _chunkDPYAO5U6cjs.insertLayer; exports.isBitDepth = _chunk2VX55NFMcjs.isBitDepth; exports.isBlendMode = _chunk2VX55NFMcjs.isBlendMode; exports.isInterpolation = _chunkDPYAO5U6cjs.isInterpolation; exports.isLayerEffectKind = _chunkDPYAO5U6cjs.isLayerEffectKind; exports.isLayerLocked = _chunkDPYAO5U6cjs.isLayerLocked; exports.isPainterlyBlendMode = _chunk2VX55NFMcjs.isPainterlyBlendMode; exports.isPng = _chunkW5M3J7PVcjs.isPng; exports.isSeparableBlendMode = _chunk2VX55NFMcjs.isSeparableBlendMode; exports.keepDeepSamples = _chunk2VX55NFMcjs.keepDeepSamples; exports.keysWeight = _chunkDPYAO5U6cjs.keysWeight; exports.layerEffectControls = _chunkBOHDJJ2Ocjs.layerEffectControls; exports.layerEffectFields = _chunkDPYAO5U6cjs.layerEffectFields; exports.layerEffectLabel = _chunkDPYAO5U6cjs.layerEffectLabel; exports.layerEffectsBadge = _chunkBOHDJJ2Ocjs.layerEffectsBadge; exports.layerEffectsPanel = _chunkBOHDJJ2Ocjs.layerEffectsPanel; exports.mapLayer = _chunkDPYAO5U6cjs.mapLayer; exports.mergeLayerEffect = _chunkDPYAO5U6cjs.mergeLayerEffect; exports.mixPigment8 = _chunk2VX55NFMcjs.mixPigment8; exports.mixPigmentRgb = _chunk2VX55NFMcjs.mixPigmentRgb; exports.newEffectId = _chunkDPYAO5U6cjs.newEffectId; exports.normalizeBlendMode = _chunk2VX55NFMcjs.normalizeBlendMode; exports.normalizeLayerEffects = _chunkDPYAO5U6cjs.normalizeLayerEffects; exports.packRgba = _chunk474IQG74cjs.packRgba; exports.parseDataUrl = _chunkW5M3J7PVcjs.parseDataUrl; exports.parseEffectColor = _chunkDPYAO5U6cjs.parseEffectColor; exports.patchEffectMaps = _chunkDPYAO5U6cjs.patchEffectMaps; exports.pigment8 = _chunk2VX55NFMcjs.pigment8; exports.pngDataUrl = _chunkW5M3J7PVcjs.pngDataUrl; exports.proxyOf = _chunk2VX55NFMcjs.proxyOf; exports.readDeepRegion = _chunk2VX55NFMcjs.readDeepRegion; exports.readPixel = _chunk474IQG74cjs.readPixel; exports.readRegion = _chunk474IQG74cjs.readRegion; exports.reduceSurface = _chunkDPYAO5U6cjs.reduceSurface; exports.renderLayerEffects = _chunkDPYAO5U6cjs.renderLayerEffects; exports.scaleLayerEffect = _chunkDPYAO5U6cjs.scaleLayerEffect; exports.screenToWorld = screenToWorld; exports.setLum = _chunk2VX55NFMcjs.setLum; exports.solidSurface = _chunk474IQG74cjs.solidSurface; exports.srgbDecode = _chunk2VX55NFMcjs.srgbDecode; exports.srgbEncode = _chunk2VX55NFMcjs.srgbEncode; exports.standardBlendMode = _chunk2VX55NFMcjs.standardBlendMode; exports.surfaceBytes = _chunk474IQG74cjs.surfaceBytes; exports.surfaceDepth = _chunk2VX55NFMcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunk2VX55NFMcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunk474IQG74cjs.surfaceFromPixels; exports.surfaceMipLevel = surfaceMipLevel; exports.surfaceResolutionForZoom = surfaceResolutionForZoom; exports.surfaceToWorld = surfaceToWorld; exports.surfacesEqual = _chunk474IQG74cjs.surfacesEqual; exports.tileCoord = _chunk474IQG74cjs.tileCoord; exports.tileKey = _chunk474IQG74cjs.tileKey; exports.tileRect = _chunk474IQG74cjs.tileRect; exports.tileSamples = _chunk2VX55NFMcjs.tileSamples; exports.tileSamples16 = _chunk2VX55NFMcjs.tileSamples16; exports.tileSamples32 = _chunk2VX55NFMcjs.tileSamples32; exports.tilesInRect = _chunk474IQG74cjs.tilesInRect; exports.to16From32 = _chunk2VX55NFMcjs.to16From32; exports.to16From8 = _chunk2VX55NFMcjs.to16From8; exports.to32From16 = _chunk2VX55NFMcjs.to32From16; exports.to32From8 = _chunk2VX55NFMcjs.to32From8; exports.to8From16 = _chunk2VX55NFMcjs.to8From16; exports.to8From32 = _chunk2VX55NFMcjs.to8From32; exports.transformSurface = _chunkDPYAO5U6cjs.transformSurface; exports.transformedBounds = _chunkDPYAO5U6cjs.transformedBounds; exports.translateSurface = _chunk474IQG74cjs.translateSurface; exports.uniformTile = _chunk474IQG74cjs.uniformTile; exports.validateEffectGradient = _chunkDPYAO5U6cjs.validateEffectGradient; exports.validateLayerEffect = _chunkDPYAO5U6cjs.validateLayerEffect; exports.validateLayerEffects = _chunkDPYAO5U6cjs.validateLayerEffects; exports.visibleSurfaceRect = visibleSurfaceRect; exports.visibleWorldRect = visibleWorldRect; exports.warpSurface = _chunkDPYAO5U6cjs.warpSurface; exports.workingToSamples = _chunkDPYAO5U6cjs.workingToSamples; exports.worldRectToSurface = worldRectToSurface; exports.worldToSurface = worldToSurface; exports.writeDeepRegion = _chunk2VX55NFMcjs.writeDeepRegion; exports.writeRegion = _chunk474IQG74cjs.writeRegion;
@@ -4,7 +4,7 @@ import {
4
4
  layerEffectControls,
5
5
  layerEffectsBadge,
6
6
  layerEffectsPanel
7
- } from "../chunk-SC2RZ5EF.js";
7
+ } from "../chunk-2VJAVXLI.js";
8
8
  import {
9
9
  CURVE_LUT_SIZE,
10
10
  DEFAULT_GLOBAL_LIGHT,
@@ -67,7 +67,7 @@ import {
67
67
  validateLayerEffects,
68
68
  warpSurface,
69
69
  workingToSamples
70
- } from "../chunk-UOOK7HTX.js";
70
+ } from "../chunk-3PPJRMIG.js";
71
71
  import "../chunk-OHKOFKBY.js";
72
72
  import {
73
73
  DIRECT_GAUSSIAN_MAX_SIGMA,
@@ -78,32 +78,25 @@ import {
78
78
  BLEND_MODES,
79
79
  PAINTERLY_BLEND_MODES,
80
80
  SHADOW_AMBIENT,
81
- base64ToBytes,
82
81
  blendChannel,
83
82
  blendImageData,
84
83
  blendLum,
85
84
  blendPixel,
86
85
  blendRgb,
87
- bytesToBase64,
88
86
  canvasCompositeOperation,
89
87
  convertSurfaceDepth,
90
- decodePng,
91
88
  deepBytes,
92
89
  deepTile,
93
90
  depthOf,
94
- encodePng,
95
91
  isBitDepth,
96
92
  isBlendMode,
97
93
  isPainterlyBlendMode,
98
- isPng,
99
94
  isSeparableBlendMode,
100
95
  keepDeepSamples,
101
96
  mixPigment8,
102
97
  mixPigmentRgb,
103
98
  normalizeBlendMode,
104
- parseDataUrl,
105
99
  pigment8,
106
- pngDataUrl,
107
100
  proxyOf,
108
101
  readDeepRegion,
109
102
  setLum,
@@ -122,7 +115,16 @@ import {
122
115
  to8From16,
123
116
  to8From32,
124
117
  writeDeepRegion
125
- } from "../chunk-42TWUPNJ.js";
118
+ } from "../chunk-IRSTHLQQ.js";
119
+ import {
120
+ base64ToBytes,
121
+ bytesToBase64,
122
+ decodePng,
123
+ encodePng,
124
+ isPng,
125
+ parseDataUrl,
126
+ pngDataUrl
127
+ } from "../chunk-OTTT5N3K.js";
126
128
  import {
127
129
  SurfaceDraft,
128
130
  TILE,
@@ -0,0 +1,48 @@
1
+ /**
2
+ * `StickerBrowser`: the state behind a sticker picker, shared by the React and Svelte pickers. It
3
+ * searches or lists the provider a page at a time (search words, category), keeps the pages it
4
+ * has loaded and its categories, and tells listeners when anything changes. UI-agnostic.
5
+ */
6
+ import type { StickerProvider, StickerRef, StickerSummary } from './types.cjs';
7
+ export interface StickerBrowserItem extends StickerSummary {
8
+ ref: StickerRef;
9
+ }
10
+ export interface StickerBrowserState {
11
+ query: string;
12
+ /** `''` for every category. */
13
+ category: string;
14
+ items: StickerBrowserItem[];
15
+ total: number;
16
+ /** More pages to load (`more()`). */
17
+ hasMore: boolean;
18
+ loading: boolean;
19
+ error: string | null;
20
+ categories: Array<{
21
+ id: string;
22
+ name: string;
23
+ count: number;
24
+ }>;
25
+ /** The provider's name. */
26
+ provider: string;
27
+ }
28
+ export declare class StickerBrowser {
29
+ private readonly provider;
30
+ private readonly pageSize;
31
+ private s;
32
+ private next;
33
+ private run;
34
+ private readonly listeners;
35
+ constructor(provider: () => StickerProvider, pageSize?: number);
36
+ get state(): StickerBrowserState;
37
+ subscribe(listener: () => void): () => void;
38
+ private set;
39
+ /** Loads the first page (and the categories) again, for the current provider. */
40
+ refresh(): Promise<void>;
41
+ /** Searches for `query` (words; `''` lists everything) from the first page. */
42
+ setQuery(query: string): Promise<void>;
43
+ /** Shows one category (`''` for all) from the first page. */
44
+ setCategory(category: string): Promise<void>;
45
+ /** Loads the next page onto the list. */
46
+ more(): Promise<void>;
47
+ private page;
48
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * `StickerBrowser`: the state behind a sticker picker, shared by the React and Svelte pickers. It
3
+ * searches or lists the provider a page at a time (search words, category), keeps the pages it
4
+ * has loaded and its categories, and tells listeners when anything changes. UI-agnostic.
5
+ */
6
+ import type { StickerProvider, StickerRef, StickerSummary } from './types.js';
7
+ export interface StickerBrowserItem extends StickerSummary {
8
+ ref: StickerRef;
9
+ }
10
+ export interface StickerBrowserState {
11
+ query: string;
12
+ /** `''` for every category. */
13
+ category: string;
14
+ items: StickerBrowserItem[];
15
+ total: number;
16
+ /** More pages to load (`more()`). */
17
+ hasMore: boolean;
18
+ loading: boolean;
19
+ error: string | null;
20
+ categories: Array<{
21
+ id: string;
22
+ name: string;
23
+ count: number;
24
+ }>;
25
+ /** The provider's name. */
26
+ provider: string;
27
+ }
28
+ export declare class StickerBrowser {
29
+ private readonly provider;
30
+ private readonly pageSize;
31
+ private s;
32
+ private next;
33
+ private run;
34
+ private readonly listeners;
35
+ constructor(provider: () => StickerProvider, pageSize?: number);
36
+ get state(): StickerBrowserState;
37
+ subscribe(listener: () => void): () => void;
38
+ private set;
39
+ /** Loads the first page (and the categories) again, for the current provider. */
40
+ refresh(): Promise<void>;
41
+ /** Searches for `query` (words; `''` lists everything) from the first page. */
42
+ setQuery(query: string): Promise<void>;
43
+ /** Shows one category (`''` for all) from the first page. */
44
+ setCategory(category: string): Promise<void>;
45
+ /** Loads the next page onto the list. */
46
+ more(): Promise<void>;
47
+ private page;
48
+ }
@@ -0,0 +1,10 @@
1
+ import type { StickerProvider } from './types.cjs';
2
+ /**
3
+ * One provider over several, in order. Its ids are refs (`provider:id`, `namespaced`), so the
4
+ * same id from two libraries stays two stickers. Pages run through the providers in turn; the
5
+ * cursor is `<provider index>|<that provider's cursor>`. Capabilities are what any of them offers.
6
+ */
7
+ export declare function combineStickerProviders(providers: readonly StickerProvider[], options?: {
8
+ id?: string;
9
+ name?: string;
10
+ }): StickerProvider;
@@ -0,0 +1,10 @@
1
+ import type { StickerProvider } from './types.js';
2
+ /**
3
+ * One provider over several, in order. Its ids are refs (`provider:id`, `namespaced`), so the
4
+ * same id from two libraries stays two stickers. Pages run through the providers in turn; the
5
+ * cursor is `<provider index>|<that provider's cursor>`. Capabilities are what any of them offers.
6
+ */
7
+ export declare function combineStickerProviders(providers: readonly StickerProvider[], options?: {
8
+ id?: string;
9
+ name?: string;
10
+ }): StickerProvider;