@pixerate/editor 0.33.0 → 0.35.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/THIRD_PARTY_NOTICES.md +22 -0
- package/dist/{bezier-DJPYiVbA.d.ts → bezier-BvqVmWMg.d.ts} +1 -1
- package/dist/{bezier-6KPx3w7Z.d.cts → bezier-D8bsO-L0.d.cts} +1 -1
- package/dist/canvas/index.cjs +179 -622
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +60 -3
- package/dist/canvas/index.d.ts +60 -3
- package/dist/canvas/index.js +37 -480
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-M4XE4UMT.cjs → chunk-BGNPT5PE.cjs} +464 -5
- package/dist/chunk-BGNPT5PE.cjs.map +1 -0
- package/dist/{chunk-GQTXV2EQ.js → chunk-EGPIVUEF.js} +470 -11
- package/dist/chunk-EGPIVUEF.js.map +1 -0
- package/dist/vector/index.cjs +2776 -185
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +638 -10
- package/dist/vector/index.d.ts +638 -10
- package/dist/vector/index.js +2644 -53
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-GQTXV2EQ.js.map +0 -1
- package/dist/chunk-M4XE4UMT.cjs.map +0 -1
package/dist/canvas/index.cjs
CHANGED
|
@@ -77,11 +77,7 @@
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
var _chunkM4XE4UMTcjs = require('../chunk-M4XE4UMT.cjs');
|
|
80
|
+
var _chunkBGNPT5PEcjs = require('../chunk-BGNPT5PE.cjs');
|
|
85
81
|
|
|
86
82
|
|
|
87
83
|
|
|
@@ -183,11 +179,11 @@ function createFanOutTrajectory(options = {}) {
|
|
|
183
179
|
const oneMinusT = 1 - t;
|
|
184
180
|
const x = oneMinusT * oneMinusT * origin.x + 2 * oneMinusT * t * midX + t * t * target.x;
|
|
185
181
|
const y = oneMinusT * oneMinusT * origin.y + 2 * oneMinusT * t * midY + t * t * target.y;
|
|
186
|
-
const
|
|
182
|
+
const scale = startScale + (endScale - startScale) * progress;
|
|
187
183
|
const opacity = startOpacity + (endOpacity - startOpacity) * progress;
|
|
188
184
|
return {
|
|
189
185
|
position: { x, y },
|
|
190
|
-
scale
|
|
186
|
+
scale,
|
|
191
187
|
opacity
|
|
192
188
|
};
|
|
193
189
|
};
|
|
@@ -1214,7 +1210,7 @@ function spacingCandidate(rects, moving, horizontal, tolerance) {
|
|
|
1214
1210
|
return best2;
|
|
1215
1211
|
};
|
|
1216
1212
|
const crossMid = (a, b) => (Math.max(crossStart(a), crossStart(b)) + Math.min(crossEnd(a), crossEnd(b))) / 2;
|
|
1217
|
-
const segment = (from, to,
|
|
1213
|
+
const segment = (from, to, cross) => horizontal ? { orientation: "horizontal", kind: "spacing", x1: from, y1: cross, x2: to, y2: cross } : { orientation: "vertical", kind: "spacing", x1: cross, y1: from, x2: cross, y2: to };
|
|
1218
1214
|
const candidates = [];
|
|
1219
1215
|
if (before && after) {
|
|
1220
1216
|
const b = before;
|
|
@@ -1726,447 +1722,6 @@ function fitViewportToNodes(nodes, size, ids, options = {}) {
|
|
|
1726
1722
|
return bounds ? fitViewportToRect(bounds, size, options) : null;
|
|
1727
1723
|
}
|
|
1728
1724
|
|
|
1729
|
-
// src/canvas/pathops/stroke.ts
|
|
1730
|
-
var DEFAULT_TOLERANCE = 0.01;
|
|
1731
|
-
var normal = (t) => [-t[1], t[0]];
|
|
1732
|
-
function raise(seg) {
|
|
1733
|
-
if (seg.length !== 3) return [...seg];
|
|
1734
|
-
const [p0, p1, p2] = seg;
|
|
1735
|
-
return [p0, [p0[0] + 2 / 3 * (p1[0] - p0[0]), p0[1] + 2 / 3 * (p1[1] - p0[1])], [p2[0] + 2 / 3 * (p1[0] - p2[0]), p2[1] + 2 / 3 * (p1[1] - p2[1])], p2];
|
|
1736
|
-
}
|
|
1737
|
-
function isDegenerate(seg, tol) {
|
|
1738
|
-
return seg.every((p) => _chunkM4XE4UMTcjs.dist.call(void 0, p, seg[0]) <= tol);
|
|
1739
|
-
}
|
|
1740
|
-
function offsetSegment(seg, d, tol, out, depth = 0) {
|
|
1741
|
-
if (seg.length === 2) {
|
|
1742
|
-
const n = normal(_chunkM4XE4UMTcjs.segmentTangent.call(void 0, seg, 0));
|
|
1743
|
-
out.push([_chunkM4XE4UMTcjs.add.call(void 0, seg[0], _chunkM4XE4UMTcjs.scale.call(void 0, n, d)), _chunkM4XE4UMTcjs.add.call(void 0, seg[1], _chunkM4XE4UMTcjs.scale.call(void 0, n, d))]);
|
|
1744
|
-
return;
|
|
1745
|
-
}
|
|
1746
|
-
const c = raise(seg);
|
|
1747
|
-
const t0 = _chunkM4XE4UMTcjs.segmentTangent.call(void 0, c, 0);
|
|
1748
|
-
const t1 = _chunkM4XE4UMTcjs.segmentTangent.call(void 0, c, 1);
|
|
1749
|
-
const q0 = _chunkM4XE4UMTcjs.add.call(void 0, c[0], _chunkM4XE4UMTcjs.scale.call(void 0, normal(t0), d));
|
|
1750
|
-
const q3 = _chunkM4XE4UMTcjs.add.call(void 0, c[3], _chunkM4XE4UMTcjs.scale.call(void 0, normal(t1), d));
|
|
1751
|
-
const k0 = _chunkM4XE4UMTcjs.segmentCurvature.call(void 0, c, 0);
|
|
1752
|
-
const k1 = _chunkM4XE4UMTcjs.segmentCurvature.call(void 0, c, 1);
|
|
1753
|
-
const f0 = Number.isFinite(k0) ? 1 - d * k0 : 1;
|
|
1754
|
-
const f1 = Number.isFinite(k1) ? 1 - d * k1 : 1;
|
|
1755
|
-
const q1 = _chunkM4XE4UMTcjs.add.call(void 0, q0, _chunkM4XE4UMTcjs.scale.call(void 0, _chunkM4XE4UMTcjs.sub.call(void 0, c[1], c[0]), f0));
|
|
1756
|
-
const q2 = _chunkM4XE4UMTcjs.add.call(void 0, q3, _chunkM4XE4UMTcjs.scale.call(void 0, _chunkM4XE4UMTcjs.sub.call(void 0, c[2], c[3]), f1));
|
|
1757
|
-
const approx = [q0, q1, q2, q3];
|
|
1758
|
-
if (depth < 10) {
|
|
1759
|
-
let err = 0;
|
|
1760
|
-
for (const t of [0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875]) {
|
|
1761
|
-
const target = _chunkM4XE4UMTcjs.add.call(void 0, _chunkM4XE4UMTcjs.segmentPoint.call(void 0, c, t), _chunkM4XE4UMTcjs.scale.call(void 0, normal(_chunkM4XE4UMTcjs.segmentTangent.call(void 0, c, t)), d));
|
|
1762
|
-
err = Math.max(err, _chunkM4XE4UMTcjs.segmentNearest.call(void 0, approx, target).distance);
|
|
1763
|
-
if (err > tol) break;
|
|
1764
|
-
}
|
|
1765
|
-
if (err <= tol) {
|
|
1766
|
-
const m = _chunkM4XE4UMTcjs.segmentPoint.call(void 0, approx, 0.5);
|
|
1767
|
-
const back = _chunkM4XE4UMTcjs.segmentNearest.call(void 0, c, m).distance;
|
|
1768
|
-
err = Math.max(err, Math.abs(back - Math.abs(d)));
|
|
1769
|
-
}
|
|
1770
|
-
if (err > tol) {
|
|
1771
|
-
const [a, b] = _chunkM4XE4UMTcjs.splitSegment.call(void 0, c, 0.5);
|
|
1772
|
-
offsetSegment(a, d, tol, out, depth + 1);
|
|
1773
|
-
offsetSegment(b, d, tol, out, depth + 1);
|
|
1774
|
-
return;
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
out.push(approx);
|
|
1778
|
-
}
|
|
1779
|
-
function pushArc(out, center, radius, start, sweep, from, to) {
|
|
1780
|
-
const n = Math.max(1, Math.ceil(Math.abs(sweep) / (Math.PI / 2) - 1e-9));
|
|
1781
|
-
const step = sweep / n;
|
|
1782
|
-
const k = 4 / 3 * Math.tan(step / 4);
|
|
1783
|
-
let prev = from;
|
|
1784
|
-
for (let i = 0; i < n; i++) {
|
|
1785
|
-
const a0 = start + step * i;
|
|
1786
|
-
const a1 = a0 + step;
|
|
1787
|
-
const c0 = Math.cos(a0);
|
|
1788
|
-
const s0 = Math.sin(a0);
|
|
1789
|
-
const c1 = Math.cos(a1);
|
|
1790
|
-
const s1 = Math.sin(a1);
|
|
1791
|
-
const end = i === n - 1 ? to : [center[0] + radius * c1, center[1] + radius * s1];
|
|
1792
|
-
out.push([
|
|
1793
|
-
prev,
|
|
1794
|
-
[center[0] + radius * (c0 - k * s0), center[1] + radius * (s0 + k * c0)],
|
|
1795
|
-
[center[0] + radius * (c1 + k * s1), center[1] + radius * (s1 - k * c1)],
|
|
1796
|
-
end
|
|
1797
|
-
]);
|
|
1798
|
-
prev = end;
|
|
1799
|
-
}
|
|
1800
|
-
}
|
|
1801
|
-
function lineTo(out, from, to) {
|
|
1802
|
-
if (!_chunkM4XE4UMTcjs.samePoint.call(void 0, from, to)) out.push([from, to]);
|
|
1803
|
-
}
|
|
1804
|
-
function addJoin(out, p, tin, tout, d, style) {
|
|
1805
|
-
const from = _chunkM4XE4UMTcjs.add.call(void 0, p, _chunkM4XE4UMTcjs.scale.call(void 0, normal(tin), d));
|
|
1806
|
-
const to = _chunkM4XE4UMTcjs.add.call(void 0, p, _chunkM4XE4UMTcjs.scale.call(void 0, normal(tout), d));
|
|
1807
|
-
const turn = _chunkM4XE4UMTcjs.cross.call(void 0, tin, tout);
|
|
1808
|
-
const cos = _chunkM4XE4UMTcjs.dot.call(void 0, tin, tout);
|
|
1809
|
-
if (Math.abs(turn) < 1e-9 && cos > 0) {
|
|
1810
|
-
lineTo(out, from, to);
|
|
1811
|
-
return;
|
|
1812
|
-
}
|
|
1813
|
-
const reversal = Math.abs(turn) < 1e-9 && cos < 0;
|
|
1814
|
-
const inner = !reversal && turn > 0 === d > 0;
|
|
1815
|
-
if (inner) {
|
|
1816
|
-
lineTo(out, from, p);
|
|
1817
|
-
lineTo(out, p, to);
|
|
1818
|
-
return;
|
|
1819
|
-
}
|
|
1820
|
-
const theta = reversal ? d > 0 ? -Math.PI : Math.PI : Math.atan2(turn, cos);
|
|
1821
|
-
if (style.join === "round") {
|
|
1822
|
-
const v = _chunkM4XE4UMTcjs.sub.call(void 0, from, p);
|
|
1823
|
-
pushArc(out, p, Math.abs(d), Math.atan2(v[1], v[0]), theta, from, to);
|
|
1824
|
-
return;
|
|
1825
|
-
}
|
|
1826
|
-
if (style.join === "miter" && !reversal) {
|
|
1827
|
-
const phi = Math.PI - Math.abs(theta);
|
|
1828
|
-
const ratio = 1 / Math.max(Math.sin(phi / 2), 1e-12);
|
|
1829
|
-
if (ratio <= style.miterLimit) {
|
|
1830
|
-
const nin = normal(tin);
|
|
1831
|
-
const nout = normal(tout);
|
|
1832
|
-
const s = d / (1 + _chunkM4XE4UMTcjs.dot.call(void 0, nin, nout));
|
|
1833
|
-
const miter = _chunkM4XE4UMTcjs.add.call(void 0, p, _chunkM4XE4UMTcjs.scale.call(void 0, _chunkM4XE4UMTcjs.add.call(void 0, nin, nout), s));
|
|
1834
|
-
lineTo(out, from, miter);
|
|
1835
|
-
lineTo(out, miter, to);
|
|
1836
|
-
return;
|
|
1837
|
-
}
|
|
1838
|
-
}
|
|
1839
|
-
lineTo(out, from, to);
|
|
1840
|
-
}
|
|
1841
|
-
function offsetChain(segs, d, closed, style, tol) {
|
|
1842
|
-
const out = [];
|
|
1843
|
-
const pen = () => out.length > 0 ? out[out.length - 1][out[out.length - 1].length - 1] : null;
|
|
1844
|
-
for (let i = 0; i < segs.length; i++) {
|
|
1845
|
-
if (i > 0) addJoin(out, segs[i][0], _chunkM4XE4UMTcjs.segmentTangent.call(void 0, segs[i - 1], 1), _chunkM4XE4UMTcjs.segmentTangent.call(void 0, segs[i], 0), d, style);
|
|
1846
|
-
const pieces = [];
|
|
1847
|
-
offsetSegment(segs[i], d, tol, pieces);
|
|
1848
|
-
for (const piece of pieces) {
|
|
1849
|
-
const at = pen();
|
|
1850
|
-
if (at && !_chunkM4XE4UMTcjs.samePoint.call(void 0, at, piece[0])) lineTo(out, at, piece[0]);
|
|
1851
|
-
out.push(piece);
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
if (closed && segs.length > 0) {
|
|
1855
|
-
const last = segs[segs.length - 1];
|
|
1856
|
-
addJoin(out, segs[0][0], _chunkM4XE4UMTcjs.segmentTangent.call(void 0, last, 1), _chunkM4XE4UMTcjs.segmentTangent.call(void 0, segs[0], 0), d, style);
|
|
1857
|
-
const at = pen();
|
|
1858
|
-
if (at && out.length > 0 && !_chunkM4XE4UMTcjs.samePoint.call(void 0, at, out[0][0])) lineTo(out, at, out[0][0]);
|
|
1859
|
-
}
|
|
1860
|
-
return out;
|
|
1861
|
-
}
|
|
1862
|
-
function reverseChain(chain) {
|
|
1863
|
-
return chain.map((s) => [...s].reverse()).reverse();
|
|
1864
|
-
}
|
|
1865
|
-
function addCap(out, p, t, h, cap) {
|
|
1866
|
-
const n = normal(t);
|
|
1867
|
-
const from = _chunkM4XE4UMTcjs.add.call(void 0, p, _chunkM4XE4UMTcjs.scale.call(void 0, n, h));
|
|
1868
|
-
const to = _chunkM4XE4UMTcjs.add.call(void 0, p, _chunkM4XE4UMTcjs.scale.call(void 0, n, -h));
|
|
1869
|
-
if (cap === "round") {
|
|
1870
|
-
pushArc(out, p, h, Math.atan2(n[1], n[0]), -Math.PI, from, to);
|
|
1871
|
-
} else if (cap === "square") {
|
|
1872
|
-
const a = _chunkM4XE4UMTcjs.add.call(void 0, from, _chunkM4XE4UMTcjs.scale.call(void 0, t, h));
|
|
1873
|
-
const b = _chunkM4XE4UMTcjs.add.call(void 0, to, _chunkM4XE4UMTcjs.scale.call(void 0, t, h));
|
|
1874
|
-
lineTo(out, from, a);
|
|
1875
|
-
lineTo(out, a, b);
|
|
1876
|
-
lineTo(out, b, to);
|
|
1877
|
-
} else {
|
|
1878
|
-
lineTo(out, from, to);
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
|
-
function dotRings(p, t, h, cap) {
|
|
1882
|
-
if (cap === "butt") return [];
|
|
1883
|
-
const ring = [];
|
|
1884
|
-
addCap(ring, p, t, h, cap);
|
|
1885
|
-
addCap(ring, p, [-t[0], -t[1]], h, cap);
|
|
1886
|
-
return [ring];
|
|
1887
|
-
}
|
|
1888
|
-
function strokeContour(contour, h, style, tol) {
|
|
1889
|
-
const tiny = Math.max(1e-12, tol * 1e-6);
|
|
1890
|
-
const all = contour.closed ? _chunkM4XE4UMTcjs.closeContour.call(void 0, contour) : contour.segments;
|
|
1891
|
-
const segs = all.filter((s) => !isDegenerate(s, tiny));
|
|
1892
|
-
if (segs.length === 0) {
|
|
1893
|
-
const p = _optionalChain([contour, 'access', _55 => _55.segments, 'access', _56 => _56[0], 'optionalAccess', _57 => _57[0]]);
|
|
1894
|
-
return p ? dotRings(p, [1, 0], h, style.cap) : [];
|
|
1895
|
-
}
|
|
1896
|
-
if (contour.closed) {
|
|
1897
|
-
const left2 = offsetChain(segs, h, true, style, tol);
|
|
1898
|
-
const right2 = offsetChain(segs, -h, true, style, tol);
|
|
1899
|
-
return [left2, reverseChain(right2)];
|
|
1900
|
-
}
|
|
1901
|
-
const left = offsetChain(segs, h, false, style, tol);
|
|
1902
|
-
const right = reverseChain(offsetChain(segs, -h, false, style, tol));
|
|
1903
|
-
const ring = [...left];
|
|
1904
|
-
const last = segs[segs.length - 1];
|
|
1905
|
-
addCap(ring, last[last.length - 1], _chunkM4XE4UMTcjs.segmentTangent.call(void 0, last, 1), h, style.cap);
|
|
1906
|
-
const joinTo = (p) => {
|
|
1907
|
-
const at = ring[ring.length - 1][ring[ring.length - 1].length - 1];
|
|
1908
|
-
lineTo(ring, at, p);
|
|
1909
|
-
};
|
|
1910
|
-
if (right.length > 0) joinTo(right[0][0]);
|
|
1911
|
-
ring.push(...right);
|
|
1912
|
-
const first = segs[0];
|
|
1913
|
-
const t0 = _chunkM4XE4UMTcjs.segmentTangent.call(void 0, first, 0);
|
|
1914
|
-
addCap(ring, first[0], [-t0[0], -t0[1]], h, style.cap);
|
|
1915
|
-
if (ring.length > 0) joinTo(ring[0][0]);
|
|
1916
|
-
return [ring];
|
|
1917
|
-
}
|
|
1918
|
-
function ringsToPath(rings) {
|
|
1919
|
-
return _chunkM4XE4UMTcjs.contoursToPath.call(void 0, rings.filter((r) => r.length > 0).map((segments) => ({ segments, closed: true })));
|
|
1920
|
-
}
|
|
1921
|
-
var MAX_DASHES = 2e5;
|
|
1922
|
-
var MIN_ENTRY = 1e-6;
|
|
1923
|
-
function dashContours(contours, pattern, offset = 0) {
|
|
1924
|
-
if (pattern.length === 0 || pattern.some((v) => !Number.isFinite(v) || v < 0) || !Number.isFinite(offset)) return null;
|
|
1925
|
-
if (!pattern.some((v) => v > MIN_ENTRY)) return null;
|
|
1926
|
-
const pat = pattern.length % 2 === 1 ? [...pattern, ...pattern] : [...pattern];
|
|
1927
|
-
const period = pat.reduce((s, v) => s + v, 0);
|
|
1928
|
-
const chains = contours.map((c) => {
|
|
1929
|
-
const segs = _chunkM4XE4UMTcjs.closeContour.call(void 0, c);
|
|
1930
|
-
const lengths = segs.map((s) => _chunkM4XE4UMTcjs.segmentLength.call(void 0, s));
|
|
1931
|
-
return { segs, lengths, total: lengths.reduce((s, v) => s + v, 0), closed: c.closed };
|
|
1932
|
-
});
|
|
1933
|
-
const totalLength = chains.reduce((s, c) => s + c.total, 0);
|
|
1934
|
-
if (totalLength / period * pat.length > MAX_DASHES) return null;
|
|
1935
|
-
let off = (offset % period + period) % period;
|
|
1936
|
-
let ix0 = 0;
|
|
1937
|
-
while (off > pat[ix0]) {
|
|
1938
|
-
off -= pat[ix0];
|
|
1939
|
-
ix0 = (ix0 + 1) % pat.length;
|
|
1940
|
-
}
|
|
1941
|
-
const out = { contours: [], dots: [] };
|
|
1942
|
-
for (const chain of chains) {
|
|
1943
|
-
if (chain.segs.length === 0 || !(chain.total > 0)) continue;
|
|
1944
|
-
let ix = ix0;
|
|
1945
|
-
let rem = pat[ix0] - off;
|
|
1946
|
-
let pos = 0;
|
|
1947
|
-
const dashes = [];
|
|
1948
|
-
let guard = 0;
|
|
1949
|
-
while (pos < chain.total && guard++ < MAX_DASHES * 2) {
|
|
1950
|
-
const step = Math.min(rem, chain.total - pos);
|
|
1951
|
-
const on = ix % 2 === 0;
|
|
1952
|
-
if (on) dashes.push({ from: pos, to: pos + step });
|
|
1953
|
-
pos += step;
|
|
1954
|
-
rem -= step;
|
|
1955
|
-
if (rem <= 1e-12) {
|
|
1956
|
-
ix = (ix + 1) % pat.length;
|
|
1957
|
-
rem = pat[ix];
|
|
1958
|
-
}
|
|
1959
|
-
}
|
|
1960
|
-
if (chain.closed && dashes.length > 1) {
|
|
1961
|
-
const first = dashes[0];
|
|
1962
|
-
const last = dashes[dashes.length - 1];
|
|
1963
|
-
if (first.from <= 1e-9 && last.to >= chain.total - 1e-9 && first.to > first.from && last.to > last.from) {
|
|
1964
|
-
dashes.pop();
|
|
1965
|
-
const tail = _chunkM4XE4UMTcjs.trimSegments.call(void 0, chain.segs, last.from, chain.total, chain.lengths);
|
|
1966
|
-
const head = _chunkM4XE4UMTcjs.trimSegments.call(void 0, chain.segs, 0, first.to, chain.lengths);
|
|
1967
|
-
dashes.shift();
|
|
1968
|
-
out.contours.push({ segments: [...tail, ...head], closed: false });
|
|
1969
|
-
}
|
|
1970
|
-
}
|
|
1971
|
-
for (const dash of dashes) {
|
|
1972
|
-
if (dash.to - dash.from <= 1e-12) {
|
|
1973
|
-
const at = locate(chain.segs, chain.lengths, dash.from);
|
|
1974
|
-
out.dots.push(at);
|
|
1975
|
-
continue;
|
|
1976
|
-
}
|
|
1977
|
-
const segments = _chunkM4XE4UMTcjs.trimSegments.call(void 0, chain.segs, dash.from, dash.to, chain.lengths);
|
|
1978
|
-
if (segments.length > 0) out.contours.push({ segments, closed: false });
|
|
1979
|
-
}
|
|
1980
|
-
}
|
|
1981
|
-
return out;
|
|
1982
|
-
}
|
|
1983
|
-
function locate(segs, lengths, at) {
|
|
1984
|
-
let acc = 0;
|
|
1985
|
-
for (let i = 0; i < segs.length; i++) {
|
|
1986
|
-
if (at <= acc + lengths[i] || i === segs.length - 1) {
|
|
1987
|
-
const piece = _chunkM4XE4UMTcjs.trimSegments.call(void 0, [segs[i]], 0, Math.max(0, at - acc), [lengths[i]]);
|
|
1988
|
-
const t = piece.length > 0 ? 1 : 0;
|
|
1989
|
-
const point = piece.length > 0 ? piece[piece.length - 1][piece[piece.length - 1].length - 1] : segs[i][0];
|
|
1990
|
-
const tangent = _chunkM4XE4UMTcjs.segmentTangent.call(void 0, piece.length > 0 ? piece[piece.length - 1] : segs[i], t);
|
|
1991
|
-
return { point, tangent };
|
|
1992
|
-
}
|
|
1993
|
-
acc += lengths[i];
|
|
1994
|
-
}
|
|
1995
|
-
return { point: segs[0][0], tangent: _chunkM4XE4UMTcjs.segmentTangent.call(void 0, segs[0], 0) };
|
|
1996
|
-
}
|
|
1997
|
-
function deepPoint(rings) {
|
|
1998
|
-
let minX = Infinity;
|
|
1999
|
-
let minY = Infinity;
|
|
2000
|
-
let maxX = -Infinity;
|
|
2001
|
-
let maxY = -Infinity;
|
|
2002
|
-
for (const p of rings[0].flat()) {
|
|
2003
|
-
minX = Math.min(minX, p[0]);
|
|
2004
|
-
maxX = Math.max(maxX, p[0]);
|
|
2005
|
-
minY = Math.min(minY, p[1]);
|
|
2006
|
-
maxY = Math.max(maxY, p[1]);
|
|
2007
|
-
}
|
|
2008
|
-
const w = maxX - minX;
|
|
2009
|
-
const h = maxY - minY;
|
|
2010
|
-
if (!(w > 0 && h > 0)) return null;
|
|
2011
|
-
const tolerance = Math.max(1e-6, 2e-3 * Math.min(w, h));
|
|
2012
|
-
const polys = rings.map((r) => _chunkM4XE4UMTcjs.flattenChain.call(void 0, r, tolerance));
|
|
2013
|
-
let best = null;
|
|
2014
|
-
for (const f of [0.5, 0.3, 0.7, 0.15, 0.85]) {
|
|
2015
|
-
const y = minY + h * f;
|
|
2016
|
-
const xs = [];
|
|
2017
|
-
for (const poly of polys) {
|
|
2018
|
-
for (let i = 0; i < poly.length; i++) {
|
|
2019
|
-
const a = poly[i];
|
|
2020
|
-
const b = poly[(i + 1) % poly.length];
|
|
2021
|
-
if (a[1] <= y !== b[1] <= y) xs.push(a[0] + (y - a[1]) / (b[1] - a[1]) * (b[0] - a[0]));
|
|
2022
|
-
}
|
|
2023
|
-
}
|
|
2024
|
-
xs.sort((p, q) => p - q);
|
|
2025
|
-
for (let i = 0; i + 1 < xs.length; i += 2) {
|
|
2026
|
-
const span = xs[i + 1] - xs[i];
|
|
2027
|
-
if (!best || span > best.span) best = { span, p: [(xs[i] + xs[i + 1]) / 2, y] };
|
|
2028
|
-
}
|
|
2029
|
-
}
|
|
2030
|
-
return _nullishCoalesce(_optionalChain([best, 'optionalAccess', _58 => _58.p]), () => ( null));
|
|
2031
|
-
}
|
|
2032
|
-
function dropSpurious(rings, spurious) {
|
|
2033
|
-
const children = rings.map(() => []);
|
|
2034
|
-
rings.forEach((r, i) => {
|
|
2035
|
-
if (r.parent >= 0) children[r.parent].push(i);
|
|
2036
|
-
});
|
|
2037
|
-
const marked = rings.map((r, i) => spurious([r.segments, ...children[i].map((c) => rings[c].segments)], r));
|
|
2038
|
-
const hasMarkedAncestor = (i) => {
|
|
2039
|
-
for (let k = i; k >= 0; k = rings[k].parent) if (marked[k]) return true;
|
|
2040
|
-
return false;
|
|
2041
|
-
};
|
|
2042
|
-
return _chunkM4XE4UMTcjs.nestedRingsToPath.call(void 0, rings, (i) => !hasMarkedAncestor(i));
|
|
2043
|
-
}
|
|
2044
|
-
function mergeSmoothRuns(path, tolerance) {
|
|
2045
|
-
const contours = _chunkM4XE4UMTcjs.pathToContours.call(void 0, path).map((contour) => {
|
|
2046
|
-
const segs = _chunkM4XE4UMTcjs.closeContour.call(void 0, contour, true).map((s) => s.length === 3 ? raise(s) : [...s]);
|
|
2047
|
-
const n = segs.length;
|
|
2048
|
-
if (n < 2) return { segments: segs, closed: true };
|
|
2049
|
-
const smooth = (a, b) => {
|
|
2050
|
-
if (a.length !== 4 || b.length !== 4) return false;
|
|
2051
|
-
const ta = _chunkM4XE4UMTcjs.segmentTangent.call(void 0, a, 1);
|
|
2052
|
-
const tb = _chunkM4XE4UMTcjs.segmentTangent.call(void 0, b, 0);
|
|
2053
|
-
return _chunkM4XE4UMTcjs.dot.call(void 0, ta, tb) > 0.9998 && Math.abs(_chunkM4XE4UMTcjs.cross.call(void 0, ta, tb)) < 0.02;
|
|
2054
|
-
};
|
|
2055
|
-
let start = 0;
|
|
2056
|
-
for (let k = 0; k < n; k++) {
|
|
2057
|
-
if (!smooth(segs[(k + n - 1) % n], segs[k])) {
|
|
2058
|
-
start = k;
|
|
2059
|
-
break;
|
|
2060
|
-
}
|
|
2061
|
-
}
|
|
2062
|
-
const ordered = [...segs.slice(start), ...segs.slice(0, start)];
|
|
2063
|
-
const out = [];
|
|
2064
|
-
let i = 0;
|
|
2065
|
-
while (i < ordered.length) {
|
|
2066
|
-
let current = ordered[i];
|
|
2067
|
-
let j = i + 1;
|
|
2068
|
-
while (j < ordered.length && smooth(ordered[j - 1], ordered[j])) {
|
|
2069
|
-
const run = ordered.slice(i, j + 1);
|
|
2070
|
-
const pts = [];
|
|
2071
|
-
run.forEach((s, k) => {
|
|
2072
|
-
for (let q = k === 0 ? 0 : 1; q <= 12; q++) pts.push(_chunkM4XE4UMTcjs.segmentPoint.call(void 0, s, q / 12));
|
|
2073
|
-
});
|
|
2074
|
-
const fit = _chunkM4XE4UMTcjs.fitCubicRun.call(void 0, pts, tolerance, _chunkM4XE4UMTcjs.segmentTangent.call(void 0, run[0], 0), _chunkM4XE4UMTcjs.segmentTangent.call(void 0, run[run.length - 1], 1));
|
|
2075
|
-
if (fit.length !== 1) break;
|
|
2076
|
-
const c = fit[0];
|
|
2077
|
-
current = [run[0][0], c.p1, c.p2, run[run.length - 1][3]];
|
|
2078
|
-
j++;
|
|
2079
|
-
}
|
|
2080
|
-
out.push(current);
|
|
2081
|
-
i = j;
|
|
2082
|
-
}
|
|
2083
|
-
return { segments: out, closed: true };
|
|
2084
|
-
});
|
|
2085
|
-
return _chunkM4XE4UMTcjs.contoursToPath.call(void 0, contours);
|
|
2086
|
-
}
|
|
2087
|
-
function joinStyle(join, miterLimit) {
|
|
2088
|
-
return {
|
|
2089
|
-
join: _nullishCoalesce(join, () => ( "miter")),
|
|
2090
|
-
miterLimit: miterLimit !== void 0 && Number.isFinite(miterLimit) ? Math.max(1, miterLimit) : 4
|
|
2091
|
-
};
|
|
2092
|
-
}
|
|
2093
|
-
function strokeOutlineRings(input, options) {
|
|
2094
|
-
const h = options.width / 2;
|
|
2095
|
-
if (!(h > 0) || !Number.isFinite(h)) return [];
|
|
2096
|
-
const tol = options.tolerance && options.tolerance > 0 ? options.tolerance : DEFAULT_TOLERANCE;
|
|
2097
|
-
const style = { ...joinStyle(options.join, options.miterLimit), cap: _nullishCoalesce(options.cap, () => ( "butt")) };
|
|
2098
|
-
let contours = _chunkM4XE4UMTcjs.pathToContours.call(void 0, input);
|
|
2099
|
-
const rings = [];
|
|
2100
|
-
if (options.dash && options.dash.length > 0) {
|
|
2101
|
-
const dashed = dashContours(contours, options.dash, _nullishCoalesce(options.dashOffset, () => ( 0)));
|
|
2102
|
-
if (dashed) {
|
|
2103
|
-
contours = dashed.contours;
|
|
2104
|
-
for (const dot2 of dashed.dots) rings.push(...dotRings(dot2.point, dot2.tangent, h, style.cap));
|
|
2105
|
-
}
|
|
2106
|
-
}
|
|
2107
|
-
for (const contour of contours) rings.push(...strokeContour(contour, h, style, tol));
|
|
2108
|
-
return ringsToPath(rings);
|
|
2109
|
-
}
|
|
2110
|
-
function outlineStroke(input, options) {
|
|
2111
|
-
const h = options.width / 2;
|
|
2112
|
-
if (!(h > 0) || !Number.isFinite(h)) return [];
|
|
2113
|
-
let source;
|
|
2114
|
-
try {
|
|
2115
|
-
source = _chunkM4XE4UMTcjs.contoursToPath.call(void 0, _chunkM4XE4UMTcjs.pathToContours.call(void 0, input));
|
|
2116
|
-
} catch (e5) {
|
|
2117
|
-
return [];
|
|
2118
|
-
}
|
|
2119
|
-
if (source.some((c) => c.type !== "Z" && Object.values(c).some((v) => typeof v === "number" && !Number.isFinite(v)))) return [];
|
|
2120
|
-
const raw = strokeOutlineRings(source, options);
|
|
2121
|
-
if (raw.length === 0) return [];
|
|
2122
|
-
const tol = options.tolerance && options.tolerance > 0 ? options.tolerance : DEFAULT_TOLERANCE;
|
|
2123
|
-
const sourceContours = _chunkM4XE4UMTcjs.pathToContours.call(void 0, source);
|
|
2124
|
-
const operand = { path: raw, fillRule: "nonzero" };
|
|
2125
|
-
try {
|
|
2126
|
-
const rings = _chunkM4XE4UMTcjs.pathBooleanRings.call(void 0, "union", [operand], options);
|
|
2127
|
-
const cleaned = dropSpurious(rings, (face, ring) => {
|
|
2128
|
-
if (ring.area >= 0) return false;
|
|
2129
|
-
const p = deepPoint(face);
|
|
2130
|
-
return !!p && _chunkM4XE4UMTcjs.distanceToBezierPath.call(void 0, sourceContours, p) < h * (1 - 1e-4) - 1e-6;
|
|
2131
|
-
});
|
|
2132
|
-
return mergeSmoothRuns(cleaned, tol);
|
|
2133
|
-
} catch (e6) {
|
|
2134
|
-
return _chunkM4XE4UMTcjs.pathBoolean.call(void 0, "union", [operand], options).path;
|
|
2135
|
-
}
|
|
2136
|
-
}
|
|
2137
|
-
function offsetPath(input, distance, options = {}) {
|
|
2138
|
-
if (!Number.isFinite(distance)) return [];
|
|
2139
|
-
const contours = _chunkM4XE4UMTcjs.pathToContours.call(void 0, input);
|
|
2140
|
-
if (contours.some((c) => c.segments.some((s) => s.some((p) => !Number.isFinite(p[0]) || !Number.isFinite(p[1]))))) return [];
|
|
2141
|
-
const closed = contours.filter((c) => c.closed && c.segments.length > 0);
|
|
2142
|
-
const open = contours.filter((c) => !c.closed && c.segments.length > 0);
|
|
2143
|
-
const fillRule = _nullishCoalesce(options.fillRule, () => ( "nonzero"));
|
|
2144
|
-
const fill = { path: _chunkM4XE4UMTcjs.contoursToPath.call(void 0, closed), fillRule };
|
|
2145
|
-
const d = Math.abs(distance);
|
|
2146
|
-
const tol = options.tolerance && options.tolerance > 0 ? options.tolerance : DEFAULT_TOLERANCE;
|
|
2147
|
-
if (d === 0) return _chunkM4XE4UMTcjs.pathBoolean.call(void 0, "union", [fill], options).path;
|
|
2148
|
-
const strokeOptions = { width: 2 * d, join: _nullishCoalesce(options.join, () => ( "miter")), miterLimit: options.miterLimit, cap: "butt", tolerance: tol };
|
|
2149
|
-
const ring = { path: strokeOutlineRings(_chunkM4XE4UMTcjs.contoursToPath.call(void 0, closed), strokeOptions), fillRule: "nonzero" };
|
|
2150
|
-
const openRing = {
|
|
2151
|
-
path: distance > 0 ? strokeOutlineRings(_chunkM4XE4UMTcjs.contoursToPath.call(void 0, open), strokeOptions) : [],
|
|
2152
|
-
fillRule: "nonzero"
|
|
2153
|
-
};
|
|
2154
|
-
const grow = distance > 0;
|
|
2155
|
-
const operands = [fill, ring, openRing];
|
|
2156
|
-
try {
|
|
2157
|
-
const rings = _chunkM4XE4UMTcjs.pathBooleanRings.call(void 0, grow ? (m) => m[0] || m[1] || m[2] : (m) => m[0] && !m[1], operands, options);
|
|
2158
|
-
const sourceContours = contours;
|
|
2159
|
-
const cleaned = dropSpurious(rings, (face, r) => {
|
|
2160
|
-
if (grow ? r.area >= 0 : r.area <= 0) return false;
|
|
2161
|
-
const p = deepPoint(face);
|
|
2162
|
-
return !!p && _chunkM4XE4UMTcjs.distanceToBezierPath.call(void 0, sourceContours, p) < d * (1 - 1e-4) - 1e-6;
|
|
2163
|
-
});
|
|
2164
|
-
return mergeSmoothRuns(cleaned, tol);
|
|
2165
|
-
} catch (e7) {
|
|
2166
|
-
return grow ? _chunkM4XE4UMTcjs.pathBoolean.call(void 0, "union", operands, options).path : _chunkM4XE4UMTcjs.pathBoolean.call(void 0, "difference", [fill, ring], options).path;
|
|
2167
|
-
}
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
1725
|
// src/canvas/shapeNodes.ts
|
|
2171
1726
|
var SHAPE_DATA_KEY = "shape";
|
|
2172
1727
|
var SHAPE_NODE_TYPE = "shape";
|
|
@@ -2178,18 +1733,18 @@ var BOOLEAN_FOR = {
|
|
|
2178
1733
|
exclude: "xor"
|
|
2179
1734
|
};
|
|
2180
1735
|
function isShapeNode(node) {
|
|
2181
|
-
return !!node &&
|
|
1736
|
+
return !!node && _chunkBGNPT5PEcjs.isShapeDescription.call(void 0, _optionalChain([node, 'access', _55 => _55.data, 'optionalAccess', _56 => _56[SHAPE_DATA_KEY]]));
|
|
2182
1737
|
}
|
|
2183
1738
|
function getNodeShape(node) {
|
|
2184
|
-
const shape = _optionalChain([node, 'optionalAccess',
|
|
2185
|
-
return
|
|
1739
|
+
const shape = _optionalChain([node, 'optionalAccess', _57 => _57.data, 'optionalAccess', _58 => _58[SHAPE_DATA_KEY]]);
|
|
1740
|
+
return _chunkBGNPT5PEcjs.isShapeDescription.call(void 0, shape) ? shape : null;
|
|
2186
1741
|
}
|
|
2187
1742
|
function shapeNodeToPolygon(node, lookup, options = {}) {
|
|
2188
1743
|
const shape = getNodeShape(node);
|
|
2189
1744
|
if (!shape) return null;
|
|
2190
1745
|
const size = getNodeSize(node, options);
|
|
2191
1746
|
const origin = node.parentId && lookup ? getAbsolutePosition(node, lookup) : node.position;
|
|
2192
|
-
const { rings, fillRule } =
|
|
1747
|
+
const { rings, fillRule } = _chunkBGNPT5PEcjs.shapeToPolygon.call(void 0, shape, size, { tolerance: options.tolerance });
|
|
2193
1748
|
return {
|
|
2194
1749
|
rings: rings.map((ring) => ring.map(([x, y]) => [x + origin.x, y + origin.y])),
|
|
2195
1750
|
fillRule
|
|
@@ -2198,14 +1753,14 @@ function shapeNodeToPolygon(node, lookup, options = {}) {
|
|
|
2198
1753
|
function shapeToBezierPath(shape, size) {
|
|
2199
1754
|
const { width: w, height: h } = size;
|
|
2200
1755
|
if (!(w > 0) || !(h > 0)) return { path: [], fillRule: "nonzero" };
|
|
2201
|
-
const svg =
|
|
2202
|
-
let path =
|
|
1756
|
+
const svg = _chunkBGNPT5PEcjs.getShapeSvg.call(void 0, { ...shape, rotation: 0 }, size);
|
|
1757
|
+
let path = _chunkBGNPT5PEcjs.toBezierPath.call(void 0, svg.d);
|
|
2203
1758
|
if (shape.kind === "path" && shape.viewBox) {
|
|
2204
1759
|
const vb = shape.viewBox;
|
|
2205
1760
|
if (vb.length === 4 && vb.every(Number.isFinite) && vb[2] > 0 && vb[3] > 0) {
|
|
2206
1761
|
const sx = w / vb[2];
|
|
2207
1762
|
const sy = h / vb[3];
|
|
2208
|
-
path =
|
|
1763
|
+
path = _chunkBGNPT5PEcjs.transformBezierPath.call(void 0, path, [sx, 0, 0, sy, -vb[0] * sx, -vb[1] * sy]);
|
|
2209
1764
|
}
|
|
2210
1765
|
}
|
|
2211
1766
|
const deg = _nullishCoalesce(shape.rotation, () => ( 0));
|
|
@@ -2216,7 +1771,7 @@ function shapeToBezierPath(shape, size) {
|
|
|
2216
1771
|
const cx = w / 2;
|
|
2217
1772
|
const cy = h / 2;
|
|
2218
1773
|
const m = [cos, sin, -sin, cos, cx - cx * cos + cy * sin, cy - cx * sin - cy * cos];
|
|
2219
|
-
path =
|
|
1774
|
+
path = _chunkBGNPT5PEcjs.transformBezierPath.call(void 0, path, m);
|
|
2220
1775
|
}
|
|
2221
1776
|
return { path, fillRule: svg.fillRule };
|
|
2222
1777
|
}
|
|
@@ -2226,7 +1781,7 @@ function shapeNodeToBezierPath(node, lookup, options = {}) {
|
|
|
2226
1781
|
const size = getNodeSize(node, options);
|
|
2227
1782
|
const origin = node.parentId && lookup ? getAbsolutePosition(node, lookup) : node.position;
|
|
2228
1783
|
const { path, fillRule } = shapeToBezierPath(shape, size);
|
|
2229
|
-
return { path:
|
|
1784
|
+
return { path: _chunkBGNPT5PEcjs.transformBezierPath.call(void 0, path, [1, 0, 0, 1, origin.x, origin.y]), fillRule };
|
|
2230
1785
|
}
|
|
2231
1786
|
var idCounter = 0;
|
|
2232
1787
|
function defaultId2(index) {
|
|
@@ -2279,7 +1834,7 @@ function combineShapeNodes(nodes, ids, operation, options = {}) {
|
|
|
2279
1834
|
const operands = ordered.map((node) => shapeNodeToBezierPath(node, lookup, options));
|
|
2280
1835
|
const pathOptions = { epsilon: options.epsilon, onFallback: options.onFallback, fallbackTolerance: options.tolerance };
|
|
2281
1836
|
if (operation === "divide") {
|
|
2282
|
-
const result =
|
|
1837
|
+
const result = _chunkBGNPT5PEcjs.dividePaths.call(void 0, operands, pathOptions);
|
|
2283
1838
|
report = result;
|
|
2284
1839
|
for (const piece of result.pieces) {
|
|
2285
1840
|
const source = ordered[piece.operands[piece.operands.length - 1]];
|
|
@@ -2287,7 +1842,7 @@ function combineShapeNodes(nodes, ids, operation, options = {}) {
|
|
|
2287
1842
|
if (node) created.push(node);
|
|
2288
1843
|
}
|
|
2289
1844
|
} else {
|
|
2290
|
-
const result =
|
|
1845
|
+
const result = _chunkBGNPT5PEcjs.pathBoolean.call(void 0, BOOLEAN_FOR[operation], operands, pathOptions);
|
|
2291
1846
|
report = result;
|
|
2292
1847
|
const node = buildPathNode(result.path, pickSource(), createId(0), buildOptions);
|
|
2293
1848
|
if (node) created.push(node);
|
|
@@ -2295,8 +1850,8 @@ function combineShapeNodes(nodes, ids, operation, options = {}) {
|
|
|
2295
1850
|
} else {
|
|
2296
1851
|
report = { engine: "polygon" };
|
|
2297
1852
|
const operands = ordered.map((node) => shapeNodeToPolygon(node, lookup, options));
|
|
2298
|
-
const write = (polygon) =>
|
|
2299
|
-
|
|
1853
|
+
const write = (polygon) => _chunkBGNPT5PEcjs.toBezierPath.call(void 0,
|
|
1854
|
+
_chunkBGNPT5PEcjs.polygonToSvgPath.call(void 0, polygon, {
|
|
2300
1855
|
precision: 9,
|
|
2301
1856
|
simplify: options.simplify,
|
|
2302
1857
|
curves: _nullishCoalesce(options.curves, () => ( "fit")),
|
|
@@ -2305,13 +1860,13 @@ function combineShapeNodes(nodes, ids, operation, options = {}) {
|
|
|
2305
1860
|
})
|
|
2306
1861
|
);
|
|
2307
1862
|
if (operation === "divide") {
|
|
2308
|
-
for (const piece of
|
|
1863
|
+
for (const piece of _chunkBGNPT5PEcjs.dividePolygons.call(void 0, operands, { epsilon: options.epsilon })) {
|
|
2309
1864
|
const source = ordered[piece.operands[piece.operands.length - 1]];
|
|
2310
1865
|
const node = buildPathNode(write([piece.polygon]), source, createId(created.length), buildOptions);
|
|
2311
1866
|
if (node) created.push(node);
|
|
2312
1867
|
}
|
|
2313
1868
|
} else {
|
|
2314
|
-
const result =
|
|
1869
|
+
const result = _chunkBGNPT5PEcjs.polygonBoolean.call(void 0, BOOLEAN_FOR[operation], operands, { epsilon: options.epsilon });
|
|
2315
1870
|
const node = buildPathNode(write(result), pickSource(), createId(0), buildOptions);
|
|
2316
1871
|
if (node) created.push(node);
|
|
2317
1872
|
}
|
|
@@ -2328,12 +1883,12 @@ function combineShapeNodes(nodes, ids, operation, options = {}) {
|
|
|
2328
1883
|
return done2;
|
|
2329
1884
|
}
|
|
2330
1885
|
function buildPathNode(path, source, id, options) {
|
|
2331
|
-
const bounds =
|
|
1886
|
+
const bounds = _chunkBGNPT5PEcjs.bezierPathBounds.call(void 0, path);
|
|
2332
1887
|
if (!bounds) return null;
|
|
2333
1888
|
const width = bounds.maxX - bounds.minX;
|
|
2334
1889
|
const height = bounds.maxY - bounds.minY;
|
|
2335
1890
|
if (!(width > 0) || !(height > 0)) return null;
|
|
2336
|
-
const d =
|
|
1891
|
+
const d = _chunkBGNPT5PEcjs.bezierPathToSvg.call(void 0, path, { precision: _nullishCoalesce(options.precision, () => ( 3)), offset: { x: -bounds.minX, y: -bounds.minY } });
|
|
2337
1892
|
if (!d) return null;
|
|
2338
1893
|
const sourceShape = getNodeShape(source);
|
|
2339
1894
|
const shape = {
|
|
@@ -2465,7 +2020,7 @@ function offsetShapeNodes(nodes, ids, distance, options = {}) {
|
|
|
2465
2020
|
for (const id of check.shapeIds) {
|
|
2466
2021
|
const node = lookup.get(id);
|
|
2467
2022
|
const outline = shapeNodeToBezierPath(node, lookup, options);
|
|
2468
|
-
const path = offsetPath(outline.path, distance, {
|
|
2023
|
+
const path = _chunkBGNPT5PEcjs.offsetPath.call(void 0, outline.path, distance, {
|
|
2469
2024
|
join: options.join,
|
|
2470
2025
|
miterLimit: options.miterLimit,
|
|
2471
2026
|
fillRule: outline.fillRule,
|
|
@@ -2501,7 +2056,7 @@ function outlineShapeNodeStrokes(nodes, ids, options = {}) {
|
|
|
2501
2056
|
const node = lookup.get(id);
|
|
2502
2057
|
const shape = getNodeShape(node);
|
|
2503
2058
|
const outline = shapeNodeToBezierPath(node, lookup, options);
|
|
2504
|
-
const path = outlineStroke(outline.path, {
|
|
2059
|
+
const path = _chunkBGNPT5PEcjs.outlineStroke.call(void 0, outline.path, {
|
|
2505
2060
|
width: _nullishCoalesce(_nullishCoalesce(options.width, () => ( shape.strokeWidth)), () => ( 1)),
|
|
2506
2061
|
join: options.join,
|
|
2507
2062
|
cap: options.cap,
|
|
@@ -2633,7 +2188,7 @@ function snapResize(rect, handle, targets, options = {}) {
|
|
|
2633
2188
|
if (useEdges) consider(within(horizontal ? index.edgeX : index.edgeY, moving, tolerance), "edge");
|
|
2634
2189
|
if (useCentres) consider(within(horizontal ? index.centreX : index.centreY, moving, tolerance), "centre");
|
|
2635
2190
|
if (!best && grid > 0) {
|
|
2636
|
-
const origin = horizontal ? _nullishCoalesce(_optionalChain([options, 'access',
|
|
2191
|
+
const origin = horizontal ? _nullishCoalesce(_optionalChain([options, 'access', _59 => _59.gridOrigin, 'optionalAccess', _60 => _60.x]), () => ( 0)) : _nullishCoalesce(_optionalChain([options, 'access', _61 => _61.gridOrigin, 'optionalAccess', _62 => _62.y]), () => ( 0));
|
|
2637
2192
|
consider([snapToGrid(moving, grid, origin)], "grid");
|
|
2638
2193
|
}
|
|
2639
2194
|
return best;
|
|
@@ -2655,8 +2210,8 @@ function snapResize(rect, handle, targets, options = {}) {
|
|
|
2655
2210
|
const ratio = rect.height > 0 ? rect.width / rect.height : 0;
|
|
2656
2211
|
if (options.keepAspectRatio && ratio > 0 && (hitX || hitY)) {
|
|
2657
2212
|
if (axes.x !== 0 && axes.y !== 0) {
|
|
2658
|
-
const
|
|
2659
|
-
const useX =
|
|
2213
|
+
const dist = (h, horizontal) => h ? Math.abs(h.value - (horizontal ? axes.x < 0 ? x0 : x1 : axes.y < 0 ? y0 : y1)) : Infinity;
|
|
2214
|
+
const useX = dist(hitX, true) <= dist(hitY, false);
|
|
2660
2215
|
if (useX && hitX) {
|
|
2661
2216
|
setEdge(true, hitX.value);
|
|
2662
2217
|
const height = (nx1 - nx0) / ratio;
|
|
@@ -2757,25 +2312,25 @@ function clampLayoutSize(value, min, max) {
|
|
|
2757
2312
|
}
|
|
2758
2313
|
var finite = (v) => typeof v === "number" && Number.isFinite(v) ? v : 0;
|
|
2759
2314
|
function getAutoLayout(node) {
|
|
2760
|
-
const layout2 = _optionalChain([node, 'optionalAccess',
|
|
2315
|
+
const layout2 = _optionalChain([node, 'optionalAccess', _63 => _63.data, 'optionalAccess', _64 => _64[AUTO_LAYOUT_DATA_KEY]]);
|
|
2761
2316
|
return layout2 && typeof layout2 === "object" && MODES.has(layout2.mode) ? layout2 : void 0;
|
|
2762
2317
|
}
|
|
2763
2318
|
function isAutoLayoutFrame(node) {
|
|
2764
2319
|
return getAutoLayout(node) !== void 0;
|
|
2765
2320
|
}
|
|
2766
2321
|
function getChildLayout(node) {
|
|
2767
|
-
const child = _optionalChain([node, 'optionalAccess',
|
|
2322
|
+
const child = _optionalChain([node, 'optionalAccess', _65 => _65.data, 'optionalAccess', _66 => _66[CHILD_LAYOUT_DATA_KEY]]);
|
|
2768
2323
|
return child && typeof child === "object" ? child : {};
|
|
2769
2324
|
}
|
|
2770
2325
|
function getLayoutSizing(node, axis) {
|
|
2771
|
-
const value = _nullishCoalesce(_optionalChain([getChildLayout, 'call',
|
|
2326
|
+
const value = _nullishCoalesce(_optionalChain([getChildLayout, 'call', _67 => _67(node), 'access', _68 => _68.sizing, 'optionalAccess', _69 => _69[axis]]), () => ( _optionalChain([getAutoLayout, 'call', _70 => _70(node), 'optionalAccess', _71 => _71.sizing, 'optionalAccess', _72 => _72[axis]])));
|
|
2772
2327
|
return value === "hug" || value === "fill" ? value : "fixed";
|
|
2773
2328
|
}
|
|
2774
2329
|
function limitsOf(node) {
|
|
2775
2330
|
const child = getChildLayout(node);
|
|
2776
2331
|
const layout2 = getAutoLayout(node);
|
|
2777
|
-
const min = _nullishCoalesce(_nullishCoalesce(child.min, () => ( _optionalChain([layout2, 'optionalAccess',
|
|
2778
|
-
const max = _nullishCoalesce(_nullishCoalesce(child.max, () => ( _optionalChain([layout2, 'optionalAccess',
|
|
2332
|
+
const min = _nullishCoalesce(_nullishCoalesce(child.min, () => ( _optionalChain([layout2, 'optionalAccess', _73 => _73.min]))), () => ( {}));
|
|
2333
|
+
const max = _nullishCoalesce(_nullishCoalesce(child.max, () => ( _optionalChain([layout2, 'optionalAccess', _74 => _74.max]))), () => ( {}));
|
|
2779
2334
|
return { minW: min.width, maxW: max.width, minH: min.height, maxH: max.height };
|
|
2780
2335
|
}
|
|
2781
2336
|
function resolvePadding(padding) {
|
|
@@ -2795,13 +2350,13 @@ var LayoutState = (_class3 = class {
|
|
|
2795
2350
|
constructor(nodes, options = {}) {;_class3.prototype.__init8.call(this);_class3.prototype.__init9.call(this);_class3.prototype.__init10.call(this);
|
|
2796
2351
|
this.measure = _nullishCoalesce(options.measure, () => ( {}));
|
|
2797
2352
|
for (const node of nodes) {
|
|
2798
|
-
const size = _nullishCoalesce(_optionalChain([this, 'access',
|
|
2353
|
+
const size = _nullishCoalesce(_optionalChain([this, 'access', _75 => _75.measure, 'access', _76 => _76.size, 'optionalCall', _77 => _77(node)]), () => ( getNodeSize(node, options.rectOptions)));
|
|
2799
2354
|
const box = {
|
|
2800
2355
|
id: node.id,
|
|
2801
2356
|
node,
|
|
2802
2357
|
parent: node.parentId,
|
|
2803
|
-
x: finite(_optionalChain([node, 'access',
|
|
2804
|
-
y: finite(_optionalChain([node, 'access',
|
|
2358
|
+
x: finite(_optionalChain([node, 'access', _78 => _78.position, 'optionalAccess', _79 => _79.x])),
|
|
2359
|
+
y: finite(_optionalChain([node, 'access', _80 => _80.position, 'optionalAccess', _81 => _81.y])),
|
|
2805
2360
|
w: finite(size.width),
|
|
2806
2361
|
h: finite(size.height),
|
|
2807
2362
|
kids: []
|
|
@@ -2810,7 +2365,7 @@ var LayoutState = (_class3 = class {
|
|
|
2810
2365
|
this.original.set(node.id, { x: box.x, y: box.y, w: box.w, h: box.h });
|
|
2811
2366
|
}
|
|
2812
2367
|
for (const node of nodes) {
|
|
2813
|
-
if (node.parentId && node.parentId !== node.id) _optionalChain([this, 'access',
|
|
2368
|
+
if (node.parentId && node.parentId !== node.id) _optionalChain([this, 'access', _82 => _82.boxes, 'access', _83 => _83.get, 'call', _84 => _84(node.parentId), 'optionalAccess', _85 => _85.kids, 'access', _86 => _86.push, 'call', _87 => _87(node.id)]);
|
|
2814
2369
|
}
|
|
2815
2370
|
}
|
|
2816
2371
|
updates() {
|
|
@@ -2838,7 +2393,7 @@ var LayoutState = (_class3 = class {
|
|
|
2838
2393
|
ancestors(id) {
|
|
2839
2394
|
const out = [];
|
|
2840
2395
|
const seen = /* @__PURE__ */ new Set([id]);
|
|
2841
|
-
let parent = _optionalChain([this, 'access',
|
|
2396
|
+
let parent = _optionalChain([this, 'access', _88 => _88.boxes, 'access', _89 => _89.get, 'call', _90 => _90(id), 'optionalAccess', _91 => _91.parent]);
|
|
2842
2397
|
while (parent && !seen.has(parent) && this.boxes.has(parent)) {
|
|
2843
2398
|
out.push(parent);
|
|
2844
2399
|
seen.add(parent);
|
|
@@ -2876,10 +2431,10 @@ function fitHugText(s, id) {
|
|
|
2876
2431
|
if (getLayoutSizing(b.node, "width") === "hug") {
|
|
2877
2432
|
const w = clampLayoutSize(natural.width, minW, maxW);
|
|
2878
2433
|
const limited = Math.abs(w - natural.width) > EPS;
|
|
2879
|
-
const h = limited ? _nullishCoalesce(_optionalChain([s, 'access',
|
|
2434
|
+
const h = limited ? _nullishCoalesce(_optionalChain([s, 'access', _92 => _92.measure, 'access', _93 => _93.textHeight, 'optionalCall', _94 => _94(b.node, w)]), () => ( natural.height)) : natural.height;
|
|
2880
2435
|
setSize(s, id, w, h);
|
|
2881
2436
|
} else if (getLayoutSizing(b.node, "height") === "hug") {
|
|
2882
|
-
setSize(s, id, b.w, _nullishCoalesce(_optionalChain([s, 'access',
|
|
2437
|
+
setSize(s, id, b.w, _nullishCoalesce(_optionalChain([s, 'access', _95 => _95.measure, 'access', _96 => _96.textHeight, 'optionalCall', _97 => _97(b.node, b.w)]), () => ( b.h)));
|
|
2883
2438
|
}
|
|
2884
2439
|
}
|
|
2885
2440
|
function enforceLimits(s, id) {
|
|
@@ -2897,7 +2452,7 @@ function itemBaseline(s, id, depth) {
|
|
|
2897
2452
|
const b = s.boxes.get(id);
|
|
2898
2453
|
if (!b) return void 0;
|
|
2899
2454
|
if (isText(s, b)) {
|
|
2900
|
-
const v = _optionalChain([s, 'access',
|
|
2455
|
+
const v = _optionalChain([s, 'access', _98 => _98.measure, 'access', _99 => _99.textBaseline, 'optionalCall', _100 => _100(b.node)]);
|
|
2901
2456
|
return typeof v === "number" && Number.isFinite(v) ? v : void 0;
|
|
2902
2457
|
}
|
|
2903
2458
|
const layout2 = getAutoLayout(b.node);
|
|
@@ -2912,7 +2467,7 @@ function resizeChild(s, id, w, h) {
|
|
|
2912
2467
|
const b = s.boxes.get(id);
|
|
2913
2468
|
if (!b) return;
|
|
2914
2469
|
if (isText(s, b) && getLayoutSizing(b.node, "height") === "hug") {
|
|
2915
|
-
setSize(s, id, w, _nullishCoalesce(_optionalChain([s, 'access',
|
|
2470
|
+
setSize(s, id, w, _nullishCoalesce(_optionalChain([s, 'access', _101 => _101.measure, 'access', _102 => _102.textHeight, 'optionalCall', _103 => _103(b.node, w)]), () => ( h)));
|
|
2916
2471
|
return;
|
|
2917
2472
|
}
|
|
2918
2473
|
const ow = b.w;
|
|
@@ -3021,7 +2576,7 @@ function layoutFrameInner(s, frame) {
|
|
|
3021
2576
|
const b = s.boxes.get(id);
|
|
3022
2577
|
return horizontal ? [b.w, b.h] : [b.h, b.w];
|
|
3023
2578
|
};
|
|
3024
|
-
const resize = (it, main,
|
|
2579
|
+
const resize = (it, main, cross) => resizeChild(s, it.id, horizontal ? main : cross, horizontal ? cross : main);
|
|
3025
2580
|
if (!wraps) {
|
|
3026
2581
|
for (const it of items) {
|
|
3027
2582
|
if (!it.fillCross || it.fillMain) continue;
|
|
@@ -3035,13 +2590,13 @@ function layoutFrameInner(s, frame) {
|
|
|
3035
2590
|
let used = 0;
|
|
3036
2591
|
items.forEach((it, i) => {
|
|
3037
2592
|
const sz = it.fillMain ? _nullishCoalesce(it.minMain, () => ( 0)) : it.main;
|
|
3038
|
-
const
|
|
3039
|
-
if (cur.length > 0 && used +
|
|
2593
|
+
const add = cur.length === 0 ? sz : Math.max(gap, 0) + sz;
|
|
2594
|
+
if (cur.length > 0 && used + add > innerMainFixed + 1e-6) {
|
|
3040
2595
|
lines.push(cur);
|
|
3041
2596
|
cur = [];
|
|
3042
2597
|
used = sz;
|
|
3043
2598
|
} else {
|
|
3044
|
-
used +=
|
|
2599
|
+
used += add;
|
|
3045
2600
|
}
|
|
3046
2601
|
cur.push(i);
|
|
3047
2602
|
});
|
|
@@ -3057,8 +2612,8 @@ function layoutFrameInner(s, frame) {
|
|
|
3057
2612
|
}
|
|
3058
2613
|
for (const it of items) {
|
|
3059
2614
|
if (!it.fillMain) continue;
|
|
3060
|
-
const
|
|
3061
|
-
resize(it, it.main,
|
|
2615
|
+
const cross = it.fillCross && !wraps ? clampLayoutSize(innerCrossFixed, it.minCross, it.maxCross) : it.cross;
|
|
2616
|
+
resize(it, it.main, cross);
|
|
3062
2617
|
it.cross = sizeOf2(it.id)[1];
|
|
3063
2618
|
}
|
|
3064
2619
|
if (baseline) {
|
|
@@ -3072,8 +2627,8 @@ function layoutFrameInner(s, frame) {
|
|
|
3072
2627
|
const inLine = line2.map((i) => items[i]);
|
|
3073
2628
|
const mainUsed = inLine.reduce((sum, it) => sum + it.main, 0) + gaps;
|
|
3074
2629
|
const allFill = inLine.every((it) => it.fillCross);
|
|
3075
|
-
const
|
|
3076
|
-
extents.push([mainUsed,
|
|
2630
|
+
const cross = inLine.filter((it) => allFill || !it.fillCross).reduce((m, it) => Math.max(m, it.baseOff + it.cross), 0);
|
|
2631
|
+
extents.push([mainUsed, cross]);
|
|
3077
2632
|
}
|
|
3078
2633
|
const contentMain = extents.reduce((m, l) => Math.max(m, l[0]), 0);
|
|
3079
2634
|
let crossGap = al.rowGap !== void 0 ? finite(al.rowGap) : gap;
|
|
@@ -3159,16 +2714,16 @@ function trackSpec(tracks, i) {
|
|
|
3159
2714
|
return { sizing: t.sizing, value };
|
|
3160
2715
|
}
|
|
3161
2716
|
function cellRect(g, c) {
|
|
3162
|
-
const x0 = _nullishCoalesce(_optionalChain([g, 'access',
|
|
3163
|
-
const x1 = _nullishCoalesce(_optionalChain([g, 'access',
|
|
3164
|
-
const y0 = _nullishCoalesce(_optionalChain([g, 'access',
|
|
3165
|
-
const y1 = _nullishCoalesce(_optionalChain([g, 'access',
|
|
2717
|
+
const x0 = _nullishCoalesce(_optionalChain([g, 'access', _104 => _104.columns, 'access', _105 => _105[c.column], 'optionalAccess', _106 => _106[0]]), () => ( 0));
|
|
2718
|
+
const x1 = _nullishCoalesce(_optionalChain([g, 'access', _107 => _107.columns, 'access', _108 => _108[c.column + c.columnSpan - 1], 'optionalAccess', _109 => _109[1]]), () => ( x0));
|
|
2719
|
+
const y0 = _nullishCoalesce(_optionalChain([g, 'access', _110 => _110.rows, 'access', _111 => _111[c.row], 'optionalAccess', _112 => _112[0]]), () => ( 0));
|
|
2720
|
+
const y1 = _nullishCoalesce(_optionalChain([g, 'access', _113 => _113.rows, 'access', _114 => _114[c.row + c.rowSpan - 1], 'optionalAccess', _115 => _115[1]]), () => ( y0));
|
|
3166
2721
|
return { x: x0, y: y0, width: Math.max(x1, x0) - x0, height: Math.max(y1, y0) - y0 };
|
|
3167
2722
|
}
|
|
3168
2723
|
var toIndex = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0 ? Math.floor(v) : void 0;
|
|
3169
2724
|
function gridPlace(s, al, kids) {
|
|
3170
|
-
const cols = trackList(_optionalChain([al, 'access',
|
|
3171
|
-
const minRows = trackList(_optionalChain([al, 'access',
|
|
2725
|
+
const cols = trackList(_optionalChain([al, 'access', _116 => _116.grid, 'optionalAccess', _117 => _117.columns]), 2).count;
|
|
2726
|
+
const minRows = trackList(_optionalChain([al, 'access', _118 => _118.grid, 'optionalAccess', _119 => _119.rows]), 1).count;
|
|
3172
2727
|
const maxRows = Math.min(Math.max(Math.floor(MAX_GRID_CELLS / cols), 1), MAX_TRACKS);
|
|
3173
2728
|
const occ = [];
|
|
3174
2729
|
const free = (c, r, cs, rs) => {
|
|
@@ -3311,8 +2866,8 @@ function gridGeometryOf(s, frame) {
|
|
|
3311
2866
|
const [pt, pr, pb, pl] = resolvePadding(al.padding);
|
|
3312
2867
|
const kids = flowChildren(s, frame);
|
|
3313
2868
|
const { cells, rows } = gridPlace(s, al, kids);
|
|
3314
|
-
const colSpec = trackList(_optionalChain([al, 'access',
|
|
3315
|
-
const rowSpec = trackList(_optionalChain([al, 'access',
|
|
2869
|
+
const colSpec = trackList(_optionalChain([al, 'access', _120 => _120.grid, 'optionalAccess', _121 => _121.columns]), 2);
|
|
2870
|
+
const rowSpec = trackList(_optionalChain([al, 'access', _122 => _122.grid, 'optionalAccess', _123 => _123.rows]), 1);
|
|
3316
2871
|
const cols = colSpec.count;
|
|
3317
2872
|
const gx = Math.max(finite(al.gap), 0);
|
|
3318
2873
|
const gy = Math.max(al.rowGap !== void 0 ? finite(al.rowGap) : gx, 0);
|
|
@@ -3414,7 +2969,7 @@ function constrain(s, id, ow, oh) {
|
|
|
3414
2969
|
let y1 = c.y + c.h;
|
|
3415
2970
|
const dx = nw - ow;
|
|
3416
2971
|
const dy = nh - oh;
|
|
3417
|
-
switch (_nullishCoalesce(_optionalChain([child, 'access',
|
|
2972
|
+
switch (_nullishCoalesce(_optionalChain([child, 'access', _124 => _124.constraints, 'optionalAccess', _125 => _125.horizontal]), () => ( "left"))) {
|
|
3418
2973
|
case "right":
|
|
3419
2974
|
x0 += dx;
|
|
3420
2975
|
x1 += dx;
|
|
@@ -3431,7 +2986,7 @@ function constrain(s, id, ow, oh) {
|
|
|
3431
2986
|
x1 *= sx;
|
|
3432
2987
|
break;
|
|
3433
2988
|
}
|
|
3434
|
-
switch (_nullishCoalesce(_optionalChain([child, 'access',
|
|
2989
|
+
switch (_nullishCoalesce(_optionalChain([child, 'access', _126 => _126.constraints, 'optionalAccess', _127 => _127.vertical]), () => ( "top"))) {
|
|
3435
2990
|
case "bottom":
|
|
3436
2991
|
y0 += dy;
|
|
3437
2992
|
y1 += dy;
|
|
@@ -3471,7 +3026,7 @@ function postOrder(s, nodes) {
|
|
|
3471
3026
|
const visit = (id) => {
|
|
3472
3027
|
if (seen.has(id)) return;
|
|
3473
3028
|
seen.add(id);
|
|
3474
|
-
for (const k of _nullishCoalesce(_optionalChain([s, 'access',
|
|
3029
|
+
for (const k of _nullishCoalesce(_optionalChain([s, 'access', _128 => _128.boxes, 'access', _129 => _129.get, 'call', _130 => _130(id), 'optionalAccess', _131 => _131.kids]), () => ( []))) visit(k);
|
|
3475
3030
|
out.push(id);
|
|
3476
3031
|
};
|
|
3477
3032
|
const roots = nodes.filter((n) => !n.parentId || !s.boxes.has(n.parentId));
|
|
@@ -3510,7 +3065,7 @@ function getFlowChildren(nodes, frameId) {
|
|
|
3510
3065
|
function getLayoutParent(nodes, id) {
|
|
3511
3066
|
const lookup = createNodeLookup(nodes);
|
|
3512
3067
|
const node = lookup.get(id);
|
|
3513
|
-
if (!_optionalChain([node, 'optionalAccess',
|
|
3068
|
+
if (!_optionalChain([node, 'optionalAccess', _132 => _132.parentId]) || getChildLayout(node).absolute) return void 0;
|
|
3514
3069
|
const parent = lookup.get(node.parentId);
|
|
3515
3070
|
return isAutoLayoutFrame(parent) ? parent : void 0;
|
|
3516
3071
|
}
|
|
@@ -3523,7 +3078,7 @@ function makeSizingCoherent(nodes, id, options = {}) {
|
|
|
3523
3078
|
if (!targets.has(node.id)) return node;
|
|
3524
3079
|
const parent = node.parentId ? lookup.get(node.parentId) : void 0;
|
|
3525
3080
|
const flowParent = parent && isAutoLayoutFrame(parent) && !getChildLayout(node).absolute ? parent : void 0;
|
|
3526
|
-
const canHug = isAutoLayoutFrame(node) || _optionalChain([options, 'access',
|
|
3081
|
+
const canHug = isAutoLayoutFrame(node) || _optionalChain([options, 'access', _133 => _133.measure, 'optionalAccess', _134 => _134.textSize, 'optionalCall', _135 => _135(node)]) !== void 0;
|
|
3527
3082
|
const coherent = (axis) => {
|
|
3528
3083
|
const sizing = getLayoutSizing(node, axis);
|
|
3529
3084
|
if (sizing === "fill" && (!flowParent || getLayoutSizing(flowParent, axis) === "hug")) return "fixed";
|
|
@@ -3555,13 +3110,13 @@ function getAutoLayoutInsertTarget(nodes, frameId, point, options = {}) {
|
|
|
3555
3110
|
const horizontal = al.mode !== "vertical";
|
|
3556
3111
|
const main = (b) => horizontal ? b.x : b.y;
|
|
3557
3112
|
const mainSize = (b) => horizontal ? b.w : b.h;
|
|
3558
|
-
const
|
|
3113
|
+
const cross = (b) => horizontal ? b.y : b.x;
|
|
3559
3114
|
const crossSize = (b) => horizontal ? b.h : b.w;
|
|
3560
3115
|
const p = { x: px2, y: py };
|
|
3561
3116
|
const multiLine = al.mode === "grid" || !!al.wrap;
|
|
3562
3117
|
let index = 0;
|
|
3563
3118
|
for (const b of siblings) {
|
|
3564
|
-
const before = multiLine ?
|
|
3119
|
+
const before = multiLine ? cross(b) + crossSize(b) <= cross(p) || cross(b) <= cross(p) && main(b) + mainSize(b) / 2 < main(p) : main(b) + mainSize(b) / 2 < main(p);
|
|
3565
3120
|
if (before) index += 1;
|
|
3566
3121
|
}
|
|
3567
3122
|
const [pt, pr, pb, pl] = resolvePadding(al.padding);
|
|
@@ -3570,13 +3125,13 @@ function getAutoLayoutInsertTarget(nodes, frameId, point, options = {}) {
|
|
|
3570
3125
|
const f = s.boxes.get(frameId);
|
|
3571
3126
|
let guide;
|
|
3572
3127
|
if (horizontal) {
|
|
3573
|
-
const x = prev && next && Math.abs(
|
|
3128
|
+
const x = prev && next && Math.abs(cross(prev) - cross(next)) < 1e-6 ? (prev.x + prev.w + next.x) / 2 : prev ? prev.x + prev.w : next ? next.x : pl;
|
|
3574
3129
|
const ref = _nullishCoalesce(next, () => ( prev));
|
|
3575
3130
|
const y1 = ref ? ref.y : pt;
|
|
3576
3131
|
const y2 = ref ? ref.y + ref.h : f.h - pb;
|
|
3577
3132
|
guide = { orientation: "vertical", kind: "edge", x1: origin.x + x, y1: origin.y + y1, x2: origin.x + x, y2: origin.y + y2 };
|
|
3578
3133
|
} else {
|
|
3579
|
-
const y = prev && next && Math.abs(
|
|
3134
|
+
const y = prev && next && Math.abs(cross(prev) - cross(next)) < 1e-6 ? (prev.y + prev.h + next.y) / 2 : prev ? prev.y + prev.h : next ? next.y : pt;
|
|
3580
3135
|
const ref = _nullishCoalesce(next, () => ( prev));
|
|
3581
3136
|
const x1 = ref ? ref.x : pl;
|
|
3582
3137
|
const x2 = ref ? ref.x + ref.w : f.w - pr;
|
|
@@ -3586,7 +3141,7 @@ function getAutoLayoutInsertTarget(nodes, frameId, point, options = {}) {
|
|
|
3586
3141
|
}
|
|
3587
3142
|
function moveLayoutChild(nodes, childId, index) {
|
|
3588
3143
|
const child = nodes.find((n) => n.id === childId);
|
|
3589
|
-
if (!_optionalChain([child, 'optionalAccess',
|
|
3144
|
+
if (!_optionalChain([child, 'optionalAccess', _136 => _136.parentId])) return nodes;
|
|
3590
3145
|
const siblings = nodes.filter((n) => n.parentId === child.parentId && n.id !== child.parentId);
|
|
3591
3146
|
const flow = siblings.filter((n) => n.hidden !== true && !getChildLayout(n).absolute && n.id !== childId);
|
|
3592
3147
|
const clamped = Math.min(Math.max(Math.floor(Number.isFinite(index) ? index : 0), 0), flow.length);
|
|
@@ -3634,11 +3189,11 @@ function createCanvasArrangeController(options) {
|
|
|
3634
3189
|
let resizeStart = null;
|
|
3635
3190
|
let resizeIndex = null;
|
|
3636
3191
|
let lastResized = null;
|
|
3637
|
-
const selectedIds = (ids) => ids ? [...ids] : _nullishCoalesce(_optionalChain([options, 'access',
|
|
3192
|
+
const selectedIds = (ids) => ids ? [...ids] : _nullishCoalesce(_optionalChain([options, 'access', _137 => _137.getSelectedIds, 'optionalCall', _138 => _138()]), () => ( options.getNodes().filter((n) => n.selected).map((n) => n.id)));
|
|
3638
3193
|
const setGuides = (next) => {
|
|
3639
3194
|
if (next.length === 0 && guides.length === 0) return;
|
|
3640
3195
|
guides = next;
|
|
3641
|
-
_optionalChain([options, 'access',
|
|
3196
|
+
_optionalChain([options, 'access', _139 => _139.onGuidesChange, 'optionalCall', _140 => _140(guides)]);
|
|
3642
3197
|
};
|
|
3643
3198
|
function apply(name, updates) {
|
|
3644
3199
|
if (updates.length === 0) return updates;
|
|
@@ -3841,7 +3396,7 @@ function createCanvasArrangeController(options) {
|
|
|
3841
3396
|
const result = snapNodeDrag(options.getNodes(), list, {
|
|
3842
3397
|
...rect(),
|
|
3843
3398
|
...options.guides,
|
|
3844
|
-
zoom: _nullishCoalesce(_optionalChain([options, 'access',
|
|
3399
|
+
zoom: _nullishCoalesce(_optionalChain([options, 'access', _141 => _141.getZoom, 'optionalCall', _142 => _142()]), () => ( 1)),
|
|
3845
3400
|
index: dragIndex
|
|
3846
3401
|
});
|
|
3847
3402
|
lastSnapped = /* @__PURE__ */ new Map();
|
|
@@ -3879,7 +3434,7 @@ function createCanvasArrangeController(options) {
|
|
|
3879
3434
|
const result = snapNodeDrag(nodes, ids, {
|
|
3880
3435
|
...rect(),
|
|
3881
3436
|
...options.guides,
|
|
3882
|
-
zoom: _nullishCoalesce(_optionalChain([options, 'access',
|
|
3437
|
+
zoom: _nullishCoalesce(_optionalChain([options, 'access', _143 => _143.getZoom, 'optionalCall', _144 => _144()]), () => ( 1)),
|
|
3883
3438
|
index: dragIndex
|
|
3884
3439
|
});
|
|
3885
3440
|
setGuides(result.guides);
|
|
@@ -3945,7 +3500,7 @@ function createCanvasArrangeController(options) {
|
|
|
3945
3500
|
...rect(),
|
|
3946
3501
|
...options.guides,
|
|
3947
3502
|
...options.resize,
|
|
3948
|
-
zoom: _nullishCoalesce(_optionalChain([options, 'access',
|
|
3503
|
+
zoom: _nullishCoalesce(_optionalChain([options, 'access', _145 => _145.getZoom, 'optionalCall', _146 => _146()]), () => ( 1)),
|
|
3949
3504
|
index: resizeIndex
|
|
3950
3505
|
});
|
|
3951
3506
|
lastResized = result.updates.length > 0 ? result : null;
|
|
@@ -3964,7 +3519,7 @@ function createCanvasArrangeController(options) {
|
|
|
3964
3519
|
resizeIndex = null;
|
|
3965
3520
|
lastResized = null;
|
|
3966
3521
|
setGuides([]);
|
|
3967
|
-
const update = _optionalChain([last, 'optionalAccess',
|
|
3522
|
+
const update = _optionalChain([last, 'optionalAccess', _147 => _147.updates, 'access', _148 => _148[0]]);
|
|
3968
3523
|
if (!update) return;
|
|
3969
3524
|
const node = options.getNodes().find((n) => n.id === update.id);
|
|
3970
3525
|
if (!node) return;
|
|
@@ -3992,7 +3547,7 @@ function createCanvasArrangeController(options) {
|
|
|
3992
3547
|
return changes.filter((c) => !isResizeChange(c));
|
|
3993
3548
|
}
|
|
3994
3549
|
if (dims.resizing === false) {
|
|
3995
|
-
const last = _optionalChain([lastResized, 'optionalAccess',
|
|
3550
|
+
const last = _optionalChain([lastResized, 'optionalAccess', _149 => _149.updates, 'access', _150 => _150[0]]);
|
|
3996
3551
|
lastResized = null;
|
|
3997
3552
|
controller.endResize();
|
|
3998
3553
|
if (!last || last.id !== id) return changes;
|
|
@@ -4006,7 +3561,7 @@ function createCanvasArrangeController(options) {
|
|
|
4006
3561
|
const posChange = changes.find((c) => c.id === id && c.type === "position" && !!c.position);
|
|
4007
3562
|
const parent = node.parentId ? lookup.get(node.parentId) : void 0;
|
|
4008
3563
|
const origin = parent ? getResizingNodeRect(parent, lookup, rect()) : { x: 0, y: 0 };
|
|
4009
|
-
const position = _nullishCoalesce(_optionalChain([posChange, 'optionalAccess',
|
|
3564
|
+
const position = _nullishCoalesce(_optionalChain([posChange, 'optionalAccess', _151 => _151.position]), () => ( node.position));
|
|
4010
3565
|
const proposed = {
|
|
4011
3566
|
x: position.x + origin.x,
|
|
4012
3567
|
y: position.y + origin.y,
|
|
@@ -4022,7 +3577,7 @@ function createCanvasArrangeController(options) {
|
|
|
4022
3577
|
...rect(),
|
|
4023
3578
|
...options.guides,
|
|
4024
3579
|
...options.resize,
|
|
4025
|
-
zoom: _nullishCoalesce(_optionalChain([options, 'access',
|
|
3580
|
+
zoom: _nullishCoalesce(_optionalChain([options, 'access', _152 => _152.getZoom, 'optionalCall', _153 => _153()]), () => ( 1)),
|
|
4026
3581
|
index: resizeIndex
|
|
4027
3582
|
});
|
|
4028
3583
|
setGuides(result.guides);
|
|
@@ -4203,7 +3758,7 @@ function createCanvasAutoLayoutController(options) {
|
|
|
4203
3758
|
const setGuides = (next) => {
|
|
4204
3759
|
if (next.length === 0 && guides.length === 0) return;
|
|
4205
3760
|
guides = next;
|
|
4206
|
-
_optionalChain([options, 'access',
|
|
3761
|
+
_optionalChain([options, 'access', _154 => _154.onGuidesChange, 'optionalCall', _155 => _155(guides)]);
|
|
4207
3762
|
};
|
|
4208
3763
|
function run(name, forward, backward, ids, extra = [], restore) {
|
|
4209
3764
|
const before = options.getNodes();
|
|
@@ -4369,11 +3924,11 @@ function createCanvasAutoLayoutController(options) {
|
|
|
4369
3924
|
const nodes = options.getNodes();
|
|
4370
3925
|
const lookup = createNodeLookup(nodes);
|
|
4371
3926
|
for (const c of changes) {
|
|
4372
|
-
const id = _nullishCoalesce(c.id, () => ( _optionalChain([c, 'access',
|
|
3927
|
+
const id = _nullishCoalesce(c.id, () => ( _optionalChain([c, 'access', _156 => _156.item, 'optionalAccess', _157 => _157.id])));
|
|
4373
3928
|
if (c.type === "add" && c.item) {
|
|
4374
3929
|
pendingIds.add(c.item.id);
|
|
4375
3930
|
} else if (c.type === "remove" && id) {
|
|
4376
|
-
const parent = _optionalChain([lookup, 'access',
|
|
3931
|
+
const parent = _optionalChain([lookup, 'access', _158 => _158.get, 'call', _159 => _159(id), 'optionalAccess', _160 => _160.parentId]);
|
|
4377
3932
|
if (parent) pendingIds.add(parent);
|
|
4378
3933
|
else pendingAll = true;
|
|
4379
3934
|
} else if (c.type === "replace" && id) {
|
|
@@ -4539,8 +4094,8 @@ function withStyle(node, prop, value, unitless = false) {
|
|
|
4539
4094
|
return { ...node, style: writeNodeStyleProperty(node.style, prop, value, unitless) };
|
|
4540
4095
|
}
|
|
4541
4096
|
function shapeOf(node) {
|
|
4542
|
-
const shape = _optionalChain([node, 'access',
|
|
4543
|
-
return
|
|
4097
|
+
const shape = _optionalChain([node, 'access', _161 => _161.data, 'optionalAccess', _162 => _162.shape]);
|
|
4098
|
+
return _chunkBGNPT5PEcjs.isShapeDescription.call(void 0, shape) ? shape : null;
|
|
4544
4099
|
}
|
|
4545
4100
|
function withShape(node, key, value) {
|
|
4546
4101
|
const shape = shapeOf(node);
|
|
@@ -4708,10 +4263,10 @@ function stringRecord(value) {
|
|
|
4708
4263
|
return out;
|
|
4709
4264
|
}
|
|
4710
4265
|
function getNodeTokenBindings(node) {
|
|
4711
|
-
return stringRecord(_optionalChain([node, 'optionalAccess',
|
|
4266
|
+
return stringRecord(_optionalChain([node, 'optionalAccess', _163 => _163.data, 'optionalAccess', _164 => _164[TOKEN_BINDINGS_DATA_KEY]]));
|
|
4712
4267
|
}
|
|
4713
4268
|
function getNodeTokenModes(node) {
|
|
4714
|
-
return stringRecord(_optionalChain([node, 'optionalAccess',
|
|
4269
|
+
return stringRecord(_optionalChain([node, 'optionalAccess', _165 => _165.data, 'optionalAccess', _166 => _166[TOKEN_MODES_DATA_KEY]]));
|
|
4715
4270
|
}
|
|
4716
4271
|
function getCanvasTokenProperty(key, options = {}) {
|
|
4717
4272
|
return (_nullishCoalesce(options.properties, () => ( CANVAS_TOKEN_PROPERTIES))).find((p) => p.key === key);
|
|
@@ -4920,12 +4475,12 @@ function tokenBacked(key, label, type, extra = {}) {
|
|
|
4920
4475
|
...extra,
|
|
4921
4476
|
read: (node) => {
|
|
4922
4477
|
const p = getCanvasTokenProperty(key);
|
|
4923
|
-
const v = _optionalChain([p, 'optionalAccess',
|
|
4478
|
+
const v = _optionalChain([p, 'optionalAccess', _167 => _167.appliesTo, 'call', _168 => _168(node)]) ? p.read(node) : void 0;
|
|
4924
4479
|
return typeof v === "number" || typeof v === "string" ? v : void 0;
|
|
4925
4480
|
},
|
|
4926
4481
|
write: (node, value) => {
|
|
4927
4482
|
const p = getCanvasTokenProperty(key);
|
|
4928
|
-
return _optionalChain([p, 'optionalAccess',
|
|
4483
|
+
return _optionalChain([p, 'optionalAccess', _169 => _169.appliesTo, 'call', _170 => _170(node)]) ? p.write(node, value) : node;
|
|
4929
4484
|
}
|
|
4930
4485
|
};
|
|
4931
4486
|
}
|
|
@@ -4936,7 +4491,7 @@ function sizeProperty(key, label) {
|
|
|
4936
4491
|
type: "number",
|
|
4937
4492
|
min: 0,
|
|
4938
4493
|
unit: "px",
|
|
4939
|
-
read: (node) => _nullishCoalesce(_nullishCoalesce(num(node[key]), () => ( readStyleSize(node.style)[key])), () => ( num(_optionalChain([node, 'access',
|
|
4494
|
+
read: (node) => _nullishCoalesce(_nullishCoalesce(num(node[key]), () => ( readStyleSize(node.style)[key])), () => ( num(_optionalChain([node, 'access', _171 => _171.measured, 'optionalAccess', _172 => _172[key]])))),
|
|
4940
4495
|
write: (node, value) => {
|
|
4941
4496
|
const v = tidy(Math.max(0, value));
|
|
4942
4497
|
return { ...node, [key]: v, style: withStyleSize(node.style, { [key]: v }) };
|
|
@@ -4944,12 +4499,12 @@ function sizeProperty(key, label) {
|
|
|
4944
4499
|
};
|
|
4945
4500
|
}
|
|
4946
4501
|
function motionPathPoint(node, progress) {
|
|
4947
|
-
const path = _optionalChain([getNodeAnimation, 'call',
|
|
4502
|
+
const path = _optionalChain([getNodeAnimation, 'call', _173 => _173(node), 'optionalAccess', _174 => _174.motionPath]);
|
|
4948
4503
|
if (!path || typeof path.d !== "string") return null;
|
|
4949
4504
|
try {
|
|
4950
|
-
const length =
|
|
4951
|
-
return
|
|
4952
|
-
} catch (
|
|
4505
|
+
const length = _chunkBGNPT5PEcjs.bezierPathLength.call(void 0, path.d);
|
|
4506
|
+
return _chunkBGNPT5PEcjs.bezierPathPointAtLength.call(void 0, path.d, Math.min(1, Math.max(0, progress)) * length);
|
|
4507
|
+
} catch (e5) {
|
|
4953
4508
|
return null;
|
|
4954
4509
|
}
|
|
4955
4510
|
}
|
|
@@ -4959,7 +4514,7 @@ var ANIMATABLE_PROPERTIES = [
|
|
|
4959
4514
|
label: "X",
|
|
4960
4515
|
type: "number",
|
|
4961
4516
|
unit: "px",
|
|
4962
|
-
read: (node) => num(_optionalChain([node, 'access',
|
|
4517
|
+
read: (node) => num(_optionalChain([node, 'access', _175 => _175.position, 'optionalAccess', _176 => _176.x])),
|
|
4963
4518
|
write: (node, value) => ({ ...node, position: { ...node.position, x: tidy(value) } })
|
|
4964
4519
|
},
|
|
4965
4520
|
{
|
|
@@ -4967,7 +4522,7 @@ var ANIMATABLE_PROPERTIES = [
|
|
|
4967
4522
|
label: "Y",
|
|
4968
4523
|
type: "number",
|
|
4969
4524
|
unit: "px",
|
|
4970
|
-
read: (node) => num(_optionalChain([node, 'access',
|
|
4525
|
+
read: (node) => num(_optionalChain([node, 'access', _177 => _177.position, 'optionalAccess', _178 => _178.y])),
|
|
4971
4526
|
write: (node, value) => ({ ...node, position: { ...node.position, y: tidy(value) } })
|
|
4972
4527
|
},
|
|
4973
4528
|
sizeProperty("width", "Width"),
|
|
@@ -5025,7 +4580,7 @@ var ANIMATABLE_PROPERTIES = [
|
|
|
5025
4580
|
...node,
|
|
5026
4581
|
position: { x: tidy(at.point[0] - width / 2), y: tidy(at.point[1] - height / 2) }
|
|
5027
4582
|
};
|
|
5028
|
-
if (_optionalChain([getNodeAnimation, 'call',
|
|
4583
|
+
if (_optionalChain([getNodeAnimation, 'call', _179 => _179(node), 'optionalAccess', _180 => _180.motionPath, 'optionalAccess', _181 => _181.autoRotate])) {
|
|
5029
4584
|
const base = _nullishCoalesce(num(readNodeStyleProperty(node.style, "rotate")), () => ( 0));
|
|
5030
4585
|
next = { ...next, style: writeNodeStyleProperty(next.style, "rotate", `${tidy(base + at.angle * 180 / Math.PI)}deg`) };
|
|
5031
4586
|
}
|
|
@@ -5044,12 +4599,12 @@ function clampAnimationValue(property, value) {
|
|
|
5044
4599
|
return v;
|
|
5045
4600
|
}
|
|
5046
4601
|
function getNodeAnimation(node) {
|
|
5047
|
-
const raw = _optionalChain([node, 'optionalAccess',
|
|
4602
|
+
const raw = _optionalChain([node, 'optionalAccess', _182 => _182.data, 'optionalAccess', _183 => _183[ANIMATION_DATA_KEY]]);
|
|
5048
4603
|
if (typeof raw !== "object" || raw === null || typeof raw.tracks !== "object" || raw.tracks === null) return null;
|
|
5049
4604
|
return raw;
|
|
5050
4605
|
}
|
|
5051
4606
|
function getAnimationTrack(node, property) {
|
|
5052
|
-
const track = _optionalChain([getNodeAnimation, 'call',
|
|
4607
|
+
const track = _optionalChain([getNodeAnimation, 'call', _184 => _184(node), 'optionalAccess', _185 => _185.tracks, 'access', _186 => _186[property]]);
|
|
5053
4608
|
return track && Array.isArray(track.keyframes) && _chunkXHRZSB77cjs.normalizeKeyframes.call(void 0, track.keyframes).length > 0 ? track : void 0;
|
|
5054
4609
|
}
|
|
5055
4610
|
function isNodeAnimated(node) {
|
|
@@ -5073,7 +4628,7 @@ function withNodeAnimation(node, animation) {
|
|
|
5073
4628
|
}
|
|
5074
4629
|
}
|
|
5075
4630
|
const data = { ..._nullishCoalesce(node.data, () => ( {})) };
|
|
5076
|
-
if (Object.keys(tracks).length === 0 && !_optionalChain([animation, 'optionalAccess',
|
|
4631
|
+
if (Object.keys(tracks).length === 0 && !_optionalChain([animation, 'optionalAccess', _187 => _187.motionPath])) delete data[ANIMATION_DATA_KEY];
|
|
5077
4632
|
else data[ANIMATION_DATA_KEY] = { ...animation, tracks };
|
|
5078
4633
|
return { ...node, data };
|
|
5079
4634
|
}
|
|
@@ -5104,7 +4659,7 @@ function evaluateAnimation(doc, time, options = {}) {
|
|
|
5104
4659
|
for (const [key, track] of Object.entries(animation.tracks)) {
|
|
5105
4660
|
if (!track || track.enabled === false) continue;
|
|
5106
4661
|
const property = (_nullishCoalesce(options.properties, () => ( ANIMATABLE_PROPERTIES))).find((p) => p.key === key);
|
|
5107
|
-
const value = _chunkXHRZSB77cjs.evaluateTrack.call(void 0, track, time, _nullishCoalesce(_optionalChain([property, 'optionalAccess',
|
|
4662
|
+
const value = _chunkXHRZSB77cjs.evaluateTrack.call(void 0, track, time, _nullishCoalesce(_optionalChain([property, 'optionalAccess', _188 => _188.type]), () => ( "number")));
|
|
5108
4663
|
if (value === void 0) continue;
|
|
5109
4664
|
(values ??= {})[key] = clampAnimationValue(property, value);
|
|
5110
4665
|
}
|
|
@@ -5150,7 +4705,7 @@ function snapTimeToFrame(time, fps) {
|
|
|
5150
4705
|
return Math.round(Math.round(time / frame) * frame * 1e3) / 1e3;
|
|
5151
4706
|
}
|
|
5152
4707
|
function coerceValue(property, value) {
|
|
5153
|
-
const type = _nullishCoalesce(_optionalChain([property, 'optionalAccess',
|
|
4708
|
+
const type = _nullishCoalesce(_optionalChain([property, 'optionalAccess', _189 => _189.type]), () => ( (typeof value === "string" && _chunkA6PHCAGXcjs.normalizeTokenColor.call(void 0, value) !== null ? "color" : "number")));
|
|
5154
4709
|
if (type === "color") {
|
|
5155
4710
|
const color = _chunkA6PHCAGXcjs.normalizeTokenColor.call(void 0, value);
|
|
5156
4711
|
if (color === null) throw new AnimationEditError("invalid_value", `"${String(value)}" is not a colour.`);
|
|
@@ -5195,7 +4750,7 @@ var Draft = (_class4 = class {
|
|
|
5195
4750
|
if (!animation) {
|
|
5196
4751
|
const current = getNodeAnimation(this.node(id));
|
|
5197
4752
|
const tracks = {};
|
|
5198
|
-
for (const [key, track] of Object.entries(_nullishCoalesce(_optionalChain([current, 'optionalAccess',
|
|
4753
|
+
for (const [key, track] of Object.entries(_nullishCoalesce(_optionalChain([current, 'optionalAccess', _190 => _190.tracks]), () => ( {})))) {
|
|
5199
4754
|
if (track) tracks[key] = { ...track, keyframes: _chunkXHRZSB77cjs.normalizeKeyframes.call(void 0, track.keyframes) };
|
|
5200
4755
|
}
|
|
5201
4756
|
animation = { ..._nullishCoalesce(current, () => ( {})), tracks };
|
|
@@ -5204,7 +4759,7 @@ var Draft = (_class4 = class {
|
|
|
5204
4759
|
return animation;
|
|
5205
4760
|
}
|
|
5206
4761
|
keys(id, property) {
|
|
5207
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
4762
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _191 => _191.animation, 'call', _192 => _192(id), 'access', _193 => _193.tracks, 'access', _194 => _194[property], 'optionalAccess', _195 => _195.keyframes]), () => ( []));
|
|
5208
4763
|
}
|
|
5209
4764
|
track(id, property) {
|
|
5210
4765
|
return this.animation(id).tracks[property];
|
|
@@ -5266,7 +4821,7 @@ function readAnimatableValue(node, property) {
|
|
|
5266
4821
|
function getAnimatedValue(node, propertyKey, time, options = {}) {
|
|
5267
4822
|
const property = getAnimatableProperty(propertyKey, options);
|
|
5268
4823
|
const track = getAnimationTrack(node, propertyKey);
|
|
5269
|
-
if (track && track.enabled !== false) return _chunkXHRZSB77cjs.evaluateTrack.call(void 0, track, time, _nullishCoalesce(_optionalChain([property, 'optionalAccess',
|
|
4824
|
+
if (track && track.enabled !== false) return _chunkXHRZSB77cjs.evaluateTrack.call(void 0, track, time, _nullishCoalesce(_optionalChain([property, 'optionalAccess', _196 => _196.type]), () => ( "number")));
|
|
5270
4825
|
return property ? readAnimatableValue(node, property) : void 0;
|
|
5271
4826
|
}
|
|
5272
4827
|
function putKey(draft, nodeId, property, time, value, easing, inherit = true) {
|
|
@@ -5276,7 +4831,7 @@ function putKey(draft, nodeId, property, time, value, easing, inherit = true) {
|
|
|
5276
4831
|
keys[at] = { ...keys[at], value, ...easing !== void 0 ? { easing } : {} };
|
|
5277
4832
|
} else {
|
|
5278
4833
|
const before = [...keys].reverse().find((k) => k.time < time);
|
|
5279
|
-
const inherited = _nullishCoalesce(easing, () => ( (inherit ? _optionalChain([before, 'optionalAccess',
|
|
4834
|
+
const inherited = _nullishCoalesce(easing, () => ( (inherit ? _optionalChain([before, 'optionalAccess', _197 => _197.easing]) : void 0)));
|
|
5280
4835
|
keys.push({ time, value, ...inherited !== void 0 ? { easing: inherited } : {} });
|
|
5281
4836
|
}
|
|
5282
4837
|
draft.setKeys(nodeId, property, keys);
|
|
@@ -5446,7 +5001,7 @@ function getKeyframeTimes(nodes, options = {}) {
|
|
|
5446
5001
|
if (!animation) continue;
|
|
5447
5002
|
for (const [property, track] of Object.entries(animation.tracks)) {
|
|
5448
5003
|
const skip = _nullishCoalesce(excluded.get(refKey({ nodeId: node.id, property })), () => ( []));
|
|
5449
|
-
for (const k of _chunkXHRZSB77cjs.normalizeKeyframes.call(void 0, _optionalChain([track, 'optionalAccess',
|
|
5004
|
+
for (const k of _chunkXHRZSB77cjs.normalizeKeyframes.call(void 0, _optionalChain([track, 'optionalAccess', _198 => _198.keyframes]))) if (!skip.some((t) => sameTime(t, k.time))) times.push(k.time);
|
|
5450
5005
|
}
|
|
5451
5006
|
}
|
|
5452
5007
|
times.sort((a, b) => a - b);
|
|
@@ -5496,7 +5051,7 @@ function parseKeyframeClipboard(input) {
|
|
|
5496
5051
|
if (input.length > 5e6) return null;
|
|
5497
5052
|
try {
|
|
5498
5053
|
value = JSON.parse(input);
|
|
5499
|
-
} catch (
|
|
5054
|
+
} catch (e6) {
|
|
5500
5055
|
return null;
|
|
5501
5056
|
}
|
|
5502
5057
|
}
|
|
@@ -5527,7 +5082,7 @@ function pasteKeyframes(nodes, clipboard, time, options = {}) {
|
|
|
5527
5082
|
let value;
|
|
5528
5083
|
try {
|
|
5529
5084
|
value = coerceValue(p, k.value);
|
|
5530
|
-
} catch (
|
|
5085
|
+
} catch (e7) {
|
|
5531
5086
|
continue;
|
|
5532
5087
|
}
|
|
5533
5088
|
const at = t + Math.max(0, k.offset);
|
|
@@ -5552,7 +5107,7 @@ function recordAnimationChanges(base, before, after, time, options = {}) {
|
|
|
5552
5107
|
const animation = getNodeAnimation(stored);
|
|
5553
5108
|
let result = next;
|
|
5554
5109
|
let tracks = null;
|
|
5555
|
-
const tracksOf = () => tracks ??= { ..._nullishCoalesce(_optionalChain([animation, 'optionalAccess',
|
|
5110
|
+
const tracksOf = () => tracks ??= { ..._nullishCoalesce(_optionalChain([animation, 'optionalAccess', _199 => _199.tracks]), () => ( {})) };
|
|
5556
5111
|
for (const p of properties) {
|
|
5557
5112
|
const track = getAnimationTrack(stored, p.key);
|
|
5558
5113
|
const animated = !!track && track.enabled !== false;
|
|
@@ -5567,7 +5122,7 @@ function recordAnimationChanges(base, before, after, time, options = {}) {
|
|
|
5567
5122
|
if (changed) {
|
|
5568
5123
|
const keys = _chunkXHRZSB77cjs.normalizeKeyframes.call(void 0, track.keyframes).filter((k) => !sameTime(k.time, t));
|
|
5569
5124
|
const before2 = [...keys].reverse().find((k) => k.time < t);
|
|
5570
|
-
keys.push({ time: t, value: now, ..._optionalChain([before2, 'optionalAccess',
|
|
5125
|
+
keys.push({ time: t, value: now, ..._optionalChain([before2, 'optionalAccess', _200 => _200.easing]) !== void 0 ? { easing: before2.easing } : {} });
|
|
5571
5126
|
tracksOf()[p.key] = { ...track, keyframes: keys.sort((a, b) => a.time - b.time) };
|
|
5572
5127
|
keyed.push({ nodeId: next.id, property: p.key, time: t });
|
|
5573
5128
|
}
|
|
@@ -5599,10 +5154,10 @@ function animateNode(nodes, nodeId, options) {
|
|
|
5599
5154
|
const writes = [];
|
|
5600
5155
|
for (const [key, target] of entries) {
|
|
5601
5156
|
const p = draft.property(key);
|
|
5602
|
-
if (!p || key === "motionPath" && !_optionalChain([getNodeAnimation, 'call',
|
|
5157
|
+
if (!p || key === "motionPath" && !_optionalChain([getNodeAnimation, 'call', _201 => _201(node), 'optionalAccess', _202 => _202.motionPath])) {
|
|
5603
5158
|
throw new AnimationEditError("unknown_property", `"${key}" cannot be animated${p ? " without a motion path" : ""}.`);
|
|
5604
5159
|
}
|
|
5605
|
-
const from = _nullishCoalesce(_optionalChain([options, 'access',
|
|
5160
|
+
const from = _nullishCoalesce(_optionalChain([options, 'access', _203 => _203.from, 'optionalAccess', _204 => _204[key]]), () => ( (key === "motionPath" ? 0 : getAnimatedValue(node, key, start, options))));
|
|
5606
5161
|
if (from === void 0) throw new AnimationEditError("invalid_value", `"${nodeId}" has no ${key} to animate from; pass "from".`);
|
|
5607
5162
|
writes.push([key, coerceValue(p, from), coerceValue(p, target)]);
|
|
5608
5163
|
}
|
|
@@ -5704,7 +5259,7 @@ function getCssPropertyAnimations(nodes, nodeId, options = {}) {
|
|
|
5704
5259
|
const keys = _chunkXHRZSB77cjs.normalizeKeyframes.call(void 0, track.keyframes);
|
|
5705
5260
|
if (keys.length > 0) tracks.set(key, keys);
|
|
5706
5261
|
}
|
|
5707
|
-
const typeOf = (key) => _nullishCoalesce(_optionalChain([ANIMATABLE_PROPERTIES, 'access',
|
|
5262
|
+
const typeOf = (key) => _nullishCoalesce(_optionalChain([ANIMATABLE_PROPERTIES, 'access', _205 => _205.find, 'call', _206 => _206((p) => p.key === key), 'optionalAccess', _207 => _207.type]), () => ( "number"));
|
|
5708
5263
|
const groups = /* @__PURE__ */ new Map();
|
|
5709
5264
|
for (const key of tracks.keys()) {
|
|
5710
5265
|
const css = map[key].css;
|
|
@@ -5812,7 +5367,7 @@ function isCssExportExact(nodes, nodeId) {
|
|
|
5812
5367
|
function isKeyframeSelected(selection, ref) {
|
|
5813
5368
|
return selection.some((s) => s.nodeId === ref.nodeId && s.property === ref.property && Math.abs(s.time - ref.time) <= _chunkXHRZSB77cjs.ANIMATION_TIME_EPSILON);
|
|
5814
5369
|
}
|
|
5815
|
-
var defaultLabel = (node) => typeof _optionalChain([node, 'access',
|
|
5370
|
+
var defaultLabel = (node) => typeof _optionalChain([node, 'access', _208 => _208.data, 'optionalAccess', _209 => _209.label]) === "string" && node.data.label.trim() ? node.data.label : node.id;
|
|
5816
5371
|
function getTimelineRows(nodes, ids, options = {}) {
|
|
5817
5372
|
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
5818
5373
|
const selection = _nullishCoalesce(options.selection, () => ( []));
|
|
@@ -5823,7 +5378,7 @@ function getTimelineRows(nodes, ids, options = {}) {
|
|
|
5823
5378
|
if (!node) continue;
|
|
5824
5379
|
for (const property of getAnimatedProperties(node, options)) {
|
|
5825
5380
|
const track = getAnimationTrack(node, property);
|
|
5826
|
-
const label = _nullishCoalesce(_optionalChain([(_nullishCoalesce(options.properties, () => ( ANIMATABLE_PROPERTIES))), 'access',
|
|
5381
|
+
const label = _nullishCoalesce(_optionalChain([(_nullishCoalesce(options.properties, () => ( ANIMATABLE_PROPERTIES))), 'access', _210 => _210.find, 'call', _211 => _211((p) => p.key === property), 'optionalAccess', _212 => _212.label]), () => ( property));
|
|
5827
5382
|
rows.push({
|
|
5828
5383
|
id: `${id}:${property}`,
|
|
5829
5384
|
nodeId: id,
|
|
@@ -5896,7 +5451,7 @@ function createCanvasAnimationController(options) {
|
|
|
5896
5451
|
duration,
|
|
5897
5452
|
loop: options.loop,
|
|
5898
5453
|
playbackRate: options.playbackRate,
|
|
5899
|
-
onTime: (time) => _optionalChain([options, 'access',
|
|
5454
|
+
onTime: (time) => _optionalChain([options, 'access', _213 => _213.onTime, 'optionalCall', _214 => _214(time)])
|
|
5900
5455
|
});
|
|
5901
5456
|
let cached = null;
|
|
5902
5457
|
const snapshot = () => ({
|
|
@@ -5918,18 +5473,18 @@ function createCanvasAnimationController(options) {
|
|
|
5918
5473
|
};
|
|
5919
5474
|
const notify = () => {
|
|
5920
5475
|
const state = getState();
|
|
5921
|
-
_optionalChain([options, 'access',
|
|
5476
|
+
_optionalChain([options, 'access', _215 => _215.onChange, 'optionalCall', _216 => _216(state)]);
|
|
5922
5477
|
for (const listener of listeners) listener(state);
|
|
5923
5478
|
};
|
|
5924
5479
|
player.subscribe(notify);
|
|
5925
|
-
const selectedIds = () => _nullishCoalesce(_optionalChain([options, 'access',
|
|
5480
|
+
const selectedIds = () => _nullishCoalesce(_optionalChain([options, 'access', _217 => _217.getSelectedIds, 'optionalCall', _218 => _218()]), () => ( options.getNodes().filter((n) => n.selected).map((n) => n.id)));
|
|
5926
5481
|
const KEEP_FIELDS = ["selected", "dragging", "measured"];
|
|
5927
5482
|
const replaceNodes = (nodes, replacements, animationOnly = false) => nodes.map((node) => {
|
|
5928
5483
|
const replacement = replacements.get(node.id);
|
|
5929
5484
|
if (!replacement) return node;
|
|
5930
5485
|
if (animationOnly) {
|
|
5931
5486
|
const data = { ..._nullishCoalesce(node.data, () => ( {})) };
|
|
5932
|
-
const value = _optionalChain([replacement, 'access',
|
|
5487
|
+
const value = _optionalChain([replacement, 'access', _219 => _219.data, 'optionalAccess', _220 => _220[ANIMATION_DATA_KEY]]);
|
|
5933
5488
|
if (value === void 0) delete data[ANIMATION_DATA_KEY];
|
|
5934
5489
|
else data[ANIMATION_DATA_KEY] = value;
|
|
5935
5490
|
return { ...node, data };
|
|
@@ -5956,7 +5511,7 @@ function createCanvasAnimationController(options) {
|
|
|
5956
5511
|
}
|
|
5957
5512
|
}
|
|
5958
5513
|
if (redoMap.size === 0) return false;
|
|
5959
|
-
const scope = _nullishCoalesce(_optionalChain([merge, 'optionalAccess',
|
|
5514
|
+
const scope = _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _221 => _221.animationOnly]), () => ( false));
|
|
5960
5515
|
const execute = () => options.setNodes(replaceNodes(options.getNodes(), redoMap, scope));
|
|
5961
5516
|
const undo = () => options.setNodes(replaceNodes(options.getNodes(), undoMap, scope));
|
|
5962
5517
|
const command = { name, execute, undo, ...merge ? { tag: merge.tag } : {} };
|
|
@@ -5969,7 +5524,7 @@ function createCanvasAnimationController(options) {
|
|
|
5969
5524
|
if (selection.length === 0) return;
|
|
5970
5525
|
const byId = new Map(options.getNodes().map((n) => [n.id, n]));
|
|
5971
5526
|
const kept = selection.filter((ref) => {
|
|
5972
|
-
const track = _optionalChain([getNodeAnimation, 'call',
|
|
5527
|
+
const track = _optionalChain([getNodeAnimation, 'call', _222 => _222(byId.get(ref.nodeId)), 'optionalAccess', _223 => _223.tracks, 'access', _224 => _224[ref.property]]);
|
|
5973
5528
|
return !!track && _chunkXHRZSB77cjs.normalizeKeyframes.call(void 0, track.keyframes).some((k) => Math.abs(k.time - ref.time) <= _chunkXHRZSB77cjs.ANIMATION_TIME_EPSILON);
|
|
5974
5529
|
});
|
|
5975
5530
|
if (kept.length !== selection.length) selection = kept;
|
|
@@ -6076,13 +5631,13 @@ function createCanvasAnimationController(options) {
|
|
|
6076
5631
|
const baseById = new Map(base.map((n) => [n.id, n]));
|
|
6077
5632
|
const staticNodes = nodes.map((n) => {
|
|
6078
5633
|
if (!ids.has(n.id)) return n;
|
|
6079
|
-
const old = _optionalChain([baseById, 'access',
|
|
5634
|
+
const old = _optionalChain([baseById, 'access', _225 => _225.get, 'call', _226 => _226(n.id), 'optionalAccess', _227 => _227.data, 'optionalAccess', _228 => _228[ANIMATION_DATA_KEY]]);
|
|
6080
5635
|
const data = { ..._nullishCoalesce(n.data, () => ( {})) };
|
|
6081
5636
|
if (old === void 0) delete data[ANIMATION_DATA_KEY];
|
|
6082
5637
|
else data[ANIMATION_DATA_KEY] = old;
|
|
6083
5638
|
return { ...n, data };
|
|
6084
5639
|
});
|
|
6085
|
-
const animationOf = new Map(nodes.filter((n) => ids.has(n.id)).map((n) => [n.id, _optionalChain([n, 'access',
|
|
5640
|
+
const animationOf = new Map(nodes.filter((n) => ids.has(n.id)).map((n) => [n.id, _optionalChain([n, 'access', _229 => _229.data, 'optionalAccess', _230 => _230[ANIMATION_DATA_KEY]])]));
|
|
6086
5641
|
options.setNodes(staticNodes);
|
|
6087
5642
|
const tag = `animation.record:${[...ids].sort().join(",")}`;
|
|
6088
5643
|
commit(
|
|
@@ -6284,7 +5839,7 @@ function createCanvasAnimationController(options) {
|
|
|
6284
5839
|
// ----- views & export ---------------------------------------------------------------
|
|
6285
5840
|
/** Timeline rows for `ids` (default: selected nodes), including the drag preview. */
|
|
6286
5841
|
timelineRows(ids = selectedIds(), opts = {}) {
|
|
6287
|
-
return getTimelineRows(options.getNodes(), ids, { ...propertyOptions(), ...opts, selection, dragDelta: _nullishCoalesce(_optionalChain([drag, 'optionalAccess',
|
|
5842
|
+
return getTimelineRows(options.getNodes(), ids, { ...propertyOptions(), ...opts, selection, dragDelta: _nullishCoalesce(_optionalChain([drag, 'optionalAccess', _231 => _231.delta]), () => ( 0)) });
|
|
6288
5843
|
},
|
|
6289
5844
|
sampleFrames(opts = {}) {
|
|
6290
5845
|
return sampleAnimationFrames(options.getNodes(), { fps, duration: duration(), ...propertyOptions(), ...opts });
|
|
@@ -6314,7 +5869,7 @@ var COMPONENT_OVERRIDES_DATA_KEY = "componentOverrides";
|
|
|
6314
5869
|
var COMPONENT_PROPERTY_REFS_DATA_KEY = "componentPropertyRefs";
|
|
6315
5870
|
var MAX_DEPTH = 16;
|
|
6316
5871
|
var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
6317
|
-
var dataOf = (node) => isRecord(_optionalChain([node, 'optionalAccess',
|
|
5872
|
+
var dataOf = (node) => isRecord(_optionalChain([node, 'optionalAccess', _232 => _232.data])) ? node.data : {};
|
|
6318
5873
|
function same(a, b) {
|
|
6319
5874
|
if (a === b) return true;
|
|
6320
5875
|
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) {
|
|
@@ -6368,7 +5923,7 @@ function getComponentPropertyRefs(node) {
|
|
|
6368
5923
|
function getLayerName(node) {
|
|
6369
5924
|
const d = dataOf(node);
|
|
6370
5925
|
for (const key of ["name", "label", "text"]) if (typeof d[key] === "string" && d[key]) return d[key];
|
|
6371
|
-
return typeof _optionalChain([node, 'optionalAccess',
|
|
5926
|
+
return typeof _optionalChain([node, 'optionalAccess', _233 => _233.type]) === "string" ? node.type : "";
|
|
6372
5927
|
}
|
|
6373
5928
|
function withData(node, data) {
|
|
6374
5929
|
return { ...node, data };
|
|
@@ -6448,8 +6003,8 @@ function sizeOf(node) {
|
|
|
6448
6003
|
return { width: node.width, height: node.height, styleWidth: s.width, styleHeight: s.height };
|
|
6449
6004
|
}
|
|
6450
6005
|
var splitGroup = (group) => {
|
|
6451
|
-
const
|
|
6452
|
-
return
|
|
6006
|
+
const dot = group.indexOf(".");
|
|
6007
|
+
return dot < 0 ? [group, ""] : [group.slice(0, dot), group.slice(dot + 1)];
|
|
6453
6008
|
};
|
|
6454
6009
|
function readOverrideGroup(node, group) {
|
|
6455
6010
|
const data = dataOf(node);
|
|
@@ -6461,9 +6016,9 @@ function readOverrideGroup(node, group) {
|
|
|
6461
6016
|
case "size":
|
|
6462
6017
|
return sizeOf(node);
|
|
6463
6018
|
case "component":
|
|
6464
|
-
return _optionalChain([getInstanceData, 'call',
|
|
6019
|
+
return _optionalChain([getInstanceData, 'call', _234 => _234(node), 'optionalAccess', _235 => _235.componentId]);
|
|
6465
6020
|
case "props":
|
|
6466
|
-
return _nullishCoalesce(_optionalChain([getInstanceData, 'call',
|
|
6021
|
+
return _nullishCoalesce(_optionalChain([getInstanceData, 'call', _236 => _236(node), 'optionalAccess', _237 => _237.properties]), () => ( {}));
|
|
6467
6022
|
}
|
|
6468
6023
|
const [kind, key] = splitGroup(group);
|
|
6469
6024
|
switch (kind) {
|
|
@@ -6562,7 +6117,7 @@ function listGroups(node, out) {
|
|
|
6562
6117
|
if (LINK_KEYS.has(k)) continue;
|
|
6563
6118
|
const prefix = NESTED_KEYS[k];
|
|
6564
6119
|
if (prefix) {
|
|
6565
|
-
if (isRecord(v)) for (const
|
|
6120
|
+
if (isRecord(v)) for (const sub of Object.keys(v)) out.add(`${prefix}.${sub}`);
|
|
6566
6121
|
continue;
|
|
6567
6122
|
}
|
|
6568
6123
|
out.add(`data.${k}`);
|
|
@@ -6643,12 +6198,12 @@ var Graph = (_class5 = class {
|
|
|
6643
6198
|
return out;
|
|
6644
6199
|
}
|
|
6645
6200
|
}, _class5);
|
|
6646
|
-
var owningComponentIn = (g, id) => _optionalChain([g, 'access',
|
|
6647
|
-
var owningInstanceIn = (g, id) => _optionalChain([g, 'access',
|
|
6648
|
-
var enclosingInstanceIn = (g, id) => _optionalChain([g, 'access',
|
|
6201
|
+
var owningComponentIn = (g, id) => _optionalChain([g, 'access', _238 => _238.chain, 'call', _239 => _239(id), 'access', _240 => _240.find, 'call', _241 => _241(isCanvasComponent), 'optionalAccess', _242 => _242.id]);
|
|
6202
|
+
var owningInstanceIn = (g, id) => _optionalChain([g, 'access', _243 => _243.chain, 'call', _244 => _244(id), 'access', _245 => _245.find, 'call', _246 => _246(isCanvasInstance), 'optionalAccess', _247 => _247.id]);
|
|
6203
|
+
var enclosingInstanceIn = (g, id) => _optionalChain([g, 'access', _248 => _248.chain, 'call', _249 => _249(id, false), 'access', _250 => _250.find, 'call', _251 => _251(isCanvasInstance), 'optionalAccess', _252 => _252.id]);
|
|
6649
6204
|
function rootInstanceIn(g, id) {
|
|
6650
6205
|
const list = g.chain(id).filter(isCanvasInstance);
|
|
6651
|
-
return _optionalChain([list, 'access',
|
|
6206
|
+
return _optionalChain([list, 'access', _253 => _253[list.length - 1], 'optionalAccess', _254 => _254.id]);
|
|
6652
6207
|
}
|
|
6653
6208
|
function variantSetIn(g, componentId) {
|
|
6654
6209
|
const comp = g.get(componentId);
|
|
@@ -6657,7 +6212,7 @@ function variantSetIn(g, componentId) {
|
|
|
6657
6212
|
return isCanvasComponentSet(parent) ? parent : void 0;
|
|
6658
6213
|
}
|
|
6659
6214
|
function getVariantValues(node) {
|
|
6660
|
-
const explicit = _optionalChain([getComponentData, 'call',
|
|
6215
|
+
const explicit = _optionalChain([getComponentData, 'call', _255 => _255(node), 'optionalAccess', _256 => _256.variant]);
|
|
6661
6216
|
if (isRecord(explicit) && Object.keys(explicit).length) return stringRecord2(explicit);
|
|
6662
6217
|
const name = getLayerName(node);
|
|
6663
6218
|
return name.includes("=") ? parseVariantName(name) : {};
|
|
@@ -6700,7 +6255,7 @@ function defaultVariantIn(g, setId) {
|
|
|
6700
6255
|
best = { key, id: v.id };
|
|
6701
6256
|
}
|
|
6702
6257
|
}
|
|
6703
|
-
return _optionalChain([best, 'optionalAccess',
|
|
6258
|
+
return _optionalChain([best, 'optionalAccess', _257 => _257.id]);
|
|
6704
6259
|
}
|
|
6705
6260
|
function findVariantIn(g, setId, wanted) {
|
|
6706
6261
|
const entries = Object.entries(wanted);
|
|
@@ -6711,7 +6266,7 @@ function findVariantIn(g, setId, wanted) {
|
|
|
6711
6266
|
if (score === entries.length) return v.id;
|
|
6712
6267
|
if (!best || score > best.score) best = { score, id: v.id };
|
|
6713
6268
|
}
|
|
6714
|
-
return _optionalChain([best, 'optionalAccess',
|
|
6269
|
+
return _optionalChain([best, 'optionalAccess', _258 => _258.id]);
|
|
6715
6270
|
}
|
|
6716
6271
|
function mainOfIn(g, id) {
|
|
6717
6272
|
const node = g.get(id);
|
|
@@ -6725,7 +6280,7 @@ function propertyDefsIn(g, componentId) {
|
|
|
6725
6280
|
if (!isCanvasComponent(comp)) return {};
|
|
6726
6281
|
const set = variantSetIn(g, componentId);
|
|
6727
6282
|
const owner = set ? dataOf(set)[COMPONENT_SET_DATA_KEY] : dataOf(comp)[COMPONENT_DATA_KEY];
|
|
6728
|
-
return isRecord(_optionalChain([owner, 'optionalAccess',
|
|
6283
|
+
return isRecord(_optionalChain([owner, 'optionalAccess', _259 => _259.properties])) ? owner.properties : {};
|
|
6729
6284
|
}
|
|
6730
6285
|
function validValue(def, v) {
|
|
6731
6286
|
return def.type === "boolean" ? typeof v === "boolean" : typeof v === "string";
|
|
@@ -6733,7 +6288,7 @@ function validValue(def, v) {
|
|
|
6733
6288
|
function effectivePropsIn(g, componentId, values) {
|
|
6734
6289
|
const out = {};
|
|
6735
6290
|
for (const [k, def] of Object.entries(propertyDefsIn(g, componentId))) {
|
|
6736
|
-
const v = _optionalChain([values, 'optionalAccess',
|
|
6291
|
+
const v = _optionalChain([values, 'optionalAccess', _260 => _260[k]]);
|
|
6737
6292
|
out[k] = v !== void 0 && validValue(def, v) ? v : def.default;
|
|
6738
6293
|
}
|
|
6739
6294
|
return out;
|
|
@@ -6744,7 +6299,7 @@ function componentDepsIn(g, componentId) {
|
|
|
6744
6299
|
while (queue.length) {
|
|
6745
6300
|
const c = queue.pop();
|
|
6746
6301
|
for (const id of g.subtree(c)) {
|
|
6747
|
-
const target = _optionalChain([getInstanceData, 'call',
|
|
6302
|
+
const target = _optionalChain([getInstanceData, 'call', _261 => _261(g.get(id)), 'optionalAccess', _262 => _262.componentId]);
|
|
6748
6303
|
if (target && !deps.has(target)) {
|
|
6749
6304
|
deps.add(target);
|
|
6750
6305
|
queue.push(target);
|
|
@@ -6778,7 +6333,7 @@ function isInsideInstance(nodes, id) {
|
|
|
6778
6333
|
return enclosingInstanceIn(new Graph(nodes), id) !== void 0;
|
|
6779
6334
|
}
|
|
6780
6335
|
function getComponentInstances(nodes, componentId) {
|
|
6781
|
-
return nodes.filter((n) => _optionalChain([getInstanceData, 'call',
|
|
6336
|
+
return nodes.filter((n) => _optionalChain([getInstanceData, 'call', _263 => _263(n), 'optionalAccess', _264 => _264.componentId]) === componentId).map((n) => n.id);
|
|
6782
6337
|
}
|
|
6783
6338
|
function getInstanceStatus(nodes, id) {
|
|
6784
6339
|
const g = new Graph(nodes);
|
|
@@ -6787,7 +6342,7 @@ function getInstanceStatus(nodes, id) {
|
|
|
6787
6342
|
return isCanvasComponent(g.get(inst.componentId)) ? "linked" : "missing-main";
|
|
6788
6343
|
}
|
|
6789
6344
|
function getVariantSet(nodes, componentId) {
|
|
6790
|
-
return _optionalChain([variantSetIn, 'call',
|
|
6345
|
+
return _optionalChain([variantSetIn, 'call', _265 => _265(new Graph(nodes), componentId), 'optionalAccess', _266 => _266.id]);
|
|
6791
6346
|
}
|
|
6792
6347
|
function getVariantOptions(nodes, setId) {
|
|
6793
6348
|
return variantOptionsIn(new Graph(nodes), setId);
|
|
@@ -6818,7 +6373,7 @@ function listCanvasComponents(nodes) {
|
|
|
6818
6373
|
const g = new Graph(nodes);
|
|
6819
6374
|
const counts = /* @__PURE__ */ new Map();
|
|
6820
6375
|
for (const n of nodes) {
|
|
6821
|
-
const c = _optionalChain([getInstanceData, 'call',
|
|
6376
|
+
const c = _optionalChain([getInstanceData, 'call', _267 => _267(n), 'optionalAccess', _268 => _268.componentId]);
|
|
6822
6377
|
if (c) counts.set(c, (_nullishCoalesce(counts.get(c), () => ( 0))) + 1);
|
|
6823
6378
|
}
|
|
6824
6379
|
const components = [];
|
|
@@ -6924,7 +6479,7 @@ function rootReference(g, comp) {
|
|
|
6924
6479
|
return "label" in dataOf(comp) && typeof label === "string" ? withData(comp, { ...dataOf(comp), label }) : comp;
|
|
6925
6480
|
}
|
|
6926
6481
|
function fixMeasured(node, old) {
|
|
6927
|
-
const measured2 = _nullishCoalesce(_optionalChain([old, 'optionalAccess',
|
|
6482
|
+
const measured2 = _nullishCoalesce(_optionalChain([old, 'optionalAccess', _269 => _269.measured]), () => ( node.measured));
|
|
6928
6483
|
const size = sizeOf(node);
|
|
6929
6484
|
const w = _nullishCoalesce(size.width, () => ( size.styleWidth));
|
|
6930
6485
|
const h = _nullishCoalesce(size.height, () => ( size.styleHeight));
|
|
@@ -7117,10 +6672,10 @@ function buildInstance(g, instId, opts, taken) {
|
|
|
7117
6672
|
if (nested && depth < MAX_DEPTH) {
|
|
7118
6673
|
const target = nested.componentId;
|
|
7119
6674
|
instProps.set(id, effectivePropsIn(g, target, nested.properties));
|
|
7120
|
-
if (_optionalChain([getInstanceData, 'call',
|
|
6675
|
+
if (_optionalChain([getInstanceData, 'call', _270 => _270(s), 'optionalAccess', _271 => _271.componentId]) !== target) {
|
|
7121
6676
|
const main = g.get(target);
|
|
7122
6677
|
if (isCanvasComponent(main) && !expanding.includes(target) && !g.isAncestor(target, instId)) {
|
|
7123
|
-
const previousComponent = o ? _optionalChain([getInstanceData, 'call',
|
|
6678
|
+
const previousComponent = o ? _optionalChain([getInstanceData, 'call', _272 => _272(o), 'optionalAccess', _273 => _273.componentId]) : void 0;
|
|
7124
6679
|
n = applyChainProps(instanceRoot(main, s, o, id, newParent, sid, nested, previousComponent, false), s, enc);
|
|
7125
6680
|
out.push(n);
|
|
7126
6681
|
copyChildren(target, id, path, [id], [...expanding, target], depth + 1);
|
|
@@ -7188,7 +6743,7 @@ function rebuildBatch(nodes, ids, opts) {
|
|
|
7188
6743
|
if (opts.layout) {
|
|
7189
6744
|
const lookup = new Map(result.map((n) => [n.id, n]));
|
|
7190
6745
|
const inFrames = [...built.keys()].filter((r) => {
|
|
7191
|
-
const parent = lookup.get(_nullishCoalesce(_optionalChain([lookup, 'access',
|
|
6746
|
+
const parent = lookup.get(_nullishCoalesce(_optionalChain([lookup, 'access', _274 => _274.get, 'call', _275 => _275(r), 'optionalAccess', _276 => _276.parentId]), () => ( "")));
|
|
7192
6747
|
return !!getAutoLayout(parent);
|
|
7193
6748
|
});
|
|
7194
6749
|
if (inFrames.length) result = applyNodeUpdates(result, layoutUpMany(result, inFrames, opts.layout));
|
|
@@ -7244,7 +6799,7 @@ function rebuildInstances(nodes, comps, resync, opts) {
|
|
|
7244
6799
|
}
|
|
7245
6800
|
function finish(original, result, opts) {
|
|
7246
6801
|
let out = result;
|
|
7247
|
-
if (_optionalChain([opts, 'access',
|
|
6802
|
+
if (_optionalChain([opts, 'access', _277 => _277.tokens, 'optionalAccess', _278 => _278.state])) out = resolveCanvasTokens(out, opts.tokens.state, opts.tokens);
|
|
7248
6803
|
if (out.length === original.length && out.every((n, i) => n === original[i])) return original;
|
|
7249
6804
|
return out;
|
|
7250
6805
|
}
|
|
@@ -7404,7 +6959,7 @@ function syncCanvasComponents(before, after, options = {}) {
|
|
|
7404
6959
|
let groups = raw.filter((gr) => gr !== "position" && (gr !== "size" || topRoot && !sizeFromLayout(g, n)));
|
|
7405
6960
|
if (topRoot) groups = groups.filter((gr) => !isOwnRootGroup(gr));
|
|
7406
6961
|
let cleared = [];
|
|
7407
|
-
const srcId = topRoot ? _optionalChain([ni, 'optionalAccess',
|
|
6962
|
+
const srcId = topRoot ? _optionalChain([ni, 'optionalAccess', _279 => _279.componentId]) : getComponentSourceId(n);
|
|
7408
6963
|
const src = g.get(srcId);
|
|
7409
6964
|
if (src) {
|
|
7410
6965
|
const reference = topRoot ? rootReference(g, src) : src;
|
|
@@ -7716,7 +7271,7 @@ function swapCanvasInstance(nodes, ids, componentId, options = {}) {
|
|
|
7716
7271
|
if (g.isAncestor(main, id) || createsCycleIn(g, main, n.parentId)) return fail(nodes, "cycle", "An instance can't show the component it is inside.");
|
|
7717
7272
|
const defaults = effectivePropsIn(g, main, void 0);
|
|
7718
7273
|
const properties = {};
|
|
7719
|
-
for (const [k, d] of Object.entries(defaults)) properties[k] = _optionalChain([inst, 'access',
|
|
7274
|
+
for (const [k, d] of Object.entries(defaults)) properties[k] = _optionalChain([inst, 'access', _280 => _280.properties, 'optionalAccess', _281 => _281[k]]) !== void 0 && typeof inst.properties[k] === typeof d ? inst.properties[k] : d;
|
|
7720
7275
|
updates.set(id, withData(n, { ...dataOf(n), [INSTANCE_DATA_KEY]: { ...inst, componentId: main, properties } }));
|
|
7721
7276
|
if (options.keepTextOverridesOnly) {
|
|
7722
7277
|
for (const d of g.subtree(id)) {
|
|
@@ -7875,11 +7430,11 @@ function restoreCanvasMainComponent(nodes, id, options = {}) {
|
|
|
7875
7430
|
if (g.get(inst.componentId)) return fail(nodes, "invalid", "The main component still exists.");
|
|
7876
7431
|
if (enclosingInstanceIn(g, id) !== void 0) return fail(nodes, "nested-instance", "Select the outer instance.");
|
|
7877
7432
|
const compId = inst.componentId;
|
|
7878
|
-
const
|
|
7433
|
+
const sub = g.subtree(id);
|
|
7879
7434
|
const map = /* @__PURE__ */ new Map([[id, compId]]);
|
|
7880
7435
|
const taken = new Set(nodes.map((n) => n.id));
|
|
7881
7436
|
taken.add(compId);
|
|
7882
|
-
for (const d of
|
|
7437
|
+
for (const d of sub) {
|
|
7883
7438
|
if (d === id) continue;
|
|
7884
7439
|
const src = enclosingInstanceIn(g, d) === id ? getComponentSourceId(g.get(d)) : void 0;
|
|
7885
7440
|
if (src && !taken.has(src)) {
|
|
@@ -7889,7 +7444,7 @@ function restoreCanvasMainComponent(nodes, id, options = {}) {
|
|
|
7889
7444
|
}
|
|
7890
7445
|
const nested = [];
|
|
7891
7446
|
const replaced = /* @__PURE__ */ new Map();
|
|
7892
|
-
for (const d of
|
|
7447
|
+
for (const d of sub) {
|
|
7893
7448
|
let n = g.get(d);
|
|
7894
7449
|
const nid = _nullishCoalesce(map.get(d), () => ( d));
|
|
7895
7450
|
const parentId = n.parentId !== void 0 ? _nullishCoalesce(map.get(n.parentId), () => ( n.parentId)) : void 0;
|
|
@@ -7961,7 +7516,7 @@ function closestVariant(list, wanted) {
|
|
|
7961
7516
|
const score = [matches2.reduce((a, b) => a + b, 0), ...matches2];
|
|
7962
7517
|
if (!best || better(score, best.score)) best = { score, id: v.id };
|
|
7963
7518
|
}
|
|
7964
|
-
return _optionalChain([best, 'optionalAccess',
|
|
7519
|
+
return _optionalChain([best, 'optionalAccess', _282 => _282.id]);
|
|
7965
7520
|
}
|
|
7966
7521
|
function variantEditIn(g, setId) {
|
|
7967
7522
|
const set = g.get(setId);
|
|
@@ -7977,7 +7532,7 @@ function addMissingProperties(edit, pairs, defaultValue) {
|
|
|
7977
7532
|
if (added.length === 0) return void 0;
|
|
7978
7533
|
const problem = variantNameProblem("value", defaultValue);
|
|
7979
7534
|
if (problem) return problem;
|
|
7980
|
-
const defs = _optionalChain([dataOf, 'call',
|
|
7535
|
+
const defs = _optionalChain([dataOf, 'call', _283 => _283(edit.set), 'access', _284 => _284[COMPONENT_SET_DATA_KEY], 'optionalAccess', _285 => _285.properties]);
|
|
7981
7536
|
const clash = isRecord(defs) ? added.find((k) => k in defs) : void 0;
|
|
7982
7537
|
if (clash) return `"${clash}" is a component property.`;
|
|
7983
7538
|
for (const [id, v] of edit.values) {
|
|
@@ -8009,11 +7564,11 @@ function nextVariantValuesIn(g, setId, fromId) {
|
|
|
8009
7564
|
const variants = variantsIn(g, setId);
|
|
8010
7565
|
const base = getVariantValues(g.get(fromId));
|
|
8011
7566
|
const first = variantOptionsIn(g, setId)[0];
|
|
8012
|
-
const prop = _nullishCoalesce(_optionalChain([first, 'optionalAccess',
|
|
7567
|
+
const prop = _nullishCoalesce(_optionalChain([first, 'optionalAccess', _286 => _286.name]), () => ( "Property 1"));
|
|
8013
7568
|
const used = new Set(variants.map((v) => variantKey(getVariantValues(v))));
|
|
8014
7569
|
for (let k = variants.length + 1; ; k++) {
|
|
8015
7570
|
const values = { ...base, [prop]: `Variant${k}` };
|
|
8016
|
-
if (!_optionalChain([first, 'optionalAccess',
|
|
7571
|
+
if (!_optionalChain([first, 'optionalAccess', _287 => _287.values, 'access', _288 => _288.includes, 'call', _289 => _289(`Variant${k}`)]) && !used.has(variantKey(values))) return values;
|
|
8017
7572
|
}
|
|
8018
7573
|
}
|
|
8019
7574
|
function getNextVariantValues(nodes, setId, from) {
|
|
@@ -8056,15 +7611,15 @@ function addCanvasVariant(nodes, setId, options = {}) {
|
|
|
8056
7611
|
const taken = new Set(g.byId.keys());
|
|
8057
7612
|
taken.add(id);
|
|
8058
7613
|
const map = /* @__PURE__ */ new Map([[fromId, id]]);
|
|
8059
|
-
const
|
|
8060
|
-
for (const d of
|
|
7614
|
+
const sub = g.subtree(fromId);
|
|
7615
|
+
for (const d of sub) {
|
|
8061
7616
|
if (d === fromId) continue;
|
|
8062
7617
|
const nid = uniqueId(`${id}-${d}`, taken);
|
|
8063
7618
|
taken.add(nid);
|
|
8064
7619
|
map.set(d, nid);
|
|
8065
7620
|
}
|
|
8066
7621
|
const order = variantOrder([...edit.variants.map((v) => v.id), id], edit.values);
|
|
8067
|
-
const subSet = new Set(
|
|
7622
|
+
const subSet = new Set(sub);
|
|
8068
7623
|
const copies = nodes.filter((n) => subSet.has(n.id)).map((n) => {
|
|
8069
7624
|
const next = { ...n, id: map.get(n.id) };
|
|
8070
7625
|
if (n.parentId !== void 0 && n.id !== fromId) next.parentId = _nullishCoalesce(map.get(n.parentId), () => ( n.parentId));
|
|
@@ -8152,7 +7707,7 @@ function updateInstanceValues(g, setId, updates, fn) {
|
|
|
8152
7707
|
const ids = new Set(variantsIn(g, setId).map((v) => v.id));
|
|
8153
7708
|
for (const n of g.nodes) {
|
|
8154
7709
|
const inst = getInstanceData(n);
|
|
8155
|
-
if (!_optionalChain([inst, 'optionalAccess',
|
|
7710
|
+
if (!_optionalChain([inst, 'optionalAccess', _290 => _290.properties]) || !ids.has(inst.componentId)) continue;
|
|
8156
7711
|
const props = fn({ ...inst.properties });
|
|
8157
7712
|
if (same(props, inst.properties)) continue;
|
|
8158
7713
|
const cur = _nullishCoalesce(updates.get(n.id), () => ( n));
|
|
@@ -8236,7 +7791,7 @@ function createCanvasComponentsController(options) {
|
|
|
8236
7791
|
layout: options.layout,
|
|
8237
7792
|
tokens: options.tokens
|
|
8238
7793
|
});
|
|
8239
|
-
const selection = (ids) => ids ? [...ids] : _nullishCoalesce(_optionalChain([options, 'access',
|
|
7794
|
+
const selection = (ids) => ids ? [...ids] : _nullishCoalesce(_optionalChain([options, 'access', _291 => _291.getSelectedIds, 'optionalCall', _292 => _292()]), () => ( options.getNodes().filter((n) => n.selected).map((n) => n.id)));
|
|
8240
7795
|
const target = (id) => _nullishCoalesce(id, () => ( selection()[0]));
|
|
8241
7796
|
function set(next) {
|
|
8242
7797
|
synced = next;
|
|
@@ -8465,12 +8020,12 @@ function createCanvasComponentsController(options) {
|
|
|
8465
8020
|
const at = target(id);
|
|
8466
8021
|
const list = sync();
|
|
8467
8022
|
const inst = at ? getOwningInstance(list, at) : void 0;
|
|
8468
|
-
const main = inst ? _optionalChain([getInstanceData, 'call',
|
|
8023
|
+
const main = inst ? _optionalChain([getInstanceData, 'call', _293 => _293(list.find((n) => n.id === inst)), 'optionalAccess', _294 => _294.componentId]) : void 0;
|
|
8469
8024
|
const node = main ? list.find((n) => n.id === main) : void 0;
|
|
8470
8025
|
if (!node) return void 0;
|
|
8471
8026
|
const next = list.map((n) => !!n.selected === (n.id === main) ? n : { ...n, selected: n.id === main });
|
|
8472
8027
|
set(next);
|
|
8473
|
-
_optionalChain([options, 'access',
|
|
8028
|
+
_optionalChain([options, 'access', _295 => _295.onReveal, 'optionalCall', _296 => _296(next.find((n) => n.id === main))]);
|
|
8474
8029
|
return main;
|
|
8475
8030
|
},
|
|
8476
8031
|
canGoToMainComponent(id) {
|
|
@@ -8495,7 +8050,7 @@ function createCanvasComponentsController(options) {
|
|
|
8495
8050
|
}
|
|
8496
8051
|
var CANVAS_COMPONENT_DRAG_TYPE = "application/x-pixerate-component";
|
|
8497
8052
|
function getCanvasComponentDragId(dataTransfer) {
|
|
8498
|
-
const id = _optionalChain([dataTransfer, 'optionalAccess',
|
|
8053
|
+
const id = _optionalChain([dataTransfer, 'optionalAccess', _297 => _297.getData, 'call', _298 => _298(CANVAS_COMPONENT_DRAG_TYPE)]);
|
|
8499
8054
|
return id ? id : void 0;
|
|
8500
8055
|
}
|
|
8501
8056
|
|
|
@@ -8565,7 +8120,7 @@ function strokePointsToPathData(points, options = {}) {
|
|
|
8565
8120
|
const [p0, p1] = points;
|
|
8566
8121
|
return `M ${p0[0]} ${p0[1]} L ${p1[0]} ${p1[1]}`;
|
|
8567
8122
|
}
|
|
8568
|
-
const fitted =
|
|
8123
|
+
const fitted = _chunkBGNPT5PEcjs.fitFreehandPath.call(void 0, points, options);
|
|
8569
8124
|
return fitted.length > 0 ? fitted : `M ${points[0][0]} ${points[0][1]}`;
|
|
8570
8125
|
}
|
|
8571
8126
|
function strokeToShapeNode(stroke, options = {}) {
|
|
@@ -8623,11 +8178,11 @@ function findStrokesAtPoint(point, nodes, radius = 12) {
|
|
|
8623
8178
|
}
|
|
8624
8179
|
const localPoint = [point[0] - rect.x, point[1] - rect.y];
|
|
8625
8180
|
try {
|
|
8626
|
-
const
|
|
8627
|
-
if (
|
|
8181
|
+
const dist = _chunkBGNPT5PEcjs.distanceToBezierPath.call(void 0, shape.d, localPoint);
|
|
8182
|
+
if (dist <= effectiveRadius) {
|
|
8628
8183
|
matches2.push(node);
|
|
8629
8184
|
}
|
|
8630
|
-
} catch (
|
|
8185
|
+
} catch (e8) {
|
|
8631
8186
|
if (point[0] >= rect.x && point[0] <= rect.x + rect.width && point[1] >= rect.y && point[1] <= rect.y + rect.height) {
|
|
8632
8187
|
matches2.push(node);
|
|
8633
8188
|
}
|
|
@@ -8655,13 +8210,13 @@ function createCanvasDrawController(options) {
|
|
|
8655
8210
|
...createDefaultStrokeStyle(tool),
|
|
8656
8211
|
...options.style
|
|
8657
8212
|
};
|
|
8658
|
-
_optionalChain([options, 'access',
|
|
8213
|
+
_optionalChain([options, 'access', _299 => _299.onStyleChange, 'optionalCall', _300 => _300(currentStyle)]);
|
|
8659
8214
|
}
|
|
8660
|
-
_optionalChain([options, 'access',
|
|
8215
|
+
_optionalChain([options, 'access', _301 => _301.onToolChange, 'optionalCall', _302 => _302(tool)]);
|
|
8661
8216
|
}
|
|
8662
8217
|
function setStyle(style) {
|
|
8663
8218
|
currentStyle = { ...currentStyle, ...style };
|
|
8664
|
-
_optionalChain([options, 'access',
|
|
8219
|
+
_optionalChain([options, 'access', _303 => _303.onStyleChange, 'optionalCall', _304 => _304(currentStyle)]);
|
|
8665
8220
|
}
|
|
8666
8221
|
function startStroke(point) {
|
|
8667
8222
|
if (currentTool === "select") return;
|
|
@@ -8671,7 +8226,7 @@ function createCanvasDrawController(options) {
|
|
|
8671
8226
|
eraseAt(point);
|
|
8672
8227
|
return;
|
|
8673
8228
|
}
|
|
8674
|
-
const id = _nullishCoalesce(_optionalChain([options, 'access',
|
|
8229
|
+
const id = _nullishCoalesce(_optionalChain([options, 'access', _305 => _305.generateNodeId, 'optionalCall', _306 => _306()]), () => ( `stroke-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`));
|
|
8675
8230
|
activeStroke = {
|
|
8676
8231
|
id,
|
|
8677
8232
|
tool: currentTool,
|
|
@@ -8679,7 +8234,7 @@ function createCanvasDrawController(options) {
|
|
|
8679
8234
|
style: { ...currentStyle },
|
|
8680
8235
|
startTime: Date.now()
|
|
8681
8236
|
};
|
|
8682
|
-
_optionalChain([options, 'access',
|
|
8237
|
+
_optionalChain([options, 'access', _307 => _307.onActiveStrokeChange, 'optionalCall', _308 => _308(activeStroke)]);
|
|
8683
8238
|
}
|
|
8684
8239
|
function continueStroke(point) {
|
|
8685
8240
|
if (currentTool === "eraser") {
|
|
@@ -8691,7 +8246,7 @@ function createCanvasDrawController(options) {
|
|
|
8691
8246
|
const last = points[points.length - 1];
|
|
8692
8247
|
if (Math.hypot(point[0] - last[0], point[1] - last[1]) < 0.25) return;
|
|
8693
8248
|
points.push(point);
|
|
8694
|
-
_optionalChain([options, 'access',
|
|
8249
|
+
_optionalChain([options, 'access', _309 => _309.onActiveStrokeChange, 'optionalCall', _310 => _310({ ...activeStroke, points: [...points] })]);
|
|
8695
8250
|
}
|
|
8696
8251
|
function endStroke() {
|
|
8697
8252
|
if (currentTool === "eraser") {
|
|
@@ -8716,7 +8271,7 @@ function createCanvasDrawController(options) {
|
|
|
8716
8271
|
if (!activeStroke) return null;
|
|
8717
8272
|
const stroke = activeStroke;
|
|
8718
8273
|
activeStroke = null;
|
|
8719
|
-
_optionalChain([options, 'access',
|
|
8274
|
+
_optionalChain([options, 'access', _311 => _311.onActiveStrokeChange, 'optionalCall', _312 => _312(null)]);
|
|
8720
8275
|
if (stroke.points.length === 0) return null;
|
|
8721
8276
|
const drawOpts = _nullishCoalesce(options.drawOptions, () => ( {}));
|
|
8722
8277
|
const smoothed = streamlinePoints(stroke.points, _nullishCoalesce(drawOpts.streamline, () => ( 0.35)));
|
|
@@ -8740,13 +8295,13 @@ function createCanvasDrawController(options) {
|
|
|
8740
8295
|
} else {
|
|
8741
8296
|
options.setNodes([...options.getNodes(), node]);
|
|
8742
8297
|
}
|
|
8743
|
-
_optionalChain([options, 'access',
|
|
8298
|
+
_optionalChain([options, 'access', _313 => _313.onStrokeComplete, 'optionalCall', _314 => _314(node)]);
|
|
8744
8299
|
return node;
|
|
8745
8300
|
}
|
|
8746
8301
|
function cancelStroke() {
|
|
8747
8302
|
if (activeStroke) {
|
|
8748
8303
|
activeStroke = null;
|
|
8749
|
-
_optionalChain([options, 'access',
|
|
8304
|
+
_optionalChain([options, 'access', _315 => _315.onActiveStrokeChange, 'optionalCall', _316 => _316(null)]);
|
|
8750
8305
|
}
|
|
8751
8306
|
if (erasedInDrag.size > 0) {
|
|
8752
8307
|
const entries = Array.from(erasedInDrag.values());
|
|
@@ -8776,7 +8331,7 @@ function createCanvasDrawController(options) {
|
|
|
8776
8331
|
const erasedSet = new Set(newlyErased.map((n) => n.id));
|
|
8777
8332
|
const nextNodes = nodes.filter((n) => !erasedSet.has(n.id));
|
|
8778
8333
|
options.setNodes(nextNodes);
|
|
8779
|
-
_optionalChain([options, 'access',
|
|
8334
|
+
_optionalChain([options, 'access', _317 => _317.onNodesErase, 'optionalCall', _318 => _318(newlyErased)]);
|
|
8780
8335
|
}
|
|
8781
8336
|
return newlyErased;
|
|
8782
8337
|
}
|
|
@@ -9171,5 +8726,7 @@ function createCanvasDrawController(options) {
|
|
|
9171
8726
|
|
|
9172
8727
|
|
|
9173
8728
|
|
|
9174
|
-
exports.ANIMATABLE_PROPERTIES = ANIMATABLE_PROPERTIES; exports.ANIMATION_DATA_KEY = ANIMATION_DATA_KEY; exports.ANIMATION_EASING_LABELS = _chunkXZ4L3R4Kcjs.ANIMATION_EASING_LABELS; exports.ANIMATION_EASING_PRESETS = _chunkXZ4L3R4Kcjs.ANIMATION_EASING_PRESETS; exports.ANIMATION_TIME_EPSILON = _chunkXHRZSB77cjs.ANIMATION_TIME_EPSILON; exports.AUTO_LAYOUT_DATA_KEY = AUTO_LAYOUT_DATA_KEY; exports.AnimationEditError = AnimationEditError; exports.AnimationPlayer = _chunkXHRZSB77cjs.AnimationPlayer; exports.CANVAS_COMPONENT_DRAG_TYPE = CANVAS_COMPONENT_DRAG_TYPE; exports.CANVAS_GRADIENT_PRESETS = _chunkM4XE4UMTcjs.CANVAS_GRADIENT_PRESETS; 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 = _chunkXZ4L3R4Kcjs.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 = _chunkXHRZSB77cjs.ManualClock; exports.PathOpsError = _chunkM4XE4UMTcjs.PathOpsError; exports.RESIZE_HANDLES = RESIZE_HANDLES; exports.SHAPE_DATA_KEY = SHAPE_DATA_KEY; exports.SHAPE_KINDS = _chunkM4XE4UMTcjs.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.angleToSvgLinearCoords = _chunkM4XE4UMTcjs.angleToSvgLinearCoords; exports.animateNode = animateNode; exports.applyAnimation = applyAnimation; exports.applyAnimationOverrides = applyAnimationOverrides; exports.applyConstraints = applyConstraints; exports.applyNodeUpdates = applyNodeUpdates; exports.applyShapeCombination = applyShapeCombination; exports.applyShapeReplacement = applyShapeReplacement; exports.arcToCubics = _chunkM4XE4UMTcjs.arcToCubics; exports.bezierPathArea = _chunkM4XE4UMTcjs.bezierPathArea; exports.bezierPathBounds = _chunkM4XE4UMTcjs.bezierPathBounds; exports.bezierPathLength = _chunkM4XE4UMTcjs.bezierPathLength; exports.bezierPathPointAtLength = _chunkM4XE4UMTcjs.bezierPathPointAtLength; exports.bezierPathSignedArea = _chunkM4XE4UMTcjs.bezierPathSignedArea; exports.bezierPathToSvg = _chunkM4XE4UMTcjs.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 = _chunkM4XE4UMTcjs.closeContour; exports.collectDescendantIds = collectDescendantIds; exports.combineCanvasComponentsAsVariants = combineCanvasComponentsAsVariants; exports.combineShapeNodes = combineShapeNodes; exports.computeNodesBoundingBox = computeNodesBoundingBox; exports.computeSnapGuides = computeSnapGuides; exports.connectedOnly = connectedOnly; exports.contourSignedArea = _chunkM4XE4UMTcjs.contourSignedArea; exports.contoursToPath = _chunkM4XE4UMTcjs.contoursToPath; exports.copyKeyframes = copyKeyframes; exports.countPathSegments = _chunkM4XE4UMTcjs.countPathSegments; exports.createAnimationPlayer = _chunkXHRZSB77cjs.createAnimationPlayer; exports.createBezierTrajectory = createBezierTrajectory; exports.createCanvasAnimationController = createCanvasAnimationController; exports.createCanvasArrangeController = createCanvasArrangeController; exports.createCanvasAutoLayoutController = createCanvasAutoLayoutController; exports.createCanvasComponent = createCanvasComponent; exports.createCanvasComponentsController = createCanvasComponentsController; exports.createCanvasDrawController = createCanvasDrawController; exports.createCanvasInstance = createCanvasInstance; exports.createCanvasScenesStore = createCanvasScenesStore; exports.createDefaultStrokeStyle = createDefaultStrokeStyle; exports.createFanOutTrajectory = createFanOutTrajectory; exports.createGuideIndex = createGuideIndex; exports.createNodeGuideIndex = createNodeGuideIndex; exports.createNodeLookup = createNodeLookup; exports.cubicBezierAt = _chunkXZ4L3R4Kcjs.cubicBezierAt; exports.cubicPointAt = _chunkM4XE4UMTcjs.cubicPointAt; exports.cubicsToPathData = _chunkM4XE4UMTcjs.cubicsToPathData; exports.dashContours = dashContours; exports.defaultEasing = defaultEasing; exports.deleteKeyframes = deleteKeyframes; exports.detachCanvasInstance = detachCanvasInstance; exports.detachTokenBindings = detachTokenBindings; exports.diffOverrideGroups = diffOverrideGroups; exports.distanceToBezierPath = _chunkM4XE4UMTcjs.distanceToBezierPath; exports.distributeNodes = distributeNodes; exports.dividePaths = _chunkM4XE4UMTcjs.dividePaths; exports.dividePolygons = _chunkM4XE4UMTcjs.dividePolygons; exports.easingFromInfluence = _chunkXZ4L3R4Kcjs.easingFromInfluence; exports.easingLabel = _chunkXZ4L3R4Kcjs.easingLabel; exports.easingToCss = _chunkXZ4L3R4Kcjs.easingToCss; exports.elasticAt = _chunkXZ4L3R4Kcjs.elasticAt; exports.ensureLayout = _chunkWADCJ7A7cjs.ensureLayout; exports.estimateCanvasHeight = estimateCanvasHeight; exports.estimateNodeSize = _chunkWADCJ7A7cjs.estimateNodeSize; exports.evaluateAnimation = evaluateAnimation; exports.evaluateEasing = _chunkXZ4L3R4Kcjs.evaluateEasing; exports.evaluateTrack = _chunkXHRZSB77cjs.evaluateTrack; exports.excludePaths = _chunkM4XE4UMTcjs.excludePaths; exports.exportCssAnimation = exportCssAnimation; exports.findConnectorSnap = findConnectorSnap; exports.findStrokesAtPoint = findStrokesAtPoint; exports.findVariant = findVariant; exports.fitCubicRun = _chunkM4XE4UMTcjs.fitCubicRun; exports.fitCubics = _chunkM4XE4UMTcjs.fitCubics; exports.fitFreehandPath = _chunkM4XE4UMTcjs.fitFreehandPath; exports.fitPathData = _chunkM4XE4UMTcjs.fitPathData; exports.fitViewportToNodes = fitViewportToNodes; exports.fitViewportToRect = fitViewportToRect; exports.flattenSvgPath = _chunkM4XE4UMTcjs.flattenSvgPath; exports.flowSide = _chunkWADCJ7A7cjs.flowSide; exports.formatAnimationTime = formatAnimationTime; exports.formatNumber = _chunkM4XE4UMTcjs.formatNumber; exports.formatOklab = _chunkXHRZSB77cjs.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 = _chunkM4XE4UMTcjs.getShapeRenderData; exports.getShapeSvg = _chunkM4XE4UMTcjs.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.gradientToSvgDef = _chunkM4XE4UMTcjs.gradientToSvgDef; exports.handlePoint = handlePoint; exports.hasVisibleStroke = hasVisibleStroke; exports.inferResizeHandle = inferResizeHandle; exports.inspectCanvasInstance = inspectCanvasInstance; exports.inspectNodeTokens = inspectNodeTokens; exports.interpolateAnimationValue = _chunkXHRZSB77cjs.interpolateAnimationValue; exports.intersectPaths = _chunkM4XE4UMTcjs.intersectPaths; exports.intersectPolygons = _chunkM4XE4UMTcjs.intersectPolygons; exports.invertNodeUpdates = invertNodeUpdates; exports.isAnimationEasing = _chunkXZ4L3R4Kcjs.isAnimationEasing; exports.isAnimationKeyframe = _chunkXHRZSB77cjs.isAnimationKeyframe; exports.isAutoLayoutFrame = isAutoLayoutFrame; exports.isCanvasComponent = isCanvasComponent; exports.isCanvasComponentSet = isCanvasComponentSet; exports.isCanvasGradient = _chunkM4XE4UMTcjs.isCanvasGradient; 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 = _chunkM4XE4UMTcjs.isShapeDescription; exports.isShapeNode = isShapeNode; exports.isStraightCubic = _chunkM4XE4UMTcjs.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 = _chunkXHRZSB77cjs.mixColorsOklab; exports.moveKeyframes = moveKeyframes; exports.moveLayoutChild = moveLayoutChild; exports.multiPolygonArea = _chunkM4XE4UMTcjs.multiPolygonArea; exports.multiPolygonBounds = _chunkM4XE4UMTcjs.multiPolygonBounds; exports.nearestHandlePositions = nearestHandlePositions; exports.normalizeBezierPath = _chunkM4XE4UMTcjs.normalizeBezierPath; exports.normalizeKeyframes = _chunkXHRZSB77cjs.normalizeKeyframes; exports.offsetPath = offsetPath; exports.offsetShapeNodes = offsetShapeNodes; exports.oklabToRgb = _chunkXHRZSB77cjs.oklabToRgb; exports.oppositePosition = oppositePosition; exports.outlineShapeNodeStrokes = outlineShapeNodeStrokes; exports.outlineStroke = outlineStroke; exports.overlaps = _chunkWADCJ7A7cjs.overlaps; exports.pageHidden = _chunkXHRZSB77cjs.pageHidden; exports.parseCanvasClipboardData = parseCanvasClipboardData; exports.parseCanvasScenes = parseCanvasScenes; exports.parseCssEasing = _chunkXZ4L3R4Kcjs.parseCssEasing; exports.parseCssGradient = _chunkM4XE4UMTcjs.parseCssGradient; exports.parseKeyframeClipboard = parseKeyframeClipboard; exports.parseNodeStyleDeclarations = parseNodeStyleDeclarations; exports.parseOklab = _chunkXHRZSB77cjs.parseOklab; exports.parseSvgPath = _chunkM4XE4UMTcjs.parseSvgPath; exports.parseVariantName = parseVariantName; exports.pasteKeyframes = pasteKeyframes; exports.pathBoolean = _chunkM4XE4UMTcjs.pathBoolean; exports.pathToContours = _chunkM4XE4UMTcjs.pathToContours; exports.placeBeside = _chunkWADCJ7A7cjs.placeBeside; exports.playWebAnimations = playWebAnimations; exports.pointInBezierPath = _chunkM4XE4UMTcjs.pointInBezierPath; exports.pointInMultiPolygon = _chunkM4XE4UMTcjs.pointInMultiPolygon; exports.pointInRings = _chunkM4XE4UMTcjs.pointInRings; exports.polygonArea = _chunkM4XE4UMTcjs.polygonArea; exports.polygonBoolean = _chunkM4XE4UMTcjs.polygonBoolean; exports.polygonToSvgPath = _chunkM4XE4UMTcjs.polygonToSvgPath; exports.positionToSide = positionToSide; exports.pruneCanvasTokenModes = pruneCanvasTokenModes; exports.pushCanvasInstanceOverrides = pushCanvasInstanceOverrides; exports.readAnimatableValue = readAnimatableValue; exports.readNodeStyleProperty = readNodeStyleProperty; exports.readOverrideGroup = readOverrideGroup; exports.readStyleSize = readStyleSize; exports.realClock = _chunkXHRZSB77cjs.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.resolveCanvasGradient = _chunkM4XE4UMTcjs.resolveCanvasGradient; exports.resolveCanvasTokens = resolveCanvasTokens; exports.resolveEasing = _chunkXZ4L3R4Kcjs.resolveEasing; exports.resolvePadding = resolvePadding; exports.restoreCanvasMainComponent = restoreCanvasMainComponent; exports.revertShapeCombination = revertShapeCombination; exports.rgbToOklab = _chunkXHRZSB77cjs.rgbToOklab; exports.ringSignedArea = _chunkM4XE4UMTcjs.ringSignedArea; exports.runMultiNodeTransition = runMultiNodeTransition; exports.sampleAnimationFrames = sampleAnimationFrames; exports.scaleKeyframes = scaleKeyframes; exports.segmentBounds = _chunkM4XE4UMTcjs.segmentBounds; exports.segmentCurvature = _chunkM4XE4UMTcjs.segmentCurvature; exports.segmentDerivative = _chunkM4XE4UMTcjs.segmentDerivative; exports.segmentExtrema = _chunkM4XE4UMTcjs.segmentExtrema; exports.segmentLength = _chunkM4XE4UMTcjs.segmentLength; exports.segmentNearest = _chunkM4XE4UMTcjs.segmentNearest; exports.segmentParamAtLength = _chunkM4XE4UMTcjs.segmentParamAtLength; exports.segmentPoint = _chunkM4XE4UMTcjs.segmentPoint; exports.segmentTangent = _chunkM4XE4UMTcjs.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 = _chunkM4XE4UMTcjs.shapeToPolygon; exports.sideToPosition = sideToPosition; exports.simplifyRing = _chunkM4XE4UMTcjs.simplifyRing; exports.snapKeyframeDelta = snapKeyframeDelta; exports.snapNodeDrag = snapNodeDrag; exports.snapNodeResize = snapNodeResize; exports.snapResize = snapResize; exports.snapTimeToFrame = snapTimeToFrame; exports.snapToGrid = snapToGrid; exports.splitSegment = _chunkM4XE4UMTcjs.splitSegment; exports.springAt = _chunkXZ4L3R4Kcjs.springAt; exports.streamlinePoints = streamlinePoints; exports.strokeBoundingBox = strokeBoundingBox; exports.strokeOutlineRings = strokeOutlineRings; exports.strokePointsToPathData = strokePointsToPathData; exports.strokeToShapeNode = strokeToShapeNode; exports.subSegment = _chunkM4XE4UMTcjs.subSegment; exports.subtractPaths = _chunkM4XE4UMTcjs.subtractPaths; exports.subtractPolygons = _chunkM4XE4UMTcjs.subtractPolygons; exports.swapCanvasInstance = swapCanvasInstance; exports.syncAllCanvasInstances = syncAllCanvasInstances; exports.syncCanvasComponents = syncCanvasComponents; exports.syncCanvasInstance = syncCanvasInstance; exports.timeToX = timeToX; exports.toBezierPath = _chunkM4XE4UMTcjs.toBezierPath; exports.toWebAnimations = toWebAnimations; exports.toggleLockNodes = toggleLockNodes; exports.transformBezierPath = _chunkM4XE4UMTcjs.transformBezierPath; exports.trimSegments = _chunkM4XE4UMTcjs.trimSegments; exports.unionPolygons = _chunkM4XE4UMTcjs.unionPolygons; exports.unitePaths = _chunkM4XE4UMTcjs.unitePaths; exports.unlockNodes = unlockNodes; exports.updateKeyframe = updateKeyframe; exports.windingNumber = _chunkM4XE4UMTcjs.windingNumber; exports.withNodeAnimation = withNodeAnimation; exports.withStyleOpacity = withStyleOpacity; exports.withStyleSize = withStyleSize; exports.wouldCreateComponentCycle = wouldCreateComponentCycle; exports.wrapAnimationTime = _chunkXHRZSB77cjs.wrapAnimationTime; exports.writeNodeStyleProperty = writeNodeStyleProperty; exports.writeOverrideGroup = writeOverrideGroup; exports.xToTime = xToTime; exports.xorPolygons = _chunkM4XE4UMTcjs.xorPolygons;
|
|
8729
|
+
|
|
8730
|
+
|
|
8731
|
+
exports.ANIMATABLE_PROPERTIES = ANIMATABLE_PROPERTIES; exports.ANIMATION_DATA_KEY = ANIMATION_DATA_KEY; exports.ANIMATION_EASING_LABELS = _chunkXZ4L3R4Kcjs.ANIMATION_EASING_LABELS; exports.ANIMATION_EASING_PRESETS = _chunkXZ4L3R4Kcjs.ANIMATION_EASING_PRESETS; exports.ANIMATION_TIME_EPSILON = _chunkXHRZSB77cjs.ANIMATION_TIME_EPSILON; exports.AUTO_LAYOUT_DATA_KEY = AUTO_LAYOUT_DATA_KEY; exports.AnimationEditError = AnimationEditError; exports.AnimationPlayer = _chunkXHRZSB77cjs.AnimationPlayer; exports.CANVAS_COMPONENT_DRAG_TYPE = CANVAS_COMPONENT_DRAG_TYPE; exports.CANVAS_GRADIENT_PRESETS = _chunkBGNPT5PEcjs.CANVAS_GRADIENT_PRESETS; 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 = _chunkXZ4L3R4Kcjs.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 = _chunkXHRZSB77cjs.ManualClock; exports.PathOpsError = _chunkBGNPT5PEcjs.PathOpsError; exports.RESIZE_HANDLES = RESIZE_HANDLES; exports.SHAPE_DATA_KEY = SHAPE_DATA_KEY; exports.SHAPE_KINDS = _chunkBGNPT5PEcjs.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.angleToSvgLinearCoords = _chunkBGNPT5PEcjs.angleToSvgLinearCoords; exports.animateNode = animateNode; exports.applyAnimation = applyAnimation; exports.applyAnimationOverrides = applyAnimationOverrides; exports.applyConstraints = applyConstraints; exports.applyNodeUpdates = applyNodeUpdates; exports.applyShapeCombination = applyShapeCombination; exports.applyShapeReplacement = applyShapeReplacement; exports.arcToCubics = _chunkBGNPT5PEcjs.arcToCubics; exports.bezierPathArea = _chunkBGNPT5PEcjs.bezierPathArea; exports.bezierPathBounds = _chunkBGNPT5PEcjs.bezierPathBounds; exports.bezierPathLength = _chunkBGNPT5PEcjs.bezierPathLength; exports.bezierPathPointAtLength = _chunkBGNPT5PEcjs.bezierPathPointAtLength; exports.bezierPathSignedArea = _chunkBGNPT5PEcjs.bezierPathSignedArea; exports.bezierPathToSvg = _chunkBGNPT5PEcjs.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 = _chunkBGNPT5PEcjs.closeContour; exports.collectDescendantIds = collectDescendantIds; exports.combineCanvasComponentsAsVariants = combineCanvasComponentsAsVariants; exports.combineShapeNodes = combineShapeNodes; exports.computeNodesBoundingBox = computeNodesBoundingBox; exports.computeSnapGuides = computeSnapGuides; exports.connectedOnly = connectedOnly; exports.contourSignedArea = _chunkBGNPT5PEcjs.contourSignedArea; exports.contoursToPath = _chunkBGNPT5PEcjs.contoursToPath; exports.copyKeyframes = copyKeyframes; exports.countPathSegments = _chunkBGNPT5PEcjs.countPathSegments; exports.createAnimationPlayer = _chunkXHRZSB77cjs.createAnimationPlayer; exports.createBezierTrajectory = createBezierTrajectory; exports.createCanvasAnimationController = createCanvasAnimationController; exports.createCanvasArrangeController = createCanvasArrangeController; exports.createCanvasAutoLayoutController = createCanvasAutoLayoutController; exports.createCanvasComponent = createCanvasComponent; exports.createCanvasComponentsController = createCanvasComponentsController; exports.createCanvasDrawController = createCanvasDrawController; exports.createCanvasInstance = createCanvasInstance; exports.createCanvasScenesStore = createCanvasScenesStore; exports.createDefaultStrokeStyle = createDefaultStrokeStyle; exports.createFanOutTrajectory = createFanOutTrajectory; exports.createGuideIndex = createGuideIndex; exports.createNodeGuideIndex = createNodeGuideIndex; exports.createNodeLookup = createNodeLookup; exports.cubicBezierAt = _chunkXZ4L3R4Kcjs.cubicBezierAt; exports.cubicPointAt = _chunkBGNPT5PEcjs.cubicPointAt; exports.cubicsToPathData = _chunkBGNPT5PEcjs.cubicsToPathData; exports.dashContours = _chunkBGNPT5PEcjs.dashContours; exports.defaultEasing = defaultEasing; exports.deleteKeyframes = deleteKeyframes; exports.detachCanvasInstance = detachCanvasInstance; exports.detachTokenBindings = detachTokenBindings; exports.diffOverrideGroups = diffOverrideGroups; exports.distanceToBezierPath = _chunkBGNPT5PEcjs.distanceToBezierPath; exports.distributeNodes = distributeNodes; exports.dividePaths = _chunkBGNPT5PEcjs.dividePaths; exports.dividePolygons = _chunkBGNPT5PEcjs.dividePolygons; exports.easingFromInfluence = _chunkXZ4L3R4Kcjs.easingFromInfluence; exports.easingLabel = _chunkXZ4L3R4Kcjs.easingLabel; exports.easingToCss = _chunkXZ4L3R4Kcjs.easingToCss; exports.elasticAt = _chunkXZ4L3R4Kcjs.elasticAt; exports.ensureLayout = _chunkWADCJ7A7cjs.ensureLayout; exports.estimateCanvasHeight = estimateCanvasHeight; exports.estimateNodeSize = _chunkWADCJ7A7cjs.estimateNodeSize; exports.evaluateAnimation = evaluateAnimation; exports.evaluateEasing = _chunkXZ4L3R4Kcjs.evaluateEasing; exports.evaluateTrack = _chunkXHRZSB77cjs.evaluateTrack; exports.excludePaths = _chunkBGNPT5PEcjs.excludePaths; exports.exportCssAnimation = exportCssAnimation; exports.findConnectorSnap = findConnectorSnap; exports.findStrokesAtPoint = findStrokesAtPoint; exports.findVariant = findVariant; exports.fitCubicRun = _chunkBGNPT5PEcjs.fitCubicRun; exports.fitCubicWithTangents = _chunkBGNPT5PEcjs.fitCubicWithTangents; exports.fitCubics = _chunkBGNPT5PEcjs.fitCubics; exports.fitFreehandPath = _chunkBGNPT5PEcjs.fitFreehandPath; exports.fitPathData = _chunkBGNPT5PEcjs.fitPathData; exports.fitViewportToNodes = fitViewportToNodes; exports.fitViewportToRect = fitViewportToRect; exports.flattenSvgPath = _chunkBGNPT5PEcjs.flattenSvgPath; exports.flowSide = _chunkWADCJ7A7cjs.flowSide; exports.formatAnimationTime = formatAnimationTime; exports.formatNumber = _chunkBGNPT5PEcjs.formatNumber; exports.formatOklab = _chunkXHRZSB77cjs.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 = _chunkBGNPT5PEcjs.getShapeRenderData; exports.getShapeSvg = _chunkBGNPT5PEcjs.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.gradientToSvgDef = _chunkBGNPT5PEcjs.gradientToSvgDef; exports.handlePoint = handlePoint; exports.hasVisibleStroke = hasVisibleStroke; exports.inferResizeHandle = inferResizeHandle; exports.inspectCanvasInstance = inspectCanvasInstance; exports.inspectNodeTokens = inspectNodeTokens; exports.interpolateAnimationValue = _chunkXHRZSB77cjs.interpolateAnimationValue; exports.intersectPaths = _chunkBGNPT5PEcjs.intersectPaths; exports.intersectPolygons = _chunkBGNPT5PEcjs.intersectPolygons; exports.invertNodeUpdates = invertNodeUpdates; exports.isAnimationEasing = _chunkXZ4L3R4Kcjs.isAnimationEasing; exports.isAnimationKeyframe = _chunkXHRZSB77cjs.isAnimationKeyframe; exports.isAutoLayoutFrame = isAutoLayoutFrame; exports.isCanvasComponent = isCanvasComponent; exports.isCanvasComponentSet = isCanvasComponentSet; exports.isCanvasGradient = _chunkBGNPT5PEcjs.isCanvasGradient; 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 = _chunkBGNPT5PEcjs.isShapeDescription; exports.isShapeNode = isShapeNode; exports.isStraightCubic = _chunkBGNPT5PEcjs.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 = _chunkXHRZSB77cjs.mixColorsOklab; exports.moveKeyframes = moveKeyframes; exports.moveLayoutChild = moveLayoutChild; exports.multiPolygonArea = _chunkBGNPT5PEcjs.multiPolygonArea; exports.multiPolygonBounds = _chunkBGNPT5PEcjs.multiPolygonBounds; exports.nearestHandlePositions = nearestHandlePositions; exports.normalizeBezierPath = _chunkBGNPT5PEcjs.normalizeBezierPath; exports.normalizeKeyframes = _chunkXHRZSB77cjs.normalizeKeyframes; exports.offsetPath = _chunkBGNPT5PEcjs.offsetPath; exports.offsetShapeNodes = offsetShapeNodes; exports.oklabToRgb = _chunkXHRZSB77cjs.oklabToRgb; exports.oppositePosition = oppositePosition; exports.outlineShapeNodeStrokes = outlineShapeNodeStrokes; exports.outlineStroke = _chunkBGNPT5PEcjs.outlineStroke; exports.overlaps = _chunkWADCJ7A7cjs.overlaps; exports.pageHidden = _chunkXHRZSB77cjs.pageHidden; exports.parseCanvasClipboardData = parseCanvasClipboardData; exports.parseCanvasScenes = parseCanvasScenes; exports.parseCssEasing = _chunkXZ4L3R4Kcjs.parseCssEasing; exports.parseCssGradient = _chunkBGNPT5PEcjs.parseCssGradient; exports.parseKeyframeClipboard = parseKeyframeClipboard; exports.parseNodeStyleDeclarations = parseNodeStyleDeclarations; exports.parseOklab = _chunkXHRZSB77cjs.parseOklab; exports.parseSvgPath = _chunkBGNPT5PEcjs.parseSvgPath; exports.parseVariantName = parseVariantName; exports.pasteKeyframes = pasteKeyframes; exports.pathBoolean = _chunkBGNPT5PEcjs.pathBoolean; exports.pathToContours = _chunkBGNPT5PEcjs.pathToContours; exports.placeBeside = _chunkWADCJ7A7cjs.placeBeside; exports.playWebAnimations = playWebAnimations; exports.pointInBezierPath = _chunkBGNPT5PEcjs.pointInBezierPath; exports.pointInMultiPolygon = _chunkBGNPT5PEcjs.pointInMultiPolygon; exports.pointInRings = _chunkBGNPT5PEcjs.pointInRings; exports.polygonArea = _chunkBGNPT5PEcjs.polygonArea; exports.polygonBoolean = _chunkBGNPT5PEcjs.polygonBoolean; exports.polygonToSvgPath = _chunkBGNPT5PEcjs.polygonToSvgPath; exports.positionToSide = positionToSide; exports.pruneCanvasTokenModes = pruneCanvasTokenModes; exports.pushCanvasInstanceOverrides = pushCanvasInstanceOverrides; exports.readAnimatableValue = readAnimatableValue; exports.readNodeStyleProperty = readNodeStyleProperty; exports.readOverrideGroup = readOverrideGroup; exports.readStyleSize = readStyleSize; exports.realClock = _chunkXHRZSB77cjs.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.resolveCanvasGradient = _chunkBGNPT5PEcjs.resolveCanvasGradient; exports.resolveCanvasTokens = resolveCanvasTokens; exports.resolveEasing = _chunkXZ4L3R4Kcjs.resolveEasing; exports.resolvePadding = resolvePadding; exports.restoreCanvasMainComponent = restoreCanvasMainComponent; exports.revertShapeCombination = revertShapeCombination; exports.rgbToOklab = _chunkXHRZSB77cjs.rgbToOklab; exports.ringSignedArea = _chunkBGNPT5PEcjs.ringSignedArea; exports.runMultiNodeTransition = runMultiNodeTransition; exports.sampleAnimationFrames = sampleAnimationFrames; exports.scaleKeyframes = scaleKeyframes; exports.segmentBounds = _chunkBGNPT5PEcjs.segmentBounds; exports.segmentCurvature = _chunkBGNPT5PEcjs.segmentCurvature; exports.segmentDerivative = _chunkBGNPT5PEcjs.segmentDerivative; exports.segmentExtrema = _chunkBGNPT5PEcjs.segmentExtrema; exports.segmentIntersections = _chunkBGNPT5PEcjs.segmentIntersections; exports.segmentLength = _chunkBGNPT5PEcjs.segmentLength; exports.segmentNearest = _chunkBGNPT5PEcjs.segmentNearest; exports.segmentParamAtLength = _chunkBGNPT5PEcjs.segmentParamAtLength; exports.segmentPoint = _chunkBGNPT5PEcjs.segmentPoint; exports.segmentTangent = _chunkBGNPT5PEcjs.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 = _chunkBGNPT5PEcjs.shapeToPolygon; exports.sideToPosition = sideToPosition; exports.simplifyRing = _chunkBGNPT5PEcjs.simplifyRing; exports.snapKeyframeDelta = snapKeyframeDelta; exports.snapNodeDrag = snapNodeDrag; exports.snapNodeResize = snapNodeResize; exports.snapResize = snapResize; exports.snapTimeToFrame = snapTimeToFrame; exports.snapToGrid = snapToGrid; exports.splitSegment = _chunkBGNPT5PEcjs.splitSegment; exports.springAt = _chunkXZ4L3R4Kcjs.springAt; exports.streamlinePoints = streamlinePoints; exports.strokeBoundingBox = strokeBoundingBox; exports.strokeOutlineRings = _chunkBGNPT5PEcjs.strokeOutlineRings; exports.strokePointsToPathData = strokePointsToPathData; exports.strokeToShapeNode = strokeToShapeNode; exports.subSegment = _chunkBGNPT5PEcjs.subSegment; exports.subtractPaths = _chunkBGNPT5PEcjs.subtractPaths; exports.subtractPolygons = _chunkBGNPT5PEcjs.subtractPolygons; exports.swapCanvasInstance = swapCanvasInstance; exports.syncAllCanvasInstances = syncAllCanvasInstances; exports.syncCanvasComponents = syncCanvasComponents; exports.syncCanvasInstance = syncCanvasInstance; exports.timeToX = timeToX; exports.toBezierPath = _chunkBGNPT5PEcjs.toBezierPath; exports.toWebAnimations = toWebAnimations; exports.toggleLockNodes = toggleLockNodes; exports.transformBezierPath = _chunkBGNPT5PEcjs.transformBezierPath; exports.trimSegments = _chunkBGNPT5PEcjs.trimSegments; exports.unionPolygons = _chunkBGNPT5PEcjs.unionPolygons; exports.unitePaths = _chunkBGNPT5PEcjs.unitePaths; exports.unlockNodes = unlockNodes; exports.updateKeyframe = updateKeyframe; exports.windingNumber = _chunkBGNPT5PEcjs.windingNumber; exports.withNodeAnimation = withNodeAnimation; exports.withStyleOpacity = withStyleOpacity; exports.withStyleSize = withStyleSize; exports.wouldCreateComponentCycle = wouldCreateComponentCycle; exports.wrapAnimationTime = _chunkXHRZSB77cjs.wrapAnimationTime; exports.writeNodeStyleProperty = writeNodeStyleProperty; exports.writeOverrideGroup = writeOverrideGroup; exports.xToTime = xToTime; exports.xorPolygons = _chunkBGNPT5PEcjs.xorPolygons;
|
|
9175
8732
|
//# sourceMappingURL=index.cjs.map
|