@pixerate/editor 0.236.0 → 0.238.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 +1 -1
- 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-PHYOZK3B.js → chunk-FQVVO5YA.js} +85 -8
- 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-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-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-WPWHT4Z6.cjs → chunk-UZU6DIZA.cjs} +221 -144
- 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 +13 -10
- package/dist/extensions/index.js +12 -9
- package/dist/extensions/loading-node.d.cts +45 -1
- package/dist/extensions/loading-node.d.ts +45 -1
- package/dist/gradient/index.cjs +29 -28
- package/dist/gradient/index.js +4 -3
- package/dist/image-editor/index.cjs +778 -777
- package/dist/image-editor/index.js +9 -8
- package/dist/index.cjs +19 -16
- package/dist/index.js +13 -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
|
@@ -7,7 +7,7 @@ var _chunkYN6JKAUEcjs = require('./chunk-YN6JKAUE.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkT7KQEMAEcjs = require('./chunk-T7KQEMAE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkHMGWFXECcjs = require('./chunk-HMGWFXEC.cjs');
|
|
@@ -35,10 +35,10 @@ var _chunkHMGWFXECcjs = require('./chunk-HMGWFXEC.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunkW7GRGGBHcjs = require('./chunk-W7GRGGBH.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
var
|
|
41
|
+
var _chunk3R5P3DVYcjs = require('./chunk-3R5P3DVY.cjs');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
@@ -411,12 +411,66 @@ var TemplateSuggestions = _core.Extension.create({
|
|
|
411
411
|
|
|
412
412
|
// src/extensions/loading-node.ts
|
|
413
413
|
|
|
414
|
+
var _model = require('@tiptap/pm/model');
|
|
415
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
416
|
+
function loadingSpinnerSpec() {
|
|
417
|
+
return [
|
|
418
|
+
`${SVG_NS} svg`,
|
|
419
|
+
{
|
|
420
|
+
width: "1em",
|
|
421
|
+
height: "1em",
|
|
422
|
+
viewBox: "0 0 24 24",
|
|
423
|
+
fill: "none",
|
|
424
|
+
"aria-hidden": "true",
|
|
425
|
+
focusable: "false",
|
|
426
|
+
"data-loading-indicator": ""
|
|
427
|
+
},
|
|
428
|
+
["circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", "stroke-width": "3", opacity: "0.25" }],
|
|
429
|
+
[
|
|
430
|
+
"path",
|
|
431
|
+
{ d: "M21 12a9 9 0 0 0-9-9", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round" },
|
|
432
|
+
[
|
|
433
|
+
"animateTransform",
|
|
434
|
+
{
|
|
435
|
+
attributeName: "transform",
|
|
436
|
+
type: "rotate",
|
|
437
|
+
from: "0 12 12",
|
|
438
|
+
to: "360 12 12",
|
|
439
|
+
dur: "0.8s",
|
|
440
|
+
repeatCount: "indefinite"
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
]
|
|
444
|
+
];
|
|
445
|
+
}
|
|
446
|
+
var viewState = (node, options) => ({
|
|
447
|
+
id: _nullishCoalesce(node.attrs.id, () => ( null)),
|
|
448
|
+
label: options.label
|
|
449
|
+
});
|
|
450
|
+
var placeholderAttributes = (options, HTMLAttributes) => _chunk34RQAGWIcjs.safeMergeAttributes.call(void 0,
|
|
451
|
+
{
|
|
452
|
+
"data-type": "loading",
|
|
453
|
+
role: "status",
|
|
454
|
+
"aria-label": options.label,
|
|
455
|
+
class: "inline-flex items-center px-1.5 py-0.5 text-xs text-muted-foreground"
|
|
456
|
+
},
|
|
457
|
+
options.HTMLAttributes,
|
|
458
|
+
HTMLAttributes
|
|
459
|
+
);
|
|
414
460
|
var LoadingNode = _core.Node.create({
|
|
415
461
|
name: "loadingNode",
|
|
416
462
|
group: "inline",
|
|
417
463
|
inline: true,
|
|
418
464
|
selectable: true,
|
|
419
465
|
atom: true,
|
|
466
|
+
addOptions() {
|
|
467
|
+
return {
|
|
468
|
+
label: "Loading\u2026",
|
|
469
|
+
HTMLAttributes: {},
|
|
470
|
+
renderIndicator: null,
|
|
471
|
+
nodeView: null
|
|
472
|
+
};
|
|
473
|
+
},
|
|
420
474
|
addAttributes() {
|
|
421
475
|
return {
|
|
422
476
|
id: {
|
|
@@ -439,12 +493,34 @@ var LoadingNode = _core.Node.create({
|
|
|
439
493
|
renderHTML({ HTMLAttributes }) {
|
|
440
494
|
return [
|
|
441
495
|
"span",
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
class: "inline-flex items-center px-1.5 py-0.5 text-xs text-muted-foreground animate-pulse"
|
|
445
|
-
}),
|
|
446
|
-
"\u23F3"
|
|
496
|
+
placeholderAttributes(this.options, HTMLAttributes),
|
|
497
|
+
(_nullishCoalesce(this.options.renderIndicator, () => ( loadingSpinnerSpec)))()
|
|
447
498
|
];
|
|
499
|
+
},
|
|
500
|
+
addNodeView() {
|
|
501
|
+
const options = this.options;
|
|
502
|
+
return ({ node, HTMLAttributes }) => {
|
|
503
|
+
const mount = options.nodeView;
|
|
504
|
+
const { dom } = _model.DOMSerializer.renderSpec(document, [
|
|
505
|
+
"span",
|
|
506
|
+
placeholderAttributes(options, HTMLAttributes),
|
|
507
|
+
...mount ? [] : [(_nullishCoalesce(options.renderIndicator, () => ( loadingSpinnerSpec)))()]
|
|
508
|
+
]);
|
|
509
|
+
const element = dom;
|
|
510
|
+
const renderer = _nullishCoalesce(_optionalChain([mount, 'optionalCall', _31 => _31(element, viewState(node, options))]), () => ( null));
|
|
511
|
+
return {
|
|
512
|
+
dom: element,
|
|
513
|
+
update: (next) => {
|
|
514
|
+
if (next.type !== node.type) return false;
|
|
515
|
+
if (next.attrs.id) element.setAttribute("data-id", String(next.attrs.id));
|
|
516
|
+
else element.removeAttribute("data-id");
|
|
517
|
+
_optionalChain([renderer, 'optionalAccess', _32 => _32.update, 'call', _33 => _33(viewState(next, options))]);
|
|
518
|
+
return true;
|
|
519
|
+
},
|
|
520
|
+
ignoreMutation: () => true,
|
|
521
|
+
destroy: () => _optionalChain([renderer, 'optionalAccess', _34 => _34.destroy, 'call', _35 => _35()])
|
|
522
|
+
};
|
|
523
|
+
};
|
|
448
524
|
}
|
|
449
525
|
});
|
|
450
526
|
|
|
@@ -614,11 +690,11 @@ var _extensioncharactercount = require('@tiptap/extension-character-count'); var
|
|
|
614
690
|
|
|
615
691
|
|
|
616
692
|
var _extensionmention = require('@tiptap/extension-mention');
|
|
617
|
-
var BaseMention = _extensionmention.Mention || _optionalChain([_extensionmention.Mention, 'optionalAccess',
|
|
693
|
+
var BaseMention = _extensionmention.Mention || _optionalChain([_extensionmention.Mention, 'optionalAccess', _36 => _36.default, 'optionalAccess', _37 => _37.default]) || _optionalChain([_extensionmention.Mention, 'optionalAccess', _38 => _38.default]) || _extensionmention.Mention;
|
|
618
694
|
var Mention = BaseMention.extend({
|
|
619
695
|
addAttributes() {
|
|
620
696
|
return {
|
|
621
|
-
..._optionalChain([this, 'access',
|
|
697
|
+
..._optionalChain([this, 'access', _39 => _39.parent, 'optionalCall', _40 => _40()]),
|
|
622
698
|
type: {
|
|
623
699
|
default: null,
|
|
624
700
|
parseHTML: (element) => element.getAttribute("data-type-name") || element.getAttribute("data-entity-type"),
|
|
@@ -664,7 +740,7 @@ var MENTION_ROLE_PATTERN = /^[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9])?$/;
|
|
|
664
740
|
function getMentionNodes(editor) {
|
|
665
741
|
const result = [];
|
|
666
742
|
editor.state.doc.descendants((node, pos) => {
|
|
667
|
-
if (_optionalChain([node, 'access',
|
|
743
|
+
if (_optionalChain([node, 'access', _41 => _41.type, 'optionalAccess', _42 => _42.name]) !== "mention") return;
|
|
668
744
|
result.push({
|
|
669
745
|
pos,
|
|
670
746
|
id: _nullishCoalesce(node.attrs.id, () => ( "")),
|
|
@@ -676,7 +752,7 @@ function getMentionNodes(editor) {
|
|
|
676
752
|
return result;
|
|
677
753
|
}
|
|
678
754
|
function setMentionRoleAt(editor, pos, role) {
|
|
679
|
-
const node = _optionalChain([editor, 'optionalAccess',
|
|
755
|
+
const node = _optionalChain([editor, 'optionalAccess', _43 => _43.state, 'optionalAccess', _44 => _44.doc, 'optionalAccess', _45 => _45.nodeAt, 'call', _46 => _46(pos)]);
|
|
680
756
|
if (!node || node.type.name !== "mention") return false;
|
|
681
757
|
if (role !== null && !MENTION_ROLE_PATTERN.test(role)) return false;
|
|
682
758
|
const tr = editor.state.tr.setNodeMarkup(pos, void 0, { ...node.attrs, assetRole: role });
|
|
@@ -698,7 +774,7 @@ function createMentionExtension(options = {}) {
|
|
|
698
774
|
|
|
699
775
|
var _prosemirrormarkdown = require('prosemirror-markdown');
|
|
700
776
|
var _markdownit = require('markdown-it'); var _markdownit2 = _interopRequireDefault(_markdownit);
|
|
701
|
-
|
|
777
|
+
|
|
702
778
|
var _markdownittasklists = require('markdown-it-task-lists'); var _markdownittasklists2 = _interopRequireDefault(_markdownittasklists);
|
|
703
779
|
|
|
704
780
|
var __defProp = Object.defineProperty;
|
|
@@ -1704,13 +1780,13 @@ var Markdown = _core.Extension.create({
|
|
|
1704
1780
|
});
|
|
1705
1781
|
|
|
1706
1782
|
// src/extensions/markdown.ts
|
|
1707
|
-
var resolveExt = (mod, name) => _optionalChain([mod, 'optionalAccess',
|
|
1783
|
+
var resolveExt = (mod, name) => _optionalChain([mod, 'optionalAccess', _47 => _47[name]]) || _optionalChain([mod, 'optionalAccess', _48 => _48.default, 'optionalAccess', _49 => _49[name]]) || _optionalChain([mod, 'optionalAccess', _50 => _50.default, 'optionalAccess', _51 => _51.default]) || _optionalChain([mod, 'optionalAccess', _52 => _52.default]) || mod;
|
|
1708
1784
|
var Markdown2 = resolveExt(Markdown, "Markdown");
|
|
1709
1785
|
|
|
1710
1786
|
// src/extensions/image.ts
|
|
1711
1787
|
var _extensionimage = require('@tiptap/extension-image'); var _Image = _interopRequireWildcard(_extensionimage);
|
|
1712
1788
|
|
|
1713
|
-
var resolveExt2 = (mod, name) => _optionalChain([mod, 'optionalAccess',
|
|
1789
|
+
var resolveExt2 = (mod, name) => _optionalChain([mod, 'optionalAccess', _53 => _53[name]]) || _optionalChain([mod, 'optionalAccess', _54 => _54.default, 'optionalAccess', _55 => _55[name]]) || _optionalChain([mod, 'optionalAccess', _56 => _56.default, 'optionalAccess', _57 => _57.default]) || _optionalChain([mod, 'optionalAccess', _58 => _58.default]) || mod;
|
|
1714
1790
|
var BaseImage = resolveExt2(_Image, "Image");
|
|
1715
1791
|
var imagePastePluginKey = new (0, _state.PluginKey)("imagePasteHandler");
|
|
1716
1792
|
function insertImageNode(view, src, alt) {
|
|
@@ -1817,7 +1893,7 @@ function handleImageInsertion(view, file, options) {
|
|
|
1817
1893
|
var Image2 = BaseImage.extend({
|
|
1818
1894
|
addOptions() {
|
|
1819
1895
|
return {
|
|
1820
|
-
..._optionalChain([this, 'access',
|
|
1896
|
+
..._optionalChain([this, 'access', _59 => _59.parent, 'optionalCall', _60 => _60()]),
|
|
1821
1897
|
allowBase64: true,
|
|
1822
1898
|
maxBase64Size: 65536,
|
|
1823
1899
|
enablePaste: true,
|
|
@@ -1830,7 +1906,7 @@ var Image2 = BaseImage.extend({
|
|
|
1830
1906
|
};
|
|
1831
1907
|
},
|
|
1832
1908
|
addProseMirrorPlugins() {
|
|
1833
|
-
const parentPlugins = _optionalChain([this, 'access',
|
|
1909
|
+
const parentPlugins = _optionalChain([this, 'access', _61 => _61.parent, 'optionalCall', _62 => _62()]) || [];
|
|
1834
1910
|
const options = this.options;
|
|
1835
1911
|
if (!options.enablePaste && !options.enableDrop) {
|
|
1836
1912
|
return parentPlugins;
|
|
@@ -1840,7 +1916,7 @@ var Image2 = BaseImage.extend({
|
|
|
1840
1916
|
props: {
|
|
1841
1917
|
handlePaste(view, event) {
|
|
1842
1918
|
if (!options.enablePaste) return false;
|
|
1843
|
-
const items = Array.from(_optionalChain([event, 'access',
|
|
1919
|
+
const items = Array.from(_optionalChain([event, 'access', _63 => _63.clipboardData, 'optionalAccess', _64 => _64.items]) || []);
|
|
1844
1920
|
const imageItems = items.filter(
|
|
1845
1921
|
(item) => item.kind === "file" && item.type.startsWith("image/")
|
|
1846
1922
|
);
|
|
@@ -1855,7 +1931,7 @@ var Image2 = BaseImage.extend({
|
|
|
1855
1931
|
},
|
|
1856
1932
|
handleDrop(view, event) {
|
|
1857
1933
|
if (!options.enableDrop) return false;
|
|
1858
|
-
const files = Array.from(_optionalChain([event, 'access',
|
|
1934
|
+
const files = Array.from(_optionalChain([event, 'access', _65 => _65.dataTransfer, 'optionalAccess', _66 => _66.files]) || []);
|
|
1859
1935
|
const imageFiles = files.filter((f) => f.type.startsWith("image/"));
|
|
1860
1936
|
if (imageFiles.length === 0) return false;
|
|
1861
1937
|
event.preventDefault();
|
|
@@ -1873,7 +1949,7 @@ var Image2 = BaseImage.extend({
|
|
|
1873
1949
|
// src/extensions/document-compare.ts
|
|
1874
1950
|
|
|
1875
1951
|
function trackChangesAuthor(state) {
|
|
1876
|
-
return _optionalChain([_chunk34RQAGWIcjs.trackChangesPluginKey, 'access',
|
|
1952
|
+
return _optionalChain([_chunk34RQAGWIcjs.trackChangesPluginKey, 'access', _67 => _67.getState, 'call', _68 => _68(state), 'optionalAccess', _69 => _69.author]);
|
|
1877
1953
|
}
|
|
1878
1954
|
function compareInEditor(editor, original, revised, options = {}) {
|
|
1879
1955
|
return _chunkHMGWFXECcjs.compareDocuments.call(void 0, original, revised, {
|
|
@@ -2007,7 +2083,7 @@ var ImportAdapterRegistry = (_class = class {constructor() { _class.prototype.__
|
|
|
2007
2083
|
* wildcards, then higher `priority`, then the most recently registered.
|
|
2008
2084
|
*/
|
|
2009
2085
|
find(query) {
|
|
2010
|
-
const fileName = _nullishCoalesce(_optionalChain([query, 'access',
|
|
2086
|
+
const fileName = _nullishCoalesce(_optionalChain([query, 'access', _70 => _70.fileName, 'optionalAccess', _71 => _71.toLowerCase, 'call', _72 => _72()]), () => ( ""));
|
|
2011
2087
|
const mime = normalizeMimeType(query.mimeType);
|
|
2012
2088
|
let best;
|
|
2013
2089
|
let bestScore = 0;
|
|
@@ -2088,7 +2164,7 @@ var ImportAdapterRegistry = (_class = class {constructor() { _class.prototype.__
|
|
|
2088
2164
|
mimeType,
|
|
2089
2165
|
target: adapter.target,
|
|
2090
2166
|
registry: this,
|
|
2091
|
-
options: _optionalChain([options, 'access',
|
|
2167
|
+
options: _optionalChain([options, 'access', _73 => _73.adapterOptions, 'optionalAccess', _74 => _74[adapter.id]])
|
|
2092
2168
|
});
|
|
2093
2169
|
try {
|
|
2094
2170
|
const result = await adapter.import(input, context);
|
|
@@ -2158,7 +2234,7 @@ function descendants(el, localName) {
|
|
|
2158
2234
|
}
|
|
2159
2235
|
function toggle(el) {
|
|
2160
2236
|
if (!el) return void 0;
|
|
2161
|
-
const value = _optionalChain([attr, 'call',
|
|
2237
|
+
const value = _optionalChain([attr, 'call', _75 => _75(el, "val"), 'optionalAccess', _76 => _76.toLowerCase, 'call', _77 => _77()]);
|
|
2162
2238
|
return value === void 0 || !["0", "false", "off", "none"].includes(value);
|
|
2163
2239
|
}
|
|
2164
2240
|
function parseXml(Parser, xml, partName) {
|
|
@@ -2199,7 +2275,7 @@ async function readRelationships(zip, Parser, partPath) {
|
|
|
2199
2275
|
const id = attr(rel, "Id");
|
|
2200
2276
|
const target = _nullishCoalesce(attr(rel, "Target"), () => ( ""));
|
|
2201
2277
|
if (!id) return;
|
|
2202
|
-
const external = _optionalChain([attr, 'call',
|
|
2278
|
+
const external = _optionalChain([attr, 'call', _78 => _78(rel, "TargetMode"), 'optionalAccess', _79 => _79.toLowerCase, 'call', _80 => _80()]) === "external";
|
|
2203
2279
|
rels.set(id, {
|
|
2204
2280
|
type: _nullishCoalesce(attr(rel, "Type"), () => ( "")),
|
|
2205
2281
|
target: external ? target : resolvePartPath(baseDir, target),
|
|
@@ -2220,13 +2296,13 @@ async function loadCharts(zip, Parser, root, rels, options) {
|
|
|
2220
2296
|
const charts = /* @__PURE__ */ new Map();
|
|
2221
2297
|
if (options.charts === false) return charts;
|
|
2222
2298
|
for (const el of descendants(root, "chart")) {
|
|
2223
|
-
if (el.namespaceURI !==
|
|
2299
|
+
if (el.namespaceURI !== _chunkT7KQEMAEcjs.CHART_OOXML_NS) continue;
|
|
2224
2300
|
const id = attr(el, "id");
|
|
2225
2301
|
const rel = id ? rels.get(id) : void 0;
|
|
2226
2302
|
if (!id || !rel || rel.external || charts.has(id)) continue;
|
|
2227
2303
|
const entry = zip.get(rel.target);
|
|
2228
2304
|
if (!entry) continue;
|
|
2229
|
-
const read =
|
|
2305
|
+
const read = _chunkT7KQEMAEcjs.chartFromOoxml.call(void 0, await zip.readText(entry), { DOMParser: Parser });
|
|
2230
2306
|
charts.set(id, {
|
|
2231
2307
|
id: `chart-${charts.size + 1}`,
|
|
2232
2308
|
path: rel.target,
|
|
@@ -2240,7 +2316,7 @@ async function loadCharts(zip, Parser, root, rels, options) {
|
|
|
2240
2316
|
return charts;
|
|
2241
2317
|
}
|
|
2242
2318
|
function chartBlockHtml(chart) {
|
|
2243
|
-
const [head, ...rows] =
|
|
2319
|
+
const [head, ...rows] = _chunk3R5P3DVYcjs.chartDataToTable.call(void 0, chart.spec);
|
|
2244
2320
|
const cell = (v, tag) => `<${tag}><p>${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, v === null || v === void 0 ? "" : String(v))}</p></${tag}>`;
|
|
2245
2321
|
const table = `<table><tbody><tr>${head.map((h) => cell(h, "th")).join("")}</tr>${rows.map((r) => `<tr>${r.map((v, i) => cell(v, i ? "td" : "th")).join("")}</tr>`).join("")}</tbody></table>`;
|
|
2246
2322
|
const caption = `<p>${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, `[Chart: ${chart.title || "untitled"}]`)}</p>`;
|
|
@@ -2262,7 +2338,7 @@ async function loadImages(zip, root, rels, options) {
|
|
|
2262
2338
|
for (const id of ids) {
|
|
2263
2339
|
const rel = rels.get(id);
|
|
2264
2340
|
if (!rel || rel.external) continue;
|
|
2265
|
-
const mime = IMAGE_MIME_TYPES[_nullishCoalesce(_optionalChain([rel, 'access',
|
|
2341
|
+
const mime = IMAGE_MIME_TYPES[_nullishCoalesce(_optionalChain([rel, 'access', _81 => _81.target, 'access', _82 => _82.split, 'call', _83 => _83("."), 'access', _84 => _84.pop, 'call', _85 => _85(), 'optionalAccess', _86 => _86.toLowerCase, 'call', _87 => _87()]), () => ( ""))];
|
|
2266
2342
|
const entry = zip.get(rel.target);
|
|
2267
2343
|
if (!mime || !entry || entry.size > maxSize) continue;
|
|
2268
2344
|
images.set(id, `data:${mime};base64,${toBase64(await zip.read(entry))}`);
|
|
@@ -2401,7 +2477,7 @@ function mapStyleIds(styles) {
|
|
|
2401
2477
|
});
|
|
2402
2478
|
return ids;
|
|
2403
2479
|
}
|
|
2404
|
-
var styleKind = (style) => _optionalChain([style, 'optionalAccess',
|
|
2480
|
+
var styleKind = (style) => _optionalChain([style, 'optionalAccess', _88 => _88.type]) === "character" ? "character" : "paragraph";
|
|
2405
2481
|
function styleDefinitions(styles, ids) {
|
|
2406
2482
|
const out = [];
|
|
2407
2483
|
styles.forEach((style, fileId) => {
|
|
@@ -2727,9 +2803,9 @@ function parseHyperlinkInstruction(instr) {
|
|
|
2727
2803
|
const match = /^\s*HYPERLINK\b(.*)$/i.exec(instr);
|
|
2728
2804
|
if (!match) return void 0;
|
|
2729
2805
|
const rest = match[1];
|
|
2730
|
-
const anchor = _optionalChain([/\\l\s+"([^"]*)"/, 'access',
|
|
2806
|
+
const anchor = _optionalChain([/\\l\s+"([^"]*)"/, 'access', _89 => _89.exec, 'call', _90 => _90(rest), 'optionalAccess', _91 => _91[1]]);
|
|
2731
2807
|
const target = /^\s*(?:"([^"]*)"|([^\s\\]+))/.exec(rest);
|
|
2732
|
-
const url = _nullishCoalesce(_optionalChain([target, 'optionalAccess',
|
|
2808
|
+
const url = _nullishCoalesce(_optionalChain([target, 'optionalAccess', _92 => _92[1]]), () => ( _optionalChain([target, 'optionalAccess', _93 => _93[2]])));
|
|
2733
2809
|
if (url) return anchor ? `${url}#${anchor}` : url;
|
|
2734
2810
|
return anchor ? `#${anchor}` : void 0;
|
|
2735
2811
|
}
|
|
@@ -2764,7 +2840,7 @@ var ParagraphRenderer = (_class2 = class {
|
|
|
2764
2840
|
else {
|
|
2765
2841
|
this.segments.shift();
|
|
2766
2842
|
const next = this.segments[0];
|
|
2767
|
-
if (_optionalChain([next, 'optionalAccess',
|
|
2843
|
+
if (_optionalChain([next, 'optionalAccess', _94 => _94.kind]) === "text") {
|
|
2768
2844
|
next.text = next.text.replace(/^ /, "");
|
|
2769
2845
|
if (!next.text) this.segments.shift();
|
|
2770
2846
|
}
|
|
@@ -2862,7 +2938,7 @@ var ParagraphRenderer = (_class2 = class {
|
|
|
2862
2938
|
run(r, base) {
|
|
2863
2939
|
const rPr = wChild(r, "rPr");
|
|
2864
2940
|
const runStyle = this.ctx.styles.get(_nullishCoalesce(attr(wChild(rPr, "rStyle"), "val"), () => ( "")));
|
|
2865
|
-
const styleFormat = base.href && runStyle && /^hyperlink$/i.test(runStyle.name) ? {} : _nullishCoalesce(_optionalChain([runStyle, 'optionalAccess',
|
|
2941
|
+
const styleFormat = base.href && runStyle && /^hyperlink$/i.test(runStyle.name) ? {} : _nullishCoalesce(_optionalChain([runStyle, 'optionalAccess', _95 => _95.format]), () => ( {}));
|
|
2866
2942
|
const own = readFormat(rPr);
|
|
2867
2943
|
const format = { ...base, ...styleFormat, ...own };
|
|
2868
2944
|
const rPrChange = wChild(rPr, "rPrChange");
|
|
@@ -2893,7 +2969,7 @@ var ParagraphRenderer = (_class2 = class {
|
|
|
2893
2969
|
};
|
|
2894
2970
|
if (child.localName === "AlternateContent") {
|
|
2895
2971
|
const branch = childElements(child).find(
|
|
2896
|
-
(b) => descendants(b, "blip").length || descendants(b, "imagedata").length || descendants(b, "chart").some((el) => el.namespaceURI ===
|
|
2972
|
+
(b) => descendants(b, "blip").length || descendants(b, "imagedata").length || descendants(b, "chart").some((el) => el.namespaceURI === _chunkT7KQEMAEcjs.CHART_OOXML_NS)
|
|
2897
2973
|
);
|
|
2898
2974
|
if (branch) this.image(branch, format, push);
|
|
2899
2975
|
return;
|
|
@@ -2960,7 +3036,7 @@ var ParagraphRenderer = (_class2 = class {
|
|
|
2960
3036
|
/** Charts this paragraph contains, in order. */
|
|
2961
3037
|
__init4() {this.charts = []}
|
|
2962
3038
|
image(container, format, push) {
|
|
2963
|
-
const chartRef = descendants(container, "chart").find((el) => el.namespaceURI ===
|
|
3039
|
+
const chartRef = descendants(container, "chart").find((el) => el.namespaceURI === _chunkT7KQEMAEcjs.CHART_OOXML_NS);
|
|
2964
3040
|
const chart = chartRef ? this.part.charts.get(_nullishCoalesce(attr(chartRef, "id"), () => ( ""))) : void 0;
|
|
2965
3041
|
if (chart) {
|
|
2966
3042
|
if (!this.ctx.charts.includes(chart)) this.ctx.charts.push(chart);
|
|
@@ -3029,15 +3105,15 @@ function paragraphInfo(p, ctx) {
|
|
|
3029
3105
|
heading = styleHeadingLevel(ctx.styles, styleId);
|
|
3030
3106
|
}
|
|
3031
3107
|
let numPr = readNumPr(pPr);
|
|
3032
|
-
if (!numPr) numPr = _optionalChain([styleChain, 'call',
|
|
3108
|
+
if (!numPr) numPr = _optionalChain([styleChain, 'call', _96 => _96(ctx.styles, styleId), 'access', _97 => _97.find, 'call', _98 => _98((style) => style.numPr), 'optionalAccess', _99 => _99.numPr]);
|
|
3033
3109
|
let list;
|
|
3034
3110
|
if (numPr && numPr.numId !== "0" && heading === void 0) {
|
|
3035
3111
|
const num = ctx.numbering.nums.get(numPr.numId);
|
|
3036
|
-
const def = num ? _optionalChain([ctx, 'access',
|
|
3112
|
+
const def = num ? _optionalChain([ctx, 'access', _100 => _100.numbering, 'access', _101 => _101.abstracts, 'access', _102 => _102.get, 'call', _103 => _103(num.abstractId), 'optionalAccess', _104 => _104.get, 'call', _105 => _105(numPr.ilvl)]) : void 0;
|
|
3037
3113
|
list = {
|
|
3038
3114
|
level: Math.max(0, Math.min(numPr.ilvl, 8)),
|
|
3039
|
-
ordered: _nullishCoalesce(_optionalChain([def, 'optionalAccess',
|
|
3040
|
-
start: _nullishCoalesce(_nullishCoalesce(_optionalChain([num, 'optionalAccess',
|
|
3115
|
+
ordered: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _106 => _106.ordered]), () => ( false)),
|
|
3116
|
+
start: _nullishCoalesce(_nullishCoalesce(_optionalChain([num, 'optionalAccess', _107 => _107.starts, 'access', _108 => _108.get, 'call', _109 => _109(numPr.ilvl)]), () => ( _optionalChain([def, 'optionalAccess', _110 => _110.start]))), () => ( 1))
|
|
3041
3117
|
};
|
|
3042
3118
|
}
|
|
3043
3119
|
const special = heading === void 0 && !list ? specialStyle(ctx.styles, styleId) : void 0;
|
|
@@ -3171,7 +3247,7 @@ function renderTable(tbl, ctx, part) {
|
|
|
3171
3247
|
if (cell.merge === "restart") {
|
|
3172
3248
|
for (let r = rowIndex + 1; r < rows.length; r++) {
|
|
3173
3249
|
const below = rows[r].find((c) => c.col === cell.col);
|
|
3174
|
-
if (_optionalChain([below, 'optionalAccess',
|
|
3250
|
+
if (_optionalChain([below, 'optionalAccess', _111 => _111.merge]) !== "continue") break;
|
|
3175
3251
|
rowspan++;
|
|
3176
3252
|
}
|
|
3177
3253
|
}
|
|
@@ -3184,7 +3260,7 @@ function renderTable(tbl, ctx, part) {
|
|
|
3184
3260
|
return `${html}</tbody></table>`;
|
|
3185
3261
|
}
|
|
3186
3262
|
function getDomParser(options) {
|
|
3187
|
-
const Parser = _nullishCoalesce(_nullishCoalesce(options.DOMParser, () => ( globalThis.DOMParser)), () => ( _optionalChain([globalThis, 'access',
|
|
3263
|
+
const Parser = _nullishCoalesce(_nullishCoalesce(options.DOMParser, () => ( globalThis.DOMParser)), () => ( _optionalChain([globalThis, 'access', _112 => _112.window, 'optionalAccess', _113 => _113.DOMParser])));
|
|
3188
3264
|
if (typeof Parser !== "function") {
|
|
3189
3265
|
throw new ImportError(
|
|
3190
3266
|
"unsupported_environment",
|
|
@@ -3199,7 +3275,7 @@ async function docxToDocumentImport(data, options = {}) {
|
|
|
3199
3275
|
try {
|
|
3200
3276
|
zip = await _chunkALNIFK5Gcjs.readZip.call(void 0, data, { maxTotalSize: 100 * 1024 * 1024, maxEntries: 5e3, ...options.zip });
|
|
3201
3277
|
} catch (error) {
|
|
3202
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
3278
|
+
if (_optionalChain([error, 'optionalAccess', _114 => _114.code]) === "invalid_archive") {
|
|
3203
3279
|
throw new ImportError("invalid_file", "Not a DOCX file (the file is not a ZIP package).", { cause: error });
|
|
3204
3280
|
}
|
|
3205
3281
|
throw error;
|
|
@@ -3219,7 +3295,7 @@ async function docxToDocumentImport(data, options = {}) {
|
|
|
3219
3295
|
throw new ImportError("invalid_file", "Not a Word document (no main document part with a body).");
|
|
3220
3296
|
}
|
|
3221
3297
|
const rels = await readRelationships(zip, Parser, mainPath);
|
|
3222
|
-
const partByType = (suffix) => _optionalChain([Array, 'access',
|
|
3298
|
+
const partByType = (suffix) => _optionalChain([Array, 'access', _115 => _115.from, 'call', _116 => _116(rels.values()), 'access', _117 => _117.find, 'call', _118 => _118((rel) => !rel.external && rel.type.endsWith(`/${suffix}`)), 'optionalAccess', _119 => _119.target]);
|
|
3223
3299
|
const baseDir = dirname(mainPath);
|
|
3224
3300
|
const stylesPath = _nullishCoalesce(partByType("styles"), () => ( `${baseDir}styles.xml`));
|
|
3225
3301
|
const numberingPath = _nullishCoalesce(partByType("numbering"), () => ( `${baseDir}numbering.xml`));
|
|
@@ -3384,7 +3460,7 @@ function getImportAccept(target) {
|
|
|
3384
3460
|
|
|
3385
3461
|
var toView = (target) => "state" in target && "dispatch" in target ? target : target.view;
|
|
3386
3462
|
function htmlToSlice(html, schema) {
|
|
3387
|
-
const Parser = _nullishCoalesce(globalThis.DOMParser, () => ( _optionalChain([globalThis, 'access',
|
|
3463
|
+
const Parser = _nullishCoalesce(globalThis.DOMParser, () => ( _optionalChain([globalThis, 'access', _120 => _120.window, 'optionalAccess', _121 => _121.DOMParser])));
|
|
3388
3464
|
if (!Parser) return null;
|
|
3389
3465
|
const body = new Parser().parseFromString(`<body>${html}</body>`, "text/html").body;
|
|
3390
3466
|
return new (0, _model.Slice)(_model.DOMParser.fromSchema(schema).parse(body).content, 0, 0);
|
|
@@ -3399,9 +3475,9 @@ function insertImportedDocument(target, content, options = {}) {
|
|
|
3399
3475
|
if (!htmlSlice && from === to && !state.doc.resolve(from).parent.inlineContent) {
|
|
3400
3476
|
from = to = _state.Selection.near(state.doc.resolve(from)).from;
|
|
3401
3477
|
}
|
|
3402
|
-
if (htmlSlice &&
|
|
3478
|
+
if (htmlSlice && _chunkW7GRGGBHcjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkW7GRGGBHcjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
|
|
3403
3479
|
const tr2 = state.tr;
|
|
3404
|
-
const end2 =
|
|
3480
|
+
const end2 = _chunkW7GRGGBHcjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
|
|
3405
3481
|
if (end2 !== null) {
|
|
3406
3482
|
if (options.at === void 0) tr2.setSelection(_state.Selection.near(tr2.doc.resolve(end2), -1));
|
|
3407
3483
|
view.dispatch(tr2.scrollIntoView().setMeta("uiEvent", "drop"));
|
|
@@ -3414,11 +3490,11 @@ function insertImportedDocument(target, content, options = {}) {
|
|
|
3414
3490
|
return end;
|
|
3415
3491
|
}
|
|
3416
3492
|
function applyImportedReviewData(editor, content) {
|
|
3417
|
-
const storage = _nullishCoalesce(_optionalChain([editor, 'optionalAccess',
|
|
3493
|
+
const storage = _nullishCoalesce(_optionalChain([editor, 'optionalAccess', _122 => _122.storage]), () => ( {}));
|
|
3418
3494
|
let comments = 0;
|
|
3419
3495
|
let styles = 0;
|
|
3420
|
-
const store = _optionalChain([storage, 'access',
|
|
3421
|
-
const threads = _nullishCoalesce(_optionalChain([content, 'access',
|
|
3496
|
+
const store = _optionalChain([storage, 'access', _123 => _123.comment, 'optionalAccess', _124 => _124.store]);
|
|
3497
|
+
const threads = _nullishCoalesce(_optionalChain([content, 'access', _125 => _125.comments, 'optionalAccess', _126 => _126.threads]), () => ( []));
|
|
3422
3498
|
if (store && threads.length) {
|
|
3423
3499
|
const existing = store.toJSON().threads;
|
|
3424
3500
|
const fresh = threads.filter((thread) => !existing.some((t) => t.id === thread.id));
|
|
@@ -3427,7 +3503,7 @@ function applyImportedReviewData(editor, content) {
|
|
|
3427
3503
|
comments = fresh.length;
|
|
3428
3504
|
}
|
|
3429
3505
|
}
|
|
3430
|
-
const registry = _optionalChain([storage, 'access',
|
|
3506
|
+
const registry = _optionalChain([storage, 'access', _127 => _127.paragraphStyles, 'optionalAccess', _128 => _128.registry]);
|
|
3431
3507
|
if (registry && content.styles) {
|
|
3432
3508
|
for (const style of content.styles.list()) {
|
|
3433
3509
|
if (registry.get(style.id)) continue;
|
|
@@ -3454,7 +3530,7 @@ async function importFilesIntoEditor(target, files, options = {}) {
|
|
|
3454
3530
|
applyImportedReviewData(target, outcome.result);
|
|
3455
3531
|
}
|
|
3456
3532
|
outcomes.push(outcome);
|
|
3457
|
-
_optionalChain([options, 'access',
|
|
3533
|
+
_optionalChain([options, 'access', _129 => _129.onImport, 'optionalCall', _130 => _130(outcome, file)]);
|
|
3458
3534
|
} catch (error) {
|
|
3459
3535
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
3460
3536
|
if (options.onError) options.onError(err, file);
|
|
@@ -3473,7 +3549,7 @@ function getImportableFiles(files, registry) {
|
|
|
3473
3549
|
}
|
|
3474
3550
|
function dropPosition(view, event) {
|
|
3475
3551
|
try {
|
|
3476
|
-
return _optionalChain([view, 'access',
|
|
3552
|
+
return _optionalChain([view, 'access', _131 => _131.posAtCoords, 'call', _132 => _132({ left: event.clientX, top: event.clientY }), 'optionalAccess', _133 => _133.pos]);
|
|
3477
3553
|
} catch (e2) {
|
|
3478
3554
|
return void 0;
|
|
3479
3555
|
}
|
|
@@ -3510,7 +3586,7 @@ var FileImport = _core.Extension.create({
|
|
|
3510
3586
|
props: {
|
|
3511
3587
|
handleDrop(view, event, _slice, moved) {
|
|
3512
3588
|
if (!options.enableDrop || moved) return false;
|
|
3513
|
-
const files = getImportableFiles(_optionalChain([event, 'access',
|
|
3589
|
+
const files = getImportableFiles(_optionalChain([event, 'access', _134 => _134.dataTransfer, 'optionalAccess', _135 => _135.files]), registry());
|
|
3514
3590
|
if (!files) return false;
|
|
3515
3591
|
event.preventDefault();
|
|
3516
3592
|
run(view, files, dropPosition(view, event));
|
|
@@ -3518,7 +3594,7 @@ var FileImport = _core.Extension.create({
|
|
|
3518
3594
|
},
|
|
3519
3595
|
handlePaste(view, event) {
|
|
3520
3596
|
if (!options.enablePaste) return false;
|
|
3521
|
-
const files = getImportableFiles(_optionalChain([event, 'access',
|
|
3597
|
+
const files = getImportableFiles(_optionalChain([event, 'access', _136 => _136.clipboardData, 'optionalAccess', _137 => _137.files]), registry());
|
|
3522
3598
|
if (!files) return false;
|
|
3523
3599
|
event.preventDefault();
|
|
3524
3600
|
run(view, files);
|
|
@@ -3542,7 +3618,7 @@ function writeRichClipboard(view, event, options = {}) {
|
|
|
3542
3618
|
const slice = state.selection.content();
|
|
3543
3619
|
const { dom, text } = view.serializeForClipboard(slice);
|
|
3544
3620
|
event.preventDefault();
|
|
3545
|
-
_optionalChain([data, 'access',
|
|
3621
|
+
_optionalChain([data, 'access', _138 => _138.clearData, 'optionalCall', _139 => _139()]);
|
|
3546
3622
|
data.setData("text/html", dom.innerHTML);
|
|
3547
3623
|
data.setData("text/plain", text);
|
|
3548
3624
|
data.setData(_nullishCoalesce(options.mimeType, () => ( _chunk3AJMR7EGcjs.PIXERATE_DOCUMENT_MIME)), _chunk3AJMR7EGcjs.serializeRichClipboardPayload.call(void 0, slice, state.schema));
|
|
@@ -3578,7 +3654,7 @@ var RichClipboard = _core.Extension.create({
|
|
|
3578
3654
|
const slice = _chunk3AJMR7EGcjs.readRichClipboard.call(void 0, event, view.state.schema, mimeType);
|
|
3579
3655
|
if (!slice) return false;
|
|
3580
3656
|
event.preventDefault();
|
|
3581
|
-
if (
|
|
3657
|
+
if (_chunkW7GRGGBHcjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
|
|
3582
3658
|
view.dispatch(
|
|
3583
3659
|
view.state.tr.replaceSelection(slice).scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste")
|
|
3584
3660
|
);
|
|
@@ -3771,7 +3847,7 @@ var Autocorrect = _core.Extension.create({
|
|
|
3771
3847
|
addCommands() {
|
|
3772
3848
|
return {
|
|
3773
3849
|
undoAutocorrect: () => ({ state, tr, dispatch }) => {
|
|
3774
|
-
const last = _optionalChain([autocorrectPluginKey, 'access',
|
|
3850
|
+
const last = _optionalChain([autocorrectPluginKey, 'access', _140 => _140.getState, 'call', _141 => _141(state), 'optionalAccess', _142 => _142.last]);
|
|
3775
3851
|
if (!last) return false;
|
|
3776
3852
|
if (state.doc.textBetween(last.from, last.to) !== last.replacement) return false;
|
|
3777
3853
|
if (dispatch) {
|
|
@@ -3821,7 +3897,7 @@ var Autocorrect = _core.Extension.create({
|
|
|
3821
3897
|
}
|
|
3822
3898
|
const insertTyped = () => {
|
|
3823
3899
|
const tr2 = state.tr.insertText(text, from, to);
|
|
3824
|
-
if (_optionalChain([pluginState, 'optionalAccess',
|
|
3900
|
+
if (_optionalChain([pluginState, 'optionalAccess', _143 => _143.closePending])) _history.closeHistory.call(void 0, tr2);
|
|
3825
3901
|
view.dispatch(tr2);
|
|
3826
3902
|
};
|
|
3827
3903
|
if (isIgnored(state, from, to)) return false;
|
|
@@ -3829,7 +3905,7 @@ var Autocorrect = _core.Extension.create({
|
|
|
3829
3905
|
if (extension.options.ignorePromptTokens && isInsidePromptToken(textBefore)) {
|
|
3830
3906
|
return false;
|
|
3831
3907
|
}
|
|
3832
|
-
const currentWord = _nullishCoalesce(_optionalChain([/\S*$/, 'access',
|
|
3908
|
+
const currentWord = _nullishCoalesce(_optionalChain([/\S*$/, 'access', _144 => _144.exec, 'call', _145 => _145(textBefore), 'optionalAccess', _146 => _146[0]]), () => ( ""));
|
|
3833
3909
|
if (/:\/\/|^www\./i.test(currentWord)) return false;
|
|
3834
3910
|
const exceptions = extension.storage.exceptions;
|
|
3835
3911
|
const found = findAutocorrection(textBefore, extension.options.rules, {
|
|
@@ -3837,7 +3913,7 @@ var Autocorrect = _core.Extension.create({
|
|
|
3837
3913
|
isException: (value) => exceptions.has(value.toLowerCase())
|
|
3838
3914
|
});
|
|
3839
3915
|
if (!found) {
|
|
3840
|
-
if (!_optionalChain([pluginState, 'optionalAccess',
|
|
3916
|
+
if (!_optionalChain([pluginState, 'optionalAccess', _147 => _147.closePending])) return false;
|
|
3841
3917
|
insertTyped();
|
|
3842
3918
|
return true;
|
|
3843
3919
|
}
|
|
@@ -3874,7 +3950,7 @@ var Autocorrect = _core.Extension.create({
|
|
|
3874
3950
|
_history.closeHistory.call(void 0, tr);
|
|
3875
3951
|
tr.setMeta(autocorrectPluginKey, { correction });
|
|
3876
3952
|
view.dispatch(tr);
|
|
3877
|
-
_optionalChain([extension, 'access',
|
|
3953
|
+
_optionalChain([extension, 'access', _148 => _148.options, 'access', _149 => _149.onCorrection, 'optionalCall', _150 => _150(correction)]);
|
|
3878
3954
|
return true;
|
|
3879
3955
|
};
|
|
3880
3956
|
return [
|
|
@@ -3884,8 +3960,8 @@ var Autocorrect = _core.Extension.create({
|
|
|
3884
3960
|
init: () => ({ last: null, closePending: false }),
|
|
3885
3961
|
apply: (tr, prev) => {
|
|
3886
3962
|
const meta = tr.getMeta(autocorrectPluginKey);
|
|
3887
|
-
if (_optionalChain([meta, 'optionalAccess',
|
|
3888
|
-
if (_optionalChain([meta, 'optionalAccess',
|
|
3963
|
+
if (_optionalChain([meta, 'optionalAccess', _151 => _151.correction])) return { last: meta.correction, closePending: true };
|
|
3964
|
+
if (_optionalChain([meta, 'optionalAccess', _152 => _152.undo])) return { last: null, closePending: true };
|
|
3889
3965
|
if (!tr.docChanged) return prev;
|
|
3890
3966
|
if (!prev.last && !prev.closePending) return prev;
|
|
3891
3967
|
return { last: null, closePending: false };
|
|
@@ -3978,8 +4054,8 @@ function createOutlineStore(editor) {
|
|
|
3978
4054
|
const compute = () => {
|
|
3979
4055
|
if (!editor || editor.isDestroyed) return EMPTY_SNAPSHOT;
|
|
3980
4056
|
const headings = getOutline(editor);
|
|
3981
|
-
const activeId = _nullishCoalesce(_optionalChain([getActiveHeading, 'call',
|
|
3982
|
-
const sameStructure =
|
|
4057
|
+
const activeId = _nullishCoalesce(_optionalChain([getActiveHeading, 'call', _153 => _153(editor, headings), 'optionalAccess', _154 => _154.id]), () => ( null));
|
|
4058
|
+
const sameStructure = _chunkW7GRGGBHcjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
|
|
3983
4059
|
if (sameStructure && snapshot.activeId === activeId) return snapshot;
|
|
3984
4060
|
return {
|
|
3985
4061
|
headings: sameStructure ? snapshot.headings : headings,
|
|
@@ -4003,16 +4079,16 @@ function createOutlineStore(editor) {
|
|
|
4003
4079
|
subscribe(listener) {
|
|
4004
4080
|
if (!listeners.size) {
|
|
4005
4081
|
snapshot = compute();
|
|
4006
|
-
_optionalChain([editor, 'optionalAccess',
|
|
4082
|
+
_optionalChain([editor, 'optionalAccess', _155 => _155.on, 'call', _156 => _156("transaction", onTransaction)]);
|
|
4007
4083
|
}
|
|
4008
4084
|
listeners.add(listener);
|
|
4009
4085
|
return () => {
|
|
4010
4086
|
listeners.delete(listener);
|
|
4011
|
-
if (!listeners.size) _optionalChain([editor, 'optionalAccess',
|
|
4087
|
+
if (!listeners.size) _optionalChain([editor, 'optionalAccess', _157 => _157.off, 'call', _158 => _158("transaction", onTransaction)]);
|
|
4012
4088
|
};
|
|
4013
4089
|
},
|
|
4014
4090
|
destroy() {
|
|
4015
|
-
_optionalChain([editor, 'optionalAccess',
|
|
4091
|
+
_optionalChain([editor, 'optionalAccess', _159 => _159.off, 'call', _160 => _160("transaction", onTransaction)]);
|
|
4016
4092
|
listeners.clear();
|
|
4017
4093
|
}
|
|
4018
4094
|
};
|
|
@@ -4027,7 +4103,7 @@ function navigateToHeading(editor, heading, options = {}) {
|
|
|
4027
4103
|
editor.view.dispatch(tr);
|
|
4028
4104
|
editor.view.focus();
|
|
4029
4105
|
}
|
|
4030
|
-
|
|
4106
|
+
_chunkW7GRGGBHcjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
|
|
4031
4107
|
return true;
|
|
4032
4108
|
}
|
|
4033
4109
|
function assignHeadingIds(state, types, generateId) {
|
|
@@ -4052,11 +4128,11 @@ function assignHeadingIds(state, types, generateId) {
|
|
|
4052
4128
|
}
|
|
4053
4129
|
var Outline = _core.Extension.create({
|
|
4054
4130
|
name: "outline",
|
|
4055
|
-
priority:
|
|
4131
|
+
priority: _chunkW7GRGGBHcjs.STRUCTURE_PRIORITY,
|
|
4056
4132
|
addOptions() {
|
|
4057
4133
|
return {
|
|
4058
4134
|
types: ["heading"],
|
|
4059
|
-
generateId: () =>
|
|
4135
|
+
generateId: () => _chunkW7GRGGBHcjs.generateStructureId.call(void 0, "h"),
|
|
4060
4136
|
onUpdate: void 0
|
|
4061
4137
|
};
|
|
4062
4138
|
},
|
|
@@ -4087,16 +4163,16 @@ var Outline = _core.Extension.create({
|
|
|
4087
4163
|
if (options.focus !== false) {
|
|
4088
4164
|
tr.setSelection(_state.TextSelection.create(tr.doc, heading.pos + 1));
|
|
4089
4165
|
tr.scrollIntoView();
|
|
4090
|
-
_optionalChain([view, 'optionalAccess',
|
|
4166
|
+
_optionalChain([view, 'optionalAccess', _161 => _161.focus, 'optionalCall', _162 => _162()]);
|
|
4091
4167
|
}
|
|
4092
|
-
|
|
4168
|
+
_chunkW7GRGGBHcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
|
|
4093
4169
|
}
|
|
4094
4170
|
return true;
|
|
4095
4171
|
},
|
|
4096
4172
|
scrollToHeading: (id, options = {}) => ({ state, dispatch, view }) => {
|
|
4097
4173
|
const heading = findHeading(state, id);
|
|
4098
4174
|
if (!heading) return false;
|
|
4099
|
-
if (dispatch)
|
|
4175
|
+
if (dispatch) _chunkW7GRGGBHcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
|
|
4100
4176
|
return true;
|
|
4101
4177
|
}
|
|
4102
4178
|
};
|
|
@@ -4117,9 +4193,9 @@ var Outline = _core.Extension.create({
|
|
|
4117
4193
|
apply: (tr, prev, _oldState, newState) => {
|
|
4118
4194
|
if (!tr.docChanged) return prev;
|
|
4119
4195
|
const next = computeOutline(newState.doc, types);
|
|
4120
|
-
if (
|
|
4196
|
+
if (_chunkW7GRGGBHcjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
|
|
4121
4197
|
storage.headings = next;
|
|
4122
|
-
_optionalChain([onUpdate, 'call',
|
|
4198
|
+
_optionalChain([onUpdate, 'call', _163 => _163(), 'optionalCall', _164 => _164(next)]);
|
|
4123
4199
|
return next;
|
|
4124
4200
|
}
|
|
4125
4201
|
}
|
|
@@ -4135,7 +4211,7 @@ var Outline = _core.Extension.create({
|
|
|
4135
4211
|
},
|
|
4136
4212
|
onBeforeCreate() {
|
|
4137
4213
|
const { types, generateId } = this.options;
|
|
4138
|
-
|
|
4214
|
+
_chunkW7GRGGBHcjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
|
|
4139
4215
|
}
|
|
4140
4216
|
});
|
|
4141
4217
|
|
|
@@ -4305,7 +4381,7 @@ function syncTableOfContents(state, headingTypes) {
|
|
|
4305
4381
|
node.attrs.minLevel,
|
|
4306
4382
|
node.attrs.maxLevel
|
|
4307
4383
|
);
|
|
4308
|
-
if (!
|
|
4384
|
+
if (!_chunkW7GRGGBHcjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
|
|
4309
4385
|
tr = _nullishCoalesce(tr, () => ( state.tr));
|
|
4310
4386
|
tr.setNodeMarkup(pos, void 0, { ...node.attrs, entries });
|
|
4311
4387
|
}
|
|
@@ -4317,7 +4393,7 @@ function syncTableOfContents(state, headingTypes) {
|
|
|
4317
4393
|
}
|
|
4318
4394
|
var TableOfContents = _core.Node.create({
|
|
4319
4395
|
name: "tableOfContents",
|
|
4320
|
-
priority:
|
|
4396
|
+
priority: _chunkW7GRGGBHcjs.STRUCTURE_PRIORITY - 5,
|
|
4321
4397
|
group: "block",
|
|
4322
4398
|
atom: true,
|
|
4323
4399
|
selectable: true,
|
|
@@ -4428,7 +4504,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4428
4504
|
return [
|
|
4429
4505
|
new (0, _state.Plugin)({
|
|
4430
4506
|
key: tableOfContentsPluginKey,
|
|
4431
|
-
state:
|
|
4507
|
+
state: _chunkW7GRGGBHcjs.presenceStateSpec.call(void 0, [this.name]),
|
|
4432
4508
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
4433
4509
|
if (!transactions.some((tr) => tr.docChanged)) return null;
|
|
4434
4510
|
if (!tableOfContentsPluginKey.getState(newState)) return null;
|
|
@@ -4438,7 +4514,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4438
4514
|
handleDOMEvents: {
|
|
4439
4515
|
click: (view, event) => {
|
|
4440
4516
|
const target = event.target;
|
|
4441
|
-
const link = _optionalChain([target, 'optionalAccess',
|
|
4517
|
+
const link = _optionalChain([target, 'optionalAccess', _165 => _165.closest, 'optionalCall', _166 => _166(
|
|
4442
4518
|
'nav[data-type="table-of-contents"] a[data-heading-id]'
|
|
4443
4519
|
)]);
|
|
4444
4520
|
if (!link) return false;
|
|
@@ -4452,7 +4528,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4452
4528
|
);
|
|
4453
4529
|
view.focus();
|
|
4454
4530
|
}
|
|
4455
|
-
|
|
4531
|
+
_chunkW7GRGGBHcjs.scrollDomAtPos.call(void 0, view, heading.pos);
|
|
4456
4532
|
return true;
|
|
4457
4533
|
}
|
|
4458
4534
|
}
|
|
@@ -4462,7 +4538,7 @@ var TableOfContents = _core.Node.create({
|
|
|
4462
4538
|
},
|
|
4463
4539
|
onBeforeCreate() {
|
|
4464
4540
|
const { headingTypes } = this.options;
|
|
4465
|
-
|
|
4541
|
+
_chunkW7GRGGBHcjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
|
|
4466
4542
|
}
|
|
4467
4543
|
});
|
|
4468
4544
|
|
|
@@ -4511,7 +4587,7 @@ function getFootnotes(doc) {
|
|
|
4511
4587
|
number: index + 1,
|
|
4512
4588
|
text: footnote ? footnoteText(footnote.node) : "",
|
|
4513
4589
|
referencePos: ref.pos,
|
|
4514
|
-
footnotePos: _nullishCoalesce(_optionalChain([footnote, 'optionalAccess',
|
|
4590
|
+
footnotePos: _nullishCoalesce(_optionalChain([footnote, 'optionalAccess', _167 => _167.pos]), () => ( null))
|
|
4515
4591
|
};
|
|
4516
4592
|
});
|
|
4517
4593
|
}
|
|
@@ -4520,7 +4596,7 @@ function syncFootnotes(tr, options = {}) {
|
|
|
4520
4596
|
const listType = schema.nodes[LIST];
|
|
4521
4597
|
const itemType = schema.nodes[ITEM];
|
|
4522
4598
|
if (!listType || !itemType) return false;
|
|
4523
|
-
const generateId = _nullishCoalesce(options.generateId, () => ( (() =>
|
|
4599
|
+
const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkW7GRGGBHcjs.generateStructureId.call(void 0, "fn"))));
|
|
4524
4600
|
const refs = [];
|
|
4525
4601
|
const lists = [];
|
|
4526
4602
|
const existing = /* @__PURE__ */ new Map();
|
|
@@ -4553,7 +4629,7 @@ function syncFootnotes(tr, options = {}) {
|
|
|
4553
4629
|
});
|
|
4554
4630
|
const desiredItems = desiredRefs.map(({ id, number, copyOf }) => {
|
|
4555
4631
|
const source = _nullishCoalesce(existing.get(id), () => ( (copyOf ? existing.get(copyOf) : void 0)));
|
|
4556
|
-
const content = _nullishCoalesce(_optionalChain([source, 'optionalAccess',
|
|
4632
|
+
const content = _nullishCoalesce(_optionalChain([source, 'optionalAccess', _168 => _168.content]), () => ( paragraphsFromText(schema, _nullishCoalesce(_optionalChain([options, 'access', _169 => _169.contents, 'optionalAccess', _170 => _170[id]]), () => ( "")))));
|
|
4557
4633
|
if (source && source.attrs.id === id && source.attrs.number === number) {
|
|
4558
4634
|
return source;
|
|
4559
4635
|
}
|
|
@@ -4604,7 +4680,7 @@ function findReferences(doc, id) {
|
|
|
4604
4680
|
}
|
|
4605
4681
|
var FootnoteReference = _core.Node.create({
|
|
4606
4682
|
name: REFERENCE,
|
|
4607
|
-
priority:
|
|
4683
|
+
priority: _chunkW7GRGGBHcjs.STRUCTURE_PRIORITY - 5,
|
|
4608
4684
|
group: "inline",
|
|
4609
4685
|
inline: true,
|
|
4610
4686
|
atom: true,
|
|
@@ -4612,7 +4688,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4612
4688
|
addOptions() {
|
|
4613
4689
|
return {
|
|
4614
4690
|
HTMLAttributes: {},
|
|
4615
|
-
generateId: () =>
|
|
4691
|
+
generateId: () => _chunkW7GRGGBHcjs.generateStructureId.call(void 0, "fn")
|
|
4616
4692
|
};
|
|
4617
4693
|
},
|
|
4618
4694
|
addAttributes() {
|
|
@@ -4723,7 +4799,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4723
4799
|
_state.TextSelection.create(tr.doc, footnote.pos + footnote.node.nodeSize - 2)
|
|
4724
4800
|
);
|
|
4725
4801
|
tr.scrollIntoView();
|
|
4726
|
-
|
|
4802
|
+
_chunkW7GRGGBHcjs.scrollDomAtPos.call(void 0, view, footnote.pos);
|
|
4727
4803
|
}
|
|
4728
4804
|
return true;
|
|
4729
4805
|
},
|
|
@@ -4733,7 +4809,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4733
4809
|
if (dispatch) {
|
|
4734
4810
|
tr.setSelection(_state.NodeSelection.create(tr.doc, ref.pos));
|
|
4735
4811
|
tr.scrollIntoView();
|
|
4736
|
-
|
|
4812
|
+
_chunkW7GRGGBHcjs.scrollDomAtPos.call(void 0, view, ref.pos);
|
|
4737
4813
|
}
|
|
4738
4814
|
return true;
|
|
4739
4815
|
}
|
|
@@ -4745,7 +4821,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4745
4821
|
return [
|
|
4746
4822
|
new (0, _state.Plugin)({
|
|
4747
4823
|
key: footnotesPluginKey,
|
|
4748
|
-
state:
|
|
4824
|
+
state: _chunkW7GRGGBHcjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
|
|
4749
4825
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
4750
4826
|
if (!transactions.some((tr2) => tr2.docChanged)) return null;
|
|
4751
4827
|
if (!footnotesPluginKey.getState(newState)) return null;
|
|
@@ -4756,7 +4832,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4756
4832
|
handleClickOn: (_view, _pos, node, _nodePos, event) => {
|
|
4757
4833
|
if (node.type.name !== REFERENCE || !node.attrs.id) return false;
|
|
4758
4834
|
const target = event.target;
|
|
4759
|
-
if (!_optionalChain([target, 'optionalAccess',
|
|
4835
|
+
if (!_optionalChain([target, 'optionalAccess', _171 => _171.closest, 'optionalCall', _172 => _172("a")])) return false;
|
|
4760
4836
|
event.preventDefault();
|
|
4761
4837
|
return editor.commands.goToFootnote(node.attrs.id);
|
|
4762
4838
|
}
|
|
@@ -4766,7 +4842,7 @@ var FootnoteReference = _core.Node.create({
|
|
|
4766
4842
|
},
|
|
4767
4843
|
onBeforeCreate() {
|
|
4768
4844
|
const { generateId } = this.options;
|
|
4769
|
-
|
|
4845
|
+
_chunkW7GRGGBHcjs.syncInitialContent.call(void 0, this.editor, (state) => {
|
|
4770
4846
|
const tr = state.tr;
|
|
4771
4847
|
return syncFootnotes(tr, { generateId }) ? tr : null;
|
|
4772
4848
|
});
|
|
@@ -4906,7 +4982,7 @@ var Bookmark = _core.Mark.create({
|
|
|
4906
4982
|
addOptions() {
|
|
4907
4983
|
return {
|
|
4908
4984
|
HTMLAttributes: {},
|
|
4909
|
-
generateId: () =>
|
|
4985
|
+
generateId: () => _chunkW7GRGGBHcjs.generateStructureId.call(void 0, "bm")
|
|
4910
4986
|
};
|
|
4911
4987
|
},
|
|
4912
4988
|
addAttributes() {
|
|
@@ -4954,7 +5030,7 @@ var Bookmark = _core.Mark.create({
|
|
|
4954
5030
|
}
|
|
4955
5031
|
if (!dispatch) return true;
|
|
4956
5032
|
const sameName = getBookmarks(state.doc).find((b) => b.name === name);
|
|
4957
|
-
const bookmarkId = _nullishCoalesce(_nullishCoalesce(id, () => ( _optionalChain([sameName, 'optionalAccess',
|
|
5033
|
+
const bookmarkId = _nullishCoalesce(_nullishCoalesce(id, () => ( _optionalChain([sameName, 'optionalAccess', _173 => _173.id]))), () => ( this.options.generateId()));
|
|
4958
5034
|
if (sameName) {
|
|
4959
5035
|
forEachBookmarkRange(
|
|
4960
5036
|
tr.doc,
|
|
@@ -4991,7 +5067,7 @@ var Bookmark = _core.Mark.create({
|
|
|
4991
5067
|
tr.setSelection(_state.TextSelection.create(tr.doc, bookmark.from, bookmark.to));
|
|
4992
5068
|
tr.scrollIntoView();
|
|
4993
5069
|
const domPos = state.doc.resolve(bookmark.from);
|
|
4994
|
-
|
|
5070
|
+
_chunkW7GRGGBHcjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
|
|
4995
5071
|
}
|
|
4996
5072
|
return true;
|
|
4997
5073
|
}
|
|
@@ -5056,7 +5132,7 @@ function syncCrossReferences(state, headingTypes) {
|
|
|
5056
5132
|
}
|
|
5057
5133
|
var CrossReference = _core.Node.create({
|
|
5058
5134
|
name: NAME,
|
|
5059
|
-
priority:
|
|
5135
|
+
priority: _chunkW7GRGGBHcjs.STRUCTURE_PRIORITY - 5,
|
|
5060
5136
|
group: "inline",
|
|
5061
5137
|
inline: true,
|
|
5062
5138
|
atom: true,
|
|
@@ -5158,7 +5234,7 @@ var CrossReference = _core.Node.create({
|
|
|
5158
5234
|
if (dispatch) {
|
|
5159
5235
|
tr.setSelection(_state.TextSelection.create(tr.doc, range.from, range.to));
|
|
5160
5236
|
tr.scrollIntoView();
|
|
5161
|
-
|
|
5237
|
+
_chunkW7GRGGBHcjs.scrollDomAtPos.call(void 0, view, range.blockPos);
|
|
5162
5238
|
}
|
|
5163
5239
|
return true;
|
|
5164
5240
|
}
|
|
@@ -5170,7 +5246,7 @@ var CrossReference = _core.Node.create({
|
|
|
5170
5246
|
return [
|
|
5171
5247
|
new (0, _state.Plugin)({
|
|
5172
5248
|
key: crossReferencePluginKey,
|
|
5173
|
-
state:
|
|
5249
|
+
state: _chunkW7GRGGBHcjs.presenceStateSpec.call(void 0, [NAME]),
|
|
5174
5250
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
5175
5251
|
if (!transactions.some((tr) => tr.docChanged)) return null;
|
|
5176
5252
|
if (!crossReferencePluginKey.getState(newState)) return null;
|
|
@@ -5189,14 +5265,14 @@ var CrossReference = _core.Node.create({
|
|
|
5189
5265
|
},
|
|
5190
5266
|
onBeforeCreate() {
|
|
5191
5267
|
const { headingTypes } = this.options;
|
|
5192
|
-
|
|
5268
|
+
_chunkW7GRGGBHcjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
|
|
5193
5269
|
}
|
|
5194
5270
|
});
|
|
5195
5271
|
|
|
5196
5272
|
// src/extensions/document-structure/command-items.ts
|
|
5197
5273
|
var start = (editor, args) => {
|
|
5198
5274
|
const chain = editor.chain().focus();
|
|
5199
|
-
return _optionalChain([args, 'optionalAccess',
|
|
5275
|
+
return _optionalChain([args, 'optionalAccess', _174 => _174.range]) ? chain.deleteRange(args.range) : chain;
|
|
5200
5276
|
};
|
|
5201
5277
|
var documentStructureCommandItems = [
|
|
5202
5278
|
{
|
|
@@ -5213,7 +5289,7 @@ var documentStructureCommandItems = [
|
|
|
5213
5289
|
description: "Insert a numbered footnote",
|
|
5214
5290
|
keywords: ["footnote", "note", "fn", "citation"],
|
|
5215
5291
|
extension: "footnoteReference",
|
|
5216
|
-
run: (editor, args) => start(editor, args).insertFootnote({ content: _optionalChain([args, 'optionalAccess',
|
|
5292
|
+
run: (editor, args) => start(editor, args).insertFootnote({ content: _optionalChain([args, 'optionalAccess', _175 => _175.content]) }).run()
|
|
5217
5293
|
},
|
|
5218
5294
|
{
|
|
5219
5295
|
id: "bookmark",
|
|
@@ -5222,7 +5298,7 @@ var documentStructureCommandItems = [
|
|
|
5222
5298
|
keywords: ["bookmark", "anchor", "name"],
|
|
5223
5299
|
extension: "bookmark",
|
|
5224
5300
|
requires: "name",
|
|
5225
|
-
run: (editor, args) => !!_optionalChain([args, 'optionalAccess',
|
|
5301
|
+
run: (editor, args) => !!_optionalChain([args, 'optionalAccess', _176 => _176.name]) && start(editor, args).setBookmark({ name: args.name }).run()
|
|
5226
5302
|
},
|
|
5227
5303
|
{
|
|
5228
5304
|
id: "cross-reference",
|
|
@@ -5231,7 +5307,7 @@ var documentStructureCommandItems = [
|
|
|
5231
5307
|
keywords: ["cross", "reference", "xref", "link", "ref"],
|
|
5232
5308
|
extension: "crossReference",
|
|
5233
5309
|
requires: "target",
|
|
5234
|
-
run: (editor, args) => !!_optionalChain([args, 'optionalAccess',
|
|
5310
|
+
run: (editor, args) => !!_optionalChain([args, 'optionalAccess', _177 => _177.targetType]) && !!args.targetId && start(editor, args).insertCrossReference({ targetType: args.targetType, targetId: args.targetId }).run()
|
|
5235
5311
|
}
|
|
5236
5312
|
];
|
|
5237
5313
|
function getDocumentStructureCommandItems(editor, query = "") {
|
|
@@ -5290,13 +5366,13 @@ var FindReplaceStore = (_class3 = class {constructor() { _class3.prototype.__ini
|
|
|
5290
5366
|
}, _class3);
|
|
5291
5367
|
var findReplacePluginKey = new (0, _state.PluginKey)("findReplace");
|
|
5292
5368
|
function getFindReplaceState(source) {
|
|
5293
|
-
const state = _nullishCoalesce(_optionalChain([source, 'optionalAccess',
|
|
5369
|
+
const state = _nullishCoalesce(_optionalChain([source, 'optionalAccess', _178 => _178.state]), () => ( source));
|
|
5294
5370
|
if (!state || typeof state.plugins === "undefined") return null;
|
|
5295
5371
|
const plugin = findReplacePluginKey.getState(state);
|
|
5296
5372
|
return plugin ? toSnapshot(plugin) : null;
|
|
5297
5373
|
}
|
|
5298
5374
|
function getFindReplaceStore(editor) {
|
|
5299
|
-
return _nullishCoalesce(_optionalChain([editor, 'optionalAccess',
|
|
5375
|
+
return _nullishCoalesce(_optionalChain([editor, 'optionalAccess', _179 => _179.storage, 'optionalAccess', _180 => _180.findReplace, 'optionalAccess', _181 => _181.store]), () => ( null));
|
|
5300
5376
|
}
|
|
5301
5377
|
var snapshotCache = /* @__PURE__ */ new WeakMap();
|
|
5302
5378
|
function toSnapshot(s) {
|
|
@@ -5444,7 +5520,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5444
5520
|
if (!s || !s.active || s.currentIndex < 0 || !s.matches[s.currentIndex]) return false;
|
|
5445
5521
|
if (dispatch) {
|
|
5446
5522
|
_history.closeHistory.call(void 0, tr);
|
|
5447
|
-
const [end] =
|
|
5523
|
+
const [end] = _chunkW7GRGGBHcjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
|
|
5448
5524
|
tr.setSelection(_state.TextSelection.create(tr.doc, end)).scrollIntoView();
|
|
5449
5525
|
meta(tr, { type: "replaced", anchor: end, count: 1 });
|
|
5450
5526
|
}
|
|
@@ -5455,7 +5531,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5455
5531
|
if (!s || !s.active || !s.matches.length) return false;
|
|
5456
5532
|
if (dispatch) {
|
|
5457
5533
|
_history.closeHistory.call(void 0, tr);
|
|
5458
|
-
const ends =
|
|
5534
|
+
const ends = _chunkW7GRGGBHcjs.applyReplacements.call(void 0, tr, s.matches);
|
|
5459
5535
|
meta(tr, { type: "replaced", anchor: ends[ends.length - 1], count: s.matches.length });
|
|
5460
5536
|
}
|
|
5461
5537
|
return true;
|
|
@@ -5467,7 +5543,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5467
5543
|
const open = (mode) => () => this.editor.commands.openFindReplace({ mode });
|
|
5468
5544
|
const step = (forward) => () => {
|
|
5469
5545
|
const s = findReplacePluginKey.getState(this.editor.state);
|
|
5470
|
-
if (!_optionalChain([s, 'optionalAccess',
|
|
5546
|
+
if (!_optionalChain([s, 'optionalAccess', _182 => _182.active]) || !s.matches.length) return false;
|
|
5471
5547
|
return forward ? this.editor.commands.findNext() : this.editor.commands.findPrevious();
|
|
5472
5548
|
};
|
|
5473
5549
|
return {
|
|
@@ -5487,7 +5563,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5487
5563
|
if (!s.active || !s.query) {
|
|
5488
5564
|
return { ...s, matches: [], currentIndex: -1, error: null, truncated: false };
|
|
5489
5565
|
}
|
|
5490
|
-
const result =
|
|
5566
|
+
const result = _chunkW7GRGGBHcjs.searchDocument.call(void 0, doc, s.query, s.options, {
|
|
5491
5567
|
replacement: s.replacement,
|
|
5492
5568
|
clipboardText: safeClipboard(options.getClipboardText),
|
|
5493
5569
|
timeLimitMs: options.timeLimitMs,
|
|
@@ -5580,7 +5656,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5580
5656
|
s = {
|
|
5581
5657
|
...s,
|
|
5582
5658
|
currentIndex: m.index,
|
|
5583
|
-
anchor: _nullishCoalesce(_optionalChain([s, 'access',
|
|
5659
|
+
anchor: _nullishCoalesce(_optionalChain([s, 'access', _183 => _183.matches, 'access', _184 => _184[m.index], 'optionalAccess', _185 => _185.from]), () => ( s.anchor))
|
|
5584
5660
|
};
|
|
5585
5661
|
redecorate = true;
|
|
5586
5662
|
break;
|
|
@@ -5596,7 +5672,7 @@ var FindReplace = _core.Extension.create({
|
|
|
5596
5672
|
}
|
|
5597
5673
|
},
|
|
5598
5674
|
props: {
|
|
5599
|
-
decorations: (state) => _nullishCoalesce(_optionalChain([findReplacePluginKey, 'access',
|
|
5675
|
+
decorations: (state) => _nullishCoalesce(_optionalChain([findReplacePluginKey, 'access', _186 => _186.getState, 'call', _187 => _187(state), 'optionalAccess', _188 => _188.decorations]), () => ( _view2.DecorationSet.empty))
|
|
5600
5676
|
},
|
|
5601
5677
|
view: (view) => {
|
|
5602
5678
|
const sync = () => {
|
|
@@ -5625,11 +5701,11 @@ var STYLE_ID_ATTRIBUTE = "styleId";
|
|
|
5625
5701
|
var CHARACTER_STYLE_MARK_NAME = "characterStyle";
|
|
5626
5702
|
var paragraphStylesPluginKey = new (0, _state.PluginKey)("paragraphStyles");
|
|
5627
5703
|
function getStyleRegistry(editor) {
|
|
5628
|
-
return _nullishCoalesce(_optionalChain([editor, 'optionalAccess',
|
|
5704
|
+
return _nullishCoalesce(_optionalChain([editor, 'optionalAccess', _189 => _189.storage, 'optionalAccess', _190 => _190.paragraphStyles, 'optionalAccess', _191 => _191.registry]), () => ( null));
|
|
5629
5705
|
}
|
|
5630
5706
|
function headingLevels(editor) {
|
|
5631
|
-
const heading = _optionalChain([editor, 'optionalAccess',
|
|
5632
|
-
const levels = _optionalChain([heading, 'optionalAccess',
|
|
5707
|
+
const heading = _optionalChain([editor, 'optionalAccess', _192 => _192.extensionManager, 'optionalAccess', _193 => _193.extensions, 'access', _194 => _194.find, 'call', _195 => _195((e) => e.name === "heading")]);
|
|
5708
|
+
const levels = _optionalChain([heading, 'optionalAccess', _196 => _196.options, 'optionalAccess', _197 => _197.levels]);
|
|
5633
5709
|
return Array.isArray(levels) ? levels : null;
|
|
5634
5710
|
}
|
|
5635
5711
|
function isParagraphStyleAvailable(editor, registry, id) {
|
|
@@ -5639,7 +5715,7 @@ function isParagraphStyleAvailable(editor, registry, id) {
|
|
|
5639
5715
|
if (!editor.schema.nodes[block.type]) return false;
|
|
5640
5716
|
if (block.type === "heading") {
|
|
5641
5717
|
const levels = headingLevels(editor);
|
|
5642
|
-
if (levels && !levels.includes(Number(_optionalChain([block, 'access',
|
|
5718
|
+
if (levels && !levels.includes(Number(_optionalChain([block, 'access', _198 => _198.attrs, 'optionalAccess', _199 => _199.level])))) return false;
|
|
5643
5719
|
}
|
|
5644
5720
|
return true;
|
|
5645
5721
|
}
|
|
@@ -5679,7 +5755,7 @@ function captureSelectionFormat(state) {
|
|
|
5679
5755
|
if (name === "highlight") character.backgroundColor = mark.attrs.color || "#fef08a";
|
|
5680
5756
|
});
|
|
5681
5757
|
const paragraph = {};
|
|
5682
|
-
const align = _optionalChain([state, 'access',
|
|
5758
|
+
const align = _optionalChain([state, 'access', _200 => _200.selection, 'access', _201 => _201.$from, 'access', _202 => _202.parent, 'access', _203 => _203.attrs, 'optionalAccess', _204 => _204.textAlign]);
|
|
5683
5759
|
if (align && align !== "left") paragraph.textAlign = align;
|
|
5684
5760
|
return { paragraph, character };
|
|
5685
5761
|
}
|
|
@@ -5845,7 +5921,7 @@ var ParagraphStyles = _core.Extension.create({
|
|
|
5845
5921
|
},
|
|
5846
5922
|
clearParagraphStyle: () => ({ commands }) => commands.setParagraphStyle(_chunkYN6JKAUEcjs.NORMAL_STYLE_ID),
|
|
5847
5923
|
setCharacterStyle: (id) => ({ commands }) => {
|
|
5848
|
-
if (_optionalChain([registry, 'call',
|
|
5924
|
+
if (_optionalChain([registry, 'call', _205 => _205(), 'access', _206 => _206.get, 'call', _207 => _207(id), 'optionalAccess', _208 => _208.kind]) !== "character") return false;
|
|
5849
5925
|
return commands.setMark(CHARACTER_STYLE_MARK_NAME, { [STYLE_ID_ATTRIBUTE]: id });
|
|
5850
5926
|
},
|
|
5851
5927
|
unsetCharacterStyle: () => ({ commands }) => commands.unsetMark(CHARACTER_STYLE_MARK_NAME),
|
|
@@ -5911,7 +5987,7 @@ var ParagraphStyles = _core.Extension.create({
|
|
|
5911
5987
|
};
|
|
5912
5988
|
},
|
|
5913
5989
|
onDestroy() {
|
|
5914
|
-
_optionalChain([this, 'access',
|
|
5990
|
+
_optionalChain([this, 'access', _209 => _209.storage, 'access', _210 => _210.cleanup, 'optionalCall', _211 => _211()]);
|
|
5915
5991
|
}
|
|
5916
5992
|
});
|
|
5917
5993
|
var EMPTY_STYLES = Object.freeze({
|
|
@@ -5949,8 +6025,8 @@ function createParagraphStylesStore(editor) {
|
|
|
5949
6025
|
}
|
|
5950
6026
|
};
|
|
5951
6027
|
const detach = () => {
|
|
5952
|
-
_optionalChain([editor, 'optionalAccess',
|
|
5953
|
-
_optionalChain([unsubscribeRegistry, 'optionalCall',
|
|
6028
|
+
_optionalChain([editor, 'optionalAccess', _212 => _212.off, 'call', _213 => _213("transaction", update)]);
|
|
6029
|
+
_optionalChain([unsubscribeRegistry, 'optionalCall', _214 => _214()]);
|
|
5954
6030
|
unsubscribeRegistry = null;
|
|
5955
6031
|
};
|
|
5956
6032
|
return {
|
|
@@ -5961,7 +6037,7 @@ function createParagraphStylesStore(editor) {
|
|
|
5961
6037
|
subscribe(listener) {
|
|
5962
6038
|
if (!listeners.size) {
|
|
5963
6039
|
snapshot = compute();
|
|
5964
|
-
_optionalChain([editor, 'optionalAccess',
|
|
6040
|
+
_optionalChain([editor, 'optionalAccess', _215 => _215.on, 'call', _216 => _216("transaction", update)]);
|
|
5965
6041
|
unsubscribeRegistry = registry ? registry.subscribe(update) : null;
|
|
5966
6042
|
}
|
|
5967
6043
|
listeners.add(listener);
|
|
@@ -5978,7 +6054,7 @@ function createParagraphStylesStore(editor) {
|
|
|
5978
6054
|
}
|
|
5979
6055
|
|
|
5980
6056
|
// src/extensions/rich-text-preset.ts
|
|
5981
|
-
var resolveExt3 = (mod, name) => _optionalChain([mod, 'optionalAccess',
|
|
6057
|
+
var resolveExt3 = (mod, name) => _optionalChain([mod, 'optionalAccess', _217 => _217[name]]) || _optionalChain([mod, 'optionalAccess', _218 => _218.default, 'optionalAccess', _219 => _219[name]]) || _optionalChain([mod, 'optionalAccess', _220 => _220.default, 'optionalAccess', _221 => _221.default]) || _optionalChain([mod, 'optionalAccess', _222 => _222.default]) || mod;
|
|
5982
6058
|
var StarterKit = resolveExt3(_StarterKit, "StarterKit");
|
|
5983
6059
|
var Color = resolveExt3(_Color, "Color");
|
|
5984
6060
|
var Highlight = resolveExt3(_Highlight, "Highlight");
|
|
@@ -6059,7 +6135,7 @@ function createRichTextPreset(options = {}) {
|
|
|
6059
6135
|
find: /^\s*(\[([ |x])?\])\s$/i,
|
|
6060
6136
|
type: this.type,
|
|
6061
6137
|
getAttributes: (match) => ({
|
|
6062
|
-
checked: _optionalChain([match, 'access',
|
|
6138
|
+
checked: _optionalChain([match, 'access', _223 => _223[2], 'optionalAccess', _224 => _224.toLowerCase, 'call', _225 => _225()]) === "x"
|
|
6063
6139
|
})
|
|
6064
6140
|
})
|
|
6065
6141
|
];
|
|
@@ -6074,7 +6150,7 @@ function createRichTextPreset(options = {}) {
|
|
|
6074
6150
|
})
|
|
6075
6151
|
];
|
|
6076
6152
|
if (options.table !== false) {
|
|
6077
|
-
extensions2.push(...
|
|
6153
|
+
extensions2.push(..._chunkW7GRGGBHcjs.createTableExtensions.call(void 0, optionObject(options.table)));
|
|
6078
6154
|
}
|
|
6079
6155
|
if (characterLimit) {
|
|
6080
6156
|
extensions2.push(
|
|
@@ -6131,7 +6207,7 @@ function createRichTextPreset(options = {}) {
|
|
|
6131
6207
|
}
|
|
6132
6208
|
if (options.comments) {
|
|
6133
6209
|
extensions2.push(
|
|
6134
|
-
typeof options.comments === "object" ?
|
|
6210
|
+
typeof options.comments === "object" ? _chunkW7GRGGBHcjs.Comments.configure(options.comments) : _chunkW7GRGGBHcjs.Comments
|
|
6135
6211
|
);
|
|
6136
6212
|
}
|
|
6137
6213
|
if (options.trackChanges) {
|
|
@@ -6181,8 +6257,8 @@ function createRichTextPreset(options = {}) {
|
|
|
6181
6257
|
}
|
|
6182
6258
|
if (options.chart) {
|
|
6183
6259
|
const { sparkline = true, ...chartOptions } = optionObject(options.chart);
|
|
6184
|
-
extensions2.push(
|
|
6185
|
-
if (sparkline) extensions2.push(
|
|
6260
|
+
extensions2.push(_chunkW7GRGGBHcjs.Chart.configure(chartOptions));
|
|
6261
|
+
if (sparkline) extensions2.push(_chunkW7GRGGBHcjs.Sparkline.configure(optionObject(sparkline)));
|
|
6186
6262
|
}
|
|
6187
6263
|
if (options.paragraphStyles) {
|
|
6188
6264
|
extensions2.push(ParagraphStyles.configure(optionObject(options.paragraphStyles)));
|
|
@@ -6235,7 +6311,7 @@ function createFindReplaceCommands(editor, options = {}) {
|
|
|
6235
6311
|
const hasMatches = () => {
|
|
6236
6312
|
const ok = usable(editor);
|
|
6237
6313
|
if (ok !== true) return ok;
|
|
6238
|
-
return _optionalChain([state, 'call',
|
|
6314
|
+
return _optionalChain([state, 'call', _226 => _226(), 'optionalAccess', _227 => _227.matches, 'access', _228 => _228.length]) ? true : "No matches.";
|
|
6239
6315
|
};
|
|
6240
6316
|
const apply = (params) => {
|
|
6241
6317
|
const split = splitParams(params);
|
|
@@ -6243,7 +6319,7 @@ function createFindReplaceCommands(editor, options = {}) {
|
|
|
6243
6319
|
};
|
|
6244
6320
|
const failIfInvalid = () => {
|
|
6245
6321
|
const s = state();
|
|
6246
|
-
if (_optionalChain([s, 'optionalAccess',
|
|
6322
|
+
if (_optionalChain([s, 'optionalAccess', _229 => _229.error])) throw new Error(s.error.message);
|
|
6247
6323
|
};
|
|
6248
6324
|
return [
|
|
6249
6325
|
{
|
|
@@ -6282,9 +6358,9 @@ function createFindReplaceCommands(editor, options = {}) {
|
|
|
6282
6358
|
failIfInvalid();
|
|
6283
6359
|
const s = state();
|
|
6284
6360
|
return {
|
|
6285
|
-
count: _nullishCoalesce(_optionalChain([s, 'optionalAccess',
|
|
6286
|
-
truncated: _nullishCoalesce(_optionalChain([s, 'optionalAccess',
|
|
6287
|
-
matches: (_nullishCoalesce(_optionalChain([s, 'optionalAccess',
|
|
6361
|
+
count: _nullishCoalesce(_optionalChain([s, 'optionalAccess', _230 => _230.matches, 'access', _231 => _231.length]), () => ( 0)),
|
|
6362
|
+
truncated: _nullishCoalesce(_optionalChain([s, 'optionalAccess', _232 => _232.truncated]), () => ( false)),
|
|
6363
|
+
matches: (_nullishCoalesce(_optionalChain([s, 'optionalAccess', _233 => _233.matches]), () => ( []))).slice(0, 200).map(({ from, to, text }) => ({ from, to, text }))
|
|
6288
6364
|
};
|
|
6289
6365
|
}
|
|
6290
6366
|
},
|
|
@@ -6311,11 +6387,11 @@ function createFindReplaceCommands(editor, options = {}) {
|
|
|
6311
6387
|
description: "Replaces every match (one undo step). Tracked when Track Changes is on.",
|
|
6312
6388
|
params: searchParams(true),
|
|
6313
6389
|
...scope,
|
|
6314
|
-
enabled: (_ctx, params) => _optionalChain([params, 'optionalAccess',
|
|
6390
|
+
enabled: (_ctx, params) => _optionalChain([params, 'optionalAccess', _234 => _234.query]) !== void 0 ? usable(editor) : hasMatches(),
|
|
6315
6391
|
run: (_ctx, params) => {
|
|
6316
6392
|
apply(params);
|
|
6317
6393
|
failIfInvalid();
|
|
6318
|
-
const count = _nullishCoalesce(_optionalChain([state, 'call',
|
|
6394
|
+
const count = _nullishCoalesce(_optionalChain([state, 'call', _235 => _235(), 'optionalAccess', _236 => _236.matches, 'access', _237 => _237.length]), () => ( 0));
|
|
6319
6395
|
if (count) editor.commands.replaceAll();
|
|
6320
6396
|
return { replaced: count };
|
|
6321
6397
|
}
|
|
@@ -6323,7 +6399,7 @@ function createFindReplaceCommands(editor, options = {}) {
|
|
|
6323
6399
|
];
|
|
6324
6400
|
}
|
|
6325
6401
|
function validateFindPattern(query, options = {}) {
|
|
6326
|
-
const result =
|
|
6402
|
+
const result = _chunkW7GRGGBHcjs.compileFindPattern.call(void 0, query, options);
|
|
6327
6403
|
return result.ok ? null : result.error;
|
|
6328
6404
|
}
|
|
6329
6405
|
|
|
@@ -6332,8 +6408,8 @@ var PARAMS = {
|
|
|
6332
6408
|
insertTable: {
|
|
6333
6409
|
type: "object",
|
|
6334
6410
|
properties: {
|
|
6335
|
-
rows: { type: "integer", minimum: 1, maximum:
|
|
6336
|
-
cols: { type: "integer", minimum: 1, maximum:
|
|
6411
|
+
rows: { type: "integer", minimum: 1, maximum: _chunkW7GRGGBHcjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
|
|
6412
|
+
cols: { type: "integer", minimum: 1, maximum: _chunkW7GRGGBHcjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
|
|
6337
6413
|
withHeaderRow: { type: "boolean", description: "Make the first row a header row (default true)." }
|
|
6338
6414
|
},
|
|
6339
6415
|
additionalProperties: false
|
|
@@ -6364,7 +6440,7 @@ function createTableCommands(editor, options = {}) {
|
|
|
6364
6440
|
const group = _nullishCoalesce(options.group, () => ( "Table"));
|
|
6365
6441
|
const scope = options.scope ? { scope: options.scope } : {};
|
|
6366
6442
|
const focus = _nullishCoalesce(options.focus, () => ( true));
|
|
6367
|
-
return
|
|
6443
|
+
return _chunkW7GRGGBHcjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
|
|
6368
6444
|
const params = PARAMS[action];
|
|
6369
6445
|
return {
|
|
6370
6446
|
id: `${prefix}${action}`,
|
|
@@ -6374,13 +6450,13 @@ function createTableCommands(editor, options = {}) {
|
|
|
6374
6450
|
description,
|
|
6375
6451
|
...params ? { params } : {},
|
|
6376
6452
|
...scope,
|
|
6377
|
-
enabled: (_ctx, p) =>
|
|
6453
|
+
enabled: (_ctx, p) => _chunkW7GRGGBHcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
|
|
6378
6454
|
run: (_ctx, p) => {
|
|
6379
|
-
if (!
|
|
6380
|
-
const reason =
|
|
6455
|
+
if (!_chunkW7GRGGBHcjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
|
|
6456
|
+
const reason = _chunkW7GRGGBHcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
|
|
6381
6457
|
throw new Error(reason === true ? `${label} did not change the document.` : reason);
|
|
6382
6458
|
}
|
|
6383
|
-
const state =
|
|
6459
|
+
const state = _chunkW7GRGGBHcjs.getTableState.call(void 0, editor);
|
|
6384
6460
|
return {
|
|
6385
6461
|
done: true,
|
|
6386
6462
|
table: state.inTable ? { rows: state.rows, columns: state.columns, row: state.row, column: state.column } : null
|
|
@@ -6503,4 +6579,5 @@ function createTableCommands(editor, options = {}) {
|
|
|
6503
6579
|
|
|
6504
6580
|
|
|
6505
6581
|
|
|
6506
|
-
|
|
6582
|
+
|
|
6583
|
+
exports.GradientText = GradientText; exports.SlashCommands = SlashCommands; exports.TemplateSuggestions = TemplateSuggestions; exports.loadingSpinnerSpec = loadingSpinnerSpec; exports.LoadingNode = LoadingNode; exports.SMILIE_REPLACEMENTS = SMILIE_REPLACEMENTS; exports.smilieAutocorrectRules = smilieAutocorrectRules; exports.SmilieReplacer = SmilieReplacer; exports.findHexColors = findHexColors; exports.ColorHighlighter = ColorHighlighter; exports.FontSize = FontSize; exports.Mention = Mention; exports.getMentionNodes = getMentionNodes; exports.setMentionRoleAt = setMentionRoleAt; exports.createMentionExtension = createMentionExtension; exports.Markdown = Markdown2; exports.imagePastePluginKey = imagePastePluginKey; exports.insertImageNode = insertImageNode; exports.updateImageSrc = updateImageSrc; exports.removeImageNode = removeImageNode; exports.handleImageInsertion = handleImageInsertion; exports.Image = Image2; exports.compareInEditor = compareInEditor; exports.applyDocumentComparison = applyDocumentComparison; exports.DocumentCompare = DocumentCompare; exports.ImportError = ImportError; exports.createImportContext = createImportContext; exports.ImportAdapterRegistry = ImportAdapterRegistry; exports.DOCX_MIME_TYPES = DOCX_MIME_TYPES; exports.DEFAULT_DOCX_MAX_IMAGE_SIZE = DEFAULT_DOCX_MAX_IMAGE_SIZE; exports.docxToDocumentImport = docxToDocumentImport; exports.createDocxImportAdapter = createDocxImportAdapter; exports.docxImportAdapter = docxImportAdapter; exports.markdownImportAdapter = markdownImportAdapter; exports.htmlImportAdapter = htmlImportAdapter; exports.plainTextImportAdapter = plainTextImportAdapter; exports.rtfImportAdapter = rtfImportAdapter; exports.BUILT_IN_IMPORT_ADAPTERS = BUILT_IN_IMPORT_ADAPTERS; exports.createImportAdapterRegistry = createImportAdapterRegistry; exports.defaultImportRegistry = defaultImportRegistry; exports.registerImportAdapter = registerImportAdapter; exports.unregisterImportAdapter = unregisterImportAdapter; exports.findImportAdapter = findImportAdapter; exports.importFile = importFile; exports.getImportAccept = getImportAccept; exports.htmlToSlice = htmlToSlice; exports.insertImportedDocument = insertImportedDocument; exports.applyImportedReviewData = applyImportedReviewData; exports.importFilesIntoEditor = importFilesIntoEditor; exports.fileImportPluginKey = fileImportPluginKey; exports.FileImport = FileImport; exports.richClipboardPluginKey = richClipboardPluginKey; exports.writeRichClipboard = writeRichClipboard; exports.RichClipboard = RichClipboard; exports.smartQuoteRules = smartQuoteRules; exports.symbolRules = symbolRules; exports.fractionRules = fractionRules; exports.capitalizeSentenceRules = capitalizeSentenceRules; exports.twoInitialCapitalsRules = twoInitialCapitalsRules; exports.defaultAutocorrectRules = defaultAutocorrectRules; exports.DEFAULT_AUTOCORRECT_EXCEPTIONS = DEFAULT_AUTOCORRECT_EXCEPTIONS; exports.autocorrectPluginKey = autocorrectPluginKey; exports.findAutocorrection = findAutocorrection; exports.isInsidePromptToken = isInsidePromptToken; exports.Autocorrect = Autocorrect; exports.outlinePluginKey = outlinePluginKey; exports.computeOutline = computeOutline; exports.buildOutlineTree = buildOutlineTree; exports.getOutline = getOutline; exports.getActiveHeading = getActiveHeading; exports.createOutlineStore = createOutlineStore; exports.navigateToHeading = navigateToHeading; exports.Outline = Outline; exports.tableOfContentsMarkdownIt = tableOfContentsMarkdownIt; exports.footnotesMarkdownIt = footnotesMarkdownIt; exports.tableOfContentsPluginKey = tableOfContentsPluginKey; exports.getTableOfContentsEntries = getTableOfContentsEntries; exports.TableOfContents = TableOfContents; exports.footnotesPluginKey = footnotesPluginKey; exports.getFootnotes = getFootnotes; exports.syncFootnotes = syncFootnotes; exports.FootnoteReference = FootnoteReference; exports.Footnotes = Footnotes; exports.Footnote = Footnote; exports.getBookmarks = getBookmarks; exports.Bookmark = Bookmark; exports.crossReferencePluginKey = crossReferencePluginKey; exports.getCrossReferenceTargets = getCrossReferenceTargets; exports.CrossReference = CrossReference; exports.documentStructureCommandItems = documentStructureCommandItems; exports.getDocumentStructureCommandItems = getDocumentStructureCommandItems; exports.EMPTY_FIND_REPLACE_SNAPSHOT = EMPTY_FIND_REPLACE_SNAPSHOT; exports.FindReplaceStore = FindReplaceStore; exports.findReplacePluginKey = findReplacePluginKey; exports.getFindReplaceState = getFindReplaceState; exports.getFindReplaceStore = getFindReplaceStore; exports.FIND_OPTION_TOGGLES = FIND_OPTION_TOGGLES; exports.formatFindStatus = formatFindStatus; exports.FindReplace = FindReplace; exports.STYLE_ID_ATTRIBUTE = STYLE_ID_ATTRIBUTE; exports.CHARACTER_STYLE_MARK_NAME = CHARACTER_STYLE_MARK_NAME; exports.paragraphStylesPluginKey = paragraphStylesPluginKey; exports.getStyleRegistry = getStyleRegistry; exports.isParagraphStyleAvailable = isParagraphStyleAvailable; exports.getParagraphStyleAt = getParagraphStyleAt; exports.captureSelectionFormat = captureSelectionFormat; exports.CharacterStyle = CharacterStyle; exports.ParagraphStyles = ParagraphStyles; exports.createParagraphStylesStore = createParagraphStylesStore; exports.createRichTextPreset = createRichTextPreset; exports.createFindReplaceCommands = createFindReplaceCommands; exports.validateFindPattern = validateFindPattern; exports.createTableCommands = createTableCommands;
|