@pixerate/editor 0.107.0 → 0.108.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.
@@ -54,6 +54,12 @@ var _chunkHUFQD4CBcjs = require('../chunk-HUFQD4CB.cjs');
54
54
 
55
55
 
56
56
  var _chunkSZ6KMZNMcjs = require('../chunk-SZ6KMZNM.cjs');
57
+
58
+
59
+
60
+
61
+
62
+ var _chunkEGFUVXKKcjs = require('../chunk-EGFUVXKK.cjs');
57
63
  require('../chunk-DWGZUSES.cjs');
58
64
 
59
65
  // src/paint-editor/noise.ts
@@ -2716,6 +2722,7 @@ var PaintEditorController = (_class9 = class {
2716
2722
  else this.emit([]);
2717
2723
  return result;
2718
2724
  }
2725
+ /** Checks stroke samples (finite x and y, pressure 0..1) and returns them; throws a sentence naming the bad point. */
2719
2726
  checkPoints(points) {
2720
2727
  if (!Array.isArray(points) || !points.length) throw new PaintEditorError("points is empty; give at least one {x, y} in document pixels.");
2721
2728
  const out = [];
@@ -3250,6 +3257,169 @@ function resampleInto(src, rect, width, height) {
3250
3257
  return { width, height, data: out };
3251
3258
  }
3252
3259
 
3260
+ // src/paint-editor/presence.ts
3261
+ var PaintPresence = class extends _chunkEGFUVXKKcjs.PresenceStore {
3262
+ };
3263
+ var FRAME = 16;
3264
+ function strokeSchedule(points) {
3265
+ if (points.length < 2) return points.map(() => 1);
3266
+ const t0 = points[0].t;
3267
+ const t1 = points[points.length - 1].t;
3268
+ if (points.every((p) => Number.isFinite(p.t)) && t1 > t0) {
3269
+ return points.map((p) => Math.min(1, Math.max(0, (p.t - t0) / (t1 - t0))));
3270
+ }
3271
+ const acc = [0];
3272
+ for (let i = 1; i < points.length; i++) acc.push(acc[i - 1] + Math.hypot(points[i].x - points[i - 1].x, points[i].y - points[i - 1].y));
3273
+ const total = acc[acc.length - 1];
3274
+ return total > 0 ? acc.map((d) => d / total) : points.map(() => 1);
3275
+ }
3276
+ function strokeDuration(points, max = 1800) {
3277
+ const t0 = _optionalChain([points, 'access', _87 => _87[0], 'optionalAccess', _88 => _88.t]);
3278
+ const t1 = _optionalChain([points, 'access', _89 => _89[points.length - 1], 'optionalAccess', _90 => _90.t]);
3279
+ let ms;
3280
+ if (points.every((p) => Number.isFinite(p.t)) && t1 > t0) ms = t1 - t0;
3281
+ else {
3282
+ let length = 0;
3283
+ for (let i = 1; i < points.length; i++) length += Math.hypot(points[i].x - points[i - 1].x, points[i].y - points[i - 1].y);
3284
+ ms = length / 1.5;
3285
+ }
3286
+ return Math.min(max, Math.max(250, ms));
3287
+ }
3288
+ function sweepPath(rect, rows = 4) {
3289
+ const inset = Math.min(rect.width, rect.height) * 0.08;
3290
+ const left = rect.x + inset;
3291
+ const right = rect.x + rect.width - inset;
3292
+ const out = [];
3293
+ for (let r = 0; r < rows; r++) {
3294
+ const y = rect.y + inset + (rect.height - 2 * inset) * (r + 0.5) / rows;
3295
+ out.push(r % 2 ? { x: right, y } : { x: left, y }, r % 2 ? { x: left, y } : { x: right, y });
3296
+ }
3297
+ return out;
3298
+ }
3299
+ var centre = (r) => ({ x: r.x + r.width / 2, y: r.y + r.height / 2 });
3300
+ var PaintDirector = class {
3301
+ constructor(controller, presence, options = {}) {
3302
+ this.controller = controller;
3303
+ this.presence = presence;
3304
+ this.options = options;
3305
+ this.clock = _nullishCoalesce(options.clock, () => ( _chunkEGFUVXKKcjs.realPresenceClock));
3306
+ this.queue = new (0, _chunkEGFUVXKKcjs.PerformanceQueue)(presence, { clock: this.clock, linger: options.linger });
3307
+ }
3308
+
3309
+
3310
+
3311
+
3312
+
3313
+ /** Acts out `commands` in order for `actor`. Resolves with one result per command. */
3314
+ perform(actor, commands) {
3315
+ return this.queue.run(actor, async () => {
3316
+ const results = [];
3317
+ for (const command of commands) {
3318
+ try {
3319
+ results.push({ ok: true, command, result: await this.performOne(actor.id, command) });
3320
+ } catch (error) {
3321
+ results.push({ ok: false, command, message: error instanceof Error ? error.message : String(error) });
3322
+ }
3323
+ }
3324
+ return results;
3325
+ });
3326
+ }
3327
+ ms(n) {
3328
+ return Math.round(n / Math.max(0.1, _nullishCoalesce(this.options.speed, () => ( 1))));
3329
+ }
3330
+ where(id) {
3331
+ const a = this.presence.get(id);
3332
+ return { x: _nullishCoalesce(_optionalChain([a, 'optionalAccess', _91 => _91.x]), () => ( 0)), y: _nullishCoalesce(_optionalChain([a, 'optionalAccess', _92 => _92.y]), () => ( 0)) };
3333
+ }
3334
+ /** Glides to `to`; an actor that just appeared starts there instead of the corner. */
3335
+ async glide(id, to, ms = 380) {
3336
+ const a = this.presence.get(id);
3337
+ if (!a || a.x === 0 && a.y === 0) {
3338
+ this.presence.set({ id, x: to.x, y: to.y });
3339
+ return;
3340
+ }
3341
+ await _chunkEGFUVXKKcjs.tweenPresenceCursor.call(void 0, this.presence, this.clock, id, this.where(id), to, this.ms(ms));
3342
+ }
3343
+ async say(id, text, ms) {
3344
+ if (!text) return;
3345
+ this.presence.set({ id, message: text });
3346
+ await this.clock.wait(this.ms(ms));
3347
+ }
3348
+ async performOne(id, command) {
3349
+ const c = this.controller;
3350
+ switch (command.kind) {
3351
+ case "say":
3352
+ await this.say(id, command.text, 900);
3353
+ return void 0;
3354
+ case "point":
3355
+ await this.say(id, command.note, 500);
3356
+ await this.glide(id, command.at);
3357
+ this.presence.set({ id, pressed: true });
3358
+ await this.clock.wait(this.ms(110));
3359
+ this.presence.set({ id, pressed: false });
3360
+ return void 0;
3361
+ case "stroke":
3362
+ await this.say(id, command.note, 500);
3363
+ return this.stroke(id, command.stroke);
3364
+ case "fill": {
3365
+ await this.say(id, command.note, 500);
3366
+ const { width, height } = c.getState().document.canvas;
3367
+ const path = sweepPath({ x: 0, y: 0, width, height });
3368
+ await this.glide(id, path[0]);
3369
+ this.presence.set({ id, pressed: true });
3370
+ try {
3371
+ for (let i = 1; i < path.length; i++) await _chunkEGFUVXKKcjs.tweenPresenceCursor.call(void 0, this.presence, this.clock, id, path[i - 1], path[i], this.ms(i % 2 ? 260 : 90));
3372
+ } finally {
3373
+ this.presence.set({ id, pressed: false });
3374
+ }
3375
+ return c.fillLayer(command.fill);
3376
+ }
3377
+ case "replay": {
3378
+ await this.say(id, command.note, 500);
3379
+ const source = c.getStrokes().filter((s) => _optionalChain([command, 'access', _93 => _93.replay, 'access', _94 => _94.strokeIds, 'optionalAccess', _95 => _95.includes, 'call', _96 => _96(s.id)]));
3380
+ const first = _optionalChain([source, 'access', _97 => _97[0], 'optionalAccess', _98 => _98.points, 'access', _99 => _99[0]]);
3381
+ if (first) await this.glide(id, first);
3382
+ const result = c.replayStrokes(command.replay);
3383
+ if (result.bounds) await this.glide(id, centre(result.bounds), 520);
3384
+ return result;
3385
+ }
3386
+ }
3387
+ }
3388
+ /** Paints a stroke live: begins it, pushes its points frame by frame as the cursor reaches them, then ends it (one undo step). */
3389
+ async stroke(id, init) {
3390
+ const c = this.controller;
3391
+ const points = c.checkPoints(init.points);
3392
+ const { points: _points, ...rest } = init;
3393
+ const session = c.beginStroke({ snapToPerspective: false, start: points[0], ...rest });
3394
+ try {
3395
+ await this.glide(id, points[0]);
3396
+ this.presence.set({ id, pressed: true });
3397
+ const at = strokeSchedule(points);
3398
+ const duration = this.ms(strokeDuration(points, this.options.maxStrokeMs));
3399
+ let next = 0;
3400
+ const frames = Math.max(1, Math.round(duration / FRAME));
3401
+ for (let f = 1; f <= frames; f++) {
3402
+ const t = f / frames;
3403
+ const from = next;
3404
+ while (next < points.length && at[next] <= t + 1e-9) next++;
3405
+ if (next > from) {
3406
+ session.push(points.slice(from, next));
3407
+ const p = points[next - 1];
3408
+ this.presence.set({ id, x: p.x, y: p.y });
3409
+ }
3410
+ if (f < frames) await this.clock.wait(duration / frames);
3411
+ }
3412
+ if (next < points.length) session.push(points.slice(next));
3413
+ this.presence.set({ id, pressed: false });
3414
+ return session.end();
3415
+ } catch (error) {
3416
+ if (c.activeStroke === session) session.cancel();
3417
+ this.presence.set({ id, pressed: false });
3418
+ throw error;
3419
+ }
3420
+ }
3421
+ };
3422
+
3253
3423
  // src/paint-editor/guide-tools.ts
3254
3424
  var READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
3255
3425
  var WRITE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false };
@@ -3685,6 +3855,12 @@ function createPaintEditorToolProvider(controller, options = {}) {
3685
3855
  const c = controller;
3686
3856
  const tools = [];
3687
3857
  const add = (t) => tools.push(t);
3858
+ const act = async (command, direct) => {
3859
+ if (!options.director) return direct();
3860
+ const [r] = await options.director.perform(_nullishCoalesce(options.actor, () => ( { id: "agent", name: "Agent" })), [command]);
3861
+ if (!r || !r.ok) throw new Error(r && !r.ok ? r.message : "The director did not run the command.");
3862
+ return r.result;
3863
+ };
3688
3864
  add({
3689
3865
  name: "get_canvas_info",
3690
3866
  title: "Get the canvas",
@@ -3949,7 +4125,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
3949
4125
  additionalProperties: false
3950
4126
  },
3951
4127
  annotations: { title: "Fill a layer", ...WRITE2 },
3952
- handler: (a) => c.fillLayer(a)
4128
+ handler: (a) => act({ kind: "fill", fill: a }, () => c.fillLayer(a))
3953
4129
  });
3954
4130
  add({
3955
4131
  name: "clear_layer",
@@ -3967,7 +4143,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
3967
4143
  annotations: { title: "List brushes", ...READ2 },
3968
4144
  handler: () => {
3969
4145
  const s = c.getState();
3970
- return { activeBrushId: s.brush.id, activeEdited: !s.brush.builtin && Boolean(_optionalChain([c, 'access', _87 => _87.getBrush, 'call', _88 => _88(s.brush.id), 'optionalAccess', _89 => _89.builtin])), brushes: s.brushes.map(brushSummary) };
4146
+ return { activeBrushId: s.brush.id, activeEdited: !s.brush.builtin && Boolean(_optionalChain([c, 'access', _100 => _100.getBrush, 'call', _101 => _101(s.brush.id), 'optionalAccess', _102 => _102.builtin])), brushes: s.brushes.map(brushSummary) };
3971
4147
  }
3972
4148
  });
3973
4149
  add({
@@ -4132,7 +4308,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
4132
4308
  add({
4133
4309
  name: "paint_stroke",
4134
4310
  title: "Paint a brush stroke",
4135
- description: "Paints one stroke through points (document pixels, with optional pressure, time, tilt and barrel rotation) on a pixel layer with a library brush or the active one, optionally changed for this stroke. Grain-responsive brushes follow the paper; the mixer engine (mixer-brush, blender, smudge) picks up and moves paint already on the layer. The symmetry guide adds its mirror copies; with a tracing image that samples colours, a stroke without color takes the image colour at its first point. One undo step. Returns the layer id, changed bounds, dab count, the recorded strokeId (for replay_strokes) and, for the mixer, its load after the stroke.",
4311
+ description: "Paints one stroke through points (document pixels, with optional pressure, time, tilt and barrel rotation) on a pixel layer with a library brush or the active one, optionally changed for this stroke. Grain-responsive brushes follow the paper; the mixer engine (mixer-brush, blender, smudge) picks up and moves paint already on the layer. The symmetry guide adds its mirror copies; with a tracing image that samples colours, a stroke without color takes the image colour at its first point. With an agent cursor (a director), the stroke is painted live along the points at the pace of their times. One undo step. Returns the layer id, changed bounds, dab count, the recorded strokeId (for replay_strokes) and, for the mixer, its load after the stroke.",
4136
4312
  inputSchema: {
4137
4313
  type: "object",
4138
4314
  properties: {
@@ -4148,8 +4324,9 @@ function createPaintEditorToolProvider(controller, options = {}) {
4148
4324
  additionalProperties: false
4149
4325
  },
4150
4326
  annotations: { title: "Paint a brush stroke", ...WRITE2 },
4151
- handler: (a) => {
4152
- const r = c.paintStroke({ points: a.points, layerId: a.layerId, brushId: a.brushId, brush: a.brush, color: a.color, seed: a.seed, snapToPerspective: a.snapToPerspective });
4327
+ handler: async (a) => {
4328
+ const stroke = { points: a.points, layerId: a.layerId, brushId: a.brushId, brush: a.brush, color: a.color, seed: a.seed, snapToPerspective: a.snapToPerspective };
4329
+ const r = await act({ kind: "stroke", stroke }, () => c.paintStroke(stroke));
4153
4330
  return r.mixerLoad ? { ...r, mixerLoad: loadResult(r.mixerLoad) } : r;
4154
4331
  }
4155
4332
  });
@@ -4186,7 +4363,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
4186
4363
  color: s.color,
4187
4364
  points: ids ? s.points : s.points.length,
4188
4365
  seed: s.seed,
4189
- copies: _nullishCoalesce(_optionalChain([s, 'access', _90 => _90.copies, 'optionalAccess', _91 => _91.length]), () => ( 0)),
4366
+ copies: _nullishCoalesce(_optionalChain([s, 'access', _103 => _103.copies, 'optionalAccess', _104 => _104.length]), () => ( 0)),
4190
4367
  bounds: { x: Math.floor(Math.min(...xs) - pad), y: Math.floor(Math.min(...ys) - pad), width: Math.ceil(Math.max(...xs) - Math.min(...xs) + 2 * pad), height: Math.ceil(Math.max(...ys) - Math.min(...ys) + 2 * pad) }
4191
4368
  };
4192
4369
  })
@@ -4223,7 +4400,10 @@ function createPaintEditorToolProvider(controller, options = {}) {
4223
4400
  additionalProperties: false
4224
4401
  },
4225
4402
  annotations: { title: "Replay strokes, varied", ...WRITE2 },
4226
- handler: (a) => c.replayStrokes(a)
4403
+ handler: (a) => {
4404
+ const replay = a;
4405
+ return act({ kind: "replay", replay }, () => c.replayStrokes(replay));
4406
+ }
4227
4407
  });
4228
4408
  add({
4229
4409
  name: "set_view",
@@ -4457,12 +4637,12 @@ var PaintGesture = (_class10 = class {
4457
4637
  if (!m || m.pointerId !== e.pointerId) return;
4458
4638
  this.mode = null;
4459
4639
  this.predicted = [];
4460
- if (m.kind === "stroke") _optionalChain([this, 'access', _92 => _92.controller, 'access', _93 => _93.activeStroke, 'optionalAccess', _94 => _94.end, 'call', _95 => _95()]);
4640
+ if (m.kind === "stroke") _optionalChain([this, 'access', _105 => _105.controller, 'access', _106 => _106.activeStroke, 'optionalAccess', _107 => _107.end, 'call', _108 => _108()]);
4461
4641
  }
4462
4642
  cancel() {
4463
4643
  this.penDown = false;
4464
4644
  this.predicted = [];
4465
- if (_optionalChain([this, 'access', _96 => _96.mode, 'optionalAccess', _97 => _97.kind]) === "stroke") _optionalChain([this, 'access', _98 => _98.controller, 'access', _99 => _99.activeStroke, 'optionalAccess', _100 => _100.cancel, 'call', _101 => _101()]);
4645
+ if (_optionalChain([this, 'access', _109 => _109.mode, 'optionalAccess', _110 => _110.kind]) === "stroke") _optionalChain([this, 'access', _111 => _111.controller, 'access', _112 => _112.activeStroke, 'optionalAccess', _113 => _113.cancel, 'call', _114 => _114()]);
4466
4646
  this.mode = null;
4467
4647
  }
4468
4648
  get active() {
@@ -4590,7 +4770,7 @@ var PAPER_SLIDERS = [
4590
4770
  ];
4591
4771
  function readPath(obj, path) {
4592
4772
  let v = obj;
4593
- for (const k of path.split(".")) v = _optionalChain([v, 'optionalAccess', _102 => _102[k]]);
4773
+ for (const k of path.split(".")) v = _optionalChain([v, 'optionalAccess', _115 => _115[k]]);
4594
4774
  return typeof v === "number" ? v : 0;
4595
4775
  }
4596
4776
  function patchPath(obj, path, value) {
@@ -4777,5 +4957,10 @@ var BLEND_MENU_GROUPS = [
4777
4957
 
4778
4958
 
4779
4959
 
4780
- exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunkSZ6KMZNMcjs.BLEND_MODES; exports.BRUSH_ID = BRUSH_ID; exports.BRUSH_ROTATIONS = BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = BUILTIN_BRUSHES; exports.DEFAULT_BRUSH_ID = DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = DEFAULT_DYNAMICS; exports.DEFAULT_PAPER = DEFAULT_PAPER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DryStroke = DryStroke; exports.GRAIN_PATTERNS = GRAIN_PATTERNS; exports.GRAIN_TILE = GRAIN_TILE; exports.HARMONY_KINDS = HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = IDENTITY_COPY; exports.MAX_BRUSH_SIZE = _chunkHUFQD4CBcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_SIDE = MAX_CANVAS_SIDE; exports.MAX_COORDINATE = MAX_COORDINATE; exports.MAX_IMAGE_SIDE = MAX_IMAGE_SIDE; exports.MAX_ZOOM = MAX_ZOOM; exports.MIN_CANVAS_SIDE = MIN_CANVAS_SIDE; exports.MIN_ZOOM = MIN_ZOOM; exports.MIXING_PAD_HEIGHT = MIXING_PAD_HEIGHT; exports.MIXING_PAD_WIDTH = MIXING_PAD_WIDTH; exports.MixingPad = MixingPad; exports.PAINTERLY_BLEND_MODES = _chunkSZ6KMZNMcjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = PAINT_BRUSH_ENGINES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_FAMILIES = PAPER_FAMILIES; exports.PAPER_LIBRARY = PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PaintCanvasPresenter = PaintCanvasPresenter; exports.PaintDocumentError = PaintDocumentError; exports.PaintEditorController = PaintEditorController; exports.PaintEditorError = PaintEditorError; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = PaperGrain; exports.PenDabWalker = PenDabWalker; exports.PenSmoother = PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.SYMMETRY_MODES = SYMMETRY_MODES; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.TileableNoise = TileableNoise; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.brushToJSON = brushToJSON; exports.clonePaper = clonePaper; exports.colorHarmony = colorHarmony; exports.composeAffine = composeAffine; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; exports.createPaintLayer = createPaintLayer; exports.decodeImageBlob = decodeImageBlob; exports.defaultGuides = defaultGuides; exports.defaultImageEncoder = defaultImageEncoder; exports.deserializePaintDocument = deserializePaintDocument; exports.deserializePaintDocumentAsync = deserializePaintDocumentAsync; exports.documentExtensions = documentExtensions; exports.documentToScreen = documentToScreen; exports.downloadBytes = downloadBytes; exports.downsampleRgba = downsampleRgba; exports.fitZoom = fitZoom; exports.grainCatch = grainCatch; exports.grainHeights = grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = hash2; exports.hexToRgb8 = hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunkSZ6KMZNMcjs.isBlendMode; exports.isPainterlyBlendMode = _chunkSZ6KMZNMcjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.mapPenPoint = mapPenPoint; exports.mix32 = mix32; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = mixerTip; exports.newPaintLayerId = newPaintLayerId; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = normalizeDynamics; exports.normalizePaintBrush = normalizePaintBrush; exports.normalizePaper = normalizePaper; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = paperPreset; exports.parseBrushLibrary = parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.patchPath = patchPath; exports.penOrientation = penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.pointerToPenPoint = pointerToPenPoint; exports.rand01 = rand01; exports.randSigned = randSigned; exports.readPath = readPath; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = renderPaper; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.samplePressure = samplePressure; exports.screenToDocument = screenToDocument; exports.seedFromString = seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.standardBlendMode = _chunkSZ6KMZNMcjs.standardBlendMode; exports.strokeBounds = strokeBounds; exports.symmetryAxisAngles = symmetryAxisAngles; exports.symmetryAxisSegments = symmetryAxisSegments; exports.symmetryCopies = symmetryCopies; exports.thumbnailStroke = thumbnailStroke; exports.tiltToOrientation = tiltToOrientation; exports.toStrokePoint = toStrokePoint; exports.variationAffine = variationAffine; exports.varyStroke = varyStroke; exports.viewCssTransform = viewCssTransform; exports.viewMatrix = viewMatrix; exports.viewPenToDocument = viewPenToDocument; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = wheelToHue;
4960
+
4961
+
4962
+
4963
+
4964
+
4965
+ exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunkSZ6KMZNMcjs.BLEND_MODES; exports.BRUSH_ID = BRUSH_ID; exports.BRUSH_ROTATIONS = BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = BUILTIN_BRUSHES; exports.DEFAULT_BRUSH_ID = DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = DEFAULT_DYNAMICS; exports.DEFAULT_PAPER = DEFAULT_PAPER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DryStroke = DryStroke; exports.GRAIN_PATTERNS = GRAIN_PATTERNS; exports.GRAIN_TILE = GRAIN_TILE; exports.HARMONY_KINDS = HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = IDENTITY_COPY; exports.MAX_BRUSH_SIZE = _chunkHUFQD4CBcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_SIDE = MAX_CANVAS_SIDE; exports.MAX_COORDINATE = MAX_COORDINATE; exports.MAX_IMAGE_SIDE = MAX_IMAGE_SIDE; exports.MAX_ZOOM = MAX_ZOOM; exports.MIN_CANVAS_SIDE = MIN_CANVAS_SIDE; exports.MIN_ZOOM = MIN_ZOOM; exports.MIXING_PAD_HEIGHT = MIXING_PAD_HEIGHT; exports.MIXING_PAD_WIDTH = MIXING_PAD_WIDTH; exports.MixingPad = MixingPad; exports.PAINTERLY_BLEND_MODES = _chunkSZ6KMZNMcjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = PAINT_BRUSH_ENGINES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_FAMILIES = PAPER_FAMILIES; exports.PAPER_LIBRARY = PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PaintCanvasPresenter = PaintCanvasPresenter; exports.PaintDirector = PaintDirector; exports.PaintDocumentError = PaintDocumentError; exports.PaintEditorController = PaintEditorController; exports.PaintEditorError = PaintEditorError; exports.PaintGesture = PaintGesture; exports.PaintPresence = PaintPresence; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = PaperGrain; exports.PenDabWalker = PenDabWalker; exports.PenSmoother = PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.SYMMETRY_MODES = SYMMETRY_MODES; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.TileableNoise = TileableNoise; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.brushToJSON = brushToJSON; exports.clonePaper = clonePaper; exports.colorHarmony = colorHarmony; exports.composeAffine = composeAffine; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; exports.createPaintLayer = createPaintLayer; exports.decodeImageBlob = decodeImageBlob; exports.defaultGuides = defaultGuides; exports.defaultImageEncoder = defaultImageEncoder; exports.deserializePaintDocument = deserializePaintDocument; exports.deserializePaintDocumentAsync = deserializePaintDocumentAsync; exports.documentExtensions = documentExtensions; exports.documentToScreen = documentToScreen; exports.downloadBytes = downloadBytes; exports.downsampleRgba = downsampleRgba; exports.fitZoom = fitZoom; exports.grainCatch = grainCatch; exports.grainHeights = grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = hash2; exports.hexToRgb8 = hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunkSZ6KMZNMcjs.isBlendMode; exports.isPainterlyBlendMode = _chunkSZ6KMZNMcjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.mapPenPoint = mapPenPoint; exports.mix32 = mix32; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = mixerTip; exports.newPaintLayerId = newPaintLayerId; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = normalizeDynamics; exports.normalizePaintBrush = normalizePaintBrush; exports.normalizePaper = normalizePaper; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = paperPreset; exports.parseBrushLibrary = parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.patchPath = patchPath; exports.penOrientation = penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.pointerToPenPoint = pointerToPenPoint; exports.rand01 = rand01; exports.randSigned = randSigned; exports.readPath = readPath; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = renderPaper; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.samplePressure = samplePressure; exports.screenToDocument = screenToDocument; exports.seedFromString = seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.standardBlendMode = _chunkSZ6KMZNMcjs.standardBlendMode; exports.strokeBounds = strokeBounds; exports.strokeDuration = strokeDuration; exports.strokeSchedule = strokeSchedule; exports.sweepPath = sweepPath; exports.symmetryAxisAngles = symmetryAxisAngles; exports.symmetryAxisSegments = symmetryAxisSegments; exports.symmetryCopies = symmetryCopies; exports.thumbnailStroke = thumbnailStroke; exports.tiltToOrientation = tiltToOrientation; exports.toStrokePoint = toStrokePoint; exports.variationAffine = variationAffine; exports.varyStroke = varyStroke; exports.viewCssTransform = viewCssTransform; exports.viewMatrix = viewMatrix; exports.viewPenToDocument = viewPenToDocument; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = wheelToHue;
4781
4966
  //# sourceMappingURL=index.cjs.map