@pixerate/editor 0.237.0 → 0.239.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.cjs +40 -39
- package/dist/agent/index.js +9 -8
- package/dist/animation/index.cjs +7 -6
- package/dist/animation/index.js +6 -5
- package/dist/animation-editor/index.cjs +66 -65
- package/dist/animation-editor/index.js +9 -8
- package/dist/{brushstrokeRender-WDTKD54B.cjs → brushstrokeRender-MPOM7BFW.cjs} +7 -5
- package/dist/{brushstrokeRender-MAHOXL7K.js → brushstrokeRender-WB67GMUP.js} +4 -2
- package/dist/canvas/index.cjs +55 -54
- package/dist/canvas/index.js +10 -9
- package/dist/chart/index.cjs +159 -158
- package/dist/chart/index.js +9 -8
- package/dist/{chunk-L6Y7TSQ4.js → chunk-36ZTV7WO.js} +1 -1
- package/dist/{chunk-JVNGCS26.js → chunk-3E36VDMJ.js} +1 -1
- package/dist/{chunk-WRZ6C4TU.cjs → chunk-3R5P3DVY.cjs} +6 -6
- package/dist/{chunk-RUONPPMC.cjs → chunk-44BMJJVA.cjs} +8 -8
- package/dist/{chunk-YBAPT7NL.js → chunk-6ADHGQ73.js} +4 -2
- package/dist/chunk-7AHBW2CQ.cjs +200 -0
- package/dist/{chunk-EUIDTZNQ.cjs → chunk-7PT4RJL5.cjs} +113 -111
- package/dist/{chunk-CU6ANS5L.js → chunk-7YGBSFC6.js} +2 -2
- package/dist/{chunk-ATKKG76G.cjs → chunk-AD7GA3TL.cjs} +23 -23
- package/dist/{chunk-FSLKBQU7.js → chunk-AIS56JOO.js} +3 -3
- package/dist/{chunk-5VQXSS2S.cjs → chunk-BBUE3UJL.cjs} +86 -86
- package/dist/{chunk-7272D3K2.js → chunk-BP6KSGVD.js} +6 -4
- package/dist/{chunk-F6R67I3A.js → chunk-CXXXAZ7H.js} +1 -1
- package/dist/{chunk-5DQPDXOM.cjs → chunk-D2SGV525.cjs} +76 -76
- package/dist/chunk-F67XMVDI.js +200 -0
- package/dist/{chunk-JVSX5QTS.js → chunk-FQVVO5YA.js} +3 -3
- package/dist/{chunk-UXETV2NC.cjs → chunk-GA4EU4P3.cjs} +4 -4
- package/dist/{chunk-UFEDHACQ.js → chunk-GXAK6Q5J.js} +2 -2
- package/dist/{chunk-MHLU6GRJ.js → chunk-JEGJP4OW.js} +7 -196
- package/dist/chunk-KMPM5JM5.js +936 -0
- package/dist/{chunk-GOBOCZZI.js → chunk-LEQKZGQI.js} +1 -1
- package/dist/{chunk-M5GLQQWG.cjs → chunk-LJZRHVZV.cjs} +2 -2
- package/dist/{chunk-N76AMOKE.cjs → chunk-MOW3JMNG.cjs} +42 -42
- package/dist/{chunk-WKMUBATU.js → chunk-N4DFDI73.js} +1 -1
- package/dist/{chunk-GNZI3KYK.cjs → chunk-NKTNLJUJ.cjs} +49 -9
- package/dist/{chunk-TQOL6CF7.js → chunk-PJYG6FCF.js} +49 -9
- package/dist/{chunk-V3L7U63N.cjs → chunk-PP6BXVRL.cjs} +1 -1
- package/dist/{chunk-TFF2GTGN.cjs → chunk-PPFJHTW5.cjs} +24 -22
- package/dist/{chunk-6ZZKRH7R.js → chunk-QARCM66V.js} +3 -3
- package/dist/{chunk-5UEFBM2M.cjs → chunk-RD7RX52G.cjs} +18 -207
- package/dist/{chunk-CDP2AKMA.js → chunk-RV5DKZHU.js} +1 -1
- package/dist/chunk-S6OT6CTS.cjs +936 -0
- package/dist/{chunk-HUAISCUX.cjs → chunk-T7KQEMAE.cjs} +18 -18
- package/dist/{chunk-BQE3Y6ZO.cjs → chunk-THXFU3JB.cjs} +5 -5
- package/dist/{chunk-4ZC5QJE2.cjs → chunk-UTI5IITZ.cjs} +3 -3
- package/dist/{chunk-XSVUNSDJ.js → chunk-UUBO6RB5.js} +1 -1
- package/dist/{chunk-CZWUDFR3.cjs → chunk-UZU6DIZA.cjs} +52 -52
- package/dist/{chunk-M2TPMYJE.js → chunk-V6DT2CDH.js} +1 -1
- package/dist/{chunk-WV5WTOC6.cjs → chunk-W7GRGGBH.cjs} +16 -16
- package/dist/{chunk-23E5GI2U.js → chunk-WGN7AUKB.js} +2 -2
- package/dist/{chunk-YMREOA67.js → chunk-XK4SST43.js} +2 -2
- package/dist/{chunk-SOSBOS5T.cjs → chunk-XWOLPNBW.cjs} +22 -22
- package/dist/{chunk-ILP77UD6.js → chunk-YGQVCQTG.js} +1 -1
- package/dist/{chunk-GXLZZVR5.cjs → chunk-ZXNO3ZOX.cjs} +37 -37
- package/dist/color/index.cjs +6 -4
- package/dist/color/index.js +9 -7
- package/dist/export/index.cjs +8 -7
- package/dist/export/index.js +7 -6
- package/dist/extensions/index.cjs +11 -10
- package/dist/extensions/index.js +10 -9
- package/dist/gradient/index.cjs +104 -813
- package/dist/gradient/index.d.cts +1 -0
- package/dist/gradient/index.d.ts +1 -0
- package/dist/gradient/index.js +87 -796
- package/dist/gradient/sample.d.cts +69 -0
- package/dist/gradient/sample.d.ts +69 -0
- package/dist/image-editor/index.cjs +826 -778
- package/dist/image-editor/index.js +57 -9
- package/dist/index.cjs +17 -16
- package/dist/index.js +11 -10
- package/dist/paint-editor/controller.d.cts +31 -1
- package/dist/paint-editor/controller.d.ts +31 -1
- package/dist/paint-editor/index.cjs +403 -195
- package/dist/paint-editor/index.js +231 -23
- package/dist/paint-editor/sticker-tools.d.cts +1 -1
- package/dist/paint-editor/sticker-tools.d.ts +1 -1
- package/dist/paint-editor/stickers.d.cts +10 -3
- package/dist/paint-editor/stickers.d.ts +10 -3
- package/dist/paint-editor/ui.d.cts +10 -3
- package/dist/paint-editor/ui.d.ts +10 -3
- package/dist/tokens/index.cjs +4 -3
- package/dist/tokens/index.js +3 -2
- package/dist/typography/index.cjs +8 -7
- package/dist/typography/index.js +3 -2
- package/dist/vector/index.cjs +967 -966
- package/dist/vector/index.js +9 -8
- package/dist/video-editor/index.cjs +7 -6
- package/dist/video-editor/index.js +6 -5
- package/package.json +1 -1
- package/skills/pixerate-color/SKILL.md +3 -0
- package/skills/pixerate-image-editor/SKILL.md +1 -0
- package/skills/pixerate-paint-editor/SKILL.md +6 -2
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkTHXFU3JBcjs = require('./chunk-THXFU3JB.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _chunkGF2RBSDMcjs = require('./chunk-GF2RBSDM.cjs');
|
|
@@ -1361,12 +1361,12 @@ var unit = (x, y) => {
|
|
|
1361
1361
|
return l > 1e-12 && Number.isFinite(l) ? [x / l, y / l] : null;
|
|
1362
1362
|
};
|
|
1363
1363
|
function cubicOf(sp, i) {
|
|
1364
|
-
const s =
|
|
1364
|
+
const s = _chunkTHXFU3JBcjs.subpathSegment.call(void 0, sp, i);
|
|
1365
1365
|
if (s.length === 4) return s;
|
|
1366
1366
|
const [a, b] = s;
|
|
1367
1367
|
return [a, [a[0] + (b[0] - a[0]) / 3, a[1] + (b[1] - a[1]) / 3], [a[0] + 2 * (b[0] - a[0]) / 3, a[1] + 2 * (b[1] - a[1]) / 3], b];
|
|
1368
1368
|
}
|
|
1369
|
-
var isLine = (sp, i) =>
|
|
1369
|
+
var isLine = (sp, i) => _chunkTHXFU3JBcjs.subpathSegment.call(void 0, sp, i).length === 2;
|
|
1370
1370
|
function startTangent(c) {
|
|
1371
1371
|
for (let k = 1; k < 4; k++) {
|
|
1372
1372
|
const u = unit(c[k][0] - c[0][0], c[k][1] - c[0][1]);
|
|
@@ -1386,10 +1386,10 @@ function sample(c, n, out, withStart) {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
var onAnchor = (a, h) => !h || Math.abs(h.x - a.x) < EPS && Math.abs(h.y - a.y) < EPS;
|
|
1388
1388
|
function tidy(a, keepType = true) {
|
|
1389
|
-
const next =
|
|
1389
|
+
const next = _chunkTHXFU3JBcjs.cloneAnchor.call(void 0, a);
|
|
1390
1390
|
if (onAnchor(next, next.in)) delete next.in;
|
|
1391
1391
|
if (onAnchor(next, next.out)) delete next.out;
|
|
1392
|
-
const shown =
|
|
1392
|
+
const shown = _chunkTHXFU3JBcjs.inferAnchorType.call(void 0, next);
|
|
1393
1393
|
const type = keepType && a.type ? a.type === "symmetric" && shown !== "symmetric" ? shown === "corner" ? "corner" : "smooth" : a.type === "smooth" && shown === "corner" ? "corner" : a.type : shown;
|
|
1394
1394
|
if (type === "corner") delete next.type;
|
|
1395
1395
|
else next.type = type;
|
|
@@ -1433,7 +1433,7 @@ function fitAcross(pts, N, t0, t1) {
|
|
|
1433
1433
|
return goldenMin(fit, 0, 1);
|
|
1434
1434
|
}
|
|
1435
1435
|
function removeAnchorKeepingShape(sp, index) {
|
|
1436
|
-
const anchors = sp.anchors.map(
|
|
1436
|
+
const anchors = sp.anchors.map(_chunkTHXFU3JBcjs.cloneAnchor);
|
|
1437
1437
|
const n = anchors.length;
|
|
1438
1438
|
if (index < 0 || index >= n) return { anchors, closed: sp.closed };
|
|
1439
1439
|
if ((sp.closed || index > 0 && index < n - 1) && n >= 3) {
|
|
@@ -1467,12 +1467,12 @@ function removeAnchorKeepingShape(sp, index) {
|
|
|
1467
1467
|
}
|
|
1468
1468
|
function removeAnchorsKeepingShape(sp, indices) {
|
|
1469
1469
|
const order = [...new Set(indices)].filter((i) => i >= 0 && i < sp.anchors.length).sort((a, b) => b - a);
|
|
1470
|
-
return order.reduce((acc, i) => removeAnchorKeepingShape(acc, i), { anchors: sp.anchors.map(
|
|
1470
|
+
return order.reduce((acc, i) => removeAnchorKeepingShape(acc, i), { anchors: sp.anchors.map(_chunkTHXFU3JBcjs.cloneAnchor), closed: sp.closed });
|
|
1471
1471
|
}
|
|
1472
1472
|
function bendSegment(sp, segment, t, p) {
|
|
1473
|
-
const anchors = sp.anchors.map(
|
|
1473
|
+
const anchors = sp.anchors.map(_chunkTHXFU3JBcjs.cloneAnchor);
|
|
1474
1474
|
const n = anchors.length;
|
|
1475
|
-
if (segment < 0 || segment >=
|
|
1475
|
+
if (segment < 0 || segment >= _chunkTHXFU3JBcjs.subpathSegmentCount.call(void 0, sp) || !Number.isFinite(t) || !Number.isFinite(p.x) || !Number.isFinite(p.y)) return { anchors, closed: sp.closed };
|
|
1476
1476
|
const tc = Math.min(0.95, Math.max(0.05, t));
|
|
1477
1477
|
const ia = segment;
|
|
1478
1478
|
const ib = (segment + 1) % n;
|
|
@@ -1483,16 +1483,16 @@ function bendSegment(sp, segment, t, p) {
|
|
|
1483
1483
|
const oy = (p.y - (a.y + (b.y - a.y) * tc)) / k;
|
|
1484
1484
|
const c1 = { x: a.x + (b.x - a.x) / 3 + ox, y: a.y + (b.y - a.y) / 3 + oy };
|
|
1485
1485
|
const c2 = { x: b.x + (a.x - b.x) / 3 + ox, y: b.y + (a.y - b.y) / 3 + oy };
|
|
1486
|
-
anchors[ia] =
|
|
1487
|
-
anchors[ib] =
|
|
1486
|
+
anchors[ia] = _chunkTHXFU3JBcjs.moveAnchorHandle.call(void 0, a, "out", c1);
|
|
1487
|
+
anchors[ib] = _chunkTHXFU3JBcjs.moveAnchorHandle.call(void 0, b, "in", c2);
|
|
1488
1488
|
return { anchors, closed: sp.closed };
|
|
1489
1489
|
}
|
|
1490
1490
|
function subpathPointAt(sp, segment, t) {
|
|
1491
|
-
const [x, y] = _chunkGF2RBSDMcjs.segmentPoint.call(void 0,
|
|
1491
|
+
const [x, y] = _chunkGF2RBSDMcjs.segmentPoint.call(void 0, _chunkTHXFU3JBcjs.subpathSegment.call(void 0, sp, segment), t);
|
|
1492
1492
|
return { x, y };
|
|
1493
1493
|
}
|
|
1494
1494
|
function curvatureMoveAnchor(sp, index, q) {
|
|
1495
|
-
const anchors = sp.anchors.map(
|
|
1495
|
+
const anchors = sp.anchors.map(_chunkTHXFU3JBcjs.cloneAnchor);
|
|
1496
1496
|
const a = sp.anchors[index];
|
|
1497
1497
|
if (!a) return { anchors, closed: sp.closed };
|
|
1498
1498
|
const own = [
|
|
@@ -1538,7 +1538,7 @@ function curvatureMoveAnchor(sp, index, q) {
|
|
|
1538
1538
|
function cutSubpathAt(sp, at) {
|
|
1539
1539
|
const n = sp.anchors.length;
|
|
1540
1540
|
const cuts = [...new Set(at)].filter((i) => Number.isInteger(i) && i >= 0 && i < n && (sp.closed || i > 0 && i < n - 1)).sort((a, b) => a - b);
|
|
1541
|
-
if (!cuts.length || n < 2) return [{ anchors: sp.anchors.map(
|
|
1541
|
+
if (!cuts.length || n < 2) return [{ anchors: sp.anchors.map(_chunkTHXFU3JBcjs.cloneAnchor), closed: sp.closed }];
|
|
1542
1542
|
const first = cuts[0];
|
|
1543
1543
|
const run = sp.closed ? Array.from({ length: n + 1 }, (_, i) => sp.anchors[(first + i) % n]) : sp.anchors;
|
|
1544
1544
|
const cutSet = new Set(sp.closed ? [...cuts.map((c) => (c - first + n) % n), n] : cuts);
|
|
@@ -1546,7 +1546,7 @@ function cutSubpathAt(sp, at) {
|
|
|
1546
1546
|
let cur = [];
|
|
1547
1547
|
run.forEach((a, i) => {
|
|
1548
1548
|
if (!cutSet.has(i)) {
|
|
1549
|
-
cur.push(
|
|
1549
|
+
cur.push(_chunkTHXFU3JBcjs.cloneAnchor.call(void 0, a));
|
|
1550
1550
|
return;
|
|
1551
1551
|
}
|
|
1552
1552
|
if (cur.length) {
|
|
@@ -1561,10 +1561,10 @@ function cutSubpathAt(sp, at) {
|
|
|
1561
1561
|
}
|
|
1562
1562
|
function splitSubpathAt(sp, segment, t, endTolerance = 1e-6) {
|
|
1563
1563
|
const n = sp.anchors.length;
|
|
1564
|
-
if (segment < 0 || segment >=
|
|
1564
|
+
if (segment < 0 || segment >= _chunkTHXFU3JBcjs.subpathSegmentCount.call(void 0, sp)) return [{ anchors: sp.anchors.map(_chunkTHXFU3JBcjs.cloneAnchor), closed: sp.closed }];
|
|
1565
1565
|
if (t <= endTolerance) return cutSubpathAt(sp, [segment]);
|
|
1566
1566
|
if (t >= 1 - endTolerance) return cutSubpathAt(sp, [(segment + 1) % n]);
|
|
1567
|
-
const { subpath, index } =
|
|
1567
|
+
const { subpath, index } = _chunkTHXFU3JBcjs.insertAnchor.call(void 0, sp, segment, t);
|
|
1568
1568
|
return cutSubpathAt(subpath, [index]);
|
|
1569
1569
|
}
|
|
1570
1570
|
var endOf = (sp, last) => sp.anchors[last ? sp.anchors.length - 1 : 0];
|
|
@@ -1587,7 +1587,7 @@ function joinSubpaths(subpaths, tolerance) {
|
|
|
1587
1587
|
const closed = [];
|
|
1588
1588
|
let open = [];
|
|
1589
1589
|
for (const sp of subpaths) {
|
|
1590
|
-
const copy = { anchors: sp.anchors.map(
|
|
1590
|
+
const copy = { anchors: sp.anchors.map(_chunkTHXFU3JBcjs.cloneAnchor), closed: sp.closed };
|
|
1591
1591
|
if (sp.closed || sp.anchors.length < 2) {
|
|
1592
1592
|
if (sp.anchors.length) closed.push(copy);
|
|
1593
1593
|
} else open.push(copy);
|
|
@@ -1642,7 +1642,7 @@ function smoothSubpath(sp, amount = 1, only) {
|
|
|
1642
1642
|
const t = Math.min(1, Math.max(0, amount));
|
|
1643
1643
|
const orig = sp.anchors;
|
|
1644
1644
|
const n = orig.length;
|
|
1645
|
-
const anchors = orig.map(
|
|
1645
|
+
const anchors = orig.map(_chunkTHXFU3JBcjs.cloneAnchor);
|
|
1646
1646
|
if (n < 3 || t === 0) return { anchors, closed: sp.closed };
|
|
1647
1647
|
for (let i = 0; i < n; i++) {
|
|
1648
1648
|
if (!sp.closed && (i === 0 || i === n - 1)) continue;
|
|
@@ -1671,8 +1671,8 @@ function smoothSubpath(sp, amount = 1, only) {
|
|
|
1671
1671
|
}
|
|
1672
1672
|
function segsOf(sp) {
|
|
1673
1673
|
const out = [];
|
|
1674
|
-
for (let i = 0; i <
|
|
1675
|
-
const s =
|
|
1674
|
+
for (let i = 0; i < _chunkTHXFU3JBcjs.subpathSegmentCount.call(void 0, sp); i++) {
|
|
1675
|
+
const s = _chunkTHXFU3JBcjs.subpathSegment.call(void 0, sp, i);
|
|
1676
1676
|
out.push(s.length === 2 ? { c: s, line: true } : { c: s, line: false });
|
|
1677
1677
|
}
|
|
1678
1678
|
return out;
|
|
@@ -1729,7 +1729,7 @@ function removeRedundantPoints(sp, tolerance) {
|
|
|
1729
1729
|
const tol = Math.max(tolerance, 1e-9);
|
|
1730
1730
|
const types = new Map(sp.anchors.filter((a) => a.type).map((a) => [`${a.x},${a.y}`, a.type]));
|
|
1731
1731
|
const segs = segsOf(sp).filter((s) => !isZeroSeg(s));
|
|
1732
|
-
if (!segs.length) return { anchors: sp.anchors.map(
|
|
1732
|
+
if (!segs.length) return { anchors: sp.anchors.map(_chunkTHXFU3JBcjs.cloneAnchor), closed: sp.closed };
|
|
1733
1733
|
const minSegs = sp.closed ? 2 : 1;
|
|
1734
1734
|
let changed = true;
|
|
1735
1735
|
while (changed && segs.length > minSegs) {
|
|
@@ -1747,7 +1747,7 @@ function removeRedundantPoints(sp, tolerance) {
|
|
|
1747
1747
|
break;
|
|
1748
1748
|
}
|
|
1749
1749
|
}
|
|
1750
|
-
return _nullishCoalesce(segsToSubpath(segs, sp.closed, types), () => ( { anchors: sp.anchors.map(
|
|
1750
|
+
return _nullishCoalesce(segsToSubpath(segs, sp.closed, types), () => ( { anchors: sp.anchors.map(_chunkTHXFU3JBcjs.cloneAnchor), closed: sp.closed }));
|
|
1751
1751
|
}
|
|
1752
1752
|
|
|
1753
1753
|
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
chartToMermaid,
|
|
6
6
|
describeChart,
|
|
7
7
|
layoutSparkline
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WGN7AUKB.js";
|
|
9
9
|
import {
|
|
10
10
|
layoutChart
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-N4DFDI73.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_CHART_THEME,
|
|
14
14
|
normalizeChartSpec
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QARCM66V.js";
|
|
16
16
|
import {
|
|
17
17
|
plainTextToSlice
|
|
18
18
|
} from "./chunk-2INPJDNY.js";
|