editate 0.6.20 → 0.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/lib/index.cjs +457 -397
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +414 -352
- package/lib/index.js.map +1 -1
- package/lib/plugins/index.d.ts +1 -0
- package/lib/plugins/scrollToSelection.d.ts +12 -0
- package/package.json +7 -3
package/lib/index.cjs
CHANGED
|
@@ -2,15 +2,15 @@ Object.defineProperty(exports, Symbol.toStringTag, {
|
|
|
2
2
|
value: "Module"
|
|
3
3
|
});
|
|
4
4
|
|
|
5
|
-
var {min: t, max: e} = Math, {keys: n, is:
|
|
5
|
+
var {min: t, max: e} = Math, {keys: n, is: o} = Object, r = t => "string" == typeof t, c = t => "function" == typeof t, s = c(queueMicrotask) ? queueMicrotask : t => {
|
|
6
6
|
Promise.resolve().then(t);
|
|
7
7
|
}, i = t => "text" in t, l = t => "children" in t, a = t => t.some(l), f = new WeakMap, u = ({children: t}, e = 0, n = t.length) => {
|
|
8
|
-
let
|
|
9
|
-
for (let
|
|
10
|
-
const e = t[
|
|
11
|
-
|
|
8
|
+
let o = 0, r = 0;
|
|
9
|
+
for (let c = e; c < n; c++) {
|
|
10
|
+
const e = t[c];
|
|
11
|
+
o += p(e), 0 !== r && l(e) && o++, r++;
|
|
12
12
|
}
|
|
13
|
-
return
|
|
13
|
+
return o;
|
|
14
14
|
}, p = t => {
|
|
15
15
|
if (l(t)) {
|
|
16
16
|
let e = f.get(t);
|
|
@@ -18,35 +18,35 @@ var {min: t, max: e} = Math, {keys: n, is: r} = Object, o = t => "string" == typ
|
|
|
18
18
|
}
|
|
19
19
|
return i(t) ? t.text.length : 1;
|
|
20
20
|
}, d = ({children: t}, e, n) => {
|
|
21
|
-
const
|
|
22
|
-
for (let
|
|
23
|
-
const
|
|
24
|
-
let
|
|
25
|
-
const i = 0 ===
|
|
26
|
-
if (
|
|
27
|
-
e -=
|
|
21
|
+
const o = t.length;
|
|
22
|
+
for (let r = 0; r < o; r++) {
|
|
23
|
+
const o = t[r], c = l(o);
|
|
24
|
+
let s = p(o);
|
|
25
|
+
const i = 0 === s;
|
|
26
|
+
if (c && s++, s > e || s === e && !c && (n || i)) return [ o, e, r ];
|
|
27
|
+
e -= s;
|
|
28
28
|
}
|
|
29
29
|
return null;
|
|
30
|
-
},
|
|
30
|
+
}, h = (t, e) => {
|
|
31
31
|
const n = [];
|
|
32
32
|
for (;t; ) {
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
35
|
-
const
|
|
36
|
-
if (!l(
|
|
37
|
-
e =
|
|
33
|
+
const o = d(t, e);
|
|
34
|
+
if (!o) break;
|
|
35
|
+
const r = o[0];
|
|
36
|
+
if (!l(r)) break;
|
|
37
|
+
e = o[1], t = r, n.push(o[2]);
|
|
38
38
|
}
|
|
39
39
|
return [ t, e, n ];
|
|
40
40
|
}, y = (t, e, n) => {
|
|
41
|
-
const [
|
|
42
|
-
return
|
|
43
|
-
},
|
|
44
|
-
const n = t.children,
|
|
45
|
-
if (
|
|
46
|
-
const [e,
|
|
41
|
+
const [o, r, c] = h(t, e), s = d(o, r, n);
|
|
42
|
+
return s ? (c.push(s[2]), [ s[0], s[1], c ]) : null;
|
|
43
|
+
}, x = (t, e) => {
|
|
44
|
+
const n = t.children, o = d(t, e);
|
|
45
|
+
if (o) {
|
|
46
|
+
const [e, r, c] = o;
|
|
47
47
|
if (l(e)) {
|
|
48
|
-
const [
|
|
49
|
-
return i.push(
|
|
48
|
+
const [o, s] = x(e, r), i = n.slice(0, c), l = n.slice(c + 1);
|
|
49
|
+
return i.push(o), l.unshift(s), [ {
|
|
50
50
|
...t,
|
|
51
51
|
children: i
|
|
52
52
|
}, {
|
|
@@ -55,82 +55,82 @@ var {min: t, max: e} = Math, {keys: n, is: r} = Object, o = t => "string" == typ
|
|
|
55
55
|
} ];
|
|
56
56
|
}
|
|
57
57
|
{
|
|
58
|
-
const
|
|
58
|
+
const o = n.slice(0, c), s = n.slice(c + 1);
|
|
59
59
|
if (i(e)) {
|
|
60
|
-
const t = e.text.slice(0,
|
|
61
|
-
!t &&
|
|
60
|
+
const t = e.text.slice(0, r), n = e.text.slice(r);
|
|
61
|
+
!t && o.length || o.push({
|
|
62
62
|
...e,
|
|
63
63
|
text: t
|
|
64
|
-
}), !n &&
|
|
64
|
+
}), !n && s.length || s.unshift({
|
|
65
65
|
...e,
|
|
66
66
|
text: n
|
|
67
67
|
});
|
|
68
|
-
} else
|
|
68
|
+
} else s.unshift(e);
|
|
69
69
|
return [ {
|
|
70
70
|
...t,
|
|
71
|
-
children:
|
|
71
|
+
children: o
|
|
72
72
|
}, {
|
|
73
73
|
...t,
|
|
74
|
-
children:
|
|
74
|
+
children: s
|
|
75
75
|
} ];
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
const
|
|
78
|
+
const r = n[n.length - 1];
|
|
79
79
|
return [ t, {
|
|
80
80
|
...t,
|
|
81
|
-
children: i(
|
|
82
|
-
...
|
|
81
|
+
children: i(r) ? [ {
|
|
82
|
+
...r,
|
|
83
83
|
text: ""
|
|
84
84
|
} ] : []
|
|
85
85
|
} ];
|
|
86
|
-
},
|
|
87
|
-
let
|
|
88
|
-
for (const
|
|
89
|
-
return
|
|
86
|
+
}, m = (t, [e, n]) => {
|
|
87
|
+
let o = 0;
|
|
88
|
+
for (const r of e) o += u(t, 0, r), 0 !== r && o++, t = t.children[r];
|
|
89
|
+
return o + n;
|
|
90
90
|
}, g = (t, e) => {
|
|
91
|
-
const [, n,
|
|
92
|
-
return [
|
|
93
|
-
},
|
|
91
|
+
const [, n, o] = h(t, e);
|
|
92
|
+
return [ o, n ];
|
|
93
|
+
}, k = (t, [e, n]) => [ m(t, e), m(t, n) ];
|
|
94
94
|
|
|
95
95
|
function* _(t, [e, n]) {
|
|
96
96
|
if (e >= n) return;
|
|
97
97
|
if (!l(t)) return;
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
let
|
|
101
|
-
const
|
|
102
|
-
for (;
|
|
103
|
-
const t = c
|
|
104
|
-
yield [ t,
|
|
98
|
+
const o = d(t, e);
|
|
99
|
+
if (o) {
|
|
100
|
+
let r = e - o[1], c = o[2];
|
|
101
|
+
const s = t.children, i = s.length;
|
|
102
|
+
for (;r <= n && c < i; ) {
|
|
103
|
+
const t = s[c];
|
|
104
|
+
yield [ t, r ], c++, r += p(t), l(t) && r++;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
function* b(t, e) {
|
|
110
|
-
if (l(t)) for (const [n,
|
|
110
|
+
if (l(t)) for (const [n, o] of _(t, e)) for (const t of b(n, [ 0, p(n) ])) t[1] += o,
|
|
111
111
|
yield t; else yield [ t, 0 ];
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
var v = (n,
|
|
115
|
-
let
|
|
116
|
-
for (const [a, f] of b(n, [
|
|
117
|
-
for (let t = f - l; t > 0; t--)
|
|
114
|
+
var v = (n, o = 0, r = 1 / 0, c) => {
|
|
115
|
+
let s = "", l = o;
|
|
116
|
+
for (const [a, f] of b(n, [ o, r ])) {
|
|
117
|
+
for (let t = f - l; t > 0; t--) s += "\n";
|
|
118
118
|
const n = p(a), u = f + n;
|
|
119
119
|
if (i(a)) {
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
} else
|
|
120
|
+
const c = e(f, o) - f, i = t(u, r) - f;
|
|
121
|
+
s += 0 === c && i === n ? a.text : a.text.slice(c, i);
|
|
122
|
+
} else c && (s += c(a));
|
|
123
123
|
l = u;
|
|
124
124
|
}
|
|
125
|
-
for (let e = t(
|
|
126
|
-
return
|
|
127
|
-
}, T = (t, e, n) => e >= n ? [] :
|
|
125
|
+
for (let e = t(r, p(n)) - l; e > 0; e--) s += "\n";
|
|
126
|
+
return s;
|
|
127
|
+
}, T = (t, e, n) => e >= n ? [] : x(x(t, n)[0], e)[1].children, E = ([t, e]) => t > e ? [ e, t ] : [ t, e ], M = ([t, e]) => t === e, S = ([t, e], [n, o]) => t < o && n < e;
|
|
128
128
|
|
|
129
129
|
function* w(t, e = E(t.selection)) {
|
|
130
130
|
if (M(e)) {
|
|
131
131
|
const n = y(t.doc, e[0])?.[0];
|
|
132
132
|
n && (yield n);
|
|
133
|
-
} else for (const [n,
|
|
133
|
+
} else for (const [n, o] of b(t.doc, e)) S(e, [ o, o + p(n) ]) && (yield n);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
function A(t, e) {
|
|
@@ -142,41 +142,41 @@ function A(t, e) {
|
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
var O = t => 1 === t.nodeType, R = t => 8 === t.nodeType, D = new Map([ [ "BR", 1 ], [ "WBR", 1 ], [ "AREA", 2 ], [ "BASE", 2 ], [ "DATALIST", 2 ], [ "HEAD", 2 ], [ "LINK", 2 ], [ "META", 2 ], [ "RP", 2 ], [ "SCRIPT", 2 ], [ "STYLE", 2 ], [ "TEMPLATE", 2 ], [ "TITLE", 2 ], [ "COLGROUP", 2 ], [ "HR", 3 ], [ "AUDIO", 3 ], [ "CANVAS", 3 ], [ "EMBED", 3 ], [ "IFRAME", 3 ], [ "IMG", 3 ], [ "OBJECT", 3 ], [ "PICTURE", 3 ], [ "VIDEO", 3 ], [ "SVG", 3 ], [ "MATH", 3 ], [ "BUTTON", 3 ], [ "INPUT", 3 ], [ "METER", 3 ], [ "PROGRESS", 3 ], [ "SELECT", 3 ], [ "TEXTAREA", 3 ] ]), B = new Set([ "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "P", "PRE", "LI", "DT", "DD", "TH", "TD" ]), I = t => B.has(t.tagName),
|
|
145
|
+
var O = t => 1 === t.nodeType, R = t => 8 === t.nodeType, D = new Map([ [ "BR", 1 ], [ "WBR", 1 ], [ "AREA", 2 ], [ "BASE", 2 ], [ "DATALIST", 2 ], [ "HEAD", 2 ], [ "LINK", 2 ], [ "META", 2 ], [ "RP", 2 ], [ "SCRIPT", 2 ], [ "STYLE", 2 ], [ "TEMPLATE", 2 ], [ "TITLE", 2 ], [ "COLGROUP", 2 ], [ "HR", 3 ], [ "AUDIO", 3 ], [ "CANVAS", 3 ], [ "EMBED", 3 ], [ "IFRAME", 3 ], [ "IMG", 3 ], [ "OBJECT", 3 ], [ "PICTURE", 3 ], [ "VIDEO", 3 ], [ "SVG", 3 ], [ "MATH", 3 ], [ "BUTTON", 3 ], [ "INPUT", 3 ], [ "METER", 3 ], [ "PROGRESS", 3 ], [ "SELECT", 3 ], [ "TEXTAREA", 3 ] ]), B = new Set([ "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "P", "PRE", "LI", "DT", "DD", "TH", "TD" ]), I = t => B.has(t.tagName), L = (t, e) => t.compareDocumentPosition(e), P = t => t.ownerDocument, H = t => P(t).getSelection(), N = (t, e) => {
|
|
146
146
|
if (t.rangeCount) {
|
|
147
147
|
const n = t.getRangeAt(0);
|
|
148
148
|
if (e.contains(n.commonAncestorContainer)) return n;
|
|
149
149
|
}
|
|
150
|
-
},
|
|
151
|
-
const [
|
|
152
|
-
return O(d) && t !== d ?
|
|
153
|
-
O(y) && t !== y ?
|
|
150
|
+
}, C = (t, e, n, o) => {
|
|
151
|
+
const [r, c] = ((t, [e, n]) => [ g(t, e), g(t, n) ])(n, o), s = P(t), i = M(o), l = o[0] - o[1] > 0, a = l ? r : c, f = F(t, e, l ? c : r), u = i ? f : F(t, e, a), p = s.createRange(), [d, h] = f, [y, x] = u;
|
|
152
|
+
return O(d) && t !== d ? h < 1 ? p.setStartBefore(d) : p.setStartAfter(d) : p.setStart(d, h),
|
|
153
|
+
O(y) && t !== y ? x < 1 ? p.setEndBefore(y) : p.setEndAfter(y) : p.setEnd(y, x),
|
|
154
154
|
p;
|
|
155
|
-
},
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
158
|
-
const
|
|
159
|
-
|
|
155
|
+
}, W = (t, e, n, o, r) => {
|
|
156
|
+
const c = H(t);
|
|
157
|
+
if (r || N(c, t)) {
|
|
158
|
+
const r = C(t, e, n, o), s = o[0] - o[1] > 0;
|
|
159
|
+
c.removeAllRanges(), c.addRange(r), s && (c.collapseToEnd(), c.extend(r.startContainer, r.startOffset));
|
|
160
160
|
}
|
|
161
|
-
},
|
|
161
|
+
}, F = (t, e, [n, o]) => e(({t: e, o: r, i: c, l: s}) => {
|
|
162
162
|
let i, l = 0;
|
|
163
163
|
for (;i = e(); ) if (4 === i) {
|
|
164
|
-
if (l < n.length) for (let t = n[l++]; t > 0; t--)
|
|
164
|
+
if (l < n.length) for (let t = n[l++]; t > 0; t--) r();
|
|
165
165
|
} else {
|
|
166
|
-
const t =
|
|
167
|
-
if (
|
|
168
|
-
|
|
166
|
+
const t = s();
|
|
167
|
+
if (o <= t) return [ c(), o ];
|
|
168
|
+
o -= t;
|
|
169
169
|
}
|
|
170
170
|
return [ t, 0 ];
|
|
171
|
-
}, t),
|
|
172
|
-
let
|
|
173
|
-
if (e ===
|
|
174
|
-
if (O(
|
|
175
|
-
const e = t(
|
|
176
|
-
|
|
171
|
+
}, t), U = (e, n, o, r) => {
|
|
172
|
+
let c = !0;
|
|
173
|
+
if (e === o && !o.hasChildNodes()) return [ [], 0 ];
|
|
174
|
+
if (O(o) && o.hasChildNodes()) {
|
|
175
|
+
const e = t(r, o.childNodes.length - 1);
|
|
176
|
+
o = o.childNodes[e], c = e === r, r = 0;
|
|
177
177
|
}
|
|
178
|
-
return n(({t, u:
|
|
179
|
-
|
|
178
|
+
return n(({t, u: s, p: i, h: l, i: a, l: f, m: u}) => {
|
|
179
|
+
s(o), 4 !== u() && i();
|
|
180
180
|
const p = n(() => {
|
|
181
181
|
const t = [];
|
|
182
182
|
for (;u() && a() !== e; ) {
|
|
@@ -188,49 +188,49 @@ var O = t => 1 === t.nodeType, R = t => 8 === t.nodeType, D = new Map([ [ "BR",
|
|
|
188
188
|
});
|
|
189
189
|
let d = 0;
|
|
190
190
|
for (;t(); ) {
|
|
191
|
-
const t =
|
|
191
|
+
const t = L(o, a());
|
|
192
192
|
if (0 === t || 16 & t) {
|
|
193
|
-
if (
|
|
193
|
+
if (c) break;
|
|
194
194
|
} else if (4 & t) break;
|
|
195
195
|
d += f();
|
|
196
196
|
}
|
|
197
|
-
return [ p, d +
|
|
197
|
+
return [ p, d + r ];
|
|
198
198
|
}, e);
|
|
199
|
-
},
|
|
200
|
-
const
|
|
201
|
-
return [
|
|
199
|
+
}, V = (t, e, {startOffset: n, startContainer: o, endOffset: r, endContainer: c}) => {
|
|
200
|
+
const s = U(t, e, o, n);
|
|
201
|
+
return [ s, o === c && n === r ? s : U(t, e, c, r) ];
|
|
202
202
|
}, q = (t, e, n) => t.split("\n").map(t => ({
|
|
203
203
|
...n,
|
|
204
204
|
children: [ {
|
|
205
205
|
...e,
|
|
206
206
|
text: t
|
|
207
207
|
} ]
|
|
208
|
-
})), z = "delete", G = "insert_text", J = "insert_node",
|
|
209
|
-
const
|
|
210
|
-
return
|
|
211
|
-
},
|
|
208
|
+
})), z = "delete", G = "insert_text", J = "insert_node", Y = (t, e) => {
|
|
209
|
+
const r = n(t);
|
|
210
|
+
return r.length === n(e).length && r.every(n => n in e && ("text" === n || o(t[n], e[n])));
|
|
211
|
+
}, j = (t, e) => {
|
|
212
212
|
if (e.length) {
|
|
213
213
|
const n = t.length;
|
|
214
214
|
if (t.push(...e), n) {
|
|
215
|
-
const e = t[n - 1],
|
|
216
|
-
|
|
217
|
-
let
|
|
218
|
-
for (;
|
|
219
|
-
const e = t[
|
|
220
|
-
t[
|
|
215
|
+
const e = t[n - 1], o = t[n], r = l(e), c = l(o);
|
|
216
|
+
r ? c && ((t, e = 0, n = t.length - 1) => {
|
|
217
|
+
let o = e + 1;
|
|
218
|
+
for (;o <= n; ) {
|
|
219
|
+
const e = t[o - 1], r = t[o];
|
|
220
|
+
t[o - 1] = X(e, r), t.splice(o, 1), n--;
|
|
221
221
|
}
|
|
222
|
-
})(t, n - 1, n) :
|
|
223
|
-
let
|
|
224
|
-
for (;
|
|
225
|
-
const e = t[
|
|
226
|
-
i(e) && i(
|
|
222
|
+
})(t, n - 1, n) : r || c || ((t, e = 0, n = t.length - 1) => {
|
|
223
|
+
let o = e + 1;
|
|
224
|
+
for (;o <= n; ) {
|
|
225
|
+
const e = t[o - 1], r = t[o];
|
|
226
|
+
i(e) && i(r) && Y(e, r) ? (t[o - 1] = {
|
|
227
227
|
...e,
|
|
228
|
-
text: e.text +
|
|
229
|
-
}, t.splice(
|
|
228
|
+
text: e.text + r.text
|
|
229
|
+
}, t.splice(o, 1), n--) : o++;
|
|
230
230
|
}
|
|
231
|
-
for (
|
|
232
|
-
const e = t[
|
|
233
|
-
i(e) && !e.text && t.length > 1 ? (t.splice(
|
|
231
|
+
for (o = e; o <= n; ) {
|
|
232
|
+
const e = t[o];
|
|
233
|
+
i(e) && !e.text && t.length > 1 ? (t.splice(o, 1), n--) : o++;
|
|
234
234
|
}
|
|
235
235
|
})(t, n - 1, n);
|
|
236
236
|
}
|
|
@@ -238,28 +238,25 @@ var O = t => 1 === t.nodeType, R = t => 8 === t.nodeType, D = new Map([ [ "BR",
|
|
|
238
238
|
t.length || t.push({
|
|
239
239
|
text: ""
|
|
240
240
|
});
|
|
241
|
-
},
|
|
241
|
+
}, X = (...t) => ({
|
|
242
242
|
...t[0],
|
|
243
|
-
children: t.reduce((t, e) => (
|
|
244
|
-
}), Z = (t, e, n,
|
|
245
|
-
if (
|
|
246
|
-
const
|
|
247
|
-
return ((
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
children: o
|
|
252
|
-
};
|
|
253
|
-
})(t, o, o, [ Z(t.children[o], e, n, r + 1) ]);
|
|
243
|
+
children: t.reduce((t, e) => (j(t, e.children), t), [])
|
|
244
|
+
}), Z = (t, e, n, o = 0) => {
|
|
245
|
+
if (o < e.length) {
|
|
246
|
+
const r = e[o], c = t.children, s = c.slice();
|
|
247
|
+
return s.splice(r, 1, Z(c[r], e, n, o + 1)), {
|
|
248
|
+
...t,
|
|
249
|
+
children: s
|
|
250
|
+
};
|
|
254
251
|
}
|
|
255
252
|
return n;
|
|
256
|
-
}, K = (t, e, n,
|
|
257
|
-
const [
|
|
258
|
-
a(
|
|
259
|
-
children:
|
|
253
|
+
}, K = (t, e, n, o) => {
|
|
254
|
+
const [r, c] = x(t, e), s = e < n ? x(t, n)[1] : c, i = a(t.children);
|
|
255
|
+
a(o) ? i || (o = X(...o).children) : i && (o = [ {
|
|
256
|
+
children: o
|
|
260
257
|
} ]);
|
|
261
|
-
const l =
|
|
262
|
-
return
|
|
258
|
+
const l = r.children.slice();
|
|
259
|
+
return j(l, o), j(l, s.children), {
|
|
263
260
|
...t,
|
|
264
261
|
children: l
|
|
265
262
|
};
|
|
@@ -267,32 +264,32 @@ var O = t => 1 === t.nodeType, R = t => 8 === t.nodeType, D = new Map([ [ "BR",
|
|
|
267
264
|
switch (e.type) {
|
|
268
265
|
case z:
|
|
269
266
|
{
|
|
270
|
-
const [n,
|
|
271
|
-
if (t >= n) return
|
|
267
|
+
const [n, o] = e.range;
|
|
268
|
+
if (t >= n) return o >= t ? n : t + n - o;
|
|
272
269
|
break;
|
|
273
270
|
}
|
|
274
271
|
|
|
275
272
|
case G:
|
|
276
273
|
{
|
|
277
|
-
const {at: n, text:
|
|
278
|
-
if (t >= n) return t +
|
|
274
|
+
const {at: n, text: o} = e;
|
|
275
|
+
if (t >= n) return t + o.length;
|
|
279
276
|
break;
|
|
280
277
|
}
|
|
281
278
|
|
|
282
279
|
case J:
|
|
283
280
|
{
|
|
284
|
-
const {at: n, fragment:
|
|
281
|
+
const {at: n, fragment: o} = e;
|
|
285
282
|
if (t >= n) return t + p({
|
|
286
|
-
children:
|
|
283
|
+
children: o
|
|
287
284
|
});
|
|
288
285
|
break;
|
|
289
286
|
}
|
|
290
287
|
}
|
|
291
288
|
return t;
|
|
292
|
-
}, et = ([t, e], n) => [ tt(t, n), tt(e, n) ], nt = "undefined" != typeof navigator && /Mac|iP(hone|od|ad)/.test(navigator.platform),
|
|
293
|
-
const n = t.endsWith("+"),
|
|
294
|
-
let
|
|
295
|
-
return
|
|
289
|
+
}, et = ([t, e], n) => [ tt(t, n), tt(e, n) ], nt = "undefined" != typeof navigator && /Mac|iP(hone|od|ad)/.test(navigator.platform), ot = (t, e) => {
|
|
290
|
+
const n = t.endsWith("+"), o = (n ? t.slice(0, -2) : t).split("+"), r = n ? "+" : o.pop(), c = "Space" === r ? " " : r.toLowerCase();
|
|
291
|
+
let s = !1, i = !1, l = !1, a = !1;
|
|
292
|
+
return o.forEach(t => {
|
|
296
293
|
switch (t) {
|
|
297
294
|
case "Ctrl":
|
|
298
295
|
i = !0;
|
|
@@ -311,56 +308,71 @@ var O = t => 1 === t.nodeType, R = t => 8 === t.nodeType, D = new Map([ [ "BR",
|
|
|
311
308
|
break;
|
|
312
309
|
|
|
313
310
|
case "Shift":
|
|
314
|
-
|
|
311
|
+
s = !0;
|
|
315
312
|
}
|
|
316
313
|
}), t => {
|
|
317
|
-
if (t.key.toLowerCase() ===
|
|
314
|
+
if (t.key.toLowerCase() === c && i === t.ctrlKey && l === t.metaKey && s === t.shiftKey && a === t.altKey) return !1 !== e(t);
|
|
318
315
|
};
|
|
319
316
|
};
|
|
320
317
|
|
|
321
|
-
function
|
|
322
|
-
let e = 0,
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
318
|
+
function rt(t) {
|
|
319
|
+
let e = 0, o = 0, r = !1;
|
|
320
|
+
const c = Date.now, s = [ [ t.doc, t.selection, [] ] ], i = () => s[e], l = () => e > 0, a = () => e < s.length - 1, f = e => {
|
|
321
|
+
t.exec(A, e.children);
|
|
322
|
+
const o = e, r = t.doc;
|
|
323
|
+
for (const c of n(o)) "children" !== c && r[c] !== o[c] && t.apply({
|
|
324
|
+
type: "patch_node",
|
|
325
|
+
path: [],
|
|
326
|
+
key: c,
|
|
327
|
+
value: o[c]
|
|
328
|
+
});
|
|
329
|
+
for (const c of n(r)) "children" === c || c in o || t.apply({
|
|
330
|
+
type: "patch_node",
|
|
331
|
+
path: [],
|
|
332
|
+
key: c,
|
|
333
|
+
value: void 0
|
|
334
|
+
});
|
|
335
|
+
}, u = () => {
|
|
336
|
+
if (l()) {
|
|
337
|
+
const n = i()[1];
|
|
326
338
|
e--;
|
|
327
339
|
const o = t.doc;
|
|
328
|
-
r = !0,
|
|
340
|
+
r = !0, f(i()[0]), r = !1, o !== t.doc && (t.selection = n);
|
|
329
341
|
}
|
|
330
|
-
},
|
|
331
|
-
if (
|
|
342
|
+
}, p = () => {
|
|
343
|
+
if (a()) {
|
|
332
344
|
e++;
|
|
333
|
-
const [n, o,
|
|
334
|
-
r = !0,
|
|
345
|
+
const [n, o, c] = i(), s = t.doc;
|
|
346
|
+
r = !0, f(n), r = !1, s !== t.doc && (t.selection = [ $(o[0], c), $(o[1], c) ]);
|
|
335
347
|
}
|
|
336
348
|
};
|
|
337
|
-
t.hook("apply", (
|
|
349
|
+
t.hook("apply", (n, i) => {
|
|
338
350
|
if (r) return;
|
|
339
351
|
const l = t.doc, a = t.selection;
|
|
340
|
-
i(
|
|
352
|
+
i(n);
|
|
341
353
|
const f = t.doc;
|
|
342
354
|
if (l !== f) {
|
|
343
|
-
const t =
|
|
344
|
-
if (0 === e || t -
|
|
355
|
+
const t = c();
|
|
356
|
+
if (0 === e || t - o >= 500) {
|
|
345
357
|
e++;
|
|
346
358
|
const t = [ l, a, [] ];
|
|
347
359
|
e >= s.length ? s.push(t) : s[e] = t;
|
|
348
360
|
}
|
|
349
|
-
|
|
361
|
+
o = t, s[e][0] = f, s[e][2].push(n), s.length > e + 1 && (s.length = e + 1), e > 500 && (e--,
|
|
350
362
|
s.shift());
|
|
351
363
|
}
|
|
352
|
-
}), t.hook("keyboard",
|
|
353
|
-
t.set(
|
|
354
|
-
undo:
|
|
355
|
-
redo:
|
|
356
|
-
undoable:
|
|
357
|
-
redoable:
|
|
364
|
+
}), t.hook("keyboard", ot("Mod+Z", u)), t.hook("keyboard", ot("Shift+Mod+Z", p)),
|
|
365
|
+
t.set(rt, {
|
|
366
|
+
undo: u,
|
|
367
|
+
redo: p,
|
|
368
|
+
undoable: l,
|
|
369
|
+
redoable: a
|
|
358
370
|
});
|
|
359
371
|
}
|
|
360
372
|
|
|
361
|
-
var
|
|
373
|
+
var ct = [], st = () => {}, it = t => {
|
|
362
374
|
throw Error(t);
|
|
363
|
-
}, lt = ({doc: t, readonly: e = !1, schema: n, isBlock:
|
|
375
|
+
}, lt = ({doc: t, readonly: e = !1, schema: n, isBlock: o = I, onWarn: a = console.warn, onError: f = it}) => {
|
|
364
376
|
let u = [ 0, 0 ];
|
|
365
377
|
const p = t => {
|
|
366
378
|
if (!n) return a("An unsafe operation was detected. We recommend using schema option."),
|
|
@@ -373,9 +385,9 @@ var st = [], ct = () => {}, it = t => {
|
|
|
373
385
|
return !1;
|
|
374
386
|
};
|
|
375
387
|
n && !p(t) && f("Invalid document");
|
|
376
|
-
const y = new Map,
|
|
388
|
+
const y = new Map, x = new WeakMap, g = t => y.get(t) || ct, _ = new Map, b = new Set, v = t => {
|
|
377
389
|
const e = _.get(t);
|
|
378
|
-
e && (b.size ||
|
|
390
|
+
e && (b.size || s(() => {
|
|
379
391
|
b.forEach(t => {
|
|
380
392
|
t();
|
|
381
393
|
}), b.clear();
|
|
@@ -386,56 +398,56 @@ var st = [], ct = () => {}, it = t => {
|
|
|
386
398
|
if (!e) if (Array.isArray(t)) for (const e of t) w(e); else w(t);
|
|
387
399
|
return R;
|
|
388
400
|
}, w = e => {
|
|
389
|
-
const n = t,
|
|
390
|
-
let
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
393
|
-
const t =
|
|
394
|
-
|
|
395
|
-
} else if (
|
|
396
|
-
|
|
401
|
+
const n = t, o = g("apply"), r = o.length;
|
|
402
|
+
let c = 0;
|
|
403
|
+
const s = () => {
|
|
404
|
+
if (c < r) {
|
|
405
|
+
const t = c;
|
|
406
|
+
o[c](e, f), t === c && f();
|
|
407
|
+
} else if (c === r) {
|
|
408
|
+
c++;
|
|
397
409
|
try {
|
|
398
|
-
const [n,
|
|
410
|
+
const [n, o] = ((t, e, n) => {
|
|
399
411
|
switch (n.type) {
|
|
400
412
|
case z:
|
|
401
413
|
{
|
|
402
|
-
const [
|
|
403
|
-
Q(t,
|
|
414
|
+
const [o, r] = n.range;
|
|
415
|
+
Q(t, o) && Q(t, r) && o < r && (t = K(t, o, r, []), e = et(e, n));
|
|
404
416
|
break;
|
|
405
417
|
}
|
|
406
418
|
|
|
407
419
|
case G:
|
|
408
420
|
{
|
|
409
|
-
const {at:
|
|
410
|
-
if (Q(t,
|
|
411
|
-
const [
|
|
421
|
+
const {at: o, text: r} = n;
|
|
422
|
+
if (Q(t, o) && r) {
|
|
423
|
+
const [c, s] = h(t, o), l = d(c, s, !0);
|
|
412
424
|
let a;
|
|
413
425
|
if (l) {
|
|
414
426
|
const t = l[0];
|
|
415
427
|
i(t) && (a = t);
|
|
416
428
|
}
|
|
417
|
-
t = K(t,
|
|
429
|
+
t = K(t, o, o, q(r, a, c)), e = et(e, n);
|
|
418
430
|
}
|
|
419
431
|
break;
|
|
420
432
|
}
|
|
421
433
|
|
|
422
434
|
case J:
|
|
423
435
|
{
|
|
424
|
-
const {at:
|
|
425
|
-
Q(t,
|
|
436
|
+
const {at: o, fragment: r} = n;
|
|
437
|
+
Q(t, o) && r.length && (t = K(t, o, o, r), e = et(e, n));
|
|
426
438
|
break;
|
|
427
439
|
}
|
|
428
440
|
|
|
429
441
|
case "format":
|
|
430
442
|
{
|
|
431
|
-
const {range: [e,
|
|
432
|
-
if (Q(t, e) && Q(t,
|
|
433
|
-
const [{children: n}, ,
|
|
443
|
+
const {range: [e, o], key: r, value: c} = n;
|
|
444
|
+
if (Q(t, e) && Q(t, o) && e <= o) if (e === o) {
|
|
445
|
+
const [{children: n}, , o] = h(t, e);
|
|
434
446
|
if (1 === n.length) {
|
|
435
447
|
const e = n[0];
|
|
436
|
-
i(e) && !e.text && (t = Z(t, [ ...
|
|
448
|
+
i(e) && !e.text && (t = Z(t, [ ...o, 0 ], {
|
|
437
449
|
...e,
|
|
438
|
-
[
|
|
450
|
+
[r]: c
|
|
439
451
|
}));
|
|
440
452
|
}
|
|
441
453
|
} else {
|
|
@@ -444,37 +456,37 @@ var st = [], ct = () => {}, it = t => {
|
|
|
444
456
|
children: t.children.map(n)
|
|
445
457
|
} : i(t) ? {
|
|
446
458
|
...t,
|
|
447
|
-
[
|
|
459
|
+
[r]: c
|
|
448
460
|
} : t;
|
|
449
|
-
t = K(t, e,
|
|
461
|
+
t = K(t, e, o, T(t, e, o).map(n));
|
|
450
462
|
}
|
|
451
463
|
break;
|
|
452
464
|
}
|
|
453
465
|
|
|
454
466
|
case "patch_node":
|
|
455
467
|
{
|
|
456
|
-
const {path: e, key:
|
|
468
|
+
const {path: e, key: o, value: r} = n, c = ((t, e) => {
|
|
457
469
|
for (let n = 0; n < e.length; n++) t = t.children[e[n]];
|
|
458
470
|
return t;
|
|
459
471
|
})(t, e);
|
|
460
|
-
|
|
461
|
-
...
|
|
462
|
-
[
|
|
472
|
+
c && (t = Z(t, e, {
|
|
473
|
+
...c,
|
|
474
|
+
[o]: r
|
|
463
475
|
}));
|
|
464
476
|
break;
|
|
465
477
|
}
|
|
466
478
|
}
|
|
467
479
|
return [ t, e ];
|
|
468
480
|
})(t, u, e);
|
|
469
|
-
(({type: t}) => t !== G && t !== z)(e) && !p(n) || (t = n, A(
|
|
481
|
+
(({type: t}) => t !== G && t !== z)(e) && !p(n) || (t = n, A(o));
|
|
470
482
|
} catch (n) {
|
|
471
483
|
a("rollback operation: " + n);
|
|
472
484
|
}
|
|
473
485
|
}
|
|
474
486
|
}, f = t => {
|
|
475
|
-
t && (e = t),
|
|
487
|
+
t && (e = t), c++, s();
|
|
476
488
|
};
|
|
477
|
-
|
|
489
|
+
s(), n !== t && v("change");
|
|
478
490
|
}, A = e => {
|
|
479
491
|
!((t, [e, n]) => Q(t, e) && Q(t, n))(t, e) || u[0] === e[0] && u[1] === e[1] || (u = e,
|
|
480
492
|
v("selectionchange"));
|
|
@@ -512,197 +524,197 @@ var st = [], ct = () => {}, it = t => {
|
|
|
512
524
|
const n = t(R, ...e);
|
|
513
525
|
return void 0 === n ? R : n;
|
|
514
526
|
},
|
|
515
|
-
get: t => (
|
|
516
|
-
set: (t, e) => (
|
|
527
|
+
get: t => (x.has(t) || f("No value found for key"), x.get(t)),
|
|
528
|
+
set: (t, e) => (x.set(t, e), R),
|
|
517
529
|
input: n => {
|
|
518
|
-
if (!window.InputEvent || !
|
|
519
|
-
|
|
520
|
-
const {contentEditable:
|
|
530
|
+
if (!window.InputEvent || !c(InputEvent.prototype.getTargetRanges)) return a("beforeinput event is not supported."),
|
|
531
|
+
st;
|
|
532
|
+
const {contentEditable: s, role: i, ariaMultiLine: l, ariaReadOnly: f} = n, p = n.style.whiteSpace;
|
|
521
533
|
n.role = "textbox", n.style.whiteSpace = "pre-wrap", n.ariaMultiLine = "true";
|
|
522
|
-
let d = !1,
|
|
523
|
-
const T =
|
|
524
|
-
let n = null,
|
|
525
|
-
const
|
|
526
|
-
if (null !=
|
|
527
|
-
if (
|
|
528
|
-
const t =
|
|
529
|
-
if (t) return
|
|
530
|
-
} else if (O(
|
|
531
|
-
if ("false" ===
|
|
534
|
+
let d = !1, h = null, y = !1, x = !1, _ = !1, b = u, v = null;
|
|
535
|
+
const T = P(n), w = ((t, e) => {
|
|
536
|
+
let n = null, o = null, r = null;
|
|
537
|
+
const c = () => {
|
|
538
|
+
if (null != r) return r;
|
|
539
|
+
if (o) if ((t => 3 === t.nodeType)(o)) {
|
|
540
|
+
const t = o.data;
|
|
541
|
+
if (t) return r = "\n" === t ? i() ? 3 : 5 : 1;
|
|
542
|
+
} else if (O(o)) {
|
|
543
|
+
if ("false" === o.contentEditable) return r = 2;
|
|
532
544
|
{
|
|
533
|
-
const t = D.get(
|
|
534
|
-
if (null != t) return
|
|
535
|
-
if (e(
|
|
545
|
+
const t = D.get(o.tagName);
|
|
546
|
+
if (null != t) return r = 1 === t ? i() ? 3 : 5 : 3 === t ? 2 : 6;
|
|
547
|
+
if (e(o)) return r = 4;
|
|
536
548
|
}
|
|
537
|
-
} else if (!(t => 11 === t.nodeType)(
|
|
538
|
-
return
|
|
539
|
-
},
|
|
540
|
-
const t =
|
|
541
|
-
if (
|
|
542
|
-
const t =
|
|
543
|
-
if (
|
|
544
|
-
return
|
|
549
|
+
} else if (!(t => 11 === t.nodeType)(o)) return r = 6;
|
|
550
|
+
return r = 0;
|
|
551
|
+
}, s = () => {
|
|
552
|
+
const t = c();
|
|
553
|
+
if (r = null, 2 === t || 6 === t) {
|
|
554
|
+
const t = o;
|
|
555
|
+
if (o = n.nextSibling(), !o) for (;(o = n.nextNode()) && t.contains(o); ) ;
|
|
556
|
+
return o;
|
|
545
557
|
}
|
|
546
|
-
return
|
|
558
|
+
return o = n.nextNode();
|
|
547
559
|
}, i = () => {
|
|
548
|
-
const t =
|
|
560
|
+
const t = o.parentNode;
|
|
549
561
|
return a(() => {
|
|
550
|
-
for (
|
|
551
|
-
if (
|
|
552
|
-
if (!t.contains(
|
|
562
|
+
for (r = 0; s(); ) {
|
|
563
|
+
if (c()) return !0;
|
|
564
|
+
if (!t.contains(o)) break;
|
|
553
565
|
}
|
|
554
566
|
return !1;
|
|
555
567
|
});
|
|
556
568
|
}, l = {
|
|
557
569
|
t: () => {
|
|
558
|
-
for (;
|
|
559
|
-
const t =
|
|
570
|
+
for (;s(); ) {
|
|
571
|
+
const t = c();
|
|
560
572
|
if (t && 6 !== t) return t;
|
|
561
573
|
}
|
|
562
574
|
},
|
|
563
|
-
|
|
564
|
-
i: () =>
|
|
575
|
+
m: c,
|
|
576
|
+
i: () => o,
|
|
565
577
|
l: () => {
|
|
566
|
-
const t =
|
|
567
|
-
return 1 === t ?
|
|
578
|
+
const t = c();
|
|
579
|
+
return 1 === t ? o.data.length : 2 === t ? 1 : 0;
|
|
568
580
|
},
|
|
569
581
|
u: t => {
|
|
570
|
-
|
|
582
|
+
r = null, n.currentNode = o = t;
|
|
571
583
|
},
|
|
572
584
|
h: () => {
|
|
573
|
-
for (;(
|
|
585
|
+
for (;(r = null) || (o = n.previousSibling()); ) if (4 === c()) return;
|
|
574
586
|
},
|
|
575
587
|
o: () => {
|
|
576
|
-
for (;(
|
|
588
|
+
for (;(r = null) || (o = n.nextSibling()); ) if (4 === c()) return;
|
|
577
589
|
},
|
|
578
590
|
p: () => {
|
|
579
|
-
for (;(
|
|
591
|
+
for (;(r = null) || (o = n.parentNode()); ) if (4 === c()) return;
|
|
580
592
|
}
|
|
581
|
-
}, a = (e,
|
|
582
|
-
const
|
|
593
|
+
}, a = (e, c) => {
|
|
594
|
+
const s = n, i = o, a = r;
|
|
583
595
|
try {
|
|
584
|
-
return n || (n = t.createTreeWalker(
|
|
596
|
+
return n || (n = t.createTreeWalker(o = c, 5)), e(l);
|
|
585
597
|
} finally {
|
|
586
|
-
n =
|
|
598
|
+
n = s, o = i, r = a, n && i && (n.currentNode = i);
|
|
587
599
|
}
|
|
588
600
|
};
|
|
589
601
|
return a;
|
|
590
|
-
})(T,
|
|
602
|
+
})(T, o), B = () => {
|
|
591
603
|
n.contentEditable = e ? "false" : "true", n.ariaReadOnly = e ? "true" : null;
|
|
592
604
|
};
|
|
593
605
|
B();
|
|
594
606
|
const I = () => {
|
|
595
|
-
|
|
607
|
+
x || n.focus({
|
|
596
608
|
preventScroll: !0
|
|
597
609
|
});
|
|
598
|
-
},
|
|
599
|
-
v = null, u[0] === b[0] && u[1] === b[1] || (
|
|
600
|
-
},
|
|
610
|
+
}, C = () => {
|
|
611
|
+
v = null, u[0] === b[0] && u[1] === b[1] || (W(n, w, t, u), b = u);
|
|
612
|
+
}, F = () => {
|
|
601
613
|
null != v && clearTimeout(v);
|
|
602
614
|
}, q = R.on("change", () => {
|
|
603
|
-
|
|
615
|
+
x || requestAnimationFrame(I);
|
|
604
616
|
}), z = R.on("selectionchange", () => {
|
|
605
|
-
u[0] === b[0] && u[1] === b[1] || (
|
|
617
|
+
u[0] === b[0] && u[1] === b[1] || (F(), v = setTimeout(C, 50));
|
|
606
618
|
}), G = R.on("readonly", B), J = t => {
|
|
607
619
|
for (const e of g("paste")) {
|
|
608
620
|
const n = e(t);
|
|
609
621
|
if (n) return n;
|
|
610
622
|
}
|
|
611
623
|
a("failed to serialize pasted data");
|
|
612
|
-
},
|
|
613
|
-
let n = !1,
|
|
614
|
-
const
|
|
615
|
-
n &&
|
|
616
|
-
},
|
|
617
|
-
|
|
618
|
-
}),
|
|
619
|
-
|
|
624
|
+
}, Y = ((t, e) => {
|
|
625
|
+
let n = !1, o = [];
|
|
626
|
+
const r = t => {
|
|
627
|
+
n && o.push(...t);
|
|
628
|
+
}, c = new MutationObserver(t => {
|
|
629
|
+
r(t), n || e();
|
|
630
|
+
}), s = () => {
|
|
631
|
+
r(c.takeRecords());
|
|
620
632
|
}, i = () => {
|
|
621
|
-
|
|
622
|
-
const t =
|
|
623
|
-
return
|
|
633
|
+
s();
|
|
634
|
+
const t = o;
|
|
635
|
+
return o = [], t;
|
|
624
636
|
};
|
|
625
|
-
return
|
|
637
|
+
return c.observe(t, {
|
|
626
638
|
characterData: !0,
|
|
627
639
|
characterDataOldValue: !0,
|
|
628
640
|
childList: !0,
|
|
629
641
|
subtree: !0
|
|
630
642
|
}), {
|
|
631
|
-
|
|
643
|
+
k: t => {
|
|
632
644
|
let e;
|
|
633
645
|
for (;e = t.pop(); ) if ("childList" === e.type) {
|
|
634
|
-
const {target: t, removedNodes: n, addedNodes:
|
|
635
|
-
for (let e = n.length - 1; e >= 0; e--) t.insertBefore(n[e],
|
|
636
|
-
for (let e =
|
|
646
|
+
const {target: t, removedNodes: n, addedNodes: o, nextSibling: r} = e;
|
|
647
|
+
for (let e = n.length - 1; e >= 0; e--) t.insertBefore(n[e], r);
|
|
648
|
+
for (let e = o.length - 1; e >= 0; e--) t.removeChild(o[e]);
|
|
637
649
|
} else e.target.data = e.oldValue;
|
|
638
650
|
i();
|
|
639
651
|
},
|
|
640
652
|
_: t => {
|
|
641
|
-
!n && t &&
|
|
653
|
+
!n && t && s(), n = t;
|
|
642
654
|
},
|
|
643
655
|
v: i,
|
|
644
656
|
T: () => {
|
|
645
|
-
|
|
657
|
+
o.length = 0, c.disconnect();
|
|
646
658
|
}
|
|
647
659
|
};
|
|
648
660
|
})(n, () => {
|
|
649
|
-
|
|
650
|
-
}),
|
|
651
|
-
A(b =
|
|
652
|
-
const n =
|
|
653
|
-
if (!
|
|
654
|
-
const
|
|
655
|
-
return (0 ===
|
|
661
|
+
F(), W(n, w, t, u);
|
|
662
|
+
}), j = () => {
|
|
663
|
+
A(b = k(t, ((t, e) => {
|
|
664
|
+
const n = H(t), o = N(n, t);
|
|
665
|
+
if (!o) return [ [ [ 0 ], 0 ], [ [ 0 ], 0 ] ];
|
|
666
|
+
const r = V(t, e, o), c = L(n.anchorNode, n.focusNode);
|
|
667
|
+
return (0 === c ? n.anchorOffset > n.focusOffset : 2 & c) ? [ r[1], r[0] ] : r;
|
|
656
668
|
})(n, w)));
|
|
657
|
-
},
|
|
658
|
-
const e =
|
|
659
|
-
|
|
660
|
-
T.addEventListener("selectionchange",
|
|
669
|
+
}, X = () => {
|
|
670
|
+
const e = Y.v();
|
|
671
|
+
Y._(!1), e.length && (Y.k(e), T.removeEventListener("selectionchange", rt), W(n, w, t, u, !0),
|
|
672
|
+
T.addEventListener("selectionchange", rt)), h && (A(h[1]), S(h[0]), h = null), y = !1;
|
|
661
673
|
}, Z = t => {
|
|
662
|
-
if (!y) for (const e of g("keyboard")) if (e(t)) return t.preventDefault(), void
|
|
674
|
+
if (!y) for (const e of g("keyboard")) if (e(t)) return t.preventDefault(), void Y._(!1);
|
|
663
675
|
}, K = () => {
|
|
664
|
-
y ||
|
|
676
|
+
y || X();
|
|
665
677
|
}, Q = e => {
|
|
666
678
|
e.preventDefault();
|
|
667
|
-
const
|
|
668
|
-
if (
|
|
669
|
-
if ("historyUndo" ===
|
|
670
|
-
y ?
|
|
671
|
-
const
|
|
672
|
-
if (
|
|
673
|
-
let
|
|
674
|
-
if (null ==
|
|
679
|
+
const o = e.inputType;
|
|
680
|
+
if (o.startsWith("format")) return;
|
|
681
|
+
if ("historyUndo" === o || "historyRedo" === o) return;
|
|
682
|
+
y ? Y._(!0) : j();
|
|
683
|
+
const r = e.getTargetRanges()[0];
|
|
684
|
+
if (r) {
|
|
685
|
+
let c = "insertParagraph" === o || "insertLineBreak" === o ? "\n" : e.data;
|
|
686
|
+
if (null == c) {
|
|
675
687
|
const t = e.dataTransfer;
|
|
676
|
-
t && (
|
|
688
|
+
t && (c = t.getData("text/plain"));
|
|
677
689
|
}
|
|
678
|
-
|
|
679
|
-
const
|
|
680
|
-
M(i) ||
|
|
690
|
+
h || (h = [ [], u ]);
|
|
691
|
+
const s = h[0], i = k(t, V(n, w, r));
|
|
692
|
+
M(i) || s.push({
|
|
681
693
|
type: "delete",
|
|
682
694
|
range: i
|
|
683
|
-
}),
|
|
695
|
+
}), c && s.push({
|
|
684
696
|
type: "insert_text",
|
|
685
697
|
at: i[0],
|
|
686
|
-
text:
|
|
698
|
+
text: c
|
|
687
699
|
});
|
|
688
700
|
}
|
|
689
|
-
y ||
|
|
701
|
+
y || X();
|
|
690
702
|
}, tt = () => {
|
|
691
|
-
y ||
|
|
703
|
+
y || j(), y = !0;
|
|
692
704
|
}, et = () => {
|
|
693
|
-
|
|
705
|
+
X();
|
|
694
706
|
}, nt = () => {
|
|
695
|
-
|
|
696
|
-
}, rt = () => {
|
|
697
|
-
h = !1;
|
|
707
|
+
x = !0, j();
|
|
698
708
|
}, ot = () => {
|
|
699
|
-
|
|
700
|
-
},
|
|
701
|
-
|
|
709
|
+
x = !1;
|
|
710
|
+
}, rt = () => {
|
|
711
|
+
!x || y || _ || j();
|
|
712
|
+
}, ct = t => {
|
|
713
|
+
if (j(), !M(u)) for (const e of g("copy")) e(t);
|
|
702
714
|
}, it = t => {
|
|
703
|
-
t.preventDefault(),
|
|
715
|
+
t.preventDefault(), ct(t.clipboardData);
|
|
704
716
|
}, lt = t => {
|
|
705
|
-
t.preventDefault(), e || (
|
|
717
|
+
t.preventDefault(), e || (ct(t.clipboardData), S({
|
|
706
718
|
type: "delete",
|
|
707
719
|
range: E(u)
|
|
708
720
|
}));
|
|
@@ -710,11 +722,11 @@ var st = [], ct = () => {}, it = t => {
|
|
|
710
722
|
t.preventDefault();
|
|
711
723
|
const e = J(t.clipboardData);
|
|
712
724
|
if (e) {
|
|
713
|
-
const t = E(u), n = t[0],
|
|
725
|
+
const t = E(u), n = t[0], o = [ {
|
|
714
726
|
type: "delete",
|
|
715
727
|
range: t
|
|
716
728
|
} ];
|
|
717
|
-
|
|
729
|
+
o.push(r(e) ? {
|
|
718
730
|
type: "insert_text",
|
|
719
731
|
at: n,
|
|
720
732
|
text: e
|
|
@@ -722,51 +734,51 @@ var st = [], ct = () => {}, it = t => {
|
|
|
722
734
|
type: "insert_node",
|
|
723
735
|
at: n,
|
|
724
736
|
fragment: e
|
|
725
|
-
}), S(
|
|
737
|
+
}), S(o);
|
|
726
738
|
}
|
|
727
739
|
}, ft = e => {
|
|
728
740
|
e.preventDefault();
|
|
729
|
-
const
|
|
730
|
-
const
|
|
731
|
-
if (
|
|
732
|
-
const
|
|
733
|
-
if (
|
|
734
|
-
} else if (
|
|
735
|
-
const
|
|
736
|
-
if (
|
|
741
|
+
const o = e.dataTransfer, c = ((t, e, {clientX: n, clientY: o}) => {
|
|
742
|
+
const r = P(t);
|
|
743
|
+
if (r.caretPositionFromPoint) {
|
|
744
|
+
const c = r.caretPositionFromPoint(n, o);
|
|
745
|
+
if (c) return U(t, e, c.offsetNode, c.offset);
|
|
746
|
+
} else if (r.caretRangeFromPoint) {
|
|
747
|
+
const c = r.caretRangeFromPoint(n, o);
|
|
748
|
+
if (c) return U(t, e, c.startContainer, c.startOffset);
|
|
737
749
|
}
|
|
738
750
|
})(n, w, e);
|
|
739
|
-
if (
|
|
751
|
+
if (o && c) {
|
|
740
752
|
let e;
|
|
741
753
|
const n = [];
|
|
742
754
|
_ && n.push({
|
|
743
755
|
type: "delete",
|
|
744
756
|
range: E(u)
|
|
745
757
|
});
|
|
746
|
-
const
|
|
747
|
-
if (
|
|
748
|
-
const
|
|
749
|
-
n.push(
|
|
758
|
+
const s = J(o);
|
|
759
|
+
if (s) {
|
|
760
|
+
const o = m(t, c), i = $(o, n);
|
|
761
|
+
n.push(r(s) ? {
|
|
750
762
|
type: "insert_text",
|
|
751
763
|
at: i,
|
|
752
|
-
text:
|
|
764
|
+
text: s
|
|
753
765
|
} : {
|
|
754
766
|
type: "insert_node",
|
|
755
767
|
at: i,
|
|
756
|
-
fragment:
|
|
757
|
-
}), e = [ i, $(
|
|
768
|
+
fragment: s
|
|
769
|
+
}), e = [ i, $(o, n) ];
|
|
758
770
|
}
|
|
759
771
|
S(n), e && A(e);
|
|
760
772
|
}
|
|
761
773
|
_ = !1;
|
|
762
774
|
}, ut = t => {
|
|
763
|
-
_ = !0,
|
|
775
|
+
_ = !0, ct(t.dataTransfer);
|
|
764
776
|
}, pt = () => {
|
|
765
777
|
_ = !1;
|
|
766
778
|
};
|
|
767
|
-
T.addEventListener("selectionchange",
|
|
779
|
+
T.addEventListener("selectionchange", rt), n.addEventListener("keydown", Z), n.addEventListener("input", K),
|
|
768
780
|
n.addEventListener("beforeinput", Q), n.addEventListener("compositionstart", tt),
|
|
769
|
-
n.addEventListener("compositionend", et), n.addEventListener("focus", nt), n.addEventListener("blur",
|
|
781
|
+
n.addEventListener("compositionend", et), n.addEventListener("focus", nt), n.addEventListener("blur", ot),
|
|
770
782
|
n.addEventListener("copy", it), n.addEventListener("cut", lt), n.addEventListener("paste", at),
|
|
771
783
|
n.addEventListener("drop", ft), n.addEventListener("dragstart", ut), n.addEventListener("dragend", pt);
|
|
772
784
|
const dt = [];
|
|
@@ -774,11 +786,11 @@ var st = [], ct = () => {}, it = t => {
|
|
|
774
786
|
const e = t(n, w);
|
|
775
787
|
e && dt.push(e);
|
|
776
788
|
}), () => {
|
|
777
|
-
d || (d = !0, q(), z(), G(), n.contentEditable =
|
|
778
|
-
n.ariaReadOnly = f, n.style.whiteSpace = p,
|
|
789
|
+
d || (d = !0, q(), z(), G(), n.contentEditable = s, n.role = i, n.ariaMultiLine = l,
|
|
790
|
+
n.ariaReadOnly = f, n.style.whiteSpace = p, Y.T(), T.removeEventListener("selectionchange", rt),
|
|
779
791
|
n.removeEventListener("keydown", Z), n.removeEventListener("input", K), n.removeEventListener("beforeinput", Q),
|
|
780
792
|
n.removeEventListener("compositionstart", tt), n.removeEventListener("compositionend", et),
|
|
781
|
-
n.removeEventListener("focus", nt), n.removeEventListener("blur",
|
|
793
|
+
n.removeEventListener("focus", nt), n.removeEventListener("blur", ot), n.removeEventListener("copy", it),
|
|
782
794
|
n.removeEventListener("cut", lt), n.removeEventListener("paste", at), n.removeEventListener("drop", ft),
|
|
783
795
|
n.removeEventListener("dragstart", ut), n.removeEventListener("dragend", pt), dt.forEach(t => {
|
|
784
796
|
t();
|
|
@@ -786,7 +798,7 @@ var st = [], ct = () => {}, it = t => {
|
|
|
786
798
|
};
|
|
787
799
|
}
|
|
788
800
|
};
|
|
789
|
-
return R.exec(
|
|
801
|
+
return R.exec(rt), R;
|
|
790
802
|
};
|
|
791
803
|
|
|
792
804
|
function at(t, e) {
|
|
@@ -796,9 +808,12 @@ function at(t, e) {
|
|
|
796
808
|
}), t.hook("paste", t => t.getData("text/plain"));
|
|
797
809
|
}
|
|
798
810
|
|
|
799
|
-
var ft = "application/x-editate-editor"
|
|
811
|
+
var ft = "application/x-editate-editor", ut = (t, e) => {
|
|
812
|
+
const n = parseFloat(t);
|
|
813
|
+
return n ? t.endsWith("%") ? n / 100 * e : n : 0;
|
|
814
|
+
}, pt = (t, e, n, o) => [ t + ut(n, e), t + e - ut(o, e) ], dt = (t, e, [n, o]) => t < n ? t - n : e > o ? e - o : 0, ht = (t, e, n) => Math.max(-e, Math.min(t, n - e));
|
|
800
815
|
|
|
801
|
-
function
|
|
816
|
+
function yt(t) {
|
|
802
817
|
t.hook("mount", t => {
|
|
803
818
|
t.ariaMultiLine = null;
|
|
804
819
|
}), t.hook("apply", (t, e) => {
|
|
@@ -809,7 +824,7 @@ function ut(t) {
|
|
|
809
824
|
const e = t.fragment;
|
|
810
825
|
t = {
|
|
811
826
|
...t,
|
|
812
|
-
fragment: a(e) ? [
|
|
827
|
+
fragment: a(e) ? [ X(...e) ] : e
|
|
813
828
|
};
|
|
814
829
|
}
|
|
815
830
|
e(t);
|
|
@@ -821,10 +836,10 @@ exports.Delete = function(t, e = E(t.selection)) {
|
|
|
821
836
|
type: "delete",
|
|
822
837
|
range: e
|
|
823
838
|
});
|
|
824
|
-
}, exports.Format = function(t, e, n,
|
|
839
|
+
}, exports.Format = function(t, e, n, o = E(t.selection)) {
|
|
825
840
|
t.apply({
|
|
826
841
|
type: "format",
|
|
827
|
-
range:
|
|
842
|
+
range: o,
|
|
828
843
|
key: e,
|
|
829
844
|
value: n
|
|
830
845
|
});
|
|
@@ -843,9 +858,9 @@ exports.Delete = function(t, e = E(t.selection)) {
|
|
|
843
858
|
text: e
|
|
844
859
|
});
|
|
845
860
|
}, exports.LeavesInRange = w, exports.Redo = function(t) {
|
|
846
|
-
t.get(
|
|
861
|
+
t.get(rt).redo();
|
|
847
862
|
}, exports.Redoable = function(t) {
|
|
848
|
-
return t.get(
|
|
863
|
+
return t.get(rt).redoable();
|
|
849
864
|
}, exports.ReplaceDoc = A, exports.ReplaceText = function(t, e, n = E(t.selection)) {
|
|
850
865
|
t.apply({
|
|
851
866
|
type: "delete",
|
|
@@ -855,56 +870,56 @@ exports.Delete = function(t, e = E(t.selection)) {
|
|
|
855
870
|
at: n[0],
|
|
856
871
|
text: e
|
|
857
872
|
});
|
|
858
|
-
}, exports.SetBlockAttr = function(t, e, n,
|
|
859
|
-
const
|
|
873
|
+
}, exports.SetBlockAttr = function(t, e, n, o = t.selection[0]) {
|
|
874
|
+
const r = h(t.doc, o)[2];
|
|
860
875
|
t.apply({
|
|
861
876
|
type: "patch_node",
|
|
862
|
-
path:
|
|
877
|
+
path: r,
|
|
863
878
|
key: e,
|
|
864
879
|
value: n
|
|
865
880
|
});
|
|
866
|
-
}, exports.SetVoidAttr = function(t, e, n,
|
|
867
|
-
const
|
|
868
|
-
|
|
881
|
+
}, exports.SetVoidAttr = function(t, e, n, o = t.selection[0]) {
|
|
882
|
+
const r = y(t.doc, o, !0);
|
|
883
|
+
r && !i(r[0]) && t.apply({
|
|
869
884
|
type: "patch_node",
|
|
870
|
-
path:
|
|
885
|
+
path: r[2],
|
|
871
886
|
key: e,
|
|
872
887
|
value: n
|
|
873
888
|
});
|
|
874
|
-
}, exports.ToggleBlockAttr = function(t, e, n,
|
|
875
|
-
const [
|
|
889
|
+
}, exports.ToggleBlockAttr = function(t, e, n, o, r = t.selection[0]) {
|
|
890
|
+
const [c, , s] = h(t.doc, r);
|
|
876
891
|
t.apply({
|
|
877
892
|
type: "patch_node",
|
|
878
|
-
path:
|
|
893
|
+
path: s,
|
|
879
894
|
key: e,
|
|
880
|
-
value:
|
|
895
|
+
value: c[e] === n ? o : n
|
|
881
896
|
});
|
|
882
897
|
}, exports.ToggleFormat = function(t, e, n = E(t.selection)) {
|
|
883
|
-
let
|
|
884
|
-
for (const
|
|
885
|
-
|
|
898
|
+
let o = !1, r = !1;
|
|
899
|
+
for (const c of t.exec(w, n)) if (i(c) && (r = !0, !c[e])) {
|
|
900
|
+
o = !0;
|
|
886
901
|
break;
|
|
887
902
|
}
|
|
888
|
-
|
|
903
|
+
r && t.apply({
|
|
889
904
|
type: "format",
|
|
890
905
|
range: n,
|
|
891
906
|
key: e,
|
|
892
|
-
value:
|
|
907
|
+
value: o
|
|
893
908
|
});
|
|
894
909
|
}, exports.Undo = function(t) {
|
|
895
|
-
t.get(
|
|
910
|
+
t.get(rt).undo();
|
|
896
911
|
}, exports.Undoable = function(t) {
|
|
897
|
-
return t.get(
|
|
898
|
-
}, exports.createEditor = lt, exports.createPlainEditor = ({text: t, singleline: e, onChange: n, ...
|
|
899
|
-
const
|
|
900
|
-
...
|
|
912
|
+
return t.get(rt).undoable();
|
|
913
|
+
}, exports.createEditor = lt, exports.createPlainEditor = ({text: t, singleline: e, onChange: n, ...o}) => {
|
|
914
|
+
const r = lt({
|
|
915
|
+
...o,
|
|
901
916
|
doc: {
|
|
902
917
|
children: q(t)
|
|
903
918
|
}
|
|
904
919
|
}).exec(at);
|
|
905
|
-
return e &&
|
|
906
|
-
n(v(
|
|
907
|
-
}),
|
|
920
|
+
return e && r.exec(yt), r.on("change", () => {
|
|
921
|
+
n(v(r.doc));
|
|
922
|
+
}), r;
|
|
908
923
|
}, exports.debugPlugin = function(t) {
|
|
909
924
|
t.hook("apply", t => {
|
|
910
925
|
console.log("apply", t);
|
|
@@ -926,47 +941,47 @@ exports.Delete = function(t, e = E(t.selection)) {
|
|
|
926
941
|
}
|
|
927
942
|
return null;
|
|
928
943
|
});
|
|
929
|
-
}, exports.getChildAt = d, exports.getLeafAt = y, exports.getLeafBlockAt =
|
|
944
|
+
}, exports.getChildAt = d, exports.getLeafAt = y, exports.getLeafBlockAt = h, exports.getNodeSize = p,
|
|
930
945
|
exports.htmlTransferPlugin = function(t, e) {
|
|
931
|
-
t.hook("mount", (n,
|
|
932
|
-
const
|
|
946
|
+
t.hook("mount", (n, o) => {
|
|
947
|
+
const r = t.hook("copy", t => {
|
|
933
948
|
const e = document.createElement("div");
|
|
934
|
-
e.appendChild(
|
|
935
|
-
}),
|
|
949
|
+
e.appendChild(N(H(n), n).cloneContents()), t.setData("text/html", e.innerHTML);
|
|
950
|
+
}), c = t.hook("paste", t => {
|
|
936
951
|
const n = t.getData("text/html");
|
|
937
952
|
return n ? ((t, e, n) => {
|
|
938
|
-
const
|
|
953
|
+
const o = n.text, r = t => {
|
|
939
954
|
const e = n[t.tagName.toLowerCase()];
|
|
940
955
|
if (e) {
|
|
941
956
|
const n = e(t);
|
|
942
957
|
if (n) return n;
|
|
943
958
|
}
|
|
944
959
|
};
|
|
945
|
-
let
|
|
946
|
-
for (const i of [ ...
|
|
947
|
-
|
|
960
|
+
let c = (new DOMParser).parseFromString(t, "text/html").body, s = !1;
|
|
961
|
+
for (const i of [ ...c.childNodes ]) R(i) ? "StartFragment" === i.data ? (s = !0,
|
|
962
|
+
c = new DocumentFragment) : "EndFragment" === i.data && (s = !1) : s && c.appendChild(i);
|
|
948
963
|
return e(({t, i: e}) => {
|
|
949
|
-
let n,
|
|
964
|
+
let n, c = null, s = "", i = !1;
|
|
950
965
|
const l = [], a = () => {
|
|
951
|
-
|
|
966
|
+
s && (c || (c = []), c.push(o(s)), s = "");
|
|
952
967
|
}, f = () => {
|
|
953
|
-
a(), !
|
|
954
|
-
children:
|
|
955
|
-
}),
|
|
968
|
+
a(), !c && i && (c = []), c && l.push({
|
|
969
|
+
children: c
|
|
970
|
+
}), c = null, i = !1;
|
|
956
971
|
};
|
|
957
|
-
for (;n = t(); ) if (4 === n) f(); else if (i = !0, 1 === n)
|
|
972
|
+
for (;n = t(); ) if (4 === n) f(); else if (i = !0, 1 === n) s += e().data; else if (2 === n) {
|
|
958
973
|
a();
|
|
959
|
-
const t =
|
|
960
|
-
t &&
|
|
974
|
+
const t = r(e());
|
|
975
|
+
t && c.push(t);
|
|
961
976
|
} else 3 === n && f();
|
|
962
977
|
return f(), l.length || l.push({
|
|
963
978
|
children: []
|
|
964
979
|
}), l;
|
|
965
|
-
},
|
|
966
|
-
})(n,
|
|
980
|
+
}, c);
|
|
981
|
+
})(n, o, e.serializers) : null;
|
|
967
982
|
});
|
|
968
983
|
return () => {
|
|
969
|
-
|
|
984
|
+
r(), c();
|
|
970
985
|
};
|
|
971
986
|
});
|
|
972
987
|
}, exports.internalTranferPlugin = function(t) {
|
|
@@ -980,29 +995,74 @@ exports.htmlTransferPlugin = function(t, e) {
|
|
|
980
995
|
}
|
|
981
996
|
});
|
|
982
997
|
}, exports.iterLeafBlocks = function* t(e, n) {
|
|
983
|
-
if (!l(e) || a(e.children)) for (const
|
|
984
|
-
const [e, n] =
|
|
985
|
-
for (const
|
|
998
|
+
if (!l(e) || a(e.children)) for (const o of _(e, n)) {
|
|
999
|
+
const [e, n] = o;
|
|
1000
|
+
for (const o of t(e, [ 0, p(e) ])) o[1] += n, yield o;
|
|
986
1001
|
} else yield [ e, 0 ];
|
|
987
1002
|
}, exports.iterLeaves = b, exports.keymapPlugin = function(t, e) {
|
|
988
1003
|
n(e).forEach(n => {
|
|
989
|
-
const
|
|
990
|
-
t.hook("keyboard",
|
|
1004
|
+
const o = e[n];
|
|
1005
|
+
t.hook("keyboard", ot(n, o));
|
|
1006
|
+
});
|
|
1007
|
+
}, exports.plainTransferPlugin = at, exports.scrollToSelectionPlugin = (t, {smooth: e} = {}) => {
|
|
1008
|
+
const n = e ? "smooth" : "auto";
|
|
1009
|
+
t.hook("mount", (e, o) => {
|
|
1010
|
+
const r = P(e), c = r.defaultView, s = ((t, e, n) => {
|
|
1011
|
+
const {body: o, documentElement: r} = e;
|
|
1012
|
+
let c = t;
|
|
1013
|
+
for (;c && c !== o && c !== r; ) {
|
|
1014
|
+
const {overflowY: t} = n.getComputedStyle(c);
|
|
1015
|
+
if ("auto" === t || "scroll" === t || "overlay" === t) return c;
|
|
1016
|
+
c = c.parentElement;
|
|
1017
|
+
}
|
|
1018
|
+
return null;
|
|
1019
|
+
})(e, r, c);
|
|
1020
|
+
let i = null;
|
|
1021
|
+
const l = t.on("change", () => {
|
|
1022
|
+
null == i && (i = setTimeout(() => {
|
|
1023
|
+
i = null;
|
|
1024
|
+
const r = C(e, o, t.doc, t.selection);
|
|
1025
|
+
let l = r.getBoundingClientRect();
|
|
1026
|
+
if (!l.height) {
|
|
1027
|
+
const t = r.startContainer, e = O(t) ? t : t.parentElement;
|
|
1028
|
+
e && (l = e.getBoundingClientRect());
|
|
1029
|
+
}
|
|
1030
|
+
const a = s ? ((t, e, n, o) => {
|
|
1031
|
+
const {scrollLeft: r, scrollTop: c, scrollWidth: s, scrollHeight: i, clientLeft: l, clientTop: a, clientWidth: f, clientHeight: u} = e, p = e.getBoundingClientRect(), d = t.getComputedStyle(e), h = ht(dt(n.top, n.bottom, pt(p.top + a, u, d.scrollPaddingTop, d.scrollPaddingBottom)), c, i - u), y = ht(dt(n.left, n.right, pt(p.left + l, f, d.scrollPaddingLeft, d.scrollPaddingRight)), r, s - f);
|
|
1032
|
+
return (h || y) && e.scrollBy({
|
|
1033
|
+
top: h,
|
|
1034
|
+
left: y,
|
|
1035
|
+
behavior: o
|
|
1036
|
+
}), [ y, h ];
|
|
1037
|
+
})(c, s, l, n) : [ 0, 0 ];
|
|
1038
|
+
((t, e, [n, o], r) => {
|
|
1039
|
+
const {documentElement: c} = t.document, {clientWidth: s, clientHeight: i} = c, l = t.getComputedStyle(c), a = dt(e.top - o, e.bottom - o, pt(0, i, l.scrollPaddingTop, l.scrollPaddingBottom)), f = dt(e.left - n, e.right - n, pt(0, s, l.scrollPaddingLeft, l.scrollPaddingRight));
|
|
1040
|
+
(a || f) && t.scrollBy({
|
|
1041
|
+
top: a,
|
|
1042
|
+
left: f,
|
|
1043
|
+
behavior: r
|
|
1044
|
+
});
|
|
1045
|
+
})(c, l, a, n);
|
|
1046
|
+
}, 50));
|
|
1047
|
+
});
|
|
1048
|
+
return () => {
|
|
1049
|
+
null != i && clearTimeout(i), l();
|
|
1050
|
+
};
|
|
991
1051
|
});
|
|
992
|
-
}, exports.
|
|
993
|
-
t.hook("mount", (n,
|
|
994
|
-
let
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
|
|
1052
|
+
}, exports.selectionRectPlugin = function(t, e) {
|
|
1053
|
+
t.hook("mount", (n, o) => {
|
|
1054
|
+
let r = !0, c = !1;
|
|
1055
|
+
const s = t.on("selectionchange", () => {
|
|
1056
|
+
c || (c = !0, requestAnimationFrame(() => {
|
|
1057
|
+
c = !1, r && e(() => {
|
|
998
1058
|
const e = t.selection;
|
|
999
|
-
return
|
|
1059
|
+
return C(n, o, t.doc, e).getBoundingClientRect();
|
|
1000
1060
|
});
|
|
1001
1061
|
}));
|
|
1002
1062
|
});
|
|
1003
1063
|
return () => {
|
|
1004
|
-
|
|
1064
|
+
r = !1, s();
|
|
1005
1065
|
};
|
|
1006
1066
|
});
|
|
1007
|
-
}, exports.singlelinePlugin =
|
|
1067
|
+
}, exports.singlelinePlugin = yt, exports.sliceText = v;
|
|
1008
1068
|
//# sourceMappingURL=index.cjs.map
|