editate 0.6.21 → 0.6.22

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