reactjs-tiptap-editor 0.4.1 → 1.0.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/lib/ActionMenuButton-BKOg7hkq.js +38 -0
- package/lib/ActionMenuButton-DLQyd_gx.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.d.cts +43 -55
- package/lib/Attachment.d.ts +43 -55
- package/lib/Attachment.js +129 -99
- package/lib/Blockquote.cjs +3 -3
- package/lib/Blockquote.d.cts +43 -55
- package/lib/Blockquote.d.ts +43 -55
- package/lib/Blockquote.js +50 -22
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +43 -55
- package/lib/Bold.d.ts +43 -55
- package/lib/Bold.js +48 -20
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +43 -55
- package/lib/BulletList.d.ts +43 -55
- package/lib/BulletList.js +38 -9
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +43 -55
- package/lib/Clear.d.ts +43 -55
- package/lib/Clear.js +32 -6
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +43 -55
- package/lib/Code.d.ts +43 -55
- package/lib/Code.js +53 -25
- package/lib/CodeBlock.cjs +35 -35
- package/lib/CodeBlock.d.cts +43 -55
- package/lib/CodeBlock.d.ts +43 -55
- package/lib/CodeBlock.js +605 -590
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +44 -56
- package/lib/CodeView.d.ts +44 -56
- package/lib/CodeView.js +49 -21
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +47 -55
- package/lib/Color.d.ts +47 -55
- package/lib/Color.js +123 -79
- package/lib/Column.cjs +1 -0
- package/lib/{Document.d.cts → Column.d.cts} +49 -58
- package/lib/{Document.d.ts → Column.d.ts} +49 -58
- package/lib/Column.js +217 -0
- package/lib/{Drawer-CaAfmqNo.js → Drawer-DZ5jvmrX.js} +404 -394
- package/lib/Drawer-SRhwOc6T.cjs +1 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +43 -55
- package/lib/Drawer.d.ts +43 -55
- package/lib/Drawer.js +6 -5
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +43 -60
- package/lib/Emoji.d.ts +43 -60
- package/lib/Emoji.js +377 -392
- package/lib/Excalidraw-DwBRXEtC.js +345 -0
- package/lib/Excalidraw-ZN3DQvDC.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +43 -55
- package/lib/Excalidraw.d.ts +43 -55
- package/lib/Excalidraw.js +6 -4
- package/lib/ExportPdf.cjs +5 -5
- package/lib/ExportPdf.d.cts +43 -55
- package/lib/ExportPdf.d.ts +43 -55
- package/lib/ExportPdf.js +60 -32
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +44 -56
- package/lib/ExportWord.d.ts +44 -56
- package/lib/ExportWord.js +84 -21
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +57 -58
- package/lib/FontFamily.d.ts +57 -58
- package/lib/FontFamily.js +72 -74
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +54 -58
- package/lib/FontSize.d.ts +54 -58
- package/lib/FontSize.js +72 -64
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +57 -55
- package/lib/Heading.d.ts +57 -55
- package/lib/Heading.js +91 -73
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +47 -55
- package/lib/Highlight.d.ts +47 -55
- package/lib/Highlight.js +152 -21
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +45 -55
- package/lib/History.d.ts +45 -55
- package/lib/History.js +976 -53
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +43 -55
- package/lib/HorizontalRule.d.ts +43 -55
- package/lib/HorizontalRule.js +97 -17
- package/lib/Icon-DUpv2cI6.cjs +1 -0
- package/lib/Icon-jKs8Hr6p.js +11 -0
- package/lib/Iframe-CmXkEqOd.js +431 -0
- package/lib/Iframe-Cvca2G7X.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +42 -61
- package/lib/Iframe.d.ts +42 -61
- package/lib/Iframe.js +6 -4
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +43 -56
- package/lib/Image.d.ts +43 -56
- package/lib/Image.js +848 -5
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +44 -58
- package/lib/ImageGif.d.ts +44 -58
- package/lib/ImageGif.js +424 -5
- package/lib/ImportWord.cjs +48 -48
- package/lib/ImportWord.d.cts +44 -56
- package/lib/ImportWord.d.ts +44 -56
- package/lib/ImportWord.js +2596 -2588
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +43 -55
- package/lib/Indent.d.ts +43 -55
- package/lib/Indent.js +97 -27
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +43 -55
- package/lib/Italic.d.ts +43 -55
- package/lib/Italic.js +47 -19
- package/lib/Katex-DsYXsjSS.js +2740 -0
- package/lib/Katex-XfrNne6U.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +43 -55
- package/lib/Katex.d.ts +43 -55
- package/lib/Katex.js +5 -196
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +45 -61
- package/lib/LineHeight.d.ts +45 -61
- package/lib/LineHeight.js +71 -112
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +44 -58
- package/lib/Link.d.ts +44 -58
- package/lib/Link.js +3 -3
- package/lib/LinkEditBlock-BZenZq-Z.cjs +5 -0
- package/lib/LinkEditBlock-CB8yIffE.js +1241 -0
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.d.cts +40 -55
- package/lib/Mention.d.ts +40 -55
- package/lib/Mention.js +114 -130
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +43 -55
- package/lib/Mermaid.d.ts +43 -55
- package/lib/Mermaid.js +177 -165
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +58 -57
- package/lib/MoreMark.d.ts +58 -57
- package/lib/MoreMark.js +125 -55
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +43 -55
- package/lib/OrderedList.d.ts +43 -55
- package/lib/OrderedList.js +37 -9
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +43 -58
- package/lib/SearchAndReplace.d.ts +43 -58
- package/lib/SearchAndReplace.js +221 -197
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +55 -62
- package/lib/SlashCommand.d.ts +55 -62
- package/lib/SlashCommand.js +235 -249
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +43 -55
- package/lib/Strike.d.ts +43 -55
- package/lib/Strike.js +39 -11
- package/lib/Table-B1j1Ebmh.cjs +9 -0
- package/lib/Table-Db8TcQX8.js +1984 -0
- package/lib/Table.cjs +1 -9
- package/lib/Table.d.cts +44 -58
- package/lib/Table.d.ts +44 -58
- package/lib/Table.js +3 -558
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +43 -55
- package/lib/TaskList.d.ts +43 -55
- package/lib/TaskList.js +38 -10
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +56 -55
- package/lib/TextAlign.d.ts +56 -55
- package/lib/TextAlign.js +108 -101
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +72 -55
- package/lib/TextDirection.d.ts +72 -55
- package/lib/TextDirection.js +105 -112
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +43 -55
- package/lib/TextUnderline.d.ts +43 -55
- package/lib/TextUnderline.js +46 -18
- package/lib/{Twitter-BFULyqdR.js → Twitter-CXmmjz9R.js} +536 -498
- package/lib/Twitter-CtVTIWJW.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +43 -55
- package/lib/Twitter.d.ts +43 -55
- package/lib/Twitter.js +5 -4
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +43 -55
- package/lib/Video.d.ts +43 -55
- package/lib/Video.js +261 -4
- package/lib/_commonjsHelpers-BItOPCY9.js +28 -0
- package/lib/_commonjsHelpers-BTDuMlIz.cjs +1 -0
- package/lib/bubble.cjs +2 -0
- package/lib/{bubble-extra.d.cts → bubble.d.cts} +69 -70
- package/lib/{bubble-extra.d.ts → bubble.d.ts} +69 -70
- package/lib/bubble.js +1925 -0
- package/lib/button-B12K7BJ4.cjs +1 -0
- package/lib/button-DXMsXUEn.js +43 -0
- package/lib/clsx-C11secjj.cjs +1 -0
- package/lib/clsx-OuTLNxxd.js +16 -0
- package/lib/delete-node-CosiBes5.cjs +1 -0
- package/lib/delete-node-IyVmiRbI.js +22 -0
- package/lib/dialog-CaCS-W5S.cjs +1 -0
- package/lib/dialog-PtQivpHS.js +100 -0
- package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
- package/lib/dom-dataset-CIEeltF6.js +47 -0
- package/lib/dropdown-menu-BPp2Z_U-.js +136 -0
- package/lib/dropdown-menu-CdSm4emp.cjs +1 -0
- package/lib/file-BLas99n7.js +43 -0
- package/lib/file-i7e4nQY2.cjs +1 -0
- package/lib/floating-ui.dom-U1vPFQ5f.js +1151 -0
- package/lib/floating-ui.dom-VCrc58uF.cjs +1 -0
- package/lib/icons-Cllpys39.js +362 -0
- package/lib/icons-CqHjeW5T.cjs +1 -0
- package/lib/index-BH4bc3jN.cjs +33 -0
- package/lib/index-BPfVXs5_.js +2380 -0
- package/lib/index-Bnmd0WvY.js +1631 -0
- package/lib/{index-Ch6dBBad.js → index-CBce_TWY.js} +40 -42
- package/lib/{index-5iBZLua9.cjs → index-D-5U8dY8.cjs} +8 -8
- package/lib/{index-ByurDDMv.js → index-D2TUfKkC.js} +2 -2
- package/lib/index-DV5kbgRU.cjs +1 -0
- package/lib/{index-LmrOdnen.js → index-DYkucCoF.js} +396 -495
- package/lib/index-Dfmm6FTT.cjs +1 -0
- package/lib/index-DnWWK9F_.js +6374 -0
- package/lib/index-DzcKxutn.js +632 -0
- package/lib/index-DzvuNTxo.cjs +4 -0
- package/lib/{index-BeCTd5v2.cjs → index-N--9MohJ.cjs} +1 -1
- package/lib/index-RfTlOzIr.cjs +22 -0
- package/lib/index.cjs +132 -1
- package/lib/index.d.cts +45 -296
- package/lib/index.d.ts +45 -296
- package/lib/index.js +243 -2
- package/lib/input-_ECRfn3Y.cjs +1 -0
- package/lib/input-wJ9PDEzZ.js +21 -0
- package/lib/isNumber-ClPupm7P.cjs +1 -0
- package/lib/isNumber-fpLGS0AZ.js +15 -0
- package/lib/label-BkgAe7IY.cjs +1 -0
- package/lib/label-CGdLYWv7.js +19 -0
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +5421 -73
- package/lib/locale-bundle.d.ts +5421 -73
- package/lib/locale-bundle.js +9 -7
- package/lib/popover-BgmUNMHj.cjs +1 -0
- package/lib/popover-CAuEW0Mr.js +23 -0
- package/lib/separator-CuBW_w98.js +328 -0
- package/lib/separator-DRIrVZ2N.cjs +1 -0
- package/lib/store-DX599H5W.js +10 -0
- package/lib/store-WStcMOiW.cjs +1 -0
- package/lib/style.css +1 -1
- package/lib/switch-CnLJ7Y-b.cjs +1 -0
- package/lib/switch-Coix_FA1.js +27 -0
- package/lib/tabs-B5mVSN1I.js +46 -0
- package/lib/tabs-BoLCMcCI.cjs +1 -0
- package/lib/textarea-B-6zTKQz.cjs +1 -0
- package/lib/{textarea-aPtytkDx.js → textarea-DUUM1jZd.js} +1 -1
- package/lib/theme-B7aAsK_T.js +15 -0
- package/lib/theme-D8_cxGqB.cjs +1 -0
- package/lib/throttle-CdwDrFpn.js +249 -0
- package/lib/throttle-qX7Yjtsg.cjs +1 -0
- package/lib/toggle-Cdp4IT2U.js +85 -0
- package/lib/toggle-D41PzQLJ.cjs +1 -0
- package/lib/tooltip-BuEiE96N.cjs +1 -0
- package/lib/tooltip-CopwsU8q.js +23 -0
- package/lib/updatePosition-8Sdem5jb.cjs +1 -0
- package/lib/updatePosition-BPmcE0YD.js +215 -0
- package/lib/use-toast-Bz3QCOtE.cjs +1 -0
- package/lib/use-toast-Crf7-q5H.js +98 -0
- package/lib/useButtonProps-BsEd4zYM.js +141 -0
- package/lib/useButtonProps-C6Vpn190.cjs +1 -0
- package/package.json +22 -105
- package/lib/ActionMenuButton-CYdM1xx5.cjs +0 -1
- package/lib/ActionMenuButton-DKRF6oa0.js +0 -33
- package/lib/BaseKit.cjs +0 -3
- package/lib/BaseKit.d.cts +0 -481
- package/lib/BaseKit.d.ts +0 -481
- package/lib/BaseKit.js +0 -132
- package/lib/Document.cjs +0 -1
- package/lib/Document.js +0 -9
- package/lib/Drawer-CdvCMSzN.cjs +0 -1
- package/lib/Excalidraw-BbMQhNvs.cjs +0 -1
- package/lib/Excalidraw-CVWz2Vyn.js +0 -290
- package/lib/FormatPainter.cjs +0 -1
- package/lib/FormatPainter.d.cts +0 -372
- package/lib/FormatPainter.d.ts +0 -372
- package/lib/FormatPainter.js +0 -76
- package/lib/ListItem.cjs +0 -1
- package/lib/ListItem.d.cts +0 -290
- package/lib/ListItem.d.ts +0 -290
- package/lib/ListItem.js +0 -7
- package/lib/MultiColumn.cjs +0 -1
- package/lib/MultiColumn.d.cts +0 -294
- package/lib/MultiColumn.d.ts +0 -294
- package/lib/MultiColumn.js +0 -8
- package/lib/RichTextEditor-CxvwGvQG.cjs +0 -142
- package/lib/RichTextEditor-DGcKEUGr.js +0 -22166
- package/lib/Selection.cjs +0 -1
- package/lib/Selection.d.cts +0 -289
- package/lib/Selection.d.ts +0 -289
- package/lib/Selection.js +0 -25
- package/lib/SubAndSuperScript.cjs +0 -1
- package/lib/SubAndSuperScript.d.cts +0 -377
- package/lib/SubAndSuperScript.d.ts +0 -377
- package/lib/SubAndSuperScript.js +0 -43
- package/lib/TableOfContent.cjs +0 -1
- package/lib/TableOfContent.d.cts +0 -291
- package/lib/TableOfContent.d.ts +0 -291
- package/lib/TableOfContent.js +0 -185
- package/lib/TextBubble.cjs +0 -1
- package/lib/TextBubble.d.cts +0 -362
- package/lib/TextBubble.d.ts +0 -362
- package/lib/TextBubble.js +0 -133
- package/lib/TrailingNode.cjs +0 -1
- package/lib/TrailingNode.d.cts +0 -297
- package/lib/TrailingNode.d.ts +0 -297
- package/lib/TrailingNode.js +0 -41
- package/lib/Twitter-Cutpkh3h.cjs +0 -1
- package/lib/bubble-extra.cjs +0 -2
- package/lib/bubble-extra.js +0 -631
- package/lib/dom-dataset-_6-diIRQ.cjs +0 -33
- package/lib/dom-dataset-lYeH6gfI.js +0 -2361
- package/lib/index-6D1J-A-o.cjs +0 -1
- package/lib/index-B96Cclrj.cjs +0 -3
- package/lib/index-BBz7Nmv9.js +0 -55
- package/lib/index-CUogRI7j.cjs +0 -1
- package/lib/index-DF2Lp4HZ.cjs +0 -100
- package/lib/index-D_L6n8O8.js +0 -76
- package/lib/index-Dbvi-Bvh.cjs +0 -1
- package/lib/index-DpCrt7xs.cjs +0 -1
- package/lib/index-DsAX1Vq8.cjs +0 -1
- package/lib/index-Dy4DlW9o.js +0 -12
- package/lib/index-J3jHHZ4d.js +0 -200
- package/lib/index-VvXaaKe3.js +0 -898
- package/lib/index-kbO3iWqL.js +0 -13432
- package/lib/textarea-DFo_aXnj.cjs +0 -1
|
@@ -0,0 +1,1631 @@
|
|
|
1
|
+
import { T as D, s as m, S as Z, u as z, v as ft, D as Be, F, x as ut, A as dt } from "./index-DnWWK9F_.js";
|
|
2
|
+
var $ = {
|
|
3
|
+
8: "Backspace",
|
|
4
|
+
9: "Tab",
|
|
5
|
+
10: "Enter",
|
|
6
|
+
12: "NumLock",
|
|
7
|
+
13: "Enter",
|
|
8
|
+
16: "Shift",
|
|
9
|
+
17: "Control",
|
|
10
|
+
18: "Alt",
|
|
11
|
+
20: "CapsLock",
|
|
12
|
+
27: "Escape",
|
|
13
|
+
32: " ",
|
|
14
|
+
33: "PageUp",
|
|
15
|
+
34: "PageDown",
|
|
16
|
+
35: "End",
|
|
17
|
+
36: "Home",
|
|
18
|
+
37: "ArrowLeft",
|
|
19
|
+
38: "ArrowUp",
|
|
20
|
+
39: "ArrowRight",
|
|
21
|
+
40: "ArrowDown",
|
|
22
|
+
44: "PrintScreen",
|
|
23
|
+
45: "Insert",
|
|
24
|
+
46: "Delete",
|
|
25
|
+
59: ";",
|
|
26
|
+
61: "=",
|
|
27
|
+
91: "Meta",
|
|
28
|
+
92: "Meta",
|
|
29
|
+
106: "*",
|
|
30
|
+
107: "+",
|
|
31
|
+
108: ",",
|
|
32
|
+
109: "-",
|
|
33
|
+
110: ".",
|
|
34
|
+
111: "/",
|
|
35
|
+
144: "NumLock",
|
|
36
|
+
145: "ScrollLock",
|
|
37
|
+
160: "Shift",
|
|
38
|
+
161: "Shift",
|
|
39
|
+
162: "Control",
|
|
40
|
+
163: "Control",
|
|
41
|
+
164: "Alt",
|
|
42
|
+
165: "Alt",
|
|
43
|
+
173: "-",
|
|
44
|
+
186: ";",
|
|
45
|
+
187: "=",
|
|
46
|
+
188: ",",
|
|
47
|
+
189: "-",
|
|
48
|
+
190: ".",
|
|
49
|
+
191: "/",
|
|
50
|
+
192: "`",
|
|
51
|
+
219: "[",
|
|
52
|
+
220: "\\",
|
|
53
|
+
221: "]",
|
|
54
|
+
222: "'"
|
|
55
|
+
}, _ = {
|
|
56
|
+
48: ")",
|
|
57
|
+
49: "!",
|
|
58
|
+
50: "@",
|
|
59
|
+
51: "#",
|
|
60
|
+
52: "$",
|
|
61
|
+
53: "%",
|
|
62
|
+
54: "^",
|
|
63
|
+
55: "&",
|
|
64
|
+
56: "*",
|
|
65
|
+
57: "(",
|
|
66
|
+
59: ":",
|
|
67
|
+
61: "+",
|
|
68
|
+
173: "_",
|
|
69
|
+
186: ":",
|
|
70
|
+
187: "+",
|
|
71
|
+
188: "<",
|
|
72
|
+
189: "_",
|
|
73
|
+
190: ">",
|
|
74
|
+
191: "?",
|
|
75
|
+
192: "~",
|
|
76
|
+
219: "{",
|
|
77
|
+
220: "|",
|
|
78
|
+
221: "}",
|
|
79
|
+
222: '"'
|
|
80
|
+
}, pt = typeof navigator < "u" && /Mac/.test(navigator.platform), ht = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
81
|
+
for (var y = 0; y < 10; y++) $[48 + y] = $[96 + y] = String(y);
|
|
82
|
+
for (var y = 1; y <= 24; y++) $[y + 111] = "F" + y;
|
|
83
|
+
for (var y = 65; y <= 90; y++)
|
|
84
|
+
$[y] = String.fromCharCode(y + 32), _[y] = String.fromCharCode(y);
|
|
85
|
+
for (var le in $) _.hasOwnProperty(le) || (_[le] = $[le]);
|
|
86
|
+
function mt(e) {
|
|
87
|
+
var n = pt && e.metaKey && e.shiftKey && !e.ctrlKey && !e.altKey || ht && e.shiftKey && e.key && e.key.length == 1 || e.key == "Unidentified", t = !n && e.key || (e.shiftKey ? _ : $)[e.keyCode] || e.key || "Unidentified";
|
|
88
|
+
return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
|
|
89
|
+
}
|
|
90
|
+
const gt = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), yt = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
91
|
+
function bt(e) {
|
|
92
|
+
let n = e.split(/-(?!$)/), t = n[n.length - 1];
|
|
93
|
+
t == "Space" && (t = " ");
|
|
94
|
+
let r, o, l, s;
|
|
95
|
+
for (let i = 0; i < n.length - 1; i++) {
|
|
96
|
+
let a = n[i];
|
|
97
|
+
if (/^(cmd|meta|m)$/i.test(a))
|
|
98
|
+
s = !0;
|
|
99
|
+
else if (/^a(lt)?$/i.test(a))
|
|
100
|
+
r = !0;
|
|
101
|
+
else if (/^(c|ctrl|control)$/i.test(a))
|
|
102
|
+
o = !0;
|
|
103
|
+
else if (/^s(hift)?$/i.test(a))
|
|
104
|
+
l = !0;
|
|
105
|
+
else if (/^mod$/i.test(a))
|
|
106
|
+
gt ? s = !0 : o = !0;
|
|
107
|
+
else
|
|
108
|
+
throw new Error("Unrecognized modifier name: " + a);
|
|
109
|
+
}
|
|
110
|
+
return r && (t = "Alt-" + t), o && (t = "Ctrl-" + t), s && (t = "Meta-" + t), l && (t = "Shift-" + t), t;
|
|
111
|
+
}
|
|
112
|
+
function Ct(e) {
|
|
113
|
+
let n = /* @__PURE__ */ Object.create(null);
|
|
114
|
+
for (let t in e)
|
|
115
|
+
n[bt(t)] = e[t];
|
|
116
|
+
return n;
|
|
117
|
+
}
|
|
118
|
+
function se(e, n, t = !0) {
|
|
119
|
+
return n.altKey && (e = "Alt-" + e), n.ctrlKey && (e = "Ctrl-" + e), n.metaKey && (e = "Meta-" + e), t && n.shiftKey && (e = "Shift-" + e), e;
|
|
120
|
+
}
|
|
121
|
+
function an(e) {
|
|
122
|
+
let n = Ct(e);
|
|
123
|
+
return function(t, r) {
|
|
124
|
+
let o = mt(r), l, s = n[se(o, r)];
|
|
125
|
+
if (s && s(t.state, t.dispatch, t))
|
|
126
|
+
return !0;
|
|
127
|
+
if (o.length == 1 && o != " ") {
|
|
128
|
+
if (r.shiftKey) {
|
|
129
|
+
let i = n[se(o, r, !1)];
|
|
130
|
+
if (i && i(t.state, t.dispatch, t))
|
|
131
|
+
return !0;
|
|
132
|
+
}
|
|
133
|
+
if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
|
|
134
|
+
!(yt && r.ctrlKey && r.altKey) && (l = $[r.keyCode]) && l != o) {
|
|
135
|
+
let i = n[se(l, r)];
|
|
136
|
+
if (i && i(t.state, t.dispatch, t))
|
|
137
|
+
return !0;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return !1;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
const B = function(e) {
|
|
144
|
+
for (var n = 0; ; n++)
|
|
145
|
+
if (e = e.previousSibling, !e)
|
|
146
|
+
return n;
|
|
147
|
+
}, qe = function(e, n, t, r) {
|
|
148
|
+
return t && (xe(e, n, t, r, -1) || xe(e, n, t, r, 1));
|
|
149
|
+
}, St = /^(img|br|input|textarea|hr)$/i;
|
|
150
|
+
function xe(e, n, t, r, o) {
|
|
151
|
+
for (var l; ; ) {
|
|
152
|
+
if (e == t && n == r)
|
|
153
|
+
return !0;
|
|
154
|
+
if (n == (o < 0 ? 0 : w(e))) {
|
|
155
|
+
let s = e.parentNode;
|
|
156
|
+
if (!s || s.nodeType != 1 || ge(e) || St.test(e.nodeName) || e.contentEditable == "false")
|
|
157
|
+
return !1;
|
|
158
|
+
n = B(e) + (o < 0 ? 0 : 1), e = s;
|
|
159
|
+
} else if (e.nodeType == 1) {
|
|
160
|
+
let s = e.childNodes[n + (o < 0 ? -1 : 0)];
|
|
161
|
+
if (s.nodeType == 1 && s.contentEditable == "false")
|
|
162
|
+
if (!((l = s.pmViewDesc) === null || l === void 0) && l.ignoreForSelection)
|
|
163
|
+
n += o;
|
|
164
|
+
else
|
|
165
|
+
return !1;
|
|
166
|
+
else
|
|
167
|
+
e = s, n = o < 0 ? w(e) : 0;
|
|
168
|
+
} else
|
|
169
|
+
return !1;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function w(e) {
|
|
173
|
+
return e.nodeType == 3 ? e.nodeValue.length : e.childNodes.length;
|
|
174
|
+
}
|
|
175
|
+
function Dt(e, n, t) {
|
|
176
|
+
for (let r = n == 0, o = n == w(e); r || o; ) {
|
|
177
|
+
if (e == t)
|
|
178
|
+
return !0;
|
|
179
|
+
let l = B(e);
|
|
180
|
+
if (e = e.parentNode, !e)
|
|
181
|
+
return !1;
|
|
182
|
+
r = r && l == 0, o = o && l == w(e);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function ge(e) {
|
|
186
|
+
let n;
|
|
187
|
+
for (let t = e; t && !(n = t.pmViewDesc); t = t.parentNode)
|
|
188
|
+
;
|
|
189
|
+
return n && n.node && n.node.isBlock && (n.dom == e || n.contentDOM == e);
|
|
190
|
+
}
|
|
191
|
+
const He = function(e) {
|
|
192
|
+
return e.focusNode && qe(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset);
|
|
193
|
+
};
|
|
194
|
+
function We(e, n) {
|
|
195
|
+
let t = document.createEvent("Event");
|
|
196
|
+
return t.initEvent("keydown", !0, !0), t.keyCode = e, t.key = t.code = n, t;
|
|
197
|
+
}
|
|
198
|
+
const x = typeof navigator < "u" ? navigator : null, Ee = typeof document < "u" ? document : null, K = x && x.userAgent || "", ce = /Edge\/(\d+)/.exec(K), Ue = /MSIE \d/.exec(K), fe = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(K), J = !!(Ue || fe || ce), je = Ue ? document.documentMode : fe ? +fe[1] : ce ? +ce[1] : 0, re = !J && /gecko\/(\d+)/i.test(K);
|
|
199
|
+
re && +(/Firefox\/(\d+)/.exec(K) || [0, 0])[1];
|
|
200
|
+
const ue = !J && /Chrome\/(\d+)/.exec(K), I = !!ue, Xe = ue ? +ue[1] : 0, q = !J && !!x && /Apple Computer/.test(x.vendor), ye = q && (/Mobile\/\w+/.test(K) || !!x && x.maxTouchPoints > 2), S = ye || (x ? /Mac/.test(x.platform) : !1), kt = x ? /Win/.test(x.platform) : !1, G = /Android \d/.test(K), be = !!Ee && "webkitFontSmoothing" in Ee.documentElement.style, Nt = be ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
201
|
+
function Tt(e, n = null) {
|
|
202
|
+
let t = e.domSelectionRange(), r = e.state.doc;
|
|
203
|
+
if (!t.focusNode)
|
|
204
|
+
return null;
|
|
205
|
+
let o = e.docView.nearestDesc(t.focusNode), l = o && o.size == 0, s = e.docView.posFromDOM(t.focusNode, t.focusOffset, 1);
|
|
206
|
+
if (s < 0)
|
|
207
|
+
return null;
|
|
208
|
+
let i = r.resolve(s), a, c;
|
|
209
|
+
if (He(t)) {
|
|
210
|
+
for (a = s; o && !o.node; )
|
|
211
|
+
o = o.parent;
|
|
212
|
+
let u = o.node;
|
|
213
|
+
if (o && u.isAtom && m.isSelectable(u) && o.parent && !(u.isInline && Dt(t.focusNode, t.focusOffset, o.dom))) {
|
|
214
|
+
let d = o.posBefore;
|
|
215
|
+
c = new m(s == d ? i : r.resolve(d));
|
|
216
|
+
}
|
|
217
|
+
} else {
|
|
218
|
+
if (t instanceof e.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1) {
|
|
219
|
+
let u = s, d = s;
|
|
220
|
+
for (let p = 0; p < t.rangeCount; p++) {
|
|
221
|
+
let h = t.getRangeAt(p);
|
|
222
|
+
u = Math.min(u, e.docView.posFromDOM(h.startContainer, h.startOffset, 1)), d = Math.max(d, e.docView.posFromDOM(h.endContainer, h.endOffset, -1));
|
|
223
|
+
}
|
|
224
|
+
if (u < 0)
|
|
225
|
+
return null;
|
|
226
|
+
[a, s] = d == e.state.selection.anchor ? [d, u] : [u, d], i = r.resolve(s);
|
|
227
|
+
} else
|
|
228
|
+
a = e.docView.posFromDOM(t.anchorNode, t.anchorOffset, 1);
|
|
229
|
+
if (a < 0)
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
let f = r.resolve(a);
|
|
233
|
+
if (!c) {
|
|
234
|
+
let u = n == "pointer" || e.state.selection.head < i.pos && !l ? 1 : -1;
|
|
235
|
+
c = Je(e, f, i, u);
|
|
236
|
+
}
|
|
237
|
+
return c;
|
|
238
|
+
}
|
|
239
|
+
function Ye(e) {
|
|
240
|
+
return e.editable ? e.hasFocus() : At(e) && document.activeElement && document.activeElement.contains(e.dom);
|
|
241
|
+
}
|
|
242
|
+
function Ce(e, n = !1) {
|
|
243
|
+
let t = e.state.selection;
|
|
244
|
+
if (Ot(e, t), !!Ye(e)) {
|
|
245
|
+
if (!n && e.input.mouseDown && e.input.mouseDown.allowDefault && I) {
|
|
246
|
+
let r = e.domSelectionRange(), o = e.domObserver.currentSelection;
|
|
247
|
+
if (r.anchorNode && o.anchorNode && qe(r.anchorNode, r.anchorOffset, o.anchorNode, o.anchorOffset)) {
|
|
248
|
+
e.input.mouseDown.delayedSelectionSync = !0, e.domObserver.setCurSelection();
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (e.domObserver.disconnectSelection(), e.cursorWrapper)
|
|
253
|
+
Et(e);
|
|
254
|
+
else {
|
|
255
|
+
let { anchor: r, head: o } = t, l, s;
|
|
256
|
+
Oe && !(t instanceof D) && (t.$from.parent.inlineContent || (l = Ae(e, t.from)), !t.empty && !t.$from.parent.inlineContent && (s = Ae(e, t.to))), e.docView.setSelection(r, o, e, n), Oe && (l && Me(l), s && Me(s)), t.visible ? e.dom.classList.remove("ProseMirror-hideselection") : (e.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && xt(e));
|
|
257
|
+
}
|
|
258
|
+
e.domObserver.setCurSelection(), e.domObserver.connectSelection();
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
const Oe = q || I && Xe < 63;
|
|
262
|
+
function Ae(e, n) {
|
|
263
|
+
let { node: t, offset: r } = e.docView.domFromPos(n, 0), o = r < t.childNodes.length ? t.childNodes[r] : null, l = r ? t.childNodes[r - 1] : null;
|
|
264
|
+
if (q && o && o.contentEditable == "false")
|
|
265
|
+
return ie(o);
|
|
266
|
+
if ((!o || o.contentEditable == "false") && (!l || l.contentEditable == "false")) {
|
|
267
|
+
if (o)
|
|
268
|
+
return ie(o);
|
|
269
|
+
if (l)
|
|
270
|
+
return ie(l);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function ie(e) {
|
|
274
|
+
return e.contentEditable = "true", q && e.draggable && (e.draggable = !1, e.wasDraggable = !0), e;
|
|
275
|
+
}
|
|
276
|
+
function Me(e) {
|
|
277
|
+
e.contentEditable = "false", e.wasDraggable && (e.draggable = !0, e.wasDraggable = null);
|
|
278
|
+
}
|
|
279
|
+
function xt(e) {
|
|
280
|
+
let n = e.dom.ownerDocument;
|
|
281
|
+
n.removeEventListener("selectionchange", e.input.hideSelectionGuard);
|
|
282
|
+
let t = e.domSelectionRange(), r = t.anchorNode, o = t.anchorOffset;
|
|
283
|
+
n.addEventListener("selectionchange", e.input.hideSelectionGuard = () => {
|
|
284
|
+
(t.anchorNode != r || t.anchorOffset != o) && (n.removeEventListener("selectionchange", e.input.hideSelectionGuard), setTimeout(() => {
|
|
285
|
+
(!Ye(e) || e.state.selection.visible) && e.dom.classList.remove("ProseMirror-hideselection");
|
|
286
|
+
}, 20));
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
function Et(e) {
|
|
290
|
+
let n = e.domSelection();
|
|
291
|
+
if (!n)
|
|
292
|
+
return;
|
|
293
|
+
let t = e.cursorWrapper.dom, r = t.nodeName == "IMG";
|
|
294
|
+
r ? n.collapse(t.parentNode, B(t) + 1) : n.collapse(t, 0), !r && !e.state.selection.visible && J && je <= 11 && (t.disabled = !0, t.disabled = !1);
|
|
295
|
+
}
|
|
296
|
+
function Ot(e, n) {
|
|
297
|
+
if (n instanceof m) {
|
|
298
|
+
let t = e.docView.descAt(n.from);
|
|
299
|
+
t != e.lastSelectedViewDesc && (Pe(e), t && t.selectNode(), e.lastSelectedViewDesc = t);
|
|
300
|
+
} else
|
|
301
|
+
Pe(e);
|
|
302
|
+
}
|
|
303
|
+
function Pe(e) {
|
|
304
|
+
e.lastSelectedViewDesc && (e.lastSelectedViewDesc.parent && e.lastSelectedViewDesc.deselectNode(), e.lastSelectedViewDesc = void 0);
|
|
305
|
+
}
|
|
306
|
+
function Je(e, n, t, r) {
|
|
307
|
+
return e.someProp("createSelectionBetween", (o) => o(e, n, t)) || D.between(n, t, r);
|
|
308
|
+
}
|
|
309
|
+
function At(e) {
|
|
310
|
+
let n = e.domSelectionRange();
|
|
311
|
+
if (!n.anchorNode)
|
|
312
|
+
return !1;
|
|
313
|
+
try {
|
|
314
|
+
return e.dom.contains(n.anchorNode.nodeType == 3 ? n.anchorNode.parentNode : n.anchorNode) && (e.editable || e.dom.contains(n.focusNode.nodeType == 3 ? n.focusNode.parentNode : n.focusNode));
|
|
315
|
+
} catch {
|
|
316
|
+
return !1;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
function de(e, n) {
|
|
320
|
+
let { $anchor: t, $head: r } = e.selection, o = n > 0 ? t.max(r) : t.min(r), l = o.parent.inlineContent ? o.depth ? e.doc.resolve(n > 0 ? o.after() : o.before()) : null : o;
|
|
321
|
+
return l && Z.findFrom(l, n);
|
|
322
|
+
}
|
|
323
|
+
function A(e, n) {
|
|
324
|
+
return e.dispatch(e.state.tr.setSelection(n).scrollIntoView()), !0;
|
|
325
|
+
}
|
|
326
|
+
function $e(e, n, t) {
|
|
327
|
+
let r = e.state.selection;
|
|
328
|
+
if (r instanceof D)
|
|
329
|
+
if (t.indexOf("s") > -1) {
|
|
330
|
+
let { $head: o } = r, l = o.textOffset ? null : n < 0 ? o.nodeBefore : o.nodeAfter;
|
|
331
|
+
if (!l || l.isText || !l.isLeaf)
|
|
332
|
+
return !1;
|
|
333
|
+
let s = e.state.doc.resolve(o.pos + l.nodeSize * (n < 0 ? -1 : 1));
|
|
334
|
+
return A(e, new D(r.$anchor, s));
|
|
335
|
+
} else if (r.empty) {
|
|
336
|
+
if (e.endOfTextblock(n > 0 ? "forward" : "backward")) {
|
|
337
|
+
let o = de(e.state, n);
|
|
338
|
+
return o && o instanceof m ? A(e, o) : !1;
|
|
339
|
+
} else if (!(S && t.indexOf("m") > -1)) {
|
|
340
|
+
let o = r.$head, l = o.textOffset ? null : n < 0 ? o.nodeBefore : o.nodeAfter, s;
|
|
341
|
+
if (!l || l.isText)
|
|
342
|
+
return !1;
|
|
343
|
+
let i = n < 0 ? o.pos - l.nodeSize : o.pos;
|
|
344
|
+
return l.isAtom || (s = e.docView.descAt(i)) && !s.contentDOM ? m.isSelectable(l) ? A(e, new m(n < 0 ? e.state.doc.resolve(o.pos - l.nodeSize) : o)) : be ? A(e, new D(e.state.doc.resolve(n < 0 ? i : i + l.nodeSize))) : !1 : !1;
|
|
345
|
+
}
|
|
346
|
+
} else return !1;
|
|
347
|
+
else {
|
|
348
|
+
if (r instanceof m && r.node.isInline)
|
|
349
|
+
return A(e, new D(n > 0 ? r.$to : r.$from));
|
|
350
|
+
{
|
|
351
|
+
let o = de(e.state, n);
|
|
352
|
+
return o ? A(e, o) : !1;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
function v(e) {
|
|
357
|
+
return e.nodeType == 3 ? e.nodeValue.length : e.childNodes.length;
|
|
358
|
+
}
|
|
359
|
+
function j(e, n) {
|
|
360
|
+
let t = e.pmViewDesc;
|
|
361
|
+
return t && t.size == 0 && (n < 0 || e.nextSibling || e.nodeName != "BR");
|
|
362
|
+
}
|
|
363
|
+
function H(e, n) {
|
|
364
|
+
return n < 0 ? Mt(e) : Pt(e);
|
|
365
|
+
}
|
|
366
|
+
function Mt(e) {
|
|
367
|
+
let n = e.domSelectionRange(), t = n.focusNode, r = n.focusOffset;
|
|
368
|
+
if (!t)
|
|
369
|
+
return;
|
|
370
|
+
let o, l, s = !1;
|
|
371
|
+
for (re && t.nodeType == 1 && r < v(t) && j(t.childNodes[r], -1) && (s = !0); ; )
|
|
372
|
+
if (r > 0) {
|
|
373
|
+
if (t.nodeType != 1)
|
|
374
|
+
break;
|
|
375
|
+
{
|
|
376
|
+
let i = t.childNodes[r - 1];
|
|
377
|
+
if (j(i, -1))
|
|
378
|
+
o = t, l = --r;
|
|
379
|
+
else if (i.nodeType == 3)
|
|
380
|
+
t = i, r = t.nodeValue.length;
|
|
381
|
+
else
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
} else {
|
|
385
|
+
if (Ge(t))
|
|
386
|
+
break;
|
|
387
|
+
{
|
|
388
|
+
let i = t.previousSibling;
|
|
389
|
+
for (; i && j(i, -1); )
|
|
390
|
+
o = t.parentNode, l = B(i), i = i.previousSibling;
|
|
391
|
+
if (i)
|
|
392
|
+
t = i, r = v(t);
|
|
393
|
+
else {
|
|
394
|
+
if (t = t.parentNode, t == e.dom)
|
|
395
|
+
break;
|
|
396
|
+
r = 0;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
s ? pe(e, t, r) : o && pe(e, o, l);
|
|
401
|
+
}
|
|
402
|
+
function Pt(e) {
|
|
403
|
+
let n = e.domSelectionRange(), t = n.focusNode, r = n.focusOffset;
|
|
404
|
+
if (!t)
|
|
405
|
+
return;
|
|
406
|
+
let o = v(t), l, s;
|
|
407
|
+
for (; ; )
|
|
408
|
+
if (r < o) {
|
|
409
|
+
if (t.nodeType != 1)
|
|
410
|
+
break;
|
|
411
|
+
let i = t.childNodes[r];
|
|
412
|
+
if (j(i, 1))
|
|
413
|
+
l = t, s = ++r;
|
|
414
|
+
else
|
|
415
|
+
break;
|
|
416
|
+
} else {
|
|
417
|
+
if (Ge(t))
|
|
418
|
+
break;
|
|
419
|
+
{
|
|
420
|
+
let i = t.nextSibling;
|
|
421
|
+
for (; i && j(i, 1); )
|
|
422
|
+
l = i.parentNode, s = B(i) + 1, i = i.nextSibling;
|
|
423
|
+
if (i)
|
|
424
|
+
t = i, r = 0, o = v(t);
|
|
425
|
+
else {
|
|
426
|
+
if (t = t.parentNode, t == e.dom)
|
|
427
|
+
break;
|
|
428
|
+
r = o = 0;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
l && pe(e, l, s);
|
|
433
|
+
}
|
|
434
|
+
function Ge(e) {
|
|
435
|
+
let n = e.pmViewDesc;
|
|
436
|
+
return n && n.node && n.node.isBlock;
|
|
437
|
+
}
|
|
438
|
+
function $t(e, n) {
|
|
439
|
+
for (; e && n == e.childNodes.length && !ge(e); )
|
|
440
|
+
n = B(e) + 1, e = e.parentNode;
|
|
441
|
+
for (; e && n < e.childNodes.length; ) {
|
|
442
|
+
let t = e.childNodes[n];
|
|
443
|
+
if (t.nodeType == 3)
|
|
444
|
+
return t;
|
|
445
|
+
if (t.nodeType == 1 && t.contentEditable == "false")
|
|
446
|
+
break;
|
|
447
|
+
e = t, n = 0;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
function Kt(e, n) {
|
|
451
|
+
for (; e && !n && !ge(e); )
|
|
452
|
+
n = B(e), e = e.parentNode;
|
|
453
|
+
for (; e && n; ) {
|
|
454
|
+
let t = e.childNodes[n - 1];
|
|
455
|
+
if (t.nodeType == 3)
|
|
456
|
+
return t;
|
|
457
|
+
if (t.nodeType == 1 && t.contentEditable == "false")
|
|
458
|
+
break;
|
|
459
|
+
e = t, n = e.childNodes.length;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function pe(e, n, t) {
|
|
463
|
+
if (n.nodeType != 3) {
|
|
464
|
+
let l, s;
|
|
465
|
+
(s = $t(n, t)) ? (n = s, t = 0) : (l = Kt(n, t)) && (n = l, t = l.nodeValue.length);
|
|
466
|
+
}
|
|
467
|
+
let r = e.domSelection();
|
|
468
|
+
if (!r)
|
|
469
|
+
return;
|
|
470
|
+
if (He(r)) {
|
|
471
|
+
let l = document.createRange();
|
|
472
|
+
l.setEnd(n, t), l.setStart(n, t), r.removeAllRanges(), r.addRange(l);
|
|
473
|
+
} else r.extend && r.extend(n, t);
|
|
474
|
+
e.domObserver.setCurSelection();
|
|
475
|
+
let { state: o } = e;
|
|
476
|
+
setTimeout(() => {
|
|
477
|
+
e.state == o && Ce(e);
|
|
478
|
+
}, 50);
|
|
479
|
+
}
|
|
480
|
+
function Ke(e, n) {
|
|
481
|
+
let t = e.state.doc.resolve(n);
|
|
482
|
+
if (!(I || kt) && t.parent.inlineContent) {
|
|
483
|
+
let o = e.coordsAtPos(n);
|
|
484
|
+
if (n > t.start()) {
|
|
485
|
+
let l = e.coordsAtPos(n - 1), s = (l.top + l.bottom) / 2;
|
|
486
|
+
if (s > o.top && s < o.bottom && Math.abs(l.left - o.left) > 1)
|
|
487
|
+
return l.left < o.left ? "ltr" : "rtl";
|
|
488
|
+
}
|
|
489
|
+
if (n < t.end()) {
|
|
490
|
+
let l = e.coordsAtPos(n + 1), s = (l.top + l.bottom) / 2;
|
|
491
|
+
if (s > o.top && s < o.bottom && Math.abs(l.left - o.left) > 1)
|
|
492
|
+
return l.left > o.left ? "ltr" : "rtl";
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
return getComputedStyle(e.dom).direction == "rtl" ? "rtl" : "ltr";
|
|
496
|
+
}
|
|
497
|
+
function Ie(e, n, t) {
|
|
498
|
+
let r = e.state.selection;
|
|
499
|
+
if (r instanceof D && !r.empty || t.indexOf("s") > -1 || S && t.indexOf("m") > -1)
|
|
500
|
+
return !1;
|
|
501
|
+
let { $from: o, $to: l } = r;
|
|
502
|
+
if (!o.parent.inlineContent || e.endOfTextblock(n < 0 ? "up" : "down")) {
|
|
503
|
+
let s = de(e.state, n);
|
|
504
|
+
if (s && s instanceof m)
|
|
505
|
+
return A(e, s);
|
|
506
|
+
}
|
|
507
|
+
if (!o.parent.inlineContent) {
|
|
508
|
+
let s = n < 0 ? o : l, i = r instanceof dt ? Z.near(s, n) : Z.findFrom(s, n);
|
|
509
|
+
return i ? A(e, i) : !1;
|
|
510
|
+
}
|
|
511
|
+
return !1;
|
|
512
|
+
}
|
|
513
|
+
function Re(e, n) {
|
|
514
|
+
if (!(e.state.selection instanceof D))
|
|
515
|
+
return !0;
|
|
516
|
+
let { $head: t, $anchor: r, empty: o } = e.state.selection;
|
|
517
|
+
if (!t.sameParent(r))
|
|
518
|
+
return !0;
|
|
519
|
+
if (!o)
|
|
520
|
+
return !1;
|
|
521
|
+
if (e.endOfTextblock(n > 0 ? "forward" : "backward"))
|
|
522
|
+
return !0;
|
|
523
|
+
let l = !t.textOffset && (n < 0 ? t.nodeBefore : t.nodeAfter);
|
|
524
|
+
if (l && !l.isText) {
|
|
525
|
+
let s = e.state.tr;
|
|
526
|
+
return n < 0 ? s.delete(t.pos - l.nodeSize, t.pos) : s.delete(t.pos, t.pos + l.nodeSize), e.dispatch(s), !0;
|
|
527
|
+
}
|
|
528
|
+
return !1;
|
|
529
|
+
}
|
|
530
|
+
function Le(e, n, t) {
|
|
531
|
+
e.domObserver.stop(), n.contentEditable = t, e.domObserver.start();
|
|
532
|
+
}
|
|
533
|
+
function It(e) {
|
|
534
|
+
if (!q || e.state.selection.$head.parentOffset > 0)
|
|
535
|
+
return !1;
|
|
536
|
+
let { focusNode: n, focusOffset: t } = e.domSelectionRange();
|
|
537
|
+
if (n && n.nodeType == 1 && t == 0 && n.firstChild && n.firstChild.contentEditable == "false") {
|
|
538
|
+
let r = n.firstChild;
|
|
539
|
+
Le(e, r, "true"), setTimeout(() => Le(e, r, "false"), 20);
|
|
540
|
+
}
|
|
541
|
+
return !1;
|
|
542
|
+
}
|
|
543
|
+
function Rt(e) {
|
|
544
|
+
let n = "";
|
|
545
|
+
return e.ctrlKey && (n += "c"), e.metaKey && (n += "m"), e.altKey && (n += "a"), e.shiftKey && (n += "s"), n;
|
|
546
|
+
}
|
|
547
|
+
function Lt(e, n) {
|
|
548
|
+
let t = n.keyCode, r = Rt(n);
|
|
549
|
+
if (t == 8 || S && t == 72 && r == "c")
|
|
550
|
+
return Re(e, -1) || H(e, -1);
|
|
551
|
+
if (t == 46 && !n.shiftKey || S && t == 68 && r == "c")
|
|
552
|
+
return Re(e, 1) || H(e, 1);
|
|
553
|
+
if (t == 13 || t == 27)
|
|
554
|
+
return !0;
|
|
555
|
+
if (t == 37 || S && t == 66 && r == "c") {
|
|
556
|
+
let o = t == 37 ? Ke(e, e.state.selection.from) == "ltr" ? -1 : 1 : -1;
|
|
557
|
+
return $e(e, o, r) || H(e, o);
|
|
558
|
+
} else if (t == 39 || S && t == 70 && r == "c") {
|
|
559
|
+
let o = t == 39 ? Ke(e, e.state.selection.from) == "ltr" ? 1 : -1 : 1;
|
|
560
|
+
return $e(e, o, r) || H(e, o);
|
|
561
|
+
} else {
|
|
562
|
+
if (t == 38 || S && t == 80 && r == "c")
|
|
563
|
+
return Ie(e, -1, r) || H(e, -1);
|
|
564
|
+
if (t == 40 || S && t == 78 && r == "c")
|
|
565
|
+
return It(e) || Ie(e, 1, r) || H(e, 1);
|
|
566
|
+
if (r == (S ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
567
|
+
return !0;
|
|
568
|
+
}
|
|
569
|
+
return !1;
|
|
570
|
+
}
|
|
571
|
+
function Qe(e, n) {
|
|
572
|
+
e.someProp("transformCopied", (p) => {
|
|
573
|
+
n = p(n, e);
|
|
574
|
+
});
|
|
575
|
+
let t = [], { content: r, openStart: o, openEnd: l } = n;
|
|
576
|
+
for (; o > 1 && l > 1 && r.childCount == 1 && r.firstChild.childCount == 1; ) {
|
|
577
|
+
o--, l--;
|
|
578
|
+
let p = r.firstChild;
|
|
579
|
+
t.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null), r = p.content;
|
|
580
|
+
}
|
|
581
|
+
let s = e.someProp("clipboardSerializer") || Be.fromSchema(e.state.schema), i = tt(), a = i.createElement("div");
|
|
582
|
+
a.appendChild(s.serializeFragment(r, { document: i }));
|
|
583
|
+
let c = a.firstChild, f, u = 0;
|
|
584
|
+
for (; c && c.nodeType == 1 && (f = et[c.nodeName.toLowerCase()]); ) {
|
|
585
|
+
for (let p = f.length - 1; p >= 0; p--) {
|
|
586
|
+
let h = i.createElement(f[p]);
|
|
587
|
+
for (; a.firstChild; )
|
|
588
|
+
h.appendChild(a.firstChild);
|
|
589
|
+
a.appendChild(h), u++;
|
|
590
|
+
}
|
|
591
|
+
c = a.firstChild;
|
|
592
|
+
}
|
|
593
|
+
c && c.nodeType == 1 && c.setAttribute("data-pm-slice", `${o} ${l}${u ? ` -${u}` : ""} ${JSON.stringify(t)}`);
|
|
594
|
+
let d = e.someProp("clipboardTextSerializer", (p) => p(n, e)) || n.content.textBetween(0, n.content.size, `
|
|
595
|
+
|
|
596
|
+
`);
|
|
597
|
+
return { dom: a, text: d, slice: n };
|
|
598
|
+
}
|
|
599
|
+
function Ze(e, n, t, r, o) {
|
|
600
|
+
let l = o.parent.type.spec.code, s, i;
|
|
601
|
+
if (!t && !n)
|
|
602
|
+
return null;
|
|
603
|
+
let a = !!n && (r || l || !t);
|
|
604
|
+
if (a) {
|
|
605
|
+
if (e.someProp("transformPastedText", (d) => {
|
|
606
|
+
n = d(n, l || r, e);
|
|
607
|
+
}), l)
|
|
608
|
+
return i = new z(F.from(e.state.schema.text(n.replace(/\r\n?/g, `
|
|
609
|
+
`))), 0, 0), e.someProp("transformPasted", (d) => {
|
|
610
|
+
i = d(i, e, !0);
|
|
611
|
+
}), i;
|
|
612
|
+
let u = e.someProp("clipboardTextParser", (d) => d(n, o, r, e));
|
|
613
|
+
if (u)
|
|
614
|
+
i = u;
|
|
615
|
+
else {
|
|
616
|
+
let d = o.marks(), { schema: p } = e.state, h = Be.fromSchema(p);
|
|
617
|
+
s = document.createElement("div"), n.split(/(?:\r\n?|\n)+/).forEach((O) => {
|
|
618
|
+
let k = s.appendChild(document.createElement("p"));
|
|
619
|
+
O && k.appendChild(h.serializeNode(p.text(O, d)));
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
} else
|
|
623
|
+
e.someProp("transformPastedHTML", (u) => {
|
|
624
|
+
t = u(t, e);
|
|
625
|
+
}), s = Bt(t), be && qt(s);
|
|
626
|
+
let c = s && s.querySelector("[data-pm-slice]"), f = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
|
|
627
|
+
if (f && f[3])
|
|
628
|
+
for (let u = +f[3]; u > 0; u--) {
|
|
629
|
+
let d = s.firstChild;
|
|
630
|
+
for (; d && d.nodeType != 1; )
|
|
631
|
+
d = d.nextSibling;
|
|
632
|
+
if (!d)
|
|
633
|
+
break;
|
|
634
|
+
s = d;
|
|
635
|
+
}
|
|
636
|
+
if (i || (i = (e.someProp("clipboardParser") || e.someProp("domParser") || ut.fromSchema(e.state.schema)).parseSlice(s, {
|
|
637
|
+
preserveWhitespace: !!(a || f),
|
|
638
|
+
context: o,
|
|
639
|
+
ruleFromNode(d) {
|
|
640
|
+
return d.nodeName == "BR" && !d.nextSibling && d.parentNode && !Vt.test(d.parentNode.nodeName) ? { ignore: !0 } : null;
|
|
641
|
+
}
|
|
642
|
+
})), f)
|
|
643
|
+
i = Ht(Ve(i, +f[1], +f[2]), f[4]);
|
|
644
|
+
else if (i = z.maxOpen(zt(i.content, o), !0), i.openStart || i.openEnd) {
|
|
645
|
+
let u = 0, d = 0;
|
|
646
|
+
for (let p = i.content.firstChild; u < i.openStart && !p.type.spec.isolating; u++, p = p.firstChild)
|
|
647
|
+
;
|
|
648
|
+
for (let p = i.content.lastChild; d < i.openEnd && !p.type.spec.isolating; d++, p = p.lastChild)
|
|
649
|
+
;
|
|
650
|
+
i = Ve(i, u, d);
|
|
651
|
+
}
|
|
652
|
+
return e.someProp("transformPasted", (u) => {
|
|
653
|
+
i = u(i, e, a);
|
|
654
|
+
}), i;
|
|
655
|
+
}
|
|
656
|
+
const Vt = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
|
|
657
|
+
function zt(e, n) {
|
|
658
|
+
if (e.childCount < 2)
|
|
659
|
+
return e;
|
|
660
|
+
for (let t = n.depth; t >= 0; t--) {
|
|
661
|
+
let o = n.node(t).contentMatchAt(n.index(t)), l, s = [];
|
|
662
|
+
if (e.forEach((i) => {
|
|
663
|
+
if (!s)
|
|
664
|
+
return;
|
|
665
|
+
let a = o.findWrapping(i.type), c;
|
|
666
|
+
if (!a)
|
|
667
|
+
return s = null;
|
|
668
|
+
if (c = s.length && l.length && we(a, l, i, s[s.length - 1], 0))
|
|
669
|
+
s[s.length - 1] = c;
|
|
670
|
+
else {
|
|
671
|
+
s.length && (s[s.length - 1] = ve(s[s.length - 1], l.length));
|
|
672
|
+
let f = _e(i, a);
|
|
673
|
+
s.push(f), o = o.matchType(f.type), l = a;
|
|
674
|
+
}
|
|
675
|
+
}), s)
|
|
676
|
+
return F.from(s);
|
|
677
|
+
}
|
|
678
|
+
return e;
|
|
679
|
+
}
|
|
680
|
+
function _e(e, n, t = 0) {
|
|
681
|
+
for (let r = n.length - 1; r >= t; r--)
|
|
682
|
+
e = n[r].create(null, F.from(e));
|
|
683
|
+
return e;
|
|
684
|
+
}
|
|
685
|
+
function we(e, n, t, r, o) {
|
|
686
|
+
if (o < e.length && o < n.length && e[o] == n[o]) {
|
|
687
|
+
let l = we(e, n, t, r.lastChild, o + 1);
|
|
688
|
+
if (l)
|
|
689
|
+
return r.copy(r.content.replaceChild(r.childCount - 1, l));
|
|
690
|
+
if (r.contentMatchAt(r.childCount).matchType(o == e.length - 1 ? t.type : e[o + 1]))
|
|
691
|
+
return r.copy(r.content.append(F.from(_e(t, e, o + 1))));
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
function ve(e, n) {
|
|
695
|
+
if (n == 0)
|
|
696
|
+
return e;
|
|
697
|
+
let t = e.content.replaceChild(e.childCount - 1, ve(e.lastChild, n - 1)), r = e.contentMatchAt(e.childCount).fillBefore(F.empty, !0);
|
|
698
|
+
return e.copy(t.append(r));
|
|
699
|
+
}
|
|
700
|
+
function he(e, n, t, r, o, l) {
|
|
701
|
+
let s = n < 0 ? e.firstChild : e.lastChild, i = s.content;
|
|
702
|
+
return e.childCount > 1 && (l = 0), o < r - 1 && (i = he(i, n, t, r, o + 1, l)), o >= t && (i = n < 0 ? s.contentMatchAt(0).fillBefore(i, l <= o).append(i) : i.append(s.contentMatchAt(s.childCount).fillBefore(F.empty, !0))), e.replaceChild(n < 0 ? 0 : e.childCount - 1, s.copy(i));
|
|
703
|
+
}
|
|
704
|
+
function Ve(e, n, t) {
|
|
705
|
+
return n < e.openStart && (e = new z(he(e.content, -1, n, e.openStart, 0, e.openEnd), n, e.openEnd)), t < e.openEnd && (e = new z(he(e.content, 1, t, e.openEnd, 0, 0), e.openStart, t)), e;
|
|
706
|
+
}
|
|
707
|
+
const et = {
|
|
708
|
+
thead: ["table"],
|
|
709
|
+
tbody: ["table"],
|
|
710
|
+
tfoot: ["table"],
|
|
711
|
+
caption: ["table"],
|
|
712
|
+
colgroup: ["table"],
|
|
713
|
+
col: ["table", "colgroup"],
|
|
714
|
+
tr: ["table", "tbody"],
|
|
715
|
+
td: ["table", "tbody", "tr"],
|
|
716
|
+
th: ["table", "tbody", "tr"]
|
|
717
|
+
};
|
|
718
|
+
let ze = null;
|
|
719
|
+
function tt() {
|
|
720
|
+
return ze || (ze = document.implementation.createHTMLDocument("title"));
|
|
721
|
+
}
|
|
722
|
+
let ae = null;
|
|
723
|
+
function Ft(e) {
|
|
724
|
+
let n = window.trustedTypes;
|
|
725
|
+
return n ? (ae || (ae = n.defaultPolicy || n.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), ae.createHTML(e)) : e;
|
|
726
|
+
}
|
|
727
|
+
function Bt(e) {
|
|
728
|
+
let n = /^(\s*<meta [^>]*>)*/.exec(e);
|
|
729
|
+
n && (e = e.slice(n[0].length));
|
|
730
|
+
let t = tt().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(e), o;
|
|
731
|
+
if ((o = r && et[r[1].toLowerCase()]) && (e = o.map((l) => "<" + l + ">").join("") + e + o.map((l) => "</" + l + ">").reverse().join("")), t.innerHTML = Ft(e), o)
|
|
732
|
+
for (let l = 0; l < o.length; l++)
|
|
733
|
+
t = t.querySelector(o[l]) || t;
|
|
734
|
+
return t;
|
|
735
|
+
}
|
|
736
|
+
function qt(e) {
|
|
737
|
+
let n = e.querySelectorAll(I ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
738
|
+
for (let t = 0; t < n.length; t++) {
|
|
739
|
+
let r = n[t];
|
|
740
|
+
r.childNodes.length == 1 && r.textContent == " " && r.parentNode && r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "), r);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
function Ht(e, n) {
|
|
744
|
+
if (!e.size)
|
|
745
|
+
return e;
|
|
746
|
+
let t = e.content.firstChild.type.schema, r;
|
|
747
|
+
try {
|
|
748
|
+
r = JSON.parse(n);
|
|
749
|
+
} catch {
|
|
750
|
+
return e;
|
|
751
|
+
}
|
|
752
|
+
let { content: o, openStart: l, openEnd: s } = e;
|
|
753
|
+
for (let i = r.length - 2; i >= 0; i -= 2) {
|
|
754
|
+
let a = t.nodes[r[i]];
|
|
755
|
+
if (!a || a.hasRequiredAttrs())
|
|
756
|
+
break;
|
|
757
|
+
o = F.from(a.create(r[i + 1], o)), l++, s++;
|
|
758
|
+
}
|
|
759
|
+
return new z(o, l, s);
|
|
760
|
+
}
|
|
761
|
+
const T = {}, C = {};
|
|
762
|
+
function M(e, n) {
|
|
763
|
+
e.input.lastSelectionOrigin = n, e.input.lastSelectionTime = Date.now();
|
|
764
|
+
}
|
|
765
|
+
C.keydown = (e, n) => {
|
|
766
|
+
let t = n;
|
|
767
|
+
if (e.input.shiftKey = t.keyCode == 16 || t.shiftKey, !rt(e, t) && (e.input.lastKeyCode = t.keyCode, e.input.lastKeyCodeTime = Date.now(), !(G && I && t.keyCode == 13)))
|
|
768
|
+
if (t.keyCode != 229 && e.domObserver.forceFlush(), ye && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
769
|
+
let r = Date.now();
|
|
770
|
+
e.input.lastIOSEnter = r, e.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
771
|
+
e.input.lastIOSEnter == r && (e.someProp("handleKeyDown", (o) => o(e, We(13, "Enter"))), e.input.lastIOSEnter = 0);
|
|
772
|
+
}, 200);
|
|
773
|
+
} else e.someProp("handleKeyDown", (r) => r(e, t)) || Lt(e, t) ? t.preventDefault() : M(e, "key");
|
|
774
|
+
};
|
|
775
|
+
C.keyup = (e, n) => {
|
|
776
|
+
n.keyCode == 16 && (e.input.shiftKey = !1);
|
|
777
|
+
};
|
|
778
|
+
C.keypress = (e, n) => {
|
|
779
|
+
let t = n;
|
|
780
|
+
if (rt(e, t) || !t.charCode || t.ctrlKey && !t.altKey || S && t.metaKey)
|
|
781
|
+
return;
|
|
782
|
+
if (e.someProp("handleKeyPress", (o) => o(e, t))) {
|
|
783
|
+
t.preventDefault();
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
let r = e.state.selection;
|
|
787
|
+
if (!(r instanceof D) || !r.$from.sameParent(r.$to)) {
|
|
788
|
+
let o = String.fromCharCode(t.charCode), l = () => e.state.tr.insertText(o).scrollIntoView();
|
|
789
|
+
!/[\r\n]/.test(o) && !e.someProp("handleTextInput", (s) => s(e, r.$from.pos, r.$to.pos, o, l)) && e.dispatch(l()), t.preventDefault();
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
function oe(e) {
|
|
793
|
+
return { left: e.clientX, top: e.clientY };
|
|
794
|
+
}
|
|
795
|
+
function Wt(e, n) {
|
|
796
|
+
let t = n.x - e.clientX, r = n.y - e.clientY;
|
|
797
|
+
return t * t + r * r < 100;
|
|
798
|
+
}
|
|
799
|
+
function Se(e, n, t, r, o) {
|
|
800
|
+
if (r == -1)
|
|
801
|
+
return !1;
|
|
802
|
+
let l = e.state.doc.resolve(r);
|
|
803
|
+
for (let s = l.depth + 1; s > 0; s--)
|
|
804
|
+
if (e.someProp(n, (i) => s > l.depth ? i(e, t, l.nodeAfter, l.before(s), o, !0) : i(e, t, l.node(s), l.before(s), o, !1)))
|
|
805
|
+
return !0;
|
|
806
|
+
return !1;
|
|
807
|
+
}
|
|
808
|
+
function U(e, n, t) {
|
|
809
|
+
if (e.focused || e.focus(), e.state.selection.eq(n))
|
|
810
|
+
return;
|
|
811
|
+
let r = e.state.tr.setSelection(n);
|
|
812
|
+
r.setMeta("pointer", !0), e.dispatch(r);
|
|
813
|
+
}
|
|
814
|
+
function Ut(e, n) {
|
|
815
|
+
if (n == -1)
|
|
816
|
+
return !1;
|
|
817
|
+
let t = e.state.doc.resolve(n), r = t.nodeAfter;
|
|
818
|
+
return r && r.isAtom && m.isSelectable(r) ? (U(e, new m(t)), !0) : !1;
|
|
819
|
+
}
|
|
820
|
+
function jt(e, n) {
|
|
821
|
+
if (n == -1)
|
|
822
|
+
return !1;
|
|
823
|
+
let t = e.state.selection, r, o;
|
|
824
|
+
t instanceof m && (r = t.node);
|
|
825
|
+
let l = e.state.doc.resolve(n);
|
|
826
|
+
for (let s = l.depth + 1; s > 0; s--) {
|
|
827
|
+
let i = s > l.depth ? l.nodeAfter : l.node(s);
|
|
828
|
+
if (m.isSelectable(i)) {
|
|
829
|
+
r && t.$from.depth > 0 && s >= t.$from.depth && l.before(t.$from.depth + 1) == t.$from.pos ? o = l.before(t.$from.depth) : o = l.before(s);
|
|
830
|
+
break;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
return o != null ? (U(e, m.create(e.state.doc, o)), !0) : !1;
|
|
834
|
+
}
|
|
835
|
+
function Xt(e, n, t, r, o) {
|
|
836
|
+
return Se(e, "handleClickOn", n, t, r) || e.someProp("handleClick", (l) => l(e, n, r)) || (o ? jt(e, t) : Ut(e, t));
|
|
837
|
+
}
|
|
838
|
+
function Yt(e, n, t, r) {
|
|
839
|
+
return Se(e, "handleDoubleClickOn", n, t, r) || e.someProp("handleDoubleClick", (o) => o(e, n, r));
|
|
840
|
+
}
|
|
841
|
+
function Jt(e, n, t, r) {
|
|
842
|
+
return Se(e, "handleTripleClickOn", n, t, r) || e.someProp("handleTripleClick", (o) => o(e, n, r)) || Gt(e, t, r);
|
|
843
|
+
}
|
|
844
|
+
function Gt(e, n, t) {
|
|
845
|
+
if (t.button != 0)
|
|
846
|
+
return !1;
|
|
847
|
+
let r = e.state.doc;
|
|
848
|
+
if (n == -1)
|
|
849
|
+
return r.inlineContent ? (U(e, D.create(r, 0, r.content.size)), !0) : !1;
|
|
850
|
+
let o = r.resolve(n);
|
|
851
|
+
for (let l = o.depth + 1; l > 0; l--) {
|
|
852
|
+
let s = l > o.depth ? o.nodeAfter : o.node(l), i = o.before(l);
|
|
853
|
+
if (s.inlineContent)
|
|
854
|
+
U(e, D.create(r, i + 1, i + 1 + s.content.size));
|
|
855
|
+
else if (m.isSelectable(s))
|
|
856
|
+
U(e, m.create(r, i));
|
|
857
|
+
else
|
|
858
|
+
continue;
|
|
859
|
+
return !0;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
function De(e) {
|
|
863
|
+
return ee(e);
|
|
864
|
+
}
|
|
865
|
+
const nt = S ? "metaKey" : "ctrlKey";
|
|
866
|
+
T.mousedown = (e, n) => {
|
|
867
|
+
let t = n;
|
|
868
|
+
e.input.shiftKey = t.shiftKey;
|
|
869
|
+
let r = De(e), o = Date.now(), l = "singleClick";
|
|
870
|
+
o - e.input.lastClick.time < 500 && Wt(t, e.input.lastClick) && !t[nt] && e.input.lastClick.button == t.button && (e.input.lastClick.type == "singleClick" ? l = "doubleClick" : e.input.lastClick.type == "doubleClick" && (l = "tripleClick")), e.input.lastClick = { time: o, x: t.clientX, y: t.clientY, type: l, button: t.button };
|
|
871
|
+
let s = e.posAtCoords(oe(t));
|
|
872
|
+
s && (l == "singleClick" ? (e.input.mouseDown && e.input.mouseDown.done(), e.input.mouseDown = new Qt(e, s, t, !!r)) : (l == "doubleClick" ? Yt : Jt)(e, s.pos, s.inside, t) ? t.preventDefault() : M(e, "pointer"));
|
|
873
|
+
};
|
|
874
|
+
class Qt {
|
|
875
|
+
constructor(n, t, r, o) {
|
|
876
|
+
this.view = n, this.pos = t, this.event = r, this.flushed = o, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = n.state.doc, this.selectNode = !!r[nt], this.allowDefault = r.shiftKey;
|
|
877
|
+
let l, s;
|
|
878
|
+
if (t.inside > -1)
|
|
879
|
+
l = n.state.doc.nodeAt(t.inside), s = t.inside;
|
|
880
|
+
else {
|
|
881
|
+
let f = n.state.doc.resolve(t.pos);
|
|
882
|
+
l = f.parent, s = f.depth ? f.before() : 0;
|
|
883
|
+
}
|
|
884
|
+
const i = o ? null : r.target, a = i ? n.docView.nearestDesc(i, !0) : null;
|
|
885
|
+
this.target = a && a.nodeDOM.nodeType == 1 ? a.nodeDOM : null;
|
|
886
|
+
let { selection: c } = n.state;
|
|
887
|
+
(r.button == 0 && l.type.spec.draggable && l.type.spec.selectable !== !1 || c instanceof m && c.from <= s && c.to > s) && (this.mightDrag = {
|
|
888
|
+
node: l,
|
|
889
|
+
pos: s,
|
|
890
|
+
addAttr: !!(this.target && !this.target.draggable),
|
|
891
|
+
setUneditable: !!(this.target && re && !this.target.hasAttribute("contentEditable"))
|
|
892
|
+
}), this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable) && (this.view.domObserver.stop(), this.mightDrag.addAttr && (this.target.draggable = !0), this.mightDrag.setUneditable && setTimeout(() => {
|
|
893
|
+
this.view.input.mouseDown == this && this.target.setAttribute("contentEditable", "false");
|
|
894
|
+
}, 20), this.view.domObserver.start()), n.root.addEventListener("mouseup", this.up = this.up.bind(this)), n.root.addEventListener("mousemove", this.move = this.move.bind(this)), M(n, "pointer");
|
|
895
|
+
}
|
|
896
|
+
done() {
|
|
897
|
+
this.view.root.removeEventListener("mouseup", this.up), this.view.root.removeEventListener("mousemove", this.move), this.mightDrag && this.target && (this.view.domObserver.stop(), this.mightDrag.addAttr && this.target.removeAttribute("draggable"), this.mightDrag.setUneditable && this.target.removeAttribute("contentEditable"), this.view.domObserver.start()), this.delayedSelectionSync && setTimeout(() => Ce(this.view)), this.view.input.mouseDown = null;
|
|
898
|
+
}
|
|
899
|
+
up(n) {
|
|
900
|
+
if (this.done(), !this.view.dom.contains(n.target))
|
|
901
|
+
return;
|
|
902
|
+
let t = this.pos;
|
|
903
|
+
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(oe(n))), this.updateAllowDefault(n), this.allowDefault || !t ? M(this.view, "pointer") : Xt(this.view, t.pos, t.inside, n, this.selectNode) ? n.preventDefault() : n.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
904
|
+
q && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
905
|
+
// cursor, but still report that the node is selected
|
|
906
|
+
// when asked through getSelection. You'll then get a
|
|
907
|
+
// situation where clicking at the point where that
|
|
908
|
+
// (hidden) cursor is doesn't change the selection, and
|
|
909
|
+
// thus doesn't get a reaction from ProseMirror. This
|
|
910
|
+
// works around that.
|
|
911
|
+
I && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (U(this.view, Z.near(this.view.state.doc.resolve(t.pos))), n.preventDefault()) : M(this.view, "pointer");
|
|
912
|
+
}
|
|
913
|
+
move(n) {
|
|
914
|
+
this.updateAllowDefault(n), M(this.view, "pointer"), n.buttons == 0 && this.done();
|
|
915
|
+
}
|
|
916
|
+
updateAllowDefault(n) {
|
|
917
|
+
!this.allowDefault && (Math.abs(this.event.x - n.clientX) > 4 || Math.abs(this.event.y - n.clientY) > 4) && (this.allowDefault = !0);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
T.touchstart = (e) => {
|
|
921
|
+
e.input.lastTouch = Date.now(), De(e), M(e, "pointer");
|
|
922
|
+
};
|
|
923
|
+
T.touchmove = (e) => {
|
|
924
|
+
e.input.lastTouch = Date.now(), M(e, "pointer");
|
|
925
|
+
};
|
|
926
|
+
T.contextmenu = (e) => De(e);
|
|
927
|
+
function rt(e, n) {
|
|
928
|
+
return e.composing ? !0 : q && Math.abs(n.timeStamp - e.input.compositionEndedAt) < 500 ? (e.input.compositionEndedAt = -2e8, !0) : !1;
|
|
929
|
+
}
|
|
930
|
+
const Zt = G ? 5e3 : -1;
|
|
931
|
+
C.compositionstart = C.compositionupdate = (e) => {
|
|
932
|
+
if (!e.composing) {
|
|
933
|
+
e.domObserver.flush();
|
|
934
|
+
let { state: n } = e, t = n.selection.$to;
|
|
935
|
+
if (n.selection instanceof D && (n.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1)))
|
|
936
|
+
e.markCursor = e.state.storedMarks || t.marks(), ee(e, !0), e.markCursor = null;
|
|
937
|
+
else if (ee(e, !n.selection.empty), re && n.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
|
|
938
|
+
let r = e.domSelectionRange();
|
|
939
|
+
for (let o = r.focusNode, l = r.focusOffset; o && o.nodeType == 1 && l != 0; ) {
|
|
940
|
+
let s = l < 0 ? o.lastChild : o.childNodes[l - 1];
|
|
941
|
+
if (!s)
|
|
942
|
+
break;
|
|
943
|
+
if (s.nodeType == 3) {
|
|
944
|
+
let i = e.domSelection();
|
|
945
|
+
i && i.collapse(s, s.nodeValue.length);
|
|
946
|
+
break;
|
|
947
|
+
} else
|
|
948
|
+
o = s, l = -1;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
e.input.composing = !0;
|
|
952
|
+
}
|
|
953
|
+
ot(e, Zt);
|
|
954
|
+
};
|
|
955
|
+
C.compositionend = (e, n) => {
|
|
956
|
+
e.composing && (e.input.composing = !1, e.input.compositionEndedAt = n.timeStamp, e.input.compositionPendingChanges = e.domObserver.pendingRecords().length ? e.input.compositionID : 0, e.input.compositionNode = null, e.input.compositionPendingChanges && Promise.resolve().then(() => e.domObserver.flush()), e.input.compositionID++, ot(e, 20));
|
|
957
|
+
};
|
|
958
|
+
function ot(e, n) {
|
|
959
|
+
clearTimeout(e.input.composingTimeout), n > -1 && (e.input.composingTimeout = setTimeout(() => ee(e), n));
|
|
960
|
+
}
|
|
961
|
+
function _t(e) {
|
|
962
|
+
for (e.composing && (e.input.composing = !1, e.input.compositionEndedAt = wt()); e.input.compositionNodes.length > 0; )
|
|
963
|
+
e.input.compositionNodes.pop().markParentsDirty();
|
|
964
|
+
}
|
|
965
|
+
function wt() {
|
|
966
|
+
let e = document.createEvent("Event");
|
|
967
|
+
return e.initEvent("event", !0, !0), e.timeStamp;
|
|
968
|
+
}
|
|
969
|
+
function ee(e, n = !1) {
|
|
970
|
+
if (!(G && e.domObserver.flushingSoon >= 0)) {
|
|
971
|
+
if (e.domObserver.forceFlush(), _t(e), n || e.docView && e.docView.dirty) {
|
|
972
|
+
let t = Tt(e), r = e.state.selection;
|
|
973
|
+
return t && !t.eq(r) ? e.dispatch(e.state.tr.setSelection(t)) : (e.markCursor || n) && !r.$from.node(r.$from.sharedDepth(r.to)).inlineContent ? e.dispatch(e.state.tr.deleteSelection()) : e.updateState(e.state), !0;
|
|
974
|
+
}
|
|
975
|
+
return !1;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
function vt(e, n) {
|
|
979
|
+
if (!e.dom.parentNode)
|
|
980
|
+
return;
|
|
981
|
+
let t = e.dom.parentNode.appendChild(document.createElement("div"));
|
|
982
|
+
t.appendChild(n), t.style.cssText = "position: fixed; left: -10000px; top: 10px";
|
|
983
|
+
let r = getSelection(), o = document.createRange();
|
|
984
|
+
o.selectNodeContents(n), e.dom.blur(), r.removeAllRanges(), r.addRange(o), setTimeout(() => {
|
|
985
|
+
t.parentNode && t.parentNode.removeChild(t), e.focus();
|
|
986
|
+
}, 50);
|
|
987
|
+
}
|
|
988
|
+
const X = J && je < 15 || ye && Nt < 604;
|
|
989
|
+
T.copy = C.cut = (e, n) => {
|
|
990
|
+
let t = n, r = e.state.selection, o = t.type == "cut";
|
|
991
|
+
if (r.empty)
|
|
992
|
+
return;
|
|
993
|
+
let l = X ? null : t.clipboardData, s = r.content(), { dom: i, text: a } = Qe(e, s);
|
|
994
|
+
l ? (t.preventDefault(), l.clearData(), l.setData("text/html", i.innerHTML), l.setData("text/plain", a)) : vt(e, i), o && e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
995
|
+
};
|
|
996
|
+
function en(e) {
|
|
997
|
+
return e.openStart == 0 && e.openEnd == 0 && e.content.childCount == 1 ? e.content.firstChild : null;
|
|
998
|
+
}
|
|
999
|
+
function tn(e, n) {
|
|
1000
|
+
if (!e.dom.parentNode)
|
|
1001
|
+
return;
|
|
1002
|
+
let t = e.input.shiftKey || e.state.selection.$from.parent.type.spec.code, r = e.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
|
|
1003
|
+
t || (r.contentEditable = "true"), r.style.cssText = "position: fixed; left: -10000px; top: 10px", r.focus();
|
|
1004
|
+
let o = e.input.shiftKey && e.input.lastKeyCode != 45;
|
|
1005
|
+
setTimeout(() => {
|
|
1006
|
+
e.focus(), r.parentNode && r.parentNode.removeChild(r), t ? me(e, r.value, null, o, n) : me(e, r.textContent, r.innerHTML, o, n);
|
|
1007
|
+
}, 50);
|
|
1008
|
+
}
|
|
1009
|
+
function me(e, n, t, r, o) {
|
|
1010
|
+
let l = Ze(e, n, t, r, e.state.selection.$from);
|
|
1011
|
+
if (e.someProp("handlePaste", (a) => a(e, o, l || z.empty)))
|
|
1012
|
+
return !0;
|
|
1013
|
+
if (!l)
|
|
1014
|
+
return !1;
|
|
1015
|
+
let s = en(l), i = s ? e.state.tr.replaceSelectionWith(s, r) : e.state.tr.replaceSelection(l);
|
|
1016
|
+
return e.dispatch(i.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
|
|
1017
|
+
}
|
|
1018
|
+
function lt(e) {
|
|
1019
|
+
let n = e.getData("text/plain") || e.getData("Text");
|
|
1020
|
+
if (n)
|
|
1021
|
+
return n;
|
|
1022
|
+
let t = e.getData("text/uri-list");
|
|
1023
|
+
return t ? t.replace(/\r?\n/g, " ") : "";
|
|
1024
|
+
}
|
|
1025
|
+
C.paste = (e, n) => {
|
|
1026
|
+
let t = n;
|
|
1027
|
+
if (e.composing && !G)
|
|
1028
|
+
return;
|
|
1029
|
+
let r = X ? null : t.clipboardData, o = e.input.shiftKey && e.input.lastKeyCode != 45;
|
|
1030
|
+
r && me(e, lt(r), r.getData("text/html"), o, t) ? t.preventDefault() : tn(e, t);
|
|
1031
|
+
};
|
|
1032
|
+
class nn {
|
|
1033
|
+
constructor(n, t, r) {
|
|
1034
|
+
this.slice = n, this.move = t, this.node = r;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
const rn = S ? "altKey" : "ctrlKey";
|
|
1038
|
+
function st(e, n) {
|
|
1039
|
+
let t = e.someProp("dragCopies", (r) => !r(n));
|
|
1040
|
+
return t ?? !n[rn];
|
|
1041
|
+
}
|
|
1042
|
+
T.dragstart = (e, n) => {
|
|
1043
|
+
let t = n, r = e.input.mouseDown;
|
|
1044
|
+
if (r && r.done(), !t.dataTransfer)
|
|
1045
|
+
return;
|
|
1046
|
+
let o = e.state.selection, l = o.empty ? null : e.posAtCoords(oe(t)), s;
|
|
1047
|
+
if (!(l && l.pos >= o.from && l.pos <= (o instanceof m ? o.to - 1 : o.to))) {
|
|
1048
|
+
if (r && r.mightDrag)
|
|
1049
|
+
s = m.create(e.state.doc, r.mightDrag.pos);
|
|
1050
|
+
else if (t.target && t.target.nodeType == 1) {
|
|
1051
|
+
let u = e.docView.nearestDesc(t.target, !0);
|
|
1052
|
+
u && u.node.type.spec.draggable && u != e.docView && (s = m.create(e.state.doc, u.posBefore));
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
let i = (s || e.state.selection).content(), { dom: a, text: c, slice: f } = Qe(e, i);
|
|
1056
|
+
(!t.dataTransfer.files.length || !I || Xe > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(X ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", X || t.dataTransfer.setData("text/plain", c), e.dragging = new nn(f, st(e, t), s);
|
|
1057
|
+
};
|
|
1058
|
+
T.dragend = (e) => {
|
|
1059
|
+
let n = e.dragging;
|
|
1060
|
+
window.setTimeout(() => {
|
|
1061
|
+
e.dragging == n && (e.dragging = null);
|
|
1062
|
+
}, 50);
|
|
1063
|
+
};
|
|
1064
|
+
C.dragover = C.dragenter = (e, n) => n.preventDefault();
|
|
1065
|
+
C.drop = (e, n) => {
|
|
1066
|
+
let t = n, r = e.dragging;
|
|
1067
|
+
if (e.dragging = null, !t.dataTransfer)
|
|
1068
|
+
return;
|
|
1069
|
+
let o = e.posAtCoords(oe(t));
|
|
1070
|
+
if (!o)
|
|
1071
|
+
return;
|
|
1072
|
+
let l = e.state.doc.resolve(o.pos), s = r && r.slice;
|
|
1073
|
+
s ? e.someProp("transformPasted", (h) => {
|
|
1074
|
+
s = h(s, e, !1);
|
|
1075
|
+
}) : s = Ze(e, lt(t.dataTransfer), X ? null : t.dataTransfer.getData("text/html"), !1, l);
|
|
1076
|
+
let i = !!(r && st(e, t));
|
|
1077
|
+
if (e.someProp("handleDrop", (h) => h(e, t, s || z.empty, i))) {
|
|
1078
|
+
t.preventDefault();
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
if (!s)
|
|
1082
|
+
return;
|
|
1083
|
+
t.preventDefault();
|
|
1084
|
+
let a = s ? ft(e.state.doc, l.pos, s) : l.pos;
|
|
1085
|
+
a == null && (a = l.pos);
|
|
1086
|
+
let c = e.state.tr;
|
|
1087
|
+
if (i) {
|
|
1088
|
+
let { node: h } = r;
|
|
1089
|
+
h ? h.replace(c) : c.deleteSelection();
|
|
1090
|
+
}
|
|
1091
|
+
let f = c.mapping.map(a), u = s.openStart == 0 && s.openEnd == 0 && s.content.childCount == 1, d = c.doc;
|
|
1092
|
+
if (u ? c.replaceRangeWith(f, f, s.content.firstChild) : c.replaceRange(f, f, s), c.doc.eq(d))
|
|
1093
|
+
return;
|
|
1094
|
+
let p = c.doc.resolve(f);
|
|
1095
|
+
if (u && m.isSelectable(s.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(s.content.firstChild))
|
|
1096
|
+
c.setSelection(new m(p));
|
|
1097
|
+
else {
|
|
1098
|
+
let h = c.mapping.map(a);
|
|
1099
|
+
c.mapping.maps[c.mapping.maps.length - 1].forEach((O, k, N, Q) => h = Q), c.setSelection(Je(e, p, c.doc.resolve(h)));
|
|
1100
|
+
}
|
|
1101
|
+
e.focus(), e.dispatch(c.setMeta("uiEvent", "drop"));
|
|
1102
|
+
};
|
|
1103
|
+
T.focus = (e) => {
|
|
1104
|
+
e.input.lastFocus = Date.now(), e.focused || (e.domObserver.stop(), e.dom.classList.add("ProseMirror-focused"), e.domObserver.start(), e.focused = !0, setTimeout(() => {
|
|
1105
|
+
e.docView && e.hasFocus() && !e.domObserver.currentSelection.eq(e.domSelectionRange()) && Ce(e);
|
|
1106
|
+
}, 20));
|
|
1107
|
+
};
|
|
1108
|
+
T.blur = (e, n) => {
|
|
1109
|
+
let t = n;
|
|
1110
|
+
e.focused && (e.domObserver.stop(), e.dom.classList.remove("ProseMirror-focused"), e.domObserver.start(), t.relatedTarget && e.dom.contains(t.relatedTarget) && e.domObserver.currentSelection.clear(), e.focused = !1);
|
|
1111
|
+
};
|
|
1112
|
+
T.beforeinput = (e, n) => {
|
|
1113
|
+
if (I && G && n.inputType == "deleteContentBackward") {
|
|
1114
|
+
e.domObserver.flushSoon();
|
|
1115
|
+
let { domChangeCount: r } = e.input;
|
|
1116
|
+
setTimeout(() => {
|
|
1117
|
+
if (e.input.domChangeCount != r || (e.dom.blur(), e.focus(), e.someProp("handleKeyDown", (l) => l(e, We(8, "Backspace")))))
|
|
1118
|
+
return;
|
|
1119
|
+
let { $cursor: o } = e.state.selection;
|
|
1120
|
+
o && o.pos > 0 && e.dispatch(e.state.tr.delete(o.pos - 1, o.pos).scrollIntoView());
|
|
1121
|
+
}, 50);
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
for (let e in C)
|
|
1125
|
+
T[e] = C[e];
|
|
1126
|
+
function Y(e, n) {
|
|
1127
|
+
if (e == n)
|
|
1128
|
+
return !0;
|
|
1129
|
+
for (let t in e)
|
|
1130
|
+
if (e[t] !== n[t])
|
|
1131
|
+
return !1;
|
|
1132
|
+
for (let t in n)
|
|
1133
|
+
if (!(t in e))
|
|
1134
|
+
return !1;
|
|
1135
|
+
return !0;
|
|
1136
|
+
}
|
|
1137
|
+
class te {
|
|
1138
|
+
constructor(n, t) {
|
|
1139
|
+
this.toDOM = n, this.spec = t || L, this.side = this.spec.side || 0;
|
|
1140
|
+
}
|
|
1141
|
+
map(n, t, r, o) {
|
|
1142
|
+
let { pos: l, deleted: s } = n.mapResult(t.from + o, this.side < 0 ? -1 : 1);
|
|
1143
|
+
return s ? null : new E(l - r, l - r, this);
|
|
1144
|
+
}
|
|
1145
|
+
valid() {
|
|
1146
|
+
return !0;
|
|
1147
|
+
}
|
|
1148
|
+
eq(n) {
|
|
1149
|
+
return this == n || n instanceof te && (this.spec.key && this.spec.key == n.spec.key || this.toDOM == n.toDOM && Y(this.spec, n.spec));
|
|
1150
|
+
}
|
|
1151
|
+
destroy(n) {
|
|
1152
|
+
this.spec.destroy && this.spec.destroy(n);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
class P {
|
|
1156
|
+
constructor(n, t) {
|
|
1157
|
+
this.attrs = n, this.spec = t || L;
|
|
1158
|
+
}
|
|
1159
|
+
map(n, t, r, o) {
|
|
1160
|
+
let l = n.map(t.from + o, this.spec.inclusiveStart ? -1 : 1) - r, s = n.map(t.to + o, this.spec.inclusiveEnd ? 1 : -1) - r;
|
|
1161
|
+
return l >= s ? null : new E(l, s, this);
|
|
1162
|
+
}
|
|
1163
|
+
valid(n, t) {
|
|
1164
|
+
return t.from < t.to;
|
|
1165
|
+
}
|
|
1166
|
+
eq(n) {
|
|
1167
|
+
return this == n || n instanceof P && Y(this.attrs, n.attrs) && Y(this.spec, n.spec);
|
|
1168
|
+
}
|
|
1169
|
+
static is(n) {
|
|
1170
|
+
return n.type instanceof P;
|
|
1171
|
+
}
|
|
1172
|
+
destroy() {
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
class ke {
|
|
1176
|
+
constructor(n, t) {
|
|
1177
|
+
this.attrs = n, this.spec = t || L;
|
|
1178
|
+
}
|
|
1179
|
+
map(n, t, r, o) {
|
|
1180
|
+
let l = n.mapResult(t.from + o, 1);
|
|
1181
|
+
if (l.deleted)
|
|
1182
|
+
return null;
|
|
1183
|
+
let s = n.mapResult(t.to + o, -1);
|
|
1184
|
+
return s.deleted || s.pos <= l.pos ? null : new E(l.pos - r, s.pos - r, this);
|
|
1185
|
+
}
|
|
1186
|
+
valid(n, t) {
|
|
1187
|
+
let { index: r, offset: o } = n.content.findIndex(t.from), l;
|
|
1188
|
+
return o == t.from && !(l = n.child(r)).isText && o + l.nodeSize == t.to;
|
|
1189
|
+
}
|
|
1190
|
+
eq(n) {
|
|
1191
|
+
return this == n || n instanceof ke && Y(this.attrs, n.attrs) && Y(this.spec, n.spec);
|
|
1192
|
+
}
|
|
1193
|
+
destroy() {
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
class E {
|
|
1197
|
+
/**
|
|
1198
|
+
@internal
|
|
1199
|
+
*/
|
|
1200
|
+
constructor(n, t, r) {
|
|
1201
|
+
this.from = n, this.to = t, this.type = r;
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
@internal
|
|
1205
|
+
*/
|
|
1206
|
+
copy(n, t) {
|
|
1207
|
+
return new E(n, t, this.type);
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
@internal
|
|
1211
|
+
*/
|
|
1212
|
+
eq(n, t = 0) {
|
|
1213
|
+
return this.type.eq(n.type) && this.from + t == n.from && this.to + t == n.to;
|
|
1214
|
+
}
|
|
1215
|
+
/**
|
|
1216
|
+
@internal
|
|
1217
|
+
*/
|
|
1218
|
+
map(n, t, r) {
|
|
1219
|
+
return this.type.map(n, this, t, r);
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
Creates a widget decoration, which is a DOM node that's shown in
|
|
1223
|
+
the document at the given position. It is recommended that you
|
|
1224
|
+
delay rendering the widget by passing a function that will be
|
|
1225
|
+
called when the widget is actually drawn in a view, but you can
|
|
1226
|
+
also directly pass a DOM node. `getPos` can be used to find the
|
|
1227
|
+
widget's current document position.
|
|
1228
|
+
*/
|
|
1229
|
+
static widget(n, t, r) {
|
|
1230
|
+
return new E(n, n, new te(t, r));
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
Creates an inline decoration, which adds the given attributes to
|
|
1234
|
+
each inline node between `from` and `to`.
|
|
1235
|
+
*/
|
|
1236
|
+
static inline(n, t, r, o) {
|
|
1237
|
+
return new E(n, t, new P(r, o));
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
Creates a node decoration. `from` and `to` should point precisely
|
|
1241
|
+
before and after a node in the document. That node, and only that
|
|
1242
|
+
node, will receive the given attributes.
|
|
1243
|
+
*/
|
|
1244
|
+
static node(n, t, r, o) {
|
|
1245
|
+
return new E(n, t, new ke(r, o));
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
The spec provided when creating this decoration. Can be useful
|
|
1249
|
+
if you've stored extra information in that object.
|
|
1250
|
+
*/
|
|
1251
|
+
get spec() {
|
|
1252
|
+
return this.type.spec;
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1255
|
+
@internal
|
|
1256
|
+
*/
|
|
1257
|
+
get inline() {
|
|
1258
|
+
return this.type instanceof P;
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
@internal
|
|
1262
|
+
*/
|
|
1263
|
+
get widget() {
|
|
1264
|
+
return this.type instanceof te;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
const W = [], L = {};
|
|
1268
|
+
class g {
|
|
1269
|
+
/**
|
|
1270
|
+
@internal
|
|
1271
|
+
*/
|
|
1272
|
+
constructor(n, t) {
|
|
1273
|
+
this.local = n.length ? n : W, this.children = t.length ? t : W;
|
|
1274
|
+
}
|
|
1275
|
+
/**
|
|
1276
|
+
Create a set of decorations, using the structure of the given
|
|
1277
|
+
document. This will consume (modify) the `decorations` array, so
|
|
1278
|
+
you must make a copy if you want need to preserve that.
|
|
1279
|
+
*/
|
|
1280
|
+
static create(n, t) {
|
|
1281
|
+
return t.length ? ne(t, n, 0, L) : b;
|
|
1282
|
+
}
|
|
1283
|
+
/**
|
|
1284
|
+
Find all decorations in this set which touch the given range
|
|
1285
|
+
(including decorations that start or end directly at the
|
|
1286
|
+
boundaries) and match the given predicate on their spec. When
|
|
1287
|
+
`start` and `end` are omitted, all decorations in the set are
|
|
1288
|
+
considered. When `predicate` isn't given, all decorations are
|
|
1289
|
+
assumed to match.
|
|
1290
|
+
*/
|
|
1291
|
+
find(n, t, r) {
|
|
1292
|
+
let o = [];
|
|
1293
|
+
return this.findInner(n ?? 0, t ?? 1e9, o, 0, r), o;
|
|
1294
|
+
}
|
|
1295
|
+
findInner(n, t, r, o, l) {
|
|
1296
|
+
for (let s = 0; s < this.local.length; s++) {
|
|
1297
|
+
let i = this.local[s];
|
|
1298
|
+
i.from <= t && i.to >= n && (!l || l(i.spec)) && r.push(i.copy(i.from + o, i.to + o));
|
|
1299
|
+
}
|
|
1300
|
+
for (let s = 0; s < this.children.length; s += 3)
|
|
1301
|
+
if (this.children[s] < t && this.children[s + 1] > n) {
|
|
1302
|
+
let i = this.children[s] + 1;
|
|
1303
|
+
this.children[s + 2].findInner(n - i, t - i, r, o + i, l);
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
Map the set of decorations in response to a change in the
|
|
1308
|
+
document.
|
|
1309
|
+
*/
|
|
1310
|
+
map(n, t, r) {
|
|
1311
|
+
return this == b || n.maps.length == 0 ? this : this.mapInner(n, t, 0, 0, r || L);
|
|
1312
|
+
}
|
|
1313
|
+
/**
|
|
1314
|
+
@internal
|
|
1315
|
+
*/
|
|
1316
|
+
mapInner(n, t, r, o, l) {
|
|
1317
|
+
let s;
|
|
1318
|
+
for (let i = 0; i < this.local.length; i++) {
|
|
1319
|
+
let a = this.local[i].map(n, r, o);
|
|
1320
|
+
a && a.type.valid(t, a) ? (s || (s = [])).push(a) : l.onRemove && l.onRemove(this.local[i].spec);
|
|
1321
|
+
}
|
|
1322
|
+
return this.children.length ? on(this.children, s || [], n, t, r, o, l) : s ? new g(s.sort(V), W) : b;
|
|
1323
|
+
}
|
|
1324
|
+
/**
|
|
1325
|
+
Add the given array of decorations to the ones in the set,
|
|
1326
|
+
producing a new set. Consumes the `decorations` array. Needs
|
|
1327
|
+
access to the current document to create the appropriate tree
|
|
1328
|
+
structure.
|
|
1329
|
+
*/
|
|
1330
|
+
add(n, t) {
|
|
1331
|
+
return t.length ? this == b ? g.create(n, t) : this.addInner(n, t, 0) : this;
|
|
1332
|
+
}
|
|
1333
|
+
addInner(n, t, r) {
|
|
1334
|
+
let o, l = 0;
|
|
1335
|
+
n.forEach((i, a) => {
|
|
1336
|
+
let c = a + r, f;
|
|
1337
|
+
if (f = at(t, i, c)) {
|
|
1338
|
+
for (o || (o = this.children.slice()); l < o.length && o[l] < a; )
|
|
1339
|
+
l += 3;
|
|
1340
|
+
o[l] == a ? o[l + 2] = o[l + 2].addInner(i, f, c + 1) : o.splice(l, 0, a, a + i.nodeSize, ne(f, i, c + 1, L)), l += 3;
|
|
1341
|
+
}
|
|
1342
|
+
});
|
|
1343
|
+
let s = it(l ? ct(t) : t, -r);
|
|
1344
|
+
for (let i = 0; i < s.length; i++)
|
|
1345
|
+
s[i].type.valid(n, s[i]) || s.splice(i--, 1);
|
|
1346
|
+
return new g(s.length ? this.local.concat(s).sort(V) : this.local, o || this.children);
|
|
1347
|
+
}
|
|
1348
|
+
/**
|
|
1349
|
+
Create a new set that contains the decorations in this set, minus
|
|
1350
|
+
the ones in the given array.
|
|
1351
|
+
*/
|
|
1352
|
+
remove(n) {
|
|
1353
|
+
return n.length == 0 || this == b ? this : this.removeInner(n, 0);
|
|
1354
|
+
}
|
|
1355
|
+
removeInner(n, t) {
|
|
1356
|
+
let r = this.children, o = this.local;
|
|
1357
|
+
for (let l = 0; l < r.length; l += 3) {
|
|
1358
|
+
let s, i = r[l] + t, a = r[l + 1] + t;
|
|
1359
|
+
for (let f = 0, u; f < n.length; f++)
|
|
1360
|
+
(u = n[f]) && u.from > i && u.to < a && (n[f] = null, (s || (s = [])).push(u));
|
|
1361
|
+
if (!s)
|
|
1362
|
+
continue;
|
|
1363
|
+
r == this.children && (r = this.children.slice());
|
|
1364
|
+
let c = r[l + 2].removeInner(s, i + 1);
|
|
1365
|
+
c != b ? r[l + 2] = c : (r.splice(l, 3), l -= 3);
|
|
1366
|
+
}
|
|
1367
|
+
if (o.length) {
|
|
1368
|
+
for (let l = 0, s; l < n.length; l++)
|
|
1369
|
+
if (s = n[l])
|
|
1370
|
+
for (let i = 0; i < o.length; i++)
|
|
1371
|
+
o[i].eq(s, t) && (o == this.local && (o = this.local.slice()), o.splice(i--, 1));
|
|
1372
|
+
}
|
|
1373
|
+
return r == this.children && o == this.local ? this : o.length || r.length ? new g(o, r) : b;
|
|
1374
|
+
}
|
|
1375
|
+
forChild(n, t) {
|
|
1376
|
+
if (this == b)
|
|
1377
|
+
return this;
|
|
1378
|
+
if (t.isLeaf)
|
|
1379
|
+
return g.empty;
|
|
1380
|
+
let r, o;
|
|
1381
|
+
for (let i = 0; i < this.children.length; i += 3)
|
|
1382
|
+
if (this.children[i] >= n) {
|
|
1383
|
+
this.children[i] == n && (r = this.children[i + 2]);
|
|
1384
|
+
break;
|
|
1385
|
+
}
|
|
1386
|
+
let l = n + 1, s = l + t.content.size;
|
|
1387
|
+
for (let i = 0; i < this.local.length; i++) {
|
|
1388
|
+
let a = this.local[i];
|
|
1389
|
+
if (a.from < s && a.to > l && a.type instanceof P) {
|
|
1390
|
+
let c = Math.max(l, a.from) - l, f = Math.min(s, a.to) - l;
|
|
1391
|
+
c < f && (o || (o = [])).push(a.copy(c, f));
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
if (o) {
|
|
1395
|
+
let i = new g(o.sort(V), W);
|
|
1396
|
+
return r ? new R([i, r]) : i;
|
|
1397
|
+
}
|
|
1398
|
+
return r || b;
|
|
1399
|
+
}
|
|
1400
|
+
/**
|
|
1401
|
+
@internal
|
|
1402
|
+
*/
|
|
1403
|
+
eq(n) {
|
|
1404
|
+
if (this == n)
|
|
1405
|
+
return !0;
|
|
1406
|
+
if (!(n instanceof g) || this.local.length != n.local.length || this.children.length != n.children.length)
|
|
1407
|
+
return !1;
|
|
1408
|
+
for (let t = 0; t < this.local.length; t++)
|
|
1409
|
+
if (!this.local[t].eq(n.local[t]))
|
|
1410
|
+
return !1;
|
|
1411
|
+
for (let t = 0; t < this.children.length; t += 3)
|
|
1412
|
+
if (this.children[t] != n.children[t] || this.children[t + 1] != n.children[t + 1] || !this.children[t + 2].eq(n.children[t + 2]))
|
|
1413
|
+
return !1;
|
|
1414
|
+
return !0;
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
@internal
|
|
1418
|
+
*/
|
|
1419
|
+
locals(n) {
|
|
1420
|
+
return Ne(this.localsInner(n));
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
@internal
|
|
1424
|
+
*/
|
|
1425
|
+
localsInner(n) {
|
|
1426
|
+
if (this == b)
|
|
1427
|
+
return W;
|
|
1428
|
+
if (n.inlineContent || !this.local.some(P.is))
|
|
1429
|
+
return this.local;
|
|
1430
|
+
let t = [];
|
|
1431
|
+
for (let r = 0; r < this.local.length; r++)
|
|
1432
|
+
this.local[r].type instanceof P || t.push(this.local[r]);
|
|
1433
|
+
return t;
|
|
1434
|
+
}
|
|
1435
|
+
forEachSet(n) {
|
|
1436
|
+
n(this);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
g.empty = new g([], []);
|
|
1440
|
+
g.removeOverlap = Ne;
|
|
1441
|
+
const b = g.empty;
|
|
1442
|
+
class R {
|
|
1443
|
+
constructor(n) {
|
|
1444
|
+
this.members = n;
|
|
1445
|
+
}
|
|
1446
|
+
map(n, t) {
|
|
1447
|
+
const r = this.members.map((o) => o.map(n, t, L));
|
|
1448
|
+
return R.from(r);
|
|
1449
|
+
}
|
|
1450
|
+
forChild(n, t) {
|
|
1451
|
+
if (t.isLeaf)
|
|
1452
|
+
return g.empty;
|
|
1453
|
+
let r = [];
|
|
1454
|
+
for (let o = 0; o < this.members.length; o++) {
|
|
1455
|
+
let l = this.members[o].forChild(n, t);
|
|
1456
|
+
l != b && (l instanceof R ? r = r.concat(l.members) : r.push(l));
|
|
1457
|
+
}
|
|
1458
|
+
return R.from(r);
|
|
1459
|
+
}
|
|
1460
|
+
eq(n) {
|
|
1461
|
+
if (!(n instanceof R) || n.members.length != this.members.length)
|
|
1462
|
+
return !1;
|
|
1463
|
+
for (let t = 0; t < this.members.length; t++)
|
|
1464
|
+
if (!this.members[t].eq(n.members[t]))
|
|
1465
|
+
return !1;
|
|
1466
|
+
return !0;
|
|
1467
|
+
}
|
|
1468
|
+
locals(n) {
|
|
1469
|
+
let t, r = !0;
|
|
1470
|
+
for (let o = 0; o < this.members.length; o++) {
|
|
1471
|
+
let l = this.members[o].localsInner(n);
|
|
1472
|
+
if (l.length)
|
|
1473
|
+
if (!t)
|
|
1474
|
+
t = l;
|
|
1475
|
+
else {
|
|
1476
|
+
r && (t = t.slice(), r = !1);
|
|
1477
|
+
for (let s = 0; s < l.length; s++)
|
|
1478
|
+
t.push(l[s]);
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
return t ? Ne(r ? t : t.sort(V)) : W;
|
|
1482
|
+
}
|
|
1483
|
+
// Create a group for the given array of decoration sets, or return
|
|
1484
|
+
// a single set when possible.
|
|
1485
|
+
static from(n) {
|
|
1486
|
+
switch (n.length) {
|
|
1487
|
+
case 0:
|
|
1488
|
+
return b;
|
|
1489
|
+
case 1:
|
|
1490
|
+
return n[0];
|
|
1491
|
+
default:
|
|
1492
|
+
return new R(n.every((t) => t instanceof g) ? n : n.reduce((t, r) => t.concat(r instanceof g ? r : r.members), []));
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
forEachSet(n) {
|
|
1496
|
+
for (let t = 0; t < this.members.length; t++)
|
|
1497
|
+
this.members[t].forEachSet(n);
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
function on(e, n, t, r, o, l, s) {
|
|
1501
|
+
let i = e.slice();
|
|
1502
|
+
for (let c = 0, f = l; c < t.maps.length; c++) {
|
|
1503
|
+
let u = 0;
|
|
1504
|
+
t.maps[c].forEach((d, p, h, O) => {
|
|
1505
|
+
let k = O - h - (p - d);
|
|
1506
|
+
for (let N = 0; N < i.length; N += 3) {
|
|
1507
|
+
let Q = i[N + 1];
|
|
1508
|
+
if (Q < 0 || d > Q + f - u)
|
|
1509
|
+
continue;
|
|
1510
|
+
let Te = i[N] + f - u;
|
|
1511
|
+
p >= Te ? i[N + 1] = d <= Te ? -2 : -1 : d >= f && k && (i[N] += k, i[N + 1] += k);
|
|
1512
|
+
}
|
|
1513
|
+
u += k;
|
|
1514
|
+
}), f = t.maps[c].map(f, -1);
|
|
1515
|
+
}
|
|
1516
|
+
let a = !1;
|
|
1517
|
+
for (let c = 0; c < i.length; c += 3)
|
|
1518
|
+
if (i[c + 1] < 0) {
|
|
1519
|
+
if (i[c + 1] == -2) {
|
|
1520
|
+
a = !0, i[c + 1] = -1;
|
|
1521
|
+
continue;
|
|
1522
|
+
}
|
|
1523
|
+
let f = t.map(e[c] + l), u = f - o;
|
|
1524
|
+
if (u < 0 || u >= r.content.size) {
|
|
1525
|
+
a = !0;
|
|
1526
|
+
continue;
|
|
1527
|
+
}
|
|
1528
|
+
let d = t.map(e[c + 1] + l, -1), p = d - o, { index: h, offset: O } = r.content.findIndex(u), k = r.maybeChild(h);
|
|
1529
|
+
if (k && O == u && O + k.nodeSize == p) {
|
|
1530
|
+
let N = i[c + 2].mapInner(t, k, f + 1, e[c] + l + 1, s);
|
|
1531
|
+
N != b ? (i[c] = u, i[c + 1] = p, i[c + 2] = N) : (i[c + 1] = -2, a = !0);
|
|
1532
|
+
} else
|
|
1533
|
+
a = !0;
|
|
1534
|
+
}
|
|
1535
|
+
if (a) {
|
|
1536
|
+
let c = ln(i, e, n, t, o, l, s), f = ne(c, r, 0, s);
|
|
1537
|
+
n = f.local;
|
|
1538
|
+
for (let u = 0; u < i.length; u += 3)
|
|
1539
|
+
i[u + 1] < 0 && (i.splice(u, 3), u -= 3);
|
|
1540
|
+
for (let u = 0, d = 0; u < f.children.length; u += 3) {
|
|
1541
|
+
let p = f.children[u];
|
|
1542
|
+
for (; d < i.length && i[d] < p; )
|
|
1543
|
+
d += 3;
|
|
1544
|
+
i.splice(d, 0, f.children[u], f.children[u + 1], f.children[u + 2]);
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
return new g(n.sort(V), i);
|
|
1548
|
+
}
|
|
1549
|
+
function it(e, n) {
|
|
1550
|
+
if (!n || !e.length)
|
|
1551
|
+
return e;
|
|
1552
|
+
let t = [];
|
|
1553
|
+
for (let r = 0; r < e.length; r++) {
|
|
1554
|
+
let o = e[r];
|
|
1555
|
+
t.push(new E(o.from + n, o.to + n, o.type));
|
|
1556
|
+
}
|
|
1557
|
+
return t;
|
|
1558
|
+
}
|
|
1559
|
+
function ln(e, n, t, r, o, l, s) {
|
|
1560
|
+
function i(a, c) {
|
|
1561
|
+
for (let f = 0; f < a.local.length; f++) {
|
|
1562
|
+
let u = a.local[f].map(r, o, c);
|
|
1563
|
+
u ? t.push(u) : s.onRemove && s.onRemove(a.local[f].spec);
|
|
1564
|
+
}
|
|
1565
|
+
for (let f = 0; f < a.children.length; f += 3)
|
|
1566
|
+
i(a.children[f + 2], a.children[f] + c + 1);
|
|
1567
|
+
}
|
|
1568
|
+
for (let a = 0; a < e.length; a += 3)
|
|
1569
|
+
e[a + 1] == -1 && i(e[a + 2], n[a] + l + 1);
|
|
1570
|
+
return t;
|
|
1571
|
+
}
|
|
1572
|
+
function at(e, n, t) {
|
|
1573
|
+
if (n.isLeaf)
|
|
1574
|
+
return null;
|
|
1575
|
+
let r = t + n.nodeSize, o = null;
|
|
1576
|
+
for (let l = 0, s; l < e.length; l++)
|
|
1577
|
+
(s = e[l]) && s.from > t && s.to < r && ((o || (o = [])).push(s), e[l] = null);
|
|
1578
|
+
return o;
|
|
1579
|
+
}
|
|
1580
|
+
function ct(e) {
|
|
1581
|
+
let n = [];
|
|
1582
|
+
for (let t = 0; t < e.length; t++)
|
|
1583
|
+
e[t] != null && n.push(e[t]);
|
|
1584
|
+
return n;
|
|
1585
|
+
}
|
|
1586
|
+
function ne(e, n, t, r) {
|
|
1587
|
+
let o = [], l = !1;
|
|
1588
|
+
n.forEach((i, a) => {
|
|
1589
|
+
let c = at(e, i, a + t);
|
|
1590
|
+
if (c) {
|
|
1591
|
+
l = !0;
|
|
1592
|
+
let f = ne(c, i, t + a + 1, r);
|
|
1593
|
+
f != b && o.push(a, a + i.nodeSize, f);
|
|
1594
|
+
}
|
|
1595
|
+
});
|
|
1596
|
+
let s = it(l ? ct(e) : e, -t).sort(V);
|
|
1597
|
+
for (let i = 0; i < s.length; i++)
|
|
1598
|
+
s[i].type.valid(n, s[i]) || (r.onRemove && r.onRemove(s[i].spec), s.splice(i--, 1));
|
|
1599
|
+
return s.length || o.length ? new g(s, o) : b;
|
|
1600
|
+
}
|
|
1601
|
+
function V(e, n) {
|
|
1602
|
+
return e.from - n.from || e.to - n.to;
|
|
1603
|
+
}
|
|
1604
|
+
function Ne(e) {
|
|
1605
|
+
let n = e;
|
|
1606
|
+
for (let t = 0; t < n.length - 1; t++) {
|
|
1607
|
+
let r = n[t];
|
|
1608
|
+
if (r.from != r.to)
|
|
1609
|
+
for (let o = t + 1; o < n.length; o++) {
|
|
1610
|
+
let l = n[o];
|
|
1611
|
+
if (l.from == r.from) {
|
|
1612
|
+
l.to != r.to && (n == e && (n = e.slice()), n[o] = l.copy(l.from, r.to), Fe(n, o + 1, l.copy(r.to, l.to)));
|
|
1613
|
+
continue;
|
|
1614
|
+
} else {
|
|
1615
|
+
l.from < r.to && (n == e && (n = e.slice()), n[t] = r.copy(r.from, l.from), Fe(n, o, r.copy(l.from, r.to)));
|
|
1616
|
+
break;
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
return n;
|
|
1621
|
+
}
|
|
1622
|
+
function Fe(e, n, t) {
|
|
1623
|
+
for (; n < e.length && V(t, e[n]) > 0; )
|
|
1624
|
+
n++;
|
|
1625
|
+
e.splice(n, 0, t);
|
|
1626
|
+
}
|
|
1627
|
+
export {
|
|
1628
|
+
g as D,
|
|
1629
|
+
E as a,
|
|
1630
|
+
an as k
|
|
1631
|
+
};
|