@pixerate/editor 0.43.0 → 0.45.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 +27 -2
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/agent/index.cjs +548 -45
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +47 -17
- package/dist/agent/index.d.ts +47 -17
- package/dist/agent/index.js +536 -33
- package/dist/agent/index.js.map +1 -1
- package/dist/{builtins-BLud97fC.d.cts → builtins-CZW-aYKS.d.cts} +1 -1
- package/dist/{builtins-D0BDyAgw.d.ts → builtins-DghNQbT-.d.ts} +1 -1
- package/dist/{chunk-I6BZB5ZH.cjs → chunk-EFDCLENW.cjs} +73 -6
- package/dist/chunk-EFDCLENW.cjs.map +1 -0
- package/dist/chunk-HHQ4XJWT.js +826 -0
- package/dist/chunk-HHQ4XJWT.js.map +1 -0
- package/dist/chunk-J3R2OWOE.cjs +1465 -0
- package/dist/chunk-J3R2OWOE.cjs.map +1 -0
- package/dist/chunk-K2LVZ4FA.cjs +826 -0
- package/dist/chunk-K2LVZ4FA.cjs.map +1 -0
- package/dist/{chunk-6MDQKHRH.cjs → chunk-N4MLNJPO.cjs} +21 -899
- package/dist/chunk-N4MLNJPO.cjs.map +1 -0
- package/dist/chunk-PQM5W7ZN.js +168 -0
- package/dist/chunk-PQM5W7ZN.js.map +1 -0
- package/dist/{chunk-DDADOHJW.js → chunk-Q25ZS4F7.js} +5 -883
- package/dist/chunk-Q25ZS4F7.js.map +1 -0
- package/dist/chunk-TK2XZK6Z.js +1465 -0
- package/dist/chunk-TK2XZK6Z.js.map +1 -0
- package/dist/commands/index.cjs +3 -2
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.cts +5 -5
- package/dist/commands/index.d.ts +5 -5
- package/dist/commands/index.js +2 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/extensions/index.cjs +4 -4
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +3 -3
- package/dist/extensions/index.d.ts +3 -3
- package/dist/extensions/index.js +12 -12
- package/dist/generation/index.cjs +2 -2
- package/dist/generation/index.d.cts +4 -4
- package/dist/generation/index.d.ts +4 -4
- package/dist/generation/index.js +1 -1
- package/dist/image-editor/index.cjs +24 -24
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +2 -2
- package/dist/image-editor/index.d.ts +2 -2
- package/dist/image-editor/index.js +24 -24
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{index-C6gaQRH0.d.cts → index-CfOQf70b.d.cts} +1 -1
- package/dist/{index-DXAv_R08.d.ts → index-jwJ_onWf.d.ts} +1 -1
- package/dist/index.cjs +9 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +12 -12
- package/dist/parameters/index.d.cts +2 -2
- package/dist/parameters/index.d.ts +2 -2
- package/dist/{registry-DnzpgY27.d.cts → registry-B4l-lYts.d.cts} +1 -1
- package/dist/{registry-DhVUZioj.d.ts → registry-BfVD-vVg.d.ts} +1 -1
- package/dist/{registry-BDe-vlv3.d.ts → registry-CSlH4iUn.d.ts} +1 -1
- package/dist/{registry-D0GADKc7.d.cts → registry-vz6HOiiy.d.cts} +1 -1
- package/dist/{schema-DYDGdYL9.d.cts → schema-Di0CS6Pe.d.cts} +26 -2
- package/dist/{schema-DYDGdYL9.d.ts → schema-Di0CS6Pe.d.ts} +26 -2
- package/dist/tools/index.cjs +37 -3
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.cts +871 -11
- package/dist/tools/index.d.ts +871 -11
- package/dist/tools/index.js +36 -2
- package/dist/vector/index.cjs +1982 -301
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +624 -154
- package/dist/vector/index.d.ts +624 -154
- package/dist/vector/index.js +1755 -74
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-36BLROHV.js +0 -438
- package/dist/chunk-36BLROHV.js.map +0 -1
- package/dist/chunk-5H2OPMXZ.js +0 -586
- package/dist/chunk-5H2OPMXZ.js.map +0 -1
- package/dist/chunk-6MDQKHRH.cjs.map +0 -1
- package/dist/chunk-D6S5M7HV.js +0 -101
- package/dist/chunk-D6S5M7HV.js.map +0 -1
- package/dist/chunk-DDADOHJW.js.map +0 -1
- package/dist/chunk-I6BZB5ZH.cjs.map +0 -1
- package/dist/chunk-MC2LQN5S.cjs +0 -586
- package/dist/chunk-MC2LQN5S.cjs.map +0 -1
- package/dist/chunk-V7CC7RZ6.cjs +0 -438
- package/dist/chunk-V7CC7RZ6.cjs.map +0 -1
|
@@ -17,7 +17,10 @@ var _chunk3CC7OPUQcjs = require('./chunk-3CC7OPUQ.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
var _chunkJ3R2OWOEcjs = require('./chunk-J3R2OWOE.cjs');
|
|
21
24
|
|
|
22
25
|
|
|
23
26
|
var _chunkCS6NZWWAcjs = require('./chunk-CS6NZWWA.cjs');
|
|
@@ -3578,9 +3581,9 @@ function insertImportedDocument(target, content, options = {}) {
|
|
|
3578
3581
|
if (!htmlSlice && from === to && !state.doc.resolve(from).parent.inlineContent) {
|
|
3579
3582
|
from = to = _state.Selection.near(state.doc.resolve(from)).from;
|
|
3580
3583
|
}
|
|
3581
|
-
if (htmlSlice &&
|
|
3584
|
+
if (htmlSlice && _chunkJ3R2OWOEcjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkJ3R2OWOEcjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
|
|
3582
3585
|
const tr2 = state.tr;
|
|
3583
|
-
const end2 =
|
|
3586
|
+
const end2 = _chunkJ3R2OWOEcjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
|
|
3584
3587
|
if (end2 !== null) {
|
|
3585
3588
|
if (options.at === void 0) tr2.setSelection(_state.Selection.near(tr2.doc.resolve(end2), -1));
|
|
3586
3589
|
view.dispatch(tr2.scrollIntoView().setMeta("uiEvent", "drop"));
|
|
@@ -3757,7 +3760,7 @@ var RichClipboard = _core.Extension.create({
|
|
|
3757
3760
|
const slice = _chunkHNDSPZ5Tcjs.readRichClipboard.call(void 0, event, view.state.schema, mimeType);
|
|
3758
3761
|
if (!slice) return false;
|
|
3759
3762
|
event.preventDefault();
|
|
3760
|
-
if (
|
|
3763
|
+
if (_chunkJ3R2OWOEcjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
|
|
3761
3764
|
view.dispatch(
|
|
3762
3765
|
view.state.tr.replaceSelection(slice).scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste")
|
|
3763
3766
|
);
|
|
@@ -5513,877 +5516,6 @@ function getDocumentStructureCommandItems(editor, query = "") {
|
|
|
5513
5516
|
|
|
5514
5517
|
|
|
5515
5518
|
|
|
5516
|
-
|
|
5517
|
-
// src/extensions/find-replace/pattern.ts
|
|
5518
|
-
var FIND_PARAGRAPH_MARK = "\r";
|
|
5519
|
-
var MAX_FIND_PATTERN_LENGTH = 1024;
|
|
5520
|
-
var MAX_COUNT = 1e3;
|
|
5521
|
-
var MAX_PROGRAM_SIZE = 2e4;
|
|
5522
|
-
var now = () => typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
5523
|
-
function createSearchBudget(options = {}) {
|
|
5524
|
-
return {
|
|
5525
|
-
deadline: now() + (_nullishCoalesce(options.timeLimitMs, () => ( 250))),
|
|
5526
|
-
steps: _nullishCoalesce(options.maxSteps, () => ( 5e7)),
|
|
5527
|
-
exhausted: false
|
|
5528
|
-
};
|
|
5529
|
-
}
|
|
5530
|
-
var PARA = 13;
|
|
5531
|
-
var ANY = (cp) => cp !== PARA;
|
|
5532
|
-
var LETTER = /\p{L}/u;
|
|
5533
|
-
var PUNCT = /\p{P}/u;
|
|
5534
|
-
var WORD = /[\p{L}\p{M}\p{Nd}\p{Pc}]/u;
|
|
5535
|
-
var foldCache = /* @__PURE__ */ new Map();
|
|
5536
|
-
function foldCodePoint(cp) {
|
|
5537
|
-
if (cp < 128) return cp >= 65 && cp <= 90 ? cp + 32 : cp;
|
|
5538
|
-
const cached = foldCache.get(cp);
|
|
5539
|
-
if (cached !== void 0) return cached;
|
|
5540
|
-
const lower = String.fromCodePoint(cp).toLowerCase();
|
|
5541
|
-
const folded = [...lower].length === 1 ? lower.codePointAt(0) : cp;
|
|
5542
|
-
if (foldCache.size < 4096) foldCache.set(cp, folded);
|
|
5543
|
-
return folded;
|
|
5544
|
-
}
|
|
5545
|
-
function isWordChar(cp) {
|
|
5546
|
-
if (cp < 0) return false;
|
|
5547
|
-
if (cp < 128) {
|
|
5548
|
-
return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 95;
|
|
5549
|
-
}
|
|
5550
|
-
return WORD.test(String.fromCodePoint(cp));
|
|
5551
|
-
}
|
|
5552
|
-
var isLetter = (cp) => cp < 128 ? cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 : LETTER.test(String.fromCodePoint(cp));
|
|
5553
|
-
function isPunct(cp) {
|
|
5554
|
-
if (cp < 128) {
|
|
5555
|
-
return cp >= 33 && cp <= 47 || cp >= 58 && cp <= 64 || cp >= 91 && cp <= 96 || cp >= 123 && cp <= 126;
|
|
5556
|
-
}
|
|
5557
|
-
return cp >= 8208 && cp <= 8231 || cp === 161 || cp === 191 || cp === 171 || cp === 187 || PUNCT.test(String.fromCodePoint(cp));
|
|
5558
|
-
}
|
|
5559
|
-
var isSpace = (cp) => cp === 32 || cp === 9 || cp === 160;
|
|
5560
|
-
function cpBefore(hay, pos) {
|
|
5561
|
-
if (pos <= 0) return -1;
|
|
5562
|
-
const low = hay.charCodeAt(pos - 1);
|
|
5563
|
-
if (low >= 56320 && low <= 57343 && pos >= 2) {
|
|
5564
|
-
const high = hay.charCodeAt(pos - 2);
|
|
5565
|
-
if (high >= 55296 && high <= 56319) return hay.codePointAt(pos - 2);
|
|
5566
|
-
}
|
|
5567
|
-
return low;
|
|
5568
|
-
}
|
|
5569
|
-
var cpAt = (hay, pos) => pos < hay.length ? hay.codePointAt(pos) : -1;
|
|
5570
|
-
var PatternError = class extends Error {
|
|
5571
|
-
constructor(code, message) {
|
|
5572
|
-
super(message);
|
|
5573
|
-
this.code = code;
|
|
5574
|
-
}
|
|
5575
|
-
|
|
5576
|
-
};
|
|
5577
|
-
var charNode = (test) => ({ k: "char", test });
|
|
5578
|
-
var exact = (cp) => charNode((c) => c === cp);
|
|
5579
|
-
var literalNode = (cp, caseInsensitive) => {
|
|
5580
|
-
if (!caseInsensitive) return exact(cp);
|
|
5581
|
-
const f = foldCodePoint(cp);
|
|
5582
|
-
return charNode((_c, folded) => folded === f);
|
|
5583
|
-
};
|
|
5584
|
-
var star = (body, lazy) => ({ k: "rep", body, min: 0, max: -1, lazy });
|
|
5585
|
-
function findCode(c) {
|
|
5586
|
-
switch (c) {
|
|
5587
|
-
case "p":
|
|
5588
|
-
return exact(PARA);
|
|
5589
|
-
case "t":
|
|
5590
|
-
return exact(9);
|
|
5591
|
-
case "?":
|
|
5592
|
-
return charNode(ANY);
|
|
5593
|
-
case "#":
|
|
5594
|
-
return charNode((cp) => cp >= 48 && cp <= 57);
|
|
5595
|
-
case "$":
|
|
5596
|
-
return charNode((cp) => isLetter(cp));
|
|
5597
|
-
case "^":
|
|
5598
|
-
return exact(94);
|
|
5599
|
-
case "l":
|
|
5600
|
-
return exact(10);
|
|
5601
|
-
case "m":
|
|
5602
|
-
return exact(12);
|
|
5603
|
-
case "n":
|
|
5604
|
-
return exact(14);
|
|
5605
|
-
case "+":
|
|
5606
|
-
return exact(8212);
|
|
5607
|
-
case "=":
|
|
5608
|
-
return exact(8211);
|
|
5609
|
-
case "s":
|
|
5610
|
-
return exact(160);
|
|
5611
|
-
case "~":
|
|
5612
|
-
return exact(8209);
|
|
5613
|
-
case "-":
|
|
5614
|
-
return exact(173);
|
|
5615
|
-
case "w":
|
|
5616
|
-
return { k: "rep", body: charNode((cp) => isSpace(cp)), min: 1, max: -1, lazy: false };
|
|
5617
|
-
case "g":
|
|
5618
|
-
return exact(65532);
|
|
5619
|
-
case "%":
|
|
5620
|
-
return exact(167);
|
|
5621
|
-
case "v":
|
|
5622
|
-
return exact(182);
|
|
5623
|
-
default:
|
|
5624
|
-
return null;
|
|
5625
|
-
}
|
|
5626
|
-
}
|
|
5627
|
-
function replaceCode(c) {
|
|
5628
|
-
switch (c) {
|
|
5629
|
-
case "p":
|
|
5630
|
-
return FIND_PARAGRAPH_MARK;
|
|
5631
|
-
case "t":
|
|
5632
|
-
return " ";
|
|
5633
|
-
case "^":
|
|
5634
|
-
return "^";
|
|
5635
|
-
case "l":
|
|
5636
|
-
return "\n";
|
|
5637
|
-
case "m":
|
|
5638
|
-
return "\f";
|
|
5639
|
-
case "n":
|
|
5640
|
-
return "";
|
|
5641
|
-
case "+":
|
|
5642
|
-
return "\u2014";
|
|
5643
|
-
case "=":
|
|
5644
|
-
return "\u2013";
|
|
5645
|
-
case "s":
|
|
5646
|
-
return "\xA0";
|
|
5647
|
-
case "~":
|
|
5648
|
-
return "\u2011";
|
|
5649
|
-
case "-":
|
|
5650
|
-
return "\xAD";
|
|
5651
|
-
case "%":
|
|
5652
|
-
return "\xA7";
|
|
5653
|
-
case "v":
|
|
5654
|
-
return "\xB6";
|
|
5655
|
-
default:
|
|
5656
|
-
return null;
|
|
5657
|
-
}
|
|
5658
|
-
}
|
|
5659
|
-
function codeChar(n) {
|
|
5660
|
-
switch (n) {
|
|
5661
|
-
case 13:
|
|
5662
|
-
return PARA;
|
|
5663
|
-
case 11:
|
|
5664
|
-
return 10;
|
|
5665
|
-
case 12:
|
|
5666
|
-
return 12;
|
|
5667
|
-
case 14:
|
|
5668
|
-
return 14;
|
|
5669
|
-
case 30:
|
|
5670
|
-
return 8209;
|
|
5671
|
-
case 31:
|
|
5672
|
-
return 173;
|
|
5673
|
-
}
|
|
5674
|
-
if (n > 1114111 || n >= 55296 && n <= 57343) return null;
|
|
5675
|
-
if (n < 32 && n !== 9 || n >= 127 && n < 160) return null;
|
|
5676
|
-
return n;
|
|
5677
|
-
}
|
|
5678
|
-
function numericCode(chars, i) {
|
|
5679
|
-
const unicode = chars[i] === "u";
|
|
5680
|
-
const start2 = unicode ? i + 1 : i;
|
|
5681
|
-
const max = unicode ? 5 : 4;
|
|
5682
|
-
let digits = "";
|
|
5683
|
-
for (let j = start2; j < chars.length && digits.length < max && /[0-9]/.test(chars[j]); j++) digits += chars[j];
|
|
5684
|
-
if (!digits) return null;
|
|
5685
|
-
const cp = codeChar(parseInt(digits, 10));
|
|
5686
|
-
return cp === null ? null : { cp, used: start2 - i + digits.length };
|
|
5687
|
-
}
|
|
5688
|
-
var toChars = (s) => Array.from(s);
|
|
5689
|
-
var cpOf = (ch) => ch.codePointAt(0);
|
|
5690
|
-
function parseSpecial(query, o, caseInsensitive) {
|
|
5691
|
-
const chars = toChars(query);
|
|
5692
|
-
const atoms = [];
|
|
5693
|
-
let spans = false;
|
|
5694
|
-
let i = 0;
|
|
5695
|
-
while (i < chars.length) {
|
|
5696
|
-
const c = chars[i++];
|
|
5697
|
-
if (c === "^" && !o.literal && i < chars.length) {
|
|
5698
|
-
const n = chars[i];
|
|
5699
|
-
const code = findCode(n);
|
|
5700
|
-
if (code) {
|
|
5701
|
-
if (n === "p") spans = true;
|
|
5702
|
-
atoms.push(code);
|
|
5703
|
-
i++;
|
|
5704
|
-
continue;
|
|
5705
|
-
}
|
|
5706
|
-
const num = numericCode(chars, i);
|
|
5707
|
-
if (num) {
|
|
5708
|
-
if (num.cp === PARA) spans = true;
|
|
5709
|
-
atoms.push(literalNode(num.cp, caseInsensitive));
|
|
5710
|
-
i += num.used;
|
|
5711
|
-
continue;
|
|
5712
|
-
}
|
|
5713
|
-
}
|
|
5714
|
-
const cp = cpOf(c);
|
|
5715
|
-
if (o.ignorePunctuation && isPunct(cp) || o.ignoreWhitespace && isSpace(cp)) continue;
|
|
5716
|
-
atoms.push(literalNode(cp, caseInsensitive));
|
|
5717
|
-
}
|
|
5718
|
-
const filler = o.ignorePunctuation && o.ignoreWhitespace ? (cp) => isPunct(cp) || isSpace(cp) : o.ignorePunctuation ? (cp) => isPunct(cp) : o.ignoreWhitespace ? (cp) => isSpace(cp) : null;
|
|
5719
|
-
const items = [];
|
|
5720
|
-
atoms.forEach((atom, index) => {
|
|
5721
|
-
if (index > 0 && filler) items.push(star(charNode(filler), false));
|
|
5722
|
-
items.push(atom);
|
|
5723
|
-
});
|
|
5724
|
-
return { node: { k: "cat", items }, spans };
|
|
5725
|
-
}
|
|
5726
|
-
function parseCount(body) {
|
|
5727
|
-
const bad = () => new PatternError("invalid_pattern", `{${body}} is not a valid count`);
|
|
5728
|
-
const num = (s) => {
|
|
5729
|
-
const t = s.trim();
|
|
5730
|
-
if (!t) return null;
|
|
5731
|
-
if (!/^[0-9]+$/.test(t)) throw bad();
|
|
5732
|
-
const n = parseInt(t, 10);
|
|
5733
|
-
if (n > MAX_COUNT) throw new PatternError("invalid_pattern", `counts go up to ${MAX_COUNT}`);
|
|
5734
|
-
return n;
|
|
5735
|
-
};
|
|
5736
|
-
const sep = body.search(/[,;]/);
|
|
5737
|
-
if (sep < 0) {
|
|
5738
|
-
const n = num(body);
|
|
5739
|
-
if (n === null) throw bad();
|
|
5740
|
-
return { min: n, max: n };
|
|
5741
|
-
}
|
|
5742
|
-
const a = _nullishCoalesce(num(body.slice(0, sep)), () => ( 0));
|
|
5743
|
-
const b = num(body.slice(sep + 1));
|
|
5744
|
-
if (b !== null && b < a) throw bad();
|
|
5745
|
-
return { min: a, max: _nullishCoalesce(b, () => ( -1)) };
|
|
5746
|
-
}
|
|
5747
|
-
function parseClass(inner) {
|
|
5748
|
-
let negated = false;
|
|
5749
|
-
if (inner[0] === "!") {
|
|
5750
|
-
negated = true;
|
|
5751
|
-
inner = inner.slice(1);
|
|
5752
|
-
}
|
|
5753
|
-
if (inner.length === 0) throw new PatternError("invalid_pattern", "[ ] needs at least one character");
|
|
5754
|
-
const singles = /* @__PURE__ */ new Set();
|
|
5755
|
-
const ranges = [];
|
|
5756
|
-
let i = 0;
|
|
5757
|
-
while (i < inner.length) {
|
|
5758
|
-
let c = inner[i];
|
|
5759
|
-
if (c === "\\" && i + 1 < inner.length) c = inner[++i];
|
|
5760
|
-
i++;
|
|
5761
|
-
if (inner[i] === "-" && i + 1 < inner.length) {
|
|
5762
|
-
const hi = inner[i + 1];
|
|
5763
|
-
if (cpOf(hi) < cpOf(c)) throw new PatternError("invalid_pattern", `[${c}-${hi}] is not in ascending order`);
|
|
5764
|
-
ranges.push([cpOf(c), cpOf(hi)]);
|
|
5765
|
-
i += 2;
|
|
5766
|
-
} else {
|
|
5767
|
-
singles.add(cpOf(c));
|
|
5768
|
-
}
|
|
5769
|
-
}
|
|
5770
|
-
const inSet = (cp) => singles.has(cp) || ranges.some(([lo, hi]) => cp >= lo && cp <= hi);
|
|
5771
|
-
return negated ? (cp) => cp !== PARA && !inSet(cp) : (cp) => inSet(cp);
|
|
5772
|
-
}
|
|
5773
|
-
function parseWildcards(query) {
|
|
5774
|
-
const chars = toChars(query);
|
|
5775
|
-
const stack = [{ items: [], group: 0 }];
|
|
5776
|
-
let groups = 0;
|
|
5777
|
-
let spans = false;
|
|
5778
|
-
const top = () => stack[stack.length - 1].items;
|
|
5779
|
-
const quantify = (min, max, what) => {
|
|
5780
|
-
const items = top();
|
|
5781
|
-
const last = items[items.length - 1];
|
|
5782
|
-
if (!last || last.k === "assert" || last.k === "rep") {
|
|
5783
|
-
throw new PatternError("invalid_pattern", `${what} needs something to repeat before it`);
|
|
5784
|
-
}
|
|
5785
|
-
items[items.length - 1] = { k: "rep", body: last, min, max, lazy: false };
|
|
5786
|
-
};
|
|
5787
|
-
let i = 0;
|
|
5788
|
-
while (i < chars.length) {
|
|
5789
|
-
const c = chars[i++];
|
|
5790
|
-
switch (c) {
|
|
5791
|
-
case "?":
|
|
5792
|
-
top().push(charNode(ANY));
|
|
5793
|
-
break;
|
|
5794
|
-
case "*":
|
|
5795
|
-
top().push(star(charNode(ANY), true));
|
|
5796
|
-
break;
|
|
5797
|
-
case "@":
|
|
5798
|
-
quantify(1, -1, "@");
|
|
5799
|
-
break;
|
|
5800
|
-
case "<":
|
|
5801
|
-
top().push({ k: "assert", kind: "wordStart" });
|
|
5802
|
-
break;
|
|
5803
|
-
case ">":
|
|
5804
|
-
top().push({ k: "assert", kind: "wordEnd" });
|
|
5805
|
-
break;
|
|
5806
|
-
case "(":
|
|
5807
|
-
stack.push({ items: [], group: ++groups });
|
|
5808
|
-
break;
|
|
5809
|
-
case ")": {
|
|
5810
|
-
if (stack.length === 1) throw new PatternError("invalid_pattern", "a ) has no opening (");
|
|
5811
|
-
const frame = stack.pop();
|
|
5812
|
-
top().push({ k: "group", index: frame.group, body: { k: "cat", items: frame.items } });
|
|
5813
|
-
break;
|
|
5814
|
-
}
|
|
5815
|
-
case "{": {
|
|
5816
|
-
const end = chars.indexOf("}", i);
|
|
5817
|
-
if (end < 0) throw new PatternError("invalid_pattern", "a { needs a closing }");
|
|
5818
|
-
const { min, max } = parseCount(chars.slice(i, end).join(""));
|
|
5819
|
-
quantify(min, max, `{${chars.slice(i, end).join("")}}`);
|
|
5820
|
-
i = end + 1;
|
|
5821
|
-
break;
|
|
5822
|
-
}
|
|
5823
|
-
case "[": {
|
|
5824
|
-
const end = chars.indexOf("]", i);
|
|
5825
|
-
if (end < 0) throw new PatternError("invalid_pattern", "a [ needs a closing ]");
|
|
5826
|
-
top().push(charNode(parseClass(chars.slice(i, end))));
|
|
5827
|
-
i = end + 1;
|
|
5828
|
-
break;
|
|
5829
|
-
}
|
|
5830
|
-
case "\\": {
|
|
5831
|
-
if (i >= chars.length) {
|
|
5832
|
-
top().push(exact(92));
|
|
5833
|
-
} else if (/[0-9]/.test(chars[i])) {
|
|
5834
|
-
throw new PatternError("invalid_pattern", "back-references (\\1) work in Replace with, not in Find what");
|
|
5835
|
-
} else {
|
|
5836
|
-
top().push(exact(cpOf(chars[i++])));
|
|
5837
|
-
}
|
|
5838
|
-
break;
|
|
5839
|
-
}
|
|
5840
|
-
case "^": {
|
|
5841
|
-
if (i >= chars.length) {
|
|
5842
|
-
top().push(exact(94));
|
|
5843
|
-
break;
|
|
5844
|
-
}
|
|
5845
|
-
const n = chars[i];
|
|
5846
|
-
const code = findCode(n);
|
|
5847
|
-
if (code) {
|
|
5848
|
-
if (n === "p") spans = true;
|
|
5849
|
-
top().push(code);
|
|
5850
|
-
i++;
|
|
5851
|
-
break;
|
|
5852
|
-
}
|
|
5853
|
-
const num = numericCode(chars, i);
|
|
5854
|
-
if (num) {
|
|
5855
|
-
if (num.cp === PARA) spans = true;
|
|
5856
|
-
top().push(exact(num.cp));
|
|
5857
|
-
i += num.used;
|
|
5858
|
-
} else {
|
|
5859
|
-
top().push(exact(94));
|
|
5860
|
-
}
|
|
5861
|
-
break;
|
|
5862
|
-
}
|
|
5863
|
-
default:
|
|
5864
|
-
top().push(exact(cpOf(c)));
|
|
5865
|
-
}
|
|
5866
|
-
}
|
|
5867
|
-
if (stack.length > 1) throw new PatternError("invalid_pattern", "a ( needs a closing )");
|
|
5868
|
-
return { node: { k: "cat", items: stack[0].items }, spans, groups };
|
|
5869
|
-
}
|
|
5870
|
-
function compileProgram(node) {
|
|
5871
|
-
const prog = [];
|
|
5872
|
-
const push = (inst) => {
|
|
5873
|
-
if (prog.length >= MAX_PROGRAM_SIZE) {
|
|
5874
|
-
throw new PatternError("too_complex", "the pattern is too complex (too many repeats)");
|
|
5875
|
-
}
|
|
5876
|
-
prog.push(inst);
|
|
5877
|
-
return prog.length - 1;
|
|
5878
|
-
};
|
|
5879
|
-
const emit = (n) => {
|
|
5880
|
-
switch (n.k) {
|
|
5881
|
-
case "char":
|
|
5882
|
-
push({ op: 0 /* Char */, test: n.test });
|
|
5883
|
-
return;
|
|
5884
|
-
case "cat":
|
|
5885
|
-
n.items.forEach(emit);
|
|
5886
|
-
return;
|
|
5887
|
-
case "group":
|
|
5888
|
-
push({ op: 3 /* Save */, n: 2 * n.index });
|
|
5889
|
-
emit(n.body);
|
|
5890
|
-
push({ op: 3 /* Save */, n: 2 * n.index + 1 });
|
|
5891
|
-
return;
|
|
5892
|
-
case "assert":
|
|
5893
|
-
push({ op: 4 /* Assert */, kind: n.kind });
|
|
5894
|
-
return;
|
|
5895
|
-
case "rep": {
|
|
5896
|
-
for (let k = 0; k < n.min; k++) emit(n.body);
|
|
5897
|
-
if (n.max < 0) {
|
|
5898
|
-
const split = push({ op: 1 /* Split */, x: 0, y: 0 });
|
|
5899
|
-
emit(n.body);
|
|
5900
|
-
push({ op: 2 /* Jmp */, x: split });
|
|
5901
|
-
const exit2 = prog.length;
|
|
5902
|
-
const inst = prog[split];
|
|
5903
|
-
inst.x = n.lazy ? exit2 : split + 1;
|
|
5904
|
-
inst.y = n.lazy ? split + 1 : exit2;
|
|
5905
|
-
return;
|
|
5906
|
-
}
|
|
5907
|
-
const splits = [];
|
|
5908
|
-
for (let k = n.min; k < n.max; k++) {
|
|
5909
|
-
splits.push(push({ op: 1 /* Split */, x: 0, y: 0 }));
|
|
5910
|
-
emit(n.body);
|
|
5911
|
-
}
|
|
5912
|
-
const exit = prog.length;
|
|
5913
|
-
for (const s of splits) {
|
|
5914
|
-
const inst = prog[s];
|
|
5915
|
-
inst.x = n.lazy ? exit : s + 1;
|
|
5916
|
-
inst.y = n.lazy ? s + 1 : exit;
|
|
5917
|
-
}
|
|
5918
|
-
return;
|
|
5919
|
-
}
|
|
5920
|
-
}
|
|
5921
|
-
};
|
|
5922
|
-
push({ op: 3 /* Save */, n: 0 });
|
|
5923
|
-
emit(node);
|
|
5924
|
-
push({ op: 3 /* Save */, n: 1 });
|
|
5925
|
-
push({ op: 5 /* Match */ });
|
|
5926
|
-
return prog;
|
|
5927
|
-
}
|
|
5928
|
-
function checkAssert(kind, hay, pos) {
|
|
5929
|
-
const before = isWordChar(cpBefore(hay, pos));
|
|
5930
|
-
const after = isWordChar(cpAt(hay, pos));
|
|
5931
|
-
switch (kind) {
|
|
5932
|
-
case "boundary":
|
|
5933
|
-
return before !== after;
|
|
5934
|
-
case "wordStart":
|
|
5935
|
-
return !before && after;
|
|
5936
|
-
case "wordEnd":
|
|
5937
|
-
return before && !after;
|
|
5938
|
-
}
|
|
5939
|
-
}
|
|
5940
|
-
function pikeExec(prog, groupCount, caseInsensitive, hay, start2, end, budget) {
|
|
5941
|
-
const ncap = 2 * (groupCount + 1);
|
|
5942
|
-
const mark = new Int32Array(prog.length);
|
|
5943
|
-
let gen = 1;
|
|
5944
|
-
let clistPc = [];
|
|
5945
|
-
let clistCaps = [];
|
|
5946
|
-
let nlistPc = [];
|
|
5947
|
-
let nlistCaps = [];
|
|
5948
|
-
const stackPc = [];
|
|
5949
|
-
const stackCaps = [];
|
|
5950
|
-
let matched = null;
|
|
5951
|
-
const initial = new Int32Array(ncap).fill(-1);
|
|
5952
|
-
const add = (listPc, listCaps, pc0, caps0, pos) => {
|
|
5953
|
-
stackPc.push(pc0);
|
|
5954
|
-
stackCaps.push(caps0);
|
|
5955
|
-
while (stackPc.length) {
|
|
5956
|
-
const pc = stackPc.pop();
|
|
5957
|
-
const caps = stackCaps.pop();
|
|
5958
|
-
if (mark[pc] === gen) continue;
|
|
5959
|
-
mark[pc] = gen;
|
|
5960
|
-
const inst = prog[pc];
|
|
5961
|
-
switch (inst.op) {
|
|
5962
|
-
case 2 /* Jmp */:
|
|
5963
|
-
stackPc.push(inst.x);
|
|
5964
|
-
stackCaps.push(caps);
|
|
5965
|
-
break;
|
|
5966
|
-
case 1 /* Split */:
|
|
5967
|
-
stackPc.push(inst.y, inst.x);
|
|
5968
|
-
stackCaps.push(caps, caps);
|
|
5969
|
-
break;
|
|
5970
|
-
case 3 /* Save */: {
|
|
5971
|
-
const next = caps.slice();
|
|
5972
|
-
next[inst.n] = pos;
|
|
5973
|
-
stackPc.push(pc + 1);
|
|
5974
|
-
stackCaps.push(next);
|
|
5975
|
-
break;
|
|
5976
|
-
}
|
|
5977
|
-
case 4 /* Assert */:
|
|
5978
|
-
if (checkAssert(inst.kind, hay, pos)) {
|
|
5979
|
-
stackPc.push(pc + 1);
|
|
5980
|
-
stackCaps.push(caps);
|
|
5981
|
-
}
|
|
5982
|
-
break;
|
|
5983
|
-
default:
|
|
5984
|
-
listPc.push(pc);
|
|
5985
|
-
listCaps.push(caps);
|
|
5986
|
-
}
|
|
5987
|
-
}
|
|
5988
|
-
};
|
|
5989
|
-
let i = start2;
|
|
5990
|
-
if (budget.steps <= 0 || now() > budget.deadline) {
|
|
5991
|
-
budget.exhausted = true;
|
|
5992
|
-
return "budget";
|
|
5993
|
-
}
|
|
5994
|
-
let steps = 0;
|
|
5995
|
-
for (; ; ) {
|
|
5996
|
-
if (!matched) add(clistPc, clistCaps, 0, initial, i);
|
|
5997
|
-
const cp = i < end ? hay.codePointAt(i) : -1;
|
|
5998
|
-
const width = cp > 65535 ? 2 : 1;
|
|
5999
|
-
if (clistPc.length === 0) {
|
|
6000
|
-
if (matched || i >= end) break;
|
|
6001
|
-
gen++;
|
|
6002
|
-
i += width;
|
|
6003
|
-
continue;
|
|
6004
|
-
}
|
|
6005
|
-
const folded = cp >= 0 && caseInsensitive ? foldCodePoint(cp) : cp;
|
|
6006
|
-
gen++;
|
|
6007
|
-
nlistPc = [];
|
|
6008
|
-
nlistCaps = [];
|
|
6009
|
-
for (let t = 0; t < clistPc.length; t++) {
|
|
6010
|
-
if (++steps >= 4096) {
|
|
6011
|
-
budget.steps -= steps;
|
|
6012
|
-
steps = 0;
|
|
6013
|
-
if (budget.steps <= 0 || now() > budget.deadline) {
|
|
6014
|
-
budget.exhausted = true;
|
|
6015
|
-
return "budget";
|
|
6016
|
-
}
|
|
6017
|
-
}
|
|
6018
|
-
const inst = prog[clistPc[t]];
|
|
6019
|
-
if (inst.op === 0 /* Char */) {
|
|
6020
|
-
if (cp >= 0 && inst.test(cp, folded)) add(nlistPc, nlistCaps, clistPc[t] + 1, clistCaps[t], i + width);
|
|
6021
|
-
} else if (inst.op === 5 /* Match */) {
|
|
6022
|
-
matched = clistCaps[t];
|
|
6023
|
-
break;
|
|
6024
|
-
}
|
|
6025
|
-
}
|
|
6026
|
-
clistPc = nlistPc;
|
|
6027
|
-
clistCaps = nlistCaps;
|
|
6028
|
-
if (i >= end) break;
|
|
6029
|
-
i += width;
|
|
6030
|
-
}
|
|
6031
|
-
budget.steps -= steps;
|
|
6032
|
-
if (!matched) return null;
|
|
6033
|
-
const groups = [];
|
|
6034
|
-
for (let g = 0; g <= groupCount; g++) {
|
|
6035
|
-
const a = matched[2 * g];
|
|
6036
|
-
const b = matched[2 * g + 1];
|
|
6037
|
-
groups.push(a >= 0 && b >= 0 ? hay.slice(a, b) : void 0);
|
|
6038
|
-
}
|
|
6039
|
-
return { start: matched[0], end: matched[1], groups };
|
|
6040
|
-
}
|
|
6041
|
-
var WORD_CLASS = "[\\p{L}\\p{M}\\p{Nd}\\p{Pc}]";
|
|
6042
|
-
var REGEX_BOUNDARY = `(?:(?<=${WORD_CLASS})(?!${WORD_CLASS})|(?<!${WORD_CLASS})(?=${WORD_CLASS}))`;
|
|
6043
|
-
function hasNestedRepeat(source) {
|
|
6044
|
-
const quantifierAt = (i) => {
|
|
6045
|
-
const c = source[i];
|
|
6046
|
-
if (c === "*" || c === "+") return { repeats: true, many: true };
|
|
6047
|
-
if (c === "{") {
|
|
6048
|
-
const m = /^\{(\d*)(,?)(\d*)\}/.exec(source.slice(i));
|
|
6049
|
-
if (m) {
|
|
6050
|
-
const max = m[2] ? m[3] ? Number(m[3]) : Infinity : Number(m[1]);
|
|
6051
|
-
return { repeats: max > 1, many: max > 1 };
|
|
6052
|
-
}
|
|
6053
|
-
}
|
|
6054
|
-
return { repeats: false, many: false };
|
|
6055
|
-
};
|
|
6056
|
-
const stack = [];
|
|
6057
|
-
let inClass = false;
|
|
6058
|
-
for (let i = 0; i < source.length; i++) {
|
|
6059
|
-
const c = source[i];
|
|
6060
|
-
if (c === "\\") {
|
|
6061
|
-
i++;
|
|
6062
|
-
continue;
|
|
6063
|
-
}
|
|
6064
|
-
if (inClass) {
|
|
6065
|
-
if (c === "]") inClass = false;
|
|
6066
|
-
continue;
|
|
6067
|
-
}
|
|
6068
|
-
if (c === "[") {
|
|
6069
|
-
inClass = true;
|
|
6070
|
-
} else if (c === "(") {
|
|
6071
|
-
stack.push(false);
|
|
6072
|
-
} else if (c === ")") {
|
|
6073
|
-
const inner = _nullishCoalesce(stack.pop(), () => ( false));
|
|
6074
|
-
const q = quantifierAt(i + 1);
|
|
6075
|
-
if (inner && q.many) return true;
|
|
6076
|
-
if (stack.length && (inner || q.repeats)) stack[stack.length - 1] = true;
|
|
6077
|
-
} else if (stack.length && quantifierAt(i).repeats) {
|
|
6078
|
-
stack[stack.length - 1] = true;
|
|
6079
|
-
}
|
|
6080
|
-
}
|
|
6081
|
-
return false;
|
|
6082
|
-
}
|
|
6083
|
-
function compileRegex(query, o) {
|
|
6084
|
-
if (hasNestedRepeat(query)) {
|
|
6085
|
-
throw new PatternError(
|
|
6086
|
-
"too_complex",
|
|
6087
|
-
"a repeated group containing a repeat, like (a+)+, can take exponential time; rewrite it without nesting"
|
|
6088
|
-
);
|
|
6089
|
-
}
|
|
6090
|
-
let source = query;
|
|
6091
|
-
if (o.wholeWord || o.matchPrefix && o.matchSuffix) source = `${REGEX_BOUNDARY}(?:${query})${REGEX_BOUNDARY}`;
|
|
6092
|
-
else if (o.matchPrefix) source = `${REGEX_BOUNDARY}(?:${query})`;
|
|
6093
|
-
else if (o.matchSuffix) source = `(?:${query})${REGEX_BOUNDARY}`;
|
|
6094
|
-
let re;
|
|
6095
|
-
try {
|
|
6096
|
-
re = new RegExp(source, o.matchCase ? "gu" : "giu");
|
|
6097
|
-
} catch (error) {
|
|
6098
|
-
throw new PatternError("invalid_pattern", `bad pattern: ${error instanceof Error ? error.message : String(error)}`);
|
|
6099
|
-
}
|
|
6100
|
-
let slicedFor = null;
|
|
6101
|
-
return {
|
|
6102
|
-
mode: "regex",
|
|
6103
|
-
spansParagraphs: false,
|
|
6104
|
-
caseInsensitive: !o.matchCase,
|
|
6105
|
-
groupCount: 0,
|
|
6106
|
-
exec(hay, start2, end, budget) {
|
|
6107
|
-
if (now() > budget.deadline) {
|
|
6108
|
-
budget.exhausted = true;
|
|
6109
|
-
return "budget";
|
|
6110
|
-
}
|
|
6111
|
-
let text = hay;
|
|
6112
|
-
if (end < hay.length) {
|
|
6113
|
-
if (!slicedFor || slicedFor.hay !== hay || slicedFor.end !== end) {
|
|
6114
|
-
slicedFor = { hay, end, text: hay.slice(0, end) };
|
|
6115
|
-
}
|
|
6116
|
-
text = slicedFor.text;
|
|
6117
|
-
}
|
|
6118
|
-
re.lastIndex = start2;
|
|
6119
|
-
const m = re.exec(text);
|
|
6120
|
-
if (!m) return null;
|
|
6121
|
-
return { start: m.index, end: m.index + m[0].length, groups: Array.from(m) };
|
|
6122
|
-
}
|
|
6123
|
-
};
|
|
6124
|
-
}
|
|
6125
|
-
function compileFindPattern(query, options = {}) {
|
|
6126
|
-
try {
|
|
6127
|
-
if (Array.from(query).length > MAX_FIND_PATTERN_LENGTH) {
|
|
6128
|
-
throw new PatternError("too_long", `the Find what text is longer than ${MAX_FIND_PATTERN_LENGTH} characters`);
|
|
6129
|
-
}
|
|
6130
|
-
if (options.regex) return { ok: true, pattern: compileRegex(query, options) };
|
|
6131
|
-
const wildcards = !!options.wildcards && !options.literal;
|
|
6132
|
-
const caseInsensitive = !options.matchCase && !wildcards;
|
|
6133
|
-
let node;
|
|
6134
|
-
let spans;
|
|
6135
|
-
let groups = 0;
|
|
6136
|
-
if (wildcards) {
|
|
6137
|
-
({ node, spans, groups } = parseWildcards(query));
|
|
6138
|
-
} else {
|
|
6139
|
-
({ node, spans } = parseSpecial(query, options, caseInsensitive));
|
|
6140
|
-
const before = options.wholeWord || options.matchPrefix;
|
|
6141
|
-
const after = options.wholeWord || options.matchSuffix;
|
|
6142
|
-
if (before || after) {
|
|
6143
|
-
const items = [];
|
|
6144
|
-
if (before) items.push({ k: "assert", kind: "boundary" });
|
|
6145
|
-
items.push(node);
|
|
6146
|
-
if (after) items.push({ k: "assert", kind: "boundary" });
|
|
6147
|
-
node = { k: "cat", items };
|
|
6148
|
-
}
|
|
6149
|
-
}
|
|
6150
|
-
const prog = compileProgram(node);
|
|
6151
|
-
return {
|
|
6152
|
-
ok: true,
|
|
6153
|
-
pattern: {
|
|
6154
|
-
mode: wildcards ? "wildcards" : "special",
|
|
6155
|
-
spansParagraphs: spans,
|
|
6156
|
-
caseInsensitive,
|
|
6157
|
-
groupCount: groups,
|
|
6158
|
-
exec: (hay, start2, end, budget) => pikeExec(prog, groups, caseInsensitive, hay, start2, end, budget)
|
|
6159
|
-
}
|
|
6160
|
-
};
|
|
6161
|
-
} catch (error) {
|
|
6162
|
-
if (error instanceof PatternError) return { ok: false, error: { code: error.code, message: error.message } };
|
|
6163
|
-
return { ok: false, error: { code: "invalid_pattern", message: error instanceof Error ? error.message : String(error) } };
|
|
6164
|
-
}
|
|
6165
|
-
}
|
|
6166
|
-
function findAllMatches(pattern, hay, options = {}) {
|
|
6167
|
-
const budget = _nullishCoalesce(options.budget, () => ( createSearchBudget()));
|
|
6168
|
-
const maxMatches = _nullishCoalesce(options.maxMatches, () => ( 1e4));
|
|
6169
|
-
const cuts = [..._nullishCoalesce(options.cuts, () => ( [])), hay.length].sort((a, b) => a - b);
|
|
6170
|
-
const matches = [];
|
|
6171
|
-
let from = 0;
|
|
6172
|
-
for (const cut of cuts) {
|
|
6173
|
-
if (cut <= from) continue;
|
|
6174
|
-
let pos = from;
|
|
6175
|
-
from = cut;
|
|
6176
|
-
for (; ; ) {
|
|
6177
|
-
const m = pattern.exec(hay, pos, cut, budget);
|
|
6178
|
-
if (m === "budget") return { matches, truncated: true };
|
|
6179
|
-
if (!m) break;
|
|
6180
|
-
const empty = m.end === m.start;
|
|
6181
|
-
const next = empty ? m.end + (cpAt(hay, m.end) > 65535 ? 2 : 1) : m.end;
|
|
6182
|
-
if (next > cut) break;
|
|
6183
|
-
pos = next;
|
|
6184
|
-
if (empty) continue;
|
|
6185
|
-
matches.push(m);
|
|
6186
|
-
if (matches.length >= maxMatches) return { matches, truncated: true };
|
|
6187
|
-
}
|
|
6188
|
-
}
|
|
6189
|
-
return { matches, truncated: false };
|
|
6190
|
-
}
|
|
6191
|
-
function parseReplacement(replacement, options = {}) {
|
|
6192
|
-
if (options.literal || options.regex) return replacement ? [{ type: "text", text: replacement }] : [];
|
|
6193
|
-
const chars = toChars(replacement);
|
|
6194
|
-
const out = [];
|
|
6195
|
-
let cur = "";
|
|
6196
|
-
const flush = () => {
|
|
6197
|
-
if (cur) out.push({ type: "text", text: cur });
|
|
6198
|
-
cur = "";
|
|
6199
|
-
};
|
|
6200
|
-
let i = 0;
|
|
6201
|
-
while (i < chars.length) {
|
|
6202
|
-
const c = chars[i++];
|
|
6203
|
-
if (c === "\\" && options.wildcards && i < chars.length) {
|
|
6204
|
-
const d = chars[i];
|
|
6205
|
-
if (/[1-9]/.test(d)) {
|
|
6206
|
-
flush();
|
|
6207
|
-
out.push({ type: "group", index: Number(d) });
|
|
6208
|
-
} else {
|
|
6209
|
-
cur += d;
|
|
6210
|
-
}
|
|
6211
|
-
i++;
|
|
6212
|
-
continue;
|
|
6213
|
-
}
|
|
6214
|
-
if (c === "^" && i < chars.length) {
|
|
6215
|
-
const n = chars[i];
|
|
6216
|
-
if (n === "&" || n === "c") {
|
|
6217
|
-
flush();
|
|
6218
|
-
out.push(n === "&" ? { type: "found" } : { type: "clipboard" });
|
|
6219
|
-
i++;
|
|
6220
|
-
continue;
|
|
6221
|
-
}
|
|
6222
|
-
const code = replaceCode(n);
|
|
6223
|
-
if (code !== null) {
|
|
6224
|
-
cur += code;
|
|
6225
|
-
i++;
|
|
6226
|
-
continue;
|
|
6227
|
-
}
|
|
6228
|
-
const num = numericCode(chars, i);
|
|
6229
|
-
if (num) {
|
|
6230
|
-
cur += String.fromCodePoint(num.cp);
|
|
6231
|
-
i += num.used;
|
|
6232
|
-
continue;
|
|
6233
|
-
}
|
|
6234
|
-
}
|
|
6235
|
-
cur += c;
|
|
6236
|
-
}
|
|
6237
|
-
flush();
|
|
6238
|
-
return out;
|
|
6239
|
-
}
|
|
6240
|
-
function expandReplacement(pieces, match, clipboardText = "") {
|
|
6241
|
-
let out = "";
|
|
6242
|
-
for (const piece of pieces) {
|
|
6243
|
-
switch (piece.type) {
|
|
6244
|
-
case "text":
|
|
6245
|
-
out += piece.text;
|
|
6246
|
-
break;
|
|
6247
|
-
case "found":
|
|
6248
|
-
out += _nullishCoalesce(match.groups[0], () => ( ""));
|
|
6249
|
-
break;
|
|
6250
|
-
case "group":
|
|
6251
|
-
out += _nullishCoalesce(match.groups[piece.index], () => ( ""));
|
|
6252
|
-
break;
|
|
6253
|
-
case "clipboard":
|
|
6254
|
-
out += clipboardText.replace(/\r\n/g, "\r").replace(/\n/g, "\r");
|
|
6255
|
-
break;
|
|
6256
|
-
}
|
|
6257
|
-
}
|
|
6258
|
-
return out;
|
|
6259
|
-
}
|
|
6260
|
-
|
|
6261
|
-
// src/extensions/find-replace/search.ts
|
|
6262
|
-
var DELETION_MARK = "deletion";
|
|
6263
|
-
var DROPPED_REPLACEMENT_MARKS = /* @__PURE__ */ new Set([DELETION_MARK, "formatChange"]);
|
|
6264
|
-
var OBJECT_CHAR = "\uFFFC";
|
|
6265
|
-
function searchDocument(doc, query, options = {}, searchOptions = {}) {
|
|
6266
|
-
if (!query) return { matches: [], truncated: false, error: null };
|
|
6267
|
-
const compiled = compileFindPattern(query, options);
|
|
6268
|
-
if (!compiled.ok) return { matches: [], truncated: false, error: compiled.error };
|
|
6269
|
-
const pattern = compiled.pattern;
|
|
6270
|
-
const pieces = parseReplacement(_nullishCoalesce(searchOptions.replacement, () => ( "")), options);
|
|
6271
|
-
const budget = createSearchBudget({ timeLimitMs: searchOptions.timeLimitMs });
|
|
6272
|
-
const maxMatches = _nullishCoalesce(searchOptions.maxMatches, () => ( 1e4));
|
|
6273
|
-
const blocks = [];
|
|
6274
|
-
doc.descendants((node, pos, parent, index) => {
|
|
6275
|
-
if (!node.isTextblock) return true;
|
|
6276
|
-
blocks.push({ node, pos, parent, index });
|
|
6277
|
-
return false;
|
|
6278
|
-
});
|
|
6279
|
-
const chunks = [];
|
|
6280
|
-
blocks.forEach((block, i) => {
|
|
6281
|
-
const prev = blocks[i - 1];
|
|
6282
|
-
const joins = pattern.spansParagraphs && prev && prev.parent === block.parent && prev.index + 1 === block.index;
|
|
6283
|
-
if (joins) chunks[chunks.length - 1].push(block);
|
|
6284
|
-
else chunks.push([block]);
|
|
6285
|
-
});
|
|
6286
|
-
const matches = [];
|
|
6287
|
-
let truncated = false;
|
|
6288
|
-
for (const chunk of chunks) {
|
|
6289
|
-
let hay = "";
|
|
6290
|
-
const posOf = [];
|
|
6291
|
-
const endOf = [];
|
|
6292
|
-
const cuts = [];
|
|
6293
|
-
chunk.forEach((block, k) => {
|
|
6294
|
-
const contentStart = block.pos + 1;
|
|
6295
|
-
block.node.forEach((child, offset) => {
|
|
6296
|
-
const at = contentStart + offset;
|
|
6297
|
-
if (child.marks.some((m) => m.type.name === DELETION_MARK)) {
|
|
6298
|
-
if (cuts[cuts.length - 1] !== hay.length) cuts.push(hay.length);
|
|
6299
|
-
return;
|
|
6300
|
-
}
|
|
6301
|
-
if (child.isText) {
|
|
6302
|
-
const text = _nullishCoalesce(child.text, () => ( ""));
|
|
6303
|
-
for (let j = 0; j < text.length; j++) {
|
|
6304
|
-
posOf.push(at + j);
|
|
6305
|
-
endOf.push(at + j + 1);
|
|
6306
|
-
}
|
|
6307
|
-
hay += text;
|
|
6308
|
-
} else {
|
|
6309
|
-
posOf.push(at);
|
|
6310
|
-
endOf.push(at + child.nodeSize);
|
|
6311
|
-
hay += child.type.name === "hardBreak" ? "\n" : OBJECT_CHAR;
|
|
6312
|
-
}
|
|
6313
|
-
});
|
|
6314
|
-
const next = chunk[k + 1];
|
|
6315
|
-
if (next) {
|
|
6316
|
-
posOf.push(contentStart + block.node.content.size);
|
|
6317
|
-
endOf.push(next.pos + 1);
|
|
6318
|
-
hay += FIND_PARAGRAPH_MARK;
|
|
6319
|
-
}
|
|
6320
|
-
});
|
|
6321
|
-
if (!hay) continue;
|
|
6322
|
-
const result = findAllMatches(pattern, hay, {
|
|
6323
|
-
cuts,
|
|
6324
|
-
budget,
|
|
6325
|
-
maxMatches: maxMatches - matches.length
|
|
6326
|
-
});
|
|
6327
|
-
for (const m of result.matches) {
|
|
6328
|
-
matches.push({
|
|
6329
|
-
from: posOf[m.start],
|
|
6330
|
-
to: endOf[m.end - 1],
|
|
6331
|
-
text: _nullishCoalesce(m.groups[0], () => ( hay.slice(m.start, m.end))),
|
|
6332
|
-
replacement: expandReplacement(pieces, m, _nullishCoalesce(searchOptions.clipboardText, () => ( "")))
|
|
6333
|
-
});
|
|
6334
|
-
}
|
|
6335
|
-
if (result.truncated) {
|
|
6336
|
-
truncated = true;
|
|
6337
|
-
break;
|
|
6338
|
-
}
|
|
6339
|
-
}
|
|
6340
|
-
return { matches, truncated, error: null };
|
|
6341
|
-
}
|
|
6342
|
-
function replacementMarks(doc, from, to) {
|
|
6343
|
-
const $from = doc.resolve(from);
|
|
6344
|
-
const node = from < to ? $from.nodeAfter : null;
|
|
6345
|
-
const marks = node ? node.marks : $from.marks();
|
|
6346
|
-
return marks.filter((m) => !DROPPED_REPLACEMENT_MARKS.has(m.type.name));
|
|
6347
|
-
}
|
|
6348
|
-
function inlineContent(schema, text, marks) {
|
|
6349
|
-
const nodes = [];
|
|
6350
|
-
const hardBreak = schema.nodes.hardBreak;
|
|
6351
|
-
const parts = hardBreak ? text.split("\n") : [text];
|
|
6352
|
-
parts.forEach((part, i) => {
|
|
6353
|
-
if (i > 0) nodes.push(hardBreak.create(null, null, marks));
|
|
6354
|
-
if (part) nodes.push(schema.text(part, marks));
|
|
6355
|
-
});
|
|
6356
|
-
return nodes;
|
|
6357
|
-
}
|
|
6358
|
-
function applyReplacements(tr, matches) {
|
|
6359
|
-
const ends = new Array(matches.length);
|
|
6360
|
-
const schema = tr.doc.type.schema;
|
|
6361
|
-
for (let i = matches.length - 1; i >= 0; i--) {
|
|
6362
|
-
const { from, to, replacement } = matches[i];
|
|
6363
|
-
const marks = replacementMarks(tr.doc, from, to);
|
|
6364
|
-
const parts = replacement.split(/[\r\u2029]/);
|
|
6365
|
-
const stepsBefore = tr.steps.length;
|
|
6366
|
-
const first = inlineContent(schema, parts[0], marks);
|
|
6367
|
-
if (first.length) tr.replaceWith(from, to, first);
|
|
6368
|
-
else if (to > from) tr.delete(from, to);
|
|
6369
|
-
let pos = tr.mapping.slice(stepsBefore).map(to, 1);
|
|
6370
|
-
for (let k = 1; k < parts.length; k++) {
|
|
6371
|
-
tr.split(pos);
|
|
6372
|
-
pos += 2;
|
|
6373
|
-
const content = inlineContent(schema, parts[k], marks);
|
|
6374
|
-
if (content.length) {
|
|
6375
|
-
tr.insert(pos, content);
|
|
6376
|
-
pos += content.reduce((size, node) => size + node.nodeSize, 0);
|
|
6377
|
-
}
|
|
6378
|
-
}
|
|
6379
|
-
const map = tr.mapping.slice(stepsBefore);
|
|
6380
|
-
for (let j = i + 1; j < matches.length; j++) ends[j] = map.map(ends[j], 1);
|
|
6381
|
-
ends[i] = pos;
|
|
6382
|
-
}
|
|
6383
|
-
return ends;
|
|
6384
|
-
}
|
|
6385
|
-
|
|
6386
|
-
// src/extensions/find-replace/extension.ts
|
|
6387
5519
|
var EMPTY_OPTIONS = Object.freeze({});
|
|
6388
5520
|
var EMPTY_FIND_REPLACE_SNAPSHOT = Object.freeze({
|
|
6389
5521
|
open: false,
|
|
@@ -6578,7 +5710,7 @@ var FindReplace = _core.Extension.create({
|
|
|
6578
5710
|
if (!s || !s.active || s.currentIndex < 0 || !s.matches[s.currentIndex]) return false;
|
|
6579
5711
|
if (dispatch) {
|
|
6580
5712
|
_history.closeHistory.call(void 0, tr);
|
|
6581
|
-
const [end] = applyReplacements(tr, [s.matches[s.currentIndex]]);
|
|
5713
|
+
const [end] = _chunkJ3R2OWOEcjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
|
|
6582
5714
|
tr.setSelection(_state.TextSelection.create(tr.doc, end)).scrollIntoView();
|
|
6583
5715
|
meta(tr, { type: "replaced", anchor: end, count: 1 });
|
|
6584
5716
|
}
|
|
@@ -6589,7 +5721,7 @@ var FindReplace = _core.Extension.create({
|
|
|
6589
5721
|
if (!s || !s.active || !s.matches.length) return false;
|
|
6590
5722
|
if (dispatch) {
|
|
6591
5723
|
_history.closeHistory.call(void 0, tr);
|
|
6592
|
-
const ends = applyReplacements(tr, s.matches);
|
|
5724
|
+
const ends = _chunkJ3R2OWOEcjs.applyReplacements.call(void 0, tr, s.matches);
|
|
6593
5725
|
meta(tr, { type: "replaced", anchor: ends[ends.length - 1], count: s.matches.length });
|
|
6594
5726
|
}
|
|
6595
5727
|
return true;
|
|
@@ -6621,7 +5753,7 @@ var FindReplace = _core.Extension.create({
|
|
|
6621
5753
|
if (!s.active || !s.query) {
|
|
6622
5754
|
return { ...s, matches: [], currentIndex: -1, error: null, truncated: false };
|
|
6623
5755
|
}
|
|
6624
|
-
const result = searchDocument(doc, s.query, s.options, {
|
|
5756
|
+
const result = _chunkJ3R2OWOEcjs.searchDocument.call(void 0, doc, s.query, s.options, {
|
|
6625
5757
|
replacement: s.replacement,
|
|
6626
5758
|
clipboardText: safeClipboard(options.getClipboardText),
|
|
6627
5759
|
timeLimitMs: options.timeLimitMs,
|
|
@@ -7208,7 +6340,7 @@ function createRichTextPreset(options = {}) {
|
|
|
7208
6340
|
})
|
|
7209
6341
|
];
|
|
7210
6342
|
if (options.table !== false) {
|
|
7211
|
-
extensions2.push(...
|
|
6343
|
+
extensions2.push(..._chunkJ3R2OWOEcjs.createTableExtensions.call(void 0, optionObject(options.table)));
|
|
7212
6344
|
}
|
|
7213
6345
|
if (characterLimit) {
|
|
7214
6346
|
extensions2.push(
|
|
@@ -7452,7 +6584,7 @@ function createFindReplaceCommands(editor, options = {}) {
|
|
|
7452
6584
|
];
|
|
7453
6585
|
}
|
|
7454
6586
|
function validateFindPattern(query, options = {}) {
|
|
7455
|
-
const result = compileFindPattern(query, options);
|
|
6587
|
+
const result = _chunkJ3R2OWOEcjs.compileFindPattern.call(void 0, query, options);
|
|
7456
6588
|
return result.ok ? null : result.error;
|
|
7457
6589
|
}
|
|
7458
6590
|
|
|
@@ -7461,8 +6593,8 @@ var PARAMS = {
|
|
|
7461
6593
|
insertTable: {
|
|
7462
6594
|
type: "object",
|
|
7463
6595
|
properties: {
|
|
7464
|
-
rows: { type: "integer", minimum: 1, maximum:
|
|
7465
|
-
cols: { type: "integer", minimum: 1, maximum:
|
|
6596
|
+
rows: { type: "integer", minimum: 1, maximum: _chunkJ3R2OWOEcjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
|
|
6597
|
+
cols: { type: "integer", minimum: 1, maximum: _chunkJ3R2OWOEcjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
|
|
7466
6598
|
withHeaderRow: { type: "boolean", description: "Make the first row a header row (default true)." }
|
|
7467
6599
|
},
|
|
7468
6600
|
additionalProperties: false
|
|
@@ -7493,7 +6625,7 @@ function createTableCommands(editor, options = {}) {
|
|
|
7493
6625
|
const group = _nullishCoalesce(options.group, () => ( "Table"));
|
|
7494
6626
|
const scope = options.scope ? { scope: options.scope } : {};
|
|
7495
6627
|
const focus = _nullishCoalesce(options.focus, () => ( true));
|
|
7496
|
-
return
|
|
6628
|
+
return _chunkJ3R2OWOEcjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
|
|
7497
6629
|
const params = PARAMS[action];
|
|
7498
6630
|
return {
|
|
7499
6631
|
id: `${prefix}${action}`,
|
|
@@ -7503,13 +6635,13 @@ function createTableCommands(editor, options = {}) {
|
|
|
7503
6635
|
description,
|
|
7504
6636
|
...params ? { params } : {},
|
|
7505
6637
|
...scope,
|
|
7506
|
-
enabled: (_ctx, p) =>
|
|
6638
|
+
enabled: (_ctx, p) => _chunkJ3R2OWOEcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
|
|
7507
6639
|
run: (_ctx, p) => {
|
|
7508
|
-
if (!
|
|
7509
|
-
const reason =
|
|
6640
|
+
if (!_chunkJ3R2OWOEcjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
|
|
6641
|
+
const reason = _chunkJ3R2OWOEcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
|
|
7510
6642
|
throw new Error(reason === true ? `${label} did not change the document.` : reason);
|
|
7511
6643
|
}
|
|
7512
|
-
const state =
|
|
6644
|
+
const state = _chunkJ3R2OWOEcjs.getTableState.call(void 0, editor);
|
|
7513
6645
|
return {
|
|
7514
6646
|
done: true,
|
|
7515
6647
|
table: state.inTable ? { rows: state.rows, columns: state.columns, row: state.row, column: state.column } : null
|
|
@@ -7640,15 +6772,5 @@ function createTableCommands(editor, options = {}) {
|
|
|
7640
6772
|
|
|
7641
6773
|
|
|
7642
6774
|
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
exports.GradientText = GradientText; exports.SlashCommands = SlashCommands; exports.TemplateSuggestions = TemplateSuggestions; 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.commentsPluginKey = commentsPluginKey; exports.COMMENT_MARK_NAME = COMMENT_MARK_NAME; exports.findCommentRanges = findCommentRanges; exports.getCommentAnchors = getCommentAnchors; exports.getCommentIdsAt = getCommentIdsAt; exports.getCommentStore = getCommentStore; exports.Comments = Comments; exports.getCommentAuthor = getCommentAuthor; 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.FIND_PARAGRAPH_MARK = FIND_PARAGRAPH_MARK; exports.MAX_FIND_PATTERN_LENGTH = MAX_FIND_PATTERN_LENGTH; exports.createSearchBudget = createSearchBudget; exports.foldCodePoint = foldCodePoint; exports.compileFindPattern = compileFindPattern; exports.findAllMatches = findAllMatches; exports.parseReplacement = parseReplacement; exports.expandReplacement = expandReplacement; exports.searchDocument = searchDocument; exports.applyReplacements = applyReplacements; 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;
|
|
7654
|
-
//# sourceMappingURL=chunk-6MDQKHRH.cjs.map
|
|
6775
|
+
exports.GradientText = GradientText; exports.SlashCommands = SlashCommands; exports.TemplateSuggestions = TemplateSuggestions; 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.commentsPluginKey = commentsPluginKey; exports.COMMENT_MARK_NAME = COMMENT_MARK_NAME; exports.findCommentRanges = findCommentRanges; exports.getCommentAnchors = getCommentAnchors; exports.getCommentIdsAt = getCommentIdsAt; exports.getCommentStore = getCommentStore; exports.Comments = Comments; exports.getCommentAuthor = getCommentAuthor; 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;
|
|
6776
|
+
//# sourceMappingURL=chunk-N4MLNJPO.cjs.map
|