@pixerate/editor 0.237.0 → 0.238.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.cjs +40 -39
- package/dist/agent/index.js +9 -8
- package/dist/animation/index.cjs +7 -6
- package/dist/animation/index.js +6 -5
- package/dist/animation-editor/index.cjs +66 -65
- package/dist/animation-editor/index.js +9 -8
- package/dist/{brushstrokeRender-WDTKD54B.cjs → brushstrokeRender-MPOM7BFW.cjs} +7 -5
- package/dist/{brushstrokeRender-MAHOXL7K.js → brushstrokeRender-WB67GMUP.js} +4 -2
- package/dist/canvas/index.cjs +55 -54
- package/dist/canvas/index.js +10 -9
- package/dist/chart/index.cjs +159 -158
- package/dist/chart/index.js +9 -8
- package/dist/{chunk-L6Y7TSQ4.js → chunk-36ZTV7WO.js} +1 -1
- package/dist/{chunk-JVNGCS26.js → chunk-3E36VDMJ.js} +1 -1
- package/dist/{chunk-WRZ6C4TU.cjs → chunk-3R5P3DVY.cjs} +6 -6
- package/dist/{chunk-RUONPPMC.cjs → chunk-44BMJJVA.cjs} +8 -8
- package/dist/{chunk-YBAPT7NL.js → chunk-6ADHGQ73.js} +4 -2
- package/dist/chunk-7AHBW2CQ.cjs +200 -0
- package/dist/{chunk-EUIDTZNQ.cjs → chunk-7PT4RJL5.cjs} +113 -111
- package/dist/{chunk-CU6ANS5L.js → chunk-7YGBSFC6.js} +2 -2
- package/dist/{chunk-ATKKG76G.cjs → chunk-AD7GA3TL.cjs} +23 -23
- package/dist/{chunk-FSLKBQU7.js → chunk-AIS56JOO.js} +3 -3
- package/dist/{chunk-5VQXSS2S.cjs → chunk-BBUE3UJL.cjs} +86 -86
- package/dist/{chunk-7272D3K2.js → chunk-BP6KSGVD.js} +6 -4
- package/dist/{chunk-F6R67I3A.js → chunk-CXXXAZ7H.js} +1 -1
- package/dist/{chunk-5DQPDXOM.cjs → chunk-D2SGV525.cjs} +76 -76
- package/dist/chunk-F67XMVDI.js +200 -0
- package/dist/{chunk-JVSX5QTS.js → chunk-FQVVO5YA.js} +3 -3
- package/dist/{chunk-UXETV2NC.cjs → chunk-GA4EU4P3.cjs} +4 -4
- package/dist/{chunk-UFEDHACQ.js → chunk-GXAK6Q5J.js} +2 -2
- package/dist/{chunk-MHLU6GRJ.js → chunk-JEGJP4OW.js} +7 -196
- package/dist/{chunk-GOBOCZZI.js → chunk-LEQKZGQI.js} +1 -1
- package/dist/{chunk-M5GLQQWG.cjs → chunk-LJZRHVZV.cjs} +2 -2
- package/dist/{chunk-N76AMOKE.cjs → chunk-MOW3JMNG.cjs} +42 -42
- package/dist/{chunk-WKMUBATU.js → chunk-N4DFDI73.js} +1 -1
- package/dist/{chunk-GNZI3KYK.cjs → chunk-NKTNLJUJ.cjs} +49 -9
- package/dist/{chunk-TQOL6CF7.js → chunk-PJYG6FCF.js} +49 -9
- package/dist/{chunk-V3L7U63N.cjs → chunk-PP6BXVRL.cjs} +1 -1
- package/dist/{chunk-TFF2GTGN.cjs → chunk-PPFJHTW5.cjs} +24 -22
- package/dist/{chunk-6ZZKRH7R.js → chunk-QARCM66V.js} +3 -3
- package/dist/{chunk-5UEFBM2M.cjs → chunk-RD7RX52G.cjs} +18 -207
- package/dist/{chunk-CDP2AKMA.js → chunk-RV5DKZHU.js} +1 -1
- package/dist/{chunk-HUAISCUX.cjs → chunk-T7KQEMAE.cjs} +18 -18
- package/dist/{chunk-BQE3Y6ZO.cjs → chunk-THXFU3JB.cjs} +5 -5
- package/dist/{chunk-4ZC5QJE2.cjs → chunk-UTI5IITZ.cjs} +3 -3
- package/dist/{chunk-XSVUNSDJ.js → chunk-UUBO6RB5.js} +1 -1
- package/dist/{chunk-CZWUDFR3.cjs → chunk-UZU6DIZA.cjs} +52 -52
- package/dist/{chunk-M2TPMYJE.js → chunk-V6DT2CDH.js} +1 -1
- package/dist/{chunk-WV5WTOC6.cjs → chunk-W7GRGGBH.cjs} +16 -16
- package/dist/{chunk-23E5GI2U.js → chunk-WGN7AUKB.js} +2 -2
- package/dist/{chunk-YMREOA67.js → chunk-XK4SST43.js} +2 -2
- package/dist/{chunk-SOSBOS5T.cjs → chunk-XWOLPNBW.cjs} +22 -22
- package/dist/{chunk-ILP77UD6.js → chunk-YGQVCQTG.js} +1 -1
- package/dist/{chunk-GXLZZVR5.cjs → chunk-ZXNO3ZOX.cjs} +37 -37
- package/dist/color/index.cjs +6 -4
- package/dist/color/index.js +9 -7
- package/dist/export/index.cjs +8 -7
- package/dist/export/index.js +7 -6
- package/dist/extensions/index.cjs +11 -10
- package/dist/extensions/index.js +10 -9
- package/dist/gradient/index.cjs +29 -28
- package/dist/gradient/index.js +4 -3
- package/dist/image-editor/index.cjs +778 -777
- package/dist/image-editor/index.js +9 -8
- package/dist/index.cjs +17 -16
- package/dist/index.js +11 -10
- package/dist/paint-editor/controller.d.cts +31 -1
- package/dist/paint-editor/controller.d.ts +31 -1
- package/dist/paint-editor/index.cjs +403 -195
- package/dist/paint-editor/index.js +231 -23
- package/dist/paint-editor/sticker-tools.d.cts +1 -1
- package/dist/paint-editor/sticker-tools.d.ts +1 -1
- package/dist/paint-editor/stickers.d.cts +10 -3
- package/dist/paint-editor/stickers.d.ts +10 -3
- package/dist/paint-editor/ui.d.cts +10 -3
- package/dist/paint-editor/ui.d.ts +10 -3
- package/dist/tokens/index.cjs +4 -3
- package/dist/tokens/index.js +3 -2
- package/dist/typography/index.cjs +8 -7
- package/dist/typography/index.js +3 -2
- package/dist/vector/index.cjs +967 -966
- package/dist/vector/index.js +9 -8
- package/dist/video-editor/index.cjs +7 -6
- package/dist/video-editor/index.js +6 -5
- package/package.json +1 -1
- package/skills/pixerate-color/SKILL.md +3 -0
- package/skills/pixerate-image-editor/SKILL.md +1 -0
- package/skills/pixerate-paint-editor/SKILL.md +6 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZXNO3ZOXcjs = require('../chunk-ZXNO3ZOX.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -39,8 +39,8 @@ var _chunkJWCKJNDRcjs = require('../chunk-JWCKJNDR.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
require('../chunk-
|
|
42
|
+
var _chunkTHXFU3JBcjs = require('../chunk-THXFU3JB.cjs');
|
|
43
|
+
require('../chunk-NKTNLJUJ.cjs');
|
|
44
44
|
require('../chunk-CVFAAZXE.cjs');
|
|
45
45
|
|
|
46
46
|
|
|
@@ -93,7 +93,7 @@ var _chunkFJ2MSI43cjs = require('../chunk-FJ2MSI43.cjs');
|
|
|
93
93
|
var _chunk7B5GTJXBcjs = require('../chunk-7B5GTJXB.cjs');
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
var
|
|
96
|
+
var _chunkLJZRHVZVcjs = require('../chunk-LJZRHVZV.cjs');
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
|
|
@@ -105,15 +105,16 @@ var _chunkM5GLQQWGcjs = require('../chunk-M5GLQQWG.cjs');
|
|
|
105
105
|
var _chunkDWJJI6RTcjs = require('../chunk-DWJJI6RT.cjs');
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
var
|
|
108
|
+
var _chunkUTI5IITZcjs = require('../chunk-UTI5IITZ.cjs');
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
|
|
113
113
|
var _chunkA6QWKBJPcjs = require('../chunk-A6QWKBJP.cjs');
|
|
114
|
-
require('../chunk-
|
|
115
|
-
require('../chunk-
|
|
116
|
-
require('../chunk-
|
|
114
|
+
require('../chunk-7PT4RJL5.cjs');
|
|
115
|
+
require('../chunk-PPFJHTW5.cjs');
|
|
116
|
+
require('../chunk-RD7RX52G.cjs');
|
|
117
|
+
require('../chunk-7AHBW2CQ.cjs');
|
|
117
118
|
require('../chunk-IPJ3TEYR.cjs');
|
|
118
119
|
|
|
119
120
|
// src/animation-editor/types.ts
|
|
@@ -696,7 +697,7 @@ function smoothMotionTimes(points, start, duration, pacing = "even") {
|
|
|
696
697
|
function motionTextLayout(nodes, id) {
|
|
697
698
|
const group = _optionalChain([nodes, 'access', _5 => _5.get, 'call', _6 => _6(id), 'optionalAccess', _7 => _7.node]);
|
|
698
699
|
if (!group || group.type !== "group") return null;
|
|
699
|
-
const letters =
|
|
700
|
+
const letters = _chunkTHXFU3JBcjs.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);
|
|
700
701
|
if (!letters.length) return null;
|
|
701
702
|
const lines = [];
|
|
702
703
|
for (const l of [...letters].sort((a, c) => a.b.y + a.b.height / 2 - (c.b.y + c.b.height / 2))) {
|
|
@@ -781,21 +782,21 @@ function indexMotionNodes(nodes) {
|
|
|
781
782
|
const out = /* @__PURE__ */ new Map();
|
|
782
783
|
const walk = (list, parentWorld, ancestors) => {
|
|
783
784
|
for (const node of list) {
|
|
784
|
-
const local =
|
|
785
|
-
const bounds =
|
|
785
|
+
const local = _chunkTHXFU3JBcjs.vectorNodeBounds.call(void 0, node);
|
|
786
|
+
const bounds = _chunkTHXFU3JBcjs.vectorNodeBounds.call(void 0, node, parentWorld);
|
|
786
787
|
const center = local ? { x: local.x + local.width / 2, y: local.y + local.height / 2 } : { x: 0, y: 0 };
|
|
787
788
|
if (!out.has(node.id)) out.set(node.id, { node, ancestors, parentWorld, center, bounds, box: local });
|
|
788
|
-
if (node.type === "group") walk(node.children,
|
|
789
|
+
if (node.type === "group") walk(node.children, _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _chunkTHXFU3JBcjs.nodeMatrix.call(void 0, node), parentWorld), [...ancestors, node.id]);
|
|
789
790
|
}
|
|
790
791
|
};
|
|
791
|
-
walk(nodes,
|
|
792
|
+
walk(nodes, _chunkTHXFU3JBcjs.IDENTITY_MATRIX, []);
|
|
792
793
|
indexCache.set(nodes, out);
|
|
793
794
|
return out;
|
|
794
795
|
}
|
|
795
796
|
var solid = (paint) => typeof paint === "string" && paint !== "none" ? paint : void 0;
|
|
796
797
|
function firstPaint(node, key) {
|
|
797
798
|
if (node.type === "path") return solid(node[key]);
|
|
798
|
-
for (const p of
|
|
799
|
+
for (const p of _chunkTHXFU3JBcjs.collectPathNodes.call(void 0, node)) {
|
|
799
800
|
const s = solid(p[key]);
|
|
800
801
|
if (s) return s;
|
|
801
802
|
}
|
|
@@ -803,7 +804,7 @@ function firstPaint(node, key) {
|
|
|
803
804
|
}
|
|
804
805
|
function strokeReach(node) {
|
|
805
806
|
let reach = 0;
|
|
806
|
-
for (const p of node.type === "path" ? [node] :
|
|
807
|
+
for (const p of node.type === "path" ? [node] : _chunkTHXFU3JBcjs.collectPathNodes.call(void 0, node)) {
|
|
807
808
|
if (p.stroke == null || p.stroke === "none") continue;
|
|
808
809
|
const width = _nullishCoalesce(p.strokeWidth, () => ( 1));
|
|
809
810
|
reach = Math.max(reach, p.strokeAlign === "outside" ? width : p.strokeAlign === "inside" ? 0 : width / 2);
|
|
@@ -873,7 +874,7 @@ function motionRestValue(entry, property, artwork) {
|
|
|
873
874
|
case "stroke":
|
|
874
875
|
return _nullishCoalesce((node && firstPaint(node, property)), () => ( "transparent"));
|
|
875
876
|
case "strokeWidth": {
|
|
876
|
-
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ?
|
|
877
|
+
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ? _chunkTHXFU3JBcjs.collectPathNodes.call(void 0, node)[0] : void 0;
|
|
877
878
|
return _nullishCoalesce(_optionalChain([path, 'optionalAccess', _14 => _14.strokeWidth]), () => ( 1));
|
|
878
879
|
}
|
|
879
880
|
case "shape":
|
|
@@ -897,7 +898,7 @@ function interpolateMotionValue(from, to, u) {
|
|
|
897
898
|
if (u <= 0) return from;
|
|
898
899
|
if (u >= 1) return to;
|
|
899
900
|
if (typeof from === "string" && typeof to === "string") {
|
|
900
|
-
const mixed =
|
|
901
|
+
const mixed = _chunkUTI5IITZcjs.mixColorsOklab.call(void 0, from, to, u);
|
|
901
902
|
if (mixed !== null) return mixed;
|
|
902
903
|
}
|
|
903
904
|
return u < 1 ? from : to;
|
|
@@ -984,12 +985,12 @@ function resolveMotionCamera(camera, scene) {
|
|
|
984
985
|
const r = camera;
|
|
985
986
|
return { x: r.x, y: r.y, width: r.width, height: r.height };
|
|
986
987
|
}
|
|
987
|
-
function motionPathLength(node, parentWorld =
|
|
988
|
+
function motionPathLength(node, parentWorld = _chunkTHXFU3JBcjs.IDENTITY_MATRIX) {
|
|
988
989
|
let longest = 0;
|
|
989
|
-
const paths = node.type === "path" ? [node] :
|
|
990
|
+
const paths = node.type === "path" ? [node] : _chunkTHXFU3JBcjs.collectPathNodes.call(void 0, node);
|
|
990
991
|
for (const p of paths) {
|
|
991
992
|
try {
|
|
992
|
-
longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0,
|
|
993
|
+
longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0, _chunkTHXFU3JBcjs.vectorPathWorldBezier.call(void 0, p, parentWorld, { effects: false })));
|
|
993
994
|
} catch (e2) {
|
|
994
995
|
}
|
|
995
996
|
}
|
|
@@ -1265,12 +1266,12 @@ function compileMotionScene(scene) {
|
|
|
1265
1266
|
const order2 = _nullishCoalesce(o.order, () => ( "together"));
|
|
1266
1267
|
const pace = _nullishCoalesce(o.pace, () => ( "time"));
|
|
1267
1268
|
if (order2 === "together" && pace === "time") return null;
|
|
1268
|
-
const paths = entry.node.type === "path" ? [entry.node] :
|
|
1269
|
+
const paths = entry.node.type === "path" ? [entry.node] : _chunkTHXFU3JBcjs.collectPathNodes.call(void 0, entry.node);
|
|
1269
1270
|
let list = paths.map((p) => {
|
|
1270
1271
|
const at = nodes.get(p.id);
|
|
1271
1272
|
let first = { x: 0, y: 0 };
|
|
1272
1273
|
try {
|
|
1273
|
-
const m =
|
|
1274
|
+
const m = _chunkTHXFU3JBcjs.vectorPathWorldBezier.call(void 0, p, _nullishCoalesce(_optionalChain([at, 'optionalAccess', _42 => _42.parentWorld]), () => ( _chunkTHXFU3JBcjs.IDENTITY_MATRIX)), { effects: false })[0];
|
|
1274
1275
|
if (m && m.type === "M") first = { x: m.x, y: m.y };
|
|
1275
1276
|
} catch (e3) {
|
|
1276
1277
|
}
|
|
@@ -1382,17 +1383,17 @@ function compileMotionScene(scene) {
|
|
|
1382
1383
|
let dx = _nullishCoalesce(_optionalChain([command3, 'access', _45 => _45.by, 'optionalAccess', _46 => _46.x]), () => ( 0));
|
|
1383
1384
|
let dy = _nullishCoalesce(_optionalChain([command3, 'access', _47 => _47.by, 'optionalAccess', _48 => _48.y]), () => ( 0));
|
|
1384
1385
|
if (command3.to) {
|
|
1385
|
-
const inv =
|
|
1386
|
-
const target =
|
|
1386
|
+
const inv = _chunkTHXFU3JBcjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1387
|
+
const target = _chunkTHXFU3JBcjs.applyMatrix.call(void 0, inv, command3.to);
|
|
1387
1388
|
dx = target.x - (entry.center.x + num2("x"));
|
|
1388
1389
|
dy = target.y - (entry.center.y + num2("y"));
|
|
1389
1390
|
}
|
|
1390
1391
|
if (_optionalChain([command3, 'access', _49 => _49.via, 'optionalAccess', _50 => _50.length])) {
|
|
1391
|
-
const inv =
|
|
1392
|
+
const inv = _chunkTHXFU3JBcjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1392
1393
|
const x0 = num2("x");
|
|
1393
1394
|
const y0 = num2("y");
|
|
1394
1395
|
const add = command3.blend === "add";
|
|
1395
|
-
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) =>
|
|
1396
|
+
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) => _chunkTHXFU3JBcjs.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 }];
|
|
1396
1397
|
const times = _optionalChain([command3, 'access', _51 => _51.times, 'optionalAccess', _52 => _52.length]) === command3.via.length ? [start, ...command3.times.map((f) => start + f * (end - start)), end] : smoothMotionTimes(offsets, start, end - start, _nullishCoalesce(command3.pacing, () => ( "even")));
|
|
1397
1398
|
for (const axis of ["x", "y"]) {
|
|
1398
1399
|
const base = add ? 0 : axis === "x" ? x0 : y0;
|
|
@@ -2015,13 +2016,13 @@ function morphBetween(a, b) {
|
|
|
2015
2016
|
let inner = morphCache.get(a);
|
|
2016
2017
|
if (!inner) morphCache.set(a, inner = /* @__PURE__ */ new WeakMap());
|
|
2017
2018
|
let morph = inner.get(b);
|
|
2018
|
-
if (!morph) inner.set(b, morph =
|
|
2019
|
+
if (!morph) inner.set(b, morph = _chunkZXNO3ZOXcjs.createVectorMorph.call(void 0, a, b, { id: a.id }));
|
|
2019
2020
|
return morph;
|
|
2020
2021
|
}
|
|
2021
2022
|
function shapeIn(entry, shape) {
|
|
2022
2023
|
if (shape === entry) return entry.node;
|
|
2023
|
-
const m =
|
|
2024
|
-
return { ...shape.node, ...
|
|
2024
|
+
const m = _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _chunkTHXFU3JBcjs.nodeMatrix.call(void 0, shape.node), shape.parentWorld), _chunkTHXFU3JBcjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
2025
|
+
return { ...shape.node, ..._chunkTHXFU3JBcjs.isIdentityMatrix.call(void 0, m) ? { transform: void 0 } : { transform: m } };
|
|
2025
2026
|
}
|
|
2026
2027
|
function shapeAt(entry, timeline, nodes, time) {
|
|
2027
2028
|
const track = timeline.tracks.get(motionTrackKey(entry.node.id, "shape"));
|
|
@@ -2041,7 +2042,7 @@ function shapeAt(entry, timeline, nodes, time) {
|
|
|
2041
2042
|
function motionFollowRoute(entry, path) {
|
|
2042
2043
|
if (!path || path.node.type !== "path") return null;
|
|
2043
2044
|
try {
|
|
2044
|
-
return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0,
|
|
2045
|
+
return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunkTHXFU3JBcjs.vectorPathWorldBezier.call(void 0, path.node, path.parentWorld, { effects: false }), _chunkTHXFU3JBcjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
2045
2046
|
} catch (e6) {
|
|
2046
2047
|
return null;
|
|
2047
2048
|
}
|
|
@@ -2075,9 +2076,9 @@ function motionNodeOffset(entry, timeline, time, nodes = indexMotionNodes([entry
|
|
|
2075
2076
|
const scaleX = read("scaleX", 1);
|
|
2076
2077
|
const scaleY = read("scaleY", 1);
|
|
2077
2078
|
const c = entry.center;
|
|
2078
|
-
let matrix =
|
|
2079
|
+
let matrix = _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _chunkTHXFU3JBcjs.scaleMatrix.call(void 0, scaleX, scaleY, c), _chunkTHXFU3JBcjs.rotateMatrix.call(void 0, rotation, c)), _chunkTHXFU3JBcjs.translateMatrix.call(void 0, dx, dy));
|
|
2079
2080
|
const along = follow ? followAt(entry, timeline, nodes, time) : null;
|
|
2080
|
-
if (along) matrix =
|
|
2081
|
+
if (along) matrix = _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, matrix, _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _chunkTHXFU3JBcjs.translateMatrix.call(void 0, -c.x, -c.y), _chunkTHXFU3JBcjs.rotateMatrix.call(void 0, along.angle)), _chunkTHXFU3JBcjs.translateMatrix.call(void 0, along.x, along.y)));
|
|
2081
2082
|
return { matrix, dx, dy, rotation, scaleX, scaleY, follow: along };
|
|
2082
2083
|
}
|
|
2083
2084
|
function motionNodeClips(id, timeline, time) {
|
|
@@ -2144,7 +2145,7 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
2144
2145
|
const start = Math.min(1, Math.max(0, typeof drawStart === "number" ? drawStart : 0));
|
|
2145
2146
|
const end = Math.min(1, Math.max(0, typeof drawEnd === "number" ? drawEnd : 1));
|
|
2146
2147
|
if (start > 0 || end < 1) {
|
|
2147
|
-
const trim =
|
|
2148
|
+
const trim = _chunkTHXFU3JBcjs.createVectorEffect.call(void 0, "trim", MOTION_DRAW_EFFECT_ID, { start: tidy(start * 100), end: tidy(end * 100) });
|
|
2148
2149
|
p = { ...p, effects: [trim, ...(_nullishCoalesce(p.effects, () => ( []))).filter((e) => e.id !== MOTION_DRAW_EFFECT_ID)] };
|
|
2149
2150
|
}
|
|
2150
2151
|
}
|
|
@@ -2158,8 +2159,8 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
2158
2159
|
if (o >= 1) delete out.opacity;
|
|
2159
2160
|
}
|
|
2160
2161
|
const offset = options.offsets === false ? null : motionNodeOffset(entry, timeline, time, nodes);
|
|
2161
|
-
if (offset && !
|
|
2162
|
-
const m =
|
|
2162
|
+
if (offset && !_chunkTHXFU3JBcjs.isIdentityMatrix.call(void 0, offset.matrix)) {
|
|
2163
|
+
const m = _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _chunkTHXFU3JBcjs.nodeMatrix.call(void 0, out), offset.matrix).map(tidy);
|
|
2163
2164
|
out = { ...out, transform: m };
|
|
2164
2165
|
}
|
|
2165
2166
|
return out;
|
|
@@ -2180,8 +2181,8 @@ function motionFrameToSvg(scene, time, options = {}) {
|
|
|
2180
2181
|
const wrap = { ...options.wrap };
|
|
2181
2182
|
for (const [id, clips] of Object.entries(frame.clips))
|
|
2182
2183
|
wrap[id] = [..._nullishCoalesce(wrap[id], () => ( [])), ...clips.map((clip, i) => ({ clip: { id: `${prefix}reveal-${id}-${i}`, shape: clip.shape, attrs: motionClipAttrs(clip) } }))];
|
|
2183
|
-
if (!motionSceneHasLayers(scene)) return withCameraViewEffects(withViewBox(
|
|
2184
|
-
const art =
|
|
2184
|
+
if (!motionSceneHasLayers(scene)) return withCameraViewEffects(withViewBox(_chunkTHXFU3JBcjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap }), frame.camera), frame.view, frame.camera, prefix);
|
|
2185
|
+
const art = _chunkTHXFU3JBcjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap, background: false });
|
|
2185
2186
|
let svg = withViewBox(withMotionShotLayers(art, scene, time, frame.camera, options.layers, options.background !== false), frame.camera);
|
|
2186
2187
|
const transition = options.transitions === false ? null : motionTransitionAt(scene, time);
|
|
2187
2188
|
if (transition) {
|
|
@@ -2372,8 +2373,8 @@ function visibleAt(timeline, id, time, node) {
|
|
|
2372
2373
|
if (Array.isArray(rect) && (rect[2] <= 1e-4 || rect[3] <= 1e-4)) return false;
|
|
2373
2374
|
const circle = clip("clipCircle");
|
|
2374
2375
|
if (Array.isArray(circle) && circle[2] <= 1e-4) return false;
|
|
2375
|
-
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" :
|
|
2376
|
-
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" ||
|
|
2376
|
+
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" : _chunkTHXFU3JBcjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
|
|
2377
|
+
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunkTHXFU3JBcjs.collectPathNodes.call(void 0, node).length === 0 || _chunkTHXFU3JBcjs.collectPathNodes.call(void 0, node).some((p) => {
|
|
2377
2378
|
const v = trackValue(timeline.tracks.get(motionTrackKey(p.id, "drawEnd")), time);
|
|
2378
2379
|
return typeof v !== "number" || v > 0.01;
|
|
2379
2380
|
}));
|
|
@@ -2460,7 +2461,7 @@ function checkMotionScene(scene) {
|
|
|
2460
2461
|
}
|
|
2461
2462
|
for (const id of targets) {
|
|
2462
2463
|
const node = nodes.get(id).node;
|
|
2463
|
-
const paths = node.type === "path" ? [node] :
|
|
2464
|
+
const paths = node.type === "path" ? [node] : _chunkTHXFU3JBcjs.collectPathNodes.call(void 0, node);
|
|
2464
2465
|
if (paths.some((p) => p[key] !== void 0 && p[key] !== null && typeof p[key] !== "string"))
|
|
2465
2466
|
issues.push(_chunkDGWOGQJ5cjs.motionIssue.call(void 0, "paint-not-color", `"${id}" has a gradient ${key}; it switches to ${color} at the end instead of blending.`, { ...where, ids: [id] }));
|
|
2466
2467
|
}
|
|
@@ -2473,7 +2474,7 @@ function checkMotionScene(scene) {
|
|
|
2473
2474
|
else
|
|
2474
2475
|
for (const id of targets) {
|
|
2475
2476
|
const node = nodes.get(id).node;
|
|
2476
|
-
const paths = node.type === "path" ? [node] :
|
|
2477
|
+
const paths = node.type === "path" ? [node] : _chunkTHXFU3JBcjs.collectPathNodes.call(void 0, node);
|
|
2477
2478
|
if (paths.some((p) => typeof p[key] !== "string"))
|
|
2478
2479
|
issues.push(_chunkDGWOGQJ5cjs.motionIssue.call(void 0, "paint-not-color", `"${id}" has a gradient or no ${key}, so a colour pulse cannot tint it; give it a solid ${key} or pulse the ${key === "fill" ? "stroke" : "fill"}.`, { ...where, ids: [id] }));
|
|
2479
2480
|
}
|
|
@@ -2918,7 +2919,7 @@ function motionNodePose(scene, id, time) {
|
|
|
2918
2919
|
if (!entry) throw new Error(`There is no element ${_chunkDGWOGQJ5cjs.namedWithSuggestion.call(void 0, id, [...indexMotionNodes(scene.artwork.nodes).keys()])} in the artwork.`);
|
|
2919
2920
|
const timeline = compileMotionScene(scene);
|
|
2920
2921
|
const drawn = indexMotionNodes(motionFrameAt(scene, time).document.nodes).get(id);
|
|
2921
|
-
const centre =
|
|
2922
|
+
const centre = _chunkTHXFU3JBcjs.applyMatrix.call(void 0, entry.parentWorld, { x: entry.center.x + motionPropertyValue(timeline, id, "x", time), y: entry.center.y + motionPropertyValue(timeline, id, "y", time) });
|
|
2922
2923
|
const paint = (property) => _nullishCoalesce(trackValue(timeline.tracks.get(motionTrackKey(id, property)), time), () => ( motionRestValue(entry, property, scene.artwork)));
|
|
2923
2924
|
const fill = paint("fill");
|
|
2924
2925
|
const stroke = paint("stroke");
|
|
@@ -3265,7 +3266,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3265
3266
|
raw: (t) => transformAt(t, true)
|
|
3266
3267
|
});
|
|
3267
3268
|
}
|
|
3268
|
-
const paths = node.type === "path" ? [node] :
|
|
3269
|
+
const paths = node.type === "path" ? [node] : _chunkTHXFU3JBcjs.collectPathNodes.call(void 0, node);
|
|
3269
3270
|
for (const path of paths) {
|
|
3270
3271
|
if (pathsSeen.has(path.id)) continue;
|
|
3271
3272
|
pathsSeen.add(path.id);
|
|
@@ -3287,7 +3288,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3287
3288
|
if (shapeSegments.length) {
|
|
3288
3289
|
if (node.type !== "path") notes.push(`"${id}" is a group: its morph or effect animation is not exported (Flair tweens one path's "d").`);
|
|
3289
3290
|
else {
|
|
3290
|
-
const inverse =
|
|
3291
|
+
const inverse = _chunkTHXFU3JBcjs.invertMatrix.call(void 0, _chunkTHXFU3JBcjs.nodeMatrix.call(void 0, node));
|
|
3291
3292
|
channels.push({
|
|
3292
3293
|
id,
|
|
3293
3294
|
kind: "attr",
|
|
@@ -3296,9 +3297,9 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3296
3297
|
exact: () => false,
|
|
3297
3298
|
value: (t) => {
|
|
3298
3299
|
const frame = motionFrameAt(scene, t, { draw: false, offsets: false });
|
|
3299
|
-
const now =
|
|
3300
|
+
const now = _chunkTHXFU3JBcjs.expandVectorAppearance.call(void 0, _optionalChain([indexMotionNodes, 'call', _151 => _151(frame.document.nodes), 'access', _152 => _152.get, 'call', _153 => _153(id), 'optionalAccess', _154 => _154.node]));
|
|
3300
3301
|
if (!now || now.type !== "path") return "";
|
|
3301
|
-
const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0,
|
|
3302
|
+
const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunkTHXFU3JBcjs.vectorPathWorldBezier.call(void 0, now, _chunkTHXFU3JBcjs.IDENTITY_MATRIX, { effects: false }), inverse);
|
|
3302
3303
|
return _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0, bezier, { precision: Math.min(precision, 2) });
|
|
3303
3304
|
}
|
|
3304
3305
|
});
|
|
@@ -3438,7 +3439,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3438
3439
|
}
|
|
3439
3440
|
if (scene.motionBlur) notes.push("Motion blur is drawn on the stage only; Flair plays the scene sharp.");
|
|
3440
3441
|
if (trigger && (_nullishCoalesce(scene.loop, () => ( "none"))) !== "none") notes.push(`The scene plays on ${trigger}, so its loop does not apply in Flair.`);
|
|
3441
|
-
let svg =
|
|
3442
|
+
let svg = _chunkTHXFU3JBcjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunkTHXFU3JBcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) }, { pretty: false, precision, wrap });
|
|
3442
3443
|
if (routes.length) svg = svg.replace(/^(<svg[^>]*>)/, `$1<defs>${routes.join("")}</defs>`);
|
|
3443
3444
|
let motion = { svg, animate };
|
|
3444
3445
|
if (_optionalChain([scene, 'access', _160 => _160.controls, 'optionalAccess', _161 => _161.length])) {
|
|
@@ -3536,14 +3537,14 @@ function easingOf(ease, fallback) {
|
|
|
3536
3537
|
return fallback;
|
|
3537
3538
|
}
|
|
3538
3539
|
function poseOf(value, entry) {
|
|
3539
|
-
const t =
|
|
3540
|
-
const o =
|
|
3540
|
+
const t = _chunkTHXFU3JBcjs.parseSvgTransform.call(void 0, String(value));
|
|
3541
|
+
const o = _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkTHXFU3JBcjs.invertMatrix.call(void 0, _chunkTHXFU3JBcjs.nodeMatrix.call(void 0, entry.node)), () => ( [1, 0, 0, 1, 0, 0])), t);
|
|
3541
3542
|
const sx = Math.hypot(o[0], o[1]);
|
|
3542
3543
|
if (!(sx > 1e-9)) return null;
|
|
3543
3544
|
const sy = (o[0] * o[3] - o[1] * o[2]) / sx;
|
|
3544
3545
|
if (Math.abs(o[2] + o[1] / sx * sy) > 1e-6 || Math.abs(o[3] - o[0] / sx * sy) > 1e-6) return null;
|
|
3545
3546
|
const c = entry.center;
|
|
3546
|
-
const moved =
|
|
3547
|
+
const moved = _chunkTHXFU3JBcjs.applyMatrix.call(void 0, o, c);
|
|
3547
3548
|
return { dx: moved.x - c.x, dy: moved.y - c.y, rotation: Math.atan2(o[1], o[0]) * 180 / Math.PI, sx, sy };
|
|
3548
3549
|
}
|
|
3549
3550
|
var near = (a, b, eps = 1e-6) => Math.abs(a - b) < eps;
|
|
@@ -3628,7 +3629,7 @@ function fromFlairSvgMotion(input, options = {}) {
|
|
|
3628
3629
|
const notes = [];
|
|
3629
3630
|
if (!input || typeof input.svg !== "string") throw new Error('Give a Flair SvgMotion: { svg: "<svg \u2026>", animate: [ \u2026 ] }.');
|
|
3630
3631
|
const { motion, controls } = resolvePlaceholders(input, notes);
|
|
3631
|
-
const artwork =
|
|
3632
|
+
const artwork = _chunkTHXFU3JBcjs.parseVectorSvg.call(void 0, motion.svg);
|
|
3632
3633
|
const nodes = indexMotionNodes(artwork.nodes);
|
|
3633
3634
|
const byStep = /* @__PURE__ */ new Map();
|
|
3634
3635
|
for (const anim of _nullishCoalesce(motion.animate, () => ( []))) {
|
|
@@ -3875,9 +3876,9 @@ function toLottie(scene, options = {}) {
|
|
|
3875
3876
|
const items = [];
|
|
3876
3877
|
const shapeSegments = [...timeline.tracks.entries()].filter(([k]) => k.startsWith(`${path.id}\0`) && (k.endsWith("\0shape") || k.includes("\0effect:"))).flatMap(([, v]) => v);
|
|
3877
3878
|
const geometryAt = (t) => {
|
|
3878
|
-
if (!shapeSegments.length) return
|
|
3879
|
+
if (!shapeSegments.length) return _chunkTHXFU3JBcjs.vectorPathWorldBezier.call(void 0, path);
|
|
3879
3880
|
const now = _optionalChain([indexMotionNodes, 'call', _170 => _170(motionFrameAt(scene, t, { draw: false, offsets: false }).document.nodes), 'access', _171 => _171.get, 'call', _172 => _172(path.id), 'optionalAccess', _173 => _173.node]);
|
|
3880
|
-
return now && now.type === "path" ?
|
|
3881
|
+
return now && now.type === "path" ? _chunkTHXFU3JBcjs.vectorPathWorldBezier.call(void 0, _chunkTHXFU3JBcjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunkTHXFU3JBcjs.vectorPathWorldBezier.call(void 0, path);
|
|
3881
3882
|
};
|
|
3882
3883
|
const rest = lottieContours(_chunkGF2RBSDMcjs.toBezierPath.call(void 0, geometryAt(0)), round4);
|
|
3883
3884
|
rest.forEach((contour, n2) => {
|
|
@@ -3950,13 +3951,13 @@ function toLottie(scene, options = {}) {
|
|
|
3950
3951
|
const innerTr = STATIC_TR();
|
|
3951
3952
|
if (node.type === "path") inner = [...pathShapes(node)];
|
|
3952
3953
|
else if (node.type === "text" || node.type === "instance") {
|
|
3953
|
-
const drawn =
|
|
3954
|
+
const drawn = _chunkTHXFU3JBcjs.expandVectorAppearance.call(void 0, node);
|
|
3954
3955
|
inner = drawn.type === "path" ? [...pathShapes(drawn)] : drawn.children.filter((c) => c.type === "path").reverse().flatMap((c) => [...pathShapes(c)]);
|
|
3955
|
-
notes.push(`"${node.id}": text is exported as its outlines${
|
|
3956
|
+
notes.push(`"${node.id}": text is exported as its outlines${_chunkTHXFU3JBcjs.vectorTextHasOutlines.call(void 0, ) ? "" : " (glyph boxes: set an outline text shaper for real glyphs)"}.`);
|
|
3956
3957
|
} else {
|
|
3957
3958
|
inner = shown(node.children).reverse().map(nodeGroup);
|
|
3958
|
-
const m =
|
|
3959
|
-
if (m !==
|
|
3959
|
+
const m = _chunkTHXFU3JBcjs.nodeMatrix.call(void 0, node);
|
|
3960
|
+
if (m !== _chunkTHXFU3JBcjs.IDENTITY_MATRIX) {
|
|
3960
3961
|
const parts = staticParts(m);
|
|
3961
3962
|
if (!parts) notes.push(`"${node.id}": its transform skews, which is not exported; it is drawn without the skew.`);
|
|
3962
3963
|
else {
|
|
@@ -3969,7 +3970,7 @@ function toLottie(scene, options = {}) {
|
|
|
3969
3970
|
const body = { ty: "gr", nm: `${node.id} (own)`, it: [...inner, innerTr] };
|
|
3970
3971
|
return { ty: "gr", nm: _nullishCoalesce(node.name, () => ( node.id)), it: [body, poseTransform(entry)] };
|
|
3971
3972
|
};
|
|
3972
|
-
const artwork = { ...scene.artwork, nodes:
|
|
3973
|
+
const artwork = { ...scene.artwork, nodes: _chunkTHXFU3JBcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) };
|
|
3973
3974
|
const content = shown(artwork.nodes).reverse().map(nodeGroup);
|
|
3974
3975
|
if (artwork.background && rgba(artwork.background))
|
|
3975
3976
|
content.push({ ty: "gr", nm: "Background", it: [{ ty: "rc", nm: "Background", p: { a: 0, k: [artwork.width / 2, artwork.height / 2] }, s: { a: 0, k: [artwork.width, artwork.height] }, r: { a: 0, k: 0 } }, { ty: "fl", c: { a: 0, k: rgba(artwork.background).map(round4) }, o: { a: 0, k: 100 }, r: 1 }, STATIC_TR()] });
|
|
@@ -4068,11 +4069,11 @@ function preset(prst, w, h) {
|
|
|
4068
4069
|
const poly = (pts) => [{ closed: true, anchors: pts.map(([x, y]) => ({ x, y })) }];
|
|
4069
4070
|
switch (prst) {
|
|
4070
4071
|
case "rect":
|
|
4071
|
-
return [
|
|
4072
|
+
return [_chunkTHXFU3JBcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
4072
4073
|
case "roundRect":
|
|
4073
|
-
return [
|
|
4074
|
+
return [_chunkTHXFU3JBcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h }, Math.min(w, h) * 0.16667)];
|
|
4074
4075
|
case "ellipse":
|
|
4075
|
-
return [
|
|
4076
|
+
return [_chunkTHXFU3JBcjs.ellipseSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
4076
4077
|
case "triangle":
|
|
4077
4078
|
return poly([[w / 2, 0], [w, h], [0, h]]);
|
|
4078
4079
|
case "rtTriangle":
|
|
@@ -4180,7 +4181,7 @@ function shapes(ctx, tree, map) {
|
|
|
4180
4181
|
let subpaths = cust ? custom(cust, w, h) : prst ? preset(prst, w, h) : null;
|
|
4181
4182
|
if (!subpaths) {
|
|
4182
4183
|
if (prst) ctx.notes.push(`"${name}" is a ${prst}, drawn as its bounding rectangle.`);
|
|
4183
|
-
subpaths = [
|
|
4184
|
+
subpaths = [_chunkTHXFU3JBcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
4184
4185
|
}
|
|
4185
4186
|
const style = kid(el, "style");
|
|
4186
4187
|
const fill = kid(spPr, "noFill") ? null : _nullishCoalesce(colour(ctx, kid(spPr, "solidFill")), () => ( (el.localName === "cxnSp" ? null : colour(ctx, kid(style, "fillRef")))));
|
|
@@ -4569,7 +4570,7 @@ function nextMotionEffectInstance(scene) {
|
|
|
4569
4570
|
walk(scene.artwork.nodes);
|
|
4570
4571
|
for (let i = 1; ; i++) if (!used.has(`fx${i}`)) return `fx${i}`;
|
|
4571
4572
|
}
|
|
4572
|
-
var motionArtworkSvg = (artwork) =>
|
|
4573
|
+
var motionArtworkSvg = (artwork) => _chunkTHXFU3JBcjs.vectorDocumentToSvg.call(void 0, artwork);
|
|
4573
4574
|
var tag = (commands, source) => commands.map((c) => c.type === "wait" ? c : { ...c, source });
|
|
4574
4575
|
function motionCommandsFromEffect(artwork, motion, source) {
|
|
4575
4576
|
const imported = fromFlairSvgMotion({ svg: motionArtworkSvg(artwork), animate: [..._nullishCoalesce(motion.animate, () => ( []))] });
|
|
@@ -4665,7 +4666,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
4665
4666
|
host: options.layerHost === void 0 ? browserMotionLayerHost() : options.layerHost,
|
|
4666
4667
|
frameSvg: (scene, time) => motionFrameToSvg(scene, time, { effects: this.effects.provider, layers: this.layers, transitions: false, pretty: false })
|
|
4667
4668
|
});
|
|
4668
|
-
this.player = new (0,
|
|
4669
|
+
this.player = new (0, _chunkLJZRHVZVcjs.AnimationPlayer)({ clock: options.clock, duration: () => compileMotionScene(this.scene).duration, loop: _nullishCoalesce(this.scene.loop, () => ( "none")) });
|
|
4669
4670
|
this.state = this.computeState();
|
|
4670
4671
|
this.connect();
|
|
4671
4672
|
}
|
|
@@ -6141,7 +6142,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
|
|
|
6141
6142
|
handler: ({ svg }) => {
|
|
6142
6143
|
let artwork;
|
|
6143
6144
|
try {
|
|
6144
|
-
artwork =
|
|
6145
|
+
artwork = _chunkTHXFU3JBcjs.parseVectorSvg.call(void 0, svg);
|
|
6145
6146
|
} catch (error) {
|
|
6146
6147
|
throw new Error(`The SVG could not be read: ${error.message}. Nothing was changed.`);
|
|
6147
6148
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createVectorMorph
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-XK4SST43.js";
|
|
4
4
|
import {
|
|
5
5
|
MOTION_ISSUE_CODES,
|
|
6
6
|
motionIssue,
|
|
@@ -39,8 +39,8 @@ import {
|
|
|
39
39
|
vectorNodeBounds,
|
|
40
40
|
vectorPathWorldBezier,
|
|
41
41
|
vectorTextHasOutlines
|
|
42
|
-
} from "../chunk-
|
|
43
|
-
import "../chunk-
|
|
42
|
+
} from "../chunk-7YGBSFC6.js";
|
|
43
|
+
import "../chunk-PJYG6FCF.js";
|
|
44
44
|
import "../chunk-M6DNZNVY.js";
|
|
45
45
|
import {
|
|
46
46
|
bezierPathLength,
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
} from "../chunk-DS4WGCLJ.js";
|
|
94
94
|
import {
|
|
95
95
|
AnimationPlayer
|
|
96
|
-
} from "../chunk-
|
|
96
|
+
} from "../chunk-CXXXAZ7H.js";
|
|
97
97
|
import {
|
|
98
98
|
ANIMATION_EASING_LABELS,
|
|
99
99
|
ANIMATION_EASING_PRESETS,
|
|
@@ -105,15 +105,16 @@ import {
|
|
|
105
105
|
} from "../chunk-5UJHB3BW.js";
|
|
106
106
|
import {
|
|
107
107
|
mixColorsOklab
|
|
108
|
-
} from "../chunk-
|
|
108
|
+
} from "../chunk-V6DT2CDH.js";
|
|
109
109
|
import {
|
|
110
110
|
hexToRgba,
|
|
111
111
|
normalizeTokenColor,
|
|
112
112
|
rgbaToHex
|
|
113
113
|
} from "../chunk-2WPNAGHI.js";
|
|
114
|
-
import "../chunk-
|
|
115
|
-
import "../chunk-
|
|
116
|
-
import "../chunk-
|
|
114
|
+
import "../chunk-BP6KSGVD.js";
|
|
115
|
+
import "../chunk-6ADHGQ73.js";
|
|
116
|
+
import "../chunk-JEGJP4OW.js";
|
|
117
|
+
import "../chunk-F67XMVDI.js";
|
|
117
118
|
import "../chunk-6ONMQ6WF.js";
|
|
118
119
|
|
|
119
120
|
// src/animation-editor/types.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
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; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkPP6BXVRLcjs = require('./chunk-PP6BXVRL.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkA2IS7EHEcjs = require('./chunk-A2IS7EHE.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkNKTNLJUJcjs = require('./chunk-NKTNLJUJ.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -22,16 +22,18 @@ require('./chunk-YQGCPL5X.cjs');
|
|
|
22
22
|
require('./chunk-OLNIPTB3.cjs');
|
|
23
23
|
require('./chunk-474IQG74.cjs');
|
|
24
24
|
require('./chunk-XFM3OCHU.cjs');
|
|
25
|
+
require('./chunk-7AHBW2CQ.cjs');
|
|
26
|
+
require('./chunk-IPJ3TEYR.cjs');
|
|
25
27
|
|
|
26
28
|
// src/canvas/brushstrokeRender.ts
|
|
27
|
-
var DRY =
|
|
29
|
+
var DRY = _chunkNKTNLJUJcjs.BUILTIN_BRUSHES.filter((b) => _chunkPQ3H2AANcjs.isBrushstrokeBrush.call(void 0, b));
|
|
28
30
|
function listCanvasBrushes() {
|
|
29
31
|
return DRY.map((b) => ({ id: b.id, name: b.name, category: b.category, size: b.tip.size }));
|
|
30
32
|
}
|
|
31
33
|
function resolveCanvasBrush(brush, width) {
|
|
32
34
|
const given = width !== void 0 && Number.isFinite(width) ? Math.max(1, width) : void 0;
|
|
33
35
|
if (typeof brush === "string") {
|
|
34
|
-
const preset =
|
|
36
|
+
const preset = _chunkNKTNLJUJcjs.BUILTIN_BRUSHES.find((b) => b.id === brush);
|
|
35
37
|
const ids = DRY.map((b) => b.id).join(", ");
|
|
36
38
|
if (!preset) throw new Error(`Unknown brush '${brush}'. Use one of the dry paint presets (${ids}) or tip settings ({ hardness, spacing, flow, \u2026 }).`);
|
|
37
39
|
if (!_chunkPQ3H2AANcjs.isBrushstrokeBrush.call(void 0, preset)) {
|
|
@@ -73,7 +75,7 @@ function renderShapeBrushstrokeNow(shape, scale, place = {}) {
|
|
|
73
75
|
const textured = typeof seed === "number" && Number.isFinite(seed);
|
|
74
76
|
const size = _nullishCoalesce(shape.brush.size, () => ( (textured ? void 0 : _nullishCoalesce(shape.strokeWidth, () => ( 3)))));
|
|
75
77
|
const brush = resolveCanvasBrush(shape.brush.brush, size);
|
|
76
|
-
const points =
|
|
78
|
+
const points = _chunkPP6BXVRLcjs.pathDataToPolyline.call(void 0, shape.d);
|
|
77
79
|
if (!points.length) return null;
|
|
78
80
|
const { pressure, tiltX, tiltY } = shape.brush;
|
|
79
81
|
const input = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pathDataToPolyline
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RV5DKZHU.js";
|
|
4
4
|
import {
|
|
5
5
|
parseCssColor
|
|
6
6
|
} from "./chunk-3CI7FRMK.js";
|
|
7
7
|
import {
|
|
8
8
|
BUILTIN_BRUSHES
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PJYG6FCF.js";
|
|
10
10
|
import {
|
|
11
11
|
formatNumber,
|
|
12
12
|
getShapeSvg,
|
|
@@ -22,6 +22,8 @@ import "./chunk-ODBT55Q7.js";
|
|
|
22
22
|
import "./chunk-42TWUPNJ.js";
|
|
23
23
|
import "./chunk-HVVR5PZW.js";
|
|
24
24
|
import "./chunk-QGHEDC7B.js";
|
|
25
|
+
import "./chunk-F67XMVDI.js";
|
|
26
|
+
import "./chunk-6ONMQ6WF.js";
|
|
25
27
|
|
|
26
28
|
// src/canvas/brushstrokeRender.ts
|
|
27
29
|
var DRY = BUILTIN_BRUSHES.filter((b) => isBrushstrokeBrush(b));
|