@pixerate/editor 0.249.0 → 0.251.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 +40 -41
- package/dist/agent/index.js +9 -10
- package/dist/animation/index.cjs +6 -7
- package/dist/animation/index.js +5 -6
- package/dist/animation-editor/index.cjs +124 -123
- package/dist/animation-editor/index.js +15 -14
- package/dist/brushes/index.cjs +1406 -0
- package/dist/brushes/index.d.cts +12 -0
- package/dist/brushes/index.d.ts +12 -0
- package/dist/brushes/index.js +1406 -0
- package/dist/brushes/migrate.d.cts +17 -0
- package/dist/brushes/migrate.d.ts +17 -0
- package/dist/brushes/normalize.d.cts +15 -0
- package/dist/brushes/normalize.d.ts +15 -0
- package/dist/brushes/presets.d.cts +12 -0
- package/dist/brushes/presets.d.ts +12 -0
- package/dist/brushes/resolve.d.cts +56 -0
- package/dist/brushes/resolve.d.ts +56 -0
- package/dist/brushes/schema.d.cts +29 -0
- package/dist/brushes/schema.d.ts +29 -0
- package/dist/brushes/types.d.cts +323 -0
- package/dist/brushes/types.d.ts +323 -0
- package/dist/{brushstrokeRender-T3JZST44.js → brushstrokeRender-5PYSKZIJ.js} +9 -8
- package/dist/{brushstrokeRender-GCKK7V2I.cjs → brushstrokeRender-7FLLSQEC.cjs} +15 -14
- package/dist/canvas/index.cjs +120 -65
- package/dist/canvas/index.d.cts +1 -0
- package/dist/canvas/index.d.ts +1 -0
- package/dist/canvas/index.js +88 -33
- package/dist/canvas/stickers.d.cts +35 -0
- package/dist/canvas/stickers.d.ts +35 -0
- package/dist/chart/index.cjs +159 -160
- package/dist/chart/index.js +9 -10
- package/dist/{chunk-RXZL4NG5.js → chunk-226QDRO3.js} +1 -1
- package/dist/{chunk-DOIU7VJG.js → chunk-2ZJ4DT3M.js} +1 -1
- package/dist/{chunk-XZNU4DUX.cjs → chunk-3NS5C7FB.cjs} +76 -76
- package/dist/{chunk-UTI5IITZ.cjs → chunk-4ZC5QJE2.cjs} +3 -3
- package/dist/{chunk-L3JFOTBQ.js → chunk-5E2Q7ZHI.js} +1 -1
- package/dist/{chunk-6BIDVPED.js → chunk-5JNA6LLY.js} +1 -1
- package/dist/{chunk-RD7RX52G.cjs → chunk-5UEFBM2M.cjs} +207 -18
- package/dist/{chunk-WA44NKPF.js → chunk-62Z5WLRA.js} +1 -1
- package/dist/{chunk-BVRRIW7F.js → chunk-6GRUVGKU.js} +3 -3
- package/dist/{chunk-QARCM66V.js → chunk-6ZZKRH7R.js} +3 -3
- package/dist/{chunk-BP6KSGVD.js → chunk-7272D3K2.js} +4 -6
- package/dist/{chunk-O75V4ZS3.js → chunk-7P6VF3FG.js} +2 -2
- package/dist/{chunk-AU6MWQKZ.js → chunk-ABL7IWFZ.js} +1 -1
- package/dist/{chunk-5RH3VXAK.js → chunk-APX63ILU.js} +4 -100
- package/dist/{chunk-W7L4HUT2.cjs → chunk-CJ6TBL2N.cjs} +16 -16
- package/dist/{chunk-7PT4RJL5.cjs → chunk-EUIDTZNQ.cjs} +111 -113
- package/dist/{chunk-CXXXAZ7H.js → chunk-F6R67I3A.js} +1 -1
- package/dist/{chunk-I7NJPHWV.cjs → chunk-FQPUF2W2.cjs} +35 -606
- package/dist/{chunk-D5KGAO4Z.js → chunk-GCVFEPJG.js} +2 -573
- package/dist/{chunk-LEQKZGQI.js → chunk-GOBOCZZI.js} +1 -1
- package/dist/{chunk-PZP2SZIZ.js → chunk-GYMMNCFT.js} +3 -3
- package/dist/{chunk-NUTMINJZ.cjs → chunk-H7ET2ISK.cjs} +52 -52
- package/dist/chunk-HS6QDWDF.cjs +1029 -0
- package/dist/{chunk-T7KQEMAE.cjs → chunk-HUAISCUX.cjs} +18 -18
- package/dist/{chunk-YGQVCQTG.js → chunk-ILP77UD6.js} +1 -1
- package/dist/{chunk-GHCSC2WP.cjs → chunk-ISIO63Q5.cjs} +21 -15
- package/dist/{chunk-S6OT6CTS.cjs → chunk-IWEVV63O.cjs} +31 -33
- package/dist/{chunk-OFH6Q67U.js → chunk-JA57JIT5.js} +9 -3
- package/dist/{chunk-LP2MCSBE.cjs → chunk-JFHBXNR2.cjs} +88 -88
- package/dist/{chunk-IOFVM3L3.cjs → chunk-JPEHXIB5.cjs} +10 -10
- package/dist/chunk-JSDND7DF.cjs +173 -0
- package/dist/{chunk-36ZTV7WO.js → chunk-L6Y7TSQ4.js} +1 -1
- package/dist/{chunk-KYX7NZ5V.cjs → chunk-LFMKWGFL.cjs} +1 -1
- package/dist/{chunk-V6DT2CDH.js → chunk-M2TPMYJE.js} +1 -1
- package/dist/{chunk-LJZRHVZV.cjs → chunk-M5GLQQWG.cjs} +2 -2
- package/dist/{chunk-JEGJP4OW.js → chunk-MHLU6GRJ.js} +196 -7
- package/dist/{chunk-KMPM5JM5.js → chunk-MONXNVZK.js} +4 -6
- package/dist/chunk-MTKY6K3Q.js +1029 -0
- package/dist/{chunk-MOW3JMNG.cjs → chunk-N76AMOKE.cjs} +42 -42
- package/dist/{chunk-75K3W4D6.cjs → chunk-NKGB64CW.cjs} +16 -16
- package/dist/{chunk-SGPIVHJB.js → chunk-P3K2JCJA.js} +3 -3
- package/dist/chunk-PXDIAYB6.cjs +594 -0
- package/dist/{chunk-UBRJOIR5.js → chunk-QC3OXRE4.js} +9 -9
- package/dist/{chunk-QOBCBGGI.cjs → chunk-QKXO6JPP.cjs} +14 -14
- package/dist/{chunk-WLJZZHUZ.cjs → chunk-QLSGTCYT.cjs} +23 -23
- package/dist/{chunk-7YW7T5TJ.js → chunk-RHPSE2YR.js} +2 -2
- package/dist/{chunk-44BMJJVA.cjs → chunk-RUONPPMC.cjs} +8 -8
- package/dist/{chunk-LJRCU3BJ.cjs → chunk-SABJMH6M.cjs} +150 -15
- package/dist/{chunk-XWOLPNBW.cjs → chunk-SOSBOS5T.cjs} +22 -22
- package/dist/chunk-SZTI6EER.js +13 -0
- package/dist/{chunk-PPFJHTW5.cjs → chunk-TFF2GTGN.cjs} +22 -24
- package/dist/{chunk-2SMMZDMG.cjs → chunk-TLOGFIIV.cjs} +37 -37
- package/dist/chunk-TXFWZ5ZJ.js +594 -0
- package/dist/chunk-U67EN7GG.cjs +13 -0
- package/dist/{chunk-GXAK6Q5J.js → chunk-UFEDHACQ.js} +2 -2
- package/dist/{chunk-GA4EU4P3.cjs → chunk-UXETV2NC.cjs} +4 -4
- package/dist/{chunk-N4DFDI73.js → chunk-WKMUBATU.js} +1 -1
- package/dist/{chunk-3R5P3DVY.cjs → chunk-WRZ6C4TU.cjs} +6 -6
- package/dist/{chunk-EJLRBS5Q.js → chunk-WZOGDKCQ.js} +137 -2
- package/dist/{chunk-6ADHGQ73.js → chunk-YBAPT7NL.js} +2 -4
- package/dist/{chunk-K5DS2JTA.cjs → chunk-Z3BRH4JK.cjs} +6 -6
- package/dist/{chunk-XNZFVYC2.cjs → chunk-ZBCT5MEA.cjs} +7 -7
- package/dist/color/index.cjs +4 -6
- package/dist/color/index.js +7 -9
- package/dist/effects/helpers.d.cts +6 -0
- package/dist/effects/helpers.d.ts +6 -0
- package/dist/effects/index.cjs +62 -60
- package/dist/effects/index.js +5 -3
- package/dist/effects/tools.d.cts +6 -0
- package/dist/effects/tools.d.ts +6 -0
- package/dist/export/index.cjs +7 -8
- package/dist/export/index.js +6 -7
- package/dist/extensions/index.cjs +10 -11
- package/dist/extensions/index.js +9 -10
- package/dist/gradient/index.cjs +33 -34
- package/dist/gradient/index.js +4 -5
- package/dist/image-editor/effects.d.cts +1 -1
- package/dist/image-editor/effects.d.ts +1 -1
- package/dist/image-editor/index.cjs +887 -863
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +69 -45
- package/dist/image-editor/stickers.d.cts +9 -0
- package/dist/image-editor/stickers.d.ts +9 -0
- package/dist/index.cjs +16 -17
- package/dist/index.js +10 -11
- package/dist/paint/index.cjs +6 -4
- package/dist/paint/index.js +21 -19
- package/dist/paint-editor/brushes.d.cts +1 -2
- package/dist/paint-editor/brushes.d.ts +1 -2
- package/dist/paint-editor/index.cjs +2199 -699
- package/dist/paint-editor/index.js +1577 -77
- package/dist/paint-editor/mark-settings.d.cts +104 -0
- package/dist/paint-editor/mark-settings.d.ts +104 -0
- package/dist/paint-editor/procedural.d.cts +2 -75
- package/dist/paint-editor/procedural.d.ts +2 -75
- package/dist/paint-editor/stickers.d.cts +1 -22
- package/dist/paint-editor/stickers.d.ts +1 -22
- package/dist/raster/index.cjs +2 -2
- package/dist/raster/index.js +9 -9
- package/dist/stickers/index.cjs +22 -16
- package/dist/stickers/index.d.cts +1 -1
- package/dist/stickers/index.d.ts +1 -1
- package/dist/stickers/index.js +14 -8
- package/dist/stickers/tools.d.cts +57 -1
- package/dist/stickers/tools.d.ts +57 -1
- package/dist/tokens/index.cjs +3 -4
- package/dist/tokens/index.js +2 -3
- package/dist/typography/index.cjs +7 -8
- package/dist/typography/index.js +2 -3
- package/dist/vector/index.cjs +1011 -977
- package/dist/vector/index.d.cts +1 -0
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.js +47 -13
- package/dist/vector/stickers.d.cts +11 -0
- package/dist/vector/stickers.d.ts +11 -0
- package/dist/video-editor/index.cjs +349 -350
- package/dist/video-editor/index.js +9 -10
- package/package.json +11 -1
- package/skills/pixerate-image-editor/SKILL.md +1 -1
- package/skills/pixerate-stickers/SKILL.md +13 -1
- package/dist/chunk-7AHBW2CQ.cjs +0 -200
- package/dist/chunk-F67XMVDI.js +0 -200
- package/dist/chunk-H4AOUUBE.cjs +0 -2635
- package/dist/chunk-J7T5QZ45.js +0 -2635
- package/dist/chunk-ZEYMKDYS.cjs +0 -269
|
@@ -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;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkTLOGFIIVcjs = require('../chunk-TLOGFIIV.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ var _chunkDGWOGQJ5cjs = require('../chunk-DGWOGQJ5.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkZ3BRH4JKcjs = require('../chunk-Z3BRH4JK.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -39,9 +39,9 @@ var _chunkK5DS2JTAcjs = require('../chunk-K5DS2JTA.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
require('../chunk-
|
|
44
|
-
require('../chunk-
|
|
42
|
+
var _chunkJPEHXIB5cjs = require('../chunk-JPEHXIB5.cjs');
|
|
43
|
+
require('../chunk-HS6QDWDF.cjs');
|
|
44
|
+
require('../chunk-JSDND7DF.cjs');
|
|
45
45
|
require('../chunk-CVFAAZXE.cjs');
|
|
46
46
|
|
|
47
47
|
|
|
@@ -51,6 +51,7 @@ require('../chunk-CVFAAZXE.cjs');
|
|
|
51
51
|
|
|
52
52
|
var _chunkGF2RBSDMcjs = require('../chunk-GF2RBSDM.cjs');
|
|
53
53
|
require('../chunk-NM3G4VQT.cjs');
|
|
54
|
+
require('../chunk-U67EN7GG.cjs');
|
|
54
55
|
|
|
55
56
|
|
|
56
57
|
var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
|
|
@@ -70,13 +71,14 @@ var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
|
|
|
70
71
|
|
|
71
72
|
|
|
72
73
|
|
|
73
|
-
var
|
|
74
|
+
var _chunkISIO63Q5cjs = require('../chunk-ISIO63Q5.cjs');
|
|
74
75
|
require('../chunk-WOFXZ3XU.cjs');
|
|
75
|
-
require('../chunk-
|
|
76
|
+
require('../chunk-PXDIAYB6.cjs');
|
|
77
|
+
require('../chunk-FQPUF2W2.cjs');
|
|
76
78
|
require('../chunk-3K6HWEXZ.cjs');
|
|
77
79
|
require('../chunk-YQGCPL5X.cjs');
|
|
78
|
-
require('../chunk-2VX55NFM.cjs');
|
|
79
80
|
require('../chunk-W5M3J7PV.cjs');
|
|
81
|
+
require('../chunk-2VX55NFM.cjs');
|
|
80
82
|
require('../chunk-474IQG74.cjs');
|
|
81
83
|
require('../chunk-XFM3OCHU.cjs');
|
|
82
84
|
require('../chunk-NIBFDFYW.cjs');
|
|
@@ -97,7 +99,7 @@ var _chunkWKPXOGZZcjs = require('../chunk-WKPXOGZZ.cjs');
|
|
|
97
99
|
var _chunk7B5GTJXBcjs = require('../chunk-7B5GTJXB.cjs');
|
|
98
100
|
|
|
99
101
|
|
|
100
|
-
var
|
|
102
|
+
var _chunkM5GLQQWGcjs = require('../chunk-M5GLQQWG.cjs');
|
|
101
103
|
|
|
102
104
|
|
|
103
105
|
|
|
@@ -109,16 +111,15 @@ var _chunkLJZRHVZVcjs = require('../chunk-LJZRHVZV.cjs');
|
|
|
109
111
|
var _chunkDWJJI6RTcjs = require('../chunk-DWJJI6RT.cjs');
|
|
110
112
|
|
|
111
113
|
|
|
112
|
-
var
|
|
114
|
+
var _chunk4ZC5QJE2cjs = require('../chunk-4ZC5QJE2.cjs');
|
|
113
115
|
|
|
114
116
|
|
|
115
117
|
|
|
116
118
|
|
|
117
119
|
var _chunkA6QWKBJPcjs = require('../chunk-A6QWKBJP.cjs');
|
|
118
|
-
require('../chunk-
|
|
119
|
-
require('../chunk-
|
|
120
|
-
require('../chunk-
|
|
121
|
-
require('../chunk-7AHBW2CQ.cjs');
|
|
120
|
+
require('../chunk-EUIDTZNQ.cjs');
|
|
121
|
+
require('../chunk-TFF2GTGN.cjs');
|
|
122
|
+
require('../chunk-5UEFBM2M.cjs');
|
|
122
123
|
require('../chunk-IPJ3TEYR.cjs');
|
|
123
124
|
|
|
124
125
|
// src/animation-editor/types.ts
|
|
@@ -505,11 +506,11 @@ function shotLayersShapeProblems(shot, name) {
|
|
|
505
506
|
if (layer.effect === void 0 && layer.subject === void 0) problems.push(`${where} needs an "effect", a "subject" or both.`);
|
|
506
507
|
if (layer.effect !== void 0 && (typeof layer.effect !== "string" || !layer.effect)) problems.push(`${where}: "effect" must be an effect id.`);
|
|
507
508
|
if (layer.subject !== void 0) {
|
|
508
|
-
const kind =
|
|
509
|
+
const kind = _chunkZ3BRH4JKcjs.effectSubjectKind.call(void 0, layer.subject);
|
|
509
510
|
if (kind === "video") problems.push(`${where}: an animation layer cannot play a video; use { "image" }, { "svg" }, { "text" } or { "slot" } (the video editor plays video).`);
|
|
510
511
|
else if (!kind || !String(layer.subject[kind]).trim()) problems.push(`${where}: "subject" must be { "image": url }, { "svg": markup }, { "text": words } or { "slot": name }.`);
|
|
511
512
|
}
|
|
512
|
-
if (layer.role !== void 0 && !
|
|
513
|
+
if (layer.role !== void 0 && !_chunkISIO63Q5cjs.EFFECT_LAYER_ROLES.includes(layer.role)) problems.push(`${where}: "role" must be one of ${_chunkISIO63Q5cjs.EFFECT_LAYER_ROLES.join(", ")}.`);
|
|
513
514
|
if (layer.rect !== void 0) {
|
|
514
515
|
const r = layer.rect;
|
|
515
516
|
if (!isObject(r) || !["x", "y", "width", "height"].every((k) => isNum(r[k])) || !(r.width > 0 && r.height > 0)) problems.push(`${where}: "rect" must be { x, y, width, height } in artwork units, width and height > 0.`);
|
|
@@ -701,7 +702,7 @@ function smoothMotionTimes(points, start, duration, pacing = "even") {
|
|
|
701
702
|
function motionTextLayout(nodes, id) {
|
|
702
703
|
const group = _optionalChain([nodes, 'access', _5 => _5.get, 'call', _6 => _6(id), 'optionalAccess', _7 => _7.node]);
|
|
703
704
|
if (!group || group.type !== "group") return null;
|
|
704
|
-
const letters =
|
|
705
|
+
const letters = _chunkJPEHXIB5cjs.collectPathNodes.call(void 0, group).map((p) => ({ id: p.id, b: _optionalChain([nodes, 'access', _8 => _8.get, 'call', _9 => _9(p.id), 'optionalAccess', _10 => _10.bounds]) })).filter((l) => !!l.b && l.b.width + l.b.height > 0);
|
|
705
706
|
if (!letters.length) return null;
|
|
706
707
|
const lines = [];
|
|
707
708
|
for (const l of [...letters].sort((a, c) => a.b.y + a.b.height / 2 - (c.b.y + c.b.height / 2))) {
|
|
@@ -786,21 +787,21 @@ function indexMotionNodes(nodes) {
|
|
|
786
787
|
const out = /* @__PURE__ */ new Map();
|
|
787
788
|
const walk = (list, parentWorld, ancestors) => {
|
|
788
789
|
for (const node of list) {
|
|
789
|
-
const local =
|
|
790
|
-
const bounds =
|
|
790
|
+
const local = _chunkJPEHXIB5cjs.vectorNodeBounds.call(void 0, node);
|
|
791
|
+
const bounds = _chunkJPEHXIB5cjs.vectorNodeBounds.call(void 0, node, parentWorld);
|
|
791
792
|
const center = local ? { x: local.x + local.width / 2, y: local.y + local.height / 2 } : { x: 0, y: 0 };
|
|
792
793
|
if (!out.has(node.id)) out.set(node.id, { node, ancestors, parentWorld, center, bounds, box: local });
|
|
793
|
-
if (node.type === "group") walk(node.children,
|
|
794
|
+
if (node.type === "group") walk(node.children, _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _chunkJPEHXIB5cjs.nodeMatrix.call(void 0, node), parentWorld), [...ancestors, node.id]);
|
|
794
795
|
}
|
|
795
796
|
};
|
|
796
|
-
walk(nodes,
|
|
797
|
+
walk(nodes, _chunkJPEHXIB5cjs.IDENTITY_MATRIX, []);
|
|
797
798
|
indexCache.set(nodes, out);
|
|
798
799
|
return out;
|
|
799
800
|
}
|
|
800
801
|
var solid = (paint) => typeof paint === "string" && paint !== "none" ? paint : void 0;
|
|
801
802
|
function firstPaint(node, key) {
|
|
802
803
|
if (node.type === "path") return solid(node[key]);
|
|
803
|
-
for (const p of
|
|
804
|
+
for (const p of _chunkJPEHXIB5cjs.collectPathNodes.call(void 0, node)) {
|
|
804
805
|
const s = solid(p[key]);
|
|
805
806
|
if (s) return s;
|
|
806
807
|
}
|
|
@@ -808,7 +809,7 @@ function firstPaint(node, key) {
|
|
|
808
809
|
}
|
|
809
810
|
function strokeReach(node) {
|
|
810
811
|
let reach = 0;
|
|
811
|
-
for (const p of node.type === "path" ? [node] :
|
|
812
|
+
for (const p of node.type === "path" ? [node] : _chunkJPEHXIB5cjs.collectPathNodes.call(void 0, node)) {
|
|
812
813
|
if (p.stroke == null || p.stroke === "none") continue;
|
|
813
814
|
const width = _nullishCoalesce(p.strokeWidth, () => ( 1));
|
|
814
815
|
reach = Math.max(reach, p.strokeAlign === "outside" ? width : p.strokeAlign === "inside" ? 0 : width / 2);
|
|
@@ -878,7 +879,7 @@ function motionRestValue(entry, property, artwork) {
|
|
|
878
879
|
case "stroke":
|
|
879
880
|
return _nullishCoalesce((node && firstPaint(node, property)), () => ( "transparent"));
|
|
880
881
|
case "strokeWidth": {
|
|
881
|
-
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ?
|
|
882
|
+
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ? _chunkJPEHXIB5cjs.collectPathNodes.call(void 0, node)[0] : void 0;
|
|
882
883
|
return _nullishCoalesce(_optionalChain([path, 'optionalAccess', _14 => _14.strokeWidth]), () => ( 1));
|
|
883
884
|
}
|
|
884
885
|
case "shape":
|
|
@@ -902,7 +903,7 @@ function interpolateMotionValue(from, to, u) {
|
|
|
902
903
|
if (u <= 0) return from;
|
|
903
904
|
if (u >= 1) return to;
|
|
904
905
|
if (typeof from === "string" && typeof to === "string") {
|
|
905
|
-
const mixed =
|
|
906
|
+
const mixed = _chunk4ZC5QJE2cjs.mixColorsOklab.call(void 0, from, to, u);
|
|
906
907
|
if (mixed !== null) return mixed;
|
|
907
908
|
}
|
|
908
909
|
return u < 1 ? from : to;
|
|
@@ -989,12 +990,12 @@ function resolveMotionCamera(camera, scene) {
|
|
|
989
990
|
const r = camera;
|
|
990
991
|
return { x: r.x, y: r.y, width: r.width, height: r.height };
|
|
991
992
|
}
|
|
992
|
-
function motionPathLength(node, parentWorld =
|
|
993
|
+
function motionPathLength(node, parentWorld = _chunkJPEHXIB5cjs.IDENTITY_MATRIX) {
|
|
993
994
|
let longest = 0;
|
|
994
|
-
const paths = node.type === "path" ? [node] :
|
|
995
|
+
const paths = node.type === "path" ? [node] : _chunkJPEHXIB5cjs.collectPathNodes.call(void 0, node);
|
|
995
996
|
for (const p of paths) {
|
|
996
997
|
try {
|
|
997
|
-
longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0,
|
|
998
|
+
longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0, _chunkJPEHXIB5cjs.vectorPathWorldBezier.call(void 0, p, parentWorld, { effects: false })));
|
|
998
999
|
} catch (e2) {
|
|
999
1000
|
}
|
|
1000
1001
|
}
|
|
@@ -1130,9 +1131,9 @@ function compileMotionScene(scene) {
|
|
|
1130
1131
|
const start = t;
|
|
1131
1132
|
let cursor = start;
|
|
1132
1133
|
const f = motionShotTimeScale(shot);
|
|
1133
|
-
const moveIn = shot.camera ?
|
|
1134
|
-
const transitionMs = index > 0 && shot.transition ? (_nullishCoalesce(shot.transition.ms, () => (
|
|
1135
|
-
const moveDuring = shot.camera ?
|
|
1134
|
+
const moveIn = shot.camera ? _chunkISIO63Q5cjs.cameraMoveParts.call(void 0, shot.camera.in) : void 0;
|
|
1135
|
+
const transitionMs = index > 0 && shot.transition ? (_nullishCoalesce(shot.transition.ms, () => ( _chunkISIO63Q5cjs.EFFECT_TRANSITION_MS))) * f : 0;
|
|
1136
|
+
const moveDuring = shot.camera ? _chunkISIO63Q5cjs.cameraMoveParts.call(void 0, shot.camera.during) : void 0;
|
|
1136
1137
|
let playsIn = false;
|
|
1137
1138
|
if (shot.camera) {
|
|
1138
1139
|
const framed = motionCameraFramed(shot.camera);
|
|
@@ -1270,12 +1271,12 @@ function compileMotionScene(scene) {
|
|
|
1270
1271
|
const order2 = _nullishCoalesce(o.order, () => ( "together"));
|
|
1271
1272
|
const pace = _nullishCoalesce(o.pace, () => ( "time"));
|
|
1272
1273
|
if (order2 === "together" && pace === "time") return null;
|
|
1273
|
-
const paths = entry.node.type === "path" ? [entry.node] :
|
|
1274
|
+
const paths = entry.node.type === "path" ? [entry.node] : _chunkJPEHXIB5cjs.collectPathNodes.call(void 0, entry.node);
|
|
1274
1275
|
let list = paths.map((p) => {
|
|
1275
1276
|
const at = nodes.get(p.id);
|
|
1276
1277
|
let first = { x: 0, y: 0 };
|
|
1277
1278
|
try {
|
|
1278
|
-
const m =
|
|
1279
|
+
const m = _chunkJPEHXIB5cjs.vectorPathWorldBezier.call(void 0, p, _nullishCoalesce(_optionalChain([at, 'optionalAccess', _42 => _42.parentWorld]), () => ( _chunkJPEHXIB5cjs.IDENTITY_MATRIX)), { effects: false })[0];
|
|
1279
1280
|
if (m && m.type === "M") first = { x: m.x, y: m.y };
|
|
1280
1281
|
} catch (e3) {
|
|
1281
1282
|
}
|
|
@@ -1387,17 +1388,17 @@ function compileMotionScene(scene) {
|
|
|
1387
1388
|
let dx = _nullishCoalesce(_optionalChain([command3, 'access', _45 => _45.by, 'optionalAccess', _46 => _46.x]), () => ( 0));
|
|
1388
1389
|
let dy = _nullishCoalesce(_optionalChain([command3, 'access', _47 => _47.by, 'optionalAccess', _48 => _48.y]), () => ( 0));
|
|
1389
1390
|
if (command3.to) {
|
|
1390
|
-
const inv =
|
|
1391
|
-
const target =
|
|
1391
|
+
const inv = _chunkJPEHXIB5cjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1392
|
+
const target = _chunkJPEHXIB5cjs.applyMatrix.call(void 0, inv, command3.to);
|
|
1392
1393
|
dx = target.x - (entry.center.x + num2("x"));
|
|
1393
1394
|
dy = target.y - (entry.center.y + num2("y"));
|
|
1394
1395
|
}
|
|
1395
1396
|
if (_optionalChain([command3, 'access', _49 => _49.via, 'optionalAccess', _50 => _50.length])) {
|
|
1396
|
-
const inv =
|
|
1397
|
+
const inv = _chunkJPEHXIB5cjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1397
1398
|
const x0 = num2("x");
|
|
1398
1399
|
const y0 = num2("y");
|
|
1399
1400
|
const add = command3.blend === "add";
|
|
1400
|
-
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) =>
|
|
1401
|
+
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) => _chunkJPEHXIB5cjs.applyMatrix.call(void 0, inv, p)).map((p) => ({ x: p.x - entry.center.x - x0, y: p.y - entry.center.y - y0 })), { x: dx, y: dy }];
|
|
1401
1402
|
const times = _optionalChain([command3, 'access', _51 => _51.times, 'optionalAccess', _52 => _52.length]) === command3.via.length ? [start, ...command3.times.map((f) => start + f * (end - start)), end] : smoothMotionTimes(offsets, start, end - start, _nullishCoalesce(command3.pacing, () => ( "even")));
|
|
1402
1403
|
for (const axis of ["x", "y"]) {
|
|
1403
1404
|
const base = add ? 0 : axis === "x" ? x0 : y0;
|
|
@@ -1501,7 +1502,7 @@ function motionShotAt(timeline, time) {
|
|
|
1501
1502
|
// src/animation-editor/camera.ts
|
|
1502
1503
|
var windowCache = /* @__PURE__ */ new WeakMap();
|
|
1503
1504
|
function motionShotCameraMove(shot, role) {
|
|
1504
|
-
return
|
|
1505
|
+
return _chunkISIO63Q5cjs.cameraMoveParts.call(void 0, _optionalChain([shot, 'optionalAccess', _55 => _55.camera, 'optionalAccess', _56 => _56[role === "transition" ? "in" : "during"]]));
|
|
1505
1506
|
}
|
|
1506
1507
|
var motionCameraStage = (scene) => ({ width: scene.artwork.width, height: scene.artwork.height });
|
|
1507
1508
|
var effectsPlayCamera = (provider) => !!provider && provider.capabilities.supportsCamera === true && typeof provider.cameraView === "function";
|
|
@@ -1523,7 +1524,7 @@ function motionCameraWindows(scene, provider) {
|
|
|
1523
1524
|
const track = timeline.tracks.get(motionTrackKey("", "camera"));
|
|
1524
1525
|
const boxView = (t) => {
|
|
1525
1526
|
const b = trackValue(track, t);
|
|
1526
|
-
return
|
|
1527
|
+
return _chunkISIO63Q5cjs.cameraViewOfBox.call(void 0, Array.isArray(b) ? { x: b[0], y: b[1], width: b[2], height: b[3] } : full, stage);
|
|
1527
1528
|
};
|
|
1528
1529
|
const view = (move, values, from, to, u, ms2) => {
|
|
1529
1530
|
try {
|
|
@@ -1539,7 +1540,7 @@ function motionCameraWindows(scene, provider) {
|
|
|
1539
1540
|
const eases = timing.commandsStart > timing.start && !!_optionalChain([track, 'optionalAccess', _57 => _57.some, 'call', _58 => _58((seg) => seg.shot === timing.id)]);
|
|
1540
1541
|
const framed = !!_optionalChain([track, 'optionalAccess', _59 => _59.some, 'call', _60 => _60((seg) => seg.shot === timing.id)]);
|
|
1541
1542
|
if (timing.cameraIn && timing.commandsStart > timing.start) {
|
|
1542
|
-
const spec =
|
|
1543
|
+
const spec = _chunkISIO63Q5cjs.cameraMoveParts.call(void 0, _optionalChain([shot, 'access', _61 => _61.camera, 'optionalAccess', _62 => _62.in]));
|
|
1543
1544
|
const from = _nullishCoalesce(carry, () => ( boxView(timing.start)));
|
|
1544
1545
|
const to = boxView(timing.commandsStart);
|
|
1545
1546
|
if (view(spec.move, spec.values, from, to, 0, timing.commandsStart - timing.start)) {
|
|
@@ -1551,7 +1552,7 @@ function motionCameraWindows(scene, provider) {
|
|
|
1551
1552
|
carry = null;
|
|
1552
1553
|
} else if (framed) carry = null;
|
|
1553
1554
|
if (timing.cameraDuring && timing.end > timing.commandsEnd) {
|
|
1554
|
-
const spec =
|
|
1555
|
+
const spec = _chunkISIO63Q5cjs.cameraMoveParts.call(void 0, _optionalChain([shot, 'access', _63 => _63.camera, 'optionalAccess', _64 => _64.during]));
|
|
1555
1556
|
const from = _nullishCoalesce(carry, () => ( boxView(timing.commandsEnd)));
|
|
1556
1557
|
const ms2 = timing.end - timing.commandsEnd;
|
|
1557
1558
|
const last = view(spec.move, spec.values, from, from, 1, ms2);
|
|
@@ -1568,8 +1569,8 @@ var lerp = (a, b, t) => a + (b - a) * t;
|
|
|
1568
1569
|
var smooth = (t) => t * t * (3 - 2 * t);
|
|
1569
1570
|
function easeViews(from, to, u, stage) {
|
|
1570
1571
|
const k = smooth(Math.min(1, Math.max(0, u)));
|
|
1571
|
-
const a =
|
|
1572
|
-
const b =
|
|
1572
|
+
const a = _chunkISIO63Q5cjs.cameraBoxOfView.call(void 0, from, stage);
|
|
1573
|
+
const b = _chunkISIO63Q5cjs.cameraBoxOfView.call(void 0, to, stage);
|
|
1573
1574
|
const zoom = from.zoom * Math.pow(to.zoom / from.zoom, k);
|
|
1574
1575
|
const cx = lerp(a.x + a.width / 2, b.x + b.width / 2, k);
|
|
1575
1576
|
const cy = lerp(a.y + a.height / 2, b.y + b.height / 2, k);
|
|
@@ -1601,7 +1602,7 @@ function motionCameraViewAt(scene, time, provider) {
|
|
|
1601
1602
|
return retaken ? null : before.after;
|
|
1602
1603
|
}
|
|
1603
1604
|
function motionCameraBox(view, scene) {
|
|
1604
|
-
return
|
|
1605
|
+
return _chunkISIO63Q5cjs.cameraBoxOfView.call(void 0, view, motionCameraStage(scene));
|
|
1605
1606
|
}
|
|
1606
1607
|
function motionCameraTransform(view, width) {
|
|
1607
1608
|
if (!view || !view.tilt && !view.turn) return "";
|
|
@@ -1642,7 +1643,7 @@ async function checkMotionCameraMoves(scene, provider) {
|
|
|
1642
1643
|
const spec = shot.camera[field];
|
|
1643
1644
|
if (spec === void 0) continue;
|
|
1644
1645
|
try {
|
|
1645
|
-
await
|
|
1646
|
+
await _chunkISIO63Q5cjs.resolveCameraMoveSpec.call(void 0, provider, spec, role);
|
|
1646
1647
|
} catch (error) {
|
|
1647
1648
|
const code = error.code === "invalid_values" || /preset/.test(error.message) ? "camera-move-values" : "camera-move-unknown";
|
|
1648
1649
|
issues.push(_chunkDGWOGQJ5cjs.motionIssue.call(void 0, code, error.message, { shot: shot.id }));
|
|
@@ -1670,7 +1671,7 @@ function motionLayerSpans(scene) {
|
|
|
1670
1671
|
(_nullishCoalesce(shot.layers, () => ( []))).forEach((layer, index) => {
|
|
1671
1672
|
const start = at(shotIndex2, layer.from, shots[shotIndex2].start);
|
|
1672
1673
|
const end = Math.max(start, at(shotIndex2, _nullishCoalesce(layer.until, () => ( { shots: 1 })), total));
|
|
1673
|
-
out.push({ layer, shot: shot.id, shotIndex: shotIndex2, index, role:
|
|
1674
|
+
out.push({ layer, shot: shot.id, shotIndex: shotIndex2, index, role: _chunkZ3BRH4JKcjs.effectLayerRole.call(void 0, layer), start, end });
|
|
1674
1675
|
});
|
|
1675
1676
|
});
|
|
1676
1677
|
spanCache.set(scene, out);
|
|
@@ -1765,7 +1766,7 @@ var MotionLayersEngine = (_class = class {
|
|
|
1765
1766
|
__init6() {this.generation = 0}
|
|
1766
1767
|
|
|
1767
1768
|
constructor(options = {}) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);
|
|
1768
|
-
this.slot = _nullishCoalesce(options.slot, () => ( new (0,
|
|
1769
|
+
this.slot = _nullishCoalesce(options.slot, () => ( new (0, _chunkISIO63Q5cjs.EffectsSlot)()));
|
|
1769
1770
|
this.host = _nullishCoalesce(options.host, () => ( null));
|
|
1770
1771
|
this.frameSvg = options.frameSvg;
|
|
1771
1772
|
this.options = { scale: _nullishCoalesce(options.scale, () => ( 1)), maxSize: _nullishCoalesce(options.maxSize, () => ( 1280)), fps: _nullishCoalesce(options.fps, () => ( 30)), maxEntries: _nullishCoalesce(options.maxEntries, () => ( 160)) };
|
|
@@ -1885,8 +1886,8 @@ var MotionLayersEngine = (_class = class {
|
|
|
1885
1886
|
const effect = layer.effect;
|
|
1886
1887
|
this.request(key, { layer: layer.id }, async () => {
|
|
1887
1888
|
const d = await this.describe(effect);
|
|
1888
|
-
const values =
|
|
1889
|
-
const input =
|
|
1889
|
+
const values = _chunkISIO63Q5cjs.resolveEffectValues.call(void 0, d, layer.values);
|
|
1890
|
+
const input = _chunkZ3BRH4JKcjs.effectLayerInput.call(void 0, d);
|
|
1890
1891
|
const inputs = layer.subject && input ? { [input]: await this.subjectPixels(layer.subject, size) } : void 0;
|
|
1891
1892
|
const pixels = await this.pool.render(provider, effect, size, { time, values, ...inputs ? { inputs } : {} });
|
|
1892
1893
|
return host.encode(pixels);
|
|
@@ -1907,7 +1908,7 @@ var MotionLayersEngine = (_class = class {
|
|
|
1907
1908
|
const fromKey = `from:${sceneId(scene)}:${active.shot}:${size.width}x${size.height}`;
|
|
1908
1909
|
this.request(key, { transition: active.shot }, async () => {
|
|
1909
1910
|
const d = await this.describe(t.effect);
|
|
1910
|
-
const values =
|
|
1911
|
+
const values = _chunkISIO63Q5cjs.resolveEffectValues.call(void 0, d, t.values);
|
|
1911
1912
|
frameSvg(scene, Math.max(0, active.start - 1e-3));
|
|
1912
1913
|
frameSvg(scene, at);
|
|
1913
1914
|
await this.idleExcept(key);
|
|
@@ -2020,13 +2021,13 @@ function morphBetween(a, b) {
|
|
|
2020
2021
|
let inner = morphCache.get(a);
|
|
2021
2022
|
if (!inner) morphCache.set(a, inner = /* @__PURE__ */ new WeakMap());
|
|
2022
2023
|
let morph = inner.get(b);
|
|
2023
|
-
if (!morph) inner.set(b, morph =
|
|
2024
|
+
if (!morph) inner.set(b, morph = _chunkTLOGFIIVcjs.createVectorMorph.call(void 0, a, b, { id: a.id }));
|
|
2024
2025
|
return morph;
|
|
2025
2026
|
}
|
|
2026
2027
|
function shapeIn(entry, shape) {
|
|
2027
2028
|
if (shape === entry) return entry.node;
|
|
2028
|
-
const m =
|
|
2029
|
-
return { ...shape.node, ...
|
|
2029
|
+
const m = _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _chunkJPEHXIB5cjs.nodeMatrix.call(void 0, shape.node), shape.parentWorld), _chunkJPEHXIB5cjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
2030
|
+
return { ...shape.node, ..._chunkJPEHXIB5cjs.isIdentityMatrix.call(void 0, m) ? { transform: void 0 } : { transform: m } };
|
|
2030
2031
|
}
|
|
2031
2032
|
function shapeAt(entry, timeline, nodes, time) {
|
|
2032
2033
|
const track = timeline.tracks.get(motionTrackKey(entry.node.id, "shape"));
|
|
@@ -2046,7 +2047,7 @@ function shapeAt(entry, timeline, nodes, time) {
|
|
|
2046
2047
|
function motionFollowRoute(entry, path) {
|
|
2047
2048
|
if (!path || path.node.type !== "path") return null;
|
|
2048
2049
|
try {
|
|
2049
|
-
return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0,
|
|
2050
|
+
return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunkJPEHXIB5cjs.vectorPathWorldBezier.call(void 0, path.node, path.parentWorld, { effects: false }), _chunkJPEHXIB5cjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
2050
2051
|
} catch (e6) {
|
|
2051
2052
|
return null;
|
|
2052
2053
|
}
|
|
@@ -2080,9 +2081,9 @@ function motionNodeOffset(entry, timeline, time, nodes = indexMotionNodes([entry
|
|
|
2080
2081
|
const scaleX = read("scaleX", 1);
|
|
2081
2082
|
const scaleY = read("scaleY", 1);
|
|
2082
2083
|
const c = entry.center;
|
|
2083
|
-
let matrix =
|
|
2084
|
+
let matrix = _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _chunkJPEHXIB5cjs.scaleMatrix.call(void 0, scaleX, scaleY, c), _chunkJPEHXIB5cjs.rotateMatrix.call(void 0, rotation, c)), _chunkJPEHXIB5cjs.translateMatrix.call(void 0, dx, dy));
|
|
2084
2085
|
const along = follow ? followAt(entry, timeline, nodes, time) : null;
|
|
2085
|
-
if (along) matrix =
|
|
2086
|
+
if (along) matrix = _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, matrix, _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _chunkJPEHXIB5cjs.translateMatrix.call(void 0, -c.x, -c.y), _chunkJPEHXIB5cjs.rotateMatrix.call(void 0, along.angle)), _chunkJPEHXIB5cjs.translateMatrix.call(void 0, along.x, along.y)));
|
|
2086
2087
|
return { matrix, dx, dy, rotation, scaleX, scaleY, follow: along };
|
|
2087
2088
|
}
|
|
2088
2089
|
function motionNodeClips(id, timeline, time) {
|
|
@@ -2149,7 +2150,7 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
2149
2150
|
const start = Math.min(1, Math.max(0, typeof drawStart === "number" ? drawStart : 0));
|
|
2150
2151
|
const end = Math.min(1, Math.max(0, typeof drawEnd === "number" ? drawEnd : 1));
|
|
2151
2152
|
if (start > 0 || end < 1) {
|
|
2152
|
-
const trim =
|
|
2153
|
+
const trim = _chunkJPEHXIB5cjs.createVectorEffect.call(void 0, "trim", MOTION_DRAW_EFFECT_ID, { start: tidy(start * 100), end: tidy(end * 100) });
|
|
2153
2154
|
p = { ...p, effects: [trim, ...(_nullishCoalesce(p.effects, () => ( []))).filter((e) => e.id !== MOTION_DRAW_EFFECT_ID)] };
|
|
2154
2155
|
}
|
|
2155
2156
|
}
|
|
@@ -2163,8 +2164,8 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
2163
2164
|
if (o >= 1) delete out.opacity;
|
|
2164
2165
|
}
|
|
2165
2166
|
const offset = options.offsets === false ? null : motionNodeOffset(entry, timeline, time, nodes);
|
|
2166
|
-
if (offset && !
|
|
2167
|
-
const m =
|
|
2167
|
+
if (offset && !_chunkJPEHXIB5cjs.isIdentityMatrix.call(void 0, offset.matrix)) {
|
|
2168
|
+
const m = _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _chunkJPEHXIB5cjs.nodeMatrix.call(void 0, out), offset.matrix).map(tidy);
|
|
2168
2169
|
out = { ...out, transform: m };
|
|
2169
2170
|
}
|
|
2170
2171
|
return out;
|
|
@@ -2185,8 +2186,8 @@ function motionFrameToSvg(scene, time, options = {}) {
|
|
|
2185
2186
|
const wrap = { ...options.wrap };
|
|
2186
2187
|
for (const [id, clips] of Object.entries(frame.clips))
|
|
2187
2188
|
wrap[id] = [..._nullishCoalesce(wrap[id], () => ( [])), ...clips.map((clip, i) => ({ clip: { id: `${prefix}reveal-${id}-${i}`, shape: clip.shape, attrs: motionClipAttrs(clip) } }))];
|
|
2188
|
-
if (!motionSceneHasLayers(scene)) return withCameraViewEffects(withViewBox(
|
|
2189
|
-
const art =
|
|
2189
|
+
if (!motionSceneHasLayers(scene)) return withCameraViewEffects(withViewBox(_chunkJPEHXIB5cjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap }), frame.camera), frame.view, frame.camera, prefix);
|
|
2190
|
+
const art = _chunkJPEHXIB5cjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap, background: false });
|
|
2190
2191
|
let svg = withViewBox(withMotionShotLayers(art, scene, time, frame.camera, options.layers, options.background !== false), frame.camera);
|
|
2191
2192
|
const transition = options.transitions === false ? null : motionTransitionAt(scene, time);
|
|
2192
2193
|
if (transition) {
|
|
@@ -2377,8 +2378,8 @@ function visibleAt(timeline, id, time, node) {
|
|
|
2377
2378
|
if (Array.isArray(rect) && (rect[2] <= 1e-4 || rect[3] <= 1e-4)) return false;
|
|
2378
2379
|
const circle = clip("clipCircle");
|
|
2379
2380
|
if (Array.isArray(circle) && circle[2] <= 1e-4) return false;
|
|
2380
|
-
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" :
|
|
2381
|
-
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" ||
|
|
2381
|
+
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" : _chunkJPEHXIB5cjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
|
|
2382
|
+
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunkJPEHXIB5cjs.collectPathNodes.call(void 0, node).length === 0 || _chunkJPEHXIB5cjs.collectPathNodes.call(void 0, node).some((p) => {
|
|
2382
2383
|
const v = trackValue(timeline.tracks.get(motionTrackKey(p.id, "drawEnd")), time);
|
|
2383
2384
|
return typeof v !== "number" || v > 0.01;
|
|
2384
2385
|
}));
|
|
@@ -2465,7 +2466,7 @@ function checkMotionScene(scene) {
|
|
|
2465
2466
|
}
|
|
2466
2467
|
for (const id of targets) {
|
|
2467
2468
|
const node = nodes.get(id).node;
|
|
2468
|
-
const paths = node.type === "path" ? [node] :
|
|
2469
|
+
const paths = node.type === "path" ? [node] : _chunkJPEHXIB5cjs.collectPathNodes.call(void 0, node);
|
|
2469
2470
|
if (paths.some((p) => p[key] !== void 0 && p[key] !== null && typeof p[key] !== "string"))
|
|
2470
2471
|
issues.push(_chunkDGWOGQJ5cjs.motionIssue.call(void 0, "paint-not-color", `"${id}" has a gradient ${key}; it switches to ${color} at the end instead of blending.`, { ...where, ids: [id] }));
|
|
2471
2472
|
}
|
|
@@ -2478,7 +2479,7 @@ function checkMotionScene(scene) {
|
|
|
2478
2479
|
else
|
|
2479
2480
|
for (const id of targets) {
|
|
2480
2481
|
const node = nodes.get(id).node;
|
|
2481
|
-
const paths = node.type === "path" ? [node] :
|
|
2482
|
+
const paths = node.type === "path" ? [node] : _chunkJPEHXIB5cjs.collectPathNodes.call(void 0, node);
|
|
2482
2483
|
if (paths.some((p) => typeof p[key] !== "string"))
|
|
2483
2484
|
issues.push(_chunkDGWOGQJ5cjs.motionIssue.call(void 0, "paint-not-color", `"${id}" has a gradient or no ${key}, so a colour pulse cannot tint it; give it a solid ${key} or pulse the ${key === "fill" ? "stroke" : "fill"}.`, { ...where, ids: [id] }));
|
|
2484
2485
|
}
|
|
@@ -2923,7 +2924,7 @@ function motionNodePose(scene, id, time) {
|
|
|
2923
2924
|
if (!entry) throw new Error(`There is no element ${_chunkDGWOGQJ5cjs.namedWithSuggestion.call(void 0, id, [...indexMotionNodes(scene.artwork.nodes).keys()])} in the artwork.`);
|
|
2924
2925
|
const timeline = compileMotionScene(scene);
|
|
2925
2926
|
const drawn = indexMotionNodes(motionFrameAt(scene, time).document.nodes).get(id);
|
|
2926
|
-
const centre =
|
|
2927
|
+
const centre = _chunkJPEHXIB5cjs.applyMatrix.call(void 0, entry.parentWorld, { x: entry.center.x + motionPropertyValue(timeline, id, "x", time), y: entry.center.y + motionPropertyValue(timeline, id, "y", time) });
|
|
2927
2928
|
const paint = (property) => _nullishCoalesce(trackValue(timeline.tracks.get(motionTrackKey(id, property)), time), () => ( motionRestValue(entry, property, scene.artwork)));
|
|
2928
2929
|
const fill = paint("fill");
|
|
2929
2930
|
const stroke = paint("stroke");
|
|
@@ -3270,7 +3271,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3270
3271
|
raw: (t) => transformAt(t, true)
|
|
3271
3272
|
});
|
|
3272
3273
|
}
|
|
3273
|
-
const paths = node.type === "path" ? [node] :
|
|
3274
|
+
const paths = node.type === "path" ? [node] : _chunkJPEHXIB5cjs.collectPathNodes.call(void 0, node);
|
|
3274
3275
|
for (const path of paths) {
|
|
3275
3276
|
if (pathsSeen.has(path.id)) continue;
|
|
3276
3277
|
pathsSeen.add(path.id);
|
|
@@ -3292,7 +3293,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3292
3293
|
if (shapeSegments.length) {
|
|
3293
3294
|
if (node.type !== "path") notes.push(`"${id}" is a group: its morph or effect animation is not exported (Flair tweens one path's "d").`);
|
|
3294
3295
|
else {
|
|
3295
|
-
const inverse =
|
|
3296
|
+
const inverse = _chunkJPEHXIB5cjs.invertMatrix.call(void 0, _chunkJPEHXIB5cjs.nodeMatrix.call(void 0, node));
|
|
3296
3297
|
channels.push({
|
|
3297
3298
|
id,
|
|
3298
3299
|
kind: "attr",
|
|
@@ -3301,9 +3302,9 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3301
3302
|
exact: () => false,
|
|
3302
3303
|
value: (t) => {
|
|
3303
3304
|
const frame = motionFrameAt(scene, t, { draw: false, offsets: false });
|
|
3304
|
-
const now =
|
|
3305
|
+
const now = _chunkJPEHXIB5cjs.expandVectorAppearance.call(void 0, _optionalChain([indexMotionNodes, 'call', _151 => _151(frame.document.nodes), 'access', _152 => _152.get, 'call', _153 => _153(id), 'optionalAccess', _154 => _154.node]));
|
|
3305
3306
|
if (!now || now.type !== "path") return "";
|
|
3306
|
-
const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0,
|
|
3307
|
+
const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunkJPEHXIB5cjs.vectorPathWorldBezier.call(void 0, now, _chunkJPEHXIB5cjs.IDENTITY_MATRIX, { effects: false }), inverse);
|
|
3307
3308
|
return _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0, bezier, { precision: Math.min(precision, 2) });
|
|
3308
3309
|
}
|
|
3309
3310
|
});
|
|
@@ -3324,7 +3325,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3324
3325
|
if (w) return `${w.move}@${w.shot}`;
|
|
3325
3326
|
const seg = camera.find((x) => t >= x.start - 1e-6 && t < Math.max(x.end, x.start + 1e-3));
|
|
3326
3327
|
const shot = seg ? scene.shots.find((x) => x.id === seg.shot) : void 0;
|
|
3327
|
-
const move = _optionalChain([
|
|
3328
|
+
const move = _optionalChain([_chunkISIO63Q5cjs.cameraMoveParts.call(void 0, _optionalChain([shot, 'optionalAccess', _155 => _155.camera, 'optionalAccess', _156 => _156.in])), 'optionalAccess', _157 => _157.move]);
|
|
3328
3329
|
return move && shot ? `${move}@${shot.id}` : void 0;
|
|
3329
3330
|
};
|
|
3330
3331
|
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));
|
|
@@ -3443,7 +3444,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3443
3444
|
}
|
|
3444
3445
|
if (scene.motionBlur) notes.push("Motion blur is drawn on the stage only; Flair plays the scene sharp.");
|
|
3445
3446
|
if (trigger && (_nullishCoalesce(scene.loop, () => ( "none"))) !== "none") notes.push(`The scene plays on ${trigger}, so its loop does not apply in Flair.`);
|
|
3446
|
-
let svg =
|
|
3447
|
+
let svg = _chunkJPEHXIB5cjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunkJPEHXIB5cjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) }, { pretty: false, precision, wrap });
|
|
3447
3448
|
if (routes.length) svg = svg.replace(/^(<svg[^>]*>)/, `$1<defs>${routes.join("")}</defs>`);
|
|
3448
3449
|
let motion = { svg, animate };
|
|
3449
3450
|
if (_optionalChain([scene, 'access', _160 => _160.controls, 'optionalAccess', _161 => _161.length])) {
|
|
@@ -3541,14 +3542,14 @@ function easingOf(ease, fallback) {
|
|
|
3541
3542
|
return fallback;
|
|
3542
3543
|
}
|
|
3543
3544
|
function poseOf(value, entry) {
|
|
3544
|
-
const t =
|
|
3545
|
-
const o =
|
|
3545
|
+
const t = _chunkJPEHXIB5cjs.parseSvgTransform.call(void 0, String(value));
|
|
3546
|
+
const o = _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkJPEHXIB5cjs.invertMatrix.call(void 0, _chunkJPEHXIB5cjs.nodeMatrix.call(void 0, entry.node)), () => ( [1, 0, 0, 1, 0, 0])), t);
|
|
3546
3547
|
const sx = Math.hypot(o[0], o[1]);
|
|
3547
3548
|
if (!(sx > 1e-9)) return null;
|
|
3548
3549
|
const sy = (o[0] * o[3] - o[1] * o[2]) / sx;
|
|
3549
3550
|
if (Math.abs(o[2] + o[1] / sx * sy) > 1e-6 || Math.abs(o[3] - o[0] / sx * sy) > 1e-6) return null;
|
|
3550
3551
|
const c = entry.center;
|
|
3551
|
-
const moved =
|
|
3552
|
+
const moved = _chunkJPEHXIB5cjs.applyMatrix.call(void 0, o, c);
|
|
3552
3553
|
return { dx: moved.x - c.x, dy: moved.y - c.y, rotation: Math.atan2(o[1], o[0]) * 180 / Math.PI, sx, sy };
|
|
3553
3554
|
}
|
|
3554
3555
|
var near = (a, b, eps = 1e-6) => Math.abs(a - b) < eps;
|
|
@@ -3633,7 +3634,7 @@ function fromFlairSvgMotion(input, options = {}) {
|
|
|
3633
3634
|
const notes = [];
|
|
3634
3635
|
if (!input || typeof input.svg !== "string") throw new Error('Give a Flair SvgMotion: { svg: "<svg \u2026>", animate: [ \u2026 ] }.');
|
|
3635
3636
|
const { motion, controls } = resolvePlaceholders(input, notes);
|
|
3636
|
-
const artwork =
|
|
3637
|
+
const artwork = _chunkJPEHXIB5cjs.parseVectorSvg.call(void 0, motion.svg);
|
|
3637
3638
|
const nodes = indexMotionNodes(artwork.nodes);
|
|
3638
3639
|
const byStep = /* @__PURE__ */ new Map();
|
|
3639
3640
|
for (const anim of _nullishCoalesce(motion.animate, () => ( []))) {
|
|
@@ -3880,9 +3881,9 @@ function toLottie(scene, options = {}) {
|
|
|
3880
3881
|
const items = [];
|
|
3881
3882
|
const shapeSegments = [...timeline.tracks.entries()].filter(([k]) => k.startsWith(`${path.id}\0`) && (k.endsWith("\0shape") || k.includes("\0effect:"))).flatMap(([, v]) => v);
|
|
3882
3883
|
const geometryAt = (t) => {
|
|
3883
|
-
if (!shapeSegments.length) return
|
|
3884
|
+
if (!shapeSegments.length) return _chunkJPEHXIB5cjs.vectorPathWorldBezier.call(void 0, path);
|
|
3884
3885
|
const now = _optionalChain([indexMotionNodes, 'call', _170 => _170(motionFrameAt(scene, t, { draw: false, offsets: false }).document.nodes), 'access', _171 => _171.get, 'call', _172 => _172(path.id), 'optionalAccess', _173 => _173.node]);
|
|
3885
|
-
return now && now.type === "path" ?
|
|
3886
|
+
return now && now.type === "path" ? _chunkJPEHXIB5cjs.vectorPathWorldBezier.call(void 0, _chunkJPEHXIB5cjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunkJPEHXIB5cjs.vectorPathWorldBezier.call(void 0, path);
|
|
3886
3887
|
};
|
|
3887
3888
|
const rest = lottieContours(_chunkGF2RBSDMcjs.toBezierPath.call(void 0, geometryAt(0)), round4);
|
|
3888
3889
|
rest.forEach((contour, n2) => {
|
|
@@ -3955,13 +3956,13 @@ function toLottie(scene, options = {}) {
|
|
|
3955
3956
|
const innerTr = STATIC_TR();
|
|
3956
3957
|
if (node.type === "path") inner = [...pathShapes(node)];
|
|
3957
3958
|
else if (node.type === "text" || node.type === "instance") {
|
|
3958
|
-
const drawn =
|
|
3959
|
+
const drawn = _chunkJPEHXIB5cjs.expandVectorAppearance.call(void 0, node);
|
|
3959
3960
|
inner = drawn.type === "path" ? [...pathShapes(drawn)] : drawn.children.filter((c) => c.type === "path").reverse().flatMap((c) => [...pathShapes(c)]);
|
|
3960
|
-
notes.push(`"${node.id}": text is exported as its outlines${
|
|
3961
|
+
notes.push(`"${node.id}": text is exported as its outlines${_chunkJPEHXIB5cjs.vectorTextHasOutlines.call(void 0, ) ? "" : " (glyph boxes: set an outline text shaper for real glyphs)"}.`);
|
|
3961
3962
|
} else {
|
|
3962
3963
|
inner = shown(node.children).reverse().map(nodeGroup);
|
|
3963
|
-
const m =
|
|
3964
|
-
if (m !==
|
|
3964
|
+
const m = _chunkJPEHXIB5cjs.nodeMatrix.call(void 0, node);
|
|
3965
|
+
if (m !== _chunkJPEHXIB5cjs.IDENTITY_MATRIX) {
|
|
3965
3966
|
const parts = staticParts(m);
|
|
3966
3967
|
if (!parts) notes.push(`"${node.id}": its transform skews, which is not exported; it is drawn without the skew.`);
|
|
3967
3968
|
else {
|
|
@@ -3974,7 +3975,7 @@ function toLottie(scene, options = {}) {
|
|
|
3974
3975
|
const body = { ty: "gr", nm: `${node.id} (own)`, it: [...inner, innerTr] };
|
|
3975
3976
|
return { ty: "gr", nm: _nullishCoalesce(node.name, () => ( node.id)), it: [body, poseTransform(entry)] };
|
|
3976
3977
|
};
|
|
3977
|
-
const artwork = { ...scene.artwork, nodes:
|
|
3978
|
+
const artwork = { ...scene.artwork, nodes: _chunkJPEHXIB5cjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) };
|
|
3978
3979
|
const content = shown(artwork.nodes).reverse().map(nodeGroup);
|
|
3979
3980
|
if (artwork.background && rgba(artwork.background))
|
|
3980
3981
|
content.push({ ty: "gr", nm: "Background", it: [{ ty: "rc", nm: "Background", p: { a: 0, k: [artwork.width / 2, artwork.height / 2] }, s: { a: 0, k: [artwork.width, artwork.height] }, r: { a: 0, k: 0 } }, { ty: "fl", c: { a: 0, k: rgba(artwork.background).map(round4) }, o: { a: 0, k: 100 }, r: 1 }, STATIC_TR()] });
|
|
@@ -4073,11 +4074,11 @@ function preset(prst, w, h) {
|
|
|
4073
4074
|
const poly = (pts) => [{ closed: true, anchors: pts.map(([x, y]) => ({ x, y })) }];
|
|
4074
4075
|
switch (prst) {
|
|
4075
4076
|
case "rect":
|
|
4076
|
-
return [
|
|
4077
|
+
return [_chunkJPEHXIB5cjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
4077
4078
|
case "roundRect":
|
|
4078
|
-
return [
|
|
4079
|
+
return [_chunkJPEHXIB5cjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h }, Math.min(w, h) * 0.16667)];
|
|
4079
4080
|
case "ellipse":
|
|
4080
|
-
return [
|
|
4081
|
+
return [_chunkJPEHXIB5cjs.ellipseSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
4081
4082
|
case "triangle":
|
|
4082
4083
|
return poly([[w / 2, 0], [w, h], [0, h]]);
|
|
4083
4084
|
case "rtTriangle":
|
|
@@ -4185,7 +4186,7 @@ function shapes(ctx, tree, map) {
|
|
|
4185
4186
|
let subpaths = cust ? custom(cust, w, h) : prst ? preset(prst, w, h) : null;
|
|
4186
4187
|
if (!subpaths) {
|
|
4187
4188
|
if (prst) ctx.notes.push(`"${name}" is a ${prst}, drawn as its bounding rectangle.`);
|
|
4188
|
-
subpaths = [
|
|
4189
|
+
subpaths = [_chunkJPEHXIB5cjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
4189
4190
|
}
|
|
4190
4191
|
const style = kid(el, "style");
|
|
4191
4192
|
const fill = kid(spPr, "noFill") ? null : _nullishCoalesce(colour(ctx, kid(spPr, "solidFill")), () => ( (el.localName === "cxnSp" ? null : colour(ctx, kid(style, "fillRef")))));
|
|
@@ -4428,7 +4429,7 @@ var kindHint = (d) => {
|
|
|
4428
4429
|
function withPreset(d, preset2, values) {
|
|
4429
4430
|
if (preset2 === void 0) return values;
|
|
4430
4431
|
const p = d.presets.find((x) => x.name === preset2);
|
|
4431
|
-
if (!p) throw new (0,
|
|
4432
|
+
if (!p) throw new (0, _chunkISIO63Q5cjs.EffectUnsupportedError)(`"${d.id}" has no preset "${preset2}"; ${d.presets.length ? `its presets are ${d.presets.map((x) => `"${x.name}"`).join(", ")}` : "it has no presets"}.`, d.id);
|
|
4432
4433
|
return { ...p.values, ..._nullishCoalesce(values, () => ( {})) };
|
|
4433
4434
|
}
|
|
4434
4435
|
async function resolveMotionShotLayer(provider, layer) {
|
|
@@ -4438,27 +4439,27 @@ async function resolveMotionShotLayer(provider, layer) {
|
|
|
4438
4439
|
const { provider: _p, name: _n, ...rest } = layer;
|
|
4439
4440
|
return rest;
|
|
4440
4441
|
}
|
|
4441
|
-
if (!provider) throw new (0,
|
|
4442
|
+
if (!provider) throw new (0, _chunkISIO63Q5cjs.NoEffectsProviderError)();
|
|
4442
4443
|
const d = await provider.describe(layer.effect);
|
|
4443
|
-
if (!
|
|
4444
|
-
const input =
|
|
4445
|
-
if (layer.subject && !input) throw new (0,
|
|
4446
|
-
if (!layer.subject && input && _optionalChain([d, 'access', _198 => _198.inputs, 'access', _199 => _199.find, 'call', _200 => _200((i) => i.name === input), 'optionalAccess', _201 => _201.required])) throw new (0,
|
|
4444
|
+
if (!_chunkZ3BRH4JKcjs.effectLayerOffered.call(void 0, d)) throw new (0, _chunkISIO63Q5cjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) cannot be a layer; ${kindHint(d)}. A layer's effect is a generator, filter, overlay or title (search_effects with use "generator", "filter", "overlay" or "title").`, d.id);
|
|
4445
|
+
const input = _chunkZ3BRH4JKcjs.effectLayerInput.call(void 0, d);
|
|
4446
|
+
if (layer.subject && !input) throw new (0, _chunkISIO63Q5cjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) draws its own picture and takes no subject; leave "subject" out, or pick a filter to change the subject.`, d.id);
|
|
4447
|
+
if (!layer.subject && input && _optionalChain([d, 'access', _198 => _198.inputs, 'access', _199 => _199.find, 'call', _200 => _200((i) => i.name === input), 'optionalAccess', _201 => _201.required])) throw new (0, _chunkISIO63Q5cjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) changes a picture; give a "subject": { "image": url }, { "svg": markup }, { "text": words } or { "slot": name }.`, d.id);
|
|
4447
4448
|
const values = withPreset(d, layer.preset, layer.values);
|
|
4448
|
-
|
|
4449
|
+
_chunkISIO63Q5cjs.resolveEffectValues.call(void 0, d, values);
|
|
4449
4450
|
const out = { ...layer, provider: provider.id, name: d.name };
|
|
4450
4451
|
if (values && Object.keys(values).length) out.values = values;
|
|
4451
4452
|
else delete out.values;
|
|
4452
4453
|
return out;
|
|
4453
4454
|
}
|
|
4454
4455
|
async function resolveMotionShotTransition(provider, transition) {
|
|
4455
|
-
if (!provider) throw new (0,
|
|
4456
|
+
if (!provider) throw new (0, _chunkISIO63Q5cjs.NoEffectsProviderError)();
|
|
4456
4457
|
const d = await provider.describe(transition.effect);
|
|
4457
|
-
if (!d.uses.includes("transition") || d.kind === "camera") throw new (0,
|
|
4458
|
+
if (!d.uses.includes("transition") || d.kind === "camera") throw new (0, _chunkISIO63Q5cjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) is not a transition (${kindHint(d)}); search_effects with use "transition" lists them.`, d.id);
|
|
4458
4459
|
if (transition.ms !== void 0 && !(transition.ms > 0 && transition.ms <= 6e4)) throw new Error(`A transition's "ms" is from 1 to 60000; got ${transition.ms}.`);
|
|
4459
4460
|
const values = withPreset(d, transition.preset, transition.values);
|
|
4460
|
-
|
|
4461
|
-
const out = { ...transition, ms: _nullishCoalesce(transition.ms, () => (
|
|
4461
|
+
_chunkISIO63Q5cjs.resolveEffectValues.call(void 0, d, values);
|
|
4462
|
+
const out = { ...transition, ms: _nullishCoalesce(transition.ms, () => ( _chunkISIO63Q5cjs.EFFECT_TRANSITION_MS)), provider: provider.id, name: d.name };
|
|
4462
4463
|
if (values && Object.keys(values).length) out.values = values;
|
|
4463
4464
|
else delete out.values;
|
|
4464
4465
|
return out;
|
|
@@ -4574,7 +4575,7 @@ function nextMotionEffectInstance(scene) {
|
|
|
4574
4575
|
walk(scene.artwork.nodes);
|
|
4575
4576
|
for (let i = 1; ; i++) if (!used.has(`fx${i}`)) return `fx${i}`;
|
|
4576
4577
|
}
|
|
4577
|
-
var motionArtworkSvg = (artwork) =>
|
|
4578
|
+
var motionArtworkSvg = (artwork) => _chunkJPEHXIB5cjs.vectorDocumentToSvg.call(void 0, artwork);
|
|
4578
4579
|
var tag = (commands, source) => commands.map((c) => c.type === "wait" ? c : { ...c, source });
|
|
4579
4580
|
function motionCommandsFromEffect(artwork, motion, source) {
|
|
4580
4581
|
const imported = fromFlairSvgMotion({ svg: motionArtworkSvg(artwork), animate: [..._nullishCoalesce(motion.animate, () => ( []))] });
|
|
@@ -4653,7 +4654,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
4653
4654
|
|
|
4654
4655
|
|
|
4655
4656
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
4656
|
-
__init9() {this.effects = new (0,
|
|
4657
|
+
__init9() {this.effects = new (0, _chunkISIO63Q5cjs.EffectsSlot)()}
|
|
4657
4658
|
/** Renders shot layer and transition pictures for frames (see `MotionLayersEngine`). */
|
|
4658
4659
|
|
|
4659
4660
|
|
|
@@ -4680,7 +4681,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
4680
4681
|
host: options.layerHost === void 0 ? browserMotionLayerHost() : options.layerHost,
|
|
4681
4682
|
frameSvg: (scene, time) => motionFrameToSvg(scene, time, { effects: this.effects.provider, layers: this.layers, transitions: false, pretty: false })
|
|
4682
4683
|
});
|
|
4683
|
-
this.player = new (0,
|
|
4684
|
+
this.player = new (0, _chunkM5GLQQWGcjs.AnimationPlayer)({ clock: options.clock, duration: () => compileMotionScene(this.scene).duration, loop: _nullishCoalesce(this.scene.loop, () => ( "none")) });
|
|
4684
4685
|
this.state = this.computeState();
|
|
4685
4686
|
this.connect();
|
|
4686
4687
|
}
|
|
@@ -4847,7 +4848,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
4847
4848
|
try {
|
|
4848
4849
|
plan = await work();
|
|
4849
4850
|
} catch (error) {
|
|
4850
|
-
if (
|
|
4851
|
+
if (_chunkISIO63Q5cjs.isEffectError.call(void 0, error) || error instanceof Error) return this.refuse(error.message);
|
|
4851
4852
|
throw error;
|
|
4852
4853
|
}
|
|
4853
4854
|
const r = this.apply({ op: "replace_scene", scene: plan.scene }, plan.label, { merge });
|
|
@@ -4858,11 +4859,11 @@ var AnimationEditorController = (_class2 = class {
|
|
|
4858
4859
|
}
|
|
4859
4860
|
async describeFor(effect, kinds) {
|
|
4860
4861
|
const provider = this.effects.require();
|
|
4861
|
-
if (!provider.applyVectorEffect) throw new (0,
|
|
4862
|
+
if (!provider.applyVectorEffect) throw new (0, _chunkISIO63Q5cjs.EffectUnsupportedError)(`${provider.name} has no vector or motion effects.`);
|
|
4862
4863
|
const d = await provider.describe(effect);
|
|
4863
4864
|
if (!kinds.includes(d.kind)) {
|
|
4864
4865
|
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";
|
|
4865
|
-
throw new (0,
|
|
4866
|
+
throw new (0, _chunkISIO63Q5cjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) is a ${d.kind} effect: ${hint}.`, d.id);
|
|
4866
4867
|
}
|
|
4867
4868
|
return d;
|
|
4868
4869
|
}
|
|
@@ -4883,7 +4884,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
4883
4884
|
return this.effectEdit(async () => {
|
|
4884
4885
|
this.knownNodes(targets);
|
|
4885
4886
|
const d = await this.describeFor(effect, ["motion"]);
|
|
4886
|
-
const values =
|
|
4887
|
+
const values = _chunkISIO63Q5cjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4887
4888
|
const instance = _nullishCoalesce(options.instance, () => ( nextMotionEffectInstance(this.scene)));
|
|
4888
4889
|
const motion = await this.effects.require().applyVectorEffect(d.id, { svg: motionArtworkSvg(this.scene.artwork), nodeIds: [...targets] }, values);
|
|
4889
4890
|
const source = { instance, effect: d.id, provider: this.effects.require().id, name: d.name, values };
|
|
@@ -4908,7 +4909,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
4908
4909
|
let given = options.values;
|
|
4909
4910
|
let place = options.box;
|
|
4910
4911
|
if (options.path) {
|
|
4911
|
-
const controls =
|
|
4912
|
+
const controls = _chunkISIO63Q5cjs.pathControlsOf.call(void 0, d);
|
|
4912
4913
|
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).`);
|
|
4913
4914
|
const control = _nullishCoalesce(options.control, () => ( (controls.length === 1 ? controls[0] : void 0)));
|
|
4914
4915
|
if (!control) throw new Error(`"${d.id}" has several path controls (${controls.join(", ")}); pass control.`);
|
|
@@ -4918,7 +4919,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
4918
4919
|
const entry = indexMotionNodes(this.scene.artwork.nodes).get(options.path.node);
|
|
4919
4920
|
if (!entry) throw new Error(`There is no node "${options.path.node}"; find_animation_elements lists the artwork's nodes.`);
|
|
4920
4921
|
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).`);
|
|
4921
|
-
value = _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0,
|
|
4922
|
+
value = _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0, _chunkJPEHXIB5cjs.vectorPathWorldBezier.call(void 0, entry.node, entry.parentWorld, { effects: false }));
|
|
4922
4923
|
place ??= "viewBox";
|
|
4923
4924
|
} else {
|
|
4924
4925
|
const provider = this.effects.require();
|
|
@@ -4928,7 +4929,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
4928
4929
|
}
|
|
4929
4930
|
given = { ..._nullishCoalesce(given, () => ( {})), [control]: value };
|
|
4930
4931
|
}
|
|
4931
|
-
const values =
|
|
4932
|
+
const values = _chunkISIO63Q5cjs.resolveEffectValues.call(void 0, d, given);
|
|
4932
4933
|
const instance = _nullishCoalesce(options.instance, () => ( nextMotionEffectInstance(this.scene)));
|
|
4933
4934
|
const motion = await this.effects.require().applyVectorEffect(d.id, motionArtworkSvg(this.scene.artwork), values);
|
|
4934
4935
|
const source = { instance, effect: d.id, provider: this.effects.require().id, name: d.name, values };
|
|
@@ -4952,7 +4953,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
4952
4953
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4953
4954
|
else throw new Error(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4954
4955
|
}
|
|
4955
|
-
const merged = { ...base, ...
|
|
4956
|
+
const merged = { ...base, ..._chunkISIO63Q5cjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4956
4957
|
const { scene: bare, place } = withoutMotionEffect(this.scene, instance);
|
|
4957
4958
|
const provider = this.effects.require();
|
|
4958
4959
|
const source = { instance, effect: d.id, provider: provider.id, name: d.name, values: merged };
|
|
@@ -5007,12 +5008,12 @@ var AnimationEditorController = (_class2 = class {
|
|
|
5007
5008
|
if (!found) return this.refuse(`There is no shot "${shot}"; the shots are ${this.scene.shots.map((s) => `"${s.id}"`).join(", ") || "none yet"}.`);
|
|
5008
5009
|
let resolved;
|
|
5009
5010
|
try {
|
|
5010
|
-
resolved = await
|
|
5011
|
+
resolved = await _chunkISIO63Q5cjs.resolveCameraMoveSpec.call(void 0, this.effects.require(), spec, role);
|
|
5011
5012
|
} catch (error) {
|
|
5012
|
-
if (
|
|
5013
|
+
if (_chunkISIO63Q5cjs.isEffectError.call(void 0, error) || error instanceof Error) return this.refuse(error.message);
|
|
5013
5014
|
throw error;
|
|
5014
5015
|
}
|
|
5015
|
-
const field =
|
|
5016
|
+
const field = _chunkISIO63Q5cjs.cameraMoveField.call(void 0, role);
|
|
5016
5017
|
const current = this.scene.shots.find((s) => s.id === shot);
|
|
5017
5018
|
if (!current) return this.refuse(`Shot "${shot}" was removed while the move was checked.`);
|
|
5018
5019
|
const parts = role === "transition" && resolved.spec.ms === void 0 ? { ...resolved.spec, ms: resolved.description.camera.durationMs } : resolved.spec;
|
|
@@ -5026,7 +5027,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
5026
5027
|
clearShotCameraMove(shot, role) {
|
|
5027
5028
|
const found = this.scene.shots.find((s) => s.id === shot);
|
|
5028
5029
|
if (!found) return this.refuse(`There is no shot "${shot}"; the shots are ${this.scene.shots.map((s) => `"${s.id}"`).join(", ") || "none yet"}.`);
|
|
5029
|
-
const field =
|
|
5030
|
+
const field = _chunkISIO63Q5cjs.cameraMoveField.call(void 0, role);
|
|
5030
5031
|
if (_optionalChain([found, 'access', _232 => _232.camera, 'optionalAccess', _233 => _233[field]]) === void 0) return this.refuse(`Shot "${shot}" has no camera "${field}" move to clear${_optionalChain([found, 'access', _234 => _234.camera, 'optionalAccess', _235 => _235[field === "in" ? "during" : "in"]]) !== void 0 ? `; it has a "${field === "in" ? "during" : "in"}" move (role ${role === "hold" ? "transition" : "hold"})` : ""}.`);
|
|
5031
5032
|
const rest = { ...found.camera };
|
|
5032
5033
|
delete rest[field];
|
|
@@ -5168,7 +5169,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
5168
5169
|
try {
|
|
5169
5170
|
plan = await work();
|
|
5170
5171
|
} catch (error) {
|
|
5171
|
-
if (
|
|
5172
|
+
if (_chunkISIO63Q5cjs.isEffectError.call(void 0, error) || error instanceof Error) return this.refuse(error.message);
|
|
5172
5173
|
throw error;
|
|
5173
5174
|
}
|
|
5174
5175
|
const id = this.scene.shots[plan.shot].id;
|
|
@@ -5250,7 +5251,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
5250
5251
|
const { provider: _p, name: _n, ...given } = transition;
|
|
5251
5252
|
resolved = await resolveMotionShotTransition(this.effects.provider, given);
|
|
5252
5253
|
} catch (error) {
|
|
5253
|
-
if (
|
|
5254
|
+
if (_chunkISIO63Q5cjs.isEffectError.call(void 0, error) || error instanceof Error) return this.refuse(error.message);
|
|
5254
5255
|
throw error;
|
|
5255
5256
|
}
|
|
5256
5257
|
if (!this.scene.shots.some((s) => s.id === shot)) return this.refuse(`Shot "${shot}" was removed while the transition was checked.`);
|
|
@@ -5282,9 +5283,9 @@ var AnimationEditorController = (_class2 = class {
|
|
|
5282
5283
|
const mode = _nullishCoalesce(options.mode, () => ( "replace"));
|
|
5283
5284
|
let filled;
|
|
5284
5285
|
try {
|
|
5285
|
-
filled = await
|
|
5286
|
+
filled = await _chunkZ3BRH4JKcjs.fillEffectTemplate.call(void 0, this.effects.provider, template, values, options.name ? { name: options.name } : {});
|
|
5286
5287
|
} catch (error) {
|
|
5287
|
-
if (
|
|
5288
|
+
if (_chunkISIO63Q5cjs.isEffectError.call(void 0, error) || error instanceof Error) return this.refuse(error.message);
|
|
5288
5289
|
throw error;
|
|
5289
5290
|
}
|
|
5290
5291
|
const provider = this.effects.provider.id;
|
|
@@ -6179,7 +6180,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
|
|
|
6179
6180
|
handler: ({ svg }) => {
|
|
6180
6181
|
let artwork;
|
|
6181
6182
|
try {
|
|
6182
|
-
artwork =
|
|
6183
|
+
artwork = _chunkJPEHXIB5cjs.parseVectorSvg.call(void 0, svg);
|
|
6183
6184
|
} catch (error) {
|
|
6184
6185
|
throw new Error(`The SVG could not be read: ${error.message}. Nothing was changed.`);
|
|
6185
6186
|
}
|
|
@@ -6984,7 +6985,7 @@ function animationCameraMoveTools(controller, ctx) {
|
|
|
6984
6985
|
shot: { type: "string", minLength: 1, description: "A shot id from get_animation." },
|
|
6985
6986
|
role: ROLE,
|
|
6986
6987
|
move: { type: "string", minLength: 1, description: "A camera move id of that role from list_camera_moves." },
|
|
6987
|
-
ms: { type: "number", minimum: 0, maximum:
|
|
6988
|
+
ms: { type: "number", minimum: 0, maximum: _chunkISIO63Q5cjs.CAMERA_MOVE_MAX_MS, description: `How long a transition takes, ms (0\u2013${_chunkISIO63Q5cjs.CAMERA_MOVE_MAX_MS}; default the move's durationMs). Not for a hold, which plays across the shot's hold.` },
|
|
6988
6989
|
preset: { type: "string", minLength: 1, description: "A preset of the move by name, from describe_effect; its values are written out on the shot." },
|
|
6989
6990
|
values: ctx.valuesSchema("Control values over the move's defaults (and the preset's), from describe_effect")
|
|
6990
6991
|
},
|
|
@@ -7057,7 +7058,7 @@ var fields = (ctx) => ({
|
|
|
7057
7058
|
preset: { type: "string", minLength: 1, description: "A preset of the effect by name, from describe_effect; its values are written out on the layer." },
|
|
7058
7059
|
values: ctx.valuesSchema("Control values over the effect's defaults (and the preset's), from describe_effect"),
|
|
7059
7060
|
subject: SUBJECT,
|
|
7060
|
-
role: { type: "string", enum: [...
|
|
7061
|
+
role: { type: "string", enum: [..._chunkISIO63Q5cjs.EFFECT_LAYER_ROLES], description: "background: under the artwork; subject: over the artwork; overlay: over everything. Default subject with a rect, else background." },
|
|
7061
7062
|
rect: RECT,
|
|
7062
7063
|
from: TIME("starts", "0: as its shot starts"),
|
|
7063
7064
|
until: TIME("stops", '{ "shots": 1 }: as the next shot starts'),
|
|
@@ -7147,7 +7148,7 @@ function animationShotLayerTools(controller, ctx) {
|
|
|
7147
7148
|
properties: {
|
|
7148
7149
|
shot: { ...SHOT2, description: "A shot id from get_animation (not the first shot)." },
|
|
7149
7150
|
effect: { ...ctx.effectIdSchema(["transition"]), description: "A transition effect id from search_effects (use transition)." },
|
|
7150
|
-
ms: { type: "number", exclusiveMinimum: 0, maximum: 6e4, description: `How long it takes, ms (default ${
|
|
7151
|
+
ms: { type: "number", exclusiveMinimum: 0, maximum: 6e4, description: `How long it takes, ms (default ${_chunkISIO63Q5cjs.EFFECT_TRANSITION_MS}).` },
|
|
7151
7152
|
preset: { type: "string", minLength: 1, description: "A preset of the transition by name, from describe_effect." },
|
|
7152
7153
|
values: ctx.valuesSchema("Control values over the transition's defaults (and the preset's)")
|
|
7153
7154
|
},
|
|
@@ -7183,7 +7184,7 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
|
|
|
7183
7184
|
if (!r.ok) throw new Error(r.error);
|
|
7184
7185
|
return { target, effect: info(r.effect), effects: controller.appliedEffects().filter((e) => e.targets.includes(target)).map(info), ...r.notes.length ? { notes: r.notes } : {} };
|
|
7185
7186
|
};
|
|
7186
|
-
return withAnimationPlayback(
|
|
7187
|
+
return withAnimationPlayback(_chunkISIO63Q5cjs.createEffectToolProvider.call(void 0, {
|
|
7187
7188
|
id: _nullishCoalesce(options.id, () => ( "animation-effects")),
|
|
7188
7189
|
namespace: options.namespace,
|
|
7189
7190
|
title: "Animation effects",
|
|
@@ -7218,7 +7219,7 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
|
|
|
7218
7219
|
extraTools: (ctx) => [
|
|
7219
7220
|
...animationCameraMoveTools(controller, ctx),
|
|
7220
7221
|
...animationShotLayerTools(controller, ctx),
|
|
7221
|
-
...
|
|
7222
|
+
..._chunkZ3BRH4JKcjs.effectTemplateTools.call(void 0,
|
|
7222
7223
|
{
|
|
7223
7224
|
provider: () => controller.effectsProvider,
|
|
7224
7225
|
fillDetails: "mode replace (default) makes a new scene from the template's shots, the size of its stage; mode append adds its shots after the current ones, scaled to the artwork. Each shot keeps its framing and camera moves, its layers and its transition; its title and caption become overlay word layers. Returns { template, mode, shots (new shot ids), layers (new layer ids), openSlots, notes }. Check the result with render_animation_frame.",
|