@pixerate/editor 0.119.0 → 0.120.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 +54 -54
- package/dist/animation-editor/index.d.cts +3 -3
- package/dist/animation-editor/index.d.ts +3 -3
- package/dist/animation-editor/index.js +2 -2
- package/dist/{chunk-KZLQY4CD.js → chunk-BOWUU4LJ.js} +2 -2
- package/dist/{chunk-KGNUFO4T.cjs → chunk-DFLJHLKA.cjs} +36 -36
- package/dist/{chunk-KGNUFO4T.cjs.map → chunk-DFLJHLKA.cjs.map} +1 -1
- package/dist/{chunk-4S2AXNQF.cjs → chunk-HTAFDTNR.cjs} +82 -82
- package/dist/{chunk-4S2AXNQF.cjs.map → chunk-HTAFDTNR.cjs.map} +1 -1
- package/dist/{chunk-LI3KTY7K.cjs → chunk-VYW7JBTM.cjs} +72 -5
- package/dist/chunk-VYW7JBTM.cjs.map +1 -0
- package/dist/{chunk-TDQDMBUR.js → chunk-WAI6ATHC.js} +2 -2
- package/dist/{chunk-CSHEI3YT.js → chunk-WORWH5K5.js} +71 -4
- package/dist/chunk-WORWH5K5.js.map +1 -0
- package/dist/{export-Ds8Ccw0K.d.ts → export-D2D8hb_u.d.ts} +1 -1
- package/dist/{export-B_jO2PrH.d.cts → export-fP2hZYjm.d.cts} +1 -1
- package/dist/image-editor/index.cjs +579 -579
- package/dist/image-editor/index.d.cts +3 -3
- package/dist/image-editor/index.d.ts +3 -3
- package/dist/image-editor/index.js +2 -2
- package/dist/paint-editor/index.cjs +7 -7
- package/dist/paint-editor/index.d.cts +2 -2
- package/dist/paint-editor/index.d.ts +2 -2
- package/dist/paint-editor/index.js +2 -2
- package/dist/{svg-hK0WQc7-.d.cts → svg-S9zzvqaZ.d.cts} +1 -1
- package/dist/{svg-CTxrB5xO.d.ts → svg-leZpRsJB.d.ts} +1 -1
- package/dist/{types-TrSSh_RB.d.ts → types-BgwxFWvn.d.ts} +23 -9
- package/dist/{types-Dq-8qgoo.d.cts → types-DdRTDnza.d.cts} +23 -9
- package/dist/vector/index.cjs +874 -872
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +12 -5
- package/dist/vector/index.d.ts +12 -5
- package/dist/vector/index.js +7 -5
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-vector/SKILL.md +1 -1
- package/skills/pixerate-vector/references/commands.md +1 -0
- package/dist/chunk-CSHEI3YT.js.map +0 -1
- package/dist/chunk-LI3KTY7K.cjs.map +0 -1
- /package/dist/{chunk-KZLQY4CD.js.map → chunk-BOWUU4LJ.js.map} +0 -0
- /package/dist/{chunk-TDQDMBUR.js.map → chunk-WAI6ATHC.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 _chunkDFLJHLKAcjs = require('../chunk-DFLJHLKA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -31,7 +31,7 @@ var _chunkWAJQKWQUcjs = require('../chunk-WAJQKWQU.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkVYW7JBTMcjs = require('../chunk-VYW7JBTM.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -559,7 +559,7 @@ function smoothMotionTimes(points, start, duration, pacing = "even") {
|
|
|
559
559
|
function motionTextLayout(nodes, id) {
|
|
560
560
|
const group = _optionalChain([nodes, 'access', _5 => _5.get, 'call', _6 => _6(id), 'optionalAccess', _7 => _7.node]);
|
|
561
561
|
if (!group || group.type !== "group") return null;
|
|
562
|
-
const letters =
|
|
562
|
+
const letters = _chunkVYW7JBTMcjs.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);
|
|
563
563
|
if (!letters.length) return null;
|
|
564
564
|
const lines = [];
|
|
565
565
|
for (const l of [...letters].sort((a, c) => a.b.y + a.b.height / 2 - (c.b.y + c.b.height / 2))) {
|
|
@@ -644,21 +644,21 @@ function indexMotionNodes(nodes) {
|
|
|
644
644
|
const out = /* @__PURE__ */ new Map();
|
|
645
645
|
const walk = (list, parentWorld, ancestors) => {
|
|
646
646
|
for (const node of list) {
|
|
647
|
-
const local =
|
|
648
|
-
const bounds =
|
|
647
|
+
const local = _chunkVYW7JBTMcjs.vectorNodeBounds.call(void 0, node);
|
|
648
|
+
const bounds = _chunkVYW7JBTMcjs.vectorNodeBounds.call(void 0, node, parentWorld);
|
|
649
649
|
const center = local ? { x: local.x + local.width / 2, y: local.y + local.height / 2 } : { x: 0, y: 0 };
|
|
650
650
|
if (!out.has(node.id)) out.set(node.id, { node, ancestors, parentWorld, center, bounds, box: local });
|
|
651
|
-
if (node.type === "group") walk(node.children,
|
|
651
|
+
if (node.type === "group") walk(node.children, _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, _chunkVYW7JBTMcjs.nodeMatrix.call(void 0, node), parentWorld), [...ancestors, node.id]);
|
|
652
652
|
}
|
|
653
653
|
};
|
|
654
|
-
walk(nodes,
|
|
654
|
+
walk(nodes, _chunkVYW7JBTMcjs.IDENTITY_MATRIX, []);
|
|
655
655
|
indexCache.set(nodes, out);
|
|
656
656
|
return out;
|
|
657
657
|
}
|
|
658
658
|
var solid = (paint) => typeof paint === "string" && paint !== "none" ? paint : void 0;
|
|
659
659
|
function firstPaint(node, key) {
|
|
660
660
|
if (node.type === "path") return solid(node[key]);
|
|
661
|
-
for (const p of
|
|
661
|
+
for (const p of _chunkVYW7JBTMcjs.collectPathNodes.call(void 0, node)) {
|
|
662
662
|
const s = solid(p[key]);
|
|
663
663
|
if (s) return s;
|
|
664
664
|
}
|
|
@@ -666,7 +666,7 @@ function firstPaint(node, key) {
|
|
|
666
666
|
}
|
|
667
667
|
function strokeReach(node) {
|
|
668
668
|
let reach = 0;
|
|
669
|
-
for (const p of node.type === "path" ? [node] :
|
|
669
|
+
for (const p of node.type === "path" ? [node] : _chunkVYW7JBTMcjs.collectPathNodes.call(void 0, node)) {
|
|
670
670
|
if (p.stroke == null || p.stroke === "none") continue;
|
|
671
671
|
const width = _nullishCoalesce(p.strokeWidth, () => ( 1));
|
|
672
672
|
reach = Math.max(reach, p.strokeAlign === "outside" ? width : p.strokeAlign === "inside" ? 0 : width / 2);
|
|
@@ -736,7 +736,7 @@ function motionRestValue(entry, property, artwork) {
|
|
|
736
736
|
case "stroke":
|
|
737
737
|
return _nullishCoalesce((node && firstPaint(node, property)), () => ( "transparent"));
|
|
738
738
|
case "strokeWidth": {
|
|
739
|
-
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ?
|
|
739
|
+
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ? _chunkVYW7JBTMcjs.collectPathNodes.call(void 0, node)[0] : void 0;
|
|
740
740
|
return _nullishCoalesce(_optionalChain([path, 'optionalAccess', _14 => _14.strokeWidth]), () => ( 1));
|
|
741
741
|
}
|
|
742
742
|
case "shape":
|
|
@@ -847,12 +847,12 @@ function resolveMotionCamera(camera, scene) {
|
|
|
847
847
|
const r = camera;
|
|
848
848
|
return { x: r.x, y: r.y, width: r.width, height: r.height };
|
|
849
849
|
}
|
|
850
|
-
function motionPathLength(node, parentWorld =
|
|
850
|
+
function motionPathLength(node, parentWorld = _chunkVYW7JBTMcjs.IDENTITY_MATRIX) {
|
|
851
851
|
let longest = 0;
|
|
852
|
-
const paths = node.type === "path" ? [node] :
|
|
852
|
+
const paths = node.type === "path" ? [node] : _chunkVYW7JBTMcjs.collectPathNodes.call(void 0, node);
|
|
853
853
|
for (const p of paths) {
|
|
854
854
|
try {
|
|
855
|
-
longest = Math.max(longest, _chunkXGD3FSNCcjs.bezierPathLength.call(void 0,
|
|
855
|
+
longest = Math.max(longest, _chunkXGD3FSNCcjs.bezierPathLength.call(void 0, _chunkVYW7JBTMcjs.vectorPathWorldBezier.call(void 0, p, parentWorld, { effects: false })));
|
|
856
856
|
} catch (e2) {
|
|
857
857
|
}
|
|
858
858
|
}
|
|
@@ -1105,12 +1105,12 @@ function compileMotionScene(scene) {
|
|
|
1105
1105
|
const order2 = _nullishCoalesce(o.order, () => ( "together"));
|
|
1106
1106
|
const pace = _nullishCoalesce(o.pace, () => ( "time"));
|
|
1107
1107
|
if (order2 === "together" && pace === "time") return null;
|
|
1108
|
-
const paths = entry.node.type === "path" ? [entry.node] :
|
|
1108
|
+
const paths = entry.node.type === "path" ? [entry.node] : _chunkVYW7JBTMcjs.collectPathNodes.call(void 0, entry.node);
|
|
1109
1109
|
let list = paths.map((p) => {
|
|
1110
1110
|
const at = nodes.get(p.id);
|
|
1111
1111
|
let first = { x: 0, y: 0 };
|
|
1112
1112
|
try {
|
|
1113
|
-
const m =
|
|
1113
|
+
const m = _chunkVYW7JBTMcjs.vectorPathWorldBezier.call(void 0, p, _nullishCoalesce(_optionalChain([at, 'optionalAccess', _41 => _41.parentWorld]), () => ( _chunkVYW7JBTMcjs.IDENTITY_MATRIX)), { effects: false })[0];
|
|
1114
1114
|
if (m && m.type === "M") first = { x: m.x, y: m.y };
|
|
1115
1115
|
} catch (e3) {
|
|
1116
1116
|
}
|
|
@@ -1222,17 +1222,17 @@ function compileMotionScene(scene) {
|
|
|
1222
1222
|
let dx = _nullishCoalesce(_optionalChain([command3, 'access', _44 => _44.by, 'optionalAccess', _45 => _45.x]), () => ( 0));
|
|
1223
1223
|
let dy = _nullishCoalesce(_optionalChain([command3, 'access', _46 => _46.by, 'optionalAccess', _47 => _47.y]), () => ( 0));
|
|
1224
1224
|
if (command3.to) {
|
|
1225
|
-
const inv =
|
|
1226
|
-
const target =
|
|
1225
|
+
const inv = _chunkVYW7JBTMcjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1226
|
+
const target = _chunkVYW7JBTMcjs.applyMatrix.call(void 0, inv, command3.to);
|
|
1227
1227
|
dx = target.x - (entry.center.x + num2("x"));
|
|
1228
1228
|
dy = target.y - (entry.center.y + num2("y"));
|
|
1229
1229
|
}
|
|
1230
1230
|
if (_optionalChain([command3, 'access', _48 => _48.via, 'optionalAccess', _49 => _49.length])) {
|
|
1231
|
-
const inv =
|
|
1231
|
+
const inv = _chunkVYW7JBTMcjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1232
1232
|
const x0 = num2("x");
|
|
1233
1233
|
const y0 = num2("y");
|
|
1234
1234
|
const add = command3.blend === "add";
|
|
1235
|
-
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) =>
|
|
1235
|
+
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) => _chunkVYW7JBTMcjs.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 }];
|
|
1236
1236
|
const times = smoothMotionTimes(offsets, start, end - start, _nullishCoalesce(command3.pacing, () => ( "even")));
|
|
1237
1237
|
for (const axis of ["x", "y"]) {
|
|
1238
1238
|
const base = add ? 0 : axis === "x" ? x0 : y0;
|
|
@@ -1375,13 +1375,13 @@ function morphBetween(a, b) {
|
|
|
1375
1375
|
let inner = morphCache.get(a);
|
|
1376
1376
|
if (!inner) morphCache.set(a, inner = /* @__PURE__ */ new WeakMap());
|
|
1377
1377
|
let morph = inner.get(b);
|
|
1378
|
-
if (!morph) inner.set(b, morph =
|
|
1378
|
+
if (!morph) inner.set(b, morph = _chunkDFLJHLKAcjs.createVectorMorph.call(void 0, a, b, { id: a.id }));
|
|
1379
1379
|
return morph;
|
|
1380
1380
|
}
|
|
1381
1381
|
function shapeIn(entry, shape) {
|
|
1382
1382
|
if (shape === entry) return entry.node;
|
|
1383
|
-
const m =
|
|
1384
|
-
return { ...shape.node, ...
|
|
1383
|
+
const m = _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, _chunkVYW7JBTMcjs.nodeMatrix.call(void 0, shape.node), shape.parentWorld), _chunkVYW7JBTMcjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
1384
|
+
return { ...shape.node, ..._chunkVYW7JBTMcjs.isIdentityMatrix.call(void 0, m) ? { transform: void 0 } : { transform: m } };
|
|
1385
1385
|
}
|
|
1386
1386
|
function shapeAt(entry, timeline, nodes, time) {
|
|
1387
1387
|
const track = timeline.tracks.get(motionTrackKey(entry.node.id, "shape"));
|
|
@@ -1401,7 +1401,7 @@ function shapeAt(entry, timeline, nodes, time) {
|
|
|
1401
1401
|
function motionFollowRoute(entry, path) {
|
|
1402
1402
|
if (!path || path.node.type !== "path") return null;
|
|
1403
1403
|
try {
|
|
1404
|
-
return _chunkXGD3FSNCcjs.transformBezierPath.call(void 0,
|
|
1404
|
+
return _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, _chunkVYW7JBTMcjs.vectorPathWorldBezier.call(void 0, path.node, path.parentWorld, { effects: false }), _chunkVYW7JBTMcjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
1405
1405
|
} catch (e4) {
|
|
1406
1406
|
return null;
|
|
1407
1407
|
}
|
|
@@ -1435,9 +1435,9 @@ function motionNodeOffset(entry, timeline, time, nodes = indexMotionNodes([entry
|
|
|
1435
1435
|
const scaleX = read("scaleX", 1);
|
|
1436
1436
|
const scaleY = read("scaleY", 1);
|
|
1437
1437
|
const c = entry.center;
|
|
1438
|
-
let matrix =
|
|
1438
|
+
let matrix = _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, _chunkVYW7JBTMcjs.scaleMatrix.call(void 0, scaleX, scaleY, c), _chunkVYW7JBTMcjs.rotateMatrix.call(void 0, rotation, c)), _chunkVYW7JBTMcjs.translateMatrix.call(void 0, dx, dy));
|
|
1439
1439
|
const along = follow ? followAt(entry, timeline, nodes, time) : null;
|
|
1440
|
-
if (along) matrix =
|
|
1440
|
+
if (along) matrix = _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, matrix, _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, _chunkVYW7JBTMcjs.translateMatrix.call(void 0, -c.x, -c.y), _chunkVYW7JBTMcjs.rotateMatrix.call(void 0, along.angle)), _chunkVYW7JBTMcjs.translateMatrix.call(void 0, along.x, along.y)));
|
|
1441
1441
|
return { matrix, dx, dy, rotation, scaleX, scaleY, follow: along };
|
|
1442
1442
|
}
|
|
1443
1443
|
function motionNodeClips(id, timeline, time) {
|
|
@@ -1504,7 +1504,7 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
1504
1504
|
const start = Math.min(1, Math.max(0, typeof drawStart === "number" ? drawStart : 0));
|
|
1505
1505
|
const end = Math.min(1, Math.max(0, typeof drawEnd === "number" ? drawEnd : 1));
|
|
1506
1506
|
if (start > 0 || end < 1) {
|
|
1507
|
-
const trim =
|
|
1507
|
+
const trim = _chunkVYW7JBTMcjs.createVectorEffect.call(void 0, "trim", MOTION_DRAW_EFFECT_ID, { start: tidy(start * 100), end: tidy(end * 100) });
|
|
1508
1508
|
p = { ...p, effects: [trim, ...(_nullishCoalesce(p.effects, () => ( []))).filter((e) => e.id !== MOTION_DRAW_EFFECT_ID)] };
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
@@ -1518,8 +1518,8 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
1518
1518
|
if (o >= 1) delete out.opacity;
|
|
1519
1519
|
}
|
|
1520
1520
|
const offset = options.offsets === false ? null : motionNodeOffset(entry, timeline, time, nodes);
|
|
1521
|
-
if (offset && !
|
|
1522
|
-
const m =
|
|
1521
|
+
if (offset && !_chunkVYW7JBTMcjs.isIdentityMatrix.call(void 0, offset.matrix)) {
|
|
1522
|
+
const m = _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, _chunkVYW7JBTMcjs.nodeMatrix.call(void 0, out), offset.matrix).map(tidy);
|
|
1523
1523
|
out = { ...out, transform: m };
|
|
1524
1524
|
}
|
|
1525
1525
|
return out;
|
|
@@ -1539,7 +1539,7 @@ function motionFrameToSvg(scene, time, options = {}) {
|
|
|
1539
1539
|
const wrap = { ...options.wrap };
|
|
1540
1540
|
for (const [id, clips] of Object.entries(frame.clips))
|
|
1541
1541
|
wrap[id] = [..._nullishCoalesce(wrap[id], () => ( [])), ...clips.map((clip, i) => ({ clip: { id: `${prefix}reveal-${id}-${i}`, shape: clip.shape, attrs: motionClipAttrs(clip) } }))];
|
|
1542
|
-
return withViewBox(
|
|
1542
|
+
return withViewBox(_chunkVYW7JBTMcjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap }), frame.camera);
|
|
1543
1543
|
}
|
|
1544
1544
|
function withViewBox(svg, box) {
|
|
1545
1545
|
const f = (n) => String(Math.round(n * 1e3) / 1e3);
|
|
@@ -1722,8 +1722,8 @@ function visibleAt(timeline, id, time, node) {
|
|
|
1722
1722
|
if (Array.isArray(rect) && (rect[2] <= 1e-4 || rect[3] <= 1e-4)) return false;
|
|
1723
1723
|
const circle = clip("clipCircle");
|
|
1724
1724
|
if (Array.isArray(circle) && circle[2] <= 1e-4) return false;
|
|
1725
|
-
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" :
|
|
1726
|
-
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" ||
|
|
1725
|
+
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" : _chunkVYW7JBTMcjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
|
|
1726
|
+
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunkVYW7JBTMcjs.collectPathNodes.call(void 0, node).length === 0 || _chunkVYW7JBTMcjs.collectPathNodes.call(void 0, node).some((p) => {
|
|
1727
1727
|
const v = trackValue(timeline.tracks.get(motionTrackKey(p.id, "drawEnd")), time);
|
|
1728
1728
|
return typeof v !== "number" || v > 0.01;
|
|
1729
1729
|
}));
|
|
@@ -1809,7 +1809,7 @@ function checkMotionScene(scene) {
|
|
|
1809
1809
|
}
|
|
1810
1810
|
for (const id of targets) {
|
|
1811
1811
|
const node = nodes.get(id).node;
|
|
1812
|
-
const paths = node.type === "path" ? [node] :
|
|
1812
|
+
const paths = node.type === "path" ? [node] : _chunkVYW7JBTMcjs.collectPathNodes.call(void 0, node);
|
|
1813
1813
|
if (paths.some((p) => p[key] !== void 0 && p[key] !== null && typeof p[key] !== "string"))
|
|
1814
1814
|
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] }));
|
|
1815
1815
|
}
|
|
@@ -1822,7 +1822,7 @@ function checkMotionScene(scene) {
|
|
|
1822
1822
|
else
|
|
1823
1823
|
for (const id of targets) {
|
|
1824
1824
|
const node = nodes.get(id).node;
|
|
1825
|
-
const paths = node.type === "path" ? [node] :
|
|
1825
|
+
const paths = node.type === "path" ? [node] : _chunkVYW7JBTMcjs.collectPathNodes.call(void 0, node);
|
|
1826
1826
|
if (paths.some((p) => typeof p[key] !== "string"))
|
|
1827
1827
|
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] }));
|
|
1828
1828
|
}
|
|
@@ -2406,7 +2406,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2406
2406
|
raw: (t) => transformAt(t, true)
|
|
2407
2407
|
});
|
|
2408
2408
|
}
|
|
2409
|
-
const paths = node.type === "path" ? [node] :
|
|
2409
|
+
const paths = node.type === "path" ? [node] : _chunkVYW7JBTMcjs.collectPathNodes.call(void 0, node);
|
|
2410
2410
|
for (const path of paths) {
|
|
2411
2411
|
if (pathsSeen.has(path.id)) continue;
|
|
2412
2412
|
pathsSeen.add(path.id);
|
|
@@ -2428,7 +2428,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2428
2428
|
if (shapeSegments.length) {
|
|
2429
2429
|
if (node.type !== "path") notes.push(`"${id}" is a group: its morph or effect animation is not exported (Flair tweens one path's "d").`);
|
|
2430
2430
|
else {
|
|
2431
|
-
const inverse =
|
|
2431
|
+
const inverse = _chunkVYW7JBTMcjs.invertMatrix.call(void 0, _chunkVYW7JBTMcjs.nodeMatrix.call(void 0, node));
|
|
2432
2432
|
channels.push({
|
|
2433
2433
|
id,
|
|
2434
2434
|
kind: "attr",
|
|
@@ -2437,9 +2437,9 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2437
2437
|
exact: () => false,
|
|
2438
2438
|
value: (t) => {
|
|
2439
2439
|
const frame = motionFrameAt(scene, t, { draw: false, offsets: false });
|
|
2440
|
-
const now =
|
|
2440
|
+
const now = _chunkVYW7JBTMcjs.expandVectorAppearance.call(void 0, _optionalChain([indexMotionNodes, 'call', _108 => _108(frame.document.nodes), 'access', _109 => _109.get, 'call', _110 => _110(id), 'optionalAccess', _111 => _111.node]));
|
|
2441
2441
|
if (!now || now.type !== "path") return "";
|
|
2442
|
-
const bezier = _chunkXGD3FSNCcjs.transformBezierPath.call(void 0,
|
|
2442
|
+
const bezier = _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, _chunkVYW7JBTMcjs.vectorPathWorldBezier.call(void 0, now, _chunkVYW7JBTMcjs.IDENTITY_MATRIX, { effects: false }), inverse);
|
|
2443
2443
|
return _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, bezier, { precision: Math.min(precision, 2) });
|
|
2444
2444
|
}
|
|
2445
2445
|
});
|
|
@@ -2546,7 +2546,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2546
2546
|
}
|
|
2547
2547
|
if (scene.motionBlur) notes.push("Motion blur is drawn on the stage only; Flair plays the scene sharp.");
|
|
2548
2548
|
if (trigger && (_nullishCoalesce(scene.loop, () => ( "none"))) !== "none") notes.push(`The scene plays on ${trigger}, so its loop does not apply in Flair.`);
|
|
2549
|
-
let svg =
|
|
2549
|
+
let svg = _chunkVYW7JBTMcjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunkVYW7JBTMcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) }, { pretty: false, precision, wrap });
|
|
2550
2550
|
if (routes.length) svg = svg.replace(/^(<svg[^>]*>)/, `$1<defs>${routes.join("")}</defs>`);
|
|
2551
2551
|
let motion = { svg, animate };
|
|
2552
2552
|
if (_optionalChain([scene, 'access', _114 => _114.controls, 'optionalAccess', _115 => _115.length])) {
|
|
@@ -2630,14 +2630,14 @@ function easingOf(ease, fallback) {
|
|
|
2630
2630
|
return fallback;
|
|
2631
2631
|
}
|
|
2632
2632
|
function poseOf(value, entry) {
|
|
2633
|
-
const t =
|
|
2634
|
-
const o =
|
|
2633
|
+
const t = _chunkVYW7JBTMcjs.parseSvgTransform.call(void 0, String(value));
|
|
2634
|
+
const o = _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkVYW7JBTMcjs.invertMatrix.call(void 0, _chunkVYW7JBTMcjs.nodeMatrix.call(void 0, entry.node)), () => ( [1, 0, 0, 1, 0, 0])), t);
|
|
2635
2635
|
const sx = Math.hypot(o[0], o[1]);
|
|
2636
2636
|
if (!(sx > 1e-9)) return null;
|
|
2637
2637
|
const sy = (o[0] * o[3] - o[1] * o[2]) / sx;
|
|
2638
2638
|
if (Math.abs(o[2] + o[1] / sx * sy) > 1e-6 || Math.abs(o[3] - o[0] / sx * sy) > 1e-6) return null;
|
|
2639
2639
|
const c = entry.center;
|
|
2640
|
-
const moved =
|
|
2640
|
+
const moved = _chunkVYW7JBTMcjs.applyMatrix.call(void 0, o, c);
|
|
2641
2641
|
return { dx: moved.x - c.x, dy: moved.y - c.y, rotation: Math.atan2(o[1], o[0]) * 180 / Math.PI, sx, sy };
|
|
2642
2642
|
}
|
|
2643
2643
|
var near = (a, b, eps = 1e-6) => Math.abs(a - b) < eps;
|
|
@@ -2722,7 +2722,7 @@ function fromFlairSvgMotion(input, options = {}) {
|
|
|
2722
2722
|
const notes = [];
|
|
2723
2723
|
if (!input || typeof input.svg !== "string") throw new Error('Give a Flair SvgMotion: { svg: "<svg \u2026>", animate: [ \u2026 ] }.');
|
|
2724
2724
|
const { motion, controls } = resolvePlaceholders(input, notes);
|
|
2725
|
-
const artwork =
|
|
2725
|
+
const artwork = _chunkVYW7JBTMcjs.parseVectorSvg.call(void 0, motion.svg);
|
|
2726
2726
|
const nodes = indexMotionNodes(artwork.nodes);
|
|
2727
2727
|
const byStep = /* @__PURE__ */ new Map();
|
|
2728
2728
|
for (const anim of _nullishCoalesce(motion.animate, () => ( []))) {
|
|
@@ -2969,9 +2969,9 @@ function toLottie(scene, options = {}) {
|
|
|
2969
2969
|
const items = [];
|
|
2970
2970
|
const shapeSegments = [...timeline.tracks.entries()].filter(([k]) => k.startsWith(`${path.id}\0`) && (k.endsWith("\0shape") || k.includes("\0effect:"))).flatMap(([, v]) => v);
|
|
2971
2971
|
const geometryAt = (t) => {
|
|
2972
|
-
if (!shapeSegments.length) return
|
|
2972
|
+
if (!shapeSegments.length) return _chunkVYW7JBTMcjs.vectorPathWorldBezier.call(void 0, path);
|
|
2973
2973
|
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]);
|
|
2974
|
-
return now && now.type === "path" ?
|
|
2974
|
+
return now && now.type === "path" ? _chunkVYW7JBTMcjs.vectorPathWorldBezier.call(void 0, _chunkVYW7JBTMcjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunkVYW7JBTMcjs.vectorPathWorldBezier.call(void 0, path);
|
|
2975
2975
|
};
|
|
2976
2976
|
const rest = lottieContours(_chunkXGD3FSNCcjs.toBezierPath.call(void 0, geometryAt(0)), round2);
|
|
2977
2977
|
rest.forEach((contour, n) => {
|
|
@@ -3044,13 +3044,13 @@ function toLottie(scene, options = {}) {
|
|
|
3044
3044
|
const innerTr = STATIC_TR();
|
|
3045
3045
|
if (node.type === "path") inner = [...pathShapes(node)];
|
|
3046
3046
|
else if (node.type === "text" || node.type === "instance") {
|
|
3047
|
-
const drawn =
|
|
3047
|
+
const drawn = _chunkVYW7JBTMcjs.expandVectorAppearance.call(void 0, node);
|
|
3048
3048
|
inner = drawn.type === "path" ? [...pathShapes(drawn)] : drawn.children.filter((c) => c.type === "path").reverse().flatMap((c) => [...pathShapes(c)]);
|
|
3049
|
-
notes.push(`"${node.id}": text is exported as its outlines${
|
|
3049
|
+
notes.push(`"${node.id}": text is exported as its outlines${_chunkVYW7JBTMcjs.vectorTextHasOutlines.call(void 0, ) ? "" : " (glyph boxes: set an outline text shaper for real glyphs)"}.`);
|
|
3050
3050
|
} else {
|
|
3051
3051
|
inner = shown(node.children).reverse().map(nodeGroup);
|
|
3052
|
-
const m =
|
|
3053
|
-
if (m !==
|
|
3052
|
+
const m = _chunkVYW7JBTMcjs.nodeMatrix.call(void 0, node);
|
|
3053
|
+
if (m !== _chunkVYW7JBTMcjs.IDENTITY_MATRIX) {
|
|
3054
3054
|
const parts = staticParts(m);
|
|
3055
3055
|
if (!parts) notes.push(`"${node.id}": its transform skews, which is not exported; it is drawn without the skew.`);
|
|
3056
3056
|
else {
|
|
@@ -3063,7 +3063,7 @@ function toLottie(scene, options = {}) {
|
|
|
3063
3063
|
const body = { ty: "gr", nm: `${node.id} (own)`, it: [...inner, innerTr] };
|
|
3064
3064
|
return { ty: "gr", nm: _nullishCoalesce(node.name, () => ( node.id)), it: [body, poseTransform(entry)] };
|
|
3065
3065
|
};
|
|
3066
|
-
const artwork = { ...scene.artwork, nodes:
|
|
3066
|
+
const artwork = { ...scene.artwork, nodes: _chunkVYW7JBTMcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) };
|
|
3067
3067
|
const content = shown(artwork.nodes).reverse().map(nodeGroup);
|
|
3068
3068
|
if (artwork.background && rgba(artwork.background))
|
|
3069
3069
|
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()] });
|
|
@@ -3162,11 +3162,11 @@ function preset(prst, w, h) {
|
|
|
3162
3162
|
const poly = (pts) => [{ closed: true, anchors: pts.map(([x, y]) => ({ x, y })) }];
|
|
3163
3163
|
switch (prst) {
|
|
3164
3164
|
case "rect":
|
|
3165
|
-
return [
|
|
3165
|
+
return [_chunkVYW7JBTMcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3166
3166
|
case "roundRect":
|
|
3167
|
-
return [
|
|
3167
|
+
return [_chunkVYW7JBTMcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h }, Math.min(w, h) * 0.16667)];
|
|
3168
3168
|
case "ellipse":
|
|
3169
|
-
return [
|
|
3169
|
+
return [_chunkVYW7JBTMcjs.ellipseSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3170
3170
|
case "triangle":
|
|
3171
3171
|
return poly([[w / 2, 0], [w, h], [0, h]]);
|
|
3172
3172
|
case "rtTriangle":
|
|
@@ -3274,7 +3274,7 @@ function shapes(ctx, tree, map) {
|
|
|
3274
3274
|
let subpaths = cust ? custom(cust, w, h) : prst ? preset(prst, w, h) : null;
|
|
3275
3275
|
if (!subpaths) {
|
|
3276
3276
|
if (prst) ctx.notes.push(`"${name}" is a ${prst}, drawn as its bounding rectangle.`);
|
|
3277
|
-
subpaths = [
|
|
3277
|
+
subpaths = [_chunkVYW7JBTMcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3278
3278
|
}
|
|
3279
3279
|
const style = kid(el, "style");
|
|
3280
3280
|
const fill = kid(spPr, "noFill") ? null : _nullishCoalesce(colour(ctx, kid(spPr, "solidFill")), () => ( (el.localName === "cxnSp" ? null : colour(ctx, kid(style, "fillRef")))));
|
|
@@ -4259,7 +4259,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
|
|
|
4259
4259
|
handler: ({ svg }) => {
|
|
4260
4260
|
let artwork;
|
|
4261
4261
|
try {
|
|
4262
|
-
artwork =
|
|
4262
|
+
artwork = _chunkVYW7JBTMcjs.parseVectorSvg.call(void 0, svg);
|
|
4263
4263
|
} catch (error) {
|
|
4264
4264
|
throw new Error(`The SVG could not be read: ${error.message}. Nothing was changed.`);
|
|
4265
4265
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { b as AnimationEasing } from '../easing-lM0Xo9Ni.cjs';
|
|
2
2
|
import { b as AnimationLoopMode, c as AnimationPlayer, C as Clock } from '../player-DrcP2xqj.cjs';
|
|
3
|
-
import { x as VectorDocument, e as VectorNode, h as VectorBounds } from '../types-
|
|
3
|
+
import { x as VectorDocument, e as VectorNode, h as VectorBounds } from '../types-DdRTDnza.cjs';
|
|
4
4
|
import { a as MotionBehavior } from '../behavior-Ymbld6jL.cjs';
|
|
5
5
|
import { A as AffineMatrix, B as BezierPath } from '../bezier-BfwIbVTl.cjs';
|
|
6
|
-
import { V as VectorSvgExportOptions } from '../svg-
|
|
6
|
+
import { V as VectorSvgExportOptions } from '../svg-S9zzvqaZ.cjs';
|
|
7
7
|
import { Z as ZipReadOptions } from '../zip-4nG0YAH7.cjs';
|
|
8
8
|
import { H as HistoryManager } from '../HistoryManager-DeQQMBCj.cjs';
|
|
9
9
|
import { a as AgentToolProvider } from '../registry-BqA1AZt0.cjs';
|
|
@@ -1867,7 +1867,7 @@ declare function describeMotionElements(scene: MotionScene): {
|
|
|
1867
1867
|
} | undefined;
|
|
1868
1868
|
effects?: {
|
|
1869
1869
|
id: string;
|
|
1870
|
-
type: "trim" | "twist" | "roundCorners" | "puckerBloat" | "zigzag" | "wiggle" | "offset" | "merge" | "repeater" | "envelope" | "contour";
|
|
1870
|
+
type: "trim" | "twist" | "roundCorners" | "puckerBloat" | "zigzag" | "wiggle" | "offset" | "merge" | "repeater" | "envelope" | "contour" | "blockShadow";
|
|
1871
1871
|
numericParams: {
|
|
1872
1872
|
[k: string]: unknown;
|
|
1873
1873
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { b as AnimationEasing } from '../easing-lM0Xo9Ni.js';
|
|
2
2
|
import { b as AnimationLoopMode, c as AnimationPlayer, C as Clock } from '../player-DV4Jujdq.js';
|
|
3
|
-
import { x as VectorDocument, e as VectorNode, h as VectorBounds } from '../types-
|
|
3
|
+
import { x as VectorDocument, e as VectorNode, h as VectorBounds } from '../types-BgwxFWvn.js';
|
|
4
4
|
import { a as MotionBehavior } from '../behavior-Ymbld6jL.js';
|
|
5
5
|
import { A as AffineMatrix, B as BezierPath } from '../bezier-DYBvLgUH.js';
|
|
6
|
-
import { V as VectorSvgExportOptions } from '../svg-
|
|
6
|
+
import { V as VectorSvgExportOptions } from '../svg-leZpRsJB.js';
|
|
7
7
|
import { Z as ZipReadOptions } from '../zip-4nG0YAH7.js';
|
|
8
8
|
import { H as HistoryManager } from '../HistoryManager-DWSLd6Tf.js';
|
|
9
9
|
import { a as AgentToolProvider } from '../registry-D-4fit9C.js';
|
|
@@ -1867,7 +1867,7 @@ declare function describeMotionElements(scene: MotionScene): {
|
|
|
1867
1867
|
} | undefined;
|
|
1868
1868
|
effects?: {
|
|
1869
1869
|
id: string;
|
|
1870
|
-
type: "trim" | "twist" | "roundCorners" | "puckerBloat" | "zigzag" | "wiggle" | "offset" | "merge" | "repeater" | "envelope" | "contour";
|
|
1870
|
+
type: "trim" | "twist" | "roundCorners" | "puckerBloat" | "zigzag" | "wiggle" | "offset" | "merge" | "repeater" | "envelope" | "contour" | "blockShadow";
|
|
1871
1871
|
numericParams: {
|
|
1872
1872
|
[k: string]: unknown;
|
|
1873
1873
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createVectorMorph
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-WAI6ATHC.js";
|
|
4
4
|
import {
|
|
5
5
|
MOTION_ISSUE_CODES,
|
|
6
6
|
motionIssue,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
vectorNodeBounds,
|
|
32
32
|
vectorPathWorldBezier,
|
|
33
33
|
vectorTextHasOutlines
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-WORWH5K5.js";
|
|
35
35
|
import {
|
|
36
36
|
bezierPathLength,
|
|
37
37
|
bezierPathPointAtLength,
|
|
@@ -118,7 +118,7 @@ import {
|
|
|
118
118
|
textRectPath,
|
|
119
119
|
translateMatrix,
|
|
120
120
|
warpPresetMesh
|
|
121
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-WORWH5K5.js";
|
|
122
122
|
import {
|
|
123
123
|
bezierPathBounds,
|
|
124
124
|
outlineStroke,
|
|
@@ -11770,4 +11770,4 @@ export {
|
|
|
11770
11770
|
smartContentsFile,
|
|
11771
11771
|
exportPsd
|
|
11772
11772
|
};
|
|
11773
|
-
//# sourceMappingURL=chunk-
|
|
11773
|
+
//# sourceMappingURL=chunk-BOWUU4LJ.js.map
|