@pixerate/editor 0.136.0 → 0.137.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation-editor/index.cjs +60 -55
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +4 -4
- package/dist/animation-editor/index.d.ts +4 -4
- package/dist/animation-editor/index.js +7 -2
- package/dist/animation-editor/index.js.map +1 -1
- package/dist/{bezier-CdccFsF8.d.cts → bezier-CZ2AhjID.d.cts} +1 -1
- package/dist/{bezier-DG9qNZQV.d.ts → bezier-Dywv3Bw8.d.ts} +1 -1
- package/dist/blending-D7jCmjO6.d.cts +1026 -0
- package/dist/blending-NgF3qo3d.d.ts +1026 -0
- package/dist/brushes-CnvZSYYU.d.cts +744 -0
- package/dist/brushes-DJmUbIgz.d.ts +744 -0
- package/dist/{brushstrokeRender-SII6MG4R.js → brushstrokeRender-2FAXA3XC.js} +13 -16
- package/dist/{brushstrokeRender-SII6MG4R.js.map → brushstrokeRender-2FAXA3XC.js.map} +1 -1
- package/dist/{brushstrokeRender-JNHVEUFG.cjs → brushstrokeRender-IMFY3FF6.cjs} +16 -19
- package/dist/brushstrokeRender-IMFY3FF6.cjs.map +1 -0
- package/dist/canvas/index.cjs +10 -10
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +7 -7
- package/dist/canvas/index.d.ts +7 -7
- package/dist/canvas/index.js +4 -4
- package/dist/{chunk-W4LNKTHT.cjs → chunk-2XS6LTUP.cjs} +63 -63
- package/dist/{chunk-W4LNKTHT.cjs.map → chunk-2XS6LTUP.cjs.map} +1 -1
- package/dist/{chunk-MAHQC3SK.js → chunk-3D77LOBM.js} +222 -135
- package/dist/chunk-3D77LOBM.js.map +1 -0
- package/dist/{chunk-BR7EKQUP.js → chunk-3G6J7UFV.js} +322 -2
- package/dist/chunk-3G6J7UFV.js.map +1 -0
- package/dist/{chunk-62XUO5LB.js → chunk-3X6IAJUQ.js} +2 -2
- package/dist/{chunk-EM3FMJWE.js → chunk-5FSRTP6E.js} +320 -3
- package/dist/chunk-5FSRTP6E.js.map +1 -0
- package/dist/{chunk-2R3UW57U.cjs → chunk-5OOIUXNJ.cjs} +333 -246
- package/dist/chunk-5OOIUXNJ.cjs.map +1 -0
- package/dist/{chunk-KZXLZCQ7.js → chunk-6S6362D2.js} +2 -2
- package/dist/{chunk-24ATT2PE.cjs → chunk-AEAAN4AD.cjs} +120 -120
- package/dist/{chunk-24ATT2PE.cjs.map → chunk-AEAAN4AD.cjs.map} +1 -1
- package/dist/{chunk-SVYE5HIM.js → chunk-EQQMGO42.js} +2 -2
- package/dist/{chunk-FHPVDTI2.cjs → chunk-F2Y4E4GU.cjs} +22 -22
- package/dist/{chunk-FHPVDTI2.cjs.map → chunk-F2Y4E4GU.cjs.map} +1 -1
- package/dist/{chunk-UYQUPUR6.js → chunk-HUO3TI4C.js} +3 -3
- package/dist/{chunk-DDSO4HS7.cjs → chunk-KEENUAFN.cjs} +2 -2
- package/dist/{chunk-DDSO4HS7.cjs.map → chunk-KEENUAFN.cjs.map} +1 -1
- package/dist/{chunk-2HC4DRF4.js → chunk-LLFHCSU2.js} +2 -2
- package/dist/{chunk-J5BA3BQ6.cjs → chunk-O7LUD7MH.cjs} +323 -3
- package/dist/chunk-O7LUD7MH.cjs.map +1 -0
- package/dist/{chunk-ILYFOJUN.js → chunk-OIBIRXRG.js} +3 -3
- package/dist/{chunk-B2CUCM7Y.cjs → chunk-PRSRYHQD.cjs} +36 -36
- package/dist/{chunk-B2CUCM7Y.cjs.map → chunk-PRSRYHQD.cjs.map} +1 -1
- package/dist/{chunk-6GFRKLLS.cjs → chunk-QBWEH3IM.cjs} +429 -112
- package/dist/chunk-QBWEH3IM.cjs.map +1 -0
- package/dist/{chunk-6QQR4LKE.js → chunk-SYT2TLQF.js} +35 -37
- package/dist/{chunk-6QQR4LKE.js.map → chunk-SYT2TLQF.js.map} +1 -1
- package/dist/{chunk-YT3JL7YM.cjs → chunk-TLCTTQFF.cjs} +53 -53
- package/dist/{chunk-YT3JL7YM.cjs.map → chunk-TLCTTQFF.cjs.map} +1 -1
- package/dist/{chunk-JLGNZMUV.cjs → chunk-XN2NBLV5.cjs} +313 -315
- package/dist/chunk-XN2NBLV5.cjs.map +1 -0
- package/dist/effects/index.d.cts +4 -4
- package/dist/effects/index.d.ts +4 -4
- package/dist/{export-Ds7zgGD8.d.ts → export-41rL6Cne.d.ts} +1 -1
- package/dist/{export-BOheWw2R.d.cts → export-CyJdfP_Z.d.cts} +5 -4
- package/dist/{export-CEYeRQXH.d.cts → export-D9mXp05Q.d.cts} +1 -1
- package/dist/{export-ByKKIA2S.d.ts → export-DwnZ_hvQ.d.ts} +5 -4
- package/dist/{helpers--ns3W2D7.d.ts → helpers-C-RgeyvH.d.ts} +18 -7
- package/dist/{helpers-BVkU4oUi.d.cts → helpers-v6GMazzg.d.cts} +18 -7
- package/dist/image-editor/index.cjs +984 -987
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +12 -11
- package/dist/image-editor/index.d.ts +12 -11
- package/dist/image-editor/index.js +92 -95
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{opentype-yi-Kz4ND.d.cts → opentype-KR_jj6b_.d.cts} +1 -1
- package/dist/{opentype-DfoVYgmG.d.ts → opentype-a1KAW-qs.d.ts} +1 -1
- package/dist/paint/index.cjs +5 -8
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +4 -2
- package/dist/paint/index.d.ts +4 -2
- package/dist/paint/index.js +15 -18
- package/dist/paint-editor/index.cjs +403 -404
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +12 -748
- package/dist/paint-editor/index.d.ts +12 -748
- package/dist/paint-editor/index.js +77 -78
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/{pathfinder-7JkMwYvC.d.cts → pathfinder-BHS4vQNm.d.cts} +1 -1
- package/dist/{pathfinder-GM3UWdBZ.d.ts → pathfinder-BVvTIBMo.d.ts} +1 -1
- package/dist/{pool-CkTxlLMC.d.ts → pool-CZQOrSXZ.d.ts} +1 -1
- package/dist/{pool-04qp8iW4.d.cts → pool-FjZZmZ80.d.cts} +1 -1
- package/dist/rand-8xbUb6ur.d.ts +1118 -0
- package/dist/rand-Cw9VLrVC.d.cts +1118 -0
- package/dist/raster/index.cjs +17 -19
- package/dist/raster/index.cjs.map +1 -1
- package/dist/raster/index.js +9 -11
- package/dist/raster/index.js.map +1 -1
- package/dist/{svg-rV6_HPmn.d.ts → svg-CSz3mzkw.d.ts} +2 -2
- package/dist/{svg-BDDKvWWY.d.cts → svg-DTb40ICU.d.cts} +2 -2
- package/dist/{tools-DPYerqeR.d.ts → tools-B0wXP5cF.d.ts} +1 -1
- package/dist/{tools-BAjSbTdY.d.cts → tools-Ca0kI1qo.d.cts} +1 -1
- package/dist/vector/index.cjs +1459 -1259
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +87 -11
- package/dist/vector/index.d.ts +87 -11
- package/dist/vector/index.js +213 -13
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.d.cts +4 -4
- package/dist/video-editor/index.d.ts +4 -4
- package/dist/{warp-DQh9R7Ie.d.cts → warp-DTOp0lON.d.cts} +1 -1
- package/dist/{warp-XVL6SpSh.d.ts → warp-pd7hrH4T.d.ts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-vector/SKILL.md +8 -0
- package/dist/brushstrokeRender-JNHVEUFG.cjs.map +0 -1
- package/dist/chunk-2R3UW57U.cjs.map +0 -1
- package/dist/chunk-64PYNEHJ.js +0 -340
- package/dist/chunk-64PYNEHJ.js.map +0 -1
- package/dist/chunk-6GFRKLLS.cjs.map +0 -1
- package/dist/chunk-7QN76ESJ.js +0 -323
- package/dist/chunk-7QN76ESJ.js.map +0 -1
- package/dist/chunk-BR7EKQUP.js.map +0 -1
- package/dist/chunk-DCLJNVZS.cjs +0 -323
- package/dist/chunk-DCLJNVZS.cjs.map +0 -1
- package/dist/chunk-EM3FMJWE.js.map +0 -1
- package/dist/chunk-J5BA3BQ6.cjs.map +0 -1
- package/dist/chunk-JLGNZMUV.cjs.map +0 -1
- package/dist/chunk-MAHQC3SK.js.map +0 -1
- package/dist/chunk-Z6OUCS2K.cjs +0 -340
- package/dist/chunk-Z6OUCS2K.cjs.map +0 -1
- package/dist/rand-BszBST4s.d.ts +0 -2140
- package/dist/rand-DOH_aMvm.d.cts +0 -2140
- /package/dist/{chunk-62XUO5LB.js.map → chunk-3X6IAJUQ.js.map} +0 -0
- /package/dist/{chunk-KZXLZCQ7.js.map → chunk-6S6362D2.js.map} +0 -0
- /package/dist/{chunk-SVYE5HIM.js.map → chunk-EQQMGO42.js.map} +0 -0
- /package/dist/{chunk-UYQUPUR6.js.map → chunk-HUO3TI4C.js.map} +0 -0
- /package/dist/{chunk-2HC4DRF4.js.map → chunk-LLFHCSU2.js.map} +0 -0
- /package/dist/{chunk-ILYFOJUN.js.map → chunk-OIBIRXRG.js.map} +0 -0
|
@@ -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;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkPRSRYHQDcjs = require('../chunk-PRSRYHQD.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -31,7 +31,8 @@ var _chunkWAJQKWQUcjs = require('../chunk-WAJQKWQU.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunk5OOIUXNJcjs = require('../chunk-5OOIUXNJ.cjs');
|
|
35
|
+
require('../chunk-2XS6LTUP.cjs');
|
|
35
36
|
require('../chunk-Q6OUXEK3.cjs');
|
|
36
37
|
|
|
37
38
|
|
|
@@ -49,6 +50,10 @@ require('../chunk-IZ4WRXZA.cjs');
|
|
|
49
50
|
|
|
50
51
|
var _chunkJODTP4DPcjs = require('../chunk-JODTP4DP.cjs');
|
|
51
52
|
require('../chunk-RIWPYSKU.cjs');
|
|
53
|
+
require('../chunk-QBWEH3IM.cjs');
|
|
54
|
+
require('../chunk-SYPFUL5B.cjs');
|
|
55
|
+
require('../chunk-O7LUD7MH.cjs');
|
|
56
|
+
require('../chunk-643B2HKC.cjs');
|
|
52
57
|
require('../chunk-FD4LPFAE.cjs');
|
|
53
58
|
|
|
54
59
|
|
|
@@ -576,7 +581,7 @@ function smoothMotionTimes(points, start, duration, pacing = "even") {
|
|
|
576
581
|
function motionTextLayout(nodes, id) {
|
|
577
582
|
const group = _optionalChain([nodes, 'access', _5 => _5.get, 'call', _6 => _6(id), 'optionalAccess', _7 => _7.node]);
|
|
578
583
|
if (!group || group.type !== "group") return null;
|
|
579
|
-
const letters =
|
|
584
|
+
const letters = _chunk5OOIUXNJcjs.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);
|
|
580
585
|
if (!letters.length) return null;
|
|
581
586
|
const lines = [];
|
|
582
587
|
for (const l of [...letters].sort((a, c) => a.b.y + a.b.height / 2 - (c.b.y + c.b.height / 2))) {
|
|
@@ -661,21 +666,21 @@ function indexMotionNodes(nodes) {
|
|
|
661
666
|
const out = /* @__PURE__ */ new Map();
|
|
662
667
|
const walk = (list, parentWorld, ancestors) => {
|
|
663
668
|
for (const node of list) {
|
|
664
|
-
const local =
|
|
665
|
-
const bounds =
|
|
669
|
+
const local = _chunk5OOIUXNJcjs.vectorNodeBounds.call(void 0, node);
|
|
670
|
+
const bounds = _chunk5OOIUXNJcjs.vectorNodeBounds.call(void 0, node, parentWorld);
|
|
666
671
|
const center = local ? { x: local.x + local.width / 2, y: local.y + local.height / 2 } : { x: 0, y: 0 };
|
|
667
672
|
if (!out.has(node.id)) out.set(node.id, { node, ancestors, parentWorld, center, bounds, box: local });
|
|
668
|
-
if (node.type === "group") walk(node.children,
|
|
673
|
+
if (node.type === "group") walk(node.children, _chunk5OOIUXNJcjs.multiplyMatrices.call(void 0, _chunk5OOIUXNJcjs.nodeMatrix.call(void 0, node), parentWorld), [...ancestors, node.id]);
|
|
669
674
|
}
|
|
670
675
|
};
|
|
671
|
-
walk(nodes,
|
|
676
|
+
walk(nodes, _chunk5OOIUXNJcjs.IDENTITY_MATRIX, []);
|
|
672
677
|
indexCache.set(nodes, out);
|
|
673
678
|
return out;
|
|
674
679
|
}
|
|
675
680
|
var solid = (paint) => typeof paint === "string" && paint !== "none" ? paint : void 0;
|
|
676
681
|
function firstPaint(node, key) {
|
|
677
682
|
if (node.type === "path") return solid(node[key]);
|
|
678
|
-
for (const p of
|
|
683
|
+
for (const p of _chunk5OOIUXNJcjs.collectPathNodes.call(void 0, node)) {
|
|
679
684
|
const s = solid(p[key]);
|
|
680
685
|
if (s) return s;
|
|
681
686
|
}
|
|
@@ -683,7 +688,7 @@ function firstPaint(node, key) {
|
|
|
683
688
|
}
|
|
684
689
|
function strokeReach(node) {
|
|
685
690
|
let reach = 0;
|
|
686
|
-
for (const p of node.type === "path" ? [node] :
|
|
691
|
+
for (const p of node.type === "path" ? [node] : _chunk5OOIUXNJcjs.collectPathNodes.call(void 0, node)) {
|
|
687
692
|
if (p.stroke == null || p.stroke === "none") continue;
|
|
688
693
|
const width = _nullishCoalesce(p.strokeWidth, () => ( 1));
|
|
689
694
|
reach = Math.max(reach, p.strokeAlign === "outside" ? width : p.strokeAlign === "inside" ? 0 : width / 2);
|
|
@@ -753,7 +758,7 @@ function motionRestValue(entry, property, artwork) {
|
|
|
753
758
|
case "stroke":
|
|
754
759
|
return _nullishCoalesce((node && firstPaint(node, property)), () => ( "transparent"));
|
|
755
760
|
case "strokeWidth": {
|
|
756
|
-
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ?
|
|
761
|
+
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ? _chunk5OOIUXNJcjs.collectPathNodes.call(void 0, node)[0] : void 0;
|
|
757
762
|
return _nullishCoalesce(_optionalChain([path, 'optionalAccess', _14 => _14.strokeWidth]), () => ( 1));
|
|
758
763
|
}
|
|
759
764
|
case "shape":
|
|
@@ -864,12 +869,12 @@ function resolveMotionCamera(camera, scene) {
|
|
|
864
869
|
const r = camera;
|
|
865
870
|
return { x: r.x, y: r.y, width: r.width, height: r.height };
|
|
866
871
|
}
|
|
867
|
-
function motionPathLength(node, parentWorld =
|
|
872
|
+
function motionPathLength(node, parentWorld = _chunk5OOIUXNJcjs.IDENTITY_MATRIX) {
|
|
868
873
|
let longest = 0;
|
|
869
|
-
const paths = node.type === "path" ? [node] :
|
|
874
|
+
const paths = node.type === "path" ? [node] : _chunk5OOIUXNJcjs.collectPathNodes.call(void 0, node);
|
|
870
875
|
for (const p of paths) {
|
|
871
876
|
try {
|
|
872
|
-
longest = Math.max(longest, _chunkBJTCSLF6cjs.bezierPathLength.call(void 0,
|
|
877
|
+
longest = Math.max(longest, _chunkBJTCSLF6cjs.bezierPathLength.call(void 0, _chunk5OOIUXNJcjs.vectorPathWorldBezier.call(void 0, p, parentWorld, { effects: false })));
|
|
873
878
|
} catch (e2) {
|
|
874
879
|
}
|
|
875
880
|
}
|
|
@@ -1122,12 +1127,12 @@ function compileMotionScene(scene) {
|
|
|
1122
1127
|
const order2 = _nullishCoalesce(o.order, () => ( "together"));
|
|
1123
1128
|
const pace = _nullishCoalesce(o.pace, () => ( "time"));
|
|
1124
1129
|
if (order2 === "together" && pace === "time") return null;
|
|
1125
|
-
const paths = entry.node.type === "path" ? [entry.node] :
|
|
1130
|
+
const paths = entry.node.type === "path" ? [entry.node] : _chunk5OOIUXNJcjs.collectPathNodes.call(void 0, entry.node);
|
|
1126
1131
|
let list = paths.map((p) => {
|
|
1127
1132
|
const at = nodes.get(p.id);
|
|
1128
1133
|
let first = { x: 0, y: 0 };
|
|
1129
1134
|
try {
|
|
1130
|
-
const m =
|
|
1135
|
+
const m = _chunk5OOIUXNJcjs.vectorPathWorldBezier.call(void 0, p, _nullishCoalesce(_optionalChain([at, 'optionalAccess', _41 => _41.parentWorld]), () => ( _chunk5OOIUXNJcjs.IDENTITY_MATRIX)), { effects: false })[0];
|
|
1131
1136
|
if (m && m.type === "M") first = { x: m.x, y: m.y };
|
|
1132
1137
|
} catch (e3) {
|
|
1133
1138
|
}
|
|
@@ -1239,17 +1244,17 @@ function compileMotionScene(scene) {
|
|
|
1239
1244
|
let dx = _nullishCoalesce(_optionalChain([command3, 'access', _44 => _44.by, 'optionalAccess', _45 => _45.x]), () => ( 0));
|
|
1240
1245
|
let dy = _nullishCoalesce(_optionalChain([command3, 'access', _46 => _46.by, 'optionalAccess', _47 => _47.y]), () => ( 0));
|
|
1241
1246
|
if (command3.to) {
|
|
1242
|
-
const inv =
|
|
1243
|
-
const target =
|
|
1247
|
+
const inv = _chunk5OOIUXNJcjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1248
|
+
const target = _chunk5OOIUXNJcjs.applyMatrix.call(void 0, inv, command3.to);
|
|
1244
1249
|
dx = target.x - (entry.center.x + num2("x"));
|
|
1245
1250
|
dy = target.y - (entry.center.y + num2("y"));
|
|
1246
1251
|
}
|
|
1247
1252
|
if (_optionalChain([command3, 'access', _48 => _48.via, 'optionalAccess', _49 => _49.length])) {
|
|
1248
|
-
const inv =
|
|
1253
|
+
const inv = _chunk5OOIUXNJcjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1249
1254
|
const x0 = num2("x");
|
|
1250
1255
|
const y0 = num2("y");
|
|
1251
1256
|
const add = command3.blend === "add";
|
|
1252
|
-
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) =>
|
|
1257
|
+
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) => _chunk5OOIUXNJcjs.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 }];
|
|
1253
1258
|
const times = smoothMotionTimes(offsets, start, end - start, _nullishCoalesce(command3.pacing, () => ( "even")));
|
|
1254
1259
|
for (const axis of ["x", "y"]) {
|
|
1255
1260
|
const base = add ? 0 : axis === "x" ? x0 : y0;
|
|
@@ -1392,13 +1397,13 @@ function morphBetween(a, b) {
|
|
|
1392
1397
|
let inner = morphCache.get(a);
|
|
1393
1398
|
if (!inner) morphCache.set(a, inner = /* @__PURE__ */ new WeakMap());
|
|
1394
1399
|
let morph = inner.get(b);
|
|
1395
|
-
if (!morph) inner.set(b, morph =
|
|
1400
|
+
if (!morph) inner.set(b, morph = _chunkPRSRYHQDcjs.createVectorMorph.call(void 0, a, b, { id: a.id }));
|
|
1396
1401
|
return morph;
|
|
1397
1402
|
}
|
|
1398
1403
|
function shapeIn(entry, shape) {
|
|
1399
1404
|
if (shape === entry) return entry.node;
|
|
1400
|
-
const m =
|
|
1401
|
-
return { ...shape.node, ...
|
|
1405
|
+
const m = _chunk5OOIUXNJcjs.multiplyMatrices.call(void 0, _chunk5OOIUXNJcjs.multiplyMatrices.call(void 0, _chunk5OOIUXNJcjs.nodeMatrix.call(void 0, shape.node), shape.parentWorld), _chunk5OOIUXNJcjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
1406
|
+
return { ...shape.node, ..._chunk5OOIUXNJcjs.isIdentityMatrix.call(void 0, m) ? { transform: void 0 } : { transform: m } };
|
|
1402
1407
|
}
|
|
1403
1408
|
function shapeAt(entry, timeline, nodes, time) {
|
|
1404
1409
|
const track = timeline.tracks.get(motionTrackKey(entry.node.id, "shape"));
|
|
@@ -1418,7 +1423,7 @@ function shapeAt(entry, timeline, nodes, time) {
|
|
|
1418
1423
|
function motionFollowRoute(entry, path) {
|
|
1419
1424
|
if (!path || path.node.type !== "path") return null;
|
|
1420
1425
|
try {
|
|
1421
|
-
return _chunkBJTCSLF6cjs.transformBezierPath.call(void 0,
|
|
1426
|
+
return _chunkBJTCSLF6cjs.transformBezierPath.call(void 0, _chunk5OOIUXNJcjs.vectorPathWorldBezier.call(void 0, path.node, path.parentWorld, { effects: false }), _chunk5OOIUXNJcjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
1422
1427
|
} catch (e4) {
|
|
1423
1428
|
return null;
|
|
1424
1429
|
}
|
|
@@ -1452,9 +1457,9 @@ function motionNodeOffset(entry, timeline, time, nodes = indexMotionNodes([entry
|
|
|
1452
1457
|
const scaleX = read("scaleX", 1);
|
|
1453
1458
|
const scaleY = read("scaleY", 1);
|
|
1454
1459
|
const c = entry.center;
|
|
1455
|
-
let matrix =
|
|
1460
|
+
let matrix = _chunk5OOIUXNJcjs.multiplyMatrices.call(void 0, _chunk5OOIUXNJcjs.multiplyMatrices.call(void 0, _chunk5OOIUXNJcjs.scaleMatrix.call(void 0, scaleX, scaleY, c), _chunk5OOIUXNJcjs.rotateMatrix.call(void 0, rotation, c)), _chunk5OOIUXNJcjs.translateMatrix.call(void 0, dx, dy));
|
|
1456
1461
|
const along = follow ? followAt(entry, timeline, nodes, time) : null;
|
|
1457
|
-
if (along) matrix =
|
|
1462
|
+
if (along) matrix = _chunk5OOIUXNJcjs.multiplyMatrices.call(void 0, matrix, _chunk5OOIUXNJcjs.multiplyMatrices.call(void 0, _chunk5OOIUXNJcjs.multiplyMatrices.call(void 0, _chunk5OOIUXNJcjs.translateMatrix.call(void 0, -c.x, -c.y), _chunk5OOIUXNJcjs.rotateMatrix.call(void 0, along.angle)), _chunk5OOIUXNJcjs.translateMatrix.call(void 0, along.x, along.y)));
|
|
1458
1463
|
return { matrix, dx, dy, rotation, scaleX, scaleY, follow: along };
|
|
1459
1464
|
}
|
|
1460
1465
|
function motionNodeClips(id, timeline, time) {
|
|
@@ -1521,7 +1526,7 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
1521
1526
|
const start = Math.min(1, Math.max(0, typeof drawStart === "number" ? drawStart : 0));
|
|
1522
1527
|
const end = Math.min(1, Math.max(0, typeof drawEnd === "number" ? drawEnd : 1));
|
|
1523
1528
|
if (start > 0 || end < 1) {
|
|
1524
|
-
const trim =
|
|
1529
|
+
const trim = _chunk5OOIUXNJcjs.createVectorEffect.call(void 0, "trim", MOTION_DRAW_EFFECT_ID, { start: tidy(start * 100), end: tidy(end * 100) });
|
|
1525
1530
|
p = { ...p, effects: [trim, ...(_nullishCoalesce(p.effects, () => ( []))).filter((e) => e.id !== MOTION_DRAW_EFFECT_ID)] };
|
|
1526
1531
|
}
|
|
1527
1532
|
}
|
|
@@ -1535,8 +1540,8 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
1535
1540
|
if (o >= 1) delete out.opacity;
|
|
1536
1541
|
}
|
|
1537
1542
|
const offset = options.offsets === false ? null : motionNodeOffset(entry, timeline, time, nodes);
|
|
1538
|
-
if (offset && !
|
|
1539
|
-
const m =
|
|
1543
|
+
if (offset && !_chunk5OOIUXNJcjs.isIdentityMatrix.call(void 0, offset.matrix)) {
|
|
1544
|
+
const m = _chunk5OOIUXNJcjs.multiplyMatrices.call(void 0, _chunk5OOIUXNJcjs.nodeMatrix.call(void 0, out), offset.matrix).map(tidy);
|
|
1540
1545
|
out = { ...out, transform: m };
|
|
1541
1546
|
}
|
|
1542
1547
|
return out;
|
|
@@ -1556,7 +1561,7 @@ function motionFrameToSvg(scene, time, options = {}) {
|
|
|
1556
1561
|
const wrap = { ...options.wrap };
|
|
1557
1562
|
for (const [id, clips] of Object.entries(frame.clips))
|
|
1558
1563
|
wrap[id] = [..._nullishCoalesce(wrap[id], () => ( [])), ...clips.map((clip, i) => ({ clip: { id: `${prefix}reveal-${id}-${i}`, shape: clip.shape, attrs: motionClipAttrs(clip) } }))];
|
|
1559
|
-
return withViewBox(
|
|
1564
|
+
return withViewBox(_chunk5OOIUXNJcjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap }), frame.camera);
|
|
1560
1565
|
}
|
|
1561
1566
|
function withViewBox(svg, box) {
|
|
1562
1567
|
const f = (n) => String(Math.round(n * 1e3) / 1e3);
|
|
@@ -1739,8 +1744,8 @@ function visibleAt(timeline, id, time, node) {
|
|
|
1739
1744
|
if (Array.isArray(rect) && (rect[2] <= 1e-4 || rect[3] <= 1e-4)) return false;
|
|
1740
1745
|
const circle = clip("clipCircle");
|
|
1741
1746
|
if (Array.isArray(circle) && circle[2] <= 1e-4) return false;
|
|
1742
|
-
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" :
|
|
1743
|
-
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" ||
|
|
1747
|
+
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" : _chunk5OOIUXNJcjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
|
|
1748
|
+
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunk5OOIUXNJcjs.collectPathNodes.call(void 0, node).length === 0 || _chunk5OOIUXNJcjs.collectPathNodes.call(void 0, node).some((p) => {
|
|
1744
1749
|
const v = trackValue(timeline.tracks.get(motionTrackKey(p.id, "drawEnd")), time);
|
|
1745
1750
|
return typeof v !== "number" || v > 0.01;
|
|
1746
1751
|
}));
|
|
@@ -1826,7 +1831,7 @@ function checkMotionScene(scene) {
|
|
|
1826
1831
|
}
|
|
1827
1832
|
for (const id of targets) {
|
|
1828
1833
|
const node = nodes.get(id).node;
|
|
1829
|
-
const paths = node.type === "path" ? [node] :
|
|
1834
|
+
const paths = node.type === "path" ? [node] : _chunk5OOIUXNJcjs.collectPathNodes.call(void 0, node);
|
|
1830
1835
|
if (paths.some((p) => p[key] !== void 0 && p[key] !== null && typeof p[key] !== "string"))
|
|
1831
1836
|
issues.push(_chunkWAJQKWQUcjs.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] }));
|
|
1832
1837
|
}
|
|
@@ -1839,7 +1844,7 @@ function checkMotionScene(scene) {
|
|
|
1839
1844
|
else
|
|
1840
1845
|
for (const id of targets) {
|
|
1841
1846
|
const node = nodes.get(id).node;
|
|
1842
|
-
const paths = node.type === "path" ? [node] :
|
|
1847
|
+
const paths = node.type === "path" ? [node] : _chunk5OOIUXNJcjs.collectPathNodes.call(void 0, node);
|
|
1843
1848
|
if (paths.some((p) => typeof p[key] !== "string"))
|
|
1844
1849
|
issues.push(_chunkWAJQKWQUcjs.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] }));
|
|
1845
1850
|
}
|
|
@@ -2423,7 +2428,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2423
2428
|
raw: (t) => transformAt(t, true)
|
|
2424
2429
|
});
|
|
2425
2430
|
}
|
|
2426
|
-
const paths = node.type === "path" ? [node] :
|
|
2431
|
+
const paths = node.type === "path" ? [node] : _chunk5OOIUXNJcjs.collectPathNodes.call(void 0, node);
|
|
2427
2432
|
for (const path of paths) {
|
|
2428
2433
|
if (pathsSeen.has(path.id)) continue;
|
|
2429
2434
|
pathsSeen.add(path.id);
|
|
@@ -2445,7 +2450,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2445
2450
|
if (shapeSegments.length) {
|
|
2446
2451
|
if (node.type !== "path") notes.push(`"${id}" is a group: its morph or effect animation is not exported (Flair tweens one path's "d").`);
|
|
2447
2452
|
else {
|
|
2448
|
-
const inverse =
|
|
2453
|
+
const inverse = _chunk5OOIUXNJcjs.invertMatrix.call(void 0, _chunk5OOIUXNJcjs.nodeMatrix.call(void 0, node));
|
|
2449
2454
|
channels.push({
|
|
2450
2455
|
id,
|
|
2451
2456
|
kind: "attr",
|
|
@@ -2454,9 +2459,9 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2454
2459
|
exact: () => false,
|
|
2455
2460
|
value: (t) => {
|
|
2456
2461
|
const frame = motionFrameAt(scene, t, { draw: false, offsets: false });
|
|
2457
|
-
const now =
|
|
2462
|
+
const now = _chunk5OOIUXNJcjs.expandVectorAppearance.call(void 0, _optionalChain([indexMotionNodes, 'call', _108 => _108(frame.document.nodes), 'access', _109 => _109.get, 'call', _110 => _110(id), 'optionalAccess', _111 => _111.node]));
|
|
2458
2463
|
if (!now || now.type !== "path") return "";
|
|
2459
|
-
const bezier = _chunkBJTCSLF6cjs.transformBezierPath.call(void 0,
|
|
2464
|
+
const bezier = _chunkBJTCSLF6cjs.transformBezierPath.call(void 0, _chunk5OOIUXNJcjs.vectorPathWorldBezier.call(void 0, now, _chunk5OOIUXNJcjs.IDENTITY_MATRIX, { effects: false }), inverse);
|
|
2460
2465
|
return _chunkBJTCSLF6cjs.bezierPathToSvg.call(void 0, bezier, { precision: Math.min(precision, 2) });
|
|
2461
2466
|
}
|
|
2462
2467
|
});
|
|
@@ -2563,7 +2568,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2563
2568
|
}
|
|
2564
2569
|
if (scene.motionBlur) notes.push("Motion blur is drawn on the stage only; Flair plays the scene sharp.");
|
|
2565
2570
|
if (trigger && (_nullishCoalesce(scene.loop, () => ( "none"))) !== "none") notes.push(`The scene plays on ${trigger}, so its loop does not apply in Flair.`);
|
|
2566
|
-
let svg =
|
|
2571
|
+
let svg = _chunk5OOIUXNJcjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunk5OOIUXNJcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) }, { pretty: false, precision, wrap });
|
|
2567
2572
|
if (routes.length) svg = svg.replace(/^(<svg[^>]*>)/, `$1<defs>${routes.join("")}</defs>`);
|
|
2568
2573
|
let motion = { svg, animate };
|
|
2569
2574
|
if (_optionalChain([scene, 'access', _114 => _114.controls, 'optionalAccess', _115 => _115.length])) {
|
|
@@ -2647,14 +2652,14 @@ function easingOf(ease, fallback) {
|
|
|
2647
2652
|
return fallback;
|
|
2648
2653
|
}
|
|
2649
2654
|
function poseOf(value, entry) {
|
|
2650
|
-
const t =
|
|
2651
|
-
const o =
|
|
2655
|
+
const t = _chunk5OOIUXNJcjs.parseSvgTransform.call(void 0, String(value));
|
|
2656
|
+
const o = _chunk5OOIUXNJcjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunk5OOIUXNJcjs.invertMatrix.call(void 0, _chunk5OOIUXNJcjs.nodeMatrix.call(void 0, entry.node)), () => ( [1, 0, 0, 1, 0, 0])), t);
|
|
2652
2657
|
const sx = Math.hypot(o[0], o[1]);
|
|
2653
2658
|
if (!(sx > 1e-9)) return null;
|
|
2654
2659
|
const sy = (o[0] * o[3] - o[1] * o[2]) / sx;
|
|
2655
2660
|
if (Math.abs(o[2] + o[1] / sx * sy) > 1e-6 || Math.abs(o[3] - o[0] / sx * sy) > 1e-6) return null;
|
|
2656
2661
|
const c = entry.center;
|
|
2657
|
-
const moved =
|
|
2662
|
+
const moved = _chunk5OOIUXNJcjs.applyMatrix.call(void 0, o, c);
|
|
2658
2663
|
return { dx: moved.x - c.x, dy: moved.y - c.y, rotation: Math.atan2(o[1], o[0]) * 180 / Math.PI, sx, sy };
|
|
2659
2664
|
}
|
|
2660
2665
|
var near = (a, b, eps = 1e-6) => Math.abs(a - b) < eps;
|
|
@@ -2739,7 +2744,7 @@ function fromFlairSvgMotion(input, options = {}) {
|
|
|
2739
2744
|
const notes = [];
|
|
2740
2745
|
if (!input || typeof input.svg !== "string") throw new Error('Give a Flair SvgMotion: { svg: "<svg \u2026>", animate: [ \u2026 ] }.');
|
|
2741
2746
|
const { motion, controls } = resolvePlaceholders(input, notes);
|
|
2742
|
-
const artwork =
|
|
2747
|
+
const artwork = _chunk5OOIUXNJcjs.parseVectorSvg.call(void 0, motion.svg);
|
|
2743
2748
|
const nodes = indexMotionNodes(artwork.nodes);
|
|
2744
2749
|
const byStep = /* @__PURE__ */ new Map();
|
|
2745
2750
|
for (const anim of _nullishCoalesce(motion.animate, () => ( []))) {
|
|
@@ -2986,9 +2991,9 @@ function toLottie(scene, options = {}) {
|
|
|
2986
2991
|
const items = [];
|
|
2987
2992
|
const shapeSegments = [...timeline.tracks.entries()].filter(([k]) => k.startsWith(`${path.id}\0`) && (k.endsWith("\0shape") || k.includes("\0effect:"))).flatMap(([, v]) => v);
|
|
2988
2993
|
const geometryAt = (t) => {
|
|
2989
|
-
if (!shapeSegments.length) return
|
|
2994
|
+
if (!shapeSegments.length) return _chunk5OOIUXNJcjs.vectorPathWorldBezier.call(void 0, path);
|
|
2990
2995
|
const now = _optionalChain([indexMotionNodes, 'call', _124 => _124(motionFrameAt(scene, t, { draw: false, offsets: false }).document.nodes), 'access', _125 => _125.get, 'call', _126 => _126(path.id), 'optionalAccess', _127 => _127.node]);
|
|
2991
|
-
return now && now.type === "path" ?
|
|
2996
|
+
return now && now.type === "path" ? _chunk5OOIUXNJcjs.vectorPathWorldBezier.call(void 0, _chunk5OOIUXNJcjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunk5OOIUXNJcjs.vectorPathWorldBezier.call(void 0, path);
|
|
2992
2997
|
};
|
|
2993
2998
|
const rest = lottieContours(_chunkBJTCSLF6cjs.toBezierPath.call(void 0, geometryAt(0)), round2);
|
|
2994
2999
|
rest.forEach((contour, n) => {
|
|
@@ -3061,13 +3066,13 @@ function toLottie(scene, options = {}) {
|
|
|
3061
3066
|
const innerTr = STATIC_TR();
|
|
3062
3067
|
if (node.type === "path") inner = [...pathShapes(node)];
|
|
3063
3068
|
else if (node.type === "text" || node.type === "instance") {
|
|
3064
|
-
const drawn =
|
|
3069
|
+
const drawn = _chunk5OOIUXNJcjs.expandVectorAppearance.call(void 0, node);
|
|
3065
3070
|
inner = drawn.type === "path" ? [...pathShapes(drawn)] : drawn.children.filter((c) => c.type === "path").reverse().flatMap((c) => [...pathShapes(c)]);
|
|
3066
|
-
notes.push(`"${node.id}": text is exported as its outlines${
|
|
3071
|
+
notes.push(`"${node.id}": text is exported as its outlines${_chunk5OOIUXNJcjs.vectorTextHasOutlines.call(void 0, ) ? "" : " (glyph boxes: set an outline text shaper for real glyphs)"}.`);
|
|
3067
3072
|
} else {
|
|
3068
3073
|
inner = shown(node.children).reverse().map(nodeGroup);
|
|
3069
|
-
const m =
|
|
3070
|
-
if (m !==
|
|
3074
|
+
const m = _chunk5OOIUXNJcjs.nodeMatrix.call(void 0, node);
|
|
3075
|
+
if (m !== _chunk5OOIUXNJcjs.IDENTITY_MATRIX) {
|
|
3071
3076
|
const parts = staticParts(m);
|
|
3072
3077
|
if (!parts) notes.push(`"${node.id}": its transform skews, which is not exported; it is drawn without the skew.`);
|
|
3073
3078
|
else {
|
|
@@ -3080,7 +3085,7 @@ function toLottie(scene, options = {}) {
|
|
|
3080
3085
|
const body = { ty: "gr", nm: `${node.id} (own)`, it: [...inner, innerTr] };
|
|
3081
3086
|
return { ty: "gr", nm: _nullishCoalesce(node.name, () => ( node.id)), it: [body, poseTransform(entry)] };
|
|
3082
3087
|
};
|
|
3083
|
-
const artwork = { ...scene.artwork, nodes:
|
|
3088
|
+
const artwork = { ...scene.artwork, nodes: _chunk5OOIUXNJcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) };
|
|
3084
3089
|
const content = shown(artwork.nodes).reverse().map(nodeGroup);
|
|
3085
3090
|
if (artwork.background && rgba(artwork.background))
|
|
3086
3091
|
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(round2) }, o: { a: 0, k: 100 }, r: 1 }, STATIC_TR()] });
|
|
@@ -3179,11 +3184,11 @@ function preset(prst, w, h) {
|
|
|
3179
3184
|
const poly = (pts) => [{ closed: true, anchors: pts.map(([x, y]) => ({ x, y })) }];
|
|
3180
3185
|
switch (prst) {
|
|
3181
3186
|
case "rect":
|
|
3182
|
-
return [
|
|
3187
|
+
return [_chunk5OOIUXNJcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3183
3188
|
case "roundRect":
|
|
3184
|
-
return [
|
|
3189
|
+
return [_chunk5OOIUXNJcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h }, Math.min(w, h) * 0.16667)];
|
|
3185
3190
|
case "ellipse":
|
|
3186
|
-
return [
|
|
3191
|
+
return [_chunk5OOIUXNJcjs.ellipseSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3187
3192
|
case "triangle":
|
|
3188
3193
|
return poly([[w / 2, 0], [w, h], [0, h]]);
|
|
3189
3194
|
case "rtTriangle":
|
|
@@ -3291,7 +3296,7 @@ function shapes(ctx, tree, map) {
|
|
|
3291
3296
|
let subpaths = cust ? custom(cust, w, h) : prst ? preset(prst, w, h) : null;
|
|
3292
3297
|
if (!subpaths) {
|
|
3293
3298
|
if (prst) ctx.notes.push(`"${name}" is a ${prst}, drawn as its bounding rectangle.`);
|
|
3294
|
-
subpaths = [
|
|
3299
|
+
subpaths = [_chunk5OOIUXNJcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3295
3300
|
}
|
|
3296
3301
|
const style = kid(el, "style");
|
|
3297
3302
|
const fill = kid(spPr, "noFill") ? null : _nullishCoalesce(colour(ctx, kid(spPr, "solidFill")), () => ( (el.localName === "cxnSp" ? null : colour(ctx, kid(style, "fillRef")))));
|
|
@@ -3529,7 +3534,7 @@ function nextMotionEffectInstance(scene) {
|
|
|
3529
3534
|
walk(scene.artwork.nodes);
|
|
3530
3535
|
for (let i = 1; ; i++) if (!used.has(`fx${i}`)) return `fx${i}`;
|
|
3531
3536
|
}
|
|
3532
|
-
var motionArtworkSvg = (artwork) =>
|
|
3537
|
+
var motionArtworkSvg = (artwork) => _chunk5OOIUXNJcjs.vectorDocumentToSvg.call(void 0, artwork);
|
|
3533
3538
|
var tag = (commands, source) => commands.map((c) => c.type === "wait" ? c : { ...c, source });
|
|
3534
3539
|
function motionCommandsFromEffect(artwork, motion, source) {
|
|
3535
3540
|
const imported = fromFlairSvgMotion({ svg: motionArtworkSvg(artwork), animate: [..._nullishCoalesce(motion.animate, () => ( []))] });
|
|
@@ -4514,7 +4519,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
|
|
|
4514
4519
|
handler: ({ svg }) => {
|
|
4515
4520
|
let artwork;
|
|
4516
4521
|
try {
|
|
4517
|
-
artwork =
|
|
4522
|
+
artwork = _chunk5OOIUXNJcjs.parseVectorSvg.call(void 0, svg);
|
|
4518
4523
|
} catch (error) {
|
|
4519
4524
|
throw new Error(`The SVG could not be read: ${error.message}. Nothing was changed.`);
|
|
4520
4525
|
}
|