@pixerate/editor 0.259.0 → 0.261.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 (80) 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/controller.d.cts +17 -0
  48. package/dist/paint-editor/controller.d.ts +17 -0
  49. package/dist/paint-editor/dab-stroke.d.cts +5 -0
  50. package/dist/paint-editor/dab-stroke.d.ts +5 -0
  51. package/dist/paint-editor/index.cjs +610 -327
  52. package/dist/paint-editor/index.d.cts +2 -0
  53. package/dist/paint-editor/index.d.ts +2 -0
  54. package/dist/paint-editor/index.js +337 -54
  55. package/dist/paint-editor/path-samples.d.cts +19 -0
  56. package/dist/paint-editor/path-samples.d.ts +19 -0
  57. package/dist/paint-editor/stamp-tip.d.cts +17 -0
  58. package/dist/paint-editor/stamp-tip.d.ts +17 -0
  59. package/dist/paint-editor/ui.d.cts +27 -1
  60. package/dist/paint-editor/ui.d.ts +27 -1
  61. package/dist/raster/index.cjs +2 -4
  62. package/dist/raster/index.js +6 -8
  63. package/dist/vector/brushstroke.d.cts +6 -0
  64. package/dist/vector/brushstroke.d.ts +6 -0
  65. package/dist/vector/controller.d.cts +11 -2
  66. package/dist/vector/controller.d.ts +11 -2
  67. package/dist/vector/index.cjs +990 -973
  68. package/dist/vector/index.js +28 -11
  69. package/package.json +1 -1
  70. package/skills/pixerate-brushes/SKILL.md +1 -1
  71. package/skills/pixerate-canvas/SKILL.md +3 -1
  72. package/skills/pixerate-paint-editor/SKILL.md +2 -0
  73. package/skills/pixerate-paint-sketch-to-finish/SKILL.md +5 -1
  74. package/skills/pixerate-vector/SKILL.md +2 -2
  75. package/dist/chunk-2VJAVXLI.js +0 -192
  76. package/dist/chunk-62Z5WLRA.js +0 -700
  77. package/dist/chunk-BOHDJJ2O.cjs +0 -192
  78. package/dist/chunk-NKGB64CW.cjs +0 -700
  79. package/dist/chunk-SS53NNZO.cjs +0 -1066
  80. package/dist/chunk-ZNA3IQZF.js +0 -1066
@@ -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;
@@ -230,6 +250,12 @@ export declare function toggleStamp(stamps: readonly StampKind[], stamp: StampKi
230
250
  * else adds it while there are fewer than `MAX_DOT_TEXTURES`. Empty means round dots.
231
251
  */
232
252
  export declare function toggleDotTexture(textures: readonly StampKind[], stamp: StampKind): StampKind[];
253
+ /** Pressure profiles the "Brush a path" panel offers for `strokePath` (`pressure` undefined: even). */
254
+ export declare const PATH_STROKE_TAPERS: ReadonlyArray<{
255
+ id: string;
256
+ label: string;
257
+ pressure?: readonly number[];
258
+ }>;
233
259
  /** The sticker panel's sliders for the selected sticker. */
234
260
  /** The brush sliders of a picked stroke on a stroke layer (paths into its brush; see `updateStroke`). */
235
261
  export declare const STROKE_SLIDERS: readonly SliderControl[];
@@ -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;
@@ -230,6 +250,12 @@ export declare function toggleStamp(stamps: readonly StampKind[], stamp: StampKi
230
250
  * else adds it while there are fewer than `MAX_DOT_TEXTURES`. Empty means round dots.
231
251
  */
232
252
  export declare function toggleDotTexture(textures: readonly StampKind[], stamp: StampKind): StampKind[];
253
+ /** Pressure profiles the "Brush a path" panel offers for `strokePath` (`pressure` undefined: even). */
254
+ export declare const PATH_STROKE_TAPERS: ReadonlyArray<{
255
+ id: string;
256
+ label: string;
257
+ pressure?: readonly number[];
258
+ }>;
233
259
  /** The sticker panel's sliders for the selected sticker. */
234
260
  /** The brush sliders of a picked stroke on a stroke layer (paths into its brush; see `updateStroke`). */
235
261
  export declare const STROKE_SLIDERS: readonly SliderControl[];
@@ -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
@@ -104,6 +104,8 @@ export interface VectorEditorOptions {
104
104
  * profile decides which). Share one with the paint editor so a brush saved there paints here.
105
105
  */
106
106
  brushLibrary?: Pick<BrushLibrary, 'list' | 'subscribe'>;
107
+ /** The app's colour scheme, which picks the side of a brush's light / dark default colour (default light). */
108
+ colorScheme?: 'light' | 'dark';
107
109
  /** History to record into, e.g. one shared with the rest of the app (default: a new one). */
108
110
  history?: HistoryManager;
109
111
  /** Starting tool (default `select`). */
@@ -789,6 +791,7 @@ export declare class VectorEditorController {
789
791
  private committing;
790
792
  private revision;
791
793
  private state;
794
+ private colorScheme;
792
795
  constructor(options?: VectorEditorOptions);
793
796
  /** Listens to the history (once; again after `destroy`). */
794
797
  private connect;
@@ -1117,7 +1120,8 @@ export declare class VectorEditorController {
1117
1120
  * Adds a brushstroke to the selected (or given) paths: a stroke layer that paints the path with
1118
1121
  * brush `brushId` (a preset, or a saved brush of the brush library: `listBrushstrokeBrushes`), `size` document
1119
1122
  * units across (default the brush's own), an optional `pressure` profile along the length, in
1120
- * `color` (default the top stroke's paint, else black) at `opacity`. At the top of the stroke
1123
+ * `color` (default the brush's own default colour, unless `keepColour`; else the top stroke's
1124
+ * paint, else black) at `opacity`. At the top of the stroke
1121
1125
  * stack or at `index`. A `seed` gives it the brush's character (jitter and the grain of `paper`,
1122
1126
  * `null` for none); without one it renders plain. One undo step.
1123
1127
  */
@@ -1125,13 +1129,15 @@ export declare class VectorEditorController {
1125
1129
  ids?: readonly string[];
1126
1130
  index?: number;
1127
1131
  color?: string;
1132
+ keepColour?: boolean;
1128
1133
  opacity?: number;
1129
1134
  }): VectorActionResult;
1130
1135
  /**
1131
1136
  * Changes brushstroke layer `index` (in the stroke stack, 0 is the bottom) of the selected (or
1132
1137
  * given) paths: another brush, size, pressure profile (null removes it), colour or opacity, the
1133
1138
  * character `seed` (null removes it: plain dabs) or the `paper` (replaced whole: `null` for no
1134
- * grain, `{}` for the default paper). Fails, changing nothing, when that layer is not a
1139
+ * grain, `{}` for the default paper). Another brush without a `color` takes that brush's default
1140
+ * colour, if it has one, unless `keepColour`. Fails, changing nothing, when that layer is not a
1135
1141
  * brushstroke. With `merge`, consecutive edits fold into one undo step.
1136
1142
  */
1137
1143
  setBrushstroke(index: number, patch: {
@@ -1139,6 +1145,7 @@ export declare class VectorEditorController {
1139
1145
  size?: number | null;
1140
1146
  pressure?: number[] | null;
1141
1147
  color?: string;
1148
+ keepColour?: boolean;
1142
1149
  opacity?: number;
1143
1150
  seed?: number | null;
1144
1151
  paper?: VectorBrushstrokePaper | null;
@@ -1146,6 +1153,8 @@ export declare class VectorEditorController {
1146
1153
  ids?: readonly string[];
1147
1154
  merge?: boolean | string;
1148
1155
  }): VectorActionResult;
1156
+ /** Sets the colour scheme that picks the side of a brush's light / dark default colour. Existing strokes keep their colour. */
1157
+ setColorScheme(scheme: 'light' | 'dark'): void;
1149
1158
  /** Removes layer `index` of the fill or stroke stack of the selected (or given) paths. */
1150
1159
  removePaintLayer(kind: 'fill' | 'stroke', index: number, options?: {
1151
1160
  ids?: readonly string[];
@@ -104,6 +104,8 @@ export interface VectorEditorOptions {
104
104
  * profile decides which). Share one with the paint editor so a brush saved there paints here.
105
105
  */
106
106
  brushLibrary?: Pick<BrushLibrary, 'list' | 'subscribe'>;
107
+ /** The app's colour scheme, which picks the side of a brush's light / dark default colour (default light). */
108
+ colorScheme?: 'light' | 'dark';
107
109
  /** History to record into, e.g. one shared with the rest of the app (default: a new one). */
108
110
  history?: HistoryManager;
109
111
  /** Starting tool (default `select`). */
@@ -789,6 +791,7 @@ export declare class VectorEditorController {
789
791
  private committing;
790
792
  private revision;
791
793
  private state;
794
+ private colorScheme;
792
795
  constructor(options?: VectorEditorOptions);
793
796
  /** Listens to the history (once; again after `destroy`). */
794
797
  private connect;
@@ -1117,7 +1120,8 @@ export declare class VectorEditorController {
1117
1120
  * Adds a brushstroke to the selected (or given) paths: a stroke layer that paints the path with
1118
1121
  * brush `brushId` (a preset, or a saved brush of the brush library: `listBrushstrokeBrushes`), `size` document
1119
1122
  * units across (default the brush's own), an optional `pressure` profile along the length, in
1120
- * `color` (default the top stroke's paint, else black) at `opacity`. At the top of the stroke
1123
+ * `color` (default the brush's own default colour, unless `keepColour`; else the top stroke's
1124
+ * paint, else black) at `opacity`. At the top of the stroke
1121
1125
  * stack or at `index`. A `seed` gives it the brush's character (jitter and the grain of `paper`,
1122
1126
  * `null` for none); without one it renders plain. One undo step.
1123
1127
  */
@@ -1125,13 +1129,15 @@ export declare class VectorEditorController {
1125
1129
  ids?: readonly string[];
1126
1130
  index?: number;
1127
1131
  color?: string;
1132
+ keepColour?: boolean;
1128
1133
  opacity?: number;
1129
1134
  }): VectorActionResult;
1130
1135
  /**
1131
1136
  * Changes brushstroke layer `index` (in the stroke stack, 0 is the bottom) of the selected (or
1132
1137
  * given) paths: another brush, size, pressure profile (null removes it), colour or opacity, the
1133
1138
  * character `seed` (null removes it: plain dabs) or the `paper` (replaced whole: `null` for no
1134
- * grain, `{}` for the default paper). Fails, changing nothing, when that layer is not a
1139
+ * grain, `{}` for the default paper). Another brush without a `color` takes that brush's default
1140
+ * colour, if it has one, unless `keepColour`. Fails, changing nothing, when that layer is not a
1135
1141
  * brushstroke. With `merge`, consecutive edits fold into one undo step.
1136
1142
  */
1137
1143
  setBrushstroke(index: number, patch: {
@@ -1139,6 +1145,7 @@ export declare class VectorEditorController {
1139
1145
  size?: number | null;
1140
1146
  pressure?: number[] | null;
1141
1147
  color?: string;
1148
+ keepColour?: boolean;
1142
1149
  opacity?: number;
1143
1150
  seed?: number | null;
1144
1151
  paper?: VectorBrushstrokePaper | null;
@@ -1146,6 +1153,8 @@ export declare class VectorEditorController {
1146
1153
  ids?: readonly string[];
1147
1154
  merge?: boolean | string;
1148
1155
  }): VectorActionResult;
1156
+ /** Sets the colour scheme that picks the side of a brush's light / dark default colour. Existing strokes keep their colour. */
1157
+ setColorScheme(scheme: 'light' | 'dark'): void;
1149
1158
  /** Removes layer `index` of the fill or stroke stack of the selected (or given) paths. */
1150
1159
  removePaintLayer(kind: 'fill' | 'stroke', index: number, options?: {
1151
1160
  ids?: readonly string[];