@pixerate/editor 0.140.3 → 0.140.4
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 +55 -55
- package/dist/animation-editor/index.js +2 -2
- package/dist/{chunk-XGOU44RJ.js → chunk-77SG47WT.js} +80 -9
- package/dist/{chunk-2SHFIVC3.js → chunk-DAS7M4RY.js} +1 -1
- package/dist/{chunk-VSR5A22L.cjs → chunk-H6FX45CP.cjs} +35 -35
- package/dist/{chunk-RCUX6CT2.cjs → chunk-HRI3ZMDM.cjs} +110 -39
- package/dist/{chunk-6UZCFD7Y.js → chunk-VM6JYWXQ.js} +1 -1
- package/dist/{chunk-O3ZU6QIZ.cjs → chunk-XNZWATSB.cjs} +81 -81
- package/dist/image-editor/index.cjs +614 -614
- package/dist/image-editor/index.js +2 -2
- package/dist/paint-editor/index.cjs +7 -7
- package/dist/paint-editor/index.js +2 -2
- package/dist/vector/index.cjs +945 -945
- package/dist/vector/index.js +2 -2
- package/package.json +1 -1
|
@@ -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 _chunkH6FX45CPcjs = require('../chunk-H6FX45CP.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -31,7 +31,7 @@ var _chunkEBDZWIOPcjs = require('../chunk-EBDZWIOP.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkHRI3ZMDMcjs = require('../chunk-HRI3ZMDM.cjs');
|
|
35
35
|
require('../chunk-BXMIBMVG.cjs');
|
|
36
36
|
require('../chunk-CVFAAZXE.cjs');
|
|
37
37
|
|
|
@@ -582,7 +582,7 @@ function smoothMotionTimes(points, start, duration, pacing = "even") {
|
|
|
582
582
|
function motionTextLayout(nodes, id) {
|
|
583
583
|
const group = _optionalChain([nodes, 'access', _5 => _5.get, 'call', _6 => _6(id), 'optionalAccess', _7 => _7.node]);
|
|
584
584
|
if (!group || group.type !== "group") return null;
|
|
585
|
-
const letters =
|
|
585
|
+
const letters = _chunkHRI3ZMDMcjs.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);
|
|
586
586
|
if (!letters.length) return null;
|
|
587
587
|
const lines = [];
|
|
588
588
|
for (const l of [...letters].sort((a, c) => a.b.y + a.b.height / 2 - (c.b.y + c.b.height / 2))) {
|
|
@@ -667,21 +667,21 @@ function indexMotionNodes(nodes) {
|
|
|
667
667
|
const out = /* @__PURE__ */ new Map();
|
|
668
668
|
const walk = (list, parentWorld, ancestors) => {
|
|
669
669
|
for (const node of list) {
|
|
670
|
-
const local =
|
|
671
|
-
const bounds =
|
|
670
|
+
const local = _chunkHRI3ZMDMcjs.vectorNodeBounds.call(void 0, node);
|
|
671
|
+
const bounds = _chunkHRI3ZMDMcjs.vectorNodeBounds.call(void 0, node, parentWorld);
|
|
672
672
|
const center = local ? { x: local.x + local.width / 2, y: local.y + local.height / 2 } : { x: 0, y: 0 };
|
|
673
673
|
if (!out.has(node.id)) out.set(node.id, { node, ancestors, parentWorld, center, bounds, box: local });
|
|
674
|
-
if (node.type === "group") walk(node.children,
|
|
674
|
+
if (node.type === "group") walk(node.children, _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.nodeMatrix.call(void 0, node), parentWorld), [...ancestors, node.id]);
|
|
675
675
|
}
|
|
676
676
|
};
|
|
677
|
-
walk(nodes,
|
|
677
|
+
walk(nodes, _chunkHRI3ZMDMcjs.IDENTITY_MATRIX, []);
|
|
678
678
|
indexCache.set(nodes, out);
|
|
679
679
|
return out;
|
|
680
680
|
}
|
|
681
681
|
var solid = (paint) => typeof paint === "string" && paint !== "none" ? paint : void 0;
|
|
682
682
|
function firstPaint(node, key) {
|
|
683
683
|
if (node.type === "path") return solid(node[key]);
|
|
684
|
-
for (const p of
|
|
684
|
+
for (const p of _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node)) {
|
|
685
685
|
const s = solid(p[key]);
|
|
686
686
|
if (s) return s;
|
|
687
687
|
}
|
|
@@ -689,7 +689,7 @@ function firstPaint(node, key) {
|
|
|
689
689
|
}
|
|
690
690
|
function strokeReach(node) {
|
|
691
691
|
let reach = 0;
|
|
692
|
-
for (const p of node.type === "path" ? [node] :
|
|
692
|
+
for (const p of node.type === "path" ? [node] : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node)) {
|
|
693
693
|
if (p.stroke == null || p.stroke === "none") continue;
|
|
694
694
|
const width = _nullishCoalesce(p.strokeWidth, () => ( 1));
|
|
695
695
|
reach = Math.max(reach, p.strokeAlign === "outside" ? width : p.strokeAlign === "inside" ? 0 : width / 2);
|
|
@@ -759,7 +759,7 @@ function motionRestValue(entry, property, artwork) {
|
|
|
759
759
|
case "stroke":
|
|
760
760
|
return _nullishCoalesce((node && firstPaint(node, property)), () => ( "transparent"));
|
|
761
761
|
case "strokeWidth": {
|
|
762
|
-
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ?
|
|
762
|
+
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ? _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node)[0] : void 0;
|
|
763
763
|
return _nullishCoalesce(_optionalChain([path, 'optionalAccess', _14 => _14.strokeWidth]), () => ( 1));
|
|
764
764
|
}
|
|
765
765
|
case "shape":
|
|
@@ -870,12 +870,12 @@ function resolveMotionCamera(camera, scene) {
|
|
|
870
870
|
const r = camera;
|
|
871
871
|
return { x: r.x, y: r.y, width: r.width, height: r.height };
|
|
872
872
|
}
|
|
873
|
-
function motionPathLength(node, parentWorld =
|
|
873
|
+
function motionPathLength(node, parentWorld = _chunkHRI3ZMDMcjs.IDENTITY_MATRIX) {
|
|
874
874
|
let longest = 0;
|
|
875
|
-
const paths = node.type === "path" ? [node] :
|
|
875
|
+
const paths = node.type === "path" ? [node] : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node);
|
|
876
876
|
for (const p of paths) {
|
|
877
877
|
try {
|
|
878
|
-
longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0,
|
|
878
|
+
longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0, _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, p, parentWorld, { effects: false })));
|
|
879
879
|
} catch (e2) {
|
|
880
880
|
}
|
|
881
881
|
}
|
|
@@ -1128,12 +1128,12 @@ function compileMotionScene(scene) {
|
|
|
1128
1128
|
const order2 = _nullishCoalesce(o.order, () => ( "together"));
|
|
1129
1129
|
const pace = _nullishCoalesce(o.pace, () => ( "time"));
|
|
1130
1130
|
if (order2 === "together" && pace === "time") return null;
|
|
1131
|
-
const paths = entry.node.type === "path" ? [entry.node] :
|
|
1131
|
+
const paths = entry.node.type === "path" ? [entry.node] : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, entry.node);
|
|
1132
1132
|
let list = paths.map((p) => {
|
|
1133
1133
|
const at = nodes.get(p.id);
|
|
1134
1134
|
let first = { x: 0, y: 0 };
|
|
1135
1135
|
try {
|
|
1136
|
-
const m =
|
|
1136
|
+
const m = _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, p, _nullishCoalesce(_optionalChain([at, 'optionalAccess', _41 => _41.parentWorld]), () => ( _chunkHRI3ZMDMcjs.IDENTITY_MATRIX)), { effects: false })[0];
|
|
1137
1137
|
if (m && m.type === "M") first = { x: m.x, y: m.y };
|
|
1138
1138
|
} catch (e3) {
|
|
1139
1139
|
}
|
|
@@ -1245,17 +1245,17 @@ function compileMotionScene(scene) {
|
|
|
1245
1245
|
let dx = _nullishCoalesce(_optionalChain([command3, 'access', _44 => _44.by, 'optionalAccess', _45 => _45.x]), () => ( 0));
|
|
1246
1246
|
let dy = _nullishCoalesce(_optionalChain([command3, 'access', _46 => _46.by, 'optionalAccess', _47 => _47.y]), () => ( 0));
|
|
1247
1247
|
if (command3.to) {
|
|
1248
|
-
const inv =
|
|
1249
|
-
const target =
|
|
1248
|
+
const inv = _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1249
|
+
const target = _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, inv, command3.to);
|
|
1250
1250
|
dx = target.x - (entry.center.x + num2("x"));
|
|
1251
1251
|
dy = target.y - (entry.center.y + num2("y"));
|
|
1252
1252
|
}
|
|
1253
1253
|
if (_optionalChain([command3, 'access', _48 => _48.via, 'optionalAccess', _49 => _49.length])) {
|
|
1254
|
-
const inv =
|
|
1254
|
+
const inv = _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1255
1255
|
const x0 = num2("x");
|
|
1256
1256
|
const y0 = num2("y");
|
|
1257
1257
|
const add = command3.blend === "add";
|
|
1258
|
-
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) =>
|
|
1258
|
+
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) => _chunkHRI3ZMDMcjs.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 }];
|
|
1259
1259
|
const times = smoothMotionTimes(offsets, start, end - start, _nullishCoalesce(command3.pacing, () => ( "even")));
|
|
1260
1260
|
for (const axis of ["x", "y"]) {
|
|
1261
1261
|
const base = add ? 0 : axis === "x" ? x0 : y0;
|
|
@@ -1398,13 +1398,13 @@ function morphBetween(a, b) {
|
|
|
1398
1398
|
let inner = morphCache.get(a);
|
|
1399
1399
|
if (!inner) morphCache.set(a, inner = /* @__PURE__ */ new WeakMap());
|
|
1400
1400
|
let morph = inner.get(b);
|
|
1401
|
-
if (!morph) inner.set(b, morph =
|
|
1401
|
+
if (!morph) inner.set(b, morph = _chunkH6FX45CPcjs.createVectorMorph.call(void 0, a, b, { id: a.id }));
|
|
1402
1402
|
return morph;
|
|
1403
1403
|
}
|
|
1404
1404
|
function shapeIn(entry, shape) {
|
|
1405
1405
|
if (shape === entry) return entry.node;
|
|
1406
|
-
const m =
|
|
1407
|
-
return { ...shape.node, ...
|
|
1406
|
+
const m = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.nodeMatrix.call(void 0, shape.node), shape.parentWorld), _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
1407
|
+
return { ...shape.node, ..._chunkHRI3ZMDMcjs.isIdentityMatrix.call(void 0, m) ? { transform: void 0 } : { transform: m } };
|
|
1408
1408
|
}
|
|
1409
1409
|
function shapeAt(entry, timeline, nodes, time) {
|
|
1410
1410
|
const track = timeline.tracks.get(motionTrackKey(entry.node.id, "shape"));
|
|
@@ -1424,7 +1424,7 @@ function shapeAt(entry, timeline, nodes, time) {
|
|
|
1424
1424
|
function motionFollowRoute(entry, path) {
|
|
1425
1425
|
if (!path || path.node.type !== "path") return null;
|
|
1426
1426
|
try {
|
|
1427
|
-
return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0,
|
|
1427
|
+
return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, path.node, path.parentWorld, { effects: false }), _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
1428
1428
|
} catch (e4) {
|
|
1429
1429
|
return null;
|
|
1430
1430
|
}
|
|
@@ -1458,9 +1458,9 @@ function motionNodeOffset(entry, timeline, time, nodes = indexMotionNodes([entry
|
|
|
1458
1458
|
const scaleX = read("scaleX", 1);
|
|
1459
1459
|
const scaleY = read("scaleY", 1);
|
|
1460
1460
|
const c = entry.center;
|
|
1461
|
-
let matrix =
|
|
1461
|
+
let matrix = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.scaleMatrix.call(void 0, scaleX, scaleY, c), _chunkHRI3ZMDMcjs.rotateMatrix.call(void 0, rotation, c)), _chunkHRI3ZMDMcjs.translateMatrix.call(void 0, dx, dy));
|
|
1462
1462
|
const along = follow ? followAt(entry, timeline, nodes, time) : null;
|
|
1463
|
-
if (along) matrix =
|
|
1463
|
+
if (along) matrix = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, matrix, _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.translateMatrix.call(void 0, -c.x, -c.y), _chunkHRI3ZMDMcjs.rotateMatrix.call(void 0, along.angle)), _chunkHRI3ZMDMcjs.translateMatrix.call(void 0, along.x, along.y)));
|
|
1464
1464
|
return { matrix, dx, dy, rotation, scaleX, scaleY, follow: along };
|
|
1465
1465
|
}
|
|
1466
1466
|
function motionNodeClips(id, timeline, time) {
|
|
@@ -1527,7 +1527,7 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
1527
1527
|
const start = Math.min(1, Math.max(0, typeof drawStart === "number" ? drawStart : 0));
|
|
1528
1528
|
const end = Math.min(1, Math.max(0, typeof drawEnd === "number" ? drawEnd : 1));
|
|
1529
1529
|
if (start > 0 || end < 1) {
|
|
1530
|
-
const trim =
|
|
1530
|
+
const trim = _chunkHRI3ZMDMcjs.createVectorEffect.call(void 0, "trim", MOTION_DRAW_EFFECT_ID, { start: tidy(start * 100), end: tidy(end * 100) });
|
|
1531
1531
|
p = { ...p, effects: [trim, ...(_nullishCoalesce(p.effects, () => ( []))).filter((e) => e.id !== MOTION_DRAW_EFFECT_ID)] };
|
|
1532
1532
|
}
|
|
1533
1533
|
}
|
|
@@ -1541,8 +1541,8 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
1541
1541
|
if (o >= 1) delete out.opacity;
|
|
1542
1542
|
}
|
|
1543
1543
|
const offset = options.offsets === false ? null : motionNodeOffset(entry, timeline, time, nodes);
|
|
1544
|
-
if (offset && !
|
|
1545
|
-
const m =
|
|
1544
|
+
if (offset && !_chunkHRI3ZMDMcjs.isIdentityMatrix.call(void 0, offset.matrix)) {
|
|
1545
|
+
const m = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.nodeMatrix.call(void 0, out), offset.matrix).map(tidy);
|
|
1546
1546
|
out = { ...out, transform: m };
|
|
1547
1547
|
}
|
|
1548
1548
|
return out;
|
|
@@ -1562,7 +1562,7 @@ function motionFrameToSvg(scene, time, options = {}) {
|
|
|
1562
1562
|
const wrap = { ...options.wrap };
|
|
1563
1563
|
for (const [id, clips] of Object.entries(frame.clips))
|
|
1564
1564
|
wrap[id] = [..._nullishCoalesce(wrap[id], () => ( [])), ...clips.map((clip, i) => ({ clip: { id: `${prefix}reveal-${id}-${i}`, shape: clip.shape, attrs: motionClipAttrs(clip) } }))];
|
|
1565
|
-
return withViewBox(
|
|
1565
|
+
return withViewBox(_chunkHRI3ZMDMcjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap }), frame.camera);
|
|
1566
1566
|
}
|
|
1567
1567
|
function withViewBox(svg, box) {
|
|
1568
1568
|
const f = (n) => String(Math.round(n * 1e3) / 1e3);
|
|
@@ -1745,8 +1745,8 @@ function visibleAt(timeline, id, time, node) {
|
|
|
1745
1745
|
if (Array.isArray(rect) && (rect[2] <= 1e-4 || rect[3] <= 1e-4)) return false;
|
|
1746
1746
|
const circle = clip("clipCircle");
|
|
1747
1747
|
if (Array.isArray(circle) && circle[2] <= 1e-4) return false;
|
|
1748
|
-
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" :
|
|
1749
|
-
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" ||
|
|
1748
|
+
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
|
|
1749
|
+
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node).length === 0 || _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node).some((p) => {
|
|
1750
1750
|
const v = trackValue(timeline.tracks.get(motionTrackKey(p.id, "drawEnd")), time);
|
|
1751
1751
|
return typeof v !== "number" || v > 0.01;
|
|
1752
1752
|
}));
|
|
@@ -1832,7 +1832,7 @@ function checkMotionScene(scene) {
|
|
|
1832
1832
|
}
|
|
1833
1833
|
for (const id of targets) {
|
|
1834
1834
|
const node = nodes.get(id).node;
|
|
1835
|
-
const paths = node.type === "path" ? [node] :
|
|
1835
|
+
const paths = node.type === "path" ? [node] : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node);
|
|
1836
1836
|
if (paths.some((p) => p[key] !== void 0 && p[key] !== null && typeof p[key] !== "string"))
|
|
1837
1837
|
issues.push(_chunkEBDZWIOPcjs.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] }));
|
|
1838
1838
|
}
|
|
@@ -1845,7 +1845,7 @@ function checkMotionScene(scene) {
|
|
|
1845
1845
|
else
|
|
1846
1846
|
for (const id of targets) {
|
|
1847
1847
|
const node = nodes.get(id).node;
|
|
1848
|
-
const paths = node.type === "path" ? [node] :
|
|
1848
|
+
const paths = node.type === "path" ? [node] : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node);
|
|
1849
1849
|
if (paths.some((p) => typeof p[key] !== "string"))
|
|
1850
1850
|
issues.push(_chunkEBDZWIOPcjs.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] }));
|
|
1851
1851
|
}
|
|
@@ -2429,7 +2429,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2429
2429
|
raw: (t) => transformAt(t, true)
|
|
2430
2430
|
});
|
|
2431
2431
|
}
|
|
2432
|
-
const paths = node.type === "path" ? [node] :
|
|
2432
|
+
const paths = node.type === "path" ? [node] : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node);
|
|
2433
2433
|
for (const path of paths) {
|
|
2434
2434
|
if (pathsSeen.has(path.id)) continue;
|
|
2435
2435
|
pathsSeen.add(path.id);
|
|
@@ -2451,7 +2451,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2451
2451
|
if (shapeSegments.length) {
|
|
2452
2452
|
if (node.type !== "path") notes.push(`"${id}" is a group: its morph or effect animation is not exported (Flair tweens one path's "d").`);
|
|
2453
2453
|
else {
|
|
2454
|
-
const inverse =
|
|
2454
|
+
const inverse = _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, _chunkHRI3ZMDMcjs.nodeMatrix.call(void 0, node));
|
|
2455
2455
|
channels.push({
|
|
2456
2456
|
id,
|
|
2457
2457
|
kind: "attr",
|
|
@@ -2460,9 +2460,9 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2460
2460
|
exact: () => false,
|
|
2461
2461
|
value: (t) => {
|
|
2462
2462
|
const frame = motionFrameAt(scene, t, { draw: false, offsets: false });
|
|
2463
|
-
const now =
|
|
2463
|
+
const now = _chunkHRI3ZMDMcjs.expandVectorAppearance.call(void 0, _optionalChain([indexMotionNodes, 'call', _108 => _108(frame.document.nodes), 'access', _109 => _109.get, 'call', _110 => _110(id), 'optionalAccess', _111 => _111.node]));
|
|
2464
2464
|
if (!now || now.type !== "path") return "";
|
|
2465
|
-
const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0,
|
|
2465
|
+
const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, now, _chunkHRI3ZMDMcjs.IDENTITY_MATRIX, { effects: false }), inverse);
|
|
2466
2466
|
return _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0, bezier, { precision: Math.min(precision, 2) });
|
|
2467
2467
|
}
|
|
2468
2468
|
});
|
|
@@ -2569,7 +2569,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2569
2569
|
}
|
|
2570
2570
|
if (scene.motionBlur) notes.push("Motion blur is drawn on the stage only; Flair plays the scene sharp.");
|
|
2571
2571
|
if (trigger && (_nullishCoalesce(scene.loop, () => ( "none"))) !== "none") notes.push(`The scene plays on ${trigger}, so its loop does not apply in Flair.`);
|
|
2572
|
-
let svg =
|
|
2572
|
+
let svg = _chunkHRI3ZMDMcjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunkHRI3ZMDMcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) }, { pretty: false, precision, wrap });
|
|
2573
2573
|
if (routes.length) svg = svg.replace(/^(<svg[^>]*>)/, `$1<defs>${routes.join("")}</defs>`);
|
|
2574
2574
|
let motion = { svg, animate };
|
|
2575
2575
|
if (_optionalChain([scene, 'access', _114 => _114.controls, 'optionalAccess', _115 => _115.length])) {
|
|
@@ -2653,14 +2653,14 @@ function easingOf(ease, fallback) {
|
|
|
2653
2653
|
return fallback;
|
|
2654
2654
|
}
|
|
2655
2655
|
function poseOf(value, entry) {
|
|
2656
|
-
const t =
|
|
2657
|
-
const o =
|
|
2656
|
+
const t = _chunkHRI3ZMDMcjs.parseSvgTransform.call(void 0, String(value));
|
|
2657
|
+
const o = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkHRI3ZMDMcjs.invertMatrix.call(void 0, _chunkHRI3ZMDMcjs.nodeMatrix.call(void 0, entry.node)), () => ( [1, 0, 0, 1, 0, 0])), t);
|
|
2658
2658
|
const sx = Math.hypot(o[0], o[1]);
|
|
2659
2659
|
if (!(sx > 1e-9)) return null;
|
|
2660
2660
|
const sy = (o[0] * o[3] - o[1] * o[2]) / sx;
|
|
2661
2661
|
if (Math.abs(o[2] + o[1] / sx * sy) > 1e-6 || Math.abs(o[3] - o[0] / sx * sy) > 1e-6) return null;
|
|
2662
2662
|
const c = entry.center;
|
|
2663
|
-
const moved =
|
|
2663
|
+
const moved = _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, o, c);
|
|
2664
2664
|
return { dx: moved.x - c.x, dy: moved.y - c.y, rotation: Math.atan2(o[1], o[0]) * 180 / Math.PI, sx, sy };
|
|
2665
2665
|
}
|
|
2666
2666
|
var near = (a, b, eps = 1e-6) => Math.abs(a - b) < eps;
|
|
@@ -2745,7 +2745,7 @@ function fromFlairSvgMotion(input, options = {}) {
|
|
|
2745
2745
|
const notes = [];
|
|
2746
2746
|
if (!input || typeof input.svg !== "string") throw new Error('Give a Flair SvgMotion: { svg: "<svg \u2026>", animate: [ \u2026 ] }.');
|
|
2747
2747
|
const { motion, controls } = resolvePlaceholders(input, notes);
|
|
2748
|
-
const artwork =
|
|
2748
|
+
const artwork = _chunkHRI3ZMDMcjs.parseVectorSvg.call(void 0, motion.svg);
|
|
2749
2749
|
const nodes = indexMotionNodes(artwork.nodes);
|
|
2750
2750
|
const byStep = /* @__PURE__ */ new Map();
|
|
2751
2751
|
for (const anim of _nullishCoalesce(motion.animate, () => ( []))) {
|
|
@@ -2992,9 +2992,9 @@ function toLottie(scene, options = {}) {
|
|
|
2992
2992
|
const items = [];
|
|
2993
2993
|
const shapeSegments = [...timeline.tracks.entries()].filter(([k]) => k.startsWith(`${path.id}\0`) && (k.endsWith("\0shape") || k.includes("\0effect:"))).flatMap(([, v]) => v);
|
|
2994
2994
|
const geometryAt = (t) => {
|
|
2995
|
-
if (!shapeSegments.length) return
|
|
2995
|
+
if (!shapeSegments.length) return _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, path);
|
|
2996
2996
|
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]);
|
|
2997
|
-
return now && now.type === "path" ?
|
|
2997
|
+
return now && now.type === "path" ? _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, _chunkHRI3ZMDMcjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, path);
|
|
2998
2998
|
};
|
|
2999
2999
|
const rest = lottieContours(_chunkGF2RBSDMcjs.toBezierPath.call(void 0, geometryAt(0)), round2);
|
|
3000
3000
|
rest.forEach((contour, n) => {
|
|
@@ -3067,13 +3067,13 @@ function toLottie(scene, options = {}) {
|
|
|
3067
3067
|
const innerTr = STATIC_TR();
|
|
3068
3068
|
if (node.type === "path") inner = [...pathShapes(node)];
|
|
3069
3069
|
else if (node.type === "text" || node.type === "instance") {
|
|
3070
|
-
const drawn =
|
|
3070
|
+
const drawn = _chunkHRI3ZMDMcjs.expandVectorAppearance.call(void 0, node);
|
|
3071
3071
|
inner = drawn.type === "path" ? [...pathShapes(drawn)] : drawn.children.filter((c) => c.type === "path").reverse().flatMap((c) => [...pathShapes(c)]);
|
|
3072
|
-
notes.push(`"${node.id}": text is exported as its outlines${
|
|
3072
|
+
notes.push(`"${node.id}": text is exported as its outlines${_chunkHRI3ZMDMcjs.vectorTextHasOutlines.call(void 0, ) ? "" : " (glyph boxes: set an outline text shaper for real glyphs)"}.`);
|
|
3073
3073
|
} else {
|
|
3074
3074
|
inner = shown(node.children).reverse().map(nodeGroup);
|
|
3075
|
-
const m =
|
|
3076
|
-
if (m !==
|
|
3075
|
+
const m = _chunkHRI3ZMDMcjs.nodeMatrix.call(void 0, node);
|
|
3076
|
+
if (m !== _chunkHRI3ZMDMcjs.IDENTITY_MATRIX) {
|
|
3077
3077
|
const parts = staticParts(m);
|
|
3078
3078
|
if (!parts) notes.push(`"${node.id}": its transform skews, which is not exported; it is drawn without the skew.`);
|
|
3079
3079
|
else {
|
|
@@ -3086,7 +3086,7 @@ function toLottie(scene, options = {}) {
|
|
|
3086
3086
|
const body = { ty: "gr", nm: `${node.id} (own)`, it: [...inner, innerTr] };
|
|
3087
3087
|
return { ty: "gr", nm: _nullishCoalesce(node.name, () => ( node.id)), it: [body, poseTransform(entry)] };
|
|
3088
3088
|
};
|
|
3089
|
-
const artwork = { ...scene.artwork, nodes:
|
|
3089
|
+
const artwork = { ...scene.artwork, nodes: _chunkHRI3ZMDMcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) };
|
|
3090
3090
|
const content = shown(artwork.nodes).reverse().map(nodeGroup);
|
|
3091
3091
|
if (artwork.background && rgba(artwork.background))
|
|
3092
3092
|
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()] });
|
|
@@ -3185,11 +3185,11 @@ function preset(prst, w, h) {
|
|
|
3185
3185
|
const poly = (pts) => [{ closed: true, anchors: pts.map(([x, y]) => ({ x, y })) }];
|
|
3186
3186
|
switch (prst) {
|
|
3187
3187
|
case "rect":
|
|
3188
|
-
return [
|
|
3188
|
+
return [_chunkHRI3ZMDMcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3189
3189
|
case "roundRect":
|
|
3190
|
-
return [
|
|
3190
|
+
return [_chunkHRI3ZMDMcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h }, Math.min(w, h) * 0.16667)];
|
|
3191
3191
|
case "ellipse":
|
|
3192
|
-
return [
|
|
3192
|
+
return [_chunkHRI3ZMDMcjs.ellipseSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3193
3193
|
case "triangle":
|
|
3194
3194
|
return poly([[w / 2, 0], [w, h], [0, h]]);
|
|
3195
3195
|
case "rtTriangle":
|
|
@@ -3297,7 +3297,7 @@ function shapes(ctx, tree, map) {
|
|
|
3297
3297
|
let subpaths = cust ? custom(cust, w, h) : prst ? preset(prst, w, h) : null;
|
|
3298
3298
|
if (!subpaths) {
|
|
3299
3299
|
if (prst) ctx.notes.push(`"${name}" is a ${prst}, drawn as its bounding rectangle.`);
|
|
3300
|
-
subpaths = [
|
|
3300
|
+
subpaths = [_chunkHRI3ZMDMcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3301
3301
|
}
|
|
3302
3302
|
const style = kid(el, "style");
|
|
3303
3303
|
const fill = kid(spPr, "noFill") ? null : _nullishCoalesce(colour(ctx, kid(spPr, "solidFill")), () => ( (el.localName === "cxnSp" ? null : colour(ctx, kid(style, "fillRef")))));
|
|
@@ -3535,7 +3535,7 @@ function nextMotionEffectInstance(scene) {
|
|
|
3535
3535
|
walk(scene.artwork.nodes);
|
|
3536
3536
|
for (let i = 1; ; i++) if (!used.has(`fx${i}`)) return `fx${i}`;
|
|
3537
3537
|
}
|
|
3538
|
-
var motionArtworkSvg = (artwork) =>
|
|
3538
|
+
var motionArtworkSvg = (artwork) => _chunkHRI3ZMDMcjs.vectorDocumentToSvg.call(void 0, artwork);
|
|
3539
3539
|
var tag = (commands, source) => commands.map((c) => c.type === "wait" ? c : { ...c, source });
|
|
3540
3540
|
function motionCommandsFromEffect(artwork, motion, source) {
|
|
3541
3541
|
const imported = fromFlairSvgMotion({ svg: motionArtworkSvg(artwork), animate: [..._nullishCoalesce(motion.animate, () => ( []))] });
|
|
@@ -4643,7 +4643,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
|
|
|
4643
4643
|
handler: ({ svg }) => {
|
|
4644
4644
|
let artwork;
|
|
4645
4645
|
try {
|
|
4646
|
-
artwork =
|
|
4646
|
+
artwork = _chunkHRI3ZMDMcjs.parseVectorSvg.call(void 0, svg);
|
|
4647
4647
|
} catch (error) {
|
|
4648
4648
|
throw new Error(`The SVG could not be read: ${error.message}. Nothing was changed.`);
|
|
4649
4649
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createVectorMorph
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-DAS7M4RY.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-77SG47WT.js";
|
|
35
35
|
import "../chunk-ORDXMBD4.js";
|
|
36
36
|
import "../chunk-M6DNZNVY.js";
|
|
37
37
|
import {
|
|
@@ -8714,7 +8714,66 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
8714
8714
|
return out.join(nl);
|
|
8715
8715
|
}
|
|
8716
8716
|
var BOOLEAN_OPERATIONS = ["union", "subtract", "intersect", "exclude"];
|
|
8717
|
-
var TEXT_CONTENT = /* @__PURE__ */ new Set(["text", "tspan", "textPath"]);
|
|
8717
|
+
var TEXT_CONTENT = /* @__PURE__ */ new Set(["text", "tspan", "textPath", "style"]);
|
|
8718
|
+
function parseCssRules(cssText) {
|
|
8719
|
+
const rules = [];
|
|
8720
|
+
const clean2 = cssText.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
8721
|
+
const re = /([^{]+)\{([^}]+)\}/g;
|
|
8722
|
+
let m;
|
|
8723
|
+
while (m = re.exec(clean2)) {
|
|
8724
|
+
const selector = m[1].trim();
|
|
8725
|
+
const body = m[2].trim();
|
|
8726
|
+
const properties = {};
|
|
8727
|
+
for (const decl of body.split(";")) {
|
|
8728
|
+
const i = decl.indexOf(":");
|
|
8729
|
+
if (i > 0) {
|
|
8730
|
+
const prop = decl.slice(0, i).trim().toLowerCase();
|
|
8731
|
+
const val = decl.slice(i + 1).replace(/!important/gi, "").trim();
|
|
8732
|
+
if (prop && val) properties[prop] = val;
|
|
8733
|
+
}
|
|
8734
|
+
}
|
|
8735
|
+
if (Object.keys(properties).length > 0) {
|
|
8736
|
+
rules.push({ selector, properties });
|
|
8737
|
+
}
|
|
8738
|
+
}
|
|
8739
|
+
return rules;
|
|
8740
|
+
}
|
|
8741
|
+
function collectStyleRules(el, rules) {
|
|
8742
|
+
if (el.name === "style") {
|
|
8743
|
+
const rawText = (el.content ?? []).map((c) => typeof c === "string" ? c : "").join("");
|
|
8744
|
+
rules.push(...parseCssRules(rawText));
|
|
8745
|
+
}
|
|
8746
|
+
for (const child of el.children) {
|
|
8747
|
+
collectStyleRules(child, rules);
|
|
8748
|
+
}
|
|
8749
|
+
}
|
|
8750
|
+
function matchesSelector(el, selector) {
|
|
8751
|
+
const sel = selector.trim();
|
|
8752
|
+
if (!sel) return false;
|
|
8753
|
+
if (sel.includes(",")) {
|
|
8754
|
+
return sel.split(",").some((s) => matchesSelector(el, s));
|
|
8755
|
+
}
|
|
8756
|
+
if (sel.startsWith(".")) {
|
|
8757
|
+
const targetClass = sel.slice(1).trim();
|
|
8758
|
+
const classes = (el.attrs.class ?? "").split(/\s+/);
|
|
8759
|
+
return classes.includes(targetClass);
|
|
8760
|
+
}
|
|
8761
|
+
if (sel.startsWith("#")) {
|
|
8762
|
+
const targetId = sel.slice(1).trim();
|
|
8763
|
+
return el.attrs.id === targetId;
|
|
8764
|
+
}
|
|
8765
|
+
if (/^[a-zA-Z_][\w:.-]*$/.test(sel)) {
|
|
8766
|
+
return el.name.toLowerCase() === sel.toLowerCase();
|
|
8767
|
+
}
|
|
8768
|
+
const match = /^([a-zA-Z_][\w:.-]*)\.([a-zA-Z0-9_-]+)$/.exec(sel);
|
|
8769
|
+
if (match) {
|
|
8770
|
+
const [, tag, cls] = match;
|
|
8771
|
+
if (el.name.toLowerCase() !== tag.toLowerCase()) return false;
|
|
8772
|
+
const classes = (el.attrs.class ?? "").split(/\s+/);
|
|
8773
|
+
return classes.includes(cls);
|
|
8774
|
+
}
|
|
8775
|
+
return false;
|
|
8776
|
+
}
|
|
8718
8777
|
function parseXml(source) {
|
|
8719
8778
|
const text = source.replace(/<!--[\s\S]*?-->/g, "").replace(/<\?[\s\S]*?\?>/g, "").replace(/<!\[CDATA\[[\s\S]*?\]\]>/g, "").replace(/<!DOCTYPE[^>[]*(\[[\s\S]*?\])?\s*>/gi, "");
|
|
8720
8779
|
const root = { name: "#root", attrs: {}, children: [] };
|
|
@@ -8811,10 +8870,20 @@ var STYLE_KEYS = {
|
|
|
8811
8870
|
"mix-blend-mode": "mixBlendMode",
|
|
8812
8871
|
filter: "filter"
|
|
8813
8872
|
};
|
|
8814
|
-
function readStyle(el, parent) {
|
|
8873
|
+
function readStyle(el, parent, cssRules) {
|
|
8815
8874
|
const { mixBlendMode: _m, filter: _f, ...inherited } = parent;
|
|
8816
8875
|
const out = { ...inherited };
|
|
8817
8876
|
for (const [attr, key] of Object.entries(STYLE_KEYS)) if (el.attrs[attr] !== void 0) out[key] = el.attrs[attr].trim();
|
|
8877
|
+
if (cssRules?.length) {
|
|
8878
|
+
for (const rule of cssRules) {
|
|
8879
|
+
if (matchesSelector(el, rule.selector)) {
|
|
8880
|
+
for (const [prop, val] of Object.entries(rule.properties)) {
|
|
8881
|
+
const key = STYLE_KEYS[prop];
|
|
8882
|
+
if (key) out[key] = val;
|
|
8883
|
+
}
|
|
8884
|
+
}
|
|
8885
|
+
}
|
|
8886
|
+
}
|
|
8818
8887
|
for (const decl of (el.attrs.style ?? "").split(";")) {
|
|
8819
8888
|
const i = decl.indexOf(":");
|
|
8820
8889
|
if (i < 0) continue;
|
|
@@ -9003,6 +9072,8 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
9003
9072
|
usedIds.add(next);
|
|
9004
9073
|
return next;
|
|
9005
9074
|
};
|
|
9075
|
+
const styleRules = [];
|
|
9076
|
+
collectStyleRules(root, styleRules);
|
|
9006
9077
|
const rawGradients = /* @__PURE__ */ new Map();
|
|
9007
9078
|
collectGradients(root, rawGradients);
|
|
9008
9079
|
const rawFilters = /* @__PURE__ */ new Map();
|
|
@@ -9137,7 +9208,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
9137
9208
|
const subpaths = fillEl ? shapeOf(fillEl) : null;
|
|
9138
9209
|
if (!fillEl || !subpaths?.length) return null;
|
|
9139
9210
|
const a = g.attrs;
|
|
9140
|
-
const fs = readStyle(fillEl, style);
|
|
9211
|
+
const fs = readStyle(fillEl, style, styleRules);
|
|
9141
9212
|
const strokeEl = part("stroke");
|
|
9142
9213
|
const outlineEl = part("stroke-outline");
|
|
9143
9214
|
const ss = strokeEl ? readStyle(strokeEl, style) : null;
|
|
@@ -9159,7 +9230,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
9159
9230
|
...meta,
|
|
9160
9231
|
subpaths,
|
|
9161
9232
|
fill: paint(fs.fill),
|
|
9162
|
-
stroke: ss ? paint(ss.stroke) : outlineEl ? paint(readStyle(outlineEl, style).fill) : null,
|
|
9233
|
+
stroke: ss ? paint(ss.stroke) : outlineEl ? paint(readStyle(outlineEl, style, styleRules).fill) : null,
|
|
9163
9234
|
...ss ? strokeStyle(ss) : {},
|
|
9164
9235
|
...fs.fillRule === "evenodd" ? { fillRule: "evenodd" } : {},
|
|
9165
9236
|
strokeWidth: width2,
|
|
@@ -9309,7 +9380,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
9309
9380
|
let id = typeof own?.id === "string" && own.id ? own.id : el.attrs.id ?? createId();
|
|
9310
9381
|
while (usedSymbolIds.has(id)) id = `${id}-${usedSymbolIds.size}`;
|
|
9311
9382
|
usedSymbolIds.add(id);
|
|
9312
|
-
const style = readStyle(el, rootStyle);
|
|
9383
|
+
const style = readStyle(el, rootStyle, styleRules);
|
|
9313
9384
|
const nodes2 = el.name === "symbol" ? visit2(el, style, IDENTITY_MATRIX) : visitOne({ ...el, attrs: { ...el.attrs, transform: "" } }, rootStyle, parseSvgTransform(el.attrs.transform));
|
|
9314
9385
|
symbols.push({ id, name: typeof own?.name === "string" && own.name ? own.name : el.attrs.id ?? "Symbol", nodes: nodes2 });
|
|
9315
9386
|
symbolOfElement.set(el, id);
|
|
@@ -9346,7 +9417,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
9346
9417
|
...effects.length ? { effects } : {}
|
|
9347
9418
|
};
|
|
9348
9419
|
if (drawn) {
|
|
9349
|
-
const ds = readStyle(drawn, rootStyle);
|
|
9420
|
+
const ds = readStyle(drawn, rootStyle, styleRules);
|
|
9350
9421
|
const op = drawn.attrs.opacity !== void 0 ? parseFloat(drawn.attrs.opacity) : void 0;
|
|
9351
9422
|
if (op !== void 0 && Number.isFinite(op) && op < 1) node.opacity = op;
|
|
9352
9423
|
const blend = vectorBlendModeFromCss(ds.mixBlendMode);
|
|
@@ -9384,7 +9455,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
9384
9455
|
resolving.add(id);
|
|
9385
9456
|
const isClip = el.name === "clipPath";
|
|
9386
9457
|
const content = isClip ? clipRulesAsFillRules(el) : el;
|
|
9387
|
-
const inner = visit2(content, readStyle(content, rootStyle), multiplyMatrices(parseSvgTransform(el.attrs.transform), space));
|
|
9458
|
+
const inner = visit2(content, readStyle(content, rootStyle, styleRules), multiplyMatrices(parseSvgTransform(el.attrs.transform), space));
|
|
9388
9459
|
resolving.delete(id);
|
|
9389
9460
|
const strip2 = (n) => n.type !== "group" ? withVectorStrokes(withVectorFills({ ...n, fill: null, stroke: null }, []), []) : { ...n, children: n.children.map(strip2) };
|
|
9390
9461
|
const list = isClip ? inner.map(strip2) : inner;
|
|
@@ -9460,7 +9531,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
9460
9531
|
const visitOne = (child, style, matrix) => {
|
|
9461
9532
|
const out = [];
|
|
9462
9533
|
const m = multiplyMatrices(parseSvgTransform(child.attrs.transform), matrix);
|
|
9463
|
-
const s = readStyle(child, style);
|
|
9534
|
+
const s = readStyle(child, style, styleRules);
|
|
9464
9535
|
const opacity = child.attrs.opacity !== void 0 ? parseFloat(child.attrs.opacity) : void 0;
|
|
9465
9536
|
const hidden = child.attrs.display === "none" || child.attrs.visibility === "hidden";
|
|
9466
9537
|
const blendMode = vectorBlendModeFromCss(s.mixBlendMode);
|
|
@@ -9561,7 +9632,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
9561
9632
|
out.push(node);
|
|
9562
9633
|
return out;
|
|
9563
9634
|
};
|
|
9564
|
-
rootStyle = readStyle(root, rootStyle);
|
|
9635
|
+
rootStyle = readStyle(root, rootStyle, styleRules);
|
|
9565
9636
|
const walkAll = (el) => {
|
|
9566
9637
|
if (el.name === "symbol" && el.attrs["data-vector-symbol"] !== void 0) symbolFor(el);
|
|
9567
9638
|
el.children.forEach(walkAll);
|