@pixerate/editor 0.266.2 → 0.267.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.
- package/dist/agent/index.cjs +2 -2
- package/dist/agent/index.js +1 -1
- package/dist/animation-editor/controller.d.cts +8 -0
- package/dist/animation-editor/controller.d.ts +8 -0
- package/dist/animation-editor/effect-tools.d.cts +1 -1
- package/dist/animation-editor/effect-tools.d.ts +1 -1
- package/dist/animation-editor/index.cjs +172 -105
- package/dist/animation-editor/index.js +91 -24
- package/dist/brushes/index.cjs +59 -59
- package/dist/brushes/index.js +5 -5
- package/dist/brushes/profiles.d.cts +6 -1
- package/dist/brushes/profiles.d.ts +6 -1
- package/dist/{brushstrokeRender-FSUWXUZY.cjs → brushstrokeRender-L7JYRR2R.cjs} +16 -16
- package/dist/{brushstrokeRender-KD453OBX.js → brushstrokeRender-NLFPEBGI.js} +4 -4
- package/dist/canvas/brushTypes.d.cts +12 -0
- package/dist/canvas/brushTypes.d.ts +12 -0
- package/dist/canvas/brushstroke.d.cts +1 -1
- package/dist/canvas/brushstroke.d.ts +1 -1
- package/dist/canvas/drawController.d.cts +19 -4
- package/dist/canvas/drawController.d.ts +19 -4
- package/dist/canvas/index.cjs +144 -105
- package/dist/canvas/index.js +46 -7
- package/dist/{chunk-XORJ7UZO.cjs → chunk-3VHH6V67.cjs} +13 -12
- package/dist/{chunk-T2LDTEXK.js → chunk-4IDUYB45.js} +2217 -56
- package/dist/chunk-7UKFXXWL.js +802 -0
- package/dist/chunk-ADMRNWR7.js +340 -0
- package/dist/{chunk-CIJBSUM5.js → chunk-AGNUD5BI.js} +2 -2
- package/dist/{chunk-WLUVZKVD.cjs → chunk-DT4YQUGT.cjs} +32 -32
- package/dist/{chunk-DXYHQ2VN.js → chunk-EF7LZAXQ.js} +1 -1
- package/dist/chunk-EXB2EGBE.cjs +802 -0
- package/dist/{chunk-4ODRXQRW.js → chunk-EYSHTYLG.js} +1 -1
- package/dist/{chunk-R44Y3EFS.js → chunk-FGJHJIMN.js} +8 -336
- package/dist/{chunk-AQZQWXEU.cjs → chunk-G7NHE2VD.cjs} +35 -35
- package/dist/{chunk-XC6DPRYI.js → chunk-GSTSZPSR.js} +154 -949
- package/dist/{chunk-VRK322ZC.cjs → chunk-HIO6E7LC.cjs} +2 -2
- package/dist/{chunk-TOID45I2.cjs → chunk-J2TNIZ55.cjs} +1 -1
- package/dist/{chunk-YHDHFJUC.cjs → chunk-J5VQYK7T.cjs} +217 -1012
- package/dist/{chunk-3C33YTNN.js → chunk-JGWVZPT6.js} +2 -2
- package/dist/{chunk-ACFSFUQH.js → chunk-JL6YH5WD.js} +4 -0
- package/dist/{chunk-3SBLVGOM.cjs → chunk-LA5Y4ETA.cjs} +23 -23
- package/dist/{chunk-MVUQSK5J.cjs → chunk-LHPEG5AU.cjs} +107 -435
- package/dist/{chunk-DOZ6F2K2.js → chunk-NSETJI74.js} +3 -2
- package/dist/{chunk-XRXFVRGY.cjs → chunk-OKHKA43L.cjs} +2364 -203
- package/dist/{chunk-LK4SXL3V.js → chunk-OSEXT7JL.js} +1 -1
- package/dist/{chunk-PE6YJMQT.cjs → chunk-PFHJS4HE.cjs} +20 -19
- package/dist/{chunk-7KNW3WXZ.cjs → chunk-QEVLRLUN.cjs} +63 -0
- package/dist/{chunk-OTN6VB5S.cjs → chunk-RDFHWAHL.cjs} +5 -1
- package/dist/{chunk-6JL2D5SG.js → chunk-VE6UKYQ2.js} +3 -2
- package/dist/{chunk-RFJZGTHA.cjs → chunk-XVOP3CGQ.cjs} +9 -9
- package/dist/{chunk-EZOJBP4D.js → chunk-YIC6MAJ2.js} +1 -1
- package/dist/chunk-YZWM6ZIP.cjs +340 -0
- package/dist/{chunk-472INMWH.js → chunk-ZA7L5YJB.js} +63 -0
- package/dist/commands/builtins.d.cts +12 -1
- package/dist/commands/builtins.d.ts +12 -1
- package/dist/commands/index.cjs +2 -2
- package/dist/commands/index.js +1 -1
- package/dist/image-editor/controller.d.cts +1 -1
- package/dist/image-editor/controller.d.ts +1 -1
- package/dist/image-editor/index.cjs +837 -833
- package/dist/image-editor/index.js +105 -101
- package/dist/paint/index.cjs +5 -3
- package/dist/paint/index.js +46 -44
- package/dist/paint-editor/controller.d.cts +5 -3
- package/dist/paint-editor/controller.d.ts +5 -3
- package/dist/paint-editor/index.cjs +832 -2295
- package/dist/paint-editor/index.js +285 -1748
- package/dist/paint-editor/path-samples.d.cts +2 -0
- package/dist/paint-editor/path-samples.d.ts +2 -0
- package/dist/paint-editor/presence.d.cts +20 -1
- package/dist/paint-editor/presence.d.ts +20 -1
- package/dist/stickers/helpers.d.cts +2 -0
- package/dist/stickers/helpers.d.ts +2 -0
- package/dist/stickers/index.cjs +41 -35
- package/dist/stickers/index.js +22 -16
- package/dist/stickers/types.d.cts +4 -2
- package/dist/stickers/types.d.ts +4 -2
- package/dist/vector/backdrop.d.cts +13 -0
- package/dist/vector/backdrop.d.ts +13 -0
- package/dist/vector/brushstroke.d.cts +54 -7
- package/dist/vector/brushstroke.d.ts +54 -7
- package/dist/vector/brushstrokeMedia.d.cts +96 -0
- package/dist/vector/brushstrokeMedia.d.ts +96 -0
- package/dist/vector/controller.d.cts +17 -3
- package/dist/vector/controller.d.ts +17 -3
- package/dist/vector/index.cjs +1846 -1386
- package/dist/vector/index.d.cts +2 -0
- package/dist/vector/index.d.ts +2 -0
- package/dist/vector/index.js +517 -57
- package/dist/vector/render.d.cts +6 -0
- package/dist/vector/render.d.ts +6 -0
- package/dist/vector/types.d.cts +14 -0
- package/dist/vector/types.d.ts +14 -0
- package/package.json +1 -1
- package/skills/pixerate-animation-editor/SKILL.md +1 -0
- package/skills/pixerate-brushes/SKILL.md +2 -2
- package/skills/pixerate-brushes-design/SKILL.md +7 -4
- package/skills/pixerate-brushes-design/evals/port-to-vector.json +8 -8
- package/skills/pixerate-canvas/SKILL.md +11 -1
- package/skills/pixerate-image-editor/SKILL.md +19 -64
- package/skills/pixerate-image-editor/references/color-management.md +2 -1
- package/skills/pixerate-image-editor/references/free-transform.md +12 -0
- package/skills/pixerate-image-editor/references/layer-effects.md +10 -0
- package/skills/pixerate-image-editor/references/painting.md +17 -0
- package/skills/pixerate-image-editor/references/photoshop-files.md +1 -1
- package/skills/pixerate-image-editor/references/shapes-and-type.md +14 -0
- package/skills/pixerate-image-editor/references/smart-objects.md +10 -0
- package/skills/pixerate-paint-editor/SKILL.md +8 -4
- package/skills/pixerate-paint-editor/references/wet-media.md +9 -0
- package/skills/pixerate-vector/SKILL.md +16 -6
- package/skills/pixerate-vector/references/best-practices.md +1 -0
- package/skills/pixerate-vector/references/commands.md +19 -0
|
@@ -382,9 +382,72 @@ function createDrawCommands(target, options = {}) {
|
|
|
382
382
|
readOnly: true,
|
|
383
383
|
run: async () => ({ brushes: await target.listBrushes() })
|
|
384
384
|
},
|
|
385
|
+
...createBrushChoiceCommands(target, base, prefix),
|
|
385
386
|
...createGestureCommands(target, base, prefix, options)
|
|
386
387
|
];
|
|
387
388
|
}
|
|
389
|
+
function createBrushChoiceCommands(target, base, prefix) {
|
|
390
|
+
const { brushSettings, selectBrush, setColorLocked, setColorScheme } = target;
|
|
391
|
+
if (!brushSettings || !selectBrush || !setColorLocked || !setColorScheme) return [];
|
|
392
|
+
const settings = () => brushSettings();
|
|
393
|
+
const RESULT = "Returns { brush, color, colorScheme, colorLocked, colorFollowsScheme } (colorFollowsScheme: the colour is a brush's light / dark default and changes with the scheme).";
|
|
394
|
+
return [
|
|
395
|
+
{
|
|
396
|
+
...base,
|
|
397
|
+
id: `${prefix}selectBrush`,
|
|
398
|
+
label: "Choose Pen Brush",
|
|
399
|
+
keywords: ["brush", "pen", "pick brush", "chalk", "pencil", "ink"],
|
|
400
|
+
description: `Chooses the brush the pen and highlighter draw with by hand (brushId from canvas.listBrushes, or null for a plain vector stroke), at the brush's own size. A brush with a default colour (the ballpoint's blue, the chalk's light / dark pair) makes it the stroke colour unless keepColour or the colour is locked (canvas.setColorLocked). Does not draw; canvas.drawFreehand takes its own brush. ${RESULT}`,
|
|
401
|
+
params: {
|
|
402
|
+
type: "object",
|
|
403
|
+
additionalProperties: false,
|
|
404
|
+
required: ["brushId"],
|
|
405
|
+
properties: {
|
|
406
|
+
brushId: { type: ["string", "null"], minLength: 1, description: "A brush id from canvas.listBrushes, or null for a plain vector stroke." },
|
|
407
|
+
keepColour: { type: "boolean", description: "Keep the current stroke colour this once instead of taking the brush's default colour (default false)." }
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
run: async (_ctx, params) => {
|
|
411
|
+
await selectBrush(params.brushId, params.keepColour ? { keepColour: true } : {});
|
|
412
|
+
return settings();
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
...base,
|
|
417
|
+
id: `${prefix}setColorLocked`,
|
|
418
|
+
label: "Keep My Colour",
|
|
419
|
+
keywords: ["lock colour", "keep colour", "brush colour", "color lock"],
|
|
420
|
+
description: `Locks or unlocks the stroke colour ("Keep my colour"): while locked, canvas.selectBrush keeps the current colour instead of taking a brush's default colour. ${RESULT}`,
|
|
421
|
+
params: {
|
|
422
|
+
type: "object",
|
|
423
|
+
additionalProperties: false,
|
|
424
|
+
required: ["locked"],
|
|
425
|
+
properties: { locked: { type: "boolean", description: "true locks the colour, false unlocks it (the canvas starts unlocked)." } }
|
|
426
|
+
},
|
|
427
|
+
run: (_ctx, params) => {
|
|
428
|
+
setColorLocked(params.locked);
|
|
429
|
+
return settings();
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
...base,
|
|
434
|
+
id: `${prefix}setColorScheme`,
|
|
435
|
+
label: "Brush Colours for Light / Dark",
|
|
436
|
+
keywords: ["colour scheme", "dark mode", "light mode", "theme", "brush colour"],
|
|
437
|
+
description: `Sets the colour scheme that picks the side of a brush's light / dark default colour (white chalk in dark, dark chalk in light). A stroke colour that came from such a default follows; strokes already drawn keep theirs, and canvas.drawFreehand resolves brush defaults for this scheme. The host usually sets it to match its theme. ${RESULT}`,
|
|
438
|
+
params: {
|
|
439
|
+
type: "object",
|
|
440
|
+
additionalProperties: false,
|
|
441
|
+
required: ["scheme"],
|
|
442
|
+
properties: { scheme: { type: "string", enum: ["light", "dark"], description: "light (dark chalk on a light background) or dark (light chalk on a dark one)." } }
|
|
443
|
+
},
|
|
444
|
+
run: (_ctx, params) => {
|
|
445
|
+
setColorScheme(params.scheme);
|
|
446
|
+
return settings();
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
];
|
|
450
|
+
}
|
|
388
451
|
var GESTURE_RECT_PARAM = {
|
|
389
452
|
type: "object",
|
|
390
453
|
additionalProperties: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HistoryState } from '../history/types.cjs';
|
|
2
2
|
import type { CanvasArrangeAction } from '../canvas/arrangeShortcuts.cjs';
|
|
3
3
|
import type { AlignEdge, DistributeAxis, DistributeMode, ZOrderOperation } from '../canvas/arrange.cjs';
|
|
4
|
-
import type { CanvasBrush, CanvasBrushPaint, CanvasBrushPreset } from '../canvas/brushTypes.cjs';
|
|
4
|
+
import type { CanvasBrush, CanvasBrushPaint, CanvasBrushPreset, CanvasBrushChoice } from '../canvas/brushTypes.cjs';
|
|
5
5
|
import type { CommandSpec } from './registry.cjs';
|
|
6
6
|
import type { PlaybackStep } from '../tools/playback.cjs';
|
|
7
7
|
import { type ShortcutBinding } from './shortcuts.cjs';
|
|
@@ -133,6 +133,17 @@ export interface DrawCommandTarget {
|
|
|
133
133
|
width: number;
|
|
134
134
|
height: number;
|
|
135
135
|
} | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* The brush picker's state, for `canvas.selectBrush`, `canvas.setColorLocked` and
|
|
138
|
+
* `canvas.setColorScheme` (registered only when the target has all of these; the draw
|
|
139
|
+
* controller does).
|
|
140
|
+
*/
|
|
141
|
+
brushSettings?(): CanvasBrushChoice;
|
|
142
|
+
selectBrush?(id: string | null, choice?: {
|
|
143
|
+
keepColour?: boolean;
|
|
144
|
+
}): Promise<CanvasBrushPreset | null>;
|
|
145
|
+
setColorLocked?(locked: boolean): void;
|
|
146
|
+
setColorScheme?(scheme: 'light' | 'dark'): void;
|
|
136
147
|
}
|
|
137
148
|
export interface DrawCommandOptions {
|
|
138
149
|
/** Id prefix (default `canvas.`). */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HistoryState } from '../history/types.js';
|
|
2
2
|
import type { CanvasArrangeAction } from '../canvas/arrangeShortcuts.js';
|
|
3
3
|
import type { AlignEdge, DistributeAxis, DistributeMode, ZOrderOperation } from '../canvas/arrange.js';
|
|
4
|
-
import type { CanvasBrush, CanvasBrushPaint, CanvasBrushPreset } from '../canvas/brushTypes.js';
|
|
4
|
+
import type { CanvasBrush, CanvasBrushPaint, CanvasBrushPreset, CanvasBrushChoice } from '../canvas/brushTypes.js';
|
|
5
5
|
import type { CommandSpec } from './registry.js';
|
|
6
6
|
import type { PlaybackStep } from '../tools/playback.js';
|
|
7
7
|
import { type ShortcutBinding } from './shortcuts.js';
|
|
@@ -133,6 +133,17 @@ export interface DrawCommandTarget {
|
|
|
133
133
|
width: number;
|
|
134
134
|
height: number;
|
|
135
135
|
} | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* The brush picker's state, for `canvas.selectBrush`, `canvas.setColorLocked` and
|
|
138
|
+
* `canvas.setColorScheme` (registered only when the target has all of these; the draw
|
|
139
|
+
* controller does).
|
|
140
|
+
*/
|
|
141
|
+
brushSettings?(): CanvasBrushChoice;
|
|
142
|
+
selectBrush?(id: string | null, choice?: {
|
|
143
|
+
keepColour?: boolean;
|
|
144
|
+
}): Promise<CanvasBrushPreset | null>;
|
|
145
|
+
setColorLocked?(locked: boolean): void;
|
|
146
|
+
setColorScheme?(scheme: 'light' | 'dark'): void;
|
|
136
147
|
}
|
|
137
148
|
export interface DrawCommandOptions {
|
|
138
149
|
/** Id prefix (default `canvas.`). */
|
package/dist/commands/index.cjs
CHANGED
|
@@ -22,7 +22,7 @@ var _chunkKIJIONZFcjs = require('../chunk-KIJIONZF.cjs');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkQEVLRLUNcjs = require('../chunk-QEVLRLUN.cjs');
|
|
26
26
|
require('../chunk-E2Z4UARJ.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
@@ -413,4 +413,4 @@ function createCanvasAnimationCommands(controller, options = {}) {
|
|
|
413
413
|
|
|
414
414
|
|
|
415
415
|
|
|
416
|
-
exports.CommandRegistry = _chunkKIJIONZFcjs.CommandRegistry; exports.CommandRegistryError = _chunkKIJIONZFcjs.CommandRegistryError; exports.DEFAULT_HISTORY_SHORTCUTS =
|
|
416
|
+
exports.CommandRegistry = _chunkKIJIONZFcjs.CommandRegistry; exports.CommandRegistryError = _chunkKIJIONZFcjs.CommandRegistryError; exports.DEFAULT_HISTORY_SHORTCUTS = _chunkQEVLRLUNcjs.DEFAULT_HISTORY_SHORTCUTS; exports.DEFAULT_RECENT_LIMIT = _chunkKIJIONZFcjs.DEFAULT_RECENT_LIMIT; exports.PLATFORMS = _chunkQJVOJUTDcjs.PLATFORMS; exports.ShortcutMap = _chunkQJVOJUTDcjs.ShortcutMap; exports.chordToString = _chunkQJVOJUTDcjs.chordToString; exports.codeFromKey = _chunkQJVOJUTDcjs.codeFromKey; exports.codeToKeyText = _chunkQJVOJUTDcjs.codeToKeyText; exports.createArrangeCommands = _chunkQEVLRLUNcjs.createArrangeCommands; exports.createCanvasAnimationCommands = createCanvasAnimationCommands; exports.createCommandPaletteController = createCommandPaletteController; exports.createCommandRegistry = _chunkKIJIONZFcjs.createCommandRegistry; exports.createCommandToolProvider = _chunkKIJIONZFcjs.createCommandToolProvider; exports.createComponentCommands = _chunkQEVLRLUNcjs.createComponentCommands; exports.createDrawCommands = _chunkQEVLRLUNcjs.createDrawCommands; exports.createFormatCommands = _chunkVCL7CB56cjs.createFormatCommands; exports.createHistoryCommands = _chunkQEVLRLUNcjs.createHistoryCommands; exports.createShapeCommands = _chunkQEVLRLUNcjs.createShapeCommands; exports.createSpreadsheetCommands = _chunkQEVLRLUNcjs.createSpreadsheetCommands; exports.defineCommand = _chunkKIJIONZFcjs.defineCommand; exports.detectPlatform = _chunkQJVOJUTDcjs.detectPlatform; exports.effectiveChord = _chunkQJVOJUTDcjs.effectiveChord; exports.effectiveChordKey = _chunkQJVOJUTDcjs.effectiveChordKey; exports.eventCode = _chunkQJVOJUTDcjs.eventCode; exports.exactBonus = _chunkKIJIONZFcjs.exactBonus; exports.formatCommandsFor = _chunkVCL7CB56cjs.formatCommandsFor; exports.formatShortcut = _chunkQJVOJUTDcjs.formatShortcut; exports.fuzzyMatch = _chunkKIJIONZFcjs.fuzzyMatch; exports.fuzzyScore = _chunkKIJIONZFcjs.fuzzyScore; exports.hasVariantCommands = _chunkQEVLRLUNcjs.hasVariantCommands; exports.isEditableEventTarget = _chunkQJVOJUTDcjs.isEditableEventTarget; exports.keyToCode = _chunkQJVOJUTDcjs.keyToCode; exports.matchHistoryShortcut = _chunkQEVLRLUNcjs.matchHistoryShortcut; exports.matchPaletteHotkey = matchPaletteHotkey; exports.normalizeChord = _chunkQJVOJUTDcjs.normalizeChord; exports.parseChord = _chunkQJVOJUTDcjs.parseChord; exports.planFreehandPlayback = _chunkQEVLRLUNcjs.planFreehandPlayback; exports.pushRecent = _chunkKIJIONZFcjs.pushRecent; exports.rankCommands = _chunkKIJIONZFcjs.rankCommands; exports.shortcutCode = _chunkQJVOJUTDcjs.shortcutCode; exports.toShortcutBindings = _chunkQJVOJUTDcjs.toShortcutBindings;
|
package/dist/commands/index.js
CHANGED
|
@@ -2583,7 +2583,7 @@ export declare class ImageEditorController {
|
|
|
2583
2583
|
*/
|
|
2584
2584
|
private checkPsdFonts;
|
|
2585
2585
|
/**
|
|
2586
|
-
* The document as
|
|
2586
|
+
* The document as a PSD in its colour mode (RGB, CMYK or Lab) at its bit depth (PSB above 30 000 px) with real layers, groups, adjustment
|
|
2587
2587
|
* layers and masks, in the source frame. Layer filters and parametric (depth) masks are baked
|
|
2588
2588
|
* into pixels and masks, annotation layers are rasterized (in a browser; elsewhere they are left
|
|
2589
2589
|
* out), and the merged image is our composite. `warnings` lists every such change.
|
|
@@ -2583,7 +2583,7 @@ export declare class ImageEditorController {
|
|
|
2583
2583
|
*/
|
|
2584
2584
|
private checkPsdFonts;
|
|
2585
2585
|
/**
|
|
2586
|
-
* The document as
|
|
2586
|
+
* The document as a PSD in its colour mode (RGB, CMYK or Lab) at its bit depth (PSB above 30 000 px) with real layers, groups, adjustment
|
|
2587
2587
|
* layers and masks, in the source frame. Layer filters and parametric (depth) masks are baked
|
|
2588
2588
|
* into pixels and masks, annotation layers are rasterized (in a browser; elsewhere they are left
|
|
2589
2589
|
* out), and the merged image is our composite. `warnings` lists every such change.
|