@pixerate/editor 0.26.1 → 0.28.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/README.md +32 -3
- package/dist/agent/index.cjs +56 -6
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +6 -4
- package/dist/agent/index.d.ts +6 -4
- package/dist/agent/index.js +51 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/animation/index.cjs +62 -0
- package/dist/animation/index.cjs.map +1 -0
- package/dist/animation/index.d.cts +296 -0
- package/dist/animation/index.d.ts +296 -0
- package/dist/animation/index.js +62 -0
- package/dist/animation/index.js.map +1 -0
- package/dist/{builtins-Chj6zv_O.d.ts → builtins-haN82vjT.d.ts} +33 -3
- package/dist/{builtins-CdPcLwwF.d.cts → builtins-nMXh9sT3.d.cts} +33 -3
- package/dist/canvas/index.cjs +535 -737
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +74 -291
- package/dist/canvas/index.d.ts +74 -291
- package/dist/canvas/index.js +417 -619
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-X7HXL2SB.js → chunk-3RPOW4CS.js} +342 -16
- package/dist/chunk-3RPOW4CS.js.map +1 -0
- package/dist/{chunk-UBCFIABU.js → chunk-5H2OPMXZ.js} +183 -6
- package/dist/chunk-5H2OPMXZ.js.map +1 -0
- package/dist/chunk-A6PHCAGX.cjs +87 -0
- package/dist/chunk-A6PHCAGX.cjs.map +1 -0
- package/dist/{chunk-HRMEDT2L.js → chunk-D6AVOTSD.js} +6 -85
- package/dist/chunk-D6AVOTSD.js.map +1 -0
- package/dist/chunk-HXDMZQTD.cjs +497 -0
- package/dist/chunk-HXDMZQTD.cjs.map +1 -0
- package/dist/chunk-IB3ZHQAX.js +497 -0
- package/dist/chunk-IB3ZHQAX.js.map +1 -0
- package/dist/{chunk-4BVP64JJ.cjs → chunk-K2UYKJ6M.cjs} +24 -103
- package/dist/chunk-K2UYKJ6M.cjs.map +1 -0
- package/dist/{chunk-HDYMLS3X.cjs → chunk-MC2LQN5S.cjs} +196 -19
- package/dist/chunk-MC2LQN5S.cjs.map +1 -0
- package/dist/{chunk-XQFHLT53.js → chunk-MXZJ4PKN.js} +24 -10
- package/dist/chunk-MXZJ4PKN.js.map +1 -0
- package/dist/{chunk-LN2POBHT.cjs → chunk-OYEFRO3D.cjs} +28 -14
- package/dist/chunk-OYEFRO3D.cjs.map +1 -0
- package/dist/chunk-PWJARCI4.js +637 -0
- package/dist/chunk-PWJARCI4.js.map +1 -0
- package/dist/chunk-TGD52FEZ.js +87 -0
- package/dist/chunk-TGD52FEZ.js.map +1 -0
- package/dist/chunk-TTYCN6ZH.cjs +637 -0
- package/dist/chunk-TTYCN6ZH.cjs.map +1 -0
- package/dist/{chunk-NQF32I6Z.cjs → chunk-U7VGDSNY.cjs} +463 -137
- package/dist/chunk-U7VGDSNY.cjs.map +1 -0
- package/dist/commands/index.cjs +30 -410
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.cts +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.js +17 -397
- package/dist/commands/index.js.map +1 -1
- package/dist/{controller-CxXGOEmy.d.ts → controller-w6eRTjF8.d.cts} +67 -2
- package/dist/{controller-CxXGOEmy.d.cts → controller-w6eRTjF8.d.ts} +67 -2
- package/dist/extensions/index.cjs +25 -7
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +1 -1
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/index.js +32 -14
- package/dist/generation/index.cjs +3 -3
- package/dist/generation/index.cjs.map +1 -1
- package/dist/generation/index.js +3 -3
- package/dist/{index-jcJwmBYt.d.cts → index-C6gaQRH0.d.cts} +53 -4
- package/dist/{index-B273Zllk.d.ts → index-DXAv_R08.d.ts} +53 -4
- package/dist/index.cjs +57 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +132 -94
- package/dist/index.js.map +1 -1
- package/dist/spreadsheet/index.cjs +23 -3
- package/dist/spreadsheet/index.cjs.map +1 -1
- package/dist/spreadsheet/index.d.cts +76 -3
- package/dist/spreadsheet/index.d.ts +76 -3
- package/dist/spreadsheet/index.js +28 -8
- package/dist/tokens/index.cjs +4 -2
- package/dist/tokens/index.cjs.map +1 -1
- package/dist/tokens/index.js +6 -4
- package/package.json +6 -1
- package/dist/chunk-4BVP64JJ.cjs.map +0 -1
- package/dist/chunk-HDYMLS3X.cjs.map +0 -1
- package/dist/chunk-HRMEDT2L.js.map +0 -1
- package/dist/chunk-LN2POBHT.cjs.map +0 -1
- package/dist/chunk-NQF32I6Z.cjs.map +0 -1
- package/dist/chunk-UBCFIABU.js.map +0 -1
- package/dist/chunk-X7HXL2SB.js.map +0 -1
- package/dist/chunk-XQFHLT53.js.map +0 -1
package/dist/canvas/index.cjs
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunkWADCJ7A7cjs = require('../chunk-WADCJ7A7.cjs');
|
|
16
|
+
|
|
2
17
|
|
|
3
18
|
|
|
4
19
|
var _chunk26BVFKHUcjs = require('../chunk-26BVFKHU.cjs');
|
|
@@ -8,10 +23,17 @@ var _chunk26BVFKHUcjs = require('../chunk-26BVFKHU.cjs');
|
|
|
8
23
|
|
|
9
24
|
|
|
10
25
|
|
|
26
|
+
var _chunkK2UYKJ6Mcjs = require('../chunk-K2UYKJ6M.cjs');
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
11
34
|
|
|
12
35
|
|
|
13
36
|
|
|
14
|
-
var _chunk4BVP64JJcjs = require('../chunk-4BVP64JJ.cjs');
|
|
15
37
|
|
|
16
38
|
|
|
17
39
|
|
|
@@ -26,80 +48,15 @@ var _chunk4BVP64JJcjs = require('../chunk-4BVP64JJ.cjs');
|
|
|
26
48
|
|
|
27
49
|
|
|
28
50
|
|
|
29
|
-
var _chunkWADCJ7A7cjs = require('../chunk-WADCJ7A7.cjs');
|
|
30
51
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} else {
|
|
40
|
-
setTimeout(resolve, 16);
|
|
41
|
-
}
|
|
42
|
-
}),
|
|
43
|
-
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)))
|
|
44
|
-
};
|
|
45
|
-
var settle = () => new Promise((resolve) => setTimeout(resolve, 0));
|
|
46
|
-
var ManualClock = (_class = class {
|
|
47
|
-
__init() {this.live = false}
|
|
48
|
-
|
|
49
|
-
__init2() {this.frames = []}
|
|
50
|
-
__init3() {this.sleepers = []}
|
|
51
|
-
__init4() {this.seq = 0}
|
|
52
|
-
constructor(start = 0) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);
|
|
53
|
-
this.time = start;
|
|
54
|
-
}
|
|
55
|
-
now() {
|
|
56
|
-
return this.time;
|
|
57
|
-
}
|
|
58
|
-
frame() {
|
|
59
|
-
return new Promise((resolve) => this.frames.push(resolve));
|
|
60
|
-
}
|
|
61
|
-
sleep(ms) {
|
|
62
|
-
return new Promise(
|
|
63
|
-
(resolve) => this.sleepers.push({
|
|
64
|
-
at: this.time + Math.max(0, ms),
|
|
65
|
-
seq: this.seq++,
|
|
66
|
-
resolve
|
|
67
|
-
})
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
/** Whether any frames or sleep timers are currently pending. */
|
|
71
|
-
get pending() {
|
|
72
|
-
return this.frames.length > 0 || this.sleepers.length > 0;
|
|
73
|
-
}
|
|
74
|
-
/** Advances time by `ms`, resolving due sleep timers in order, followed by queued frames. */
|
|
75
|
-
async advance(ms) {
|
|
76
|
-
const end = this.time + Math.max(0, ms);
|
|
77
|
-
await settle();
|
|
78
|
-
while (true) {
|
|
79
|
-
let next;
|
|
80
|
-
for (const s of this.sleepers) {
|
|
81
|
-
if (s.at <= end && (!next || s.at < next.at || s.at === next.at && s.seq < next.seq)) {
|
|
82
|
-
next = s;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (!next) break;
|
|
86
|
-
this.sleepers.splice(this.sleepers.indexOf(next), 1);
|
|
87
|
-
this.time = Math.max(this.time, next.at);
|
|
88
|
-
next.resolve();
|
|
89
|
-
await settle();
|
|
90
|
-
}
|
|
91
|
-
this.time = end;
|
|
92
|
-
const dueFrames = this.frames.splice(0, this.frames.length);
|
|
93
|
-
for (const resolveFrame of dueFrames) {
|
|
94
|
-
resolveFrame();
|
|
95
|
-
}
|
|
96
|
-
await settle();
|
|
97
|
-
}
|
|
98
|
-
/** Convenience method to advance by 1 frame at a given fps (default: 60fps = 16.67ms). */
|
|
99
|
-
async tick(fps = 60) {
|
|
100
|
-
await this.advance(Math.round(1e3 / fps));
|
|
101
|
-
}
|
|
102
|
-
}, _class);
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
var _chunkTTYCN6ZHcjs = require('../chunk-TTYCN6ZH.cjs');
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
var _chunkA6PHCAGXcjs = require('../chunk-A6PHCAGX.cjs');
|
|
103
60
|
|
|
104
61
|
// src/canvas/trajectory.ts
|
|
105
62
|
var defaultEasing = (t) => --t * t * t + 1;
|
|
@@ -181,7 +138,7 @@ function runMultiNodeTransition(transitions, options = {}) {
|
|
|
181
138
|
const {
|
|
182
139
|
defaultDuration = 400,
|
|
183
140
|
defaultEasing: easingFunc = defaultEasing,
|
|
184
|
-
clock = realClock,
|
|
141
|
+
clock = _chunkTTYCN6ZHcjs.realClock,
|
|
185
142
|
styleFormat = "string",
|
|
186
143
|
onUpdate,
|
|
187
144
|
onComplete
|
|
@@ -601,23 +558,23 @@ function connectedOnly(nodes, edges) {
|
|
|
601
558
|
}
|
|
602
559
|
|
|
603
560
|
// src/canvas/streaming.ts
|
|
604
|
-
var StreamingLayoutManager = (
|
|
561
|
+
var StreamingLayoutManager = (_class = class {
|
|
605
562
|
|
|
606
563
|
|
|
607
564
|
|
|
608
565
|
|
|
609
566
|
|
|
610
567
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
constructor(options = {}) {;
|
|
568
|
+
__init() {this.pendingTimer = null}
|
|
569
|
+
__init2() {this.pendingArgs = null}
|
|
570
|
+
__init3() {this.activeTransitionCancel = null}
|
|
571
|
+
__init4() {this.targetPositions = /* @__PURE__ */ new Map()}
|
|
572
|
+
__init5() {this.livePositions = /* @__PURE__ */ new Map()}
|
|
573
|
+
constructor(options = {}) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);
|
|
617
574
|
this.throttleMs = _nullishCoalesce(options.throttleMs, () => ( 200));
|
|
618
575
|
this.glideDurationMs = _nullishCoalesce(options.glideDurationMs, () => ( 300));
|
|
619
576
|
this.connectedOnly = _nullishCoalesce(options.connectedOnly, () => ( false));
|
|
620
|
-
this.clock = _nullishCoalesce(options.clock, () => ( realClock));
|
|
577
|
+
this.clock = _nullishCoalesce(options.clock, () => ( _chunkTTYCN6ZHcjs.realClock));
|
|
621
578
|
this.layoutOptions = _nullishCoalesce(options.layoutOptions, () => ( { direction: "LR" }));
|
|
622
579
|
this.onLayoutUpdated = options.onLayoutUpdated;
|
|
623
580
|
}
|
|
@@ -732,7 +689,7 @@ var StreamingLayoutManager = (_class2 = class {
|
|
|
732
689
|
this.activeTransitionCancel = null;
|
|
733
690
|
}
|
|
734
691
|
}
|
|
735
|
-
},
|
|
692
|
+
}, _class);
|
|
736
693
|
|
|
737
694
|
// src/canvas/arrange.ts
|
|
738
695
|
var LOCKED_DATA_KEY = "locked";
|
|
@@ -1498,15 +1455,15 @@ function parseCanvasScenes(input) {
|
|
|
1498
1455
|
}
|
|
1499
1456
|
return scenes;
|
|
1500
1457
|
}
|
|
1501
|
-
var CanvasScenesStore = (
|
|
1458
|
+
var CanvasScenesStore = (_class2 = class {
|
|
1502
1459
|
|
|
1503
|
-
|
|
1460
|
+
__init6() {this.currentId = null}
|
|
1504
1461
|
|
|
1505
|
-
|
|
1462
|
+
__init7() {this.listeners = /* @__PURE__ */ new Set()}
|
|
1506
1463
|
|
|
1507
1464
|
|
|
1508
1465
|
|
|
1509
|
-
constructor(options = {}) {;
|
|
1466
|
+
constructor(options = {}) {;_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);
|
|
1510
1467
|
this.scenes = parseCanvasScenes(_nullishCoalesce(options.initialScenes, () => ( [])));
|
|
1511
1468
|
this.createId = _nullishCoalesce(options.createId, () => ( defaultId));
|
|
1512
1469
|
this.wrap = _nullishCoalesce(options.wrap, () => ( false));
|
|
@@ -1660,7 +1617,7 @@ var CanvasScenesStore = (_class3 = class {
|
|
|
1660
1617
|
this.currentId = null;
|
|
1661
1618
|
this.commit(parseCanvasScenes(input));
|
|
1662
1619
|
}
|
|
1663
|
-
},
|
|
1620
|
+
}, _class2);
|
|
1664
1621
|
function createCanvasScenesStore(options) {
|
|
1665
1622
|
return new CanvasScenesStore(options);
|
|
1666
1623
|
}
|
|
@@ -1785,13 +1742,13 @@ function normalizeInput(input) {
|
|
|
1785
1742
|
}
|
|
1786
1743
|
return { rings, fillRule: "nonzero" };
|
|
1787
1744
|
}
|
|
1788
|
-
var PointPool = (
|
|
1789
|
-
constructor(eps) {;
|
|
1745
|
+
var PointPool = (_class3 = class {
|
|
1746
|
+
constructor(eps) {;_class3.prototype.__init8.call(this);_class3.prototype.__init9.call(this);
|
|
1790
1747
|
this.eps = eps;
|
|
1791
1748
|
}
|
|
1792
1749
|
|
|
1793
|
-
|
|
1794
|
-
|
|
1750
|
+
__init8() {this.vertices = []}
|
|
1751
|
+
__init9() {this.cells = /* @__PURE__ */ new Map()}
|
|
1795
1752
|
get(x, y) {
|
|
1796
1753
|
const cx = Math.floor(x / this.eps);
|
|
1797
1754
|
const cy = Math.floor(y / this.eps);
|
|
@@ -1820,7 +1777,7 @@ var PointPool = (_class4 = class {
|
|
|
1820
1777
|
else this.cells.set(key, [vertex.id]);
|
|
1821
1778
|
return vertex;
|
|
1822
1779
|
}
|
|
1823
|
-
},
|
|
1780
|
+
}, _class3);
|
|
1824
1781
|
function project(a, b, p) {
|
|
1825
1782
|
const dx = b.x - a.x;
|
|
1826
1783
|
const dy = b.y - a.y;
|
|
@@ -2277,7 +2234,7 @@ function fitSingleFrom(pts, u, t0, t1) {
|
|
|
2277
2234
|
let best = generate(pts, u, t0, t1);
|
|
2278
2235
|
let [bestErr, bestSplit] = maxError(pts, best, u);
|
|
2279
2236
|
const params = u.slice();
|
|
2280
|
-
for (let
|
|
2237
|
+
for (let round2 = 0; round2 < MAX_REPARAM; round2++) {
|
|
2281
2238
|
for (let i = 0; i < params.length; i++) params[i] = newton(best, pts[i], params[i]);
|
|
2282
2239
|
const c = generate(pts, params, t0, t1);
|
|
2283
2240
|
const [e, s] = maxError(pts, c, params);
|
|
@@ -2501,12 +2458,12 @@ function isShapeDescription(value) {
|
|
|
2501
2458
|
return kind !== "path" || typeof value.d === "string";
|
|
2502
2459
|
}
|
|
2503
2460
|
var PARAM_COUNTS = { m: 2, l: 2, h: 1, v: 1, c: 6, s: 4, q: 4, t: 2, a: 7, z: 0 };
|
|
2504
|
-
var PathScanner = (
|
|
2505
|
-
constructor(text) {;
|
|
2461
|
+
var PathScanner = (_class4 = class {
|
|
2462
|
+
constructor(text) {;_class4.prototype.__init10.call(this);
|
|
2506
2463
|
this.text = text;
|
|
2507
2464
|
}
|
|
2508
2465
|
|
|
2509
|
-
|
|
2466
|
+
__init10() {this.pos = 0}
|
|
2510
2467
|
skip() {
|
|
2511
2468
|
while (this.pos < this.text.length && /[\s,]/.test(this.text[this.pos])) this.pos++;
|
|
2512
2469
|
}
|
|
@@ -2541,7 +2498,7 @@ var PathScanner = (_class5 = class {
|
|
|
2541
2498
|
}
|
|
2542
2499
|
return null;
|
|
2543
2500
|
}
|
|
2544
|
-
},
|
|
2501
|
+
}, _class4);
|
|
2545
2502
|
function parseSvgPath(d) {
|
|
2546
2503
|
const scanner = new PathScanner(_nullishCoalesce(d, () => ( "")));
|
|
2547
2504
|
const commands = [];
|
|
@@ -3849,13 +3806,13 @@ function scaleOf(operands) {
|
|
|
3849
3806
|
}
|
|
3850
3807
|
return Math.max(1, max);
|
|
3851
3808
|
}
|
|
3852
|
-
var VertexPool = (
|
|
3853
|
-
constructor(eps) {;
|
|
3809
|
+
var VertexPool = (_class5 = class {
|
|
3810
|
+
constructor(eps) {;_class5.prototype.__init11.call(this);_class5.prototype.__init12.call(this);
|
|
3854
3811
|
this.eps = eps;
|
|
3855
3812
|
}
|
|
3856
3813
|
|
|
3857
|
-
|
|
3858
|
-
|
|
3814
|
+
__init11() {this.vertices = []}
|
|
3815
|
+
__init12() {this.cells = /* @__PURE__ */ new Map()}
|
|
3859
3816
|
get(x, y) {
|
|
3860
3817
|
const cx = Math.floor(x / this.eps);
|
|
3861
3818
|
const cy = Math.floor(y / this.eps);
|
|
@@ -3884,7 +3841,7 @@ var VertexPool = (_class6 = class {
|
|
|
3884
3841
|
else this.cells.set(key, [vertex.id]);
|
|
3885
3842
|
return vertex;
|
|
3886
3843
|
}
|
|
3887
|
-
},
|
|
3844
|
+
}, _class5);
|
|
3888
3845
|
function hull(pts) {
|
|
3889
3846
|
let minX = Infinity;
|
|
3890
3847
|
let maxX = -Infinity;
|
|
@@ -5729,12 +5686,12 @@ function resolvePadding(padding) {
|
|
|
5729
5686
|
else sides = [0, 0, 0, 0];
|
|
5730
5687
|
return sides.map((p) => Math.max(finite(p), 0));
|
|
5731
5688
|
}
|
|
5732
|
-
var LayoutState = (
|
|
5733
|
-
|
|
5689
|
+
var LayoutState = (_class6 = class {
|
|
5690
|
+
__init13() {this.boxes = /* @__PURE__ */ new Map()}
|
|
5734
5691
|
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
constructor(nodes, options = {}) {;
|
|
5692
|
+
__init14() {this.visiting = /* @__PURE__ */ new Set()}
|
|
5693
|
+
__init15() {this.original = /* @__PURE__ */ new Map()}
|
|
5694
|
+
constructor(nodes, options = {}) {;_class6.prototype.__init13.call(this);_class6.prototype.__init14.call(this);_class6.prototype.__init15.call(this);
|
|
5738
5695
|
this.measure = _nullishCoalesce(options.measure, () => ( {}));
|
|
5739
5696
|
for (const node of nodes) {
|
|
5740
5697
|
const size = _nullishCoalesce(_optionalChain([this, 'access', _108 => _108.measure, 'access', _109 => _109.size, 'optionalCall', _110 => _110(node)]), () => ( getNodeSize(node, options.rectOptions)));
|
|
@@ -5788,7 +5745,7 @@ var LayoutState = (_class7 = class {
|
|
|
5788
5745
|
}
|
|
5789
5746
|
return out;
|
|
5790
5747
|
}
|
|
5791
|
-
},
|
|
5748
|
+
}, _class6);
|
|
5792
5749
|
function setSize(s, id, w, h) {
|
|
5793
5750
|
const b = s.boxes.get(id);
|
|
5794
5751
|
if (!b) return;
|
|
@@ -7666,7 +7623,7 @@ function getTokenPropertyScope(property, node) {
|
|
|
7666
7623
|
}
|
|
7667
7624
|
function getTokensForProperty(state, property, node) {
|
|
7668
7625
|
const scope = getTokenPropertyScope(property, node);
|
|
7669
|
-
return state.variables.filter((v) => v.type === property.type &&
|
|
7626
|
+
return state.variables.filter((v) => v.type === property.type && _chunkK2UYKJ6Mcjs.isTokenInScope.call(void 0, v, scope));
|
|
7670
7627
|
}
|
|
7671
7628
|
function lookupOf(nodes) {
|
|
7672
7629
|
return new Map(nodes.map((n) => [n.id, n]));
|
|
@@ -7674,7 +7631,7 @@ function lookupOf(nodes) {
|
|
|
7674
7631
|
function validModes(state, modes, into) {
|
|
7675
7632
|
for (const [collectionId, modeId] of Object.entries(modes)) {
|
|
7676
7633
|
if (state) {
|
|
7677
|
-
const collection =
|
|
7634
|
+
const collection = _chunkK2UYKJ6Mcjs.getTokenCollection.call(void 0, state, collectionId);
|
|
7678
7635
|
if (!collection || !collection.modes.some((m) => m.id === modeId)) continue;
|
|
7679
7636
|
}
|
|
7680
7637
|
into[collectionId] = modeId;
|
|
@@ -7729,7 +7686,7 @@ function applyBindings(node, state, modes, options, only) {
|
|
|
7729
7686
|
if (only && !only.has(variableId)) continue;
|
|
7730
7687
|
const property = getCanvasTokenProperty(key, options);
|
|
7731
7688
|
if (!property || !property.appliesTo(next)) continue;
|
|
7732
|
-
const resolved =
|
|
7689
|
+
const resolved = _chunkK2UYKJ6Mcjs.resolveToken.call(void 0, state, variableId, modes);
|
|
7733
7690
|
if (!resolved.ok || resolved.type !== property.type) continue;
|
|
7734
7691
|
next = property.write(next, resolved.value);
|
|
7735
7692
|
}
|
|
@@ -7752,7 +7709,7 @@ function inspectNodeTokens(node, nodes, state, options = {}) {
|
|
|
7752
7709
|
for (const [key, variableId] of Object.entries(getNodeTokenBindings(node))) {
|
|
7753
7710
|
const property = getCanvasTokenProperty(key, options);
|
|
7754
7711
|
if (!property) continue;
|
|
7755
|
-
out.push({ property, variableId, variable:
|
|
7712
|
+
out.push({ property, variableId, variable: _chunkK2UYKJ6Mcjs.getTokenVariable.call(void 0, state, variableId), resolution: _chunkK2UYKJ6Mcjs.resolveToken.call(void 0, state, variableId, modes) });
|
|
7756
7713
|
}
|
|
7757
7714
|
return out;
|
|
7758
7715
|
}
|
|
@@ -7764,12 +7721,12 @@ function setDataRecord(node, key, record) {
|
|
|
7764
7721
|
}
|
|
7765
7722
|
function bindCanvasToken(nodes, ids, propertyKey, variableId, state, options = {}) {
|
|
7766
7723
|
const property = getCanvasTokenProperty(propertyKey, options);
|
|
7767
|
-
if (!property) throw new (0,
|
|
7724
|
+
if (!property) throw new (0, _chunkK2UYKJ6Mcjs.TokenError)("not-found", `No bindable property \`${propertyKey}\``);
|
|
7768
7725
|
if (variableId !== null) {
|
|
7769
|
-
const variable =
|
|
7770
|
-
if (!variable) throw new (0,
|
|
7726
|
+
const variable = _chunkK2UYKJ6Mcjs.getTokenVariable.call(void 0, state, variableId);
|
|
7727
|
+
if (!variable) throw new (0, _chunkK2UYKJ6Mcjs.TokenError)("not-found", `No variable \`${variableId}\``);
|
|
7771
7728
|
if (variable.type !== property.type) {
|
|
7772
|
-
throw new (0,
|
|
7729
|
+
throw new (0, _chunkK2UYKJ6Mcjs.TokenError)("type-mismatch", `${property.label} takes a ${property.type} variable; \`${variable.name}\` is a ${variable.type}`);
|
|
7773
7730
|
}
|
|
7774
7731
|
}
|
|
7775
7732
|
const targets = new Set(ids);
|
|
@@ -7791,9 +7748,9 @@ function bindCanvasToken(nodes, ids, propertyKey, variableId, state, options = {
|
|
|
7791
7748
|
}
|
|
7792
7749
|
function setCanvasTokenMode(nodes, ids, collectionId, modeId, state, options = {}) {
|
|
7793
7750
|
if (modeId !== null) {
|
|
7794
|
-
const collection =
|
|
7795
|
-
if (!collection) throw new (0,
|
|
7796
|
-
if (!collection.modes.some((m) => m.id === modeId)) throw new (0,
|
|
7751
|
+
const collection = _chunkK2UYKJ6Mcjs.getTokenCollection.call(void 0, state, collectionId);
|
|
7752
|
+
if (!collection) throw new (0, _chunkK2UYKJ6Mcjs.TokenError)("not-found", `No collection \`${collectionId}\``);
|
|
7753
|
+
if (!collection.modes.some((m) => m.id === modeId)) throw new (0, _chunkK2UYKJ6Mcjs.TokenError)("not-found", `No mode \`${modeId}\` in \`${collection.name}\``);
|
|
7797
7754
|
}
|
|
7798
7755
|
const targets = new Set(ids);
|
|
7799
7756
|
let changed = false;
|
|
@@ -7814,7 +7771,7 @@ function setCanvasTokenMode(nodes, ids, collectionId, modeId, state, options = {
|
|
|
7814
7771
|
}
|
|
7815
7772
|
function detachTokenBindings(nodes, state, variableIds, options = {}) {
|
|
7816
7773
|
const only = variableIds ? new Set(variableIds) : null;
|
|
7817
|
-
const isDetached = (id) => only ? only.has(id) : !
|
|
7774
|
+
const isDetached = (id) => only ? only.has(id) : !_chunkK2UYKJ6Mcjs.getTokenVariable.call(void 0, state, id);
|
|
7818
7775
|
const { modesOf } = modesResolver(nodes, state, options);
|
|
7819
7776
|
let changed = false;
|
|
7820
7777
|
const out = nodes.map((node) => {
|
|
@@ -7843,244 +7800,8 @@ function pruneCanvasTokenModes(nodes, state) {
|
|
|
7843
7800
|
return changed ? out : nodes;
|
|
7844
7801
|
}
|
|
7845
7802
|
|
|
7846
|
-
// src/canvas/animation/easing.ts
|
|
7847
|
-
var ANIMATION_EASING_PRESETS = [
|
|
7848
|
-
"linear",
|
|
7849
|
-
"ease",
|
|
7850
|
-
"ease-in",
|
|
7851
|
-
"ease-out",
|
|
7852
|
-
"ease-in-out",
|
|
7853
|
-
"ease-in-back",
|
|
7854
|
-
"ease-out-back",
|
|
7855
|
-
"spring",
|
|
7856
|
-
"hold"
|
|
7857
|
-
];
|
|
7858
|
-
var ANIMATION_EASING_LABELS = {
|
|
7859
|
-
linear: "Linear",
|
|
7860
|
-
hold: "Hold",
|
|
7861
|
-
ease: "Ease",
|
|
7862
|
-
"ease-in": "Ease in",
|
|
7863
|
-
"ease-out": "Ease out",
|
|
7864
|
-
"ease-in-out": "Ease in-out",
|
|
7865
|
-
"ease-in-back": "Back in",
|
|
7866
|
-
"ease-out-back": "Back out",
|
|
7867
|
-
spring: "Spring"
|
|
7868
|
-
};
|
|
7869
|
-
var CUBIC_BEZIER_PRESETS = {
|
|
7870
|
-
linear: [0, 0, 1, 1],
|
|
7871
|
-
ease: [0.25, 0.1, 0.25, 1],
|
|
7872
|
-
"ease-in": [0.42, 0, 1, 1],
|
|
7873
|
-
"ease-out": [0, 0, 0.58, 1],
|
|
7874
|
-
"ease-in-out": [0.42, 0, 0.58, 1],
|
|
7875
|
-
"ease-in-back": [0.36, 0, 0.66, -0.56],
|
|
7876
|
-
"ease-out-back": [0.34, 1.56, 0.64, 1]
|
|
7877
|
-
};
|
|
7878
|
-
var DEFAULT_SPRING = { stiffness: 170, damping: 26, mass: 1, velocity: 0 };
|
|
7879
|
-
var clamp = (v, lo, hi) => Math.min(hi, Math.max(lo, v));
|
|
7880
|
-
var finite2 = (v, fallback) => typeof v === "number" && Number.isFinite(v) ? v : fallback;
|
|
7881
|
-
function cubicBezierAt(x1, y1, x2, y2, x) {
|
|
7882
|
-
if (x <= 0) return 0;
|
|
7883
|
-
if (x >= 1) return 1;
|
|
7884
|
-
x1 = clamp(x1, 0, 1);
|
|
7885
|
-
x2 = clamp(x2, 0, 1);
|
|
7886
|
-
const bx = (s2) => 3 * (1 - s2) * (1 - s2) * s2 * x1 + 3 * (1 - s2) * s2 * s2 * x2 + s2 * s2 * s2;
|
|
7887
|
-
const by = (s2) => 3 * (1 - s2) * (1 - s2) * s2 * y1 + 3 * (1 - s2) * s2 * s2 * y2 + s2 * s2 * s2;
|
|
7888
|
-
const dbx = (s2) => 3 * (1 - s2) * (1 - s2) * x1 + 6 * (1 - s2) * s2 * (x2 - x1) + 3 * s2 * s2 * (1 - x2);
|
|
7889
|
-
let s = x;
|
|
7890
|
-
for (let i = 0; i < 8; i++) {
|
|
7891
|
-
const d = dbx(s);
|
|
7892
|
-
if (Math.abs(d) < 1e-9) break;
|
|
7893
|
-
const next = s - (bx(s) - x) / d;
|
|
7894
|
-
if (!(next >= 0 && next <= 1)) break;
|
|
7895
|
-
s = next;
|
|
7896
|
-
}
|
|
7897
|
-
if (Math.abs(bx(s) - x) > 1e-7) {
|
|
7898
|
-
let lo = 0;
|
|
7899
|
-
let hi = 1;
|
|
7900
|
-
for (let i = 0; i < 60; i++) {
|
|
7901
|
-
s = (lo + hi) / 2;
|
|
7902
|
-
if (bx(s) < x) lo = s;
|
|
7903
|
-
else hi = s;
|
|
7904
|
-
}
|
|
7905
|
-
}
|
|
7906
|
-
return by(s);
|
|
7907
|
-
}
|
|
7908
|
-
function springAt(spring, seconds) {
|
|
7909
|
-
const stiffness = Math.max(1e-6, finite2(spring.stiffness, DEFAULT_SPRING.stiffness));
|
|
7910
|
-
const damping = Math.max(0, finite2(spring.damping, DEFAULT_SPRING.damping));
|
|
7911
|
-
const mass = Math.max(1e-6, finite2(spring.mass, DEFAULT_SPRING.mass));
|
|
7912
|
-
const v0 = -finite2(spring.velocity, DEFAULT_SPRING.velocity);
|
|
7913
|
-
const t = Math.max(0, seconds);
|
|
7914
|
-
const w0 = Math.sqrt(stiffness / mass);
|
|
7915
|
-
const zeta = damping / (2 * Math.sqrt(stiffness * mass));
|
|
7916
|
-
let x;
|
|
7917
|
-
if (zeta < 1 - 1e-6) {
|
|
7918
|
-
const wd = w0 * Math.sqrt(1 - zeta * zeta);
|
|
7919
|
-
x = Math.exp(-zeta * w0 * t) * (Math.cos(wd * t) + (zeta * w0 + v0) / wd * Math.sin(wd * t));
|
|
7920
|
-
} else if (zeta <= 1 + 1e-6) {
|
|
7921
|
-
x = Math.exp(-w0 * t) * (1 + (w0 + v0) * t);
|
|
7922
|
-
} else {
|
|
7923
|
-
const r = Math.sqrt(zeta * zeta - 1);
|
|
7924
|
-
const s1 = -w0 * (zeta - r);
|
|
7925
|
-
const s2 = -w0 * (zeta + r);
|
|
7926
|
-
const c2 = (v0 - s1) / (s2 - s1);
|
|
7927
|
-
const c1 = 1 - c2;
|
|
7928
|
-
x = c1 * Math.exp(s1 * t) + c2 * Math.exp(s2 * t);
|
|
7929
|
-
}
|
|
7930
|
-
return 1 - x;
|
|
7931
|
-
}
|
|
7932
|
-
function resolveEasing(easing) {
|
|
7933
|
-
if (easing === "hold") return "hold";
|
|
7934
|
-
if (easing === "spring") return { type: "spring", ...DEFAULT_SPRING };
|
|
7935
|
-
if (typeof easing === "string") {
|
|
7936
|
-
const preset = CUBIC_BEZIER_PRESETS[easing];
|
|
7937
|
-
if (preset) return { type: "cubic-bezier", x1: preset[0], y1: preset[1], x2: preset[2], y2: preset[3] };
|
|
7938
|
-
const parsed = parseCssEasing(easing);
|
|
7939
|
-
return parsed ? resolveEasing(parsed) : { type: "cubic-bezier", x1: 0, y1: 0, x2: 1, y2: 1 };
|
|
7940
|
-
}
|
|
7941
|
-
if (easing && typeof easing === "object") {
|
|
7942
|
-
if (easing.type === "spring") {
|
|
7943
|
-
return {
|
|
7944
|
-
type: "spring",
|
|
7945
|
-
stiffness: finite2(easing.stiffness, DEFAULT_SPRING.stiffness),
|
|
7946
|
-
damping: finite2(easing.damping, DEFAULT_SPRING.damping),
|
|
7947
|
-
mass: finite2(easing.mass, DEFAULT_SPRING.mass),
|
|
7948
|
-
velocity: finite2(easing.velocity, DEFAULT_SPRING.velocity)
|
|
7949
|
-
};
|
|
7950
|
-
}
|
|
7951
|
-
if (easing.type === "cubic-bezier") {
|
|
7952
|
-
return {
|
|
7953
|
-
type: "cubic-bezier",
|
|
7954
|
-
x1: clamp(finite2(easing.x1, 0), 0, 1),
|
|
7955
|
-
y1: finite2(easing.y1, 0),
|
|
7956
|
-
x2: clamp(finite2(easing.x2, 1), 0, 1),
|
|
7957
|
-
y2: finite2(easing.y2, 1)
|
|
7958
|
-
};
|
|
7959
|
-
}
|
|
7960
|
-
}
|
|
7961
|
-
return { type: "cubic-bezier", x1: 0, y1: 0, x2: 1, y2: 1 };
|
|
7962
|
-
}
|
|
7963
|
-
function evaluateEasing(easing, u, durationMs = 1e3) {
|
|
7964
|
-
if (!(u > 0)) return 0;
|
|
7965
|
-
if (u >= 1) return 1;
|
|
7966
|
-
const resolved = resolveEasing(easing);
|
|
7967
|
-
if (resolved === "hold") return 0;
|
|
7968
|
-
if (resolved.type === "spring") return springAt(resolved, u * Math.max(0, durationMs) / 1e3);
|
|
7969
|
-
const { x1, y1, x2, y2 } = resolved;
|
|
7970
|
-
if (x1 === y1 && x2 === y2) return u;
|
|
7971
|
-
return cubicBezierAt(x1, y1, x2, y2, u);
|
|
7972
|
-
}
|
|
7973
|
-
function easingFromInfluence(outInfluence = 1 / 3, inInfluence = 1 / 3) {
|
|
7974
|
-
return {
|
|
7975
|
-
type: "cubic-bezier",
|
|
7976
|
-
x1: clamp(outInfluence, 0.01, 1),
|
|
7977
|
-
y1: 0,
|
|
7978
|
-
x2: 1 - clamp(inInfluence, 0.01, 1),
|
|
7979
|
-
y2: 1
|
|
7980
|
-
};
|
|
7981
|
-
}
|
|
7982
|
-
var NUMBER = String.raw`\s*(-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)\s*`;
|
|
7983
|
-
var CUBIC_RE = new RegExp(`^cubic-bezier\\(${NUMBER},${NUMBER},${NUMBER},${NUMBER}\\)$`, "i");
|
|
7984
|
-
function parseCssEasing(text) {
|
|
7985
|
-
const value = text.trim().toLowerCase();
|
|
7986
|
-
if (value.length > 200) return null;
|
|
7987
|
-
if (ANIMATION_EASING_PRESETS.includes(value)) return value;
|
|
7988
|
-
if (value === "step-end" || /^steps\(\s*1\s*(,\s*(end|jump-end)\s*)?\)$/.test(value)) return "hold";
|
|
7989
|
-
const m = CUBIC_RE.exec(value);
|
|
7990
|
-
if (!m) return null;
|
|
7991
|
-
const [x1, y1, x2, y2] = m.slice(1).map(Number);
|
|
7992
|
-
if (![x1, y1, x2, y2].every(Number.isFinite) || x1 < 0 || x1 > 1 || x2 < 0 || x2 > 1) return null;
|
|
7993
|
-
return { type: "cubic-bezier", x1, y1, x2, y2 };
|
|
7994
|
-
}
|
|
7995
|
-
function isAnimationEasing(value) {
|
|
7996
|
-
if (typeof value === "string") return parseCssEasing(value) !== null;
|
|
7997
|
-
if (typeof value !== "object" || value === null) return false;
|
|
7998
|
-
const e = value;
|
|
7999
|
-
if (e.type === "spring") return true;
|
|
8000
|
-
return e.type === "cubic-bezier" && [e.x1, e.y1, e.x2, e.y2].every((v) => typeof v === "number" && Number.isFinite(v));
|
|
8001
|
-
}
|
|
8002
|
-
var round = (v, digits = 4) => {
|
|
8003
|
-
const p = 10 ** digits;
|
|
8004
|
-
return Math.round(v * p) / p;
|
|
8005
|
-
};
|
|
8006
|
-
function easingToCss(easing, durationMs = 1e3, samples = 24) {
|
|
8007
|
-
const resolved = resolveEasing(easing);
|
|
8008
|
-
if (resolved === "hold") return "steps(1, end)";
|
|
8009
|
-
if (resolved.type === "spring") {
|
|
8010
|
-
const n = Math.max(2, Math.floor(samples));
|
|
8011
|
-
const points = [];
|
|
8012
|
-
for (let i = 0; i <= n; i++) points.push(String(round(i === n ? 1 : springAt(resolved, i / n * durationMs / 1e3))));
|
|
8013
|
-
return `linear(${points.join(", ")})`;
|
|
8014
|
-
}
|
|
8015
|
-
const { x1, y1, x2, y2 } = resolved;
|
|
8016
|
-
for (const [name, p] of Object.entries(CUBIC_BEZIER_PRESETS)) {
|
|
8017
|
-
if (["linear", "ease", "ease-in", "ease-out", "ease-in-out"].includes(name) && p[0] === x1 && p[1] === y1 && p[2] === x2 && p[3] === y2) {
|
|
8018
|
-
return name;
|
|
8019
|
-
}
|
|
8020
|
-
}
|
|
8021
|
-
return `cubic-bezier(${round(x1)}, ${round(y1)}, ${round(x2)}, ${round(y2)})`;
|
|
8022
|
-
}
|
|
8023
|
-
function easingLabel(easing) {
|
|
8024
|
-
if (easing === void 0 || easing === null) return ANIMATION_EASING_LABELS.linear;
|
|
8025
|
-
if (typeof easing === "string") return _nullishCoalesce(ANIMATION_EASING_LABELS[easing], () => ( easing));
|
|
8026
|
-
return easing.type === "spring" ? "Spring" : "Custom";
|
|
8027
|
-
}
|
|
8028
|
-
|
|
8029
|
-
// src/canvas/animation/color.ts
|
|
8030
|
-
var toLinear = (c) => c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
8031
|
-
var toGamma = (c) => c <= 31308e-7 ? 12.92 * c : 1.055 * Math.sign(c) * Math.abs(c) ** (1 / 2.4) - 0.055;
|
|
8032
|
-
function rgbToOklab(r, g, b, alpha = 1) {
|
|
8033
|
-
const lr = toLinear(r);
|
|
8034
|
-
const lg = toLinear(g);
|
|
8035
|
-
const lb = toLinear(b);
|
|
8036
|
-
const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
|
|
8037
|
-
const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
|
|
8038
|
-
const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
|
|
8039
|
-
return {
|
|
8040
|
-
l: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
|
|
8041
|
-
a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
|
|
8042
|
-
b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
|
|
8043
|
-
alpha
|
|
8044
|
-
};
|
|
8045
|
-
}
|
|
8046
|
-
function oklabToRgb(color) {
|
|
8047
|
-
const l_ = color.l + 0.3963377774 * color.a + 0.2158037573 * color.b;
|
|
8048
|
-
const m_ = color.l - 0.1055613458 * color.a - 0.0638541728 * color.b;
|
|
8049
|
-
const s_ = color.l - 0.0894841775 * color.a - 1.291485548 * color.b;
|
|
8050
|
-
const l = l_ ** 3;
|
|
8051
|
-
const m = m_ ** 3;
|
|
8052
|
-
const s = s_ ** 3;
|
|
8053
|
-
const clamp01 = (v) => Math.min(1, Math.max(0, v));
|
|
8054
|
-
return {
|
|
8055
|
-
r: clamp01(toGamma(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s)),
|
|
8056
|
-
g: clamp01(toGamma(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s)),
|
|
8057
|
-
b: clamp01(toGamma(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s)),
|
|
8058
|
-
a: clamp01(color.alpha)
|
|
8059
|
-
};
|
|
8060
|
-
}
|
|
8061
|
-
function parseOklab(input) {
|
|
8062
|
-
const hex = _chunk4BVP64JJcjs.normalizeTokenColor.call(void 0, input);
|
|
8063
|
-
if (hex === null) return null;
|
|
8064
|
-
const c = _chunk4BVP64JJcjs.hexToRgba.call(void 0, hex);
|
|
8065
|
-
return rgbToOklab(c.r, c.g, c.b, c.a);
|
|
8066
|
-
}
|
|
8067
|
-
function formatOklab(color) {
|
|
8068
|
-
const { r, g, b, a } = oklabToRgb(color);
|
|
8069
|
-
return _chunk4BVP64JJcjs.rgbaToHex.call(void 0, r, g, b, a);
|
|
8070
|
-
}
|
|
8071
|
-
function mixColorsOklab(from, to, t) {
|
|
8072
|
-
const a = parseOklab(from);
|
|
8073
|
-
const b = parseOklab(to);
|
|
8074
|
-
if (!a || !b) return null;
|
|
8075
|
-
const alpha = a.alpha + (b.alpha - a.alpha) * t;
|
|
8076
|
-
const premul = (k) => a[k] * a.alpha + (b[k] * b.alpha - a[k] * a.alpha) * t;
|
|
8077
|
-
if (alpha <= 1e-9) return formatOklab({ l: a.l + (b.l - a.l) * t, a: 0, b: 0, alpha: 0 });
|
|
8078
|
-
return formatOklab({ l: premul("l") / alpha, a: premul("a") / alpha, b: premul("b") / alpha, alpha });
|
|
8079
|
-
}
|
|
8080
|
-
|
|
8081
7803
|
// src/canvas/animation/model.ts
|
|
8082
7804
|
var ANIMATION_DATA_KEY = "animation";
|
|
8083
|
-
var ANIMATION_TIME_EPSILON = 1e-6;
|
|
8084
7805
|
var num = (value) => {
|
|
8085
7806
|
if (typeof value === "number") return Number.isFinite(value) ? value : void 0;
|
|
8086
7807
|
if (typeof value === "string") {
|
|
@@ -8221,37 +7942,6 @@ function clampAnimationValue(property, value) {
|
|
|
8221
7942
|
if (property.max !== void 0) v = Math.min(property.max, v);
|
|
8222
7943
|
return v;
|
|
8223
7944
|
}
|
|
8224
|
-
function isValue(value) {
|
|
8225
|
-
return typeof value === "number" && Number.isFinite(value) || typeof value === "string";
|
|
8226
|
-
}
|
|
8227
|
-
function isAnimationKeyframe(value) {
|
|
8228
|
-
if (typeof value !== "object" || value === null) return false;
|
|
8229
|
-
const k = value;
|
|
8230
|
-
return typeof k.time === "number" && Number.isFinite(k.time) && isValue(k.value) && (k.easing === void 0 || isAnimationEasing(k.easing));
|
|
8231
|
-
}
|
|
8232
|
-
var sortedCache = /* @__PURE__ */ new WeakMap();
|
|
8233
|
-
function normalizeKeyframes(keyframes) {
|
|
8234
|
-
if (!Array.isArray(keyframes)) return [];
|
|
8235
|
-
const cached = sortedCache.get(keyframes);
|
|
8236
|
-
if (cached && cached.items.length === keyframes.length && cached.items.every((k, i) => k === keyframes[i])) return cached.out;
|
|
8237
|
-
const indexed = keyframes.map((k, i) => ({ k, i })).filter(({ k }) => isAnimationKeyframe(k)).sort((a, b) => a.k.time - b.k.time || a.i - b.i);
|
|
8238
|
-
const out = [];
|
|
8239
|
-
let lastIndex = -1;
|
|
8240
|
-
for (const { k, i } of indexed) {
|
|
8241
|
-
const prev = out[out.length - 1];
|
|
8242
|
-
if (prev && Math.abs(k.time - prev.time) <= ANIMATION_TIME_EPSILON) {
|
|
8243
|
-
if (i > lastIndex) {
|
|
8244
|
-
out[out.length - 1] = k;
|
|
8245
|
-
lastIndex = i;
|
|
8246
|
-
}
|
|
8247
|
-
continue;
|
|
8248
|
-
}
|
|
8249
|
-
out.push(k);
|
|
8250
|
-
lastIndex = i;
|
|
8251
|
-
}
|
|
8252
|
-
sortedCache.set(keyframes, { items: [...keyframes], out });
|
|
8253
|
-
return out;
|
|
8254
|
-
}
|
|
8255
7945
|
function getNodeAnimation(node) {
|
|
8256
7946
|
const raw = _optionalChain([node, 'optionalAccess', _215 => _215.data, 'optionalAccess', _216 => _216[ANIMATION_DATA_KEY]]);
|
|
8257
7947
|
if (typeof raw !== "object" || raw === null || typeof raw.tracks !== "object" || raw.tracks === null) return null;
|
|
@@ -8259,7 +7949,7 @@ function getNodeAnimation(node) {
|
|
|
8259
7949
|
}
|
|
8260
7950
|
function getAnimationTrack(node, property) {
|
|
8261
7951
|
const track = _optionalChain([getNodeAnimation, 'call', _217 => _217(node), 'optionalAccess', _218 => _218.tracks, 'access', _219 => _219[property]]);
|
|
8262
|
-
return track && Array.isArray(track.keyframes) && normalizeKeyframes(track.keyframes).length > 0 ? track : void 0;
|
|
7952
|
+
return track && Array.isArray(track.keyframes) && _chunkTTYCN6ZHcjs.normalizeKeyframes.call(void 0, track.keyframes).length > 0 ? track : void 0;
|
|
8263
7953
|
}
|
|
8264
7954
|
function isNodeAnimated(node) {
|
|
8265
7955
|
const animation = getNodeAnimation(node);
|
|
@@ -8289,45 +7979,6 @@ function withNodeAnimation(node, animation) {
|
|
|
8289
7979
|
|
|
8290
7980
|
// src/canvas/animation/evaluate.ts
|
|
8291
7981
|
var nodesOf = (doc) => Array.isArray(doc) ? doc : doc.nodes;
|
|
8292
|
-
function interpolateAnimationValue(from, to, t, type = "number") {
|
|
8293
|
-
if (typeof from === "number" && typeof to === "number") return from + (to - from) * t;
|
|
8294
|
-
if (t <= 0) return from;
|
|
8295
|
-
if (t >= 1) return to;
|
|
8296
|
-
if (type === "color" || typeof from === "string" && typeof to === "string") {
|
|
8297
|
-
const mixed = mixColorsOklab(from, to, t);
|
|
8298
|
-
if (mixed !== null) return mixed;
|
|
8299
|
-
}
|
|
8300
|
-
return from;
|
|
8301
|
-
}
|
|
8302
|
-
function segmentIndex(keys, time) {
|
|
8303
|
-
let lo = 0;
|
|
8304
|
-
let hi = keys.length - 1;
|
|
8305
|
-
let found = -1;
|
|
8306
|
-
while (lo <= hi) {
|
|
8307
|
-
const mid = lo + hi >> 1;
|
|
8308
|
-
if (keys[mid].time <= time) {
|
|
8309
|
-
found = mid;
|
|
8310
|
-
lo = mid + 1;
|
|
8311
|
-
} else hi = mid - 1;
|
|
8312
|
-
}
|
|
8313
|
-
return found;
|
|
8314
|
-
}
|
|
8315
|
-
function evaluateTrack(track, time, type = "number") {
|
|
8316
|
-
const keyframes = Array.isArray(track) ? track : _optionalChain([track, 'optionalAccess', _221 => _221.keyframes]);
|
|
8317
|
-
const keys = normalizeKeyframes(keyframes);
|
|
8318
|
-
if (keys.length === 0) return void 0;
|
|
8319
|
-
if (!(time > keys[0].time)) return keys[0].value;
|
|
8320
|
-
const last = keys[keys.length - 1];
|
|
8321
|
-
if (time >= last.time) return last.value;
|
|
8322
|
-
const i = segmentIndex(keys, time);
|
|
8323
|
-
const a = keys[i];
|
|
8324
|
-
const b = keys[i + 1];
|
|
8325
|
-
if (time === a.time) return a.value;
|
|
8326
|
-
const span = b.time - a.time;
|
|
8327
|
-
const u = (time - a.time) / span;
|
|
8328
|
-
if (a.easing === "hold") return a.value;
|
|
8329
|
-
return interpolateAnimationValue(a.value, b.value, evaluateEasing(a.easing, u, span), type);
|
|
8330
|
-
}
|
|
8331
7982
|
function getAnimationDuration(doc) {
|
|
8332
7983
|
let end = 0;
|
|
8333
7984
|
for (const node of nodesOf(doc)) {
|
|
@@ -8335,23 +7986,12 @@ function getAnimationDuration(doc) {
|
|
|
8335
7986
|
if (!animation) continue;
|
|
8336
7987
|
for (const track of Object.values(animation.tracks)) {
|
|
8337
7988
|
if (!track || track.enabled === false) continue;
|
|
8338
|
-
const keys = normalizeKeyframes(track.keyframes);
|
|
7989
|
+
const keys = _chunkTTYCN6ZHcjs.normalizeKeyframes.call(void 0, track.keyframes);
|
|
8339
7990
|
if (keys.length > 0) end = Math.max(end, keys[keys.length - 1].time);
|
|
8340
7991
|
}
|
|
8341
7992
|
}
|
|
8342
7993
|
return end;
|
|
8343
7994
|
}
|
|
8344
|
-
function wrapAnimationTime(time, duration, loop = "none") {
|
|
8345
|
-
if (!Number.isFinite(time)) return 0;
|
|
8346
|
-
if (!(duration > 0)) return 0;
|
|
8347
|
-
if (loop === "loop") return (time % duration + duration) % duration;
|
|
8348
|
-
if (loop === "ping-pong") {
|
|
8349
|
-
const period = duration * 2;
|
|
8350
|
-
const m = (time % period + period) % period;
|
|
8351
|
-
return m <= duration ? m : period - m;
|
|
8352
|
-
}
|
|
8353
|
-
return Math.min(duration, Math.max(0, time));
|
|
8354
|
-
}
|
|
8355
7995
|
function evaluateAnimation(doc, time, options = {}) {
|
|
8356
7996
|
const only = options.ids ? new Set(options.ids) : null;
|
|
8357
7997
|
const out = {};
|
|
@@ -8363,7 +8003,7 @@ function evaluateAnimation(doc, time, options = {}) {
|
|
|
8363
8003
|
for (const [key, track] of Object.entries(animation.tracks)) {
|
|
8364
8004
|
if (!track || track.enabled === false) continue;
|
|
8365
8005
|
const property = (_nullishCoalesce(options.properties, () => ( ANIMATABLE_PROPERTIES))).find((p) => p.key === key);
|
|
8366
|
-
const value = evaluateTrack(track, time, _nullishCoalesce(_optionalChain([property, 'optionalAccess',
|
|
8006
|
+
const value = _chunkTTYCN6ZHcjs.evaluateTrack.call(void 0, track, time, _nullishCoalesce(_optionalChain([property, 'optionalAccess', _221 => _221.type]), () => ( "number")));
|
|
8367
8007
|
if (value === void 0) continue;
|
|
8368
8008
|
(values ??= {})[key] = clampAnimationValue(property, value);
|
|
8369
8009
|
}
|
|
@@ -8401,7 +8041,7 @@ var AnimationEditError = class extends Error {
|
|
|
8401
8041
|
}
|
|
8402
8042
|
};
|
|
8403
8043
|
var MAX_KEYFRAME_REFS = 4096;
|
|
8404
|
-
var sameTime = (a, b) => Math.abs(a - b) <= ANIMATION_TIME_EPSILON;
|
|
8044
|
+
var sameTime = (a, b) => Math.abs(a - b) <= _chunkTTYCN6ZHcjs.ANIMATION_TIME_EPSILON;
|
|
8405
8045
|
var refKey = (r) => `${r.nodeId}\0${r.property}`;
|
|
8406
8046
|
function snapTimeToFrame(time, fps) {
|
|
8407
8047
|
if (!(fps > 0)) return time;
|
|
@@ -8409,9 +8049,9 @@ function snapTimeToFrame(time, fps) {
|
|
|
8409
8049
|
return Math.round(Math.round(time / frame) * frame * 1e3) / 1e3;
|
|
8410
8050
|
}
|
|
8411
8051
|
function coerceValue(property, value) {
|
|
8412
|
-
const type = _nullishCoalesce(_optionalChain([property, 'optionalAccess',
|
|
8052
|
+
const type = _nullishCoalesce(_optionalChain([property, 'optionalAccess', _222 => _222.type]), () => ( (typeof value === "string" && _chunkA6PHCAGXcjs.normalizeTokenColor.call(void 0, value) !== null ? "color" : "number")));
|
|
8413
8053
|
if (type === "color") {
|
|
8414
|
-
const color =
|
|
8054
|
+
const color = _chunkA6PHCAGXcjs.normalizeTokenColor.call(void 0, value);
|
|
8415
8055
|
if (color === null) throw new AnimationEditError("invalid_value", `"${String(value)}" is not a colour.`);
|
|
8416
8056
|
return color;
|
|
8417
8057
|
}
|
|
@@ -8421,17 +8061,17 @@ function coerceValue(property, value) {
|
|
|
8421
8061
|
}
|
|
8422
8062
|
function coerceEasing(easing) {
|
|
8423
8063
|
if (typeof easing === "string") {
|
|
8424
|
-
const parsed = parseCssEasing(easing);
|
|
8064
|
+
const parsed = _chunkTTYCN6ZHcjs.parseCssEasing.call(void 0, easing);
|
|
8425
8065
|
if (parsed) return parsed;
|
|
8426
|
-
} else if (isAnimationEasing(easing)) return easing;
|
|
8066
|
+
} else if (_chunkTTYCN6ZHcjs.isAnimationEasing.call(void 0, easing)) return easing;
|
|
8427
8067
|
throw new AnimationEditError("invalid_easing", `Unknown easing ${JSON.stringify(easing)}.`);
|
|
8428
8068
|
}
|
|
8429
8069
|
function coerceTime(time) {
|
|
8430
8070
|
if (typeof time !== "number" || !Number.isFinite(time)) throw new AnimationEditError("invalid_time", `Invalid time ${String(time)}.`);
|
|
8431
8071
|
return Math.max(0, time);
|
|
8432
8072
|
}
|
|
8433
|
-
var Draft = (
|
|
8434
|
-
constructor(nodes, options = {}) {;
|
|
8073
|
+
var Draft = (_class7 = class {
|
|
8074
|
+
constructor(nodes, options = {}) {;_class7.prototype.__init16.call(this);_class7.prototype.__init17.call(this);
|
|
8435
8075
|
this.nodes = nodes;
|
|
8436
8076
|
this.options = options;
|
|
8437
8077
|
this.byId = new Map(nodes.map((n) => [n.id, n]));
|
|
@@ -8439,8 +8079,8 @@ var Draft = (_class8 = class {
|
|
|
8439
8079
|
|
|
8440
8080
|
|
|
8441
8081
|
|
|
8442
|
-
|
|
8443
|
-
|
|
8082
|
+
__init16() {this.animations = /* @__PURE__ */ new Map()}
|
|
8083
|
+
__init17() {this.nodeWrites = /* @__PURE__ */ new Map()}
|
|
8444
8084
|
node(id) {
|
|
8445
8085
|
const node = _nullishCoalesce(this.nodeWrites.get(id), () => ( this.byId.get(id)));
|
|
8446
8086
|
if (!node) throw new AnimationEditError("unknown_node", `Node "${id}" does not exist.`);
|
|
@@ -8454,8 +8094,8 @@ var Draft = (_class8 = class {
|
|
|
8454
8094
|
if (!animation) {
|
|
8455
8095
|
const current = getNodeAnimation(this.node(id));
|
|
8456
8096
|
const tracks = {};
|
|
8457
|
-
for (const [key, track] of Object.entries(_nullishCoalesce(_optionalChain([current, 'optionalAccess',
|
|
8458
|
-
if (track) tracks[key] = { ...track, keyframes: normalizeKeyframes(track.keyframes) };
|
|
8097
|
+
for (const [key, track] of Object.entries(_nullishCoalesce(_optionalChain([current, 'optionalAccess', _223 => _223.tracks]), () => ( {})))) {
|
|
8098
|
+
if (track) tracks[key] = { ...track, keyframes: _chunkTTYCN6ZHcjs.normalizeKeyframes.call(void 0, track.keyframes) };
|
|
8459
8099
|
}
|
|
8460
8100
|
animation = { ..._nullishCoalesce(current, () => ( {})), tracks };
|
|
8461
8101
|
this.animations.set(id, animation);
|
|
@@ -8463,7 +8103,7 @@ var Draft = (_class8 = class {
|
|
|
8463
8103
|
return animation;
|
|
8464
8104
|
}
|
|
8465
8105
|
keys(id, property) {
|
|
8466
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
8106
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _224 => _224.animation, 'call', _225 => _225(id), 'access', _226 => _226.tracks, 'access', _227 => _227[property], 'optionalAccess', _228 => _228.keyframes]), () => ( []));
|
|
8467
8107
|
}
|
|
8468
8108
|
track(id, property) {
|
|
8469
8109
|
return this.animation(id).tracks[property];
|
|
@@ -8499,7 +8139,7 @@ var Draft = (_class8 = class {
|
|
|
8499
8139
|
return animation ? withNodeAnimation(base, animation) : base;
|
|
8500
8140
|
});
|
|
8501
8141
|
}
|
|
8502
|
-
},
|
|
8142
|
+
}, _class7);
|
|
8503
8143
|
function validateRefs(draft, refs, allowEmpty = false) {
|
|
8504
8144
|
if (!Array.isArray(refs) || !allowEmpty && refs.length === 0) throw new AnimationEditError("unknown_keyframe", "Name at least one keyframe.");
|
|
8505
8145
|
if (refs.length > MAX_KEYFRAME_REFS) throw new AnimationEditError("too_many_keyframes", `At most ${MAX_KEYFRAME_REFS} keyframes per edit.`);
|
|
@@ -8525,7 +8165,7 @@ function readAnimatableValue(node, property) {
|
|
|
8525
8165
|
function getAnimatedValue(node, propertyKey, time, options = {}) {
|
|
8526
8166
|
const property = getAnimatableProperty(propertyKey, options);
|
|
8527
8167
|
const track = getAnimationTrack(node, propertyKey);
|
|
8528
|
-
if (track && track.enabled !== false) return evaluateTrack(track, time, _nullishCoalesce(_optionalChain([property, 'optionalAccess',
|
|
8168
|
+
if (track && track.enabled !== false) return _chunkTTYCN6ZHcjs.evaluateTrack.call(void 0, track, time, _nullishCoalesce(_optionalChain([property, 'optionalAccess', _229 => _229.type]), () => ( "number")));
|
|
8529
8169
|
return property ? readAnimatableValue(node, property) : void 0;
|
|
8530
8170
|
}
|
|
8531
8171
|
function putKey(draft, nodeId, property, time, value, easing, inherit = true) {
|
|
@@ -8535,7 +8175,7 @@ function putKey(draft, nodeId, property, time, value, easing, inherit = true) {
|
|
|
8535
8175
|
keys[at] = { ...keys[at], value, ...easing !== void 0 ? { easing } : {} };
|
|
8536
8176
|
} else {
|
|
8537
8177
|
const before = [...keys].reverse().find((k) => k.time < time);
|
|
8538
|
-
const inherited = _nullishCoalesce(easing, () => ( (inherit ? _optionalChain([before, 'optionalAccess',
|
|
8178
|
+
const inherited = _nullishCoalesce(easing, () => ( (inherit ? _optionalChain([before, 'optionalAccess', _230 => _230.easing]) : void 0)));
|
|
8539
8179
|
keys.push({ time, value, ...inherited !== void 0 ? { easing: inherited } : {} });
|
|
8540
8180
|
}
|
|
8541
8181
|
draft.setKeys(nodeId, property, keys);
|
|
@@ -8627,7 +8267,7 @@ function removeTrack(nodes, nodeId, property, options = {}) {
|
|
|
8627
8267
|
if (!track) return nodes;
|
|
8628
8268
|
const p = draft.property(property);
|
|
8629
8269
|
if (options.keepValueAt !== void 0 && p && property !== "motionPath") {
|
|
8630
|
-
const value = evaluateTrack(track, options.keepValueAt, p.type);
|
|
8270
|
+
const value = _chunkTTYCN6ZHcjs.evaluateTrack.call(void 0, track, options.keepValueAt, p.type);
|
|
8631
8271
|
if (value !== void 0) draft.writeNode(nodeId, (n) => p.write(n, value));
|
|
8632
8272
|
}
|
|
8633
8273
|
draft.setKeys(nodeId, property, []);
|
|
@@ -8656,10 +8296,10 @@ function moveKeyframes(nodes, refs, delta, options = {}) {
|
|
|
8656
8296
|
low = Math.max(low, min - time);
|
|
8657
8297
|
high = Math.min(high, max - time);
|
|
8658
8298
|
}
|
|
8659
|
-
if (low > high + ANIMATION_TIME_EPSILON) throw new AnimationEditError("no_movement_range", "The keyframes have no common movement range.");
|
|
8299
|
+
if (low > high + _chunkTTYCN6ZHcjs.ANIMATION_TIME_EPSILON) throw new AnimationEditError("no_movement_range", "The keyframes have no common movement range.");
|
|
8660
8300
|
const applied = Math.min(high, Math.max(low, delta));
|
|
8661
8301
|
const moved = refs.map((ref) => ({ ...ref, time: draft.keys(ref.nodeId, ref.property)[draft.find(ref)].time + applied }));
|
|
8662
|
-
if (Math.abs(applied) <= ANIMATION_TIME_EPSILON) return { nodes, delta: 0, refs: refs.map((r) => ({ ...r })) };
|
|
8302
|
+
if (Math.abs(applied) <= _chunkTTYCN6ZHcjs.ANIMATION_TIME_EPSILON) return { nodes, delta: 0, refs: refs.map((r) => ({ ...r })) };
|
|
8663
8303
|
retime(draft, refs, (time) => time + applied);
|
|
8664
8304
|
return { nodes: draft.commit(), delta: applied, refs: moved };
|
|
8665
8305
|
}
|
|
@@ -8705,7 +8345,7 @@ function getKeyframeTimes(nodes, options = {}) {
|
|
|
8705
8345
|
if (!animation) continue;
|
|
8706
8346
|
for (const [property, track] of Object.entries(animation.tracks)) {
|
|
8707
8347
|
const skip = _nullishCoalesce(excluded.get(refKey({ nodeId: node.id, property })), () => ( []));
|
|
8708
|
-
for (const k of normalizeKeyframes(_optionalChain([track, 'optionalAccess',
|
|
8348
|
+
for (const k of _chunkTTYCN6ZHcjs.normalizeKeyframes.call(void 0, _optionalChain([track, 'optionalAccess', _231 => _231.keyframes]))) if (!skip.some((t) => sameTime(t, k.time))) times.push(k.time);
|
|
8709
8349
|
}
|
|
8710
8350
|
}
|
|
8711
8351
|
times.sort((a, b) => a - b);
|
|
@@ -8763,7 +8403,7 @@ function parseKeyframeClipboard(input) {
|
|
|
8763
8403
|
const clip = value;
|
|
8764
8404
|
if (clip.type !== "pixerate/keyframes" || clip.version !== 1 || !Array.isArray(clip.keyframes)) return null;
|
|
8765
8405
|
const keyframes = clip.keyframes.filter(
|
|
8766
|
-
(k) => k && typeof k.nodeId === "string" && typeof k.property === "string" && typeof k.offset === "number" && Number.isFinite(k.offset) && (typeof k.value === "number" && Number.isFinite(k.value) || typeof k.value === "string") && (k.easing === void 0 || isAnimationEasing(k.easing))
|
|
8406
|
+
(k) => k && typeof k.nodeId === "string" && typeof k.property === "string" && typeof k.offset === "number" && Number.isFinite(k.offset) && (typeof k.value === "number" && Number.isFinite(k.value) || typeof k.value === "string") && (k.easing === void 0 || _chunkTTYCN6ZHcjs.isAnimationEasing.call(void 0, k.easing))
|
|
8767
8407
|
);
|
|
8768
8408
|
return keyframes.length > 0 ? { type: "pixerate/keyframes", version: 1, keyframes } : null;
|
|
8769
8409
|
}
|
|
@@ -8811,7 +8451,7 @@ function recordAnimationChanges(base, before, after, time, options = {}) {
|
|
|
8811
8451
|
const animation = getNodeAnimation(stored);
|
|
8812
8452
|
let result = next;
|
|
8813
8453
|
let tracks = null;
|
|
8814
|
-
const tracksOf = () => tracks ??= { ..._nullishCoalesce(_optionalChain([animation, 'optionalAccess',
|
|
8454
|
+
const tracksOf = () => tracks ??= { ..._nullishCoalesce(_optionalChain([animation, 'optionalAccess', _232 => _232.tracks]), () => ( {})) };
|
|
8815
8455
|
for (const p of properties) {
|
|
8816
8456
|
const track = getAnimationTrack(stored, p.key);
|
|
8817
8457
|
const animated = !!track && track.enabled !== false;
|
|
@@ -8824,16 +8464,16 @@ function recordAnimationChanges(base, before, after, time, options = {}) {
|
|
|
8824
8464
|
};
|
|
8825
8465
|
if (animated) {
|
|
8826
8466
|
if (changed) {
|
|
8827
|
-
const keys = normalizeKeyframes(track.keyframes).filter((k) => !sameTime(k.time, t));
|
|
8467
|
+
const keys = _chunkTTYCN6ZHcjs.normalizeKeyframes.call(void 0, track.keyframes).filter((k) => !sameTime(k.time, t));
|
|
8828
8468
|
const before2 = [...keys].reverse().find((k) => k.time < t);
|
|
8829
|
-
keys.push({ time: t, value: now, ..._optionalChain([before2, 'optionalAccess',
|
|
8469
|
+
keys.push({ time: t, value: now, ..._optionalChain([before2, 'optionalAccess', _233 => _233.easing]) !== void 0 ? { easing: before2.easing } : {} });
|
|
8830
8470
|
tracksOf()[p.key] = { ...track, keyframes: keys.sort((a, b) => a.time - b.time) };
|
|
8831
8471
|
keyed.push({ nodeId: next.id, property: p.key, time: t });
|
|
8832
8472
|
}
|
|
8833
8473
|
restore();
|
|
8834
8474
|
} else if (changed && options.recording && !track) {
|
|
8835
8475
|
const keys = [];
|
|
8836
|
-
if (t > ANIMATION_TIME_EPSILON && was !== void 0) keys.push({ time: 0, value: was });
|
|
8476
|
+
if (t > _chunkTTYCN6ZHcjs.ANIMATION_TIME_EPSILON && was !== void 0) keys.push({ time: 0, value: was });
|
|
8837
8477
|
keys.push({ time: t, value: now });
|
|
8838
8478
|
tracksOf()[p.key] = { keyframes: keys };
|
|
8839
8479
|
keyed.push({ nodeId: next.id, property: p.key, time: t });
|
|
@@ -8858,10 +8498,10 @@ function animateNode(nodes, nodeId, options) {
|
|
|
8858
8498
|
const writes = [];
|
|
8859
8499
|
for (const [key, target] of entries) {
|
|
8860
8500
|
const p = draft.property(key);
|
|
8861
|
-
if (!p || key === "motionPath" && !_optionalChain([getNodeAnimation, 'call',
|
|
8501
|
+
if (!p || key === "motionPath" && !_optionalChain([getNodeAnimation, 'call', _234 => _234(node), 'optionalAccess', _235 => _235.motionPath])) {
|
|
8862
8502
|
throw new AnimationEditError("unknown_property", `"${key}" cannot be animated${p ? " without a motion path" : ""}.`);
|
|
8863
8503
|
}
|
|
8864
|
-
const from = _nullishCoalesce(_optionalChain([options, 'access',
|
|
8504
|
+
const from = _nullishCoalesce(_optionalChain([options, 'access', _236 => _236.from, 'optionalAccess', _237 => _237[key]]), () => ( (key === "motionPath" ? 0 : getAnimatedValue(node, key, start, options))));
|
|
8865
8505
|
if (from === void 0) throw new AnimationEditError("invalid_value", `"${nodeId}" has no ${key} to animate from; pass "from".`);
|
|
8866
8506
|
writes.push([key, coerceValue(p, from), coerceValue(p, target)]);
|
|
8867
8507
|
}
|
|
@@ -8873,212 +8513,6 @@ function animateNode(nodes, nodeId, options) {
|
|
|
8873
8513
|
return { nodes: draft.commit(), refs };
|
|
8874
8514
|
}
|
|
8875
8515
|
|
|
8876
|
-
// src/canvas/animation/player.ts
|
|
8877
|
-
var AnimationPlayer = (_class9 = class {
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
8882
|
-
|
|
8883
|
-
__init22() {this.playing = false}
|
|
8884
|
-
__init23() {this.scrubbing = false}
|
|
8885
|
-
__init24() {this.resumeAfterScrub = false}
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
/** Unwrapped time at `anchorAt` (keeps the ping-pong direction across frames). */
|
|
8889
|
-
__init25() {this.anchorRaw = 0}
|
|
8890
|
-
__init26() {this.anchorAt = 0}
|
|
8891
|
-
__init27() {this.generation = 0}
|
|
8892
|
-
|
|
8893
|
-
__init28() {this.listeners = /* @__PURE__ */ new Set()}
|
|
8894
|
-
constructor(options = {}) {;_class9.prototype.__init22.call(this);_class9.prototype.__init23.call(this);_class9.prototype.__init24.call(this);_class9.prototype.__init25.call(this);_class9.prototype.__init26.call(this);_class9.prototype.__init27.call(this);_class9.prototype.__init28.call(this);
|
|
8895
|
-
this.clock = _nullishCoalesce(options.clock, () => ( realClock));
|
|
8896
|
-
this.durationSource = _nullishCoalesce(options.duration, () => ( 1e3));
|
|
8897
|
-
this.loop = _nullishCoalesce(options.loop, () => ( "none"));
|
|
8898
|
-
this.rate = Number.isFinite(options.playbackRate) && options.playbackRate !== 0 ? options.playbackRate : 1;
|
|
8899
|
-
this.onTime = options.onTime;
|
|
8900
|
-
this.onEnd = options.onEnd;
|
|
8901
|
-
this.time = this.clamp(_nullishCoalesce(options.time, () => ( 0)));
|
|
8902
|
-
this.cached = this.snapshot();
|
|
8903
|
-
}
|
|
8904
|
-
/** Current timeline length (ms). */
|
|
8905
|
-
get duration() {
|
|
8906
|
-
const d = typeof this.durationSource === "function" ? this.durationSource() : this.durationSource;
|
|
8907
|
-
return Number.isFinite(d) && d > 0 ? d : 0;
|
|
8908
|
-
}
|
|
8909
|
-
get currentTime() {
|
|
8910
|
-
return this.time;
|
|
8911
|
-
}
|
|
8912
|
-
get isPlaying() {
|
|
8913
|
-
return this.playing;
|
|
8914
|
-
}
|
|
8915
|
-
getState() {
|
|
8916
|
-
return this.cached;
|
|
8917
|
-
}
|
|
8918
|
-
subscribe(listener) {
|
|
8919
|
-
this.listeners.add(listener);
|
|
8920
|
-
return () => {
|
|
8921
|
-
this.listeners.delete(listener);
|
|
8922
|
-
};
|
|
8923
|
-
}
|
|
8924
|
-
/** Replaces the callbacks (hooks keep them current without recreating the player). */
|
|
8925
|
-
setCallbacks(callbacks) {
|
|
8926
|
-
this.onTime = callbacks.onTime;
|
|
8927
|
-
this.onEnd = callbacks.onEnd;
|
|
8928
|
-
}
|
|
8929
|
-
setDuration(duration) {
|
|
8930
|
-
this.durationSource = duration;
|
|
8931
|
-
this.time = this.clamp(this.time);
|
|
8932
|
-
this.emit(false);
|
|
8933
|
-
}
|
|
8934
|
-
setLoop(loop) {
|
|
8935
|
-
if (loop === this.loop) return;
|
|
8936
|
-
this.reanchor();
|
|
8937
|
-
this.loop = loop;
|
|
8938
|
-
this.emit(false);
|
|
8939
|
-
}
|
|
8940
|
-
setPlaybackRate(rate) {
|
|
8941
|
-
if (!Number.isFinite(rate) || rate === 0 || rate === this.rate) return;
|
|
8942
|
-
this.reanchor();
|
|
8943
|
-
this.rate = rate;
|
|
8944
|
-
this.emit(false);
|
|
8945
|
-
}
|
|
8946
|
-
/** Starts playing from the playhead (from the start again when a one-shot play had ended). */
|
|
8947
|
-
play() {
|
|
8948
|
-
if (this.playing) return;
|
|
8949
|
-
const d = this.duration;
|
|
8950
|
-
if (this.loop === "none" && d > 0) {
|
|
8951
|
-
if (this.rate > 0 && this.time >= d) this.time = 0;
|
|
8952
|
-
if (this.rate < 0 && this.time <= 0) this.time = d;
|
|
8953
|
-
}
|
|
8954
|
-
this.playing = true;
|
|
8955
|
-
this.scrubbing = false;
|
|
8956
|
-
this.anchorRaw = this.time;
|
|
8957
|
-
this.anchorAt = this.clock.now();
|
|
8958
|
-
this.emit(false);
|
|
8959
|
-
this.schedule();
|
|
8960
|
-
}
|
|
8961
|
-
pause() {
|
|
8962
|
-
if (!this.playing) return;
|
|
8963
|
-
this.tick(false);
|
|
8964
|
-
this.playing = false;
|
|
8965
|
-
this.generation++;
|
|
8966
|
-
this.emit(true);
|
|
8967
|
-
}
|
|
8968
|
-
toggle() {
|
|
8969
|
-
if (this.playing) this.pause();
|
|
8970
|
-
else this.play();
|
|
8971
|
-
}
|
|
8972
|
-
/** Pauses and returns to the start. */
|
|
8973
|
-
stop() {
|
|
8974
|
-
this.playing = false;
|
|
8975
|
-
this.generation++;
|
|
8976
|
-
this.seek(0);
|
|
8977
|
-
}
|
|
8978
|
-
/** Moves the playhead (clamped to the timeline); playback continues from there. */
|
|
8979
|
-
seek(time) {
|
|
8980
|
-
if (!Number.isFinite(time)) return;
|
|
8981
|
-
this.time = this.clamp(time);
|
|
8982
|
-
this.anchorRaw = this.time;
|
|
8983
|
-
this.anchorAt = this.clock.now();
|
|
8984
|
-
this.emit(true);
|
|
8985
|
-
}
|
|
8986
|
-
/** Seeks while dragging the playhead: playback pauses until `endScrub`. */
|
|
8987
|
-
scrub(time) {
|
|
8988
|
-
if (!this.scrubbing) {
|
|
8989
|
-
this.resumeAfterScrub = this.playing;
|
|
8990
|
-
if (this.playing) {
|
|
8991
|
-
this.playing = false;
|
|
8992
|
-
this.generation++;
|
|
8993
|
-
}
|
|
8994
|
-
this.scrubbing = true;
|
|
8995
|
-
}
|
|
8996
|
-
this.seek(time);
|
|
8997
|
-
}
|
|
8998
|
-
/** Ends a scrub, resuming playback if it was playing when the scrub began. */
|
|
8999
|
-
endScrub() {
|
|
9000
|
-
if (!this.scrubbing) return;
|
|
9001
|
-
this.scrubbing = false;
|
|
9002
|
-
const resume = this.resumeAfterScrub;
|
|
9003
|
-
this.resumeAfterScrub = false;
|
|
9004
|
-
if (resume) this.play();
|
|
9005
|
-
else this.emit(false);
|
|
9006
|
-
}
|
|
9007
|
-
/** Stops scheduling frames and drops listeners. */
|
|
9008
|
-
destroy() {
|
|
9009
|
-
this.playing = false;
|
|
9010
|
-
this.generation++;
|
|
9011
|
-
this.listeners.clear();
|
|
9012
|
-
}
|
|
9013
|
-
clamp(time) {
|
|
9014
|
-
return Math.min(this.duration, Math.max(0, Number.isFinite(time) ? time : 0));
|
|
9015
|
-
}
|
|
9016
|
-
reanchor() {
|
|
9017
|
-
if (!this.playing) return;
|
|
9018
|
-
this.tick(false);
|
|
9019
|
-
this.anchorRaw = this.rawNow();
|
|
9020
|
-
this.anchorAt = this.clock.now();
|
|
9021
|
-
}
|
|
9022
|
-
rawNow() {
|
|
9023
|
-
return this.anchorRaw + (this.clock.now() - this.anchorAt) * this.rate;
|
|
9024
|
-
}
|
|
9025
|
-
schedule() {
|
|
9026
|
-
const generation = this.generation;
|
|
9027
|
-
this.clock.frame().then(() => {
|
|
9028
|
-
if (generation !== this.generation || !this.playing) return;
|
|
9029
|
-
this.tick(true);
|
|
9030
|
-
if (this.playing) this.schedule();
|
|
9031
|
-
});
|
|
9032
|
-
}
|
|
9033
|
-
/** Advances the playhead to the clock's time; `notify` emits the change. */
|
|
9034
|
-
tick(notify) {
|
|
9035
|
-
if (!this.playing) return;
|
|
9036
|
-
const d = this.duration;
|
|
9037
|
-
const raw = this.rawNow();
|
|
9038
|
-
let ended = false;
|
|
9039
|
-
if (this.loop === "none" || d <= 0) {
|
|
9040
|
-
if (this.rate > 0 && raw >= d) {
|
|
9041
|
-
this.time = d;
|
|
9042
|
-
ended = true;
|
|
9043
|
-
} else if (this.rate < 0 && raw <= 0) {
|
|
9044
|
-
this.time = 0;
|
|
9045
|
-
ended = true;
|
|
9046
|
-
} else this.time = this.clamp(raw);
|
|
9047
|
-
} else {
|
|
9048
|
-
this.time = wrapAnimationTime(raw, d, this.loop);
|
|
9049
|
-
}
|
|
9050
|
-
if (ended) {
|
|
9051
|
-
this.playing = false;
|
|
9052
|
-
this.generation++;
|
|
9053
|
-
}
|
|
9054
|
-
if (notify || ended) this.emit(true);
|
|
9055
|
-
if (ended) _optionalChain([this, 'access', _239 => _239.onEnd, 'optionalCall', _240 => _240()]);
|
|
9056
|
-
}
|
|
9057
|
-
snapshot() {
|
|
9058
|
-
return {
|
|
9059
|
-
time: this.time,
|
|
9060
|
-
playing: this.playing,
|
|
9061
|
-
scrubbing: this.scrubbing,
|
|
9062
|
-
loop: this.loop,
|
|
9063
|
-
playbackRate: this.rate,
|
|
9064
|
-
duration: this.duration
|
|
9065
|
-
};
|
|
9066
|
-
}
|
|
9067
|
-
emit(timeChanged) {
|
|
9068
|
-
const next = this.snapshot();
|
|
9069
|
-
const prev = this.cached;
|
|
9070
|
-
if (prev.time === next.time && prev.playing === next.playing && prev.scrubbing === next.scrubbing && prev.loop === next.loop && prev.playbackRate === next.playbackRate && prev.duration === next.duration) {
|
|
9071
|
-
return;
|
|
9072
|
-
}
|
|
9073
|
-
this.cached = next;
|
|
9074
|
-
if (timeChanged && prev.time !== next.time) _optionalChain([this, 'access', _241 => _241.onTime, 'optionalCall', _242 => _242(next.time)]);
|
|
9075
|
-
for (const listener of this.listeners) listener(next);
|
|
9076
|
-
}
|
|
9077
|
-
}, _class9);
|
|
9078
|
-
function createAnimationPlayer(options) {
|
|
9079
|
-
return new AnimationPlayer(options);
|
|
9080
|
-
}
|
|
9081
|
-
|
|
9082
8516
|
// src/canvas/animation/export.ts
|
|
9083
8517
|
function sampleAnimationFrames(doc, options = {}) {
|
|
9084
8518
|
const fps = _nullishCoalesce(options.fps, () => ( 30));
|
|
@@ -9109,22 +8543,22 @@ var CSS_ANIMATION_PROPERTIES = {
|
|
|
9109
8543
|
width: { css: "width", camel: "width" },
|
|
9110
8544
|
height: { css: "height", camel: "height" }
|
|
9111
8545
|
};
|
|
9112
|
-
var
|
|
8546
|
+
var round = (v) => Math.round(v * 1e3) / 1e3;
|
|
9113
8547
|
function cssValue(source, value, node, partner, partnerSource) {
|
|
9114
8548
|
if (source === "x" || source === "y") {
|
|
9115
8549
|
const dx = source === "x" ? value - node.position.x : partner !== void 0 ? partner - node.position.x : 0;
|
|
9116
8550
|
const dy = source === "y" ? value - node.position.y : partner !== void 0 && partnerSource === "y" ? partner - node.position.y : 0;
|
|
9117
|
-
return `${
|
|
8551
|
+
return `${round(dx)}px ${round(dy)}px`;
|
|
9118
8552
|
}
|
|
9119
8553
|
if (typeof value === "string") return value;
|
|
9120
8554
|
switch (source) {
|
|
9121
8555
|
case "rotation":
|
|
9122
|
-
return `${
|
|
8556
|
+
return `${round(value)}deg`;
|
|
9123
8557
|
case "scale":
|
|
9124
8558
|
case "opacity":
|
|
9125
|
-
return String(
|
|
8559
|
+
return String(round(value));
|
|
9126
8560
|
default:
|
|
9127
|
-
return `${
|
|
8561
|
+
return `${round(value)}px`;
|
|
9128
8562
|
}
|
|
9129
8563
|
}
|
|
9130
8564
|
var sameTimes = (a, b) => a.length === b.length && a.every((k, i) => Math.abs(k.time - b[i].time) < 1e-6 && JSON.stringify(_nullishCoalesce(k.easing, () => ( "linear"))) === JSON.stringify(_nullishCoalesce(b[i].easing, () => ( "linear"))));
|
|
@@ -9142,7 +8576,7 @@ function exactStops(keys, duration, format) {
|
|
|
9142
8576
|
stops.push({
|
|
9143
8577
|
offset: Math.min(1, Math.max(0, k.time / duration)),
|
|
9144
8578
|
value: format(k, i),
|
|
9145
|
-
...next ? { easing: easingToCss(k.easing, next.time - k.time) } : {}
|
|
8579
|
+
...next ? { easing: _chunkTTYCN6ZHcjs.easingToCss.call(void 0, k.easing, next.time - k.time) } : {}
|
|
9146
8580
|
});
|
|
9147
8581
|
});
|
|
9148
8582
|
const last = keys[keys.length - 1];
|
|
@@ -9166,10 +8600,10 @@ function getCssPropertyAnimations(nodes, nodeId, options = {}) {
|
|
|
9166
8600
|
const tracks = /* @__PURE__ */ new Map();
|
|
9167
8601
|
for (const [key, track] of Object.entries(animation.tracks)) {
|
|
9168
8602
|
if (!track || track.enabled === false || !map[key]) continue;
|
|
9169
|
-
const keys = normalizeKeyframes(track.keyframes);
|
|
8603
|
+
const keys = _chunkTTYCN6ZHcjs.normalizeKeyframes.call(void 0, track.keyframes);
|
|
9170
8604
|
if (keys.length > 0) tracks.set(key, keys);
|
|
9171
8605
|
}
|
|
9172
|
-
const typeOf = (key) => _nullishCoalesce(_optionalChain([ANIMATABLE_PROPERTIES, 'access',
|
|
8606
|
+
const typeOf = (key) => _nullishCoalesce(_optionalChain([ANIMATABLE_PROPERTIES, 'access', _238 => _238.find, 'call', _239 => _239((p) => p.key === key), 'optionalAccess', _240 => _240.type]), () => ( "number"));
|
|
9173
8607
|
const groups = /* @__PURE__ */ new Map();
|
|
9174
8608
|
for (const key of tracks.keys()) {
|
|
9175
8609
|
const css = map[key].css;
|
|
@@ -9179,12 +8613,12 @@ function getCssPropertyAnimations(nodes, nodeId, options = {}) {
|
|
|
9179
8613
|
for (const [css, sources] of groups) {
|
|
9180
8614
|
const camel2 = map[sources[0]].camel;
|
|
9181
8615
|
const keysOf = (k) => tracks.get(k);
|
|
9182
|
-
const evalAt = (k, t) => evaluateTrack(keysOf(k), t, typeOf(k));
|
|
8616
|
+
const evalAt = (k, t) => _chunkTTYCN6ZHcjs.evaluateTrack.call(void 0, keysOf(k), t, typeOf(k));
|
|
9183
8617
|
const allTimes = sources.flatMap((k) => keysOf(k).map((x) => x.time));
|
|
9184
8618
|
if (sources.includes("motionPath")) {
|
|
9185
8619
|
const position = (t) => {
|
|
9186
8620
|
const moved = ANIMATABLE_PROPERTIES.find((p) => p.key === "motionPath").write(node, evalAt("motionPath", t));
|
|
9187
|
-
return `${
|
|
8621
|
+
return `${round(moved.position.x - node.position.x)}px ${round(moved.position.y - node.position.y)}px`;
|
|
9188
8622
|
};
|
|
9189
8623
|
out.push({ property: css, camel: camel2, sources, stops: sampledStops(duration, fps, allTimes, position), exact: false });
|
|
9190
8624
|
continue;
|
|
@@ -9219,7 +8653,7 @@ function timing(options, duration) {
|
|
|
9219
8653
|
const rate = options.playbackRate && Number.isFinite(options.playbackRate) && options.playbackRate !== 0 ? options.playbackRate : 1;
|
|
9220
8654
|
const loop = _nullishCoalesce(options.loop, () => ( "none"));
|
|
9221
8655
|
return {
|
|
9222
|
-
duration:
|
|
8656
|
+
duration: round(duration / Math.abs(rate)),
|
|
9223
8657
|
iterations: loop === "none" ? 1 : Infinity,
|
|
9224
8658
|
direction: loop === "ping-pong" ? rate < 0 ? "alternate-reverse" : "alternate" : rate < 0 ? "reverse" : "normal"
|
|
9225
8659
|
};
|
|
@@ -9236,7 +8670,7 @@ function exportCssAnimation(nodes, nodeId, options = {}) {
|
|
|
9236
8670
|
for (const prop of props) {
|
|
9237
8671
|
const name = `${base}-${cssIdent(prop.property)}`;
|
|
9238
8672
|
const lines = prop.stops.map((s) => {
|
|
9239
|
-
const pct = `${
|
|
8673
|
+
const pct = `${round(s.offset * 100)}%`;
|
|
9240
8674
|
const easing = s.easing ? ` animation-timing-function: ${s.easing};` : "";
|
|
9241
8675
|
return ` ${pct} { ${prop.property}: ${s.value};${easing} }`;
|
|
9242
8676
|
});
|
|
@@ -9275,9 +8709,9 @@ function isCssExportExact(nodes, nodeId) {
|
|
|
9275
8709
|
|
|
9276
8710
|
// src/canvas/animation/timeline.ts
|
|
9277
8711
|
function isKeyframeSelected(selection, ref) {
|
|
9278
|
-
return selection.some((s) => s.nodeId === ref.nodeId && s.property === ref.property && Math.abs(s.time - ref.time) <= ANIMATION_TIME_EPSILON);
|
|
8712
|
+
return selection.some((s) => s.nodeId === ref.nodeId && s.property === ref.property && Math.abs(s.time - ref.time) <= _chunkTTYCN6ZHcjs.ANIMATION_TIME_EPSILON);
|
|
9279
8713
|
}
|
|
9280
|
-
var defaultLabel = (node) => typeof _optionalChain([node, 'access',
|
|
8714
|
+
var defaultLabel = (node) => typeof _optionalChain([node, 'access', _241 => _241.data, 'optionalAccess', _242 => _242.label]) === "string" && node.data.label.trim() ? node.data.label : node.id;
|
|
9281
8715
|
function getTimelineRows(nodes, ids, options = {}) {
|
|
9282
8716
|
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
9283
8717
|
const selection = _nullishCoalesce(options.selection, () => ( []));
|
|
@@ -9288,7 +8722,7 @@ function getTimelineRows(nodes, ids, options = {}) {
|
|
|
9288
8722
|
if (!node) continue;
|
|
9289
8723
|
for (const property of getAnimatedProperties(node, options)) {
|
|
9290
8724
|
const track = getAnimationTrack(node, property);
|
|
9291
|
-
const label = _nullishCoalesce(_optionalChain([(_nullishCoalesce(options.properties, () => ( ANIMATABLE_PROPERTIES))), 'access',
|
|
8725
|
+
const label = _nullishCoalesce(_optionalChain([(_nullishCoalesce(options.properties, () => ( ANIMATABLE_PROPERTIES))), 'access', _243 => _243.find, 'call', _244 => _244((p) => p.key === property), 'optionalAccess', _245 => _245.label]), () => ( property));
|
|
9292
8726
|
rows.push({
|
|
9293
8727
|
id: `${id}:${property}`,
|
|
9294
8728
|
nodeId: id,
|
|
@@ -9296,7 +8730,7 @@ function getTimelineRows(nodes, ids, options = {}) {
|
|
|
9296
8730
|
property,
|
|
9297
8731
|
label,
|
|
9298
8732
|
enabled: track.enabled !== false,
|
|
9299
|
-
keyframes: normalizeKeyframes(track.keyframes).map((k) => {
|
|
8733
|
+
keyframes: _chunkTTYCN6ZHcjs.normalizeKeyframes.call(void 0, track.keyframes).map((k) => {
|
|
9300
8734
|
const ref = { nodeId: id, property, time: k.time };
|
|
9301
8735
|
const selected = isKeyframeSelected(selection, ref);
|
|
9302
8736
|
return {
|
|
@@ -9356,12 +8790,12 @@ function createCanvasAnimationController(options) {
|
|
|
9356
8790
|
}
|
|
9357
8791
|
return _nullishCoalesce(fixedDuration, () => ( durationValue));
|
|
9358
8792
|
};
|
|
9359
|
-
const player = new AnimationPlayer({
|
|
8793
|
+
const player = new (0, _chunkTTYCN6ZHcjs.AnimationPlayer)({
|
|
9360
8794
|
clock: options.clock,
|
|
9361
8795
|
duration,
|
|
9362
8796
|
loop: options.loop,
|
|
9363
8797
|
playbackRate: options.playbackRate,
|
|
9364
|
-
onTime: (time) => _optionalChain([options, 'access',
|
|
8798
|
+
onTime: (time) => _optionalChain([options, 'access', _246 => _246.onTime, 'optionalCall', _247 => _247(time)])
|
|
9365
8799
|
});
|
|
9366
8800
|
let cached = null;
|
|
9367
8801
|
const snapshot = () => ({
|
|
@@ -9383,18 +8817,18 @@ function createCanvasAnimationController(options) {
|
|
|
9383
8817
|
};
|
|
9384
8818
|
const notify = () => {
|
|
9385
8819
|
const state = getState();
|
|
9386
|
-
_optionalChain([options, 'access',
|
|
8820
|
+
_optionalChain([options, 'access', _248 => _248.onChange, 'optionalCall', _249 => _249(state)]);
|
|
9387
8821
|
for (const listener of listeners) listener(state);
|
|
9388
8822
|
};
|
|
9389
8823
|
player.subscribe(notify);
|
|
9390
|
-
const selectedIds = () => _nullishCoalesce(_optionalChain([options, 'access',
|
|
8824
|
+
const selectedIds = () => _nullishCoalesce(_optionalChain([options, 'access', _250 => _250.getSelectedIds, 'optionalCall', _251 => _251()]), () => ( options.getNodes().filter((n) => n.selected).map((n) => n.id)));
|
|
9391
8825
|
const KEEP_FIELDS = ["selected", "dragging", "measured"];
|
|
9392
8826
|
const replaceNodes = (nodes, replacements, animationOnly = false) => nodes.map((node) => {
|
|
9393
8827
|
const replacement = replacements.get(node.id);
|
|
9394
8828
|
if (!replacement) return node;
|
|
9395
8829
|
if (animationOnly) {
|
|
9396
8830
|
const data = { ..._nullishCoalesce(node.data, () => ( {})) };
|
|
9397
|
-
const value = _optionalChain([replacement, 'access',
|
|
8831
|
+
const value = _optionalChain([replacement, 'access', _252 => _252.data, 'optionalAccess', _253 => _253[ANIMATION_DATA_KEY]]);
|
|
9398
8832
|
if (value === void 0) delete data[ANIMATION_DATA_KEY];
|
|
9399
8833
|
else data[ANIMATION_DATA_KEY] = value;
|
|
9400
8834
|
return { ...node, data };
|
|
@@ -9421,7 +8855,7 @@ function createCanvasAnimationController(options) {
|
|
|
9421
8855
|
}
|
|
9422
8856
|
}
|
|
9423
8857
|
if (redoMap.size === 0) return false;
|
|
9424
|
-
const scope = _nullishCoalesce(_optionalChain([merge, 'optionalAccess',
|
|
8858
|
+
const scope = _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _254 => _254.animationOnly]), () => ( false));
|
|
9425
8859
|
const execute = () => options.setNodes(replaceNodes(options.getNodes(), redoMap, scope));
|
|
9426
8860
|
const undo = () => options.setNodes(replaceNodes(options.getNodes(), undoMap, scope));
|
|
9427
8861
|
const command = { name, execute, undo, ...merge ? { tag: merge.tag } : {} };
|
|
@@ -9434,8 +8868,8 @@ function createCanvasAnimationController(options) {
|
|
|
9434
8868
|
if (selection.length === 0) return;
|
|
9435
8869
|
const byId = new Map(options.getNodes().map((n) => [n.id, n]));
|
|
9436
8870
|
const kept = selection.filter((ref) => {
|
|
9437
|
-
const track = _optionalChain([getNodeAnimation, 'call',
|
|
9438
|
-
return !!track && normalizeKeyframes(track.keyframes).some((k) => Math.abs(k.time - ref.time) <= ANIMATION_TIME_EPSILON);
|
|
8871
|
+
const track = _optionalChain([getNodeAnimation, 'call', _255 => _255(byId.get(ref.nodeId)), 'optionalAccess', _256 => _256.tracks, 'access', _257 => _257[ref.property]]);
|
|
8872
|
+
return !!track && _chunkTTYCN6ZHcjs.normalizeKeyframes.call(void 0, track.keyframes).some((k) => Math.abs(k.time - ref.time) <= _chunkTTYCN6ZHcjs.ANIMATION_TIME_EPSILON);
|
|
9439
8873
|
});
|
|
9440
8874
|
if (kept.length !== selection.length) selection = kept;
|
|
9441
8875
|
}
|
|
@@ -9507,7 +8941,7 @@ function createCanvasAnimationController(options) {
|
|
|
9507
8941
|
nextKeyframe(ids = selectedIds()) {
|
|
9508
8942
|
const list = [...ids];
|
|
9509
8943
|
const times = getKeyframeTimes(options.getNodes(), list.length ? { ids: list } : {});
|
|
9510
|
-
const next = times.find((t) => t > player.currentTime + ANIMATION_TIME_EPSILON);
|
|
8944
|
+
const next = times.find((t) => t > player.currentTime + _chunkTTYCN6ZHcjs.ANIMATION_TIME_EPSILON);
|
|
9511
8945
|
if (next === void 0) return null;
|
|
9512
8946
|
player.seek(next);
|
|
9513
8947
|
return next;
|
|
@@ -9515,7 +8949,7 @@ function createCanvasAnimationController(options) {
|
|
|
9515
8949
|
previousKeyframe(ids = selectedIds()) {
|
|
9516
8950
|
const list = [...ids];
|
|
9517
8951
|
const times = getKeyframeTimes(options.getNodes(), list.length ? { ids: list } : {});
|
|
9518
|
-
const prev = [...times].reverse().find((t) => t < player.currentTime - ANIMATION_TIME_EPSILON);
|
|
8952
|
+
const prev = [...times].reverse().find((t) => t < player.currentTime - _chunkTTYCN6ZHcjs.ANIMATION_TIME_EPSILON);
|
|
9519
8953
|
if (prev === void 0) return null;
|
|
9520
8954
|
player.seek(prev);
|
|
9521
8955
|
return prev;
|
|
@@ -9541,13 +8975,13 @@ function createCanvasAnimationController(options) {
|
|
|
9541
8975
|
const baseById = new Map(base.map((n) => [n.id, n]));
|
|
9542
8976
|
const staticNodes = nodes.map((n) => {
|
|
9543
8977
|
if (!ids.has(n.id)) return n;
|
|
9544
|
-
const old = _optionalChain([baseById, 'access',
|
|
8978
|
+
const old = _optionalChain([baseById, 'access', _258 => _258.get, 'call', _259 => _259(n.id), 'optionalAccess', _260 => _260.data, 'optionalAccess', _261 => _261[ANIMATION_DATA_KEY]]);
|
|
9545
8979
|
const data = { ..._nullishCoalesce(n.data, () => ( {})) };
|
|
9546
8980
|
if (old === void 0) delete data[ANIMATION_DATA_KEY];
|
|
9547
8981
|
else data[ANIMATION_DATA_KEY] = old;
|
|
9548
8982
|
return { ...n, data };
|
|
9549
8983
|
});
|
|
9550
|
-
const animationOf = new Map(nodes.filter((n) => ids.has(n.id)).map((n) => [n.id, _optionalChain([n, 'access',
|
|
8984
|
+
const animationOf = new Map(nodes.filter((n) => ids.has(n.id)).map((n) => [n.id, _optionalChain([n, 'access', _262 => _262.data, 'optionalAccess', _263 => _263[ANIMATION_DATA_KEY]])]));
|
|
9551
8985
|
options.setNodes(staticNodes);
|
|
9552
8986
|
const tag = `animation.record:${[...ids].sort().join(",")}`;
|
|
9553
8987
|
commit(
|
|
@@ -9749,7 +9183,7 @@ function createCanvasAnimationController(options) {
|
|
|
9749
9183
|
// ----- views & export ---------------------------------------------------------------
|
|
9750
9184
|
/** Timeline rows for `ids` (default: selected nodes), including the drag preview. */
|
|
9751
9185
|
timelineRows(ids = selectedIds(), opts = {}) {
|
|
9752
|
-
return getTimelineRows(options.getNodes(), ids, { ...propertyOptions(), ...opts, selection, dragDelta: _nullishCoalesce(_optionalChain([drag, 'optionalAccess',
|
|
9186
|
+
return getTimelineRows(options.getNodes(), ids, { ...propertyOptions(), ...opts, selection, dragDelta: _nullishCoalesce(_optionalChain([drag, 'optionalAccess', _264 => _264.delta]), () => ( 0)) });
|
|
9753
9187
|
},
|
|
9754
9188
|
sampleFrames(opts = {}) {
|
|
9755
9189
|
return sampleAnimationFrames(options.getNodes(), { fps, duration: duration(), ...propertyOptions(), ...opts });
|
|
@@ -9779,7 +9213,7 @@ var COMPONENT_OVERRIDES_DATA_KEY = "componentOverrides";
|
|
|
9779
9213
|
var COMPONENT_PROPERTY_REFS_DATA_KEY = "componentPropertyRefs";
|
|
9780
9214
|
var MAX_DEPTH = 16;
|
|
9781
9215
|
var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
9782
|
-
var dataOf = (node) => isRecord(_optionalChain([node, 'optionalAccess',
|
|
9216
|
+
var dataOf = (node) => isRecord(_optionalChain([node, 'optionalAccess', _265 => _265.data])) ? node.data : {};
|
|
9783
9217
|
function same(a, b) {
|
|
9784
9218
|
if (a === b) return true;
|
|
9785
9219
|
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) {
|
|
@@ -9833,7 +9267,7 @@ function getComponentPropertyRefs(node) {
|
|
|
9833
9267
|
function getLayerName(node) {
|
|
9834
9268
|
const d = dataOf(node);
|
|
9835
9269
|
for (const key of ["name", "label", "text"]) if (typeof d[key] === "string" && d[key]) return d[key];
|
|
9836
|
-
return typeof _optionalChain([node, 'optionalAccess',
|
|
9270
|
+
return typeof _optionalChain([node, 'optionalAccess', _266 => _266.type]) === "string" ? node.type : "";
|
|
9837
9271
|
}
|
|
9838
9272
|
function withData(node, data) {
|
|
9839
9273
|
return { ...node, data };
|
|
@@ -9926,9 +9360,9 @@ function readOverrideGroup(node, group) {
|
|
|
9926
9360
|
case "size":
|
|
9927
9361
|
return sizeOf(node);
|
|
9928
9362
|
case "component":
|
|
9929
|
-
return _optionalChain([getInstanceData, 'call',
|
|
9363
|
+
return _optionalChain([getInstanceData, 'call', _267 => _267(node), 'optionalAccess', _268 => _268.componentId]);
|
|
9930
9364
|
case "props":
|
|
9931
|
-
return _nullishCoalesce(_optionalChain([getInstanceData, 'call',
|
|
9365
|
+
return _nullishCoalesce(_optionalChain([getInstanceData, 'call', _269 => _269(node), 'optionalAccess', _270 => _270.properties]), () => ( {}));
|
|
9932
9366
|
}
|
|
9933
9367
|
const [kind, key] = splitGroup(group);
|
|
9934
9368
|
switch (kind) {
|
|
@@ -10052,8 +9486,8 @@ function copyGroups(from, to, groups) {
|
|
|
10052
9486
|
function fieldGroup(field) {
|
|
10053
9487
|
return field === "visible" ? "hidden" : field;
|
|
10054
9488
|
}
|
|
10055
|
-
var Graph = (
|
|
10056
|
-
constructor(nodes) {;
|
|
9489
|
+
var Graph = (_class8 = class {
|
|
9490
|
+
constructor(nodes) {;_class8.prototype.__init18.call(this);
|
|
10057
9491
|
this.nodes = nodes;
|
|
10058
9492
|
this.byId = new Map(nodes.map((n) => [n.id, n]));
|
|
10059
9493
|
for (const n of nodes) {
|
|
@@ -10065,7 +9499,7 @@ var Graph = (_class10 = class {
|
|
|
10065
9499
|
}
|
|
10066
9500
|
|
|
10067
9501
|
|
|
10068
|
-
|
|
9502
|
+
__init18() {this.kids = /* @__PURE__ */ new Map()}
|
|
10069
9503
|
get(id) {
|
|
10070
9504
|
return id === void 0 ? void 0 : this.byId.get(id);
|
|
10071
9505
|
}
|
|
@@ -10107,13 +9541,13 @@ var Graph = (_class10 = class {
|
|
|
10107
9541
|
}
|
|
10108
9542
|
return out;
|
|
10109
9543
|
}
|
|
10110
|
-
},
|
|
10111
|
-
var owningComponentIn = (g, id) => _optionalChain([g, 'access',
|
|
10112
|
-
var owningInstanceIn = (g, id) => _optionalChain([g, 'access',
|
|
10113
|
-
var enclosingInstanceIn = (g, id) => _optionalChain([g, 'access',
|
|
9544
|
+
}, _class8);
|
|
9545
|
+
var owningComponentIn = (g, id) => _optionalChain([g, 'access', _271 => _271.chain, 'call', _272 => _272(id), 'access', _273 => _273.find, 'call', _274 => _274(isCanvasComponent), 'optionalAccess', _275 => _275.id]);
|
|
9546
|
+
var owningInstanceIn = (g, id) => _optionalChain([g, 'access', _276 => _276.chain, 'call', _277 => _277(id), 'access', _278 => _278.find, 'call', _279 => _279(isCanvasInstance), 'optionalAccess', _280 => _280.id]);
|
|
9547
|
+
var enclosingInstanceIn = (g, id) => _optionalChain([g, 'access', _281 => _281.chain, 'call', _282 => _282(id, false), 'access', _283 => _283.find, 'call', _284 => _284(isCanvasInstance), 'optionalAccess', _285 => _285.id]);
|
|
10114
9548
|
function rootInstanceIn(g, id) {
|
|
10115
9549
|
const list = g.chain(id).filter(isCanvasInstance);
|
|
10116
|
-
return _optionalChain([list, 'access',
|
|
9550
|
+
return _optionalChain([list, 'access', _286 => _286[list.length - 1], 'optionalAccess', _287 => _287.id]);
|
|
10117
9551
|
}
|
|
10118
9552
|
function variantSetIn(g, componentId) {
|
|
10119
9553
|
const comp = g.get(componentId);
|
|
@@ -10122,7 +9556,7 @@ function variantSetIn(g, componentId) {
|
|
|
10122
9556
|
return isCanvasComponentSet(parent) ? parent : void 0;
|
|
10123
9557
|
}
|
|
10124
9558
|
function getVariantValues(node) {
|
|
10125
|
-
const explicit = _optionalChain([getComponentData, 'call',
|
|
9559
|
+
const explicit = _optionalChain([getComponentData, 'call', _288 => _288(node), 'optionalAccess', _289 => _289.variant]);
|
|
10126
9560
|
if (isRecord(explicit) && Object.keys(explicit).length) return stringRecord2(explicit);
|
|
10127
9561
|
const name = getLayerName(node);
|
|
10128
9562
|
return name.includes("=") ? parseVariantName(name) : {};
|
|
@@ -10165,7 +9599,7 @@ function defaultVariantIn(g, setId) {
|
|
|
10165
9599
|
best = { key, id: v.id };
|
|
10166
9600
|
}
|
|
10167
9601
|
}
|
|
10168
|
-
return _optionalChain([best, 'optionalAccess',
|
|
9602
|
+
return _optionalChain([best, 'optionalAccess', _290 => _290.id]);
|
|
10169
9603
|
}
|
|
10170
9604
|
function findVariantIn(g, setId, wanted) {
|
|
10171
9605
|
const entries = Object.entries(wanted);
|
|
@@ -10176,7 +9610,7 @@ function findVariantIn(g, setId, wanted) {
|
|
|
10176
9610
|
if (score === entries.length) return v.id;
|
|
10177
9611
|
if (!best || score > best.score) best = { score, id: v.id };
|
|
10178
9612
|
}
|
|
10179
|
-
return _optionalChain([best, 'optionalAccess',
|
|
9613
|
+
return _optionalChain([best, 'optionalAccess', _291 => _291.id]);
|
|
10180
9614
|
}
|
|
10181
9615
|
function mainOfIn(g, id) {
|
|
10182
9616
|
const node = g.get(id);
|
|
@@ -10190,7 +9624,7 @@ function propertyDefsIn(g, componentId) {
|
|
|
10190
9624
|
if (!isCanvasComponent(comp)) return {};
|
|
10191
9625
|
const set = variantSetIn(g, componentId);
|
|
10192
9626
|
const owner = set ? dataOf(set)[COMPONENT_SET_DATA_KEY] : dataOf(comp)[COMPONENT_DATA_KEY];
|
|
10193
|
-
return isRecord(_optionalChain([owner, 'optionalAccess',
|
|
9627
|
+
return isRecord(_optionalChain([owner, 'optionalAccess', _292 => _292.properties])) ? owner.properties : {};
|
|
10194
9628
|
}
|
|
10195
9629
|
function validValue(def, v) {
|
|
10196
9630
|
return def.type === "boolean" ? typeof v === "boolean" : typeof v === "string";
|
|
@@ -10198,7 +9632,7 @@ function validValue(def, v) {
|
|
|
10198
9632
|
function effectivePropsIn(g, componentId, values) {
|
|
10199
9633
|
const out = {};
|
|
10200
9634
|
for (const [k, def] of Object.entries(propertyDefsIn(g, componentId))) {
|
|
10201
|
-
const v = _optionalChain([values, 'optionalAccess',
|
|
9635
|
+
const v = _optionalChain([values, 'optionalAccess', _293 => _293[k]]);
|
|
10202
9636
|
out[k] = v !== void 0 && validValue(def, v) ? v : def.default;
|
|
10203
9637
|
}
|
|
10204
9638
|
return out;
|
|
@@ -10209,7 +9643,7 @@ function componentDepsIn(g, componentId) {
|
|
|
10209
9643
|
while (queue.length) {
|
|
10210
9644
|
const c = queue.pop();
|
|
10211
9645
|
for (const id of g.subtree(c)) {
|
|
10212
|
-
const target = _optionalChain([getInstanceData, 'call',
|
|
9646
|
+
const target = _optionalChain([getInstanceData, 'call', _294 => _294(g.get(id)), 'optionalAccess', _295 => _295.componentId]);
|
|
10213
9647
|
if (target && !deps.has(target)) {
|
|
10214
9648
|
deps.add(target);
|
|
10215
9649
|
queue.push(target);
|
|
@@ -10243,7 +9677,7 @@ function isInsideInstance(nodes, id) {
|
|
|
10243
9677
|
return enclosingInstanceIn(new Graph(nodes), id) !== void 0;
|
|
10244
9678
|
}
|
|
10245
9679
|
function getComponentInstances(nodes, componentId) {
|
|
10246
|
-
return nodes.filter((n) => _optionalChain([getInstanceData, 'call',
|
|
9680
|
+
return nodes.filter((n) => _optionalChain([getInstanceData, 'call', _296 => _296(n), 'optionalAccess', _297 => _297.componentId]) === componentId).map((n) => n.id);
|
|
10247
9681
|
}
|
|
10248
9682
|
function getInstanceStatus(nodes, id) {
|
|
10249
9683
|
const g = new Graph(nodes);
|
|
@@ -10252,7 +9686,7 @@ function getInstanceStatus(nodes, id) {
|
|
|
10252
9686
|
return isCanvasComponent(g.get(inst.componentId)) ? "linked" : "missing-main";
|
|
10253
9687
|
}
|
|
10254
9688
|
function getVariantSet(nodes, componentId) {
|
|
10255
|
-
return _optionalChain([variantSetIn, 'call',
|
|
9689
|
+
return _optionalChain([variantSetIn, 'call', _298 => _298(new Graph(nodes), componentId), 'optionalAccess', _299 => _299.id]);
|
|
10256
9690
|
}
|
|
10257
9691
|
function getVariantOptions(nodes, setId) {
|
|
10258
9692
|
return variantOptionsIn(new Graph(nodes), setId);
|
|
@@ -10283,7 +9717,7 @@ function listCanvasComponents(nodes) {
|
|
|
10283
9717
|
const g = new Graph(nodes);
|
|
10284
9718
|
const counts = /* @__PURE__ */ new Map();
|
|
10285
9719
|
for (const n of nodes) {
|
|
10286
|
-
const c = _optionalChain([getInstanceData, 'call',
|
|
9720
|
+
const c = _optionalChain([getInstanceData, 'call', _300 => _300(n), 'optionalAccess', _301 => _301.componentId]);
|
|
10287
9721
|
if (c) counts.set(c, (_nullishCoalesce(counts.get(c), () => ( 0))) + 1);
|
|
10288
9722
|
}
|
|
10289
9723
|
const components = [];
|
|
@@ -10389,7 +9823,7 @@ function rootReference(g, comp) {
|
|
|
10389
9823
|
return "label" in dataOf(comp) && typeof label === "string" ? withData(comp, { ...dataOf(comp), label }) : comp;
|
|
10390
9824
|
}
|
|
10391
9825
|
function fixMeasured(node, old) {
|
|
10392
|
-
const measured2 = _nullishCoalesce(_optionalChain([old, 'optionalAccess',
|
|
9826
|
+
const measured2 = _nullishCoalesce(_optionalChain([old, 'optionalAccess', _302 => _302.measured]), () => ( node.measured));
|
|
10393
9827
|
const size = sizeOf(node);
|
|
10394
9828
|
const w = _nullishCoalesce(size.width, () => ( size.styleWidth));
|
|
10395
9829
|
const h = _nullishCoalesce(size.height, () => ( size.styleHeight));
|
|
@@ -10582,10 +10016,10 @@ function buildInstance(g, instId, opts, taken) {
|
|
|
10582
10016
|
if (nested && depth < MAX_DEPTH) {
|
|
10583
10017
|
const target = nested.componentId;
|
|
10584
10018
|
instProps.set(id, effectivePropsIn(g, target, nested.properties));
|
|
10585
|
-
if (_optionalChain([getInstanceData, 'call',
|
|
10019
|
+
if (_optionalChain([getInstanceData, 'call', _303 => _303(s), 'optionalAccess', _304 => _304.componentId]) !== target) {
|
|
10586
10020
|
const main = g.get(target);
|
|
10587
10021
|
if (isCanvasComponent(main) && !expanding.includes(target) && !g.isAncestor(target, instId)) {
|
|
10588
|
-
const previousComponent = o ? _optionalChain([getInstanceData, 'call',
|
|
10022
|
+
const previousComponent = o ? _optionalChain([getInstanceData, 'call', _305 => _305(o), 'optionalAccess', _306 => _306.componentId]) : void 0;
|
|
10589
10023
|
n = applyChainProps(instanceRoot(main, s, o, id, newParent, sid, nested, previousComponent, false), s, enc);
|
|
10590
10024
|
out.push(n);
|
|
10591
10025
|
copyChildren(target, id, path, [id], [...expanding, target], depth + 1);
|
|
@@ -10653,7 +10087,7 @@ function rebuildBatch(nodes, ids, opts) {
|
|
|
10653
10087
|
if (opts.layout) {
|
|
10654
10088
|
const lookup = new Map(result.map((n) => [n.id, n]));
|
|
10655
10089
|
const inFrames = [...built.keys()].filter((r) => {
|
|
10656
|
-
const parent = lookup.get(_nullishCoalesce(_optionalChain([lookup, 'access',
|
|
10090
|
+
const parent = lookup.get(_nullishCoalesce(_optionalChain([lookup, 'access', _307 => _307.get, 'call', _308 => _308(r), 'optionalAccess', _309 => _309.parentId]), () => ( "")));
|
|
10657
10091
|
return !!getAutoLayout(parent);
|
|
10658
10092
|
});
|
|
10659
10093
|
if (inFrames.length) result = applyNodeUpdates(result, layoutUpMany(result, inFrames, opts.layout));
|
|
@@ -10709,7 +10143,7 @@ function rebuildInstances(nodes, comps, resync, opts) {
|
|
|
10709
10143
|
}
|
|
10710
10144
|
function finish(original, result, opts) {
|
|
10711
10145
|
let out = result;
|
|
10712
|
-
if (_optionalChain([opts, 'access',
|
|
10146
|
+
if (_optionalChain([opts, 'access', _310 => _310.tokens, 'optionalAccess', _311 => _311.state])) out = resolveCanvasTokens(out, opts.tokens.state, opts.tokens);
|
|
10713
10147
|
if (out.length === original.length && out.every((n, i) => n === original[i])) return original;
|
|
10714
10148
|
return out;
|
|
10715
10149
|
}
|
|
@@ -10869,7 +10303,7 @@ function syncCanvasComponents(before, after, options = {}) {
|
|
|
10869
10303
|
let groups = raw.filter((gr) => gr !== "position" && (gr !== "size" || topRoot && !sizeFromLayout(g, n)));
|
|
10870
10304
|
if (topRoot) groups = groups.filter((gr) => !isOwnRootGroup(gr));
|
|
10871
10305
|
let cleared = [];
|
|
10872
|
-
const srcId = topRoot ? _optionalChain([ni, 'optionalAccess',
|
|
10306
|
+
const srcId = topRoot ? _optionalChain([ni, 'optionalAccess', _312 => _312.componentId]) : getComponentSourceId(n);
|
|
10873
10307
|
const src = g.get(srcId);
|
|
10874
10308
|
if (src) {
|
|
10875
10309
|
const reference = topRoot ? rootReference(g, src) : src;
|
|
@@ -11181,7 +10615,7 @@ function swapCanvasInstance(nodes, ids, componentId, options = {}) {
|
|
|
11181
10615
|
if (g.isAncestor(main, id) || createsCycleIn(g, main, n.parentId)) return fail(nodes, "cycle", "An instance can't show the component it is inside.");
|
|
11182
10616
|
const defaults = effectivePropsIn(g, main, void 0);
|
|
11183
10617
|
const properties = {};
|
|
11184
|
-
for (const [k, d] of Object.entries(defaults)) properties[k] = _optionalChain([inst, 'access',
|
|
10618
|
+
for (const [k, d] of Object.entries(defaults)) properties[k] = _optionalChain([inst, 'access', _313 => _313.properties, 'optionalAccess', _314 => _314[k]]) !== void 0 && typeof inst.properties[k] === typeof d ? inst.properties[k] : d;
|
|
11185
10619
|
updates.set(id, withData(n, { ...dataOf(n), [INSTANCE_DATA_KEY]: { ...inst, componentId: main, properties } }));
|
|
11186
10620
|
if (options.keepTextOverridesOnly) {
|
|
11187
10621
|
for (const d of g.subtree(id)) {
|
|
@@ -11382,6 +10816,289 @@ function restoreCanvasMainComponent(nodes, id, options = {}) {
|
|
|
11382
10816
|
for (const nn of nested) after = rebaseInstance(after, nn, options.tokens);
|
|
11383
10817
|
return done(nodes, after, [compId], options);
|
|
11384
10818
|
}
|
|
10819
|
+
var VARIANT_GAP = 20;
|
|
10820
|
+
var variantKey = (values) => formatVariantName(values);
|
|
10821
|
+
function variantNameProblem(kind, s) {
|
|
10822
|
+
const label = kind === "property" ? "Variant property names" : "Variant values";
|
|
10823
|
+
if (!s) return `${label} must not be empty.`;
|
|
10824
|
+
if (/[,=]/.test(s)) return `${label} can't contain "," or "=".`;
|
|
10825
|
+
return void 0;
|
|
10826
|
+
}
|
|
10827
|
+
function cleanVariantPairs(pairs) {
|
|
10828
|
+
const out = {};
|
|
10829
|
+
for (const [rawKey, rawValue] of Object.entries(pairs)) {
|
|
10830
|
+
if (typeof rawValue !== "string") return `"${rawKey}" takes a text value.`;
|
|
10831
|
+
const k = rawKey.trim();
|
|
10832
|
+
const v = rawValue.trim();
|
|
10833
|
+
const problem = _nullishCoalesce(variantNameProblem("property", k), () => ( variantNameProblem("value", v)));
|
|
10834
|
+
if (problem) return problem;
|
|
10835
|
+
out[k] = v;
|
|
10836
|
+
}
|
|
10837
|
+
return out;
|
|
10838
|
+
}
|
|
10839
|
+
function variantOrder(ids, values) {
|
|
10840
|
+
const order = [];
|
|
10841
|
+
for (const id of ids) for (const k of Object.keys(_nullishCoalesce(values.get(id), () => ( {})))) if (!order.includes(k)) order.push(k);
|
|
10842
|
+
return order;
|
|
10843
|
+
}
|
|
10844
|
+
function withVariantValues(node, values, order) {
|
|
10845
|
+
const name = formatVariantName(values, order);
|
|
10846
|
+
const data = { ...dataOf(node), [COMPONENT_DATA_KEY]: { ..._nullishCoalesce(getComponentData(node), () => ( {})), variant: values }, label: name };
|
|
10847
|
+
if (typeof data.name === "string" && data.name.includes("=")) data.name = name;
|
|
10848
|
+
return same(dataOf(node), data) ? node : withData(node, data);
|
|
10849
|
+
}
|
|
10850
|
+
function closestVariant(list, wanted) {
|
|
10851
|
+
const entries = Object.entries(wanted);
|
|
10852
|
+
let best;
|
|
10853
|
+
const better = (a, b) => {
|
|
10854
|
+
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return a[i] > b[i];
|
|
10855
|
+
return false;
|
|
10856
|
+
};
|
|
10857
|
+
for (const v of list) {
|
|
10858
|
+
const values = getVariantValues(v);
|
|
10859
|
+
const matches2 = entries.map(([k, val]) => values[k] === val ? 1 : 0);
|
|
10860
|
+
const score = [matches2.reduce((a, b) => a + b, 0), ...matches2];
|
|
10861
|
+
if (!best || better(score, best.score)) best = { score, id: v.id };
|
|
10862
|
+
}
|
|
10863
|
+
return _optionalChain([best, 'optionalAccess', _315 => _315.id]);
|
|
10864
|
+
}
|
|
10865
|
+
function variantEditIn(g, setId) {
|
|
10866
|
+
const set = g.get(setId);
|
|
10867
|
+
if (!isCanvasComponentSet(set)) return { code: "not-found", reason: "Choose a component set." };
|
|
10868
|
+
if (owningInstanceIn(g, setId)) return { code: "inside-instance", reason: "A component set inside an instance can't be edited: edit its main." };
|
|
10869
|
+
const variants = variantsIn(g, setId);
|
|
10870
|
+
return { set, variants, values: new Map(variants.map((v) => [v.id, getVariantValues(v)])) };
|
|
10871
|
+
}
|
|
10872
|
+
function addMissingProperties(edit, pairs, defaultValue) {
|
|
10873
|
+
const known = /* @__PURE__ */ new Set();
|
|
10874
|
+
for (const v of edit.values.values()) for (const k of Object.keys(v)) known.add(k);
|
|
10875
|
+
const added = Object.keys(pairs).filter((k) => !known.has(k));
|
|
10876
|
+
if (added.length === 0) return void 0;
|
|
10877
|
+
const problem = variantNameProblem("value", defaultValue);
|
|
10878
|
+
if (problem) return problem;
|
|
10879
|
+
const defs = _optionalChain([dataOf, 'call', _316 => _316(edit.set), 'access', _317 => _317[COMPONENT_SET_DATA_KEY], 'optionalAccess', _318 => _318.properties]);
|
|
10880
|
+
const clash = isRecord(defs) ? added.find((k) => k in defs) : void 0;
|
|
10881
|
+
if (clash) return `"${clash}" is a component property.`;
|
|
10882
|
+
for (const [id, v] of edit.values) {
|
|
10883
|
+
const next = { ...v };
|
|
10884
|
+
for (const k of added) next[k] = defaultValue;
|
|
10885
|
+
edit.values.set(id, next);
|
|
10886
|
+
}
|
|
10887
|
+
return void 0;
|
|
10888
|
+
}
|
|
10889
|
+
function duplicateAmong(values, ids) {
|
|
10890
|
+
for (const id of ids) {
|
|
10891
|
+
const key = variantKey(values.get(id));
|
|
10892
|
+
for (const [other, v] of values) {
|
|
10893
|
+
if (other !== id && variantKey(v) === key) return formatVariantName(values.get(id), variantOrder([...values.keys()], values));
|
|
10894
|
+
}
|
|
10895
|
+
}
|
|
10896
|
+
return void 0;
|
|
10897
|
+
}
|
|
10898
|
+
function writeVariantEdit(edit, extra = []) {
|
|
10899
|
+
const order = variantOrder([...edit.variants.map((v) => v.id), ...extra], edit.values);
|
|
10900
|
+
const updates = /* @__PURE__ */ new Map();
|
|
10901
|
+
for (const v of edit.variants) {
|
|
10902
|
+
const next = withVariantValues(v, edit.values.get(v.id), order);
|
|
10903
|
+
if (next !== v) updates.set(v.id, next);
|
|
10904
|
+
}
|
|
10905
|
+
return updates;
|
|
10906
|
+
}
|
|
10907
|
+
function nextVariantValuesIn(g, setId, fromId) {
|
|
10908
|
+
const variants = variantsIn(g, setId);
|
|
10909
|
+
const base = getVariantValues(g.get(fromId));
|
|
10910
|
+
const first = variantOptionsIn(g, setId)[0];
|
|
10911
|
+
const prop = _nullishCoalesce(_optionalChain([first, 'optionalAccess', _319 => _319.name]), () => ( "Property 1"));
|
|
10912
|
+
const used = new Set(variants.map((v) => variantKey(getVariantValues(v))));
|
|
10913
|
+
for (let k = variants.length + 1; ; k++) {
|
|
10914
|
+
const values = { ...base, [prop]: `Variant${k}` };
|
|
10915
|
+
if (!_optionalChain([first, 'optionalAccess', _320 => _320.values, 'access', _321 => _321.includes, 'call', _322 => _322(`Variant${k}`)]) && !used.has(variantKey(values))) return values;
|
|
10916
|
+
}
|
|
10917
|
+
}
|
|
10918
|
+
function getNextVariantValues(nodes, setId, from) {
|
|
10919
|
+
const g = new Graph(nodes);
|
|
10920
|
+
return nextVariantValuesIn(g, setId, _nullishCoalesce(from, () => ( defaultVariantIn(g, setId))));
|
|
10921
|
+
}
|
|
10922
|
+
function relayoutSet(nodes, setId, options) {
|
|
10923
|
+
if (options.layout === false || !getAutoLayout(nodes.find((n) => n.id === setId))) return nodes;
|
|
10924
|
+
return applyNodeUpdates(nodes, layoutUpMany(nodes, [setId], typeof options.layout === "object" ? options.layout : {}));
|
|
10925
|
+
}
|
|
10926
|
+
function addCanvasVariant(nodes, setId, options = {}) {
|
|
10927
|
+
const g = new Graph(nodes);
|
|
10928
|
+
const edit = variantEditIn(g, setId);
|
|
10929
|
+
if (!("set" in edit)) return fail(nodes, edit.code, edit.reason);
|
|
10930
|
+
if (edit.variants.length === 0) return fail(nodes, "invalid", "The set has no variant to duplicate.");
|
|
10931
|
+
const fromId = _nullishCoalesce(options.from, () => ( defaultVariantIn(g, setId)));
|
|
10932
|
+
const source = edit.variants.find((v) => v.id === fromId);
|
|
10933
|
+
if (!source) return fail(nodes, "not-found", `"${fromId}" is not a variant of this set.`);
|
|
10934
|
+
const wanted = cleanVariantPairs(_nullishCoalesce(options.variant, () => ( nextVariantValuesIn(g, setId, fromId))));
|
|
10935
|
+
if (typeof wanted === "string") return fail(nodes, "invalid", wanted);
|
|
10936
|
+
const problem = addMissingProperties(edit, wanted, (_nullishCoalesce(options.defaultValue, () => ( "Default"))).trim());
|
|
10937
|
+
if (problem) return fail(nodes, "invalid", problem);
|
|
10938
|
+
const id = _nullishCoalesce(options.id, () => ( uniqueId(`${setId}-variant`, g.byId)));
|
|
10939
|
+
if (g.get(id)) return fail(nodes, "invalid", `Id "${id}" is taken.`);
|
|
10940
|
+
edit.values.set(id, { ...edit.values.get(fromId), ...wanted });
|
|
10941
|
+
const dup = duplicateAmong(edit.values, [id]);
|
|
10942
|
+
if (dup) return fail(nodes, "invalid", `A variant with ${dup} exists already.`);
|
|
10943
|
+
const autoLayout = !!getAutoLayout(edit.set);
|
|
10944
|
+
const { width, height } = getNodeSize(source);
|
|
10945
|
+
let position = options.position ? { ...options.position } : { ...source.position };
|
|
10946
|
+
if (!options.position && !autoLayout) {
|
|
10947
|
+
const rects = edit.variants.map((v) => ({ ...v.position, ...getNodeSize(v) }));
|
|
10948
|
+
position = { x: source.position.x + width + VARIANT_GAP, y: source.position.y };
|
|
10949
|
+
for (let k = 0; k <= rects.length; k++) {
|
|
10950
|
+
const hit = rects.find((r) => position.x < r.x + r.width && r.x < position.x + width && position.y < r.y + r.height && r.y < position.y + height);
|
|
10951
|
+
if (!hit) break;
|
|
10952
|
+
position = { x: hit.x + hit.width + VARIANT_GAP, y: position.y };
|
|
10953
|
+
}
|
|
10954
|
+
}
|
|
10955
|
+
const taken = new Set(g.byId.keys());
|
|
10956
|
+
taken.add(id);
|
|
10957
|
+
const map = /* @__PURE__ */ new Map([[fromId, id]]);
|
|
10958
|
+
const sub3 = g.subtree(fromId);
|
|
10959
|
+
for (const d of sub3) {
|
|
10960
|
+
if (d === fromId) continue;
|
|
10961
|
+
const nid = uniqueId(`${id}-${d}`, taken);
|
|
10962
|
+
taken.add(nid);
|
|
10963
|
+
map.set(d, nid);
|
|
10964
|
+
}
|
|
10965
|
+
const order = variantOrder([...edit.variants.map((v) => v.id), id], edit.values);
|
|
10966
|
+
const subSet = new Set(sub3);
|
|
10967
|
+
const copies = nodes.filter((n) => subSet.has(n.id)).map((n) => {
|
|
10968
|
+
const next = { ...n, id: map.get(n.id) };
|
|
10969
|
+
if (n.parentId !== void 0 && n.id !== fromId) next.parentId = _nullishCoalesce(map.get(n.parentId), () => ( n.parentId));
|
|
10970
|
+
for (const k of RUNTIME_KEYS) delete next[k];
|
|
10971
|
+
if (n.id !== fromId) return next;
|
|
10972
|
+
next.position = position;
|
|
10973
|
+
return withVariantValues(next, edit.values.get(id), order);
|
|
10974
|
+
});
|
|
10975
|
+
const updates = writeVariantEdit(edit, [id]);
|
|
10976
|
+
const inSet = new Set(g.subtree(setId));
|
|
10977
|
+
let last = -1;
|
|
10978
|
+
nodes.forEach((n, i) => {
|
|
10979
|
+
if (inSet.has(n.id)) last = i;
|
|
10980
|
+
});
|
|
10981
|
+
let after = [];
|
|
10982
|
+
nodes.forEach((n, i) => {
|
|
10983
|
+
after.push(_nullishCoalesce(updates.get(n.id), () => ( n)));
|
|
10984
|
+
if (i === last) after.push(...copies);
|
|
10985
|
+
});
|
|
10986
|
+
if (autoLayout && !options.position) after = relayoutSet(after, setId, options);
|
|
10987
|
+
else {
|
|
10988
|
+
const size = getNodeSize(edit.set);
|
|
10989
|
+
const w = Math.max(size.width, position.x + width + VARIANT_GAP);
|
|
10990
|
+
const h = Math.max(size.height, position.y + height + VARIANT_GAP);
|
|
10991
|
+
if (w !== size.width || h !== size.height) after = applyNodeUpdates(after, [{ id: setId, width: w, height: h }]);
|
|
10992
|
+
}
|
|
10993
|
+
return done(nodes, after, [id], options);
|
|
10994
|
+
}
|
|
10995
|
+
function removeCanvasVariant(nodes, variantId, options = {}) {
|
|
10996
|
+
const g = new Graph(nodes);
|
|
10997
|
+
const set = variantSetIn(g, variantId);
|
|
10998
|
+
if (!set) return fail(nodes, "not-found", "Choose a variant of a component set.");
|
|
10999
|
+
if (owningInstanceIn(g, set.id)) return fail(nodes, "inside-instance", "A component set inside an instance can't be edited: edit its main.");
|
|
11000
|
+
const others = variantsIn(g, set.id).filter((v) => v.id !== variantId);
|
|
11001
|
+
if (others.length === 0) return fail(nodes, "invalid", "A component set needs at least one variant: delete the set instead.");
|
|
11002
|
+
const replacement = closestVariant(others, getVariantValues(g.get(variantId)));
|
|
11003
|
+
const swap = (v) => v === variantId ? replacement : v;
|
|
11004
|
+
const repointed = nodes.map((n) => {
|
|
11005
|
+
const data = dataOf(n);
|
|
11006
|
+
let next;
|
|
11007
|
+
const inst = getInstanceData(n);
|
|
11008
|
+
if (inst) {
|
|
11009
|
+
const moved = { ...inst, componentId: swap(inst.componentId) };
|
|
11010
|
+
if (inst.properties) moved.properties = Object.fromEntries(Object.entries(inst.properties).map(([k, v]) => [k, swap(v)]));
|
|
11011
|
+
if (!same(moved, inst)) next = { ...data, [INSTANCE_DATA_KEY]: moved };
|
|
11012
|
+
}
|
|
11013
|
+
for (const key of [COMPONENT_DATA_KEY, COMPONENT_SET_DATA_KEY]) {
|
|
11014
|
+
const owner = data[key];
|
|
11015
|
+
if (!isRecord(owner) || !isRecord(owner.properties)) continue;
|
|
11016
|
+
const defs = {};
|
|
11017
|
+
for (const [k, def] of Object.entries(owner.properties)) {
|
|
11018
|
+
defs[k] = def.type === "instanceSwap" ? { ...def, default: swap(def.default), ...def.preferred ? { preferred: [...new Set(def.preferred.map(swap))] } : {} } : def;
|
|
11019
|
+
}
|
|
11020
|
+
if (!same(defs, owner.properties)) next = { ..._nullishCoalesce(next, () => ( data)), [key]: { ...owner, properties: defs } };
|
|
11021
|
+
}
|
|
11022
|
+
return next ? withData(n, next) : n;
|
|
11023
|
+
});
|
|
11024
|
+
const mid = syncCanvasComponents(nodes, repointed, options);
|
|
11025
|
+
const gone = new Set(new Graph(mid).subtree(variantId));
|
|
11026
|
+
const after = relayoutSet(
|
|
11027
|
+
mid.filter((n) => !gone.has(n.id)),
|
|
11028
|
+
set.id,
|
|
11029
|
+
options
|
|
11030
|
+
);
|
|
11031
|
+
return { ok: true, nodes: syncCanvasComponents(mid, after, options), ids: [replacement] };
|
|
11032
|
+
}
|
|
11033
|
+
function setCanvasVariantProperties(nodes, variantId, values, options = {}) {
|
|
11034
|
+
const g = new Graph(nodes);
|
|
11035
|
+
const set = variantSetIn(g, variantId);
|
|
11036
|
+
if (!set) return fail(nodes, "not-found", "Choose a variant of a component set.");
|
|
11037
|
+
const edit = variantEditIn(g, set.id);
|
|
11038
|
+
if (!("set" in edit)) return fail(nodes, edit.code, edit.reason);
|
|
11039
|
+
const wanted = cleanVariantPairs(values);
|
|
11040
|
+
if (typeof wanted === "string") return fail(nodes, "invalid", wanted);
|
|
11041
|
+
const problem = addMissingProperties(edit, wanted, (_nullishCoalesce(options.defaultValue, () => ( "Default"))).trim());
|
|
11042
|
+
if (problem) return fail(nodes, "invalid", problem);
|
|
11043
|
+
edit.values.set(variantId, { ...edit.values.get(variantId), ...wanted });
|
|
11044
|
+
const dup = duplicateAmong(edit.values, [variantId]);
|
|
11045
|
+
if (dup) return fail(nodes, "invalid", `A variant with ${dup} exists already.`);
|
|
11046
|
+
const updates = writeVariantEdit(edit);
|
|
11047
|
+
if (updates.size === 0) return { ok: true, nodes, ids: [variantId] };
|
|
11048
|
+
return done(nodes, nodes.map((n) => _nullishCoalesce(updates.get(n.id), () => ( n))), [variantId], options);
|
|
11049
|
+
}
|
|
11050
|
+
function updateInstanceValues(g, setId, updates, fn) {
|
|
11051
|
+
const ids = new Set(variantsIn(g, setId).map((v) => v.id));
|
|
11052
|
+
for (const n of g.nodes) {
|
|
11053
|
+
const inst = getInstanceData(n);
|
|
11054
|
+
if (!_optionalChain([inst, 'optionalAccess', _323 => _323.properties]) || !ids.has(inst.componentId)) continue;
|
|
11055
|
+
const props = fn({ ...inst.properties });
|
|
11056
|
+
if (same(props, inst.properties)) continue;
|
|
11057
|
+
const cur = _nullishCoalesce(updates.get(n.id), () => ( n));
|
|
11058
|
+
updates.set(n.id, withData(cur, { ...dataOf(cur), [INSTANCE_DATA_KEY]: { ...inst, properties: props } }));
|
|
11059
|
+
}
|
|
11060
|
+
}
|
|
11061
|
+
function renameCanvasVariantProperty(nodes, setId, name, newName, options = {}) {
|
|
11062
|
+
const g = new Graph(nodes);
|
|
11063
|
+
const edit = variantEditIn(g, setId);
|
|
11064
|
+
if (!("set" in edit)) return fail(nodes, edit.code, edit.reason);
|
|
11065
|
+
const known = variantOptionsIn(g, setId);
|
|
11066
|
+
if (!known.some((o) => o.name === name)) return fail(nodes, "unknown-property", `Unknown variant property "${name}".`);
|
|
11067
|
+
const to = newName.trim();
|
|
11068
|
+
const problem = variantNameProblem("property", to);
|
|
11069
|
+
if (problem) return fail(nodes, "invalid", problem);
|
|
11070
|
+
if (to === name) return { ok: true, nodes, ids: [setId] };
|
|
11071
|
+
if (known.some((o) => o.name === to)) return fail(nodes, "invalid", `"${to}" exists already.`);
|
|
11072
|
+
if (to in propertyDefsIn(g, edit.variants[0].id)) return fail(nodes, "invalid", `"${to}" is a component property.`);
|
|
11073
|
+
const rename = (v) => Object.fromEntries(Object.entries(v).map(([k, val]) => [k === name ? to : k, val]));
|
|
11074
|
+
for (const [id, v] of edit.values) edit.values.set(id, rename(v));
|
|
11075
|
+
const updates = writeVariantEdit(edit);
|
|
11076
|
+
updateInstanceValues(g, setId, updates, (props) => name in props ? rename(props) : props);
|
|
11077
|
+
return done(nodes, nodes.map((n) => _nullishCoalesce(updates.get(n.id), () => ( n))), [setId], options);
|
|
11078
|
+
}
|
|
11079
|
+
function renameCanvasVariantValue(nodes, setId, property, value, newValue, options = {}) {
|
|
11080
|
+
const g = new Graph(nodes);
|
|
11081
|
+
const edit = variantEditIn(g, setId);
|
|
11082
|
+
if (!("set" in edit)) return fail(nodes, edit.code, edit.reason);
|
|
11083
|
+
const option = variantOptionsIn(g, setId).find((o) => o.name === property);
|
|
11084
|
+
if (!option) return fail(nodes, "unknown-property", `Unknown variant property "${property}".`);
|
|
11085
|
+
if (!option.values.includes(value)) return fail(nodes, "invalid", `"${property}" has no value "${value}".`);
|
|
11086
|
+
const to = newValue.trim();
|
|
11087
|
+
const problem = variantNameProblem("value", to);
|
|
11088
|
+
if (problem) return fail(nodes, "invalid", problem);
|
|
11089
|
+
if (to === value) return { ok: true, nodes, ids: [setId] };
|
|
11090
|
+
const touched = [];
|
|
11091
|
+
for (const [id, v] of edit.values) {
|
|
11092
|
+
if (v[property] !== value) continue;
|
|
11093
|
+
edit.values.set(id, { ...v, [property]: to });
|
|
11094
|
+
touched.push(id);
|
|
11095
|
+
}
|
|
11096
|
+
const dup = duplicateAmong(edit.values, touched);
|
|
11097
|
+
if (dup) return fail(nodes, "invalid", `A variant with ${dup} exists already.`);
|
|
11098
|
+
const updates = writeVariantEdit(edit);
|
|
11099
|
+
updateInstanceValues(g, setId, updates, (props) => props[property] === value ? { ...props, [property]: to } : props);
|
|
11100
|
+
return done(nodes, nodes.map((n) => _nullishCoalesce(updates.get(n.id), () => ( n))), [setId], options);
|
|
11101
|
+
}
|
|
11385
11102
|
|
|
11386
11103
|
// src/canvas/componentsController.ts
|
|
11387
11104
|
function makePatch(from, to) {
|
|
@@ -11418,7 +11135,7 @@ function createCanvasComponentsController(options) {
|
|
|
11418
11135
|
layout: options.layout,
|
|
11419
11136
|
tokens: options.tokens
|
|
11420
11137
|
});
|
|
11421
|
-
const selection = (ids) => ids ? [...ids] : _nullishCoalesce(_optionalChain([options, 'access',
|
|
11138
|
+
const selection = (ids) => ids ? [...ids] : _nullishCoalesce(_optionalChain([options, 'access', _324 => _324.getSelectedIds, 'optionalCall', _325 => _325()]), () => ( options.getNodes().filter((n) => n.selected).map((n) => n.id)));
|
|
11422
11139
|
const target = (id) => _nullishCoalesce(id, () => ( selection()[0]));
|
|
11423
11140
|
function set(next) {
|
|
11424
11141
|
synced = next;
|
|
@@ -11449,6 +11166,24 @@ function createCanvasComponentsController(options) {
|
|
|
11449
11166
|
}
|
|
11450
11167
|
const reason = (result) => result.ok ? true : result.reason;
|
|
11451
11168
|
const nodes = () => options.getNodes();
|
|
11169
|
+
const refused = (why) => ({ ok: false, nodes: nodes(), code: "not-found", reason: why });
|
|
11170
|
+
const setOf = (id) => {
|
|
11171
|
+
const at = target(id);
|
|
11172
|
+
const node = at ? nodes().find((n) => n.id === at) : void 0;
|
|
11173
|
+
if (!node) return void 0;
|
|
11174
|
+
return isCanvasComponentSet(node) ? node.id : getVariantSet(nodes(), node.id);
|
|
11175
|
+
};
|
|
11176
|
+
const variantOf = (id) => {
|
|
11177
|
+
const at = target(id);
|
|
11178
|
+
return at && getVariantSet(nodes(), at) ? at : void 0;
|
|
11179
|
+
};
|
|
11180
|
+
const NO_SET = "Select a component set or one of its variants.";
|
|
11181
|
+
const NO_VARIANT = "Select a variant of a component set.";
|
|
11182
|
+
const addOptions = (setId, addOptions_) => {
|
|
11183
|
+
if (addOptions_.from !== void 0 || setId !== void 0) return addOptions_;
|
|
11184
|
+
const v = variantOf();
|
|
11185
|
+
return v ? { ...addOptions_, from: v } : addOptions_;
|
|
11186
|
+
};
|
|
11452
11187
|
const controller = {
|
|
11453
11188
|
sync,
|
|
11454
11189
|
/** Rebuilds every instance from its main (e.g. after loading), not recorded in history. */
|
|
@@ -11563,6 +11298,63 @@ function createCanvasComponentsController(options) {
|
|
|
11563
11298
|
(n) => setCanvasComponentProperty(n, componentId, name, def, { ...syncOptions(), ...propertyOptions })
|
|
11564
11299
|
);
|
|
11565
11300
|
},
|
|
11301
|
+
/**
|
|
11302
|
+
* Adds a variant to a set (default: the selection's set) by duplicating `from` (default:
|
|
11303
|
+
* the selected variant, else the default variant) with the given `variant` values.
|
|
11304
|
+
*/
|
|
11305
|
+
addVariant(setId, variantOptions = {}) {
|
|
11306
|
+
const set2 = setOf(setId);
|
|
11307
|
+
if (!set2) return refused(NO_SET);
|
|
11308
|
+
const opts = addOptions(setId, variantOptions);
|
|
11309
|
+
return run("Add Variant", (n) => addCanvasVariant(n, set2, { ...syncOptions(), ...opts }));
|
|
11310
|
+
},
|
|
11311
|
+
canAddVariant(setId, variantOptions = {}) {
|
|
11312
|
+
const set2 = setOf(setId);
|
|
11313
|
+
return set2 ? reason(addCanvasVariant(nodes(), set2, { ...addOptions(setId, variantOptions), layout: false })) : NO_SET;
|
|
11314
|
+
},
|
|
11315
|
+
/** Removes a variant (default: the selected one); its instances switch to the closest variant. */
|
|
11316
|
+
removeVariant(variantId) {
|
|
11317
|
+
const v = variantOf(variantId);
|
|
11318
|
+
if (!v) return refused(NO_VARIANT);
|
|
11319
|
+
return run("Remove Variant", (n) => removeCanvasVariant(n, v, syncOptions()));
|
|
11320
|
+
},
|
|
11321
|
+
canRemoveVariant(variantId) {
|
|
11322
|
+
const v = variantOf(variantId);
|
|
11323
|
+
return v ? reason(removeCanvasVariant(nodes(), v, { layout: false })) : NO_VARIANT;
|
|
11324
|
+
},
|
|
11325
|
+
/** Edits a variant's property values (default: the selected variant). */
|
|
11326
|
+
setVariantProperties(values, variantId, variantOptions = {}) {
|
|
11327
|
+
const v = variantOf(variantId);
|
|
11328
|
+
if (!v) return refused(NO_VARIANT);
|
|
11329
|
+
return run("Edit Variant", (n) => setCanvasVariantProperties(n, v, values, { ...syncOptions(), ...variantOptions }));
|
|
11330
|
+
},
|
|
11331
|
+
canSetVariantProperties(values, variantId) {
|
|
11332
|
+
const v = variantOf(variantId);
|
|
11333
|
+
if (!v) return NO_VARIANT;
|
|
11334
|
+
return values ? reason(setCanvasVariantProperties(nodes(), v, values, { layout: false })) : true;
|
|
11335
|
+
},
|
|
11336
|
+
/** Renames a variant property across a set (default: the selection's set). */
|
|
11337
|
+
renameVariantProperty(name, newName, setId) {
|
|
11338
|
+
const set2 = setOf(setId);
|
|
11339
|
+
if (!set2) return refused(NO_SET);
|
|
11340
|
+
return run("Rename Variant Property", (n) => renameCanvasVariantProperty(n, set2, name, newName, syncOptions()));
|
|
11341
|
+
},
|
|
11342
|
+
canRenameVariantProperty(name, newName, setId) {
|
|
11343
|
+
const set2 = setOf(setId);
|
|
11344
|
+
if (!set2) return NO_SET;
|
|
11345
|
+
return name !== void 0 && newName !== void 0 ? reason(renameCanvasVariantProperty(nodes(), set2, name, newName, { layout: false })) : true;
|
|
11346
|
+
},
|
|
11347
|
+
/** Renames a value of a variant property across a set (default: the selection's set). */
|
|
11348
|
+
renameVariantValue(property, value, newValue, setId) {
|
|
11349
|
+
const set2 = setOf(setId);
|
|
11350
|
+
if (!set2) return refused(NO_SET);
|
|
11351
|
+
return run("Rename Variant Value", (n) => renameCanvasVariantValue(n, set2, property, value, newValue, syncOptions()));
|
|
11352
|
+
},
|
|
11353
|
+
canRenameVariantValue(property, value, newValue, setId) {
|
|
11354
|
+
const set2 = setOf(setId);
|
|
11355
|
+
if (!set2) return NO_SET;
|
|
11356
|
+
return property !== void 0 && value !== void 0 && newValue !== void 0 ? reason(renameCanvasVariantValue(nodes(), set2, property, value, newValue, { layout: false })) : true;
|
|
11357
|
+
},
|
|
11566
11358
|
/** Binds (or with `null` unbinds) a main layer's field to a component property. */
|
|
11567
11359
|
bindComponentProperty(layerId, field, name) {
|
|
11568
11360
|
return run("Bind Component Property", (n) => bindCanvasComponentProperty(n, layerId, field, name, syncOptions()));
|
|
@@ -11572,12 +11364,12 @@ function createCanvasComponentsController(options) {
|
|
|
11572
11364
|
const at = target(id);
|
|
11573
11365
|
const list = sync();
|
|
11574
11366
|
const inst = at ? getOwningInstance(list, at) : void 0;
|
|
11575
|
-
const main = inst ? _optionalChain([getInstanceData, 'call',
|
|
11367
|
+
const main = inst ? _optionalChain([getInstanceData, 'call', _326 => _326(list.find((n) => n.id === inst)), 'optionalAccess', _327 => _327.componentId]) : void 0;
|
|
11576
11368
|
const node = main ? list.find((n) => n.id === main) : void 0;
|
|
11577
11369
|
if (!node) return void 0;
|
|
11578
11370
|
const next = list.map((n) => !!n.selected === (n.id === main) ? n : { ...n, selected: n.id === main });
|
|
11579
11371
|
set(next);
|
|
11580
|
-
_optionalChain([options, 'access',
|
|
11372
|
+
_optionalChain([options, 'access', _328 => _328.onReveal, 'optionalCall', _329 => _329(next.find((n) => n.id === main))]);
|
|
11581
11373
|
return main;
|
|
11582
11374
|
},
|
|
11583
11375
|
canGoToMainComponent(id) {
|
|
@@ -11602,7 +11394,7 @@ function createCanvasComponentsController(options) {
|
|
|
11602
11394
|
}
|
|
11603
11395
|
var CANVAS_COMPONENT_DRAG_TYPE = "application/x-pixerate-component";
|
|
11604
11396
|
function getCanvasComponentDragId(dataTransfer) {
|
|
11605
|
-
const id = _optionalChain([dataTransfer, 'optionalAccess',
|
|
11397
|
+
const id = _optionalChain([dataTransfer, 'optionalAccess', _330 => _330.getData, 'call', _331 => _331(CANVAS_COMPONENT_DRAG_TYPE)]);
|
|
11606
11398
|
return id ? id : void 0;
|
|
11607
11399
|
}
|
|
11608
11400
|
|
|
@@ -11954,5 +11746,11 @@ function getCanvasComponentDragId(dataTransfer) {
|
|
|
11954
11746
|
|
|
11955
11747
|
|
|
11956
11748
|
|
|
11957
|
-
exports.ANIMATABLE_PROPERTIES = ANIMATABLE_PROPERTIES; exports.ANIMATION_DATA_KEY = ANIMATION_DATA_KEY; exports.ANIMATION_EASING_LABELS = ANIMATION_EASING_LABELS; exports.ANIMATION_EASING_PRESETS = ANIMATION_EASING_PRESETS; exports.ANIMATION_TIME_EPSILON = ANIMATION_TIME_EPSILON; exports.AUTO_LAYOUT_DATA_KEY = AUTO_LAYOUT_DATA_KEY; exports.AnimationEditError = AnimationEditError; exports.AnimationPlayer = AnimationPlayer; exports.CANVAS_COMPONENT_DRAG_TYPE = CANVAS_COMPONENT_DRAG_TYPE; exports.CANVAS_TOKEN_PROPERTIES = CANVAS_TOKEN_PROPERTIES; exports.CHILD_LAYOUT_DATA_KEY = CHILD_LAYOUT_DATA_KEY; exports.COMPONENT_DATA_KEY = COMPONENT_DATA_KEY; exports.COMPONENT_OVERRIDES_DATA_KEY = COMPONENT_OVERRIDES_DATA_KEY; exports.COMPONENT_PROPERTY_REFS_DATA_KEY = COMPONENT_PROPERTY_REFS_DATA_KEY; exports.COMPONENT_SET_DATA_KEY = COMPONENT_SET_DATA_KEY; exports.COMPONENT_SOURCE_DATA_KEY = COMPONENT_SOURCE_DATA_KEY; exports.CONNECTION_LINE_TYPES = CONNECTION_LINE_TYPES; exports.CSS_ANIMATION_PROPERTIES = CSS_ANIMATION_PROPERTIES; exports.CUBIC_BEZIER_PRESETS = CUBIC_BEZIER_PRESETS; exports.CanvasScenesStore = CanvasScenesStore; exports.DEFAULT_ARRANGE_SHORTCUTS = _chunk26BVFKHUcjs.DEFAULT_ARRANGE_SHORTCUTS; exports.DEFAULT_NODE_HEIGHT = _chunkWADCJ7A7cjs.DEFAULT_NODE_HEIGHT; exports.DEFAULT_NODE_WIDTH = _chunkWADCJ7A7cjs.DEFAULT_NODE_WIDTH; exports.DEFAULT_PLACEMENT_GAP = _chunkWADCJ7A7cjs.DEFAULT_PLACEMENT_GAP; exports.INSTANCE_DATA_KEY = INSTANCE_DATA_KEY; exports.LOCKED_DATA_KEY = LOCKED_DATA_KEY; exports.LOCKED_PREVIOUS_FLAGS_KEY = LOCKED_PREVIOUS_FLAGS_KEY; exports.MAX_KEYFRAME_REFS = MAX_KEYFRAME_REFS; exports.ManualClock = ManualClock; exports.PathOpsError = PathOpsError; exports.RESIZE_HANDLES = RESIZE_HANDLES; exports.SHAPE_DATA_KEY = SHAPE_DATA_KEY; exports.SHAPE_KINDS = SHAPE_KINDS; exports.SHAPE_NODE_TYPE = SHAPE_NODE_TYPE; exports.SHAPE_OPERATIONS = SHAPE_OPERATIONS; exports.StreamingLayoutManager = StreamingLayoutManager; exports.TOKEN_BINDINGS_DATA_KEY = TOKEN_BINDINGS_DATA_KEY; exports.TOKEN_MODES_DATA_KEY = TOKEN_MODES_DATA_KEY; exports.addKeyframesAtTime = addKeyframesAtTime; exports.alignNodes = alignNodes; exports.animateNode = animateNode; exports.applyAnimation = applyAnimation; exports.applyAnimationOverrides = applyAnimationOverrides; exports.applyConstraints = applyConstraints; exports.applyNodeUpdates = applyNodeUpdates; exports.applyShapeCombination = applyShapeCombination; exports.applyShapeReplacement = applyShapeReplacement; exports.arcToCubics = arcToCubics; exports.bezierPathArea = bezierPathArea; exports.bezierPathBounds = bezierPathBounds; exports.bezierPathLength = bezierPathLength; exports.bezierPathPointAtLength = bezierPathPointAtLength; exports.bezierPathSignedArea = bezierPathSignedArea; exports.bezierPathToSvg = bezierPathToSvg; exports.bindCanvasComponentProperty = bindCanvasComponentProperty; exports.bindCanvasToken = bindCanvasToken; exports.blendLayout = blendLayout; exports.boundsOf = _chunkWADCJ7A7cjs.boundsOf; exports.calculateDagreReflowDisplacement = calculateDagreReflowDisplacement; exports.calculateDirectionalDisplacement = calculateDirectionalDisplacement; exports.canCombineShapeNodes = canCombineShapeNodes; exports.canOffsetShapeNodes = canOffsetShapeNodes; exports.canOutlineShapeNodeStrokes = canOutlineShapeNodeStrokes; exports.canvasHeight = canvasHeight; exports.centerNodes = _chunkWADCJ7A7cjs.centerNodes; exports.centre = _chunkWADCJ7A7cjs.centre; exports.clampAnimationValue = clampAnimationValue; exports.clampLayoutSize = clampLayoutSize; exports.closeContour = closeContour; exports.collectDescendantIds = collectDescendantIds; exports.combineCanvasComponentsAsVariants = combineCanvasComponentsAsVariants; exports.combineShapeNodes = combineShapeNodes; exports.computeNodesBoundingBox = computeNodesBoundingBox; exports.computeSnapGuides = computeSnapGuides; exports.connectedOnly = connectedOnly; exports.contourSignedArea = contourSignedArea; exports.contoursToPath = contoursToPath; exports.copyKeyframes = copyKeyframes; exports.countPathSegments = countPathSegments; exports.createAnimationPlayer = createAnimationPlayer; exports.createBezierTrajectory = createBezierTrajectory; exports.createCanvasAnimationController = createCanvasAnimationController; exports.createCanvasArrangeController = createCanvasArrangeController; exports.createCanvasAutoLayoutController = createCanvasAutoLayoutController; exports.createCanvasComponent = createCanvasComponent; exports.createCanvasComponentsController = createCanvasComponentsController; exports.createCanvasInstance = createCanvasInstance; exports.createCanvasScenesStore = createCanvasScenesStore; exports.createFanOutTrajectory = createFanOutTrajectory; exports.createGuideIndex = createGuideIndex; exports.createNodeGuideIndex = createNodeGuideIndex; exports.createNodeLookup = createNodeLookup; exports.cubicBezierAt = cubicBezierAt; exports.cubicPointAt = cubicPointAt; exports.cubicsToPathData = cubicsToPathData; exports.dashContours = dashContours; exports.defaultEasing = defaultEasing; exports.deleteKeyframes = deleteKeyframes; exports.detachCanvasInstance = detachCanvasInstance; exports.detachTokenBindings = detachTokenBindings; exports.diffOverrideGroups = diffOverrideGroups; exports.distanceToBezierPath = distanceToBezierPath; exports.distributeNodes = distributeNodes; exports.dividePaths = dividePaths; exports.dividePolygons = dividePolygons; exports.easingFromInfluence = easingFromInfluence; exports.easingLabel = easingLabel; exports.easingToCss = easingToCss; exports.ensureLayout = _chunkWADCJ7A7cjs.ensureLayout; exports.estimateCanvasHeight = estimateCanvasHeight; exports.estimateNodeSize = _chunkWADCJ7A7cjs.estimateNodeSize; exports.evaluateAnimation = evaluateAnimation; exports.evaluateEasing = evaluateEasing; exports.evaluateTrack = evaluateTrack; exports.excludePaths = excludePaths; exports.exportCssAnimation = exportCssAnimation; exports.findConnectorSnap = findConnectorSnap; exports.findVariant = findVariant; exports.fitCubicRun = fitCubicRun; exports.fitCubics = fitCubics; exports.fitFreehandPath = fitFreehandPath; exports.fitPathData = fitPathData; exports.fitViewportToNodes = fitViewportToNodes; exports.fitViewportToRect = fitViewportToRect; exports.flattenSvgPath = flattenSvgPath; exports.flowSide = _chunkWADCJ7A7cjs.flowSide; exports.formatAnimationTime = formatAnimationTime; exports.formatNumber = formatNumber2; exports.formatOklab = formatOklab; exports.formatVariantName = formatVariantName; exports.getAbsolutePosition = getAbsolutePosition; exports.getAnimatableProperty = getAnimatableProperty; exports.getAnimatedProperties = getAnimatedProperties; exports.getAnimatedValue = getAnimatedValue; exports.getAnimationDuration = getAnimationDuration; exports.getAnimationTrack = getAnimationTrack; exports.getAutoLayout = getAutoLayout; exports.getAutoLayoutGrid = getAutoLayoutGrid; exports.getAutoLayoutInsertTarget = getAutoLayoutInsertTarget; exports.getBindableTokenProperties = getBindableTokenProperties; exports.getCanvasComponentDragId = getCanvasComponentDragId; exports.getCanvasTokenProperty = getCanvasTokenProperty; exports.getCenteredNodePosition = _chunkWADCJ7A7cjs.getCenteredNodePosition; exports.getChildLayout = getChildLayout; exports.getComponentData = getComponentData; exports.getComponentInstances = getComponentInstances; exports.getComponentPropertyDefs = getComponentPropertyDefs; exports.getComponentPropertyRefs = getComponentPropertyRefs; exports.getComponentSourceId = getComponentSourceId; exports.getCssPropertyAnimations = getCssPropertyAnimations; exports.getDefaultVariant = getDefaultVariant; exports.getEffectiveTokenModes = getEffectiveTokenModes; exports.getFlowChildren = getFlowChildren; exports.getInstanceData = getInstanceData; exports.getInstanceProperties = getInstanceProperties; exports.getInstanceStatus = getInstanceStatus; exports.getKeyframeTimes = getKeyframeTimes; exports.getLayerName = getLayerName; exports.getLayoutParent = getLayoutParent; exports.getLayoutSizing = getLayoutSizing; exports.getLayoutedNodes = _chunkWADCJ7A7cjs.getLayoutedNodes; exports.getNodeAnimation = getNodeAnimation; exports.getNodeOverrides = getNodeOverrides; exports.getNodeRect = getNodeRect; exports.getNodeShape = getNodeShape; exports.getNodeSize = getNodeSize; exports.getNodeTokenBindings = getNodeTokenBindings; exports.getNodeTokenModes = getNodeTokenModes; exports.getOwningComponent = getOwningComponent; exports.getOwningInstance = getOwningInstance; exports.getResizingNodeRect = getResizingNodeRect; exports.getRootInstance = getRootInstance; exports.getShapeRenderData = getShapeRenderData; exports.getShapeSvg = getShapeSvg; exports.getTimelineRows = getTimelineRows; exports.getTimelineTicks = getTimelineTicks; exports.getTokenPropertyScope = getTokenPropertyScope; exports.getTokensForProperty = getTokensForProperty; exports.getVariantConflicts = getVariantConflicts; exports.getVariantOptions = getVariantOptions; exports.getVariantSet = getVariantSet; exports.getVariantValues = getVariantValues; exports.handlePoint = handlePoint; exports.hasVisibleStroke = hasVisibleStroke; exports.inferResizeHandle = inferResizeHandle; exports.inspectCanvasInstance = inspectCanvasInstance; exports.inspectNodeTokens = inspectNodeTokens; exports.interpolateAnimationValue = interpolateAnimationValue; exports.intersectPaths = intersectPaths; exports.intersectPolygons = intersectPolygons; exports.invertNodeUpdates = invertNodeUpdates; exports.isAnimationEasing = isAnimationEasing; exports.isAnimationKeyframe = isAnimationKeyframe; exports.isAutoLayoutFrame = isAutoLayoutFrame; exports.isCanvasComponent = isCanvasComponent; exports.isCanvasComponentSet = isCanvasComponentSet; exports.isCanvasInstance = isCanvasInstance; exports.isCssExportExact = isCssExportExact; exports.isEventFromTextInput = isEventFromTextInput; exports.isInsideInstance = isInsideInstance; exports.isKeyframeSelected = isKeyframeSelected; exports.isLocked = isLocked; exports.isMeasureModifierHeld = isMeasureModifierHeld; exports.isNodeAnimated = isNodeAnimated; exports.isShapeDescription = isShapeDescription; exports.isShapeNode = isShapeNode; exports.isStraightCubic = isStraightCubic; exports.isValidCanvasEdge = isValidCanvasEdge; exports.isValidCanvasNode = isValidCanvasNode; exports.isValidCanvasScene = isValidCanvasScene; exports.isValidUrl = isValidUrl; exports.layoutAll = layoutAll; exports.layoutBounds = layoutBounds; exports.layoutFrame = layoutFrame; exports.layoutUp = layoutUp; exports.layoutUpMany = layoutUpMany; exports.linearPositionTrajectory = linearPositionTrajectory; exports.linearTrajectory = linearTrajectory; exports.listCanvasComponents = listCanvasComponents; exports.lockNodes = lockNodes; exports.makeSizingCoherent = makeSizingCoherent; exports.matchArrangeShortcut = _chunk26BVFKHUcjs.matchArrangeShortcut; exports.matchSize = matchSize; exports.measureBetween = measureBetween; exports.measureLabel = measureLabel; exports.measureSelection = measureSelection; exports.measureToLine = measureToLine; exports.mergeNodeUpdates = mergeNodeUpdates; exports.mixColorsOklab = mixColorsOklab; exports.moveKeyframes = moveKeyframes; exports.moveLayoutChild = moveLayoutChild; exports.multiPolygonArea = multiPolygonArea; exports.multiPolygonBounds = multiPolygonBounds; exports.nearestHandlePositions = nearestHandlePositions; exports.normalizeBezierPath = normalizeBezierPath; exports.normalizeKeyframes = normalizeKeyframes; exports.offsetPath = offsetPath; exports.offsetShapeNodes = offsetShapeNodes; exports.oklabToRgb = oklabToRgb; exports.oppositePosition = oppositePosition; exports.outlineShapeNodeStrokes = outlineShapeNodeStrokes; exports.outlineStroke = outlineStroke; exports.overlaps = _chunkWADCJ7A7cjs.overlaps; exports.pageHidden = pageHidden; exports.parseCanvasClipboardData = parseCanvasClipboardData; exports.parseCanvasScenes = parseCanvasScenes; exports.parseCssEasing = parseCssEasing; exports.parseKeyframeClipboard = parseKeyframeClipboard; exports.parseNodeStyleDeclarations = parseNodeStyleDeclarations; exports.parseOklab = parseOklab; exports.parseSvgPath = parseSvgPath; exports.parseVariantName = parseVariantName; exports.pasteKeyframes = pasteKeyframes; exports.pathBoolean = pathBoolean; exports.pathToContours = pathToContours; exports.placeBeside = _chunkWADCJ7A7cjs.placeBeside; exports.playWebAnimations = playWebAnimations; exports.pointInBezierPath = pointInBezierPath; exports.pointInMultiPolygon = pointInMultiPolygon; exports.pointInRings = pointInRings; exports.polygonArea = polygonArea; exports.polygonBoolean = polygonBoolean; exports.polygonToSvgPath = polygonToSvgPath; exports.positionToSide = positionToSide; exports.pruneCanvasTokenModes = pruneCanvasTokenModes; exports.pushCanvasInstanceOverrides = pushCanvasInstanceOverrides; exports.readAnimatableValue = readAnimatableValue; exports.readNodeStyleProperty = readNodeStyleProperty; exports.readOverrideGroup = readOverrideGroup; exports.readStyleSize = readStyleSize; exports.realClock = realClock; exports.recordAnimationChanges = recordAnimationChanges; exports.relayoutUpdates = relayoutUpdates; exports.remapPastedNodes = remapPastedNodes; exports.removeTrack = removeTrack; exports.reorderNodes = reorderNodes; exports.repositionNodesTo = repositionNodesTo; exports.resetCanvasInstanceOverrides = resetCanvasInstanceOverrides; exports.resizeHandleAxes = resizeHandleAxes; exports.resolveCanvasTokens = resolveCanvasTokens; exports.resolveEasing = resolveEasing; exports.resolvePadding = resolvePadding; exports.restoreCanvasMainComponent = restoreCanvasMainComponent; exports.revertShapeCombination = revertShapeCombination; exports.rgbToOklab = rgbToOklab; exports.ringSignedArea = ringSignedArea; exports.runMultiNodeTransition = runMultiNodeTransition; exports.sampleAnimationFrames = sampleAnimationFrames; exports.scaleKeyframes = scaleKeyframes; exports.segmentBounds = segmentBounds; exports.segmentCurvature = segmentCurvature; exports.segmentDerivative = segmentDerivative; exports.segmentExtrema = segmentExtrema; exports.segmentLength = segmentLength; exports.segmentNearest = segmentNearest; exports.segmentParamAtLength = segmentParamAtLength; exports.segmentPoint = segmentPoint; exports.segmentTangent = segmentTangent; exports.serializeCanvasNodes = serializeCanvasNodes; exports.setCanvasComponentProperty = setCanvasComponentProperty; exports.setCanvasInstanceProperties = setCanvasInstanceProperties; exports.setCanvasTokenMode = setCanvasTokenMode; exports.setKeyframe = setKeyframe; exports.setKeyframeEasing = setKeyframeEasing; exports.setMotionPath = setMotionPath; exports.setTrackEnabled = setTrackEnabled; exports.shapeNodeToBezierPath = shapeNodeToBezierPath; exports.shapeNodeToPolygon = shapeNodeToPolygon; exports.shapeToBezierPath = shapeToBezierPath; exports.shapeToPolygon = shapeToPolygon; exports.sideToPosition = sideToPosition; exports.simplifyRing = simplifyRing; exports.snapKeyframeDelta = snapKeyframeDelta; exports.snapNodeDrag = snapNodeDrag; exports.snapNodeResize = snapNodeResize; exports.snapResize = snapResize; exports.snapTimeToFrame = snapTimeToFrame; exports.snapToGrid = snapToGrid; exports.splitSegment = splitSegment; exports.springAt = springAt; exports.strokeOutlineRings = strokeOutlineRings; exports.subSegment = subSegment; exports.subtractPaths = subtractPaths; exports.subtractPolygons = subtractPolygons; exports.swapCanvasInstance = swapCanvasInstance; exports.syncAllCanvasInstances = syncAllCanvasInstances; exports.syncCanvasComponents = syncCanvasComponents; exports.syncCanvasInstance = syncCanvasInstance; exports.timeToX = timeToX; exports.toBezierPath = toBezierPath; exports.toWebAnimations = toWebAnimations; exports.toggleLockNodes = toggleLockNodes; exports.transformBezierPath = transformBezierPath; exports.trimSegments = trimSegments; exports.unionPolygons = unionPolygons; exports.unitePaths = unitePaths; exports.unlockNodes = unlockNodes; exports.updateKeyframe = updateKeyframe; exports.windingNumber = windingNumber; exports.withNodeAnimation = withNodeAnimation; exports.withStyleOpacity = withStyleOpacity; exports.withStyleSize = withStyleSize; exports.wouldCreateComponentCycle = wouldCreateComponentCycle; exports.wrapAnimationTime = wrapAnimationTime; exports.writeNodeStyleProperty = writeNodeStyleProperty; exports.writeOverrideGroup = writeOverrideGroup; exports.xToTime = xToTime; exports.xorPolygons = xorPolygons;
|
|
11749
|
+
|
|
11750
|
+
|
|
11751
|
+
|
|
11752
|
+
|
|
11753
|
+
|
|
11754
|
+
|
|
11755
|
+
exports.ANIMATABLE_PROPERTIES = ANIMATABLE_PROPERTIES; exports.ANIMATION_DATA_KEY = ANIMATION_DATA_KEY; exports.ANIMATION_EASING_LABELS = _chunkTTYCN6ZHcjs.ANIMATION_EASING_LABELS; exports.ANIMATION_EASING_PRESETS = _chunkTTYCN6ZHcjs.ANIMATION_EASING_PRESETS; exports.ANIMATION_TIME_EPSILON = _chunkTTYCN6ZHcjs.ANIMATION_TIME_EPSILON; exports.AUTO_LAYOUT_DATA_KEY = AUTO_LAYOUT_DATA_KEY; exports.AnimationEditError = AnimationEditError; exports.AnimationPlayer = _chunkTTYCN6ZHcjs.AnimationPlayer; exports.CANVAS_COMPONENT_DRAG_TYPE = CANVAS_COMPONENT_DRAG_TYPE; exports.CANVAS_TOKEN_PROPERTIES = CANVAS_TOKEN_PROPERTIES; exports.CHILD_LAYOUT_DATA_KEY = CHILD_LAYOUT_DATA_KEY; exports.COMPONENT_DATA_KEY = COMPONENT_DATA_KEY; exports.COMPONENT_OVERRIDES_DATA_KEY = COMPONENT_OVERRIDES_DATA_KEY; exports.COMPONENT_PROPERTY_REFS_DATA_KEY = COMPONENT_PROPERTY_REFS_DATA_KEY; exports.COMPONENT_SET_DATA_KEY = COMPONENT_SET_DATA_KEY; exports.COMPONENT_SOURCE_DATA_KEY = COMPONENT_SOURCE_DATA_KEY; exports.CONNECTION_LINE_TYPES = CONNECTION_LINE_TYPES; exports.CSS_ANIMATION_PROPERTIES = CSS_ANIMATION_PROPERTIES; exports.CUBIC_BEZIER_PRESETS = _chunkTTYCN6ZHcjs.CUBIC_BEZIER_PRESETS; exports.CanvasScenesStore = CanvasScenesStore; exports.DEFAULT_ARRANGE_SHORTCUTS = _chunk26BVFKHUcjs.DEFAULT_ARRANGE_SHORTCUTS; exports.DEFAULT_NODE_HEIGHT = _chunkWADCJ7A7cjs.DEFAULT_NODE_HEIGHT; exports.DEFAULT_NODE_WIDTH = _chunkWADCJ7A7cjs.DEFAULT_NODE_WIDTH; exports.DEFAULT_PLACEMENT_GAP = _chunkWADCJ7A7cjs.DEFAULT_PLACEMENT_GAP; exports.INSTANCE_DATA_KEY = INSTANCE_DATA_KEY; exports.LOCKED_DATA_KEY = LOCKED_DATA_KEY; exports.LOCKED_PREVIOUS_FLAGS_KEY = LOCKED_PREVIOUS_FLAGS_KEY; exports.MAX_KEYFRAME_REFS = MAX_KEYFRAME_REFS; exports.ManualClock = _chunkTTYCN6ZHcjs.ManualClock; exports.PathOpsError = PathOpsError; exports.RESIZE_HANDLES = RESIZE_HANDLES; exports.SHAPE_DATA_KEY = SHAPE_DATA_KEY; exports.SHAPE_KINDS = SHAPE_KINDS; exports.SHAPE_NODE_TYPE = SHAPE_NODE_TYPE; exports.SHAPE_OPERATIONS = SHAPE_OPERATIONS; exports.StreamingLayoutManager = StreamingLayoutManager; exports.TOKEN_BINDINGS_DATA_KEY = TOKEN_BINDINGS_DATA_KEY; exports.TOKEN_MODES_DATA_KEY = TOKEN_MODES_DATA_KEY; exports.addCanvasVariant = addCanvasVariant; exports.addKeyframesAtTime = addKeyframesAtTime; exports.alignNodes = alignNodes; exports.animateNode = animateNode; exports.applyAnimation = applyAnimation; exports.applyAnimationOverrides = applyAnimationOverrides; exports.applyConstraints = applyConstraints; exports.applyNodeUpdates = applyNodeUpdates; exports.applyShapeCombination = applyShapeCombination; exports.applyShapeReplacement = applyShapeReplacement; exports.arcToCubics = arcToCubics; exports.bezierPathArea = bezierPathArea; exports.bezierPathBounds = bezierPathBounds; exports.bezierPathLength = bezierPathLength; exports.bezierPathPointAtLength = bezierPathPointAtLength; exports.bezierPathSignedArea = bezierPathSignedArea; exports.bezierPathToSvg = bezierPathToSvg; exports.bindCanvasComponentProperty = bindCanvasComponentProperty; exports.bindCanvasToken = bindCanvasToken; exports.blendLayout = blendLayout; exports.boundsOf = _chunkWADCJ7A7cjs.boundsOf; exports.calculateDagreReflowDisplacement = calculateDagreReflowDisplacement; exports.calculateDirectionalDisplacement = calculateDirectionalDisplacement; exports.canCombineShapeNodes = canCombineShapeNodes; exports.canOffsetShapeNodes = canOffsetShapeNodes; exports.canOutlineShapeNodeStrokes = canOutlineShapeNodeStrokes; exports.canvasHeight = canvasHeight; exports.centerNodes = _chunkWADCJ7A7cjs.centerNodes; exports.centre = _chunkWADCJ7A7cjs.centre; exports.clampAnimationValue = clampAnimationValue; exports.clampLayoutSize = clampLayoutSize; exports.closeContour = closeContour; exports.collectDescendantIds = collectDescendantIds; exports.combineCanvasComponentsAsVariants = combineCanvasComponentsAsVariants; exports.combineShapeNodes = combineShapeNodes; exports.computeNodesBoundingBox = computeNodesBoundingBox; exports.computeSnapGuides = computeSnapGuides; exports.connectedOnly = connectedOnly; exports.contourSignedArea = contourSignedArea; exports.contoursToPath = contoursToPath; exports.copyKeyframes = copyKeyframes; exports.countPathSegments = countPathSegments; exports.createAnimationPlayer = _chunkTTYCN6ZHcjs.createAnimationPlayer; exports.createBezierTrajectory = createBezierTrajectory; exports.createCanvasAnimationController = createCanvasAnimationController; exports.createCanvasArrangeController = createCanvasArrangeController; exports.createCanvasAutoLayoutController = createCanvasAutoLayoutController; exports.createCanvasComponent = createCanvasComponent; exports.createCanvasComponentsController = createCanvasComponentsController; exports.createCanvasInstance = createCanvasInstance; exports.createCanvasScenesStore = createCanvasScenesStore; exports.createFanOutTrajectory = createFanOutTrajectory; exports.createGuideIndex = createGuideIndex; exports.createNodeGuideIndex = createNodeGuideIndex; exports.createNodeLookup = createNodeLookup; exports.cubicBezierAt = _chunkTTYCN6ZHcjs.cubicBezierAt; exports.cubicPointAt = cubicPointAt; exports.cubicsToPathData = cubicsToPathData; exports.dashContours = dashContours; exports.defaultEasing = defaultEasing; exports.deleteKeyframes = deleteKeyframes; exports.detachCanvasInstance = detachCanvasInstance; exports.detachTokenBindings = detachTokenBindings; exports.diffOverrideGroups = diffOverrideGroups; exports.distanceToBezierPath = distanceToBezierPath; exports.distributeNodes = distributeNodes; exports.dividePaths = dividePaths; exports.dividePolygons = dividePolygons; exports.easingFromInfluence = _chunkTTYCN6ZHcjs.easingFromInfluence; exports.easingLabel = _chunkTTYCN6ZHcjs.easingLabel; exports.easingToCss = _chunkTTYCN6ZHcjs.easingToCss; exports.ensureLayout = _chunkWADCJ7A7cjs.ensureLayout; exports.estimateCanvasHeight = estimateCanvasHeight; exports.estimateNodeSize = _chunkWADCJ7A7cjs.estimateNodeSize; exports.evaluateAnimation = evaluateAnimation; exports.evaluateEasing = _chunkTTYCN6ZHcjs.evaluateEasing; exports.evaluateTrack = _chunkTTYCN6ZHcjs.evaluateTrack; exports.excludePaths = excludePaths; exports.exportCssAnimation = exportCssAnimation; exports.findConnectorSnap = findConnectorSnap; exports.findVariant = findVariant; exports.fitCubicRun = fitCubicRun; exports.fitCubics = fitCubics; exports.fitFreehandPath = fitFreehandPath; exports.fitPathData = fitPathData; exports.fitViewportToNodes = fitViewportToNodes; exports.fitViewportToRect = fitViewportToRect; exports.flattenSvgPath = flattenSvgPath; exports.flowSide = _chunkWADCJ7A7cjs.flowSide; exports.formatAnimationTime = formatAnimationTime; exports.formatNumber = formatNumber2; exports.formatOklab = _chunkTTYCN6ZHcjs.formatOklab; exports.formatVariantName = formatVariantName; exports.getAbsolutePosition = getAbsolutePosition; exports.getAnimatableProperty = getAnimatableProperty; exports.getAnimatedProperties = getAnimatedProperties; exports.getAnimatedValue = getAnimatedValue; exports.getAnimationDuration = getAnimationDuration; exports.getAnimationTrack = getAnimationTrack; exports.getAutoLayout = getAutoLayout; exports.getAutoLayoutGrid = getAutoLayoutGrid; exports.getAutoLayoutInsertTarget = getAutoLayoutInsertTarget; exports.getBindableTokenProperties = getBindableTokenProperties; exports.getCanvasComponentDragId = getCanvasComponentDragId; exports.getCanvasTokenProperty = getCanvasTokenProperty; exports.getCenteredNodePosition = _chunkWADCJ7A7cjs.getCenteredNodePosition; exports.getChildLayout = getChildLayout; exports.getComponentData = getComponentData; exports.getComponentInstances = getComponentInstances; exports.getComponentPropertyDefs = getComponentPropertyDefs; exports.getComponentPropertyRefs = getComponentPropertyRefs; exports.getComponentSourceId = getComponentSourceId; exports.getCssPropertyAnimations = getCssPropertyAnimations; exports.getDefaultVariant = getDefaultVariant; exports.getEffectiveTokenModes = getEffectiveTokenModes; exports.getFlowChildren = getFlowChildren; exports.getInstanceData = getInstanceData; exports.getInstanceProperties = getInstanceProperties; exports.getInstanceStatus = getInstanceStatus; exports.getKeyframeTimes = getKeyframeTimes; exports.getLayerName = getLayerName; exports.getLayoutParent = getLayoutParent; exports.getLayoutSizing = getLayoutSizing; exports.getLayoutedNodes = _chunkWADCJ7A7cjs.getLayoutedNodes; exports.getNextVariantValues = getNextVariantValues; exports.getNodeAnimation = getNodeAnimation; exports.getNodeOverrides = getNodeOverrides; exports.getNodeRect = getNodeRect; exports.getNodeShape = getNodeShape; exports.getNodeSize = getNodeSize; exports.getNodeTokenBindings = getNodeTokenBindings; exports.getNodeTokenModes = getNodeTokenModes; exports.getOwningComponent = getOwningComponent; exports.getOwningInstance = getOwningInstance; exports.getResizingNodeRect = getResizingNodeRect; exports.getRootInstance = getRootInstance; exports.getShapeRenderData = getShapeRenderData; exports.getShapeSvg = getShapeSvg; exports.getTimelineRows = getTimelineRows; exports.getTimelineTicks = getTimelineTicks; exports.getTokenPropertyScope = getTokenPropertyScope; exports.getTokensForProperty = getTokensForProperty; exports.getVariantConflicts = getVariantConflicts; exports.getVariantOptions = getVariantOptions; exports.getVariantSet = getVariantSet; exports.getVariantValues = getVariantValues; exports.handlePoint = handlePoint; exports.hasVisibleStroke = hasVisibleStroke; exports.inferResizeHandle = inferResizeHandle; exports.inspectCanvasInstance = inspectCanvasInstance; exports.inspectNodeTokens = inspectNodeTokens; exports.interpolateAnimationValue = _chunkTTYCN6ZHcjs.interpolateAnimationValue; exports.intersectPaths = intersectPaths; exports.intersectPolygons = intersectPolygons; exports.invertNodeUpdates = invertNodeUpdates; exports.isAnimationEasing = _chunkTTYCN6ZHcjs.isAnimationEasing; exports.isAnimationKeyframe = _chunkTTYCN6ZHcjs.isAnimationKeyframe; exports.isAutoLayoutFrame = isAutoLayoutFrame; exports.isCanvasComponent = isCanvasComponent; exports.isCanvasComponentSet = isCanvasComponentSet; exports.isCanvasInstance = isCanvasInstance; exports.isCssExportExact = isCssExportExact; exports.isEventFromTextInput = isEventFromTextInput; exports.isInsideInstance = isInsideInstance; exports.isKeyframeSelected = isKeyframeSelected; exports.isLocked = isLocked; exports.isMeasureModifierHeld = isMeasureModifierHeld; exports.isNodeAnimated = isNodeAnimated; exports.isShapeDescription = isShapeDescription; exports.isShapeNode = isShapeNode; exports.isStraightCubic = isStraightCubic; exports.isValidCanvasEdge = isValidCanvasEdge; exports.isValidCanvasNode = isValidCanvasNode; exports.isValidCanvasScene = isValidCanvasScene; exports.isValidUrl = isValidUrl; exports.layoutAll = layoutAll; exports.layoutBounds = layoutBounds; exports.layoutFrame = layoutFrame; exports.layoutUp = layoutUp; exports.layoutUpMany = layoutUpMany; exports.linearPositionTrajectory = linearPositionTrajectory; exports.linearTrajectory = linearTrajectory; exports.listCanvasComponents = listCanvasComponents; exports.lockNodes = lockNodes; exports.makeSizingCoherent = makeSizingCoherent; exports.matchArrangeShortcut = _chunk26BVFKHUcjs.matchArrangeShortcut; exports.matchSize = matchSize; exports.measureBetween = measureBetween; exports.measureLabel = measureLabel; exports.measureSelection = measureSelection; exports.measureToLine = measureToLine; exports.mergeNodeUpdates = mergeNodeUpdates; exports.mixColorsOklab = _chunkTTYCN6ZHcjs.mixColorsOklab; exports.moveKeyframes = moveKeyframes; exports.moveLayoutChild = moveLayoutChild; exports.multiPolygonArea = multiPolygonArea; exports.multiPolygonBounds = multiPolygonBounds; exports.nearestHandlePositions = nearestHandlePositions; exports.normalizeBezierPath = normalizeBezierPath; exports.normalizeKeyframes = _chunkTTYCN6ZHcjs.normalizeKeyframes; exports.offsetPath = offsetPath; exports.offsetShapeNodes = offsetShapeNodes; exports.oklabToRgb = _chunkTTYCN6ZHcjs.oklabToRgb; exports.oppositePosition = oppositePosition; exports.outlineShapeNodeStrokes = outlineShapeNodeStrokes; exports.outlineStroke = outlineStroke; exports.overlaps = _chunkWADCJ7A7cjs.overlaps; exports.pageHidden = _chunkTTYCN6ZHcjs.pageHidden; exports.parseCanvasClipboardData = parseCanvasClipboardData; exports.parseCanvasScenes = parseCanvasScenes; exports.parseCssEasing = _chunkTTYCN6ZHcjs.parseCssEasing; exports.parseKeyframeClipboard = parseKeyframeClipboard; exports.parseNodeStyleDeclarations = parseNodeStyleDeclarations; exports.parseOklab = _chunkTTYCN6ZHcjs.parseOklab; exports.parseSvgPath = parseSvgPath; exports.parseVariantName = parseVariantName; exports.pasteKeyframes = pasteKeyframes; exports.pathBoolean = pathBoolean; exports.pathToContours = pathToContours; exports.placeBeside = _chunkWADCJ7A7cjs.placeBeside; exports.playWebAnimations = playWebAnimations; exports.pointInBezierPath = pointInBezierPath; exports.pointInMultiPolygon = pointInMultiPolygon; exports.pointInRings = pointInRings; exports.polygonArea = polygonArea; exports.polygonBoolean = polygonBoolean; exports.polygonToSvgPath = polygonToSvgPath; exports.positionToSide = positionToSide; exports.pruneCanvasTokenModes = pruneCanvasTokenModes; exports.pushCanvasInstanceOverrides = pushCanvasInstanceOverrides; exports.readAnimatableValue = readAnimatableValue; exports.readNodeStyleProperty = readNodeStyleProperty; exports.readOverrideGroup = readOverrideGroup; exports.readStyleSize = readStyleSize; exports.realClock = _chunkTTYCN6ZHcjs.realClock; exports.recordAnimationChanges = recordAnimationChanges; exports.relayoutUpdates = relayoutUpdates; exports.remapPastedNodes = remapPastedNodes; exports.removeCanvasVariant = removeCanvasVariant; exports.removeTrack = removeTrack; exports.renameCanvasVariantProperty = renameCanvasVariantProperty; exports.renameCanvasVariantValue = renameCanvasVariantValue; exports.reorderNodes = reorderNodes; exports.repositionNodesTo = repositionNodesTo; exports.resetCanvasInstanceOverrides = resetCanvasInstanceOverrides; exports.resizeHandleAxes = resizeHandleAxes; exports.resolveCanvasTokens = resolveCanvasTokens; exports.resolveEasing = _chunkTTYCN6ZHcjs.resolveEasing; exports.resolvePadding = resolvePadding; exports.restoreCanvasMainComponent = restoreCanvasMainComponent; exports.revertShapeCombination = revertShapeCombination; exports.rgbToOklab = _chunkTTYCN6ZHcjs.rgbToOklab; exports.ringSignedArea = ringSignedArea; exports.runMultiNodeTransition = runMultiNodeTransition; exports.sampleAnimationFrames = sampleAnimationFrames; exports.scaleKeyframes = scaleKeyframes; exports.segmentBounds = segmentBounds; exports.segmentCurvature = segmentCurvature; exports.segmentDerivative = segmentDerivative; exports.segmentExtrema = segmentExtrema; exports.segmentLength = segmentLength; exports.segmentNearest = segmentNearest; exports.segmentParamAtLength = segmentParamAtLength; exports.segmentPoint = segmentPoint; exports.segmentTangent = segmentTangent; exports.serializeCanvasNodes = serializeCanvasNodes; exports.setCanvasComponentProperty = setCanvasComponentProperty; exports.setCanvasInstanceProperties = setCanvasInstanceProperties; exports.setCanvasTokenMode = setCanvasTokenMode; exports.setCanvasVariantProperties = setCanvasVariantProperties; exports.setKeyframe = setKeyframe; exports.setKeyframeEasing = setKeyframeEasing; exports.setMotionPath = setMotionPath; exports.setTrackEnabled = setTrackEnabled; exports.shapeNodeToBezierPath = shapeNodeToBezierPath; exports.shapeNodeToPolygon = shapeNodeToPolygon; exports.shapeToBezierPath = shapeToBezierPath; exports.shapeToPolygon = shapeToPolygon; exports.sideToPosition = sideToPosition; exports.simplifyRing = simplifyRing; exports.snapKeyframeDelta = snapKeyframeDelta; exports.snapNodeDrag = snapNodeDrag; exports.snapNodeResize = snapNodeResize; exports.snapResize = snapResize; exports.snapTimeToFrame = snapTimeToFrame; exports.snapToGrid = snapToGrid; exports.splitSegment = splitSegment; exports.springAt = _chunkTTYCN6ZHcjs.springAt; exports.strokeOutlineRings = strokeOutlineRings; exports.subSegment = subSegment; exports.subtractPaths = subtractPaths; exports.subtractPolygons = subtractPolygons; exports.swapCanvasInstance = swapCanvasInstance; exports.syncAllCanvasInstances = syncAllCanvasInstances; exports.syncCanvasComponents = syncCanvasComponents; exports.syncCanvasInstance = syncCanvasInstance; exports.timeToX = timeToX; exports.toBezierPath = toBezierPath; exports.toWebAnimations = toWebAnimations; exports.toggleLockNodes = toggleLockNodes; exports.transformBezierPath = transformBezierPath; exports.trimSegments = trimSegments; exports.unionPolygons = unionPolygons; exports.unitePaths = unitePaths; exports.unlockNodes = unlockNodes; exports.updateKeyframe = updateKeyframe; exports.windingNumber = windingNumber; exports.withNodeAnimation = withNodeAnimation; exports.withStyleOpacity = withStyleOpacity; exports.withStyleSize = withStyleSize; exports.wouldCreateComponentCycle = wouldCreateComponentCycle; exports.wrapAnimationTime = _chunkTTYCN6ZHcjs.wrapAnimationTime; exports.writeNodeStyleProperty = writeNodeStyleProperty; exports.writeOverrideGroup = writeOverrideGroup; exports.xToTime = xToTime; exports.xorPolygons = xorPolygons;
|
|
11958
11756
|
//# sourceMappingURL=index.cjs.map
|