@pixerate/editor 0.231.1 → 0.232.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/animation-editor/index.cjs +25 -25
- package/dist/animation-editor/index.js +1 -1
- package/dist/canvas/index.cjs +7 -7
- package/dist/canvas/index.js +1 -1
- package/dist/{chunk-OPSK22DL.cjs → chunk-2K5TELHV.cjs} +19 -2
- package/dist/{chunk-CSM5T6SE.js → chunk-6QLTUGMO.js} +1 -1
- package/dist/{chunk-5T3H7CGG.cjs → chunk-A653N65Q.cjs} +7 -7
- package/dist/{chunk-SBPGIZQN.js → chunk-MUSZYMBX.js} +1 -1
- package/dist/{chunk-TCZ2J7PR.js → chunk-PQYDJ2AV.js} +18 -1
- package/dist/{chunk-C73U5UI3.cjs → chunk-RG4O6K2A.cjs} +14 -14
- package/dist/effects/conformance.d.cts +4 -1
- package/dist/effects/conformance.d.ts +4 -1
- package/dist/effects/errors.d.cts +6 -1
- package/dist/effects/errors.d.ts +6 -1
- package/dist/effects/fake-templates.d.cts +17 -0
- package/dist/effects/fake-templates.d.ts +17 -0
- package/dist/effects/fake.d.cts +6 -1
- package/dist/effects/fake.d.ts +6 -1
- package/dist/effects/index.cjs +537 -74
- package/dist/effects/index.d.cts +1 -0
- package/dist/effects/index.d.ts +1 -0
- package/dist/effects/index.js +466 -3
- package/dist/effects/templates.d.cts +56 -0
- package/dist/effects/templates.d.ts +56 -0
- package/dist/effects/types.d.cts +212 -0
- package/dist/effects/types.d.ts +212 -0
- package/dist/image-editor/index.cjs +13 -13
- package/dist/image-editor/index.js +1 -1
- package/dist/paint-editor/index.cjs +7 -7
- package/dist/paint-editor/index.js +2 -2
- package/dist/vector/index.cjs +6 -6
- package/dist/vector/index.js +1 -1
- package/dist/video-editor/index.cjs +329 -329
- package/dist/video-editor/index.js +3 -3
- package/package.json +1 -1
- package/skills/pixerate-animation-editor/SKILL.md +37 -0
|
@@ -54,7 +54,7 @@ require('../chunk-NM3G4VQT.cjs');
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
var
|
|
57
|
+
var _chunk2K5TELHVcjs = require('../chunk-2K5TELHV.cjs');
|
|
58
58
|
require('../chunk-WOFXZ3XU.cjs');
|
|
59
59
|
require('../chunk-PQ3H2AAN.cjs');
|
|
60
60
|
require('../chunk-YQGCPL5X.cjs');
|
|
@@ -1053,8 +1053,8 @@ function compileMotionScene(scene) {
|
|
|
1053
1053
|
const start = t;
|
|
1054
1054
|
let cursor = start;
|
|
1055
1055
|
const f = motionShotTimeScale(shot);
|
|
1056
|
-
const moveIn = shot.camera ?
|
|
1057
|
-
const moveDuring = shot.camera ?
|
|
1056
|
+
const moveIn = shot.camera ? _chunk2K5TELHVcjs.cameraMoveParts.call(void 0, shot.camera.in) : void 0;
|
|
1057
|
+
const moveDuring = shot.camera ? _chunk2K5TELHVcjs.cameraMoveParts.call(void 0, shot.camera.during) : void 0;
|
|
1058
1058
|
let playsIn = false;
|
|
1059
1059
|
if (shot.camera) {
|
|
1060
1060
|
const framed = motionCameraFramed(shot.camera);
|
|
@@ -1422,7 +1422,7 @@ function motionShotAt(timeline, time) {
|
|
|
1422
1422
|
// src/animation-editor/camera.ts
|
|
1423
1423
|
var windowCache = /* @__PURE__ */ new WeakMap();
|
|
1424
1424
|
function motionShotCameraMove(shot, role) {
|
|
1425
|
-
return
|
|
1425
|
+
return _chunk2K5TELHVcjs.cameraMoveParts.call(void 0, _optionalChain([shot, 'optionalAccess', _55 => _55.camera, 'optionalAccess', _56 => _56[role === "transition" ? "in" : "during"]]));
|
|
1426
1426
|
}
|
|
1427
1427
|
var motionCameraStage = (scene) => ({ width: scene.artwork.width, height: scene.artwork.height });
|
|
1428
1428
|
var effectsPlayCamera = (provider) => !!provider && provider.capabilities.supportsCamera === true && typeof provider.cameraView === "function";
|
|
@@ -1444,7 +1444,7 @@ function motionCameraWindows(scene, provider) {
|
|
|
1444
1444
|
const track = timeline.tracks.get(motionTrackKey("", "camera"));
|
|
1445
1445
|
const boxView = (t) => {
|
|
1446
1446
|
const b = trackValue(track, t);
|
|
1447
|
-
return
|
|
1447
|
+
return _chunk2K5TELHVcjs.cameraViewOfBox.call(void 0, Array.isArray(b) ? { x: b[0], y: b[1], width: b[2], height: b[3] } : full, stage);
|
|
1448
1448
|
};
|
|
1449
1449
|
const view = (move, values, from, to, u, ms2) => {
|
|
1450
1450
|
try {
|
|
@@ -1460,7 +1460,7 @@ function motionCameraWindows(scene, provider) {
|
|
|
1460
1460
|
const eases = timing.commandsStart > timing.start && !!_optionalChain([track, 'optionalAccess', _57 => _57.some, 'call', _58 => _58((seg) => seg.shot === timing.id)]);
|
|
1461
1461
|
const framed = !!_optionalChain([track, 'optionalAccess', _59 => _59.some, 'call', _60 => _60((seg) => seg.shot === timing.id)]);
|
|
1462
1462
|
if (timing.cameraIn && timing.commandsStart > timing.start) {
|
|
1463
|
-
const spec =
|
|
1463
|
+
const spec = _chunk2K5TELHVcjs.cameraMoveParts.call(void 0, _optionalChain([shot, 'access', _61 => _61.camera, 'optionalAccess', _62 => _62.in]));
|
|
1464
1464
|
const from = _nullishCoalesce(carry, () => ( boxView(timing.start)));
|
|
1465
1465
|
const to = boxView(timing.commandsStart);
|
|
1466
1466
|
if (view(spec.move, spec.values, from, to, 0, timing.commandsStart - timing.start)) {
|
|
@@ -1472,7 +1472,7 @@ function motionCameraWindows(scene, provider) {
|
|
|
1472
1472
|
carry = null;
|
|
1473
1473
|
} else if (framed) carry = null;
|
|
1474
1474
|
if (timing.cameraDuring && timing.end > timing.commandsEnd) {
|
|
1475
|
-
const spec =
|
|
1475
|
+
const spec = _chunk2K5TELHVcjs.cameraMoveParts.call(void 0, _optionalChain([shot, 'access', _63 => _63.camera, 'optionalAccess', _64 => _64.during]));
|
|
1476
1476
|
const from = _nullishCoalesce(carry, () => ( boxView(timing.commandsEnd)));
|
|
1477
1477
|
const ms2 = timing.end - timing.commandsEnd;
|
|
1478
1478
|
const last = view(spec.move, spec.values, from, from, 1, ms2);
|
|
@@ -1489,8 +1489,8 @@ var lerp = (a, b, t) => a + (b - a) * t;
|
|
|
1489
1489
|
var smooth = (t) => t * t * (3 - 2 * t);
|
|
1490
1490
|
function easeViews(from, to, u, stage) {
|
|
1491
1491
|
const k = smooth(Math.min(1, Math.max(0, u)));
|
|
1492
|
-
const a =
|
|
1493
|
-
const b =
|
|
1492
|
+
const a = _chunk2K5TELHVcjs.cameraBoxOfView.call(void 0, from, stage);
|
|
1493
|
+
const b = _chunk2K5TELHVcjs.cameraBoxOfView.call(void 0, to, stage);
|
|
1494
1494
|
const zoom = from.zoom * Math.pow(to.zoom / from.zoom, k);
|
|
1495
1495
|
const cx = lerp(a.x + a.width / 2, b.x + b.width / 2, k);
|
|
1496
1496
|
const cy = lerp(a.y + a.height / 2, b.y + b.height / 2, k);
|
|
@@ -1522,7 +1522,7 @@ function motionCameraViewAt(scene, time, provider) {
|
|
|
1522
1522
|
return retaken ? null : before.after;
|
|
1523
1523
|
}
|
|
1524
1524
|
function motionCameraBox(view, scene) {
|
|
1525
|
-
return
|
|
1525
|
+
return _chunk2K5TELHVcjs.cameraBoxOfView.call(void 0, view, motionCameraStage(scene));
|
|
1526
1526
|
}
|
|
1527
1527
|
function motionCameraTransform(view, width) {
|
|
1528
1528
|
if (!view || !view.tilt && !view.turn) return "";
|
|
@@ -1563,7 +1563,7 @@ async function checkMotionCameraMoves(scene, provider) {
|
|
|
1563
1563
|
const spec = shot.camera[field];
|
|
1564
1564
|
if (spec === void 0) continue;
|
|
1565
1565
|
try {
|
|
1566
|
-
await
|
|
1566
|
+
await _chunk2K5TELHVcjs.resolveCameraMoveSpec.call(void 0, provider, spec, role);
|
|
1567
1567
|
} catch (error) {
|
|
1568
1568
|
const code = error.code === "invalid_values" || /preset/.test(error.message) ? "camera-move-values" : "camera-move-unknown";
|
|
1569
1569
|
issues.push(_chunkERJA5CGTcjs.motionIssue.call(void 0, code, error.message, { shot: shot.id }));
|
|
@@ -2910,7 +2910,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2910
2910
|
if (w) return `${w.move}@${w.shot}`;
|
|
2911
2911
|
const seg = camera.find((x) => t >= x.start - 1e-6 && t < Math.max(x.end, x.start + 1e-3));
|
|
2912
2912
|
const shot = seg ? scene.shots.find((x) => x.id === seg.shot) : void 0;
|
|
2913
|
-
const move = _optionalChain([
|
|
2913
|
+
const move = _optionalChain([_chunk2K5TELHVcjs.cameraMoveParts.call(void 0, _optionalChain([shot, 'optionalAccess', _134 => _134.camera, 'optionalAccess', _135 => _135.in])), 'optionalAccess', _136 => _136.move]);
|
|
2914
2914
|
return move && shot ? `${move}@${shot.id}` : void 0;
|
|
2915
2915
|
};
|
|
2916
2916
|
const unplayed = scene.shots.filter((x) => x.camera && (x.camera.in !== void 0 || x.camera.during !== void 0) && !windows.some((w) => w.shot === x.id));
|
|
@@ -4078,7 +4078,7 @@ var AnimationEditorController = (_class = class {
|
|
|
4078
4078
|
|
|
4079
4079
|
|
|
4080
4080
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
4081
|
-
__init() {this.effects = new (0,
|
|
4081
|
+
__init() {this.effects = new (0, _chunk2K5TELHVcjs.EffectsSlot)()}
|
|
4082
4082
|
|
|
4083
4083
|
|
|
4084
4084
|
__init2() {this.selection = null}
|
|
@@ -4263,7 +4263,7 @@ var AnimationEditorController = (_class = class {
|
|
|
4263
4263
|
try {
|
|
4264
4264
|
plan = await work();
|
|
4265
4265
|
} catch (error) {
|
|
4266
|
-
if (
|
|
4266
|
+
if (_chunk2K5TELHVcjs.isEffectError.call(void 0, error) || error instanceof Error) return this.refuse(error.message);
|
|
4267
4267
|
throw error;
|
|
4268
4268
|
}
|
|
4269
4269
|
const r = this.apply({ op: "replace_scene", scene: plan.scene }, plan.label, { merge });
|
|
@@ -4274,11 +4274,11 @@ var AnimationEditorController = (_class = class {
|
|
|
4274
4274
|
}
|
|
4275
4275
|
async describeFor(effect, kinds) {
|
|
4276
4276
|
const provider = this.effects.require();
|
|
4277
|
-
if (!provider.applyVectorEffect) throw new (0,
|
|
4277
|
+
if (!provider.applyVectorEffect) throw new (0, _chunk2K5TELHVcjs.EffectUnsupportedError)(`${provider.name} has no vector or motion effects.`);
|
|
4278
4278
|
const d = await provider.describe(effect);
|
|
4279
4279
|
if (!kinds.includes(d.kind)) {
|
|
4280
4280
|
const hint = d.kind === "motion" ? "apply it to nodes with apply_effect" : d.kind === "vector" ? "add it with add_vector_effect" : "it draws pixels, which scenes cannot hold";
|
|
4281
|
-
throw new (0,
|
|
4281
|
+
throw new (0, _chunk2K5TELHVcjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) is a ${d.kind} effect: ${hint}.`, d.id);
|
|
4282
4282
|
}
|
|
4283
4283
|
return d;
|
|
4284
4284
|
}
|
|
@@ -4299,7 +4299,7 @@ var AnimationEditorController = (_class = class {
|
|
|
4299
4299
|
return this.effectEdit(async () => {
|
|
4300
4300
|
this.knownNodes(targets);
|
|
4301
4301
|
const d = await this.describeFor(effect, ["motion"]);
|
|
4302
|
-
const values =
|
|
4302
|
+
const values = _chunk2K5TELHVcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4303
4303
|
const instance = _nullishCoalesce(options.instance, () => ( nextMotionEffectInstance(this.scene)));
|
|
4304
4304
|
const motion = await this.effects.require().applyVectorEffect(d.id, { svg: motionArtworkSvg(this.scene.artwork), nodeIds: [...targets] }, values);
|
|
4305
4305
|
const source = { instance, effect: d.id, provider: this.effects.require().id, name: d.name, values };
|
|
@@ -4321,7 +4321,7 @@ var AnimationEditorController = (_class = class {
|
|
|
4321
4321
|
addVectorEffect(effect, options = {}) {
|
|
4322
4322
|
return this.effectEdit(async () => {
|
|
4323
4323
|
const d = await this.describeFor(effect, ["vector"]);
|
|
4324
|
-
const values =
|
|
4324
|
+
const values = _chunk2K5TELHVcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4325
4325
|
const instance = _nullishCoalesce(options.instance, () => ( nextMotionEffectInstance(this.scene)));
|
|
4326
4326
|
const motion = await this.effects.require().applyVectorEffect(d.id, motionArtworkSvg(this.scene.artwork), values);
|
|
4327
4327
|
const source = { instance, effect: d.id, provider: this.effects.require().id, name: d.name, values };
|
|
@@ -4345,7 +4345,7 @@ var AnimationEditorController = (_class = class {
|
|
|
4345
4345
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4346
4346
|
else throw new Error(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4347
4347
|
}
|
|
4348
|
-
const merged = { ...base, ...
|
|
4348
|
+
const merged = { ...base, ..._chunk2K5TELHVcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4349
4349
|
const { scene: bare, place } = withoutMotionEffect(this.scene, instance);
|
|
4350
4350
|
const provider = this.effects.require();
|
|
4351
4351
|
const source = { instance, effect: d.id, provider: provider.id, name: d.name, values: merged };
|
|
@@ -4400,12 +4400,12 @@ var AnimationEditorController = (_class = class {
|
|
|
4400
4400
|
if (!found) return this.refuse(`There is no shot "${shot}"; the shots are ${this.scene.shots.map((s) => `"${s.id}"`).join(", ") || "none yet"}.`);
|
|
4401
4401
|
let resolved;
|
|
4402
4402
|
try {
|
|
4403
|
-
resolved = await
|
|
4403
|
+
resolved = await _chunk2K5TELHVcjs.resolveCameraMoveSpec.call(void 0, this.effects.require(), spec, role);
|
|
4404
4404
|
} catch (error) {
|
|
4405
|
-
if (
|
|
4405
|
+
if (_chunk2K5TELHVcjs.isEffectError.call(void 0, error) || error instanceof Error) return this.refuse(error.message);
|
|
4406
4406
|
throw error;
|
|
4407
4407
|
}
|
|
4408
|
-
const field =
|
|
4408
|
+
const field = _chunk2K5TELHVcjs.cameraMoveField.call(void 0, role);
|
|
4409
4409
|
const current = this.scene.shots.find((s) => s.id === shot);
|
|
4410
4410
|
if (!current) return this.refuse(`Shot "${shot}" was removed while the move was checked.`);
|
|
4411
4411
|
const parts = role === "transition" && resolved.spec.ms === void 0 ? { ...resolved.spec, ms: resolved.description.camera.durationMs } : resolved.spec;
|
|
@@ -4419,7 +4419,7 @@ var AnimationEditorController = (_class = class {
|
|
|
4419
4419
|
clearShotCameraMove(shot, role) {
|
|
4420
4420
|
const found = this.scene.shots.find((s) => s.id === shot);
|
|
4421
4421
|
if (!found) return this.refuse(`There is no shot "${shot}"; the shots are ${this.scene.shots.map((s) => `"${s.id}"`).join(", ") || "none yet"}.`);
|
|
4422
|
-
const field =
|
|
4422
|
+
const field = _chunk2K5TELHVcjs.cameraMoveField.call(void 0, role);
|
|
4423
4423
|
if (_optionalChain([found, 'access', _185 => _185.camera, 'optionalAccess', _186 => _186[field]]) === void 0) return this.refuse(`Shot "${shot}" has no camera "${field}" move to clear${_optionalChain([found, 'access', _187 => _187.camera, 'optionalAccess', _188 => _188[field === "in" ? "during" : "in"]]) !== void 0 ? `; it has a "${field === "in" ? "during" : "in"}" move (role ${role === "hold" ? "transition" : "hold"})` : ""}.`);
|
|
4424
4424
|
const rest = { ...found.camera };
|
|
4425
4425
|
delete rest[field];
|
|
@@ -6199,7 +6199,7 @@ function animationCameraMoveTools(controller, ctx) {
|
|
|
6199
6199
|
shot: { type: "string", minLength: 1, description: "A shot id from get_animation." },
|
|
6200
6200
|
role: ROLE,
|
|
6201
6201
|
move: { type: "string", minLength: 1, description: "A camera move id of that role from list_camera_moves." },
|
|
6202
|
-
ms: { type: "number", minimum: 0, maximum:
|
|
6202
|
+
ms: { type: "number", minimum: 0, maximum: _chunk2K5TELHVcjs.CAMERA_MOVE_MAX_MS, description: `How long a transition takes, ms (0\u2013${_chunk2K5TELHVcjs.CAMERA_MOVE_MAX_MS}; default the move's durationMs). Not for a hold, which plays across the shot's hold.` },
|
|
6203
6203
|
preset: { type: "string", minLength: 1, description: "A preset of the move by name, from describe_effect; its values are written out on the shot." },
|
|
6204
6204
|
values: ctx.valuesSchema("Control values over the move's defaults (and the preset's), from describe_effect")
|
|
6205
6205
|
},
|
|
@@ -6241,7 +6241,7 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
|
|
|
6241
6241
|
if (!r.ok) throw new Error(r.error);
|
|
6242
6242
|
return { target, effect: info(r.effect), effects: controller.appliedEffects().filter((e) => e.targets.includes(target)).map(info), ...r.notes.length ? { notes: r.notes } : {} };
|
|
6243
6243
|
};
|
|
6244
|
-
return withAnimationPlayback(
|
|
6244
|
+
return withAnimationPlayback(_chunk2K5TELHVcjs.createEffectToolProvider.call(void 0, {
|
|
6245
6245
|
id: _nullishCoalesce(options.id, () => ( "animation-effects")),
|
|
6246
6246
|
namespace: options.namespace,
|
|
6247
6247
|
title: "Animation effects",
|
package/dist/canvas/index.cjs
CHANGED
|
@@ -220,7 +220,7 @@ var _chunkNM3G4VQTcjs = require('../chunk-NM3G4VQT.cjs');
|
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
|
|
223
|
-
var
|
|
223
|
+
var _chunk2K5TELHVcjs = require('../chunk-2K5TELHV.cjs');
|
|
224
224
|
require('../chunk-WOFXZ3XU.cjs');
|
|
225
225
|
|
|
226
226
|
|
|
@@ -11425,14 +11425,14 @@ function canvasEffectErrorReason(effect, error) {
|
|
|
11425
11425
|
}
|
|
11426
11426
|
var CANVAS_EFFECT_MISSING_PATTERN = "repeating-linear-gradient(45deg, rgba(128,128,128,0.28) 0 2px, transparent 2px 8px)";
|
|
11427
11427
|
function createCanvasEffectsController(options) {
|
|
11428
|
-
const slot = new (0,
|
|
11428
|
+
const slot = new (0, _chunk2K5TELHVcjs.EffectsSlot)();
|
|
11429
11429
|
if (options.effects) slot.set(options.effects);
|
|
11430
11430
|
const describe = async (effect, place2) => {
|
|
11431
11431
|
const d = await slot.require().describe(effect);
|
|
11432
11432
|
const allowed = CANVAS_EFFECT_PLACES[place2];
|
|
11433
11433
|
if (d.kind === "motion" || !d.uses.some((u) => allowed.includes(u))) {
|
|
11434
11434
|
const where = place2 === "transition" ? "a scene transition" : place2 === "fill" ? "a fill" : "an overlay";
|
|
11435
|
-
throw new (0,
|
|
11435
|
+
throw new (0, _chunk2K5TELHVcjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) is a ${d.uses.join(" / ")} effect and cannot be ${where}, which takes ${allowed.join(" or ")} effects; search_effects with use "${allowed[0]}" lists ones that fit.`, d.id);
|
|
11436
11436
|
}
|
|
11437
11437
|
return d;
|
|
11438
11438
|
};
|
|
@@ -11463,7 +11463,7 @@ function createCanvasEffectsController(options) {
|
|
|
11463
11463
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
11464
11464
|
else throw new Error(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
11465
11465
|
}
|
|
11466
|
-
return { ...base, ...
|
|
11466
|
+
return { ...base, ..._chunk2K5TELHVcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
11467
11467
|
};
|
|
11468
11468
|
return {
|
|
11469
11469
|
/** The provider slot. */
|
|
@@ -11497,7 +11497,7 @@ function createCanvasEffectsController(options) {
|
|
|
11497
11497
|
const mode = _nullishCoalesce(opts.mode, () => ( "fill"));
|
|
11498
11498
|
const d = await describe(effect, mode);
|
|
11499
11499
|
if (opts.opacity !== void 0 && !(opts.opacity >= 0 && opts.opacity <= 1)) throw new Error("opacity must be from 0 to 1.");
|
|
11500
|
-
const next = { effect: d.id, provider: slot.require().id, name: d.name, values:
|
|
11500
|
+
const next = { effect: d.id, provider: slot.require().id, name: d.name, values: _chunk2K5TELHVcjs.resolveEffectValues.call(void 0, d, opts.values), mode, ...opts.opacity !== void 0 && opts.opacity !== 1 ? { opacity: opts.opacity } : {} };
|
|
11501
11501
|
commit(`Add effect ${d.name}`, withEffect(nodeId, next));
|
|
11502
11502
|
return next;
|
|
11503
11503
|
},
|
|
@@ -11554,7 +11554,7 @@ function createCanvasEffectsController(options) {
|
|
|
11554
11554
|
const d = await describe(effect, "transition");
|
|
11555
11555
|
const duration = _nullishCoalesce(_nullishCoalesce(opts.duration, () => ( d.duration)), () => ( 600));
|
|
11556
11556
|
if (!(duration > 0)) throw new Error("duration must be a number of ms above 0.");
|
|
11557
|
-
const transition = { effect: d.id, provider: slot.require().id, name: d.name, values:
|
|
11557
|
+
const transition = { effect: d.id, provider: slot.require().id, name: d.name, values: _chunk2K5TELHVcjs.resolveEffectValues.call(void 0, d, opts.values), duration };
|
|
11558
11558
|
scenes2.update(sceneId, { transition });
|
|
11559
11559
|
return transition;
|
|
11560
11560
|
}
|
|
@@ -11698,7 +11698,7 @@ function createCanvasEffectsToolProvider(controller, options = {}) {
|
|
|
11698
11698
|
const once = (instance) => {
|
|
11699
11699
|
if (instance !== "effect") throw new Error('A shape node has one effect, "effect".');
|
|
11700
11700
|
};
|
|
11701
|
-
return
|
|
11701
|
+
return _chunk2K5TELHVcjs.createEffectToolProvider.call(void 0, {
|
|
11702
11702
|
id: _nullishCoalesce(options.id, () => ( "canvas-effects")),
|
|
11703
11703
|
namespace: options.namespace,
|
|
11704
11704
|
title: "Canvas effects",
|
package/dist/canvas/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkWOFXZ3XUcjs = require('./chunk-WOFXZ3XU.cjs');
|
|
4
4
|
|
|
5
5
|
// src/effects/errors.ts
|
|
6
|
-
var EFFECT_ERROR_CODES = ["unknown_effect", "invalid_values", "unsupported", "disposed", "no_provider"];
|
|
6
|
+
var EFFECT_ERROR_CODES = ["unknown_effect", "invalid_values", "unsupported", "disposed", "no_provider", "unknown_template"];
|
|
7
7
|
var EffectError = class extends Error {
|
|
8
8
|
|
|
9
9
|
|
|
@@ -24,6 +24,14 @@ var UnknownEffectError = class extends EffectError {
|
|
|
24
24
|
this.name = "UnknownEffectError";
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
+
var UnknownTemplateError = class extends EffectError {
|
|
28
|
+
|
|
29
|
+
constructor(templateId, providerName) {
|
|
30
|
+
super("unknown_template", `Unknown template "${templateId}"${providerName ? ` in ${providerName}` : ""}. Call list_templates or listTemplates() for valid ids.`);
|
|
31
|
+
this.name = "UnknownTemplateError";
|
|
32
|
+
this.templateId = templateId;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
27
35
|
var EffectControlError = class extends EffectError {
|
|
28
36
|
|
|
29
37
|
constructor(effectId, details) {
|
|
@@ -277,6 +285,10 @@ function cameraBoxOfView(view, stage) {
|
|
|
277
285
|
var EFFECT_KINDS = ["shader", "vector", "motion", "camera"];
|
|
278
286
|
var EFFECT_USES = ["filter", "transition", "generator", "overlay", "title", "motion", "interactive", "camera"];
|
|
279
287
|
var CAMERA_MOVE_ROLES = ["transition", "hold"];
|
|
288
|
+
var EFFECT_SUBJECT_KINDS = ["image", "video", "svg", "text", "slot"];
|
|
289
|
+
var EFFECT_LAYER_ROLES = ["background", "subject", "overlay"];
|
|
290
|
+
var EFFECT_TRANSITION_MS = 800;
|
|
291
|
+
var EFFECT_TEMPLATE_SLOT_TYPES = ["image", "video", "svg", "text", "color", "number"];
|
|
280
292
|
|
|
281
293
|
// src/effects/tools.ts
|
|
282
294
|
var ANNOTATIONS = {
|
|
@@ -553,4 +565,9 @@ function createEffectToolProvider(host) {
|
|
|
553
565
|
|
|
554
566
|
|
|
555
567
|
|
|
556
|
-
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
exports.EFFECT_ERROR_CODES = EFFECT_ERROR_CODES; exports.EffectError = EffectError; exports.UnknownEffectError = UnknownEffectError; exports.UnknownTemplateError = UnknownTemplateError; exports.EffectControlError = EffectControlError; exports.EffectUnsupportedError = EffectUnsupportedError; exports.EffectDisposedError = EffectDisposedError; exports.NoEffectsProviderError = NoEffectsProviderError; exports.isEffectError = isEffectError; exports.effectValueErrors = effectValueErrors; exports.resolveEffectValues = resolveEffectValues; exports.effectOffered = effectOffered; exports.normaliseEffectTag = normaliseEffectTag; exports.hasEffectTags = hasEffectTags; exports.countEffectTags = countEffectTags; exports.searchEffectSummaries = searchEffectSummaries; exports.createEffectPixels = createEffectPixels; exports.isEffectPixels = isEffectPixels; exports.srgbToLinear = srgbToLinear; exports.linearToSrgb = linearToSrgb; exports.encodeEffectFloat = encodeEffectFloat; exports.applyEffectMask = applyEffectMask; exports.EffectsSlot = EffectsSlot; exports.isCameraView = isCameraView; exports.sampleCameraViews = sampleCameraViews; exports.sampleEffectCameraMove = sampleEffectCameraMove; exports.cameraMoveField = cameraMoveField; exports.cameraMovesFor = cameraMovesFor; exports.cameraMoveIdList = cameraMoveIdList; exports.cameraMoveParts = cameraMoveParts; exports.CAMERA_MOVE_MAX_MS = CAMERA_MOVE_MAX_MS; exports.resolveCameraMoveSpec = resolveCameraMoveSpec; exports.cameraViewOfBox = cameraViewOfBox; exports.cameraBoxOfView = cameraBoxOfView; exports.EFFECT_KINDS = EFFECT_KINDS; exports.EFFECT_USES = EFFECT_USES; exports.CAMERA_MOVE_ROLES = CAMERA_MOVE_ROLES; exports.EFFECT_SUBJECT_KINDS = EFFECT_SUBJECT_KINDS; exports.EFFECT_LAYER_ROLES = EFFECT_LAYER_ROLES; exports.EFFECT_TRANSITION_MS = EFFECT_TRANSITION_MS; exports.EFFECT_TEMPLATE_SLOT_TYPES = EFFECT_TEMPLATE_SLOT_TYPES; exports.createEffectToolProvider = createEffectToolProvider;
|
|
@@ -7,7 +7,7 @@ var _chunkPY4GWSE2cjs = require('./chunk-PY4GWSE2.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk2K5TELHVcjs = require('./chunk-2K5TELHV.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkWOFXZ3XUcjs = require('./chunk-WOFXZ3XU.cjs');
|
|
@@ -1316,12 +1316,12 @@ function videoEffectLayerKey(layer, width, height) {
|
|
|
1316
1316
|
}
|
|
1317
1317
|
function mixEffectPixels(a, b, k) {
|
|
1318
1318
|
if (k >= 1) return b;
|
|
1319
|
-
const out =
|
|
1319
|
+
const out = _chunk2K5TELHVcjs.createEffectPixels.call(void 0, a.width, a.height);
|
|
1320
1320
|
for (let i = 0; i < out.data.length; i++) out.data[i] = a.data[i] + (b.data[i] - a.data[i]) * k;
|
|
1321
1321
|
return out;
|
|
1322
1322
|
}
|
|
1323
1323
|
function overEffectPixels(base, top, opacity = 1) {
|
|
1324
|
-
const out =
|
|
1324
|
+
const out = _chunk2K5TELHVcjs.createEffectPixels.call(void 0, base.width, base.height);
|
|
1325
1325
|
const o = out.data;
|
|
1326
1326
|
const b = base.data;
|
|
1327
1327
|
const t = top.data;
|
|
@@ -1366,7 +1366,7 @@ var VideoEffectsEngine = (_class2 = class {
|
|
|
1366
1366
|
__init10() {this.generation = 0}
|
|
1367
1367
|
|
|
1368
1368
|
constructor(options = {}) {;_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);
|
|
1369
|
-
this.slot = _nullishCoalesce(options.slot, () => ( new (0,
|
|
1369
|
+
this.slot = _nullishCoalesce(options.slot, () => ( new (0, _chunk2K5TELHVcjs.EffectsSlot)()));
|
|
1370
1370
|
this.maxEntries = _nullishCoalesce(options.maxEntries, () => ( 120));
|
|
1371
1371
|
this.toImage = _nullishCoalesce(options.toImage, () => ( defaultToImage));
|
|
1372
1372
|
this.pool = new (0, _chunkPY4GWSE2cjs.EffectRendererPool)({ maxRenderers: options.maxRenderers });
|
|
@@ -1508,7 +1508,7 @@ function checkVideoEffectPlace(d, place) {
|
|
|
1508
1508
|
if (d.kind === "motion" || !d.uses.some((u) => allowed.includes(u))) {
|
|
1509
1509
|
const where = place === "clip" ? "on a clip" : place === "transition" ? "as a transition" : "as an effect clip";
|
|
1510
1510
|
const instead = d.uses.includes("transition") ? "set_video_effect_transition" : d.uses.some((u) => VIDEO_EFFECT_PLACES.generator.includes(u)) ? "add_video_effect_clip" : d.uses.some((u) => u === "filter") ? "apply_effect" : null;
|
|
1511
|
-
throw new (0,
|
|
1511
|
+
throw new (0, _chunk2K5TELHVcjs.EffectUnsupportedError)(
|
|
1512
1512
|
`"${d.id}" (${d.name}) is a ${d.uses.join(" / ")} effect and cannot be used ${where}, which takes ${allowed.join(" or ")} effects${instead ? `; use ${instead} instead` : ""}. search_effects with use "${allowed[0]}" lists ones that fit.`,
|
|
1513
1513
|
d.id
|
|
1514
1514
|
);
|
|
@@ -1529,12 +1529,12 @@ function checkVideoEffectValues(d, values, options = {}) {
|
|
|
1529
1529
|
else if (type !== "number" && type !== "integer") errors.push({ path: `/${k}`, message: "only number controls can be keyframed." });
|
|
1530
1530
|
else for (const [i, key] of v.keys.entries()) for (const e of _chunkWOFXZ3XUcjs.validateJsonSchema.call(void 0, key.v, schema)) errors.push({ path: `/${k}/keys/${i}/v`, message: e.message });
|
|
1531
1531
|
}
|
|
1532
|
-
for (const e of
|
|
1532
|
+
for (const e of _chunk2K5TELHVcjs.effectValueErrors.call(void 0, d, plain)) {
|
|
1533
1533
|
const name = e.path.split("/")[1];
|
|
1534
1534
|
const about = name && _optionalChain([d, 'access', _46 => _46.controls, 'access', _47 => _47.properties, 'access', _48 => _48[name], 'optionalAccess', _49 => _49.description]);
|
|
1535
1535
|
errors.push(about ? { path: e.path, message: `${e.message} (${about})` } : e);
|
|
1536
1536
|
}
|
|
1537
|
-
if (errors.length) throw new (0,
|
|
1537
|
+
if (errors.length) throw new (0, _chunk2K5TELHVcjs.EffectControlError)(d.id, errors);
|
|
1538
1538
|
return { ..._nullishCoalesce(options.base, () => ( d.defaults)), ..._nullishCoalesce(values, () => ( {})) };
|
|
1539
1539
|
}
|
|
1540
1540
|
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-V2ZCJRDM.js";
|
|
4
4
|
|
|
5
5
|
// src/effects/errors.ts
|
|
6
|
-
var EFFECT_ERROR_CODES = ["unknown_effect", "invalid_values", "unsupported", "disposed", "no_provider"];
|
|
6
|
+
var EFFECT_ERROR_CODES = ["unknown_effect", "invalid_values", "unsupported", "disposed", "no_provider", "unknown_template"];
|
|
7
7
|
var EffectError = class extends Error {
|
|
8
8
|
code;
|
|
9
9
|
effectId;
|
|
@@ -24,6 +24,14 @@ var UnknownEffectError = class extends EffectError {
|
|
|
24
24
|
this.name = "UnknownEffectError";
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
+
var UnknownTemplateError = class extends EffectError {
|
|
28
|
+
templateId;
|
|
29
|
+
constructor(templateId, providerName) {
|
|
30
|
+
super("unknown_template", `Unknown template "${templateId}"${providerName ? ` in ${providerName}` : ""}. Call list_templates or listTemplates() for valid ids.`);
|
|
31
|
+
this.name = "UnknownTemplateError";
|
|
32
|
+
this.templateId = templateId;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
27
35
|
var EffectControlError = class extends EffectError {
|
|
28
36
|
details;
|
|
29
37
|
constructor(effectId, details) {
|
|
@@ -277,6 +285,10 @@ function cameraBoxOfView(view, stage) {
|
|
|
277
285
|
var EFFECT_KINDS = ["shader", "vector", "motion", "camera"];
|
|
278
286
|
var EFFECT_USES = ["filter", "transition", "generator", "overlay", "title", "motion", "interactive", "camera"];
|
|
279
287
|
var CAMERA_MOVE_ROLES = ["transition", "hold"];
|
|
288
|
+
var EFFECT_SUBJECT_KINDS = ["image", "video", "svg", "text", "slot"];
|
|
289
|
+
var EFFECT_LAYER_ROLES = ["background", "subject", "overlay"];
|
|
290
|
+
var EFFECT_TRANSITION_MS = 800;
|
|
291
|
+
var EFFECT_TEMPLATE_SLOT_TYPES = ["image", "video", "svg", "text", "color", "number"];
|
|
280
292
|
|
|
281
293
|
// src/effects/tools.ts
|
|
282
294
|
var ANNOTATIONS = {
|
|
@@ -519,6 +531,7 @@ export {
|
|
|
519
531
|
EFFECT_ERROR_CODES,
|
|
520
532
|
EffectError,
|
|
521
533
|
UnknownEffectError,
|
|
534
|
+
UnknownTemplateError,
|
|
522
535
|
EffectControlError,
|
|
523
536
|
EffectUnsupportedError,
|
|
524
537
|
EffectDisposedError,
|
|
@@ -552,5 +565,9 @@ export {
|
|
|
552
565
|
EFFECT_KINDS,
|
|
553
566
|
EFFECT_USES,
|
|
554
567
|
CAMERA_MOVE_ROLES,
|
|
568
|
+
EFFECT_SUBJECT_KINDS,
|
|
569
|
+
EFFECT_LAYER_ROLES,
|
|
570
|
+
EFFECT_TRANSITION_MS,
|
|
571
|
+
EFFECT_TEMPLATE_SLOT_TYPES,
|
|
555
572
|
createEffectToolProvider
|
|
556
573
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk2K5TELHVcjs = require('./chunk-2K5TELHV.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkFJ2MSI43cjs = require('./chunk-FJ2MSI43.cjs');
|
|
@@ -26,7 +26,7 @@ function documentErrors(doc, description) {
|
|
|
26
26
|
const isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
27
27
|
if (doc.values !== void 0) {
|
|
28
28
|
if (!isRecord(doc.values)) errors.push({ path: "/values", message: "must be an object of control values" });
|
|
29
|
-
else errors.push(...
|
|
29
|
+
else errors.push(..._chunk2K5TELHVcjs.effectValueErrors.call(void 0, description, doc.values).map((e) => ({ ...e, path: `/values${e.path}` })));
|
|
30
30
|
}
|
|
31
31
|
if (doc.tracks !== void 0) {
|
|
32
32
|
if (!isRecord(doc.tracks)) errors.push({ path: "/tracks", message: "must be an object of keyframe lists" });
|
|
@@ -39,7 +39,7 @@ function documentErrors(doc, description) {
|
|
|
39
39
|
kfs.forEach((kf, i) => {
|
|
40
40
|
if (!isRecord(kf)) return errors.push({ path: `${at}/${i}`, message: "must be a keyframe object" });
|
|
41
41
|
if (typeof kf.time !== "number" || !Number.isFinite(kf.time) || kf.time < 0) errors.push({ path: `${at}/${i}/time`, message: "must be a finite number of ms >= 0" });
|
|
42
|
-
errors.push(...
|
|
42
|
+
errors.push(..._chunk2K5TELHVcjs.effectValueErrors.call(void 0, description, { [control]: kf.value }).map((e) => ({ ...e, path: `${at}/${i}/value` })));
|
|
43
43
|
if (kf.easing !== void 0 && !_chunkDWJJI6RTcjs.isAnimationEasing.call(void 0, kf.easing)) errors.push({ path: `${at}/${i}/easing`, message: "is not a valid easing" });
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -49,7 +49,7 @@ function documentErrors(doc, description) {
|
|
|
49
49
|
else
|
|
50
50
|
doc.presets.forEach((p, i) => {
|
|
51
51
|
if (!isRecord(p) || typeof p.name !== "string" || !p.name) return errors.push({ path: `/presets/${i}`, message: "must have a name" });
|
|
52
|
-
errors.push(...
|
|
52
|
+
errors.push(..._chunk2K5TELHVcjs.effectValueErrors.call(void 0, description, p.values).map((e) => ({ ...e, path: `/presets/${i}/values${e.path}` })));
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
if (doc.duration !== void 0 && (typeof doc.duration !== "number" || !Number.isFinite(doc.duration) || !(doc.duration > 0))) {
|
|
@@ -170,7 +170,7 @@ async function createEffectAuthoringSession(source, options) {
|
|
|
170
170
|
if (isDocumentSource(source)) {
|
|
171
171
|
const doc = source.document;
|
|
172
172
|
if (doc.version !== 1 || !doc.effectId) {
|
|
173
|
-
throw new (0,
|
|
173
|
+
throw new (0, _chunk2K5TELHVcjs.EffectUnsupportedError)("Invalid effect authoring document: version 1 required");
|
|
174
174
|
}
|
|
175
175
|
effectId = doc.effectId;
|
|
176
176
|
initialDoc = doc;
|
|
@@ -178,15 +178,15 @@ async function createEffectAuthoringSession(source, options) {
|
|
|
178
178
|
effectId = source.effectId;
|
|
179
179
|
requestedPreset = source.preset;
|
|
180
180
|
} else {
|
|
181
|
-
throw new (0,
|
|
181
|
+
throw new (0, _chunk2K5TELHVcjs.EffectUnsupportedError)("Invalid effect authoring source");
|
|
182
182
|
}
|
|
183
183
|
const description = await provider.describe(effectId);
|
|
184
184
|
if (initialDoc) {
|
|
185
185
|
const problems = documentErrors(initialDoc, description);
|
|
186
|
-
if (problems.length) throw new (0,
|
|
186
|
+
if (problems.length) throw new (0, _chunk2K5TELHVcjs.EffectControlError)(effectId, problems);
|
|
187
187
|
}
|
|
188
188
|
if (description.kind === "motion") {
|
|
189
|
-
throw new (0,
|
|
189
|
+
throw new (0, _chunk2K5TELHVcjs.EffectUnsupportedError)("Motion effects cannot be authored as pixel effects", effectId);
|
|
190
190
|
}
|
|
191
191
|
let disposed = false;
|
|
192
192
|
let playing = false;
|
|
@@ -207,7 +207,7 @@ async function createEffectAuthoringSession(source, options) {
|
|
|
207
207
|
const found = description.presets.find((p) => p.name === requestedPreset);
|
|
208
208
|
if (!found) {
|
|
209
209
|
const validNames = description.presets.map((p) => `"${p.name}"`).join(", ");
|
|
210
|
-
throw new (0,
|
|
210
|
+
throw new (0, _chunk2K5TELHVcjs.EffectUnsupportedError)(
|
|
211
211
|
`Unknown preset "${requestedPreset}" for effect "${effectId}". Valid presets are: ${validNames || "none"}`,
|
|
212
212
|
effectId
|
|
213
213
|
);
|
|
@@ -321,7 +321,7 @@ async function createEffectAuthoringSession(source, options) {
|
|
|
321
321
|
if (!validNames.includes(name)) {
|
|
322
322
|
return { ok: false, message: `there is no control "${name}"; the controls are ${validNames.join(", ")}` };
|
|
323
323
|
}
|
|
324
|
-
const errors =
|
|
324
|
+
const errors = _chunk2K5TELHVcjs.effectValueErrors.call(void 0, description, { [name]: value });
|
|
325
325
|
if (errors.length > 0) {
|
|
326
326
|
return { ok: false, message: valueErrorMessage(errors) };
|
|
327
327
|
}
|
|
@@ -391,7 +391,7 @@ async function createEffectAuthoringSession(source, options) {
|
|
|
391
391
|
if (!validNames.includes(k)) {
|
|
392
392
|
return { ok: false, message: `there is no control "${k}"; the controls are ${validNames.join(", ")}` };
|
|
393
393
|
}
|
|
394
|
-
const errors =
|
|
394
|
+
const errors = _chunk2K5TELHVcjs.effectValueErrors.call(void 0, description, { [k]: v });
|
|
395
395
|
if (errors.length > 0) {
|
|
396
396
|
return { ok: false, message: valueErrorMessage(errors) };
|
|
397
397
|
}
|
|
@@ -528,7 +528,7 @@ async function createEffectAuthoringSession(source, options) {
|
|
|
528
528
|
return { ok: false, message: `invalid easing: ${String(easing)}` };
|
|
529
529
|
}
|
|
530
530
|
const targetValue = value !== void 0 ? value : valuesAtTime(time, baseValues, tracks)[name];
|
|
531
|
-
const errors =
|
|
531
|
+
const errors = _chunk2K5TELHVcjs.effectValueErrors.call(void 0, description, { [name]: targetValue });
|
|
532
532
|
if (errors.length > 0) {
|
|
533
533
|
return { ok: false, message: valueErrorMessage(errors) };
|
|
534
534
|
}
|
|
@@ -705,7 +705,7 @@ async function createEffectAuthoringSession(source, options) {
|
|
|
705
705
|
},
|
|
706
706
|
async createPreview(opts) {
|
|
707
707
|
if (disposed) {
|
|
708
|
-
throw new (0,
|
|
708
|
+
throw new (0, _chunk2K5TELHVcjs.EffectDisposedError)(effectId);
|
|
709
709
|
}
|
|
710
710
|
let renderer;
|
|
711
711
|
try {
|
|
@@ -730,7 +730,7 @@ async function createEffectAuthoringSession(source, options) {
|
|
|
730
730
|
height: renderer.height,
|
|
731
731
|
depth: renderer.depth,
|
|
732
732
|
render: async (req) => {
|
|
733
|
-
if (disposed) throw new (0,
|
|
733
|
+
if (disposed) throw new (0, _chunk2K5TELHVcjs.EffectDisposedError)(effectId);
|
|
734
734
|
const effectiveValues = _nullishCoalesce(req.values, () => ( valuesAtTime(req.time, baseValues, tracks)));
|
|
735
735
|
const pixels = await renderer.render({
|
|
736
736
|
...req,
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { type EffectProvider } from './types.cjs';
|
|
7
7
|
export interface EffectConformanceIssue {
|
|
8
8
|
effectId?: string;
|
|
9
|
+
/** Set for an issue with a sequence template. */
|
|
10
|
+
templateId?: string;
|
|
9
11
|
message: string;
|
|
10
12
|
}
|
|
11
13
|
export interface EffectConformanceOptions {
|
|
@@ -17,6 +19,7 @@ export interface EffectConformanceOptions {
|
|
|
17
19
|
size?: number;
|
|
18
20
|
/** Also check authoring when supportsAuthoring is true (default true). */
|
|
19
21
|
authoring?: boolean;
|
|
22
|
+
/** Also check sequence templates when supportsTemplates is true (default true). */
|
|
23
|
+
templates?: boolean;
|
|
20
24
|
}
|
|
21
|
-
/** Runs the contract checks against `provider` and returns every issue found (empty when it conforms). */
|
|
22
25
|
export declare function checkEffectProvider(provider: EffectProvider, options?: EffectConformanceOptions): Promise<EffectConformanceIssue[]>;
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { type EffectProvider } from './types.js';
|
|
7
7
|
export interface EffectConformanceIssue {
|
|
8
8
|
effectId?: string;
|
|
9
|
+
/** Set for an issue with a sequence template. */
|
|
10
|
+
templateId?: string;
|
|
9
11
|
message: string;
|
|
10
12
|
}
|
|
11
13
|
export interface EffectConformanceOptions {
|
|
@@ -17,6 +19,7 @@ export interface EffectConformanceOptions {
|
|
|
17
19
|
size?: number;
|
|
18
20
|
/** Also check authoring when supportsAuthoring is true (default true). */
|
|
19
21
|
authoring?: boolean;
|
|
22
|
+
/** Also check sequence templates when supportsTemplates is true (default true). */
|
|
23
|
+
templates?: boolean;
|
|
20
24
|
}
|
|
21
|
-
/** Runs the contract checks against `provider` and returns every issue found (empty when it conforms). */
|
|
22
25
|
export declare function checkEffectProvider(provider: EffectProvider, options?: EffectConformanceOptions): Promise<EffectConformanceIssue[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SchemaValidationError } from '../tools/schema.cjs';
|
|
2
|
-
export type EffectErrorCode = 'unknown_effect' | 'invalid_values' | 'unsupported' | 'disposed' | 'no_provider';
|
|
2
|
+
export type EffectErrorCode = 'unknown_effect' | 'invalid_values' | 'unsupported' | 'disposed' | 'no_provider' | 'unknown_template';
|
|
3
3
|
export declare const EFFECT_ERROR_CODES: readonly EffectErrorCode[];
|
|
4
4
|
/**
|
|
5
5
|
* Base of every effects error. Check `code` (or use `isEffectError`) rather than `instanceof`
|
|
@@ -14,6 +14,11 @@ export declare class EffectError extends Error {
|
|
|
14
14
|
export declare class UnknownEffectError extends EffectError {
|
|
15
15
|
constructor(effectId: string, providerName?: string);
|
|
16
16
|
}
|
|
17
|
+
/** No sequence template has this id. */
|
|
18
|
+
export declare class UnknownTemplateError extends EffectError {
|
|
19
|
+
readonly templateId: string;
|
|
20
|
+
constructor(templateId: string, providerName?: string);
|
|
21
|
+
}
|
|
17
22
|
/** Control values do not match the effect's control schema (unknown control, wrong type, out of range). */
|
|
18
23
|
export declare class EffectControlError extends EffectError {
|
|
19
24
|
readonly details: readonly SchemaValidationError[];
|