@pixerate/editor 0.259.0 → 0.260.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 (74) hide show
  1. package/dist/agent/index.cjs +2 -2
  2. package/dist/agent/index.js +1 -1
  3. package/dist/animation-editor/index.cjs +61 -59
  4. package/dist/animation-editor/index.js +5 -3
  5. package/dist/brushes/index.cjs +52 -52
  6. package/dist/brushes/index.js +6 -6
  7. package/dist/{brushstrokeRender-JI4W6F2G.js → brushstrokeRender-25Q5BEY6.js} +17 -7
  8. package/dist/{brushstrokeRender-MQ6PSDM5.cjs → brushstrokeRender-N6UPZSQS.cjs} +31 -21
  9. package/dist/canvas/brushTypes.d.cts +5 -0
  10. package/dist/canvas/brushTypes.d.ts +5 -0
  11. package/dist/canvas/drawController.d.cts +15 -1
  12. package/dist/canvas/drawController.d.ts +15 -1
  13. package/dist/canvas/index.cjs +136 -102
  14. package/dist/canvas/index.js +35 -1
  15. package/dist/{chunk-3PPJRMIG.js → chunk-3O47TPGX.js} +197 -18
  16. package/dist/{chunk-5Q5MLXAD.cjs → chunk-3TQW5MPW.cjs} +23 -23
  17. package/dist/{chunk-JBBJE76O.cjs → chunk-3ZRNK3RO.cjs} +1138 -85
  18. package/dist/{chunk-YSGW7VV4.cjs → chunk-43NT242D.cjs} +1401 -228
  19. package/dist/{chunk-SMTUQWGY.js → chunk-5IW65VQ6.js} +1 -1
  20. package/dist/{chunk-YQ4PQTBB.js → chunk-6NZL24W4.js} +9 -1
  21. package/dist/{chunk-O3ZVZSNJ.cjs → chunk-7AUQ2UJ3.cjs} +137 -129
  22. package/dist/{chunk-4M4E3N6X.js → chunk-CQVTGBQI.js} +1 -1
  23. package/dist/{chunk-SSFMWJDK.js → chunk-D4TE5JNW.js} +1192 -19
  24. package/dist/{chunk-AORZ5M5C.js → chunk-EHALWBBD.js} +1 -1
  25. package/dist/{chunk-6WCQ35GI.cjs → chunk-NHA26O5X.cjs} +2 -2
  26. package/dist/{chunk-DPYAO5U6.cjs → chunk-PVJMTLPJ.cjs} +197 -18
  27. package/dist/{chunk-MQGQTKVW.cjs → chunk-PYTJBVW5.cjs} +29 -29
  28. package/dist/{chunk-IXQZHCOF.js → chunk-QAR2N7HZ.js} +1 -1
  29. package/dist/{chunk-5P4JEOIV.js → chunk-TMDDMJCR.js} +2 -2
  30. package/dist/{chunk-RSIKDWOP.cjs → chunk-TZOX7KWV.cjs} +15 -15
  31. package/dist/{chunk-IPUTIUGQ.cjs → chunk-UVZ7RQOE.cjs} +1 -1
  32. package/dist/{chunk-A7GJ6BXI.js → chunk-WJ4WQJCC.js} +1062 -9
  33. package/dist/{chunk-ICTPLVSR.js → chunk-X2EXYY4J.js} +1 -1
  34. package/dist/{chunk-WQCNC4DK.js → chunk-XC6DPRYI.js} +695 -4
  35. package/dist/{chunk-KBYB7OWB.cjs → chunk-YHDHFJUC.cjs} +776 -85
  36. package/dist/{chunk-P3PZ63M3.cjs → chunk-YLUIFXSL.cjs} +35 -35
  37. package/dist/commands/index.cjs +2 -2
  38. package/dist/commands/index.js +1 -1
  39. package/dist/image-editor/index.cjs +1385 -2484
  40. package/dist/image-editor/index.js +139 -1238
  41. package/dist/image-editor/selection-worker.cjs +3 -4
  42. package/dist/image-editor/selection-worker.js +1 -2
  43. package/dist/paint/index.cjs +3 -5
  44. package/dist/paint/index.js +40 -42
  45. package/dist/paint-editor/contract.d.cts +29 -0
  46. package/dist/paint-editor/contract.d.ts +29 -0
  47. package/dist/paint-editor/dab-stroke.d.cts +5 -0
  48. package/dist/paint-editor/dab-stroke.d.ts +5 -0
  49. package/dist/paint-editor/index.cjs +402 -258
  50. package/dist/paint-editor/index.d.cts +1 -0
  51. package/dist/paint-editor/index.d.ts +1 -0
  52. package/dist/paint-editor/index.js +197 -53
  53. package/dist/paint-editor/stamp-tip.d.cts +17 -0
  54. package/dist/paint-editor/stamp-tip.d.ts +17 -0
  55. package/dist/paint-editor/ui.d.cts +21 -1
  56. package/dist/paint-editor/ui.d.ts +21 -1
  57. package/dist/raster/index.cjs +2 -4
  58. package/dist/raster/index.js +6 -8
  59. package/dist/vector/brushstroke.d.cts +6 -0
  60. package/dist/vector/brushstroke.d.ts +6 -0
  61. package/dist/vector/controller.d.cts +11 -2
  62. package/dist/vector/controller.d.ts +11 -2
  63. package/dist/vector/index.cjs +990 -973
  64. package/dist/vector/index.js +28 -11
  65. package/package.json +1 -1
  66. package/skills/pixerate-brushes/SKILL.md +1 -1
  67. package/skills/pixerate-canvas/SKILL.md +3 -1
  68. package/skills/pixerate-vector/SKILL.md +2 -2
  69. package/dist/chunk-2VJAVXLI.js +0 -192
  70. package/dist/chunk-62Z5WLRA.js +0 -700
  71. package/dist/chunk-BOHDJJ2O.cjs +0 -192
  72. package/dist/chunk-NKGB64CW.cjs +0 -700
  73. package/dist/chunk-SS53NNZO.cjs +0 -1066
  74. package/dist/chunk-ZNA3IQZF.js +0 -1066
@@ -57,3 +57,4 @@ export type { StickerProvider, StickerRef, StickerSummary } from '../stickers/ty
57
57
  export * from './sticker-art.cjs';
58
58
  export * from './collaboration.cjs';
59
59
  export * from './collaboration-tools.cjs';
60
+ export { paintContracts, PAINT_CONTRACT_FORMAT_VERSION, PAINT_DOCUMENT_JSON_SCHEMA } from './contract.cjs';
@@ -57,3 +57,4 @@ export type { StickerProvider, StickerRef, StickerSummary } from '../stickers/ty
57
57
  export * from './sticker-art.js';
58
58
  export * from './collaboration.js';
59
59
  export * from './collaboration-tools.js';
60
+ export { paintContracts, PAINT_CONTRACT_FORMAT_VERSION, PAINT_DOCUMENT_JSON_SCHEMA } from './contract.js';
@@ -11,7 +11,7 @@ import {
11
11
  mergeBrushPatch,
12
12
  multiColorSliders,
13
13
  patchBrushValue
14
- } from "../chunk-ICTPLVSR.js";
14
+ } from "../chunk-X2EXYY4J.js";
15
15
  import {
16
16
  createStickerTools,
17
17
  describeStickerRef
@@ -20,20 +20,18 @@ import {
20
20
  toVideoFfmpeg
21
21
  } from "../chunk-MWUZCEFT.js";
22
22
  import {
23
+ BRUSH_OPTION_CONTROLS,
23
24
  createLayerEffectTools,
24
25
  deserializeLayers,
25
26
  exportPsd,
26
27
  resolveExternalAssets,
27
28
  serializeLayers,
28
29
  serializeLayersExternal
29
- } from "../chunk-SSFMWJDK.js";
30
- import "../chunk-ZNA3IQZF.js";
31
- import {
32
- brushColourHex
33
- } from "../chunk-FJBQTZS4.js";
34
- import "../chunk-3CI7FRMK.js";
30
+ } from "../chunk-D4TE5JNW.js";
31
+ import "../chunk-WJ4WQJCC.js";
35
32
  import {
36
33
  LAYER_EFFECT_KINDS,
34
+ LAYER_EFFECT_MENU,
37
35
  LayerEffectError,
38
36
  RasterCompositor,
39
37
  defaultLayerEffect,
@@ -42,12 +40,13 @@ import {
42
40
  insertLayer,
43
41
  isLayerEffectKind,
44
42
  isLayerLocked,
43
+ layerEffectControls,
45
44
  layerEffectLabel,
46
45
  mapLayer,
47
46
  mergeLayerEffect,
48
47
  newEffectId,
49
48
  validateLayerEffects
50
- } from "../chunk-3PPJRMIG.js";
49
+ } from "../chunk-3O47TPGX.js";
51
50
  import "../chunk-OHKOFKBY.js";
52
51
  import "../chunk-ZIF4UJJ6.js";
53
52
  import {
@@ -74,7 +73,8 @@ import {
74
73
  pigmentOf,
75
74
  pointerPressure,
76
75
  wetSupport
77
- } from "../chunk-WQCNC4DK.js";
76
+ } from "../chunk-XC6DPRYI.js";
77
+ import "../chunk-VWEWY4FY.js";
78
78
  import "../chunk-HVQVHUTV.js";
79
79
  import {
80
80
  writeZip
@@ -85,7 +85,7 @@ import {
85
85
  realPresenceClock,
86
86
  tweenPresenceCursor
87
87
  } from "../chunk-IVSWRVB4.js";
88
- import "../chunk-YQ4PQTBB.js";
88
+ import "../chunk-6NZL24W4.js";
89
89
  import {
90
90
  BRUSH_ID,
91
91
  BRUSH_PRESETS,
@@ -140,7 +140,7 @@ import {
140
140
  parseBrushLibrary,
141
141
  resolveBrush,
142
142
  usesPaintExchange
143
- } from "../chunk-SMTUQWGY.js";
143
+ } from "../chunk-5IW65VQ6.js";
144
144
  import {
145
145
  STAMP_KINDS,
146
146
  StickersSlot,
@@ -152,6 +152,10 @@ import {
152
152
  import "../chunk-M6DNZNVY.js";
153
153
  import "../chunk-WEIK3UYB.js";
154
154
  import "../chunk-PWBZH3FK.js";
155
+ import {
156
+ brushColourHex
157
+ } from "../chunk-FJBQTZS4.js";
158
+ import "../chunk-3CI7FRMK.js";
155
159
  import {
156
160
  StickerError
157
161
  } from "../chunk-SZTI6EER.js";
@@ -268,6 +272,7 @@ import "../chunk-SIFAIGB3.js";
268
272
  import "../chunk-CIQIM2IP.js";
269
273
  import "../chunk-VDGBHYC7.js";
270
274
  import {
275
+ EDITOR_DOCUMENT_FORMAT,
271
276
  createEditorAssetRegistry,
272
277
  defineEditorDocument
273
278
  } from "../chunk-XBQX76CT.js";
@@ -653,6 +658,18 @@ function brushStickerRefs(brush) {
653
658
  const refs = brush.engine === "sticker" ? [...brush.sticker.stamps] : brush.engine === "particle" ? [...brush.particle.dotTextures] : brush.engine === "dab" && brush.stamp ? [brush.stamp] : [];
654
659
  return [...new Set(refs.filter((r) => r.includes(":") && !r.startsWith("editor:")))];
655
660
  }
661
+ function sprayDroplets(d, spray, seed) {
662
+ const count = 1 + Math.round(spray.density * 31);
663
+ const key = d.index * 131 + Math.round(d.travel * 8);
664
+ const out = [];
665
+ for (let i = 0; i < count; i++) {
666
+ const n = key * 64 + i;
667
+ const a = rand01(seed, n, 61) * Math.PI * 2;
668
+ const rr = Math.sqrt(rand01(seed, n, 67)) * d.radius;
669
+ out.push({ ...d, x: d.x + Math.cos(a) * rr, y: d.y + Math.sin(a) * rr, radius: Math.max(0.5, d.radius * spray.size * (0.6 + 0.8 * rand01(seed, n, 71))), roundness: 1, angle: rand01(seed, n, 73) * Math.PI * 2 });
670
+ }
671
+ return out;
672
+ }
656
673
 
657
674
  // src/paint-editor/engine.ts
658
675
  function penOrientation(p) {
@@ -921,14 +938,7 @@ var DryStroke = class {
921
938
  this.mark(d, d, rects);
922
939
  continue;
923
940
  }
924
- const count = 1 + Math.round(spray.density * 31);
925
- const key = d.index * 131 + Math.round(d.travel * 8);
926
- for (let i = 0; i < count; i++) {
927
- const a = rand01(seed, key * 64 + i, 61) * Math.PI * 2;
928
- const rr = Math.sqrt(rand01(seed, key * 64 + i, 67)) * d.radius;
929
- const drop = { ...d, x: d.x + Math.cos(a) * rr, y: d.y + Math.sin(a) * rr, radius: Math.max(0.5, d.radius * spray.size * (0.6 + 0.8 * rand01(seed, key * 64 + i, 71))), roundness: 1, angle: rand01(seed, key * 64 + i, 73) * Math.PI * 2 };
930
- this.mark(drop, d, rects);
931
- }
941
+ for (const drop of sprayDroplets(d, spray, seed)) this.mark(drop, d, rects);
932
942
  }
933
943
  return rects;
934
944
  }
@@ -1019,6 +1029,7 @@ var PaintDabStroke = class {
1019
1029
  constructor(brush, options) {
1020
1030
  this.brush = brush;
1021
1031
  this.options = options;
1032
+ this.stamp = brush.engine === "dab" && brush.stamp ? stampSampler(brush.stamp, options.stampArt) : null;
1022
1033
  this.smoother = new PenSmoother(brush.tip.smoothing, brush.pressureSmoothing);
1023
1034
  this.copies = options.copies?.length ? options.copies : [IDENTITY_COPY];
1024
1035
  const exchanging = brush.engine === "mixer" || brush.engine === "dab";
@@ -1062,6 +1073,8 @@ var PaintDabStroke = class {
1062
1073
  paint = [0, 0, 0];
1063
1074
  lastRaw = null;
1064
1075
  lastFed = null;
1076
+ /** The stamp tip's shape (dab brushes), or `null` for the round computed tip. */
1077
+ stamp;
1065
1078
  /** What copy 0's brush carries after the dabs so far (mixer and wet-capable dab brushes). */
1066
1079
  get load() {
1067
1080
  return this.states[0].exchange?.load ?? null;
@@ -1094,8 +1107,9 @@ var PaintDabStroke = class {
1094
1107
  return rects;
1095
1108
  }
1096
1109
  paintDabs(copy, dabs, rects) {
1097
- for (const d of dabs) {
1098
- const rect = dabRect(d, this.brush.tip.hardness);
1110
+ const spray = this.brush.engine === "dab" ? this.brush.spray : null;
1111
+ for (const d of spray ? dabs.flatMap((dab) => sprayDroplets(dab, spray, (this.options.seed ?? 0) + copy * 7919)) : dabs) {
1112
+ const rect = this.stamp ? stampDabRect(d) : dabRect(d, this.brush.tip.hardness);
1099
1113
  if (rect.width <= 0 || rect.height <= 0) continue;
1100
1114
  this.dab(copy, d, rect);
1101
1115
  rects.push(rect);
@@ -1111,7 +1125,8 @@ var PaintDabStroke = class {
1111
1125
  }
1112
1126
  const tip = this.tip.subarray(0, n);
1113
1127
  tip.fill(0);
1114
- rasterizeDab({ ...d, alpha: 1 }, this.brush.tip.hardness, rect, tip);
1128
+ if (this.stamp) rasterizeStampDab({ ...d, alpha: 1 }, this.stamp, d.index, rect, tip);
1129
+ else rasterizeDab({ ...d, alpha: 1 }, this.brush.tip.hardness, rect, tip);
1115
1130
  if (!(this.depth > 0 && this.options.grain)) return { tip, cov: tip };
1116
1131
  const cov = this.cov.subarray(0, n);
1117
1132
  const grain = this.options.grain;
@@ -2958,7 +2973,8 @@ var PaintStrokeSession = class _PaintStrokeSession {
2958
2973
  seed: init.seed,
2959
2974
  copies: this.copies,
2960
2975
  paint: init.paint ?? null,
2961
- effect
2976
+ effect,
2977
+ stampArt: init.stampArt
2962
2978
  });
2963
2979
  } else {
2964
2980
  const opts = { grain: init.grain, paperDepth: init.paperDepth, seed: init.seed, copies: this.copies, paint: init.paint ?? null, effect, stampArt: init.stampArt };
@@ -12178,44 +12194,47 @@ var PaintGesture = class {
12178
12194
  }
12179
12195
  };
12180
12196
  var round2 = (v) => Math.round(v * 100) / 100;
12197
+ var PAINT_SHORTCUTS = [
12198
+ { id: "undo", label: "Undo", group: "edit", keys: ["Mod+Z"], tool: "undo_paint" },
12199
+ { id: "redo", label: "Redo", group: "edit", keys: ["Mod+Shift+Z", "Mod+Y"], tool: "redo_paint" },
12200
+ ...PAINT_TOOLS.map((t) => ({ id: `tool.${t.id}`, label: t.label, group: "tools", keys: [t.key.toUpperCase()] })),
12201
+ { id: "brush.smaller", label: "Smaller brush", group: "brush", keys: ["["], tool: "set_brush" },
12202
+ { id: "brush.larger", label: "Larger brush", group: "brush", keys: ["]"], tool: "set_brush" },
12203
+ { id: "colour.swap", label: "Swap colours", group: "colour", keys: ["X"] },
12204
+ { id: "view.mirror", label: "Mirror the view", group: "view", keys: ["M"], tool: "set_view" },
12205
+ { id: "view.reset", label: "Reset the view", group: "view", keys: ["Escape"], tool: "set_view" }
12206
+ ];
12207
+ function paintShortcutFor(e) {
12208
+ if (!e.key) return null;
12209
+ const parts = [...e.ctrlKey || e.metaKey ? ["Mod"] : [], ...e.shiftKey && (e.ctrlKey || e.metaKey) ? ["Shift"] : []];
12210
+ const key = e.key.length === 1 ? e.key.toUpperCase() : e.key[0].toUpperCase() + e.key.slice(1).toLowerCase();
12211
+ const combo = [...parts, key].join("+");
12212
+ return PAINT_SHORTCUTS.find((s) => s.keys.includes(combo)) ?? null;
12213
+ }
12181
12214
  function handlePaintShortcut(controller, gesture, e) {
12182
- const mod = e.ctrlKey || e.metaKey;
12183
- const key = e.key.toLowerCase();
12184
- if (mod && key === "z") {
12185
- if (controller.getState().stroking) return true;
12186
- if (e.shiftKey) controller.redo();
12187
- else controller.undo();
12215
+ const shortcut = paintShortcutFor(e);
12216
+ if (!shortcut) return false;
12217
+ const id = shortcut.id;
12218
+ if (id === "undo" || id === "redo") {
12219
+ if (controller.getState().stroking && !(id === "redo" && e.key.toLowerCase() === "y")) return true;
12220
+ if (id === "undo") controller.undo();
12221
+ else controller.redo();
12188
12222
  return true;
12189
12223
  }
12190
- if (mod && key === "y") {
12191
- controller.redo();
12224
+ if (id.startsWith("tool.")) {
12225
+ gesture.tool = id.slice(5);
12192
12226
  return true;
12193
12227
  }
12194
- if (mod) return false;
12195
- const tool = PAINT_TOOLS.find((t) => t.key === key);
12196
- if (tool) {
12197
- gesture.tool = tool.id;
12198
- return true;
12199
- }
12200
- const brush = controller.getState().brush;
12201
- if (key === "[" || key === "]") {
12228
+ if (id === "brush.smaller" || id === "brush.larger") {
12229
+ const brush = controller.getState().brush;
12202
12230
  const step = Math.max(1, Math.round(brush.tip.size * 0.15));
12203
- controller.setBrush({ tip: { size: Math.max(1, brush.tip.size + (key === "]" ? step : -step)) } });
12204
- return true;
12205
- }
12206
- if (key === "x") {
12207
- controller.swapColors();
12231
+ controller.setBrush({ tip: { size: Math.max(1, brush.tip.size + (id === "brush.larger" ? step : -step)) } });
12208
12232
  return true;
12209
12233
  }
12210
- if (key === "m") {
12211
- controller.setView({ mirror: !controller.getState().view.mirror });
12212
- return true;
12213
- }
12214
- if (key === "escape") {
12215
- controller.resetView();
12216
- return true;
12217
- }
12218
- return false;
12234
+ if (id === "colour.swap") controller.swapColors();
12235
+ else if (id === "view.mirror") controller.setView({ mirror: !controller.getState().view.mirror });
12236
+ else if (id === "view.reset") controller.resetView();
12237
+ return true;
12219
12238
  }
12220
12239
  var PaintCanvasPresenter = class {
12221
12240
  constructor(controller) {
@@ -13171,6 +13190,126 @@ function createPaintProposalToolProvider(proposals, options = {}) {
13171
13190
  tools: [proposeTool, listTool, acceptTool, rejectTool]
13172
13191
  };
13173
13192
  }
13193
+
13194
+ // src/paint-editor/contract.ts
13195
+ var PAINT_CONTRACT_FORMAT_VERSION = 1;
13196
+ var POINT2 = { type: "object", properties: { x: { type: "number", description: "Document x in pixels." }, y: { type: "number", description: "Document y in pixels." } }, required: ["x", "y"] };
13197
+ var PAINT_DOCUMENT_JSON_SCHEMA = {
13198
+ type: "object",
13199
+ description: "A saved painting, as the paint editor's save tools and autosave write it.",
13200
+ properties: {
13201
+ format: { type: "string", const: EDITOR_DOCUMENT_FORMAT, description: `Always "${EDITOR_DOCUMENT_FORMAT}".` },
13202
+ kind: { type: "string", const: "paint", description: 'Always "paint".' },
13203
+ formatVersion: { type: "integer", minimum: 1, description: "Version of the envelope for this kind; readers migrate older ones." },
13204
+ name: { type: "string", description: "Display name, when it has one." },
13205
+ document: {
13206
+ type: "object",
13207
+ description: "The painting (`SerializedPaintDocument`).",
13208
+ properties: {
13209
+ format: { type: "string", const: PAINT_FORMAT, description: `Always "${PAINT_FORMAT}".` },
13210
+ version: { type: "integer", minimum: 1, maximum: PAINT_SCHEMA_VERSION, description: `Painting version (${PAINT_SCHEMA_VERSION}; version 1 strokes hold flat engine brushes and are migrated).` },
13211
+ width: { type: "integer", minimum: 1, description: "Canvas width in pixels." },
13212
+ height: { type: "integer", minimum: 1, description: "Canvas height in pixels." },
13213
+ dpi: { type: "number", exclusiveMinimum: 0, description: "Pixels per inch." },
13214
+ paper: {
13215
+ type: "object",
13216
+ description: "The paper settings; the paper is regenerated from them, never stored as pixels.",
13217
+ properties: {
13218
+ preset: { type: "string", description: "The paper preset it started from (custom when none)." },
13219
+ name: { type: "string", description: "Display name." },
13220
+ pattern: { type: "string", description: "Grain pattern id." },
13221
+ seed: { type: "number", description: "Grain seed." },
13222
+ color: { type: "string", description: "Paper colour #rrggbb." },
13223
+ scale: { type: "number", description: "Grain scale (0.25 to 8)." },
13224
+ depth: { type: "number", minimum: 0, maximum: 1, description: "Grain depth for dry media." }
13225
+ },
13226
+ required: ["preset", "pattern", "seed", "color"]
13227
+ },
13228
+ layers: {
13229
+ type: "array",
13230
+ description: "Bottom to top: the image editor's serialized layers (pixel layers keep their pixels in `assets`).",
13231
+ items: { type: "object", properties: { id: { type: "string", description: "Layer id." }, name: { type: "string", description: "Layer name." }, type: { type: "string", description: "pixel, group, \u2026" } }, required: ["id", "type"] }
13232
+ },
13233
+ assets: { type: "object", additionalProperties: { type: "string" }, description: "Asset id \u2192 PNG data URL or an external reference." },
13234
+ activeLayerId: { type: ["string", "null"], description: "The active layer." },
13235
+ strokes: {
13236
+ type: "array",
13237
+ description: "Recorded strokes, oldest first (missing when saved without them).",
13238
+ items: {
13239
+ type: "object",
13240
+ properties: {
13241
+ id: { type: "string", description: "Stroke id." },
13242
+ layerId: { type: "string", description: "The layer it painted on." },
13243
+ color: { type: "string", description: "The paint colour as recorded at stroke start." },
13244
+ seed: { type: "number", description: "Seed of its jitter and grain, so a replay is exact." },
13245
+ points: { type: "array", items: POINT2, description: "The samples, with pressure, tilt and time when recorded." },
13246
+ brush: { $ref: "../brushes/brush.schema.json", description: "The facet brush it painted with." }
13247
+ },
13248
+ required: ["id", "layerId", "points", "brush"]
13249
+ }
13250
+ }
13251
+ },
13252
+ required: ["format", "version", "width", "height", "dpi", "paper", "layers", "assets", "activeLayerId"]
13253
+ }
13254
+ },
13255
+ required: ["format", "kind", "formatVersion", "document"]
13256
+ };
13257
+ function toolList(provider) {
13258
+ const tools = typeof provider.tools === "function" ? provider.tools() : provider.tools;
13259
+ return {
13260
+ id: provider.id,
13261
+ title: provider.title,
13262
+ ...provider.skill ? { skill: provider.skill } : {},
13263
+ tools: tools.map((t) => ({ name: t.name, title: t.title, description: t.description, inputSchema: t.inputSchema, annotations: t.annotations }))
13264
+ };
13265
+ }
13266
+ function uiTables() {
13267
+ return {
13268
+ tools: PAINT_TOOLS,
13269
+ brushOptions: BRUSH_OPTION_CONTROLS,
13270
+ blendMenu: BLEND_MENU_GROUPS,
13271
+ layerEffects: LAYER_EFFECT_MENU.map(({ kind, label }) => ({ kind, label, controls: layerEffectControls(defaultLayerEffect(kind, kind)) })),
13272
+ sliders: { paper: PAPER_SLIDERS, wet: WET_PARAM_SLIDERS, wetTilt: WET_TILT_SLIDERS, wetSpeed: WET_SPEED_SLIDER, light: LIGHT_SLIDERS, stroke: STROKE_SLIDERS, sticker: STICKER_SLIDERS },
13273
+ padSampleSizes: PAD_SAMPLE_SIZES,
13274
+ wetGpu: WET_GPU_OPTIONS,
13275
+ labels: {
13276
+ wetTools: WET_TOOL_LABELS,
13277
+ wetMedia: WET_MEDIUM_LABELS,
13278
+ impastoTools: IMPASTO_TOOL_LABELS,
13279
+ particleKinds: PARTICLE_KIND_LABELS,
13280
+ particleRenders: PARTICLE_RENDER_LABELS,
13281
+ ribbonPairs: RIBBON_PAIR_LABELS,
13282
+ dotTextureOrders: DOT_TEXTURE_ORDER_LABELS,
13283
+ dotRotations: DOT_ROTATION_LABELS,
13284
+ stamps: STAMP_LABELS
13285
+ }
13286
+ };
13287
+ }
13288
+ function paintContracts(options) {
13289
+ const controller = new PaintEditorController({ width: 64, height: 64 });
13290
+ controller.setEffectsProvider(options.effects);
13291
+ const providers = [
13292
+ createPaintEditorToolProvider(controller),
13293
+ createPaintEffectsToolProvider(controller),
13294
+ createPaintBrushLibraryToolProvider(controller),
13295
+ createPaintProposalToolProvider(createPaintProposals({ controller }))
13296
+ ].map(toolList);
13297
+ const document = createPaintEditorDocument(controller);
13298
+ const files = {
13299
+ "document.schema.json": { $schema: "https://json-schema.org/draft/2020-12/schema", $id: "document.schema.json", ...PAINT_DOCUMENT_JSON_SCHEMA },
13300
+ "tools.json": { providers },
13301
+ "commands.json": PAINT_SHORTCUTS.map((s) => ({ ...s, params: { type: "object", properties: {}, additionalProperties: false } })),
13302
+ "ui.json": uiTables()
13303
+ };
13304
+ files["manifest.json"] = {
13305
+ domain: "paint",
13306
+ formatVersion: PAINT_CONTRACT_FORMAT_VERSION,
13307
+ document: { kind: document.kind, formatVersion: document.formatVersion, format: PAINT_FORMAT, version: PAINT_SCHEMA_VERSION },
13308
+ counts: { providers: providers.length, tools: providers.reduce((n, p) => n + p.tools.length, 0), commands: PAINT_SHORTCUTS.length, layerEffects: LAYER_EFFECT_KINDS.length },
13309
+ files: Object.keys(files).sort()
13310
+ };
13311
+ return files;
13312
+ }
13174
13313
  export {
13175
13314
  BACKLIGHT_SPILL,
13176
13315
  BLEND_MENU_GROUPS,
@@ -13238,6 +13377,8 @@ export {
13238
13377
  PAINT_BRUSH_CATEGORIES,
13239
13378
  PAINT_BRUSH_ENGINES,
13240
13379
  PAINT_COLOR_JSON_SCHEMA,
13380
+ PAINT_CONTRACT_FORMAT_VERSION,
13381
+ PAINT_DOCUMENT_JSON_SCHEMA,
13241
13382
  PAINT_EFFECT_PLACES,
13242
13383
  PAINT_FORMAT,
13243
13384
  PAINT_GRADIENT_FULL_SPEED,
@@ -13251,6 +13392,7 @@ export {
13251
13392
  PAINT_GRADIENT_SPACES,
13252
13393
  PAINT_GRADIENT_SPACE_LABELS,
13253
13394
  PAINT_SCHEMA_VERSION,
13395
+ PAINT_SHORTCUTS,
13254
13396
  PAINT_SOURCE_JSON_SCHEMA,
13255
13397
  PAINT_TARGET,
13256
13398
  PAINT_TOOLS,
@@ -13425,9 +13567,11 @@ export {
13425
13567
  overPixels,
13426
13568
  padSampleRadius,
13427
13569
  paintAgentStrokePoints,
13570
+ paintContracts,
13428
13571
  paintGradientMappingFor,
13429
13572
  paintPlaybackPanel,
13430
13573
  paintProposalGhost,
13574
+ paintShortcutFor,
13431
13575
  paintSourceColor,
13432
13576
  paintSourceCss,
13433
13577
  paintToMultiColor,
@@ -43,3 +43,20 @@ export declare function brushStickerRefs(brush: {
43
43
  dotTextures: readonly string[];
44
44
  };
45
45
  }): string[];
46
+ /**
47
+ * Spray marks: the droplets of dab `d`, spread evenly over its disc, each a fraction `size` of
48
+ * the tip (with ±40% variation) and turned at random. Seeded by the stroke `seed`, the dab's
49
+ * index and its travel, so replays lay the same droplets.
50
+ */
51
+ export declare function sprayDroplets<D extends {
52
+ x: number;
53
+ y: number;
54
+ radius: number;
55
+ roundness: number;
56
+ angle: number;
57
+ index: number;
58
+ travel: number;
59
+ }>(d: D, spray: {
60
+ density: number;
61
+ size: number;
62
+ }, seed: number): D[];
@@ -43,3 +43,20 @@ export declare function brushStickerRefs(brush: {
43
43
  dotTextures: readonly string[];
44
44
  };
45
45
  }): string[];
46
+ /**
47
+ * Spray marks: the droplets of dab `d`, spread evenly over its disc, each a fraction `size` of
48
+ * the tip (with ±40% variation) and turned at random. Seeded by the stroke `seed`, the dab's
49
+ * index and its travel, so replays lay the same droplets.
50
+ */
51
+ export declare function sprayDroplets<D extends {
52
+ x: number;
53
+ y: number;
54
+ radius: number;
55
+ roundness: number;
56
+ angle: number;
57
+ index: number;
58
+ travel: number;
59
+ }>(d: D, spray: {
60
+ density: number;
61
+ size: number;
62
+ }, seed: number): D[];
@@ -94,7 +94,27 @@ export declare class PaintGesture {
94
94
  shiftKey?: boolean;
95
95
  }): void;
96
96
  }
97
- /** Keyboard shortcuts shared by both editors; returns true when it handled the key. */
97
+ /** A keyboard command of the paint editor (`PAINT_SHORTCUTS`). */
98
+ export interface PaintShortcut {
99
+ /** Stable id, e.g. `undo` or `tool.brush`. */
100
+ id: string;
101
+ label: string;
102
+ group: 'edit' | 'tools' | 'brush' | 'colour' | 'view';
103
+ /** Keys that run it: `Mod` is Ctrl or Cmd; letters are matched case-insensitively. */
104
+ keys: readonly string[];
105
+ /** The agent tool that does the same, when there is one. */
106
+ tool?: string;
107
+ }
108
+ /** The keyboard commands both editors handle (`handlePaintShortcut`), in the order it checks them. */
109
+ export declare const PAINT_SHORTCUTS: readonly PaintShortcut[];
110
+ /** The shortcut `e` presses, if any. */
111
+ export declare function paintShortcutFor(e: {
112
+ key: string;
113
+ ctrlKey?: boolean;
114
+ metaKey?: boolean;
115
+ shiftKey?: boolean;
116
+ }): PaintShortcut | null;
117
+ /** Keyboard shortcuts shared by both editors (`PAINT_SHORTCUTS`); returns true when it handled the key. */
98
118
  export declare function handlePaintShortcut(controller: PaintEditorController, gesture: PaintGesture, e: {
99
119
  key: string;
100
120
  ctrlKey?: boolean;
@@ -94,7 +94,27 @@ export declare class PaintGesture {
94
94
  shiftKey?: boolean;
95
95
  }): void;
96
96
  }
97
- /** Keyboard shortcuts shared by both editors; returns true when it handled the key. */
97
+ /** A keyboard command of the paint editor (`PAINT_SHORTCUTS`). */
98
+ export interface PaintShortcut {
99
+ /** Stable id, e.g. `undo` or `tool.brush`. */
100
+ id: string;
101
+ label: string;
102
+ group: 'edit' | 'tools' | 'brush' | 'colour' | 'view';
103
+ /** Keys that run it: `Mod` is Ctrl or Cmd; letters are matched case-insensitively. */
104
+ keys: readonly string[];
105
+ /** The agent tool that does the same, when there is one. */
106
+ tool?: string;
107
+ }
108
+ /** The keyboard commands both editors handle (`handlePaintShortcut`), in the order it checks them. */
109
+ export declare const PAINT_SHORTCUTS: readonly PaintShortcut[];
110
+ /** The shortcut `e` presses, if any. */
111
+ export declare function paintShortcutFor(e: {
112
+ key: string;
113
+ ctrlKey?: boolean;
114
+ metaKey?: boolean;
115
+ shiftKey?: boolean;
116
+ }): PaintShortcut | null;
117
+ /** Keyboard shortcuts shared by both editors (`PAINT_SHORTCUTS`); returns true when it handled the key. */
98
118
  export declare function handlePaintShortcut(controller: PaintEditorController, gesture: PaintGesture, e: {
99
119
  key: string;
100
120
  ctrlKey?: boolean;
@@ -4,7 +4,6 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkBOHDJJ2Ocjs = require('../chunk-BOHDJJ2O.cjs');
8
7
 
9
8
 
10
9
 
@@ -66,8 +65,7 @@ var _chunkBOHDJJ2Ocjs = require('../chunk-BOHDJJ2O.cjs');
66
65
 
67
66
 
68
67
 
69
-
70
- var _chunkDPYAO5U6cjs = require('../chunk-DPYAO5U6.cjs');
68
+ var _chunkPVJMTLPJcjs = require('../chunk-PVJMTLPJ.cjs');
71
69
  require('../chunk-QT26RHKK.cjs');
72
70
 
73
71
 
@@ -530,4 +528,4 @@ function drawSurfaceToViewport(ctx, surface, mapping, view, options) {
530
528
 
531
529
 
532
530
 
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;
531
+ exports.BIT_DEPTHS = _chunk2VX55NFMcjs.BIT_DEPTHS; exports.BLEND_MODES = _chunk2VX55NFMcjs.BLEND_MODES; exports.CURVE_LUT_SIZE = _chunkPVJMTLPJcjs.CURVE_LUT_SIZE; exports.DEFAULT_GLOBAL_LIGHT = _chunkPVJMTLPJcjs.DEFAULT_GLOBAL_LIGHT; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkK6PXS6DOcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DeepCompositor = _chunkPVJMTLPJcjs.DeepCompositor; exports.INTERPOLATIONS = _chunkPVJMTLPJcjs.INTERPOLATIONS; exports.LAYER_EFFECT_KINDS = _chunkPVJMTLPJcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = _chunkPVJMTLPJcjs.LAYER_EFFECT_MENU; exports.LayerEffectError = _chunkPVJMTLPJcjs.LayerEffectError; exports.MAX_EFFECT_REACH = _chunkPVJMTLPJcjs.MAX_EFFECT_REACH; exports.MAX_TRANSFORM_PIXELS = _chunkPVJMTLPJcjs.MAX_TRANSFORM_PIXELS; exports.PAINTERLY_BLEND_MODES = _chunk2VX55NFMcjs.PAINTERLY_BLEND_MODES; exports.PatternPlacement = _chunkPVJMTLPJcjs.PatternPlacement; exports.PatternTile = _chunkPVJMTLPJcjs.PatternTile; exports.RasterCompositor = _chunkPVJMTLPJcjs.RasterCompositor; exports.SHADOW_AMBIENT = _chunk2VX55NFMcjs.SHADOW_AMBIENT; exports.STROKE_CHAMFER_MAX = _chunkPVJMTLPJcjs.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 = _chunkPVJMTLPJcjs.TransformTooLargeError; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeEffectItems = _chunkPVJMTLPJcjs.activeEffectItems; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.applyEdgeAmbient = _chunkPVJMTLPJcjs.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 = _chunkPVJMTLPJcjs.blendTile; exports.buildEffectMaps = _chunkPVJMTLPJcjs.buildEffectMaps; exports.builtinPattern = _chunkPVJMTLPJcjs.builtinPattern; exports.builtinPatternIds = _chunkPVJMTLPJcjs.builtinPatternIds; exports.bytesToBase64 = _chunkW5M3J7PVcjs.bytesToBase64; exports.canvasCompositeOperation = _chunk2VX55NFMcjs.canvasCompositeOperation; exports.changedTiles = _chunkPVJMTLPJcjs.changedTiles; exports.collectTiles = _chunk474IQG74cjs.collectTiles; exports.compositeLayerEffects = _chunkPVJMTLPJcjs.compositeLayerEffects; exports.compositeSurfaceOver = _chunkPVJMTLPJcjs.compositeSurfaceOver; exports.contentBounds = _chunk474IQG74cjs.contentBounds; exports.contourLut = _chunkPVJMTLPJcjs.contourLut; exports.convertSurfaceDepth = _chunk2VX55NFMcjs.convertSurfaceDepth; exports.curveLut = _chunkPVJMTLPJcjs.curveLut; exports.decodePng = _chunkW5M3J7PVcjs.decodePng; exports.deepBytes = _chunk2VX55NFMcjs.deepBytes; exports.deepTile = _chunk2VX55NFMcjs.deepTile; exports.defaultEffectGradient = _chunkPVJMTLPJcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkPVJMTLPJcjs.defaultLayerEffect; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthOf = _chunk2VX55NFMcjs.depthOf; exports.drawSurfaceToViewport = drawSurfaceToViewport; exports.effectColorHex = _chunkPVJMTLPJcjs.effectColorHex; exports.effectControlChange = _chunkPVJMTLPJcjs.effectControlChange; exports.effectFillColors = _chunkPVJMTLPJcjs.effectFillColors; exports.effectReach = _chunkPVJMTLPJcjs.effectReach; exports.effectsAreLocal = _chunkPVJMTLPJcjs.effectsAreLocal; exports.effectsFingerprint = _chunkPVJMTLPJcjs.effectsFingerprint; exports.effectsMargin = _chunkPVJMTLPJcjs.effectsMargin; exports.effectsScale = _chunkPVJMTLPJcjs.effectsScale; exports.emptySurface = _chunk474IQG74cjs.emptySurface; exports.encodePng = _chunkW5M3J7PVcjs.encodePng; exports.fillRect = _chunk474IQG74cjs.fillRect; exports.findLayer = _chunkPVJMTLPJcjs.findLayer; exports.finishTile = _chunk474IQG74cjs.finishTile; exports.flattenLayers = _chunkPVJMTLPJcjs.flattenLayers; exports.gaussianBlur = _chunkK6PXS6DOcjs.gaussianBlur; exports.gradientT = _chunkPVJMTLPJcjs.gradientT; exports.hasActiveEffects = _chunkPVJMTLPJcjs.hasActiveEffects; exports.hashNoise = _chunkPVJMTLPJcjs.hashNoise; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertLayer = _chunkPVJMTLPJcjs.insertLayer; exports.isBitDepth = _chunk2VX55NFMcjs.isBitDepth; exports.isBlendMode = _chunk2VX55NFMcjs.isBlendMode; exports.isInterpolation = _chunkPVJMTLPJcjs.isInterpolation; exports.isLayerEffectKind = _chunkPVJMTLPJcjs.isLayerEffectKind; exports.isLayerLocked = _chunkPVJMTLPJcjs.isLayerLocked; exports.isPainterlyBlendMode = _chunk2VX55NFMcjs.isPainterlyBlendMode; exports.isPng = _chunkW5M3J7PVcjs.isPng; exports.isSeparableBlendMode = _chunk2VX55NFMcjs.isSeparableBlendMode; exports.keepDeepSamples = _chunk2VX55NFMcjs.keepDeepSamples; exports.keysWeight = _chunkPVJMTLPJcjs.keysWeight; exports.layerEffectControls = _chunkPVJMTLPJcjs.layerEffectControls; exports.layerEffectFields = _chunkPVJMTLPJcjs.layerEffectFields; exports.layerEffectLabel = _chunkPVJMTLPJcjs.layerEffectLabel; exports.layerEffectsBadge = _chunkPVJMTLPJcjs.layerEffectsBadge; exports.layerEffectsPanel = _chunkPVJMTLPJcjs.layerEffectsPanel; exports.mapLayer = _chunkPVJMTLPJcjs.mapLayer; exports.mergeLayerEffect = _chunkPVJMTLPJcjs.mergeLayerEffect; exports.mixPigment8 = _chunk2VX55NFMcjs.mixPigment8; exports.mixPigmentRgb = _chunk2VX55NFMcjs.mixPigmentRgb; exports.newEffectId = _chunkPVJMTLPJcjs.newEffectId; exports.normalizeBlendMode = _chunk2VX55NFMcjs.normalizeBlendMode; exports.normalizeLayerEffects = _chunkPVJMTLPJcjs.normalizeLayerEffects; exports.packRgba = _chunk474IQG74cjs.packRgba; exports.parseDataUrl = _chunkW5M3J7PVcjs.parseDataUrl; exports.parseEffectColor = _chunkPVJMTLPJcjs.parseEffectColor; exports.patchEffectMaps = _chunkPVJMTLPJcjs.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 = _chunkPVJMTLPJcjs.reduceSurface; exports.renderLayerEffects = _chunkPVJMTLPJcjs.renderLayerEffects; exports.scaleLayerEffect = _chunkPVJMTLPJcjs.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 = _chunkPVJMTLPJcjs.transformSurface; exports.transformedBounds = _chunkPVJMTLPJcjs.transformedBounds; exports.translateSurface = _chunk474IQG74cjs.translateSurface; exports.uniformTile = _chunk474IQG74cjs.uniformTile; exports.validateEffectGradient = _chunkPVJMTLPJcjs.validateEffectGradient; exports.validateLayerEffect = _chunkPVJMTLPJcjs.validateLayerEffect; exports.validateLayerEffects = _chunkPVJMTLPJcjs.validateLayerEffects; exports.visibleSurfaceRect = visibleSurfaceRect; exports.visibleWorldRect = visibleWorldRect; exports.warpSurface = _chunkPVJMTLPJcjs.warpSurface; exports.workingToSamples = _chunkPVJMTLPJcjs.workingToSamples; exports.worldRectToSurface = worldRectToSurface; exports.worldToSurface = worldToSurface; exports.writeDeepRegion = _chunk2VX55NFMcjs.writeDeepRegion; exports.writeRegion = _chunk474IQG74cjs.writeRegion;
@@ -1,16 +1,10 @@
1
- import {
2
- LAYER_EFFECT_MENU,
3
- effectControlChange,
4
- layerEffectControls,
5
- layerEffectsBadge,
6
- layerEffectsPanel
7
- } from "../chunk-2VJAVXLI.js";
8
1
  import {
9
2
  CURVE_LUT_SIZE,
10
3
  DEFAULT_GLOBAL_LIGHT,
11
4
  DeepCompositor,
12
5
  INTERPOLATIONS,
13
6
  LAYER_EFFECT_KINDS,
7
+ LAYER_EFFECT_MENU,
14
8
  LayerEffectError,
15
9
  MAX_EFFECT_REACH,
16
10
  MAX_TRANSFORM_PIXELS,
@@ -33,6 +27,7 @@ import {
33
27
  defaultEffectGradient,
34
28
  defaultLayerEffect,
35
29
  effectColorHex,
30
+ effectControlChange,
36
31
  effectFillColors,
37
32
  effectReach,
38
33
  effectsAreLocal,
@@ -49,8 +44,11 @@ import {
49
44
  isLayerEffectKind,
50
45
  isLayerLocked,
51
46
  keysWeight,
47
+ layerEffectControls,
52
48
  layerEffectFields,
53
49
  layerEffectLabel,
50
+ layerEffectsBadge,
51
+ layerEffectsPanel,
54
52
  mapLayer,
55
53
  mergeLayerEffect,
56
54
  newEffectId,
@@ -67,7 +65,7 @@ import {
67
65
  validateLayerEffects,
68
66
  warpSurface,
69
67
  workingToSamples
70
- } from "../chunk-3PPJRMIG.js";
68
+ } from "../chunk-3O47TPGX.js";
71
69
  import "../chunk-OHKOFKBY.js";
72
70
  import {
73
71
  DIRECT_GAUSSIAN_MAX_SIGMA,
@@ -18,6 +18,12 @@ export declare function vectorBrushstrokeBrushOf(brush: Pick<VectorBrushstroke,
18
18
  * `user` are the saved brushes on offer.
19
19
  */
20
20
  export declare function vectorBrushstrokeBrushError(id: string, user?: readonly Brush[]): string | null;
21
+ /**
22
+ * The default colour of brush `id` (a preset, else a saved brush of `user`) as a hex colour for
23
+ * `scheme`: a solid default, or the side of a light / dark pair; null when it has none (it paints
24
+ * in the colour it is given).
25
+ */
26
+ export declare function vectorBrushstrokeDefaultColour(id: string, user?: readonly Brush[], scheme?: 'light' | 'dark'): string | null;
21
27
  /**
22
28
  * Reads brushstroke settings from untrusted data; null when the brush is unknown. A saved brush is
23
29
  * taken from `value.spec` (a stored layer) or from `user` (the brush library's saved brushes) and
@@ -18,6 +18,12 @@ export declare function vectorBrushstrokeBrushOf(brush: Pick<VectorBrushstroke,
18
18
  * `user` are the saved brushes on offer.
19
19
  */
20
20
  export declare function vectorBrushstrokeBrushError(id: string, user?: readonly Brush[]): string | null;
21
+ /**
22
+ * The default colour of brush `id` (a preset, else a saved brush of `user`) as a hex colour for
23
+ * `scheme`: a solid default, or the side of a light / dark pair; null when it has none (it paints
24
+ * in the colour it is given).
25
+ */
26
+ export declare function vectorBrushstrokeDefaultColour(id: string, user?: readonly Brush[], scheme?: 'light' | 'dark'): string | null;
21
27
  /**
22
28
  * Reads brushstroke settings from untrusted data; null when the brush is unknown. A saved brush is
23
29
  * taken from `value.spec` (a stored layer) or from `user` (the brush library's saved brushes) and