@pixerate/editor 0.266.2 → 0.268.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 +175 -108
- package/dist/animation-editor/index.js +94 -27
- package/dist/brushes/index.cjs +201 -75
- package/dist/brushes/index.d.cts +4 -3
- package/dist/brushes/index.d.ts +4 -3
- package/dist/brushes/index.js +138 -12
- package/dist/brushes/library.d.cts +27 -1
- package/dist/brushes/library.d.ts +27 -1
- package/dist/brushes/profiles.d.cts +10 -1
- package/dist/brushes/profiles.d.ts +10 -1
- package/dist/brushes/schema.d.cts +4 -0
- package/dist/brushes/schema.d.ts +4 -0
- package/dist/brushes/sources.d.cts +114 -0
- package/dist/brushes/sources.d.ts +114 -0
- package/dist/brushes/types.d.cts +37 -5
- package/dist/brushes/types.d.ts +37 -5
- package/dist/brushes/ui.d.cts +40 -4
- package/dist/brushes/ui.d.ts +40 -4
- package/dist/{brushstrokeRender-KD453OBX.js → brushstrokeRender-A727TTNQ.js} +7 -7
- package/dist/{brushstrokeRender-FSUWXUZY.cjs → brushstrokeRender-WR2N5HHY.cjs} +23 -23
- 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-TOID45I2.cjs → chunk-2WOGXEDX.cjs} +1 -1
- package/dist/{chunk-XORJ7UZO.cjs → chunk-3VHH6V67.cjs} +13 -12
- package/dist/{chunk-3C33YTNN.js → chunk-3XDSNIGF.js} +73 -6
- package/dist/chunk-62MFUHSI.cjs +802 -0
- package/dist/{chunk-R44Y3EFS.js → chunk-74ODPZLX.js} +17 -345
- package/dist/{chunk-GCVFEPJG.js → chunk-ACTHSQOI.js} +182 -0
- package/dist/chunk-ADMRNWR7.js +340 -0
- package/dist/{chunk-MVUQSK5J.cjs → chunk-B3G7BKUV.cjs} +111 -439
- package/dist/{chunk-DXYHQ2VN.js → chunk-BAZMCFVL.js} +1 -1
- package/dist/{chunk-VRK322ZC.cjs → chunk-BPJSI4NT.cjs} +2 -2
- package/dist/{chunk-RFJZGTHA.cjs → chunk-EU2ZZA6L.cjs} +400 -69
- package/dist/{chunk-XC6DPRYI.js → chunk-GSTSZPSR.js} +154 -949
- package/dist/{chunk-EZOJBP4D.js → chunk-HFY5LG5J.js} +1 -1
- package/dist/chunk-HVO6XCI4.js +802 -0
- package/dist/{chunk-YHDHFJUC.cjs → chunk-J5VQYK7T.cjs} +217 -1012
- package/dist/{chunk-XRXFVRGY.cjs → chunk-JBB3GDBB.cjs} +2483 -208
- package/dist/{chunk-ACFSFUQH.js → chunk-JL6YH5WD.js} +4 -0
- package/dist/{chunk-CIJBSUM5.js → chunk-KZI3YWKW.js} +353 -22
- package/dist/{chunk-4ODRXQRW.js → chunk-LETF75CA.js} +1 -1
- package/dist/{chunk-FQPUF2W2.cjs → chunk-NIBFKXMD.cjs} +217 -35
- package/dist/{chunk-AQZQWXEU.cjs → chunk-NPWWSCWT.cjs} +35 -35
- package/dist/{chunk-DOZ6F2K2.js → chunk-NSETJI74.js} +3 -2
- package/dist/{chunk-PE6YJMQT.cjs → chunk-PFHJS4HE.cjs} +20 -19
- package/dist/{chunk-7KNW3WXZ.cjs → chunk-QEVLRLUN.cjs} +63 -0
- package/dist/{chunk-LK4SXL3V.js → chunk-QNY7BDFP.js} +1 -1
- package/dist/{chunk-OTN6VB5S.cjs → chunk-RDFHWAHL.cjs} +5 -1
- package/dist/{chunk-PXDIAYB6.cjs → chunk-STLTOISW.cjs} +34 -214
- package/dist/{chunk-T2LDTEXK.js → chunk-UVTO3D4E.js} +2333 -58
- package/dist/{chunk-6JL2D5SG.js → chunk-VE6UKYQ2.js} +3 -2
- package/dist/{chunk-TXFWZ5ZJ.js → chunk-W6JDUXP3.js} +4 -184
- package/dist/{chunk-3SBLVGOM.cjs → chunk-YOVXQHA3.cjs} +23 -23
- package/dist/{chunk-WLUVZKVD.cjs → chunk-YXP6X3SY.cjs} +103 -36
- 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 +868 -864
- package/dist/image-editor/index.js +123 -119
- package/dist/paint/index.cjs +8 -6
- package/dist/paint/index.js +56 -54
- package/dist/paint-editor/brush-library-tools.d.cts +12 -2
- package/dist/paint-editor/brush-library-tools.d.ts +12 -2
- package/dist/paint-editor/brush-model.d.cts +29 -1
- package/dist/paint-editor/brush-model.d.ts +29 -1
- package/dist/paint-editor/brush-source-art.d.cts +32 -0
- package/dist/paint-editor/brush-source-art.d.ts +32 -0
- package/dist/paint-editor/controller.d.cts +11 -4
- package/dist/paint-editor/controller.d.ts +11 -4
- package/dist/paint-editor/dab-stroke.d.cts +2 -0
- package/dist/paint-editor/dab-stroke.d.ts +2 -0
- package/dist/paint-editor/engine.d.cts +11 -2
- package/dist/paint-editor/engine.d.ts +11 -2
- package/dist/paint-editor/index.cjs +967 -2335
- package/dist/paint-editor/index.d.cts +3 -1
- package/dist/paint-editor/index.d.ts +3 -1
- package/dist/paint-editor/index.js +394 -1762
- 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/paint-editor/stamp-tip.d.cts +8 -5
- package/dist/paint-editor/stamp-tip.d.ts +8 -5
- package/dist/paint-editor/thumbnails.d.cts +6 -0
- package/dist/paint-editor/thumbnails.d.ts +6 -0
- package/dist/paint-editor/tip-grain.d.cts +34 -0
- package/dist/paint-editor/tip-grain.d.ts +34 -0
- package/dist/raster/index.cjs +2 -2
- package/dist/raster/index.js +9 -9
- 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 +1850 -1390
- package/dist/vector/index.d.cts +2 -0
- package/dist/vector/index.d.ts +2 -0
- package/dist/vector/index.js +520 -60
- 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 +37 -10
- package/skills/pixerate-brushes-design/SKILL.md +15 -5
- 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 +14 -4
- package/skills/pixerate-paint-editor/references/brush-facets.md +3 -1
- package/skills/pixerate-paint-editor/references/wet-media.md +9 -0
- package/skills/pixerate-paint-sketch-to-finish/SKILL.md +1 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createVectorMorph
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-QNY7BDFP.js";
|
|
4
4
|
import {
|
|
5
5
|
MOTION_ISSUE_CODES,
|
|
6
6
|
motionIssue,
|
|
@@ -39,9 +39,9 @@ import {
|
|
|
39
39
|
vectorNodeBounds,
|
|
40
40
|
vectorPathWorldBezier,
|
|
41
41
|
vectorTextHasOutlines
|
|
42
|
-
} from "../chunk-
|
|
43
|
-
import "../chunk-
|
|
44
|
-
import "../chunk-
|
|
42
|
+
} from "../chunk-UVTO3D4E.js";
|
|
43
|
+
import "../chunk-KZI3YWKW.js";
|
|
44
|
+
import "../chunk-JL6YH5WD.js";
|
|
45
45
|
import "../chunk-M6DNZNVY.js";
|
|
46
46
|
import {
|
|
47
47
|
bezierPathLength,
|
|
@@ -74,12 +74,13 @@ import {
|
|
|
74
74
|
resolveEffectValues
|
|
75
75
|
} from "../chunk-MV7CYFMJ.js";
|
|
76
76
|
import "../chunk-V2ZCJRDM.js";
|
|
77
|
-
import "../chunk-
|
|
78
|
-
import "../chunk-
|
|
77
|
+
import "../chunk-GSTSZPSR.js";
|
|
78
|
+
import "../chunk-W6JDUXP3.js";
|
|
79
|
+
import "../chunk-ACTHSQOI.js";
|
|
79
80
|
import "../chunk-4D6KP5BV.js";
|
|
80
81
|
import "../chunk-ODBT55Q7.js";
|
|
81
|
-
import "../chunk-OTTT5N3K.js";
|
|
82
82
|
import "../chunk-IRSTHLQQ.js";
|
|
83
|
+
import "../chunk-OTTT5N3K.js";
|
|
83
84
|
import "../chunk-HVVR5PZW.js";
|
|
84
85
|
import "../chunk-QGHEDC7B.js";
|
|
85
86
|
import "../chunk-SIFAIGB3.js";
|
|
@@ -4901,6 +4902,25 @@ var AnimationEditorController = class {
|
|
|
4901
4902
|
return { scene: { ...this.scene, shots }, label: `Apply ${d.name}`, instance, notes };
|
|
4902
4903
|
});
|
|
4903
4904
|
}
|
|
4905
|
+
async resolveVectorPath(artwork, d, path, controlName) {
|
|
4906
|
+
const controls = pathControlsOf(d);
|
|
4907
|
+
if (!controls.length) throw new Error(`"${d.id}" does not draw along a path. Find one that does with search_effects accepts ["path"] (kind vector).`);
|
|
4908
|
+
const control = controlName ?? (controls.length === 1 ? controls[0] : void 0);
|
|
4909
|
+
if (!control) throw new Error(`"${d.id}" has several path controls (${controls.join(", ")}); pass control.`);
|
|
4910
|
+
if (!controls.includes(control)) throw new Error(`"${control}" is not a path control of "${d.id}"; its path controls are ${controls.join(", ")}.`);
|
|
4911
|
+
if ("node" in path) {
|
|
4912
|
+
const entry = indexMotionNodes(artwork.nodes).get(path.node);
|
|
4913
|
+
if (!entry) throw new Error(`There is no node "${path.node}"; find_animation_elements lists the artwork's nodes.`);
|
|
4914
|
+
if (entry.node.type !== "path") throw new Error(`Node "${path.node}" is a ${entry.node.type}, not a path; pass a path node (find_animation_elements shows each node's type).`);
|
|
4915
|
+
const value2 = bezierPathToSvg(vectorPathWorldBezier(entry.node, entry.parentWorld, { effects: false }));
|
|
4916
|
+
return { control, value: value2, place: "viewBox" };
|
|
4917
|
+
}
|
|
4918
|
+
const provider = this.effects.require();
|
|
4919
|
+
if (!provider.pathFromText) throw new Error(`The effects provider "${provider.id}" cannot write words as a path; pass a path node instead.`);
|
|
4920
|
+
if (typeof path.text !== "string" || !path.text.trim()) throw new Error("text is empty; pass the words to write.");
|
|
4921
|
+
const value = await provider.pathFromText(path.text, { ...path.font ? { font: path.font } : {}, ...path.align ? { align: path.align } : {} });
|
|
4922
|
+
return { control, value };
|
|
4923
|
+
}
|
|
4904
4924
|
/**
|
|
4905
4925
|
* Adds a provider vector effect (one with its own picture: a lower third, a loader): its SVG as
|
|
4906
4926
|
* an artwork group (id: the instance) fitted into `box` (default the whole artwork), and its
|
|
@@ -4912,25 +4932,9 @@ var AnimationEditorController = class {
|
|
|
4912
4932
|
let given = options.values;
|
|
4913
4933
|
let place = options.box;
|
|
4914
4934
|
if (options.path) {
|
|
4915
|
-
const
|
|
4916
|
-
if (
|
|
4917
|
-
|
|
4918
|
-
if (!control) throw new Error(`"${d.id}" has several path controls (${controls.join(", ")}); pass control.`);
|
|
4919
|
-
if (!controls.includes(control)) throw new Error(`"${control}" is not a path control of "${d.id}"; its path controls are ${controls.join(", ")}.`);
|
|
4920
|
-
let value;
|
|
4921
|
-
if ("node" in options.path) {
|
|
4922
|
-
const entry = indexMotionNodes(this.scene.artwork.nodes).get(options.path.node);
|
|
4923
|
-
if (!entry) throw new Error(`There is no node "${options.path.node}"; find_animation_elements lists the artwork's nodes.`);
|
|
4924
|
-
if (entry.node.type !== "path") throw new Error(`Node "${options.path.node}" is a ${entry.node.type}, not a path; pass a path node (find_animation_elements shows each node's type).`);
|
|
4925
|
-
value = bezierPathToSvg(vectorPathWorldBezier(entry.node, entry.parentWorld, { effects: false }));
|
|
4926
|
-
place ??= "viewBox";
|
|
4927
|
-
} else {
|
|
4928
|
-
const provider = this.effects.require();
|
|
4929
|
-
if (!provider.pathFromText) throw new Error(`The effects provider "${provider.id}" cannot write words as a path; pass a path node instead.`);
|
|
4930
|
-
if (typeof options.path.text !== "string" || !options.path.text.trim()) throw new Error("text is empty; pass the words to write.");
|
|
4931
|
-
value = await provider.pathFromText(options.path.text, { ...options.path.font ? { font: options.path.font } : {}, ...options.path.align ? { align: options.path.align } : {} });
|
|
4932
|
-
}
|
|
4933
|
-
given = { ...given ?? {}, [control]: value };
|
|
4935
|
+
const resolved = await this.resolveVectorPath(this.scene.artwork, d, options.path, options.control);
|
|
4936
|
+
if (resolved.place) place ??= resolved.place;
|
|
4937
|
+
given = { ...given ?? {}, [resolved.control]: resolved.value };
|
|
4934
4938
|
}
|
|
4935
4939
|
const values = resolveEffectValues(d, given);
|
|
4936
4940
|
const instance = options.instance ?? nextMotionEffectInstance(this.scene);
|
|
@@ -4940,6 +4944,33 @@ var AnimationEditorController = class {
|
|
|
4940
4944
|
return { scene: { ...this.scene, artwork: { ...this.scene.artwork, nodes: [...this.scene.artwork.nodes, group] }, shots: [...this.scene.shots, ...shots] }, label: `Add ${d.name}`, instance, notes };
|
|
4941
4945
|
});
|
|
4942
4946
|
}
|
|
4947
|
+
/**
|
|
4948
|
+
* Sets an applied vector effect's path from a path node in the artwork (landing on the node at
|
|
4949
|
+
* scale 1) or words written by the provider (keeping where the picture was placed). One undo step.
|
|
4950
|
+
*/
|
|
4951
|
+
setVectorEffectPath(instance, path, options = {}) {
|
|
4952
|
+
return this.effectEdit(async () => {
|
|
4953
|
+
const was = motionSceneEffects(this.scene).find((e) => e.instance === instance);
|
|
4954
|
+
if (!was) throw new Error(`There is no applied effect "${instance}"; list_applied_effects lists them.`);
|
|
4955
|
+
if (was.kind !== "vector") throw new Error(`"${instance}" is a motion effect, not a vector effect.`);
|
|
4956
|
+
const d = await this.describeFor(was.effect, ["vector"]);
|
|
4957
|
+
const { scene: bare } = withoutMotionEffect(this.scene, instance);
|
|
4958
|
+
const { control, value, place } = await this.resolveVectorPath(bare.artwork, d, path, options.control);
|
|
4959
|
+
const merged = { ...was.values, [control]: value };
|
|
4960
|
+
const provider = this.effects.require();
|
|
4961
|
+
const source = { instance, effect: d.id, provider: provider.id, name: d.name, values: merged };
|
|
4962
|
+
const motion = await provider.applyVectorEffect(d.id, motionArtworkSvg(bare.artwork), merged);
|
|
4963
|
+
const { group, shots, notes } = motionPartsFromVectorEffect(bare.artwork, motion, source, place);
|
|
4964
|
+
const old = this.scene.artwork.nodes.find((n2) => n2.id === instance);
|
|
4965
|
+
const index = this.scene.artwork.nodes.findIndex((n2) => n2.id === instance);
|
|
4966
|
+
const nodes = [...bare.artwork.nodes];
|
|
4967
|
+
nodes.splice(Math.max(0, index), 0, !place && old?.transform ? { ...group, transform: old.transform } : group);
|
|
4968
|
+
const at = this.scene.shots.findIndex((s) => was.shots.includes(s.id));
|
|
4969
|
+
const kept = bare.shots;
|
|
4970
|
+
const nextShots = [...kept.slice(0, Math.max(0, at)), ...shots, ...kept.slice(Math.max(0, at))];
|
|
4971
|
+
return { scene: { ...bare, artwork: { ...bare.artwork, nodes }, shots: nextShots }, label: `Set ${d.name} path`, instance, notes };
|
|
4972
|
+
});
|
|
4973
|
+
}
|
|
4943
4974
|
/**
|
|
4944
4975
|
* Makes an applied effect again with new `values` (merged over its own; `null` resets a
|
|
4945
4976
|
* control), in the same place. One undo step.
|
|
@@ -7239,7 +7270,7 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
|
|
|
7239
7270
|
{
|
|
7240
7271
|
name: "add_vector_effect",
|
|
7241
7272
|
title: "Add a vector effect",
|
|
7242
|
-
description: 'Adds a provider vector effect that brings its own picture (search_effects with kind vector: lower thirds, loaders, stickers): its SVG becomes an artwork group, fitted into box (default the whole artwork), and its motion becomes shots after the last one. For an effect that draws along a path (search_effects accepts ["path"]: a signature, a route), pass path: { node } to run it along a path node (its outline with every transform applied; the picture then lands on the node at scale 1 unless box is given) or { text } for words the provider writes. Use it instead of follow or draw-on when the effect itself should trace the path. The path is copied when added;
|
|
7273
|
+
description: 'Adds a provider vector effect that brings its own picture (search_effects with kind vector: lower thirds, loaders, stickers): its SVG becomes an artwork group, fitted into box (default the whole artwork), and its motion becomes shots after the last one. For an effect that draws along a path (search_effects accepts ["path"]: a signature, a route), pass path: { node } to run it along a path node (its outline with every transform applied; the picture then lands on the node at scale 1 unless box is given) or { text } for words the provider writes. Use it instead of follow or draw-on when the effect itself should trace the path. The path is copied when added; after reshaping the node, give it the path again with set_vector_effect_path. Change it with update_effect (target and effect: the returned instance) or remove it with remove_effect. One undo step. Returns the instance, the group id and any notes on what could not be carried over.',
|
|
7243
7274
|
inputSchema: {
|
|
7244
7275
|
type: "object",
|
|
7245
7276
|
properties: {
|
|
@@ -7283,6 +7314,42 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
|
|
|
7283
7314
|
if (!r.ok) throw new Error(r.error);
|
|
7284
7315
|
return { instance: r.effect.instance, group: r.effect.group, effect: info(r.effect), ...r.notes.length ? { notes: r.notes } : {} };
|
|
7285
7316
|
}
|
|
7317
|
+
},
|
|
7318
|
+
{
|
|
7319
|
+
name: "set_vector_effect_path",
|
|
7320
|
+
title: "Run a vector effect along a path",
|
|
7321
|
+
description: 'Gives a vector effect already added with add_vector_effect (instance: its id from add_vector_effect or list_applied_effects) a new path to draw along, in place: path: { node } runs it along a path node (its outline with every transform applied) and lands the picture on the node at scale 1; { text } writes words with the provider and keeps the picture where it was. Use it after reshaping the node the effect was run along, or to switch between a node and words. To clear the path, call update_effect with the path control set to "". Refuses a motion effect, an effect without a path control, an unknown or non-path node, and a provider that cannot write words, saying what to pass. One undo step. Returns the instance, the control set, its new path data and any notes.',
|
|
7322
|
+
inputSchema: {
|
|
7323
|
+
type: "object",
|
|
7324
|
+
properties: {
|
|
7325
|
+
instance: { type: "string", minLength: 1, description: "The applied vector effect id (add_vector_effect instance, or list_applied_effects)." },
|
|
7326
|
+
path: {
|
|
7327
|
+
type: "object",
|
|
7328
|
+
description: "The path the effect draws along: { node } or { text }.",
|
|
7329
|
+
properties: {
|
|
7330
|
+
node: { type: "string", minLength: 1, description: "A path node id (find_animation_elements)." },
|
|
7331
|
+
text: { type: "string", minLength: 1, description: "Words the provider writes as a single-stroke path." },
|
|
7332
|
+
font: { type: "string", minLength: 1, description: "With text: a single-stroke font the provider offers (default its first)." },
|
|
7333
|
+
align: { type: "string", enum: ["start", "middle", "end"], description: "With text: where the line sits (default start)." }
|
|
7334
|
+
},
|
|
7335
|
+
oneOf: [{ required: ["node"] }, { required: ["text"] }],
|
|
7336
|
+
additionalProperties: false
|
|
7337
|
+
},
|
|
7338
|
+
control: { type: "string", minLength: 1, description: "Which path control takes the path (default the effect's only one; describe_effect pathControls lists them)." }
|
|
7339
|
+
},
|
|
7340
|
+
required: ["instance", "path"],
|
|
7341
|
+
additionalProperties: false
|
|
7342
|
+
},
|
|
7343
|
+
annotations: { title: "Run a vector effect along a path", ...ctx.annotations.write, idempotentHint: true },
|
|
7344
|
+
handler: async (args) => {
|
|
7345
|
+
ctx.requireProvider();
|
|
7346
|
+
if (args.path.node !== void 0 && args.path.text !== void 0) throw new Error("Pass path as { node } or { text }, not both.");
|
|
7347
|
+
const path = args.path.node !== void 0 ? { node: args.path.node } : { text: args.path.text, font: args.path.font, align: args.path.align };
|
|
7348
|
+
const r = await controller.setVectorEffectPath(args.instance, path, { control: args.control });
|
|
7349
|
+
if (!r.ok) throw new Error(r.error);
|
|
7350
|
+
const control = args.control ?? pathControlsOf(await controller.effectsProvider.describe(r.effect.effect))[0];
|
|
7351
|
+
return { instance: r.effect.instance, group: r.effect.group, control, value: r.effect.values[control], effect: info(r.effect), ...r.notes.length ? { notes: r.notes } : {} };
|
|
7352
|
+
}
|
|
7286
7353
|
}
|
|
7287
7354
|
]
|
|
7288
7355
|
}), options.playbackSurface);
|