@pixerate/editor 0.229.0 → 0.231.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/camera-tools.d.cts +10 -0
- package/dist/animation-editor/camera-tools.d.ts +10 -0
- package/dist/animation-editor/camera.d.cts +67 -0
- package/dist/animation-editor/camera.d.ts +67 -0
- package/dist/animation-editor/compile.d.cts +4 -0
- package/dist/animation-editor/compile.d.ts +4 -0
- package/dist/animation-editor/controller.d.cts +34 -2
- package/dist/animation-editor/controller.d.ts +34 -2
- package/dist/animation-editor/effect-tools.d.cts +2 -1
- package/dist/animation-editor/effect-tools.d.ts +2 -1
- package/dist/animation-editor/evaluate.d.cts +9 -0
- package/dist/animation-editor/evaluate.d.ts +9 -0
- package/dist/animation-editor/flair.d.cts +8 -0
- package/dist/animation-editor/flair.d.ts +8 -0
- package/dist/animation-editor/index.cjs +603 -217
- package/dist/animation-editor/index.d.cts +2 -0
- package/dist/animation-editor/index.d.ts +2 -0
- package/dist/animation-editor/index.js +454 -68
- package/dist/animation-editor/issues.d.cts +16 -0
- package/dist/animation-editor/issues.d.ts +16 -0
- package/dist/animation-editor/tools.d.cts +1 -1
- package/dist/animation-editor/tools.d.ts +1 -1
- package/dist/animation-editor/types.d.cts +21 -3
- package/dist/animation-editor/types.d.ts +21 -3
- package/dist/canvas/index.cjs +7 -7
- package/dist/canvas/index.js +1 -1
- package/dist/{chunk-IGPEBXUD.cjs → chunk-5T3H7CGG.cjs} +21 -11
- package/dist/{chunk-K5GXW5TR.cjs → chunk-C73U5UI3.cjs} +14 -14
- package/dist/{chunk-LPTFDCJO.js → chunk-CSM5T6SE.js} +14 -4
- package/dist/{chunk-EBDZWIOP.cjs → chunk-ERJA5CGT.cjs} +5 -1
- package/dist/{chunk-5MQOBTNP.cjs → chunk-OPSK22DL.cjs} +80 -9
- package/dist/{chunk-PB6JV62G.js → chunk-SBPGIZQN.js} +1 -1
- package/dist/{chunk-UGYUGZE2.js → chunk-TCZ2J7PR.js} +71 -0
- package/dist/{chunk-W4KFNAWC.js → chunk-TYCJGFCF.js} +5 -1
- package/dist/effects/helpers.d.cts +35 -1
- package/dist/effects/helpers.d.ts +35 -1
- package/dist/effects/index.cjs +60 -44
- package/dist/effects/index.js +18 -2
- package/dist/effects/types.d.cts +15 -0
- package/dist/effects/types.d.ts +15 -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/camera-tools.d.cts +10 -0
- package/dist/video-editor/camera-tools.d.ts +10 -0
- package/dist/video-editor/camera.d.cts +47 -0
- package/dist/video-editor/camera.d.ts +47 -0
- package/dist/video-editor/check.d.cts +1 -1
- package/dist/video-editor/check.d.ts +1 -1
- package/dist/video-editor/controller.d.cts +37 -2
- package/dist/video-editor/controller.d.ts +37 -2
- package/dist/video-editor/effect-tools.d.cts +2 -1
- package/dist/video-editor/effect-tools.d.ts +2 -1
- package/dist/video-editor/index.cjs +705 -390
- package/dist/video-editor/index.d.cts +2 -0
- package/dist/video-editor/index.d.ts +2 -0
- package/dist/video-editor/index.js +334 -19
- package/dist/video-editor/keyframes.d.cts +10 -3
- package/dist/video-editor/keyframes.d.ts +10 -3
- package/dist/video-editor/parse.d.cts +5 -3
- package/dist/video-editor/parse.d.ts +5 -3
- package/dist/video-editor/tools.d.cts +18 -0
- package/dist/video-editor/tools.d.ts +18 -0
- package/dist/video-editor/types.d.cts +37 -1
- package/dist/video-editor/types.d.ts +37 -1
- package/package.json +1 -1
- package/skills/pixerate-animation-editor/SKILL.md +28 -1
- package/skills/pixerate-animation-motion-graphics/SKILL.md +3 -0
- package/skills/pixerate-video-editor/SKILL.md +16 -1
- package/skills/pixerate-video-montage/SKILL.md +2 -1
package/dist/effects/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunk4XSBOGMKcjs = require('../chunk-4XSBOGMK.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkC73U5UI3cjs = require('../chunk-C73U5UI3.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
|
|
@@ -37,7 +37,15 @@ var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
var _chunkOPSK22DLcjs = require('../chunk-OPSK22DL.cjs');
|
|
41
49
|
require('../chunk-WOFXZ3XU.cjs');
|
|
42
50
|
require('../chunk-FJ2MSI43.cjs');
|
|
43
51
|
|
|
@@ -45,7 +53,7 @@ require('../chunk-FJ2MSI43.cjs');
|
|
|
45
53
|
var _chunkDWJJI6RTcjs = require('../chunk-DWJJI6RT.cjs');
|
|
46
54
|
|
|
47
55
|
// src/effects/conformance.ts
|
|
48
|
-
var codeOf = (e) =>
|
|
56
|
+
var codeOf = (e) => _chunkOPSK22DLcjs.isEffectError.call(void 0, e) ? e.code : e instanceof Error ? `untyped ${e.name}: ${e.message}` : String(e);
|
|
49
57
|
async function rejectsWith(code, run) {
|
|
50
58
|
try {
|
|
51
59
|
await run();
|
|
@@ -59,10 +67,10 @@ function checkSummary(e, issues) {
|
|
|
59
67
|
const at = (message) => issues.push({ effectId: e.id, message });
|
|
60
68
|
if (!e.id || typeof e.id !== "string") at("summary has no id");
|
|
61
69
|
if (!e.name) at("summary has no name");
|
|
62
|
-
if (!
|
|
70
|
+
if (!_chunkOPSK22DLcjs.EFFECT_KINDS.includes(e.kind)) at(`kind "${e.kind}" is not one of ${_chunkOPSK22DLcjs.EFFECT_KINDS.join(", ")}`);
|
|
63
71
|
if (!e.category) at("summary has no category");
|
|
64
72
|
if (!Array.isArray(e.uses) || !e.uses.length) at("summary has no uses");
|
|
65
|
-
for (const u of _nullishCoalesce(e.uses, () => ( []))) if (!
|
|
73
|
+
for (const u of _nullishCoalesce(e.uses, () => ( []))) if (!_chunkOPSK22DLcjs.EFFECT_USES.includes(u)) at(`use "${u}" is not one of ${_chunkOPSK22DLcjs.EFFECT_USES.join(", ")}`);
|
|
66
74
|
if (typeof e.transparent !== "boolean") at("transparent is not a boolean");
|
|
67
75
|
if (typeof e.loop !== "boolean") at("loop is not a boolean");
|
|
68
76
|
if (e.duration !== void 0 && !(e.duration > 0)) at("duration must be a positive number of ms when present");
|
|
@@ -72,7 +80,7 @@ function checkSummary(e, issues) {
|
|
|
72
80
|
const m = e.camera;
|
|
73
81
|
if (!m) at("a camera effect needs camera: { role, durationMs }");
|
|
74
82
|
else {
|
|
75
|
-
if (!
|
|
83
|
+
if (!_chunkOPSK22DLcjs.CAMERA_MOVE_ROLES.includes(m.role)) at(`camera.role "${m.role}" is not one of ${_chunkOPSK22DLcjs.CAMERA_MOVE_ROLES.join(", ")}`);
|
|
76
84
|
if (!(Number.isFinite(m.durationMs) && m.durationMs >= 0)) at("camera.durationMs must be a number of ms \u2265 0");
|
|
77
85
|
if (m.cut !== void 0 && !(m.cut >= 0 && m.cut <= 1)) at("camera.cut must be 0\u20131 when present");
|
|
78
86
|
if (e.duration !== void 0 && e.duration !== m.durationMs) at(`duration ${e.duration} differs from camera.durationMs ${m.durationMs}`);
|
|
@@ -98,8 +106,8 @@ function checkDescription(id, d, issues) {
|
|
|
98
106
|
if (!control) at(`backgroundOpacity "${d.backgroundOpacity}" is not a control`);
|
|
99
107
|
else if (control.type !== "number" || control.minimum !== 0 || control.maximum !== 1) at(`backgroundOpacity "${d.backgroundOpacity}" must be a number control from 0 to 1`);
|
|
100
108
|
}
|
|
101
|
-
for (const e of
|
|
102
|
-
for (const p of _nullishCoalesce(d.presets, () => ( []))) for (const e of
|
|
109
|
+
for (const e of _chunkOPSK22DLcjs.effectValueErrors.call(void 0, d, d.defaults)) at(`default ${e.path}: ${e.message}`);
|
|
110
|
+
for (const p of _nullishCoalesce(d.presets, () => ( []))) for (const e of _chunkOPSK22DLcjs.effectValueErrors.call(void 0, d, p.values)) at(`preset "${p.name}" ${e.path}: ${e.message}`);
|
|
103
111
|
for (const input2 of _nullishCoalesce(d.inputs, () => ( []))) {
|
|
104
112
|
if (!input2.name || !input2.description) at("every input needs a name and a description");
|
|
105
113
|
if (input2.kind !== "image" && input2.kind !== "audio") at(`input "${input2.name}" has kind "${input2.kind}"`);
|
|
@@ -110,7 +118,7 @@ function checkDescription(id, d, issues) {
|
|
|
110
118
|
}
|
|
111
119
|
}
|
|
112
120
|
function grey(size) {
|
|
113
|
-
const p =
|
|
121
|
+
const p = _chunkOPSK22DLcjs.createEffectPixels.call(void 0, size, size);
|
|
114
122
|
p.data.fill(128);
|
|
115
123
|
return p;
|
|
116
124
|
}
|
|
@@ -127,7 +135,7 @@ async function checkRender(provider, d, size, issues) {
|
|
|
127
135
|
}
|
|
128
136
|
try {
|
|
129
137
|
const out = await renderer.render({ time: 0, inputs });
|
|
130
|
-
if (!
|
|
138
|
+
if (!_chunkOPSK22DLcjs.isEffectPixels.call(void 0, out)) at("render did not return EffectPixels");
|
|
131
139
|
else if (out.width !== size || out.height !== size || out.data.length !== size * size * 4) at(`render returned ${out.width}\xD7${out.height}, not ${size}\xD7${size}`);
|
|
132
140
|
} catch (e) {
|
|
133
141
|
at(`render failed: ${codeOf(e)}`);
|
|
@@ -157,10 +165,10 @@ async function checkCamera(provider, d, issues) {
|
|
|
157
165
|
at("cameraView must be synchronous; it returned a Promise");
|
|
158
166
|
return;
|
|
159
167
|
}
|
|
160
|
-
if (!
|
|
168
|
+
if (!_chunkOPSK22DLcjs.isCameraView.call(void 0, view)) at(`cameraView at u ${u} is not a CameraView (zoom > 0, finite scrollX and scrollY): ${JSON.stringify(view)}`);
|
|
161
169
|
else views.push(view);
|
|
162
170
|
const again = provider.cameraView(d.id, ctx(u));
|
|
163
|
-
if (
|
|
171
|
+
if (_chunkOPSK22DLcjs.isCameraView.call(void 0, view) && !sameView(view, again)) at(`cameraView is not pure: two calls at u ${u} gave different views`);
|
|
164
172
|
} catch (e) {
|
|
165
173
|
at(`cameraView at u ${u} failed: ${codeOf(e)}`);
|
|
166
174
|
}
|
|
@@ -173,7 +181,7 @@ async function checkCamera(provider, d, issues) {
|
|
|
173
181
|
const keys = _optionalChain([sample, 'optionalAccess', _11 => _11.keys]);
|
|
174
182
|
if (!Array.isArray(keys) || keys.length < 2) at("sampleCameraMove returned fewer than two keys");
|
|
175
183
|
else {
|
|
176
|
-
if (keys.some((k, i) => !
|
|
184
|
+
if (keys.some((k, i) => !_chunkOPSK22DLcjs.isCameraView.call(void 0, k.view) || !Number.isFinite(k.t) || i > 0 && k.t < keys[i - 1].t)) at("sampleCameraMove keys must be CameraViews in time order");
|
|
177
185
|
if (keys[0].t !== 0 || keys[keys.length - 1].t !== ms) at(`sampleCameraMove keys must run from 0 to ${ms} ms, got ${keys[0].t} to ${keys[keys.length - 1].t}`);
|
|
178
186
|
else if (!near(keys[0].view, views[0]) || !near(keys[keys.length - 1].view, views[4])) at("sampleCameraMove disagrees with cameraView at the start or end of the move");
|
|
179
187
|
if (camera.cut !== void 0 && sample.cut === void 0) at("sampleCameraMove gave no cut for a move that cuts");
|
|
@@ -543,15 +551,15 @@ var smooth = (t) => t * t * (3 - 2 * t);
|
|
|
543
551
|
var clamp01 = (v) => v < 0 ? 0 : v > 1 ? 1 : v;
|
|
544
552
|
function input(request, name, id, width, height) {
|
|
545
553
|
const src = _optionalChain([request, 'access', _24 => _24.inputs, 'optionalAccess', _25 => _25[name]]);
|
|
546
|
-
if (!src) throw new (0,
|
|
547
|
-
if (!
|
|
554
|
+
if (!src) throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`Effect "${id}" needs an input named "${name}".`, id);
|
|
555
|
+
if (!_chunkOPSK22DLcjs.isEffectPixels.call(void 0, src)) throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`The fake provider only takes EffectPixels inputs ("${name}").`, id);
|
|
548
556
|
if (src.width !== width || src.height !== height) {
|
|
549
|
-
throw new (0,
|
|
557
|
+
throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`Input "${name}" is ${src.width}\xD7${src.height}; the renderer is ${width}\xD7${height}.`, id);
|
|
550
558
|
}
|
|
551
559
|
return src;
|
|
552
560
|
}
|
|
553
561
|
function renderPixels(d, v, request, width, height) {
|
|
554
|
-
const out =
|
|
562
|
+
const out = _chunkOPSK22DLcjs.createEffectPixels.call(void 0, width, height);
|
|
555
563
|
const o = out.data;
|
|
556
564
|
switch (d.id) {
|
|
557
565
|
case "fake.invert": {
|
|
@@ -617,7 +625,7 @@ function renderPixels(d, v, request, width, height) {
|
|
|
617
625
|
break;
|
|
618
626
|
}
|
|
619
627
|
default:
|
|
620
|
-
throw new (0,
|
|
628
|
+
throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`"${d.id}" is a ${d.kind} effect; use applyVectorEffect.`, d.id);
|
|
621
629
|
}
|
|
622
630
|
return out;
|
|
623
631
|
}
|
|
@@ -647,22 +655,22 @@ function cameraViewOf(d, ctx, v) {
|
|
|
647
655
|
case "fake.drift":
|
|
648
656
|
return viewAt(x0, y0, from.zoom * lerp(1, v.scale, smooth(u)), ctx);
|
|
649
657
|
default:
|
|
650
|
-
throw new (0,
|
|
658
|
+
throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`"${d.id}" is a ${d.kind} effect, not a camera move.`, d.id);
|
|
651
659
|
}
|
|
652
660
|
}
|
|
653
661
|
function toFloat(p) {
|
|
654
662
|
const f = new Float32Array(p.data.length);
|
|
655
663
|
for (let i = 0; i < f.length; i += 4) {
|
|
656
|
-
f[i] =
|
|
657
|
-
f[i + 1] =
|
|
658
|
-
f[i + 2] =
|
|
664
|
+
f[i] = _chunkOPSK22DLcjs.srgbToLinear.call(void 0, p.data[i] / 255);
|
|
665
|
+
f[i + 1] = _chunkOPSK22DLcjs.srgbToLinear.call(void 0, p.data[i + 1] / 255);
|
|
666
|
+
f[i + 2] = _chunkOPSK22DLcjs.srgbToLinear.call(void 0, p.data[i + 2] / 255);
|
|
659
667
|
f[i + 3] = p.data[i + 3] / 255;
|
|
660
668
|
}
|
|
661
|
-
return
|
|
669
|
+
return _chunkOPSK22DLcjs.encodeEffectFloat.call(void 0, { ...p, float: f });
|
|
662
670
|
}
|
|
663
671
|
function maskResult(out, mask, source, id) {
|
|
664
|
-
if (!
|
|
665
|
-
throw new (0,
|
|
672
|
+
if (!_chunkOPSK22DLcjs.isEffectPixels.call(void 0, mask) || mask.width !== out.width || mask.height !== out.height) {
|
|
673
|
+
throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)("The mask must be EffectPixels the size of the renderer.", id);
|
|
666
674
|
}
|
|
667
675
|
const o = out.data;
|
|
668
676
|
for (let i = 0; i < o.length; i += 4) {
|
|
@@ -688,32 +696,32 @@ function createFakeEffectProvider(options = {}) {
|
|
|
688
696
|
const byId = new Map(all.map((d) => [d.id, d]));
|
|
689
697
|
const get = (id) => {
|
|
690
698
|
const d = byId.get(id);
|
|
691
|
-
if (!d) throw new (0,
|
|
699
|
+
if (!d) throw new (0, _chunkOPSK22DLcjs.UnknownEffectError)(id, "the fake provider");
|
|
692
700
|
return d;
|
|
693
701
|
};
|
|
694
702
|
const summaries = all.map(summaryOf);
|
|
695
703
|
const camera = (id, ctx, values) => {
|
|
696
704
|
const d = get(id);
|
|
697
|
-
if (d.kind !== "camera") throw new (0,
|
|
698
|
-
if (!(ctx.u >= 0 && ctx.u <= 1)) throw new (0,
|
|
699
|
-
return cameraViewOf(d, ctx,
|
|
705
|
+
if (d.kind !== "camera") throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`"${id}" is a ${d.kind} effect, not a camera move.`, id);
|
|
706
|
+
if (!(ctx.u >= 0 && ctx.u <= 1)) throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`u must be 0\u20131 through the move, got ${ctx.u}.`, id);
|
|
707
|
+
return cameraViewOf(d, ctx, _chunkOPSK22DLcjs.resolveEffectValues.call(void 0, d, values));
|
|
700
708
|
};
|
|
701
709
|
const provider = {
|
|
702
710
|
id: "fake",
|
|
703
711
|
name: "Fake effects",
|
|
704
712
|
version: "1",
|
|
705
713
|
capabilities,
|
|
706
|
-
list: (o) =>
|
|
707
|
-
search: (q, o) =>
|
|
714
|
+
list: (o) => _chunkOPSK22DLcjs.searchEffectSummaries.call(void 0, summaries, "", o),
|
|
715
|
+
search: (q, o) => _chunkOPSK22DLcjs.searchEffectSummaries.call(void 0, summaries, q, o),
|
|
708
716
|
describe: (id) => structuredClone(get(id)),
|
|
709
717
|
createRenderer(id, ro) {
|
|
710
718
|
const d = get(id);
|
|
711
|
-
if (d.kind === "camera") throw new (0,
|
|
712
|
-
if (d.kind !== "shader") throw new (0,
|
|
719
|
+
if (d.kind === "camera") throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`"${id}" is a camera move: it moves a scene's camera and draws no pixels. Use cameraView.`, id);
|
|
720
|
+
if (d.kind !== "shader") throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`"${id}" is a ${d.kind} effect; use applyVectorEffect.`, id);
|
|
713
721
|
const { width, height } = ro;
|
|
714
722
|
const depth = _nullishCoalesce(ro.depth, () => ( 8));
|
|
715
723
|
if (!(width > 0 && height > 0) || width > capabilities.maxSize || height > capabilities.maxSize) {
|
|
716
|
-
throw new (0,
|
|
724
|
+
throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`Renderer size ${width}\xD7${height} is outside 1\u2013${capabilities.maxSize}.`, id);
|
|
717
725
|
}
|
|
718
726
|
let disposed = false;
|
|
719
727
|
return {
|
|
@@ -722,15 +730,15 @@ function createFakeEffectProvider(options = {}) {
|
|
|
722
730
|
height,
|
|
723
731
|
depth,
|
|
724
732
|
async render(request) {
|
|
725
|
-
if (disposed) throw new (0,
|
|
733
|
+
if (disposed) throw new (0, _chunkOPSK22DLcjs.EffectDisposedError)(id);
|
|
726
734
|
if (!Number.isFinite(request.time) || request.time < 0) {
|
|
727
|
-
throw new (0,
|
|
735
|
+
throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`time must be a finite number of ms \u2265 0, got ${request.time}.`, id);
|
|
728
736
|
}
|
|
729
|
-
const values =
|
|
737
|
+
const values = _chunkOPSK22DLcjs.resolveEffectValues.call(void 0, d, request.values);
|
|
730
738
|
_optionalChain([options, 'access', _26 => _26.onRender, 'optionalCall', _27 => _27(id, request)]);
|
|
731
739
|
const out = renderPixels(d, values, request, width, height);
|
|
732
740
|
if (request.mask) {
|
|
733
|
-
if (!capabilities.supportsMask) throw new (0,
|
|
741
|
+
if (!capabilities.supportsMask) throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)("This provider does not take masks.", id);
|
|
734
742
|
const source = d.uses.includes("filter") ? _optionalChain([request, 'access', _28 => _28.inputs, 'optionalAccess', _29 => _29.source]) : void 0;
|
|
735
743
|
maskResult(out, request.mask, source, id);
|
|
736
744
|
}
|
|
@@ -743,8 +751,8 @@ function createFakeEffectProvider(options = {}) {
|
|
|
743
751
|
},
|
|
744
752
|
applyVectorEffect(id, target, values) {
|
|
745
753
|
const d = get(id);
|
|
746
|
-
if (d.kind !== "motion" && d.kind !== "vector") throw new (0,
|
|
747
|
-
const v =
|
|
754
|
+
if (d.kind !== "motion" && d.kind !== "vector") throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`"${id}" is a ${d.kind} effect, not a vector one.`, id);
|
|
755
|
+
const v = _chunkOPSK22DLcjs.resolveEffectValues.call(void 0, d, values);
|
|
748
756
|
if (d.kind === "vector") {
|
|
749
757
|
return { svg: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100"><circle id="badge" cx="50" cy="50" r="40" fill="${v.color}"/></svg>`, animate: [{ id: "badge", ms: v.ms, attrs: { opacity: [0, 1] } }], duration: v.ms, loop: false };
|
|
750
758
|
}
|
|
@@ -764,11 +772,11 @@ function createFakeEffectProvider(options = {}) {
|
|
|
764
772
|
sampleCameraMove: (id, request) => {
|
|
765
773
|
const d = get(id);
|
|
766
774
|
const { from, to, ms, stage, fps, values } = request;
|
|
767
|
-
return
|
|
775
|
+
return _chunkOPSK22DLcjs.sampleCameraViews.call(void 0, (u) => camera(id, { from, to, u, ms, stage }, values), { ms, fps, cut: _optionalChain([d, 'access', _30 => _30.camera, 'optionalAccess', _31 => _31.cut]) });
|
|
768
776
|
}
|
|
769
777
|
} : {},
|
|
770
778
|
...supportsAuthoring ? {
|
|
771
|
-
openAuthoring: (from) =>
|
|
779
|
+
openAuthoring: (from) => _chunkC73U5UI3cjs.createEffectAuthoringSession.call(void 0, from, { provider })
|
|
772
780
|
} : {}
|
|
773
781
|
};
|
|
774
782
|
return provider;
|
|
@@ -849,7 +857,7 @@ var effectFieldValue = (field, value) => {
|
|
|
849
857
|
return value === void 0 || value === null || typeof value === "object" && !Array.isArray(value) ? field.default : value;
|
|
850
858
|
};
|
|
851
859
|
function effectSamplePicture(width, height, variant = 0) {
|
|
852
|
-
const p =
|
|
860
|
+
const p = _chunkOPSK22DLcjs.createEffectPixels.call(void 0, width, height);
|
|
853
861
|
for (let y = 0, i = 0; y < height; y++) {
|
|
854
862
|
for (let x = 0; x < width; x++, i += 4) {
|
|
855
863
|
const u = x / Math.max(1, width - 1);
|
|
@@ -1336,4 +1344,12 @@ function createEffectAuthoringToolProvider(host, options) {
|
|
|
1336
1344
|
|
|
1337
1345
|
|
|
1338
1346
|
|
|
1339
|
-
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
|
|
1350
|
+
|
|
1351
|
+
|
|
1352
|
+
|
|
1353
|
+
|
|
1354
|
+
|
|
1355
|
+
exports.CAMERA_MOVE_MAX_MS = _chunkOPSK22DLcjs.CAMERA_MOVE_MAX_MS; exports.CAMERA_MOVE_ROLES = _chunkOPSK22DLcjs.CAMERA_MOVE_ROLES; exports.EFFECT_ERROR_CODES = _chunkOPSK22DLcjs.EFFECT_ERROR_CODES; exports.EFFECT_KINDS = _chunkOPSK22DLcjs.EFFECT_KINDS; exports.EFFECT_USES = _chunkOPSK22DLcjs.EFFECT_USES; exports.EFFECT_USE_LABELS = EFFECT_USE_LABELS; exports.EffectControlError = _chunkOPSK22DLcjs.EffectControlError; exports.EffectDisposedError = _chunkOPSK22DLcjs.EffectDisposedError; exports.EffectError = _chunkOPSK22DLcjs.EffectError; exports.EffectRendererPool = _chunkPY4GWSE2cjs.EffectRendererPool; exports.EffectUnsupportedError = _chunkOPSK22DLcjs.EffectUnsupportedError; exports.EffectsSlot = _chunkOPSK22DLcjs.EffectsSlot; exports.NoEffectsProviderError = _chunkOPSK22DLcjs.NoEffectsProviderError; exports.UnknownEffectError = _chunkOPSK22DLcjs.UnknownEffectError; exports.applyEffectMask = _chunkOPSK22DLcjs.applyEffectMask; exports.cameraBoxOfView = _chunkOPSK22DLcjs.cameraBoxOfView; exports.cameraMoveField = _chunkOPSK22DLcjs.cameraMoveField; exports.cameraMoveIdList = _chunkOPSK22DLcjs.cameraMoveIdList; exports.cameraMoveParts = _chunkOPSK22DLcjs.cameraMoveParts; exports.cameraMovesFor = _chunkOPSK22DLcjs.cameraMovesFor; exports.cameraViewOfBox = _chunkOPSK22DLcjs.cameraViewOfBox; exports.checkEffectProvider = checkEffectProvider; exports.countEffectTags = _chunkOPSK22DLcjs.countEffectTags; exports.createEffectAuthoringSession = _chunkC73U5UI3cjs.createEffectAuthoringSession; exports.createEffectAuthoringToolProvider = createEffectAuthoringToolProvider; exports.createEffectPixels = _chunkOPSK22DLcjs.createEffectPixels; exports.createEffectToolProvider = _chunkOPSK22DLcjs.createEffectToolProvider; exports.createFakeEffectProvider = createFakeEffectProvider; exports.effectControlField = effectControlField; exports.effectFieldValue = effectFieldValue; exports.effectFontFamilies = effectFontFamilies; exports.effectOffered = _chunkOPSK22DLcjs.effectOffered; exports.effectParameterFields = effectParameterFields; exports.effectSampleInputs = effectSampleInputs; exports.effectSamplePicture = effectSamplePicture; exports.effectValueErrors = _chunkOPSK22DLcjs.effectValueErrors; exports.encodeEffectFloat = _chunkOPSK22DLcjs.encodeEffectFloat; exports.groupEffectsByCategory = groupEffectsByCategory; exports.hasEffectTags = _chunkOPSK22DLcjs.hasEffectTags; exports.isCameraView = _chunkOPSK22DLcjs.isCameraView; exports.isEffectError = _chunkOPSK22DLcjs.isEffectError; exports.isEffectFontControl = isEffectFontControl; exports.isEffectPixels = _chunkOPSK22DLcjs.isEffectPixels; exports.linearToSrgb = _chunkOPSK22DLcjs.linearToSrgb; exports.normaliseEffectTag = _chunkOPSK22DLcjs.normaliseEffectTag; exports.renderEffectThumbnail = renderEffectThumbnail; exports.resolveCameraMoveSpec = _chunkOPSK22DLcjs.resolveCameraMoveSpec; exports.resolveEffectValues = _chunkOPSK22DLcjs.resolveEffectValues; exports.sampleCameraViews = _chunkOPSK22DLcjs.sampleCameraViews; exports.sampleEffectCameraMove = _chunkOPSK22DLcjs.sampleEffectCameraMove; exports.searchEffectSummaries = _chunkOPSK22DLcjs.searchEffectSummaries; exports.srgbToLinear = _chunkOPSK22DLcjs.srgbToLinear;
|
package/dist/effects/index.js
CHANGED
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
} from "../chunk-N4ZXW3WB.js";
|
|
4
4
|
import {
|
|
5
5
|
createEffectAuthoringSession
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-SBPGIZQN.js";
|
|
7
7
|
import {
|
|
8
8
|
EffectRendererPool
|
|
9
9
|
} from "../chunk-EHLOCVWB.js";
|
|
10
10
|
import {
|
|
11
|
+
CAMERA_MOVE_MAX_MS,
|
|
11
12
|
CAMERA_MOVE_ROLES,
|
|
12
13
|
EFFECT_ERROR_CODES,
|
|
13
14
|
EFFECT_KINDS,
|
|
@@ -20,6 +21,12 @@ import {
|
|
|
20
21
|
NoEffectsProviderError,
|
|
21
22
|
UnknownEffectError,
|
|
22
23
|
applyEffectMask,
|
|
24
|
+
cameraBoxOfView,
|
|
25
|
+
cameraMoveField,
|
|
26
|
+
cameraMoveIdList,
|
|
27
|
+
cameraMoveParts,
|
|
28
|
+
cameraMovesFor,
|
|
29
|
+
cameraViewOfBox,
|
|
23
30
|
countEffectTags,
|
|
24
31
|
createEffectPixels,
|
|
25
32
|
createEffectToolProvider,
|
|
@@ -32,12 +39,13 @@ import {
|
|
|
32
39
|
isEffectPixels,
|
|
33
40
|
linearToSrgb,
|
|
34
41
|
normaliseEffectTag,
|
|
42
|
+
resolveCameraMoveSpec,
|
|
35
43
|
resolveEffectValues,
|
|
36
44
|
sampleCameraViews,
|
|
37
45
|
sampleEffectCameraMove,
|
|
38
46
|
searchEffectSummaries,
|
|
39
47
|
srgbToLinear
|
|
40
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-TCZ2J7PR.js";
|
|
41
49
|
import "../chunk-V2ZCJRDM.js";
|
|
42
50
|
import "../chunk-RNSANXPT.js";
|
|
43
51
|
import {
|
|
@@ -1292,6 +1300,7 @@ function createEffectAuthoringToolProvider(host, options) {
|
|
|
1292
1300
|
};
|
|
1293
1301
|
}
|
|
1294
1302
|
export {
|
|
1303
|
+
CAMERA_MOVE_MAX_MS,
|
|
1295
1304
|
CAMERA_MOVE_ROLES,
|
|
1296
1305
|
EFFECT_ERROR_CODES,
|
|
1297
1306
|
EFFECT_KINDS,
|
|
@@ -1306,6 +1315,12 @@ export {
|
|
|
1306
1315
|
NoEffectsProviderError,
|
|
1307
1316
|
UnknownEffectError,
|
|
1308
1317
|
applyEffectMask,
|
|
1318
|
+
cameraBoxOfView,
|
|
1319
|
+
cameraMoveField,
|
|
1320
|
+
cameraMoveIdList,
|
|
1321
|
+
cameraMoveParts,
|
|
1322
|
+
cameraMovesFor,
|
|
1323
|
+
cameraViewOfBox,
|
|
1309
1324
|
checkEffectProvider,
|
|
1310
1325
|
countEffectTags,
|
|
1311
1326
|
createEffectAuthoringSession,
|
|
@@ -1331,6 +1346,7 @@ export {
|
|
|
1331
1346
|
linearToSrgb,
|
|
1332
1347
|
normaliseEffectTag,
|
|
1333
1348
|
renderEffectThumbnail,
|
|
1349
|
+
resolveCameraMoveSpec,
|
|
1334
1350
|
resolveEffectValues,
|
|
1335
1351
|
sampleCameraViews,
|
|
1336
1352
|
sampleEffectCameraMove,
|
package/dist/effects/types.d.cts
CHANGED
|
@@ -214,6 +214,21 @@ export interface CameraView {
|
|
|
214
214
|
/** Direction the blur streaks, degrees on screen (0 horizontal, 90 vertical); absent when it blurs every way (a zoom or a turn). */
|
|
215
215
|
blurAngle?: number;
|
|
216
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* A camera move as a document names it (the shape of Flair's `CameraMoveSpec`): the move's id, or
|
|
219
|
+
* the id with a preset, values and a length. Editors save it on a shot (`in` for a `transition`
|
|
220
|
+
* move, `during` for a `hold`).
|
|
221
|
+
*/
|
|
222
|
+
export type CameraMoveSpec = string | {
|
|
223
|
+
/** The camera effect's id. */
|
|
224
|
+
move: string;
|
|
225
|
+
/** Length of a `transition` move (ms); default its `durationMs`. A `hold` plays across the shot's hold and takes none. */
|
|
226
|
+
ms?: number;
|
|
227
|
+
/** The preset its values came from, by name. */
|
|
228
|
+
preset?: string;
|
|
229
|
+
/** Control values over the move's defaults (a preset's values are written out here too). */
|
|
230
|
+
values?: Record<string, EffectValue>;
|
|
231
|
+
};
|
|
217
232
|
/** The stage a camera looks at, in pixels. */
|
|
218
233
|
export interface CameraStage {
|
|
219
234
|
width: number;
|
package/dist/effects/types.d.ts
CHANGED
|
@@ -214,6 +214,21 @@ export interface CameraView {
|
|
|
214
214
|
/** Direction the blur streaks, degrees on screen (0 horizontal, 90 vertical); absent when it blurs every way (a zoom or a turn). */
|
|
215
215
|
blurAngle?: number;
|
|
216
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* A camera move as a document names it (the shape of Flair's `CameraMoveSpec`): the move's id, or
|
|
219
|
+
* the id with a preset, values and a length. Editors save it on a shot (`in` for a `transition`
|
|
220
|
+
* move, `during` for a `hold`).
|
|
221
|
+
*/
|
|
222
|
+
export type CameraMoveSpec = string | {
|
|
223
|
+
/** The camera effect's id. */
|
|
224
|
+
move: string;
|
|
225
|
+
/** Length of a `transition` move (ms); default its `durationMs`. A `hold` plays across the shot's hold and takes none. */
|
|
226
|
+
ms?: number;
|
|
227
|
+
/** The preset its values came from, by name. */
|
|
228
|
+
preset?: string;
|
|
229
|
+
/** Control values over the move's defaults (a preset's values are written out here too). */
|
|
230
|
+
values?: Record<string, EffectValue>;
|
|
231
|
+
};
|
|
217
232
|
/** The stage a camera looks at, in pixels. */
|
|
218
233
|
export interface CameraStage {
|
|
219
234
|
width: number;
|
|
@@ -744,7 +744,7 @@ require('../chunk-NM3G4VQT.cjs');
|
|
|
744
744
|
|
|
745
745
|
|
|
746
746
|
|
|
747
|
-
var
|
|
747
|
+
var _chunkOPSK22DLcjs = require('../chunk-OPSK22DL.cjs');
|
|
748
748
|
require('../chunk-WOFXZ3XU.cjs');
|
|
749
749
|
|
|
750
750
|
|
|
@@ -4832,7 +4832,7 @@ function checkImageEffectPlace(d, place) {
|
|
|
4832
4832
|
const allowed = IMAGE_EFFECT_PLACES[place];
|
|
4833
4833
|
if (d.kind === "motion" || !d.uses.some((u) => allowed.includes(u))) {
|
|
4834
4834
|
const instead = place === "filter" && d.uses.some((u) => IMAGE_EFFECT_PLACES.layer.includes(u)) ? "; add it as an effect layer with add_effect_layer instead" : place === "layer" && d.uses.includes("filter") ? "; apply it to a layer as a smart filter with apply_effect instead" : "";
|
|
4835
|
-
throw new (0,
|
|
4835
|
+
throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(
|
|
4836
4836
|
`"${d.id}" (${d.name}) is a ${d.uses.join(" / ")} effect, and ${place === "filter" ? "a smart filter takes filter effects" : "an effect layer takes generator, overlay or title effects"}${instead}.`,
|
|
4837
4837
|
d.id
|
|
4838
4838
|
);
|
|
@@ -4856,9 +4856,9 @@ function effectPixelsToSurface(p, depth) {
|
|
|
4856
4856
|
const d = new Uint16Array(f.length);
|
|
4857
4857
|
const code = (v) => v > 0 ? v < 1 ? Math.round(v * 65535) : 65535 : 0;
|
|
4858
4858
|
for (let i = 0; i < f.length; i += 4) {
|
|
4859
|
-
d[i] = code(
|
|
4860
|
-
d[i + 1] = code(
|
|
4861
|
-
d[i + 2] = code(
|
|
4859
|
+
d[i] = code(_chunkOPSK22DLcjs.linearToSrgb.call(void 0, f[i]));
|
|
4860
|
+
d[i + 1] = code(_chunkOPSK22DLcjs.linearToSrgb.call(void 0, f[i + 1]));
|
|
4861
|
+
d[i + 2] = code(_chunkOPSK22DLcjs.linearToSrgb.call(void 0, f[i + 2]));
|
|
4862
4862
|
d[i + 3] = code(f[i + 3]);
|
|
4863
4863
|
}
|
|
4864
4864
|
return _chunkOLNIPTB3cjs.surfaceFromDeepPixels.call(void 0, { width: p.width, height: p.height, data: d }, 4);
|
|
@@ -4875,7 +4875,7 @@ var ImageEffectsEngine = (_class9 = class {
|
|
|
4875
4875
|
__init49() {this.generation = 0}
|
|
4876
4876
|
|
|
4877
4877
|
constructor(options = {}) {;_class9.prototype.__init44.call(this);_class9.prototype.__init45.call(this);_class9.prototype.__init46.call(this);_class9.prototype.__init47.call(this);_class9.prototype.__init48.call(this);_class9.prototype.__init49.call(this);
|
|
4878
|
-
this.slot = _nullishCoalesce(options.slot, () => ( new (0,
|
|
4878
|
+
this.slot = _nullishCoalesce(options.slot, () => ( new (0, _chunkOPSK22DLcjs.EffectsSlot)()));
|
|
4879
4879
|
this.maxEntries = _nullishCoalesce(options.maxEntries, () => ( 24));
|
|
4880
4880
|
this.pool = new (0, _chunkPY4GWSE2cjs.EffectRendererPool)({ maxRenderers: options.maxRenderers });
|
|
4881
4881
|
this.detach = this.slot.subscribe(() => {
|
|
@@ -4935,7 +4935,7 @@ var ImageEffectsEngine = (_class9 = class {
|
|
|
4935
4935
|
const provider = this.slot.require();
|
|
4936
4936
|
const depth = _nullishCoalesce(size.depth, () => ( 8));
|
|
4937
4937
|
const out = await this.render(provider, effect, size.width, size.height, depth, { time: _nullishCoalesce(size.time, () => ( 0)), values });
|
|
4938
|
-
return out.width === size.width && out.height === size.height ? out :
|
|
4938
|
+
return out.width === size.width && out.height === size.height ? out : _chunkOPSK22DLcjs.createEffectPixels.call(void 0, size.width, size.height);
|
|
4939
4939
|
}
|
|
4940
4940
|
/** Why the result for `key` failed, if it did. */
|
|
4941
4941
|
failure(key2) {
|
|
@@ -6197,7 +6197,7 @@ var ImageEditorController = (_class12 = class {
|
|
|
6197
6197
|
__init84() {this.selectionWorker = null}
|
|
6198
6198
|
__init85() {this.documentOpener = null}
|
|
6199
6199
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
6200
|
-
__init86() {this.effects = new (0,
|
|
6200
|
+
__init86() {this.effects = new (0, _chunkOPSK22DLcjs.EffectsSlot)()}
|
|
6201
6201
|
/** Renders provider effects: effect smart filter results and effect layers. */
|
|
6202
6202
|
__init87() {this.effectsEngine = new ImageEffectsEngine({ slot: this.effects })}
|
|
6203
6203
|
__init88() {this.effectRefresh = "none"}
|
|
@@ -6533,7 +6533,7 @@ var ImageEditorController = (_class12 = class {
|
|
|
6533
6533
|
*/
|
|
6534
6534
|
async applyEffectFilter(layerId, effect, options = {}) {
|
|
6535
6535
|
const d = await this.describeEffect(effect, "filter");
|
|
6536
|
-
const values =
|
|
6536
|
+
const values = _chunkOPSK22DLcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
6537
6537
|
const found = _chunkHB4ICNNAcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
6538
6538
|
if (!found) throw new (0, _chunk5VQXSS2Scjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
|
|
6539
6539
|
let layers = this.state.layers;
|
|
@@ -6575,7 +6575,7 @@ var ImageEditorController = (_class12 = class {
|
|
|
6575
6575
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
6576
6576
|
else throw new (0, _chunk5VQXSS2Scjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
6577
6577
|
}
|
|
6578
|
-
update.values = { ...base, ...
|
|
6578
|
+
update.values = { ...base, ..._chunkOPSK22DLcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
6579
6579
|
}
|
|
6580
6580
|
for (const k of ["enabled", "blend", "opacity", "preserveTransparency"]) if (changes[k] !== void 0) update[k] = changes[k];
|
|
6581
6581
|
let res = _chunk5VQXSS2Scjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
|
|
@@ -6602,7 +6602,7 @@ var ImageEditorController = (_class12 = class {
|
|
|
6602
6602
|
const id = options.id && !ids.has(options.id) ? options.id : _chunk5VQXSS2Scjs.newLayerId.call(void 0, );
|
|
6603
6603
|
const placed = _chunk5VQXSS2Scjs.placeLayer.call(void 0, this.state.layers, { type: "pixel", id, name: "", visible: true, opacity: 1, blend: "normal", surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } }, this.newLayerPlacement(options));
|
|
6604
6604
|
if (options.clipped) requireClipBase(placed, id);
|
|
6605
|
-
const values =
|
|
6605
|
+
const values = _chunkOPSK22DLcjs.resolveEffectValues.call(void 0, d, withBackgroundOpacity(d, options.values, hasLayersBelow(placed, id)));
|
|
6606
6606
|
const { width, height } = this.naturalSize;
|
|
6607
6607
|
const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time });
|
|
6608
6608
|
const layer = {
|
|
@@ -6647,7 +6647,7 @@ var ImageEditorController = (_class12 = class {
|
|
|
6647
6647
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
6648
6648
|
else throw new (0, _chunk5VQXSS2Scjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
6649
6649
|
}
|
|
6650
|
-
const values = { ...base, ...
|
|
6650
|
+
const values = { ...base, ..._chunkOPSK22DLcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
6651
6651
|
const time = changes.time === void 0 ? _nullishCoalesce(g.time, () => ( 0)) : checkEffectTime(changes.time);
|
|
6652
6652
|
const animate = changes.animate === void 0 ? g.animate : changes.animate === null ? void 0 : checkEffectAnimation(changes.animate);
|
|
6653
6653
|
const { width, height } = this.naturalSize;
|
|
@@ -21880,7 +21880,7 @@ function createImageEffectsToolProvider(controller, options = {}) {
|
|
|
21880
21880
|
return { target, effect: _nullishCoalesce(effects.find((e) => e.id === instance), () => ( effects[effects.length - 1])), effects, ...extra };
|
|
21881
21881
|
};
|
|
21882
21882
|
const plainValues = (v) => v;
|
|
21883
|
-
return withImagePlayback(
|
|
21883
|
+
return withImagePlayback(_chunkOPSK22DLcjs.createEffectToolProvider.call(void 0, {
|
|
21884
21884
|
id: _nullishCoalesce(options.id, () => ( "image-effects")),
|
|
21885
21885
|
namespace: options.namespace,
|
|
21886
21886
|
title: "Image effects",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk5T3H7CGGcjs = require('../chunk-5T3H7CGG.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -137,7 +137,7 @@ require('../chunk-NM3G4VQT.cjs');
|
|
|
137
137
|
|
|
138
138
|
|
|
139
139
|
|
|
140
|
-
var
|
|
140
|
+
var _chunkOPSK22DLcjs = require('../chunk-OPSK22DL.cjs');
|
|
141
141
|
require('../chunk-WOFXZ3XU.cjs');
|
|
142
142
|
|
|
143
143
|
|
|
@@ -3213,7 +3213,7 @@ function timeLapseVideo(frameCount, width, height, fps, holdMs, name = "Time-lap
|
|
|
3213
3213
|
}
|
|
3214
3214
|
const video = { version: 1, name, width: w, height: h, fps, background: "#000000", assets, tracks: [{ id: "v1", kind: "video", clips }] };
|
|
3215
3215
|
const durationMs = frameCount ? clips[clips.length - 1].start + clips[clips.length - 1].duration : 0;
|
|
3216
|
-
return { video, ffmpeg:
|
|
3216
|
+
return { video, ffmpeg: _chunk5T3H7CGGcjs.toVideoFfmpeg.call(void 0, video, { output: "timelapse.mp4" }), durationMs };
|
|
3217
3217
|
}
|
|
3218
3218
|
async function buildTimeLapse(source, target, options = {}) {
|
|
3219
3219
|
const maxSide = Math.max(32, Math.min(4096, Math.round(_nullishCoalesce(options.maxSide, () => ( 720)))));
|
|
@@ -3296,7 +3296,7 @@ function checkPaintEffectPlace(d, place) {
|
|
|
3296
3296
|
else if (d.uses.includes("filter") && place !== "light") instead = "; run it on a layer's dried paint with apply_effect instead";
|
|
3297
3297
|
else if (place === "light" && d.uses.some((u) => PAINT_EFFECT_PLACES.layer.includes(u))) instead = "; add it as an effect layer (add_effect_layer) or fill a layer with it (fill_layer_with_effect) instead";
|
|
3298
3298
|
else if (place === "paper" && d.uses.some((u) => u === "overlay" || u === "title")) instead = "; add it as an effect layer with add_effect_layer instead";
|
|
3299
|
-
throw new (0,
|
|
3299
|
+
throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) is a ${d.uses.join(" / ") || d.kind} effect, and ${PLACE_WORDS[place]}${instead}.`, d.id);
|
|
3300
3300
|
}
|
|
3301
3301
|
var PAPER_EFFECT_BLENDS = ["multiply", "normal", "overlay", "soft-light", "screen", "color"];
|
|
3302
3302
|
var paperVersion = 1;
|
|
@@ -3479,7 +3479,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3479
3479
|
/** Set while an operation that changes wet paint runs: the simulation before it (for undo). */
|
|
3480
3480
|
__init106() {this.wetOp = null}
|
|
3481
3481
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
3482
|
-
__init107() {this.effects = new (0,
|
|
3482
|
+
__init107() {this.effects = new (0, _chunkOPSK22DLcjs.EffectsSlot)()}
|
|
3483
3483
|
__init108() {this.effectsRenderer = new PaintEffectsRenderer()}
|
|
3484
3484
|
__init109() {this.paperEffectNodeCache = null}
|
|
3485
3485
|
constructor(options = {}) {;_class10.prototype.__init72.call(this);_class10.prototype.__init73.call(this);_class10.prototype.__init74.call(this);_class10.prototype.__init75.call(this);_class10.prototype.__init76.call(this);_class10.prototype.__init77.call(this);_class10.prototype.__init78.call(this);_class10.prototype.__init79.call(this);_class10.prototype.__init80.call(this);_class10.prototype.__init81.call(this);_class10.prototype.__init82.call(this);_class10.prototype.__init83.call(this);_class10.prototype.__init84.call(this);_class10.prototype.__init85.call(this);_class10.prototype.__init86.call(this);_class10.prototype.__init87.call(this);_class10.prototype.__init88.call(this);_class10.prototype.__init89.call(this);_class10.prototype.__init90.call(this);_class10.prototype.__init91.call(this);_class10.prototype.__init92.call(this);_class10.prototype.__init93.call(this);_class10.prototype.__init94.call(this);_class10.prototype.__init95.call(this);_class10.prototype.__init96.call(this);_class10.prototype.__init97.call(this);_class10.prototype.__init98.call(this);_class10.prototype.__init99.call(this);_class10.prototype.__init100.call(this);_class10.prototype.__init101.call(this);_class10.prototype.__init102.call(this);_class10.prototype.__init103.call(this);_class10.prototype.__init104.call(this);_class10.prototype.__init105.call(this);_class10.prototype.__init106.call(this);_class10.prototype.__init107.call(this);_class10.prototype.__init108.call(this);_class10.prototype.__init109.call(this);_class10.prototype.__init110.call(this);_class10.prototype.__init111.call(this);_class10.prototype.__init112.call(this);_class10.prototype.__init113.call(this);
|
|
@@ -4154,7 +4154,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4154
4154
|
if (v === null) merged[k] = d.defaults[k];
|
|
4155
4155
|
else given[k] = v;
|
|
4156
4156
|
}
|
|
4157
|
-
return { ...merged, ...
|
|
4157
|
+
return { ...merged, ..._chunkOPSK22DLcjs.resolveEffectValues.call(void 0, { ...d, defaults: merged }, given) };
|
|
4158
4158
|
}
|
|
4159
4159
|
/** Renders a generator, overlay or title effect at the canvas size. */
|
|
4160
4160
|
renderEffectCanvas(d, values, time = 0) {
|
|
@@ -8917,7 +8917,7 @@ function createPaintEffectsToolProvider(controller, options = {}) {
|
|
|
8917
8917
|
if (changes.enabled !== void 0) throw new Error("enabled does not apply here: hide an effect layer with update_layer visible false, or remove the effect paper.");
|
|
8918
8918
|
};
|
|
8919
8919
|
const values = (v) => v;
|
|
8920
|
-
return withPaintPlayback(
|
|
8920
|
+
return withPaintPlayback(_chunkOPSK22DLcjs.createEffectToolProvider.call(void 0, {
|
|
8921
8921
|
id: _nullishCoalesce(options.id, () => ( "paint-effects")),
|
|
8922
8922
|
namespace: options.namespace,
|
|
8923
8923
|
title: "Paint effects",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toVideoFfmpeg
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-CSM5T6SE.js";
|
|
4
4
|
import {
|
|
5
5
|
deserializeLayers,
|
|
6
6
|
exportPsd,
|
|
@@ -137,7 +137,7 @@ import {
|
|
|
137
137
|
EffectsSlot,
|
|
138
138
|
createEffectToolProvider,
|
|
139
139
|
resolveEffectValues
|
|
140
|
-
} from "../chunk-
|
|
140
|
+
} from "../chunk-TCZ2J7PR.js";
|
|
141
141
|
import "../chunk-V2ZCJRDM.js";
|
|
142
142
|
import {
|
|
143
143
|
CoverageMap,
|
package/dist/vector/index.cjs
CHANGED
|
@@ -558,7 +558,7 @@ var _chunkNM3G4VQTcjs = require('../chunk-NM3G4VQT.cjs');
|
|
|
558
558
|
|
|
559
559
|
|
|
560
560
|
|
|
561
|
-
var
|
|
561
|
+
var _chunkOPSK22DLcjs = require('../chunk-OPSK22DL.cjs');
|
|
562
562
|
require('../chunk-WOFXZ3XU.cjs');
|
|
563
563
|
|
|
564
564
|
|
|
@@ -7328,7 +7328,7 @@ var VectorEditorController = (_class7 = class _VectorEditorController {
|
|
|
7328
7328
|
}
|
|
7329
7329
|
// --- Provider effects ---
|
|
7330
7330
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
7331
|
-
__init59() {this.effects = new (0,
|
|
7331
|
+
__init59() {this.effects = new (0, _chunkOPSK22DLcjs.EffectsSlot)()}
|
|
7332
7332
|
/** The registered effects provider, or `null`. */
|
|
7333
7333
|
get effectsProvider() {
|
|
7334
7334
|
return this.effects.provider;
|
|
@@ -7352,10 +7352,10 @@ var VectorEditorController = (_class7 = class _VectorEditorController {
|
|
|
7352
7352
|
/** The effect's picture as group children, scaled into `box` (an affine fit). */
|
|
7353
7353
|
async vectorEffectPicture(effect, values) {
|
|
7354
7354
|
const provider = this.effects.require();
|
|
7355
|
-
if (!provider.applyVectorEffect) throw new (0,
|
|
7355
|
+
if (!provider.applyVectorEffect) throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`${provider.name} has no vector effects.`);
|
|
7356
7356
|
const d = await provider.describe(effect);
|
|
7357
|
-
if (d.kind !== "vector") throw new (0,
|
|
7358
|
-
const resolved =
|
|
7357
|
+
if (d.kind !== "vector") throw new (0, _chunkOPSK22DLcjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) is a ${d.kind} effect; the vector editor adds vector effects, which bring their own picture${d.kind === "motion" ? " (apply motion in the animation editor)" : ""}.`, d.id);
|
|
7358
|
+
const resolved = _chunkOPSK22DLcjs.resolveEffectValues.call(void 0, d, values);
|
|
7359
7359
|
const motion = await provider.applyVectorEffect(d.id, this.toSvg(), resolved);
|
|
7360
7360
|
const parsed = _chunkBQE3Y6ZOcjs.parseVectorSvg.call(void 0, motion.svg);
|
|
7361
7361
|
if (!parsed.nodes.length) throw new Error(`"${d.name}" drew no shapes the editor can read.`);
|
|
@@ -18172,7 +18172,7 @@ function createVectorEffectsToolProvider(controller, options = {}) {
|
|
|
18172
18172
|
const effects = _optionalChain([g, 'optionalAccess', _765 => _765.providerEffect]) ? [info(g)] : [];
|
|
18173
18173
|
return { target: id, effect: _nullishCoalesce(removed, () => ( effects[0])), effects };
|
|
18174
18174
|
};
|
|
18175
|
-
return
|
|
18175
|
+
return _chunkOPSK22DLcjs.createEffectToolProvider.call(void 0, {
|
|
18176
18176
|
id: _nullishCoalesce(options.id, () => ( "vector-effects")),
|
|
18177
18177
|
namespace: options.namespace,
|
|
18178
18178
|
title: "Vector effects",
|