@pixerate/editor 0.269.2 → 0.271.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/dist/agent/index.cjs +30 -30
- package/dist/agent/index.js +3 -3
- package/dist/animation-editor/index.cjs +62 -62
- package/dist/animation-editor/index.js +4 -4
- package/dist/canvas/editorDocument.d.cts +3 -1
- package/dist/canvas/editorDocument.d.ts +3 -1
- package/dist/canvas/index.cjs +53 -27
- package/dist/canvas/index.js +34 -8
- package/dist/chart/index.cjs +21 -21
- package/dist/chart/index.js +2 -2
- package/dist/{chunk-GBEF2D4P.js → chunk-23YL2EAB.js} +1 -1
- package/dist/{chunk-QGVTOCNB.js → chunk-6ZSFRRJI.js} +1 -1
- package/dist/{chunk-4YSPQGZW.js → chunk-B5W677L7.js} +1 -1
- package/dist/{chunk-4NMPUJUK.cjs → chunk-DDL3ZBHK.cjs} +86 -86
- package/dist/{chunk-T4JPGBW3.cjs → chunk-DGITFN73.cjs} +8 -8
- package/dist/{chunk-PY4GWSE2.cjs → chunk-EBFPMSJO.cjs} +27 -5
- package/dist/{chunk-NS62CQ2B.js → chunk-GAZPHCTV.js} +23 -2
- package/dist/{chunk-YYBW6DF2.cjs → chunk-GSLOH2IN.cjs} +2 -2
- package/dist/{chunk-56RHCIJV.cjs → chunk-JJ2H25JG.cjs} +237 -170
- package/dist/{chunk-CBVNCWJM.cjs → chunk-LBDC5434.cjs} +2 -2
- package/dist/{chunk-BENSE3VX.cjs → chunk-M2ZVPU7L.cjs} +23 -23
- package/dist/{chunk-MQ6MGIQM.js → chunk-NMZQMPFZ.js} +1 -1
- package/dist/{chunk-AI4F33IV.cjs → chunk-NQUKTRKN.cjs} +45 -45
- package/dist/{chunk-4CPOKP27.js → chunk-QYXUE37Q.js} +1 -1
- package/dist/{chunk-MWUZCEFT.js → chunk-S2XPXA47.js} +1 -1
- package/dist/{chunk-EHLOCVWB.js → chunk-T2URHAJX.js} +27 -5
- package/dist/{chunk-FUDP5QBB.js → chunk-TNHDCP4R.js} +70 -3
- package/dist/{chunk-VBRHE4AM.cjs → chunk-U2ASNGO6.cjs} +35 -35
- package/dist/{chunk-WKPXOGZZ.cjs → chunk-WPLGZBNE.cjs} +23 -2
- package/dist/{chunk-N3UMQVKX.js → chunk-X4FTNFIA.js} +1 -1
- package/dist/{chunk-2OQGPEHH.cjs → chunk-XUDMRMXQ.cjs} +2 -2
- package/dist/{chunk-THBJHPUL.js → chunk-YNFSH72F.js} +1 -1
- package/dist/diagram/index.cjs +2 -2
- package/dist/diagram/index.js +1 -1
- package/dist/effects/index.cjs +8 -5
- package/dist/effects/index.js +6 -3
- package/dist/effects/pool.d.cts +9 -0
- package/dist/effects/pool.d.ts +9 -0
- package/dist/effects/types.d.cts +2 -0
- package/dist/effects/types.d.ts +2 -0
- package/dist/extensions/index.cjs +5 -5
- package/dist/extensions/index.js +4 -4
- package/dist/gradient/index.cjs +2 -2
- package/dist/gradient/index.js +1 -1
- package/dist/history/HistoryManager.d.cts +9 -0
- package/dist/history/HistoryManager.d.ts +9 -0
- package/dist/history/index.cjs +2 -2
- package/dist/history/index.js +1 -1
- package/dist/history/types.d.cts +5 -2
- package/dist/history/types.d.ts +5 -2
- package/dist/image-editor/index.cjs +784 -784
- package/dist/image-editor/index.js +4 -4
- package/dist/index.cjs +10 -10
- package/dist/index.js +4 -4
- package/dist/paint-editor/controller.d.cts +75 -4
- package/dist/paint-editor/controller.d.ts +75 -4
- package/dist/paint-editor/effect-paint.d.cts +33 -8
- package/dist/paint-editor/effect-paint.d.ts +33 -8
- package/dist/paint-editor/effects.d.cts +4 -0
- package/dist/paint-editor/effects.d.ts +4 -0
- package/dist/paint-editor/index.cjs +692 -398
- package/dist/paint-editor/index.js +362 -68
- package/dist/paint-editor/stroke.d.cts +13 -5
- package/dist/paint-editor/stroke.d.ts +13 -5
- package/dist/parameters/index.cjs +2 -2
- package/dist/parameters/index.js +1 -1
- package/dist/vector/index.cjs +998 -998
- package/dist/vector/index.js +4 -4
- package/dist/video-editor/index.cjs +321 -321
- package/dist/video-editor/index.js +4 -4
- package/package.json +1 -1
- package/skills/pixerate-paint-editor/SKILL.md +2 -2
- package/skills/pixerate-paint-editor/references/effect-paint.md +28 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkEBFPMSJOcjs = require('./chunk-EBFPMSJO.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -1369,7 +1369,7 @@ var VideoEffectsEngine = (_class2 = class {
|
|
|
1369
1369
|
this.slot = _nullishCoalesce(options.slot, () => ( new (0, _chunkL2JTLW6Bcjs.EffectsSlot)()));
|
|
1370
1370
|
this.maxEntries = _nullishCoalesce(options.maxEntries, () => ( 120));
|
|
1371
1371
|
this.toImage = _nullishCoalesce(options.toImage, () => ( defaultToImage));
|
|
1372
|
-
this.pool = new (0,
|
|
1372
|
+
this.pool = new (0, _chunkEBFPMSJOcjs.EffectRendererPool)({ maxRenderers: options.maxRenderers });
|
|
1373
1373
|
this.detach = this.slot.subscribe(() => {
|
|
1374
1374
|
this.reset();
|
|
1375
1375
|
this.notify();
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkJJ2H25JGcjs = require('./chunk-JJ2H25JG.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 = _chunkJJ2H25JGcjs.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) => _chunkJJ2H25JGcjs.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 = _chunkJJ2H25JGcjs.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 = _chunkJJ2H25JGcjs.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(_chunkJJ2H25JGcjs.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(_chunkJJ2H25JGcjs.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(_chunkJJ2H25JGcjs.cloneAnchor);
|
|
1474
1474
|
const n = anchors.length;
|
|
1475
|
-
if (segment < 0 || segment >=
|
|
1475
|
+
if (segment < 0 || segment >= _chunkJJ2H25JGcjs.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] = _chunkJJ2H25JGcjs.moveAnchorHandle.call(void 0, a, "out", c1);
|
|
1487
|
+
anchors[ib] = _chunkJJ2H25JGcjs.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, _chunkJJ2H25JGcjs.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(_chunkJJ2H25JGcjs.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(_chunkJJ2H25JGcjs.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(_chunkJJ2H25JGcjs.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 >= _chunkJJ2H25JGcjs.subpathSegmentCount.call(void 0, sp)) return [{ anchors: sp.anchors.map(_chunkJJ2H25JGcjs.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 } = _chunkJJ2H25JGcjs.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(_chunkJJ2H25JGcjs.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(_chunkJJ2H25JGcjs.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 < _chunkJJ2H25JGcjs.subpathSegmentCount.call(void 0, sp); i++) {
|
|
1675
|
+
const s = _chunkJJ2H25JGcjs.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(_chunkJJ2H25JGcjs.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(_chunkJJ2H25JGcjs.cloneAnchor), closed: sp.closed }));
|
|
1751
1751
|
}
|
|
1752
1752
|
|
|
1753
1753
|
|
|
@@ -35,7 +35,7 @@ var _chunkHMGWFXECcjs = require('./chunk-HMGWFXEC.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunkDGITFN73cjs = require('./chunk-DGITFN73.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
var _chunkP6WYDBTHcjs = require('./chunk-P6WYDBTH.cjs');
|
|
@@ -2013,9 +2013,9 @@ function insertImportedDocument(target, content, options = {}) {
|
|
|
2013
2013
|
if (!htmlSlice && from === to && !state.doc.resolve(from).parent.inlineContent) {
|
|
2014
2014
|
from = to = _state.Selection.near(state.doc.resolve(from)).from;
|
|
2015
2015
|
}
|
|
2016
|
-
if (htmlSlice &&
|
|
2016
|
+
if (htmlSlice && _chunkDGITFN73cjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkDGITFN73cjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
|
|
2017
2017
|
const tr2 = state.tr;
|
|
2018
|
-
const end2 =
|
|
2018
|
+
const end2 = _chunkDGITFN73cjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
|
|
2019
2019
|
if (end2 !== null) {
|
|
2020
2020
|
if (options.at === void 0) tr2.setSelection(_state.Selection.near(tr2.doc.resolve(end2), -1));
|
|
2021
2021
|
view.dispatch(tr2.scrollIntoView().setMeta("uiEvent", "drop"));
|
|
@@ -3847,7 +3847,7 @@ var RichClipboard = _core.Extension.create({
|
|
|
3847
3847
|
const slice = _chunk3AJMR7EGcjs.readRichClipboard.call(void 0, event, view.state.schema, mimeType);
|
|
3848
3848
|
if (!slice) return false;
|
|
3849
3849
|
event.preventDefault();
|
|
3850
|
-
if (
|
|
3850
|
+
if (_chunkDGITFN73cjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
|
|
3851
3851
|
view.dispatch(
|
|
3852
3852
|
view.state.tr.replaceSelection(slice).scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste")
|
|
3853
3853
|
);
|
|
@@ -4248,7 +4248,7 @@ function createOutlineStore(editor) {
|
|
|
4248
4248
|
if (!editor || editor.isDestroyed) return EMPTY_SNAPSHOT;
|
|
4249
4249
|
const headings = getOutline(editor);
|
|
4250
4250
|
const activeId = _nullishCoalesce(_optionalChain([getActiveHeading, 'call', _188 => _188(editor, headings), 'optionalAccess', _189 => _189.id]), () => ( null));
|
|
4251
|
-
const sameStructure =
|
|
4251
|
+
const sameStructure = _chunkDGITFN73cjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
|
|
4252
4252
|
if (sameStructure && snapshot.activeId === activeId) return snapshot;
|
|
4253
4253
|
return {
|
|
4254
4254
|
headings: sameStructure ? snapshot.headings : headings,
|
|
@@ -4296,7 +4296,7 @@ function navigateToHeading(editor, heading, options = {}) {
|
|
|
4296
4296
|
editor.view.dispatch(tr);
|
|
4297
4297
|
editor.view.focus();
|
|
4298
4298
|
}
|
|
4299
|
-
|
|
4299
|
+
_chunkDGITFN73cjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
|
|
4300
4300
|
return true;
|
|
4301
4301
|
}
|
|
4302
4302
|
function assignHeadingIds(state, types, generateId) {
|
|
@@ -4321,11 +4321,11 @@ function assignHeadingIds(state, types, generateId) {
|
|
|
4321
4321
|
}
|
|
4322
4322
|
var Outline = _core.Extension.create({
|
|
4323
4323
|
name: "outline",
|
|
4324
|
-
priority:
|
|
4324
|
+
priority: _chunkDGITFN73cjs.STRUCTURE_PRIORITY,
|
|
4325
4325
|
addOptions() {
|
|
4326
4326
|
return {
|
|
4327
4327
|
types: ["heading"],
|
|
4328
|
-
generateId: () =>
|
|
4328
|
+
generateId: () => _chunkDGITFN73cjs.generateStructureId.call(void 0, "h"),
|
|
4329
4329
|
onUpdate: void 0
|
|
4330
4330
|
};
|
|
4331
4331
|
},
|
|
@@ -4358,14 +4358,14 @@ var Outline = _core.Extension.create({
|
|
|
4358
4358
|
tr.scrollIntoView();
|
|
4359
4359
|
_optionalChain([view, 'optionalAccess', _196 => _196.focus, 'optionalCall', _197 => _197()]);
|
|
4360
4360
|
}
|
|
4361
|
-
|
|
4361
|
+
_chunkDGITFN73cjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
|
|
4362
4362
|
}
|
|
4363
4363
|
return true;
|
|
4364
4364
|
},
|
|
4365
4365
|
scrollToHeading: (id, options = {}) => ({ state, dispatch, view }) => {
|
|
4366
4366
|
const heading = findHeading(state, id);
|
|
4367
4367
|
if (!heading) return false;
|
|
4368
|
-
if (dispatch)
|
|
4368
|
+
if (dispatch) _chunkDGITFN73cjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
|
|
4369
4369
|
return true;
|
|
4370
4370
|
}
|
|
4371
4371
|
};
|
|
@@ -4386,7 +4386,7 @@ var Outline = _core.Extension.create({
|
|
|
4386
4386
|
apply: (tr, prev, _oldState, newState) => {
|
|
4387
4387
|
if (!tr.docChanged) return prev;
|
|
4388
4388
|
const next = computeOutline(newState.doc, types);
|
|
4389
|
-
if (
|
|
4389
|
+
if (_chunkDGITFN73cjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
|
|
4390
4390
|
storage.headings = next;
|
|
4391
4391
|
_optionalChain([onUpdate, 'call', _198 => _198(), 'optionalCall', _199 => _199(next)]);
|
|
4392
4392
|
return next;
|
|
@@ -4404,7 +4404,7 @@ var Outline = _core.Extension.create({
|
|
|
4404
4404
|
},
|
|
4405
4405
|
onBeforeCreate() {
|
|
4406
4406
|
const { types, generateId } = this.options;
|
|
4407
|
-
|
|
4407
|
+
_chunkDGITFN73cjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
|
|
4408
4408
|
}
|
|
4409
4409
|
});
|
|
4410
4410
|
|
|
@@ -4574,7 +4574,7 @@ function syncTableOfContents(state, headingTypes) {
|
|
|
4574
4574
|
node.attrs.minLevel,
|
|
4575
4575
|
node.attrs.maxLevel
|
|
4576
4576
|
);
|
|
4577
|
-
if (!
|
|
4577
|
+
if (!_chunkDGITFN73cjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
|
|
4578
4578
|
tr = _nullishCoalesce(tr, () => ( state.tr));
|
|
4579
4579
|
tr.setNodeMarkup(pos, void 0, { ...node.attrs, entries });
|
|
4580
4580
|
}
|
|
@@ -4586,7 +4586,7 @@ function syncTableOfContents(state, headingTypes) {
|
|
|
4586
4586
|
}
|
|
4587
4587
|
var TableOfContents = _core.Node.create({
|
|
4588
4588
|
name: "tableOfContents",
|
|
4589
|
-
priority:
|
|
4589
|
+
priority: _chunkDGITFN73cjs.STRUCTURE_PRIORITY - 5,
|
|
4590
4590
|
group: "block",
|
|
4591
4591
|
atom: true,
|
|
4592
4592
|
selectable: true,
|
|
@@ -4697,7 +4697,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4697
4697
|
return [
|
|
4698
4698
|
new (0, _state.Plugin)({
|
|
4699
4699
|
key: tableOfContentsPluginKey,
|
|
4700
|
-
state:
|
|
4700
|
+
state: _chunkDGITFN73cjs.presenceStateSpec.call(void 0, [this.name]),
|
|
4701
4701
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
4702
4702
|
if (!transactions.some((tr) => tr.docChanged)) return null;
|
|
4703
4703
|
if (!tableOfContentsPluginKey.getState(newState)) return null;
|
|
@@ -4721,7 +4721,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4721
4721
|
);
|
|
4722
4722
|
view.focus();
|
|
4723
4723
|
}
|
|
4724
|
-
|
|
4724
|
+
_chunkDGITFN73cjs.scrollDomAtPos.call(void 0, view, heading.pos);
|
|
4725
4725
|
return true;
|
|
4726
4726
|
}
|
|
4727
4727
|
}
|
|
@@ -4731,7 +4731,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4731
4731
|
},
|
|
4732
4732
|
onBeforeCreate() {
|
|
4733
4733
|
const { headingTypes } = this.options;
|
|
4734
|
-
|
|
4734
|
+
_chunkDGITFN73cjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
|
|
4735
4735
|
}
|
|
4736
4736
|
});
|
|
4737
4737
|
|
|
@@ -4789,7 +4789,7 @@ function syncFootnotes(tr, options = {}) {
|
|
|
4789
4789
|
const listType = schema.nodes[LIST];
|
|
4790
4790
|
const itemType = schema.nodes[ITEM];
|
|
4791
4791
|
if (!listType || !itemType) return false;
|
|
4792
|
-
const generateId = _nullishCoalesce(options.generateId, () => ( (() =>
|
|
4792
|
+
const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkDGITFN73cjs.generateStructureId.call(void 0, "fn"))));
|
|
4793
4793
|
const refs = [];
|
|
4794
4794
|
const lists = [];
|
|
4795
4795
|
const existing = /* @__PURE__ */ new Map();
|
|
@@ -4873,7 +4873,7 @@ function findReferences(doc, id) {
|
|
|
4873
4873
|
}
|
|
4874
4874
|
var FootnoteReference = _core.Node.create({
|
|
4875
4875
|
name: REFERENCE,
|
|
4876
|
-
priority:
|
|
4876
|
+
priority: _chunkDGITFN73cjs.STRUCTURE_PRIORITY - 5,
|
|
4877
4877
|
group: "inline",
|
|
4878
4878
|
inline: true,
|
|
4879
4879
|
atom: true,
|
|
@@ -4881,7 +4881,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4881
4881
|
addOptions() {
|
|
4882
4882
|
return {
|
|
4883
4883
|
HTMLAttributes: {},
|
|
4884
|
-
generateId: () =>
|
|
4884
|
+
generateId: () => _chunkDGITFN73cjs.generateStructureId.call(void 0, "fn")
|
|
4885
4885
|
};
|
|
4886
4886
|
},
|
|
4887
4887
|
addAttributes() {
|
|
@@ -4992,7 +4992,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4992
4992
|
_state.TextSelection.create(tr.doc, footnote.pos + footnote.node.nodeSize - 2)
|
|
4993
4993
|
);
|
|
4994
4994
|
tr.scrollIntoView();
|
|
4995
|
-
|
|
4995
|
+
_chunkDGITFN73cjs.scrollDomAtPos.call(void 0, view, footnote.pos);
|
|
4996
4996
|
}
|
|
4997
4997
|
return true;
|
|
4998
4998
|
},
|
|
@@ -5002,7 +5002,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
5002
5002
|
if (dispatch) {
|
|
5003
5003
|
tr.setSelection(_state.NodeSelection.create(tr.doc, ref.pos));
|
|
5004
5004
|
tr.scrollIntoView();
|
|
5005
|
-
|
|
5005
|
+
_chunkDGITFN73cjs.scrollDomAtPos.call(void 0, view, ref.pos);
|
|
5006
5006
|
}
|
|
5007
5007
|
return true;
|
|
5008
5008
|
}
|
|
@@ -5014,7 +5014,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
5014
5014
|
return [
|
|
5015
5015
|
new (0, _state.Plugin)({
|
|
5016
5016
|
key: footnotesPluginKey,
|
|
5017
|
-
state:
|
|
5017
|
+
state: _chunkDGITFN73cjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
|
|
5018
5018
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
5019
5019
|
if (!transactions.some((tr2) => tr2.docChanged)) return null;
|
|
5020
5020
|
if (!footnotesPluginKey.getState(newState)) return null;
|
|
@@ -5035,7 +5035,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
5035
5035
|
},
|
|
5036
5036
|
onBeforeCreate() {
|
|
5037
5037
|
const { generateId } = this.options;
|
|
5038
|
-
|
|
5038
|
+
_chunkDGITFN73cjs.syncInitialContent.call(void 0, this.editor, (state) => {
|
|
5039
5039
|
const tr = state.tr;
|
|
5040
5040
|
return syncFootnotes(tr, { generateId }) ? tr : null;
|
|
5041
5041
|
});
|
|
@@ -5175,7 +5175,7 @@ var Bookmark = _core.Mark.create({
|
|
|
5175
5175
|
addOptions() {
|
|
5176
5176
|
return {
|
|
5177
5177
|
HTMLAttributes: {},
|
|
5178
|
-
generateId: () =>
|
|
5178
|
+
generateId: () => _chunkDGITFN73cjs.generateStructureId.call(void 0, "bm")
|
|
5179
5179
|
};
|
|
5180
5180
|
},
|
|
5181
5181
|
addAttributes() {
|
|
@@ -5260,7 +5260,7 @@ var Bookmark = _core.Mark.create({
|
|
|
5260
5260
|
tr.setSelection(_state.TextSelection.create(tr.doc, bookmark.from, bookmark.to));
|
|
5261
5261
|
tr.scrollIntoView();
|
|
5262
5262
|
const domPos = state.doc.resolve(bookmark.from);
|
|
5263
|
-
|
|
5263
|
+
_chunkDGITFN73cjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
|
|
5264
5264
|
}
|
|
5265
5265
|
return true;
|
|
5266
5266
|
}
|
|
@@ -5325,7 +5325,7 @@ function syncCrossReferences(state, headingTypes) {
|
|
|
5325
5325
|
}
|
|
5326
5326
|
var CrossReference = _core.Node.create({
|
|
5327
5327
|
name: NAME,
|
|
5328
|
-
priority:
|
|
5328
|
+
priority: _chunkDGITFN73cjs.STRUCTURE_PRIORITY - 5,
|
|
5329
5329
|
group: "inline",
|
|
5330
5330
|
inline: true,
|
|
5331
5331
|
atom: true,
|
|
@@ -5427,7 +5427,7 @@ var CrossReference = _core.Node.create({
|
|
|
5427
5427
|
if (dispatch) {
|
|
5428
5428
|
tr.setSelection(_state.TextSelection.create(tr.doc, range.from, range.to));
|
|
5429
5429
|
tr.scrollIntoView();
|
|
5430
|
-
|
|
5430
|
+
_chunkDGITFN73cjs.scrollDomAtPos.call(void 0, view, range.blockPos);
|
|
5431
5431
|
}
|
|
5432
5432
|
return true;
|
|
5433
5433
|
}
|
|
@@ -5439,7 +5439,7 @@ var CrossReference = _core.Node.create({
|
|
|
5439
5439
|
return [
|
|
5440
5440
|
new (0, _state.Plugin)({
|
|
5441
5441
|
key: crossReferencePluginKey,
|
|
5442
|
-
state:
|
|
5442
|
+
state: _chunkDGITFN73cjs.presenceStateSpec.call(void 0, [NAME]),
|
|
5443
5443
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
5444
5444
|
if (!transactions.some((tr) => tr.docChanged)) return null;
|
|
5445
5445
|
if (!crossReferencePluginKey.getState(newState)) return null;
|
|
@@ -5458,7 +5458,7 @@ var CrossReference = _core.Node.create({
|
|
|
5458
5458
|
},
|
|
5459
5459
|
onBeforeCreate() {
|
|
5460
5460
|
const { headingTypes } = this.options;
|
|
5461
|
-
|
|
5461
|
+
_chunkDGITFN73cjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
|
|
5462
5462
|
}
|
|
5463
5463
|
});
|
|
5464
5464
|
|
|
@@ -5713,7 +5713,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5713
5713
|
if (!s || !s.active || s.currentIndex < 0 || !s.matches[s.currentIndex]) return false;
|
|
5714
5714
|
if (dispatch) {
|
|
5715
5715
|
_history.closeHistory.call(void 0, tr);
|
|
5716
|
-
const [end] =
|
|
5716
|
+
const [end] = _chunkDGITFN73cjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
|
|
5717
5717
|
tr.setSelection(_state.TextSelection.create(tr.doc, end)).scrollIntoView();
|
|
5718
5718
|
meta(tr, { type: "replaced", anchor: end, count: 1 });
|
|
5719
5719
|
}
|
|
@@ -5724,7 +5724,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5724
5724
|
if (!s || !s.active || !s.matches.length) return false;
|
|
5725
5725
|
if (dispatch) {
|
|
5726
5726
|
_history.closeHistory.call(void 0, tr);
|
|
5727
|
-
const ends =
|
|
5727
|
+
const ends = _chunkDGITFN73cjs.applyReplacements.call(void 0, tr, s.matches);
|
|
5728
5728
|
meta(tr, { type: "replaced", anchor: ends[ends.length - 1], count: s.matches.length });
|
|
5729
5729
|
}
|
|
5730
5730
|
return true;
|
|
@@ -5756,7 +5756,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5756
5756
|
if (!s.active || !s.query) {
|
|
5757
5757
|
return { ...s, matches: [], currentIndex: -1, error: null, truncated: false };
|
|
5758
5758
|
}
|
|
5759
|
-
const result =
|
|
5759
|
+
const result = _chunkDGITFN73cjs.searchDocument.call(void 0, doc, s.query, s.options, {
|
|
5760
5760
|
replacement: s.replacement,
|
|
5761
5761
|
clipboardText: safeClipboard(options.getClipboardText),
|
|
5762
5762
|
timeLimitMs: options.timeLimitMs,
|
|
@@ -6343,7 +6343,7 @@ function createRichTextPreset(options = {}) {
|
|
|
6343
6343
|
})
|
|
6344
6344
|
];
|
|
6345
6345
|
if (options.table !== false) {
|
|
6346
|
-
extensions2.push(...
|
|
6346
|
+
extensions2.push(..._chunkDGITFN73cjs.createTableExtensions.call(void 0, optionObject(options.table)));
|
|
6347
6347
|
}
|
|
6348
6348
|
if (characterLimit) {
|
|
6349
6349
|
extensions2.push(
|
|
@@ -6400,7 +6400,7 @@ function createRichTextPreset(options = {}) {
|
|
|
6400
6400
|
}
|
|
6401
6401
|
if (options.comments) {
|
|
6402
6402
|
extensions2.push(
|
|
6403
|
-
typeof options.comments === "object" ?
|
|
6403
|
+
typeof options.comments === "object" ? _chunkDGITFN73cjs.Comments.configure(options.comments) : _chunkDGITFN73cjs.Comments
|
|
6404
6404
|
);
|
|
6405
6405
|
}
|
|
6406
6406
|
if (options.trackChanges) {
|
|
@@ -6450,8 +6450,8 @@ function createRichTextPreset(options = {}) {
|
|
|
6450
6450
|
}
|
|
6451
6451
|
if (options.chart) {
|
|
6452
6452
|
const { sparkline = true, ...chartOptions } = optionObject(options.chart);
|
|
6453
|
-
extensions2.push(
|
|
6454
|
-
if (sparkline) extensions2.push(
|
|
6453
|
+
extensions2.push(_chunkDGITFN73cjs.Chart.configure(chartOptions));
|
|
6454
|
+
if (sparkline) extensions2.push(_chunkDGITFN73cjs.Sparkline.configure(optionObject(sparkline)));
|
|
6455
6455
|
}
|
|
6456
6456
|
if (options.paragraphStyles) {
|
|
6457
6457
|
extensions2.push(ParagraphStyles.configure(optionObject(options.paragraphStyles)));
|
|
@@ -6592,7 +6592,7 @@ function createFindReplaceCommands(editor, options = {}) {
|
|
|
6592
6592
|
];
|
|
6593
6593
|
}
|
|
6594
6594
|
function validateFindPattern(query, options = {}) {
|
|
6595
|
-
const result =
|
|
6595
|
+
const result = _chunkDGITFN73cjs.compileFindPattern.call(void 0, query, options);
|
|
6596
6596
|
return result.ok ? null : result.error;
|
|
6597
6597
|
}
|
|
6598
6598
|
|
|
@@ -6601,8 +6601,8 @@ var PARAMS = {
|
|
|
6601
6601
|
insertTable: {
|
|
6602
6602
|
type: "object",
|
|
6603
6603
|
properties: {
|
|
6604
|
-
rows: { type: "integer", minimum: 1, maximum:
|
|
6605
|
-
cols: { type: "integer", minimum: 1, maximum:
|
|
6604
|
+
rows: { type: "integer", minimum: 1, maximum: _chunkDGITFN73cjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
|
|
6605
|
+
cols: { type: "integer", minimum: 1, maximum: _chunkDGITFN73cjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
|
|
6606
6606
|
withHeaderRow: { type: "boolean", description: "Make the first row a header row (default true)." }
|
|
6607
6607
|
},
|
|
6608
6608
|
additionalProperties: false
|
|
@@ -6633,7 +6633,7 @@ function createTableCommands(editor, options = {}) {
|
|
|
6633
6633
|
const group = _nullishCoalesce(options.group, () => ( "Table"));
|
|
6634
6634
|
const scope = options.scope ? { scope: options.scope } : {};
|
|
6635
6635
|
const focus = _nullishCoalesce(options.focus, () => ( true));
|
|
6636
|
-
return
|
|
6636
|
+
return _chunkDGITFN73cjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
|
|
6637
6637
|
const params = PARAMS[action];
|
|
6638
6638
|
return {
|
|
6639
6639
|
id: `${prefix}${action}`,
|
|
@@ -6643,13 +6643,13 @@ function createTableCommands(editor, options = {}) {
|
|
|
6643
6643
|
description,
|
|
6644
6644
|
...params ? { params } : {},
|
|
6645
6645
|
...scope,
|
|
6646
|
-
enabled: (_ctx, p) =>
|
|
6646
|
+
enabled: (_ctx, p) => _chunkDGITFN73cjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
|
|
6647
6647
|
run: (_ctx, p) => {
|
|
6648
|
-
if (!
|
|
6649
|
-
const reason =
|
|
6648
|
+
if (!_chunkDGITFN73cjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
|
|
6649
|
+
const reason = _chunkDGITFN73cjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
|
|
6650
6650
|
throw new Error(reason === true ? `${label} did not change the document.` : reason);
|
|
6651
6651
|
}
|
|
6652
|
-
const state =
|
|
6652
|
+
const state = _chunkDGITFN73cjs.getTableState.call(void 0, editor);
|
|
6653
6653
|
return {
|
|
6654
6654
|
done: true,
|
|
6655
6655
|
table: state.inTable ? { rows: state.rows, columns: state.columns, row: state.row, column: state.column } : null
|
|
@@ -9,6 +9,19 @@ var EffectRendererPool = class {
|
|
|
9
9
|
get size() {
|
|
10
10
|
return this.entries.size;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Renders `request` on the caller's stack when this size's renderer is warm, idle and has
|
|
14
|
+
* `renderSync`; otherwise `null`, and nothing is rendered (an asynchronous provider never pays for it).
|
|
15
|
+
*/
|
|
16
|
+
renderSync(provider, id, size, request) {
|
|
17
|
+
const depth = size.depth ?? 8;
|
|
18
|
+
const key = `${provider.id}:${id}@${size.width}x${size.height}x${depth}`;
|
|
19
|
+
const entry = this.entries.get(key);
|
|
20
|
+
if (!entry?.resolved?.renderSync || entry.busy > 0) return null;
|
|
21
|
+
this.entries.delete(key);
|
|
22
|
+
this.entries.set(key, entry);
|
|
23
|
+
return entry.resolved.renderSync(request);
|
|
24
|
+
}
|
|
12
25
|
/** Renders `request` with the provider's renderer for this effect, size and depth (made on first use). */
|
|
13
26
|
render(provider, id, size, request) {
|
|
14
27
|
const depth = size.depth ?? 8;
|
|
@@ -19,15 +32,24 @@ var EffectRendererPool = class {
|
|
|
19
32
|
this.entries.set(key, entry);
|
|
20
33
|
} else {
|
|
21
34
|
const renderer = Promise.resolve().then(() => provider.createRenderer(id, { width: size.width, height: size.height, depth }));
|
|
22
|
-
renderer.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
const created = { renderer, busy: 0, queue: Promise.resolve() };
|
|
36
|
+
renderer.then(
|
|
37
|
+
(r) => {
|
|
38
|
+
created.resolved = r;
|
|
39
|
+
},
|
|
40
|
+
() => {
|
|
41
|
+
if (this.entries.get(key)?.renderer === renderer) this.entries.delete(key);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
entry = created;
|
|
26
45
|
this.entries.set(key, entry);
|
|
27
46
|
this.evict();
|
|
28
47
|
}
|
|
29
48
|
const e = entry;
|
|
30
|
-
|
|
49
|
+
e.busy++;
|
|
50
|
+
const next = e.queue.then(() => e.renderer).then((r) => r.render(request)).finally(() => {
|
|
51
|
+
e.busy--;
|
|
52
|
+
});
|
|
31
53
|
e.queue = next.catch(() => void 0);
|
|
32
54
|
return next;
|
|
33
55
|
}
|