@pixerate/editor 0.137.0 → 0.138.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.d.cts +3 -3
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +1 -1
- package/dist/animation-editor/index.cjs +57 -57
- package/dist/animation-editor/index.d.cts +3 -3
- package/dist/animation-editor/index.d.ts +3 -3
- package/dist/animation-editor/index.js +4 -4
- package/dist/{arrange-CKXK_hf7.d.cts → arrange-j_mLiFMO.d.cts} +1 -1
- package/dist/{arrange-BUREmgD9.d.ts → arrange-q5HQvnnB.d.ts} +1 -1
- package/dist/{bezier-CZ2AhjID.d.cts → bezier-CUaH8hcK.d.cts} +1 -1
- package/dist/{bezier-Dywv3Bw8.d.ts → bezier-DPmdGwgR.d.ts} +1 -1
- package/dist/{brushTypes-C7N3EBK7.d.cts → brushTypes-MX5UVs_m.d.cts} +27 -2
- package/dist/{brushTypes-C7N3EBK7.d.ts → brushTypes-MX5UVs_m.d.ts} +27 -2
- package/dist/{brushes-DJmUbIgz.d.ts → brushes-B1ABdDAs.d.ts} +2 -108
- package/dist/{brushes-CnvZSYYU.d.cts → brushes-DnIdJYxN.d.cts} +2 -108
- package/dist/{brushstrokeRender-IMFY3FF6.cjs → brushstrokeRender-PP6NTF6M.cjs} +52 -24
- package/dist/brushstrokeRender-PP6NTF6M.cjs.map +1 -0
- package/dist/{brushstrokeRender-2FAXA3XC.js → brushstrokeRender-QGEYJ4OZ.js} +40 -12
- package/dist/brushstrokeRender-QGEYJ4OZ.js.map +1 -0
- package/dist/{builtins-Cc-bH-3U.d.cts → builtins-BakDiKWf.d.cts} +3 -2
- package/dist/{builtins-ZU1GJnUA.d.ts → builtins-CE33vyv2.d.ts} +3 -2
- package/dist/canvas/index.cjs +16 -9
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +56 -11
- package/dist/canvas/index.d.ts +56 -11
- package/dist/canvas/index.js +10 -3
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-QBWEH3IM.cjs → chunk-3T5O225T.cjs} +391 -76
- package/dist/chunk-3T5O225T.cjs.map +1 -0
- package/dist/{chunk-PRSRYHQD.cjs → chunk-7MN75BXI.cjs} +36 -36
- package/dist/{chunk-PRSRYHQD.cjs.map → chunk-7MN75BXI.cjs.map} +1 -1
- package/dist/{chunk-EQQMGO42.js → chunk-C2J7GOMJ.js} +18 -5
- package/dist/chunk-C2J7GOMJ.js.map +1 -0
- package/dist/{chunk-2XS6LTUP.cjs → chunk-C46AZEBE.cjs} +104 -339
- package/dist/chunk-C46AZEBE.cjs.map +1 -0
- package/dist/{chunk-XN2NBLV5.cjs → chunk-CM3LJPR3.cjs} +82 -82
- package/dist/{chunk-XN2NBLV5.cjs.map → chunk-CM3LJPR3.cjs.map} +1 -1
- package/dist/{chunk-HUO3TI4C.js → chunk-CPSMARTX.js} +6 -241
- package/dist/chunk-CPSMARTX.js.map +1 -0
- package/dist/{chunk-KEENUAFN.cjs → chunk-DLLUOVQX.cjs} +18 -5
- package/dist/chunk-DLLUOVQX.cjs.map +1 -0
- package/dist/{chunk-LSXXAJG3.js → chunk-J7DSKTKB.js} +5 -4
- package/dist/chunk-J7DSKTKB.js.map +1 -0
- package/dist/{chunk-6S6362D2.js → chunk-OV7253FC.js} +2 -2
- package/dist/{chunk-5FSRTP6E.js → chunk-PQFVLOMR.js} +319 -4
- package/dist/chunk-PQFVLOMR.js.map +1 -0
- package/dist/{chunk-OIBIRXRG.js → chunk-PSPLRQL6.js} +2 -2
- package/dist/{chunk-SYT2TLQF.js → chunk-QBARQGSG.js} +2 -2
- package/dist/{chunk-5OOIUXNJ.cjs → chunk-SXOTFV3V.cjs} +6 -6
- package/dist/{chunk-5OOIUXNJ.cjs.map → chunk-SXOTFV3V.cjs.map} +1 -1
- package/dist/{chunk-DFSZO2B5.cjs → chunk-UFL5N4DK.cjs} +5 -4
- package/dist/chunk-UFL5N4DK.cjs.map +1 -0
- package/dist/{chunk-3D77LOBM.js → chunk-V45ZTW4R.js} +3 -3
- package/dist/{chunk-TLCTTQFF.cjs → chunk-VEHVXRJU.cjs} +17 -17
- package/dist/{chunk-TLCTTQFF.cjs.map → chunk-VEHVXRJU.cjs.map} +1 -1
- package/dist/commands/index.cjs +2 -2
- package/dist/commands/index.d.cts +3 -3
- package/dist/commands/index.d.ts +3 -3
- package/dist/commands/index.js +1 -1
- package/dist/{export-DwnZ_hvQ.d.ts → export-BwFRiItd.d.ts} +4 -4
- package/dist/{export-CyJdfP_Z.d.cts → export-DuN3dpCg.d.cts} +4 -4
- package/dist/{blending-NgF3qo3d.d.ts → grain-COgYMMHv.d.ts} +58 -1
- package/dist/{blending-D7jCmjO6.d.cts → grain-GCt_O2kv.d.cts} +58 -1
- package/dist/image-editor/index.cjs +695 -677
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +11 -11
- package/dist/image-editor/index.d.ts +11 -11
- package/dist/image-editor/index.js +23 -5
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{opentype-a1KAW-qs.d.ts → opentype-T7bkbR2D.d.ts} +1 -1
- package/dist/{opentype-KR_jj6b_.d.cts → opentype-n99lqxEZ.d.cts} +1 -1
- package/dist/paint/index.cjs +21 -3
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +72 -7
- package/dist/paint/index.d.ts +72 -7
- package/dist/paint/index.js +20 -2
- package/dist/paint-editor/index.cjs +171 -171
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +75 -29
- package/dist/paint-editor/index.d.ts +75 -29
- package/dist/paint-editor/index.js +12 -12
- package/dist/{pathfinder-BHS4vQNm.d.cts → pathfinder-CQlldanv.d.cts} +2 -2
- package/dist/{pathfinder-BVvTIBMo.d.ts → pathfinder-D-V6JLSw.d.ts} +2 -2
- package/dist/{rand-Cw9VLrVC.d.cts → rand-D7nfeD1p.d.cts} +18 -2
- package/dist/{rand-8xbUb6ur.d.ts → rand-DJGxSq9d.d.ts} +18 -2
- package/dist/{svg-CSz3mzkw.d.ts → svg-CnDCpIy9.d.ts} +1 -1
- package/dist/{svg-DTb40ICU.d.cts → svg-DPJMUSNt.d.cts} +1 -1
- package/dist/vector/index.cjs +944 -944
- package/dist/vector/index.d.cts +10 -10
- package/dist/vector/index.d.ts +10 -10
- package/dist/vector/index.js +4 -4
- package/dist/{warp-DTOp0lON.d.cts → warp-C7rMWUgW.d.cts} +1 -1
- package/dist/{warp-pd7hrH4T.d.ts → warp-Doasjpyr.d.ts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-canvas/SKILL.md +12 -5
- package/dist/brushstrokeRender-2FAXA3XC.js.map +0 -1
- package/dist/brushstrokeRender-IMFY3FF6.cjs.map +0 -1
- package/dist/chunk-2XS6LTUP.cjs.map +0 -1
- package/dist/chunk-5FSRTP6E.js.map +0 -1
- package/dist/chunk-DFSZO2B5.cjs.map +0 -1
- package/dist/chunk-EQQMGO42.js.map +0 -1
- package/dist/chunk-HUO3TI4C.js.map +0 -1
- package/dist/chunk-KEENUAFN.cjs.map +0 -1
- package/dist/chunk-LSXXAJG3.js.map +0 -1
- package/dist/chunk-QBWEH3IM.cjs.map +0 -1
- /package/dist/{chunk-6S6362D2.js.map → chunk-OV7253FC.js.map} +0 -0
- /package/dist/{chunk-OIBIRXRG.js.map → chunk-PSPLRQL6.js.map} +0 -0
- /package/dist/{chunk-SYT2TLQF.js.map → chunk-QBARQGSG.js.map} +0 -0
- /package/dist/{chunk-3D77LOBM.js.map → chunk-V45ZTW4R.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/chunk-DFSZO2B5.cjs","../src/commands/builtins.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACgBO,IAAM,0BAAA,EAAwD;AAAA,EACpE,EAAE,OAAA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ACI,MAAA;AACC,MAAA;AACJ,MAAA;AACA,MAAA;AACA,MAAA;AACK,MAAA;AAEN,IAAA;AACA,IAAA;AACI,MAAA;AACC,MAAA;AACJ,MAAA;AACA,MAAA;AACA,MAAA;AACK,MAAA;AACN,IAAA;AACA,IAAA;AACI,MAAA;AACC,MAAA;AACJ,MAAA;AACA,MAAA;AACA,MAAA;AACK,MAAA;AAEN,IAAA;AACD,EAAA;AACD;ADpUW;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/editor/editor/packages/core/dist/chunk-DFSZO2B5.cjs","sourcesContent":[null,"import type { HistoryState } from '../history/types.js';\nimport type { CanvasArrangeAction } from '../canvas/arrangeShortcuts.js';\nimport type { AlignEdge, DistributeAxis, DistributeMode, ZOrderOperation } from '../canvas/arrange.js';\nimport { DEFAULT_ARRANGE_SHORTCUTS } from '../canvas/arrangeShortcuts.js';\nimport type { CanvasBrush, CanvasBrushPaint, CanvasBrushPreset } from '../canvas/brushTypes.js';\nimport type { CommandParamsSchema, CommandSpec } from './registry.js';\nimport { ShortcutMap, type ShortcutBinding } from './shortcuts.js';\nimport type { KeyboardEventLike, Platform } from './chords.js';\n\n// ---------------------------------------------------------------------------\n// History\n// ---------------------------------------------------------------------------\n\n/** Minimal history surface (`HistoryManager` satisfies it). */\nexport interface HistoryCommandTarget {\n\tundo(): boolean | void;\n\tredo(): boolean | void;\n\tgetState(): Pick<HistoryState, 'canUndo' | 'canRedo'> & Partial<Pick<HistoryState, 'undoName' | 'redoName'>>;\n}\n\n/** Default history bindings: `Mod+Z` undo; `Mod+Shift+Z` redo, plus `Mod+Y` off macOS. */\nexport const DEFAULT_HISTORY_SHORTCUTS: readonly ShortcutBinding[] = [\n\t{ command: 'undo', chord: 'Mod+Z' },\n\t{ command: 'redo', chord: 'Mod+Shift+Z' },\n\t{ command: 'redo', chord: 'Mod+Y', platforms: ['windows', 'linux'] }\n];\n\nexport interface HistoryCommandOptions {\n\t/** Id prefix (default `history.`). */\n\tprefix?: string;\n\tgroup?: string;\n\tscope?: string;\n}\n\n/** `history.undo` / `history.redo` commands for a `HistoryManager` (disabled with a reason when empty). */\nexport function createHistoryCommands(history: HistoryCommandTarget, options: HistoryCommandOptions = {}): CommandSpec[] {\n\tconst prefix = options.prefix ?? 'history.';\n\tconst group = options.group ?? 'Edit';\n\tconst shortcutsOf = (command: 'undo' | 'redo') =>\n\t\tDEFAULT_HISTORY_SHORTCUTS.filter((b) => b.command === command).map(({ command: _c, ...rest }) => rest);\n\treturn [\n\t\t{\n\t\t\tid: `${prefix}undo`,\n\t\t\tlabel: 'Undo',\n\t\t\tgroup,\n\t\t\tkeywords: ['revert', 'back'],\n\t\t\tdescription: 'Reverts the last change.',\n\t\t\tshortcut: shortcutsOf('undo'),\n\t\t\t...(options.scope ? { scope: options.scope } : {}),\n\t\t\tenabled: () => (history.getState().canUndo ? true : 'Nothing to undo.'),\n\t\t\trun: () => {\n\t\t\t\thistory.undo();\n\t\t\t\treturn { undone: true, state: history.getState() };\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tid: `${prefix}redo`,\n\t\t\tlabel: 'Redo',\n\t\t\tgroup,\n\t\t\tkeywords: ['repeat', 'forward'],\n\t\t\tdescription: 'Re-applies the last undone change.',\n\t\t\tshortcut: shortcutsOf('redo'),\n\t\t\t...(options.scope ? { scope: options.scope } : {}),\n\t\t\tenabled: () => (history.getState().canRedo ? true : 'Nothing to redo.'),\n\t\t\trun: () => {\n\t\t\t\thistory.redo();\n\t\t\t\treturn { redone: true, state: history.getState() };\n\t\t\t}\n\t\t}\n\t];\n}\n\nlet historyShortcutMap: ShortcutMap | null = null;\n\n/**\n * Resolves a keydown event to `undo` / `redo` with the default history bindings\n * (`Mod` is ⌘ on macOS and Ctrl elsewhere). Events from text inputs and\n * contenteditable elements are ignored unless `allowInEditable`.\n */\nexport function matchHistoryShortcut(\n\tevent: KeyboardEventLike,\n\toptions: { platform?: Platform; allowInEditable?: boolean } = {}\n): 'undo' | 'redo' | null {\n\thistoryShortcutMap ??= new ShortcutMap(DEFAULT_HISTORY_SHORTCUTS);\n\treturn (historyShortcutMap.resolve(event, options)?.command as 'undo' | 'redo' | undefined) ?? null;\n}\n\n// ---------------------------------------------------------------------------\n// Canvas arrange\n// ---------------------------------------------------------------------------\n\n/** Minimal arrange controller surface (`createCanvasArrangeController` satisfies it). */\nexport interface ArrangeCommandTarget {\n\talign(edge: AlignEdge, ids?: Iterable<string>): unknown;\n\tdistribute(axis: DistributeAxis, mode?: DistributeMode, ids?: Iterable<string>): unknown;\n\treorder(operation: ZOrderOperation, ids?: Iterable<string>): unknown;\n\tlock(ids?: Iterable<string>): unknown;\n\tunlock(ids?: Iterable<string>): unknown;\n}\n\nexport interface ArrangeCommandOptions {\n\t/** Id prefix (default `canvas.`). */\n\tprefix?: string;\n\tgroup?: string;\n\t/** Scope of the commands and their shortcuts (default `canvas`). Pass `null` for global. */\n\tscope?: string | null;\n\t/** Current selection, used for enablement (\"Select at least two nodes\"). */\n\tgetSelectedIds?: () => string[];\n\t/** Scene navigation (`nextScene` / `previousScene`); those commands are only added when given. */\n\tscenes?: { next(): unknown; previous(): unknown };\n\t/** Use these bindings instead of `DEFAULT_ARRANGE_SHORTCUTS`. */\n\tbindings?: readonly { action: CanvasArrangeAction; label: string }[];\n}\n\nconst ARRANGE_LABELS: Record<CanvasArrangeAction, string> = {\n\talignLeft: 'Align Left',\n\talignCenter: 'Align Horizontal Centers',\n\talignRight: 'Align Right',\n\talignTop: 'Align Top',\n\talignMiddle: 'Align Vertical Centers',\n\talignBottom: 'Align Bottom',\n\tdistributeHorizontal: 'Distribute Horizontally',\n\tdistributeVertical: 'Distribute Vertically',\n\tlock: 'Lock',\n\tunlock: 'Unlock',\n\tbringForward: 'Bring Forward',\n\tsendBackward: 'Send Backward',\n\tbringToFront: 'Bring to Front',\n\tsendToBack: 'Send to Back',\n\tnextScene: 'Next Scene',\n\tpreviousScene: 'Previous Scene'\n};\n\nconst IDS_PARAMS: CommandParamsSchema = {\n\ttype: 'object',\n\tproperties: {\n\t\tids: {\n\t\t\ttype: 'array',\n\t\t\titems: { type: 'string' },\n\t\t\tdescription: 'Node ids to act on (default: the selection).'\n\t\t}\n\t}\n};\n\n/**\n * Commands for the canvas arrange actions (`canvas.alignLeft`, `canvas.bringToFront`, …)\n * with the default arrange shortcuts. Each accepts `{ ids? }`; enablement checks the\n * named ids, or the selection when none are named.\n */\nexport function createArrangeCommands(controller: ArrangeCommandTarget, options: ArrangeCommandOptions = {}): CommandSpec[] {\n\tconst prefix = options.prefix ?? 'canvas.';\n\tconst group = options.group ?? 'Arrange';\n\tconst scope = options.scope === null ? undefined : options.scope ?? 'canvas';\n\tconst bindings = options.bindings ?? DEFAULT_ARRANGE_SHORTCUTS;\n\tconst count = (params?: { ids?: string[] }) => params?.ids?.length ?? options.getSelectedIds?.().length;\n\tconst needs = (min: number, what: string) => (_: unknown, params?: { ids?: string[] }) => {\n\t\tconst n = count(params);\n\t\tif (n === undefined || n >= min) return true;\n\t\treturn min === 1 ? `Select a ${what} first.` : `Select at least ${min} ${what}s.`;\n\t};\n\n\tconst run: Record<CanvasArrangeAction, (ids?: string[]) => unknown> = {\n\t\talignLeft: (ids) => controller.align('left', ids),\n\t\talignCenter: (ids) => controller.align('center', ids),\n\t\talignRight: (ids) => controller.align('right', ids),\n\t\talignTop: (ids) => controller.align('top', ids),\n\t\talignMiddle: (ids) => controller.align('middle', ids),\n\t\talignBottom: (ids) => controller.align('bottom', ids),\n\t\tdistributeHorizontal: (ids) => controller.distribute('horizontal', 'gaps', ids),\n\t\tdistributeVertical: (ids) => controller.distribute('vertical', 'gaps', ids),\n\t\tlock: (ids) => controller.lock(ids),\n\t\tunlock: (ids) => controller.unlock(ids),\n\t\tbringForward: (ids) => controller.reorder('bringForward', ids),\n\t\tsendBackward: (ids) => controller.reorder('sendBackward', ids),\n\t\tbringToFront: (ids) => controller.reorder('bringToFront', ids),\n\t\tsendToBack: (ids) => controller.reorder('sendToBack', ids),\n\t\tnextScene: () => options.scenes?.next(),\n\t\tpreviousScene: () => options.scenes?.previous()\n\t};\n\n\tconst actions = Object.keys(ARRANGE_LABELS) as CanvasArrangeAction[];\n\treturn actions\n\t\t.filter((action) => options.scenes || (action !== 'nextScene' && action !== 'previousScene'))\n\t\t.map((action): CommandSpec => {\n\t\t\tconst isScene = action === 'nextScene' || action === 'previousScene';\n\t\t\tconst enabled = isScene\n\t\t\t\t? undefined\n\t\t\t\t: action.startsWith('align')\n\t\t\t\t\t? needs(2, 'node')\n\t\t\t\t\t: action.startsWith('distribute')\n\t\t\t\t\t\t? needs(3, 'node')\n\t\t\t\t\t\t: needs(1, 'node');\n\t\t\treturn {\n\t\t\t\tid: `${prefix}${action}`,\n\t\t\t\tlabel: ARRANGE_LABELS[action],\n\t\t\t\tgroup: isScene ? 'Scenes' : group,\n\t\t\t\tkeywords: isScene ? ['scene', 'slide', 'page'] : action.startsWith('align') ? ['align'] : ['arrange', 'layer', 'order'],\n\t\t\t\t...(scope ? { scope } : {}),\n\t\t\t\tshortcut: bindings.filter((b) => b.action === action).map((b) => b.label),\n\t\t\t\t...(isScene ? {} : { params: IDS_PARAMS }),\n\t\t\t\t...(enabled ? { enabled } : {}),\n\t\t\t\trun: (_ctx: unknown, params: { ids?: string[] }) => run[action](params?.ids)\n\t\t\t};\n\t\t});\n}\n\n// ---------------------------------------------------------------------------\n// Canvas shape operations\n// ---------------------------------------------------------------------------\n\n/** Shape operations surface of the arrange controller (`createCanvasArrangeController` satisfies it). */\nexport interface ShapeCommandTarget {\n\tcombineShapes(operation: 'unite' | 'intersect' | 'subtract' | 'exclude' | 'divide', ids?: Iterable<string>): unknown;\n\tcanCombineShapes(ids?: Iterable<string>): boolean;\n\toffsetShapes(distance: number, ids?: Iterable<string>, options?: { join?: 'miter' | 'round' | 'bevel'; miterLimit?: number }): unknown;\n\tcanOffsetShapes(ids?: Iterable<string>): boolean;\n\toutlineStroke(\n\t\tids?: Iterable<string>,\n\t\toptions?: { join?: 'miter' | 'round' | 'bevel'; cap?: 'butt' | 'round' | 'square'; miterLimit?: number }\n\t): unknown;\n\tcanOutlineStroke(ids?: Iterable<string>): boolean;\n}\n\nexport interface ShapeCommandOptions {\n\t/** Id prefix (default `canvas.`). */\n\tprefix?: string;\n\tgroup?: string;\n\t/** Scope (default `canvas`). Pass `null` for global. */\n\tscope?: string | null;\n\t/** Offset distance used when `canvas.offsetPath` is run without one (default 10). */\n\tdefaultOffset?: number;\n}\n\nconst SHAPE_COMMANDS = [\n\t{ op: 'unite', label: 'Unite Shapes', keywords: ['union', 'merge', 'boolean', 'combine'] },\n\t{ op: 'intersect', label: 'Intersect Shapes', keywords: ['intersection', 'boolean', 'combine'] },\n\t{ op: 'subtract', label: 'Subtract Shapes', keywords: ['difference', 'minus front', 'boolean', 'combine'] },\n\t{ op: 'exclude', label: 'Exclude Shapes', keywords: ['xor', 'boolean', 'combine'] },\n\t{ op: 'divide', label: 'Divide Shapes', keywords: ['split', 'pathfinder', 'boolean'] }\n] as const;\n\nconst JOIN_PARAM = { type: 'string', enum: ['miter', 'round', 'bevel'], description: 'Corner style (default miter).' } as const;\n\n/**\n * Palette / context-menu / agent commands for the shape operations: `canvas.unite`,\n * `canvas.intersect`, `canvas.subtract`, `canvas.exclude`, `canvas.divide`,\n * `canvas.offsetPath` (`{ distance, join?, miterLimit?, ids? }`) and `canvas.outlineStroke`\n * (`{ join?, cap?, miterLimit?, ids? }`). Each is one undoable step when the controller has a\n * history; enablement explains why a command cannot run.\n */\nexport function createShapeCommands(controller: ShapeCommandTarget, options: ShapeCommandOptions = {}): CommandSpec[] {\n\tconst prefix = options.prefix ?? 'canvas.';\n\tconst group = options.group ?? 'Shape';\n\tconst scope = options.scope === null ? undefined : options.scope ?? 'canvas';\n\tconst base = { group, ...(scope ? { scope } : {}) };\n\tconst combine = SHAPE_COMMANDS.map(\n\t\t({ op, label, keywords }): CommandSpec => ({\n\t\t\t...base,\n\t\t\tid: `${prefix}${op}`,\n\t\t\tlabel,\n\t\t\tkeywords: [...keywords],\n\t\t\tdescription: `${label.split(' ')[0]}s the selected shapes into a new path (curves are kept).`,\n\t\t\tparams: IDS_PARAMS,\n\t\t\tenabled: (_ctx: unknown, params?: { ids?: string[] }) =>\n\t\t\t\tcontroller.canCombineShapes(params?.ids) ? true : 'Select at least two unlocked shapes.',\n\t\t\trun: (_ctx: unknown, params: { ids?: string[] }) => controller.combineShapes(op, params?.ids)\n\t\t})\n\t);\n\treturn [\n\t\t...combine,\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}offsetPath`,\n\t\t\tlabel: 'Offset Path…',\n\t\t\tkeywords: ['inset', 'outset', 'grow', 'shrink', 'expand', 'contract'],\n\t\t\tdescription: 'Grows (positive distance) or shrinks (negative) the selected shapes.',\n\t\t\tparams: {\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: {\n\t\t\t\t\tdistance: { type: 'number', description: `Offset in canvas units (default ${options.defaultOffset ?? 10}).` },\n\t\t\t\t\tjoin: JOIN_PARAM,\n\t\t\t\t\tmiterLimit: { type: 'number', description: 'Miter limit (default 4).' },\n\t\t\t\t\tids: IDS_PARAMS.properties!.ids\n\t\t\t\t}\n\t\t\t},\n\t\t\tenabled: (_ctx: unknown, params?: { ids?: string[] }) =>\n\t\t\t\tcontroller.canOffsetShapes(params?.ids) ? true : 'Select an unlocked shape.',\n\t\t\trun: (_ctx: unknown, params: { distance?: number; join?: 'miter' | 'round' | 'bevel'; miterLimit?: number; ids?: string[] }) =>\n\t\t\t\tcontroller.offsetShapes(params?.distance ?? options.defaultOffset ?? 10, params?.ids, {\n\t\t\t\t\t...(params?.join ? { join: params.join } : {}),\n\t\t\t\t\t...(params?.miterLimit !== undefined ? { miterLimit: params.miterLimit } : {})\n\t\t\t\t})\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}outlineStroke`,\n\t\t\tlabel: 'Outline Stroke',\n\t\t\tkeywords: ['expand stroke', 'stroke to path', 'convert stroke'],\n\t\t\tdescription: 'Converts the strokes of the selected shapes to filled shapes.',\n\t\t\tparams: {\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: {\n\t\t\t\t\tjoin: JOIN_PARAM,\n\t\t\t\t\tcap: { type: 'string', enum: ['butt', 'round', 'square'], description: 'Line cap (default butt).' },\n\t\t\t\t\tmiterLimit: { type: 'number', description: 'Miter limit (default 4).' },\n\t\t\t\t\tids: IDS_PARAMS.properties!.ids\n\t\t\t\t}\n\t\t\t},\n\t\t\tenabled: (_ctx: unknown, params?: { ids?: string[] }) =>\n\t\t\t\tcontroller.canOutlineStroke(params?.ids) ? true : 'Select an unlocked shape with a stroke.',\n\t\t\trun: (\n\t\t\t\t_ctx: unknown,\n\t\t\t\tparams: { join?: 'miter' | 'round' | 'bevel'; cap?: 'butt' | 'round' | 'square'; miterLimit?: number; ids?: string[] }\n\t\t\t) =>\n\t\t\t\tcontroller.outlineStroke(params?.ids, {\n\t\t\t\t\t...(params?.join ? { join: params.join } : {}),\n\t\t\t\t\t...(params?.cap ? { cap: params.cap } : {}),\n\t\t\t\t\t...(params?.miterLimit !== undefined ? { miterLimit: params.miterLimit } : {})\n\t\t\t\t})\n\t\t}\n\t];\n}\n\n// ---------------------------------------------------------------------------\n// Canvas freehand drawing\n// ---------------------------------------------------------------------------\n\n/** Draw surface of the freehand draw controller (`createCanvasDrawController` satisfies it). */\nexport interface DrawCommandTarget {\n\tdrawStroke(input: {\n\t\tpoints: readonly (readonly [number, number])[];\n\t\ttool?: 'pen' | 'highlighter';\n\t\tstyle?: { color?: string; width?: number; opacity?: number; brush?: CanvasBrush; paint?: CanvasBrushPaint };\n\t\tpressure?: readonly number[];\n\t\ttiltX?: readonly number[];\n\t\ttiltY?: readonly number[];\n\t\tstreamline?: boolean;\n\t}): Promise<{ id: string; bounds: { x: number; y: number; width: number; height: number }; brush?: unknown }>;\n\t/** The dry paint presets a stroke can be brushed with (loads the paint engine). */\n\tlistBrushes(): Promise<CanvasBrushPreset[]>;\n}\n\nexport interface DrawCommandOptions {\n\t/** Id prefix (default `canvas.`). */\n\tprefix?: string;\n\tgroup?: string;\n\t/** Scope of the commands (default `canvas`). Pass `null` for global. */\n\tscope?: string | null;\n\t/** Refuse drawing with this reason (e.g. a read-only canvas); `canvas.listBrushes` still runs. */\n\treadOnlyReason?: () => string | null | undefined;\n}\n\nconst PROFILE_PARAM = (what: string, lo: number, hi: number) =>\n\t({\n\t\ttype: 'array',\n\t\tminItems: 1,\n\t\tmaxItems: 256,\n\t\titems: { type: 'number', minimum: lo, maximum: hi },\n\t\tdescription: `${what} spread evenly along the stroke's length: the first value at the start, the last at the end, linearly in between; one value is constant. Only with a brush.`\n\t}) as const;\n\nconst BRUSH_SETTINGS_PARAM = {\n\ttype: 'object',\n\tadditionalProperties: false,\n\tdescription: 'Tip settings instead of a preset.',\n\tproperties: {\n\t\tsize: { type: 'number', minimum: 1, maximum: 2500, description: 'Brush diameter in canvas units (default: the stroke width).' },\n\t\thardness: { type: 'number', minimum: 0, maximum: 1, description: 'Edge hardness, 0 soft to 1 hard (default 1).' },\n\t\tspacing: { type: 'number', minimum: 0.01, maximum: 10, description: 'Dab spacing as a fraction of the diameter (default 0.1).' },\n\t\tangle: { type: 'number', minimum: -360, maximum: 360, description: 'Tip angle in degrees (default 0).' },\n\t\troundness: { type: 'number', minimum: 0.01, maximum: 1, description: 'Tip roundness, 1 round to 0.01 flat (default 1).' },\n\t\topacity: { type: 'number', minimum: 0, maximum: 1, description: 'Opacity ceiling of the stroke 0..1 (default 1).' },\n\t\tflow: { type: 'number', minimum: 0, maximum: 1, description: 'Build-up per dab 0..1 (default 1).' },\n\t\tpressureSize: { type: 'boolean', description: 'Pressure scales the size (default true).' },\n\t\tpressureOpacity: { type: 'boolean', description: 'Pressure scales the opacity (default false).' }\n\t}\n} as const;\n\nconst HEX_PARAM = '^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$';\n\n/**\n * Gradient paint for a brushed stroke: the paint engine's `PaintSource` described structurally,\n * so commands never import the paint module (see GOTCHAS: the DTS build runs out of memory).\n * The canvas renderer validates it again (sorted stops, defaults) before anything is drawn.\n */\nconst BRUSH_PAINT_PARAM = {\n\tdescription:\n\t\t'Paint the brushed stroke with gradient paint (or one colour) instead of `color`, sampled dab by dab along the path; `color` still gives the alpha and fills \"paint\" stops. Only with `brush`. Example (blue to yellow over 200 canvas units, and back): { \"type\": \"gradient\", \"stops\": [{ \"offset\": 0, \"color\": \"#1d4ed8\" }, { \"offset\": 1, \"color\": \"#facc15\" }], \"map\": { \"by\": \"distance\", \"length\": 200, \"repeat\": \"mirror\" } }.',\n\toneOf: [\n\t\t{\n\t\t\ttype: 'object',\n\t\t\tadditionalProperties: false,\n\t\t\trequired: ['type', 'color'],\n\t\t\tdescription: 'One colour.',\n\t\t\tproperties: {\n\t\t\t\ttype: { type: 'string', enum: ['color'], description: 'Always \"color\".' },\n\t\t\t\tcolor: { type: 'string', pattern: HEX_PARAM, description: 'The colour as #rrggbb (or #rgb).' }\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\ttype: 'object',\n\t\t\tadditionalProperties: false,\n\t\t\trequired: ['type', 'stops'],\n\t\t\tdescription: 'Gradient paint: the brush samples it dab by dab as the stroke goes.',\n\t\t\tproperties: {\n\t\t\t\ttype: { type: 'string', enum: ['gradient'], description: 'Always \"gradient\".' },\n\t\t\t\tstops: {\n\t\t\t\t\ttype: 'array',\n\t\t\t\t\tminItems: 2,\n\t\t\t\t\tmaxItems: 16,\n\t\t\t\t\tdescription: '2..16 stops sorted by offset.',\n\t\t\t\t\titems: {\n\t\t\t\t\t\ttype: 'object',\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t\trequired: ['offset', 'color'],\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\toffset: { type: 'number', minimum: 0, maximum: 1, description: 'Position 0..1 along the gradient.' },\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdescription: 'The stop colour as #rrggbb, or \"paint\" (the stroke colour) or \"secondary\" (white).',\n\t\t\t\t\t\t\t\tanyOf: [{ pattern: HEX_PARAM }, { enum: ['paint', 'secondary'] }]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\topacity: { type: 'number', minimum: 0, maximum: 1, description: 'Multiplies the brush flow where this colour is laid, 0..1 (default 1).' },\n\t\t\t\t\t\t\tmidpoint: { type: 'number', minimum: 0.05, maximum: 0.95, description: 'Where between this stop and the next the colours are half mixed, 0.05..0.95 (default 0.5).' }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tspace: { type: 'string', enum: ['pigment', 'oklab', 'srgb'], description: 'How neighbouring stops mix: pigment (default; like paint, blue to yellow passes green), oklab (perceptual) or srgb (plain numbers).' },\n\t\t\t\tmap: {\n\t\t\t\t\ttype: 'object',\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\trequired: ['by'],\n\t\t\t\t\tdescription: 'What moves the stroke along the gradient (default distance, 300 canvas units, mirror).',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tby: {\n\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\tenum: ['distance', 'pressure', 'tilt', 'direction', 'across-tip', 'random'],\n\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t'distance: canvas units (or dabs) travelled along the path; pressure: the pressure profile 0..1; tilt: pen lean from the tilt profiles, upright 0 .. flat 1; direction: direction of travel, once round per 360°; across-tip: left to right across the tip (a brush loaded with several colours); random: a seeded random point per dab. Canvas strokes carry no timing, so velocity and time are not available.'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tlength: { type: 'number', minimum: 1, maximum: 100000, description: 'distance: canvas units (or dabs, with unit \"dabs\") per run through the gradient (default 300).' },\n\t\t\t\t\t\trepeat: { type: 'string', enum: ['clamp', 'repeat', 'mirror'], description: 'distance: past the end, clamp (hold the last colour), repeat (start again) or mirror (run back; default).' },\n\t\t\t\t\t\tunit: { type: 'string', enum: ['px', 'dabs'], description: 'distance: canvas units (\"px\", default) or dabs.' },\n\t\t\t\t\t\tevery: { type: 'integer', minimum: 1, maximum: 500, description: 'random: dabs per random pick (default 1).' }\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsoftness: { type: 'number', minimum: 0, maximum: 1, description: 'How softly neighbouring stops blend: 1 smooth (default) .. 0 hard steps.' }\n\t\t\t}\n\t\t}\n\t]\n} as const;\n\n/**\n * Agent / palette commands for freehand drawing: `canvas.drawFreehand` (a pen or highlighter\n * stroke through given points, optionally brushed with a dry paint preset and a pressure / tilt\n * profile; one undo step) and the read-only `canvas.listBrushes` (the dry presets it accepts).\n */\nexport function createDrawCommands(target: DrawCommandTarget, options: DrawCommandOptions = {}): CommandSpec[] {\n\tconst prefix = options.prefix ?? 'canvas.';\n\tconst group = options.group ?? 'Draw';\n\tconst scope = options.scope === null ? undefined : options.scope ?? 'canvas';\n\tconst base = { group, ...(scope ? { scope } : {}) };\n\treturn [\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}drawFreehand`,\n\t\t\tlabel: 'Draw Freehand Stroke',\n\t\t\tkeywords: ['pen', 'highlighter', 'brush', 'sketch', 'draw', 'stroke', 'pencil', 'ink'],\n\t\t\tdescription:\n\t\t\t\t'Draws a freehand pen or highlighter stroke through points (canvas coordinates) as one path shape node, in one undo step. With `brush` it is painted with a dry paint brush (a preset id from canvas.listBrushes, or tip settings) and `pressure` / `tiltX` / `tiltY` profiles shape it along its length; `paint` gives it gradient paint that changes colour along the stroke. Wet brushes are refused. Returns the new node `id`, its `bounds` and the stored `brush`.',\n\t\t\tparams: {\n\t\t\t\ttype: 'object',\n\t\t\t\tadditionalProperties: false,\n\t\t\t\trequired: ['points'],\n\t\t\t\tproperties: {\n\t\t\t\t\tpoints: {\n\t\t\t\t\t\ttype: 'array',\n\t\t\t\t\t\tminItems: 1,\n\t\t\t\t\t\tmaxItems: 5000,\n\t\t\t\t\t\titems: { type: 'array', minItems: 2, maxItems: 2, items: { type: 'number' } },\n\t\t\t\t\t\tdescription: 'Stroke points as [x, y] pairs in canvas (flow) units, in drawing order. Use a point every few units along curves.'\n\t\t\t\t\t},\n\t\t\t\t\ttool: { type: 'string', enum: ['pen', 'highlighter'], description: 'Pen (default: blue, width 3) or highlighter (yellow, width 24, opacity 0.35); sets the defaults below.' },\n\t\t\t\t\tcolor: { type: 'string', description: 'Stroke colour, any CSS colour (default from the tool).' },\n\t\t\t\t\twidth: { type: 'number', exclusiveMinimum: 0, maximum: 2500, description: 'Stroke width in canvas units; the brush size for brushed strokes (default from the tool).' },\n\t\t\t\t\topacity: { type: 'number', minimum: 0, maximum: 1, description: 'Stroke opacity 0..1 (default from the tool).' },\n\t\t\t\t\tbrush: {\n\t\t\t\t\t\tdescription: 'Paint the stroke with a dry paint brush: a preset id such as \"ink-pen\", \"pencil-hb\", \"brush-pen\", \"charcoal-stick\", \"soft-pastel\", \"marker\" or \"airbrush\" (all ids: canvas.listBrushes), or tip settings. Omit for a plain vector stroke.',\n\t\t\t\t\t\toneOf: [{ type: 'string', minLength: 1 }, BRUSH_SETTINGS_PARAM]\n\t\t\t\t\t},\n\t\t\t\t\tpaint: BRUSH_PAINT_PARAM,\n\t\t\t\t\tpressure: PROFILE_PARAM('Pen pressure 0..1', 0, 1),\n\t\t\t\t\ttiltX: PROFILE_PARAM('Pen tilt along x in degrees (−90..90)', -90, 90),\n\t\t\t\t\ttiltY: PROFILE_PARAM('Pen tilt along y in degrees (−90..90)', -90, 90),\n\t\t\t\t\tstreamline: { type: 'boolean', description: 'Smooth jittery points before fitting the path (default false).' }\n\t\t\t\t}\n\t\t\t},\n\t\t\tenabled: () => options.readOnlyReason?.() || true,\n\t\t\trun: (\n\t\t\t\t_ctx: unknown,\n\t\t\t\tparams: {\n\t\t\t\t\tpoints: [number, number][];\n\t\t\t\t\ttool?: 'pen' | 'highlighter';\n\t\t\t\t\tcolor?: string;\n\t\t\t\t\twidth?: number;\n\t\t\t\t\topacity?: number;\n\t\t\t\t\tbrush?: CanvasBrush;\n\t\t\t\t\tpaint?: CanvasBrushPaint;\n\t\t\t\t\tpressure?: number[];\n\t\t\t\t\ttiltX?: number[];\n\t\t\t\t\ttiltY?: number[];\n\t\t\t\t\tstreamline?: boolean;\n\t\t\t\t}\n\t\t\t) =>\n\t\t\t\ttarget.drawStroke({\n\t\t\t\t\tpoints: params.points,\n\t\t\t\t\t...(params.tool ? { tool: params.tool } : {}),\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...(params.color !== undefined ? { color: params.color } : {}),\n\t\t\t\t\t\t...(params.width !== undefined ? { width: params.width } : {}),\n\t\t\t\t\t\t...(params.opacity !== undefined ? { opacity: params.opacity } : {}),\n\t\t\t\t\t\t...(params.brush !== undefined ? { brush: params.brush } : {}),\n\t\t\t\t\t\t...(params.paint !== undefined ? { paint: params.paint } : {})\n\t\t\t\t\t},\n\t\t\t\t\t...(params.pressure ? { pressure: params.pressure } : {}),\n\t\t\t\t\t...(params.tiltX ? { tiltX: params.tiltX } : {}),\n\t\t\t\t\t...(params.tiltY ? { tiltY: params.tiltY } : {}),\n\t\t\t\t\t...(params.streamline ? { streamline: true } : {})\n\t\t\t\t})\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}listBrushes`,\n\t\t\tlabel: 'List Freehand Brushes',\n\t\t\tkeywords: ['brushes', 'presets', 'paint', 'pencil', 'ink'],\n\t\t\tdescription: 'Read-only: the dry paint presets canvas.drawFreehand accepts as `brush`, as { id, name, category, size } (size is the preset\\'s own diameter; the stroke width replaces it).',\n\t\t\tparams: { type: 'object', additionalProperties: false, properties: {} },\n\t\t\treadOnly: true,\n\t\t\trun: async () => ({ brushes: await target.listBrushes() })\n\t\t}\n\t];\n}\n\n// ---------------------------------------------------------------------------\n// Canvas components and instances\n// ---------------------------------------------------------------------------\n\ntype ComponentActionResult = { ok: true; ids: string[] } | { ok: false; reason: string };\n\n/** Components surface of the components controller (`createCanvasComponentsController` satisfies it). */\nexport interface ComponentCommandTarget {\n\tcreateComponent(ids?: Iterable<string>): ComponentActionResult;\n\tcanCreateComponent(ids?: Iterable<string>): true | string;\n\tcombineAsVariants(ids?: Iterable<string>): ComponentActionResult;\n\tcanCombineAsVariants(ids?: Iterable<string>): true | string;\n\tcreateInstance(componentId: string, options?: { parentId?: string; position?: { x: number; y: number }; properties?: Record<string, boolean | string> }): ComponentActionResult;\n\tcanCreateInstance(componentId?: string, parentId?: string): true | string;\n\tdetachInstance(ids?: Iterable<string>): ComponentActionResult;\n\tcanDetachInstance(ids?: Iterable<string>): true | string;\n\tresetOverrides(id?: string, group?: string): ComponentActionResult;\n\tcanResetOverrides(id?: string): true | string;\n\tpushOverrides(id?: string): ComponentActionResult;\n\tcanPushOverrides(id?: string): true | string;\n\tswapInstance(componentId: string, ids?: Iterable<string>): ComponentActionResult;\n\tcanSwapInstance(componentId?: string, ids?: Iterable<string>): true | string;\n\tsetInstanceProperties(properties: Record<string, unknown>, ids?: Iterable<string>): ComponentActionResult;\n\tcanSetInstanceProperties(ids?: Iterable<string>): true | string;\n\trestoreMainComponent(id?: string): ComponentActionResult;\n\tcanRestoreMainComponent(id?: string): true | string;\n\tgoToMainComponent(id?: string): string | undefined;\n\tcanGoToMainComponent(id?: string): true | string;\n\tlist(): unknown;\n\tinspect(id?: string): unknown;\n\t// Variant editing (optional so older targets keep type-checking; the controller has them all).\n\taddVariant?(\n\t\tsetId?: string,\n\t\toptions?: { from?: string; variant?: Record<string, string>; position?: { x: number; y: number }; defaultValue?: string }\n\t): ComponentActionResult;\n\tcanAddVariant?(setId?: string, options?: { from?: string; variant?: Record<string, string> }): true | string;\n\tremoveVariant?(variantId?: string): ComponentActionResult;\n\tcanRemoveVariant?(variantId?: string): true | string;\n\tsetVariantProperties?(values: Record<string, string>, variantId?: string, options?: { defaultValue?: string }): ComponentActionResult;\n\tcanSetVariantProperties?(values?: Record<string, string>, variantId?: string): true | string;\n\trenameVariantProperty?(name: string, newName: string, setId?: string): ComponentActionResult;\n\tcanRenameVariantProperty?(name?: string, newName?: string, setId?: string): true | string;\n\trenameVariantValue?(property: string, value: string, newValue: string, setId?: string): ComponentActionResult;\n\tcanRenameVariantValue?(property?: string, value?: string, newValue?: string, setId?: string): true | string;\n}\n\n/** The variant-editing part of a `ComponentCommandTarget` (present on the components controller). */\ntype VariantCommandTarget = Required<\n\tPick<\n\t\tComponentCommandTarget,\n\t\t| 'addVariant'\n\t\t| 'canAddVariant'\n\t\t| 'removeVariant'\n\t\t| 'canRemoveVariant'\n\t\t| 'setVariantProperties'\n\t\t| 'canSetVariantProperties'\n\t\t| 'renameVariantProperty'\n\t\t| 'canRenameVariantProperty'\n\t\t| 'renameVariantValue'\n\t\t| 'canRenameVariantValue'\n\t>\n>;\n\n/** Whether a command target can edit variants. */\nexport function hasVariantCommands(controller: ComponentCommandTarget): controller is ComponentCommandTarget & VariantCommandTarget {\n\treturn typeof controller.addVariant === 'function' && typeof controller.removeVariant === 'function';\n}\n\nconst SET_ID_PARAM = { type: 'string', description: 'Component set (or one of its variants) to act on (default: the selection’s set).' } as const;\nconst VARIANT_ID_PARAM = { type: 'string', description: 'Variant to act on (default: the first selected variant).' } as const;\nconst VARIANT_VALUES_PARAM = {\n\ttype: 'object',\n\tdescription: 'Variant property → value, e.g. { \"Size\": \"Medium\" }. New property names are added to every variant.',\n\tadditionalProperties: { type: 'string' }\n} as const;\n\nfunction variantCommands(controller: ComponentCommandTarget & VariantCommandTarget, prefix: string, base: Partial<CommandSpec>): CommandSpec[] {\n\treturn [\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}addVariant`,\n\t\t\tlabel: 'Add Variant',\n\t\t\tkeywords: ['variant', 'new variant', 'duplicate variant', 'component set'],\n\t\t\tdescription: 'Adds a variant to a component set by duplicating one (default: the selected or default variant) with new property values.',\n\t\t\tparams: {\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: {\n\t\t\t\t\tsetId: SET_ID_PARAM,\n\t\t\t\t\tfrom: { type: 'string', description: 'Variant to duplicate (default: the selected variant, else the default one).' },\n\t\t\t\t\tvariant: VARIANT_VALUES_PARAM,\n\t\t\t\t\tx: { type: 'number', description: 'X in the set’s space (default: next to the source).' },\n\t\t\t\t\ty: { type: 'number', description: 'Y in the set’s space.' }\n\t\t\t\t}\n\t\t\t},\n\t\t\tenabled: (_ctx: unknown, params?: { setId?: string; from?: string; variant?: Record<string, string> }) =>\n\t\t\t\tcontroller.canAddVariant(params?.setId, {\n\t\t\t\t\t...(params?.from !== undefined ? { from: params.from } : {}),\n\t\t\t\t\t...(params?.variant ? { variant: params.variant } : {})\n\t\t\t\t}),\n\t\t\trun: (_ctx: unknown, params?: { setId?: string; from?: string; variant?: Record<string, string>; x?: number; y?: number }) =>\n\t\t\t\toutcome(\n\t\t\t\t\tcontroller.addVariant(params?.setId, {\n\t\t\t\t\t\t...(params?.from !== undefined ? { from: params.from } : {}),\n\t\t\t\t\t\t...(params?.variant ? { variant: params.variant } : {}),\n\t\t\t\t\t\t...(params?.x !== undefined || params?.y !== undefined ? { position: { x: params?.x ?? 0, y: params?.y ?? 0 } } : {})\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t} as CommandSpec,\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}removeVariant`,\n\t\t\tlabel: 'Remove Variant',\n\t\t\tkeywords: ['delete variant', 'variant'],\n\t\t\tdescription: 'Removes a variant; its instances switch to the closest remaining variant, keeping overrides.',\n\t\t\tparams: { type: 'object', properties: { id: VARIANT_ID_PARAM } },\n\t\t\tenabled: (_ctx: unknown, params?: { id?: string }) => controller.canRemoveVariant(params?.id),\n\t\t\trun: (_ctx: unknown, params?: { id?: string }) => outcome(controller.removeVariant(params?.id))\n\t\t} as CommandSpec,\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}setVariantProperties`,\n\t\t\tlabel: 'Edit Variant Properties…',\n\t\t\tkeywords: ['rename variant', 'variant values', 'variant'],\n\t\t\tdescription: 'Sets a variant’s property values (refusing a combination another variant has).',\n\t\t\tparams: { type: 'object', properties: { values: VARIANT_VALUES_PARAM, id: VARIANT_ID_PARAM }, required: ['values'] },\n\t\t\tenabled: (_ctx: unknown, params?: { values?: Record<string, string>; id?: string }) => controller.canSetVariantProperties(params?.values, params?.id),\n\t\t\trun: (_ctx: unknown, params: { values: Record<string, string>; id?: string }) => outcome(controller.setVariantProperties(params.values, params?.id))\n\t\t} as CommandSpec,\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}renameVariantProperty`,\n\t\t\tlabel: 'Rename Variant Property…',\n\t\t\tkeywords: ['rename property', 'variant property'],\n\t\t\tdescription: 'Renames a variant property across a component set.',\n\t\t\tparams: {\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: { name: { type: 'string' }, newName: { type: 'string' }, setId: SET_ID_PARAM },\n\t\t\t\trequired: ['name', 'newName']\n\t\t\t},\n\t\t\tenabled: (_ctx: unknown, params?: { name?: string; newName?: string; setId?: string }) =>\n\t\t\t\tcontroller.canRenameVariantProperty(params?.name, params?.newName, params?.setId),\n\t\t\trun: (_ctx: unknown, params: { name: string; newName: string; setId?: string }) =>\n\t\t\t\toutcome(controller.renameVariantProperty(params.name, params.newName, params?.setId))\n\t\t} as CommandSpec,\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}renameVariantValue`,\n\t\t\tlabel: 'Rename Variant Value…',\n\t\t\tkeywords: ['rename value', 'variant value'],\n\t\t\tdescription: 'Renames a value of a variant property across a component set.',\n\t\t\tparams: {\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: { property: { type: 'string' }, value: { type: 'string' }, newValue: { type: 'string' }, setId: SET_ID_PARAM },\n\t\t\t\trequired: ['property', 'value', 'newValue']\n\t\t\t},\n\t\t\tenabled: (_ctx: unknown, params?: { property?: string; value?: string; newValue?: string; setId?: string }) =>\n\t\t\t\tcontroller.canRenameVariantValue(params?.property, params?.value, params?.newValue, params?.setId),\n\t\t\trun: (_ctx: unknown, params: { property: string; value: string; newValue: string; setId?: string }) =>\n\t\t\t\toutcome(controller.renameVariantValue(params.property, params.value, params.newValue, params?.setId))\n\t\t} as CommandSpec\n\t];\n}\n\nexport interface ComponentCommandOptions {\n\t/** Id prefix (default `canvas.`). */\n\tprefix?: string;\n\tgroup?: string;\n\t/** Scope (default `canvas`). Pass `null` for global. */\n\tscope?: string | null;\n}\n\nconst outcome = (result: ComponentActionResult) => {\n\tif (!result.ok) throw new Error(result.reason);\n\treturn { ids: result.ids };\n};\n\nconst ID_PARAM = { type: 'string', description: 'Instance (or layer inside one) to act on (default: the first selected node).' } as const;\n\n/**\n * Palette / context-menu / agent commands for components and instances:\n * `canvas.createComponent`, `canvas.combineAsVariants`, `canvas.createInstance`\n * (`{ componentId, parentId?, x?, y?, properties? }`), `canvas.detachInstance`,\n * `canvas.resetOverrides` (`{ id?, group? }`), `canvas.pushOverrides`, `canvas.goToMainComponent`,\n * `canvas.swapInstance` (`{ componentId, ids? }`), `canvas.setInstanceProperties`\n * (`{ properties, ids? }`: variant and component property values), `canvas.restoreMainComponent`,\n * the variant editors `canvas.addVariant` (`{ setId?, from?, variant?, x?, y? }`),\n * `canvas.removeVariant` (`{ id? }`), `canvas.setVariantProperties` (`{ values, id? }`),\n * `canvas.renameVariantProperty` (`{ name, newName, setId? }`) and `canvas.renameVariantValue`\n * (`{ property, value, newValue, setId? }`) when the target has them, and the read-only `canvas.listComponents` / `canvas.inspectInstance`. Each action is one\n * undoable step when the controller has a history; enablement explains why it cannot run.\n */\nexport function createComponentCommands(controller: ComponentCommandTarget, options: ComponentCommandOptions = {}): CommandSpec[] {\n\tconst prefix = options.prefix ?? 'canvas.';\n\tconst group = options.group ?? 'Components';\n\tconst scope = options.scope === null ? undefined : options.scope ?? 'canvas';\n\tconst base = { group, ...(scope ? { scope } : {}) };\n\tconst idParams: CommandParamsSchema = { type: 'object', properties: { id: ID_PARAM } };\n\treturn [\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}createComponent`,\n\t\t\tlabel: 'Create Component',\n\t\t\tkeywords: ['component', 'symbol', 'main component', 'reusable'],\n\t\t\tdescription: 'Turns the selected frame into a main component, or wraps the selection in one.',\n\t\t\tparams: IDS_PARAMS,\n\t\t\tshortcut: 'Mod+Alt+K',\n\t\t\tenabled: (_ctx: unknown, params?: { ids?: string[] }) => controller.canCreateComponent(params?.ids),\n\t\t\trun: (_ctx: unknown, params: { ids?: string[] }) => outcome(controller.createComponent(params?.ids))\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}combineAsVariants`,\n\t\t\tlabel: 'Combine as Variants',\n\t\t\tkeywords: ['component set', 'variant', 'variants'],\n\t\t\tdescription: 'Wraps the selected components in a component set.',\n\t\t\tparams: IDS_PARAMS,\n\t\t\tenabled: (_ctx: unknown, params?: { ids?: string[] }) => controller.canCombineAsVariants(params?.ids),\n\t\t\trun: (_ctx: unknown, params: { ids?: string[] }) => outcome(controller.combineAsVariants(params?.ids))\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}createInstance`,\n\t\t\tlabel: 'Create Instance',\n\t\t\tkeywords: ['instance', 'insert component', 'use component'],\n\t\t\tdescription: 'Places an instance of a component (or a component set’s default variant).',\n\t\t\tparams: {\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: {\n\t\t\t\t\tcomponentId: { type: 'string', description: 'Component or component set id.' },\n\t\t\t\t\tparentId: { type: 'string', description: 'Frame to place it in (default: the canvas).' },\n\t\t\t\t\tx: { type: 'number', description: 'X in the parent’s space (default: next to the main).' },\n\t\t\t\t\ty: { type: 'number', description: 'Y in the parent’s space.' },\n\t\t\t\t\tproperties: { type: 'object', description: 'Variant and component property values.', additionalProperties: true }\n\t\t\t\t},\n\t\t\t\trequired: ['componentId']\n\t\t\t},\n\t\t\tenabled: (_ctx: unknown, params?: { componentId?: string; parentId?: string }) =>\n\t\t\t\tparams?.componentId === undefined ? true : controller.canCreateInstance(params.componentId, params.parentId),\n\t\t\trun: (_ctx: unknown, params: { componentId: string; parentId?: string; x?: number; y?: number; properties?: Record<string, boolean | string> }) =>\n\t\t\t\toutcome(\n\t\t\t\t\tcontroller.createInstance(params.componentId, {\n\t\t\t\t\t\t...(params.parentId !== undefined ? { parentId: params.parentId } : {}),\n\t\t\t\t\t\t...(params.x !== undefined || params.y !== undefined ? { position: { x: params.x ?? 0, y: params.y ?? 0 } } : {}),\n\t\t\t\t\t\t...(params.properties ? { properties: params.properties } : {})\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}detachInstance`,\n\t\t\tlabel: 'Detach Instance',\n\t\t\tkeywords: ['unlink', 'break instance'],\n\t\t\tdescription: 'Turns the selected instances into plain frames that keep their look.',\n\t\t\tparams: IDS_PARAMS,\n\t\t\tshortcut: 'Mod+Alt+B',\n\t\t\tenabled: (_ctx: unknown, params?: { ids?: string[] }) => controller.canDetachInstance(params?.ids),\n\t\t\trun: (_ctx: unknown, params: { ids?: string[] }) => outcome(controller.detachInstance(params?.ids))\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}resetOverrides`,\n\t\t\tlabel: 'Reset All Changes',\n\t\t\tkeywords: ['reset instance', 'reset overrides', 'revert'],\n\t\t\tdescription: 'Resets the overrides of an instance (or of a layer, or one override group) to its main.',\n\t\t\tparams: {\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: {\n\t\t\t\t\tid: ID_PARAM,\n\t\t\t\t\tgroup: { type: 'string', description: 'One override group to reset, e.g. \"data.label\" or \"shape.fill\" (default: all).' }\n\t\t\t\t}\n\t\t\t},\n\t\t\tenabled: (_ctx: unknown, params?: { id?: string }) => controller.canResetOverrides(params?.id),\n\t\t\trun: (_ctx: unknown, params: { id?: string; group?: string }) => outcome(controller.resetOverrides(params?.id, params?.group))\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}pushOverrides`,\n\t\t\tlabel: 'Push Changes to Main Component',\n\t\t\tkeywords: ['push overrides', 'update main component'],\n\t\t\tdescription: 'Copies the instance’s overrides to its main component and every other instance.',\n\t\t\tparams: idParams,\n\t\t\tenabled: (_ctx: unknown, params?: { id?: string }) => controller.canPushOverrides(params?.id),\n\t\t\trun: (_ctx: unknown, params: { id?: string }) => outcome(controller.pushOverrides(params?.id))\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}goToMainComponent`,\n\t\t\tlabel: 'Go to Main Component',\n\t\t\tkeywords: ['main component', 'find main', 'reveal'],\n\t\t\tdescription: 'Selects the main component of the selected instance.',\n\t\t\tparams: idParams,\n\t\t\tenabled: (_ctx: unknown, params?: { id?: string }) => controller.canGoToMainComponent(params?.id),\n\t\t\trun: (_ctx: unknown, params: { id?: string }) => {\n\t\t\t\tconst main = controller.goToMainComponent(params?.id);\n\t\t\t\tif (!main) throw new Error('The main component was not found.');\n\t\t\t\treturn { id: main };\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}swapInstance`,\n\t\t\tlabel: 'Swap Instance…',\n\t\t\tkeywords: ['replace instance', 'swap component'],\n\t\t\tdescription: 'Makes the selected instances show another component, keeping matching overrides.',\n\t\t\tparams: {\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: {\n\t\t\t\t\tcomponentId: { type: 'string', description: 'Component or component set to swap to.' },\n\t\t\t\t\tids: IDS_PARAMS.properties!.ids\n\t\t\t\t},\n\t\t\t\trequired: ['componentId']\n\t\t\t},\n\t\t\tenabled: (_ctx: unknown, params?: { componentId?: string; ids?: string[] }) => controller.canSwapInstance(params?.componentId, params?.ids),\n\t\t\trun: (_ctx: unknown, params: { componentId: string; ids?: string[] }) => outcome(controller.swapInstance(params.componentId, params?.ids))\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}setInstanceProperties`,\n\t\t\tlabel: 'Set Instance Properties…',\n\t\t\tkeywords: ['variant', 'switch variant', 'component property', 'toggle'],\n\t\t\tdescription: 'Sets variant properties (switching variants) and component property values of the selected instances.',\n\t\t\tparams: {\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: {\n\t\t\t\t\tproperties: { type: 'object', description: 'Property name → value (variant value, boolean, text or component id).', additionalProperties: true },\n\t\t\t\t\tids: IDS_PARAMS.properties!.ids\n\t\t\t\t},\n\t\t\t\trequired: ['properties']\n\t\t\t},\n\t\t\tenabled: (_ctx: unknown, params?: { ids?: string[] }) => controller.canSetInstanceProperties(params?.ids),\n\t\t\trun: (_ctx: unknown, params: { properties: Record<string, unknown>; ids?: string[] }) =>\n\t\t\t\toutcome(controller.setInstanceProperties(params.properties, params?.ids))\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}restoreMainComponent`,\n\t\t\tlabel: 'Restore Main Component',\n\t\t\tkeywords: ['missing main', 'recover component'],\n\t\t\tdescription: 'Turns an instance whose main was deleted back into the main component.',\n\t\t\tparams: idParams,\n\t\t\tenabled: (_ctx: unknown, params?: { id?: string }) => controller.canRestoreMainComponent(params?.id),\n\t\t\trun: (_ctx: unknown, params: { id?: string }) => outcome(controller.restoreMainComponent(params?.id))\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}listComponents`,\n\t\t\tlabel: 'List Components',\n\t\t\tkeywords: ['components', 'variants', 'assets'],\n\t\t\tdescription: 'Lists the components and component sets (with their variant options).',\n\t\t\treadOnly: true,\n\t\t\trun: () => controller.list()\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}inspectInstance`,\n\t\t\tlabel: 'Inspect Instance',\n\t\t\tkeywords: ['instance', 'overrides', 'properties'],\n\t\t\tdescription: 'Describes an instance: its main, variant, property values and overrides.',\n\t\t\tparams: idParams,\n\t\t\treadOnly: true,\n\t\t\tenabled: (_ctx: unknown, params?: { id?: string }) => (controller.inspect(params?.id) ? true : 'Select an instance.'),\n\t\t\trun: (_ctx: unknown, params: { id?: string }) => controller.inspect(params?.id) ?? null\n\t\t},\n\t\t...(hasVariantCommands(controller) ? variantCommands(controller, prefix, base) : [])\n\t];\n}\n\n// ---------------------------------------------------------------------------\n// Spreadsheet table actions\n// ---------------------------------------------------------------------------\n\n/** Spreadsheet controller surface used by `createSpreadsheetCommands`. */\nexport interface SpreadsheetCommandTarget {\n\tselectedRange: unknown;\n\tgetFilterState(): { enabled: boolean; rules: readonly unknown[] };\n\ttoggleFilters(): void;\n\tclearFilters(): void;\n\tunhideAll(): void;\n\tmergeCells(): boolean;\n\tunmergeCells(): boolean;\n\ttransposeRange(): boolean;\n}\n\nexport interface SpreadsheetCommandOptions {\n\t/** Id prefix (default `spreadsheet.`). */\n\tprefix?: string;\n\t/** Scope (default `spreadsheet`). Pass `null` for global. */\n\tscope?: string | null;\n}\n\n/** Turns a controller's `false` (nothing changed) into a failure the palette and agents see. */\nfunction orFail(changed: boolean, message: string): true {\n\tif (!changed) throw new Error(message);\n\treturn true;\n}\n\n/**\n * Palette / agent commands for common spreadsheet table actions (no default shortcuts).\n * Merge, unmerge and transpose act on the user's selection; agents should use the\n * `merge_cells` / `unmerge_cells` / `transpose_range` tools, which take a range.\n */\nexport function createSpreadsheetCommands(\n\tcontroller: SpreadsheetCommandTarget,\n\toptions: SpreadsheetCommandOptions = {}\n): CommandSpec[] {\n\tconst prefix = options.prefix ?? 'spreadsheet.';\n\tconst scope = options.scope === null ? undefined : options.scope ?? 'spreadsheet';\n\tconst hasRange = () => (controller.selectedRange ? true : 'Select a range first.');\n\tconst base = { group: 'Table', ...(scope ? { scope } : {}) };\n\treturn [\n\t\t{ ...base, id: `${prefix}toggleFilters`, label: 'Toggle Filters', keywords: ['filter'], run: () => controller.toggleFilters() },\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}clearFilters`,\n\t\t\tlabel: 'Clear Filters',\n\t\t\tkeywords: ['filter', 'reset'],\n\t\t\tenabled: () => (controller.getFilterState().rules.length > 0 ? true : 'No filters to clear.'),\n\t\t\trun: () => controller.clearFilters()\n\t\t},\n\t\t{ ...base, id: `${prefix}unhideAll`, label: 'Unhide All Rows and Columns', keywords: ['show', 'hidden'], run: () => controller.unhideAll() },\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}mergeCells`,\n\t\t\tlabel: 'Merge Cells',\n\t\t\tkeywords: ['combine'],\n\t\t\tenabled: hasRange,\n\t\t\trun: () =>\n\t\t\t\torFail(controller.mergeCells(), 'Cannot merge the selection: it is a single cell, or it partly overlaps a merge or a spill range.')\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}unmergeCells`,\n\t\t\tlabel: 'Unmerge Cells',\n\t\t\tkeywords: ['split'],\n\t\t\tenabled: hasRange,\n\t\t\trun: () => orFail(controller.unmergeCells(), 'There are no merged cells in the selection.')\n\t\t},\n\t\t{\n\t\t\t...base,\n\t\t\tid: `${prefix}transposeRange`,\n\t\t\tlabel: 'Transpose Range',\n\t\t\tkeywords: ['rotate', 'swap rows columns'],\n\t\t\tenabled: hasRange,\n\t\t\trun: () =>\n\t\t\t\torFail(controller.transposeRange(), 'Cannot transpose the selection: it is a single cell, or a merge or a spill range is in the way.')\n\t\t}\n\t];\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/canvas/brushstroke.ts"],"sourcesContent":["/**\n * Brushed freehand strokes: a path shape with a `brush` keeps its path (selection, editing, eraser\n * hit-testing, grouping and export work as for any path) and is drawn with the paint engine's\n * dry brushstroke renderer instead of an SVG stroke. The renderer, the paint presets and the colour\n * parser live in a separate chunk, loaded the first time a brushed stroke is drawn, so canvases\n * without brushes never load the paint engine.\n */\nimport { brushstrokeScaleBucket } from '../paint/brushstroke-scale.js';\nimport { parseSvgPath, type PathShape, type ShapeDescription, type ShapeSize } from './shapeGeometry.js';\nimport type { Point } from './types.js';\nimport type { CanvasBrush, CanvasBrushPaint, CanvasBrushPreset, CanvasBrushstroke } from './brushTypes.js';\n\nexport type { CanvasBrush, CanvasBrushPaint, CanvasBrushPaintMapping, CanvasBrushPaintStop, CanvasBrushPreset, CanvasBrushSettings, CanvasBrushstroke } from './brushTypes.js';\n\nexport { brushstrokeScaleBucket };\n\n/** A brushed stroke's image, placed in the path's coordinates (the shape's view box). */\nexport interface CanvasBrushstrokeImage {\n\t/** PNG data URL. */\n\thref: string;\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n\t/** Image pixels per path unit. */\n\tscale: number;\n}\n\n/** A path shape with a brush. */\nexport type BrushedPathShape = PathShape & { brush: CanvasBrushstroke };\n\n/** Whether a shape is a brushed stroke. */\nexport function isBrushedShape(shape: ShapeDescription | null | undefined): shape is BrushedPathShape {\n\treturn !!shape && shape.kind === 'path' && !!shape.brush && typeof shape.brush === 'object' && shape.brush.brush != null;\n}\n\n/**\n * The open polyline of a path's first subpath, in path coordinates: lines kept, curves sampled\n * every `step` units or so. Brushed strokes are drawn along it.\n */\nexport function pathDataToPolyline(d: string, step = 2): Point[] {\n\tconst out: Point[] = [];\n\tlet x = 0;\n\tlet y = 0;\n\tlet started = false;\n\tconst push = (px: number, py: number) => {\n\t\tconst last = out[out.length - 1];\n\t\tif (!last || last[0] !== px || last[1] !== py) out.push([px, py]);\n\t};\n\tfor (const c of parseSvgPath(d)) {\n\t\tif (c.type === 'M') {\n\t\t\tif (started) break;\n\t\t\tstarted = true;\n\t\t\tx = c.x;\n\t\t\ty = c.y;\n\t\t\tpush(x, y);\n\t\t} else if (c.type === 'Z') {\n\t\t\tif (out.length) push(out[0][0], out[0][1]);\n\t\t\tbreak;\n\t\t} else if (c.type === 'C' || c.type === 'Q') {\n\t\t\tconst pts = c.type === 'C' ? [[x, y], [c.x1, c.y1], [c.x2, c.y2], [c.x, c.y]] : [[x, y], [c.x1, c.y1], [c.x, c.y]];\n\t\t\tlet hull = 0;\n\t\t\tfor (let i = 1; i < pts.length; i++) hull += Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]);\n\t\t\tconst n = Math.max(1, Math.min(256, Math.ceil(hull / Math.max(0.25, step))));\n\t\t\tfor (let k = 1; k <= n; k++) {\n\t\t\t\tconst t = k / n;\n\t\t\t\tconst u = 1 - t;\n\t\t\t\tif (c.type === 'C') {\n\t\t\t\t\tpush(\n\t\t\t\t\t\tu * u * u * x + 3 * u * u * t * c.x1 + 3 * u * t * t * c.x2 + t * t * t * c.x,\n\t\t\t\t\t\tu * u * u * y + 3 * u * u * t * c.y1 + 3 * u * t * t * c.y2 + t * t * t * c.y\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tpush(u * u * x + 2 * u * t * c.x1 + t * t * c.x, u * u * y + 2 * u * t * c.y1 + t * t * c.y);\n\t\t\t\t}\n\t\t\t}\n\t\t\tx = c.x;\n\t\t\ty = c.y;\n\t\t} else {\n\t\t\t// Lines, and arcs as their chords (freehand paths have none).\n\t\t\tx = c.x;\n\t\t\ty = c.y;\n\t\t\tpush(x, y);\n\t\t}\n\t}\n\treturn out;\n}\n\n/**\n * Resamples per-point values into `count` values spread evenly along the polyline's length (the\n * profile a brushed stroke stores). Values are rounded to three decimals.\n */\nexport function profileAlongPolyline(points: readonly Point[], values: readonly number[], count = 32): number[] {\n\tconst n = Math.min(points.length, values.length);\n\tif (n === 0) return [];\n\tif (n === 1) return [round3(values[0])];\n\tconst lengths = [0];\n\tfor (let i = 1; i < n; i++) lengths.push(lengths[i - 1] + Math.hypot(points[i][0] - points[i - 1][0], points[i][1] - points[i - 1][1]));\n\tconst total = lengths[n - 1];\n\tconst m = Math.max(2, Math.min(count, n));\n\tconst out: number[] = [];\n\tlet j = 0;\n\tfor (let k = 0; k < m; k++) {\n\t\tconst at = total > 0 ? (total * k) / (m - 1) : 0;\n\t\twhile (j < n - 2 && lengths[j + 1] < at) j++;\n\t\tconst span = lengths[j + 1] - lengths[j];\n\t\tconst f = span > 0 ? Math.min(1, Math.max(0, (at - lengths[j]) / span)) : 0;\n\t\tout.push(round3(values[j] + (values[j + 1] - values[j]) * f));\n\t}\n\treturn out;\n}\n\nconst round3 = (v: number) => Math.round(v * 1000) / 1000;\n\n// ---------------------------------------------------------------------------\n// The lazily loaded renderer\n// ---------------------------------------------------------------------------\n\n/** The renderer chunk (`./brushstrokeRender.ts`). */\nexport interface CanvasBrushstrokeRenderer {\n\tlistCanvasBrushes(): CanvasBrushPreset[];\n\t/** Throws for an unknown or non-dry brush; the result is the paint engine's brush. */\n\tresolveCanvasBrush(brush: CanvasBrush, width: number): unknown;\n\t/** Throws for paint that is not a colour or gradient paint a canvas stroke can use; the result is the paint engine's `PaintSource`. */\n\tresolveCanvasPaint(paint: unknown): unknown;\n\trenderShapeBrushstrokeNow(shape: BrushedPathShape, scale: number): CanvasBrushstrokeImage | null;\n\tbrushedShapeSvgNow(shape: BrushedPathShape, size: ShapeSize, scale: number): string;\n}\n\nlet loading: Promise<CanvasBrushstrokeRenderer> | null = null;\n\n/**\n * Loads the brushstroke renderer (the paint engine's dry brushes, the paint presets and a CSS\n * colour parser). Called for you by the functions below; call it early to warm up.\n */\nexport function loadCanvasBrushstrokeRenderer(): Promise<CanvasBrushstrokeRenderer> {\n\tloading ??= (import('./brushstrokeRender.js') as Promise<CanvasBrushstrokeRenderer>).catch((error) => {\n\t\tloading = null;\n\t\tthrow error;\n\t});\n\treturn loading;\n}\n\n/** The dry paint presets a freehand stroke can use (wet, mixer, blender, smudge and eraser presets are left out). */\nexport async function listCanvasBrushes(): Promise<CanvasBrushPreset[]> {\n\treturn (await loadCanvasBrushstrokeRenderer()).listCanvasBrushes();\n}\n\n/**\n * Checks a brush: an unknown preset id, a wet (or other non-dry) preset, or settings that are not\n * an object throw an error saying which presets can be used.\n */\nexport async function validateCanvasBrush(brush: CanvasBrush): Promise<void> {\n\t(await loadCanvasBrushstrokeRenderer()).resolveCanvasBrush(brush, 1);\n}\n\n/**\n * Checks a brushed stroke's `paint` (a colour or gradient paint): bad stops, an unknown mapping,\n * or a mapping that needs timed samples (`velocity`, `time`) throw an error saying what to use.\n */\nexport async function validateCanvasBrushPaint(paint: CanvasBrushPaint): Promise<void> {\n\t(await loadCanvasBrushstrokeRenderer()).resolveCanvasPaint(paint);\n}\n\nexport interface RenderShapeBrushstrokeOptions {\n\t/** Image pixels per path unit; pass `brushstrokeScaleBucket(zoom × node scale, devicePixelRatio)` (default 1). */\n\tscale?: number;\n}\n\n/**\n * Renders a brushed path shape to a cached PNG placed in path coordinates, or null for a shape\n * without a brush or an empty path. Throws for an unknown or non-dry brush.\n */\nexport async function renderShapeBrushstroke(shape: ShapeDescription, options: RenderShapeBrushstrokeOptions = {}): Promise<CanvasBrushstrokeImage | null> {\n\tif (!isBrushedShape(shape)) return null;\n\treturn (await loadCanvasBrushstrokeRenderer()).renderShapeBrushstrokeNow(shape, options.scale ?? 1);\n}\n\n/**\n * The brushed stroke as a standalone SVG document of `size` (the node box), with the image\n * embedded as a PNG data URL: what an SVG export writes for the node. Shapes without a brush give\n * null (export them as paths).\n */\nexport async function getBrushedShapeSvg(shape: ShapeDescription, size: ShapeSize, options: RenderShapeBrushstrokeOptions = {}): Promise<string | null> {\n\tif (!isBrushedShape(shape)) return null;\n\treturn (await loadCanvasBrushstrokeRenderer()).brushedShapeSvgNow(shape, size, options.scale ?? 2);\n}\n"],"mappings":";;;;;AAgCO,SAAS,eAAe,OAAuE;AACrG,SAAO,CAAC,CAAC,SAAS,MAAM,SAAS,UAAU,CAAC,CAAC,MAAM,SAAS,OAAO,MAAM,UAAU,YAAY,MAAM,MAAM,SAAS;AACrH;AAMO,SAAS,mBAAmB,GAAW,OAAO,GAAY;AAChE,QAAM,MAAe,CAAC;AACtB,MAAI,IAAI;AACR,MAAI,IAAI;AACR,MAAI,UAAU;AACd,QAAM,OAAO,CAAC,IAAY,OAAe;AACxC,UAAM,OAAO,IAAI,IAAI,SAAS,CAAC;AAC/B,QAAI,CAAC,QAAQ,KAAK,CAAC,MAAM,MAAM,KAAK,CAAC,MAAM,GAAI,KAAI,KAAK,CAAC,IAAI,EAAE,CAAC;AAAA,EACjE;AACA,aAA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