@vc-shell/framework 1.1.91-alpha.0 → 1.1.91-alpha.2
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/CHANGELOG.md +1408 -2771
- package/core/api/platform.ts +9883 -9883
- package/core/composables/useNotifications/index.ts +32 -1
- package/core/composables/useSettings/index.ts +8 -3
- package/core/plugins/signalR/index.ts +3 -3
- package/core/providers/auth-provider-utils.ts +26 -0
- package/core/providers/example-custom-auth-provider.ts +3 -2
- package/core/providers/platform-auth-provider.ts +5 -3
- package/core/types/auth-provider.ts +2 -6
- package/dist/core/api/platform.d.ts +1 -1
- package/dist/core/api/platform.d.ts.map +1 -1
- package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
- package/dist/core/composables/useSettings/index.d.ts.map +1 -1
- package/dist/core/providers/auth-provider-utils.d.ts +17 -0
- package/dist/core/providers/auth-provider-utils.d.ts.map +1 -0
- package/dist/core/providers/example-custom-auth-provider.d.ts +2 -2
- package/dist/core/providers/example-custom-auth-provider.d.ts.map +1 -1
- package/dist/core/providers/platform-auth-provider.d.ts +3 -3
- package/dist/core/providers/platform-auth-provider.d.ts.map +1 -1
- package/dist/core/types/auth-provider.d.ts +2 -2
- package/dist/core/types/auth-provider.d.ts.map +1 -1
- package/dist/framework.js +10440 -10407
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/shared/components/sign-in/useExternalProvider.d.ts +1 -1
- package/dist/shared/components/sign-in/useExternalProvider.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{vendor-core-js-azBmvlGv.js → vendor-core-js-DDuR6YMQ.js} +49 -49
- package/dist/vendor-microsoft-applicationinsights-analytics-js-C1Yxuzwg.js +1207 -0
- package/dist/{vendor-microsoft-applicationinsights-cfgsync-js-Dp8OU6ZE.js → vendor-microsoft-applicationinsights-cfgsync-js-DArHD4Dn.js} +20 -20
- package/dist/{vendor-microsoft-applicationinsights-channel-js-Bc73N-5y.js → vendor-microsoft-applicationinsights-channel-js-Dbs0XRes.js} +767 -754
- package/dist/{vendor-microsoft-applicationinsights-common-DcnOqpgL.js → vendor-microsoft-applicationinsights-common-OjU3Zs6r.js} +191 -191
- package/dist/vendor-microsoft-applicationinsights-core-js-DWRvqBek.js +4276 -0
- package/dist/{vendor-microsoft-applicationinsights-dependencies-js-C_DhEOae.js → vendor-microsoft-applicationinsights-dependencies-js-BxTNw-Sk.js} +422 -414
- package/dist/{vendor-microsoft-applicationinsights-properties-js-COczDd7b.js → vendor-microsoft-applicationinsights-properties-js-Gfhpu-At.js} +117 -117
- package/dist/{vendor-microsoft-applicationinsights-web-DtOQojwf.js → vendor-microsoft-applicationinsights-web-9yeJ0EZv.js} +59 -59
- package/dist/{vendor-nevware21-ts-async-DFUnZ_sN.js → vendor-nevware21-ts-async-CdMc_sGt.js} +4 -3
- package/dist/{vendor-prosemirror-gapcursor-3PaVPyUV.js → vendor-prosemirror-gapcursor-K-Pj0iVP.js} +1 -1
- package/dist/{vendor-prosemirror-tables-CezTPhzU.js → vendor-prosemirror-tables-MDKm8BUy.js} +1 -1
- package/dist/{vendor-prosemirror-view-CzsD5m3e.js → vendor-prosemirror-view-CesDChJC.js} +512 -511
- package/dist/{vendor-semver-B87_S22g.js → vendor-semver-Dar8oU3V.js} +38 -36
- package/dist/{vendor-tiptap-core-rgc3Sj5Y.js → vendor-tiptap-core-B000Ay3n.js} +4 -2
- package/dist/{vendor-tiptap-extension-blockquote-DgzMeNpc.js → vendor-tiptap-extension-blockquote-CHW3QVCH.js} +1 -1
- package/dist/{vendor-tiptap-extension-bold-DZbX5Qiw.js → vendor-tiptap-extension-bold-DsNXR7l5.js} +1 -1
- package/dist/{vendor-tiptap-extension-code-BcakHaXe.js → vendor-tiptap-extension-code-BXPfZcyf.js} +1 -1
- package/dist/vendor-tiptap-extension-code-block-DYMOFxJc.js +197 -0
- package/dist/{vendor-tiptap-extension-document-BBhadLNS.js → vendor-tiptap-extension-document-Y-jQl_8Q.js} +1 -1
- package/dist/{vendor-tiptap-extension-hard-break-eyl10A9U.js → vendor-tiptap-extension-hard-break-DfxtqTYW.js} +1 -1
- package/dist/{vendor-tiptap-extension-heading-BmX_Abvh.js → vendor-tiptap-extension-heading-BqN9fEEm.js} +1 -1
- package/dist/{vendor-tiptap-extension-horizontal-rule-DyYIWV6W.js → vendor-tiptap-extension-horizontal-rule-Dl1wmLAo.js} +16 -16
- package/dist/{vendor-tiptap-extension-image-C06iDyEi.js → vendor-tiptap-extension-image-Cv28QlbA.js} +1 -1
- package/dist/{vendor-tiptap-extension-italic-B2YDHBEe.js → vendor-tiptap-extension-italic-B3WETSCz.js} +1 -1
- package/dist/{vendor-tiptap-extension-link-Bw8_3Rr4.js → vendor-tiptap-extension-link-CTWD6W1U.js} +1 -1
- package/dist/{vendor-tiptap-extension-list-qHzpj6eq.js → vendor-tiptap-extension-list-Da9Xfgwa.js} +1 -1
- package/dist/{vendor-tiptap-extension-paragraph-BnCRfXCL.js → vendor-tiptap-extension-paragraph-CSda9k3a.js} +1 -1
- package/dist/vendor-tiptap-extension-placeholder-MI_ltlp7.js +1 -0
- package/dist/{vendor-tiptap-extension-strike-Naksm43m.js → vendor-tiptap-extension-strike-Di5VtsLj.js} +1 -1
- package/dist/{vendor-tiptap-extension-table-Cguez3tu.js → vendor-tiptap-extension-table-DYCEjlpp.js} +94 -85
- package/dist/vendor-tiptap-extension-table-cell-D5DL87Xa.js +1 -0
- package/dist/vendor-tiptap-extension-table-header-D5DL87Xa.js +1 -0
- package/dist/vendor-tiptap-extension-table-row-D5DL87Xa.js +1 -0
- package/dist/{vendor-tiptap-extension-text-CixjyWfN.js → vendor-tiptap-extension-text-8vtzSN60.js} +1 -1
- package/dist/{vendor-tiptap-extension-text-style-CVsjuWJ4.js → vendor-tiptap-extension-text-style-BiLsi9B8.js} +35 -30
- package/dist/{vendor-tiptap-extension-underline-Rwkvga0F.js → vendor-tiptap-extension-underline-Bz_pv2E0.js} +1 -1
- package/dist/{vendor-tiptap-extensions-F9A02hii.js → vendor-tiptap-extensions-Crh_nh74.js} +3 -3
- package/dist/{vendor-tiptap-markdown-BSUpswXr.js → vendor-tiptap-markdown-bGlioql8.js} +1 -1
- package/dist/vendor-tiptap-pm-Ug0Z93EG.js +1 -0
- package/dist/{vendor-tiptap-starter-kit-BUgq7S1_.js → vendor-tiptap-starter-kit-B3fY431M.js} +17 -17
- package/dist/{vendor-tiptap-vue-3-UHrHfZLG.js → vendor-tiptap-vue-3-CqWn44-V.js} +22 -22
- package/dist/{vendor-vue3-application-insights-CE6eo4vj.js → vendor-vue3-application-insights-BKiiWnf2.js} +2 -2
- package/dist/{vendor-vueuse-components-B0zqjNRW.js → vendor-vueuse-components-sgKpNzof.js} +1 -1
- package/dist/{vendor-vueuse-core-CYgwn-B2.js → vendor-vueuse-core-D0cN7FqY.js} +10 -10
- package/dist/{vendor-vueuse-shared-B_uDJJ6V.js → vendor-vueuse-shared-Pt0UEStA.js} +19 -19
- package/package.json +4 -4
- package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +2 -2
- package/shared/components/sign-in/useExternalProvider.ts +11 -1
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +11 -3
- package/ui/components/organisms/vc-app/vc-app.vue +2 -2
- package/dist/vendor-microsoft-applicationinsights-analytics-js-BNSkz9ia.js +0 -1105
- package/dist/vendor-microsoft-applicationinsights-core-js-CX4NA2hM.js +0 -4127
- package/dist/vendor-tiptap-extension-code-block-B0U7g1XA.js +0 -192
- package/dist/vendor-tiptap-extension-placeholder-BVZ1jBA2.js +0 -1
- package/dist/vendor-tiptap-extension-table-cell-lniviH1T.js +0 -1
- package/dist/vendor-tiptap-extension-table-header-lniviH1T.js +0 -1
- package/dist/vendor-tiptap-extension-table-row-lniviH1T.js +0 -1
- package/dist/vendor-tiptap-pm-BUxx7nt1.js +0 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { N as D, S as
|
|
2
|
-
import { S as se, D as
|
|
3
|
-
import { d as
|
|
1
|
+
import { N as D, S as be, T as x, A as Nn } from "./vendor-prosemirror-state-DUZYoLys.js";
|
|
2
|
+
import { S as se, D as Ve, F as j, d as $t, M as Sn } from "./vendor-prosemirror-model-CiCy9gkA.js";
|
|
3
|
+
import { d as Cn } from "./vendor-prosemirror-transform-BOkRqJ32.js";
|
|
4
4
|
const C = function(t) {
|
|
5
5
|
for (var e = 0; ; e++)
|
|
6
6
|
if (t = t.previousSibling, !t)
|
|
7
7
|
return e;
|
|
8
|
-
},
|
|
8
|
+
}, he = function(t) {
|
|
9
9
|
let e = t.assignedSlot || t.parentNode;
|
|
10
10
|
return e && e.nodeType == 11 ? e.host : e;
|
|
11
11
|
};
|
|
12
|
-
let
|
|
13
|
-
const
|
|
14
|
-
let o =
|
|
12
|
+
let Ke = null;
|
|
13
|
+
const H = function(t, e, n) {
|
|
14
|
+
let o = Ke || (Ke = document.createRange());
|
|
15
15
|
return o.setEnd(t, n ?? t.nodeValue.length), o.setStart(t, e || 0), o;
|
|
16
|
-
},
|
|
17
|
-
|
|
16
|
+
}, On = function() {
|
|
17
|
+
Ke = null;
|
|
18
18
|
}, re = function(t, e, n, o) {
|
|
19
|
-
return n && (
|
|
20
|
-
},
|
|
21
|
-
function
|
|
19
|
+
return n && (st(t, e, n, o, -1) || st(t, e, n, o, 1));
|
|
20
|
+
}, Mn = /^(img|br|input|textarea|hr)$/i;
|
|
21
|
+
function st(t, e, n, o, i) {
|
|
22
22
|
for (var s; ; ) {
|
|
23
23
|
if (t == n && e == o)
|
|
24
24
|
return !0;
|
|
25
25
|
if (e == (i < 0 ? 0 : B(t))) {
|
|
26
26
|
let r = t.parentNode;
|
|
27
|
-
if (!r || r.nodeType != 1 || Ce(t) ||
|
|
27
|
+
if (!r || r.nodeType != 1 || Ce(t) || Mn.test(t.nodeName) || t.contentEditable == "false")
|
|
28
28
|
return !1;
|
|
29
29
|
e = C(t) + (i < 0 ? 0 : 1), t = r;
|
|
30
30
|
} else if (t.nodeType == 1) {
|
|
@@ -43,7 +43,7 @@ function rt(t, e, n, o, i) {
|
|
|
43
43
|
function B(t) {
|
|
44
44
|
return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function xn(t, e) {
|
|
47
47
|
for (; ; ) {
|
|
48
48
|
if (t.nodeType == 3 && e)
|
|
49
49
|
return t;
|
|
@@ -57,7 +57,7 @@ function kn(t, e) {
|
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function kn(t, e) {
|
|
61
61
|
for (; ; ) {
|
|
62
62
|
if (t.nodeType == 3 && e < t.nodeValue.length)
|
|
63
63
|
return t;
|
|
@@ -71,7 +71,7 @@ function Tn(t, e) {
|
|
|
71
71
|
return null;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Tn(t, e, n) {
|
|
75
75
|
for (let o = e == 0, i = e == B(t); o || i; ) {
|
|
76
76
|
if (t == n)
|
|
77
77
|
return !0;
|
|
@@ -87,20 +87,20 @@ function Ce(t) {
|
|
|
87
87
|
;
|
|
88
88
|
return e && e.node && e.node.isBlock && (e.dom == t || e.contentDOM == t);
|
|
89
89
|
}
|
|
90
|
-
const
|
|
90
|
+
const Re = function(t) {
|
|
91
91
|
return t.focusNode && re(t.focusNode, t.focusOffset, t.anchorNode, t.anchorOffset);
|
|
92
92
|
};
|
|
93
93
|
function ee(t, e) {
|
|
94
94
|
let n = document.createEvent("Event");
|
|
95
95
|
return n.initEvent("keydown", !0, !0), n.keyCode = t, n.key = n.code = e, n;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function An(t) {
|
|
98
98
|
let e = t.activeElement;
|
|
99
99
|
for (; e && e.shadowRoot; )
|
|
100
100
|
e = e.shadowRoot.activeElement;
|
|
101
101
|
return e;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function En(t, e, n) {
|
|
104
104
|
if (t.caretPositionFromPoint)
|
|
105
105
|
try {
|
|
106
106
|
let o = t.caretPositionFromPoint(e, n);
|
|
@@ -114,10 +114,10 @@ function Pn(t, e, n) {
|
|
|
114
114
|
return { node: o.startContainer, offset: Math.min(B(o.startContainer), o.startOffset) };
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
const
|
|
117
|
+
const $ = typeof navigator < "u" ? navigator : null, rt = typeof document < "u" ? document : null, w = $ && $.userAgent || "", He = /Edge\/(\d+)/.exec(w), qt = /MSIE \d/.exec(w), We = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(w), P = !!(qt || We || He), J = qt ? document.documentMode : We ? +We[1] : He ? +He[1] : 0, I = !P && /gecko\/(\d+)/i.test(w);
|
|
118
118
|
I && +(/Firefox\/(\d+)/.exec(w) || [0, 0])[1];
|
|
119
|
-
const
|
|
120
|
-
function
|
|
119
|
+
const _e = !P && /Chrome\/(\d+)/.exec(w), M = !!_e, Kt = _e ? +_e[1] : 0, k = !P && !!$ && /Apple Computer/.test($.vendor), ue = k && (/Mobile\/\w+/.test(w) || !!$ && $.maxTouchPoints > 2), R = ue || ($ ? /Mac/.test($.platform) : !1), Pn = $ ? /Win/.test($.platform) : !1, W = /Android \d/.test(w), Oe = !!rt && "webkitFontSmoothing" in rt.documentElement.style, Vn = Oe ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
120
|
+
function Rn(t) {
|
|
121
121
|
let e = t.defaultView && t.defaultView.visualViewport;
|
|
122
122
|
return e ? {
|
|
123
123
|
left: 0,
|
|
@@ -131,10 +131,10 @@ function Bn(t) {
|
|
|
131
131
|
bottom: t.documentElement.clientHeight
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function K(t, e) {
|
|
135
135
|
return typeof t == "number" ? t : t[e];
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function Bn(t) {
|
|
138
138
|
let e = t.getBoundingClientRect(), n = e.width / t.offsetWidth || 1, o = e.height / t.offsetHeight || 1;
|
|
139
139
|
return {
|
|
140
140
|
left: e.left,
|
|
@@ -143,15 +143,15 @@ function In(t) {
|
|
|
143
143
|
bottom: e.top + t.clientHeight * o
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function lt(t, e, n) {
|
|
147
147
|
let o = t.someProp("scrollThreshold") || 0, i = t.someProp("scrollMargin") || 5, s = t.dom.ownerDocument;
|
|
148
148
|
for (let r = n || t.dom; r; ) {
|
|
149
149
|
if (r.nodeType != 1) {
|
|
150
|
-
r =
|
|
150
|
+
r = he(r);
|
|
151
151
|
continue;
|
|
152
152
|
}
|
|
153
|
-
let l = r, a = l == s.body, c = a ?
|
|
154
|
-
if (e.top < c.top +
|
|
153
|
+
let l = r, a = l == s.body, c = a ? Rn(s) : Bn(l), d = 0, f = 0;
|
|
154
|
+
if (e.top < c.top + K(o, "top") ? f = -(c.top - e.top + K(i, "top")) : e.bottom > c.bottom - K(o, "bottom") && (f = e.bottom - e.top > c.bottom - c.top ? e.top + K(i, "top") - c.top : e.bottom - c.bottom + K(i, "bottom")), e.left < c.left + K(o, "left") ? d = -(c.left - e.left + K(i, "left")) : e.right > c.right - K(o, "right") && (d = e.right - c.right + K(i, "right")), d || f)
|
|
155
155
|
if (a)
|
|
156
156
|
s.defaultView.scrollBy(d, f);
|
|
157
157
|
else {
|
|
@@ -163,10 +163,10 @@ function at(t, e, n) {
|
|
|
163
163
|
let u = a ? "fixed" : getComputedStyle(r).position;
|
|
164
164
|
if (/^(fixed|sticky)$/.test(u))
|
|
165
165
|
break;
|
|
166
|
-
r = u == "absolute" ? r.offsetParent :
|
|
166
|
+
r = u == "absolute" ? r.offsetParent : he(r);
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function In(t) {
|
|
170
170
|
let e = t.dom.getBoundingClientRect(), n = Math.max(0, e.top), o, i;
|
|
171
171
|
for (let s = (e.left + e.right) / 2, r = n + 1; r < Math.min(innerHeight, e.bottom); r += 5) {
|
|
172
172
|
let l = t.root.elementFromPoint(s, r);
|
|
@@ -178,45 +178,45 @@ function Fn(t) {
|
|
|
178
178
|
break;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
return { refDOM: o, refTop: i, stack:
|
|
181
|
+
return { refDOM: o, refTop: i, stack: Ht(t.dom) };
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function Ht(t) {
|
|
184
184
|
let e = [], n = t.ownerDocument;
|
|
185
|
-
for (let o = t; o && (e.push({ dom: o, top: o.scrollTop, left: o.scrollLeft }), t != n); o =
|
|
185
|
+
for (let o = t; o && (e.push({ dom: o, top: o.scrollTop, left: o.scrollLeft }), t != n); o = he(o))
|
|
186
186
|
;
|
|
187
187
|
return e;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function Fn({ refDOM: t, refTop: e, stack: n }) {
|
|
190
190
|
let o = t ? t.getBoundingClientRect().top : 0;
|
|
191
|
-
|
|
191
|
+
Wt(n, o == 0 ? 0 : o - e);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function Wt(t, e) {
|
|
194
194
|
for (let n = 0; n < t.length; n++) {
|
|
195
195
|
let { dom: o, top: i, left: s } = t[n];
|
|
196
196
|
o.scrollTop != i + e && (o.scrollTop = i + e), o.scrollLeft != s && (o.scrollLeft = s);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
let ae = null;
|
|
200
|
-
function
|
|
200
|
+
function zn(t) {
|
|
201
201
|
if (t.setActive)
|
|
202
202
|
return t.setActive();
|
|
203
203
|
if (ae)
|
|
204
204
|
return t.focus(ae);
|
|
205
|
-
let e =
|
|
205
|
+
let e = Ht(t);
|
|
206
206
|
t.focus(ae == null ? {
|
|
207
207
|
get preventScroll() {
|
|
208
208
|
return ae = { preventScroll: !0 }, !0;
|
|
209
209
|
}
|
|
210
|
-
} : void 0), ae || (ae = !1,
|
|
210
|
+
} : void 0), ae || (ae = !1, Wt(e, 0));
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function _t(t, e) {
|
|
213
213
|
let n, o = 2e8, i, s = 0, r = e.top, l = e.top, a, c;
|
|
214
214
|
for (let d = t.firstChild, f = 0; d; d = d.nextSibling, f++) {
|
|
215
215
|
let u;
|
|
216
216
|
if (d.nodeType == 1)
|
|
217
217
|
u = d.getClientRects();
|
|
218
218
|
else if (d.nodeType == 3)
|
|
219
|
-
u =
|
|
219
|
+
u = H(d).getClientRects();
|
|
220
220
|
else
|
|
221
221
|
continue;
|
|
222
222
|
for (let p = 0; p < u.length; p++) {
|
|
@@ -235,34 +235,34 @@ function jt(t, e) {
|
|
|
235
235
|
!n && (e.left >= h.right && e.top >= h.top || e.left >= h.left && e.top >= h.bottom) && (s = f + 1);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
return !n && a && (n = a, i = c, o = 0), n && n.nodeType == 3 ?
|
|
238
|
+
return !n && a && (n = a, i = c, o = 0), n && n.nodeType == 3 ? Ln(n, i) : !n || o && n.nodeType == 1 ? { node: t, offset: s } : _t(n, i);
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function Ln(t, e) {
|
|
241
241
|
let n = t.nodeValue.length, o = document.createRange();
|
|
242
242
|
for (let i = 0; i < n; i++) {
|
|
243
243
|
o.setEnd(t, i + 1), o.setStart(t, i);
|
|
244
244
|
let s = U(o, 1);
|
|
245
|
-
if (s.top != s.bottom &&
|
|
245
|
+
if (s.top != s.bottom && Ze(e, s))
|
|
246
246
|
return { node: t, offset: i + (e.left >= (s.left + s.right) / 2 ? 1 : 0) };
|
|
247
247
|
}
|
|
248
248
|
return { node: t, offset: 0 };
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Ze(t, e) {
|
|
251
251
|
return t.left >= e.left - 1 && t.left <= e.right + 1 && t.top >= e.top - 1 && t.top <= e.bottom + 1;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function $n(t, e) {
|
|
254
254
|
let n = t.parentNode;
|
|
255
255
|
return n && /^li$/i.test(n.nodeName) && e.left < t.getBoundingClientRect().left ? n : t;
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
let { node: o, offset: i } =
|
|
257
|
+
function qn(t, e, n) {
|
|
258
|
+
let { node: o, offset: i } = _t(e, n), s = -1;
|
|
259
259
|
if (o.nodeType == 1 && !o.firstChild) {
|
|
260
260
|
let r = o.getBoundingClientRect();
|
|
261
261
|
s = r.left != r.right && n.left > (r.left + r.right) / 2 ? 1 : -1;
|
|
262
262
|
}
|
|
263
263
|
return t.docView.posFromDOM(o, i, s);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function Kn(t, e, n, o) {
|
|
266
266
|
let i = -1;
|
|
267
267
|
for (let s = e, r = !1; s != t.dom; ) {
|
|
268
268
|
let l = t.docView.nearestDesc(s, !0), a;
|
|
@@ -275,7 +275,7 @@ function Hn(t, e, n, o) {
|
|
|
275
275
|
}
|
|
276
276
|
return i > -1 ? i : t.docView.posFromDOM(e, n, -1);
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function jt(t, e, n) {
|
|
279
279
|
let o = t.childNodes.length;
|
|
280
280
|
if (o && n.top < n.bottom)
|
|
281
281
|
for (let i = Math.max(0, Math.min(o - 1, Math.floor(o * (e.top - n.top) / (n.bottom - n.top)) - 2)), s = i; ; ) {
|
|
@@ -284,8 +284,8 @@ function Ut(t, e, n) {
|
|
|
284
284
|
let l = r.getClientRects();
|
|
285
285
|
for (let a = 0; a < l.length; a++) {
|
|
286
286
|
let c = l[a];
|
|
287
|
-
if (
|
|
288
|
-
return
|
|
287
|
+
if (Ze(e, c))
|
|
288
|
+
return jt(r, e, c);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
if ((s = (s + 1) % o) == i)
|
|
@@ -293,102 +293,102 @@ function Ut(t, e, n) {
|
|
|
293
293
|
}
|
|
294
294
|
return t;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
297
|
-
let n = t.dom.ownerDocument, o, i = 0, s =
|
|
296
|
+
function Hn(t, e) {
|
|
297
|
+
let n = t.dom.ownerDocument, o, i = 0, s = En(n, e.left, e.top);
|
|
298
298
|
s && ({ node: o, offset: i } = s);
|
|
299
299
|
let r = (t.root.elementFromPoint ? t.root : n).elementFromPoint(e.left, e.top), l;
|
|
300
300
|
if (!r || !t.dom.contains(r.nodeType != 1 ? r.parentNode : r)) {
|
|
301
301
|
let c = t.dom.getBoundingClientRect();
|
|
302
|
-
if (!
|
|
302
|
+
if (!Ze(e, c) || (r = jt(t.dom, e, c), !r))
|
|
303
303
|
return null;
|
|
304
304
|
}
|
|
305
305
|
if (k)
|
|
306
|
-
for (let c = r; o && c; c =
|
|
306
|
+
for (let c = r; o && c; c = he(c))
|
|
307
307
|
c.draggable && (o = void 0);
|
|
308
|
-
if (r =
|
|
308
|
+
if (r = $n(r, e), o) {
|
|
309
309
|
if (I && o.nodeType == 1 && (i = Math.min(i, o.childNodes.length), i < o.childNodes.length)) {
|
|
310
310
|
let d = o.childNodes[i], f;
|
|
311
311
|
d.nodeName == "IMG" && (f = d.getBoundingClientRect()).right <= e.left && f.bottom > e.top && i++;
|
|
312
312
|
}
|
|
313
313
|
let c;
|
|
314
|
-
Oe && i && o.nodeType == 1 && (c = o.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, o == t.dom && i == o.childNodes.length - 1 && o.lastChild.nodeType == 1 && e.top > o.lastChild.getBoundingClientRect().bottom ? l = t.state.doc.content.size : (i == 0 || o.nodeType != 1 || o.childNodes[i - 1].nodeName != "BR") && (l =
|
|
314
|
+
Oe && i && o.nodeType == 1 && (c = o.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, o == t.dom && i == o.childNodes.length - 1 && o.lastChild.nodeType == 1 && e.top > o.lastChild.getBoundingClientRect().bottom ? l = t.state.doc.content.size : (i == 0 || o.nodeType != 1 || o.childNodes[i - 1].nodeName != "BR") && (l = Kn(t, o, i, e));
|
|
315
315
|
}
|
|
316
|
-
l == null && (l =
|
|
316
|
+
l == null && (l = qn(t, r, e));
|
|
317
317
|
let a = t.docView.nearestDesc(r, !0);
|
|
318
318
|
return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function at(t) {
|
|
321
321
|
return t.top < t.bottom || t.left < t.right;
|
|
322
322
|
}
|
|
323
323
|
function U(t, e) {
|
|
324
324
|
let n = t.getClientRects();
|
|
325
325
|
if (n.length) {
|
|
326
326
|
let o = n[e < 0 ? 0 : n.length - 1];
|
|
327
|
-
if (
|
|
327
|
+
if (at(o))
|
|
328
328
|
return o;
|
|
329
329
|
}
|
|
330
|
-
return Array.prototype.find.call(n,
|
|
330
|
+
return Array.prototype.find.call(n, at) || t.getBoundingClientRect();
|
|
331
331
|
}
|
|
332
|
-
const
|
|
333
|
-
function
|
|
332
|
+
const Wn = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
|
|
333
|
+
function Ut(t, e, n) {
|
|
334
334
|
let { node: o, offset: i, atom: s } = t.docView.domFromPos(e, n < 0 ? -1 : 1), r = Oe || I;
|
|
335
335
|
if (o.nodeType == 3)
|
|
336
|
-
if (r && (
|
|
337
|
-
let a = U(
|
|
336
|
+
if (r && (Wn.test(o.nodeValue) || (n < 0 ? !i : i == o.nodeValue.length))) {
|
|
337
|
+
let a = U(H(o, i, i), n);
|
|
338
338
|
if (I && i && /\s/.test(o.nodeValue[i - 1]) && i < o.nodeValue.length) {
|
|
339
|
-
let c = U(
|
|
339
|
+
let c = U(H(o, i - 1, i - 1), -1);
|
|
340
340
|
if (c.top == a.top) {
|
|
341
|
-
let d = U(
|
|
341
|
+
let d = U(H(o, i, i + 1), -1);
|
|
342
342
|
if (d.top != a.top)
|
|
343
|
-
return
|
|
343
|
+
return me(d, d.left < c.left);
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
return a;
|
|
347
347
|
} else {
|
|
348
348
|
let a = i, c = i, d = n < 0 ? 1 : -1;
|
|
349
|
-
return n < 0 && !i ? (c++, d = -1) : n >= 0 && i == o.nodeValue.length ? (a--, d = 1) : n < 0 ? a-- : c++,
|
|
349
|
+
return n < 0 && !i ? (c++, d = -1) : n >= 0 && i == o.nodeValue.length ? (a--, d = 1) : n < 0 ? a-- : c++, me(U(H(o, a, c), d), d < 0);
|
|
350
350
|
}
|
|
351
351
|
if (!t.state.doc.resolve(e - (s || 0)).parent.inlineContent) {
|
|
352
352
|
if (s == null && i && (n < 0 || i == B(o))) {
|
|
353
353
|
let a = o.childNodes[i - 1];
|
|
354
354
|
if (a.nodeType == 1)
|
|
355
|
-
return
|
|
355
|
+
return Fe(a.getBoundingClientRect(), !1);
|
|
356
356
|
}
|
|
357
357
|
if (s == null && i < B(o)) {
|
|
358
358
|
let a = o.childNodes[i];
|
|
359
359
|
if (a.nodeType == 1)
|
|
360
|
-
return
|
|
360
|
+
return Fe(a.getBoundingClientRect(), !0);
|
|
361
361
|
}
|
|
362
|
-
return
|
|
362
|
+
return Fe(o.getBoundingClientRect(), n >= 0);
|
|
363
363
|
}
|
|
364
364
|
if (s == null && i && (n < 0 || i == B(o))) {
|
|
365
|
-
let a = o.childNodes[i - 1], c = a.nodeType == 3 ?
|
|
365
|
+
let a = o.childNodes[i - 1], c = a.nodeType == 3 ? H(a, B(a) - (r ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
|
|
366
366
|
if (c)
|
|
367
|
-
return
|
|
367
|
+
return me(U(c, 1), !1);
|
|
368
368
|
}
|
|
369
369
|
if (s == null && i < B(o)) {
|
|
370
370
|
let a = o.childNodes[i];
|
|
371
371
|
for (; a.pmViewDesc && a.pmViewDesc.ignoreForCoords; )
|
|
372
372
|
a = a.nextSibling;
|
|
373
|
-
let c = a ? a.nodeType == 3 ?
|
|
373
|
+
let c = a ? a.nodeType == 3 ? H(a, 0, r ? 0 : 1) : a.nodeType == 1 ? a : null : null;
|
|
374
374
|
if (c)
|
|
375
|
-
return
|
|
375
|
+
return me(U(c, -1), !0);
|
|
376
376
|
}
|
|
377
|
-
return
|
|
377
|
+
return me(U(o.nodeType == 3 ? H(o) : o, -n), n >= 0);
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function me(t, e) {
|
|
380
380
|
if (t.width == 0)
|
|
381
381
|
return t;
|
|
382
382
|
let n = e ? t.left : t.right;
|
|
383
383
|
return { top: t.top, bottom: t.bottom, left: n, right: n };
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function Fe(t, e) {
|
|
386
386
|
if (t.height == 0)
|
|
387
387
|
return t;
|
|
388
388
|
let n = e ? t.top : t.bottom;
|
|
389
389
|
return { top: n, bottom: n, left: t.left, right: t.right };
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function Yt(t, e, n) {
|
|
392
392
|
let o = t.state, i = t.root.activeElement;
|
|
393
393
|
o != e && t.updateState(e), i != t.dom && t.focus();
|
|
394
394
|
try {
|
|
@@ -397,9 +397,9 @@ function Gt(t, e, n) {
|
|
|
397
397
|
o != e && t.updateState(o), i != t.dom && i && i.focus();
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function _n(t, e, n) {
|
|
401
401
|
let o = e.selection, i = n == "up" ? o.$from : o.$to;
|
|
402
|
-
return
|
|
402
|
+
return Yt(t, e, () => {
|
|
403
403
|
let { node: s } = t.docView.domFromPos(i.pos, n == "up" ? -1 : 1);
|
|
404
404
|
for (; ; ) {
|
|
405
405
|
let l = t.docView.nearestDesc(s, !0);
|
|
@@ -411,13 +411,13 @@ function jn(t, e, n) {
|
|
|
411
411
|
}
|
|
412
412
|
s = l.dom.parentNode;
|
|
413
413
|
}
|
|
414
|
-
let r =
|
|
414
|
+
let r = Ut(t, i.pos, 1);
|
|
415
415
|
for (let l = s.firstChild; l; l = l.nextSibling) {
|
|
416
416
|
let a;
|
|
417
417
|
if (l.nodeType == 1)
|
|
418
418
|
a = l.getClientRects();
|
|
419
419
|
else if (l.nodeType == 3)
|
|
420
|
-
a =
|
|
420
|
+
a = H(l, 0, l.nodeValue.length).getClientRects();
|
|
421
421
|
else
|
|
422
422
|
continue;
|
|
423
423
|
for (let c = 0; c < a.length; c++) {
|
|
@@ -429,13 +429,13 @@ function jn(t, e, n) {
|
|
|
429
429
|
return !0;
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
|
-
const
|
|
433
|
-
function
|
|
432
|
+
const jn = /[\u0590-\u08ac]/;
|
|
433
|
+
function Un(t, e, n) {
|
|
434
434
|
let { $head: o } = e.selection;
|
|
435
435
|
if (!o.parent.isTextblock)
|
|
436
436
|
return !1;
|
|
437
437
|
let i = o.parentOffset, s = !i, r = i == o.parent.content.size, l = t.domSelection();
|
|
438
|
-
return l ? !
|
|
438
|
+
return l ? !jn.test(o.parent.textContent) || !l.modify ? n == "left" || n == "backward" ? s : r : Yt(t, e, () => {
|
|
439
439
|
let { focusNode: a, focusOffset: c, anchorNode: d, anchorOffset: f } = t.domSelectionRange(), u = l.caretBidiLevel;
|
|
440
440
|
l.modify("move", n, "character");
|
|
441
441
|
let p = o.depth ? t.docView.domAfterPos(o.before()) : t.dom, { focusNode: h, focusOffset: g } = t.domSelectionRange(), m = h && !p.contains(h.nodeType == 1 ? h : h.parentNode) || a == h && c == g;
|
|
@@ -446,11 +446,11 @@ function Yn(t, e, n) {
|
|
|
446
446
|
return u != null && (l.caretBidiLevel = u), m;
|
|
447
447
|
}) : o.pos == o.start() || o.pos == o.end();
|
|
448
448
|
}
|
|
449
|
-
let
|
|
450
|
-
function
|
|
451
|
-
return
|
|
449
|
+
let ct = null, dt = null, ft = !1;
|
|
450
|
+
function Yn(t, e, n) {
|
|
451
|
+
return ct == e && dt == n ? ft : (ct = e, dt = n, ft = n == "up" || n == "down" ? _n(t, e, n) : Un(t, e, n));
|
|
452
452
|
}
|
|
453
|
-
const F = 0,
|
|
453
|
+
const F = 0, ht = 1, te = 2, q = 3;
|
|
454
454
|
class Me {
|
|
455
455
|
constructor(e, n, o, i) {
|
|
456
456
|
this.parent = e, this.children = n, this.dom = o, this.contentDOM = i, this.dirty = F, o.pmViewDesc = this;
|
|
@@ -622,7 +622,7 @@ class Me {
|
|
|
622
622
|
let o = 0, i = 0;
|
|
623
623
|
for (let s = 0; o < this.children.length; o++) {
|
|
624
624
|
let r = this.children[o], l = s + r.size;
|
|
625
|
-
if (l > e || r instanceof
|
|
625
|
+
if (l > e || r instanceof Xt) {
|
|
626
626
|
i = e - s;
|
|
627
627
|
break;
|
|
628
628
|
}
|
|
@@ -630,7 +630,7 @@ class Me {
|
|
|
630
630
|
}
|
|
631
631
|
if (i)
|
|
632
632
|
return this.children[o].domFromPos(i - this.children[o].border, n);
|
|
633
|
-
for (let s; o && !(s = this.children[o - 1]).size && s instanceof
|
|
633
|
+
for (let s; o && !(s = this.children[o - 1]).size && s instanceof Gt && s.side >= 0; o--)
|
|
634
634
|
;
|
|
635
635
|
if (n <= 0) {
|
|
636
636
|
let s, r = !0;
|
|
@@ -766,10 +766,10 @@ class Me {
|
|
|
766
766
|
if (o == r ? e <= r && n >= o : e < r && n > o) {
|
|
767
767
|
let l = o + s.border, a = r - s.border;
|
|
768
768
|
if (e >= l && n <= a) {
|
|
769
|
-
this.dirty = e == o || n == r ? te :
|
|
769
|
+
this.dirty = e == o || n == r ? te : ht, e == l && n == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = q : s.markDirty(e - l, n - l);
|
|
770
770
|
return;
|
|
771
771
|
} else
|
|
772
|
-
s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? te :
|
|
772
|
+
s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? te : q;
|
|
773
773
|
}
|
|
774
774
|
o = r;
|
|
775
775
|
}
|
|
@@ -778,7 +778,7 @@ class Me {
|
|
|
778
778
|
markParentsDirty() {
|
|
779
779
|
let e = 1;
|
|
780
780
|
for (let n = this.parent; n; n = n.parent, e++) {
|
|
781
|
-
let o = e == 1 ? te :
|
|
781
|
+
let o = e == 1 ? te : ht;
|
|
782
782
|
n.dirty < o && (n.dirty = o);
|
|
783
783
|
}
|
|
784
784
|
}
|
|
@@ -795,7 +795,7 @@ class Me {
|
|
|
795
795
|
return !1;
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
|
-
class
|
|
798
|
+
class Gt extends Me {
|
|
799
799
|
constructor(e, n, o, i) {
|
|
800
800
|
let s, r = n.type.toDOM;
|
|
801
801
|
if (typeof r == "function" && (r = r(o, () => {
|
|
@@ -838,7 +838,7 @@ class Xt extends Me {
|
|
|
838
838
|
return this.widget.type.side;
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
|
-
class
|
|
841
|
+
class Gn extends Me {
|
|
842
842
|
constructor(e, n, o, i) {
|
|
843
843
|
super(e, [], n, null), this.textDOM = o, this.text = i;
|
|
844
844
|
}
|
|
@@ -861,13 +861,13 @@ class le extends Me {
|
|
|
861
861
|
}
|
|
862
862
|
static create(e, n, o, i) {
|
|
863
863
|
let s = i.nodeViews[n.type.name], r = s && s(n, i, o);
|
|
864
|
-
return (!r || !r.dom) && (r =
|
|
864
|
+
return (!r || !r.dom) && (r = Ve.renderSpec(document, n.type.spec.toDOM(n, o), null, n.attrs)), new le(e, n, r.dom, r.contentDOM || r.dom, r);
|
|
865
865
|
}
|
|
866
866
|
parseRule() {
|
|
867
|
-
return this.dirty &
|
|
867
|
+
return this.dirty & q || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
|
|
868
868
|
}
|
|
869
869
|
matchesMark(e) {
|
|
870
|
-
return this.dirty !=
|
|
870
|
+
return this.dirty != q && this.mark.eq(e);
|
|
871
871
|
}
|
|
872
872
|
markDirty(e, n) {
|
|
873
873
|
if (super.markDirty(e, n), this.dirty != F) {
|
|
@@ -879,7 +879,7 @@ class le extends Me {
|
|
|
879
879
|
}
|
|
880
880
|
slice(e, n, o) {
|
|
881
881
|
let i = le.create(this.parent, this.mark, !0, o), s = this.children, r = this.size;
|
|
882
|
-
n < r && (s =
|
|
882
|
+
n < r && (s = Ue(s, n, r, o)), e > 0 && (s = Ue(s, 0, e, o));
|
|
883
883
|
for (let l = 0; l < s.length; l++)
|
|
884
884
|
s[l].parent = i;
|
|
885
885
|
return i.children = s, i;
|
|
@@ -916,10 +916,10 @@ class Z extends Me {
|
|
|
916
916
|
d = document.createTextNode(n.text);
|
|
917
917
|
else if (d.nodeType != 3)
|
|
918
918
|
throw new RangeError("Text must be rendered as a DOM text node");
|
|
919
|
-
} else d || ({ dom: d, contentDOM: f } =
|
|
919
|
+
} else d || ({ dom: d, contentDOM: f } = Ve.renderSpec(document, n.type.spec.toDOM(n), null, n.attrs));
|
|
920
920
|
!f && !n.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), n.type.spec.draggable && (d.draggable = !0));
|
|
921
921
|
let u = d;
|
|
922
|
-
return d =
|
|
922
|
+
return d = Qt(d, o, n), c ? a = new Xn(e, n, o, i, d, f || null, u, c, s, r + 1) : n.isText ? new Be(e, n, o, i, d, u, s) : new Z(e, n, o, i, d, f || null, u, s, r + 1);
|
|
923
923
|
}
|
|
924
924
|
parseRule() {
|
|
925
925
|
if (this.node.type.spec.reparseInView)
|
|
@@ -937,12 +937,12 @@ class Z extends Me {
|
|
|
937
937
|
break;
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
|
-
e.contentElement || (e.getContent = () =>
|
|
940
|
+
e.contentElement || (e.getContent = () => j.empty);
|
|
941
941
|
}
|
|
942
942
|
return e;
|
|
943
943
|
}
|
|
944
944
|
matchesNode(e, n, o) {
|
|
945
|
-
return this.dirty == F && e.eq(this.node) &&
|
|
945
|
+
return this.dirty == F && e.eq(this.node) && ke(n, this.outerDeco) && o.eq(this.innerDeco);
|
|
946
946
|
}
|
|
947
947
|
get size() {
|
|
948
948
|
return this.node.nodeSize;
|
|
@@ -955,14 +955,14 @@ class Z extends Me {
|
|
|
955
955
|
// separate step, syncs the DOM inside `this.contentDOM` to
|
|
956
956
|
// `this.children`.
|
|
957
957
|
updateChildren(e, n) {
|
|
958
|
-
let o = this.node.inlineContent, i = n, s = e.composing ? this.localCompositionInfo(e, n) : null, r = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new
|
|
959
|
-
|
|
960
|
-
c.spec.marks ? a.syncToMarks(c.spec.marks, o, e) : c.type.side >= 0 && !f && a.syncToMarks(d == this.node.childCount ?
|
|
958
|
+
let o = this.node.inlineContent, i = n, s = e.composing ? this.localCompositionInfo(e, n) : null, r = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new Zn(this, r && r.node, e);
|
|
959
|
+
vn(this.node, this.innerDeco, (c, d, f) => {
|
|
960
|
+
c.spec.marks ? a.syncToMarks(c.spec.marks, o, e) : c.type.side >= 0 && !f && a.syncToMarks(d == this.node.childCount ? Sn.none : this.node.child(d).marks, o, e), a.placeWidget(c, e, i);
|
|
961
961
|
}, (c, d, f, u) => {
|
|
962
962
|
a.syncToMarks(c.marks, o, e);
|
|
963
963
|
let p;
|
|
964
964
|
a.findNodeMatch(c, d, f, u) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (p = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, d, f, p, e) || a.updateNextNode(c, d, f, e, u, i) || a.addNode(c, d, f, e, i), i += c.nodeSize;
|
|
965
|
-
}), a.syncToMarks([], o, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == te) && (r && this.protectLocalComposition(e, r),
|
|
965
|
+
}), a.syncToMarks([], o, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == te) && (r && this.protectLocalComposition(e, r), Jt(this.contentDOM, this.children, e), ue && eo(this.dom));
|
|
966
966
|
}
|
|
967
967
|
localCompositionInfo(e, n) {
|
|
968
968
|
let { from: o, to: i } = e.state.selection;
|
|
@@ -972,7 +972,7 @@ class Z extends Me {
|
|
|
972
972
|
if (!s || !this.dom.contains(s.parentNode))
|
|
973
973
|
return null;
|
|
974
974
|
if (this.node.inlineContent) {
|
|
975
|
-
let r = s.nodeValue, l =
|
|
975
|
+
let r = s.nodeValue, l = to(this.node.content, r, o - n, i - n);
|
|
976
976
|
return l < 0 ? null : { node: s, pos: l, text: r };
|
|
977
977
|
} else
|
|
978
978
|
return { node: s, pos: -1, text: "" };
|
|
@@ -988,22 +988,22 @@ class Z extends Me {
|
|
|
988
988
|
s.parentNode.removeChild(s.nextSibling);
|
|
989
989
|
s.pmViewDesc && (s.pmViewDesc = void 0);
|
|
990
990
|
}
|
|
991
|
-
let r = new
|
|
992
|
-
e.input.compositionNodes.push(r), this.children =
|
|
991
|
+
let r = new Gn(this, s, n, i);
|
|
992
|
+
e.input.compositionNodes.push(r), this.children = Ue(this.children, o, o + i.length, e, r);
|
|
993
993
|
}
|
|
994
994
|
// If this desc must be updated to match the given node decoration,
|
|
995
995
|
// do so and return true.
|
|
996
996
|
update(e, n, o, i) {
|
|
997
|
-
return this.dirty ==
|
|
997
|
+
return this.dirty == q || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, n, o, i), !0);
|
|
998
998
|
}
|
|
999
999
|
updateInner(e, n, o, i) {
|
|
1000
1000
|
this.updateOuterDeco(n), this.node = e, this.innerDeco = o, this.contentDOM && this.updateChildren(i, this.posAtStart), this.dirty = F;
|
|
1001
1001
|
}
|
|
1002
1002
|
updateOuterDeco(e) {
|
|
1003
|
-
if (
|
|
1003
|
+
if (ke(e, this.outerDeco))
|
|
1004
1004
|
return;
|
|
1005
1005
|
let n = this.nodeDOM.nodeType != 1, o = this.dom;
|
|
1006
|
-
this.dom =
|
|
1006
|
+
this.dom = Zt(this.dom, this.nodeDOM, je(this.outerDeco, this.node, n), je(e, this.node, n)), this.dom != o && (o.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
|
|
1007
1007
|
}
|
|
1008
1008
|
// Mark this node as being the selected node.
|
|
1009
1009
|
selectNode() {
|
|
@@ -1017,12 +1017,12 @@ class Z extends Me {
|
|
|
1017
1017
|
return this.node.isAtom;
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1021
|
-
|
|
1020
|
+
function ut(t, e, n, o, i) {
|
|
1021
|
+
Qt(o, e, t);
|
|
1022
1022
|
let s = new Z(void 0, t, e, n, o, o, o, i, 0);
|
|
1023
1023
|
return s.contentDOM && s.updateChildren(i, 0), s;
|
|
1024
1024
|
}
|
|
1025
|
-
class
|
|
1025
|
+
class Be extends Z {
|
|
1026
1026
|
constructor(e, n, o, i, s, r, l) {
|
|
1027
1027
|
super(e, n, o, i, s, null, r, l, 0);
|
|
1028
1028
|
}
|
|
@@ -1033,7 +1033,7 @@ class Ie extends Z {
|
|
|
1033
1033
|
return { skip: e || !0 };
|
|
1034
1034
|
}
|
|
1035
1035
|
update(e, n, o, i) {
|
|
1036
|
-
return this.dirty ==
|
|
1036
|
+
return this.dirty == q || this.dirty != F && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(n), (this.dirty != F || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, i.trackWrites == this.nodeDOM && (i.trackWrites = null)), this.node = e, this.dirty = F, !0);
|
|
1037
1037
|
}
|
|
1038
1038
|
inParent() {
|
|
1039
1039
|
let e = this.parent.contentDOM;
|
|
@@ -1053,10 +1053,10 @@ class Ie extends Z {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
slice(e, n, o) {
|
|
1055
1055
|
let i = this.node.cut(e, n), s = document.createTextNode(i.text);
|
|
1056
|
-
return new
|
|
1056
|
+
return new Be(this.parent, i, this.outerDeco, this.innerDeco, s, s, o);
|
|
1057
1057
|
}
|
|
1058
1058
|
markDirty(e, n) {
|
|
1059
|
-
super.markDirty(e, n), this.dom != this.nodeDOM && (e == 0 || n == this.nodeDOM.nodeValue.length) && (this.dirty =
|
|
1059
|
+
super.markDirty(e, n), this.dom != this.nodeDOM && (e == 0 || n == this.nodeDOM.nodeValue.length) && (this.dirty = q);
|
|
1060
1060
|
}
|
|
1061
1061
|
get domAtom() {
|
|
1062
1062
|
return !1;
|
|
@@ -1065,7 +1065,7 @@ class Ie extends Z {
|
|
|
1065
1065
|
return this.node.text == e;
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
|
-
class
|
|
1068
|
+
class Xt extends Me {
|
|
1069
1069
|
parseRule() {
|
|
1070
1070
|
return { ignore: !0 };
|
|
1071
1071
|
}
|
|
@@ -1079,7 +1079,7 @@ class Jt extends Me {
|
|
|
1079
1079
|
return this.dom.nodeName == "IMG";
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
|
-
class
|
|
1082
|
+
class Xn extends Z {
|
|
1083
1083
|
constructor(e, n, o, i, s, r, l, a, c, d) {
|
|
1084
1084
|
super(e, n, o, i, s, r, l, c, d), this.spec = a;
|
|
1085
1085
|
}
|
|
@@ -1087,7 +1087,7 @@ class Jn extends Z {
|
|
|
1087
1087
|
// through. If it does, and there's a `contentDOM` node, our logic
|
|
1088
1088
|
// updates the children.
|
|
1089
1089
|
update(e, n, o, i) {
|
|
1090
|
-
if (this.dirty ==
|
|
1090
|
+
if (this.dirty == q)
|
|
1091
1091
|
return !1;
|
|
1092
1092
|
if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
|
|
1093
1093
|
let s = this.spec.update(e, n, o);
|
|
@@ -1113,47 +1113,47 @@ class Jn extends Z {
|
|
|
1113
1113
|
return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
|
|
1114
1114
|
}
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1116
|
+
function Jt(t, e, n) {
|
|
1117
1117
|
let o = t.firstChild, i = !1;
|
|
1118
1118
|
for (let s = 0; s < e.length; s++) {
|
|
1119
1119
|
let r = e[s], l = r.dom;
|
|
1120
1120
|
if (l.parentNode == t) {
|
|
1121
1121
|
for (; l != o; )
|
|
1122
|
-
o =
|
|
1122
|
+
o = pt(o), i = !0;
|
|
1123
1123
|
o = o.nextSibling;
|
|
1124
1124
|
} else
|
|
1125
1125
|
i = !0, t.insertBefore(l, o);
|
|
1126
1126
|
if (r instanceof le) {
|
|
1127
1127
|
let a = o ? o.previousSibling : t.lastChild;
|
|
1128
|
-
|
|
1128
|
+
Jt(r.contentDOM, r.children, n), o = a ? a.nextSibling : t.firstChild;
|
|
1129
1129
|
}
|
|
1130
1130
|
}
|
|
1131
1131
|
for (; o; )
|
|
1132
|
-
o =
|
|
1132
|
+
o = pt(o), i = !0;
|
|
1133
1133
|
i && n.trackWrites == t && (n.trackWrites = null);
|
|
1134
1134
|
}
|
|
1135
|
-
const
|
|
1135
|
+
const ge = function(t) {
|
|
1136
1136
|
t && (this.nodeName = t);
|
|
1137
1137
|
};
|
|
1138
|
-
|
|
1139
|
-
const ne = [new
|
|
1140
|
-
function
|
|
1138
|
+
ge.prototype = /* @__PURE__ */ Object.create(null);
|
|
1139
|
+
const ne = [new ge()];
|
|
1140
|
+
function je(t, e, n) {
|
|
1141
1141
|
if (t.length == 0)
|
|
1142
1142
|
return ne;
|
|
1143
|
-
let o = n ? ne[0] : new
|
|
1143
|
+
let o = n ? ne[0] : new ge(), i = [o];
|
|
1144
1144
|
for (let s = 0; s < t.length; s++) {
|
|
1145
1145
|
let r = t[s].type.attrs;
|
|
1146
1146
|
if (r) {
|
|
1147
|
-
r.nodeName && i.push(o = new
|
|
1147
|
+
r.nodeName && i.push(o = new ge(r.nodeName));
|
|
1148
1148
|
for (let l in r) {
|
|
1149
1149
|
let a = r[l];
|
|
1150
|
-
a != null && (n && i.length == 1 && i.push(o = new
|
|
1150
|
+
a != null && (n && i.length == 1 && i.push(o = new ge(e.isInline ? "span" : "div")), l == "class" ? o.class = (o.class ? o.class + " " : "") + a : l == "style" ? o.style = (o.style ? o.style + ";" : "") + a : l != "nodeName" && (o[l] = a));
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
1154
|
return i;
|
|
1155
1155
|
}
|
|
1156
|
-
function
|
|
1156
|
+
function Zt(t, e, n, o) {
|
|
1157
1157
|
if (n == ne && o == ne)
|
|
1158
1158
|
return e;
|
|
1159
1159
|
let i = e;
|
|
@@ -1163,11 +1163,11 @@ function Qt(t, e, n, o) {
|
|
|
1163
1163
|
let a;
|
|
1164
1164
|
l && l.nodeName == r.nodeName && i != t && (a = i.parentNode) && a.nodeName.toLowerCase() == r.nodeName || (a = document.createElement(r.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = ne[0]), i = a;
|
|
1165
1165
|
}
|
|
1166
|
-
|
|
1166
|
+
Jn(i, l || ne[0], r);
|
|
1167
1167
|
}
|
|
1168
1168
|
return i;
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function Jn(t, e, n) {
|
|
1171
1171
|
for (let o in e)
|
|
1172
1172
|
o != "class" && o != "style" && o != "nodeName" && !(o in n) && t.removeAttribute(o);
|
|
1173
1173
|
for (let o in n)
|
|
@@ -1189,10 +1189,10 @@ function Zn(t, e, n) {
|
|
|
1189
1189
|
n.style && (t.style.cssText += n.style);
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1193
|
-
return
|
|
1192
|
+
function Qt(t, e, n) {
|
|
1193
|
+
return Zt(t, t, ne, je(e, n, t.nodeType != 1));
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1195
|
+
function ke(t, e) {
|
|
1196
1196
|
if (t.length != e.length)
|
|
1197
1197
|
return !1;
|
|
1198
1198
|
for (let n = 0; n < t.length; n++)
|
|
@@ -1200,13 +1200,13 @@ function Te(t, e) {
|
|
|
1200
1200
|
return !1;
|
|
1201
1201
|
return !0;
|
|
1202
1202
|
}
|
|
1203
|
-
function
|
|
1203
|
+
function pt(t) {
|
|
1204
1204
|
let e = t.nextSibling;
|
|
1205
1205
|
return t.parentNode.removeChild(t), e;
|
|
1206
1206
|
}
|
|
1207
|
-
class
|
|
1207
|
+
class Zn {
|
|
1208
1208
|
constructor(e, n, o) {
|
|
1209
|
-
this.lock = n, this.view = o, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch =
|
|
1209
|
+
this.lock = n, this.view = o, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = Qn(e.node.content, e);
|
|
1210
1210
|
}
|
|
1211
1211
|
// Destroy and remove the children between the given indices in
|
|
1212
1212
|
// `this.top`.
|
|
@@ -1266,7 +1266,7 @@ class Qn {
|
|
|
1266
1266
|
}
|
|
1267
1267
|
updateNodeAt(e, n, o, i, s) {
|
|
1268
1268
|
let r = this.top.children[i];
|
|
1269
|
-
return r.dirty ==
|
|
1269
|
+
return r.dirty == q && r.dom == r.contentDOM && (r.dirty = te), r.update(e, n, o, s) ? (this.destroyBetween(this.index, i), this.index++, !0) : !1;
|
|
1270
1270
|
}
|
|
1271
1271
|
findIndexWithChild(e) {
|
|
1272
1272
|
for (; ; ) {
|
|
@@ -1294,7 +1294,7 @@ class Qn {
|
|
|
1294
1294
|
let c = this.preMatch.matched.get(a);
|
|
1295
1295
|
if (c != null && c != s)
|
|
1296
1296
|
return !1;
|
|
1297
|
-
let d = a.dom, f, u = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty !=
|
|
1297
|
+
let d = a.dom, f, u = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != q && ke(n, a.outerDeco));
|
|
1298
1298
|
if (!u && a.update(e, n, o, i))
|
|
1299
1299
|
return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
|
|
1300
1300
|
if (!u && (f = this.recreateWrapper(a, e, n, o, i, r)))
|
|
@@ -1307,7 +1307,7 @@ class Qn {
|
|
|
1307
1307
|
// When a node with content is replaced by a different node with
|
|
1308
1308
|
// identical content, move over its children.
|
|
1309
1309
|
recreateWrapper(e, n, o, i, s, r) {
|
|
1310
|
-
if (e.dirty || n.isAtom || !e.children.length || !e.node.content.eq(n.content) || !
|
|
1310
|
+
if (e.dirty || n.isAtom || !e.children.length || !e.node.content.eq(n.content) || !ke(o, e.outerDeco) || !i.eq(e.innerDeco))
|
|
1311
1311
|
return null;
|
|
1312
1312
|
let l = Z.create(this.top, n, o, i, s, r);
|
|
1313
1313
|
if (l.contentDOM) {
|
|
@@ -1327,7 +1327,7 @@ class Qn {
|
|
|
1327
1327
|
if (i && i.matchesWidget(e) && (e == i.widget || !i.widget.type.toDOM.parentNode))
|
|
1328
1328
|
this.index++;
|
|
1329
1329
|
else {
|
|
1330
|
-
let s = new
|
|
1330
|
+
let s = new Gt(this.top, e, n, o);
|
|
1331
1331
|
this.top.children.splice(this.index++, 0, s), this.changed = !0;
|
|
1332
1332
|
}
|
|
1333
1333
|
}
|
|
@@ -1338,7 +1338,7 @@ class Qn {
|
|
|
1338
1338
|
for (; e instanceof le; )
|
|
1339
1339
|
n = e, e = n.children[n.children.length - 1];
|
|
1340
1340
|
(!e || // Empty textblock
|
|
1341
|
-
!(e instanceof
|
|
1341
|
+
!(e instanceof Be) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((k || M) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", n), this.addHackNode("BR", this.top));
|
|
1342
1342
|
}
|
|
1343
1343
|
addHackNode(e, n) {
|
|
1344
1344
|
if (n == this.top && this.index < n.children.length && n.children[this.index].matchesHack(e))
|
|
@@ -1346,7 +1346,7 @@ class Qn {
|
|
|
1346
1346
|
else {
|
|
1347
1347
|
let o = document.createElement(e);
|
|
1348
1348
|
e == "IMG" && (o.className = "ProseMirror-separator", o.alt = ""), e == "BR" && (o.className = "ProseMirror-trailingBreak");
|
|
1349
|
-
let i = new
|
|
1349
|
+
let i = new Xt(this.top, [], o, null);
|
|
1350
1350
|
n != this.top ? n.children.push(i) : n.children.splice(this.index++, 0, i), this.changed = !0;
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
@@ -1354,7 +1354,7 @@ class Qn {
|
|
|
1354
1354
|
return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
|
|
1355
1355
|
}
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1357
|
+
function Qn(t, e) {
|
|
1358
1358
|
let n = e, o = n.children.length, i = t.childCount, s = /* @__PURE__ */ new Map(), r = [];
|
|
1359
1359
|
e: for (; i > 0; ) {
|
|
1360
1360
|
let l;
|
|
@@ -1381,10 +1381,10 @@ function wn(t, e) {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
return { index: i, matched: s, matches: r.reverse() };
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function wn(t, e) {
|
|
1385
1385
|
return t.type.side - e.type.side;
|
|
1386
1386
|
}
|
|
1387
|
-
function
|
|
1387
|
+
function vn(t, e, n, o) {
|
|
1388
1388
|
let i = e.locals(t), s = 0;
|
|
1389
1389
|
if (i.length == 0) {
|
|
1390
1390
|
for (let c = 0; c < t.childCount; c++) {
|
|
@@ -1402,7 +1402,7 @@ function eo(t, e, n, o) {
|
|
|
1402
1402
|
}
|
|
1403
1403
|
if (d)
|
|
1404
1404
|
if (f) {
|
|
1405
|
-
f.sort(
|
|
1405
|
+
f.sort(wn);
|
|
1406
1406
|
for (let m = 0; m < f.length; m++)
|
|
1407
1407
|
n(f[m], c, !!a);
|
|
1408
1408
|
} else
|
|
@@ -1432,13 +1432,13 @@ function eo(t, e, n, o) {
|
|
|
1432
1432
|
o(u, g, e.forChild(s, u), p), s = h;
|
|
1433
1433
|
}
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1435
|
+
function eo(t) {
|
|
1436
1436
|
if (t.nodeName == "UL" || t.nodeName == "OL") {
|
|
1437
1437
|
let e = t.style.cssText;
|
|
1438
1438
|
t.style.cssText = e + "; list-style: square !important", window.getComputedStyle(t).listStyle, t.style.cssText = e;
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
|
-
function
|
|
1441
|
+
function to(t, e, n, o) {
|
|
1442
1442
|
for (let i = 0, s = 0; i < t.childCount && s <= o; ) {
|
|
1443
1443
|
let r = t.child(i++), l = s;
|
|
1444
1444
|
if (s += r.nodeSize, !r.isText)
|
|
@@ -1462,7 +1462,7 @@ function no(t, e, n, o) {
|
|
|
1462
1462
|
}
|
|
1463
1463
|
return -1;
|
|
1464
1464
|
}
|
|
1465
|
-
function
|
|
1465
|
+
function Ue(t, e, n, o, i) {
|
|
1466
1466
|
let s = [];
|
|
1467
1467
|
for (let r = 0, l = 0; r < t.length; r++) {
|
|
1468
1468
|
let a = t[r], c = l, d = l += a.size;
|
|
@@ -1470,7 +1470,7 @@ function Ye(t, e, n, o, i) {
|
|
|
1470
1470
|
}
|
|
1471
1471
|
return s;
|
|
1472
1472
|
}
|
|
1473
|
-
function
|
|
1473
|
+
function Qe(t, e = null) {
|
|
1474
1474
|
let n = t.domSelectionRange(), o = t.state.doc;
|
|
1475
1475
|
if (!n.focusNode)
|
|
1476
1476
|
return null;
|
|
@@ -1478,11 +1478,11 @@ function we(t, e = null) {
|
|
|
1478
1478
|
if (r < 0)
|
|
1479
1479
|
return null;
|
|
1480
1480
|
let l = o.resolve(r), a, c;
|
|
1481
|
-
if (
|
|
1481
|
+
if (Re(n)) {
|
|
1482
1482
|
for (a = r; i && !i.node; )
|
|
1483
1483
|
i = i.parent;
|
|
1484
1484
|
let f = i.node;
|
|
1485
|
-
if (i && f.isAtom && D.isSelectable(f) && i.parent && !(f.isInline &&
|
|
1485
|
+
if (i && f.isAtom && D.isSelectable(f) && i.parent && !(f.isInline && Tn(n.focusNode, n.focusOffset, i.dom))) {
|
|
1486
1486
|
let u = i.posBefore;
|
|
1487
1487
|
c = new D(r == u ? l : o.resolve(u));
|
|
1488
1488
|
}
|
|
@@ -1504,16 +1504,16 @@ function we(t, e = null) {
|
|
|
1504
1504
|
let d = o.resolve(a);
|
|
1505
1505
|
if (!c) {
|
|
1506
1506
|
let f = e == "pointer" || t.state.selection.head < l.pos && !s ? 1 : -1;
|
|
1507
|
-
c =
|
|
1507
|
+
c = we(t, d, l, f);
|
|
1508
1508
|
}
|
|
1509
1509
|
return c;
|
|
1510
1510
|
}
|
|
1511
|
-
function
|
|
1512
|
-
return t.editable ? t.hasFocus() :
|
|
1511
|
+
function wt(t) {
|
|
1512
|
+
return t.editable ? t.hasFocus() : en(t) && document.activeElement && document.activeElement.contains(t.dom);
|
|
1513
1513
|
}
|
|
1514
|
-
function
|
|
1514
|
+
function _(t, e = !1) {
|
|
1515
1515
|
let n = t.state.selection;
|
|
1516
|
-
if (
|
|
1516
|
+
if (vt(t, n), !!wt(t)) {
|
|
1517
1517
|
if (!e && t.input.mouseDown && t.input.mouseDown.allowDefault && M) {
|
|
1518
1518
|
let o = t.domSelectionRange(), i = t.domObserver.currentSelection;
|
|
1519
1519
|
if (o.anchorNode && i.anchorNode && re(o.anchorNode, o.anchorOffset, i.anchorNode, i.anchorOffset)) {
|
|
@@ -1522,66 +1522,66 @@ function W(t, e = !1) {
|
|
|
1522
1522
|
}
|
|
1523
1523
|
}
|
|
1524
1524
|
if (t.domObserver.disconnectSelection(), t.cursorWrapper)
|
|
1525
|
-
|
|
1525
|
+
oo(t);
|
|
1526
1526
|
else {
|
|
1527
1527
|
let { anchor: o, head: i } = n, s, r;
|
|
1528
|
-
|
|
1528
|
+
mt && !(n instanceof x) && (n.$from.parent.inlineContent || (s = gt(t, n.from)), !n.empty && !n.$from.parent.inlineContent && (r = gt(t, n.to))), t.docView.setSelection(o, i, t, e), mt && (s && yt(s), r && yt(r)), n.visible ? t.dom.classList.remove("ProseMirror-hideselection") : (t.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && no(t));
|
|
1529
1529
|
}
|
|
1530
1530
|
t.domObserver.setCurSelection(), t.domObserver.connectSelection();
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
1533
|
-
const
|
|
1534
|
-
function
|
|
1533
|
+
const mt = k || M && Kt < 63;
|
|
1534
|
+
function gt(t, e) {
|
|
1535
1535
|
let { node: n, offset: o } = t.docView.domFromPos(e, 0), i = o < n.childNodes.length ? n.childNodes[o] : null, s = o ? n.childNodes[o - 1] : null;
|
|
1536
1536
|
if (k && i && i.contentEditable == "false")
|
|
1537
|
-
return
|
|
1537
|
+
return ze(i);
|
|
1538
1538
|
if ((!i || i.contentEditable == "false") && (!s || s.contentEditable == "false")) {
|
|
1539
1539
|
if (i)
|
|
1540
|
-
return
|
|
1540
|
+
return ze(i);
|
|
1541
1541
|
if (s)
|
|
1542
|
-
return
|
|
1542
|
+
return ze(s);
|
|
1543
1543
|
}
|
|
1544
1544
|
}
|
|
1545
|
-
function
|
|
1545
|
+
function ze(t) {
|
|
1546
1546
|
return t.contentEditable = "true", k && t.draggable && (t.draggable = !1, t.wasDraggable = !0), t;
|
|
1547
1547
|
}
|
|
1548
|
-
function
|
|
1548
|
+
function yt(t) {
|
|
1549
1549
|
t.contentEditable = "false", t.wasDraggable && (t.draggable = !0, t.wasDraggable = null);
|
|
1550
1550
|
}
|
|
1551
|
-
function
|
|
1551
|
+
function no(t) {
|
|
1552
1552
|
let e = t.dom.ownerDocument;
|
|
1553
1553
|
e.removeEventListener("selectionchange", t.input.hideSelectionGuard);
|
|
1554
1554
|
let n = t.domSelectionRange(), o = n.anchorNode, i = n.anchorOffset;
|
|
1555
1555
|
e.addEventListener("selectionchange", t.input.hideSelectionGuard = () => {
|
|
1556
1556
|
(n.anchorNode != o || n.anchorOffset != i) && (e.removeEventListener("selectionchange", t.input.hideSelectionGuard), setTimeout(() => {
|
|
1557
|
-
(!
|
|
1557
|
+
(!wt(t) || t.state.selection.visible) && t.dom.classList.remove("ProseMirror-hideselection");
|
|
1558
1558
|
}, 20));
|
|
1559
1559
|
});
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1561
|
+
function oo(t) {
|
|
1562
1562
|
let e = t.domSelection();
|
|
1563
1563
|
if (!e)
|
|
1564
1564
|
return;
|
|
1565
1565
|
let n = t.cursorWrapper.dom, o = n.nodeName == "IMG";
|
|
1566
1566
|
o ? e.collapse(n.parentNode, C(n) + 1) : e.collapse(n, 0), !o && !t.state.selection.visible && P && J <= 11 && (n.disabled = !0, n.disabled = !1);
|
|
1567
1567
|
}
|
|
1568
|
-
function
|
|
1568
|
+
function vt(t, e) {
|
|
1569
1569
|
if (e instanceof D) {
|
|
1570
1570
|
let n = t.docView.descAt(e.from);
|
|
1571
|
-
n != t.lastSelectedViewDesc && (
|
|
1571
|
+
n != t.lastSelectedViewDesc && (bt(t), n && n.selectNode(), t.lastSelectedViewDesc = n);
|
|
1572
1572
|
} else
|
|
1573
|
-
|
|
1573
|
+
bt(t);
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1575
|
+
function bt(t) {
|
|
1576
1576
|
t.lastSelectedViewDesc && (t.lastSelectedViewDesc.parent && t.lastSelectedViewDesc.deselectNode(), t.lastSelectedViewDesc = void 0);
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1578
|
+
function we(t, e, n, o) {
|
|
1579
1579
|
return t.someProp("createSelectionBetween", (i) => i(t, e, n)) || x.between(e, n, o);
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1582
|
-
return t.editable && !t.hasFocus() ? !1 :
|
|
1581
|
+
function Dt(t) {
|
|
1582
|
+
return t.editable && !t.hasFocus() ? !1 : en(t);
|
|
1583
1583
|
}
|
|
1584
|
-
function
|
|
1584
|
+
function en(t) {
|
|
1585
1585
|
let e = t.domSelectionRange();
|
|
1586
1586
|
if (!e.anchorNode)
|
|
1587
1587
|
return !1;
|
|
@@ -1591,18 +1591,18 @@ function tn(t) {
|
|
|
1591
1591
|
return !1;
|
|
1592
1592
|
}
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1594
|
+
function io(t) {
|
|
1595
1595
|
let e = t.docView.domFromPos(t.state.selection.anchor, 0), n = t.domSelectionRange();
|
|
1596
1596
|
return re(e.node, e.offset, n.anchorNode, n.anchorOffset);
|
|
1597
1597
|
}
|
|
1598
|
-
function
|
|
1598
|
+
function Ye(t, e) {
|
|
1599
1599
|
let { $anchor: n, $head: o } = t.selection, i = e > 0 ? n.max(o) : n.min(o), s = i.parent.inlineContent ? i.depth ? t.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
|
|
1600
|
-
return s &&
|
|
1600
|
+
return s && be.findFrom(s, e);
|
|
1601
1601
|
}
|
|
1602
1602
|
function Y(t, e) {
|
|
1603
1603
|
return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()), !0;
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1605
|
+
function Nt(t, e, n) {
|
|
1606
1606
|
let o = t.state.selection;
|
|
1607
1607
|
if (o instanceof x)
|
|
1608
1608
|
if (n.indexOf("s") > -1) {
|
|
@@ -1613,7 +1613,7 @@ function St(t, e, n) {
|
|
|
1613
1613
|
return Y(t, new x(o.$anchor, r));
|
|
1614
1614
|
} else if (o.empty) {
|
|
1615
1615
|
if (t.endOfTextblock(e > 0 ? "forward" : "backward")) {
|
|
1616
|
-
let i =
|
|
1616
|
+
let i = Ye(t.state, e);
|
|
1617
1617
|
return i && i instanceof D ? Y(t, i) : !1;
|
|
1618
1618
|
} else if (!(R && n.indexOf("m") > -1)) {
|
|
1619
1619
|
let i = o.$head, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, r;
|
|
@@ -1627,33 +1627,33 @@ function St(t, e, n) {
|
|
|
1627
1627
|
if (o instanceof D && o.node.isInline)
|
|
1628
1628
|
return Y(t, new x(e > 0 ? o.$to : o.$from));
|
|
1629
1629
|
{
|
|
1630
|
-
let i =
|
|
1630
|
+
let i = Ye(t.state, e);
|
|
1631
1631
|
return i ? Y(t, i) : !1;
|
|
1632
1632
|
}
|
|
1633
1633
|
}
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1635
|
+
function Te(t) {
|
|
1636
1636
|
return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
|
|
1637
1637
|
}
|
|
1638
|
-
function
|
|
1638
|
+
function ye(t, e) {
|
|
1639
1639
|
let n = t.pmViewDesc;
|
|
1640
1640
|
return n && n.size == 0 && (e < 0 || t.nextSibling || t.nodeName != "BR");
|
|
1641
1641
|
}
|
|
1642
1642
|
function ce(t, e) {
|
|
1643
|
-
return e < 0 ?
|
|
1643
|
+
return e < 0 ? so(t) : ro(t);
|
|
1644
1644
|
}
|
|
1645
|
-
function
|
|
1645
|
+
function so(t) {
|
|
1646
1646
|
let e = t.domSelectionRange(), n = e.focusNode, o = e.focusOffset;
|
|
1647
1647
|
if (!n)
|
|
1648
1648
|
return;
|
|
1649
1649
|
let i, s, r = !1;
|
|
1650
|
-
for (I && n.nodeType == 1 && o <
|
|
1650
|
+
for (I && n.nodeType == 1 && o < Te(n) && ye(n.childNodes[o], -1) && (r = !0); ; )
|
|
1651
1651
|
if (o > 0) {
|
|
1652
1652
|
if (n.nodeType != 1)
|
|
1653
1653
|
break;
|
|
1654
1654
|
{
|
|
1655
1655
|
let l = n.childNodes[o - 1];
|
|
1656
|
-
if (
|
|
1656
|
+
if (ye(l, -1))
|
|
1657
1657
|
i = n, s = --o;
|
|
1658
1658
|
else if (l.nodeType == 3)
|
|
1659
1659
|
n = l, o = n.nodeValue.length;
|
|
@@ -1661,14 +1661,14 @@ function ro(t) {
|
|
|
1661
1661
|
break;
|
|
1662
1662
|
}
|
|
1663
1663
|
} else {
|
|
1664
|
-
if (
|
|
1664
|
+
if (tn(n))
|
|
1665
1665
|
break;
|
|
1666
1666
|
{
|
|
1667
1667
|
let l = n.previousSibling;
|
|
1668
|
-
for (; l &&
|
|
1668
|
+
for (; l && ye(l, -1); )
|
|
1669
1669
|
i = n.parentNode, s = C(l), l = l.previousSibling;
|
|
1670
1670
|
if (l)
|
|
1671
|
-
n = l, o =
|
|
1671
|
+
n = l, o = Te(n);
|
|
1672
1672
|
else {
|
|
1673
1673
|
if (n = n.parentNode, n == t.dom)
|
|
1674
1674
|
break;
|
|
@@ -1676,31 +1676,31 @@ function ro(t) {
|
|
|
1676
1676
|
}
|
|
1677
1677
|
}
|
|
1678
1678
|
}
|
|
1679
|
-
r ?
|
|
1679
|
+
r ? Ge(t, n, o) : i && Ge(t, i, s);
|
|
1680
1680
|
}
|
|
1681
|
-
function
|
|
1681
|
+
function ro(t) {
|
|
1682
1682
|
let e = t.domSelectionRange(), n = e.focusNode, o = e.focusOffset;
|
|
1683
1683
|
if (!n)
|
|
1684
1684
|
return;
|
|
1685
|
-
let i =
|
|
1685
|
+
let i = Te(n), s, r;
|
|
1686
1686
|
for (; ; )
|
|
1687
1687
|
if (o < i) {
|
|
1688
1688
|
if (n.nodeType != 1)
|
|
1689
1689
|
break;
|
|
1690
1690
|
let l = n.childNodes[o];
|
|
1691
|
-
if (
|
|
1691
|
+
if (ye(l, 1))
|
|
1692
1692
|
s = n, r = ++o;
|
|
1693
1693
|
else
|
|
1694
1694
|
break;
|
|
1695
1695
|
} else {
|
|
1696
|
-
if (
|
|
1696
|
+
if (tn(n))
|
|
1697
1697
|
break;
|
|
1698
1698
|
{
|
|
1699
1699
|
let l = n.nextSibling;
|
|
1700
|
-
for (; l &&
|
|
1700
|
+
for (; l && ye(l, 1); )
|
|
1701
1701
|
s = l.parentNode, r = C(l) + 1, l = l.nextSibling;
|
|
1702
1702
|
if (l)
|
|
1703
|
-
n = l, o = 0, i =
|
|
1703
|
+
n = l, o = 0, i = Te(n);
|
|
1704
1704
|
else {
|
|
1705
1705
|
if (n = n.parentNode, n == t.dom)
|
|
1706
1706
|
break;
|
|
@@ -1708,13 +1708,13 @@ function lo(t) {
|
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
1710
|
}
|
|
1711
|
-
s &&
|
|
1711
|
+
s && Ge(t, s, r);
|
|
1712
1712
|
}
|
|
1713
|
-
function
|
|
1713
|
+
function tn(t) {
|
|
1714
1714
|
let e = t.pmViewDesc;
|
|
1715
1715
|
return e && e.node && e.node.isBlock;
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1717
|
+
function lo(t, e) {
|
|
1718
1718
|
for (; t && e == t.childNodes.length && !Ce(t); )
|
|
1719
1719
|
e = C(t) + 1, t = t.parentNode;
|
|
1720
1720
|
for (; t && e < t.childNodes.length; ) {
|
|
@@ -1726,7 +1726,7 @@ function ao(t, e) {
|
|
|
1726
1726
|
t = n, e = 0;
|
|
1727
1727
|
}
|
|
1728
1728
|
}
|
|
1729
|
-
function
|
|
1729
|
+
function ao(t, e) {
|
|
1730
1730
|
for (; t && !e && !Ce(t); )
|
|
1731
1731
|
e = C(t), t = t.parentNode;
|
|
1732
1732
|
for (; t && e; ) {
|
|
@@ -1738,27 +1738,27 @@ function co(t, e) {
|
|
|
1738
1738
|
t = n, e = t.childNodes.length;
|
|
1739
1739
|
}
|
|
1740
1740
|
}
|
|
1741
|
-
function
|
|
1741
|
+
function Ge(t, e, n) {
|
|
1742
1742
|
if (e.nodeType != 3) {
|
|
1743
1743
|
let s, r;
|
|
1744
|
-
(r =
|
|
1744
|
+
(r = lo(e, n)) ? (e = r, n = 0) : (s = ao(e, n)) && (e = s, n = s.nodeValue.length);
|
|
1745
1745
|
}
|
|
1746
1746
|
let o = t.domSelection();
|
|
1747
1747
|
if (!o)
|
|
1748
1748
|
return;
|
|
1749
|
-
if (
|
|
1749
|
+
if (Re(o)) {
|
|
1750
1750
|
let s = document.createRange();
|
|
1751
1751
|
s.setEnd(e, n), s.setStart(e, n), o.removeAllRanges(), o.addRange(s);
|
|
1752
1752
|
} else o.extend && o.extend(e, n);
|
|
1753
1753
|
t.domObserver.setCurSelection();
|
|
1754
1754
|
let { state: i } = t;
|
|
1755
1755
|
setTimeout(() => {
|
|
1756
|
-
t.state == i &&
|
|
1756
|
+
t.state == i && _(t);
|
|
1757
1757
|
}, 50);
|
|
1758
1758
|
}
|
|
1759
|
-
function
|
|
1759
|
+
function St(t, e) {
|
|
1760
1760
|
let n = t.state.doc.resolve(e);
|
|
1761
|
-
if (!(M ||
|
|
1761
|
+
if (!(M || Pn) && n.parent.inlineContent) {
|
|
1762
1762
|
let i = t.coordsAtPos(e);
|
|
1763
1763
|
if (e > n.start()) {
|
|
1764
1764
|
let s = t.coordsAtPos(e - 1), r = (s.top + s.bottom) / 2;
|
|
@@ -1773,23 +1773,23 @@ function Ct(t, e) {
|
|
|
1773
1773
|
}
|
|
1774
1774
|
return getComputedStyle(t.dom).direction == "rtl" ? "rtl" : "ltr";
|
|
1775
1775
|
}
|
|
1776
|
-
function
|
|
1776
|
+
function Ct(t, e, n) {
|
|
1777
1777
|
let o = t.state.selection;
|
|
1778
1778
|
if (o instanceof x && !o.empty || n.indexOf("s") > -1 || R && n.indexOf("m") > -1)
|
|
1779
1779
|
return !1;
|
|
1780
1780
|
let { $from: i, $to: s } = o;
|
|
1781
1781
|
if (!i.parent.inlineContent || t.endOfTextblock(e < 0 ? "up" : "down")) {
|
|
1782
|
-
let r =
|
|
1782
|
+
let r = Ye(t.state, e);
|
|
1783
1783
|
if (r && r instanceof D)
|
|
1784
1784
|
return Y(t, r);
|
|
1785
1785
|
}
|
|
1786
1786
|
if (!i.parent.inlineContent) {
|
|
1787
|
-
let r = e < 0 ? i : s, l = o instanceof
|
|
1787
|
+
let r = e < 0 ? i : s, l = o instanceof Nn ? be.near(r, e) : be.findFrom(r, e);
|
|
1788
1788
|
return l ? Y(t, l) : !1;
|
|
1789
1789
|
}
|
|
1790
1790
|
return !1;
|
|
1791
1791
|
}
|
|
1792
|
-
function
|
|
1792
|
+
function Ot(t, e) {
|
|
1793
1793
|
if (!(t.state.selection instanceof x))
|
|
1794
1794
|
return !0;
|
|
1795
1795
|
let { $head: n, $anchor: o, empty: i } = t.state.selection;
|
|
@@ -1806,48 +1806,48 @@ function Mt(t, e) {
|
|
|
1806
1806
|
}
|
|
1807
1807
|
return !1;
|
|
1808
1808
|
}
|
|
1809
|
-
function
|
|
1809
|
+
function Mt(t, e, n) {
|
|
1810
1810
|
t.domObserver.stop(), e.contentEditable = n, t.domObserver.start();
|
|
1811
1811
|
}
|
|
1812
|
-
function
|
|
1812
|
+
function co(t) {
|
|
1813
1813
|
if (!k || t.state.selection.$head.parentOffset > 0)
|
|
1814
1814
|
return !1;
|
|
1815
1815
|
let { focusNode: e, focusOffset: n } = t.domSelectionRange();
|
|
1816
1816
|
if (e && e.nodeType == 1 && n == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
|
|
1817
1817
|
let o = e.firstChild;
|
|
1818
|
-
|
|
1818
|
+
Mt(t, o, "true"), setTimeout(() => Mt(t, o, "false"), 20);
|
|
1819
1819
|
}
|
|
1820
1820
|
return !1;
|
|
1821
1821
|
}
|
|
1822
|
-
function
|
|
1822
|
+
function fo(t) {
|
|
1823
1823
|
let e = "";
|
|
1824
1824
|
return t.ctrlKey && (e += "c"), t.metaKey && (e += "m"), t.altKey && (e += "a"), t.shiftKey && (e += "s"), e;
|
|
1825
1825
|
}
|
|
1826
|
-
function
|
|
1827
|
-
let n = e.keyCode, o =
|
|
1826
|
+
function ho(t, e) {
|
|
1827
|
+
let n = e.keyCode, o = fo(e);
|
|
1828
1828
|
if (n == 8 || R && n == 72 && o == "c")
|
|
1829
|
-
return
|
|
1829
|
+
return Ot(t, -1) || ce(t, -1);
|
|
1830
1830
|
if (n == 46 && !e.shiftKey || R && n == 68 && o == "c")
|
|
1831
|
-
return
|
|
1831
|
+
return Ot(t, 1) || ce(t, 1);
|
|
1832
1832
|
if (n == 13 || n == 27)
|
|
1833
1833
|
return !0;
|
|
1834
1834
|
if (n == 37 || R && n == 66 && o == "c") {
|
|
1835
|
-
let i = n == 37 ?
|
|
1836
|
-
return
|
|
1835
|
+
let i = n == 37 ? St(t, t.state.selection.from) == "ltr" ? -1 : 1 : -1;
|
|
1836
|
+
return Nt(t, i, o) || ce(t, i);
|
|
1837
1837
|
} else if (n == 39 || R && n == 70 && o == "c") {
|
|
1838
|
-
let i = n == 39 ?
|
|
1839
|
-
return
|
|
1838
|
+
let i = n == 39 ? St(t, t.state.selection.from) == "ltr" ? 1 : -1 : 1;
|
|
1839
|
+
return Nt(t, i, o) || ce(t, i);
|
|
1840
1840
|
} else {
|
|
1841
1841
|
if (n == 38 || R && n == 80 && o == "c")
|
|
1842
|
-
return
|
|
1842
|
+
return Ct(t, -1, o) || ce(t, -1);
|
|
1843
1843
|
if (n == 40 || R && n == 78 && o == "c")
|
|
1844
|
-
return
|
|
1844
|
+
return co(t) || Ct(t, 1, o) || ce(t, 1);
|
|
1845
1845
|
if (o == (R ? "m" : "c") && (n == 66 || n == 73 || n == 89 || n == 90))
|
|
1846
1846
|
return !0;
|
|
1847
1847
|
}
|
|
1848
1848
|
return !1;
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1850
|
+
function ve(t, e) {
|
|
1851
1851
|
t.someProp("transformCopied", (p) => {
|
|
1852
1852
|
e = p(e, t);
|
|
1853
1853
|
});
|
|
@@ -1857,10 +1857,10 @@ function et(t, e) {
|
|
|
1857
1857
|
let p = o.firstChild;
|
|
1858
1858
|
n.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null), o = p.content;
|
|
1859
1859
|
}
|
|
1860
|
-
let r = t.someProp("clipboardSerializer") ||
|
|
1860
|
+
let r = t.someProp("clipboardSerializer") || Ve.fromSchema(t.state.schema), l = an(), a = l.createElement("div");
|
|
1861
1861
|
a.appendChild(r.serializeFragment(o, { document: l }));
|
|
1862
1862
|
let c = a.firstChild, d, f = 0;
|
|
1863
|
-
for (; c && c.nodeType == 1 && (d =
|
|
1863
|
+
for (; c && c.nodeType == 1 && (d = ln[c.nodeName.toLowerCase()]); ) {
|
|
1864
1864
|
for (let p = d.length - 1; p >= 0; p--) {
|
|
1865
1865
|
let h = l.createElement(d[p]);
|
|
1866
1866
|
for (; a.firstChild; )
|
|
@@ -1875,7 +1875,7 @@ function et(t, e) {
|
|
|
1875
1875
|
`);
|
|
1876
1876
|
return { dom: a, text: u, slice: e };
|
|
1877
1877
|
}
|
|
1878
|
-
function
|
|
1878
|
+
function nn(t, e, n, o, i) {
|
|
1879
1879
|
let s = i.parent.type.spec.code, r, l;
|
|
1880
1880
|
if (!n && !e)
|
|
1881
1881
|
return null;
|
|
@@ -1884,7 +1884,7 @@ function on(t, e, n, o, i) {
|
|
|
1884
1884
|
if (t.someProp("transformPastedText", (u) => {
|
|
1885
1885
|
e = u(e, s || o, t);
|
|
1886
1886
|
}), s)
|
|
1887
|
-
return l = new se(
|
|
1887
|
+
return l = new se(j.from(t.state.schema.text(e.replace(/\r\n?/g, `
|
|
1888
1888
|
`))), 0, 0), t.someProp("transformPasted", (u) => {
|
|
1889
1889
|
l = u(l, t, !0);
|
|
1890
1890
|
}), l;
|
|
@@ -1892,7 +1892,7 @@ function on(t, e, n, o, i) {
|
|
|
1892
1892
|
if (f)
|
|
1893
1893
|
l = f;
|
|
1894
1894
|
else {
|
|
1895
|
-
let u = i.marks(), { schema: p } = t.state, h =
|
|
1895
|
+
let u = i.marks(), { schema: p } = t.state, h = Ve.fromSchema(p);
|
|
1896
1896
|
r = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((g) => {
|
|
1897
1897
|
let m = r.appendChild(document.createElement("p"));
|
|
1898
1898
|
g && m.appendChild(h.serializeNode(p.text(g, u)));
|
|
@@ -1901,7 +1901,7 @@ function on(t, e, n, o, i) {
|
|
|
1901
1901
|
} else
|
|
1902
1902
|
t.someProp("transformPastedHTML", (f) => {
|
|
1903
1903
|
n = f(n, t);
|
|
1904
|
-
}), r =
|
|
1904
|
+
}), r = go(n), Oe && yo(r);
|
|
1905
1905
|
let c = r && r.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
|
|
1906
1906
|
if (d && d[3])
|
|
1907
1907
|
for (let f = +d[3]; f > 0; f--) {
|
|
@@ -1912,28 +1912,28 @@ function on(t, e, n, o, i) {
|
|
|
1912
1912
|
break;
|
|
1913
1913
|
r = u;
|
|
1914
1914
|
}
|
|
1915
|
-
if (l || (l = (t.someProp("clipboardParser") || t.someProp("domParser") ||
|
|
1915
|
+
if (l || (l = (t.someProp("clipboardParser") || t.someProp("domParser") || $t.fromSchema(t.state.schema)).parseSlice(r, {
|
|
1916
1916
|
preserveWhitespace: !!(a || d),
|
|
1917
1917
|
context: i,
|
|
1918
1918
|
ruleFromNode(u) {
|
|
1919
|
-
return u.nodeName == "BR" && !u.nextSibling && u.parentNode && !
|
|
1919
|
+
return u.nodeName == "BR" && !u.nextSibling && u.parentNode && !uo.test(u.parentNode.nodeName) ? { ignore: !0 } : null;
|
|
1920
1920
|
}
|
|
1921
1921
|
})), d)
|
|
1922
|
-
l =
|
|
1923
|
-
else if (l = se.maxOpen(
|
|
1922
|
+
l = bo(xt(l, +d[1], +d[2]), d[4]);
|
|
1923
|
+
else if (l = se.maxOpen(po(l.content, i), !0), l.openStart || l.openEnd) {
|
|
1924
1924
|
let f = 0, u = 0;
|
|
1925
1925
|
for (let p = l.content.firstChild; f < l.openStart && !p.type.spec.isolating; f++, p = p.firstChild)
|
|
1926
1926
|
;
|
|
1927
1927
|
for (let p = l.content.lastChild; u < l.openEnd && !p.type.spec.isolating; u++, p = p.lastChild)
|
|
1928
1928
|
;
|
|
1929
|
-
l =
|
|
1929
|
+
l = xt(l, f, u);
|
|
1930
1930
|
}
|
|
1931
1931
|
return t.someProp("transformPasted", (f) => {
|
|
1932
1932
|
l = f(l, t, a);
|
|
1933
1933
|
}), l;
|
|
1934
1934
|
}
|
|
1935
|
-
const
|
|
1936
|
-
function
|
|
1935
|
+
const uo = /^(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;
|
|
1936
|
+
function po(t, e) {
|
|
1937
1937
|
if (t.childCount < 2)
|
|
1938
1938
|
return t;
|
|
1939
1939
|
for (let n = e.depth; n >= 0; n--) {
|
|
@@ -1944,46 +1944,46 @@ function mo(t, e) {
|
|
|
1944
1944
|
let a = i.findWrapping(l.type), c;
|
|
1945
1945
|
if (!a)
|
|
1946
1946
|
return r = null;
|
|
1947
|
-
if (c = r.length && s.length &&
|
|
1947
|
+
if (c = r.length && s.length && sn(a, s, l, r[r.length - 1], 0))
|
|
1948
1948
|
r[r.length - 1] = c;
|
|
1949
1949
|
else {
|
|
1950
|
-
r.length && (r[r.length - 1] =
|
|
1951
|
-
let d =
|
|
1950
|
+
r.length && (r[r.length - 1] = rn(r[r.length - 1], s.length));
|
|
1951
|
+
let d = on(l, a);
|
|
1952
1952
|
r.push(d), i = i.matchType(d.type), s = a;
|
|
1953
1953
|
}
|
|
1954
1954
|
}), r)
|
|
1955
|
-
return
|
|
1955
|
+
return j.from(r);
|
|
1956
1956
|
}
|
|
1957
1957
|
return t;
|
|
1958
1958
|
}
|
|
1959
|
-
function
|
|
1959
|
+
function on(t, e, n = 0) {
|
|
1960
1960
|
for (let o = e.length - 1; o >= n; o--)
|
|
1961
|
-
t = e[o].create(null,
|
|
1961
|
+
t = e[o].create(null, j.from(t));
|
|
1962
1962
|
return t;
|
|
1963
1963
|
}
|
|
1964
|
-
function
|
|
1964
|
+
function sn(t, e, n, o, i) {
|
|
1965
1965
|
if (i < t.length && i < e.length && t[i] == e[i]) {
|
|
1966
|
-
let s =
|
|
1966
|
+
let s = sn(t, e, n, o.lastChild, i + 1);
|
|
1967
1967
|
if (s)
|
|
1968
1968
|
return o.copy(o.content.replaceChild(o.childCount - 1, s));
|
|
1969
1969
|
if (o.contentMatchAt(o.childCount).matchType(i == t.length - 1 ? n.type : t[i + 1]))
|
|
1970
|
-
return o.copy(o.content.append(
|
|
1970
|
+
return o.copy(o.content.append(j.from(on(n, t, i + 1))));
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
|
-
function
|
|
1973
|
+
function rn(t, e) {
|
|
1974
1974
|
if (e == 0)
|
|
1975
1975
|
return t;
|
|
1976
|
-
let n = t.content.replaceChild(t.childCount - 1,
|
|
1976
|
+
let n = t.content.replaceChild(t.childCount - 1, rn(t.lastChild, e - 1)), o = t.contentMatchAt(t.childCount).fillBefore(j.empty, !0);
|
|
1977
1977
|
return t.copy(n.append(o));
|
|
1978
1978
|
}
|
|
1979
|
-
function
|
|
1979
|
+
function Xe(t, e, n, o, i, s) {
|
|
1980
1980
|
let r = e < 0 ? t.firstChild : t.lastChild, l = r.content;
|
|
1981
|
-
return t.childCount > 1 && (s = 0), i < o - 1 && (l =
|
|
1981
|
+
return t.childCount > 1 && (s = 0), i < o - 1 && (l = Xe(l, e, n, o, i + 1, s)), i >= n && (l = e < 0 ? r.contentMatchAt(0).fillBefore(l, s <= i).append(l) : l.append(r.contentMatchAt(r.childCount).fillBefore(j.empty, !0))), t.replaceChild(e < 0 ? 0 : t.childCount - 1, r.copy(l));
|
|
1982
1982
|
}
|
|
1983
|
-
function
|
|
1984
|
-
return e < t.openStart && (t = new se(
|
|
1983
|
+
function xt(t, e, n) {
|
|
1984
|
+
return e < t.openStart && (t = new se(Xe(t.content, -1, e, t.openStart, 0, t.openEnd), e, t.openEnd)), n < t.openEnd && (t = new se(Xe(t.content, 1, n, t.openEnd, 0, 0), t.openStart, n)), t;
|
|
1985
1985
|
}
|
|
1986
|
-
const
|
|
1986
|
+
const ln = {
|
|
1987
1987
|
thead: ["table"],
|
|
1988
1988
|
tbody: ["table"],
|
|
1989
1989
|
tfoot: ["table"],
|
|
@@ -1994,32 +1994,32 @@ const an = {
|
|
|
1994
1994
|
td: ["table", "tbody", "tr"],
|
|
1995
1995
|
th: ["table", "tbody", "tr"]
|
|
1996
1996
|
};
|
|
1997
|
-
let
|
|
1998
|
-
function
|
|
1999
|
-
return
|
|
1997
|
+
let kt = null;
|
|
1998
|
+
function an() {
|
|
1999
|
+
return kt || (kt = document.implementation.createHTMLDocument("title"));
|
|
2000
2000
|
}
|
|
2001
|
-
let
|
|
2002
|
-
function
|
|
2001
|
+
let Le = null;
|
|
2002
|
+
function mo(t) {
|
|
2003
2003
|
let e = window.trustedTypes;
|
|
2004
|
-
return e ? (
|
|
2004
|
+
return e ? (Le || (Le = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (n) => n })), Le.createHTML(t)) : t;
|
|
2005
2005
|
}
|
|
2006
|
-
function
|
|
2006
|
+
function go(t) {
|
|
2007
2007
|
let e = /^(\s*<meta [^>]*>)*/.exec(t);
|
|
2008
2008
|
e && (t = t.slice(e[0].length));
|
|
2009
|
-
let n =
|
|
2010
|
-
if ((i = o &&
|
|
2009
|
+
let n = an().createElement("div"), o = /<([a-z][^>\s]+)/i.exec(t), i;
|
|
2010
|
+
if ((i = o && ln[o[1].toLowerCase()]) && (t = i.map((s) => "<" + s + ">").join("") + t + i.map((s) => "</" + s + ">").reverse().join("")), n.innerHTML = mo(t), i)
|
|
2011
2011
|
for (let s = 0; s < i.length; s++)
|
|
2012
2012
|
n = n.querySelector(i[s]) || n;
|
|
2013
2013
|
return n;
|
|
2014
2014
|
}
|
|
2015
|
-
function
|
|
2015
|
+
function yo(t) {
|
|
2016
2016
|
let e = t.querySelectorAll(M ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
2017
2017
|
for (let n = 0; n < e.length; n++) {
|
|
2018
2018
|
let o = e[n];
|
|
2019
2019
|
o.childNodes.length == 1 && o.textContent == " " && o.parentNode && o.parentNode.replaceChild(t.ownerDocument.createTextNode(" "), o);
|
|
2020
2020
|
}
|
|
2021
2021
|
}
|
|
2022
|
-
function
|
|
2022
|
+
function bo(t, e) {
|
|
2023
2023
|
if (!t.size)
|
|
2024
2024
|
return t;
|
|
2025
2025
|
let n = t.content.firstChild.type.schema, o;
|
|
@@ -2033,47 +2033,47 @@ function Do(t, e) {
|
|
|
2033
2033
|
let a = n.nodes[o[l]];
|
|
2034
2034
|
if (!a || a.hasRequiredAttrs())
|
|
2035
2035
|
break;
|
|
2036
|
-
i =
|
|
2036
|
+
i = j.from(a.create(o[l + 1], i)), s++, r++;
|
|
2037
2037
|
}
|
|
2038
2038
|
return new se(i, s, r);
|
|
2039
2039
|
}
|
|
2040
|
-
const T = {}, A = {},
|
|
2041
|
-
class
|
|
2040
|
+
const T = {}, A = {}, Do = { touchstart: !0, touchmove: !0 };
|
|
2041
|
+
class No {
|
|
2042
2042
|
constructor() {
|
|
2043
2043
|
this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "", button: 0 }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
|
|
2044
2044
|
}
|
|
2045
2045
|
}
|
|
2046
|
-
function
|
|
2046
|
+
function So(t) {
|
|
2047
2047
|
for (let e in T) {
|
|
2048
2048
|
let n = T[e];
|
|
2049
2049
|
t.dom.addEventListener(e, t.input.eventHandlers[e] = (o) => {
|
|
2050
|
-
|
|
2051
|
-
},
|
|
2050
|
+
Oo(t, o) && !et(t, o) && (t.editable || !(o.type in A)) && n(t, o);
|
|
2051
|
+
}, Do[e] ? { passive: !0 } : void 0);
|
|
2052
2052
|
}
|
|
2053
|
-
k && t.dom.addEventListener("input", () => null),
|
|
2053
|
+
k && t.dom.addEventListener("input", () => null), Je(t);
|
|
2054
2054
|
}
|
|
2055
2055
|
function X(t, e) {
|
|
2056
2056
|
t.input.lastSelectionOrigin = e, t.input.lastSelectionTime = Date.now();
|
|
2057
2057
|
}
|
|
2058
|
-
function
|
|
2058
|
+
function Co(t) {
|
|
2059
2059
|
t.domObserver.stop();
|
|
2060
2060
|
for (let e in t.input.eventHandlers)
|
|
2061
2061
|
t.dom.removeEventListener(e, t.input.eventHandlers[e]);
|
|
2062
2062
|
clearTimeout(t.input.composingTimeout), clearTimeout(t.input.lastIOSEnterFallbackTimeout);
|
|
2063
2063
|
}
|
|
2064
|
-
function
|
|
2064
|
+
function Je(t) {
|
|
2065
2065
|
t.someProp("handleDOMEvents", (e) => {
|
|
2066
2066
|
for (let n in e)
|
|
2067
|
-
t.input.eventHandlers[n] || t.dom.addEventListener(n, t.input.eventHandlers[n] = (o) =>
|
|
2067
|
+
t.input.eventHandlers[n] || t.dom.addEventListener(n, t.input.eventHandlers[n] = (o) => et(t, o));
|
|
2068
2068
|
});
|
|
2069
2069
|
}
|
|
2070
|
-
function
|
|
2070
|
+
function et(t, e) {
|
|
2071
2071
|
return t.someProp("handleDOMEvents", (n) => {
|
|
2072
2072
|
let o = n[e.type];
|
|
2073
2073
|
return o ? o(t, e) || e.defaultPrevented : !1;
|
|
2074
2074
|
});
|
|
2075
2075
|
}
|
|
2076
|
-
function
|
|
2076
|
+
function Oo(t, e) {
|
|
2077
2077
|
if (!e.bubbles)
|
|
2078
2078
|
return !0;
|
|
2079
2079
|
if (e.defaultPrevented)
|
|
@@ -2083,25 +2083,25 @@ function Mo(t, e) {
|
|
|
2083
2083
|
return !1;
|
|
2084
2084
|
return !0;
|
|
2085
2085
|
}
|
|
2086
|
-
function
|
|
2087
|
-
!
|
|
2086
|
+
function Mo(t, e) {
|
|
2087
|
+
!et(t, e) && T[e.type] && (t.editable || !(e.type in A)) && T[e.type](t, e);
|
|
2088
2088
|
}
|
|
2089
2089
|
A.keydown = (t, e) => {
|
|
2090
2090
|
let n = e;
|
|
2091
|
-
if (t.input.shiftKey = n.keyCode == 16 || n.shiftKey, !
|
|
2092
|
-
if (n.keyCode != 229 && t.domObserver.forceFlush(),
|
|
2091
|
+
if (t.input.shiftKey = n.keyCode == 16 || n.shiftKey, !dn(t, n) && (t.input.lastKeyCode = n.keyCode, t.input.lastKeyCodeTime = Date.now(), !(W && M && n.keyCode == 13)))
|
|
2092
|
+
if (n.keyCode != 229 && t.domObserver.forceFlush(), ue && n.keyCode == 13 && !n.ctrlKey && !n.altKey && !n.metaKey) {
|
|
2093
2093
|
let o = Date.now();
|
|
2094
2094
|
t.input.lastIOSEnter = o, t.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
2095
2095
|
t.input.lastIOSEnter == o && (t.someProp("handleKeyDown", (i) => i(t, ee(13, "Enter"))), t.input.lastIOSEnter = 0);
|
|
2096
2096
|
}, 200);
|
|
2097
|
-
} else t.someProp("handleKeyDown", (o) => o(t, n)) ||
|
|
2097
|
+
} else t.someProp("handleKeyDown", (o) => o(t, n)) || ho(t, n) ? n.preventDefault() : X(t, "key");
|
|
2098
2098
|
};
|
|
2099
2099
|
A.keyup = (t, e) => {
|
|
2100
2100
|
e.keyCode == 16 && (t.input.shiftKey = !1);
|
|
2101
2101
|
};
|
|
2102
2102
|
A.keypress = (t, e) => {
|
|
2103
2103
|
let n = e;
|
|
2104
|
-
if (
|
|
2104
|
+
if (dn(t, n) || !n.charCode || n.ctrlKey && !n.altKey || R && n.metaKey)
|
|
2105
2105
|
return;
|
|
2106
2106
|
if (t.someProp("handleKeyPress", (i) => i(t, n))) {
|
|
2107
2107
|
n.preventDefault();
|
|
@@ -2113,14 +2113,14 @@ A.keypress = (t, e) => {
|
|
|
2113
2113
|
!/[\r\n]/.test(i) && !t.someProp("handleTextInput", (r) => r(t, o.$from.pos, o.$to.pos, i, s)) && t.dispatch(s()), n.preventDefault();
|
|
2114
2114
|
}
|
|
2115
2115
|
};
|
|
2116
|
-
function
|
|
2116
|
+
function Ie(t) {
|
|
2117
2117
|
return { left: t.clientX, top: t.clientY };
|
|
2118
2118
|
}
|
|
2119
|
-
function
|
|
2119
|
+
function xo(t, e) {
|
|
2120
2120
|
let n = e.x - t.clientX, o = e.y - t.clientY;
|
|
2121
2121
|
return n * n + o * o < 100;
|
|
2122
2122
|
}
|
|
2123
|
-
function
|
|
2123
|
+
function tt(t, e, n, o, i) {
|
|
2124
2124
|
if (o == -1)
|
|
2125
2125
|
return !1;
|
|
2126
2126
|
let s = t.state.doc.resolve(o);
|
|
@@ -2135,13 +2135,13 @@ function fe(t, e, n) {
|
|
|
2135
2135
|
let o = t.state.tr.setSelection(e);
|
|
2136
2136
|
o.setMeta("pointer", !0), t.dispatch(o);
|
|
2137
2137
|
}
|
|
2138
|
-
function
|
|
2138
|
+
function ko(t, e) {
|
|
2139
2139
|
if (e == -1)
|
|
2140
2140
|
return !1;
|
|
2141
2141
|
let n = t.state.doc.resolve(e), o = n.nodeAfter;
|
|
2142
2142
|
return o && o.isAtom && D.isSelectable(o) ? (fe(t, new D(n)), !0) : !1;
|
|
2143
2143
|
}
|
|
2144
|
-
function
|
|
2144
|
+
function To(t, e) {
|
|
2145
2145
|
if (e == -1)
|
|
2146
2146
|
return !1;
|
|
2147
2147
|
let n = t.state.selection, o, i;
|
|
@@ -2156,16 +2156,16 @@ function Ao(t, e) {
|
|
|
2156
2156
|
}
|
|
2157
2157
|
return i != null ? (fe(t, D.create(t.state.doc, i)), !0) : !1;
|
|
2158
2158
|
}
|
|
2159
|
-
function
|
|
2160
|
-
return
|
|
2159
|
+
function Ao(t, e, n, o, i) {
|
|
2160
|
+
return tt(t, "handleClickOn", e, n, o) || t.someProp("handleClick", (s) => s(t, e, o)) || (i ? To(t, n) : ko(t, n));
|
|
2161
2161
|
}
|
|
2162
|
-
function
|
|
2163
|
-
return
|
|
2162
|
+
function Eo(t, e, n, o) {
|
|
2163
|
+
return tt(t, "handleDoubleClickOn", e, n, o) || t.someProp("handleDoubleClick", (i) => i(t, e, o));
|
|
2164
2164
|
}
|
|
2165
|
-
function
|
|
2166
|
-
return
|
|
2165
|
+
function Po(t, e, n, o) {
|
|
2166
|
+
return tt(t, "handleTripleClickOn", e, n, o) || t.someProp("handleTripleClick", (i) => i(t, e, o)) || Vo(t, n, o);
|
|
2167
2167
|
}
|
|
2168
|
-
function
|
|
2168
|
+
function Vo(t, e, n) {
|
|
2169
2169
|
if (n.button != 0)
|
|
2170
2170
|
return !1;
|
|
2171
2171
|
let o = t.state.doc;
|
|
@@ -2183,21 +2183,21 @@ function Ro(t, e, n) {
|
|
|
2183
2183
|
return !0;
|
|
2184
2184
|
}
|
|
2185
2185
|
}
|
|
2186
|
-
function
|
|
2187
|
-
return
|
|
2186
|
+
function nt(t) {
|
|
2187
|
+
return Ae(t);
|
|
2188
2188
|
}
|
|
2189
|
-
const
|
|
2189
|
+
const cn = R ? "metaKey" : "ctrlKey";
|
|
2190
2190
|
T.mousedown = (t, e) => {
|
|
2191
2191
|
let n = e;
|
|
2192
2192
|
t.input.shiftKey = n.shiftKey;
|
|
2193
|
-
let o =
|
|
2194
|
-
i - t.input.lastClick.time < 500 &&
|
|
2195
|
-
let r = t.posAtCoords(
|
|
2196
|
-
r && (s == "singleClick" ? (t.input.mouseDown && t.input.mouseDown.done(), t.input.mouseDown = new
|
|
2193
|
+
let o = nt(t), i = Date.now(), s = "singleClick";
|
|
2194
|
+
i - t.input.lastClick.time < 500 && xo(n, t.input.lastClick) && !n[cn] && t.input.lastClick.button == n.button && (t.input.lastClick.type == "singleClick" ? s = "doubleClick" : t.input.lastClick.type == "doubleClick" && (s = "tripleClick")), t.input.lastClick = { time: i, x: n.clientX, y: n.clientY, type: s, button: n.button };
|
|
2195
|
+
let r = t.posAtCoords(Ie(n));
|
|
2196
|
+
r && (s == "singleClick" ? (t.input.mouseDown && t.input.mouseDown.done(), t.input.mouseDown = new Ro(t, r, n, !!o)) : (s == "doubleClick" ? Eo : Po)(t, r.pos, r.inside, n) ? n.preventDefault() : X(t, "pointer"));
|
|
2197
2197
|
};
|
|
2198
|
-
class
|
|
2198
|
+
class Ro {
|
|
2199
2199
|
constructor(e, n, o, i) {
|
|
2200
|
-
this.view = e, this.pos = n, this.event = o, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!o[
|
|
2200
|
+
this.view = e, this.pos = n, this.event = o, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!o[cn], this.allowDefault = o.shiftKey;
|
|
2201
2201
|
let s, r;
|
|
2202
2202
|
if (n.inside > -1)
|
|
2203
2203
|
s = e.state.doc.nodeAt(n.inside), r = n.inside;
|
|
@@ -2218,13 +2218,13 @@ class Bo {
|
|
|
2218
2218
|
}, 20), this.view.domObserver.start()), e.root.addEventListener("mouseup", this.up = this.up.bind(this)), e.root.addEventListener("mousemove", this.move = this.move.bind(this)), X(e, "pointer");
|
|
2219
2219
|
}
|
|
2220
2220
|
done() {
|
|
2221
|
-
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(() =>
|
|
2221
|
+
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(() => _(this.view)), this.view.input.mouseDown = null;
|
|
2222
2222
|
}
|
|
2223
2223
|
up(e) {
|
|
2224
2224
|
if (this.done(), !this.view.dom.contains(e.target))
|
|
2225
2225
|
return;
|
|
2226
2226
|
let n = this.pos;
|
|
2227
|
-
this.view.state.doc != this.startDoc && (n = this.view.posAtCoords(
|
|
2227
|
+
this.view.state.doc != this.startDoc && (n = this.view.posAtCoords(Ie(e))), this.updateAllowDefault(e), this.allowDefault || !n ? X(this.view, "pointer") : Ao(this.view, n.pos, n.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
2228
2228
|
k && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
2229
2229
|
// cursor, but still report that the node is selected
|
|
2230
2230
|
// when asked through getSelection. You'll then get a
|
|
@@ -2232,7 +2232,7 @@ class Bo {
|
|
|
2232
2232
|
// (hidden) cursor is doesn't change the selection, and
|
|
2233
2233
|
// thus doesn't get a reaction from ProseMirror. This
|
|
2234
2234
|
// works around that.
|
|
2235
|
-
M && !this.view.state.selection.visible && Math.min(Math.abs(n.pos - this.view.state.selection.from), Math.abs(n.pos - this.view.state.selection.to)) <= 2) ? (fe(this.view,
|
|
2235
|
+
M && !this.view.state.selection.visible && Math.min(Math.abs(n.pos - this.view.state.selection.from), Math.abs(n.pos - this.view.state.selection.to)) <= 2) ? (fe(this.view, be.near(this.view.state.doc.resolve(n.pos))), e.preventDefault()) : X(this.view, "pointer");
|
|
2236
2236
|
}
|
|
2237
2237
|
move(e) {
|
|
2238
2238
|
this.updateAllowDefault(e), X(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
@@ -2242,23 +2242,23 @@ class Bo {
|
|
|
2242
2242
|
}
|
|
2243
2243
|
}
|
|
2244
2244
|
T.touchstart = (t) => {
|
|
2245
|
-
t.input.lastTouch = Date.now(),
|
|
2245
|
+
t.input.lastTouch = Date.now(), nt(t), X(t, "pointer");
|
|
2246
2246
|
};
|
|
2247
2247
|
T.touchmove = (t) => {
|
|
2248
2248
|
t.input.lastTouch = Date.now(), X(t, "pointer");
|
|
2249
2249
|
};
|
|
2250
|
-
T.contextmenu = (t) =>
|
|
2251
|
-
function
|
|
2250
|
+
T.contextmenu = (t) => nt(t);
|
|
2251
|
+
function dn(t, e) {
|
|
2252
2252
|
return t.composing ? !0 : k && Math.abs(e.timeStamp - t.input.compositionEndedAt) < 500 ? (t.input.compositionEndedAt = -2e8, !0) : !1;
|
|
2253
2253
|
}
|
|
2254
|
-
const
|
|
2254
|
+
const Bo = W ? 5e3 : -1;
|
|
2255
2255
|
A.compositionstart = A.compositionupdate = (t) => {
|
|
2256
2256
|
if (!t.composing) {
|
|
2257
2257
|
t.domObserver.flush();
|
|
2258
2258
|
let { state: e } = t, n = e.selection.$to;
|
|
2259
2259
|
if (e.selection instanceof x && (e.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((o) => o.type.spec.inclusive === !1)))
|
|
2260
|
-
t.markCursor = t.state.storedMarks || n.marks(),
|
|
2261
|
-
else if (
|
|
2260
|
+
t.markCursor = t.state.storedMarks || n.marks(), Ae(t, !0), t.markCursor = null;
|
|
2261
|
+
else if (Ae(t, !e.selection.empty), I && e.selection.empty && n.parentOffset && !n.textOffset && n.nodeBefore.marks.length) {
|
|
2262
2262
|
let o = t.domSelectionRange();
|
|
2263
2263
|
for (let i = o.focusNode, s = o.focusOffset; i && i.nodeType == 1 && s != 0; ) {
|
|
2264
2264
|
let r = s < 0 ? i.lastChild : i.childNodes[s - 1];
|
|
@@ -2274,23 +2274,23 @@ A.compositionstart = A.compositionupdate = (t) => {
|
|
|
2274
2274
|
}
|
|
2275
2275
|
t.input.composing = !0;
|
|
2276
2276
|
}
|
|
2277
|
-
|
|
2277
|
+
fn(t, Bo);
|
|
2278
2278
|
};
|
|
2279
2279
|
A.compositionend = (t, e) => {
|
|
2280
|
-
t.composing && (t.input.composing = !1, t.input.compositionEndedAt = e.timeStamp, t.input.compositionPendingChanges = t.domObserver.pendingRecords().length ? t.input.compositionID : 0, t.input.compositionNode = null, t.input.compositionPendingChanges && Promise.resolve().then(() => t.domObserver.flush()), t.input.compositionID++,
|
|
2280
|
+
t.composing && (t.input.composing = !1, t.input.compositionEndedAt = e.timeStamp, t.input.compositionPendingChanges = t.domObserver.pendingRecords().length ? t.input.compositionID : 0, t.input.compositionNode = null, t.input.compositionPendingChanges && Promise.resolve().then(() => t.domObserver.flush()), t.input.compositionID++, fn(t, 20));
|
|
2281
2281
|
};
|
|
2282
|
-
function
|
|
2283
|
-
clearTimeout(t.input.composingTimeout), e > -1 && (t.input.composingTimeout = setTimeout(() =>
|
|
2282
|
+
function fn(t, e) {
|
|
2283
|
+
clearTimeout(t.input.composingTimeout), e > -1 && (t.input.composingTimeout = setTimeout(() => Ae(t), e));
|
|
2284
2284
|
}
|
|
2285
|
-
function
|
|
2286
|
-
for (t.composing && (t.input.composing = !1, t.input.compositionEndedAt =
|
|
2285
|
+
function hn(t) {
|
|
2286
|
+
for (t.composing && (t.input.composing = !1, t.input.compositionEndedAt = Fo()); t.input.compositionNodes.length > 0; )
|
|
2287
2287
|
t.input.compositionNodes.pop().markParentsDirty();
|
|
2288
2288
|
}
|
|
2289
|
-
function
|
|
2289
|
+
function Io(t) {
|
|
2290
2290
|
let e = t.domSelectionRange();
|
|
2291
2291
|
if (!e.focusNode)
|
|
2292
2292
|
return null;
|
|
2293
|
-
let n =
|
|
2293
|
+
let n = xn(e.focusNode, e.focusOffset), o = kn(e.focusNode, e.focusOffset);
|
|
2294
2294
|
if (n && o && n != o) {
|
|
2295
2295
|
let i = o.pmViewDesc, s = t.domObserver.lastChangedTextNode;
|
|
2296
2296
|
if (n == s || o == s)
|
|
@@ -2305,20 +2305,20 @@ function Fo(t) {
|
|
|
2305
2305
|
}
|
|
2306
2306
|
return n || o;
|
|
2307
2307
|
}
|
|
2308
|
-
function
|
|
2308
|
+
function Fo() {
|
|
2309
2309
|
let t = document.createEvent("Event");
|
|
2310
2310
|
return t.initEvent("event", !0, !0), t.timeStamp;
|
|
2311
2311
|
}
|
|
2312
|
-
function
|
|
2313
|
-
if (!(
|
|
2314
|
-
if (t.domObserver.forceFlush(),
|
|
2315
|
-
let n =
|
|
2312
|
+
function Ae(t, e = !1) {
|
|
2313
|
+
if (!(W && t.domObserver.flushingSoon >= 0)) {
|
|
2314
|
+
if (t.domObserver.forceFlush(), hn(t), e || t.docView && t.docView.dirty) {
|
|
2315
|
+
let n = Qe(t), o = t.state.selection;
|
|
2316
2316
|
return n && !n.eq(o) ? t.dispatch(t.state.tr.setSelection(n)) : (t.markCursor || e) && !o.$from.node(o.$from.sharedDepth(o.to)).inlineContent ? t.dispatch(t.state.tr.deleteSelection()) : t.updateState(t.state), !0;
|
|
2317
2317
|
}
|
|
2318
2318
|
return !1;
|
|
2319
2319
|
}
|
|
2320
2320
|
}
|
|
2321
|
-
function
|
|
2321
|
+
function zo(t, e) {
|
|
2322
2322
|
if (!t.dom.parentNode)
|
|
2323
2323
|
return;
|
|
2324
2324
|
let n = t.dom.parentNode.appendChild(document.createElement("div"));
|
|
@@ -2328,18 +2328,18 @@ function Lo(t, e) {
|
|
|
2328
2328
|
n.parentNode && n.parentNode.removeChild(n), t.focus();
|
|
2329
2329
|
}, 50);
|
|
2330
2330
|
}
|
|
2331
|
-
const De = P && J < 15 ||
|
|
2331
|
+
const De = P && J < 15 || ue && Vn < 604;
|
|
2332
2332
|
T.copy = A.cut = (t, e) => {
|
|
2333
2333
|
let n = e, o = t.state.selection, i = n.type == "cut";
|
|
2334
2334
|
if (o.empty)
|
|
2335
2335
|
return;
|
|
2336
|
-
let s = De ? null : n.clipboardData, r = o.content(), { dom: l, text: a } =
|
|
2337
|
-
s ? (n.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) :
|
|
2336
|
+
let s = De ? null : n.clipboardData, r = o.content(), { dom: l, text: a } = ve(t, r);
|
|
2337
|
+
s ? (n.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : zo(t, l), i && t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
2338
2338
|
};
|
|
2339
|
-
function
|
|
2339
|
+
function Lo(t) {
|
|
2340
2340
|
return t.openStart == 0 && t.openEnd == 0 && t.content.childCount == 1 ? t.content.firstChild : null;
|
|
2341
2341
|
}
|
|
2342
|
-
function
|
|
2342
|
+
function $o(t, e) {
|
|
2343
2343
|
if (!t.dom.parentNode)
|
|
2344
2344
|
return;
|
|
2345
2345
|
let n = t.input.shiftKey || t.state.selection.$from.parent.type.spec.code, o = t.dom.parentNode.appendChild(document.createElement(n ? "textarea" : "div"));
|
|
@@ -2350,15 +2350,15 @@ function qo(t, e) {
|
|
|
2350
2350
|
}, 50);
|
|
2351
2351
|
}
|
|
2352
2352
|
function Ne(t, e, n, o, i) {
|
|
2353
|
-
let s =
|
|
2353
|
+
let s = nn(t, e, n, o, t.state.selection.$from);
|
|
2354
2354
|
if (t.someProp("handlePaste", (a) => a(t, i, s || se.empty)))
|
|
2355
2355
|
return !0;
|
|
2356
2356
|
if (!s)
|
|
2357
2357
|
return !1;
|
|
2358
|
-
let r =
|
|
2358
|
+
let r = Lo(s), l = r ? t.state.tr.replaceSelectionWith(r, o) : t.state.tr.replaceSelection(s);
|
|
2359
2359
|
return t.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
|
|
2360
2360
|
}
|
|
2361
|
-
function
|
|
2361
|
+
function un(t) {
|
|
2362
2362
|
let e = t.getData("text/plain") || t.getData("Text");
|
|
2363
2363
|
if (e)
|
|
2364
2364
|
return e;
|
|
@@ -2367,26 +2367,26 @@ function pn(t) {
|
|
|
2367
2367
|
}
|
|
2368
2368
|
A.paste = (t, e) => {
|
|
2369
2369
|
let n = e;
|
|
2370
|
-
if (t.composing && !
|
|
2370
|
+
if (t.composing && !W)
|
|
2371
2371
|
return;
|
|
2372
2372
|
let o = De ? null : n.clipboardData, i = t.input.shiftKey && t.input.lastKeyCode != 45;
|
|
2373
|
-
o && Ne(t,
|
|
2373
|
+
o && Ne(t, un(o), o.getData("text/html"), i, n) ? n.preventDefault() : $o(t, n);
|
|
2374
2374
|
};
|
|
2375
|
-
class
|
|
2375
|
+
class pn {
|
|
2376
2376
|
constructor(e, n, o) {
|
|
2377
2377
|
this.slice = e, this.move = n, this.node = o;
|
|
2378
2378
|
}
|
|
2379
2379
|
}
|
|
2380
|
-
const
|
|
2381
|
-
function
|
|
2380
|
+
const qo = R ? "altKey" : "ctrlKey";
|
|
2381
|
+
function mn(t, e) {
|
|
2382
2382
|
let n = t.someProp("dragCopies", (o) => !o(e));
|
|
2383
|
-
return n ?? !e[
|
|
2383
|
+
return n ?? !e[qo];
|
|
2384
2384
|
}
|
|
2385
2385
|
T.dragstart = (t, e) => {
|
|
2386
2386
|
let n = e, o = t.input.mouseDown;
|
|
2387
2387
|
if (o && o.done(), !n.dataTransfer)
|
|
2388
2388
|
return;
|
|
2389
|
-
let i = t.state.selection, s = i.empty ? null : t.posAtCoords(
|
|
2389
|
+
let i = t.state.selection, s = i.empty ? null : t.posAtCoords(Ie(n)), r;
|
|
2390
2390
|
if (!(s && s.pos >= i.from && s.pos <= (i instanceof D ? i.to - 1 : i.to))) {
|
|
2391
2391
|
if (o && o.mightDrag)
|
|
2392
2392
|
r = D.create(t.state.doc, o.mightDrag.pos);
|
|
@@ -2395,8 +2395,8 @@ T.dragstart = (t, e) => {
|
|
|
2395
2395
|
f && f.node.type.spec.draggable && f != t.docView && (r = D.create(t.state.doc, f.posBefore));
|
|
2396
2396
|
}
|
|
2397
2397
|
}
|
|
2398
|
-
let l = (r || t.state.selection).content(), { dom: a, text: c, slice: d } =
|
|
2399
|
-
(!n.dataTransfer.files.length || !M ||
|
|
2398
|
+
let l = (r || t.state.selection).content(), { dom: a, text: c, slice: d } = ve(t, l);
|
|
2399
|
+
(!n.dataTransfer.files.length || !M || Kt > 120) && n.dataTransfer.clearData(), n.dataTransfer.setData(De ? "Text" : "text/html", a.innerHTML), n.dataTransfer.effectAllowed = "copyMove", De || n.dataTransfer.setData("text/plain", c), t.dragging = new pn(d, mn(t, n), r);
|
|
2400
2400
|
};
|
|
2401
2401
|
T.dragend = (t) => {
|
|
2402
2402
|
let e = t.dragging;
|
|
@@ -2409,14 +2409,14 @@ A.drop = (t, e) => {
|
|
|
2409
2409
|
let n = e, o = t.dragging;
|
|
2410
2410
|
if (t.dragging = null, !n.dataTransfer)
|
|
2411
2411
|
return;
|
|
2412
|
-
let i = t.posAtCoords(
|
|
2412
|
+
let i = t.posAtCoords(Ie(n));
|
|
2413
2413
|
if (!i)
|
|
2414
2414
|
return;
|
|
2415
2415
|
let s = t.state.doc.resolve(i.pos), r = o && o.slice;
|
|
2416
2416
|
r ? t.someProp("transformPasted", (h) => {
|
|
2417
2417
|
r = h(r, t, !1);
|
|
2418
|
-
}) : r =
|
|
2419
|
-
let l = !!(o &&
|
|
2418
|
+
}) : r = nn(t, un(n.dataTransfer), De ? null : n.dataTransfer.getData("text/html"), !1, s);
|
|
2419
|
+
let l = !!(o && mn(t, n));
|
|
2420
2420
|
if (t.someProp("handleDrop", (h) => h(t, n, r || se.empty, l))) {
|
|
2421
2421
|
n.preventDefault();
|
|
2422
2422
|
return;
|
|
@@ -2424,7 +2424,7 @@ A.drop = (t, e) => {
|
|
|
2424
2424
|
if (!r)
|
|
2425
2425
|
return;
|
|
2426
2426
|
n.preventDefault();
|
|
2427
|
-
let a = r ?
|
|
2427
|
+
let a = r ? Cn(t.state.doc, s.pos, r) : s.pos;
|
|
2428
2428
|
a == null && (a = s.pos);
|
|
2429
2429
|
let c = t.state.tr;
|
|
2430
2430
|
if (l) {
|
|
@@ -2439,13 +2439,13 @@ A.drop = (t, e) => {
|
|
|
2439
2439
|
c.setSelection(new D(p));
|
|
2440
2440
|
else {
|
|
2441
2441
|
let h = c.mapping.map(a);
|
|
2442
|
-
c.mapping.maps[c.mapping.maps.length - 1].forEach((g, m, y, V) => h = V), c.setSelection(
|
|
2442
|
+
c.mapping.maps[c.mapping.maps.length - 1].forEach((g, m, y, V) => h = V), c.setSelection(we(t, p, c.doc.resolve(h)));
|
|
2443
2443
|
}
|
|
2444
2444
|
t.focus(), t.dispatch(c.setMeta("uiEvent", "drop"));
|
|
2445
2445
|
};
|
|
2446
2446
|
T.focus = (t) => {
|
|
2447
2447
|
t.input.lastFocus = Date.now(), t.focused || (t.domObserver.stop(), t.dom.classList.add("ProseMirror-focused"), t.domObserver.start(), t.focused = !0, setTimeout(() => {
|
|
2448
|
-
t.docView && t.hasFocus() && !t.domObserver.currentSelection.eq(t.domSelectionRange()) &&
|
|
2448
|
+
t.docView && t.hasFocus() && !t.domObserver.currentSelection.eq(t.domSelectionRange()) && _(t);
|
|
2449
2449
|
}, 20));
|
|
2450
2450
|
};
|
|
2451
2451
|
T.blur = (t, e) => {
|
|
@@ -2453,7 +2453,7 @@ T.blur = (t, e) => {
|
|
|
2453
2453
|
t.focused && (t.domObserver.stop(), t.dom.classList.remove("ProseMirror-focused"), t.domObserver.start(), n.relatedTarget && t.dom.contains(n.relatedTarget) && t.domObserver.currentSelection.clear(), t.focused = !1);
|
|
2454
2454
|
};
|
|
2455
2455
|
T.beforeinput = (t, e) => {
|
|
2456
|
-
if (M &&
|
|
2456
|
+
if (M && W && e.inputType == "deleteContentBackward") {
|
|
2457
2457
|
t.domObserver.flushSoon();
|
|
2458
2458
|
let { domChangeCount: o } = t.input;
|
|
2459
2459
|
setTimeout(() => {
|
|
@@ -2477,19 +2477,19 @@ function Se(t, e) {
|
|
|
2477
2477
|
return !1;
|
|
2478
2478
|
return !0;
|
|
2479
2479
|
}
|
|
2480
|
-
class
|
|
2480
|
+
class Ee {
|
|
2481
2481
|
constructor(e, n) {
|
|
2482
2482
|
this.toDOM = e, this.spec = n || oe, this.side = this.spec.side || 0;
|
|
2483
2483
|
}
|
|
2484
2484
|
map(e, n, o, i) {
|
|
2485
2485
|
let { pos: s, deleted: r } = e.mapResult(n.from + i, this.side < 0 ? -1 : 1);
|
|
2486
|
-
return r ? null : new
|
|
2486
|
+
return r ? null : new L(s - o, s - o, this);
|
|
2487
2487
|
}
|
|
2488
2488
|
valid() {
|
|
2489
2489
|
return !0;
|
|
2490
2490
|
}
|
|
2491
2491
|
eq(e) {
|
|
2492
|
-
return this == e || e instanceof
|
|
2492
|
+
return this == e || e instanceof Ee && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Se(this.spec, e.spec));
|
|
2493
2493
|
}
|
|
2494
2494
|
destroy(e) {
|
|
2495
2495
|
this.spec.destroy && this.spec.destroy(e);
|
|
@@ -2501,7 +2501,7 @@ class Q {
|
|
|
2501
2501
|
}
|
|
2502
2502
|
map(e, n, o, i) {
|
|
2503
2503
|
let s = e.map(n.from + i, this.spec.inclusiveStart ? -1 : 1) - o, r = e.map(n.to + i, this.spec.inclusiveEnd ? 1 : -1) - o;
|
|
2504
|
-
return s >= r ? null : new
|
|
2504
|
+
return s >= r ? null : new L(s, r, this);
|
|
2505
2505
|
}
|
|
2506
2506
|
valid(e, n) {
|
|
2507
2507
|
return n.from < n.to;
|
|
@@ -2515,7 +2515,7 @@ class Q {
|
|
|
2515
2515
|
destroy() {
|
|
2516
2516
|
}
|
|
2517
2517
|
}
|
|
2518
|
-
class
|
|
2518
|
+
class ot {
|
|
2519
2519
|
constructor(e, n) {
|
|
2520
2520
|
this.attrs = e, this.spec = n || oe;
|
|
2521
2521
|
}
|
|
@@ -2524,19 +2524,19 @@ class it {
|
|
|
2524
2524
|
if (s.deleted)
|
|
2525
2525
|
return null;
|
|
2526
2526
|
let r = e.mapResult(n.to + i, -1);
|
|
2527
|
-
return r.deleted || r.pos <= s.pos ? null : new
|
|
2527
|
+
return r.deleted || r.pos <= s.pos ? null : new L(s.pos - o, r.pos - o, this);
|
|
2528
2528
|
}
|
|
2529
2529
|
valid(e, n) {
|
|
2530
2530
|
let { index: o, offset: i } = e.content.findIndex(n.from), s;
|
|
2531
2531
|
return i == n.from && !(s = e.child(o)).isText && i + s.nodeSize == n.to;
|
|
2532
2532
|
}
|
|
2533
2533
|
eq(e) {
|
|
2534
|
-
return this == e || e instanceof
|
|
2534
|
+
return this == e || e instanceof ot && Se(this.attrs, e.attrs) && Se(this.spec, e.spec);
|
|
2535
2535
|
}
|
|
2536
2536
|
destroy() {
|
|
2537
2537
|
}
|
|
2538
2538
|
}
|
|
2539
|
-
class
|
|
2539
|
+
class L {
|
|
2540
2540
|
/**
|
|
2541
2541
|
@internal
|
|
2542
2542
|
*/
|
|
@@ -2547,7 +2547,7 @@ class z {
|
|
|
2547
2547
|
@internal
|
|
2548
2548
|
*/
|
|
2549
2549
|
copy(e, n) {
|
|
2550
|
-
return new
|
|
2550
|
+
return new L(e, n, this.type);
|
|
2551
2551
|
}
|
|
2552
2552
|
/**
|
|
2553
2553
|
@internal
|
|
@@ -2570,14 +2570,14 @@ class z {
|
|
|
2570
2570
|
widget's current document position.
|
|
2571
2571
|
*/
|
|
2572
2572
|
static widget(e, n, o) {
|
|
2573
|
-
return new
|
|
2573
|
+
return new L(e, e, new Ee(n, o));
|
|
2574
2574
|
}
|
|
2575
2575
|
/**
|
|
2576
2576
|
Creates an inline decoration, which adds the given attributes to
|
|
2577
2577
|
each inline node between `from` and `to`.
|
|
2578
2578
|
*/
|
|
2579
2579
|
static inline(e, n, o, i) {
|
|
2580
|
-
return new
|
|
2580
|
+
return new L(e, n, new Q(o, i));
|
|
2581
2581
|
}
|
|
2582
2582
|
/**
|
|
2583
2583
|
Creates a node decoration. `from` and `to` should point precisely
|
|
@@ -2585,7 +2585,7 @@ class z {
|
|
|
2585
2585
|
node, will receive the given attributes.
|
|
2586
2586
|
*/
|
|
2587
2587
|
static node(e, n, o, i) {
|
|
2588
|
-
return new
|
|
2588
|
+
return new L(e, n, new ot(o, i));
|
|
2589
2589
|
}
|
|
2590
2590
|
/**
|
|
2591
2591
|
The spec provided when creating this decoration. Can be useful
|
|
@@ -2604,7 +2604,7 @@ class z {
|
|
|
2604
2604
|
@internal
|
|
2605
2605
|
*/
|
|
2606
2606
|
get widget() {
|
|
2607
|
-
return this.type instanceof
|
|
2607
|
+
return this.type instanceof Ee;
|
|
2608
2608
|
}
|
|
2609
2609
|
}
|
|
2610
2610
|
const de = [], oe = {};
|
|
@@ -2621,7 +2621,7 @@ class S {
|
|
|
2621
2621
|
you must make a copy if you want need to preserve that.
|
|
2622
2622
|
*/
|
|
2623
2623
|
static create(e, n) {
|
|
2624
|
-
return n.length ?
|
|
2624
|
+
return n.length ? Pe(n, e, 0, oe) : O;
|
|
2625
2625
|
}
|
|
2626
2626
|
/**
|
|
2627
2627
|
Find all decorations in this set which touch the given range
|
|
@@ -2662,7 +2662,7 @@ class S {
|
|
|
2662
2662
|
let a = this.local[l].map(e, o, i);
|
|
2663
2663
|
a && a.type.valid(n, a) ? (r || (r = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
|
|
2664
2664
|
}
|
|
2665
|
-
return this.children.length ?
|
|
2665
|
+
return this.children.length ? Ko(this.children, r || [], e, n, o, i, s) : r ? new S(r.sort(ie), de) : O;
|
|
2666
2666
|
}
|
|
2667
2667
|
/**
|
|
2668
2668
|
Add the given array of decorations to the ones in the set,
|
|
@@ -2677,13 +2677,13 @@ class S {
|
|
|
2677
2677
|
let i, s = 0;
|
|
2678
2678
|
e.forEach((l, a) => {
|
|
2679
2679
|
let c = a + o, d;
|
|
2680
|
-
if (d =
|
|
2680
|
+
if (d = yn(n, l, c)) {
|
|
2681
2681
|
for (i || (i = this.children.slice()); s < i.length && i[s] < a; )
|
|
2682
2682
|
s += 3;
|
|
2683
|
-
i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize,
|
|
2683
|
+
i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize, Pe(d, l, c + 1, oe)), s += 3;
|
|
2684
2684
|
}
|
|
2685
2685
|
});
|
|
2686
|
-
let r =
|
|
2686
|
+
let r = gn(s ? bn(n) : n, -o);
|
|
2687
2687
|
for (let l = 0; l < r.length; l++)
|
|
2688
2688
|
r[l].type.valid(e, r[l]) || r.splice(l--, 1);
|
|
2689
2689
|
return new S(r.length ? this.local.concat(r).sort(ie) : this.local, i || this.children);
|
|
@@ -2760,7 +2760,7 @@ class S {
|
|
|
2760
2760
|
@internal
|
|
2761
2761
|
*/
|
|
2762
2762
|
locals(e) {
|
|
2763
|
-
return
|
|
2763
|
+
return it(this.localsInner(e));
|
|
2764
2764
|
}
|
|
2765
2765
|
/**
|
|
2766
2766
|
@internal
|
|
@@ -2780,7 +2780,7 @@ class S {
|
|
|
2780
2780
|
}
|
|
2781
2781
|
}
|
|
2782
2782
|
S.empty = new S([], []);
|
|
2783
|
-
S.removeOverlap =
|
|
2783
|
+
S.removeOverlap = it;
|
|
2784
2784
|
const O = S.empty;
|
|
2785
2785
|
class G {
|
|
2786
2786
|
constructor(e) {
|
|
@@ -2821,7 +2821,7 @@ class G {
|
|
|
2821
2821
|
n.push(s[r]);
|
|
2822
2822
|
}
|
|
2823
2823
|
}
|
|
2824
|
-
return n ?
|
|
2824
|
+
return n ? it(o ? n : n.sort(ie)) : de;
|
|
2825
2825
|
}
|
|
2826
2826
|
// Create a group for the given array of decoration sets, or return
|
|
2827
2827
|
// a single set when possible.
|
|
@@ -2840,7 +2840,7 @@ class G {
|
|
|
2840
2840
|
this.members[n].forEachSet(e);
|
|
2841
2841
|
}
|
|
2842
2842
|
}
|
|
2843
|
-
function
|
|
2843
|
+
function Ko(t, e, n, o, i, s, r) {
|
|
2844
2844
|
let l = t.slice();
|
|
2845
2845
|
for (let c = 0, d = s; c < n.maps.length; c++) {
|
|
2846
2846
|
let f = 0;
|
|
@@ -2850,8 +2850,8 @@ function Ho(t, e, n, o, i, s, r) {
|
|
|
2850
2850
|
let V = l[y + 1];
|
|
2851
2851
|
if (V < 0 || u > V + d - f)
|
|
2852
2852
|
continue;
|
|
2853
|
-
let
|
|
2854
|
-
p >=
|
|
2853
|
+
let z = l[y] + d - f;
|
|
2854
|
+
p >= z ? l[y + 1] = u <= z ? -2 : -1 : u >= d && m && (l[y] += m, l[y + 1] += m);
|
|
2855
2855
|
}
|
|
2856
2856
|
f += m;
|
|
2857
2857
|
}), d = n.maps[c].map(d, -1);
|
|
@@ -2876,7 +2876,7 @@ function Ho(t, e, n, o, i, s, r) {
|
|
|
2876
2876
|
a = !0;
|
|
2877
2877
|
}
|
|
2878
2878
|
if (a) {
|
|
2879
|
-
let c =
|
|
2879
|
+
let c = Ho(l, t, e, n, i, s, r), d = Pe(c, o, 0, r);
|
|
2880
2880
|
e = d.local;
|
|
2881
2881
|
for (let f = 0; f < l.length; f += 3)
|
|
2882
2882
|
l[f + 1] < 0 && (l.splice(f, 3), f -= 3);
|
|
@@ -2889,17 +2889,17 @@ function Ho(t, e, n, o, i, s, r) {
|
|
|
2889
2889
|
}
|
|
2890
2890
|
return new S(e.sort(ie), l);
|
|
2891
2891
|
}
|
|
2892
|
-
function
|
|
2892
|
+
function gn(t, e) {
|
|
2893
2893
|
if (!e || !t.length)
|
|
2894
2894
|
return t;
|
|
2895
2895
|
let n = [];
|
|
2896
2896
|
for (let o = 0; o < t.length; o++) {
|
|
2897
2897
|
let i = t[o];
|
|
2898
|
-
n.push(new
|
|
2898
|
+
n.push(new L(i.from + e, i.to + e, i.type));
|
|
2899
2899
|
}
|
|
2900
2900
|
return n;
|
|
2901
2901
|
}
|
|
2902
|
-
function
|
|
2902
|
+
function Ho(t, e, n, o, i, s, r) {
|
|
2903
2903
|
function l(a, c) {
|
|
2904
2904
|
for (let d = 0; d < a.local.length; d++) {
|
|
2905
2905
|
let f = a.local[d].map(o, i, c);
|
|
@@ -2912,7 +2912,7 @@ function Wo(t, e, n, o, i, s, r) {
|
|
|
2912
2912
|
t[a + 1] == -1 && l(t[a + 2], e[a] + s + 1);
|
|
2913
2913
|
return n;
|
|
2914
2914
|
}
|
|
2915
|
-
function
|
|
2915
|
+
function yn(t, e, n) {
|
|
2916
2916
|
if (e.isLeaf)
|
|
2917
2917
|
return null;
|
|
2918
2918
|
let o = n + e.nodeSize, i = null;
|
|
@@ -2920,23 +2920,23 @@ function bn(t, e, n) {
|
|
|
2920
2920
|
(r = t[s]) && r.from > n && r.to < o && ((i || (i = [])).push(r), t[s] = null);
|
|
2921
2921
|
return i;
|
|
2922
2922
|
}
|
|
2923
|
-
function
|
|
2923
|
+
function bn(t) {
|
|
2924
2924
|
let e = [];
|
|
2925
2925
|
for (let n = 0; n < t.length; n++)
|
|
2926
2926
|
t[n] != null && e.push(t[n]);
|
|
2927
2927
|
return e;
|
|
2928
2928
|
}
|
|
2929
|
-
function
|
|
2929
|
+
function Pe(t, e, n, o) {
|
|
2930
2930
|
let i = [], s = !1;
|
|
2931
2931
|
e.forEach((l, a) => {
|
|
2932
|
-
let c =
|
|
2932
|
+
let c = yn(t, l, a + n);
|
|
2933
2933
|
if (c) {
|
|
2934
2934
|
s = !0;
|
|
2935
|
-
let d =
|
|
2935
|
+
let d = Pe(c, l, n + a + 1, o);
|
|
2936
2936
|
d != O && i.push(a, a + l.nodeSize, d);
|
|
2937
2937
|
}
|
|
2938
2938
|
});
|
|
2939
|
-
let r =
|
|
2939
|
+
let r = gn(s ? bn(t) : t, -n).sort(ie);
|
|
2940
2940
|
for (let l = 0; l < r.length; l++)
|
|
2941
2941
|
r[l].type.valid(e, r[l]) || (o.onRemove && o.onRemove(r[l].spec), r.splice(l--, 1));
|
|
2942
2942
|
return r.length || i.length ? new S(r, i) : O;
|
|
@@ -2944,7 +2944,7 @@ function Ve(t, e, n, o) {
|
|
|
2944
2944
|
function ie(t, e) {
|
|
2945
2945
|
return t.from - e.from || t.to - e.to;
|
|
2946
2946
|
}
|
|
2947
|
-
function
|
|
2947
|
+
function it(t) {
|
|
2948
2948
|
let e = t;
|
|
2949
2949
|
for (let n = 0; n < e.length - 1; n++) {
|
|
2950
2950
|
let o = e[n];
|
|
@@ -2952,37 +2952,37 @@ function st(t) {
|
|
|
2952
2952
|
for (let i = n + 1; i < e.length; i++) {
|
|
2953
2953
|
let s = e[i];
|
|
2954
2954
|
if (s.from == o.from) {
|
|
2955
|
-
s.to != o.to && (e == t && (e = t.slice()), e[i] = s.copy(s.from, o.to),
|
|
2955
|
+
s.to != o.to && (e == t && (e = t.slice()), e[i] = s.copy(s.from, o.to), Tt(e, i + 1, s.copy(o.to, s.to)));
|
|
2956
2956
|
continue;
|
|
2957
2957
|
} else {
|
|
2958
|
-
s.from < o.to && (e == t && (e = t.slice()), e[n] = o.copy(o.from, s.from),
|
|
2958
|
+
s.from < o.to && (e == t && (e = t.slice()), e[n] = o.copy(o.from, s.from), Tt(e, i, o.copy(s.from, o.to)));
|
|
2959
2959
|
break;
|
|
2960
2960
|
}
|
|
2961
2961
|
}
|
|
2962
2962
|
}
|
|
2963
2963
|
return e;
|
|
2964
2964
|
}
|
|
2965
|
-
function
|
|
2965
|
+
function Tt(t, e, n) {
|
|
2966
2966
|
for (; e < t.length && ie(n, t[e]) > 0; )
|
|
2967
2967
|
e++;
|
|
2968
2968
|
t.splice(e, 0, n);
|
|
2969
2969
|
}
|
|
2970
|
-
function
|
|
2970
|
+
function $e(t) {
|
|
2971
2971
|
let e = [];
|
|
2972
2972
|
return t.someProp("decorations", (n) => {
|
|
2973
2973
|
let o = n(t.state);
|
|
2974
2974
|
o && o != O && e.push(o);
|
|
2975
2975
|
}), t.cursorWrapper && e.push(S.create(t.state.doc, [t.cursorWrapper.deco])), G.from(e);
|
|
2976
2976
|
}
|
|
2977
|
-
const
|
|
2977
|
+
const Wo = {
|
|
2978
2978
|
childList: !0,
|
|
2979
2979
|
characterData: !0,
|
|
2980
2980
|
characterDataOldValue: !0,
|
|
2981
2981
|
attributes: !0,
|
|
2982
2982
|
attributeOldValue: !0,
|
|
2983
2983
|
subtree: !0
|
|
2984
|
-
},
|
|
2985
|
-
class
|
|
2984
|
+
}, _o = P && J <= 11;
|
|
2985
|
+
class jo {
|
|
2986
2986
|
constructor() {
|
|
2987
2987
|
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
|
|
2988
2988
|
}
|
|
@@ -2996,13 +2996,13 @@ class Uo {
|
|
|
2996
2996
|
return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
|
|
2997
2997
|
}
|
|
2998
2998
|
}
|
|
2999
|
-
class
|
|
2999
|
+
class Uo {
|
|
3000
3000
|
constructor(e, n) {
|
|
3001
|
-
this.view = e, this.handleDOMChange = n, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new
|
|
3001
|
+
this.view = e, this.handleDOMChange = n, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new jo(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((o) => {
|
|
3002
3002
|
for (let i = 0; i < o.length; i++)
|
|
3003
3003
|
this.queue.push(o[i]);
|
|
3004
3004
|
P && J <= 11 && o.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
|
|
3005
|
-
}),
|
|
3005
|
+
}), _o && (this.onCharData = (o) => {
|
|
3006
3006
|
this.queue.push({ target: o.target, type: "characterData", oldValue: o.prevValue }), this.flushSoon();
|
|
3007
3007
|
}), this.onSelectionChange = this.onSelectionChange.bind(this);
|
|
3008
3008
|
}
|
|
@@ -3015,7 +3015,7 @@ class Yo {
|
|
|
3015
3015
|
this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
|
|
3016
3016
|
}
|
|
3017
3017
|
start() {
|
|
3018
|
-
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom,
|
|
3018
|
+
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, Wo)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
|
|
3019
3019
|
}
|
|
3020
3020
|
stop() {
|
|
3021
3021
|
if (this.observer) {
|
|
@@ -3039,9 +3039,9 @@ class Yo {
|
|
|
3039
3039
|
this.suppressingSelectionUpdates = !0, setTimeout(() => this.suppressingSelectionUpdates = !1, 50);
|
|
3040
3040
|
}
|
|
3041
3041
|
onSelectionChange() {
|
|
3042
|
-
if (
|
|
3042
|
+
if (Dt(this.view)) {
|
|
3043
3043
|
if (this.suppressingSelectionUpdates)
|
|
3044
|
-
return
|
|
3044
|
+
return _(this.view);
|
|
3045
3045
|
if (P && J <= 11 && !this.view.state.selection.empty) {
|
|
3046
3046
|
let e = this.view.domSelectionRange();
|
|
3047
3047
|
if (e.focusNode && re(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
|
|
@@ -3057,9 +3057,9 @@ class Yo {
|
|
|
3057
3057
|
if (!e.focusNode)
|
|
3058
3058
|
return !0;
|
|
3059
3059
|
let n = /* @__PURE__ */ new Set(), o;
|
|
3060
|
-
for (let s = e.focusNode; s; s =
|
|
3060
|
+
for (let s = e.focusNode; s; s = he(s))
|
|
3061
3061
|
n.add(s);
|
|
3062
|
-
for (let s = e.anchorNode; s; s =
|
|
3062
|
+
for (let s = e.anchorNode; s; s = he(s))
|
|
3063
3063
|
if (n.has(s)) {
|
|
3064
3064
|
o = s;
|
|
3065
3065
|
break;
|
|
@@ -3083,7 +3083,7 @@ class Yo {
|
|
|
3083
3083
|
return;
|
|
3084
3084
|
let n = this.pendingRecords();
|
|
3085
3085
|
n.length && (this.queue = []);
|
|
3086
|
-
let o = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(o) &&
|
|
3086
|
+
let o = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(o) && Dt(e) && !this.ignoreSelectionChange(o), s = -1, r = -1, l = !1, a = [];
|
|
3087
3087
|
if (e.editable)
|
|
3088
3088
|
for (let d = 0; d < n.length; d++) {
|
|
3089
3089
|
let f = this.registerMutation(n[d], a);
|
|
@@ -3098,12 +3098,12 @@ class Yo {
|
|
|
3098
3098
|
let { focusNode: f } = this.currentSelection;
|
|
3099
3099
|
for (let u of d) {
|
|
3100
3100
|
let p = u.parentNode;
|
|
3101
|
-
p && p.nodeName == "LI" && (!f ||
|
|
3101
|
+
p && p.nodeName == "LI" && (!f || Xo(e, f) != p) && u.remove();
|
|
3102
3102
|
}
|
|
3103
3103
|
}
|
|
3104
3104
|
}
|
|
3105
3105
|
let c = null;
|
|
3106
|
-
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 &&
|
|
3106
|
+
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Re(o) && (c = Qe(e)) && c.eq(be.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, _(e), this.currentSelection.set(o), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, r), Yo(e)), this.handleDOMChange(s, r, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(o) || _(e), this.currentSelection.set(o));
|
|
3107
3107
|
}
|
|
3108
3108
|
registerMutation(e, n) {
|
|
3109
3109
|
if (n.indexOf(e.target) > -1)
|
|
@@ -3138,31 +3138,31 @@ class Yo {
|
|
|
3138
3138
|
});
|
|
3139
3139
|
}
|
|
3140
3140
|
}
|
|
3141
|
-
let
|
|
3142
|
-
function
|
|
3143
|
-
if (!
|
|
3144
|
-
if (t.requiresGeckoHackNode = I,
|
|
3141
|
+
let At = /* @__PURE__ */ new WeakMap(), Et = !1;
|
|
3142
|
+
function Yo(t) {
|
|
3143
|
+
if (!At.has(t) && (At.set(t, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace) !== -1)) {
|
|
3144
|
+
if (t.requiresGeckoHackNode = I, Et)
|
|
3145
3145
|
return;
|
|
3146
|
-
console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),
|
|
3146
|
+
console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), Et = !0;
|
|
3147
3147
|
}
|
|
3148
3148
|
}
|
|
3149
|
-
function
|
|
3149
|
+
function Pt(t, e) {
|
|
3150
3150
|
let n = e.startContainer, o = e.startOffset, i = e.endContainer, s = e.endOffset, r = t.domAtPos(t.state.selection.anchor);
|
|
3151
3151
|
return re(r.node, r.offset, i, s) && ([n, o, i, s] = [i, s, n, o]), { anchorNode: n, anchorOffset: o, focusNode: i, focusOffset: s };
|
|
3152
3152
|
}
|
|
3153
|
-
function
|
|
3153
|
+
function Go(t, e) {
|
|
3154
3154
|
if (e.getComposedRanges) {
|
|
3155
3155
|
let i = e.getComposedRanges(t.root)[0];
|
|
3156
3156
|
if (i)
|
|
3157
|
-
return
|
|
3157
|
+
return Pt(t, i);
|
|
3158
3158
|
}
|
|
3159
3159
|
let n;
|
|
3160
3160
|
function o(i) {
|
|
3161
3161
|
i.preventDefault(), i.stopImmediatePropagation(), n = i.getTargetRanges()[0];
|
|
3162
3162
|
}
|
|
3163
|
-
return t.dom.addEventListener("beforeinput", o, !0), document.execCommand("indent"), t.dom.removeEventListener("beforeinput", o, !0), n ?
|
|
3163
|
+
return t.dom.addEventListener("beforeinput", o, !0), document.execCommand("indent"), t.dom.removeEventListener("beforeinput", o, !0), n ? Pt(t, n) : null;
|
|
3164
3164
|
}
|
|
3165
|
-
function
|
|
3165
|
+
function Xo(t, e) {
|
|
3166
3166
|
for (let n = e.parentNode; n && n != t.dom; n = n.parentNode) {
|
|
3167
3167
|
let o = t.docView.nearestDesc(n, !0);
|
|
3168
3168
|
if (o && o.node.isBlock)
|
|
@@ -3170,9 +3170,9 @@ function Jo(t, e) {
|
|
|
3170
3170
|
}
|
|
3171
3171
|
return null;
|
|
3172
3172
|
}
|
|
3173
|
-
function
|
|
3173
|
+
function Jo(t, e, n) {
|
|
3174
3174
|
let { node: o, fromOffset: i, toOffset: s, from: r, to: l } = t.docView.parseRange(e, n), a = t.domSelectionRange(), c, d = a.anchorNode;
|
|
3175
|
-
if (d && t.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }],
|
|
3175
|
+
if (d && t.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], Re(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), M && t.input.lastKeyCode === 8)
|
|
3176
3176
|
for (let m = s; m > i; m--) {
|
|
3177
3177
|
let y = o.childNodes[m - 1], V = y.pmViewDesc;
|
|
3178
3178
|
if (y.nodeName == "BR" && !V) {
|
|
@@ -3182,7 +3182,7 @@ function Zo(t, e, n) {
|
|
|
3182
3182
|
if (!V || V.size)
|
|
3183
3183
|
break;
|
|
3184
3184
|
}
|
|
3185
|
-
let f = t.state.doc, u = t.someProp("domParser") ||
|
|
3185
|
+
let f = t.state.doc, u = t.someProp("domParser") || $t.fromSchema(t.state.schema), p = f.resolve(r), h = null, g = u.parse(o, {
|
|
3186
3186
|
topNode: p.parent,
|
|
3187
3187
|
topMatch: p.parent.contentMatchAt(p.index()),
|
|
3188
3188
|
topOpen: !0,
|
|
@@ -3190,7 +3190,7 @@ function Zo(t, e, n) {
|
|
|
3190
3190
|
to: s,
|
|
3191
3191
|
preserveWhitespace: p.parent.type.whitespace == "pre" ? "full" : !0,
|
|
3192
3192
|
findPositions: c,
|
|
3193
|
-
ruleFromNode:
|
|
3193
|
+
ruleFromNode: Zo,
|
|
3194
3194
|
context: p
|
|
3195
3195
|
});
|
|
3196
3196
|
if (c && c[0].pos != null) {
|
|
@@ -3199,7 +3199,7 @@ function Zo(t, e, n) {
|
|
|
3199
3199
|
}
|
|
3200
3200
|
return { doc: g, sel: h, from: r, to: l };
|
|
3201
3201
|
}
|
|
3202
|
-
function
|
|
3202
|
+
function Zo(t) {
|
|
3203
3203
|
let e = t.pmViewDesc;
|
|
3204
3204
|
if (e)
|
|
3205
3205
|
return e.parseRule();
|
|
@@ -3213,13 +3213,13 @@ function Qo(t) {
|
|
|
3213
3213
|
return { ignore: !0 };
|
|
3214
3214
|
return null;
|
|
3215
3215
|
}
|
|
3216
|
-
const
|
|
3217
|
-
function
|
|
3216
|
+
const Qo = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
3217
|
+
function wo(t, e, n, o, i) {
|
|
3218
3218
|
let s = t.input.compositionPendingChanges || (t.composing ? t.input.compositionID : 0);
|
|
3219
3219
|
if (t.input.compositionPendingChanges = 0, e < 0) {
|
|
3220
|
-
let b = t.input.lastSelectionTime > Date.now() - 50 ? t.input.lastSelectionOrigin : null, N =
|
|
3220
|
+
let b = t.input.lastSelectionTime > Date.now() - 50 ? t.input.lastSelectionOrigin : null, N = Qe(t, b);
|
|
3221
3221
|
if (N && !t.state.selection.eq(N)) {
|
|
3222
|
-
if (M &&
|
|
3222
|
+
if (M && W && t.input.lastKeyCode === 13 && Date.now() - 100 < t.input.lastKeyCodeTime && t.someProp("handleKeyDown", (Dn) => Dn(t, ee(13, "Enter"))))
|
|
3223
3223
|
return;
|
|
3224
3224
|
let E = t.state.tr.setSelection(N);
|
|
3225
3225
|
b == "pointer" ? E.setMeta("pointer", !0) : b == "key" && E.scrollIntoView(), s && E.setMeta("composition", s), t.dispatch(E);
|
|
@@ -3228,10 +3228,10 @@ function vo(t, e, n, o, i) {
|
|
|
3228
3228
|
}
|
|
3229
3229
|
let r = t.state.doc.resolve(e), l = r.sharedDepth(n);
|
|
3230
3230
|
e = r.before(l + 1), n = t.state.doc.resolve(n).after(l + 1);
|
|
3231
|
-
let a = t.state.selection, c =
|
|
3231
|
+
let a = t.state.selection, c = Jo(t, e, n), d = t.state.doc, f = d.slice(c.from, c.to), u, p;
|
|
3232
3232
|
t.input.lastKeyCode === 8 && Date.now() - 100 < t.input.lastKeyCodeTime ? (u = t.state.selection.to, p = "end") : (u = t.state.selection.from, p = "start"), t.input.lastKeyCode = null;
|
|
3233
|
-
let h =
|
|
3234
|
-
if (h && t.input.domChangeCount++, (
|
|
3233
|
+
let h = ti(f.content, c.doc.content, c.from, u, p);
|
|
3234
|
+
if (h && t.input.domChangeCount++, (ue && t.input.lastIOSEnter > Date.now() - 225 || W) && i.some((b) => b.nodeType == 1 && !Qo.test(b.nodeName)) && (!h || h.endA >= h.endB) && t.someProp("handleKeyDown", (b) => b(t, ee(13, "Enter")))) {
|
|
3235
3235
|
t.input.lastIOSEnter = 0;
|
|
3236
3236
|
return;
|
|
3237
3237
|
}
|
|
@@ -3240,7 +3240,7 @@ function vo(t, e, n, o, i) {
|
|
|
3240
3240
|
h = { start: a.from, endA: a.to, endB: a.to };
|
|
3241
3241
|
else {
|
|
3242
3242
|
if (c.sel) {
|
|
3243
|
-
let b =
|
|
3243
|
+
let b = Vt(t, t.state.doc, c.sel);
|
|
3244
3244
|
if (b && !b.eq(t.state.selection)) {
|
|
3245
3245
|
let N = t.state.tr.setSelection(b);
|
|
3246
3246
|
s && N.setMeta("composition", s), t.dispatch(N);
|
|
@@ -3249,50 +3249,51 @@ function vo(t, e, n, o, i) {
|
|
|
3249
3249
|
return;
|
|
3250
3250
|
}
|
|
3251
3251
|
t.state.selection.from < t.state.selection.to && h.start == h.endB && t.state.selection instanceof x && (h.start > t.state.selection.from && h.start <= t.state.selection.from + 2 && t.state.selection.from >= c.from ? h.start = t.state.selection.from : h.endA < t.state.selection.to && h.endA >= t.state.selection.to - 2 && t.state.selection.to <= c.to && (h.endB += t.state.selection.to - h.endA, h.endA = t.state.selection.to)), P && J <= 11 && h.endB == h.start + 1 && h.endA == h.start && h.start > c.from && c.doc.textBetween(h.start - c.from - 1, h.start - c.from + 1) == " " && (h.start--, h.endA--, h.endB--);
|
|
3252
|
-
let g = c.doc.resolveNoCache(h.start - c.from), m = c.doc.resolveNoCache(h.endB - c.from), y = d.resolve(h.start), V = g.sameParent(m) && g.parent.inlineContent && y.end() >= h.endA
|
|
3253
|
-
if ((
|
|
3252
|
+
let g = c.doc.resolveNoCache(h.start - c.from), m = c.doc.resolveNoCache(h.endB - c.from), y = d.resolve(h.start), V = g.sameParent(m) && g.parent.inlineContent && y.end() >= h.endA;
|
|
3253
|
+
if ((ue && t.input.lastIOSEnter > Date.now() - 225 && (!V || i.some((b) => b.nodeName == "DIV" || b.nodeName == "P")) || !V && g.pos < c.doc.content.size && (!g.sameParent(m) || !g.parent.inlineContent) && g.pos < m.pos && !/\S/.test(c.doc.textBetween(g.pos, m.pos, "", ""))) && t.someProp("handleKeyDown", (b) => b(t, ee(13, "Enter")))) {
|
|
3254
3254
|
t.input.lastIOSEnter = 0;
|
|
3255
3255
|
return;
|
|
3256
3256
|
}
|
|
3257
|
-
if (t.state.selection.anchor > h.start &&
|
|
3258
|
-
|
|
3257
|
+
if (t.state.selection.anchor > h.start && ei(d, h.start, h.endA, g, m) && t.someProp("handleKeyDown", (b) => b(t, ee(8, "Backspace")))) {
|
|
3258
|
+
W && M && t.domObserver.suppressSelectionUpdates();
|
|
3259
3259
|
return;
|
|
3260
3260
|
}
|
|
3261
|
-
M && h.endB == h.start && (t.input.lastChromeDelete = Date.now()),
|
|
3261
|
+
M && h.endB == h.start && (t.input.lastChromeDelete = Date.now()), W && !V && g.start() != m.start() && m.parentOffset == 0 && g.depth == m.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == h.endA && (h.endB -= 2, m = c.doc.resolveNoCache(h.endB - c.from), setTimeout(() => {
|
|
3262
3262
|
t.someProp("handleKeyDown", function(b) {
|
|
3263
3263
|
return b(t, ee(13, "Enter"));
|
|
3264
3264
|
});
|
|
3265
3265
|
}, 20));
|
|
3266
|
-
let
|
|
3267
|
-
let N = b || t.state.tr.replace(
|
|
3266
|
+
let z = h.start, v = h.endA, pe = (b) => {
|
|
3267
|
+
let N = b || t.state.tr.replace(z, v, c.doc.slice(h.start - c.from, h.endB - c.from));
|
|
3268
3268
|
if (c.sel) {
|
|
3269
|
-
let E =
|
|
3270
|
-
E && !(M && t.composing && E.empty && (h.start != h.endB || t.input.lastChromeDelete < Date.now() - 100) && (E.head ==
|
|
3269
|
+
let E = Vt(t, N.doc, c.sel);
|
|
3270
|
+
E && !(M && t.composing && E.empty && (h.start != h.endB || t.input.lastChromeDelete < Date.now() - 100) && (E.head == z || E.head == N.mapping.map(v) - 1) || P && E.empty && E.head == z) && N.setSelection(E);
|
|
3271
3271
|
}
|
|
3272
3272
|
return s && N.setMeta("composition", s), N.scrollIntoView();
|
|
3273
|
-
},
|
|
3274
|
-
if (V)
|
|
3273
|
+
}, xe;
|
|
3274
|
+
if (V)
|
|
3275
3275
|
if (g.pos == m.pos) {
|
|
3276
|
-
P && J <= 11 && g.parentOffset == 0 && (t.domObserver.suppressSelectionUpdates(), setTimeout(() =>
|
|
3277
|
-
let b =
|
|
3276
|
+
P && J <= 11 && g.parentOffset == 0 && (t.domObserver.suppressSelectionUpdates(), setTimeout(() => _(t), 20));
|
|
3277
|
+
let b = pe(t.state.tr.delete(z, v)), N = d.resolve(h.start).marksAcross(d.resolve(h.endA));
|
|
3278
3278
|
N && b.ensureMarks(N), t.dispatch(b);
|
|
3279
3279
|
} else if (
|
|
3280
3280
|
// Adding or removing a mark
|
|
3281
|
-
h.endA == h.endB && (
|
|
3281
|
+
h.endA == h.endB && (xe = vo(g.parent.content.cut(g.parentOffset, m.parentOffset), y.parent.content.cut(y.parentOffset, h.endA - y.start())))
|
|
3282
3282
|
) {
|
|
3283
|
-
let b =
|
|
3284
|
-
|
|
3283
|
+
let b = pe(t.state.tr);
|
|
3284
|
+
xe.type == "add" ? b.addMark(z, v, xe.mark) : b.removeMark(z, v, xe.mark), t.dispatch(b);
|
|
3285
3285
|
} else if (g.parent.child(g.index()).isText && g.index() == m.index() - (m.textOffset ? 0 : 1)) {
|
|
3286
|
-
let b = g.parent.textBetween(g.parentOffset, m.parentOffset), N = () =>
|
|
3287
|
-
t.someProp("handleTextInput", (E) => E(t,
|
|
3288
|
-
}
|
|
3289
|
-
|
|
3290
|
-
|
|
3286
|
+
let b = g.parent.textBetween(g.parentOffset, m.parentOffset), N = () => pe(t.state.tr.insertText(b, z, v));
|
|
3287
|
+
t.someProp("handleTextInput", (E) => E(t, z, v, b, N)) || t.dispatch(N());
|
|
3288
|
+
} else
|
|
3289
|
+
t.dispatch(pe());
|
|
3290
|
+
else
|
|
3291
|
+
t.dispatch(pe());
|
|
3291
3292
|
}
|
|
3292
|
-
function
|
|
3293
|
-
return Math.max(n.anchor, n.head) > e.content.size ? null :
|
|
3293
|
+
function Vt(t, e, n) {
|
|
3294
|
+
return Math.max(n.anchor, n.head) > e.content.size ? null : we(t, e.resolve(n.anchor), e.resolve(n.head));
|
|
3294
3295
|
}
|
|
3295
|
-
function
|
|
3296
|
+
function vo(t, e) {
|
|
3296
3297
|
let n = t.firstChild.marks, o = e.firstChild.marks, i = n, s = o, r, l, a;
|
|
3297
3298
|
for (let d = 0; d < o.length; d++)
|
|
3298
3299
|
i = o[d].removeFromSet(i);
|
|
@@ -3307,14 +3308,14 @@ function ei(t, e) {
|
|
|
3307
3308
|
let c = [];
|
|
3308
3309
|
for (let d = 0; d < e.childCount; d++)
|
|
3309
3310
|
c.push(a(e.child(d)));
|
|
3310
|
-
if (
|
|
3311
|
+
if (j.from(c).eq(t))
|
|
3311
3312
|
return { mark: l, type: r };
|
|
3312
3313
|
}
|
|
3313
|
-
function
|
|
3314
|
+
function ei(t, e, n, o, i) {
|
|
3314
3315
|
if (
|
|
3315
3316
|
// The content must have shrunk
|
|
3316
3317
|
n - e <= i.pos - o.pos || // newEnd must point directly at or after the end of the block that newStart points into
|
|
3317
|
-
|
|
3318
|
+
qe(o, !0, !1) < i.pos
|
|
3318
3319
|
)
|
|
3319
3320
|
return !1;
|
|
3320
3321
|
let s = t.resolve(e);
|
|
@@ -3324,10 +3325,10 @@ function ti(t, e, n, o, i) {
|
|
|
3324
3325
|
}
|
|
3325
3326
|
if (s.parentOffset < s.parent.content.size || !s.parent.isTextblock)
|
|
3326
3327
|
return !1;
|
|
3327
|
-
let r = t.resolve(
|
|
3328
|
-
return !r.parent.isTextblock || r.pos > n ||
|
|
3328
|
+
let r = t.resolve(qe(s, !0, !0));
|
|
3329
|
+
return !r.parent.isTextblock || r.pos > n || qe(r, !0, !1) < n ? !1 : o.parent.content.cut(o.parentOffset).eq(r.parent.content);
|
|
3329
3330
|
}
|
|
3330
|
-
function
|
|
3331
|
+
function qe(t, e, n) {
|
|
3331
3332
|
let o = t.depth, i = e ? t.end() : t.pos;
|
|
3332
3333
|
for (; o > 0 && (e || t.indexAfter(o) == t.node(o).childCount); )
|
|
3333
3334
|
o--, i++, e = !1;
|
|
@@ -3338,7 +3339,7 @@ function Ke(t, e, n) {
|
|
|
3338
3339
|
}
|
|
3339
3340
|
return i;
|
|
3340
3341
|
}
|
|
3341
|
-
function
|
|
3342
|
+
function ti(t, e, n, o, i) {
|
|
3342
3343
|
let s = t.findDiffStart(e, n);
|
|
3343
3344
|
if (s == null)
|
|
3344
3345
|
return null;
|
|
@@ -3349,20 +3350,20 @@ function ni(t, e, n, o, i) {
|
|
|
3349
3350
|
}
|
|
3350
3351
|
if (r < s && t.size < e.size) {
|
|
3351
3352
|
let a = o <= s && o >= r ? s - o : 0;
|
|
3352
|
-
s -= a, s && s < e.size &&
|
|
3353
|
+
s -= a, s && s < e.size && Rt(e.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), l = s + (l - r), r = s;
|
|
3353
3354
|
} else if (l < s) {
|
|
3354
3355
|
let a = o <= s && o >= l ? s - o : 0;
|
|
3355
|
-
s -= a, s && s < t.size &&
|
|
3356
|
+
s -= a, s && s < t.size && Rt(t.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), r = s + (r - l), l = s;
|
|
3356
3357
|
}
|
|
3357
3358
|
return { start: s, endA: r, endB: l };
|
|
3358
3359
|
}
|
|
3359
|
-
function
|
|
3360
|
+
function Rt(t) {
|
|
3360
3361
|
if (t.length != 2)
|
|
3361
3362
|
return !1;
|
|
3362
3363
|
let e = t.charCodeAt(0), n = t.charCodeAt(1);
|
|
3363
3364
|
return e >= 56320 && e <= 57343 && n >= 55296 && n <= 56319;
|
|
3364
3365
|
}
|
|
3365
|
-
class
|
|
3366
|
+
class ni {
|
|
3366
3367
|
/**
|
|
3367
3368
|
Create a view. `place` may be a DOM node that the editor should
|
|
3368
3369
|
be appended to, a function that will place it into the document,
|
|
@@ -3371,7 +3372,7 @@ class oi {
|
|
|
3371
3372
|
added to the document.
|
|
3372
3373
|
*/
|
|
3373
3374
|
constructor(e, n) {
|
|
3374
|
-
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new
|
|
3375
|
+
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new No(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = n, this.state = n.state, this.directPlugins = n.plugins || [], this.directPlugins.forEach(Lt), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Ft(this), It(this), this.nodeViews = zt(this), this.docView = ut(this.state.doc, Bt(this), $e(this), this.dom, this), this.domObserver = new Uo(this, (o, i, s, r) => wo(this, o, i, s, r)), this.domObserver.start(), So(this), this.updatePluginViews();
|
|
3375
3376
|
}
|
|
3376
3377
|
/**
|
|
3377
3378
|
Holds `true` when a
|
|
@@ -3399,9 +3400,9 @@ class oi {
|
|
|
3399
3400
|
the DOM.
|
|
3400
3401
|
*/
|
|
3401
3402
|
update(e) {
|
|
3402
|
-
e.handleDOMEvents != this._props.handleDOMEvents &&
|
|
3403
|
+
e.handleDOMEvents != this._props.handleDOMEvents && Je(this);
|
|
3403
3404
|
let n = this._props;
|
|
3404
|
-
this._props = e, e.plugins && (e.plugins.forEach(
|
|
3405
|
+
this._props = e, e.plugins && (e.plugins.forEach(Lt), this.directPlugins = e.plugins), this.updateStateInner(e.state, n);
|
|
3405
3406
|
}
|
|
3406
3407
|
/**
|
|
3407
3408
|
Update the view by updating existing props object with the object
|
|
@@ -3427,26 +3428,26 @@ class oi {
|
|
|
3427
3428
|
updateStateInner(e, n) {
|
|
3428
3429
|
var o;
|
|
3429
3430
|
let i = this.state, s = !1, r = !1;
|
|
3430
|
-
e.storedMarks && this.composing && (
|
|
3431
|
+
e.storedMarks && this.composing && (hn(this), r = !0), this.state = e;
|
|
3431
3432
|
let l = i.plugins != e.plugins || this._props.plugins != n.plugins;
|
|
3432
3433
|
if (l || this._props.plugins != n.plugins || this._props.nodeViews != n.nodeViews) {
|
|
3433
|
-
let p =
|
|
3434
|
-
|
|
3434
|
+
let p = zt(this);
|
|
3435
|
+
ii(p, this.nodeViews) && (this.nodeViews = p, s = !0);
|
|
3435
3436
|
}
|
|
3436
|
-
(l || n.handleDOMEvents != this._props.handleDOMEvents) &&
|
|
3437
|
-
let a =
|
|
3437
|
+
(l || n.handleDOMEvents != this._props.handleDOMEvents) && Je(this), this.editable = Ft(this), It(this);
|
|
3438
|
+
let a = $e(this), c = Bt(this), d = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", f = s || !this.docView.matchesNode(e.doc, c, a);
|
|
3438
3439
|
(f || !e.selection.eq(i.selection)) && (r = !0);
|
|
3439
|
-
let u = d == "preserve" && r && this.dom.style.overflowAnchor == null &&
|
|
3440
|
+
let u = d == "preserve" && r && this.dom.style.overflowAnchor == null && In(this);
|
|
3440
3441
|
if (r) {
|
|
3441
3442
|
this.domObserver.stop();
|
|
3442
|
-
let p = f && (P || M) && !this.composing && !i.selection.empty && !e.selection.empty &&
|
|
3443
|
+
let p = f && (P || M) && !this.composing && !i.selection.empty && !e.selection.empty && oi(i.selection, e.selection);
|
|
3443
3444
|
if (f) {
|
|
3444
3445
|
let h = M ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
3445
|
-
this.composing && (this.input.compositionNode =
|
|
3446
|
+
this.composing && (this.input.compositionNode = Io(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ut(e.doc, c, a, this.dom, this)), h && !this.trackWrites && (p = !0);
|
|
3446
3447
|
}
|
|
3447
|
-
p || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) &&
|
|
3448
|
+
p || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && io(this)) ? _(this, p) : (vt(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
3448
3449
|
}
|
|
3449
|
-
this.updatePluginViews(i), !((o = this.dragging) === null || o === void 0) && o.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : u &&
|
|
3450
|
+
this.updatePluginViews(i), !((o = this.dragging) === null || o === void 0) && o.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : u && Fn(u);
|
|
3450
3451
|
}
|
|
3451
3452
|
/**
|
|
3452
3453
|
@internal
|
|
@@ -3456,9 +3457,9 @@ class oi {
|
|
|
3456
3457
|
if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode))) {
|
|
3457
3458
|
if (!this.someProp("handleScrollToSelection", (n) => n(this))) if (this.state.selection instanceof D) {
|
|
3458
3459
|
let n = this.docView.domAfterPos(this.state.selection.from);
|
|
3459
|
-
n.nodeType == 1 &&
|
|
3460
|
+
n.nodeType == 1 && lt(this, n.getBoundingClientRect(), e);
|
|
3460
3461
|
} else
|
|
3461
|
-
|
|
3462
|
+
lt(this, this.coordsAtPos(this.state.selection.head, 1), e);
|
|
3462
3463
|
}
|
|
3463
3464
|
}
|
|
3464
3465
|
destroyPluginViews() {
|
|
@@ -3491,7 +3492,7 @@ class oi {
|
|
|
3491
3492
|
let s = o.from + (this.state.doc.content.size - n.doc.content.size);
|
|
3492
3493
|
(s > 0 && this.state.doc.nodeAt(s)) == o.node && (i = s);
|
|
3493
3494
|
}
|
|
3494
|
-
this.dragging = new
|
|
3495
|
+
this.dragging = new pn(e.slice, e.move, i < 0 ? void 0 : D.create(this.state.doc, i));
|
|
3495
3496
|
}
|
|
3496
3497
|
someProp(e, n) {
|
|
3497
3498
|
let o = this._props && this._props[e], i;
|
|
@@ -3533,7 +3534,7 @@ class oi {
|
|
|
3533
3534
|
Focus the editor.
|
|
3534
3535
|
*/
|
|
3535
3536
|
focus() {
|
|
3536
|
-
this.domObserver.stop(), this.editable &&
|
|
3537
|
+
this.domObserver.stop(), this.editable && zn(this.dom), _(this), this.domObserver.start();
|
|
3537
3538
|
}
|
|
3538
3539
|
/**
|
|
3539
3540
|
Get the document root in which the editor exists. This will
|
|
@@ -3567,7 +3568,7 @@ class oi {
|
|
|
3567
3568
|
the top level, not in any node.
|
|
3568
3569
|
*/
|
|
3569
3570
|
posAtCoords(e) {
|
|
3570
|
-
return
|
|
3571
|
+
return Hn(this, e);
|
|
3571
3572
|
}
|
|
3572
3573
|
/**
|
|
3573
3574
|
Returns the viewport rectangle at a given document position.
|
|
@@ -3578,7 +3579,7 @@ class oi {
|
|
|
3578
3579
|
otherwise the element after.
|
|
3579
3580
|
*/
|
|
3580
3581
|
coordsAtPos(e, n = 1) {
|
|
3581
|
-
return
|
|
3582
|
+
return Ut(this, e, n);
|
|
3582
3583
|
}
|
|
3583
3584
|
/**
|
|
3584
3585
|
Find the DOM position that corresponds to the given document
|
|
@@ -3632,7 +3633,7 @@ class oi {
|
|
|
3632
3633
|
pass a different state.
|
|
3633
3634
|
*/
|
|
3634
3635
|
endOfTextblock(e, n) {
|
|
3635
|
-
return
|
|
3636
|
+
return Yn(this, n || this.state, e);
|
|
3636
3637
|
}
|
|
3637
3638
|
/**
|
|
3638
3639
|
Run the editor's paste logic with the given HTML string. The
|
|
@@ -3657,14 +3658,14 @@ class oi {
|
|
|
3657
3658
|
[`transformCopied`](https://prosemirror.net/docs/ref/#view.EditorProps.transformCopied)).
|
|
3658
3659
|
*/
|
|
3659
3660
|
serializeForClipboard(e) {
|
|
3660
|
-
return
|
|
3661
|
+
return ve(this, e);
|
|
3661
3662
|
}
|
|
3662
3663
|
/**
|
|
3663
3664
|
Removes the editor from the DOM and destroys all [node
|
|
3664
3665
|
views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
3665
3666
|
*/
|
|
3666
3667
|
destroy() {
|
|
3667
|
-
this.docView && (
|
|
3668
|
+
this.docView && (Co(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], $e(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, On());
|
|
3668
3669
|
}
|
|
3669
3670
|
/**
|
|
3670
3671
|
This is true when the view has been
|
|
@@ -3678,14 +3679,14 @@ class oi {
|
|
|
3678
3679
|
Used for testing.
|
|
3679
3680
|
*/
|
|
3680
3681
|
dispatchEvent(e) {
|
|
3681
|
-
return
|
|
3682
|
+
return Mo(this, e);
|
|
3682
3683
|
}
|
|
3683
3684
|
/**
|
|
3684
3685
|
@internal
|
|
3685
3686
|
*/
|
|
3686
3687
|
domSelectionRange() {
|
|
3687
3688
|
let e = this.domSelection();
|
|
3688
|
-
return e ? k && this.root.nodeType === 11 &&
|
|
3689
|
+
return e ? k && this.root.nodeType === 11 && An(this.dom.ownerDocument) == this.dom && Go(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
|
|
3689
3690
|
}
|
|
3690
3691
|
/**
|
|
3691
3692
|
@internal
|
|
@@ -3694,33 +3695,33 @@ class oi {
|
|
|
3694
3695
|
return this.root.getSelection();
|
|
3695
3696
|
}
|
|
3696
3697
|
}
|
|
3697
|
-
|
|
3698
|
+
ni.prototype.dispatch = function(t) {
|
|
3698
3699
|
let e = this._props.dispatchTransaction;
|
|
3699
3700
|
e ? e.call(this, t) : this.updateState(this.state.apply(t));
|
|
3700
3701
|
};
|
|
3701
|
-
function
|
|
3702
|
+
function Bt(t) {
|
|
3702
3703
|
let e = /* @__PURE__ */ Object.create(null);
|
|
3703
3704
|
return e.class = "ProseMirror", e.contenteditable = String(t.editable), t.someProp("attributes", (n) => {
|
|
3704
3705
|
if (typeof n == "function" && (n = n(t.state)), n)
|
|
3705
3706
|
for (let o in n)
|
|
3706
3707
|
o == "class" ? e.class += " " + n[o] : o == "style" ? e.style = (e.style ? e.style + ";" : "") + n[o] : !e[o] && o != "contenteditable" && o != "nodeName" && (e[o] = String(n[o]));
|
|
3707
|
-
}), e.translate || (e.translate = "no"), [
|
|
3708
|
+
}), e.translate || (e.translate = "no"), [L.node(0, t.state.doc.content.size, e)];
|
|
3708
3709
|
}
|
|
3709
|
-
function
|
|
3710
|
+
function It(t) {
|
|
3710
3711
|
if (t.markCursor) {
|
|
3711
3712
|
let e = document.createElement("img");
|
|
3712
|
-
e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), t.cursorWrapper = { dom: e, deco:
|
|
3713
|
+
e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), t.cursorWrapper = { dom: e, deco: L.widget(t.state.selection.from, e, { raw: !0, marks: t.markCursor }) };
|
|
3713
3714
|
} else
|
|
3714
3715
|
t.cursorWrapper = null;
|
|
3715
3716
|
}
|
|
3716
|
-
function
|
|
3717
|
+
function Ft(t) {
|
|
3717
3718
|
return !t.someProp("editable", (e) => e(t.state) === !1);
|
|
3718
3719
|
}
|
|
3719
|
-
function
|
|
3720
|
+
function oi(t, e) {
|
|
3720
3721
|
let n = Math.min(t.$anchor.sharedDepth(t.head), e.$anchor.sharedDepth(e.head));
|
|
3721
3722
|
return t.$anchor.start(n) != e.$anchor.start(n);
|
|
3722
3723
|
}
|
|
3723
|
-
function
|
|
3724
|
+
function zt(t) {
|
|
3724
3725
|
let e = /* @__PURE__ */ Object.create(null);
|
|
3725
3726
|
function n(o) {
|
|
3726
3727
|
for (let i in o)
|
|
@@ -3728,7 +3729,7 @@ function Lt(t) {
|
|
|
3728
3729
|
}
|
|
3729
3730
|
return t.someProp("nodeViews", n), t.someProp("markViews", n), e;
|
|
3730
3731
|
}
|
|
3731
|
-
function
|
|
3732
|
+
function ii(t, e) {
|
|
3732
3733
|
let n = 0, o = 0;
|
|
3733
3734
|
for (let i in t) {
|
|
3734
3735
|
if (t[i] != e[i])
|
|
@@ -3739,12 +3740,12 @@ function si(t, e) {
|
|
|
3739
3740
|
o++;
|
|
3740
3741
|
return n != o;
|
|
3741
3742
|
}
|
|
3742
|
-
function
|
|
3743
|
+
function Lt(t) {
|
|
3743
3744
|
if (t.spec.state || t.spec.filterTransaction || t.spec.appendTransaction)
|
|
3744
3745
|
throw new RangeError("Plugins passed directly to the view must not have a state component");
|
|
3745
3746
|
}
|
|
3746
3747
|
export {
|
|
3747
3748
|
S as D,
|
|
3748
|
-
|
|
3749
|
-
|
|
3749
|
+
ni as E,
|
|
3750
|
+
L as a
|
|
3750
3751
|
};
|