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