@pixerate/editor 0.125.0 → 0.127.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/index.d.cts +2 -3
- package/dist/animation/index.d.ts +2 -3
- package/dist/animation-editor/index.cjs +71 -73
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +6 -8
- package/dist/animation-editor/index.d.ts +6 -8
- package/dist/animation-editor/index.js +11 -13
- package/dist/animation-editor/index.js.map +1 -1
- package/dist/{bezier-CBzKKDjl.d.cts → bezier-DBz0IgEt.d.cts} +22 -2
- package/dist/{bezier-CWv6LQal.d.ts → bezier-DWI5MEkI.d.ts} +22 -2
- package/dist/{brushstrokeRender-LRV7GXGD.js → brushstrokeRender-7RUITO42.js} +3 -3
- package/dist/{brushstrokeRender-EELTV7U4.cjs → brushstrokeRender-OW6ENCZG.cjs} +7 -7
- package/dist/{brushstrokeRender-EELTV7U4.cjs.map → brushstrokeRender-OW6ENCZG.cjs.map} +1 -1
- package/dist/canvas/index.cjs +423 -37
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +189 -11
- package/dist/canvas/index.d.ts +189 -11
- package/dist/canvas/index.js +395 -9
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-7LQO6OHH.cjs → chunk-33SO3QWP.cjs} +4 -4
- package/dist/{chunk-7LQO6OHH.cjs.map → chunk-33SO3QWP.cjs.map} +1 -1
- package/dist/{chunk-MPQAO33O.js → chunk-A6KHMKI4.js} +3 -3
- package/dist/{chunk-V5YGPRCZ.cjs → chunk-BEGEWQHD.cjs} +41 -41
- package/dist/{chunk-V5YGPRCZ.cjs.map → chunk-BEGEWQHD.cjs.map} +1 -1
- package/dist/{chunk-N3FVUOZD.cjs → chunk-BJTCSLF6.cjs} +7 -7
- package/dist/{chunk-N3FVUOZD.cjs.map → chunk-BJTCSLF6.cjs.map} +1 -1
- package/dist/{chunk-WUDPFWAN.js → chunk-F7Q2NE2Y.js} +3 -3
- package/dist/{chunk-G6WXWS4Y.js → chunk-FICSDDDF.js} +2 -2
- package/dist/{chunk-GUZ47CJM.cjs → chunk-IZ4WRXZA.cjs} +1 -1
- package/dist/{chunk-GUZ47CJM.cjs.map → chunk-IZ4WRXZA.cjs.map} +1 -1
- package/dist/{chunk-QDJKUBWE.cjs → chunk-JODTP4DP.cjs} +176 -5
- package/dist/chunk-JODTP4DP.cjs.map +1 -0
- package/dist/{chunk-GLWZXQ4Q.js → chunk-KHNZ6MOU.js} +1 -1
- package/dist/chunk-KHNZ6MOU.js.map +1 -0
- package/dist/{chunk-GCJWMEYW.cjs → chunk-KSJLDRHK.cjs} +46 -46
- package/dist/{chunk-GCJWMEYW.cjs.map → chunk-KSJLDRHK.cjs.map} +1 -1
- package/dist/{chunk-QQKTOA4U.cjs → chunk-ORE334I6.cjs} +132 -132
- package/dist/{chunk-QQKTOA4U.cjs.map → chunk-ORE334I6.cjs.map} +1 -1
- package/dist/{chunk-X6KTSFAE.js → chunk-Q4NBEVV5.js} +2 -2
- package/dist/{chunk-XZWOLXWA.js → chunk-QFSTQHZY.js} +174 -3
- package/dist/chunk-QFSTQHZY.js.map +1 -0
- package/dist/{chunk-FPRIUR4T.js → chunk-ROZFX4QI.js} +3 -3
- package/dist/{chunk-UXFI3CDZ.cjs → chunk-SFCPGMCT.cjs} +8 -8
- package/dist/{chunk-UXFI3CDZ.cjs.map → chunk-SFCPGMCT.cjs.map} +1 -1
- package/dist/{chunk-J67OLQUQ.js → chunk-UABQTYQF.js} +3 -3
- package/dist/{chunk-O5RVCDEC.cjs → chunk-XLUYXUBD.cjs} +88 -88
- package/dist/{chunk-O5RVCDEC.cjs.map → chunk-XLUYXUBD.cjs.map} +1 -1
- package/dist/{chunk-FG274FYT.js → chunk-YGJIER2R.js} +2 -2
- package/dist/effects/index.cjs +32 -34
- package/dist/effects/index.cjs.map +1 -1
- package/dist/effects/index.d.cts +6 -38
- package/dist/effects/index.d.ts +6 -38
- package/dist/effects/index.js +3 -5
- package/dist/effects/index.js.map +1 -1
- package/dist/evaluate-BbCeF6pt.d.ts +114 -0
- package/dist/evaluate-BsxYieLN.d.cts +114 -0
- package/dist/{export-DVl4fWy5.d.cts → export-Cbr9IqpJ.d.cts} +1 -1
- package/dist/{export-Bp7ji2r4.d.cts → export-CcldobdN.d.cts} +3 -3
- package/dist/{export-C1s4eolZ.d.ts → export-ClPKUB-v.d.ts} +1 -1
- package/dist/{export-DAyPY94f.d.ts → export-PGhOpDmz.d.ts} +3 -3
- package/dist/{helpers-i95Ob6Vi.d.cts → helpers-C5aAd44p.d.cts} +67 -4
- package/dist/{helpers-BBLlekuM.d.ts → helpers-CPWcK504.d.ts} +67 -4
- package/dist/image-editor/index.cjs +619 -621
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +9 -11
- package/dist/image-editor/index.d.ts +9 -11
- package/dist/image-editor/index.js +6 -8
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{opentype-14PDI5D2.d.ts → opentype-01rMIuQR.d.ts} +1 -1
- package/dist/{opentype-D80AVmMu.d.cts → opentype-BgqvmGT-.d.cts} +1 -1
- package/dist/paint-editor/index.cjs +737 -117
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +248 -13
- package/dist/paint-editor/index.d.ts +248 -13
- package/dist/paint-editor/index.js +635 -15
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/{pathfinder-DjISxkUv.d.ts → pathfinder-D-h0Imus.d.ts} +1 -1
- package/dist/{pathfinder-C0UoFypx.d.cts → pathfinder-DgG0Z9Lr.d.cts} +1 -1
- package/dist/{player-cGLrngL_.d.ts → player-BK2kKbfd.d.ts} +1 -1
- package/dist/{player-CBtEoU2x.d.cts → player-CmbY3218.d.cts} +1 -1
- package/dist/pool-C7GtrL34.d.cts +34 -0
- package/dist/pool-CTrtciaN.d.ts +34 -0
- package/dist/{svg-DJKriJ4A.d.ts → svg-BRLwcibA.d.ts} +2 -3
- package/dist/{svg-BkRL-fZJ.d.cts → svg-DLBBPQP9.d.cts} +2 -3
- package/dist/{tools-CM8Oe8F3.d.ts → tools-AugT22z3.d.ts} +1 -1
- package/dist/{tools-DZCv2kX1.d.cts → tools-BpCmUNxb.d.cts} +1 -1
- package/dist/vector/index.cjs +923 -925
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +10 -12
- package/dist/vector/index.d.ts +10 -12
- package/dist/vector/index.js +11 -13
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.cjs +269 -271
- package/dist/video-editor/index.cjs.map +1 -1
- package/dist/video-editor/index.d.cts +6 -8
- package/dist/video-editor/index.d.ts +6 -8
- package/dist/video-editor/index.js +3 -5
- package/dist/video-editor/index.js.map +1 -1
- package/dist/{warp-CH9MM435.d.cts → warp-C13L_GRn.d.cts} +1 -1
- package/dist/{warp-k_PdtXOG.d.ts → warp-q8FK5HHi.d.ts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-canvas/SKILL.md +19 -0
- package/skills/pixerate-paint-editor/SKILL.md +40 -1
- package/dist/behavior-Ymbld6jL.d.cts +0 -60
- package/dist/behavior-Ymbld6jL.d.ts +0 -60
- package/dist/chunk-GLWZXQ4Q.js.map +0 -1
- package/dist/chunk-IOXKXQNW.cjs +0 -178
- package/dist/chunk-IOXKXQNW.cjs.map +0 -1
- package/dist/chunk-QDJKUBWE.cjs.map +0 -1
- package/dist/chunk-TGKT5QAB.js +0 -178
- package/dist/chunk-TGKT5QAB.js.map +0 -1
- package/dist/chunk-XZWOLXWA.js.map +0 -1
- package/dist/evaluate-2S3vSPLy.d.cts +0 -55
- package/dist/evaluate-CfmT6xA3.d.ts +0 -55
- package/dist/gradient-KDfCvhuj.d.cts +0 -66
- package/dist/gradient-KDfCvhuj.d.ts +0 -66
- /package/dist/{brushstrokeRender-LRV7GXGD.js.map → brushstrokeRender-7RUITO42.js.map} +0 -0
- /package/dist/{chunk-MPQAO33O.js.map → chunk-A6KHMKI4.js.map} +0 -0
- /package/dist/{chunk-WUDPFWAN.js.map → chunk-F7Q2NE2Y.js.map} +0 -0
- /package/dist/{chunk-G6WXWS4Y.js.map → chunk-FICSDDDF.js.map} +0 -0
- /package/dist/{chunk-X6KTSFAE.js.map → chunk-Q4NBEVV5.js.map} +0 -0
- /package/dist/{chunk-FPRIUR4T.js.map → chunk-ROZFX4QI.js.map} +0 -0
- /package/dist/{chunk-J67OLQUQ.js.map → chunk-UABQTYQF.js.map} +0 -0
- /package/dist/{chunk-FG274FYT.js.map → chunk-YGJIER2R.js.map} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { A as ANIMATION_EASING_LABELS, a as ANIMATION_EASING_PRESETS, b as AnimationEasing, c as AnimationEasingPreset, C as CUBIC_BEZIER_PRESETS, d as CubicBezierEasing, E as ElasticEasing, S as SPRING_PRESETS, e as SpringEasing, f as cubicBezierAt, g as easingFromInfluence, h as easingLabel, i as easingToCss, j as elasticAt, k as evaluateEasing, l as isAnimationEasing, p as parseCssEasing, r as resolveEasing, m as reverseCubicBezier, s as springAt, n as springSettleMs } from '../easing-lM0Xo9Ni.cjs';
|
|
2
|
-
export { M as MOTION_BEHAVIORS,
|
|
2
|
+
export { A as ANIMATION_TIME_EPSILON, a as AnimationKeyframe, b as AnimationLoopMode, c as AnimationTrack, d as AnimationValue, e as AnimationValueType, M as MOTION_BEHAVIORS, f as MotionBehavior, g as behaviorProgress, h as evaluateTrack, i as fractalWiggle, j as interpolateAnimationValue, k as isAnimationKeyframe, l as isMotionBehavior, m as motionSeedFromId, n as normalizeKeyframes, q as quinticFade, w as wrapAnimationTime } from '../evaluate-BsxYieLN.cjs';
|
|
3
3
|
export { O as OklabColor, f as formatOklab, m as mixColorsOklab, o as oklabToRgb, p as parseOklab, r as rgbToOklab } from '../color-E9pwm--w.cjs';
|
|
4
|
-
export { A as
|
|
5
|
-
export { A as AnimationPlayer, a as AnimationPlayerOptions, b as AnimationPlayerState, C as Clock, M as ManualClock, c as createAnimationPlayer, p as pageHidden, r as realClock } from '../player-CBtEoU2x.cjs';
|
|
4
|
+
export { A as AnimationPlayer, a as AnimationPlayerOptions, b as AnimationPlayerState, C as Clock, M as ManualClock, c as createAnimationPlayer, p as pageHidden, r as realClock } from '../player-CmbY3218.cjs';
|
|
6
5
|
export { P as PRESENCE_COLORS, a as PerformanceQueue, b as PerformanceQueueOptions, c as PresenceActor, d as PresenceActorInfo, e as PresenceClock, f as PresenceState, g as PresenceStore, h as createInstantPresenceClock, r as realPresenceClock, t as tweenPresenceCursor } from '../presence-Cb6WhcrQ.cjs';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { A as ANIMATION_EASING_LABELS, a as ANIMATION_EASING_PRESETS, b as AnimationEasing, c as AnimationEasingPreset, C as CUBIC_BEZIER_PRESETS, d as CubicBezierEasing, E as ElasticEasing, S as SPRING_PRESETS, e as SpringEasing, f as cubicBezierAt, g as easingFromInfluence, h as easingLabel, i as easingToCss, j as elasticAt, k as evaluateEasing, l as isAnimationEasing, p as parseCssEasing, r as resolveEasing, m as reverseCubicBezier, s as springAt, n as springSettleMs } from '../easing-lM0Xo9Ni.js';
|
|
2
|
-
export { M as MOTION_BEHAVIORS,
|
|
2
|
+
export { A as ANIMATION_TIME_EPSILON, a as AnimationKeyframe, b as AnimationLoopMode, c as AnimationTrack, d as AnimationValue, e as AnimationValueType, M as MOTION_BEHAVIORS, f as MotionBehavior, g as behaviorProgress, h as evaluateTrack, i as fractalWiggle, j as interpolateAnimationValue, k as isAnimationKeyframe, l as isMotionBehavior, m as motionSeedFromId, n as normalizeKeyframes, q as quinticFade, w as wrapAnimationTime } from '../evaluate-BbCeF6pt.js';
|
|
3
3
|
export { O as OklabColor, f as formatOklab, m as mixColorsOklab, o as oklabToRgb, p as parseOklab, r as rgbToOklab } from '../color-E9pwm--w.js';
|
|
4
|
-
export { A as
|
|
5
|
-
export { A as AnimationPlayer, a as AnimationPlayerOptions, b as AnimationPlayerState, C as Clock, M as ManualClock, c as createAnimationPlayer, p as pageHidden, r as realClock } from '../player-cGLrngL_.js';
|
|
4
|
+
export { A as AnimationPlayer, a as AnimationPlayerOptions, b as AnimationPlayerState, C as Clock, M as ManualClock, c as createAnimationPlayer, p as pageHidden, r as realClock } from '../player-BK2kKbfd.js';
|
|
6
5
|
export { P as PRESENCE_COLORS, a as PerformanceQueue, b as PerformanceQueueOptions, c as PresenceActor, d as PresenceActorInfo, e as PresenceClock, f as PresenceState, g as PresenceStore, h as createInstantPresenceClock, r as realPresenceClock, t as tweenPresenceCursor } from '../presence-Cb6WhcrQ.js';
|
|
@@ -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 _chunkBEGEWQHDcjs = require('../chunk-BEGEWQHD.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -31,24 +31,22 @@ var _chunkWAJQKWQUcjs = require('../chunk-WAJQKWQU.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkORE334I6cjs = require('../chunk-ORE334I6.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var _chunkQDJKUBWEcjs = require('../chunk-QDJKUBWE.cjs');
|
|
38
37
|
|
|
39
38
|
|
|
40
39
|
|
|
41
40
|
|
|
41
|
+
var _chunkBJTCSLF6cjs = require('../chunk-BJTCSLF6.cjs');
|
|
42
|
+
require('../chunk-IZ4WRXZA.cjs');
|
|
42
43
|
|
|
43
|
-
var _chunkIOXKXQNWcjs = require('../chunk-IOXKXQNW.cjs');
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
var _chunkN3FVUOZDcjs = require('../chunk-N3FVUOZD.cjs');
|
|
51
|
-
require('../chunk-GUZ47CJM.cjs');
|
|
49
|
+
var _chunkJODTP4DPcjs = require('../chunk-JODTP4DP.cjs');
|
|
52
50
|
require('../chunk-RIWPYSKU.cjs');
|
|
53
51
|
|
|
54
52
|
|
|
@@ -575,7 +573,7 @@ function smoothMotionTimes(points, start, duration, pacing = "even") {
|
|
|
575
573
|
function motionTextLayout(nodes, id) {
|
|
576
574
|
const group = _optionalChain([nodes, 'access', _5 => _5.get, 'call', _6 => _6(id), 'optionalAccess', _7 => _7.node]);
|
|
577
575
|
if (!group || group.type !== "group") return null;
|
|
578
|
-
const letters =
|
|
576
|
+
const letters = _chunkORE334I6cjs.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);
|
|
579
577
|
if (!letters.length) return null;
|
|
580
578
|
const lines = [];
|
|
581
579
|
for (const l of [...letters].sort((a, c) => a.b.y + a.b.height / 2 - (c.b.y + c.b.height / 2))) {
|
|
@@ -660,21 +658,21 @@ function indexMotionNodes(nodes) {
|
|
|
660
658
|
const out = /* @__PURE__ */ new Map();
|
|
661
659
|
const walk = (list, parentWorld, ancestors) => {
|
|
662
660
|
for (const node of list) {
|
|
663
|
-
const local =
|
|
664
|
-
const bounds =
|
|
661
|
+
const local = _chunkORE334I6cjs.vectorNodeBounds.call(void 0, node);
|
|
662
|
+
const bounds = _chunkORE334I6cjs.vectorNodeBounds.call(void 0, node, parentWorld);
|
|
665
663
|
const center = local ? { x: local.x + local.width / 2, y: local.y + local.height / 2 } : { x: 0, y: 0 };
|
|
666
664
|
if (!out.has(node.id)) out.set(node.id, { node, ancestors, parentWorld, center, bounds, box: local });
|
|
667
|
-
if (node.type === "group") walk(node.children,
|
|
665
|
+
if (node.type === "group") walk(node.children, _chunkORE334I6cjs.multiplyMatrices.call(void 0, _chunkORE334I6cjs.nodeMatrix.call(void 0, node), parentWorld), [...ancestors, node.id]);
|
|
668
666
|
}
|
|
669
667
|
};
|
|
670
|
-
walk(nodes,
|
|
668
|
+
walk(nodes, _chunkORE334I6cjs.IDENTITY_MATRIX, []);
|
|
671
669
|
indexCache.set(nodes, out);
|
|
672
670
|
return out;
|
|
673
671
|
}
|
|
674
672
|
var solid = (paint) => typeof paint === "string" && paint !== "none" ? paint : void 0;
|
|
675
673
|
function firstPaint(node, key) {
|
|
676
674
|
if (node.type === "path") return solid(node[key]);
|
|
677
|
-
for (const p of
|
|
675
|
+
for (const p of _chunkORE334I6cjs.collectPathNodes.call(void 0, node)) {
|
|
678
676
|
const s = solid(p[key]);
|
|
679
677
|
if (s) return s;
|
|
680
678
|
}
|
|
@@ -682,7 +680,7 @@ function firstPaint(node, key) {
|
|
|
682
680
|
}
|
|
683
681
|
function strokeReach(node) {
|
|
684
682
|
let reach = 0;
|
|
685
|
-
for (const p of node.type === "path" ? [node] :
|
|
683
|
+
for (const p of node.type === "path" ? [node] : _chunkORE334I6cjs.collectPathNodes.call(void 0, node)) {
|
|
686
684
|
if (p.stroke == null || p.stroke === "none") continue;
|
|
687
685
|
const width = _nullishCoalesce(p.strokeWidth, () => ( 1));
|
|
688
686
|
reach = Math.max(reach, p.strokeAlign === "outside" ? width : p.strokeAlign === "inside" ? 0 : width / 2);
|
|
@@ -752,7 +750,7 @@ function motionRestValue(entry, property, artwork) {
|
|
|
752
750
|
case "stroke":
|
|
753
751
|
return _nullishCoalesce((node && firstPaint(node, property)), () => ( "transparent"));
|
|
754
752
|
case "strokeWidth": {
|
|
755
|
-
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ?
|
|
753
|
+
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ? _chunkORE334I6cjs.collectPathNodes.call(void 0, node)[0] : void 0;
|
|
756
754
|
return _nullishCoalesce(_optionalChain([path, 'optionalAccess', _14 => _14.strokeWidth]), () => ( 1));
|
|
757
755
|
}
|
|
758
756
|
case "shape":
|
|
@@ -863,12 +861,12 @@ function resolveMotionCamera(camera, scene) {
|
|
|
863
861
|
const r = camera;
|
|
864
862
|
return { x: r.x, y: r.y, width: r.width, height: r.height };
|
|
865
863
|
}
|
|
866
|
-
function motionPathLength(node, parentWorld =
|
|
864
|
+
function motionPathLength(node, parentWorld = _chunkORE334I6cjs.IDENTITY_MATRIX) {
|
|
867
865
|
let longest = 0;
|
|
868
|
-
const paths = node.type === "path" ? [node] :
|
|
866
|
+
const paths = node.type === "path" ? [node] : _chunkORE334I6cjs.collectPathNodes.call(void 0, node);
|
|
869
867
|
for (const p of paths) {
|
|
870
868
|
try {
|
|
871
|
-
longest = Math.max(longest,
|
|
869
|
+
longest = Math.max(longest, _chunkBJTCSLF6cjs.bezierPathLength.call(void 0, _chunkORE334I6cjs.vectorPathWorldBezier.call(void 0, p, parentWorld, { effects: false })));
|
|
872
870
|
} catch (e2) {
|
|
873
871
|
}
|
|
874
872
|
}
|
|
@@ -1121,12 +1119,12 @@ function compileMotionScene(scene) {
|
|
|
1121
1119
|
const order2 = _nullishCoalesce(o.order, () => ( "together"));
|
|
1122
1120
|
const pace = _nullishCoalesce(o.pace, () => ( "time"));
|
|
1123
1121
|
if (order2 === "together" && pace === "time") return null;
|
|
1124
|
-
const paths = entry.node.type === "path" ? [entry.node] :
|
|
1122
|
+
const paths = entry.node.type === "path" ? [entry.node] : _chunkORE334I6cjs.collectPathNodes.call(void 0, entry.node);
|
|
1125
1123
|
let list = paths.map((p) => {
|
|
1126
1124
|
const at = nodes.get(p.id);
|
|
1127
1125
|
let first = { x: 0, y: 0 };
|
|
1128
1126
|
try {
|
|
1129
|
-
const m =
|
|
1127
|
+
const m = _chunkORE334I6cjs.vectorPathWorldBezier.call(void 0, p, _nullishCoalesce(_optionalChain([at, 'optionalAccess', _41 => _41.parentWorld]), () => ( _chunkORE334I6cjs.IDENTITY_MATRIX)), { effects: false })[0];
|
|
1130
1128
|
if (m && m.type === "M") first = { x: m.x, y: m.y };
|
|
1131
1129
|
} catch (e3) {
|
|
1132
1130
|
}
|
|
@@ -1238,17 +1236,17 @@ function compileMotionScene(scene) {
|
|
|
1238
1236
|
let dx = _nullishCoalesce(_optionalChain([command3, 'access', _44 => _44.by, 'optionalAccess', _45 => _45.x]), () => ( 0));
|
|
1239
1237
|
let dy = _nullishCoalesce(_optionalChain([command3, 'access', _46 => _46.by, 'optionalAccess', _47 => _47.y]), () => ( 0));
|
|
1240
1238
|
if (command3.to) {
|
|
1241
|
-
const inv =
|
|
1242
|
-
const target =
|
|
1239
|
+
const inv = _chunkORE334I6cjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1240
|
+
const target = _chunkORE334I6cjs.applyMatrix.call(void 0, inv, command3.to);
|
|
1243
1241
|
dx = target.x - (entry.center.x + num2("x"));
|
|
1244
1242
|
dy = target.y - (entry.center.y + num2("y"));
|
|
1245
1243
|
}
|
|
1246
1244
|
if (_optionalChain([command3, 'access', _48 => _48.via, 'optionalAccess', _49 => _49.length])) {
|
|
1247
|
-
const inv =
|
|
1245
|
+
const inv = _chunkORE334I6cjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1248
1246
|
const x0 = num2("x");
|
|
1249
1247
|
const y0 = num2("y");
|
|
1250
1248
|
const add = command3.blend === "add";
|
|
1251
|
-
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) =>
|
|
1249
|
+
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) => _chunkORE334I6cjs.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 }];
|
|
1252
1250
|
const times = smoothMotionTimes(offsets, start, end - start, _nullishCoalesce(command3.pacing, () => ( "even")));
|
|
1253
1251
|
for (const axis of ["x", "y"]) {
|
|
1254
1252
|
const base = add ? 0 : axis === "x" ? x0 : y0;
|
|
@@ -1391,13 +1389,13 @@ function morphBetween(a, b) {
|
|
|
1391
1389
|
let inner = morphCache.get(a);
|
|
1392
1390
|
if (!inner) morphCache.set(a, inner = /* @__PURE__ */ new WeakMap());
|
|
1393
1391
|
let morph = inner.get(b);
|
|
1394
|
-
if (!morph) inner.set(b, morph =
|
|
1392
|
+
if (!morph) inner.set(b, morph = _chunkBEGEWQHDcjs.createVectorMorph.call(void 0, a, b, { id: a.id }));
|
|
1395
1393
|
return morph;
|
|
1396
1394
|
}
|
|
1397
1395
|
function shapeIn(entry, shape) {
|
|
1398
1396
|
if (shape === entry) return entry.node;
|
|
1399
|
-
const m =
|
|
1400
|
-
return { ...shape.node, ...
|
|
1397
|
+
const m = _chunkORE334I6cjs.multiplyMatrices.call(void 0, _chunkORE334I6cjs.multiplyMatrices.call(void 0, _chunkORE334I6cjs.nodeMatrix.call(void 0, shape.node), shape.parentWorld), _chunkORE334I6cjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
1398
|
+
return { ...shape.node, ..._chunkORE334I6cjs.isIdentityMatrix.call(void 0, m) ? { transform: void 0 } : { transform: m } };
|
|
1401
1399
|
}
|
|
1402
1400
|
function shapeAt(entry, timeline, nodes, time) {
|
|
1403
1401
|
const track = timeline.tracks.get(motionTrackKey(entry.node.id, "shape"));
|
|
@@ -1417,7 +1415,7 @@ function shapeAt(entry, timeline, nodes, time) {
|
|
|
1417
1415
|
function motionFollowRoute(entry, path) {
|
|
1418
1416
|
if (!path || path.node.type !== "path") return null;
|
|
1419
1417
|
try {
|
|
1420
|
-
return
|
|
1418
|
+
return _chunkBJTCSLF6cjs.transformBezierPath.call(void 0, _chunkORE334I6cjs.vectorPathWorldBezier.call(void 0, path.node, path.parentWorld, { effects: false }), _chunkORE334I6cjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
1421
1419
|
} catch (e4) {
|
|
1422
1420
|
return null;
|
|
1423
1421
|
}
|
|
@@ -1430,7 +1428,7 @@ function followAt(entry, timeline, nodes, time) {
|
|
|
1430
1428
|
const progress = Number(trackValue(track, time));
|
|
1431
1429
|
if (!route || !(progress >= 0)) return null;
|
|
1432
1430
|
try {
|
|
1433
|
-
const at =
|
|
1431
|
+
const at = _chunkBJTCSLF6cjs.bezierPathPointAtLength.call(void 0, route, Math.min(1, Math.max(0, progress)) * _chunkBJTCSLF6cjs.bezierPathLength.call(void 0, route));
|
|
1434
1432
|
if (!at) return null;
|
|
1435
1433
|
return { x: at.point[0], y: at.point[1], angle: s.rotate ? at.angle * 180 / Math.PI : 0 };
|
|
1436
1434
|
} catch (e5) {
|
|
@@ -1451,9 +1449,9 @@ function motionNodeOffset(entry, timeline, time, nodes = indexMotionNodes([entry
|
|
|
1451
1449
|
const scaleX = read("scaleX", 1);
|
|
1452
1450
|
const scaleY = read("scaleY", 1);
|
|
1453
1451
|
const c = entry.center;
|
|
1454
|
-
let matrix =
|
|
1452
|
+
let matrix = _chunkORE334I6cjs.multiplyMatrices.call(void 0, _chunkORE334I6cjs.multiplyMatrices.call(void 0, _chunkORE334I6cjs.scaleMatrix.call(void 0, scaleX, scaleY, c), _chunkORE334I6cjs.rotateMatrix.call(void 0, rotation, c)), _chunkORE334I6cjs.translateMatrix.call(void 0, dx, dy));
|
|
1455
1453
|
const along = follow ? followAt(entry, timeline, nodes, time) : null;
|
|
1456
|
-
if (along) matrix =
|
|
1454
|
+
if (along) matrix = _chunkORE334I6cjs.multiplyMatrices.call(void 0, matrix, _chunkORE334I6cjs.multiplyMatrices.call(void 0, _chunkORE334I6cjs.multiplyMatrices.call(void 0, _chunkORE334I6cjs.translateMatrix.call(void 0, -c.x, -c.y), _chunkORE334I6cjs.rotateMatrix.call(void 0, along.angle)), _chunkORE334I6cjs.translateMatrix.call(void 0, along.x, along.y)));
|
|
1457
1455
|
return { matrix, dx, dy, rotation, scaleX, scaleY, follow: along };
|
|
1458
1456
|
}
|
|
1459
1457
|
function motionNodeClips(id, timeline, time) {
|
|
@@ -1520,7 +1518,7 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
1520
1518
|
const start = Math.min(1, Math.max(0, typeof drawStart === "number" ? drawStart : 0));
|
|
1521
1519
|
const end = Math.min(1, Math.max(0, typeof drawEnd === "number" ? drawEnd : 1));
|
|
1522
1520
|
if (start > 0 || end < 1) {
|
|
1523
|
-
const trim =
|
|
1521
|
+
const trim = _chunkORE334I6cjs.createVectorEffect.call(void 0, "trim", MOTION_DRAW_EFFECT_ID, { start: tidy(start * 100), end: tidy(end * 100) });
|
|
1524
1522
|
p = { ...p, effects: [trim, ...(_nullishCoalesce(p.effects, () => ( []))).filter((e) => e.id !== MOTION_DRAW_EFFECT_ID)] };
|
|
1525
1523
|
}
|
|
1526
1524
|
}
|
|
@@ -1534,8 +1532,8 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
1534
1532
|
if (o >= 1) delete out.opacity;
|
|
1535
1533
|
}
|
|
1536
1534
|
const offset = options.offsets === false ? null : motionNodeOffset(entry, timeline, time, nodes);
|
|
1537
|
-
if (offset && !
|
|
1538
|
-
const m =
|
|
1535
|
+
if (offset && !_chunkORE334I6cjs.isIdentityMatrix.call(void 0, offset.matrix)) {
|
|
1536
|
+
const m = _chunkORE334I6cjs.multiplyMatrices.call(void 0, _chunkORE334I6cjs.nodeMatrix.call(void 0, out), offset.matrix).map(tidy);
|
|
1539
1537
|
out = { ...out, transform: m };
|
|
1540
1538
|
}
|
|
1541
1539
|
return out;
|
|
@@ -1555,7 +1553,7 @@ function motionFrameToSvg(scene, time, options = {}) {
|
|
|
1555
1553
|
const wrap = { ...options.wrap };
|
|
1556
1554
|
for (const [id, clips] of Object.entries(frame.clips))
|
|
1557
1555
|
wrap[id] = [..._nullishCoalesce(wrap[id], () => ( [])), ...clips.map((clip, i) => ({ clip: { id: `${prefix}reveal-${id}-${i}`, shape: clip.shape, attrs: motionClipAttrs(clip) } }))];
|
|
1558
|
-
return withViewBox(
|
|
1556
|
+
return withViewBox(_chunkORE334I6cjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap }), frame.camera);
|
|
1559
1557
|
}
|
|
1560
1558
|
function withViewBox(svg, box) {
|
|
1561
1559
|
const f = (n) => String(Math.round(n * 1e3) / 1e3);
|
|
@@ -1738,8 +1736,8 @@ function visibleAt(timeline, id, time, node) {
|
|
|
1738
1736
|
if (Array.isArray(rect) && (rect[2] <= 1e-4 || rect[3] <= 1e-4)) return false;
|
|
1739
1737
|
const circle = clip("clipCircle");
|
|
1740
1738
|
if (Array.isArray(circle) && circle[2] <= 1e-4) return false;
|
|
1741
|
-
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" :
|
|
1742
|
-
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" ||
|
|
1739
|
+
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" : _chunkORE334I6cjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
|
|
1740
|
+
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunkORE334I6cjs.collectPathNodes.call(void 0, node).length === 0 || _chunkORE334I6cjs.collectPathNodes.call(void 0, node).some((p) => {
|
|
1743
1741
|
const v = trackValue(timeline.tracks.get(motionTrackKey(p.id, "drawEnd")), time);
|
|
1744
1742
|
return typeof v !== "number" || v > 0.01;
|
|
1745
1743
|
}));
|
|
@@ -1825,7 +1823,7 @@ function checkMotionScene(scene) {
|
|
|
1825
1823
|
}
|
|
1826
1824
|
for (const id of targets) {
|
|
1827
1825
|
const node = nodes.get(id).node;
|
|
1828
|
-
const paths = node.type === "path" ? [node] :
|
|
1826
|
+
const paths = node.type === "path" ? [node] : _chunkORE334I6cjs.collectPathNodes.call(void 0, node);
|
|
1829
1827
|
if (paths.some((p) => p[key] !== void 0 && p[key] !== null && typeof p[key] !== "string"))
|
|
1830
1828
|
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] }));
|
|
1831
1829
|
}
|
|
@@ -1838,7 +1836,7 @@ function checkMotionScene(scene) {
|
|
|
1838
1836
|
else
|
|
1839
1837
|
for (const id of targets) {
|
|
1840
1838
|
const node = nodes.get(id).node;
|
|
1841
|
-
const paths = node.type === "path" ? [node] :
|
|
1839
|
+
const paths = node.type === "path" ? [node] : _chunkORE334I6cjs.collectPathNodes.call(void 0, node);
|
|
1842
1840
|
if (paths.some((p) => typeof p[key] !== "string"))
|
|
1843
1841
|
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] }));
|
|
1844
1842
|
}
|
|
@@ -2386,7 +2384,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2386
2384
|
if (!route) continue;
|
|
2387
2385
|
const routeId = freshId(`${id}--follow-route`);
|
|
2388
2386
|
ids.set(seg.path, routeId);
|
|
2389
|
-
routes.push(`<path id="${routeId}" d="${
|
|
2387
|
+
routes.push(`<path id="${routeId}" d="${_chunkBJTCSLF6cjs.bezierPathToSvg.call(void 0, route, { precision })}" fill="none"/>`);
|
|
2390
2388
|
}
|
|
2391
2389
|
if (ids.size) {
|
|
2392
2390
|
const wrapper = freshId(`${id}--follow`);
|
|
@@ -2422,7 +2420,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2422
2420
|
raw: (t) => transformAt(t, true)
|
|
2423
2421
|
});
|
|
2424
2422
|
}
|
|
2425
|
-
const paths = node.type === "path" ? [node] :
|
|
2423
|
+
const paths = node.type === "path" ? [node] : _chunkORE334I6cjs.collectPathNodes.call(void 0, node);
|
|
2426
2424
|
for (const path of paths) {
|
|
2427
2425
|
if (pathsSeen.has(path.id)) continue;
|
|
2428
2426
|
pathsSeen.add(path.id);
|
|
@@ -2444,7 +2442,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2444
2442
|
if (shapeSegments.length) {
|
|
2445
2443
|
if (node.type !== "path") notes.push(`"${id}" is a group: its morph or effect animation is not exported (Flair tweens one path's "d").`);
|
|
2446
2444
|
else {
|
|
2447
|
-
const inverse =
|
|
2445
|
+
const inverse = _chunkORE334I6cjs.invertMatrix.call(void 0, _chunkORE334I6cjs.nodeMatrix.call(void 0, node));
|
|
2448
2446
|
channels.push({
|
|
2449
2447
|
id,
|
|
2450
2448
|
kind: "attr",
|
|
@@ -2453,10 +2451,10 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2453
2451
|
exact: () => false,
|
|
2454
2452
|
value: (t) => {
|
|
2455
2453
|
const frame = motionFrameAt(scene, t, { draw: false, offsets: false });
|
|
2456
|
-
const now =
|
|
2454
|
+
const now = _chunkORE334I6cjs.expandVectorAppearance.call(void 0, _optionalChain([indexMotionNodes, 'call', _108 => _108(frame.document.nodes), 'access', _109 => _109.get, 'call', _110 => _110(id), 'optionalAccess', _111 => _111.node]));
|
|
2457
2455
|
if (!now || now.type !== "path") return "";
|
|
2458
|
-
const bezier =
|
|
2459
|
-
return
|
|
2456
|
+
const bezier = _chunkBJTCSLF6cjs.transformBezierPath.call(void 0, _chunkORE334I6cjs.vectorPathWorldBezier.call(void 0, now, _chunkORE334I6cjs.IDENTITY_MATRIX, { effects: false }), inverse);
|
|
2457
|
+
return _chunkBJTCSLF6cjs.bezierPathToSvg.call(void 0, bezier, { precision: Math.min(precision, 2) });
|
|
2460
2458
|
}
|
|
2461
2459
|
});
|
|
2462
2460
|
}
|
|
@@ -2562,7 +2560,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2562
2560
|
}
|
|
2563
2561
|
if (scene.motionBlur) notes.push("Motion blur is drawn on the stage only; Flair plays the scene sharp.");
|
|
2564
2562
|
if (trigger && (_nullishCoalesce(scene.loop, () => ( "none"))) !== "none") notes.push(`The scene plays on ${trigger}, so its loop does not apply in Flair.`);
|
|
2565
|
-
let svg =
|
|
2563
|
+
let svg = _chunkORE334I6cjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunkORE334I6cjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) }, { pretty: false, precision, wrap });
|
|
2566
2564
|
if (routes.length) svg = svg.replace(/^(<svg[^>]*>)/, `$1<defs>${routes.join("")}</defs>`);
|
|
2567
2565
|
let motion = { svg, animate };
|
|
2568
2566
|
if (_optionalChain([scene, 'access', _114 => _114.controls, 'optionalAccess', _115 => _115.length])) {
|
|
@@ -2646,14 +2644,14 @@ function easingOf(ease, fallback) {
|
|
|
2646
2644
|
return fallback;
|
|
2647
2645
|
}
|
|
2648
2646
|
function poseOf(value, entry) {
|
|
2649
|
-
const t =
|
|
2650
|
-
const o =
|
|
2647
|
+
const t = _chunkORE334I6cjs.parseSvgTransform.call(void 0, String(value));
|
|
2648
|
+
const o = _chunkORE334I6cjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkORE334I6cjs.invertMatrix.call(void 0, _chunkORE334I6cjs.nodeMatrix.call(void 0, entry.node)), () => ( [1, 0, 0, 1, 0, 0])), t);
|
|
2651
2649
|
const sx = Math.hypot(o[0], o[1]);
|
|
2652
2650
|
if (!(sx > 1e-9)) return null;
|
|
2653
2651
|
const sy = (o[0] * o[3] - o[1] * o[2]) / sx;
|
|
2654
2652
|
if (Math.abs(o[2] + o[1] / sx * sy) > 1e-6 || Math.abs(o[3] - o[0] / sx * sy) > 1e-6) return null;
|
|
2655
2653
|
const c = entry.center;
|
|
2656
|
-
const moved =
|
|
2654
|
+
const moved = _chunkORE334I6cjs.applyMatrix.call(void 0, o, c);
|
|
2657
2655
|
return { dx: moved.x - c.x, dy: moved.y - c.y, rotation: Math.atan2(o[1], o[0]) * 180 / Math.PI, sx, sy };
|
|
2658
2656
|
}
|
|
2659
2657
|
var near = (a, b, eps = 1e-6) => Math.abs(a - b) < eps;
|
|
@@ -2738,7 +2736,7 @@ function fromFlairSvgMotion(input, options = {}) {
|
|
|
2738
2736
|
const notes = [];
|
|
2739
2737
|
if (!input || typeof input.svg !== "string") throw new Error('Give a Flair SvgMotion: { svg: "<svg \u2026>", animate: [ \u2026 ] }.');
|
|
2740
2738
|
const { motion, controls } = resolvePlaceholders(input, notes);
|
|
2741
|
-
const artwork =
|
|
2739
|
+
const artwork = _chunkORE334I6cjs.parseVectorSvg.call(void 0, motion.svg);
|
|
2742
2740
|
const nodes = indexMotionNodes(artwork.nodes);
|
|
2743
2741
|
const byStep = /* @__PURE__ */ new Map();
|
|
2744
2742
|
for (const anim of _nullishCoalesce(motion.animate, () => ( []))) {
|
|
@@ -2985,11 +2983,11 @@ function toLottie(scene, options = {}) {
|
|
|
2985
2983
|
const items = [];
|
|
2986
2984
|
const shapeSegments = [...timeline.tracks.entries()].filter(([k]) => k.startsWith(`${path.id}\0`) && (k.endsWith("\0shape") || k.includes("\0effect:"))).flatMap(([, v]) => v);
|
|
2987
2985
|
const geometryAt = (t) => {
|
|
2988
|
-
if (!shapeSegments.length) return
|
|
2986
|
+
if (!shapeSegments.length) return _chunkORE334I6cjs.vectorPathWorldBezier.call(void 0, path);
|
|
2989
2987
|
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]);
|
|
2990
|
-
return now && now.type === "path" ?
|
|
2988
|
+
return now && now.type === "path" ? _chunkORE334I6cjs.vectorPathWorldBezier.call(void 0, _chunkORE334I6cjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunkORE334I6cjs.vectorPathWorldBezier.call(void 0, path);
|
|
2991
2989
|
};
|
|
2992
|
-
const rest = lottieContours(
|
|
2990
|
+
const rest = lottieContours(_chunkBJTCSLF6cjs.toBezierPath.call(void 0, geometryAt(0)), round2);
|
|
2993
2991
|
rest.forEach((contour, n) => {
|
|
2994
2992
|
let ks = { a: 0, k: contour };
|
|
2995
2993
|
if (shapeSegments.length) {
|
|
@@ -2998,7 +2996,7 @@ function toLottie(scene, options = {}) {
|
|
|
2998
2996
|
const count = Math.max(1, Math.ceil(end * fps / 1e3));
|
|
2999
2997
|
for (let k = 0; k <= count && fits; k++) {
|
|
3000
2998
|
const t = end * k / count;
|
|
3001
|
-
const c = lottieContours(
|
|
2999
|
+
const c = lottieContours(_chunkBJTCSLF6cjs.toBezierPath.call(void 0, geometryAt(t)), round2)[n];
|
|
3002
3000
|
if (!c || c.v.length !== contour.v.length || c.c !== contour.c) fits = false;
|
|
3003
3001
|
else keys.push({ t: frame(t), s: [c], ...k < count ? { o: { x: [0], y: [0] }, i: { x: [1], y: [1] } } : {} });
|
|
3004
3002
|
}
|
|
@@ -3060,13 +3058,13 @@ function toLottie(scene, options = {}) {
|
|
|
3060
3058
|
const innerTr = STATIC_TR();
|
|
3061
3059
|
if (node.type === "path") inner = [...pathShapes(node)];
|
|
3062
3060
|
else if (node.type === "text" || node.type === "instance") {
|
|
3063
|
-
const drawn =
|
|
3061
|
+
const drawn = _chunkORE334I6cjs.expandVectorAppearance.call(void 0, node);
|
|
3064
3062
|
inner = drawn.type === "path" ? [...pathShapes(drawn)] : drawn.children.filter((c) => c.type === "path").reverse().flatMap((c) => [...pathShapes(c)]);
|
|
3065
|
-
notes.push(`"${node.id}": text is exported as its outlines${
|
|
3063
|
+
notes.push(`"${node.id}": text is exported as its outlines${_chunkORE334I6cjs.vectorTextHasOutlines.call(void 0, ) ? "" : " (glyph boxes: set an outline text shaper for real glyphs)"}.`);
|
|
3066
3064
|
} else {
|
|
3067
3065
|
inner = shown(node.children).reverse().map(nodeGroup);
|
|
3068
|
-
const m =
|
|
3069
|
-
if (m !==
|
|
3066
|
+
const m = _chunkORE334I6cjs.nodeMatrix.call(void 0, node);
|
|
3067
|
+
if (m !== _chunkORE334I6cjs.IDENTITY_MATRIX) {
|
|
3070
3068
|
const parts = staticParts(m);
|
|
3071
3069
|
if (!parts) notes.push(`"${node.id}": its transform skews, which is not exported; it is drawn without the skew.`);
|
|
3072
3070
|
else {
|
|
@@ -3079,7 +3077,7 @@ function toLottie(scene, options = {}) {
|
|
|
3079
3077
|
const body = { ty: "gr", nm: `${node.id} (own)`, it: [...inner, innerTr] };
|
|
3080
3078
|
return { ty: "gr", nm: _nullishCoalesce(node.name, () => ( node.id)), it: [body, poseTransform(entry)] };
|
|
3081
3079
|
};
|
|
3082
|
-
const artwork = { ...scene.artwork, nodes:
|
|
3080
|
+
const artwork = { ...scene.artwork, nodes: _chunkORE334I6cjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) };
|
|
3083
3081
|
const content = shown(artwork.nodes).reverse().map(nodeGroup);
|
|
3084
3082
|
if (artwork.background && rgba(artwork.background))
|
|
3085
3083
|
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()] });
|
|
@@ -3178,11 +3176,11 @@ function preset(prst, w, h) {
|
|
|
3178
3176
|
const poly = (pts) => [{ closed: true, anchors: pts.map(([x, y]) => ({ x, y })) }];
|
|
3179
3177
|
switch (prst) {
|
|
3180
3178
|
case "rect":
|
|
3181
|
-
return [
|
|
3179
|
+
return [_chunkORE334I6cjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3182
3180
|
case "roundRect":
|
|
3183
|
-
return [
|
|
3181
|
+
return [_chunkORE334I6cjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h }, Math.min(w, h) * 0.16667)];
|
|
3184
3182
|
case "ellipse":
|
|
3185
|
-
return [
|
|
3183
|
+
return [_chunkORE334I6cjs.ellipseSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3186
3184
|
case "triangle":
|
|
3187
3185
|
return poly([[w / 2, 0], [w, h], [0, h]]);
|
|
3188
3186
|
case "rtTriangle":
|
|
@@ -3290,7 +3288,7 @@ function shapes(ctx, tree, map) {
|
|
|
3290
3288
|
let subpaths = cust ? custom(cust, w, h) : prst ? preset(prst, w, h) : null;
|
|
3291
3289
|
if (!subpaths) {
|
|
3292
3290
|
if (prst) ctx.notes.push(`"${name}" is a ${prst}, drawn as its bounding rectangle.`);
|
|
3293
|
-
subpaths = [
|
|
3291
|
+
subpaths = [_chunkORE334I6cjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3294
3292
|
}
|
|
3295
3293
|
const style = kid(el, "style");
|
|
3296
3294
|
const fill = kid(spPr, "noFill") ? null : _nullishCoalesce(colour(ctx, kid(spPr, "solidFill")), () => ( (el.localName === "cxnSp" ? null : colour(ctx, kid(style, "fillRef")))));
|
|
@@ -3528,7 +3526,7 @@ function nextMotionEffectInstance(scene) {
|
|
|
3528
3526
|
walk(scene.artwork.nodes);
|
|
3529
3527
|
for (let i = 1; ; i++) if (!used.has(`fx${i}`)) return `fx${i}`;
|
|
3530
3528
|
}
|
|
3531
|
-
var motionArtworkSvg = (artwork) =>
|
|
3529
|
+
var motionArtworkSvg = (artwork) => _chunkORE334I6cjs.vectorDocumentToSvg.call(void 0, artwork);
|
|
3532
3530
|
var tag = (commands, source) => commands.map((c) => c.type === "wait" ? c : { ...c, source });
|
|
3533
3531
|
function motionCommandsFromEffect(artwork, motion, source) {
|
|
3534
3532
|
const imported = fromFlairSvgMotion({ svg: motionArtworkSvg(artwork), animate: [..._nullishCoalesce(motion.animate, () => ( []))] });
|
|
@@ -3595,7 +3593,7 @@ var AnimationEditorController = (_class = class {
|
|
|
3595
3593
|
|
|
3596
3594
|
|
|
3597
3595
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
3598
|
-
__init() {this.effects = new (0,
|
|
3596
|
+
__init() {this.effects = new (0, _chunkJODTP4DPcjs.EffectsSlot)()}
|
|
3599
3597
|
|
|
3600
3598
|
|
|
3601
3599
|
__init2() {this.selection = null}
|
|
@@ -3770,7 +3768,7 @@ var AnimationEditorController = (_class = class {
|
|
|
3770
3768
|
try {
|
|
3771
3769
|
plan = await work();
|
|
3772
3770
|
} catch (error) {
|
|
3773
|
-
if (
|
|
3771
|
+
if (_chunkJODTP4DPcjs.isEffectError.call(void 0, error) || error instanceof Error) return this.refuse(error.message);
|
|
3774
3772
|
throw error;
|
|
3775
3773
|
}
|
|
3776
3774
|
const r = this.apply({ op: "replace_scene", scene: plan.scene }, plan.label, { merge });
|
|
@@ -3781,11 +3779,11 @@ var AnimationEditorController = (_class = class {
|
|
|
3781
3779
|
}
|
|
3782
3780
|
async describeFor(effect, kinds) {
|
|
3783
3781
|
const provider = this.effects.require();
|
|
3784
|
-
if (!provider.applyVectorEffect) throw new (0,
|
|
3782
|
+
if (!provider.applyVectorEffect) throw new (0, _chunkJODTP4DPcjs.EffectUnsupportedError)(`${provider.name} has no vector or motion effects.`);
|
|
3785
3783
|
const d = await provider.describe(effect);
|
|
3786
3784
|
if (!kinds.includes(d.kind)) {
|
|
3787
3785
|
const hint = d.kind === "motion" ? "apply it to nodes with apply_effect" : d.kind === "vector" ? "add it with add_vector_effect" : "it draws pixels, which scenes cannot hold";
|
|
3788
|
-
throw new (0,
|
|
3786
|
+
throw new (0, _chunkJODTP4DPcjs.EffectUnsupportedError)(`"${d.id}" (${d.name}) is a ${d.kind} effect: ${hint}.`, d.id);
|
|
3789
3787
|
}
|
|
3790
3788
|
return d;
|
|
3791
3789
|
}
|
|
@@ -3806,7 +3804,7 @@ var AnimationEditorController = (_class = class {
|
|
|
3806
3804
|
return this.effectEdit(async () => {
|
|
3807
3805
|
this.knownNodes(targets);
|
|
3808
3806
|
const d = await this.describeFor(effect, ["motion"]);
|
|
3809
|
-
const values =
|
|
3807
|
+
const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
3810
3808
|
const instance = _nullishCoalesce(options.instance, () => ( nextMotionEffectInstance(this.scene)));
|
|
3811
3809
|
const motion = await this.effects.require().applyVectorEffect(d.id, { svg: motionArtworkSvg(this.scene.artwork), nodeIds: [...targets] }, values);
|
|
3812
3810
|
const source = { instance, effect: d.id, provider: this.effects.require().id, name: d.name, values };
|
|
@@ -3828,7 +3826,7 @@ var AnimationEditorController = (_class = class {
|
|
|
3828
3826
|
addVectorEffect(effect, options = {}) {
|
|
3829
3827
|
return this.effectEdit(async () => {
|
|
3830
3828
|
const d = await this.describeFor(effect, ["vector"]);
|
|
3831
|
-
const values =
|
|
3829
|
+
const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
3832
3830
|
const instance = _nullishCoalesce(options.instance, () => ( nextMotionEffectInstance(this.scene)));
|
|
3833
3831
|
const motion = await this.effects.require().applyVectorEffect(d.id, motionArtworkSvg(this.scene.artwork), values);
|
|
3834
3832
|
const source = { instance, effect: d.id, provider: this.effects.require().id, name: d.name, values };
|
|
@@ -3852,7 +3850,7 @@ var AnimationEditorController = (_class = class {
|
|
|
3852
3850
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
3853
3851
|
else throw new Error(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
3854
3852
|
}
|
|
3855
|
-
const merged = { ...base, ...
|
|
3853
|
+
const merged = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
3856
3854
|
const { scene: bare, place } = withoutMotionEffect(this.scene, instance);
|
|
3857
3855
|
const provider = this.effects.require();
|
|
3858
3856
|
const source = { instance, effect: d.id, provider: provider.id, name: d.name, values: merged };
|
|
@@ -4513,7 +4511,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
|
|
|
4513
4511
|
handler: ({ svg }) => {
|
|
4514
4512
|
let artwork;
|
|
4515
4513
|
try {
|
|
4516
|
-
artwork =
|
|
4514
|
+
artwork = _chunkORE334I6cjs.parseVectorSvg.call(void 0, svg);
|
|
4517
4515
|
} catch (error) {
|
|
4518
4516
|
throw new Error(`The SVG could not be read: ${error.message}. Nothing was changed.`);
|
|
4519
4517
|
}
|
|
@@ -5236,7 +5234,7 @@ function createAnimationEffectsToolProvider(controller, options = {}) {
|
|
|
5236
5234
|
if (!r.ok) throw new Error(r.error);
|
|
5237
5235
|
return { target, effect: info(r.effect), effects: controller.appliedEffects().filter((e) => e.targets.includes(target)).map(info), ...r.notes.length ? { notes: r.notes } : {} };
|
|
5238
5236
|
};
|
|
5239
|
-
return
|
|
5237
|
+
return _chunkJODTP4DPcjs.createEffectToolProvider.call(void 0, {
|
|
5240
5238
|
id: _nullishCoalesce(options.id, () => ( "animation-effects")),
|
|
5241
5239
|
namespace: options.namespace,
|
|
5242
5240
|
target: { noun: "node", id: "A node id of the artwork from get_animation (a group animates as one)." },
|