@alxgrn/prose-editor 0.0.13 → 0.0.14
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/dist/prose-editor.es.js +476 -473
- package/dist/prose-editor.es.js.map +1 -1
- package/dist/prose-editor.umd.js +16 -16
- package/dist/prose-editor.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/prose-editor.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './index.css';var Rf = Object.defineProperty;
|
|
2
2
|
var If = (n, e, t) => e in n ? Rf(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var F = (n, e, t) => If(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import A, { createContext as ct, useLayoutEffect as Pf, useContext as
|
|
4
|
+
import A, { createContext as ct, useLayoutEffect as Pf, useContext as ie, forwardRef as Ge, useState as N, useRef as I, useImperativeHandle as ns, useCallback as He, useMemo as Me, useReducer as vf, memo as Fe, createElement as Hn, useSyncExternalStore as Vf, cloneElement as rs, Component as $f, useEffect as q } from "react";
|
|
5
5
|
import { unstable_batchedUpdates as zf, flushSync as Ri, createPortal as jf } from "react-dom";
|
|
6
6
|
import { Icons as O, Prompt as Ff, Modal as Pa, Form as va, Image as Bf, Input as Pr, Editable as Va, Button as Lf, Menu as Fn } from "@alxgrn/telefrag-ui";
|
|
7
7
|
function Wf(n) {
|
|
@@ -58,11 +58,11 @@ function qf() {
|
|
|
58
58
|
return b.$$typeof === mr ? null : b.displayName || b.name || null;
|
|
59
59
|
if (typeof b == "string") return b;
|
|
60
60
|
switch (b) {
|
|
61
|
-
case
|
|
61
|
+
case R:
|
|
62
62
|
return "Fragment";
|
|
63
|
-
case P:
|
|
64
|
-
return "Portal";
|
|
65
63
|
case z:
|
|
64
|
+
return "Portal";
|
|
65
|
+
case v:
|
|
66
66
|
return "Profiler";
|
|
67
67
|
case B:
|
|
68
68
|
return "StrictMode";
|
|
@@ -75,11 +75,11 @@ function qf() {
|
|
|
75
75
|
switch (typeof b.tag == "number" && console.error(
|
|
76
76
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
77
77
|
), b.$$typeof) {
|
|
78
|
-
case
|
|
78
|
+
case L:
|
|
79
79
|
return (b.displayName || "Context") + ".Provider";
|
|
80
|
-
case
|
|
80
|
+
case D:
|
|
81
81
|
return (b._context.displayName || "Context") + ".Consumer";
|
|
82
|
-
case
|
|
82
|
+
case ee:
|
|
83
83
|
var E = b.render;
|
|
84
84
|
return b = b.displayName, b || (b = E.displayName || E.name || "", b = b !== "" ? "ForwardRef(" + b + ")" : "ForwardRef"), b;
|
|
85
85
|
case $e:
|
|
@@ -105,11 +105,11 @@ function qf() {
|
|
|
105
105
|
}
|
|
106
106
|
if (E) {
|
|
107
107
|
E = console;
|
|
108
|
-
var T = E.error,
|
|
108
|
+
var T = E.error, W = typeof Symbol == "function" && Symbol.toStringTag && b[Symbol.toStringTag] || b.constructor.name || "Object";
|
|
109
109
|
return T.call(
|
|
110
110
|
E,
|
|
111
111
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
112
|
-
|
|
112
|
+
W
|
|
113
113
|
), e(b);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -170,10 +170,10 @@ function qf() {
|
|
|
170
170
|
var T = ws.get(b);
|
|
171
171
|
if (T !== void 0) return T;
|
|
172
172
|
Cs = !0, T = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
|
|
173
|
-
var
|
|
174
|
-
|
|
173
|
+
var W = null;
|
|
174
|
+
W = zt.H, zt.H = null, s();
|
|
175
175
|
try {
|
|
176
|
-
var
|
|
176
|
+
var le = {
|
|
177
177
|
DetermineComponentFrameRoot: function() {
|
|
178
178
|
try {
|
|
179
179
|
if (E) {
|
|
@@ -215,22 +215,22 @@ function qf() {
|
|
|
215
215
|
return [null, null];
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
|
-
|
|
218
|
+
le.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
|
|
219
219
|
var J = Object.getOwnPropertyDescriptor(
|
|
220
|
-
|
|
220
|
+
le.DetermineComponentFrameRoot,
|
|
221
221
|
"name"
|
|
222
222
|
);
|
|
223
223
|
J && J.configurable && Object.defineProperty(
|
|
224
|
-
|
|
224
|
+
le.DetermineComponentFrameRoot,
|
|
225
225
|
"name",
|
|
226
226
|
{ value: "DetermineComponentFrameRoot" }
|
|
227
227
|
);
|
|
228
|
-
var j =
|
|
228
|
+
var j = le.DetermineComponentFrameRoot(), Ze = j[0], ln = j[1];
|
|
229
229
|
if (Ze && ln) {
|
|
230
|
-
var
|
|
230
|
+
var he = Ze.split(`
|
|
231
231
|
`), Ft = ln.split(`
|
|
232
232
|
`);
|
|
233
|
-
for (j = J = 0; J <
|
|
233
|
+
for (j = J = 0; J < he.length && !he[J].includes(
|
|
234
234
|
"DetermineComponentFrameRoot"
|
|
235
235
|
); )
|
|
236
236
|
J++;
|
|
@@ -238,16 +238,16 @@ function qf() {
|
|
|
238
238
|
"DetermineComponentFrameRoot"
|
|
239
239
|
); )
|
|
240
240
|
j++;
|
|
241
|
-
if (J ===
|
|
242
|
-
for (J =
|
|
241
|
+
if (J === he.length || j === Ft.length)
|
|
242
|
+
for (J = he.length - 1, j = Ft.length - 1; 1 <= J && 0 <= j && he[J] !== Ft[j]; )
|
|
243
243
|
j--;
|
|
244
244
|
for (; 1 <= J && 0 <= j; J--, j--)
|
|
245
|
-
if (
|
|
245
|
+
if (he[J] !== Ft[j]) {
|
|
246
246
|
if (J !== 1 || j !== 1)
|
|
247
247
|
do
|
|
248
|
-
if (J--, j--, 0 > j ||
|
|
248
|
+
if (J--, j--, 0 > j || he[J] !== Ft[j]) {
|
|
249
249
|
var Rn = `
|
|
250
|
-
` +
|
|
250
|
+
` + he[J].replace(
|
|
251
251
|
" at new ",
|
|
252
252
|
" at "
|
|
253
253
|
);
|
|
@@ -258,9 +258,9 @@ function qf() {
|
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
} finally {
|
|
261
|
-
Cs = !1, zt.H =
|
|
261
|
+
Cs = !1, zt.H = W, o(), Error.prepareStackTrace = T;
|
|
262
262
|
}
|
|
263
|
-
return
|
|
263
|
+
return he = (he = b ? b.displayName || b.name : "") ? i(he) : "", typeof b == "function" && ws.set(b, he), he;
|
|
264
264
|
}
|
|
265
265
|
function a(b) {
|
|
266
266
|
if (b == null) return "";
|
|
@@ -280,7 +280,7 @@ function qf() {
|
|
|
280
280
|
}
|
|
281
281
|
if (typeof b == "object")
|
|
282
282
|
switch (b.$$typeof) {
|
|
283
|
-
case
|
|
283
|
+
case ee:
|
|
284
284
|
return b = l(b.render, !1), b;
|
|
285
285
|
case $e:
|
|
286
286
|
return a(b.type);
|
|
@@ -322,13 +322,13 @@ function qf() {
|
|
|
322
322
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
323
323
|
)), b = this.props.ref, b !== void 0 ? b : null;
|
|
324
324
|
}
|
|
325
|
-
function h(b, E, T,
|
|
325
|
+
function h(b, E, T, W, le, J) {
|
|
326
326
|
return T = J.ref, b = {
|
|
327
|
-
$$typeof:
|
|
327
|
+
$$typeof: P,
|
|
328
328
|
type: b,
|
|
329
329
|
key: E,
|
|
330
330
|
props: J,
|
|
331
|
-
_owner:
|
|
331
|
+
_owner: le
|
|
332
332
|
}, (T !== void 0 ? T : null) !== null ? Object.defineProperty(b, "ref", {
|
|
333
333
|
enumerable: !1,
|
|
334
334
|
get: d
|
|
@@ -344,14 +344,14 @@ function qf() {
|
|
|
344
344
|
value: null
|
|
345
345
|
}), Object.freeze && (Object.freeze(b.props), Object.freeze(b)), b;
|
|
346
346
|
}
|
|
347
|
-
function p(b, E, T,
|
|
348
|
-
if (typeof b == "string" || typeof b == "function" || b ===
|
|
347
|
+
function p(b, E, T, W, le, J) {
|
|
348
|
+
if (typeof b == "string" || typeof b == "function" || b === R || b === v || b === B || b === dt || b === Ee || b === on || typeof b == "object" && b !== null && (b.$$typeof === $t || b.$$typeof === $e || b.$$typeof === L || b.$$typeof === D || b.$$typeof === ee || b.$$typeof === Tf || b.getModuleId !== void 0)) {
|
|
349
349
|
var j = E.children;
|
|
350
350
|
if (j !== void 0)
|
|
351
|
-
if (
|
|
351
|
+
if (W)
|
|
352
352
|
if (Ss(j)) {
|
|
353
|
-
for (
|
|
354
|
-
y(j[
|
|
353
|
+
for (W = 0; W < j.length; W++)
|
|
354
|
+
y(j[W], b);
|
|
355
355
|
Object.freeze && Object.freeze(j);
|
|
356
356
|
} else
|
|
357
357
|
console.error(
|
|
@@ -359,28 +359,28 @@ function qf() {
|
|
|
359
359
|
);
|
|
360
360
|
else y(j, b);
|
|
361
361
|
} else
|
|
362
|
-
j = "", (b === void 0 || typeof b == "object" && b !== null && Object.keys(b).length === 0) && (j += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), b === null ?
|
|
362
|
+
j = "", (b === void 0 || typeof b == "object" && b !== null && Object.keys(b).length === 0) && (j += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), b === null ? W = "null" : Ss(b) ? W = "array" : b !== void 0 && b.$$typeof === P ? (W = "<" + (n(b.type) || "Unknown") + " />", j = " Did you accidentally export a JSX literal instead of a component?") : W = typeof b, console.error(
|
|
363
363
|
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
|
|
364
|
-
|
|
364
|
+
W,
|
|
365
365
|
j
|
|
366
366
|
);
|
|
367
367
|
if (bi.call(E, "key")) {
|
|
368
368
|
j = n(b);
|
|
369
|
-
var Ze = Object.keys(E).filter(function(
|
|
370
|
-
return
|
|
369
|
+
var Ze = Object.keys(E).filter(function(he) {
|
|
370
|
+
return he !== "key";
|
|
371
371
|
});
|
|
372
|
-
|
|
372
|
+
W = 0 < Ze.length ? "{key: someKey, " + Ze.join(": ..., ") + ": ...}" : "{key: someKey}", Ti[j + W] || (Ze = 0 < Ze.length ? "{" + Ze.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
373
373
|
`A props object containing a "key" prop is being spread into JSX:
|
|
374
374
|
let props = %s;
|
|
375
375
|
<%s {...props} />
|
|
376
376
|
React keys must be passed directly to JSX without using spread:
|
|
377
377
|
let props = %s;
|
|
378
378
|
<%s key={someKey} {...props} />`,
|
|
379
|
-
|
|
379
|
+
W,
|
|
380
380
|
j,
|
|
381
381
|
Ze,
|
|
382
382
|
j
|
|
383
|
-
), Ti[j +
|
|
383
|
+
), Ti[j + W] = !0);
|
|
384
384
|
}
|
|
385
385
|
if (j = null, T !== void 0 && (t(T), j = "" + T), u(E) && (t(E.key), j = "" + E.key), "key" in E) {
|
|
386
386
|
T = {};
|
|
@@ -390,14 +390,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
390
390
|
return j && f(
|
|
391
391
|
T,
|
|
392
392
|
typeof b == "function" ? b.displayName || b.name || "Unknown" : b
|
|
393
|
-
), h(b, j, J,
|
|
393
|
+
), h(b, j, J, le, c(), T);
|
|
394
394
|
}
|
|
395
395
|
function y(b, E) {
|
|
396
396
|
if (typeof b == "object" && b && b.$$typeof !== Af) {
|
|
397
397
|
if (Ss(b))
|
|
398
398
|
for (var T = 0; T < b.length; T++) {
|
|
399
|
-
var
|
|
400
|
-
m(
|
|
399
|
+
var W = b[T];
|
|
400
|
+
m(W) && x(W, E);
|
|
401
401
|
}
|
|
402
402
|
else if (m(b))
|
|
403
403
|
b._store && (b._store.validated = 1);
|
|
@@ -407,22 +407,22 @@ React keys must be passed directly to JSX without using spread:
|
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
function m(b) {
|
|
410
|
-
return typeof b == "object" && b !== null && b.$$typeof ===
|
|
410
|
+
return typeof b == "object" && b !== null && b.$$typeof === P;
|
|
411
411
|
}
|
|
412
412
|
function x(b, E) {
|
|
413
413
|
if (b._store && !b._store.validated && b.key == null && (b._store.validated = 1, E = k(E), !Ai[E])) {
|
|
414
414
|
Ai[E] = !0;
|
|
415
415
|
var T = "";
|
|
416
416
|
b && b._owner != null && b._owner !== c() && (T = null, typeof b._owner.tag == "number" ? T = n(b._owner.type) : typeof b._owner.name == "string" && (T = b._owner.name), T = " It was passed a child from " + T + ".");
|
|
417
|
-
var
|
|
417
|
+
var W = zt.getCurrentStack;
|
|
418
418
|
zt.getCurrentStack = function() {
|
|
419
|
-
var
|
|
420
|
-
return
|
|
419
|
+
var le = a(b.type);
|
|
420
|
+
return W && (le += W() || ""), le;
|
|
421
421
|
}, console.error(
|
|
422
422
|
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
|
423
423
|
E,
|
|
424
424
|
T
|
|
425
|
-
), zt.getCurrentStack =
|
|
425
|
+
), zt.getCurrentStack = W;
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
428
|
function k(b) {
|
|
@@ -433,23 +433,23 @@ Check the render method of \`` + T + "`."), E || (b = n(b)) && (E = `
|
|
|
433
433
|
|
|
434
434
|
Check the top-level render call using <` + b + ">."), E;
|
|
435
435
|
}
|
|
436
|
-
var M = A,
|
|
436
|
+
var M = A, P = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), B = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), D = Symbol.for("react.consumer"), L = Symbol.for("react.context"), ee = Symbol.for("react.forward_ref"), dt = Symbol.for("react.suspense"), Ee = Symbol.for("react.suspense_list"), $e = Symbol.for("react.memo"), $t = Symbol.for("react.lazy"), on = Symbol.for("react.offscreen"), Tn = Symbol.iterator, mr = Symbol.for("react.client.reference"), zt = M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, bi = Object.prototype.hasOwnProperty, jt = Object.assign, Tf = Symbol.for("react.client.reference"), Ss = Array.isArray, An = 0, xi, Si, ki, Ci, wi, Mi, Ni;
|
|
437
437
|
r.__reactDisabledLog = !0;
|
|
438
438
|
var ks, Di, Cs = !1, ws = new (typeof WeakMap == "function" ? WeakMap : Map)(), Af = Symbol.for("react.client.reference"), Oi, Ei = {}, Ti = {}, Ai = {};
|
|
439
|
-
Pn.Fragment =
|
|
440
|
-
return p(b, E, T, !1,
|
|
441
|
-
}, Pn.jsxs = function(b, E, T,
|
|
442
|
-
return p(b, E, T, !0,
|
|
439
|
+
Pn.Fragment = R, Pn.jsx = function(b, E, T, W, le) {
|
|
440
|
+
return p(b, E, T, !1, W, le);
|
|
441
|
+
}, Pn.jsxs = function(b, E, T, W, le) {
|
|
442
|
+
return p(b, E, T, !0, W, le);
|
|
443
443
|
};
|
|
444
444
|
}()), Pn;
|
|
445
445
|
}
|
|
446
446
|
process.env.NODE_ENV === "production" ? eo.exports = _f() : eo.exports = qf();
|
|
447
447
|
var g = eo.exports;
|
|
448
|
-
function
|
|
448
|
+
function te(n) {
|
|
449
449
|
this.content = n;
|
|
450
450
|
}
|
|
451
|
-
|
|
452
|
-
constructor:
|
|
451
|
+
te.prototype = {
|
|
452
|
+
constructor: te,
|
|
453
453
|
find: function(n) {
|
|
454
454
|
for (var e = 0; e < this.content.length; e += 2)
|
|
455
455
|
if (this.content[e] === n) return e;
|
|
@@ -468,7 +468,7 @@ ee.prototype = {
|
|
|
468
468
|
// given, the key of the binding will be replaced with that key.
|
|
469
469
|
update: function(n, e, t) {
|
|
470
470
|
var r = t && t != n ? this.remove(t) : this, s = r.find(n), o = r.content.slice();
|
|
471
|
-
return s == -1 ? o.push(t || n, e) : (o[s + 1] = e, t && (o[s] = t)), new
|
|
471
|
+
return s == -1 ? o.push(t || n, e) : (o[s + 1] = e, t && (o[s] = t)), new te(o);
|
|
472
472
|
},
|
|
473
473
|
// :: (string) → OrderedMap
|
|
474
474
|
// Return a map with the given key removed, if it existed.
|
|
@@ -476,25 +476,25 @@ ee.prototype = {
|
|
|
476
476
|
var e = this.find(n);
|
|
477
477
|
if (e == -1) return this;
|
|
478
478
|
var t = this.content.slice();
|
|
479
|
-
return t.splice(e, 2), new
|
|
479
|
+
return t.splice(e, 2), new te(t);
|
|
480
480
|
},
|
|
481
481
|
// :: (string, any) → OrderedMap
|
|
482
482
|
// Add a new key to the start of the map.
|
|
483
483
|
addToStart: function(n, e) {
|
|
484
|
-
return new
|
|
484
|
+
return new te([n, e].concat(this.remove(n).content));
|
|
485
485
|
},
|
|
486
486
|
// :: (string, any) → OrderedMap
|
|
487
487
|
// Add a new key to the end of the map.
|
|
488
488
|
addToEnd: function(n, e) {
|
|
489
489
|
var t = this.remove(n).content.slice();
|
|
490
|
-
return t.push(n, e), new
|
|
490
|
+
return t.push(n, e), new te(t);
|
|
491
491
|
},
|
|
492
492
|
// :: (string, string, any) → OrderedMap
|
|
493
493
|
// Add a key after the given key. If `place` is not found, the new
|
|
494
494
|
// key is added to the end.
|
|
495
495
|
addBefore: function(n, e, t) {
|
|
496
496
|
var r = this.remove(e), s = r.content.slice(), o = r.find(n);
|
|
497
|
-
return s.splice(o == -1 ? s.length : o, 0, e, t), new
|
|
497
|
+
return s.splice(o == -1 ? s.length : o, 0, e, t), new te(s);
|
|
498
498
|
},
|
|
499
499
|
// :: ((key: string, value: any))
|
|
500
500
|
// Call the given function for each key/value pair in the map, in
|
|
@@ -507,20 +507,20 @@ ee.prototype = {
|
|
|
507
507
|
// Create a new map by prepending the keys in this map that don't
|
|
508
508
|
// appear in `map` before the keys in `map`.
|
|
509
509
|
prepend: function(n) {
|
|
510
|
-
return n =
|
|
510
|
+
return n = te.from(n), n.size ? new te(n.content.concat(this.subtract(n).content)) : this;
|
|
511
511
|
},
|
|
512
512
|
// :: (union<Object, OrderedMap>) → OrderedMap
|
|
513
513
|
// Create a new map by appending the keys in this map that don't
|
|
514
514
|
// appear in `map` after the keys in `map`.
|
|
515
515
|
append: function(n) {
|
|
516
|
-
return n =
|
|
516
|
+
return n = te.from(n), n.size ? new te(this.subtract(n).content.concat(n.content)) : this;
|
|
517
517
|
},
|
|
518
518
|
// :: (union<Object, OrderedMap>) → OrderedMap
|
|
519
519
|
// Create a map containing all the keys in this map that don't
|
|
520
520
|
// appear in `map`.
|
|
521
521
|
subtract: function(n) {
|
|
522
522
|
var e = this;
|
|
523
|
-
n =
|
|
523
|
+
n = te.from(n);
|
|
524
524
|
for (var t = 0; t < n.content.length; t += 2)
|
|
525
525
|
e = e.remove(n.content[t]);
|
|
526
526
|
return e;
|
|
@@ -539,11 +539,11 @@ ee.prototype = {
|
|
|
539
539
|
return this.content.length >> 1;
|
|
540
540
|
}
|
|
541
541
|
};
|
|
542
|
-
|
|
543
|
-
if (n instanceof
|
|
542
|
+
te.from = function(n) {
|
|
543
|
+
if (n instanceof te) return n;
|
|
544
544
|
var e = [];
|
|
545
545
|
if (n) for (var t in n) e.push(t, n[t]);
|
|
546
|
-
return new
|
|
546
|
+
return new te(e);
|
|
547
547
|
};
|
|
548
548
|
function $a(n, e, t) {
|
|
549
549
|
for (let r = 0; ; r++) {
|
|
@@ -875,7 +875,7 @@ function vr(n, e) {
|
|
|
875
875
|
}
|
|
876
876
|
return !0;
|
|
877
877
|
}
|
|
878
|
-
class
|
|
878
|
+
class _ {
|
|
879
879
|
/**
|
|
880
880
|
@internal
|
|
881
881
|
*/
|
|
@@ -973,14 +973,14 @@ class W {
|
|
|
973
973
|
*/
|
|
974
974
|
static setFrom(e) {
|
|
975
975
|
if (!e || Array.isArray(e) && e.length == 0)
|
|
976
|
-
return
|
|
977
|
-
if (e instanceof
|
|
976
|
+
return _.none;
|
|
977
|
+
if (e instanceof _)
|
|
978
978
|
return [e];
|
|
979
979
|
let t = e.slice();
|
|
980
980
|
return t.sort((r, s) => r.type.rank - s.type.rank), t;
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
-
|
|
983
|
+
_.none = [];
|
|
984
984
|
class Vr extends Error {
|
|
985
985
|
}
|
|
986
986
|
class C {
|
|
@@ -1278,7 +1278,7 @@ class Jn {
|
|
|
1278
1278
|
marks() {
|
|
1279
1279
|
let e = this.parent, t = this.index();
|
|
1280
1280
|
if (e.content.size == 0)
|
|
1281
|
-
return
|
|
1281
|
+
return _.none;
|
|
1282
1282
|
if (this.textOffset)
|
|
1283
1283
|
return e.child(t).marks;
|
|
1284
1284
|
let r = e.maybeChild(t - 1), s = e.maybeChild(t);
|
|
@@ -1445,7 +1445,7 @@ class Ne {
|
|
|
1445
1445
|
/**
|
|
1446
1446
|
@internal
|
|
1447
1447
|
*/
|
|
1448
|
-
constructor(e, t, r, s =
|
|
1448
|
+
constructor(e, t, r, s = _.none) {
|
|
1449
1449
|
this.type = e, this.attrs = t, this.marks = s, this.content = r || S.empty;
|
|
1450
1450
|
}
|
|
1451
1451
|
/**
|
|
@@ -1559,7 +1559,7 @@ class Ne {
|
|
|
1559
1559
|
attributes, and marks.
|
|
1560
1560
|
*/
|
|
1561
1561
|
hasMarkup(e, t, r) {
|
|
1562
|
-
return this.type == e && vr(this.attrs, t || e.defaultAttrs || Yf) &&
|
|
1562
|
+
return this.type == e && vr(this.attrs, t || e.defaultAttrs || Yf) && _.sameSet(this.marks, r || _.none);
|
|
1563
1563
|
}
|
|
1564
1564
|
/**
|
|
1565
1565
|
Create a new node with the same markup as this node, containing
|
|
@@ -1769,12 +1769,12 @@ class Ne {
|
|
|
1769
1769
|
*/
|
|
1770
1770
|
check() {
|
|
1771
1771
|
this.type.checkContent(this.content), this.type.checkAttrs(this.attrs);
|
|
1772
|
-
let e =
|
|
1772
|
+
let e = _.none;
|
|
1773
1773
|
for (let t = 0; t < this.marks.length; t++) {
|
|
1774
1774
|
let r = this.marks[t];
|
|
1775
1775
|
r.type.checkAttrs(r.attrs), e = r.addToSet(e);
|
|
1776
1776
|
}
|
|
1777
|
-
if (!
|
|
1777
|
+
if (!_.sameSet(e, this.marks))
|
|
1778
1778
|
throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((t) => t.type.name)}`);
|
|
1779
1779
|
this.content.forEach((t) => t.check());
|
|
1780
1780
|
}
|
|
@@ -2317,7 +2317,7 @@ let zi = class Ga {
|
|
|
2317
2317
|
create(e = null, t, r) {
|
|
2318
2318
|
if (this.isText)
|
|
2319
2319
|
throw new Error("NodeType.create can't construct text nodes");
|
|
2320
|
-
return new Ne(this, this.computeAttrs(e), S.from(t),
|
|
2320
|
+
return new Ne(this, this.computeAttrs(e), S.from(t), _.setFrom(r));
|
|
2321
2321
|
}
|
|
2322
2322
|
/**
|
|
2323
2323
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
|
|
@@ -2325,7 +2325,7 @@ let zi = class Ga {
|
|
|
2325
2325
|
if it doesn't match.
|
|
2326
2326
|
*/
|
|
2327
2327
|
createChecked(e = null, t, r) {
|
|
2328
|
-
return t = S.from(t), this.checkContent(t), new Ne(this, this.computeAttrs(e), t,
|
|
2328
|
+
return t = S.from(t), this.checkContent(t), new Ne(this, this.computeAttrs(e), t, _.setFrom(r));
|
|
2329
2329
|
}
|
|
2330
2330
|
/**
|
|
2331
2331
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
|
|
@@ -2343,7 +2343,7 @@ let zi = class Ga {
|
|
|
2343
2343
|
t = i.append(t);
|
|
2344
2344
|
}
|
|
2345
2345
|
let s = this.contentMatch.matchFragment(t), o = s && s.fillBefore(S.empty, !0);
|
|
2346
|
-
return o ? new Ne(this, e, t.append(o),
|
|
2346
|
+
return o ? new Ne(this, e, t.append(o), _.setFrom(r)) : null;
|
|
2347
2347
|
}
|
|
2348
2348
|
/**
|
|
2349
2349
|
Returns true if the given fragment is valid content for this node
|
|
@@ -2399,7 +2399,7 @@ let zi = class Ga {
|
|
|
2399
2399
|
let t;
|
|
2400
2400
|
for (let r = 0; r < e.length; r++)
|
|
2401
2401
|
this.allowsMarkType(e[r].type) ? t && t.push(e[r]) : t || (t = e.slice(0, r));
|
|
2402
|
-
return t ? t.length ? t :
|
|
2402
|
+
return t ? t.length ? t : _.none : e;
|
|
2403
2403
|
}
|
|
2404
2404
|
/**
|
|
2405
2405
|
@internal
|
|
@@ -2440,7 +2440,7 @@ class ss {
|
|
|
2440
2440
|
constructor(e, t, r, s) {
|
|
2441
2441
|
this.name = e, this.rank = t, this.schema = r, this.spec = s, this.attrs = Ya(e, s.attrs), this.excluded = null;
|
|
2442
2442
|
let o = Ja(this.attrs);
|
|
2443
|
-
this.instance = o ? new
|
|
2443
|
+
this.instance = o ? new _(this, o) : null;
|
|
2444
2444
|
}
|
|
2445
2445
|
/**
|
|
2446
2446
|
Create a mark of this type. `attrs` may be `null` or an object
|
|
@@ -2448,7 +2448,7 @@ class ss {
|
|
|
2448
2448
|
they have defaults, will be added.
|
|
2449
2449
|
*/
|
|
2450
2450
|
create(e = null) {
|
|
2451
|
-
return !e && this.instance ? this.instance : new
|
|
2451
|
+
return !e && this.instance ? this.instance : new _(this, Ka(this.attrs, e));
|
|
2452
2452
|
}
|
|
2453
2453
|
/**
|
|
2454
2454
|
@internal
|
|
@@ -2497,7 +2497,7 @@ class is {
|
|
|
2497
2497
|
let t = this.spec = {};
|
|
2498
2498
|
for (let s in e)
|
|
2499
2499
|
t[s] = e[s];
|
|
2500
|
-
t.nodes =
|
|
2500
|
+
t.nodes = te.from(e.nodes), t.marks = te.from(e.marks || {}), this.nodes = zi.compile(this.spec.nodes, this), this.marks = ss.compile(this.spec.marks, this);
|
|
2501
2501
|
let r = /* @__PURE__ */ Object.create(null);
|
|
2502
2502
|
for (let s in this.nodes) {
|
|
2503
2503
|
if (s in this.marks)
|
|
@@ -2539,7 +2539,7 @@ class is {
|
|
|
2539
2539
|
*/
|
|
2540
2540
|
text(e, t) {
|
|
2541
2541
|
let r = this.nodes.text;
|
|
2542
|
-
return new jr(r, r.defaultAttrs, e,
|
|
2542
|
+
return new jr(r, r.defaultAttrs, e, _.setFrom(t));
|
|
2543
2543
|
}
|
|
2544
2544
|
/**
|
|
2545
2545
|
Create a mark with the given type and attributes.
|
|
@@ -2559,7 +2559,7 @@ class is {
|
|
|
2559
2559
|
bound.
|
|
2560
2560
|
*/
|
|
2561
2561
|
markFromJSON(e) {
|
|
2562
|
-
return
|
|
2562
|
+
return _.fromJSON(this, e);
|
|
2563
2563
|
}
|
|
2564
2564
|
/**
|
|
2565
2565
|
@internal
|
|
@@ -2620,7 +2620,7 @@ class Xt {
|
|
|
2620
2620
|
*/
|
|
2621
2621
|
parse(e, t = {}) {
|
|
2622
2622
|
let r = new Bi(this, t, !1);
|
|
2623
|
-
return r.addAll(e,
|
|
2623
|
+
return r.addAll(e, _.none, t.from, t.to), r.finish();
|
|
2624
2624
|
}
|
|
2625
2625
|
/**
|
|
2626
2626
|
Parses the content of the given DOM node, like
|
|
@@ -2632,7 +2632,7 @@ class Xt {
|
|
|
2632
2632
|
*/
|
|
2633
2633
|
parseSlice(e, t = {}) {
|
|
2634
2634
|
let r = new Bi(this, t, !0);
|
|
2635
|
-
return r.addAll(e,
|
|
2635
|
+
return r.addAll(e, _.none, t.from, t.to), C.maxOpen(r.finish());
|
|
2636
2636
|
}
|
|
2637
2637
|
/**
|
|
2638
2638
|
@internal
|
|
@@ -2754,7 +2754,7 @@ function Fi(n, e, t) {
|
|
|
2754
2754
|
}
|
|
2755
2755
|
class br {
|
|
2756
2756
|
constructor(e, t, r, s, o, i) {
|
|
2757
|
-
this.type = e, this.attrs = t, this.marks = r, this.solid = s, this.options = i, this.content = [], this.activeMarks =
|
|
2757
|
+
this.type = e, this.attrs = t, this.marks = r, this.solid = s, this.options = i, this.content = [], this.activeMarks = _.none, this.match = o || (i & Dr ? null : e.contentMatch);
|
|
2758
2758
|
}
|
|
2759
2759
|
findWrapping(e) {
|
|
2760
2760
|
if (!this.match) {
|
|
@@ -2789,7 +2789,7 @@ class Bi {
|
|
|
2789
2789
|
constructor(e, t, r) {
|
|
2790
2790
|
this.parser = e, this.options = t, this.isOpen = r, this.open = 0, this.localPreserveWS = !1;
|
|
2791
2791
|
let s = t.topNode, o, i = Fi(null, t.preserveWhitespace, 0) | (r ? Dr : 0);
|
|
2792
|
-
s ? o = new br(s.type, s.attrs,
|
|
2792
|
+
s ? o = new br(s.type, s.attrs, _.none, !0, t.topMatch || s.type.contentMatch, i) : r ? o = new br(null, null, _.none, !0, null, i) : o = new br(e.schema.topNodeType, null, _.none, !0, null, i), this.nodes = [o], this.find = t.findPositions, this.needsBlock = !1;
|
|
2793
2793
|
}
|
|
2794
2794
|
get top() {
|
|
2795
2795
|
return this.nodes[this.open];
|
|
@@ -2944,7 +2944,7 @@ class Bi {
|
|
|
2944
2944
|
this.closeExtra();
|
|
2945
2945
|
let o = this.top;
|
|
2946
2946
|
o.match && (o.match = o.match.matchType(e.type));
|
|
2947
|
-
let i =
|
|
2947
|
+
let i = _.none;
|
|
2948
2948
|
for (let l of s.concat(e.marks))
|
|
2949
2949
|
(o.type ? o.type.allowsMarkType(l.type) : Wi(l.type, e.type)) && (i = l.addToSet(i));
|
|
2950
2950
|
return o.content.push(e.mark(i)), !0;
|
|
@@ -2964,7 +2964,7 @@ class Bi {
|
|
|
2964
2964
|
i.match = i.match && i.match.matchType(e);
|
|
2965
2965
|
let l = Fi(e, o, i.options);
|
|
2966
2966
|
i.options & Dr && i.content.length == 0 && (l |= Dr);
|
|
2967
|
-
let a =
|
|
2967
|
+
let a = _.none;
|
|
2968
2968
|
return r = r.filter((c) => (i.type ? i.type.allowsMarkType(c.type) : Wi(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new br(e, t, a, s, null, l)), this.open++, r;
|
|
2969
2969
|
}
|
|
2970
2970
|
// Make sure all nodes above this.open are finished and added to
|
|
@@ -3520,7 +3520,7 @@ class Un {
|
|
|
3520
3520
|
}
|
|
3521
3521
|
}
|
|
3522
3522
|
const Ds = /* @__PURE__ */ Object.create(null);
|
|
3523
|
-
class
|
|
3523
|
+
class de {
|
|
3524
3524
|
/**
|
|
3525
3525
|
Get the step map that represents the changes made by this step,
|
|
3526
3526
|
and which can be used to transform between positions in the old
|
|
@@ -3603,7 +3603,7 @@ function vo(n, e, t) {
|
|
|
3603
3603
|
}
|
|
3604
3604
|
return S.fromArray(r);
|
|
3605
3605
|
}
|
|
3606
|
-
class kt extends
|
|
3606
|
+
class kt extends de {
|
|
3607
3607
|
/**
|
|
3608
3608
|
Create a mark step.
|
|
3609
3609
|
*/
|
|
@@ -3641,8 +3641,8 @@ class kt extends fe {
|
|
|
3641
3641
|
return new kt(t.from, t.to, e.markFromJSON(t.mark));
|
|
3642
3642
|
}
|
|
3643
3643
|
}
|
|
3644
|
-
|
|
3645
|
-
class _e extends
|
|
3644
|
+
de.jsonID("addMark", kt);
|
|
3645
|
+
class _e extends de {
|
|
3646
3646
|
/**
|
|
3647
3647
|
Create a mark-removing step.
|
|
3648
3648
|
*/
|
|
@@ -3680,8 +3680,8 @@ class _e extends fe {
|
|
|
3680
3680
|
return new _e(t.from, t.to, e.markFromJSON(t.mark));
|
|
3681
3681
|
}
|
|
3682
3682
|
}
|
|
3683
|
-
|
|
3684
|
-
class Ct extends
|
|
3683
|
+
de.jsonID("removeMark", _e);
|
|
3684
|
+
class Ct extends de {
|
|
3685
3685
|
/**
|
|
3686
3686
|
Create a node mark step.
|
|
3687
3687
|
*/
|
|
@@ -3724,8 +3724,8 @@ class Ct extends fe {
|
|
|
3724
3724
|
return new Ct(t.pos, e.markFromJSON(t.mark));
|
|
3725
3725
|
}
|
|
3726
3726
|
}
|
|
3727
|
-
|
|
3728
|
-
class Qt extends
|
|
3727
|
+
de.jsonID("addNodeMark", Ct);
|
|
3728
|
+
class Qt extends de {
|
|
3729
3729
|
/**
|
|
3730
3730
|
Create a mark-removing step.
|
|
3731
3731
|
*/
|
|
@@ -3759,8 +3759,8 @@ class Qt extends fe {
|
|
|
3759
3759
|
return new Qt(t.pos, e.markFromJSON(t.mark));
|
|
3760
3760
|
}
|
|
3761
3761
|
}
|
|
3762
|
-
|
|
3763
|
-
class
|
|
3762
|
+
de.jsonID("removeNodeMark", Qt);
|
|
3763
|
+
class ce extends de {
|
|
3764
3764
|
/**
|
|
3765
3765
|
The given `slice` should fit the 'gap' between `from` and
|
|
3766
3766
|
`to`—the depths must line up, and the surrounding nodes must be
|
|
@@ -3780,21 +3780,21 @@ class ae extends fe {
|
|
|
3780
3780
|
return new we([this.from, this.to - this.from, this.slice.size]);
|
|
3781
3781
|
}
|
|
3782
3782
|
invert(e) {
|
|
3783
|
-
return new
|
|
3783
|
+
return new ce(this.from, this.from + this.slice.size, e.slice(this.from, this.to));
|
|
3784
3784
|
}
|
|
3785
3785
|
map(e) {
|
|
3786
3786
|
let t = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
|
|
3787
|
-
return t.deletedAcross && r.deletedAcross ? null : new
|
|
3787
|
+
return t.deletedAcross && r.deletedAcross ? null : new ce(t.pos, Math.max(t.pos, r.pos), this.slice, this.structure);
|
|
3788
3788
|
}
|
|
3789
3789
|
merge(e) {
|
|
3790
|
-
if (!(e instanceof
|
|
3790
|
+
if (!(e instanceof ce) || e.structure || this.structure)
|
|
3791
3791
|
return null;
|
|
3792
3792
|
if (this.from + this.slice.size == e.from && !this.slice.openEnd && !e.slice.openStart) {
|
|
3793
3793
|
let t = this.slice.size + e.slice.size == 0 ? C.empty : new C(this.slice.content.append(e.slice.content), this.slice.openStart, e.slice.openEnd);
|
|
3794
|
-
return new
|
|
3794
|
+
return new ce(this.from, this.to + (e.to - e.from), t, this.structure);
|
|
3795
3795
|
} else if (e.to == this.from && !this.slice.openStart && !e.slice.openEnd) {
|
|
3796
3796
|
let t = this.slice.size + e.slice.size == 0 ? C.empty : new C(e.slice.content.append(this.slice.content), e.slice.openStart, this.slice.openEnd);
|
|
3797
|
-
return new
|
|
3797
|
+
return new ce(e.from, this.to, t, this.structure);
|
|
3798
3798
|
} else
|
|
3799
3799
|
return null;
|
|
3800
3800
|
}
|
|
@@ -3808,11 +3808,11 @@ class ae extends fe {
|
|
|
3808
3808
|
static fromJSON(e, t) {
|
|
3809
3809
|
if (typeof t.from != "number" || typeof t.to != "number")
|
|
3810
3810
|
throw new RangeError("Invalid input for ReplaceStep.fromJSON");
|
|
3811
|
-
return new
|
|
3811
|
+
return new ce(t.from, t.to, C.fromJSON(e, t.slice), !!t.structure);
|
|
3812
3812
|
}
|
|
3813
3813
|
}
|
|
3814
|
-
|
|
3815
|
-
class
|
|
3814
|
+
de.jsonID("replace", ce);
|
|
3815
|
+
class oe extends de {
|
|
3816
3816
|
/**
|
|
3817
3817
|
Create a replace-around step with the given range and gap.
|
|
3818
3818
|
`insert` should be the point in the slice into which the content
|
|
@@ -3843,11 +3843,11 @@ class se extends fe {
|
|
|
3843
3843
|
}
|
|
3844
3844
|
invert(e) {
|
|
3845
3845
|
let t = this.gapTo - this.gapFrom;
|
|
3846
|
-
return new
|
|
3846
|
+
return new oe(this.from, this.from + this.slice.size + t, this.from + this.insert, this.from + this.insert + t, e.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
|
|
3847
3847
|
}
|
|
3848
3848
|
map(e) {
|
|
3849
3849
|
let t = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1), s = this.from == this.gapFrom ? t.pos : e.map(this.gapFrom, -1), o = this.to == this.gapTo ? r.pos : e.map(this.gapTo, 1);
|
|
3850
|
-
return t.deletedAcross && r.deletedAcross || s < t.pos || o > r.pos ? null : new
|
|
3850
|
+
return t.deletedAcross && r.deletedAcross || s < t.pos || o > r.pos ? null : new oe(t.pos, r.pos, s, o, this.slice, this.insert, this.structure);
|
|
3851
3851
|
}
|
|
3852
3852
|
toJSON() {
|
|
3853
3853
|
let e = {
|
|
@@ -3866,10 +3866,10 @@ class se extends fe {
|
|
|
3866
3866
|
static fromJSON(e, t) {
|
|
3867
3867
|
if (typeof t.from != "number" || typeof t.to != "number" || typeof t.gapFrom != "number" || typeof t.gapTo != "number" || typeof t.insert != "number")
|
|
3868
3868
|
throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
|
|
3869
|
-
return new
|
|
3869
|
+
return new oe(t.from, t.to, t.gapFrom, t.gapTo, C.fromJSON(e, t.slice), t.insert, !!t.structure);
|
|
3870
3870
|
}
|
|
3871
3871
|
}
|
|
3872
|
-
|
|
3872
|
+
de.jsonID("replaceAround", oe);
|
|
3873
3873
|
function so(n, e, t) {
|
|
3874
3874
|
let r = n.resolve(e), s = t - e, o = r.depth;
|
|
3875
3875
|
for (; s > 0 && o > 0 && r.indexAfter(o) == r.node(o).childCount; )
|
|
@@ -3928,7 +3928,7 @@ function Vo(n, e, t, r = t.contentMatch, s = !0) {
|
|
|
3928
3928
|
for (let a = 0; a < o.childCount; a++) {
|
|
3929
3929
|
let c = o.child(a), u = l + c.nodeSize, f = r.matchType(c.type);
|
|
3930
3930
|
if (!f)
|
|
3931
|
-
i.push(new
|
|
3931
|
+
i.push(new ce(l, u, C.empty));
|
|
3932
3932
|
else {
|
|
3933
3933
|
r = f;
|
|
3934
3934
|
for (let d = 0; d < c.marks.length; d++)
|
|
@@ -3936,7 +3936,7 @@ function Vo(n, e, t, r = t.contentMatch, s = !0) {
|
|
|
3936
3936
|
if (s && c.isText && t.whitespace != "pre") {
|
|
3937
3937
|
let d, h = /\r?\n|\r/g, p;
|
|
3938
3938
|
for (; d = h.exec(c.text); )
|
|
3939
|
-
p || (p = new C(S.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), i.push(new
|
|
3939
|
+
p || (p = new C(S.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), i.push(new ce(l + d.index, l + d.index + d[0].length, p));
|
|
3940
3940
|
}
|
|
3941
3941
|
}
|
|
3942
3942
|
l = u;
|
|
@@ -3969,7 +3969,7 @@ function xd(n, e, t) {
|
|
|
3969
3969
|
let d = S.empty, h = 0;
|
|
3970
3970
|
for (let p = o, y = !1; p > t; p--)
|
|
3971
3971
|
y || s.after(p + 1) < s.end(p) ? (y = !0, d = S.from(s.node(p).copy(d)), h++) : c++;
|
|
3972
|
-
n.step(new
|
|
3972
|
+
n.step(new oe(a, c, i, l, new C(u.append(d), f, h), u.size - f, !0));
|
|
3973
3973
|
}
|
|
3974
3974
|
function $o(n, e, t = null, r = n) {
|
|
3975
3975
|
let s = Sd(n, e), o = s && kd(r, e);
|
|
@@ -4005,7 +4005,7 @@ function Cd(n, e, t) {
|
|
|
4005
4005
|
r = S.from(t[i].type.create(t[i].attrs, r));
|
|
4006
4006
|
}
|
|
4007
4007
|
let s = e.start, o = e.end;
|
|
4008
|
-
n.step(new
|
|
4008
|
+
n.step(new oe(s, o, s, o, new C(r, 0, 0), t.length, !0));
|
|
4009
4009
|
}
|
|
4010
4010
|
function wd(n, e, t, r, s) {
|
|
4011
4011
|
if (!r.isTextblock)
|
|
@@ -4021,7 +4021,7 @@ function wd(n, e, t, r, s) {
|
|
|
4021
4021
|
}
|
|
4022
4022
|
c === !1 && oc(n, i, l, o), Vo(n, n.mapping.slice(o).map(l, 1), r, void 0, c === null);
|
|
4023
4023
|
let u = n.mapping.slice(o), f = u.map(l, 1), d = u.map(l + i.nodeSize, 1);
|
|
4024
|
-
return n.step(new
|
|
4024
|
+
return n.step(new oe(f, d, f + 1, d - 1, new C(S.from(r.create(a, null, i.marks)), 0, 0), 1, !0)), c === !0 && sc(n, i, l, o), !1;
|
|
4025
4025
|
}
|
|
4026
4026
|
});
|
|
4027
4027
|
}
|
|
@@ -4059,7 +4059,7 @@ function Nd(n, e, t, r, s) {
|
|
|
4059
4059
|
return n.replaceWith(e, e + o.nodeSize, i);
|
|
4060
4060
|
if (!t.validContent(o.content))
|
|
4061
4061
|
throw new RangeError("Invalid content for node type " + t.name);
|
|
4062
|
-
n.step(new
|
|
4062
|
+
n.step(new oe(e, e + o.nodeSize, e + 1, e + o.nodeSize - 1, new C(S.from(i), 0, 0), 1, !0));
|
|
4063
4063
|
}
|
|
4064
4064
|
function bn(n, e, t = 1, r) {
|
|
4065
4065
|
let s = n.resolve(e), o = s.depth - t, i = r && r[r.length - 1] || s.parent;
|
|
@@ -4085,7 +4085,7 @@ function Dd(n, e, t = 1, r) {
|
|
|
4085
4085
|
let u = r && r[c];
|
|
4086
4086
|
i = S.from(u ? u.type.create(u.attrs, i) : s.node(l).copy(i));
|
|
4087
4087
|
}
|
|
4088
|
-
n.step(new
|
|
4088
|
+
n.step(new ce(e, e, new C(o.append(i), t, t), !0));
|
|
4089
4089
|
}
|
|
4090
4090
|
function En(n, e) {
|
|
4091
4091
|
let t = n.resolve(e), r = t.index();
|
|
@@ -4128,7 +4128,7 @@ function Ed(n, e, t) {
|
|
|
4128
4128
|
}
|
|
4129
4129
|
i.inlineContent && Vo(n, e + t - 1, i, o.node().contentMatchAt(o.index()), r == null);
|
|
4130
4130
|
let a = n.mapping.slice(l), c = a.map(e - t);
|
|
4131
|
-
if (n.step(new
|
|
4131
|
+
if (n.step(new ce(c, a.map(e + t, -1), C.empty, !0)), r === !0) {
|
|
4132
4132
|
let u = n.doc.resolve(c);
|
|
4133
4133
|
sc(n, u.node(), u.before(), n.steps.length);
|
|
4134
4134
|
}
|
|
@@ -4181,7 +4181,7 @@ function jo(n, e, t = e, r = C.empty) {
|
|
|
4181
4181
|
if (e == t && !r.size)
|
|
4182
4182
|
return null;
|
|
4183
4183
|
let s = n.resolve(e), o = n.resolve(t);
|
|
4184
|
-
return ac(s, o, r) ? new
|
|
4184
|
+
return ac(s, o, r) ? new ce(e, t, r) : new Ad(s, o, r).fit();
|
|
4185
4185
|
}
|
|
4186
4186
|
function ac(n, e, t) {
|
|
4187
4187
|
return !t.openStart && !t.openEnd && n.start() == e.start() && n.parent.canReplace(n.index(), e.index(), t.content);
|
|
@@ -4214,7 +4214,7 @@ class Ad {
|
|
|
4214
4214
|
for (; i && l && o.childCount == 1; )
|
|
4215
4215
|
o = o.firstChild.content, i--, l--;
|
|
4216
4216
|
let a = new C(o, i, l);
|
|
4217
|
-
return e > -1 ? new
|
|
4217
|
+
return e > -1 ? new oe(r.pos, e, this.$to.pos, this.$to.end(), a, t) : a.size || r.pos != this.$to.pos ? new ce(r.pos, s.pos, a) : null;
|
|
4218
4218
|
}
|
|
4219
4219
|
// Find a position on the start spine of `this.unplaced` that has
|
|
4220
4220
|
// content that can be moved somewhere on the frontier. Returns two
|
|
@@ -4371,7 +4371,7 @@ function Pd(n, e, t, r) {
|
|
|
4371
4371
|
return n.deleteRange(e, t);
|
|
4372
4372
|
let s = n.doc.resolve(e), o = n.doc.resolve(t);
|
|
4373
4373
|
if (ac(s, o, r))
|
|
4374
|
-
return n.step(new
|
|
4374
|
+
return n.step(new ce(e, t, r));
|
|
4375
4375
|
let i = fc(s, n.doc.resolve(t));
|
|
4376
4376
|
i[i.length - 1] == 0 && i.pop();
|
|
4377
4377
|
let l = -(s.depth + 1);
|
|
@@ -4455,7 +4455,7 @@ function fc(n, e) {
|
|
|
4455
4455
|
}
|
|
4456
4456
|
return t;
|
|
4457
4457
|
}
|
|
4458
|
-
class xn extends
|
|
4458
|
+
class xn extends de {
|
|
4459
4459
|
/**
|
|
4460
4460
|
Construct an attribute step.
|
|
4461
4461
|
*/
|
|
@@ -4492,8 +4492,8 @@ class xn extends fe {
|
|
|
4492
4492
|
return new xn(t.pos, t.attr, t.value);
|
|
4493
4493
|
}
|
|
4494
4494
|
}
|
|
4495
|
-
|
|
4496
|
-
class Yn extends
|
|
4495
|
+
de.jsonID("attr", xn);
|
|
4496
|
+
class Yn extends de {
|
|
4497
4497
|
/**
|
|
4498
4498
|
Construct an attribute step.
|
|
4499
4499
|
*/
|
|
@@ -4526,7 +4526,7 @@ class Yn extends fe {
|
|
|
4526
4526
|
return new Yn(t.attr, t.value);
|
|
4527
4527
|
}
|
|
4528
4528
|
}
|
|
4529
|
-
|
|
4529
|
+
de.jsonID("docAttr", Yn);
|
|
4530
4530
|
let Mn = class extends Error {
|
|
4531
4531
|
};
|
|
4532
4532
|
Mn = function n(e) {
|
|
@@ -4715,7 +4715,7 @@ class dc {
|
|
|
4715
4715
|
let r = this.doc.nodeAt(e);
|
|
4716
4716
|
if (!r)
|
|
4717
4717
|
throw new RangeError("No node at position " + e);
|
|
4718
|
-
if (t instanceof
|
|
4718
|
+
if (t instanceof _)
|
|
4719
4719
|
t.isInSet(r.marks) && this.step(new Qt(e, t));
|
|
4720
4720
|
else {
|
|
4721
4721
|
let s = r.marks, o, i = [];
|
|
@@ -4872,7 +4872,7 @@ class $ {
|
|
|
4872
4872
|
negative, it will search backwards first.
|
|
4873
4873
|
*/
|
|
4874
4874
|
static near(e, t = 1) {
|
|
4875
|
-
return this.findFrom(e, t) || this.findFrom(e, -t) || new
|
|
4875
|
+
return this.findFrom(e, t) || this.findFrom(e, -t) || new Se(e.node(0));
|
|
4876
4876
|
}
|
|
4877
4877
|
/**
|
|
4878
4878
|
Find the cursor or leaf node selection closest to the start of
|
|
@@ -4881,14 +4881,14 @@ class $ {
|
|
|
4881
4881
|
exists.
|
|
4882
4882
|
*/
|
|
4883
4883
|
static atStart(e) {
|
|
4884
|
-
return dn(e, e, 0, 0, 1) || new
|
|
4884
|
+
return dn(e, e, 0, 0, 1) || new Se(e);
|
|
4885
4885
|
}
|
|
4886
4886
|
/**
|
|
4887
4887
|
Find the cursor or leaf node selection closest to the end of the
|
|
4888
4888
|
given document.
|
|
4889
4889
|
*/
|
|
4890
4890
|
static atEnd(e) {
|
|
4891
|
-
return dn(e, e, e.content.size, e.childCount, -1) || new
|
|
4891
|
+
return dn(e, e, e.content.size, e.childCount, -1) || new Se(e);
|
|
4892
4892
|
}
|
|
4893
4893
|
/**
|
|
4894
4894
|
Deserialize the JSON representation of a selection. Must be
|
|
@@ -5084,7 +5084,7 @@ class Fo {
|
|
|
5084
5084
|
return r && w.isSelectable(r) ? new w(t) : $.near(t);
|
|
5085
5085
|
}
|
|
5086
5086
|
}
|
|
5087
|
-
class
|
|
5087
|
+
class Se extends $ {
|
|
5088
5088
|
/**
|
|
5089
5089
|
Create an all-selection over the given document.
|
|
5090
5090
|
*/
|
|
@@ -5106,25 +5106,25 @@ class xe extends $ {
|
|
|
5106
5106
|
@internal
|
|
5107
5107
|
*/
|
|
5108
5108
|
static fromJSON(e) {
|
|
5109
|
-
return new
|
|
5109
|
+
return new Se(e);
|
|
5110
5110
|
}
|
|
5111
5111
|
map(e) {
|
|
5112
|
-
return new
|
|
5112
|
+
return new Se(e);
|
|
5113
5113
|
}
|
|
5114
5114
|
eq(e) {
|
|
5115
|
-
return e instanceof
|
|
5115
|
+
return e instanceof Se;
|
|
5116
5116
|
}
|
|
5117
5117
|
getBookmark() {
|
|
5118
5118
|
return $d;
|
|
5119
5119
|
}
|
|
5120
5120
|
}
|
|
5121
|
-
$.jsonID("all",
|
|
5121
|
+
$.jsonID("all", Se);
|
|
5122
5122
|
const $d = {
|
|
5123
5123
|
map() {
|
|
5124
5124
|
return this;
|
|
5125
5125
|
},
|
|
5126
5126
|
resolve(n) {
|
|
5127
|
-
return new
|
|
5127
|
+
return new Se(n);
|
|
5128
5128
|
}
|
|
5129
5129
|
};
|
|
5130
5130
|
function dn(n, e, t, r, s, o = !1) {
|
|
@@ -5149,7 +5149,7 @@ function Yi(n, e, t) {
|
|
|
5149
5149
|
if (r < e)
|
|
5150
5150
|
return;
|
|
5151
5151
|
let s = n.steps[r];
|
|
5152
|
-
if (!(s instanceof
|
|
5152
|
+
if (!(s instanceof ce || s instanceof oe))
|
|
5153
5153
|
return;
|
|
5154
5154
|
let o = n.mapping.maps[r], i;
|
|
5155
5155
|
o.forEach((l, a, c, u) => {
|
|
@@ -5200,7 +5200,7 @@ class zd extends dc {
|
|
|
5200
5200
|
this is already the case.
|
|
5201
5201
|
*/
|
|
5202
5202
|
ensureMarks(e) {
|
|
5203
|
-
return
|
|
5203
|
+
return _.sameSet(this.storedMarks || this.selection.$from.marks(), e) || this.setStoredMarks(e), this;
|
|
5204
5204
|
}
|
|
5205
5205
|
/**
|
|
5206
5206
|
Add a mark to the set of stored marks.
|
|
@@ -5245,7 +5245,7 @@ class zd extends dc {
|
|
|
5245
5245
|
*/
|
|
5246
5246
|
replaceSelectionWith(e, t = !0) {
|
|
5247
5247
|
let r = this.selection;
|
|
5248
|
-
return t && (e = e.mark(this.storedMarks || (r.empty ? r.$from.marks() : r.$from.marksAcross(r.$to) ||
|
|
5248
|
+
return t && (e = e.mark(this.storedMarks || (r.empty ? r.$from.marks() : r.$from.marksAcross(r.$to) || _.none))), r.replaceWith(this, e), this;
|
|
5249
5249
|
}
|
|
5250
5250
|
/**
|
|
5251
5251
|
Delete the selection.
|
|
@@ -5990,10 +5990,10 @@ var Tt = {
|
|
|
5990
5990
|
221: "}",
|
|
5991
5991
|
222: '"'
|
|
5992
5992
|
}, Ud = typeof navigator < "u" && /Mac/.test(navigator.platform), Yd = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
5993
|
-
for (var
|
|
5994
|
-
for (var
|
|
5995
|
-
for (var
|
|
5996
|
-
Tt[
|
|
5993
|
+
for (var ne = 0; ne < 10; ne++) Tt[48 + ne] = Tt[96 + ne] = String(ne);
|
|
5994
|
+
for (var ne = 1; ne <= 24; ne++) Tt[ne + 111] = "F" + ne;
|
|
5995
|
+
for (var ne = 65; ne <= 90; ne++)
|
|
5996
|
+
Tt[ne] = String.fromCharCode(ne + 32), Lr[ne] = String.fromCharCode(ne);
|
|
5997
5997
|
for (var vs in Tt) Lr.hasOwnProperty(vs) || (Lr[vs] = Tt[vs]);
|
|
5998
5998
|
function Gd(n) {
|
|
5999
5999
|
var e = Ud && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || Yd && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? Lr : Tt)[n.keyCode] || n.key || "Unidentified";
|
|
@@ -6217,7 +6217,7 @@ const wc = (n, e) => {
|
|
|
6217
6217
|
return !0;
|
|
6218
6218
|
}, ah = (n, e) => {
|
|
6219
6219
|
let t = n.selection, { $from: r, $to: s } = t;
|
|
6220
|
-
if (t instanceof
|
|
6220
|
+
if (t instanceof Se || r.parent.inlineContent || s.parent.inlineContent)
|
|
6221
6221
|
return !1;
|
|
6222
6222
|
let o = _o(s.parent.contentMatchAt(s.indexAfter()));
|
|
6223
6223
|
if (!o || !o.isTextblock)
|
|
@@ -6257,7 +6257,7 @@ function uh(n) {
|
|
|
6257
6257
|
o.unshift(null);
|
|
6258
6258
|
}
|
|
6259
6259
|
let u = e.tr;
|
|
6260
|
-
(e.selection instanceof V || e.selection instanceof
|
|
6260
|
+
(e.selection instanceof V || e.selection instanceof Se) && u.deleteSelection();
|
|
6261
6261
|
let f = u.mapping.map(r.pos), d = bn(u.doc, f, o.length, o);
|
|
6262
6262
|
if (d || (o[0] = l ? { type: l } : null, d = bn(u.doc, f, o.length, o)), !d)
|
|
6263
6263
|
return !1;
|
|
@@ -6271,7 +6271,7 @@ function uh(n) {
|
|
|
6271
6271
|
const fh = uh(), Mc = (n, e) => {
|
|
6272
6272
|
let { $from: t, to: r } = n.selection, s, o = t.sharedDepth(r);
|
|
6273
6273
|
return o == 0 ? !1 : (s = t.before(o), e && e(n.tr.setSelection(w.create(n.doc, s))), !0);
|
|
6274
|
-
}, dh = (n, e) => (e && e(n.tr.setSelection(new
|
|
6274
|
+
}, dh = (n, e) => (e && e(n.tr.setSelection(new Se(n.doc))), !0);
|
|
6275
6275
|
function hh(n, e, t) {
|
|
6276
6276
|
let r = e.nodeBefore, s = e.nodeAfter, o = e.index();
|
|
6277
6277
|
return !r || !s || !r.type.compatibleContent(s.type) ? !1 : !r.content.size && e.parent.canReplace(o - 1, o) ? (t && t(n.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(o, o + 1) || !(s.isTextblock || En(n.doc, e.pos)) ? !1 : (t && t(n.tr.join(e.pos).scrollIntoView()), !0);
|
|
@@ -6287,7 +6287,7 @@ function Nc(n, e, t, r) {
|
|
|
6287
6287
|
for (let x = i.length - 1; x >= 0; x--)
|
|
6288
6288
|
p = S.from(i[x].create(null, p));
|
|
6289
6289
|
p = S.from(s.copy(p));
|
|
6290
|
-
let y = n.tr.step(new
|
|
6290
|
+
let y = n.tr.step(new oe(e.pos - 1, h, e.pos, h, new C(p, 1, 0), i.length, !0)), m = y.doc.resolve(h + 2 * i.length);
|
|
6291
6291
|
m.nodeAfter && m.nodeAfter.type == s.type && En(y.doc, m.pos) && y.join(m.pos), t(y.scrollIntoView());
|
|
6292
6292
|
}
|
|
6293
6293
|
return !0;
|
|
@@ -6307,7 +6307,7 @@ function Nc(n, e, t, r) {
|
|
|
6307
6307
|
let x = S.empty;
|
|
6308
6308
|
for (let M = p.length - 1; M >= 0; M--)
|
|
6309
6309
|
x = S.from(p[M].copy(x));
|
|
6310
|
-
let k = n.tr.step(new
|
|
6310
|
+
let k = n.tr.step(new oe(e.pos - p.length, e.pos + o.nodeSize, e.pos + m, e.pos + o.nodeSize - m, new C(x, p.length, 0), 0, !0));
|
|
6311
6311
|
t(k.scrollIntoView());
|
|
6312
6312
|
}
|
|
6313
6313
|
return !0;
|
|
@@ -6512,7 +6512,7 @@ class Sh {
|
|
|
6512
6512
|
this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
|
|
6513
6513
|
}
|
|
6514
6514
|
}
|
|
6515
|
-
const
|
|
6515
|
+
const re = function(n) {
|
|
6516
6516
|
for (var e = 0; ; e++)
|
|
6517
6517
|
if (n = n.previousSibling, !n)
|
|
6518
6518
|
return e;
|
|
@@ -6537,7 +6537,7 @@ function rl(n, e, t, r, s) {
|
|
|
6537
6537
|
let o = n.parentNode;
|
|
6538
6538
|
if (!o || o.nodeType != 1 || ar(n) || Ch.test(n.nodeName) || n.contentEditable == "false")
|
|
6539
6539
|
return !1;
|
|
6540
|
-
e =
|
|
6540
|
+
e = re(n) + (s < 0 ? 0 : 1), n = o;
|
|
6541
6541
|
} else if (n.nodeType == 1) {
|
|
6542
6542
|
if (n = n.childNodes[e + (s < 0 ? -1 : 0)], n.contentEditable == "false")
|
|
6543
6543
|
return !1;
|
|
@@ -6558,7 +6558,7 @@ function wh(n, e) {
|
|
|
6558
6558
|
return null;
|
|
6559
6559
|
n = n.childNodes[e - 1], e = Pe(n);
|
|
6560
6560
|
} else if (n.parentNode && !ar(n))
|
|
6561
|
-
e =
|
|
6561
|
+
e = re(n), n = n.parentNode;
|
|
6562
6562
|
else
|
|
6563
6563
|
return null;
|
|
6564
6564
|
}
|
|
@@ -6572,7 +6572,7 @@ function Mh(n, e) {
|
|
|
6572
6572
|
return null;
|
|
6573
6573
|
n = n.childNodes[e], e = 0;
|
|
6574
6574
|
} else if (n.parentNode && !ar(n))
|
|
6575
|
-
e =
|
|
6575
|
+
e = re(n) + 1, n = n.parentNode;
|
|
6576
6576
|
else
|
|
6577
6577
|
return null;
|
|
6578
6578
|
}
|
|
@@ -6581,7 +6581,7 @@ function Nh(n, e, t) {
|
|
|
6581
6581
|
for (let r = e == 0, s = e == Pe(n); r || s; ) {
|
|
6582
6582
|
if (n == t)
|
|
6583
6583
|
return !0;
|
|
6584
|
-
let o =
|
|
6584
|
+
let o = re(n);
|
|
6585
6585
|
if (n = n.parentNode, !n)
|
|
6586
6586
|
return !1;
|
|
6587
6587
|
r = r && o == 0, s = s && o == Pe(n);
|
|
@@ -6620,9 +6620,9 @@ function Oh(n, e, t) {
|
|
|
6620
6620
|
return { node: r.startContainer, offset: Math.min(Pe(r.startContainer), r.startOffset) };
|
|
6621
6621
|
}
|
|
6622
6622
|
}
|
|
6623
|
-
const Je = typeof navigator < "u" ? navigator : null, sl = typeof document < "u" ? document : null, Rt = Je && Je.userAgent || "", io = /Edge\/(\d+)/.exec(Rt), Tc = /MSIE \d/.exec(Rt), lo = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rt),
|
|
6623
|
+
const Je = typeof navigator < "u" ? navigator : null, sl = typeof document < "u" ? document : null, Rt = Je && Je.userAgent || "", io = /Edge\/(\d+)/.exec(Rt), Tc = /MSIE \d/.exec(Rt), lo = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rt), ke = !!(Tc || lo || io), Ot = Tc ? document.documentMode : lo ? +lo[1] : io ? +io[1] : 0, je = !ke && /gecko\/(\d+)/i.test(Rt);
|
|
6624
6624
|
je && +(/Firefox\/(\d+)/.exec(Rt) || [0, 0])[1];
|
|
6625
|
-
const ao = !
|
|
6625
|
+
const ao = !ke && /Chrome\/(\d+)/.exec(Rt), ue = !!ao, Ac = ao ? +ao[1] : 0, ge = !ke && !!Je && /Apple Computer/.test(Je.vendor), Dn = ge && (/Mobile\/\w+/.test(Rt) || !!Je && Je.maxTouchPoints > 2), Re = Dn || (Je ? /Mac/.test(Je.platform) : !1), Eh = Je ? /Win/.test(Je.platform) : !1, it = /Android \d/.test(Rt), cr = !!sl && "webkitFontSmoothing" in sl.documentElement.style, Th = cr ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
6626
6626
|
function Ah(n) {
|
|
6627
6627
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
6628
6628
|
return e ? {
|
|
@@ -6804,7 +6804,7 @@ function Fh(n, e) {
|
|
|
6804
6804
|
if (!qo(e, c) || (i = vc(n.dom, e, c), !i))
|
|
6805
6805
|
return null;
|
|
6806
6806
|
}
|
|
6807
|
-
if (
|
|
6807
|
+
if (ge)
|
|
6808
6808
|
for (let c = i; r && c; c = Gn(c))
|
|
6809
6809
|
c.draggable && (r = void 0);
|
|
6810
6810
|
if (i = $h(i, e), r) {
|
|
@@ -7048,7 +7048,7 @@ let ur = class {
|
|
|
7048
7048
|
}
|
|
7049
7049
|
let s;
|
|
7050
7050
|
if (e == this.dom && this.contentDOM)
|
|
7051
|
-
s = t >
|
|
7051
|
+
s = t > re(this.contentDOM);
|
|
7052
7052
|
else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM))
|
|
7053
7053
|
s = e.compareDocumentPosition(this.contentDOM) & 2;
|
|
7054
7054
|
else if (this.dom.firstChild) {
|
|
@@ -7132,12 +7132,12 @@ let ur = class {
|
|
|
7132
7132
|
let o, i = !0;
|
|
7133
7133
|
for (; o = r ? this.children[r - 1] : null, !(!o || o.dom.parentNode == this.contentDOM); r--, i = !1)
|
|
7134
7134
|
;
|
|
7135
|
-
return o && t && i && !o.border && !o.domAtom ? o.domFromPos(o.size, t) : { node: this.contentDOM, offset: o ?
|
|
7135
|
+
return o && t && i && !o.border && !o.domAtom ? o.domFromPos(o.size, t) : { node: this.contentDOM, offset: o ? re(o.dom) + 1 : 0 };
|
|
7136
7136
|
} else {
|
|
7137
7137
|
let o, i = !0;
|
|
7138
7138
|
for (; o = r < this.children.length ? this.children[r] : null, !(!o || o.dom.parentNode == this.contentDOM); r++, i = !1)
|
|
7139
7139
|
;
|
|
7140
|
-
return o && i && !o.border && !o.domAtom ? o.domFromPos(0, t) : { node: this.contentDOM, offset: o ?
|
|
7140
|
+
return o && i && !o.border && !o.domAtom ? o.domFromPos(0, t) : { node: this.contentDOM, offset: o ? re(o.dom) : this.contentDOM.childNodes.length };
|
|
7141
7141
|
}
|
|
7142
7142
|
}
|
|
7143
7143
|
// Used to find a DOM range in a single parent for a given changed
|
|
@@ -7156,7 +7156,7 @@ let ur = class {
|
|
|
7156
7156
|
for (let f = l; f > 0; f--) {
|
|
7157
7157
|
let d = this.children[f - 1];
|
|
7158
7158
|
if (d.size && d.dom.parentNode == this.contentDOM && !d.emptyChildAt(1)) {
|
|
7159
|
-
s =
|
|
7159
|
+
s = re(d.dom) + 1;
|
|
7160
7160
|
break;
|
|
7161
7161
|
}
|
|
7162
7162
|
e -= d.size;
|
|
@@ -7168,7 +7168,7 @@ let ur = class {
|
|
|
7168
7168
|
for (let u = l + 1; u < this.children.length; u++) {
|
|
7169
7169
|
let f = this.children[u];
|
|
7170
7170
|
if (f.size && f.dom.parentNode == this.contentDOM && !f.emptyChildAt(-1)) {
|
|
7171
|
-
o =
|
|
7171
|
+
o = re(f.dom);
|
|
7172
7172
|
break;
|
|
7173
7173
|
}
|
|
7174
7174
|
t += f.size;
|
|
@@ -7206,14 +7206,14 @@ let ur = class {
|
|
|
7206
7206
|
p = m;
|
|
7207
7207
|
}
|
|
7208
7208
|
let l = this.domFromPos(e, e ? -1 : 1), a = t == e ? l : this.domFromPos(t, t ? -1 : 1), c = r.root.getSelection(), u = r.domSelectionRange(), f = !1;
|
|
7209
|
-
if ((je ||
|
|
7209
|
+
if ((je || ge) && e == t) {
|
|
7210
7210
|
let { node: h, offset: p } = l;
|
|
7211
7211
|
if (h.nodeType == 3) {
|
|
7212
7212
|
if (f = !!(p && h.nodeValue[p - 1] == `
|
|
7213
7213
|
`), f && p == h.nodeValue.length)
|
|
7214
7214
|
for (let y = h, m; y; y = y.parentNode) {
|
|
7215
7215
|
if (m = y.nextSibling) {
|
|
7216
|
-
m.nodeName == "BR" && (l = a = { node: m.parentNode, offset:
|
|
7216
|
+
m.nodeName == "BR" && (l = a = { node: m.parentNode, offset: re(m) + 1 });
|
|
7217
7217
|
break;
|
|
7218
7218
|
}
|
|
7219
7219
|
let x = y.pmViewDesc;
|
|
@@ -7229,7 +7229,7 @@ let ur = class {
|
|
|
7229
7229
|
let h = u.focusNode.childNodes[u.focusOffset];
|
|
7230
7230
|
h && h.contentEditable == "false" && (s = !0);
|
|
7231
7231
|
}
|
|
7232
|
-
if (!(s || f &&
|
|
7232
|
+
if (!(s || f && ge) && Zt(l.node, l.offset, u.anchorNode, u.anchorOffset) && Zt(a.node, a.offset, u.focusNode, u.focusOffset))
|
|
7233
7233
|
return;
|
|
7234
7234
|
let d = !1;
|
|
7235
7235
|
if ((c.extend || e == t) && !f) {
|
|
@@ -7443,7 +7443,7 @@ let ur = class {
|
|
|
7443
7443
|
updateChildren(e, t) {
|
|
7444
7444
|
let r = this.node.inlineContent, s = t, o = e.composing ? this.localCompositionInfo(e, t) : null, i = o && o.pos > -1 ? o : null, l = o && o.pos < 0, a = new Uh(this, i && i.node, e);
|
|
7445
7445
|
Xh(this.node, this.innerDeco, (c, u, f) => {
|
|
7446
|
-
c.spec.marks ? a.syncToMarks(c.spec.marks, r, e) : c.type.side >= 0 && !f && a.syncToMarks(u == this.node.childCount ?
|
|
7446
|
+
c.spec.marks ? a.syncToMarks(c.spec.marks, r, e) : c.type.side >= 0 && !f && a.syncToMarks(u == this.node.childCount ? _.none : this.node.child(u).marks, r, e), a.placeWidget(c, e, s);
|
|
7447
7447
|
}, (c, u, f, d) => {
|
|
7448
7448
|
a.syncToMarks(c.marks, r, e);
|
|
7449
7449
|
let h;
|
|
@@ -7823,7 +7823,7 @@ class Uh {
|
|
|
7823
7823
|
for (; e instanceof Wr; )
|
|
7824
7824
|
t = e, e = t.children[t.children.length - 1];
|
|
7825
7825
|
(!e || // Empty textblock
|
|
7826
|
-
!(e instanceof Fc) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((
|
|
7826
|
+
!(e instanceof Fc) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((ge || ue) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
|
|
7827
7827
|
}
|
|
7828
7828
|
addHackNode(e, t) {
|
|
7829
7829
|
if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))
|
|
@@ -7999,7 +7999,7 @@ function Hc(n) {
|
|
|
7999
7999
|
function at(n, e = !1) {
|
|
8000
8000
|
let t = n.state.selection;
|
|
8001
8001
|
if (Jc(n, t), !!Hc(n)) {
|
|
8002
|
-
if (!e && n.input.mouseDown && n.input.mouseDown.allowDefault &&
|
|
8002
|
+
if (!e && n.input.mouseDown && n.input.mouseDown.allowDefault && ue) {
|
|
8003
8003
|
let r = n.domSelectionRange(), s = n.domObserver.currentSelection;
|
|
8004
8004
|
if (r.anchorNode && s.anchorNode && Zt(r.anchorNode, r.anchorOffset, s.anchorNode, s.anchorOffset)) {
|
|
8005
8005
|
n.input.mouseDown.delayedSelectionSync = !0, n.domObserver.setCurSelection();
|
|
@@ -8015,10 +8015,10 @@ function at(n, e = !1) {
|
|
|
8015
8015
|
n.domObserver.setCurSelection(), n.domObserver.connectSelection();
|
|
8016
8016
|
}
|
|
8017
8017
|
}
|
|
8018
|
-
const hl =
|
|
8018
|
+
const hl = ge || ue && Ac < 63;
|
|
8019
8019
|
function pl(n, e) {
|
|
8020
8020
|
let { node: t, offset: r } = n.docView.domFromPos(e, 0), s = r < t.childNodes.length ? t.childNodes[r] : null, o = r ? t.childNodes[r - 1] : null;
|
|
8021
|
-
if (
|
|
8021
|
+
if (ge && s && s.contentEditable == "false")
|
|
8022
8022
|
return Fs(s);
|
|
8023
8023
|
if ((!s || s.contentEditable == "false") && (!o || o.contentEditable == "false")) {
|
|
8024
8024
|
if (s)
|
|
@@ -8028,7 +8028,7 @@ function pl(n, e) {
|
|
|
8028
8028
|
}
|
|
8029
8029
|
}
|
|
8030
8030
|
function Fs(n) {
|
|
8031
|
-
return n.contentEditable = "true",
|
|
8031
|
+
return n.contentEditable = "true", ge && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
|
|
8032
8032
|
}
|
|
8033
8033
|
function ml(n) {
|
|
8034
8034
|
n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
|
|
@@ -8048,7 +8048,7 @@ function tp(n) {
|
|
|
8048
8048
|
if (!e)
|
|
8049
8049
|
return;
|
|
8050
8050
|
let r = n.cursorWrapper.dom, s = r.nodeName == "IMG";
|
|
8051
|
-
s ? t.setStart(r.parentNode,
|
|
8051
|
+
s ? t.setStart(r.parentNode, re(r) + 1) : t.setStart(r, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t), !s && !n.state.selection.visible && ke && Ot <= 11 && (r.disabled = !0, r.disabled = !1);
|
|
8052
8052
|
}
|
|
8053
8053
|
function Jc(n, e) {
|
|
8054
8054
|
if (e instanceof w) {
|
|
@@ -8151,7 +8151,7 @@ function rp(n) {
|
|
|
8151
8151
|
{
|
|
8152
8152
|
let l = t.previousSibling;
|
|
8153
8153
|
for (; l && Wn(l, -1); )
|
|
8154
|
-
s = t.parentNode, o =
|
|
8154
|
+
s = t.parentNode, o = re(l), l = l.previousSibling;
|
|
8155
8155
|
if (l)
|
|
8156
8156
|
t = l, r = qr(t);
|
|
8157
8157
|
else {
|
|
@@ -8183,7 +8183,7 @@ function sp(n) {
|
|
|
8183
8183
|
{
|
|
8184
8184
|
let l = t.nextSibling;
|
|
8185
8185
|
for (; l && Wn(l, 1); )
|
|
8186
|
-
o = l.parentNode, i =
|
|
8186
|
+
o = l.parentNode, i = re(l) + 1, l = l.nextSibling;
|
|
8187
8187
|
if (l)
|
|
8188
8188
|
t = l, r = 0, s = qr(t);
|
|
8189
8189
|
else {
|
|
@@ -8201,7 +8201,7 @@ function Uc(n) {
|
|
|
8201
8201
|
}
|
|
8202
8202
|
function op(n, e) {
|
|
8203
8203
|
for (; n && e == n.childNodes.length && !ar(n); )
|
|
8204
|
-
e =
|
|
8204
|
+
e = re(n) + 1, n = n.parentNode;
|
|
8205
8205
|
for (; n && e < n.childNodes.length; ) {
|
|
8206
8206
|
let t = n.childNodes[e];
|
|
8207
8207
|
if (t.nodeType == 3)
|
|
@@ -8213,7 +8213,7 @@ function op(n, e) {
|
|
|
8213
8213
|
}
|
|
8214
8214
|
function ip(n, e) {
|
|
8215
8215
|
for (; n && !e && !ar(n); )
|
|
8216
|
-
e =
|
|
8216
|
+
e = re(n), n = n.parentNode;
|
|
8217
8217
|
for (; n && e; ) {
|
|
8218
8218
|
let t = n.childNodes[e - 1];
|
|
8219
8219
|
if (t.nodeType == 3)
|
|
@@ -8243,7 +8243,7 @@ function po(n, e, t) {
|
|
|
8243
8243
|
}
|
|
8244
8244
|
function xl(n, e) {
|
|
8245
8245
|
let t = n.state.doc.resolve(e);
|
|
8246
|
-
if (!(
|
|
8246
|
+
if (!(ue || Eh) && t.parent.inlineContent) {
|
|
8247
8247
|
let s = n.coordsAtPos(e);
|
|
8248
8248
|
if (e > t.start()) {
|
|
8249
8249
|
let o = n.coordsAtPos(e - 1), i = (o.top + o.bottom) / 2;
|
|
@@ -8269,7 +8269,7 @@ function Sl(n, e, t) {
|
|
|
8269
8269
|
return yt(n, i);
|
|
8270
8270
|
}
|
|
8271
8271
|
if (!s.parent.inlineContent) {
|
|
8272
|
-
let i = e < 0 ? s : o, l = r instanceof
|
|
8272
|
+
let i = e < 0 ? s : o, l = r instanceof Se ? $.near(i, e) : $.findFrom(i, e);
|
|
8273
8273
|
return l ? yt(n, l) : !1;
|
|
8274
8274
|
}
|
|
8275
8275
|
return !1;
|
|
@@ -8295,7 +8295,7 @@ function Cl(n, e, t) {
|
|
|
8295
8295
|
n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
|
|
8296
8296
|
}
|
|
8297
8297
|
function lp(n) {
|
|
8298
|
-
if (!
|
|
8298
|
+
if (!ge || n.state.selection.$head.parentOffset > 0)
|
|
8299
8299
|
return !1;
|
|
8300
8300
|
let { focusNode: e, focusOffset: t } = n.domSelectionRange();
|
|
8301
8301
|
if (e && e.nodeType == 1 && t == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
|
|
@@ -8496,7 +8496,7 @@ function hp(n) {
|
|
|
8496
8496
|
return t;
|
|
8497
8497
|
}
|
|
8498
8498
|
function pp(n) {
|
|
8499
|
-
let e = n.querySelectorAll(
|
|
8499
|
+
let e = n.querySelectorAll(ue ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
8500
8500
|
for (let t = 0; t < e.length; t++) {
|
|
8501
8501
|
let r = e[t];
|
|
8502
8502
|
r.childNodes.length == 1 && r.textContent == " " && r.parentNode && r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), r);
|
|
@@ -8520,20 +8520,20 @@ function mp(n, e) {
|
|
|
8520
8520
|
}
|
|
8521
8521
|
return new C(s, o, i);
|
|
8522
8522
|
}
|
|
8523
|
-
const
|
|
8523
|
+
const ye = {}, be = {}, gp = { touchstart: !0, touchmove: !0 };
|
|
8524
8524
|
class yp {
|
|
8525
8525
|
constructor() {
|
|
8526
8526
|
this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "" }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
|
|
8527
8527
|
}
|
|
8528
8528
|
}
|
|
8529
8529
|
function bp(n) {
|
|
8530
|
-
for (let e in
|
|
8531
|
-
let t =
|
|
8530
|
+
for (let e in ye) {
|
|
8531
|
+
let t = ye[e];
|
|
8532
8532
|
n.dom.addEventListener(e, n.input.eventHandlers[e] = (r) => {
|
|
8533
|
-
Sp(n, r) && !Ko(n, r) && (n.editable || !(r.type in
|
|
8533
|
+
Sp(n, r) && !Ko(n, r) && (n.editable || !(r.type in be)) && t(n, r);
|
|
8534
8534
|
}, gp[e] ? { passive: !0 } : void 0);
|
|
8535
8535
|
}
|
|
8536
|
-
|
|
8536
|
+
ge && n.dom.addEventListener("input", () => null), go(n);
|
|
8537
8537
|
}
|
|
8538
8538
|
function wt(n, e) {
|
|
8539
8539
|
n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
|
|
@@ -8567,11 +8567,11 @@ function Sp(n, e) {
|
|
|
8567
8567
|
return !0;
|
|
8568
8568
|
}
|
|
8569
8569
|
function kp(n, e) {
|
|
8570
|
-
!Ko(n, e) &&
|
|
8570
|
+
!Ko(n, e) && ye[e.type] && (n.editable || !(e.type in be)) && ye[e.type](n, e);
|
|
8571
8571
|
}
|
|
8572
|
-
|
|
8572
|
+
be.keydown = (n, e) => {
|
|
8573
8573
|
let t = e;
|
|
8574
|
-
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !ru(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(it &&
|
|
8574
|
+
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !ru(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(it && ue && t.keyCode == 13)))
|
|
8575
8575
|
if (t.keyCode != 229 && n.domObserver.forceFlush(), Dn && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
8576
8576
|
let r = Date.now();
|
|
8577
8577
|
n.input.lastIOSEnter = r, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
@@ -8579,10 +8579,10 @@ ye.keydown = (n, e) => {
|
|
|
8579
8579
|
}, 200);
|
|
8580
8580
|
} else n.someProp("handleKeyDown", (r) => r(n, t)) || cp(n, t) ? t.preventDefault() : wt(n, "key");
|
|
8581
8581
|
};
|
|
8582
|
-
|
|
8582
|
+
be.keyup = (n, e) => {
|
|
8583
8583
|
e.keyCode == 16 && (n.input.shiftKey = !1);
|
|
8584
8584
|
};
|
|
8585
|
-
|
|
8585
|
+
be.keypress = (n, e) => {
|
|
8586
8586
|
let t = e;
|
|
8587
8587
|
if (ru(n, t) || !t.charCode || t.ctrlKey && !t.altKey || Re && t.metaKey)
|
|
8588
8588
|
return;
|
|
@@ -8670,7 +8670,7 @@ function Yo(n) {
|
|
|
8670
8670
|
return Hr(n);
|
|
8671
8671
|
}
|
|
8672
8672
|
const nu = Re ? "metaKey" : "ctrlKey";
|
|
8673
|
-
|
|
8673
|
+
ye.mousedown = (n, e) => {
|
|
8674
8674
|
let t = e;
|
|
8675
8675
|
n.input.shiftKey = t.shiftKey;
|
|
8676
8676
|
let r = Yo(n), s = Date.now(), o = "singleClick";
|
|
@@ -8708,14 +8708,14 @@ let Tp = class {
|
|
|
8708
8708
|
return;
|
|
8709
8709
|
let t = this.pos;
|
|
8710
8710
|
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(us(e))), this.updateAllowDefault(e), this.allowDefault || !t ? wt(this.view, "pointer") : Np(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
8711
|
-
|
|
8711
|
+
ge && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
8712
8712
|
// cursor, but still report that the node is selected
|
|
8713
8713
|
// when asked through getSelection. You'll then get a
|
|
8714
8714
|
// situation where clicking at the point where that
|
|
8715
8715
|
// (hidden) cursor is doesn't change the selection, and
|
|
8716
8716
|
// thus doesn't get a reaction from ProseMirror. This
|
|
8717
8717
|
// works around that.
|
|
8718
|
-
|
|
8718
|
+
ue && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (Cn(this.view, $.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : wt(this.view, "pointer");
|
|
8719
8719
|
}
|
|
8720
8720
|
move(e) {
|
|
8721
8721
|
this.updateAllowDefault(e), wt(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
@@ -8724,18 +8724,18 @@ let Tp = class {
|
|
|
8724
8724
|
!this.allowDefault && (Math.abs(this.event.x - e.clientX) > 4 || Math.abs(this.event.y - e.clientY) > 4) && (this.allowDefault = !0);
|
|
8725
8725
|
}
|
|
8726
8726
|
};
|
|
8727
|
-
|
|
8727
|
+
ye.touchstart = (n) => {
|
|
8728
8728
|
n.input.lastTouch = Date.now(), Yo(n), wt(n, "pointer");
|
|
8729
8729
|
};
|
|
8730
|
-
|
|
8730
|
+
ye.touchmove = (n) => {
|
|
8731
8731
|
n.input.lastTouch = Date.now(), wt(n, "pointer");
|
|
8732
8732
|
};
|
|
8733
|
-
|
|
8733
|
+
ye.contextmenu = (n) => Yo(n);
|
|
8734
8734
|
function ru(n, e) {
|
|
8735
|
-
return n.composing ? !0 :
|
|
8735
|
+
return n.composing ? !0 : ge && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
|
|
8736
8736
|
}
|
|
8737
8737
|
const Ap = it ? 5e3 : -1;
|
|
8738
|
-
|
|
8738
|
+
be.compositionstart = be.compositionupdate = (n) => {
|
|
8739
8739
|
if (!n.composing) {
|
|
8740
8740
|
n.domObserver.flush();
|
|
8741
8741
|
let { state: e } = n, t = e.selection.$to;
|
|
@@ -8759,7 +8759,7 @@ ye.compositionstart = ye.compositionupdate = (n) => {
|
|
|
8759
8759
|
}
|
|
8760
8760
|
su(n, Ap);
|
|
8761
8761
|
};
|
|
8762
|
-
|
|
8762
|
+
be.compositionend = (n, e) => {
|
|
8763
8763
|
n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, su(n, 20));
|
|
8764
8764
|
};
|
|
8765
8765
|
function su(n, e) {
|
|
@@ -8811,8 +8811,8 @@ function Pp(n, e) {
|
|
|
8811
8811
|
t.parentNode && t.parentNode.removeChild(t), n.focus();
|
|
8812
8812
|
}, 50);
|
|
8813
8813
|
}
|
|
8814
|
-
const Xn =
|
|
8815
|
-
|
|
8814
|
+
const Xn = ke && Ot < 15 || Dn && Th < 604;
|
|
8815
|
+
ye.copy = be.cut = (n, e) => {
|
|
8816
8816
|
let t = e, r = n.state.selection, s = t.type == "cut";
|
|
8817
8817
|
if (r.empty)
|
|
8818
8818
|
return;
|
|
@@ -8848,7 +8848,7 @@ function iu(n) {
|
|
|
8848
8848
|
let t = n.getData("text/uri-list");
|
|
8849
8849
|
return t ? t.replace(/\r?\n/g, " ") : "";
|
|
8850
8850
|
}
|
|
8851
|
-
|
|
8851
|
+
be.paste = (n, e) => {
|
|
8852
8852
|
let t = e;
|
|
8853
8853
|
if (n.composing && !it)
|
|
8854
8854
|
return;
|
|
@@ -8861,7 +8861,7 @@ let lu = class {
|
|
|
8861
8861
|
}
|
|
8862
8862
|
};
|
|
8863
8863
|
const au = Re ? "altKey" : "ctrlKey";
|
|
8864
|
-
|
|
8864
|
+
ye.dragstart = (n, e) => {
|
|
8865
8865
|
let t = e, r = n.input.mouseDown;
|
|
8866
8866
|
if (r && r.done(), !t.dataTransfer)
|
|
8867
8867
|
return;
|
|
@@ -8875,16 +8875,16 @@ ge.dragstart = (n, e) => {
|
|
|
8875
8875
|
}
|
|
8876
8876
|
}
|
|
8877
8877
|
let l = (i || n.state.selection).content(), { dom: a, text: c, slice: u } = Yc(n, l);
|
|
8878
|
-
(!t.dataTransfer.files.length || !
|
|
8878
|
+
(!t.dataTransfer.files.length || !ue || Ac > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Xn ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Xn || t.dataTransfer.setData("text/plain", c), n.dragging = new lu(u, !t[au], i);
|
|
8879
8879
|
};
|
|
8880
|
-
|
|
8880
|
+
ye.dragend = (n) => {
|
|
8881
8881
|
let e = n.dragging;
|
|
8882
8882
|
window.setTimeout(() => {
|
|
8883
8883
|
n.dragging == e && (n.dragging = null);
|
|
8884
8884
|
}, 50);
|
|
8885
8885
|
};
|
|
8886
|
-
|
|
8887
|
-
|
|
8886
|
+
be.dragover = be.dragenter = (n, e) => e.preventDefault();
|
|
8887
|
+
be.drop = (n, e) => {
|
|
8888
8888
|
let t = e, r = n.dragging;
|
|
8889
8889
|
if (n.dragging = null, !t.dataTransfer)
|
|
8890
8890
|
return;
|
|
@@ -8922,17 +8922,17 @@ ye.drop = (n, e) => {
|
|
|
8922
8922
|
}
|
|
8923
8923
|
n.focus(), n.dispatch(c.setMeta("uiEvent", "drop"));
|
|
8924
8924
|
};
|
|
8925
|
-
|
|
8925
|
+
ye.focus = (n) => {
|
|
8926
8926
|
n.input.lastFocus = Date.now(), n.focused || (n.domObserver.stop(), n.dom.classList.add("ProseMirror-focused"), n.domObserver.start(), n.focused = !0, setTimeout(() => {
|
|
8927
8927
|
n.docView && n.hasFocus() && !n.domObserver.currentSelection.eq(n.domSelectionRange()) && at(n);
|
|
8928
8928
|
}, 20));
|
|
8929
8929
|
};
|
|
8930
|
-
|
|
8930
|
+
ye.blur = (n, e) => {
|
|
8931
8931
|
let t = e;
|
|
8932
8932
|
n.focused && (n.domObserver.stop(), n.dom.classList.remove("ProseMirror-focused"), n.domObserver.start(), t.relatedTarget && n.dom.contains(t.relatedTarget) && n.domObserver.currentSelection.clear(), n.focused = !1);
|
|
8933
8933
|
};
|
|
8934
|
-
|
|
8935
|
-
if (
|
|
8934
|
+
ye.beforeinput = (n, e) => {
|
|
8935
|
+
if (ue && it && e.inputType == "deleteContentBackward") {
|
|
8936
8936
|
n.domObserver.flushSoon();
|
|
8937
8937
|
let { domChangeCount: r } = n.input;
|
|
8938
8938
|
setTimeout(() => {
|
|
@@ -8943,8 +8943,8 @@ ge.beforeinput = (n, e) => {
|
|
|
8943
8943
|
}, 50);
|
|
8944
8944
|
}
|
|
8945
8945
|
};
|
|
8946
|
-
for (let n in
|
|
8947
|
-
|
|
8946
|
+
for (let n in be)
|
|
8947
|
+
ye[n] = be[n];
|
|
8948
8948
|
function Zn(n, e) {
|
|
8949
8949
|
if (n == e)
|
|
8950
8950
|
return !0;
|
|
@@ -9097,7 +9097,7 @@ let U = class mt {
|
|
|
9097
9097
|
you must make a copy if you want need to preserve that.
|
|
9098
9098
|
*/
|
|
9099
9099
|
static create(e, t) {
|
|
9100
|
-
return t.length ? Jr(t, e, 0, Jt) :
|
|
9100
|
+
return t.length ? Jr(t, e, 0, Jt) : ae;
|
|
9101
9101
|
}
|
|
9102
9102
|
/**
|
|
9103
9103
|
Find all decorations in this set which touch the given range
|
|
@@ -9127,7 +9127,7 @@ let U = class mt {
|
|
|
9127
9127
|
document.
|
|
9128
9128
|
*/
|
|
9129
9129
|
map(e, t, r) {
|
|
9130
|
-
return this ==
|
|
9130
|
+
return this == ae || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, r || Jt);
|
|
9131
9131
|
}
|
|
9132
9132
|
/**
|
|
9133
9133
|
@internal
|
|
@@ -9138,7 +9138,7 @@ let U = class mt {
|
|
|
9138
9138
|
let a = this.local[l].map(e, r, s);
|
|
9139
9139
|
a && a.type.valid(t, a) ? (i || (i = [])).push(a) : o.onRemove && o.onRemove(this.local[l].spec);
|
|
9140
9140
|
}
|
|
9141
|
-
return this.children.length ? zp(this.children, i || [], e, t, r, s, o) : i ? new mt(i.sort(Kt), hn) :
|
|
9141
|
+
return this.children.length ? zp(this.children, i || [], e, t, r, s, o) : i ? new mt(i.sort(Kt), hn) : ae;
|
|
9142
9142
|
}
|
|
9143
9143
|
/**
|
|
9144
9144
|
Add the given array of decorations to the ones in the set,
|
|
@@ -9147,7 +9147,7 @@ let U = class mt {
|
|
|
9147
9147
|
structure.
|
|
9148
9148
|
*/
|
|
9149
9149
|
add(e, t) {
|
|
9150
|
-
return t.length ? this ==
|
|
9150
|
+
return t.length ? this == ae ? mt.create(e, t) : this.addInner(e, t, 0) : this;
|
|
9151
9151
|
}
|
|
9152
9152
|
addInner(e, t, r) {
|
|
9153
9153
|
let s, o = 0;
|
|
@@ -9169,7 +9169,7 @@ let U = class mt {
|
|
|
9169
9169
|
the ones in the given array.
|
|
9170
9170
|
*/
|
|
9171
9171
|
remove(e) {
|
|
9172
|
-
return e.length == 0 || this ==
|
|
9172
|
+
return e.length == 0 || this == ae ? this : this.removeInner(e, 0);
|
|
9173
9173
|
}
|
|
9174
9174
|
removeInner(e, t) {
|
|
9175
9175
|
let r = this.children, s = this.local;
|
|
@@ -9181,7 +9181,7 @@ let U = class mt {
|
|
|
9181
9181
|
continue;
|
|
9182
9182
|
r == this.children && (r = this.children.slice());
|
|
9183
9183
|
let c = r[o + 2].removeInner(i, l + 1);
|
|
9184
|
-
c !=
|
|
9184
|
+
c != ae ? r[o + 2] = c : (r.splice(o, 3), o -= 3);
|
|
9185
9185
|
}
|
|
9186
9186
|
if (s.length) {
|
|
9187
9187
|
for (let o = 0, i; o < e.length; o++)
|
|
@@ -9189,10 +9189,10 @@ let U = class mt {
|
|
|
9189
9189
|
for (let l = 0; l < s.length; l++)
|
|
9190
9190
|
s[l].eq(i, t) && (s == this.local && (s = this.local.slice()), s.splice(l--, 1));
|
|
9191
9191
|
}
|
|
9192
|
-
return r == this.children && s == this.local ? this : s.length || r.length ? new mt(s, r) :
|
|
9192
|
+
return r == this.children && s == this.local ? this : s.length || r.length ? new mt(s, r) : ae;
|
|
9193
9193
|
}
|
|
9194
9194
|
forChild(e, t) {
|
|
9195
|
-
if (this ==
|
|
9195
|
+
if (this == ae)
|
|
9196
9196
|
return this;
|
|
9197
9197
|
if (t.isLeaf)
|
|
9198
9198
|
return mt.empty;
|
|
@@ -9214,7 +9214,7 @@ let U = class mt {
|
|
|
9214
9214
|
let l = new mt(s.sort(Kt), hn);
|
|
9215
9215
|
return r ? new fu([l, r]) : l;
|
|
9216
9216
|
}
|
|
9217
|
-
return r ||
|
|
9217
|
+
return r || ae;
|
|
9218
9218
|
}
|
|
9219
9219
|
/**
|
|
9220
9220
|
@internal
|
|
@@ -9242,7 +9242,7 @@ let U = class mt {
|
|
|
9242
9242
|
@internal
|
|
9243
9243
|
*/
|
|
9244
9244
|
localsInner(e) {
|
|
9245
|
-
if (this ==
|
|
9245
|
+
if (this == ae)
|
|
9246
9246
|
return hn;
|
|
9247
9247
|
if (e.inlineContent || !this.local.some(_n.is))
|
|
9248
9248
|
return this.local;
|
|
@@ -9257,7 +9257,7 @@ let U = class mt {
|
|
|
9257
9257
|
};
|
|
9258
9258
|
U.empty = new U([], []);
|
|
9259
9259
|
U.removeOverlap = Go;
|
|
9260
|
-
const
|
|
9260
|
+
const ae = U.empty;
|
|
9261
9261
|
let fu = class pn {
|
|
9262
9262
|
constructor(e) {
|
|
9263
9263
|
this.members = e;
|
|
@@ -9272,7 +9272,7 @@ let fu = class pn {
|
|
|
9272
9272
|
let r = [];
|
|
9273
9273
|
for (let s = 0; s < this.members.length; s++) {
|
|
9274
9274
|
let o = this.members[s].forChild(e, t);
|
|
9275
|
-
o !=
|
|
9275
|
+
o != ae && (o instanceof pn ? r = r.concat(o.members) : r.push(o));
|
|
9276
9276
|
}
|
|
9277
9277
|
return pn.from(r);
|
|
9278
9278
|
}
|
|
@@ -9304,7 +9304,7 @@ let fu = class pn {
|
|
|
9304
9304
|
static from(e) {
|
|
9305
9305
|
switch (e.length) {
|
|
9306
9306
|
case 0:
|
|
9307
|
-
return
|
|
9307
|
+
return ae;
|
|
9308
9308
|
case 1:
|
|
9309
9309
|
return e[0];
|
|
9310
9310
|
default:
|
|
@@ -9347,7 +9347,7 @@ function zp(n, e, t, r, s, o, i) {
|
|
|
9347
9347
|
let d = t.map(n[c + 1] + o, -1), h = d - s, { index: p, offset: y } = r.content.findIndex(f), m = r.maybeChild(p);
|
|
9348
9348
|
if (m && y == f && y + m.nodeSize == h) {
|
|
9349
9349
|
let x = l[c + 2].mapInner(t, m, u + 1, n[c] + o + 1, i);
|
|
9350
|
-
x !=
|
|
9350
|
+
x != ae ? (l[c] = f, l[c + 1] = h, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
|
|
9351
9351
|
} else
|
|
9352
9352
|
a = !0;
|
|
9353
9353
|
}
|
|
@@ -9409,13 +9409,13 @@ function Jr(n, e, t, r) {
|
|
|
9409
9409
|
if (c) {
|
|
9410
9410
|
o = !0;
|
|
9411
9411
|
let u = Jr(c, l, t + a + 1, r);
|
|
9412
|
-
u !=
|
|
9412
|
+
u != ae && s.push(a, a + l.nodeSize, u);
|
|
9413
9413
|
}
|
|
9414
9414
|
});
|
|
9415
9415
|
let i = du(o ? pu(n) : n, -t).sort(Kt);
|
|
9416
9416
|
for (let l = 0; l < i.length; l++)
|
|
9417
9417
|
i[l].type.valid(e, i[l]) || (r.onRemove && r.onRemove(i[l].spec), i.splice(l--, 1));
|
|
9418
|
-
return i.length || s.length ? new U(i, s) :
|
|
9418
|
+
return i.length || s.length ? new U(i, s) : ae;
|
|
9419
9419
|
}
|
|
9420
9420
|
function Kt(n, e) {
|
|
9421
9421
|
return n.from - e.from || n.to - e.to;
|
|
@@ -9447,7 +9447,7 @@ function Ls(n) {
|
|
|
9447
9447
|
let e = [];
|
|
9448
9448
|
return n.someProp("decorations", (t) => {
|
|
9449
9449
|
let r = t(n.state);
|
|
9450
|
-
r && r !=
|
|
9450
|
+
r && r != ae && e.push(r);
|
|
9451
9451
|
}), n.cursorWrapper && e.push(U.create(n.state.doc, [n.cursorWrapper.deco])), fu.from(e);
|
|
9452
9452
|
}
|
|
9453
9453
|
const Fp = {
|
|
@@ -9457,7 +9457,7 @@ const Fp = {
|
|
|
9457
9457
|
attributes: !0,
|
|
9458
9458
|
attributeOldValue: !0,
|
|
9459
9459
|
subtree: !0
|
|
9460
|
-
}, Bp =
|
|
9460
|
+
}, Bp = ke && Ot <= 11;
|
|
9461
9461
|
let Lp = class {
|
|
9462
9462
|
constructor() {
|
|
9463
9463
|
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
|
|
@@ -9477,7 +9477,7 @@ class Wp {
|
|
|
9477
9477
|
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Lp(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
|
|
9478
9478
|
for (let s = 0; s < r.length; s++)
|
|
9479
9479
|
this.queue.push(r[s]);
|
|
9480
|
-
|
|
9480
|
+
ke && Ot <= 11 && r.some((s) => s.type == "childList" && s.removedNodes.length || s.type == "characterData" && s.oldValue.length > s.target.nodeValue.length) ? this.flushSoon() : this.flush();
|
|
9481
9481
|
}), Bp && (this.onCharData = (r) => {
|
|
9482
9482
|
this.queue.push({ target: r.target, type: "characterData", oldValue: r.prevValue }), this.flushSoon();
|
|
9483
9483
|
}), this.onSelectionChange = this.onSelectionChange.bind(this);
|
|
@@ -9518,7 +9518,7 @@ class Wp {
|
|
|
9518
9518
|
if (yl(this.view)) {
|
|
9519
9519
|
if (this.suppressingSelectionUpdates)
|
|
9520
9520
|
return at(this.view);
|
|
9521
|
-
if (
|
|
9521
|
+
if (ke && Ot <= 11 && !this.view.state.selection.empty) {
|
|
9522
9522
|
let e = this.view.domSelectionRange();
|
|
9523
9523
|
if (e.focusNode && Zt(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
|
|
9524
9524
|
return this.flushSoon();
|
|
@@ -9596,12 +9596,12 @@ class Wp {
|
|
|
9596
9596
|
if (r.contentDOM && r.contentDOM != r.dom && !r.contentDOM.contains(e.target))
|
|
9597
9597
|
return { from: r.posBefore, to: r.posAfter };
|
|
9598
9598
|
let s = e.previousSibling, o = e.nextSibling;
|
|
9599
|
-
if (
|
|
9599
|
+
if (ke && Ot <= 11 && e.addedNodes.length)
|
|
9600
9600
|
for (let u = 0; u < e.addedNodes.length; u++) {
|
|
9601
9601
|
let { previousSibling: f, nextSibling: d } = e.addedNodes[u];
|
|
9602
9602
|
(!f || Array.prototype.indexOf.call(e.addedNodes, f) < 0) && (s = f), (!d || Array.prototype.indexOf.call(e.addedNodes, d) < 0) && (o = d);
|
|
9603
9603
|
}
|
|
9604
|
-
let i = s && s.parentNode == e.target ?
|
|
9604
|
+
let i = s && s.parentNode == e.target ? re(s) + 1 : 0, l = r.localPosFromDOM(e.target, i, -1), a = o && o.parentNode == e.target ? re(o) : e.target.childNodes.length, c = r.localPosFromDOM(e.target, a, 1);
|
|
9605
9605
|
return { from: l, to: c };
|
|
9606
9606
|
} else return e.type == "attributes" ? { from: r.posAtStart - r.border, to: r.posAtEnd + r.border } : (this.lastChangedTextNode = e.target, {
|
|
9607
9607
|
from: r.posAtStart,
|
|
@@ -9648,7 +9648,7 @@ function Hp(n, e) {
|
|
|
9648
9648
|
}
|
|
9649
9649
|
function Jp(n, e, t) {
|
|
9650
9650
|
let { node: r, fromOffset: s, toOffset: o, from: i, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, u = a.anchorNode;
|
|
9651
|
-
if (u && n.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: a.anchorOffset }], cs(a) || c.push({ node: a.focusNode, offset: a.focusOffset })),
|
|
9651
|
+
if (u && n.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: a.anchorOffset }], cs(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), ue && n.input.lastKeyCode === 8)
|
|
9652
9652
|
for (let m = o; m > s; m--) {
|
|
9653
9653
|
let x = r.childNodes[m - 1], k = x.pmViewDesc;
|
|
9654
9654
|
if (x.nodeName == "BR" && !k) {
|
|
@@ -9680,10 +9680,10 @@ function Kp(n) {
|
|
|
9680
9680
|
if (e)
|
|
9681
9681
|
return e.parseRule();
|
|
9682
9682
|
if (n.nodeName == "BR" && n.parentNode) {
|
|
9683
|
-
if (
|
|
9683
|
+
if (ge && /^(ul|ol)$/i.test(n.parentNode.nodeName)) {
|
|
9684
9684
|
let t = document.createElement("div");
|
|
9685
9685
|
return t.appendChild(document.createElement("li")), { skip: t };
|
|
9686
|
-
} else if (n.parentNode.lastChild == n ||
|
|
9686
|
+
} else if (n.parentNode.lastChild == n || ge && /^(tr|table)$/i.test(n.parentNode.nodeName))
|
|
9687
9687
|
return { ignore: !0 };
|
|
9688
9688
|
} else if (n.nodeName == "IMG" && n.getAttribute("mark-placeholder"))
|
|
9689
9689
|
return { ignore: !0 };
|
|
@@ -9693,12 +9693,12 @@ const Up = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|df
|
|
|
9693
9693
|
function Yp(n, e, t, r, s) {
|
|
9694
9694
|
let o = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
|
|
9695
9695
|
if (n.input.compositionPendingChanges = 0, e < 0) {
|
|
9696
|
-
let
|
|
9697
|
-
if (
|
|
9698
|
-
if (
|
|
9696
|
+
let D = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, L = Ho(n, D);
|
|
9697
|
+
if (L && !n.state.selection.eq(L)) {
|
|
9698
|
+
if (ue && it && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (dt) => dt(n, Lt(13, "Enter"))))
|
|
9699
9699
|
return;
|
|
9700
|
-
let
|
|
9701
|
-
|
|
9700
|
+
let ee = n.state.tr.setSelection(L);
|
|
9701
|
+
D == "pointer" ? ee.setMeta("pointer", !0) : D == "key" && ee.scrollIntoView(), o && ee.setMeta("composition", o), n.dispatch(ee);
|
|
9702
9702
|
}
|
|
9703
9703
|
return;
|
|
9704
9704
|
}
|
|
@@ -9707,7 +9707,7 @@ function Yp(n, e, t, r, s) {
|
|
|
9707
9707
|
let a = n.state.selection, c = Jp(n, e, t), u = n.state.doc, f = u.slice(c.from, c.to), d, h;
|
|
9708
9708
|
n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (d = n.state.selection.to, h = "end") : (d = n.state.selection.from, h = "start"), n.input.lastKeyCode = null;
|
|
9709
9709
|
let p = Qp(f.content, c.doc.content, c.from, d, h);
|
|
9710
|
-
if (p && n.input.domChangeCount++, (Dn && n.input.lastIOSEnter > Date.now() - 225 || it) && s.some((
|
|
9710
|
+
if (p && n.input.domChangeCount++, (Dn && n.input.lastIOSEnter > Date.now() - 225 || it) && s.some((D) => D.nodeType == 1 && !Up.test(D.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (D) => D(n, Lt(13, "Enter")))) {
|
|
9711
9711
|
n.input.lastIOSEnter = 0;
|
|
9712
9712
|
return;
|
|
9713
9713
|
}
|
|
@@ -9716,50 +9716,50 @@ function Yp(n, e, t, r, s) {
|
|
|
9716
9716
|
p = { start: a.from, endA: a.to, endB: a.to };
|
|
9717
9717
|
else {
|
|
9718
9718
|
if (c.sel) {
|
|
9719
|
-
let
|
|
9720
|
-
if (
|
|
9721
|
-
let
|
|
9722
|
-
o &&
|
|
9719
|
+
let D = Al(n, n.state.doc, c.sel);
|
|
9720
|
+
if (D && !D.eq(n.state.selection)) {
|
|
9721
|
+
let L = n.state.tr.setSelection(D);
|
|
9722
|
+
o && L.setMeta("composition", o), n.dispatch(L);
|
|
9723
9723
|
}
|
|
9724
9724
|
}
|
|
9725
9725
|
return;
|
|
9726
9726
|
}
|
|
9727
|
-
n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof V && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)),
|
|
9727
|
+
n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof V && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)), ke && Ot <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == " " && (p.start--, p.endA--, p.endB--);
|
|
9728
9728
|
let y = c.doc.resolveNoCache(p.start - c.from), m = c.doc.resolveNoCache(p.endB - c.from), x = u.resolve(p.start), k = y.sameParent(m) && y.parent.inlineContent && x.end() >= p.endA, M;
|
|
9729
|
-
if ((Dn && n.input.lastIOSEnter > Date.now() - 225 && (!k || s.some((
|
|
9729
|
+
if ((Dn && n.input.lastIOSEnter > Date.now() - 225 && (!k || s.some((D) => D.nodeName == "DIV" || D.nodeName == "P")) || !k && y.pos < c.doc.content.size && !y.sameParent(m) && (M = $.findFrom(c.doc.resolve(y.pos + 1), 1, !0)) && M.head == m.pos) && n.someProp("handleKeyDown", (D) => D(n, Lt(13, "Enter")))) {
|
|
9730
9730
|
n.input.lastIOSEnter = 0;
|
|
9731
9731
|
return;
|
|
9732
9732
|
}
|
|
9733
|
-
if (n.state.selection.anchor > p.start && Xp(u, p.start, p.endA, y, m) && n.someProp("handleKeyDown", (
|
|
9734
|
-
it &&
|
|
9733
|
+
if (n.state.selection.anchor > p.start && Xp(u, p.start, p.endA, y, m) && n.someProp("handleKeyDown", (D) => D(n, Lt(8, "Backspace")))) {
|
|
9734
|
+
it && ue && n.domObserver.suppressSelectionUpdates();
|
|
9735
9735
|
return;
|
|
9736
9736
|
}
|
|
9737
|
-
|
|
9738
|
-
n.someProp("handleKeyDown", function(
|
|
9739
|
-
return
|
|
9737
|
+
ue && p.endB == p.start && (n.input.lastChromeDelete = Date.now()), it && !k && y.start() != m.start() && m.parentOffset == 0 && y.depth == m.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, m = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
|
|
9738
|
+
n.someProp("handleKeyDown", function(D) {
|
|
9739
|
+
return D(n, Lt(13, "Enter"));
|
|
9740
9740
|
});
|
|
9741
9741
|
}, 20));
|
|
9742
|
-
let
|
|
9742
|
+
let P = p.start, z = p.endA, R, B, v;
|
|
9743
9743
|
if (k) {
|
|
9744
9744
|
if (y.pos == m.pos)
|
|
9745
|
-
|
|
9745
|
+
ke && Ot <= 11 && y.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => at(n), 20)), R = n.state.tr.delete(P, z), B = u.resolve(p.start).marksAcross(u.resolve(p.endA));
|
|
9746
9746
|
else if (
|
|
9747
9747
|
// Adding or removing a mark
|
|
9748
|
-
p.endA == p.endB && (
|
|
9748
|
+
p.endA == p.endB && (v = Gp(y.parent.content.cut(y.parentOffset, m.parentOffset), x.parent.content.cut(x.parentOffset, p.endA - x.start())))
|
|
9749
9749
|
)
|
|
9750
|
-
|
|
9750
|
+
R = n.state.tr, v.type == "add" ? R.addMark(P, z, v.mark) : R.removeMark(P, z, v.mark);
|
|
9751
9751
|
else if (y.parent.child(y.index()).isText && y.index() == m.index() - (m.textOffset ? 0 : 1)) {
|
|
9752
|
-
let
|
|
9753
|
-
if (n.someProp("handleTextInput", (
|
|
9752
|
+
let D = y.parent.textBetween(y.parentOffset, m.parentOffset);
|
|
9753
|
+
if (n.someProp("handleTextInput", (L) => L(n, P, z, D)))
|
|
9754
9754
|
return;
|
|
9755
|
-
|
|
9755
|
+
R = n.state.tr.insertText(D, P, z);
|
|
9756
9756
|
}
|
|
9757
9757
|
}
|
|
9758
|
-
if (
|
|
9759
|
-
let
|
|
9760
|
-
|
|
9758
|
+
if (R || (R = n.state.tr.replace(P, z, c.doc.slice(p.start - c.from, p.endB - c.from))), c.sel) {
|
|
9759
|
+
let D = Al(n, R.doc, c.sel);
|
|
9760
|
+
D && !(ue && n.composing && D.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (D.head == P || D.head == R.mapping.map(z) - 1) || ke && D.empty && D.head == P) && R.setSelection(D);
|
|
9761
9761
|
}
|
|
9762
|
-
B &&
|
|
9762
|
+
B && R.ensureMarks(B), o && R.setMeta("composition", o), n.dispatch(R.scrollIntoView());
|
|
9763
9763
|
}
|
|
9764
9764
|
function Al(n, e, t) {
|
|
9765
9765
|
return Math.max(t.anchor, t.head) > e.content.size ? null : Jo(n, e.resolve(t.anchor), e.resolve(t.head));
|
|
@@ -9911,9 +9911,9 @@ class Zp {
|
|
|
9911
9911
|
let d = u == "preserve" && i && this.dom.style.overflowAnchor == null && Ih(this);
|
|
9912
9912
|
if (i) {
|
|
9913
9913
|
this.domObserver.stop();
|
|
9914
|
-
let h = f && (
|
|
9914
|
+
let h = f && (ke || ue) && !this.composing && !s.selection.empty && !e.selection.empty && em(s.selection, e.selection);
|
|
9915
9915
|
if (f) {
|
|
9916
|
-
let p =
|
|
9916
|
+
let p = ue ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
9917
9917
|
this.composing && (this.input.compositionNode = Rp(this)), (o || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = fl(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (h = !0);
|
|
9918
9918
|
}
|
|
9919
9919
|
h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && np(this)) ? at(this, h) : (Jc(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
@@ -9984,7 +9984,7 @@ class Zp {
|
|
|
9984
9984
|
Query whether the view has focus.
|
|
9985
9985
|
*/
|
|
9986
9986
|
hasFocus() {
|
|
9987
|
-
if (
|
|
9987
|
+
if (ke) {
|
|
9988
9988
|
let e = this.root.activeElement;
|
|
9989
9989
|
if (e == this.dom)
|
|
9990
9990
|
return !0;
|
|
@@ -10157,7 +10157,7 @@ class Zp {
|
|
|
10157
10157
|
*/
|
|
10158
10158
|
domSelectionRange() {
|
|
10159
10159
|
let e = this.domSelection();
|
|
10160
|
-
return e ?
|
|
10160
|
+
return e ? ge && this.root.nodeType === 11 && Dh(this.dom.ownerDocument) == this.dom && qp(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
|
|
10161
10161
|
}
|
|
10162
10162
|
/**
|
|
10163
10163
|
@internal
|
|
@@ -10463,7 +10463,7 @@ function ym(n, e, t, r, s) {
|
|
|
10463
10463
|
let o = S.empty;
|
|
10464
10464
|
for (let u = t.length - 1; u >= 0; u--)
|
|
10465
10465
|
o = S.from(t[u].type.create(t[u].attrs, o));
|
|
10466
|
-
n.step(new
|
|
10466
|
+
n.step(new oe(e.start - (r ? 2 : 0), e.end, e.start, e.end, new C(o, 0, 0), t.length, !0));
|
|
10467
10467
|
let i = 0;
|
|
10468
10468
|
for (let u = 0; u < t.length; u++)
|
|
10469
10469
|
t[u].type == s && (i = u + 1);
|
|
@@ -10510,7 +10510,7 @@ function xm(n) {
|
|
|
10510
10510
|
}
|
|
10511
10511
|
function Sm(n, e, t, r) {
|
|
10512
10512
|
let s = n.tr, o = r.end, i = r.$to.end(r.depth);
|
|
10513
|
-
o < i && (s.step(new
|
|
10513
|
+
o < i && (s.step(new oe(o - 1, i, o, i, new C(S.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new zr(s.doc.resolve(r.$from.pos), s.doc.resolve(i), r.depth));
|
|
10514
10514
|
const l = lr(r);
|
|
10515
10515
|
if (l == null)
|
|
10516
10516
|
return !1;
|
|
@@ -10529,7 +10529,7 @@ function km(n, e, t) {
|
|
|
10529
10529
|
if (!c.canReplace(u + (l ? 0 : 1), u + 1, i.content.append(a ? S.empty : S.from(s))))
|
|
10530
10530
|
return !1;
|
|
10531
10531
|
let f = o.pos, d = f + i.nodeSize;
|
|
10532
|
-
return r.step(new
|
|
10532
|
+
return r.step(new oe(f - (l ? 1 : 0), d + (a ? 1 : 0), f + 1, d - 1, new C((l ? S.empty : S.from(s.copy(S.empty))).append(a ? S.empty : S.from(s.copy(S.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
|
|
10533
10533
|
}
|
|
10534
10534
|
function Cm(n) {
|
|
10535
10535
|
return function(e, t) {
|
|
@@ -10544,7 +10544,7 @@ function Cm(n) {
|
|
|
10544
10544
|
return !1;
|
|
10545
10545
|
if (t) {
|
|
10546
10546
|
let c = a.lastChild && a.lastChild.type == l.type, u = S.from(c ? n.create() : null), f = new C(S.from(n.create(null, S.from(l.type.create(null, u)))), c ? 3 : 1, 0), d = o.start, h = o.end;
|
|
10547
|
-
t(e.tr.step(new
|
|
10547
|
+
t(e.tr.step(new oe(d - (c ? 3 : 1), h, d, h, f, 1, !0)).scrollIntoView());
|
|
10548
10548
|
}
|
|
10549
10549
|
return !0;
|
|
10550
10550
|
};
|
|
@@ -11118,7 +11118,7 @@ function Kl(n, e, t) {
|
|
|
11118
11118
|
return bt(n, i);
|
|
11119
11119
|
}
|
|
11120
11120
|
if (!s.parent.inlineContent) {
|
|
11121
|
-
let i = e < 0 ? s : o, l = r instanceof
|
|
11121
|
+
let i = e < 0 ? s : o, l = r instanceof Se ? $.near(i, e) : $.findFrom(i, e);
|
|
11122
11122
|
return l ? bt(n, l) : !1;
|
|
11123
11123
|
}
|
|
11124
11124
|
return !1;
|
|
@@ -11889,7 +11889,7 @@ class Q {
|
|
|
11889
11889
|
you must make a copy if you want need to preserve that.
|
|
11890
11890
|
*/
|
|
11891
11891
|
static create(e, t) {
|
|
11892
|
-
return t.length ? Qr(t, e, 0, Ut) :
|
|
11892
|
+
return t.length ? Qr(t, e, 0, Ut) : pe;
|
|
11893
11893
|
}
|
|
11894
11894
|
/**
|
|
11895
11895
|
Find all decorations in this set which touch the given range
|
|
@@ -11919,7 +11919,7 @@ class Q {
|
|
|
11919
11919
|
document.
|
|
11920
11920
|
*/
|
|
11921
11921
|
map(e, t, r) {
|
|
11922
|
-
return this ==
|
|
11922
|
+
return this == pe || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, r || Ut);
|
|
11923
11923
|
}
|
|
11924
11924
|
/**
|
|
11925
11925
|
@internal
|
|
@@ -11930,7 +11930,7 @@ class Q {
|
|
|
11930
11930
|
let a = this.local[l].map(e, r, s);
|
|
11931
11931
|
a && a.type.valid(t, a) ? (i || (i = [])).push(a) : o.onRemove && o.onRemove(this.local[l].spec);
|
|
11932
11932
|
}
|
|
11933
|
-
return this.children.length ? Ag(this.children, i || [], e, t, r, s, o) : i ? new Q(i.sort(Yt), mn) :
|
|
11933
|
+
return this.children.length ? Ag(this.children, i || [], e, t, r, s, o) : i ? new Q(i.sort(Yt), mn) : pe;
|
|
11934
11934
|
}
|
|
11935
11935
|
/**
|
|
11936
11936
|
Add the given array of decorations to the ones in the set,
|
|
@@ -11939,7 +11939,7 @@ class Q {
|
|
|
11939
11939
|
structure.
|
|
11940
11940
|
*/
|
|
11941
11941
|
add(e, t) {
|
|
11942
|
-
return t.length ? this ==
|
|
11942
|
+
return t.length ? this == pe ? Q.create(e, t) : this.addInner(e, t, 0) : this;
|
|
11943
11943
|
}
|
|
11944
11944
|
addInner(e, t, r) {
|
|
11945
11945
|
let s, o = 0;
|
|
@@ -11961,7 +11961,7 @@ class Q {
|
|
|
11961
11961
|
the ones in the given array.
|
|
11962
11962
|
*/
|
|
11963
11963
|
remove(e) {
|
|
11964
|
-
return e.length == 0 || this ==
|
|
11964
|
+
return e.length == 0 || this == pe ? this : this.removeInner(e, 0);
|
|
11965
11965
|
}
|
|
11966
11966
|
removeInner(e, t) {
|
|
11967
11967
|
let r = this.children, s = this.local;
|
|
@@ -11973,7 +11973,7 @@ class Q {
|
|
|
11973
11973
|
continue;
|
|
11974
11974
|
r == this.children && (r = this.children.slice());
|
|
11975
11975
|
let c = r[o + 2].removeInner(i, l + 1);
|
|
11976
|
-
c !=
|
|
11976
|
+
c != pe ? r[o + 2] = c : (r.splice(o, 3), o -= 3);
|
|
11977
11977
|
}
|
|
11978
11978
|
if (s.length) {
|
|
11979
11979
|
for (let o = 0, i; o < e.length; o++)
|
|
@@ -11981,10 +11981,10 @@ class Q {
|
|
|
11981
11981
|
for (let l = 0; l < s.length; l++)
|
|
11982
11982
|
s[l].eq(i, t) && (s == this.local && (s = this.local.slice()), s.splice(l--, 1));
|
|
11983
11983
|
}
|
|
11984
|
-
return r == this.children && s == this.local ? this : s.length || r.length ? new Q(s, r) :
|
|
11984
|
+
return r == this.children && s == this.local ? this : s.length || r.length ? new Q(s, r) : pe;
|
|
11985
11985
|
}
|
|
11986
11986
|
forChild(e, t) {
|
|
11987
|
-
if (this ==
|
|
11987
|
+
if (this == pe)
|
|
11988
11988
|
return this;
|
|
11989
11989
|
if (t.isLeaf)
|
|
11990
11990
|
return Q.empty;
|
|
@@ -12006,7 +12006,7 @@ class Q {
|
|
|
12006
12006
|
let l = new Q(s.sort(Yt), mn);
|
|
12007
12007
|
return r ? new Tg([l, r]) : l;
|
|
12008
12008
|
}
|
|
12009
|
-
return r ||
|
|
12009
|
+
return r || pe;
|
|
12010
12010
|
}
|
|
12011
12011
|
/**
|
|
12012
12012
|
@internal
|
|
@@ -12034,7 +12034,7 @@ class Q {
|
|
|
12034
12034
|
@internal
|
|
12035
12035
|
*/
|
|
12036
12036
|
localsInner(e) {
|
|
12037
|
-
if (this ==
|
|
12037
|
+
if (this == pe)
|
|
12038
12038
|
return mn;
|
|
12039
12039
|
if (e.inlineContent || !this.local.some(Et.is))
|
|
12040
12040
|
return this.local;
|
|
@@ -12049,7 +12049,7 @@ class Q {
|
|
|
12049
12049
|
}
|
|
12050
12050
|
Q.empty = new Q([], []);
|
|
12051
12051
|
Q.removeOverlap = ii;
|
|
12052
|
-
const
|
|
12052
|
+
const pe = Q.empty;
|
|
12053
12053
|
let Tg = class gn {
|
|
12054
12054
|
constructor(e) {
|
|
12055
12055
|
this.members = e;
|
|
@@ -12064,7 +12064,7 @@ let Tg = class gn {
|
|
|
12064
12064
|
let r = [];
|
|
12065
12065
|
for (let s = 0; s < this.members.length; s++) {
|
|
12066
12066
|
let o = this.members[s].forChild(e, t);
|
|
12067
|
-
o !=
|
|
12067
|
+
o != pe && (o instanceof gn ? r = r.concat(o.members) : r.push(o));
|
|
12068
12068
|
}
|
|
12069
12069
|
return gn.from(r);
|
|
12070
12070
|
}
|
|
@@ -12096,7 +12096,7 @@ let Tg = class gn {
|
|
|
12096
12096
|
static from(e) {
|
|
12097
12097
|
switch (e.length) {
|
|
12098
12098
|
case 0:
|
|
12099
|
-
return
|
|
12099
|
+
return pe;
|
|
12100
12100
|
case 1:
|
|
12101
12101
|
return e[0];
|
|
12102
12102
|
default:
|
|
@@ -12139,7 +12139,7 @@ function Ag(n, e, t, r, s, o, i) {
|
|
|
12139
12139
|
let d = t.map(n[c + 1] + o, -1), h = d - s, { index: p, offset: y } = r.content.findIndex(f), m = r.maybeChild(p);
|
|
12140
12140
|
if (m && y == f && y + m.nodeSize == h) {
|
|
12141
12141
|
let x = l[c + 2].mapInner(t, m, u + 1, n[c] + o + 1, i);
|
|
12142
|
-
x !=
|
|
12142
|
+
x != pe ? (l[c] = f, l[c + 1] = h, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
|
|
12143
12143
|
} else
|
|
12144
12144
|
a = !0;
|
|
12145
12145
|
}
|
|
@@ -12201,13 +12201,13 @@ function Qr(n, e, t, r) {
|
|
|
12201
12201
|
if (c) {
|
|
12202
12202
|
o = !0;
|
|
12203
12203
|
let u = Qr(c, l, t + a + 1, r);
|
|
12204
|
-
u !=
|
|
12204
|
+
u != pe && s.push(a, a + l.nodeSize, u);
|
|
12205
12205
|
}
|
|
12206
12206
|
});
|
|
12207
12207
|
let i = zu(o ? Fu(n) : n, -t).sort(Yt);
|
|
12208
12208
|
for (let l = 0; l < i.length; l++)
|
|
12209
12209
|
i[l].type.valid(e, i[l]) || (r.onRemove && r.onRemove(i[l].spec), i.splice(l--, 1));
|
|
12210
|
-
return i.length || s.length ? new Q(i, s) :
|
|
12210
|
+
return i.length || s.length ? new Q(i, s) : pe;
|
|
12211
12211
|
}
|
|
12212
12212
|
function Yt(n, e) {
|
|
12213
12213
|
return n.from - e.from || n.to - e.to;
|
|
@@ -12247,7 +12247,7 @@ if (typeof WeakMap < "u") {
|
|
|
12247
12247
|
if (n[s] == r) return n[s + 1];
|
|
12248
12248
|
}, Do = (r, s) => (t == 10 && (t = 0), n[t++] = r, n[t++] = s);
|
|
12249
12249
|
}
|
|
12250
|
-
var
|
|
12250
|
+
var se = class {
|
|
12251
12251
|
constructor(n, e, t, r) {
|
|
12252
12252
|
this.width = n, this.height = e, this.map = t, this.problems = r;
|
|
12253
12253
|
}
|
|
@@ -12352,18 +12352,18 @@ function Ig(n) {
|
|
|
12352
12352
|
});
|
|
12353
12353
|
break;
|
|
12354
12354
|
}
|
|
12355
|
-
const
|
|
12356
|
-
for (let
|
|
12357
|
-
r[
|
|
12355
|
+
const P = s + M * e;
|
|
12356
|
+
for (let z = 0; z < m; z++) {
|
|
12357
|
+
r[P + z] == 0 ? r[P + z] = u : (o || (o = [])).push({
|
|
12358
12358
|
type: "collision",
|
|
12359
12359
|
row: c,
|
|
12360
12360
|
pos: u,
|
|
12361
|
-
n: m -
|
|
12361
|
+
n: m - z
|
|
12362
12362
|
});
|
|
12363
|
-
const
|
|
12364
|
-
if (
|
|
12365
|
-
const B = (
|
|
12366
|
-
|
|
12363
|
+
const R = k && k[z];
|
|
12364
|
+
if (R) {
|
|
12365
|
+
const B = (P + z) % e * 2, v = i[B];
|
|
12366
|
+
v == null || v != R && i[B + 1] == 1 ? (i[B] = R, i[B + 1] = 1) : v == R && i[B + 1]++;
|
|
12367
12367
|
}
|
|
12368
12368
|
}
|
|
12369
12369
|
}
|
|
@@ -12375,7 +12375,7 @@ function Ig(n) {
|
|
|
12375
12375
|
h && (o || (o = [])).push({ type: "missing", row: c, n: h }), u++;
|
|
12376
12376
|
}
|
|
12377
12377
|
(e === 0 || t === 0) && (o || (o = [])).push({ type: "zero_sized" });
|
|
12378
|
-
const l = new
|
|
12378
|
+
const l = new se(e, t, r, o);
|
|
12379
12379
|
let a = !1;
|
|
12380
12380
|
for (let c = 0; !a && c < i.length; c += 2)
|
|
12381
12381
|
i[c] != null && i[c + 1] < t && (a = !0);
|
|
@@ -12519,7 +12519,7 @@ function zg(n) {
|
|
|
12519
12519
|
}
|
|
12520
12520
|
};
|
|
12521
12521
|
}
|
|
12522
|
-
function
|
|
12522
|
+
function xe(n) {
|
|
12523
12523
|
let e = n.cached.tableNodeTypes;
|
|
12524
12524
|
if (!e) {
|
|
12525
12525
|
e = n.cached.tableNodeTypes = {};
|
|
@@ -12582,7 +12582,7 @@ function li(n, e) {
|
|
|
12582
12582
|
return n.depth == e.depth && n.pos >= e.start(-1) && n.pos <= e.end(-1);
|
|
12583
12583
|
}
|
|
12584
12584
|
function Bu(n, e, t) {
|
|
12585
|
-
const r = n.node(-1), s =
|
|
12585
|
+
const r = n.node(-1), s = se.get(r), o = n.start(-1), i = s.nextCell(n.pos - o, e, t);
|
|
12586
12586
|
return i == null ? null : n.node(0).resolve(o + i);
|
|
12587
12587
|
}
|
|
12588
12588
|
function en(n, e, t = 1) {
|
|
@@ -12598,7 +12598,7 @@ function Lu(n, e, t = 1) {
|
|
|
12598
12598
|
return r;
|
|
12599
12599
|
}
|
|
12600
12600
|
function Lg(n, e, t) {
|
|
12601
|
-
const r =
|
|
12601
|
+
const r = xe(e.type.schema).header_cell;
|
|
12602
12602
|
for (let s = 0; s < n.height; s++)
|
|
12603
12603
|
if (e.nodeAt(n.map[t + s * n.width]).type != r)
|
|
12604
12604
|
return !1;
|
|
@@ -12610,7 +12610,7 @@ var H = class nt extends $ {
|
|
|
12610
12610
|
// cells in the same table. They may be the same, to select a single
|
|
12611
12611
|
// cell.
|
|
12612
12612
|
constructor(e, t = e) {
|
|
12613
|
-
const r = e.node(-1), s =
|
|
12613
|
+
const r = e.node(-1), s = se.get(r), o = e.start(-1), i = s.rectBetween(
|
|
12614
12614
|
e.pos - o,
|
|
12615
12615
|
t.pos - o
|
|
12616
12616
|
), l = e.node(0), a = s.cellsInRect(i).filter((u) => u != t.pos - o);
|
|
@@ -12638,7 +12638,7 @@ var H = class nt extends $ {
|
|
|
12638
12638
|
// Returns a rectangular slice of table rows containing the selected
|
|
12639
12639
|
// cells.
|
|
12640
12640
|
content() {
|
|
12641
|
-
const e = this.$anchorCell.node(-1), t =
|
|
12641
|
+
const e = this.$anchorCell.node(-1), t = se.get(e), r = this.$anchorCell.start(-1), s = t.rectBetween(
|
|
12642
12642
|
this.$anchorCell.pos - r,
|
|
12643
12643
|
this.$headCell.pos - r
|
|
12644
12644
|
), o = {}, i = [];
|
|
@@ -12701,7 +12701,7 @@ var H = class nt extends $ {
|
|
|
12701
12701
|
this.replace(e, new C(S.from(t), 0, 0));
|
|
12702
12702
|
}
|
|
12703
12703
|
forEachCell(e) {
|
|
12704
|
-
const t = this.$anchorCell.node(-1), r =
|
|
12704
|
+
const t = this.$anchorCell.node(-1), r = se.get(t), s = this.$anchorCell.start(-1), o = r.cellsInRect(
|
|
12705
12705
|
r.rectBetween(
|
|
12706
12706
|
this.$anchorCell.pos - s,
|
|
12707
12707
|
this.$headCell.pos - s
|
|
@@ -12721,7 +12721,7 @@ var H = class nt extends $ {
|
|
|
12721
12721
|
// Returns the smallest column selection that covers the given anchor
|
|
12722
12722
|
// and head cell.
|
|
12723
12723
|
static colSelection(e, t = e) {
|
|
12724
|
-
const r = e.node(-1), s =
|
|
12724
|
+
const r = e.node(-1), s = se.get(r), o = e.start(-1), i = s.findCell(e.pos - o), l = s.findCell(t.pos - o), a = e.node(0);
|
|
12725
12725
|
return i.top <= l.top ? (i.top > 0 && (e = a.resolve(o + s.map[i.left])), l.bottom < s.height && (t = a.resolve(
|
|
12726
12726
|
o + s.map[s.width * (s.height - 1) + l.right - 1]
|
|
12727
12727
|
))) : (l.top > 0 && (t = a.resolve(o + s.map[l.left])), i.bottom < s.height && (e = a.resolve(
|
|
@@ -12731,7 +12731,7 @@ var H = class nt extends $ {
|
|
|
12731
12731
|
// True if this selection goes all the way from the left to the
|
|
12732
12732
|
// right of the table.
|
|
12733
12733
|
isRowSelection() {
|
|
12734
|
-
const e = this.$anchorCell.node(-1), t =
|
|
12734
|
+
const e = this.$anchorCell.node(-1), t = se.get(e), r = this.$anchorCell.start(-1), s = t.colCount(this.$anchorCell.pos - r), o = t.colCount(this.$headCell.pos - r);
|
|
12735
12735
|
if (Math.min(s, o) > 0) return !1;
|
|
12736
12736
|
const i = s + this.$anchorCell.nodeAfter.attrs.colspan, l = o + this.$headCell.nodeAfter.attrs.colspan;
|
|
12737
12737
|
return Math.max(i, l) == t.width;
|
|
@@ -12742,7 +12742,7 @@ var H = class nt extends $ {
|
|
|
12742
12742
|
// Returns the smallest row selection that covers the given anchor
|
|
12743
12743
|
// and head cell.
|
|
12744
12744
|
static rowSelection(e, t = e) {
|
|
12745
|
-
const r = e.node(-1), s =
|
|
12745
|
+
const r = e.node(-1), s = se.get(r), o = e.start(-1), i = s.findCell(e.pos - o), l = s.findCell(t.pos - o), a = e.node(0);
|
|
12746
12746
|
return i.left <= l.left ? (i.left > 0 && (e = a.resolve(
|
|
12747
12747
|
o + s.map[i.top * s.width]
|
|
12748
12748
|
)), l.right < s.width && (t = a.resolve(
|
|
@@ -12828,7 +12828,7 @@ function Jg(n, e, t) {
|
|
|
12828
12828
|
const l = s.resolve(r.from + 1);
|
|
12829
12829
|
o = H.rowSelection(l, l);
|
|
12830
12830
|
} else if (!t) {
|
|
12831
|
-
const l =
|
|
12831
|
+
const l = se.get(r.node), a = r.from + 1, c = a + l.map[l.width * l.height - 1];
|
|
12832
12832
|
o = H.create(s, a + 1, c);
|
|
12833
12833
|
}
|
|
12834
12834
|
} else r instanceof V && qg(r) ? o = V.create(s, r.from) : r instanceof V && Hg(r) && (o = V.create(s, r.$from.start(), r.$from.end()));
|
|
@@ -12855,7 +12855,7 @@ function ai(n, e) {
|
|
|
12855
12855
|
return e ? e.doc != n.doc && _u(e.doc, n.doc, 0, r) : n.doc.descendants(r), t;
|
|
12856
12856
|
}
|
|
12857
12857
|
function Ug(n, e, t, r) {
|
|
12858
|
-
const s =
|
|
12858
|
+
const s = se.get(e);
|
|
12859
12859
|
if (!s.problems) return r;
|
|
12860
12860
|
r || (r = n.tr);
|
|
12861
12861
|
const o = [];
|
|
@@ -12903,7 +12903,7 @@ function Ug(n, e, t, r) {
|
|
|
12903
12903
|
u.firstChild && (h = u.firstChild.type.spec.tableRole);
|
|
12904
12904
|
const p = [];
|
|
12905
12905
|
for (let m = 0; m < d; m++) {
|
|
12906
|
-
const x =
|
|
12906
|
+
const x = xe(n.schema)[h].createAndFill();
|
|
12907
12907
|
x && p.push(x);
|
|
12908
12908
|
}
|
|
12909
12909
|
const y = (a == 0 || i == a - 1) && l == a ? c + 1 : f - 1;
|
|
@@ -12914,7 +12914,7 @@ function Ug(n, e, t, r) {
|
|
|
12914
12914
|
return r.setMeta(Kg, { fixTables: !0 });
|
|
12915
12915
|
}
|
|
12916
12916
|
function Qe(n) {
|
|
12917
|
-
const e = n.selection, t = hs(n), r = t.node(-1), s = t.start(-1), o =
|
|
12917
|
+
const e = n.selection, t = hs(n), r = t.node(-1), s = t.start(-1), o = se.get(r);
|
|
12918
12918
|
return { ...e instanceof H ? o.rectBetween(
|
|
12919
12919
|
e.$anchorCell.pos - s,
|
|
12920
12920
|
e.$headCell.pos - s
|
|
@@ -12933,7 +12933,7 @@ function qu(n, { map: e, tableStart: t, table: r }, s) {
|
|
|
12933
12933
|
Lu(c.attrs, s - e.colCount(a))
|
|
12934
12934
|
), i += c.attrs.rowspan - 1;
|
|
12935
12935
|
} else {
|
|
12936
|
-
const a = o == null ?
|
|
12936
|
+
const a = o == null ? xe(r.type.schema).cell : r.nodeAt(e.map[l + o]).type, c = e.positionAt(i, s, r);
|
|
12937
12937
|
n.insert(n.mapping.map(t + c), a.createAndFill());
|
|
12938
12938
|
}
|
|
12939
12939
|
}
|
|
@@ -12981,7 +12981,7 @@ function Qg(n, e) {
|
|
|
12981
12981
|
const o = t.tableStart ? r.doc.nodeAt(t.tableStart - 1) : r.doc;
|
|
12982
12982
|
if (!o)
|
|
12983
12983
|
throw RangeError("No table found");
|
|
12984
|
-
t.table = o, t.map =
|
|
12984
|
+
t.table = o, t.map = se.get(o);
|
|
12985
12985
|
}
|
|
12986
12986
|
e(r);
|
|
12987
12987
|
}
|
|
@@ -12989,7 +12989,7 @@ function Qg(n, e) {
|
|
|
12989
12989
|
}
|
|
12990
12990
|
function Zg(n, e, t) {
|
|
12991
12991
|
var r;
|
|
12992
|
-
const s =
|
|
12992
|
+
const s = xe(e.type.schema).header_cell;
|
|
12993
12993
|
for (let o = 0; o < n.width; o++)
|
|
12994
12994
|
if (((r = e.nodeAt(n.map[o + t * n.width])) == null ? void 0 : r.type) != s)
|
|
12995
12995
|
return !1;
|
|
@@ -13010,10 +13010,10 @@ function Hu(n, { map: e, tableStart: t, table: r }, s) {
|
|
|
13010
13010
|
rowspan: d.rowspan + 1
|
|
13011
13011
|
}), c += d.colspan - 1;
|
|
13012
13012
|
} else {
|
|
13013
|
-
const f = a == null ?
|
|
13013
|
+
const f = a == null ? xe(r.type.schema).cell : (o = r.nodeAt(e.map[u + a * e.width])) == null ? void 0 : o.type, d = f == null ? void 0 : f.createAndFill();
|
|
13014
13014
|
d && l.push(d);
|
|
13015
13015
|
}
|
|
13016
|
-
return n.insert(i,
|
|
13016
|
+
return n.insert(i, xe(r.type.schema).row.create(null, l)), n;
|
|
13017
13017
|
}
|
|
13018
13018
|
function ey(n, e) {
|
|
13019
13019
|
if (!Ve(n)) return !1;
|
|
@@ -13065,7 +13065,7 @@ function ry(n, e) {
|
|
|
13065
13065
|
const o = t.tableStart ? r.doc.nodeAt(t.tableStart - 1) : r.doc;
|
|
13066
13066
|
if (!o)
|
|
13067
13067
|
throw RangeError("No table found");
|
|
13068
|
-
t.table = o, t.map =
|
|
13068
|
+
t.table = o, t.map = se.get(t.table);
|
|
13069
13069
|
}
|
|
13070
13070
|
e(r);
|
|
13071
13071
|
}
|
|
@@ -13130,7 +13130,7 @@ function oy(n, e) {
|
|
|
13130
13130
|
return !0;
|
|
13131
13131
|
}
|
|
13132
13132
|
function iy(n, e) {
|
|
13133
|
-
const t =
|
|
13133
|
+
const t = xe(n.schema);
|
|
13134
13134
|
return ly(({ node: r }) => t[r.type.spec.tableRole])(n, e);
|
|
13135
13135
|
}
|
|
13136
13136
|
function ly(n) {
|
|
@@ -13207,7 +13207,7 @@ function ay(n) {
|
|
|
13207
13207
|
return function(e, t) {
|
|
13208
13208
|
if (!Ve(e)) return !1;
|
|
13209
13209
|
if (t) {
|
|
13210
|
-
const r =
|
|
13210
|
+
const r = xe(e.schema), s = Qe(e), o = e.tr, i = s.map.cellsInRect(
|
|
13211
13211
|
n == "column" ? {
|
|
13212
13212
|
left: s.left,
|
|
13213
13213
|
top: 0,
|
|
@@ -13256,7 +13256,7 @@ function ci(n, e) {
|
|
|
13256
13256
|
return e = e || { useDeprecatedLogic: !1 }, e.useDeprecatedLogic ? ay(n) : function(t, r) {
|
|
13257
13257
|
if (!Ve(t)) return !1;
|
|
13258
13258
|
if (r) {
|
|
13259
|
-
const s =
|
|
13259
|
+
const s = xe(t.schema), o = Qe(t), i = t.tr, l = ra("row", o, s), a = ra(
|
|
13260
13260
|
"column",
|
|
13261
13261
|
o,
|
|
13262
13262
|
s
|
|
@@ -13335,7 +13335,7 @@ function Sr(n, e) {
|
|
|
13335
13335
|
const t = n.selection;
|
|
13336
13336
|
if (!(t instanceof H)) return !1;
|
|
13337
13337
|
if (e) {
|
|
13338
|
-
const r = n.tr, s =
|
|
13338
|
+
const r = n.tr, s = xe(n.schema).cell.createAndFill().content;
|
|
13339
13339
|
t.forEachCell((o, i) => {
|
|
13340
13340
|
o.content.eq(s) || r.replace(
|
|
13341
13341
|
r.mapping.map(i + 1),
|
|
@@ -13357,14 +13357,14 @@ function py(n) {
|
|
|
13357
13357
|
let c = e.child(a).content;
|
|
13358
13358
|
const u = a ? 0 : Math.max(0, t - 1), f = a < e.childCount - 1 ? 0 : Math.max(0, r - 1);
|
|
13359
13359
|
(u || f) && (c = Oo(
|
|
13360
|
-
|
|
13360
|
+
xe(i).row,
|
|
13361
13361
|
new C(c, u, f)
|
|
13362
13362
|
).content), l.push(c);
|
|
13363
13363
|
}
|
|
13364
13364
|
else if (o == "cell" || o == "header_cell")
|
|
13365
13365
|
l.push(
|
|
13366
13366
|
t || r ? Oo(
|
|
13367
|
-
|
|
13367
|
+
xe(i).row,
|
|
13368
13368
|
new C(e, t, r)
|
|
13369
13369
|
).content : e
|
|
13370
13370
|
);
|
|
@@ -13386,7 +13386,7 @@ function my(n, e) {
|
|
|
13386
13386
|
for (let s = 0; s < t.length; s++) r = Math.max(r, t[s]);
|
|
13387
13387
|
for (let s = 0; s < t.length; s++)
|
|
13388
13388
|
if (s >= e.length && e.push(S.empty), t[s] < r) {
|
|
13389
|
-
const o =
|
|
13389
|
+
const o = xe(n).cell.createAndFill(), i = [];
|
|
13390
13390
|
for (let l = t[s]; l < r; l++)
|
|
13391
13391
|
i.push(o);
|
|
13392
13392
|
e[s] = e[s].append(S.from(i));
|
|
@@ -13440,7 +13440,7 @@ function gy({ width: n, height: e, rows: t }, r, s) {
|
|
|
13440
13440
|
return { width: n, height: e, rows: t };
|
|
13441
13441
|
}
|
|
13442
13442
|
function yy(n, e, t, r, s, o, i) {
|
|
13443
|
-
const l = n.doc.type.schema, a =
|
|
13443
|
+
const l = n.doc.type.schema, a = xe(l);
|
|
13444
13444
|
let c, u;
|
|
13445
13445
|
if (s > e.width)
|
|
13446
13446
|
for (let f = 0, d = 0; f < e.height; f++) {
|
|
@@ -13518,13 +13518,13 @@ function la(n, e, t, r, s) {
|
|
|
13518
13518
|
let o = t ? n.doc.nodeAt(t - 1) : n.doc;
|
|
13519
13519
|
if (!o)
|
|
13520
13520
|
throw new Error("No table found");
|
|
13521
|
-
let i =
|
|
13521
|
+
let i = se.get(o);
|
|
13522
13522
|
const { top: l, left: a } = r, c = a + s.width, u = l + s.height, f = n.tr;
|
|
13523
13523
|
let d = 0;
|
|
13524
13524
|
function h() {
|
|
13525
13525
|
if (o = t ? f.doc.nodeAt(t - 1) : f.doc, !o)
|
|
13526
13526
|
throw new Error("No table found");
|
|
13527
|
-
i =
|
|
13527
|
+
i = se.get(o), d = f.mapping.maps.length;
|
|
13528
13528
|
}
|
|
13529
13529
|
yy(f, i, o, t, c, u, d) && h(), oa(f, i, o, t, a, c, l, d) && h(), oa(f, i, o, t, a, c, u, d) && h(), ia(f, i, o, t, l, u, a, d) && h(), ia(f, i, o, t, l, u, c, d) && h();
|
|
13530
13530
|
for (let p = l; p < u; p++) {
|
|
@@ -13619,11 +13619,11 @@ function Sy(n, e, t) {
|
|
|
13619
13619
|
height: 1,
|
|
13620
13620
|
rows: [
|
|
13621
13621
|
S.from(
|
|
13622
|
-
Oo(
|
|
13622
|
+
Oo(xe(n.state.schema).cell, t)
|
|
13623
13623
|
)
|
|
13624
13624
|
]
|
|
13625
13625
|
});
|
|
13626
|
-
const o = s.$anchorCell.node(-1), i = s.$anchorCell.start(-1), l =
|
|
13626
|
+
const o = s.$anchorCell.node(-1), i = s.$anchorCell.start(-1), l = se.get(o).rectBetween(
|
|
13627
13627
|
s.$anchorCell.pos - i,
|
|
13628
13628
|
s.$headCell.pos - i
|
|
13629
13629
|
);
|
|
@@ -13634,7 +13634,7 @@ function Sy(n, e, t) {
|
|
|
13634
13634
|
n.state,
|
|
13635
13635
|
n.dispatch,
|
|
13636
13636
|
i,
|
|
13637
|
-
|
|
13637
|
+
se.get(o.node(-1)).findCell(o.pos - i),
|
|
13638
13638
|
r
|
|
13639
13639
|
), !0;
|
|
13640
13640
|
} else
|
|
@@ -13928,11 +13928,11 @@ function X() {
|
|
|
13928
13928
|
typeof document > "u" || Pf(...e);
|
|
13929
13929
|
}
|
|
13930
13930
|
function Py(n, e) {
|
|
13931
|
-
const t =
|
|
13931
|
+
const t = ie(Xu);
|
|
13932
13932
|
X(() => t(n), e);
|
|
13933
13933
|
}
|
|
13934
13934
|
function ft(n, e) {
|
|
13935
|
-
const { view: t, flushSyncRef: r } =
|
|
13935
|
+
const { view: t, flushSyncRef: r } = ie(Vt);
|
|
13936
13936
|
Py(
|
|
13937
13937
|
() => {
|
|
13938
13938
|
if (t != null && t.docView) {
|
|
@@ -14111,7 +14111,7 @@ _y && +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [
|
|
|
14111
14111
|
0,
|
|
14112
14112
|
0
|
|
14113
14113
|
])[1];
|
|
14114
|
-
const
|
|
14114
|
+
const fe = {
|
|
14115
14115
|
ie: ps,
|
|
14116
14116
|
ie_version: Fy,
|
|
14117
14117
|
gecko: Zu,
|
|
@@ -14255,18 +14255,18 @@ function Gy(n) {
|
|
|
14255
14255
|
const e = n, t = e.domSelection(), r = document.createRange();
|
|
14256
14256
|
if (!t) return;
|
|
14257
14257
|
const s = e.cursorWrapper.dom, o = s.nodeName == "IMG";
|
|
14258
|
-
o ? r.setStart(s.parentNode, xt(s) + 1) : r.setStart(s, 0), r.collapse(!0), t.removeAllRanges(), t.addRange(r), !o && !e.state.selection.visible &&
|
|
14258
|
+
o ? r.setStart(s.parentNode, xt(s) + 1) : r.setStart(s, 0), r.collapse(!0), t.removeAllRanges(), t.addRange(r), !o && !e.state.selection.visible && fe.ie && fe.ie_version <= 11 && (s.disabled = !0, s.disabled = !1);
|
|
14259
14259
|
}
|
|
14260
14260
|
function xa(n, e) {
|
|
14261
14261
|
const t = n, { node: r, offset: s } = t.docView.domFromPos(e, 0), o = s < r.childNodes.length ? r.childNodes[s] : null, i = s ? r.childNodes[s - 1] : null;
|
|
14262
|
-
if (
|
|
14262
|
+
if (fe.safari && o && o.contentEditable == "false") return Ys(o);
|
|
14263
14263
|
if ((!o || o.contentEditable == "false") && (!i || i.contentEditable == "false")) {
|
|
14264
14264
|
if (o) return Ys(o);
|
|
14265
14265
|
if (i) return Ys(i);
|
|
14266
14266
|
}
|
|
14267
14267
|
}
|
|
14268
14268
|
function Ys(n) {
|
|
14269
|
-
return n.contentEditable = "true",
|
|
14269
|
+
return n.contentEditable = "true", fe.safari && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
|
|
14270
14270
|
}
|
|
14271
14271
|
function Sa(n) {
|
|
14272
14272
|
n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
|
|
@@ -14281,12 +14281,12 @@ function Xy(n) {
|
|
|
14281
14281
|
}, 20));
|
|
14282
14282
|
});
|
|
14283
14283
|
}
|
|
14284
|
-
const ka =
|
|
14284
|
+
const ka = fe.safari || fe.chrome && fe.chrome_version < 63;
|
|
14285
14285
|
function Mr(n) {
|
|
14286
14286
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
14287
14287
|
const t = n, r = t.state.selection;
|
|
14288
14288
|
if (Uy(t, r), !!tf(t)) {
|
|
14289
|
-
if (!e && t.input.mouseDown && t.input.mouseDown.allowDefault &&
|
|
14289
|
+
if (!e && t.input.mouseDown && t.input.mouseDown.allowDefault && fe.chrome) {
|
|
14290
14290
|
const s = t.domSelectionRange(), o = t.domObserver.currentSelection;
|
|
14291
14291
|
if (s.anchorNode && o.anchorNode && es(s.anchorNode, s.anchorOffset, o.anchorNode, o.anchorOffset)) {
|
|
14292
14292
|
t.input.mouseDown.delayedSelectionSync = !0, t.domObserver.setCurSelection();
|
|
@@ -14406,7 +14406,7 @@ class Zy {
|
|
|
14406
14406
|
onSelectionChange() {
|
|
14407
14407
|
if (pa(this.view) && !this.view.composing) {
|
|
14408
14408
|
if (this.suppressingSelectionUpdates) return Mr(this.view);
|
|
14409
|
-
if (
|
|
14409
|
+
if (fe.ie && fe.ie_version <= 11 && !this.view.state.selection.empty) {
|
|
14410
14410
|
const e = this.view.domSelectionRange();
|
|
14411
14411
|
if (e.focusNode && es(
|
|
14412
14412
|
e.focusNode,
|
|
@@ -14750,7 +14750,7 @@ class pr {
|
|
|
14750
14750
|
let l = this.domFromPos(e, e ? -1 : 1), a = t == e ? l : this.domFromPos(t, t ? -1 : 1);
|
|
14751
14751
|
const c = r.root.getSelection(), u = r.domSelectionRange();
|
|
14752
14752
|
let f = !1;
|
|
14753
|
-
if ((
|
|
14753
|
+
if ((fe.gecko || fe.safari) && e == t) {
|
|
14754
14754
|
const { node: p, offset: y } = l;
|
|
14755
14755
|
if (p.nodeType == 3) {
|
|
14756
14756
|
if (f = !!(y && ((h = p.nodeValue) == null ? void 0 : h[y - 1]) == `
|
|
@@ -14771,11 +14771,11 @@ class pr {
|
|
|
14771
14771
|
f = m && (m.nodeName == "BR" || m.contentEditable == "false");
|
|
14772
14772
|
}
|
|
14773
14773
|
}
|
|
14774
|
-
if (
|
|
14774
|
+
if (fe.gecko && u.focusNode && u.focusNode != a.node && u.focusNode.nodeType == 1) {
|
|
14775
14775
|
const p = u.focusNode.childNodes[u.focusOffset];
|
|
14776
14776
|
p && p.contentEditable == "false" && (s = !0);
|
|
14777
14777
|
}
|
|
14778
|
-
if (!(s || f &&
|
|
14778
|
+
if (!(s || f && fe.safari) && es(l.node, l.offset, u.anchorNode, u.anchorOffset) && es(a.node, a.offset, u.focusNode, u.focusOffset)) return;
|
|
14779
14779
|
let d = !1;
|
|
14780
14780
|
if ((c.extend || e == t) && !f) {
|
|
14781
14781
|
c.collapse(l.node, l.offset);
|
|
@@ -15191,10 +15191,10 @@ function fb(n, e) {
|
|
|
15191
15191
|
e.plugins,
|
|
15192
15192
|
u,
|
|
15193
15193
|
h
|
|
15194
|
-
]), y = He(function(
|
|
15194
|
+
]), y = He(function(v) {
|
|
15195
15195
|
t.current ? Ri(() => {
|
|
15196
|
-
e.state || a((
|
|
15197
|
-
}) : (e.state || a((
|
|
15196
|
+
e.state || a((D) => D.apply(v)), e.dispatchTransaction && e.dispatchTransaction.call(this, v);
|
|
15197
|
+
}) : (e.state || a((D) => D.apply(v)), e.dispatchTransaction && e.dispatchTransaction.call(this, v));
|
|
15198
15198
|
}, [
|
|
15199
15199
|
e.dispatchTransaction,
|
|
15200
15200
|
e.state
|
|
@@ -15208,43 +15208,43 @@ function fb(n, e) {
|
|
|
15208
15208
|
plugins: p,
|
|
15209
15209
|
dispatchTransaction: y,
|
|
15210
15210
|
docView: k.current
|
|
15211
|
-
}, [
|
|
15211
|
+
}, [P, z] = N(
|
|
15212
15212
|
// During the initial render, we create something of a dummy
|
|
15213
15213
|
// EditorView. This allows us to ensure that the first render actually
|
|
15214
15214
|
// renders the document, which is necessary for SSR.
|
|
15215
15215
|
() => new Na(null, M)
|
|
15216
15216
|
);
|
|
15217
15217
|
return X(() => () => {
|
|
15218
|
-
|
|
15218
|
+
P == null || P.destroy();
|
|
15219
15219
|
}, [
|
|
15220
|
-
|
|
15220
|
+
P
|
|
15221
15221
|
]), X(() => {
|
|
15222
15222
|
if (!n) {
|
|
15223
|
-
|
|
15223
|
+
z(null);
|
|
15224
15224
|
return;
|
|
15225
15225
|
}
|
|
15226
|
-
if (!
|
|
15226
|
+
if (!P || P.dom !== n) {
|
|
15227
15227
|
const B = new Na({
|
|
15228
15228
|
mount: n
|
|
15229
15229
|
}, M);
|
|
15230
|
-
|
|
15230
|
+
z(B), B.dom.addEventListener("compositionend", o);
|
|
15231
15231
|
return;
|
|
15232
15232
|
}
|
|
15233
|
-
if (
|
|
15234
|
-
|
|
15233
|
+
if (P.needsRedraw) {
|
|
15234
|
+
z(null);
|
|
15235
15235
|
return;
|
|
15236
15236
|
}
|
|
15237
|
-
|
|
15238
|
-
}),
|
|
15237
|
+
P == null || P.domObserver.selectionToDOM(), P == null || P.runPendingEffects();
|
|
15238
|
+
}), P == null || P.pureSetProps(M), {
|
|
15239
15239
|
editor: Me(() => ({
|
|
15240
|
-
view:
|
|
15240
|
+
view: P,
|
|
15241
15241
|
registerEventListener: f,
|
|
15242
15242
|
unregisterEventListener: d,
|
|
15243
15243
|
cursorWrapper: r,
|
|
15244
15244
|
docViewDescRef: k,
|
|
15245
15245
|
flushSyncRef: t
|
|
15246
15246
|
}), [
|
|
15247
|
-
|
|
15247
|
+
P,
|
|
15248
15248
|
f,
|
|
15249
15249
|
d,
|
|
15250
15250
|
r
|
|
@@ -15288,23 +15288,23 @@ const Oe = ct({
|
|
|
15288
15288
|
}
|
|
15289
15289
|
});
|
|
15290
15290
|
function pi(n, e, t, r, s, o, i, l) {
|
|
15291
|
-
const { view: a } =
|
|
15292
|
-
d.current =
|
|
15293
|
-
}, []), p = I(() => !1), y = He((
|
|
15294
|
-
p.current =
|
|
15291
|
+
const { view: a } = ie(Vt), [c, u] = N(!0), f = I(i), d = I(() => !1), h = He((R) => {
|
|
15292
|
+
d.current = R;
|
|
15293
|
+
}, []), p = I(() => !1), y = He((R) => {
|
|
15294
|
+
p.current = R;
|
|
15295
15295
|
}, []), m = I(() => {
|
|
15296
15296
|
!r.current || !n || (r.current.nodeType == 1 && r.current.classList.add("ProseMirror-selectednode"), (l != null && l.current || !n.type.spec.draggable) && (((t == null ? void 0 : t.current) ?? r.current).draggable = !0));
|
|
15297
15297
|
}), x = I(() => {
|
|
15298
15298
|
!r.current || !n || r.current.nodeType == 1 && (r.current.classList.remove("ProseMirror-selectednode"), (l != null && l.current || !n.type.spec.draggable) && ((t == null ? void 0 : t.current) ?? r.current).removeAttribute("draggable"));
|
|
15299
|
-
}), k = He((
|
|
15300
|
-
m.current =
|
|
15301
|
-
}, []), { siblingsRef: M, parentRef:
|
|
15299
|
+
}), k = He((R, B) => {
|
|
15300
|
+
m.current = R, x.current = B;
|
|
15301
|
+
}, []), { siblingsRef: M, parentRef: P } = ie(Oe), z = I([]);
|
|
15302
15302
|
return X(() => {
|
|
15303
|
-
const
|
|
15303
|
+
const R = M.current;
|
|
15304
15304
|
return () => {
|
|
15305
|
-
if (f.current &&
|
|
15306
|
-
const B =
|
|
15307
|
-
|
|
15305
|
+
if (f.current && R.includes(f.current)) {
|
|
15306
|
+
const B = R.indexOf(f.current);
|
|
15307
|
+
R.splice(B, 1);
|
|
15308
15308
|
}
|
|
15309
15309
|
};
|
|
15310
15310
|
}, [
|
|
@@ -15312,29 +15312,29 @@ function pi(n, e, t, r, s, o, i, l) {
|
|
|
15312
15312
|
]), X(() => {
|
|
15313
15313
|
var B;
|
|
15314
15314
|
if (!n || !r.current) return;
|
|
15315
|
-
const
|
|
15316
|
-
f.current ? (f.current.parent =
|
|
15315
|
+
const R = z.current[0];
|
|
15316
|
+
f.current ? (f.current.parent = P.current, f.current.children = z.current, f.current.node = n, f.current.getPos = e, f.current.outerDeco = o, f.current.innerDeco = s, f.current.dom = (t == null ? void 0 : t.current) ?? r.current, f.current.dom.pmViewDesc = f.current, f.current.contentDOM = // If there's already a contentDOM, we can just
|
|
15317
15317
|
// keep it; it won't have changed. This is especially
|
|
15318
15318
|
// important during compositions, where the
|
|
15319
15319
|
// firstChildDesc might not have a correct dom node set yet.
|
|
15320
|
-
(l == null ? void 0 : l.current) ?? f.current.contentDOM ?? (
|
|
15321
|
-
for (const
|
|
15322
|
-
if (
|
|
15323
|
-
const
|
|
15324
|
-
if (!
|
|
15325
|
-
let
|
|
15326
|
-
for (;
|
|
15327
|
-
|
|
15328
|
-
if (!
|
|
15329
|
-
|
|
15320
|
+
(l == null ? void 0 : l.current) ?? f.current.contentDOM ?? (R == null ? void 0 : R.dom.parentElement) ?? null, f.current.nodeDOM = r.current) : f.current = new di(P.current, z.current, e, n, o, s, (t == null ? void 0 : t.current) ?? r.current, (R == null ? void 0 : R.dom.parentElement) ?? null, r.current, (v) => !!d.current(v), () => m.current(), () => x.current(), (v) => p.current(v)), u(f.current.contentDOM !== null), M.current.includes(f.current) || M.current.push(f.current), M.current.sort(sn);
|
|
15321
|
+
for (const v of z.current)
|
|
15322
|
+
if (v.parent = f.current, v instanceof ts) {
|
|
15323
|
+
const D = (B = f.current.contentDOM) == null ? void 0 : B.firstChild;
|
|
15324
|
+
if (!D) throw new Error("Started a composition but couldn't find the text node it belongs to.");
|
|
15325
|
+
let L = D;
|
|
15326
|
+
for (; L.firstChild; )
|
|
15327
|
+
L = L.firstChild;
|
|
15328
|
+
if (!L || !(L instanceof Text)) throw new Error("Started a composition but couldn't find the text node it belongs to.");
|
|
15329
|
+
v.dom = D, v.textDOM = L, v.text = L.data, v.textDOM.pmViewDesc = v, a == null || a.input.compositionNodes.push(v);
|
|
15330
15330
|
}
|
|
15331
15331
|
return () => {
|
|
15332
|
-
var
|
|
15333
|
-
((
|
|
15332
|
+
var v, D, L, ee;
|
|
15333
|
+
((v = f.current) == null ? void 0 : v.children[0]) instanceof ts && !(a != null && a.composing) && ((ee = (D = f.current) == null ? void 0 : D.children[0].dom.parentNode) == null || ee.removeChild((L = f.current) == null ? void 0 : L.children[0].dom));
|
|
15334
15334
|
};
|
|
15335
15335
|
}), {
|
|
15336
15336
|
hasContentDOM: c,
|
|
15337
|
-
childDescriptors:
|
|
15337
|
+
childDescriptors: z,
|
|
15338
15338
|
nodeViewDescRef: f,
|
|
15339
15339
|
setStopEvent: h,
|
|
15340
15340
|
setSelectNode: k,
|
|
@@ -15405,7 +15405,7 @@ function pb(n, e, t, r) {
|
|
|
15405
15405
|
}
|
|
15406
15406
|
}
|
|
15407
15407
|
function mb() {
|
|
15408
|
-
const { view: n } =
|
|
15408
|
+
const { view: n } = ie(Vt);
|
|
15409
15409
|
return n && To.getState(n.state);
|
|
15410
15410
|
}
|
|
15411
15411
|
var sf = { exports: {} };
|
|
@@ -15675,7 +15675,7 @@ const mi = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
|
|
|
15675
15675
|
return s && !af(r) && d.push(o), /* @__PURE__ */ Hn(a, u, ...d);
|
|
15676
15676
|
})), cf = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
|
|
15677
15677
|
let { mark: r, getPos: s, children: o } = e;
|
|
15678
|
-
const { siblingsRef: i, parentRef: l } =
|
|
15678
|
+
const { siblingsRef: i, parentRef: l } = ie(Oe), a = I(void 0), c = I([]), u = I(null);
|
|
15679
15679
|
ns(t, () => u.current, []);
|
|
15680
15680
|
const f = Me(() => {
|
|
15681
15681
|
var h, p;
|
|
@@ -15721,7 +15721,7 @@ const mi = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
|
|
|
15721
15721
|
}));
|
|
15722
15722
|
function Sb(n) {
|
|
15723
15723
|
let { widget: e, getPos: t } = n;
|
|
15724
|
-
const { siblingsRef: r, parentRef: s } =
|
|
15724
|
+
const { siblingsRef: r, parentRef: s } = ie(Oe), o = I(null), i = I(null);
|
|
15725
15725
|
return X(() => {
|
|
15726
15726
|
const l = r.current;
|
|
15727
15727
|
return () => {
|
|
@@ -15761,7 +15761,7 @@ function wb() {
|
|
|
15761
15761
|
const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
15762
15762
|
var dt;
|
|
15763
15763
|
let { customNodeView: t, node: r, getPos: s, innerDeco: o, outerDeco: i } = e;
|
|
15764
|
-
const { view: l } =
|
|
15764
|
+
const { view: l } = ie(Vt), a = I(null), c = I(null), u = I(null), f = I(() => s.current()).current, d = I(r);
|
|
15765
15765
|
d.current = r;
|
|
15766
15766
|
const h = I(i);
|
|
15767
15767
|
h.current = i;
|
|
@@ -15779,7 +15779,7 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15779
15779
|
f,
|
|
15780
15780
|
h.current,
|
|
15781
15781
|
p.current
|
|
15782
|
-
), m.current.stopEvent &&
|
|
15782
|
+
), m.current.stopEvent && z(m.current.stopEvent.bind(m.current)), m.current.selectNode && R(m.current.selectNode.bind(m.current), (($t = m.current.deselectNode) == null ? void 0 : $t.bind(m.current)) ?? (() => {
|
|
15783
15783
|
})), m.current.ignoreMutation && B(m.current.ignoreMutation.bind(m.current)), x()), !y.current) return;
|
|
15784
15784
|
const { dom: Ee } = m.current;
|
|
15785
15785
|
if (y.current.firstChild === Ee)
|
|
@@ -15819,12 +15819,12 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15819
15819
|
s,
|
|
15820
15820
|
f
|
|
15821
15821
|
]);
|
|
15822
|
-
const { childDescriptors: M, nodeViewDescRef:
|
|
15823
|
-
parentRef:
|
|
15822
|
+
const { childDescriptors: M, nodeViewDescRef: P, setStopEvent: z, setSelectNode: R, setIgnoreMutation: B } = pi(r, f, a, c, o, i, void 0, u), v = Me(() => ({
|
|
15823
|
+
parentRef: P,
|
|
15824
15824
|
siblingsRef: M
|
|
15825
15825
|
}), [
|
|
15826
15826
|
M,
|
|
15827
|
-
|
|
15827
|
+
P
|
|
15828
15828
|
]);
|
|
15829
15829
|
if (!k) return null;
|
|
15830
15830
|
m.current || (m.current = t(
|
|
@@ -15836,20 +15836,20 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15836
15836
|
() => s.current(),
|
|
15837
15837
|
h.current,
|
|
15838
15838
|
p.current
|
|
15839
|
-
), m.current.stopEvent &&
|
|
15839
|
+
), m.current.stopEvent && z(m.current.stopEvent.bind(m.current)), m.current.selectNode && R(m.current.selectNode.bind(m.current), ((dt = m.current.deselectNode) == null ? void 0 : dt.bind(m.current)) ?? (() => {
|
|
15840
15840
|
})), m.current.ignoreMutation && B(m.current.ignoreMutation.bind(m.current)));
|
|
15841
|
-
const { contentDOM:
|
|
15842
|
-
u.current =
|
|
15843
|
-
const
|
|
15841
|
+
const { contentDOM: D } = m.current;
|
|
15842
|
+
u.current = D ?? null;
|
|
15843
|
+
const L = /* @__PURE__ */ Hn(r.isInline ? "span" : "div", {
|
|
15844
15844
|
ref: y,
|
|
15845
|
-
contentEditable: !!
|
|
15845
|
+
contentEditable: !!D,
|
|
15846
15846
|
suppressContentEditableWarning: !0
|
|
15847
|
-
},
|
|
15847
|
+
}, D && /* @__PURE__ */ jf(/* @__PURE__ */ A.createElement(or, {
|
|
15848
15848
|
getPos: s,
|
|
15849
15849
|
node: r,
|
|
15850
15850
|
innerDecorations: o
|
|
15851
|
-
}),
|
|
15852
|
-
i.reduce(ms,
|
|
15851
|
+
}), D)), ee = /* @__PURE__ */ rs(
|
|
15852
|
+
i.reduce(ms, L),
|
|
15853
15853
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15854
15854
|
i.some((Ee) => Ee.type.attrs.nodeName) ? {
|
|
15855
15855
|
ref: a
|
|
@@ -15860,23 +15860,23 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15860
15860
|
)
|
|
15861
15861
|
);
|
|
15862
15862
|
return /* @__PURE__ */ A.createElement(Oe.Provider, {
|
|
15863
|
-
value:
|
|
15864
|
-
},
|
|
15863
|
+
value: v
|
|
15864
|
+
}, ee);
|
|
15865
15865
|
}), Nb = ct(null), Db = ct(null), uf = ct(null), Ob = /* @__PURE__ */ Fe(function(e) {
|
|
15866
15866
|
let { outerDeco: t, getPos: r, node: s, innerDeco: o, ...i } = e;
|
|
15867
|
-
const l = I(null), a = I(null), c = I(null), u = I(() => r.current()).current, { nodeViews: f } =
|
|
15867
|
+
const l = I(null), a = I(null), c = I(null), u = I(() => r.current()).current, { nodeViews: f } = ie(Uu);
|
|
15868
15868
|
let d = null;
|
|
15869
15869
|
const h = f[s.type.name], p = Me(() => {
|
|
15870
|
-
var
|
|
15871
|
-
return (
|
|
15870
|
+
var D, L;
|
|
15871
|
+
return (L = (D = s.type.spec).toDOM) == null ? void 0 : L.call(D, s);
|
|
15872
15872
|
}, [
|
|
15873
15873
|
s
|
|
15874
|
-
]), { hasContentDOM: y, childDescriptors: m, setStopEvent: x, setSelectNode: k, setIgnoreMutation: M, nodeViewDescRef:
|
|
15874
|
+
]), { hasContentDOM: y, childDescriptors: m, setStopEvent: x, setSelectNode: k, setIgnoreMutation: M, nodeViewDescRef: P } = pi(s, () => r.current(), l, a, o, t, void 0, c), z = {
|
|
15875
15875
|
...i,
|
|
15876
15876
|
...!y && {
|
|
15877
15877
|
contentEditable: !1
|
|
15878
15878
|
}
|
|
15879
|
-
},
|
|
15879
|
+
}, R = Me(() => ({
|
|
15880
15880
|
node: s,
|
|
15881
15881
|
getPos: u,
|
|
15882
15882
|
decorations: t,
|
|
@@ -15888,15 +15888,15 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15888
15888
|
t
|
|
15889
15889
|
]);
|
|
15890
15890
|
if (h ? d = /* @__PURE__ */ A.createElement(h, {
|
|
15891
|
-
...
|
|
15891
|
+
...z,
|
|
15892
15892
|
ref: a,
|
|
15893
|
-
nodeProps:
|
|
15893
|
+
nodeProps: R
|
|
15894
15894
|
}, /* @__PURE__ */ A.createElement(or, {
|
|
15895
15895
|
getPos: r,
|
|
15896
15896
|
node: s,
|
|
15897
15897
|
innerDecorations: o
|
|
15898
15898
|
})) : p && (d = /* @__PURE__ */ A.createElement(mi, {
|
|
15899
|
-
...
|
|
15899
|
+
...z,
|
|
15900
15900
|
ref: a,
|
|
15901
15901
|
outputSpec: p
|
|
15902
15902
|
}, /* @__PURE__ */ A.createElement(or, {
|
|
@@ -15908,19 +15908,19 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15908
15908
|
const B = /* @__PURE__ */ rs(
|
|
15909
15909
|
t.reduce(ms, d),
|
|
15910
15910
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15911
|
-
t.some((
|
|
15911
|
+
t.some((D) => D.type.attrs.nodeName) ? {
|
|
15912
15912
|
ref: l
|
|
15913
15913
|
} : (
|
|
15914
15914
|
// we've already passed the domRef to the NodeView component
|
|
15915
15915
|
// as a prop
|
|
15916
15916
|
void 0
|
|
15917
15917
|
)
|
|
15918
|
-
),
|
|
15919
|
-
parentRef:
|
|
15918
|
+
), v = Me(() => ({
|
|
15919
|
+
parentRef: P,
|
|
15920
15920
|
siblingsRef: m
|
|
15921
15921
|
}), [
|
|
15922
15922
|
m,
|
|
15923
|
-
|
|
15923
|
+
P
|
|
15924
15924
|
]);
|
|
15925
15925
|
return /* @__PURE__ */ A.createElement(Db.Provider, {
|
|
15926
15926
|
value: k
|
|
@@ -15929,11 +15929,11 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15929
15929
|
}, /* @__PURE__ */ A.createElement(Nb.Provider, {
|
|
15930
15930
|
value: M
|
|
15931
15931
|
}, /* @__PURE__ */ A.createElement(Oe.Provider, {
|
|
15932
|
-
value:
|
|
15932
|
+
value: v
|
|
15933
15933
|
}, B))));
|
|
15934
15934
|
}), ff = /* @__PURE__ */ Fe(function(e) {
|
|
15935
15935
|
let { outerDeco: t, getPos: r, node: s, innerDeco: o, ...i } = e;
|
|
15936
|
-
const { view: l } =
|
|
15936
|
+
const { view: l } = ie(Vt), a = l == null ? void 0 : l.someProp("nodeViews", (c) => c == null ? void 0 : c[s.type.name]);
|
|
15937
15937
|
return a ? /* @__PURE__ */ A.createElement(Mb, {
|
|
15938
15938
|
customNodeView: a,
|
|
15939
15939
|
node: s,
|
|
@@ -15950,7 +15950,7 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15950
15950
|
});
|
|
15951
15951
|
function Eb(n) {
|
|
15952
15952
|
let { getPos: e } = n;
|
|
15953
|
-
const { siblingsRef: t, parentRef: r } =
|
|
15953
|
+
const { siblingsRef: t, parentRef: r } = ie(Oe), s = I(null), o = I(null), [i, l] = N(!1);
|
|
15954
15954
|
return X(() => {
|
|
15955
15955
|
const a = t.current;
|
|
15956
15956
|
return () => {
|
|
@@ -15964,7 +15964,7 @@ function Eb(n) {
|
|
|
15964
15964
|
]), X(() => {
|
|
15965
15965
|
var c;
|
|
15966
15966
|
const a = t.current[t.current.length - 1];
|
|
15967
|
-
if ((
|
|
15967
|
+
if ((fe.safari || fe.chrome) && ((c = a == null ? void 0 : a.dom) == null ? void 0 : c.contentEditable) == "false") {
|
|
15968
15968
|
l(!0);
|
|
15969
15969
|
return;
|
|
15970
15970
|
}
|
|
@@ -16347,7 +16347,7 @@ class $b extends $f {
|
|
|
16347
16347
|
}
|
|
16348
16348
|
function zb(n) {
|
|
16349
16349
|
let { getPos: e } = n;
|
|
16350
|
-
const { siblingsRef: t, parentRef: r } =
|
|
16350
|
+
const { siblingsRef: t, parentRef: r } = ie(Oe), s = I(null), o = I(null);
|
|
16351
16351
|
return X(() => {
|
|
16352
16352
|
const i = t.current;
|
|
16353
16353
|
return () => {
|
|
@@ -16367,7 +16367,7 @@ function zb(n) {
|
|
|
16367
16367
|
}
|
|
16368
16368
|
function jb(n) {
|
|
16369
16369
|
let { widget: e, getPos: t } = n;
|
|
16370
|
-
const { siblingsRef: r, parentRef: s } =
|
|
16370
|
+
const { siblingsRef: r, parentRef: s } = ie(Oe), o = I(null), i = I(() => t.current()).current, l = I(null);
|
|
16371
16371
|
X(() => {
|
|
16372
16372
|
const c = r.current;
|
|
16373
16373
|
return () => {
|
|
@@ -16402,7 +16402,7 @@ function Gs(n, e) {
|
|
|
16402
16402
|
}
|
|
16403
16403
|
const Fb = /* @__PURE__ */ Fe(function(e) {
|
|
16404
16404
|
let { child: t, getInnerPos: r } = e;
|
|
16405
|
-
const { view: s } =
|
|
16405
|
+
const { view: s } = ie(Vt), o = I(() => r.current() + t.offset);
|
|
16406
16406
|
return o.current = () => r.current() + t.offset, t.type === "widget" ? /* @__PURE__ */ A.createElement(jb, {
|
|
16407
16407
|
key: t.key,
|
|
16408
16408
|
widget: t.widget,
|
|
@@ -16561,29 +16561,29 @@ const or = /* @__PURE__ */ Fe(function(e) {
|
|
|
16561
16561
|
let M;
|
|
16562
16562
|
if (y) {
|
|
16563
16563
|
M = Xs(i.current(), m, "native-widget", o == null ? void 0 : o.posToKey, p, x);
|
|
16564
|
-
const
|
|
16564
|
+
const z = {
|
|
16565
16565
|
type: "native-widget",
|
|
16566
16566
|
widget: p,
|
|
16567
16567
|
marks: k,
|
|
16568
16568
|
offset: m,
|
|
16569
16569
|
index: x,
|
|
16570
16570
|
key: M
|
|
16571
|
-
},
|
|
16572
|
-
|
|
16571
|
+
}, R = l.get(M);
|
|
16572
|
+
R && Gs(R, z) ? R.offset = m : l.set(M, z), a.add(M);
|
|
16573
16573
|
} else {
|
|
16574
16574
|
M = Xs(i.current(), m, "widget", o == null ? void 0 : o.posToKey, p, x);
|
|
16575
|
-
const
|
|
16575
|
+
const z = {
|
|
16576
16576
|
type: "widget",
|
|
16577
16577
|
widget: p,
|
|
16578
16578
|
marks: k,
|
|
16579
16579
|
offset: m,
|
|
16580
16580
|
index: x,
|
|
16581
16581
|
key: M
|
|
16582
|
-
},
|
|
16583
|
-
|
|
16582
|
+
}, R = l.get(M);
|
|
16583
|
+
R && Gs(R, z) ? R.offset = m : l.set(M, z), a.add(M);
|
|
16584
16584
|
}
|
|
16585
|
-
const
|
|
16586
|
-
c.push(
|
|
16585
|
+
const P = l.get(M);
|
|
16586
|
+
c.push(P), Lb(u, l.get(M));
|
|
16587
16587
|
}, (p, y, m, x) => {
|
|
16588
16588
|
const k = Xs(i.current(), x, "node", o == null ? void 0 : o.posToKey), M = {
|
|
16589
16589
|
type: "node",
|
|
@@ -16593,8 +16593,8 @@ const or = /* @__PURE__ */ Fe(function(e) {
|
|
|
16593
16593
|
outerDeco: y,
|
|
16594
16594
|
offset: x,
|
|
16595
16595
|
key: k
|
|
16596
|
-
},
|
|
16597
|
-
|
|
16596
|
+
}, P = l.get(k);
|
|
16597
|
+
P && Gs(P, M) ? (P.offset = x, u = P) : (l.set(k, M), u = M), a.add(k), Wb(c, u), c = [];
|
|
16598
16598
|
});
|
|
16599
16599
|
for (const p of l.keys())
|
|
16600
16600
|
a.has(p) || l.delete(p);
|
|
@@ -16646,7 +16646,7 @@ const or = /* @__PURE__ */ Fe(function(e) {
|
|
|
16646
16646
|
})), df = /* @__PURE__ */ ct(null);
|
|
16647
16647
|
function Jb(n, e) {
|
|
16648
16648
|
let { as: t, ...r } = n;
|
|
16649
|
-
const s = I([]), o = I(null), { setMount: i, ...l } =
|
|
16649
|
+
const s = I([]), o = I(null), { setMount: i, ...l } = ie(df), a = I(void 0);
|
|
16650
16650
|
ns(e, () => o.current, []);
|
|
16651
16651
|
const c = Me(() => ({
|
|
16652
16652
|
parentRef: a,
|
|
@@ -16707,8 +16707,8 @@ function Ub(n) {
|
|
|
16707
16707
|
function pf(n) {
|
|
16708
16708
|
return /* @__PURE__ */ A.createElement(db, null, /* @__PURE__ */ A.createElement(Ub, n));
|
|
16709
16709
|
}
|
|
16710
|
-
function
|
|
16711
|
-
const e = I(n), { view: t } =
|
|
16710
|
+
function me(n) {
|
|
16711
|
+
const e = I(n), { view: t } = ie(Vt);
|
|
16712
16712
|
return ft(() => {
|
|
16713
16713
|
e.current = n;
|
|
16714
16714
|
}, [
|
|
@@ -16722,7 +16722,7 @@ function pe(n) {
|
|
|
16722
16722
|
]);
|
|
16723
16723
|
}
|
|
16724
16724
|
function yi(n) {
|
|
16725
|
-
const e =
|
|
16725
|
+
const e = ie(uf), t = me(n);
|
|
16726
16726
|
ft(() => {
|
|
16727
16727
|
e(t);
|
|
16728
16728
|
}, [
|
|
@@ -17131,7 +17131,7 @@ const Yb = ["p", 0], Gb = ["blockquote", 0], Xb = ["hr"], Qb = ["pre", ["code",
|
|
|
17131
17131
|
ft((c) => {
|
|
17132
17132
|
c && (r(e.isActive && e.isActive(c.state)), l(e.isSelected && !e.isSelected(c.state)), e.isDisabled ? o(e.isDisabled(c.state)) : o(!e.command(c.state)));
|
|
17133
17133
|
});
|
|
17134
|
-
const a =
|
|
17134
|
+
const a = me((c) => {
|
|
17135
17135
|
c && (s || e.command(c.state, c.dispatch, c), c.focus());
|
|
17136
17136
|
});
|
|
17137
17137
|
return i ? null : /* @__PURE__ */ g.jsx(
|
|
@@ -17167,7 +17167,7 @@ const Yb = ["p", 0], Gb = ["blockquote", 0], Xb = ["hr"], Qb = ["pre", ["code",
|
|
|
17167
17167
|
r && /* @__PURE__ */ g.jsx(ir, { item: r })
|
|
17168
17168
|
] });
|
|
17169
17169
|
}, xs = ({ items: n }) => /* @__PURE__ */ g.jsx("div", { className: "MenuBlock", children: n.map((e, t) => /* @__PURE__ */ g.jsx(ir, { item: e }, t)) }), m0 = ({ schema: n, isOpen: e, onClose: t }) => {
|
|
17170
|
-
const r =
|
|
17170
|
+
const r = me((s, o) => {
|
|
17171
17171
|
s && (Ce(n.marks.link, { href: o })(s.state, s.dispatch), t(), s.focus());
|
|
17172
17172
|
});
|
|
17173
17173
|
return /* @__PURE__ */ g.jsx(
|
|
@@ -17290,7 +17290,7 @@ const kf = () => /* @__PURE__ */ g.jsxs("div", { className: "MenuBlock", childre
|
|
|
17290
17290
|
const h = lt.getState(d.state);
|
|
17291
17291
|
u(h.upload !== void 0);
|
|
17292
17292
|
}, [e]);
|
|
17293
|
-
const f =
|
|
17293
|
+
const f = me((d) => {
|
|
17294
17294
|
d && (c ? _m(d, o, l, n) : qm(d, r, l, n), d.focus(), t());
|
|
17295
17295
|
});
|
|
17296
17296
|
return /* @__PURE__ */ g.jsxs(Pa, { isOpen: e, onClose: t, children: [
|
|
@@ -17345,7 +17345,7 @@ const kf = () => /* @__PURE__ */ g.jsxs("div", { className: "MenuBlock", childre
|
|
|
17345
17345
|
q(() => {
|
|
17346
17346
|
s(""), i("");
|
|
17347
17347
|
}, [e]);
|
|
17348
|
-
const l =
|
|
17348
|
+
const l = me((a) => {
|
|
17349
17349
|
const c = n.nodes.video;
|
|
17350
17350
|
if (!a || !r || !c) return;
|
|
17351
17351
|
const u = bs(r);
|
|
@@ -17484,16 +17484,16 @@ const Nf = () => /* @__PURE__ */ g.jsx(xs, { items: [{
|
|
|
17484
17484
|
}), u(x ? `${x} / ${m.childCount}` : "");
|
|
17485
17485
|
}
|
|
17486
17486
|
});
|
|
17487
|
-
const f =
|
|
17487
|
+
const f = me((p, y) => {
|
|
17488
17488
|
if (!p) return;
|
|
17489
17489
|
i(y);
|
|
17490
17490
|
const m = p.state.tr, x = t.getPos();
|
|
17491
17491
|
p.dispatch(m.setNodeMarkup(x, null, { ...t.node.attrs, title: y })), p.focus();
|
|
17492
|
-
}), d =
|
|
17492
|
+
}), d = me((p) => {
|
|
17493
17493
|
if (!p) return;
|
|
17494
17494
|
const y = t.getPos(), m = t.node.nodeSize, x = t.node.attrs, k = p.state.schema, M = k.nodes.carousel.create(null, k.nodes.image.create(x));
|
|
17495
17495
|
p.dispatch(p.state.tr.replaceWith(y, y + m, M));
|
|
17496
|
-
}), h =
|
|
17496
|
+
}), h = me((p) => {
|
|
17497
17497
|
if (!p) return;
|
|
17498
17498
|
const y = p.state.tr, m = t.getPos(), x = t.node.nodeSize, k = p.state.doc.resolve(m).parent;
|
|
17499
17499
|
k.type.name === "carousel" && k.childCount === 1 ? p.dispatch(y.delete(m - 1, m - 1 + k.nodeSize)) : p.dispatch(y.delete(m, m + x));
|
|
@@ -17542,7 +17542,7 @@ const Nf = () => /* @__PURE__ */ g.jsx(xs, { items: [{
|
|
|
17542
17542
|
yi(() => !0), q(() => {
|
|
17543
17543
|
i(bs(t.node.attrs.src));
|
|
17544
17544
|
}, [t]);
|
|
17545
|
-
const u =
|
|
17545
|
+
const u = me((f, d) => {
|
|
17546
17546
|
if (!f) return;
|
|
17547
17547
|
a(d);
|
|
17548
17548
|
const { $from: h, $to: p } = f.state.selection, y = h.blockRange(p);
|
|
@@ -17588,7 +17588,7 @@ const Nf = () => /* @__PURE__ */ g.jsx(xs, { items: [{
|
|
|
17588
17588
|
const c = l.state.doc, u = !!c.textBetween(0, c.content.size, void 0, " ").length, f = !!Lo(l.state);
|
|
17589
17589
|
r && t ? a = u && f : r ? a = f : t && (a = u), o(a);
|
|
17590
17590
|
});
|
|
17591
|
-
const i =
|
|
17591
|
+
const i = me((l) => {
|
|
17592
17592
|
try {
|
|
17593
17593
|
let a;
|
|
17594
17594
|
const c = ai(l.state);
|
|
@@ -17679,7 +17679,7 @@ const Nf = () => /* @__PURE__ */ g.jsx(xs, { items: [{
|
|
|
17679
17679
|
}
|
|
17680
17680
|
r(f), o(d);
|
|
17681
17681
|
}, [i]);
|
|
17682
|
-
const a =
|
|
17682
|
+
const a = me((c, u) => {
|
|
17683
17683
|
!c || !u.id || (s[u.id](c.state, c.dispatch, c), l(!1), c.focus());
|
|
17684
17684
|
});
|
|
17685
17685
|
return n.nodes.heading ? /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
@@ -17736,7 +17736,7 @@ const Nf = () => /* @__PURE__ */ g.jsx(xs, { items: [{
|
|
|
17736
17736
|
icon: /* @__PURE__ */ g.jsx(O.AlignJustify, {}),
|
|
17737
17737
|
text: "Выровнять по краям"
|
|
17738
17738
|
}], C0 = ({ schema: n }) => {
|
|
17739
|
-
const e = I(null), [t, r] = N(!1), s =
|
|
17739
|
+
const e = I(null), [t, r] = N(!1), s = me((o, i) => {
|
|
17740
17740
|
if (!o || !i.id) return;
|
|
17741
17741
|
const l = i.id === "left" ? null : i.id, { $from: a, $to: c } = o.state.selection, u = a.blockRange(c);
|
|
17742
17742
|
if (u) {
|
|
@@ -17826,7 +17826,7 @@ const Nf = () => /* @__PURE__ */ g.jsx(xs, { items: [{
|
|
|
17826
17826
|
q(() => {
|
|
17827
17827
|
i(M0(t.node));
|
|
17828
17828
|
}, [t]);
|
|
17829
|
-
const l =
|
|
17829
|
+
const l = me((a) => {
|
|
17830
17830
|
hy(a.state, a.dispatch);
|
|
17831
17831
|
});
|
|
17832
17832
|
return /* @__PURE__ */ g.jsxs("table", { ref: s, ...r, children: [
|
|
@@ -17912,7 +17912,7 @@ const Nf = () => /* @__PURE__ */ g.jsx(xs, { items: [{
|
|
|
17912
17912
|
onCellMenuClose: o,
|
|
17913
17913
|
onColumnMenuClose: i
|
|
17914
17914
|
}) => {
|
|
17915
|
-
const l =
|
|
17915
|
+
const l = me((a, c) => {
|
|
17916
17916
|
if (a) {
|
|
17917
17917
|
switch (c.id) {
|
|
17918
17918
|
case "toggleHeaderRow":
|
|
@@ -18136,36 +18136,39 @@ const Nf = () => /* @__PURE__ */ g.jsx(xs, { items: [{
|
|
|
18136
18136
|
}
|
|
18137
18137
|
), A0 = Ge(
|
|
18138
18138
|
function({ children: e, nodeProps: t, ...r }, s) {
|
|
18139
|
-
|
|
18140
|
-
|
|
18141
|
-
|
|
18139
|
+
var B;
|
|
18140
|
+
const o = I(null), [i, l] = N(!1), [a, c] = N(!1), [u, f] = N(!1), [d, h] = N(!1), [p, y] = N(), [m, x] = N(), k = (v) => {
|
|
18141
|
+
const D = v.scrollLeft, L = v.clientWidth, ee = v.scrollWidth;
|
|
18142
|
+
f(D > 0), h(D < ee - L * 1.5);
|
|
18142
18143
|
};
|
|
18143
18144
|
yi(() => !0), q(() => {
|
|
18144
|
-
|
|
18145
|
+
o.current && (m && o.current.scrollWidth > m && (o.current.scrollLeft = o.current.scrollWidth - o.current.clientWidth), x(o.current.scrollWidth));
|
|
18146
|
+
}, [(B = o.current) == null ? void 0 : B.scrollWidth]), q(() => {
|
|
18147
|
+
y(t.getPos() + t.node.nodeSize - 1), c(t.node.childCount > 1), o.current && t.node.childCount > 1 && k(o.current);
|
|
18145
18148
|
}, [t, o]);
|
|
18146
|
-
const
|
|
18147
|
-
if (!
|
|
18148
|
-
const D = t.getPos(),
|
|
18149
|
-
|
|
18150
|
-
}),
|
|
18149
|
+
const M = me((v) => {
|
|
18150
|
+
if (!v) return;
|
|
18151
|
+
const D = t.getPos(), L = t.node.nodeSize;
|
|
18152
|
+
v.dispatch(v.state.tr.delete(D, D + L));
|
|
18153
|
+
}), P = () => {
|
|
18151
18154
|
l(!0);
|
|
18152
|
-
},
|
|
18153
|
-
|
|
18154
|
-
},
|
|
18155
|
-
if (
|
|
18156
|
-
const
|
|
18157
|
-
let
|
|
18158
|
-
o.current.scrollLeft =
|
|
18155
|
+
}, z = (v) => {
|
|
18156
|
+
k(v.currentTarget);
|
|
18157
|
+
}, R = (v, D) => {
|
|
18158
|
+
if (v.stopPropagation(), !o.current) return;
|
|
18159
|
+
const L = o.current.clientWidth;
|
|
18160
|
+
let ee = o.current.scrollLeft + D * L;
|
|
18161
|
+
o.current.scrollLeft = ee;
|
|
18159
18162
|
};
|
|
18160
18163
|
return /* @__PURE__ */ g.jsxs("div", { ref: s, ...r, className: "carousel", children: [
|
|
18161
|
-
/* @__PURE__ */ g.jsx("div", { className: "carousel-list", ref: o, onScroll:
|
|
18164
|
+
/* @__PURE__ */ g.jsx("div", { className: "carousel-list", ref: o, onScroll: z, children: e }),
|
|
18162
18165
|
/* @__PURE__ */ g.jsxs("div", { className: "carousel-buttons", children: [
|
|
18163
|
-
/* @__PURE__ */ g.jsx("div", { onClick:
|
|
18164
|
-
/* @__PURE__ */ g.jsx("div", { onClick:
|
|
18166
|
+
/* @__PURE__ */ g.jsx("div", { onClick: M, className: "text-button", children: "Удалить карусель" }),
|
|
18167
|
+
/* @__PURE__ */ g.jsx("div", { onClick: P, children: /* @__PURE__ */ g.jsx(O.Plus, {}) })
|
|
18165
18168
|
] }),
|
|
18166
18169
|
a && /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
18167
|
-
u && /* @__PURE__ */ g.jsx("div", { className: "carousel-prev", onClick: (
|
|
18168
|
-
d && /* @__PURE__ */ g.jsx("div", { className: "carousel-next", onClick: (
|
|
18170
|
+
u && /* @__PURE__ */ g.jsx("div", { className: "carousel-prev", onClick: (v) => R(v, -1), children: /* @__PURE__ */ g.jsx(O.ChevronLeft, {}) }),
|
|
18171
|
+
d && /* @__PURE__ */ g.jsx("div", { className: "carousel-next", onClick: (v) => R(v, 1), children: /* @__PURE__ */ g.jsx(O.ChevronRight, {}) })
|
|
18169
18172
|
] }),
|
|
18170
18173
|
/* @__PURE__ */ g.jsx(wf, { pos: p, isOpen: i, onClose: () => l(!1) })
|
|
18171
18174
|
] });
|