mhz-ui 1.0.99 → 1.0.100
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/UiEditor/UiEditor.js +749 -746
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./UiEditor.css";
|
|
2
|
-
import { defineComponent as mn, ref as ts, onMounted as ns, onBeforeUnmount as
|
|
2
|
+
import { defineComponent as mn, ref as ts, onMounted as ns, onBeforeUnmount as Un, h as Gn, getCurrentInstance as Ec, watchEffect as Nc, nextTick as Ac, unref as Ni, shallowRef as Dc, markRaw as Ic, customRef as Rc, computed as Pc, watch as Bc, openBlock as Bs, createElementBlock as Ls, normalizeClass as fr, createElementVNode as zs, Fragment as Lc, renderList as zc, toDisplayString as Vc, createVNode as Fc } from "vue";
|
|
3
3
|
import { _ as $c } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
function X(n) {
|
|
5
5
|
this.content = n;
|
|
@@ -330,15 +330,15 @@ class x {
|
|
|
330
330
|
*/
|
|
331
331
|
findIndex(e, t = -1) {
|
|
332
332
|
if (e == 0)
|
|
333
|
-
return
|
|
333
|
+
return pr(0, e);
|
|
334
334
|
if (e == this.size)
|
|
335
|
-
return
|
|
335
|
+
return pr(this.content.length, e);
|
|
336
336
|
if (e > this.size || e < 0)
|
|
337
337
|
throw new RangeError(`Position ${e} outside of fragment (${this})`);
|
|
338
338
|
for (let r = 0, i = 0; ; r++) {
|
|
339
339
|
let s = this.child(r), o = i + s.nodeSize;
|
|
340
340
|
if (o >= e)
|
|
341
|
-
return o == e || t > 0 ?
|
|
341
|
+
return o == e || t > 0 ? pr(r + 1, o) : pr(r, i);
|
|
342
342
|
i = o;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
@@ -403,11 +403,11 @@ class x {
|
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
x.empty = new x([], 0);
|
|
406
|
-
const
|
|
407
|
-
function
|
|
408
|
-
return
|
|
406
|
+
const si = { index: 0, offset: 0 };
|
|
407
|
+
function pr(n, e) {
|
|
408
|
+
return si.index = n, si.offset = e, si;
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function Tr(n, e) {
|
|
411
411
|
if (n === e)
|
|
412
412
|
return !0;
|
|
413
413
|
if (!(n && typeof n == "object") || !(e && typeof e == "object"))
|
|
@@ -419,11 +419,11 @@ function Or(n, e) {
|
|
|
419
419
|
if (n.length != e.length)
|
|
420
420
|
return !1;
|
|
421
421
|
for (let r = 0; r < n.length; r++)
|
|
422
|
-
if (!
|
|
422
|
+
if (!Tr(n[r], e[r]))
|
|
423
423
|
return !1;
|
|
424
424
|
} else {
|
|
425
425
|
for (let r in n)
|
|
426
|
-
if (!(r in e) || !
|
|
426
|
+
if (!(r in e) || !Tr(n[r], e[r]))
|
|
427
427
|
return !1;
|
|
428
428
|
for (let r in e)
|
|
429
429
|
if (!(r in n))
|
|
@@ -431,7 +431,7 @@ function Or(n, e) {
|
|
|
431
431
|
}
|
|
432
432
|
return !0;
|
|
433
433
|
}
|
|
434
|
-
let F = class
|
|
434
|
+
let F = class Ai {
|
|
435
435
|
/**
|
|
436
436
|
@internal
|
|
437
437
|
*/
|
|
@@ -485,7 +485,7 @@ let F = class Di {
|
|
|
485
485
|
another mark.
|
|
486
486
|
*/
|
|
487
487
|
eq(e) {
|
|
488
|
-
return this == e || this.type == e.type &&
|
|
488
|
+
return this == e || this.type == e.type && Tr(this.attrs, e.attrs);
|
|
489
489
|
}
|
|
490
490
|
/**
|
|
491
491
|
Convert this mark to a JSON-serializeable representation.
|
|
@@ -529,15 +529,15 @@ let F = class Di {
|
|
|
529
529
|
*/
|
|
530
530
|
static setFrom(e) {
|
|
531
531
|
if (!e || Array.isArray(e) && e.length == 0)
|
|
532
|
-
return
|
|
533
|
-
if (e instanceof
|
|
532
|
+
return Ai.none;
|
|
533
|
+
if (e instanceof Ai)
|
|
534
534
|
return [e];
|
|
535
535
|
let t = e.slice();
|
|
536
536
|
return t.sort((r, i) => r.type.rank - i.type.rank), t;
|
|
537
537
|
}
|
|
538
538
|
};
|
|
539
539
|
F.none = [];
|
|
540
|
-
class
|
|
540
|
+
class Er extends Error {
|
|
541
541
|
}
|
|
542
542
|
class S {
|
|
543
543
|
/**
|
|
@@ -640,9 +640,9 @@ function kl(n, e, t, r) {
|
|
|
640
640
|
}
|
|
641
641
|
function Hc(n, e, t) {
|
|
642
642
|
if (t.openStart > n.depth)
|
|
643
|
-
throw new
|
|
643
|
+
throw new Er("Inserted content deeper than insertion position");
|
|
644
644
|
if (n.depth - t.openStart != e.depth - t.openEnd)
|
|
645
|
-
throw new
|
|
645
|
+
throw new Er("Inconsistent open depths");
|
|
646
646
|
return xl(n, e, t, 0);
|
|
647
647
|
}
|
|
648
648
|
function xl(n, e, t, r) {
|
|
@@ -658,39 +658,39 @@ function xl(n, e, t, r) {
|
|
|
658
658
|
let { start: o, end: l } = jc(t, n);
|
|
659
659
|
return Dt(s, Sl(n, o, l, e, r));
|
|
660
660
|
}
|
|
661
|
-
else return Dt(s,
|
|
661
|
+
else return Dt(s, Nr(n, e, r));
|
|
662
662
|
}
|
|
663
663
|
function wl(n, e) {
|
|
664
664
|
if (!e.type.compatibleContent(n.type))
|
|
665
|
-
throw new
|
|
665
|
+
throw new Er("Cannot join " + e.type.name + " onto " + n.type.name);
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function Di(n, e, t) {
|
|
668
668
|
let r = n.node(t);
|
|
669
669
|
return wl(r, e.node(t)), r;
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function At(n, e) {
|
|
672
672
|
let t = e.length - 1;
|
|
673
673
|
t >= 0 && n.isText && n.sameMarkup(e[t]) ? e[t] = n.withText(e[t].text + n.text) : e.push(n);
|
|
674
674
|
}
|
|
675
675
|
function En(n, e, t, r) {
|
|
676
676
|
let i = (e || n).node(t), s = 0, o = e ? e.index(t) : i.childCount;
|
|
677
|
-
n && (s = n.index(t), n.depth > t ? s++ : n.textOffset && (
|
|
677
|
+
n && (s = n.index(t), n.depth > t ? s++ : n.textOffset && (At(n.nodeAfter, r), s++));
|
|
678
678
|
for (let l = s; l < o; l++)
|
|
679
|
-
|
|
680
|
-
e && e.depth == t && e.textOffset &&
|
|
679
|
+
At(i.child(l), r);
|
|
680
|
+
e && e.depth == t && e.textOffset && At(e.nodeBefore, r);
|
|
681
681
|
}
|
|
682
682
|
function Dt(n, e) {
|
|
683
683
|
return n.type.checkContent(e), n.copy(e);
|
|
684
684
|
}
|
|
685
685
|
function Sl(n, e, t, r, i) {
|
|
686
|
-
let s = n.depth > i &&
|
|
687
|
-
return En(null, n, i, l), s && o && e.index(i) == t.index(i) ? (wl(s, o),
|
|
686
|
+
let s = n.depth > i && Di(n, e, i + 1), o = r.depth > i && Di(t, r, i + 1), l = [];
|
|
687
|
+
return En(null, n, i, l), s && o && e.index(i) == t.index(i) ? (wl(s, o), At(Dt(s, Sl(n, e, t, r, i + 1)), l)) : (s && At(Dt(s, Nr(n, e, i + 1)), l), En(e, t, i, l), o && At(Dt(o, Nr(t, r, i + 1)), l)), En(r, null, i, l), new x(l);
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function Nr(n, e, t) {
|
|
690
690
|
let r = [];
|
|
691
691
|
if (En(null, n, t, r), n.depth > t) {
|
|
692
|
-
let i =
|
|
693
|
-
|
|
692
|
+
let i = Di(n, e, t + 1);
|
|
693
|
+
At(Dt(i, Nr(n, e, t + 1)), r);
|
|
694
694
|
}
|
|
695
695
|
return En(e, null, t, r), new x(r);
|
|
696
696
|
}
|
|
@@ -997,7 +997,7 @@ class Ar {
|
|
|
997
997
|
}
|
|
998
998
|
}
|
|
999
999
|
const Kc = /* @__PURE__ */ Object.create(null);
|
|
1000
|
-
let ut = class
|
|
1000
|
+
let ut = class Ii {
|
|
1001
1001
|
/**
|
|
1002
1002
|
@internal
|
|
1003
1003
|
*/
|
|
@@ -1115,21 +1115,21 @@ let ut = class Ri {
|
|
|
1115
1115
|
attributes, and marks.
|
|
1116
1116
|
*/
|
|
1117
1117
|
hasMarkup(e, t, r) {
|
|
1118
|
-
return this.type == e &&
|
|
1118
|
+
return this.type == e && Tr(this.attrs, t || e.defaultAttrs || Kc) && F.sameSet(this.marks, r || F.none);
|
|
1119
1119
|
}
|
|
1120
1120
|
/**
|
|
1121
1121
|
Create a new node with the same markup as this node, containing
|
|
1122
1122
|
the given content (or empty, if no content is given).
|
|
1123
1123
|
*/
|
|
1124
1124
|
copy(e = null) {
|
|
1125
|
-
return e == this.content ? this : new
|
|
1125
|
+
return e == this.content ? this : new Ii(this.type, this.attrs, e, this.marks);
|
|
1126
1126
|
}
|
|
1127
1127
|
/**
|
|
1128
1128
|
Create a copy of this node, with the given set of marks instead
|
|
1129
1129
|
of the node's own marks.
|
|
1130
1130
|
*/
|
|
1131
1131
|
mark(e) {
|
|
1132
|
-
return e == this.marks ? this : new
|
|
1132
|
+
return e == this.marks ? this : new Ii(this.type, this.attrs, this.content, e);
|
|
1133
1133
|
}
|
|
1134
1134
|
/**
|
|
1135
1135
|
Create a copy of this node with only the content between the
|
|
@@ -1367,7 +1367,7 @@ let ut = class Ri {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
};
|
|
1369
1369
|
ut.prototype.text = void 0;
|
|
1370
|
-
class
|
|
1370
|
+
class Dr extends ut {
|
|
1371
1371
|
/**
|
|
1372
1372
|
@internal
|
|
1373
1373
|
*/
|
|
@@ -1389,10 +1389,10 @@ class Nr extends ut {
|
|
|
1389
1389
|
return this.text.length;
|
|
1390
1390
|
}
|
|
1391
1391
|
mark(e) {
|
|
1392
|
-
return e == this.marks ? this : new
|
|
1392
|
+
return e == this.marks ? this : new Dr(this.type, this.attrs, this.text, e);
|
|
1393
1393
|
}
|
|
1394
1394
|
withText(e) {
|
|
1395
|
-
return e == this.text ? this : new
|
|
1395
|
+
return e == this.text ? this : new Dr(this.type, this.attrs, e, this.marks);
|
|
1396
1396
|
}
|
|
1397
1397
|
cut(e = 0, t = this.text.length) {
|
|
1398
1398
|
return e == 0 && t == this.text.length ? this : this.withText(this.text.slice(e, t));
|
|
@@ -1778,7 +1778,7 @@ function El(n, e) {
|
|
|
1778
1778
|
}
|
|
1779
1779
|
return t;
|
|
1780
1780
|
}
|
|
1781
|
-
function
|
|
1781
|
+
function Nl(n, e, t, r) {
|
|
1782
1782
|
for (let i in e)
|
|
1783
1783
|
if (!(i in n))
|
|
1784
1784
|
throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);
|
|
@@ -1787,7 +1787,7 @@ function Al(n, e, t, r) {
|
|
|
1787
1787
|
s.validate && s.validate(e[i]);
|
|
1788
1788
|
}
|
|
1789
1789
|
}
|
|
1790
|
-
function
|
|
1790
|
+
function Al(n, e) {
|
|
1791
1791
|
let t = /* @__PURE__ */ Object.create(null);
|
|
1792
1792
|
if (e)
|
|
1793
1793
|
for (let r in e)
|
|
@@ -1799,7 +1799,7 @@ let Hs = class Dl {
|
|
|
1799
1799
|
@internal
|
|
1800
1800
|
*/
|
|
1801
1801
|
constructor(e, t, r) {
|
|
1802
|
-
this.name = e, this.schema = t, this.spec = r, this.markSet = null, this.groups = r.group ? r.group.split(" ") : [], this.attrs =
|
|
1802
|
+
this.name = e, this.schema = t, this.spec = r, this.markSet = null, this.groups = r.group ? r.group.split(" ") : [], this.attrs = Al(e, r.attrs), this.defaultAttrs = Tl(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(r.inline || e == "text"), this.isText = e == "text";
|
|
1803
1803
|
}
|
|
1804
1804
|
/**
|
|
1805
1805
|
True if this is an inline type.
|
|
@@ -1927,7 +1927,7 @@ let Hs = class Dl {
|
|
|
1927
1927
|
@internal
|
|
1928
1928
|
*/
|
|
1929
1929
|
checkAttrs(e) {
|
|
1930
|
-
|
|
1930
|
+
Nl(this.attrs, e, "node", this.name);
|
|
1931
1931
|
}
|
|
1932
1932
|
/**
|
|
1933
1933
|
Check whether the given mark type is allowed in this node.
|
|
@@ -1989,12 +1989,12 @@ class nu {
|
|
|
1989
1989
|
return !this.hasDefault;
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
|
-
class
|
|
1992
|
+
class Wr {
|
|
1993
1993
|
/**
|
|
1994
1994
|
@internal
|
|
1995
1995
|
*/
|
|
1996
1996
|
constructor(e, t, r, i) {
|
|
1997
|
-
this.name = e, this.rank = t, this.schema = r, this.spec = i, this.attrs =
|
|
1997
|
+
this.name = e, this.rank = t, this.schema = r, this.spec = i, this.attrs = Al(e, i.attrs), this.excluded = null;
|
|
1998
1998
|
let s = Tl(this.attrs);
|
|
1999
1999
|
this.instance = s ? new F(this, s) : null;
|
|
2000
2000
|
}
|
|
@@ -2011,7 +2011,7 @@ class qr {
|
|
|
2011
2011
|
*/
|
|
2012
2012
|
static compile(e, t) {
|
|
2013
2013
|
let r = /* @__PURE__ */ Object.create(null), i = 0;
|
|
2014
|
-
return e.forEach((s, o) => r[s] = new
|
|
2014
|
+
return e.forEach((s, o) => r[s] = new Wr(s, i++, t, o)), r;
|
|
2015
2015
|
}
|
|
2016
2016
|
/**
|
|
2017
2017
|
When there is a mark of this type in the given set, a new set
|
|
@@ -2034,7 +2034,7 @@ class qr {
|
|
|
2034
2034
|
@internal
|
|
2035
2035
|
*/
|
|
2036
2036
|
checkAttrs(e) {
|
|
2037
|
-
|
|
2037
|
+
Nl(this.attrs, e, "mark", this.name);
|
|
2038
2038
|
}
|
|
2039
2039
|
/**
|
|
2040
2040
|
Queries whether a given mark type is
|
|
@@ -2053,7 +2053,7 @@ class Il {
|
|
|
2053
2053
|
let t = this.spec = {};
|
|
2054
2054
|
for (let i in e)
|
|
2055
2055
|
t[i] = e[i];
|
|
2056
|
-
t.nodes = X.from(e.nodes), t.marks = X.from(e.marks || {}), this.nodes = Hs.compile(this.spec.nodes, this), this.marks =
|
|
2056
|
+
t.nodes = X.from(e.nodes), t.marks = X.from(e.marks || {}), this.nodes = Hs.compile(this.spec.nodes, this), this.marks = Wr.compile(this.spec.marks, this);
|
|
2057
2057
|
let r = /* @__PURE__ */ Object.create(null);
|
|
2058
2058
|
for (let i in this.nodes) {
|
|
2059
2059
|
if (i in this.marks)
|
|
@@ -2095,7 +2095,7 @@ class Il {
|
|
|
2095
2095
|
*/
|
|
2096
2096
|
text(e, t) {
|
|
2097
2097
|
let r = this.nodes.text;
|
|
2098
|
-
return new
|
|
2098
|
+
return new Dr(r, r.defaultAttrs, e, F.setFrom(t));
|
|
2099
2099
|
}
|
|
2100
2100
|
/**
|
|
2101
2101
|
Create a mark with the given type and attributes.
|
|
@@ -2304,13 +2304,13 @@ const Rl = {
|
|
|
2304
2304
|
script: !0,
|
|
2305
2305
|
style: !0,
|
|
2306
2306
|
title: !0
|
|
2307
|
-
}, Pl = { ol: !0, ul: !0 },
|
|
2307
|
+
}, Pl = { ol: !0, ul: !0 }, Ln = 1, Ri = 2, Nn = 4;
|
|
2308
2308
|
function Ws(n, e, t) {
|
|
2309
|
-
return e != null ? (e ?
|
|
2309
|
+
return e != null ? (e ? Ln : 0) | (e === "full" ? Ri : 0) : n && n.whitespace == "pre" ? Ln | Ri : t & ~Nn;
|
|
2310
2310
|
}
|
|
2311
|
-
class
|
|
2311
|
+
class hr {
|
|
2312
2312
|
constructor(e, t, r, i, s, o) {
|
|
2313
|
-
this.type = e, this.attrs = t, this.marks = r, this.solid = i, this.options = o, this.content = [], this.activeMarks = F.none, this.match = s || (o &
|
|
2313
|
+
this.type = e, this.attrs = t, this.marks = r, this.solid = i, this.options = o, this.content = [], this.activeMarks = F.none, this.match = s || (o & Nn ? null : e.contentMatch);
|
|
2314
2314
|
}
|
|
2315
2315
|
findWrapping(e) {
|
|
2316
2316
|
if (!this.match) {
|
|
@@ -2327,7 +2327,7 @@ class pr {
|
|
|
2327
2327
|
return this.match.findWrapping(e.type);
|
|
2328
2328
|
}
|
|
2329
2329
|
finish(e) {
|
|
2330
|
-
if (!(this.options &
|
|
2330
|
+
if (!(this.options & Ln)) {
|
|
2331
2331
|
let r = this.content[this.content.length - 1], i;
|
|
2332
2332
|
if (r && r.isText && (i = /[ \t\r\n\u000c]+$/.exec(r.text))) {
|
|
2333
2333
|
let s = r;
|
|
@@ -2343,9 +2343,9 @@ class pr {
|
|
|
2343
2343
|
}
|
|
2344
2344
|
class qs {
|
|
2345
2345
|
constructor(e, t, r) {
|
|
2346
|
-
this.parser = e, this.options = t, this.isOpen = r, this.open = 0;
|
|
2347
|
-
let i = t.topNode, s, o = Ws(null, t.preserveWhitespace, 0) | (r ?
|
|
2348
|
-
i ? s = new
|
|
2346
|
+
this.parser = e, this.options = t, this.isOpen = r, this.open = 0, this.localPreserveWS = !1;
|
|
2347
|
+
let i = t.topNode, s, o = Ws(null, t.preserveWhitespace, 0) | (r ? Nn : 0);
|
|
2348
|
+
i ? s = new hr(i.type, i.attrs, F.none, !0, t.topMatch || i.type.contentMatch, o) : r ? s = new hr(null, null, F.none, !0, null, o) : s = new hr(e.schema.topNodeType, null, F.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
|
|
2349
2349
|
}
|
|
2350
2350
|
get top() {
|
|
2351
2351
|
return this.nodes[this.open];
|
|
@@ -2357,14 +2357,14 @@ class qs {
|
|
|
2357
2357
|
e.nodeType == 3 ? this.addTextNode(e, t) : e.nodeType == 1 && this.addElement(e, t);
|
|
2358
2358
|
}
|
|
2359
2359
|
addTextNode(e, t) {
|
|
2360
|
-
let r = e.nodeValue, i = this.top;
|
|
2361
|
-
if (
|
|
2362
|
-
if (
|
|
2363
|
-
|
|
2364
|
-
`)
|
|
2360
|
+
let r = e.nodeValue, i = this.top, s = i.options & Ri ? "full" : this.localPreserveWS || (i.options & Ln) > 0;
|
|
2361
|
+
if (s === "full" || i.inlineContext(e) || /[^ \t\r\n\u000c]/.test(r)) {
|
|
2362
|
+
if (s)
|
|
2363
|
+
s !== "full" ? r = r.replace(/\r?\n|\r/g, " ") : r = r.replace(/\r\n?/g, `
|
|
2364
|
+
`);
|
|
2365
2365
|
else if (r = r.replace(/[ \t\r\n\u000c]+/g, " "), /^[ \t\r\n\u000c]/.test(r) && this.open == this.nodes.length - 1) {
|
|
2366
|
-
let
|
|
2367
|
-
(!
|
|
2366
|
+
let o = i.content[i.content.length - 1], l = e.previousSibling;
|
|
2367
|
+
(!o || l && l.nodeName == "BR" || o.isText && /[ \t\r\n\u000c]$/.test(o.text)) && (r = r.slice(1));
|
|
2368
2368
|
}
|
|
2369
2369
|
r && this.insertNode(this.parser.schema.text(r), t), this.findInText(e);
|
|
2370
2370
|
} else
|
|
@@ -2373,26 +2373,29 @@ class qs {
|
|
|
2373
2373
|
// Try to find a handler for the given tag and use that to parse. If
|
|
2374
2374
|
// none is found, the element's content nodes are added directly.
|
|
2375
2375
|
addElement(e, t, r) {
|
|
2376
|
-
let i =
|
|
2377
|
-
|
|
2378
|
-
let o =
|
|
2379
|
-
|
|
2376
|
+
let i = this.localPreserveWS, s = this.top;
|
|
2377
|
+
(e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
|
|
2378
|
+
let o = e.nodeName.toLowerCase(), l;
|
|
2379
|
+
Pl.hasOwnProperty(o) && this.parser.normalizeLists && ou(e);
|
|
2380
|
+
let a = this.options.ruleFromNode && this.options.ruleFromNode(e) || (l = this.parser.matchTag(e, this, r));
|
|
2381
|
+
e: if (a ? a.ignore : su.hasOwnProperty(o))
|
|
2380
2382
|
this.findInside(e), this.ignoreFallback(e, t);
|
|
2381
|
-
else if (!
|
|
2382
|
-
|
|
2383
|
-
let
|
|
2384
|
-
if (Rl.hasOwnProperty(
|
|
2385
|
-
|
|
2383
|
+
else if (!a || a.skip || a.closeParent) {
|
|
2384
|
+
a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
|
|
2385
|
+
let c, u = this.needsBlock;
|
|
2386
|
+
if (Rl.hasOwnProperty(o))
|
|
2387
|
+
s.content.length && s.content[0].isInline && this.open && (this.open--, s = this.top), c = !0, s.type || (this.needsBlock = !0);
|
|
2386
2388
|
else if (!e.firstChild) {
|
|
2387
2389
|
this.leafFallback(e, t);
|
|
2388
|
-
|
|
2390
|
+
break e;
|
|
2389
2391
|
}
|
|
2390
|
-
let
|
|
2391
|
-
|
|
2392
|
+
let d = a && a.skip ? t : this.readStyles(e, t);
|
|
2393
|
+
d && this.addAll(e, d), c && this.sync(s), this.needsBlock = u;
|
|
2392
2394
|
} else {
|
|
2393
|
-
let
|
|
2394
|
-
|
|
2395
|
+
let c = this.readStyles(e, t);
|
|
2396
|
+
c && this.addElementByRule(e, a, c, a.consuming === !1 ? l : void 0);
|
|
2395
2397
|
}
|
|
2398
|
+
this.localPreserveWS = i;
|
|
2396
2399
|
}
|
|
2397
2400
|
// Called for leaf DOM nodes that would otherwise be ignored
|
|
2398
2401
|
leafFallback(e, t) {
|
|
@@ -2511,9 +2514,9 @@ class qs {
|
|
|
2511
2514
|
let o = this.top;
|
|
2512
2515
|
o.match = o.match && o.match.matchType(e);
|
|
2513
2516
|
let l = Ws(e, s, o.options);
|
|
2514
|
-
o.options &
|
|
2517
|
+
o.options & Nn && o.content.length == 0 && (l |= Nn);
|
|
2515
2518
|
let a = F.none;
|
|
2516
|
-
return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : _s(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new
|
|
2519
|
+
return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : _s(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new hr(e, t, a, i, null, l)), this.open++, r;
|
|
2517
2520
|
}
|
|
2518
2521
|
// Make sure all nodes above this.open are finished and added to
|
|
2519
2522
|
// their parents
|
|
@@ -2526,12 +2529,14 @@ class qs {
|
|
|
2526
2529
|
}
|
|
2527
2530
|
}
|
|
2528
2531
|
finish() {
|
|
2529
|
-
return this.open = 0, this.closeExtra(this.isOpen), this.nodes[0].finish(this.isOpen || this.options.topOpen);
|
|
2532
|
+
return this.open = 0, this.closeExtra(this.isOpen), this.nodes[0].finish(!!(this.isOpen || this.options.topOpen));
|
|
2530
2533
|
}
|
|
2531
2534
|
sync(e) {
|
|
2532
|
-
for (let t = this.open; t >= 0; t--)
|
|
2535
|
+
for (let t = this.open; t >= 0; t--) {
|
|
2533
2536
|
if (this.nodes[t] == e)
|
|
2534
2537
|
return this.open = t, !0;
|
|
2538
|
+
this.localPreserveWS && (this.nodes[t].options |= Ln);
|
|
2539
|
+
}
|
|
2535
2540
|
return !1;
|
|
2536
2541
|
}
|
|
2537
2542
|
get currentPos() {
|
|
@@ -2658,7 +2663,7 @@ class $t {
|
|
|
2658
2663
|
nodes.
|
|
2659
2664
|
*/
|
|
2660
2665
|
serializeFragment(e, t = {}, r) {
|
|
2661
|
-
r || (r =
|
|
2666
|
+
r || (r = oi(t).createDocumentFragment());
|
|
2662
2667
|
let i = r, s = [];
|
|
2663
2668
|
return e.forEach((o) => {
|
|
2664
2669
|
if (s.length || o.marks.length) {
|
|
@@ -2687,7 +2692,7 @@ class $t {
|
|
|
2687
2692
|
@internal
|
|
2688
2693
|
*/
|
|
2689
2694
|
serializeNodeInner(e, t) {
|
|
2690
|
-
let { dom: r, contentDOM: i } =
|
|
2695
|
+
let { dom: r, contentDOM: i } = wr(oi(t), this.nodes[e.type.name](e), null, e.attrs);
|
|
2691
2696
|
if (i) {
|
|
2692
2697
|
if (e.isLeaf)
|
|
2693
2698
|
throw new RangeError("Content hole not allowed in a leaf node spec");
|
|
@@ -2715,10 +2720,10 @@ class $t {
|
|
|
2715
2720
|
*/
|
|
2716
2721
|
serializeMark(e, t, r = {}) {
|
|
2717
2722
|
let i = this.marks[e.type.name];
|
|
2718
|
-
return i &&
|
|
2723
|
+
return i && wr(oi(r), i(e, t), null, e.attrs);
|
|
2719
2724
|
}
|
|
2720
2725
|
static renderSpec(e, t, r = null, i) {
|
|
2721
|
-
return
|
|
2726
|
+
return wr(e, t, r, i);
|
|
2722
2727
|
}
|
|
2723
2728
|
/**
|
|
2724
2729
|
Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
|
|
@@ -2750,7 +2755,7 @@ function Js(n) {
|
|
|
2750
2755
|
}
|
|
2751
2756
|
return e;
|
|
2752
2757
|
}
|
|
2753
|
-
function
|
|
2758
|
+
function oi(n) {
|
|
2754
2759
|
return n.document || window.document;
|
|
2755
2760
|
}
|
|
2756
2761
|
const Us = /* @__PURE__ */ new WeakMap();
|
|
@@ -2774,7 +2779,7 @@ function cu(n) {
|
|
|
2774
2779
|
}
|
|
2775
2780
|
return t(n), e;
|
|
2776
2781
|
}
|
|
2777
|
-
function
|
|
2782
|
+
function wr(n, e, t, r) {
|
|
2778
2783
|
if (typeof e == "string")
|
|
2779
2784
|
return { dom: n.createTextNode(e) };
|
|
2780
2785
|
if (e.nodeType != null)
|
|
@@ -2804,7 +2809,7 @@ function xr(n, e, t, r) {
|
|
|
2804
2809
|
throw new RangeError("Content hole must be the only child of its parent node");
|
|
2805
2810
|
return { dom: a, contentDOM: a };
|
|
2806
2811
|
} else {
|
|
2807
|
-
let { dom: p, contentDOM: h } =
|
|
2812
|
+
let { dom: p, contentDOM: h } = wr(n, f, t, r);
|
|
2808
2813
|
if (a.appendChild(p), h) {
|
|
2809
2814
|
if (l)
|
|
2810
2815
|
throw new RangeError("Multiple content holes");
|
|
@@ -2824,7 +2829,7 @@ function Gs(n) {
|
|
|
2824
2829
|
function du(n) {
|
|
2825
2830
|
return (n - (n & Bl)) / Ll;
|
|
2826
2831
|
}
|
|
2827
|
-
const zl = 1, Vl = 2,
|
|
2832
|
+
const zl = 1, Vl = 2, Sr = 4, Fl = 8;
|
|
2828
2833
|
class Pi {
|
|
2829
2834
|
/**
|
|
2830
2835
|
@internal
|
|
@@ -2844,13 +2849,13 @@ class Pi {
|
|
|
2844
2849
|
Tells you whether the token before the mapped position was deleted.
|
|
2845
2850
|
*/
|
|
2846
2851
|
get deletedBefore() {
|
|
2847
|
-
return (this.delInfo & (zl |
|
|
2852
|
+
return (this.delInfo & (zl | Sr)) > 0;
|
|
2848
2853
|
}
|
|
2849
2854
|
/**
|
|
2850
2855
|
True when the token after the mapped position was deleted.
|
|
2851
2856
|
*/
|
|
2852
2857
|
get deletedAfter() {
|
|
2853
|
-
return (this.delInfo & (Vl |
|
|
2858
|
+
return (this.delInfo & (Vl | Sr)) > 0;
|
|
2854
2859
|
}
|
|
2855
2860
|
/**
|
|
2856
2861
|
Tells whether any of the steps mapped through deletes across the
|
|
@@ -2858,7 +2863,7 @@ class Pi {
|
|
|
2858
2863
|
position).
|
|
2859
2864
|
*/
|
|
2860
2865
|
get deletedAcross() {
|
|
2861
|
-
return (this.delInfo &
|
|
2866
|
+
return (this.delInfo & Sr) > 0;
|
|
2862
2867
|
}
|
|
2863
2868
|
}
|
|
2864
2869
|
class be {
|
|
@@ -2901,7 +2906,7 @@ class be {
|
|
|
2901
2906
|
let f = c ? e == a ? -1 : e == d ? 1 : t : t, p = a + i + (f < 0 ? 0 : u);
|
|
2902
2907
|
if (r)
|
|
2903
2908
|
return p;
|
|
2904
|
-
let h = e == (t < 0 ? a : d) ? null : uu(l / 3, e - a), m = e == a ? Vl : e == d ? zl :
|
|
2909
|
+
let h = e == (t < 0 ? a : d) ? null : uu(l / 3, e - a), m = e == a ? Vl : e == d ? zl : Sr;
|
|
2905
2910
|
return (t < 0 ? e != a : e != d) && (m |= Fl), new Pi(p, m, h);
|
|
2906
2911
|
}
|
|
2907
2912
|
i += u - c;
|
|
@@ -3065,7 +3070,7 @@ class en {
|
|
|
3065
3070
|
return r ? e : new Pi(e, i, null);
|
|
3066
3071
|
}
|
|
3067
3072
|
}
|
|
3068
|
-
const
|
|
3073
|
+
const li = /* @__PURE__ */ Object.create(null);
|
|
3069
3074
|
class se {
|
|
3070
3075
|
/**
|
|
3071
3076
|
Get the step map that represents the changes made by this step,
|
|
@@ -3090,7 +3095,7 @@ class se {
|
|
|
3090
3095
|
static fromJSON(e, t) {
|
|
3091
3096
|
if (!t || !t.stepType)
|
|
3092
3097
|
throw new RangeError("Invalid input for Step.fromJSON");
|
|
3093
|
-
let r =
|
|
3098
|
+
let r = li[t.stepType];
|
|
3094
3099
|
if (!r)
|
|
3095
3100
|
throw new RangeError(`No step type ${t.stepType} defined`);
|
|
3096
3101
|
return r.fromJSON(e, t);
|
|
@@ -3102,9 +3107,9 @@ class se {
|
|
|
3102
3107
|
that's unlikely to clash with steps from other modules.
|
|
3103
3108
|
*/
|
|
3104
3109
|
static jsonID(e, t) {
|
|
3105
|
-
if (e in
|
|
3110
|
+
if (e in li)
|
|
3106
3111
|
throw new RangeError("Duplicate use of step JSON ID " + e);
|
|
3107
|
-
return
|
|
3112
|
+
return li[e] = t, t.prototype.jsonID = e, t;
|
|
3108
3113
|
}
|
|
3109
3114
|
}
|
|
3110
3115
|
class q {
|
|
@@ -3135,7 +3140,7 @@ class q {
|
|
|
3135
3140
|
try {
|
|
3136
3141
|
return q.ok(e.replace(t, r, i));
|
|
3137
3142
|
} catch (s) {
|
|
3138
|
-
if (s instanceof
|
|
3143
|
+
if (s instanceof Er)
|
|
3139
3144
|
return q.fail(s.message);
|
|
3140
3145
|
throw s;
|
|
3141
3146
|
}
|
|
@@ -3161,7 +3166,7 @@ class lt extends se {
|
|
|
3161
3166
|
return q.fromReplace(e, this.from, this.to, s);
|
|
3162
3167
|
}
|
|
3163
3168
|
invert() {
|
|
3164
|
-
return new
|
|
3169
|
+
return new Fe(this.from, this.to, this.mark);
|
|
3165
3170
|
}
|
|
3166
3171
|
map(e) {
|
|
3167
3172
|
let t = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
|
|
@@ -3188,7 +3193,7 @@ class lt extends se {
|
|
|
3188
3193
|
}
|
|
3189
3194
|
}
|
|
3190
3195
|
se.jsonID("addMark", lt);
|
|
3191
|
-
class
|
|
3196
|
+
class Fe extends se {
|
|
3192
3197
|
/**
|
|
3193
3198
|
Create a mark-removing step.
|
|
3194
3199
|
*/
|
|
@@ -3204,10 +3209,10 @@ class $e extends se {
|
|
|
3204
3209
|
}
|
|
3205
3210
|
map(e) {
|
|
3206
3211
|
let t = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
|
|
3207
|
-
return t.deleted && r.deleted || t.pos >= r.pos ? null : new
|
|
3212
|
+
return t.deleted && r.deleted || t.pos >= r.pos ? null : new Fe(t.pos, r.pos, this.mark);
|
|
3208
3213
|
}
|
|
3209
3214
|
merge(e) {
|
|
3210
|
-
return e instanceof
|
|
3215
|
+
return e instanceof Fe && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new Fe(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
|
|
3211
3216
|
}
|
|
3212
3217
|
toJSON() {
|
|
3213
3218
|
return {
|
|
@@ -3223,10 +3228,10 @@ class $e extends se {
|
|
|
3223
3228
|
static fromJSON(e, t) {
|
|
3224
3229
|
if (typeof t.from != "number" || typeof t.to != "number")
|
|
3225
3230
|
throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");
|
|
3226
|
-
return new
|
|
3231
|
+
return new Fe(t.from, t.to, e.markFromJSON(t.mark));
|
|
3227
3232
|
}
|
|
3228
3233
|
}
|
|
3229
|
-
se.jsonID("removeMark",
|
|
3234
|
+
se.jsonID("removeMark", Fe);
|
|
3230
3235
|
class at extends se {
|
|
3231
3236
|
/**
|
|
3232
3237
|
Create a node mark step.
|
|
@@ -3439,7 +3444,7 @@ function fu(n, e, t, r) {
|
|
|
3439
3444
|
if (!r.isInSet(d) && u.type.allowsMarkType(r.type)) {
|
|
3440
3445
|
let f = Math.max(c, e), p = Math.min(c + a.nodeSize, t), h = r.addToSet(d);
|
|
3441
3446
|
for (let m = 0; m < d.length; m++)
|
|
3442
|
-
d[m].isInSet(h) || (o && o.to == f && o.mark.eq(d[m]) ? o.to = p : i.push(o = new
|
|
3447
|
+
d[m].isInSet(h) || (o && o.to == f && o.mark.eq(d[m]) ? o.to = p : i.push(o = new Fe(f, p, d[m])));
|
|
3443
3448
|
l && l.to == f ? l.to = p : s.push(l = new lt(f, p, r));
|
|
3444
3449
|
}
|
|
3445
3450
|
}), i.forEach((a) => n.step(a)), s.forEach((a) => n.step(a));
|
|
@@ -3451,7 +3456,7 @@ function pu(n, e, t, r) {
|
|
|
3451
3456
|
return;
|
|
3452
3457
|
s++;
|
|
3453
3458
|
let a = null;
|
|
3454
|
-
if (r instanceof
|
|
3459
|
+
if (r instanceof Wr) {
|
|
3455
3460
|
let c = o.marks, u;
|
|
3456
3461
|
for (; u = r.isInSet(c); )
|
|
3457
3462
|
(a || (a = [])).push(u), c = u.removeFromSet(c);
|
|
@@ -3467,7 +3472,7 @@ function pu(n, e, t, r) {
|
|
|
3467
3472
|
f ? (f.to = c, f.step = s) : i.push({ style: d, from: Math.max(l, e), to: c, step: s });
|
|
3468
3473
|
}
|
|
3469
3474
|
}
|
|
3470
|
-
}), i.forEach((o) => n.step(new
|
|
3475
|
+
}), i.forEach((o) => n.step(new Fe(o.from, o.to, o.style)));
|
|
3471
3476
|
}
|
|
3472
3477
|
function is(n, e, t, r = t.contentMatch, i = !0) {
|
|
3473
3478
|
let s = n.doc.nodeAt(e), o = [], l = e + 1;
|
|
@@ -3478,7 +3483,7 @@ function is(n, e, t, r = t.contentMatch, i = !0) {
|
|
|
3478
3483
|
else {
|
|
3479
3484
|
r = d;
|
|
3480
3485
|
for (let f = 0; f < c.marks.length; f++)
|
|
3481
|
-
t.allowsMarkType(c.marks[f].type) || n.step(new
|
|
3486
|
+
t.allowsMarkType(c.marks[f].type) || n.step(new Fe(l, u, c.marks[f]));
|
|
3482
3487
|
if (i && c.isText && t.whitespace != "pre") {
|
|
3483
3488
|
let f, p = /\r?\n|\r/g, h;
|
|
3484
3489
|
for (; f = p.exec(c.text); )
|
|
@@ -3650,7 +3655,7 @@ function Su(n, e) {
|
|
|
3650
3655
|
function jl(n, e) {
|
|
3651
3656
|
return !!(n && e && !n.isLeaf && Su(n, e));
|
|
3652
3657
|
}
|
|
3653
|
-
function
|
|
3658
|
+
function qr(n, e, t = -1) {
|
|
3654
3659
|
let r = n.resolve(e);
|
|
3655
3660
|
for (let i = r.depth; ; i--) {
|
|
3656
3661
|
let s, o, l = r.index(i);
|
|
@@ -3723,7 +3728,7 @@ function Wl(n, e, t) {
|
|
|
3723
3728
|
}
|
|
3724
3729
|
return null;
|
|
3725
3730
|
}
|
|
3726
|
-
function
|
|
3731
|
+
function Kr(n, e, t = e, r = S.empty) {
|
|
3727
3732
|
if (e == t && !r.size)
|
|
3728
3733
|
return null;
|
|
3729
3734
|
let i = n.resolve(e), s = n.resolve(t);
|
|
@@ -3778,7 +3783,7 @@ class Ou {
|
|
|
3778
3783
|
for (let t = 1; t <= 2; t++)
|
|
3779
3784
|
for (let r = t == 1 ? e : this.unplaced.openStart; r >= 0; r--) {
|
|
3780
3785
|
let i, s = null;
|
|
3781
|
-
r ? (s =
|
|
3786
|
+
r ? (s = ai(this.unplaced.content, r - 1).firstChild, i = s.content) : i = this.unplaced.content;
|
|
3782
3787
|
let o = i.firstChild;
|
|
3783
3788
|
for (let l = this.depth; l >= 0; l--) {
|
|
3784
3789
|
let { type: a, match: c } = this.frontier[l], u, d = null;
|
|
@@ -3792,11 +3797,11 @@ class Ou {
|
|
|
3792
3797
|
}
|
|
3793
3798
|
}
|
|
3794
3799
|
openMore() {
|
|
3795
|
-
let { content: e, openStart: t, openEnd: r } = this.unplaced, i =
|
|
3800
|
+
let { content: e, openStart: t, openEnd: r } = this.unplaced, i = ai(e, t);
|
|
3796
3801
|
return !i.childCount || i.firstChild.isLeaf ? !1 : (this.unplaced = new S(e, t + 1, Math.max(r, i.size + t >= e.size - r ? t + 1 : 0)), !0);
|
|
3797
3802
|
}
|
|
3798
3803
|
dropNode() {
|
|
3799
|
-
let { content: e, openStart: t, openEnd: r } = this.unplaced, i =
|
|
3804
|
+
let { content: e, openStart: t, openEnd: r } = this.unplaced, i = ai(e, t);
|
|
3800
3805
|
if (i.childCount <= 1 && t > 0) {
|
|
3801
3806
|
let s = e.size - t <= t + i.size;
|
|
3802
3807
|
this.unplaced = new S(Cn(e, t - 1, 1), t - 1, s ? t - 1 : r);
|
|
@@ -3837,7 +3842,7 @@ class Ou {
|
|
|
3837
3842
|
if (!this.$to.parent.isTextblock)
|
|
3838
3843
|
return -1;
|
|
3839
3844
|
let e = this.frontier[this.depth], t;
|
|
3840
|
-
if (!e.type.isTextblock || !
|
|
3845
|
+
if (!e.type.isTextblock || !ci(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
|
|
3841
3846
|
return -1;
|
|
3842
3847
|
let { depth: r } = this.$to, i = this.$to.after(r);
|
|
3843
3848
|
for (; r > 1 && i == this.$to.end(--r); )
|
|
@@ -3846,10 +3851,10 @@ class Ou {
|
|
|
3846
3851
|
}
|
|
3847
3852
|
findCloseLevel(e) {
|
|
3848
3853
|
e: for (let t = Math.min(this.depth, e.depth); t >= 0; t--) {
|
|
3849
|
-
let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o =
|
|
3854
|
+
let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = ci(e, t, i, r, s);
|
|
3850
3855
|
if (o) {
|
|
3851
3856
|
for (let l = t - 1; l >= 0; l--) {
|
|
3852
|
-
let { match: a, type: c } = this.frontier[l], u =
|
|
3857
|
+
let { match: a, type: c } = this.frontier[l], u = ci(e, l, c, a, !0);
|
|
3853
3858
|
if (!u || u.childCount)
|
|
3854
3859
|
continue e;
|
|
3855
3860
|
}
|
|
@@ -3885,7 +3890,7 @@ function Cn(n, e, t) {
|
|
|
3885
3890
|
function On(n, e, t) {
|
|
3886
3891
|
return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(On(n.lastChild.content, e - 1, t)));
|
|
3887
3892
|
}
|
|
3888
|
-
function
|
|
3893
|
+
function ai(n, e) {
|
|
3889
3894
|
for (let t = 0; t < e; t++)
|
|
3890
3895
|
n = n.firstChild.content;
|
|
3891
3896
|
return n;
|
|
@@ -3896,7 +3901,7 @@ function Kl(n, e, t) {
|
|
|
3896
3901
|
let r = n.content;
|
|
3897
3902
|
return e > 1 && (r = r.replaceChild(0, Kl(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(x.empty, !0)))), n.copy(r);
|
|
3898
3903
|
}
|
|
3899
|
-
function
|
|
3904
|
+
function ci(n, e, t, r, i) {
|
|
3900
3905
|
let s = n.node(e), o = i ? n.indexAfter(e) : n.index(e);
|
|
3901
3906
|
if (o == s.childCount && !t.compatibleContent(s.type))
|
|
3902
3907
|
return null;
|
|
@@ -3912,7 +3917,7 @@ function Tu(n, e, t) {
|
|
|
3912
3917
|
function Eu(n) {
|
|
3913
3918
|
return n.spec.defining || n.spec.definingForContent;
|
|
3914
3919
|
}
|
|
3915
|
-
function
|
|
3920
|
+
function Nu(n, e, t, r) {
|
|
3916
3921
|
if (!r.size)
|
|
3917
3922
|
return n.deleteRange(e, t);
|
|
3918
3923
|
let i = n.doc.resolve(e), s = n.doc.resolve(t);
|
|
@@ -3970,7 +3975,7 @@ function _l(n, e, t, r, i) {
|
|
|
3970
3975
|
}
|
|
3971
3976
|
return n;
|
|
3972
3977
|
}
|
|
3973
|
-
function
|
|
3978
|
+
function Au(n, e, t, r) {
|
|
3974
3979
|
if (!r.isInline && e == t && n.doc.resolve(e).parent.content.size) {
|
|
3975
3980
|
let i = Cu(n.doc, e, r.type);
|
|
3976
3981
|
i != null && (e = t = i);
|
|
@@ -4039,7 +4044,7 @@ class nn extends se {
|
|
|
4039
4044
|
}
|
|
4040
4045
|
}
|
|
4041
4046
|
se.jsonID("attr", nn);
|
|
4042
|
-
class
|
|
4047
|
+
class zn extends se {
|
|
4043
4048
|
/**
|
|
4044
4049
|
Construct an attribute step.
|
|
4045
4050
|
*/
|
|
@@ -4058,7 +4063,7 @@ class Ln extends se {
|
|
|
4058
4063
|
return be.empty;
|
|
4059
4064
|
}
|
|
4060
4065
|
invert(e) {
|
|
4061
|
-
return new
|
|
4066
|
+
return new zn(this.attr, e.attrs[this.attr]);
|
|
4062
4067
|
}
|
|
4063
4068
|
map(e) {
|
|
4064
4069
|
return this;
|
|
@@ -4069,10 +4074,10 @@ class Ln extends se {
|
|
|
4069
4074
|
static fromJSON(e, t) {
|
|
4070
4075
|
if (typeof t.attr != "string")
|
|
4071
4076
|
throw new RangeError("Invalid input for DocAttrStep.fromJSON");
|
|
4072
|
-
return new
|
|
4077
|
+
return new zn(t.attr, t.value);
|
|
4073
4078
|
}
|
|
4074
4079
|
}
|
|
4075
|
-
se.jsonID("docAttr",
|
|
4080
|
+
se.jsonID("docAttr", zn);
|
|
4076
4081
|
let on = class extends Error {
|
|
4077
4082
|
};
|
|
4078
4083
|
on = function n(e) {
|
|
@@ -4131,7 +4136,7 @@ class Iu {
|
|
|
4131
4136
|
given `slice`.
|
|
4132
4137
|
*/
|
|
4133
4138
|
replace(e, t = e, r = S.empty) {
|
|
4134
|
-
let i =
|
|
4139
|
+
let i = Kr(this.doc, e, t, r);
|
|
4135
4140
|
return i && this.step(i), this;
|
|
4136
4141
|
}
|
|
4137
4142
|
/**
|
|
@@ -4173,7 +4178,7 @@ class Iu {
|
|
|
4173
4178
|
control over what happens.
|
|
4174
4179
|
*/
|
|
4175
4180
|
replaceRange(e, t, r) {
|
|
4176
|
-
return
|
|
4181
|
+
return Nu(this, e, t, r), this;
|
|
4177
4182
|
}
|
|
4178
4183
|
/**
|
|
4179
4184
|
Replace the given range with a node, but use `from` and `to` as
|
|
@@ -4185,7 +4190,7 @@ class Iu {
|
|
|
4185
4190
|
that parent node.
|
|
4186
4191
|
*/
|
|
4187
4192
|
replaceRangeWith(e, t, r) {
|
|
4188
|
-
return
|
|
4193
|
+
return Au(this, e, t, r), this;
|
|
4189
4194
|
}
|
|
4190
4195
|
/**
|
|
4191
4196
|
Delete the given range, expanding it to cover fully covered
|
|
@@ -4245,7 +4250,7 @@ class Iu {
|
|
|
4245
4250
|
Set a single attribute on the document to a new value.
|
|
4246
4251
|
*/
|
|
4247
4252
|
setDocAttribute(e, t) {
|
|
4248
|
-
return this.step(new
|
|
4253
|
+
return this.step(new zn(e, t)), this;
|
|
4249
4254
|
}
|
|
4250
4255
|
/**
|
|
4251
4256
|
Add a mark to the node at position `pos`.
|
|
@@ -4302,7 +4307,7 @@ class Iu {
|
|
|
4302
4307
|
return is(this, e, t, r), this;
|
|
4303
4308
|
}
|
|
4304
4309
|
}
|
|
4305
|
-
const
|
|
4310
|
+
const ui = /* @__PURE__ */ Object.create(null);
|
|
4306
4311
|
class R {
|
|
4307
4312
|
/**
|
|
4308
4313
|
Initialize a selection with the head and anchor and ranges. If no
|
|
@@ -4413,7 +4418,7 @@ class R {
|
|
|
4413
4418
|
negative, it will search backwards first.
|
|
4414
4419
|
*/
|
|
4415
4420
|
static near(e, t = 1) {
|
|
4416
|
-
return this.findFrom(e, t) || this.findFrom(e, -t) || new
|
|
4421
|
+
return this.findFrom(e, t) || this.findFrom(e, -t) || new Ie(e.node(0));
|
|
4417
4422
|
}
|
|
4418
4423
|
/**
|
|
4419
4424
|
Find the cursor or leaf node selection closest to the start of
|
|
@@ -4422,14 +4427,14 @@ class R {
|
|
|
4422
4427
|
exists.
|
|
4423
4428
|
*/
|
|
4424
4429
|
static atStart(e) {
|
|
4425
|
-
return Gt(e, e, 0, 0, 1) || new
|
|
4430
|
+
return Gt(e, e, 0, 0, 1) || new Ie(e);
|
|
4426
4431
|
}
|
|
4427
4432
|
/**
|
|
4428
4433
|
Find the cursor or leaf node selection closest to the end of the
|
|
4429
4434
|
given document.
|
|
4430
4435
|
*/
|
|
4431
4436
|
static atEnd(e) {
|
|
4432
|
-
return Gt(e, e, e.content.size, e.childCount, -1) || new
|
|
4437
|
+
return Gt(e, e, e.content.size, e.childCount, -1) || new Ie(e);
|
|
4433
4438
|
}
|
|
4434
4439
|
/**
|
|
4435
4440
|
Deserialize the JSON representation of a selection. Must be
|
|
@@ -4438,7 +4443,7 @@ class R {
|
|
|
4438
4443
|
static fromJSON(e, t) {
|
|
4439
4444
|
if (!t || !t.type)
|
|
4440
4445
|
throw new RangeError("Invalid input for Selection.fromJSON");
|
|
4441
|
-
let r =
|
|
4446
|
+
let r = ui[t.type];
|
|
4442
4447
|
if (!r)
|
|
4443
4448
|
throw new RangeError(`No selection type ${t.type} defined`);
|
|
4444
4449
|
return r.fromJSON(e, t);
|
|
@@ -4450,9 +4455,9 @@ class R {
|
|
|
4450
4455
|
clash with classes from other modules.
|
|
4451
4456
|
*/
|
|
4452
4457
|
static jsonID(e, t) {
|
|
4453
|
-
if (e in
|
|
4458
|
+
if (e in ui)
|
|
4454
4459
|
throw new RangeError("Duplicate use of selection JSON ID " + e);
|
|
4455
|
-
return
|
|
4460
|
+
return ui[e] = t, t.prototype.jsonID = e, t;
|
|
4456
4461
|
}
|
|
4457
4462
|
/**
|
|
4458
4463
|
Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
|
|
@@ -4511,7 +4516,7 @@ class D extends R {
|
|
|
4511
4516
|
return e instanceof D && e.anchor == this.anchor && e.head == this.head;
|
|
4512
4517
|
}
|
|
4513
4518
|
getBookmark() {
|
|
4514
|
-
return new
|
|
4519
|
+
return new _r(this.anchor, this.head);
|
|
4515
4520
|
}
|
|
4516
4521
|
toJSON() {
|
|
4517
4522
|
return { type: "text", anchor: this.anchor, head: this.head };
|
|
@@ -4552,18 +4557,18 @@ class D extends R {
|
|
|
4552
4557
|
}
|
|
4553
4558
|
}
|
|
4554
4559
|
R.jsonID("text", D);
|
|
4555
|
-
class
|
|
4560
|
+
class _r {
|
|
4556
4561
|
constructor(e, t) {
|
|
4557
4562
|
this.anchor = e, this.head = t;
|
|
4558
4563
|
}
|
|
4559
4564
|
map(e) {
|
|
4560
|
-
return new
|
|
4565
|
+
return new _r(e.map(this.anchor), e.map(this.head));
|
|
4561
4566
|
}
|
|
4562
4567
|
resolve(e) {
|
|
4563
4568
|
return D.between(e.resolve(this.anchor), e.resolve(this.head));
|
|
4564
4569
|
}
|
|
4565
4570
|
}
|
|
4566
|
-
class
|
|
4571
|
+
class N extends R {
|
|
4567
4572
|
/**
|
|
4568
4573
|
Create a node selection. Does not verify the validity of its
|
|
4569
4574
|
argument.
|
|
@@ -4574,13 +4579,13 @@ class A extends R {
|
|
|
4574
4579
|
}
|
|
4575
4580
|
map(e, t) {
|
|
4576
4581
|
let { deleted: r, pos: i } = t.mapResult(this.anchor), s = e.resolve(i);
|
|
4577
|
-
return r ? R.near(s) : new
|
|
4582
|
+
return r ? R.near(s) : new N(s);
|
|
4578
4583
|
}
|
|
4579
4584
|
content() {
|
|
4580
4585
|
return new S(x.from(this.node), 0, 0);
|
|
4581
4586
|
}
|
|
4582
4587
|
eq(e) {
|
|
4583
|
-
return e instanceof
|
|
4588
|
+
return e instanceof N && e.anchor == this.anchor;
|
|
4584
4589
|
}
|
|
4585
4590
|
toJSON() {
|
|
4586
4591
|
return { type: "node", anchor: this.anchor };
|
|
@@ -4594,13 +4599,13 @@ class A extends R {
|
|
|
4594
4599
|
static fromJSON(e, t) {
|
|
4595
4600
|
if (typeof t.anchor != "number")
|
|
4596
4601
|
throw new RangeError("Invalid input for NodeSelection.fromJSON");
|
|
4597
|
-
return new
|
|
4602
|
+
return new N(e.resolve(t.anchor));
|
|
4598
4603
|
}
|
|
4599
4604
|
/**
|
|
4600
4605
|
Create a node selection from non-resolved positions.
|
|
4601
4606
|
*/
|
|
4602
4607
|
static create(e, t) {
|
|
4603
|
-
return new
|
|
4608
|
+
return new N(e.resolve(t));
|
|
4604
4609
|
}
|
|
4605
4610
|
/**
|
|
4606
4611
|
Determines whether the given node may be selected as a node
|
|
@@ -4610,22 +4615,22 @@ class A extends R {
|
|
|
4610
4615
|
return !e.isText && e.type.spec.selectable !== !1;
|
|
4611
4616
|
}
|
|
4612
4617
|
}
|
|
4613
|
-
|
|
4614
|
-
R.jsonID("node",
|
|
4618
|
+
N.prototype.visible = !1;
|
|
4619
|
+
R.jsonID("node", N);
|
|
4615
4620
|
class ls {
|
|
4616
4621
|
constructor(e) {
|
|
4617
4622
|
this.anchor = e;
|
|
4618
4623
|
}
|
|
4619
4624
|
map(e) {
|
|
4620
4625
|
let { deleted: t, pos: r } = e.mapResult(this.anchor);
|
|
4621
|
-
return t ? new
|
|
4626
|
+
return t ? new _r(r, r) : new ls(r);
|
|
4622
4627
|
}
|
|
4623
4628
|
resolve(e) {
|
|
4624
4629
|
let t = e.resolve(this.anchor), r = t.nodeAfter;
|
|
4625
|
-
return r &&
|
|
4630
|
+
return r && N.isSelectable(r) ? new N(t) : R.near(t);
|
|
4626
4631
|
}
|
|
4627
4632
|
}
|
|
4628
|
-
class
|
|
4633
|
+
class Ie extends R {
|
|
4629
4634
|
/**
|
|
4630
4635
|
Create an all-selection over the given document.
|
|
4631
4636
|
*/
|
|
@@ -4647,25 +4652,25 @@ class Re extends R {
|
|
|
4647
4652
|
@internal
|
|
4648
4653
|
*/
|
|
4649
4654
|
static fromJSON(e) {
|
|
4650
|
-
return new
|
|
4655
|
+
return new Ie(e);
|
|
4651
4656
|
}
|
|
4652
4657
|
map(e) {
|
|
4653
|
-
return new
|
|
4658
|
+
return new Ie(e);
|
|
4654
4659
|
}
|
|
4655
4660
|
eq(e) {
|
|
4656
|
-
return e instanceof
|
|
4661
|
+
return e instanceof Ie;
|
|
4657
4662
|
}
|
|
4658
4663
|
getBookmark() {
|
|
4659
4664
|
return Pu;
|
|
4660
4665
|
}
|
|
4661
4666
|
}
|
|
4662
|
-
R.jsonID("all",
|
|
4667
|
+
R.jsonID("all", Ie);
|
|
4663
4668
|
const Pu = {
|
|
4664
4669
|
map() {
|
|
4665
4670
|
return this;
|
|
4666
4671
|
},
|
|
4667
4672
|
resolve(n) {
|
|
4668
|
-
return new
|
|
4673
|
+
return new Ie(n);
|
|
4669
4674
|
}
|
|
4670
4675
|
};
|
|
4671
4676
|
function Gt(n, e, t, r, i, s = !1) {
|
|
@@ -4674,8 +4679,8 @@ function Gt(n, e, t, r, i, s = !1) {
|
|
|
4674
4679
|
for (let o = r - (i > 0 ? 0 : 1); i > 0 ? o < e.childCount : o >= 0; o += i) {
|
|
4675
4680
|
let l = e.child(o);
|
|
4676
4681
|
if (l.isAtom) {
|
|
4677
|
-
if (!s &&
|
|
4678
|
-
return
|
|
4682
|
+
if (!s && N.isSelectable(l))
|
|
4683
|
+
return N.create(n, t - (i < 0 ? l.nodeSize : 0));
|
|
4679
4684
|
} else {
|
|
4680
4685
|
let a = Gt(n, l, t + i, i < 0 ? l.childCount : 0, i, s);
|
|
4681
4686
|
if (a)
|
|
@@ -4697,7 +4702,7 @@ function Qs(n, e, t) {
|
|
|
4697
4702
|
o == null && (o = u);
|
|
4698
4703
|
}), n.setSelection(R.near(n.doc.resolve(o), t));
|
|
4699
4704
|
}
|
|
4700
|
-
const eo = 1,
|
|
4705
|
+
const eo = 1, mr = 2, to = 4;
|
|
4701
4706
|
class Bu extends Iu {
|
|
4702
4707
|
/**
|
|
4703
4708
|
@internal
|
|
@@ -4721,7 +4726,7 @@ class Bu extends Iu {
|
|
|
4721
4726
|
setSelection(e) {
|
|
4722
4727
|
if (e.$from.doc != this.doc)
|
|
4723
4728
|
throw new RangeError("Selection passed to setSelection must point at the current document");
|
|
4724
|
-
return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | eo) & ~
|
|
4729
|
+
return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | eo) & ~mr, this.storedMarks = null, this;
|
|
4725
4730
|
}
|
|
4726
4731
|
/**
|
|
4727
4732
|
Whether the selection was explicitly updated by this transaction.
|
|
@@ -4733,7 +4738,7 @@ class Bu extends Iu {
|
|
|
4733
4738
|
Set the current stored marks.
|
|
4734
4739
|
*/
|
|
4735
4740
|
setStoredMarks(e) {
|
|
4736
|
-
return this.storedMarks = e, this.updated |=
|
|
4741
|
+
return this.storedMarks = e, this.updated |= mr, this;
|
|
4737
4742
|
}
|
|
4738
4743
|
/**
|
|
4739
4744
|
Make sure the current stored marks or, if that is null, the marks
|
|
@@ -4759,13 +4764,13 @@ class Bu extends Iu {
|
|
|
4759
4764
|
Whether the stored marks were explicitly set for this transaction.
|
|
4760
4765
|
*/
|
|
4761
4766
|
get storedMarksSet() {
|
|
4762
|
-
return (this.updated &
|
|
4767
|
+
return (this.updated & mr) > 0;
|
|
4763
4768
|
}
|
|
4764
4769
|
/**
|
|
4765
4770
|
@internal
|
|
4766
4771
|
*/
|
|
4767
4772
|
addStep(e, t) {
|
|
4768
|
-
super.addStep(e, t), this.updated = this.updated & ~
|
|
4773
|
+
super.addStep(e, t), this.updated = this.updated & ~mr, this.storedMarks = null;
|
|
4769
4774
|
}
|
|
4770
4775
|
/**
|
|
4771
4776
|
Update the timestamp for the transaction.
|
|
@@ -4891,7 +4896,7 @@ const Lu = [
|
|
|
4891
4896
|
}
|
|
4892
4897
|
})
|
|
4893
4898
|
];
|
|
4894
|
-
class
|
|
4899
|
+
class di {
|
|
4895
4900
|
constructor(e, t) {
|
|
4896
4901
|
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Lu.slice(), t && t.forEach((r) => {
|
|
4897
4902
|
if (this.pluginsByKey[r.key])
|
|
@@ -4992,7 +4997,7 @@ class Zt {
|
|
|
4992
4997
|
Create a new state.
|
|
4993
4998
|
*/
|
|
4994
4999
|
static create(e) {
|
|
4995
|
-
let t = new
|
|
5000
|
+
let t = new di(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new Zt(t);
|
|
4996
5001
|
for (let i = 0; i < t.fields.length; i++)
|
|
4997
5002
|
r[t.fields[i].name] = t.fields[i].init(e, r);
|
|
4998
5003
|
return r;
|
|
@@ -5006,7 +5011,7 @@ class Zt {
|
|
|
5006
5011
|
configuration object..
|
|
5007
5012
|
*/
|
|
5008
5013
|
reconfigure(e) {
|
|
5009
|
-
let t = new
|
|
5014
|
+
let t = new di(this.schema, e.plugins), r = t.fields, i = new Zt(t);
|
|
5010
5015
|
for (let s = 0; s < r.length; s++) {
|
|
5011
5016
|
let o = r[s].name;
|
|
5012
5017
|
i[o] = this.hasOwnProperty(o) ? this[o] : r[s].init(e, i);
|
|
@@ -5043,7 +5048,7 @@ class Zt {
|
|
|
5043
5048
|
throw new RangeError("Invalid input for EditorState.fromJSON");
|
|
5044
5049
|
if (!e.schema)
|
|
5045
5050
|
throw new RangeError("Required config field 'schema' missing");
|
|
5046
|
-
let i = new
|
|
5051
|
+
let i = new di(e.schema, e.plugins), s = new Zt(i);
|
|
5047
5052
|
return i.fields.forEach((o) => {
|
|
5048
5053
|
if (o.name == "doc")
|
|
5049
5054
|
s.doc = ut.fromJSON(e.schema, t.doc);
|
|
@@ -5086,11 +5091,11 @@ class oe {
|
|
|
5086
5091
|
return e[this.key];
|
|
5087
5092
|
}
|
|
5088
5093
|
}
|
|
5089
|
-
const
|
|
5094
|
+
const fi = /* @__PURE__ */ Object.create(null);
|
|
5090
5095
|
function Gl(n) {
|
|
5091
|
-
return n in
|
|
5096
|
+
return n in fi ? n + "$" + ++fi[n] : (fi[n] = 0, n + "$");
|
|
5092
5097
|
}
|
|
5093
|
-
class
|
|
5098
|
+
class Ne {
|
|
5094
5099
|
/**
|
|
5095
5100
|
Create a plugin key.
|
|
5096
5101
|
*/
|
|
@@ -5115,12 +5120,12 @@ const Z = function(n) {
|
|
|
5115
5120
|
for (var e = 0; ; e++)
|
|
5116
5121
|
if (n = n.previousSibling, !n)
|
|
5117
5122
|
return e;
|
|
5118
|
-
},
|
|
5123
|
+
}, Vn = function(n) {
|
|
5119
5124
|
let e = n.assignedSlot || n.parentNode;
|
|
5120
5125
|
return e && e.nodeType == 11 ? e.host : e;
|
|
5121
5126
|
};
|
|
5122
5127
|
let Li = null;
|
|
5123
|
-
const
|
|
5128
|
+
const Ge = function(n, e, t) {
|
|
5124
5129
|
let r = Li || (Li = document.createRange());
|
|
5125
5130
|
return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
|
|
5126
5131
|
}, zu = function() {
|
|
@@ -5134,7 +5139,7 @@ function ro(n, e, t, r, i) {
|
|
|
5134
5139
|
return !0;
|
|
5135
5140
|
if (e == (i < 0 ? 0 : Se(n))) {
|
|
5136
5141
|
let s = n.parentNode;
|
|
5137
|
-
if (!s || s.nodeType != 1 ||
|
|
5142
|
+
if (!s || s.nodeType != 1 || Yn(n) || Vu.test(n.nodeName) || n.contentEditable == "false")
|
|
5138
5143
|
return !1;
|
|
5139
5144
|
e = Z(n) + (i < 0 ? 0 : 1), n = s;
|
|
5140
5145
|
} else if (n.nodeType == 1) {
|
|
@@ -5156,7 +5161,7 @@ function Fu(n, e) {
|
|
|
5156
5161
|
if (n.contentEditable == "false")
|
|
5157
5162
|
return null;
|
|
5158
5163
|
n = n.childNodes[e - 1], e = Se(n);
|
|
5159
|
-
} else if (n.parentNode && !
|
|
5164
|
+
} else if (n.parentNode && !Yn(n))
|
|
5160
5165
|
e = Z(n), n = n.parentNode;
|
|
5161
5166
|
else
|
|
5162
5167
|
return null;
|
|
@@ -5170,7 +5175,7 @@ function $u(n, e) {
|
|
|
5170
5175
|
if (n.contentEditable == "false")
|
|
5171
5176
|
return null;
|
|
5172
5177
|
n = n.childNodes[e], e = 0;
|
|
5173
|
-
} else if (n.parentNode && !
|
|
5178
|
+
} else if (n.parentNode && !Yn(n))
|
|
5174
5179
|
e = Z(n) + 1, n = n.parentNode;
|
|
5175
5180
|
else
|
|
5176
5181
|
return null;
|
|
@@ -5186,13 +5191,13 @@ function Hu(n, e, t) {
|
|
|
5186
5191
|
r = r && s == 0, i = i && s == Se(n);
|
|
5187
5192
|
}
|
|
5188
5193
|
}
|
|
5189
|
-
function
|
|
5194
|
+
function Yn(n) {
|
|
5190
5195
|
let e;
|
|
5191
5196
|
for (let t = n; t && !(e = t.pmViewDesc); t = t.parentNode)
|
|
5192
5197
|
;
|
|
5193
5198
|
return e && e.node && e.node.isBlock && (e.dom == n || e.contentDOM == n);
|
|
5194
5199
|
}
|
|
5195
|
-
const
|
|
5200
|
+
const Jr = function(n) {
|
|
5196
5201
|
return n.focusNode && zt(n.focusNode, n.focusOffset, n.anchorNode, n.anchorOffset);
|
|
5197
5202
|
};
|
|
5198
5203
|
function Ot(n, e) {
|
|
@@ -5219,9 +5224,9 @@ function Wu(n, e, t) {
|
|
|
5219
5224
|
return { node: r.startContainer, offset: Math.min(Se(r.startContainer), r.startOffset) };
|
|
5220
5225
|
}
|
|
5221
5226
|
}
|
|
5222
|
-
const
|
|
5223
|
-
|
|
5224
|
-
const Fi = !fe && /Chrome\/(\d+)/.exec(bt), ie = !!Fi, Xl = Fi ? +Fi[1] : 0, ae = !fe && !!
|
|
5227
|
+
const He = typeof navigator < "u" ? navigator : null, io = typeof document < "u" ? document : null, bt = He && He.userAgent || "", zi = /Edge\/(\d+)/.exec(bt), Yl = /MSIE \d/.exec(bt), Vi = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(bt), fe = !!(Yl || Vi || zi), ft = Yl ? document.documentMode : Vi ? +Vi[1] : zi ? +zi[1] : 0, Re = !fe && /gecko\/(\d+)/i.test(bt);
|
|
5228
|
+
Re && +(/Firefox\/(\d+)/.exec(bt) || [0, 0])[1];
|
|
5229
|
+
const Fi = !fe && /Chrome\/(\d+)/.exec(bt), ie = !!Fi, Xl = Fi ? +Fi[1] : 0, ae = !fe && !!He && /Apple Computer/.test(He.vendor), ln = ae && (/Mobile\/\w+/.test(bt) || !!He && He.maxTouchPoints > 2), we = ln || (He ? /Mac/.test(He.platform) : !1), qu = He ? /Win/.test(He.platform) : !1, Xe = /Android \d/.test(bt), Xn = !!io && "webkitFontSmoothing" in io.documentElement.style, Ku = Xn ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
5225
5230
|
function _u(n) {
|
|
5226
5231
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
5227
5232
|
return e ? {
|
|
@@ -5236,7 +5241,7 @@ function _u(n) {
|
|
|
5236
5241
|
bottom: n.documentElement.clientHeight
|
|
5237
5242
|
};
|
|
5238
5243
|
}
|
|
5239
|
-
function
|
|
5244
|
+
function Ue(n, e) {
|
|
5240
5245
|
return typeof n == "number" ? n : n[e];
|
|
5241
5246
|
}
|
|
5242
5247
|
function Ju(n) {
|
|
@@ -5250,11 +5255,11 @@ function Ju(n) {
|
|
|
5250
5255
|
}
|
|
5251
5256
|
function so(n, e, t) {
|
|
5252
5257
|
let r = n.someProp("scrollThreshold") || 0, i = n.someProp("scrollMargin") || 5, s = n.dom.ownerDocument;
|
|
5253
|
-
for (let o = t || n.dom; o; o =
|
|
5258
|
+
for (let o = t || n.dom; o; o = Vn(o)) {
|
|
5254
5259
|
if (o.nodeType != 1)
|
|
5255
5260
|
continue;
|
|
5256
5261
|
let l = o, a = l == s.body, c = a ? _u(s) : Ju(l), u = 0, d = 0;
|
|
5257
|
-
if (e.top < c.top +
|
|
5262
|
+
if (e.top < c.top + Ue(r, "top") ? d = -(c.top - e.top + Ue(i, "top")) : e.bottom > c.bottom - Ue(r, "bottom") && (d = e.bottom - e.top > c.bottom - c.top ? e.top + Ue(i, "top") - c.top : e.bottom - c.bottom + Ue(i, "bottom")), e.left < c.left + Ue(r, "left") ? u = -(c.left - e.left + Ue(i, "left")) : e.right > c.right - Ue(r, "right") && (u = e.right - c.right + Ue(i, "right")), u || d)
|
|
5258
5263
|
if (a)
|
|
5259
5264
|
s.defaultView.scrollBy(u, d);
|
|
5260
5265
|
else {
|
|
@@ -5283,7 +5288,7 @@ function Uu(n) {
|
|
|
5283
5288
|
}
|
|
5284
5289
|
function Zl(n) {
|
|
5285
5290
|
let e = [], t = n.ownerDocument;
|
|
5286
|
-
for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r =
|
|
5291
|
+
for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r = Vn(r))
|
|
5287
5292
|
;
|
|
5288
5293
|
return e;
|
|
5289
5294
|
}
|
|
@@ -5317,7 +5322,7 @@ function ea(n, e) {
|
|
|
5317
5322
|
if (u.nodeType == 1)
|
|
5318
5323
|
f = u.getClientRects();
|
|
5319
5324
|
else if (u.nodeType == 3)
|
|
5320
|
-
f =
|
|
5325
|
+
f = Ge(u).getClientRects();
|
|
5321
5326
|
else
|
|
5322
5327
|
continue;
|
|
5323
5328
|
for (let p = 0; p < f.length; p++) {
|
|
@@ -5366,14 +5371,12 @@ function Qu(n, e, t) {
|
|
|
5366
5371
|
function ed(n, e, t, r) {
|
|
5367
5372
|
let i = -1;
|
|
5368
5373
|
for (let s = e, o = !1; s != n.dom; ) {
|
|
5369
|
-
let l = n.docView.nearestDesc(s, !0);
|
|
5374
|
+
let l = n.docView.nearestDesc(s, !0), a;
|
|
5370
5375
|
if (!l)
|
|
5371
5376
|
return null;
|
|
5372
|
-
if (l.dom.nodeType == 1 && (l.node.isBlock && l.parent || !l.contentDOM)
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
return (l.node.isBlock ? r.top < (a.top + a.bottom) / 2 : r.left < (a.left + a.right) / 2) ? l.posBefore : l.posAfter;
|
|
5376
|
-
}
|
|
5377
|
+
if (l.dom.nodeType == 1 && (l.node.isBlock && l.parent || !l.contentDOM) && // Ignore elements with zero-size bounding rectangles
|
|
5378
|
+
((a = l.dom.getBoundingClientRect()).width || a.height) && (l.node.isBlock && l.parent && (!o && a.left > r.left || a.top > r.top ? i = l.posBefore : (!o && a.right < r.left || a.bottom < r.top) && (i = l.posAfter), o = !0), !l.contentDOM && i < 0 && !l.node.isText))
|
|
5379
|
+
return (l.node.isBlock ? r.top < (a.top + a.bottom) / 2 : r.left < (a.left + a.right) / 2) ? l.posBefore : l.posAfter;
|
|
5377
5380
|
s = l.dom.parentNode;
|
|
5378
5381
|
}
|
|
5379
5382
|
return i > -1 ? i : n.docView.posFromDOM(e, t, -1);
|
|
@@ -5406,15 +5409,15 @@ function td(n, e) {
|
|
|
5406
5409
|
return null;
|
|
5407
5410
|
}
|
|
5408
5411
|
if (ae)
|
|
5409
|
-
for (let c = o; r && c; c =
|
|
5412
|
+
for (let c = o; r && c; c = Vn(c))
|
|
5410
5413
|
c.draggable && (r = void 0);
|
|
5411
5414
|
if (o = Zu(o, e), r) {
|
|
5412
|
-
if (
|
|
5415
|
+
if (Re && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
|
|
5413
5416
|
let u = r.childNodes[i], d;
|
|
5414
5417
|
u.nodeName == "IMG" && (d = u.getBoundingClientRect()).right <= e.left && d.bottom > e.top && i++;
|
|
5415
5418
|
}
|
|
5416
5419
|
let c;
|
|
5417
|
-
|
|
5420
|
+
Xn && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = ed(n, r, i, e));
|
|
5418
5421
|
}
|
|
5419
5422
|
l == null && (l = Qu(n, o, e));
|
|
5420
5423
|
let a = n.docView.nearestDesc(o, !0);
|
|
@@ -5434,14 +5437,14 @@ function rt(n, e) {
|
|
|
5434
5437
|
}
|
|
5435
5438
|
const nd = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
|
|
5436
5439
|
function na(n, e, t) {
|
|
5437
|
-
let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o =
|
|
5440
|
+
let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = Xn || Re;
|
|
5438
5441
|
if (r.nodeType == 3)
|
|
5439
5442
|
if (o && (nd.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
|
|
5440
|
-
let a = rt(
|
|
5441
|
-
if (
|
|
5442
|
-
let c = rt(
|
|
5443
|
+
let a = rt(Ge(r, i, i), t);
|
|
5444
|
+
if (Re && i && /\s/.test(r.nodeValue[i - 1]) && i < r.nodeValue.length) {
|
|
5445
|
+
let c = rt(Ge(r, i - 1, i - 1), -1);
|
|
5443
5446
|
if (c.top == a.top) {
|
|
5444
|
-
let u = rt(
|
|
5447
|
+
let u = rt(Ge(r, i, i + 1), -1);
|
|
5445
5448
|
if (u.top != a.top)
|
|
5446
5449
|
return Sn(u, u.left < c.left);
|
|
5447
5450
|
}
|
|
@@ -5449,23 +5452,23 @@ function na(n, e, t) {
|
|
|
5449
5452
|
return a;
|
|
5450
5453
|
} else {
|
|
5451
5454
|
let a = i, c = i, u = t < 0 ? 1 : -1;
|
|
5452
|
-
return t < 0 && !i ? (c++, u = -1) : t >= 0 && i == r.nodeValue.length ? (a--, u = 1) : t < 0 ? a-- : c++, Sn(rt(
|
|
5455
|
+
return t < 0 && !i ? (c++, u = -1) : t >= 0 && i == r.nodeValue.length ? (a--, u = 1) : t < 0 ? a-- : c++, Sn(rt(Ge(r, a, c), u), u < 0);
|
|
5453
5456
|
}
|
|
5454
5457
|
if (!n.state.doc.resolve(e - (s || 0)).parent.inlineContent) {
|
|
5455
5458
|
if (s == null && i && (t < 0 || i == Se(r))) {
|
|
5456
5459
|
let a = r.childNodes[i - 1];
|
|
5457
5460
|
if (a.nodeType == 1)
|
|
5458
|
-
return
|
|
5461
|
+
return pi(a.getBoundingClientRect(), !1);
|
|
5459
5462
|
}
|
|
5460
5463
|
if (s == null && i < Se(r)) {
|
|
5461
5464
|
let a = r.childNodes[i];
|
|
5462
5465
|
if (a.nodeType == 1)
|
|
5463
|
-
return
|
|
5466
|
+
return pi(a.getBoundingClientRect(), !0);
|
|
5464
5467
|
}
|
|
5465
|
-
return
|
|
5468
|
+
return pi(r.getBoundingClientRect(), t >= 0);
|
|
5466
5469
|
}
|
|
5467
5470
|
if (s == null && i && (t < 0 || i == Se(r))) {
|
|
5468
|
-
let a = r.childNodes[i - 1], c = a.nodeType == 3 ?
|
|
5471
|
+
let a = r.childNodes[i - 1], c = a.nodeType == 3 ? Ge(a, Se(a) - (o ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
|
|
5469
5472
|
if (c)
|
|
5470
5473
|
return Sn(rt(c, 1), !1);
|
|
5471
5474
|
}
|
|
@@ -5473,11 +5476,11 @@ function na(n, e, t) {
|
|
|
5473
5476
|
let a = r.childNodes[i];
|
|
5474
5477
|
for (; a.pmViewDesc && a.pmViewDesc.ignoreForCoords; )
|
|
5475
5478
|
a = a.nextSibling;
|
|
5476
|
-
let c = a ? a.nodeType == 3 ?
|
|
5479
|
+
let c = a ? a.nodeType == 3 ? Ge(a, 0, o ? 0 : 1) : a.nodeType == 1 ? a : null : null;
|
|
5477
5480
|
if (c)
|
|
5478
5481
|
return Sn(rt(c, -1), !0);
|
|
5479
5482
|
}
|
|
5480
|
-
return Sn(rt(r.nodeType == 3 ?
|
|
5483
|
+
return Sn(rt(r.nodeType == 3 ? Ge(r) : r, -t), t >= 0);
|
|
5481
5484
|
}
|
|
5482
5485
|
function Sn(n, e) {
|
|
5483
5486
|
if (n.width == 0)
|
|
@@ -5485,7 +5488,7 @@ function Sn(n, e) {
|
|
|
5485
5488
|
let t = e ? n.left : n.right;
|
|
5486
5489
|
return { top: n.top, bottom: n.bottom, left: t, right: t };
|
|
5487
5490
|
}
|
|
5488
|
-
function
|
|
5491
|
+
function pi(n, e) {
|
|
5489
5492
|
if (n.height == 0)
|
|
5490
5493
|
return n;
|
|
5491
5494
|
let t = e ? n.top : n.bottom;
|
|
@@ -5520,7 +5523,7 @@ function rd(n, e, t) {
|
|
|
5520
5523
|
if (l.nodeType == 1)
|
|
5521
5524
|
a = l.getClientRects();
|
|
5522
5525
|
else if (l.nodeType == 3)
|
|
5523
|
-
a =
|
|
5526
|
+
a = Ge(l, 0, l.nodeValue.length).getClientRects();
|
|
5524
5527
|
else
|
|
5525
5528
|
continue;
|
|
5526
5529
|
for (let c = 0; c < a.length; c++) {
|
|
@@ -5553,8 +5556,8 @@ let lo = null, ao = null, co = !1;
|
|
|
5553
5556
|
function od(n, e, t) {
|
|
5554
5557
|
return lo == e && ao == t ? co : (lo = e, ao = t, co = t == "up" || t == "down" ? rd(n, e, t) : sd(n, e, t));
|
|
5555
5558
|
}
|
|
5556
|
-
const Ce = 0, uo = 1, Et = 2,
|
|
5557
|
-
class
|
|
5559
|
+
const Ce = 0, uo = 1, Et = 2, je = 3;
|
|
5560
|
+
class Zn {
|
|
5558
5561
|
constructor(e, t, r, i) {
|
|
5559
5562
|
this.parent = e, this.children = t, this.dom = r, this.contentDOM = i, this.dirty = Ce, r.pmViewDesc = this;
|
|
5560
5563
|
}
|
|
@@ -5807,7 +5810,7 @@ class Xn {
|
|
|
5807
5810
|
h = g;
|
|
5808
5811
|
}
|
|
5809
5812
|
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(), d = !1;
|
|
5810
|
-
if ((
|
|
5813
|
+
if ((Re || ae) && e == t) {
|
|
5811
5814
|
let { node: p, offset: h } = l;
|
|
5812
5815
|
if (p.nodeType == 3) {
|
|
5813
5816
|
if (d = !!(h && p.nodeValue[h - 1] == `
|
|
@@ -5826,7 +5829,7 @@ class Xn {
|
|
|
5826
5829
|
d = m && (m.nodeName == "BR" || m.contentEditable == "false");
|
|
5827
5830
|
}
|
|
5828
5831
|
}
|
|
5829
|
-
if (
|
|
5832
|
+
if (Re && u.focusNode && u.focusNode != a.node && u.focusNode.nodeType == 1) {
|
|
5830
5833
|
let p = u.focusNode.childNodes[u.focusOffset];
|
|
5831
5834
|
p && p.contentEditable == "false" && (i = !0);
|
|
5832
5835
|
}
|
|
@@ -5863,10 +5866,10 @@ class Xn {
|
|
|
5863
5866
|
if (r == o ? e <= o && t >= r : e < o && t > r) {
|
|
5864
5867
|
let l = r + s.border, a = o - s.border;
|
|
5865
5868
|
if (e >= l && t <= a) {
|
|
5866
|
-
this.dirty = e == r || t == o ? Et : uo, e == l && t == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty =
|
|
5869
|
+
this.dirty = e == r || t == o ? Et : uo, e == l && t == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = je : s.markDirty(e - l, t - l);
|
|
5867
5870
|
return;
|
|
5868
5871
|
} else
|
|
5869
|
-
s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? Et :
|
|
5872
|
+
s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? Et : je;
|
|
5870
5873
|
}
|
|
5871
5874
|
r = o;
|
|
5872
5875
|
}
|
|
@@ -5889,7 +5892,7 @@ class Xn {
|
|
|
5889
5892
|
return !1;
|
|
5890
5893
|
}
|
|
5891
5894
|
}
|
|
5892
|
-
class ia extends
|
|
5895
|
+
class ia extends Zn {
|
|
5893
5896
|
constructor(e, t, r, i) {
|
|
5894
5897
|
let s, o = t.type.toDOM;
|
|
5895
5898
|
if (typeof o == "function" && (o = o(r, () => {
|
|
@@ -5929,7 +5932,7 @@ class ia extends Xn {
|
|
|
5929
5932
|
return this.widget.type.side;
|
|
5930
5933
|
}
|
|
5931
5934
|
}
|
|
5932
|
-
class ld extends
|
|
5935
|
+
class ld extends Zn {
|
|
5933
5936
|
constructor(e, t, r, i) {
|
|
5934
5937
|
super(e, [], t, null), this.textDOM = r, this.text = i;
|
|
5935
5938
|
}
|
|
@@ -5946,7 +5949,7 @@ class ld extends Xn {
|
|
|
5946
5949
|
return e.type === "characterData" && e.target.nodeValue == e.oldValue;
|
|
5947
5950
|
}
|
|
5948
5951
|
}
|
|
5949
|
-
class Vt extends
|
|
5952
|
+
class Vt extends Zn {
|
|
5950
5953
|
constructor(e, t, r, i, s) {
|
|
5951
5954
|
super(e, [], r, i), this.mark = t, this.spec = s;
|
|
5952
5955
|
}
|
|
@@ -5955,10 +5958,10 @@ class Vt extends Xn {
|
|
|
5955
5958
|
return (!o || !o.dom) && (o = $t.renderSpec(document, t.type.spec.toDOM(t, r), null, t.attrs)), new Vt(e, t, o.dom, o.contentDOM || o.dom, o);
|
|
5956
5959
|
}
|
|
5957
5960
|
parseRule() {
|
|
5958
|
-
return this.dirty &
|
|
5961
|
+
return this.dirty & je || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
|
|
5959
5962
|
}
|
|
5960
5963
|
matchesMark(e) {
|
|
5961
|
-
return this.dirty !=
|
|
5964
|
+
return this.dirty != je && this.mark.eq(e);
|
|
5962
5965
|
}
|
|
5963
5966
|
markDirty(e, t) {
|
|
5964
5967
|
if (super.markDirty(e, t), this.dirty != Ce) {
|
|
@@ -5982,7 +5985,7 @@ class Vt extends Xn {
|
|
|
5982
5985
|
this.spec.destroy && this.spec.destroy(), super.destroy();
|
|
5983
5986
|
}
|
|
5984
5987
|
}
|
|
5985
|
-
class pt extends
|
|
5988
|
+
class pt extends Zn {
|
|
5986
5989
|
constructor(e, t, r, i, s, o, l, a, c) {
|
|
5987
5990
|
super(e, [], s, o), this.node = t, this.outerDeco = r, this.innerDeco = i, this.nodeDOM = l;
|
|
5988
5991
|
}
|
|
@@ -6010,7 +6013,7 @@ class pt extends Xn {
|
|
|
6010
6013
|
} else u || ({ dom: u, contentDOM: d } = $t.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
|
|
6011
6014
|
!d && !t.isText && u.nodeName != "BR" && (u.hasAttribute("contenteditable") || (u.contentEditable = "false"), t.type.spec.draggable && (u.draggable = !0));
|
|
6012
6015
|
let f = u;
|
|
6013
|
-
return u = aa(u, r, t), c ? a = new ad(e, t, r, i, u, d || null, f, c, s, o + 1) : t.isText ? new
|
|
6016
|
+
return u = aa(u, r, t), c ? a = new ad(e, t, r, i, u, d || null, f, c, s, o + 1) : t.isText ? new Ur(e, t, r, i, u, f, s) : new pt(e, t, r, i, u, d || null, f, s, o + 1);
|
|
6014
6017
|
}
|
|
6015
6018
|
parseRule() {
|
|
6016
6019
|
if (this.node.type.spec.reparseInView)
|
|
@@ -6033,7 +6036,7 @@ class pt extends Xn {
|
|
|
6033
6036
|
return e;
|
|
6034
6037
|
}
|
|
6035
6038
|
matchesNode(e, t, r) {
|
|
6036
|
-
return this.dirty == Ce && e.eq(this.node) &&
|
|
6039
|
+
return this.dirty == Ce && e.eq(this.node) && Ir(t, this.outerDeco) && r.eq(this.innerDeco);
|
|
6037
6040
|
}
|
|
6038
6041
|
get size() {
|
|
6039
6042
|
return this.node.nodeSize;
|
|
@@ -6085,13 +6088,13 @@ class pt extends Xn {
|
|
|
6085
6088
|
// If this desc must be updated to match the given node decoration,
|
|
6086
6089
|
// do so and return true.
|
|
6087
6090
|
update(e, t, r, i) {
|
|
6088
|
-
return this.dirty ==
|
|
6091
|
+
return this.dirty == je || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, r, i), !0);
|
|
6089
6092
|
}
|
|
6090
6093
|
updateInner(e, t, r, i) {
|
|
6091
6094
|
this.updateOuterDeco(t), this.node = e, this.innerDeco = r, this.contentDOM && this.updateChildren(i, this.posAtStart), this.dirty = Ce;
|
|
6092
6095
|
}
|
|
6093
6096
|
updateOuterDeco(e) {
|
|
6094
|
-
if (
|
|
6097
|
+
if (Ir(e, this.outerDeco))
|
|
6095
6098
|
return;
|
|
6096
6099
|
let t = this.nodeDOM.nodeType != 1, r = this.dom;
|
|
6097
6100
|
this.dom = la(this.dom, this.nodeDOM, $i(this.outerDeco, this.node, t), $i(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
|
|
@@ -6113,7 +6116,7 @@ function fo(n, e, t, r, i) {
|
|
|
6113
6116
|
let s = new pt(void 0, n, e, t, r, r, r, i, 0);
|
|
6114
6117
|
return s.contentDOM && s.updateChildren(i, 0), s;
|
|
6115
6118
|
}
|
|
6116
|
-
class
|
|
6119
|
+
class Ur extends pt {
|
|
6117
6120
|
constructor(e, t, r, i, s, o, l) {
|
|
6118
6121
|
super(e, t, r, i, s, null, o, l, 0);
|
|
6119
6122
|
}
|
|
@@ -6124,7 +6127,7 @@ class Gr extends pt {
|
|
|
6124
6127
|
return { skip: e || !0 };
|
|
6125
6128
|
}
|
|
6126
6129
|
update(e, t, r, i) {
|
|
6127
|
-
return this.dirty ==
|
|
6130
|
+
return this.dirty == je || this.dirty != Ce && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(t), (this.dirty != Ce || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, i.trackWrites == this.nodeDOM && (i.trackWrites = null)), this.node = e, this.dirty = Ce, !0);
|
|
6128
6131
|
}
|
|
6129
6132
|
inParent() {
|
|
6130
6133
|
let e = this.parent.contentDOM;
|
|
@@ -6144,10 +6147,10 @@ class Gr extends pt {
|
|
|
6144
6147
|
}
|
|
6145
6148
|
slice(e, t, r) {
|
|
6146
6149
|
let i = this.node.cut(e, t), s = document.createTextNode(i.text);
|
|
6147
|
-
return new
|
|
6150
|
+
return new Ur(this.parent, i, this.outerDeco, this.innerDeco, s, s, r);
|
|
6148
6151
|
}
|
|
6149
6152
|
markDirty(e, t) {
|
|
6150
|
-
super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty =
|
|
6153
|
+
super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = je);
|
|
6151
6154
|
}
|
|
6152
6155
|
get domAtom() {
|
|
6153
6156
|
return !1;
|
|
@@ -6156,7 +6159,7 @@ class Gr extends pt {
|
|
|
6156
6159
|
return this.node.text == e;
|
|
6157
6160
|
}
|
|
6158
6161
|
}
|
|
6159
|
-
class sa extends
|
|
6162
|
+
class sa extends Zn {
|
|
6160
6163
|
parseRule() {
|
|
6161
6164
|
return { ignore: !0 };
|
|
6162
6165
|
}
|
|
@@ -6178,7 +6181,7 @@ class ad extends pt {
|
|
|
6178
6181
|
// through. If it does, and there's a `contentDOM` node, our logic
|
|
6179
6182
|
// updates the children.
|
|
6180
6183
|
update(e, t, r, i) {
|
|
6181
|
-
if (this.dirty ==
|
|
6184
|
+
if (this.dirty == je)
|
|
6182
6185
|
return !1;
|
|
6183
6186
|
if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
|
|
6184
6187
|
let s = this.spec.update(e, t, r);
|
|
@@ -6223,38 +6226,38 @@ function oa(n, e, t) {
|
|
|
6223
6226
|
r = po(r), i = !0;
|
|
6224
6227
|
i && t.trackWrites == n && (t.trackWrites = null);
|
|
6225
6228
|
}
|
|
6226
|
-
const
|
|
6229
|
+
const An = function(n) {
|
|
6227
6230
|
n && (this.nodeName = n);
|
|
6228
6231
|
};
|
|
6229
|
-
|
|
6230
|
-
const
|
|
6232
|
+
An.prototype = /* @__PURE__ */ Object.create(null);
|
|
6233
|
+
const Nt = [new An()];
|
|
6231
6234
|
function $i(n, e, t) {
|
|
6232
6235
|
if (n.length == 0)
|
|
6233
|
-
return
|
|
6234
|
-
let r = t ?
|
|
6236
|
+
return Nt;
|
|
6237
|
+
let r = t ? Nt[0] : new An(), i = [r];
|
|
6235
6238
|
for (let s = 0; s < n.length; s++) {
|
|
6236
6239
|
let o = n[s].type.attrs;
|
|
6237
6240
|
if (o) {
|
|
6238
|
-
o.nodeName && i.push(r = new
|
|
6241
|
+
o.nodeName && i.push(r = new An(o.nodeName));
|
|
6239
6242
|
for (let l in o) {
|
|
6240
6243
|
let a = o[l];
|
|
6241
|
-
a != null && (t && i.length == 1 && i.push(r = new
|
|
6244
|
+
a != null && (t && i.length == 1 && i.push(r = new An(e.isInline ? "span" : "div")), l == "class" ? r.class = (r.class ? r.class + " " : "") + a : l == "style" ? r.style = (r.style ? r.style + ";" : "") + a : l != "nodeName" && (r[l] = a));
|
|
6242
6245
|
}
|
|
6243
6246
|
}
|
|
6244
6247
|
}
|
|
6245
6248
|
return i;
|
|
6246
6249
|
}
|
|
6247
6250
|
function la(n, e, t, r) {
|
|
6248
|
-
if (t ==
|
|
6251
|
+
if (t == Nt && r == Nt)
|
|
6249
6252
|
return e;
|
|
6250
6253
|
let i = e;
|
|
6251
6254
|
for (let s = 0; s < r.length; s++) {
|
|
6252
6255
|
let o = r[s], l = t[s];
|
|
6253
6256
|
if (s) {
|
|
6254
6257
|
let a;
|
|
6255
|
-
l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l =
|
|
6258
|
+
l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = Nt[0]), i = a;
|
|
6256
6259
|
}
|
|
6257
|
-
cd(i, l ||
|
|
6260
|
+
cd(i, l || Nt[0], o);
|
|
6258
6261
|
}
|
|
6259
6262
|
return i;
|
|
6260
6263
|
}
|
|
@@ -6281,9 +6284,9 @@ function cd(n, e, t) {
|
|
|
6281
6284
|
}
|
|
6282
6285
|
}
|
|
6283
6286
|
function aa(n, e, t) {
|
|
6284
|
-
return la(n, n,
|
|
6287
|
+
return la(n, n, Nt, $i(e, t, n.nodeType != 1));
|
|
6285
6288
|
}
|
|
6286
|
-
function
|
|
6289
|
+
function Ir(n, e) {
|
|
6287
6290
|
if (n.length != e.length)
|
|
6288
6291
|
return !1;
|
|
6289
6292
|
for (let t = 0; t < n.length; t++)
|
|
@@ -6357,7 +6360,7 @@ class ud {
|
|
|
6357
6360
|
}
|
|
6358
6361
|
updateNodeAt(e, t, r, i, s) {
|
|
6359
6362
|
let o = this.top.children[i];
|
|
6360
|
-
return o.dirty ==
|
|
6363
|
+
return o.dirty == je && o.dom == o.contentDOM && (o.dirty = Et), o.update(e, t, r, s) ? (this.destroyBetween(this.index, i), this.index++, !0) : !1;
|
|
6361
6364
|
}
|
|
6362
6365
|
findIndexWithChild(e) {
|
|
6363
6366
|
for (; ; ) {
|
|
@@ -6385,7 +6388,7 @@ class ud {
|
|
|
6385
6388
|
let c = this.preMatch.matched.get(a);
|
|
6386
6389
|
if (c != null && c != s)
|
|
6387
6390
|
return !1;
|
|
6388
|
-
let u = a.dom, d, f = this.isLocked(u) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty !=
|
|
6391
|
+
let u = a.dom, d, f = this.isLocked(u) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != je && Ir(t, a.outerDeco));
|
|
6389
6392
|
if (!f && a.update(e, t, r, i))
|
|
6390
6393
|
return this.destroyBetween(this.index, l), a.dom != u && (this.changed = !0), this.index++, !0;
|
|
6391
6394
|
if (!f && (d = this.recreateWrapper(a, e, t, r, i, o)))
|
|
@@ -6398,7 +6401,7 @@ class ud {
|
|
|
6398
6401
|
// When a node with content is replaced by a different node with
|
|
6399
6402
|
// identical content, move over its children.
|
|
6400
6403
|
recreateWrapper(e, t, r, i, s, o) {
|
|
6401
|
-
if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !
|
|
6404
|
+
if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !Ir(r, e.outerDeco) || !i.eq(e.innerDeco))
|
|
6402
6405
|
return null;
|
|
6403
6406
|
let l = pt.create(this.top, t, r, i, s, o);
|
|
6404
6407
|
if (l.contentDOM) {
|
|
@@ -6429,7 +6432,7 @@ class ud {
|
|
|
6429
6432
|
for (; e instanceof Vt; )
|
|
6430
6433
|
t = e, e = t.children[t.children.length - 1];
|
|
6431
6434
|
(!e || // Empty textblock
|
|
6432
|
-
!(e instanceof
|
|
6435
|
+
!(e instanceof Ur) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((ae || ie) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
|
|
6433
6436
|
}
|
|
6434
6437
|
addHackNode(e, t) {
|
|
6435
6438
|
if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))
|
|
@@ -6569,13 +6572,13 @@ function cs(n, e = null) {
|
|
|
6569
6572
|
if (o < 0)
|
|
6570
6573
|
return null;
|
|
6571
6574
|
let l = r.resolve(o), a, c;
|
|
6572
|
-
if (
|
|
6575
|
+
if (Jr(t)) {
|
|
6573
6576
|
for (a = o; i && !i.node; )
|
|
6574
6577
|
i = i.parent;
|
|
6575
6578
|
let d = i.node;
|
|
6576
|
-
if (i && d.isAtom &&
|
|
6579
|
+
if (i && d.isAtom && N.isSelectable(d) && i.parent && !(d.isInline && Hu(t.focusNode, t.focusOffset, i.dom))) {
|
|
6577
6580
|
let f = i.posBefore;
|
|
6578
|
-
c = new
|
|
6581
|
+
c = new N(o == f ? l : r.resolve(f));
|
|
6579
6582
|
}
|
|
6580
6583
|
} else {
|
|
6581
6584
|
if (t instanceof n.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1) {
|
|
@@ -6625,15 +6628,15 @@ const ho = ae || ie && Xl < 63;
|
|
|
6625
6628
|
function mo(n, e) {
|
|
6626
6629
|
let { node: t, offset: r } = n.docView.domFromPos(e, 0), i = r < t.childNodes.length ? t.childNodes[r] : null, s = r ? t.childNodes[r - 1] : null;
|
|
6627
6630
|
if (ae && i && i.contentEditable == "false")
|
|
6628
|
-
return
|
|
6631
|
+
return hi(i);
|
|
6629
6632
|
if ((!i || i.contentEditable == "false") && (!s || s.contentEditable == "false")) {
|
|
6630
6633
|
if (i)
|
|
6631
|
-
return
|
|
6634
|
+
return hi(i);
|
|
6632
6635
|
if (s)
|
|
6633
|
-
return
|
|
6636
|
+
return hi(s);
|
|
6634
6637
|
}
|
|
6635
6638
|
}
|
|
6636
|
-
function
|
|
6639
|
+
function hi(n) {
|
|
6637
6640
|
return n.contentEditable = "true", ae && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
|
|
6638
6641
|
}
|
|
6639
6642
|
function go(n) {
|
|
@@ -6657,7 +6660,7 @@ function yd(n) {
|
|
|
6657
6660
|
i ? t.setStart(r.parentNode, Z(r) + 1) : t.setStart(r, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t), !i && !n.state.selection.visible && fe && ft <= 11 && (r.disabled = !0, r.disabled = !1);
|
|
6658
6661
|
}
|
|
6659
6662
|
function ua(n, e) {
|
|
6660
|
-
if (e instanceof
|
|
6663
|
+
if (e instanceof N) {
|
|
6661
6664
|
let t = n.docView.descAt(e.from);
|
|
6662
6665
|
t != n.lastSelectedViewDesc && (yo(n), t && t.selectNode(), n.lastSelectedViewDesc = t);
|
|
6663
6666
|
} else
|
|
@@ -6705,17 +6708,17 @@ function vo(n, e, t) {
|
|
|
6705
6708
|
} else if (r.empty) {
|
|
6706
6709
|
if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
|
|
6707
6710
|
let i = ji(n.state, e);
|
|
6708
|
-
return i && i instanceof
|
|
6711
|
+
return i && i instanceof N ? it(n, i) : !1;
|
|
6709
6712
|
} else if (!(we && t.indexOf("m") > -1)) {
|
|
6710
6713
|
let i = r.$head, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, o;
|
|
6711
6714
|
if (!s || s.isText)
|
|
6712
6715
|
return !1;
|
|
6713
6716
|
let l = e < 0 ? i.pos - s.nodeSize : i.pos;
|
|
6714
|
-
return s.isAtom || (o = n.docView.descAt(l)) && !o.contentDOM ?
|
|
6717
|
+
return s.isAtom || (o = n.docView.descAt(l)) && !o.contentDOM ? N.isSelectable(s) ? it(n, new N(e < 0 ? n.state.doc.resolve(i.pos - s.nodeSize) : i)) : Xn ? it(n, new D(n.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
|
|
6715
6718
|
}
|
|
6716
6719
|
} else return !1;
|
|
6717
6720
|
else {
|
|
6718
|
-
if (r instanceof
|
|
6721
|
+
if (r instanceof N && r.node.isInline)
|
|
6719
6722
|
return it(n, new D(e > 0 ? r.$to : r.$from));
|
|
6720
6723
|
{
|
|
6721
6724
|
let i = ji(n.state, e);
|
|
@@ -6723,7 +6726,7 @@ function vo(n, e, t) {
|
|
|
6723
6726
|
}
|
|
6724
6727
|
}
|
|
6725
6728
|
}
|
|
6726
|
-
function
|
|
6729
|
+
function Rr(n) {
|
|
6727
6730
|
return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
|
|
6728
6731
|
}
|
|
6729
6732
|
function Dn(n, e) {
|
|
@@ -6738,7 +6741,7 @@ function vd(n) {
|
|
|
6738
6741
|
if (!t)
|
|
6739
6742
|
return;
|
|
6740
6743
|
let i, s, o = !1;
|
|
6741
|
-
for (
|
|
6744
|
+
for (Re && t.nodeType == 1 && r < Rr(t) && Dn(t.childNodes[r], -1) && (o = !0); ; )
|
|
6742
6745
|
if (r > 0) {
|
|
6743
6746
|
if (t.nodeType != 1)
|
|
6744
6747
|
break;
|
|
@@ -6759,7 +6762,7 @@ function vd(n) {
|
|
|
6759
6762
|
for (; l && Dn(l, -1); )
|
|
6760
6763
|
i = t.parentNode, s = Z(l), l = l.previousSibling;
|
|
6761
6764
|
if (l)
|
|
6762
|
-
t = l, r =
|
|
6765
|
+
t = l, r = Rr(t);
|
|
6763
6766
|
else {
|
|
6764
6767
|
if (t = t.parentNode, t == n.dom)
|
|
6765
6768
|
break;
|
|
@@ -6773,7 +6776,7 @@ function kd(n) {
|
|
|
6773
6776
|
let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
|
|
6774
6777
|
if (!t)
|
|
6775
6778
|
return;
|
|
6776
|
-
let i =
|
|
6779
|
+
let i = Rr(t), s, o;
|
|
6777
6780
|
for (; ; )
|
|
6778
6781
|
if (r < i) {
|
|
6779
6782
|
if (t.nodeType != 1)
|
|
@@ -6791,7 +6794,7 @@ function kd(n) {
|
|
|
6791
6794
|
for (; l && Dn(l, 1); )
|
|
6792
6795
|
s = l.parentNode, o = Z(l) + 1, l = l.nextSibling;
|
|
6793
6796
|
if (l)
|
|
6794
|
-
t = l, r = 0, i =
|
|
6797
|
+
t = l, r = 0, i = Rr(t);
|
|
6795
6798
|
else {
|
|
6796
6799
|
if (t = t.parentNode, t == n.dom)
|
|
6797
6800
|
break;
|
|
@@ -6806,7 +6809,7 @@ function fa(n) {
|
|
|
6806
6809
|
return e && e.node && e.node.isBlock;
|
|
6807
6810
|
}
|
|
6808
6811
|
function xd(n, e) {
|
|
6809
|
-
for (; n && e == n.childNodes.length && !
|
|
6812
|
+
for (; n && e == n.childNodes.length && !Yn(n); )
|
|
6810
6813
|
e = Z(n) + 1, n = n.parentNode;
|
|
6811
6814
|
for (; n && e < n.childNodes.length; ) {
|
|
6812
6815
|
let t = n.childNodes[e];
|
|
@@ -6818,7 +6821,7 @@ function xd(n, e) {
|
|
|
6818
6821
|
}
|
|
6819
6822
|
}
|
|
6820
6823
|
function wd(n, e) {
|
|
6821
|
-
for (; n && !e && !
|
|
6824
|
+
for (; n && !e && !Yn(n); )
|
|
6822
6825
|
e = Z(n), n = n.parentNode;
|
|
6823
6826
|
for (; n && e; ) {
|
|
6824
6827
|
let t = n.childNodes[e - 1];
|
|
@@ -6837,7 +6840,7 @@ function Wi(n, e, t) {
|
|
|
6837
6840
|
let r = n.domSelection();
|
|
6838
6841
|
if (!r)
|
|
6839
6842
|
return;
|
|
6840
|
-
if (
|
|
6843
|
+
if (Jr(r)) {
|
|
6841
6844
|
let s = document.createRange();
|
|
6842
6845
|
s.setEnd(e, t), s.setStart(e, t), r.removeAllRanges(), r.addRange(s);
|
|
6843
6846
|
} else r.extend && r.extend(e, t);
|
|
@@ -6871,11 +6874,11 @@ function xo(n, e, t) {
|
|
|
6871
6874
|
let { $from: i, $to: s } = r;
|
|
6872
6875
|
if (!i.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
|
|
6873
6876
|
let o = ji(n.state, e);
|
|
6874
|
-
if (o && o instanceof
|
|
6877
|
+
if (o && o instanceof N)
|
|
6875
6878
|
return it(n, o);
|
|
6876
6879
|
}
|
|
6877
6880
|
if (!i.parent.inlineContent) {
|
|
6878
|
-
let o = e < 0 ? i : s, l = r instanceof
|
|
6881
|
+
let o = e < 0 ? i : s, l = r instanceof Ie ? R.near(o, e) : R.findFrom(o, e);
|
|
6879
6882
|
return l ? it(n, l) : !1;
|
|
6880
6883
|
}
|
|
6881
6884
|
return !1;
|
|
@@ -6990,7 +6993,7 @@ function ha(n, e, t, r, i) {
|
|
|
6990
6993
|
} else
|
|
6991
6994
|
n.someProp("transformPastedHTML", (d) => {
|
|
6992
6995
|
t = d(t, n);
|
|
6993
|
-
}), o =
|
|
6996
|
+
}), o = Nd(t), Xn && Ad(o);
|
|
6994
6997
|
let c = o && o.querySelector("[data-pm-slice]"), u = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
|
|
6995
6998
|
if (u && u[3])
|
|
6996
6999
|
for (let d = +u[3]; d > 0; d--) {
|
|
@@ -7087,12 +7090,12 @@ let Co = null;
|
|
|
7087
7090
|
function va() {
|
|
7088
7091
|
return Co || (Co = document.implementation.createHTMLDocument("title"));
|
|
7089
7092
|
}
|
|
7090
|
-
let
|
|
7093
|
+
let mi = null;
|
|
7091
7094
|
function Ed(n) {
|
|
7092
7095
|
let e = window.trustedTypes;
|
|
7093
|
-
return e ? (
|
|
7096
|
+
return e ? (mi || (mi = e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), mi.createHTML(n)) : n;
|
|
7094
7097
|
}
|
|
7095
|
-
function
|
|
7098
|
+
function Nd(n) {
|
|
7096
7099
|
let e = /^(\s*<meta [^>]*>)*/.exec(n);
|
|
7097
7100
|
e && (n = n.slice(e[0].length));
|
|
7098
7101
|
let t = va().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), i;
|
|
@@ -7101,7 +7104,7 @@ function Ad(n) {
|
|
|
7101
7104
|
t = t.querySelector(i[s]) || t;
|
|
7102
7105
|
return t;
|
|
7103
7106
|
}
|
|
7104
|
-
function
|
|
7107
|
+
function Ad(n) {
|
|
7105
7108
|
let e = n.querySelectorAll(ie ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
7106
7109
|
for (let t = 0; t < e.length; t++) {
|
|
7107
7110
|
let r = e[t];
|
|
@@ -7129,7 +7132,7 @@ function Dd(n, e) {
|
|
|
7129
7132
|
const ce = {}, ue = {}, Id = { touchstart: !0, touchmove: !0 };
|
|
7130
7133
|
class Rd {
|
|
7131
7134
|
constructor() {
|
|
7132
|
-
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.
|
|
7135
|
+
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;
|
|
7133
7136
|
}
|
|
7134
7137
|
}
|
|
7135
7138
|
function Pd(n) {
|
|
@@ -7177,7 +7180,7 @@ function zd(n, e) {
|
|
|
7177
7180
|
}
|
|
7178
7181
|
ue.keydown = (n, e) => {
|
|
7179
7182
|
let t = e;
|
|
7180
|
-
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !xa(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(
|
|
7183
|
+
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !xa(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(Xe && ie && t.keyCode == 13)))
|
|
7181
7184
|
if (t.keyCode != 229 && n.domObserver.forceFlush(), ln && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
7182
7185
|
let r = Date.now();
|
|
7183
7186
|
n.input.lastIOSEnter = r, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
@@ -7202,7 +7205,7 @@ ue.keypress = (n, e) => {
|
|
|
7202
7205
|
!/[\r\n]/.test(i) && !n.someProp("handleTextInput", (s) => s(n, r.$from.pos, r.$to.pos, i)) && n.dispatch(n.state.tr.insertText(i).scrollIntoView()), t.preventDefault();
|
|
7203
7206
|
}
|
|
7204
7207
|
};
|
|
7205
|
-
function
|
|
7208
|
+
function Gr(n) {
|
|
7206
7209
|
return { left: n.clientX, top: n.clientY };
|
|
7207
7210
|
}
|
|
7208
7211
|
function Vd(n, e) {
|
|
@@ -7228,22 +7231,22 @@ function Fd(n, e) {
|
|
|
7228
7231
|
if (e == -1)
|
|
7229
7232
|
return !1;
|
|
7230
7233
|
let t = n.state.doc.resolve(e), r = t.nodeAfter;
|
|
7231
|
-
return r && r.isAtom &&
|
|
7234
|
+
return r && r.isAtom && N.isSelectable(r) ? (rn(n, new N(t)), !0) : !1;
|
|
7232
7235
|
}
|
|
7233
7236
|
function $d(n, e) {
|
|
7234
7237
|
if (e == -1)
|
|
7235
7238
|
return !1;
|
|
7236
7239
|
let t = n.state.selection, r, i;
|
|
7237
|
-
t instanceof
|
|
7240
|
+
t instanceof N && (r = t.node);
|
|
7238
7241
|
let s = n.state.doc.resolve(e);
|
|
7239
7242
|
for (let o = s.depth + 1; o > 0; o--) {
|
|
7240
7243
|
let l = o > s.depth ? s.nodeAfter : s.node(o);
|
|
7241
|
-
if (
|
|
7244
|
+
if (N.isSelectable(l)) {
|
|
7242
7245
|
r && t.$from.depth > 0 && o >= t.$from.depth && s.before(t.$from.depth + 1) == t.$from.pos ? i = s.before(t.$from.depth) : i = s.before(o);
|
|
7243
7246
|
break;
|
|
7244
7247
|
}
|
|
7245
7248
|
}
|
|
7246
|
-
return i != null ? (rn(n,
|
|
7249
|
+
return i != null ? (rn(n, N.create(n.state.doc, i)), !0) : !1;
|
|
7247
7250
|
}
|
|
7248
7251
|
function Hd(n, e, t, r, i) {
|
|
7249
7252
|
return fs(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? $d(n, t) : Fd(n, t));
|
|
@@ -7265,15 +7268,15 @@ function qd(n, e, t) {
|
|
|
7265
7268
|
let o = s > i.depth ? i.nodeAfter : i.node(s), l = i.before(s);
|
|
7266
7269
|
if (o.inlineContent)
|
|
7267
7270
|
rn(n, D.create(r, l + 1, l + 1 + o.content.size));
|
|
7268
|
-
else if (
|
|
7269
|
-
rn(n,
|
|
7271
|
+
else if (N.isSelectable(o))
|
|
7272
|
+
rn(n, N.create(r, l));
|
|
7270
7273
|
else
|
|
7271
7274
|
continue;
|
|
7272
7275
|
return !0;
|
|
7273
7276
|
}
|
|
7274
7277
|
}
|
|
7275
7278
|
function ps(n) {
|
|
7276
|
-
return
|
|
7279
|
+
return Pr(n);
|
|
7277
7280
|
}
|
|
7278
7281
|
const ka = we ? "metaKey" : "ctrlKey";
|
|
7279
7282
|
ce.mousedown = (n, e) => {
|
|
@@ -7281,7 +7284,7 @@ ce.mousedown = (n, e) => {
|
|
|
7281
7284
|
n.input.shiftKey = t.shiftKey;
|
|
7282
7285
|
let r = ps(n), i = Date.now(), s = "singleClick";
|
|
7283
7286
|
i - n.input.lastClick.time < 500 && Vd(t, n.input.lastClick) && !t[ka] && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s };
|
|
7284
|
-
let o = n.posAtCoords(
|
|
7287
|
+
let o = n.posAtCoords(Gr(t));
|
|
7285
7288
|
o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Kd(n, o, t, !!r)) : (s == "doubleClick" ? jd : Wd)(n, o.pos, o.inside, t) ? t.preventDefault() : ct(n, "pointer"));
|
|
7286
7289
|
};
|
|
7287
7290
|
class Kd {
|
|
@@ -7297,11 +7300,11 @@ class Kd {
|
|
|
7297
7300
|
const l = i ? null : r.target, a = l ? e.docView.nearestDesc(l, !0) : null;
|
|
7298
7301
|
this.target = a && a.dom.nodeType == 1 ? a.dom : null;
|
|
7299
7302
|
let { selection: c } = e.state;
|
|
7300
|
-
(r.button == 0 && s.type.spec.draggable && s.type.spec.selectable !== !1 || c instanceof
|
|
7303
|
+
(r.button == 0 && s.type.spec.draggable && s.type.spec.selectable !== !1 || c instanceof N && c.from <= o && c.to > o) && (this.mightDrag = {
|
|
7301
7304
|
node: s,
|
|
7302
7305
|
pos: o,
|
|
7303
7306
|
addAttr: !!(this.target && !this.target.draggable),
|
|
7304
|
-
setUneditable: !!(this.target &&
|
|
7307
|
+
setUneditable: !!(this.target && Re && !this.target.hasAttribute("contentEditable"))
|
|
7305
7308
|
}), this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable) && (this.view.domObserver.stop(), this.mightDrag.addAttr && (this.target.draggable = !0), this.mightDrag.setUneditable && setTimeout(() => {
|
|
7306
7309
|
this.view.input.mouseDown == this && this.target.setAttribute("contentEditable", "false");
|
|
7307
7310
|
}, 20), this.view.domObserver.start()), e.root.addEventListener("mouseup", this.up = this.up.bind(this)), e.root.addEventListener("mousemove", this.move = this.move.bind(this)), ct(e, "pointer");
|
|
@@ -7313,7 +7316,7 @@ class Kd {
|
|
|
7313
7316
|
if (this.done(), !this.view.dom.contains(e.target))
|
|
7314
7317
|
return;
|
|
7315
7318
|
let t = this.pos;
|
|
7316
|
-
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(
|
|
7319
|
+
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Gr(e))), this.updateAllowDefault(e), this.allowDefault || !t ? ct(this.view, "pointer") : Hd(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
7317
7320
|
ae && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
7318
7321
|
// cursor, but still report that the node is selected
|
|
7319
7322
|
// when asked through getSelection. You'll then get a
|
|
@@ -7340,14 +7343,14 @@ ce.contextmenu = (n) => ps(n);
|
|
|
7340
7343
|
function xa(n, e) {
|
|
7341
7344
|
return n.composing ? !0 : ae && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
|
|
7342
7345
|
}
|
|
7343
|
-
const _d =
|
|
7346
|
+
const _d = Xe ? 5e3 : -1;
|
|
7344
7347
|
ue.compositionstart = ue.compositionupdate = (n) => {
|
|
7345
7348
|
if (!n.composing) {
|
|
7346
7349
|
n.domObserver.flush();
|
|
7347
7350
|
let { state: e } = n, t = e.selection.$to;
|
|
7348
7351
|
if (e.selection instanceof D && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1)))
|
|
7349
|
-
n.markCursor = n.state.storedMarks || t.marks(),
|
|
7350
|
-
else if (
|
|
7352
|
+
n.markCursor = n.state.storedMarks || t.marks(), Pr(n, !0), n.markCursor = null;
|
|
7353
|
+
else if (Pr(n, !e.selection.empty), Re && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
|
|
7351
7354
|
let r = n.domSelectionRange();
|
|
7352
7355
|
for (let i = r.focusNode, s = r.focusOffset; i && i.nodeType == 1 && s != 0; ) {
|
|
7353
7356
|
let o = s < 0 ? i.lastChild : i.childNodes[s - 1];
|
|
@@ -7369,7 +7372,7 @@ ue.compositionend = (n, e) => {
|
|
|
7369
7372
|
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++, wa(n, 20));
|
|
7370
7373
|
};
|
|
7371
7374
|
function wa(n, e) {
|
|
7372
|
-
clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() =>
|
|
7375
|
+
clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => Pr(n), e));
|
|
7373
7376
|
}
|
|
7374
7377
|
function Sa(n) {
|
|
7375
7378
|
for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Ud()); n.input.compositionNodes.length > 0; )
|
|
@@ -7398,8 +7401,8 @@ function Ud() {
|
|
|
7398
7401
|
let n = document.createEvent("Event");
|
|
7399
7402
|
return n.initEvent("event", !0, !0), n.timeStamp;
|
|
7400
7403
|
}
|
|
7401
|
-
function
|
|
7402
|
-
if (!(
|
|
7404
|
+
function Pr(n, e = !1) {
|
|
7405
|
+
if (!(Xe && n.domObserver.flushingSoon >= 0)) {
|
|
7403
7406
|
if (n.domObserver.forceFlush(), Sa(n), e || n.docView && n.docView.dirty) {
|
|
7404
7407
|
let t = cs(n);
|
|
7405
7408
|
return t && !t.eq(n.state.selection) ? n.dispatch(n.state.tr.setSelection(t)) : (n.markCursor || e) && !n.state.selection.empty ? n.dispatch(n.state.tr.deleteSelection()) : n.updateState(n.state), !0;
|
|
@@ -7417,12 +7420,12 @@ function Gd(n, e) {
|
|
|
7417
7420
|
t.parentNode && t.parentNode.removeChild(t), n.focus();
|
|
7418
7421
|
}, 50);
|
|
7419
7422
|
}
|
|
7420
|
-
const
|
|
7423
|
+
const Fn = fe && ft < 15 || ln && Ku < 604;
|
|
7421
7424
|
ce.copy = ue.cut = (n, e) => {
|
|
7422
7425
|
let t = e, r = n.state.selection, i = t.type == "cut";
|
|
7423
7426
|
if (r.empty)
|
|
7424
7427
|
return;
|
|
7425
|
-
let s =
|
|
7428
|
+
let s = Fn ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = pa(n, o);
|
|
7426
7429
|
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : Gd(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
7427
7430
|
};
|
|
7428
7431
|
function Yd(n) {
|
|
@@ -7435,10 +7438,10 @@ function Xd(n, e) {
|
|
|
7435
7438
|
t || (r.contentEditable = "true"), r.style.cssText = "position: fixed; left: -10000px; top: 10px", r.focus();
|
|
7436
7439
|
let i = n.input.shiftKey && n.input.lastKeyCode != 45;
|
|
7437
7440
|
setTimeout(() => {
|
|
7438
|
-
n.focus(), r.parentNode && r.parentNode.removeChild(r), t ?
|
|
7441
|
+
n.focus(), r.parentNode && r.parentNode.removeChild(r), t ? $n(n, r.value, null, i, e) : $n(n, r.textContent, r.innerHTML, i, e);
|
|
7439
7442
|
}, 50);
|
|
7440
7443
|
}
|
|
7441
|
-
function
|
|
7444
|
+
function $n(n, e, t, r, i) {
|
|
7442
7445
|
let s = ha(n, e, t, r, n.state.selection.$from);
|
|
7443
7446
|
if (n.someProp("handlePaste", (a) => a(n, i, s || S.empty)))
|
|
7444
7447
|
return !0;
|
|
@@ -7456,10 +7459,10 @@ function Ma(n) {
|
|
|
7456
7459
|
}
|
|
7457
7460
|
ue.paste = (n, e) => {
|
|
7458
7461
|
let t = e;
|
|
7459
|
-
if (n.composing && !
|
|
7462
|
+
if (n.composing && !Xe)
|
|
7460
7463
|
return;
|
|
7461
|
-
let r =
|
|
7462
|
-
r &&
|
|
7464
|
+
let r = Fn ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
|
|
7465
|
+
r && $n(n, Ma(r), r.getData("text/html"), i, t) ? t.preventDefault() : Xd(n, t);
|
|
7463
7466
|
};
|
|
7464
7467
|
class Ca {
|
|
7465
7468
|
constructor(e, t, r) {
|
|
@@ -7471,17 +7474,17 @@ ce.dragstart = (n, e) => {
|
|
|
7471
7474
|
let t = e, r = n.input.mouseDown;
|
|
7472
7475
|
if (r && r.done(), !t.dataTransfer)
|
|
7473
7476
|
return;
|
|
7474
|
-
let i = n.state.selection, s = i.empty ? null : n.posAtCoords(
|
|
7475
|
-
if (!(s && s.pos >= i.from && s.pos <= (i instanceof
|
|
7477
|
+
let i = n.state.selection, s = i.empty ? null : n.posAtCoords(Gr(t)), o;
|
|
7478
|
+
if (!(s && s.pos >= i.from && s.pos <= (i instanceof N ? i.to - 1 : i.to))) {
|
|
7476
7479
|
if (r && r.mightDrag)
|
|
7477
|
-
o =
|
|
7480
|
+
o = N.create(n.state.doc, r.mightDrag.pos);
|
|
7478
7481
|
else if (t.target && t.target.nodeType == 1) {
|
|
7479
7482
|
let d = n.docView.nearestDesc(t.target, !0);
|
|
7480
|
-
d && d.node.type.spec.draggable && d != n.docView && (o =
|
|
7483
|
+
d && d.node.type.spec.draggable && d != n.docView && (o = N.create(n.state.doc, d.posBefore));
|
|
7481
7484
|
}
|
|
7482
7485
|
}
|
|
7483
7486
|
let l = (o || n.state.selection).content(), { dom: a, text: c, slice: u } = pa(n, l);
|
|
7484
|
-
(!t.dataTransfer.files.length || !ie || Xl > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(
|
|
7487
|
+
(!t.dataTransfer.files.length || !ie || Xl > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Fn ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Fn || t.dataTransfer.setData("text/plain", c), n.dragging = new Ca(u, !t[Oa], o);
|
|
7485
7488
|
};
|
|
7486
7489
|
ce.dragend = (n) => {
|
|
7487
7490
|
let e = n.dragging;
|
|
@@ -7494,13 +7497,13 @@ ue.drop = (n, e) => {
|
|
|
7494
7497
|
let t = e, r = n.dragging;
|
|
7495
7498
|
if (n.dragging = null, !t.dataTransfer)
|
|
7496
7499
|
return;
|
|
7497
|
-
let i = n.posAtCoords(
|
|
7500
|
+
let i = n.posAtCoords(Gr(t));
|
|
7498
7501
|
if (!i)
|
|
7499
7502
|
return;
|
|
7500
7503
|
let s = n.state.doc.resolve(i.pos), o = r && r.slice;
|
|
7501
7504
|
o ? n.someProp("transformPasted", (h) => {
|
|
7502
7505
|
o = h(o, n);
|
|
7503
|
-
}) : o = ha(n, Ma(t.dataTransfer),
|
|
7506
|
+
}) : o = ha(n, Ma(t.dataTransfer), Fn ? null : t.dataTransfer.getData("text/html"), !1, s);
|
|
7504
7507
|
let l = !!(r && !t[Oa]);
|
|
7505
7508
|
if (n.someProp("handleDrop", (h) => h(n, t, o || S.empty, l))) {
|
|
7506
7509
|
t.preventDefault();
|
|
@@ -7520,8 +7523,8 @@ ue.drop = (n, e) => {
|
|
|
7520
7523
|
if (d ? c.replaceRangeWith(u, u, o.content.firstChild) : c.replaceRange(u, u, o), c.doc.eq(f))
|
|
7521
7524
|
return;
|
|
7522
7525
|
let p = c.doc.resolve(u);
|
|
7523
|
-
if (d &&
|
|
7524
|
-
c.setSelection(new
|
|
7526
|
+
if (d && N.isSelectable(o.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(o.content.firstChild))
|
|
7527
|
+
c.setSelection(new N(p));
|
|
7525
7528
|
else {
|
|
7526
7529
|
let h = c.mapping.map(a);
|
|
7527
7530
|
c.mapping.maps[c.mapping.maps.length - 1].forEach((m, g, b, w) => h = w), c.setSelection(us(n, p, c.doc.resolve(h)));
|
|
@@ -7538,7 +7541,7 @@ ce.blur = (n, e) => {
|
|
|
7538
7541
|
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);
|
|
7539
7542
|
};
|
|
7540
7543
|
ce.beforeinput = (n, e) => {
|
|
7541
|
-
if (ie &&
|
|
7544
|
+
if (ie && Xe && e.inputType == "deleteContentBackward") {
|
|
7542
7545
|
n.domObserver.flushSoon();
|
|
7543
7546
|
let { domChangeCount: r } = n.input;
|
|
7544
7547
|
setTimeout(() => {
|
|
@@ -7551,7 +7554,7 @@ ce.beforeinput = (n, e) => {
|
|
|
7551
7554
|
};
|
|
7552
7555
|
for (let n in ue)
|
|
7553
7556
|
ce[n] = ue[n];
|
|
7554
|
-
function
|
|
7557
|
+
function Hn(n, e) {
|
|
7555
7558
|
if (n == e)
|
|
7556
7559
|
return !0;
|
|
7557
7560
|
for (let t in n)
|
|
@@ -7562,7 +7565,7 @@ function $n(n, e) {
|
|
|
7562
7565
|
return !1;
|
|
7563
7566
|
return !0;
|
|
7564
7567
|
}
|
|
7565
|
-
class
|
|
7568
|
+
class Br {
|
|
7566
7569
|
constructor(e, t) {
|
|
7567
7570
|
this.toDOM = e, this.spec = t || It, this.side = this.spec.side || 0;
|
|
7568
7571
|
}
|
|
@@ -7574,7 +7577,7 @@ class Lr {
|
|
|
7574
7577
|
return !0;
|
|
7575
7578
|
}
|
|
7576
7579
|
eq(e) {
|
|
7577
|
-
return this == e || e instanceof
|
|
7580
|
+
return this == e || e instanceof Br && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Hn(this.spec, e.spec));
|
|
7578
7581
|
}
|
|
7579
7582
|
destroy(e) {
|
|
7580
7583
|
this.spec.destroy && this.spec.destroy(e);
|
|
@@ -7592,7 +7595,7 @@ class ht {
|
|
|
7592
7595
|
return t.from < t.to;
|
|
7593
7596
|
}
|
|
7594
7597
|
eq(e) {
|
|
7595
|
-
return this == e || e instanceof ht &&
|
|
7598
|
+
return this == e || e instanceof ht && Hn(this.attrs, e.attrs) && Hn(this.spec, e.spec);
|
|
7596
7599
|
}
|
|
7597
7600
|
static is(e) {
|
|
7598
7601
|
return e.type instanceof ht;
|
|
@@ -7616,7 +7619,7 @@ class hs {
|
|
|
7616
7619
|
return i == t.from && !(s = e.child(r)).isText && i + s.nodeSize == t.to;
|
|
7617
7620
|
}
|
|
7618
7621
|
eq(e) {
|
|
7619
|
-
return this == e || e instanceof hs &&
|
|
7622
|
+
return this == e || e instanceof hs && Hn(this.attrs, e.attrs) && Hn(this.spec, e.spec);
|
|
7620
7623
|
}
|
|
7621
7624
|
destroy() {
|
|
7622
7625
|
}
|
|
@@ -7655,7 +7658,7 @@ class Me {
|
|
|
7655
7658
|
widget's current document position.
|
|
7656
7659
|
*/
|
|
7657
7660
|
static widget(e, t, r) {
|
|
7658
|
-
return new Me(e, e, new
|
|
7661
|
+
return new Me(e, e, new Br(t, r));
|
|
7659
7662
|
}
|
|
7660
7663
|
/**
|
|
7661
7664
|
Creates an inline decoration, which adds the given attributes to
|
|
@@ -7689,7 +7692,7 @@ class Me {
|
|
|
7689
7692
|
@internal
|
|
7690
7693
|
*/
|
|
7691
7694
|
get widget() {
|
|
7692
|
-
return this.type instanceof
|
|
7695
|
+
return this.type instanceof Br;
|
|
7693
7696
|
}
|
|
7694
7697
|
}
|
|
7695
7698
|
const Yt = [], It = {};
|
|
@@ -7706,7 +7709,7 @@ class K {
|
|
|
7706
7709
|
you must make a copy if you want need to preserve that.
|
|
7707
7710
|
*/
|
|
7708
7711
|
static create(e, t) {
|
|
7709
|
-
return t.length ?
|
|
7712
|
+
return t.length ? Lr(t, e, 0, It) : re;
|
|
7710
7713
|
}
|
|
7711
7714
|
/**
|
|
7712
7715
|
Find all decorations in this set which touch the given range
|
|
@@ -7765,10 +7768,10 @@ class K {
|
|
|
7765
7768
|
if (u = Ea(t, l, c)) {
|
|
7766
7769
|
for (i || (i = this.children.slice()); s < i.length && i[s] < a; )
|
|
7767
7770
|
s += 3;
|
|
7768
|
-
i[s] == a ? i[s + 2] = i[s + 2].addInner(l, u, c + 1) : i.splice(s, 0, a, a + l.nodeSize,
|
|
7771
|
+
i[s] == a ? i[s + 2] = i[s + 2].addInner(l, u, c + 1) : i.splice(s, 0, a, a + l.nodeSize, Lr(u, l, c + 1, It)), s += 3;
|
|
7769
7772
|
}
|
|
7770
7773
|
});
|
|
7771
|
-
let o = Ta(s ?
|
|
7774
|
+
let o = Ta(s ? Na(t) : t, -r);
|
|
7772
7775
|
for (let l = 0; l < o.length; l++)
|
|
7773
7776
|
o[l].type.valid(e, o[l]) || o.splice(l--, 1);
|
|
7774
7777
|
return new K(o.length ? this.local.concat(o).sort(Rt) : this.local, i || this.children);
|
|
@@ -7961,7 +7964,7 @@ function Zd(n, e, t, r, i, s, o) {
|
|
|
7961
7964
|
a = !0;
|
|
7962
7965
|
}
|
|
7963
7966
|
if (a) {
|
|
7964
|
-
let c = Qd(l, n, e, t, i, s, o), u =
|
|
7967
|
+
let c = Qd(l, n, e, t, i, s, o), u = Lr(c, r, 0, o);
|
|
7965
7968
|
e = u.local;
|
|
7966
7969
|
for (let d = 0; d < l.length; d += 3)
|
|
7967
7970
|
l[d + 1] < 0 && (l.splice(d, 3), d -= 3);
|
|
@@ -8005,23 +8008,23 @@ function Ea(n, e, t) {
|
|
|
8005
8008
|
(o = n[s]) && o.from > t && o.to < r && ((i || (i = [])).push(o), n[s] = null);
|
|
8006
8009
|
return i;
|
|
8007
8010
|
}
|
|
8008
|
-
function
|
|
8011
|
+
function Na(n) {
|
|
8009
8012
|
let e = [];
|
|
8010
8013
|
for (let t = 0; t < n.length; t++)
|
|
8011
8014
|
n[t] != null && e.push(n[t]);
|
|
8012
8015
|
return e;
|
|
8013
8016
|
}
|
|
8014
|
-
function
|
|
8017
|
+
function Lr(n, e, t, r) {
|
|
8015
8018
|
let i = [], s = !1;
|
|
8016
8019
|
e.forEach((l, a) => {
|
|
8017
8020
|
let c = Ea(n, l, a + t);
|
|
8018
8021
|
if (c) {
|
|
8019
8022
|
s = !0;
|
|
8020
|
-
let u =
|
|
8023
|
+
let u = Lr(c, l, t + a + 1, r);
|
|
8021
8024
|
u != re && i.push(a, a + l.nodeSize, u);
|
|
8022
8025
|
}
|
|
8023
8026
|
});
|
|
8024
|
-
let o = Ta(s ?
|
|
8027
|
+
let o = Ta(s ? Na(n) : n, -t).sort(Rt);
|
|
8025
8028
|
for (let l = 0; l < o.length; l++)
|
|
8026
8029
|
o[l].type.valid(e, o[l]) || (r.onRemove && r.onRemove(o[l].spec), o.splice(l--, 1));
|
|
8027
8030
|
return o.length || i.length ? new K(o, i) : re;
|
|
@@ -8052,7 +8055,7 @@ function Oo(n, e, t) {
|
|
|
8052
8055
|
e++;
|
|
8053
8056
|
n.splice(e, 0, t);
|
|
8054
8057
|
}
|
|
8055
|
-
function
|
|
8058
|
+
function gi(n) {
|
|
8056
8059
|
let e = [];
|
|
8057
8060
|
return n.someProp("decorations", (t) => {
|
|
8058
8061
|
let r = t(n.state);
|
|
@@ -8142,9 +8145,9 @@ class rf {
|
|
|
8142
8145
|
if (!e.focusNode)
|
|
8143
8146
|
return !0;
|
|
8144
8147
|
let t = /* @__PURE__ */ new Set(), r;
|
|
8145
|
-
for (let s = e.focusNode; s; s =
|
|
8148
|
+
for (let s = e.focusNode; s; s = Vn(s))
|
|
8146
8149
|
t.add(s);
|
|
8147
|
-
for (let s = e.anchorNode; s; s =
|
|
8150
|
+
for (let s = e.anchorNode; s; s = Vn(s))
|
|
8148
8151
|
if (t.has(s)) {
|
|
8149
8152
|
r = s;
|
|
8150
8153
|
break;
|
|
@@ -8174,7 +8177,7 @@ class rf {
|
|
|
8174
8177
|
let d = this.registerMutation(t[u], a);
|
|
8175
8178
|
d && (s = s < 0 ? d.from : Math.min(d.from, s), o = o < 0 ? d.to : Math.max(d.to, o), d.typeOver && (l = !0));
|
|
8176
8179
|
}
|
|
8177
|
-
if (
|
|
8180
|
+
if (Re && a.length) {
|
|
8178
8181
|
let u = a.filter((d) => d.nodeName == "BR");
|
|
8179
8182
|
if (u.length == 2) {
|
|
8180
8183
|
let [d, f] = u;
|
|
@@ -8188,7 +8191,7 @@ class rf {
|
|
|
8188
8191
|
}
|
|
8189
8192
|
}
|
|
8190
8193
|
let c = null;
|
|
8191
|
-
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 &&
|
|
8194
|
+
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Jr(r) && (c = cs(e)) && c.eq(R.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Qe(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), sf(e)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || Qe(e), this.currentSelection.set(r));
|
|
8192
8195
|
}
|
|
8193
8196
|
registerMutation(e, t) {
|
|
8194
8197
|
if (t.indexOf(e.target) > -1)
|
|
@@ -8226,12 +8229,12 @@ class rf {
|
|
|
8226
8229
|
let To = /* @__PURE__ */ new WeakMap(), Eo = !1;
|
|
8227
8230
|
function sf(n) {
|
|
8228
8231
|
if (!To.has(n) && (To.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
|
|
8229
|
-
if (n.requiresGeckoHackNode =
|
|
8232
|
+
if (n.requiresGeckoHackNode = Re, Eo)
|
|
8230
8233
|
return;
|
|
8231
8234
|
console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), Eo = !0;
|
|
8232
8235
|
}
|
|
8233
8236
|
}
|
|
8234
|
-
function
|
|
8237
|
+
function No(n, e) {
|
|
8235
8238
|
let t = e.startContainer, r = e.startOffset, i = e.endContainer, s = e.endOffset, o = n.domAtPos(n.state.selection.anchor);
|
|
8236
8239
|
return zt(o.node, o.offset, i, s) && ([t, r, i, s] = [i, s, t, r]), { anchorNode: t, anchorOffset: r, focusNode: i, focusOffset: s };
|
|
8237
8240
|
}
|
|
@@ -8239,13 +8242,13 @@ function of(n, e) {
|
|
|
8239
8242
|
if (e.getComposedRanges) {
|
|
8240
8243
|
let i = e.getComposedRanges(n.root)[0];
|
|
8241
8244
|
if (i)
|
|
8242
|
-
return
|
|
8245
|
+
return No(n, i);
|
|
8243
8246
|
}
|
|
8244
8247
|
let t;
|
|
8245
8248
|
function r(i) {
|
|
8246
8249
|
i.preventDefault(), i.stopImmediatePropagation(), t = i.getTargetRanges()[0];
|
|
8247
8250
|
}
|
|
8248
|
-
return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ?
|
|
8251
|
+
return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? No(n, t) : null;
|
|
8249
8252
|
}
|
|
8250
8253
|
function lf(n, e) {
|
|
8251
8254
|
for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
|
|
@@ -8257,7 +8260,7 @@ function lf(n, e) {
|
|
|
8257
8260
|
}
|
|
8258
8261
|
function af(n, e, t) {
|
|
8259
8262
|
let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, u = a.anchorNode;
|
|
8260
|
-
if (u && n.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: a.anchorOffset }],
|
|
8263
|
+
if (u && n.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: a.anchorOffset }], Jr(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), ie && n.input.lastKeyCode === 8)
|
|
8261
8264
|
for (let g = s; g > i; g--) {
|
|
8262
8265
|
let b = r.childNodes[g - 1], w = b.pmViewDesc;
|
|
8263
8266
|
if (b.nodeName == "BR" && !w) {
|
|
@@ -8304,7 +8307,7 @@ function df(n, e, t, r, i) {
|
|
|
8304
8307
|
if (n.input.compositionPendingChanges = 0, e < 0) {
|
|
8305
8308
|
let E = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, z = cs(n, E);
|
|
8306
8309
|
if (z && !n.state.selection.eq(z)) {
|
|
8307
|
-
if (ie &&
|
|
8310
|
+
if (ie && Xe && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (H) => H(n, Ot(13, "Enter"))))
|
|
8308
8311
|
return;
|
|
8309
8312
|
let $ = n.state.tr.setSelection(z);
|
|
8310
8313
|
E == "pointer" ? $.setMeta("pointer", !0) : E == "key" && $.scrollIntoView(), s && $.setMeta("composition", s), n.dispatch($);
|
|
@@ -8316,7 +8319,7 @@ function df(n, e, t, r, i) {
|
|
|
8316
8319
|
let a = n.state.selection, c = af(n, e, t), u = n.state.doc, d = u.slice(c.from, c.to), f, p;
|
|
8317
8320
|
n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (f = n.state.selection.to, p = "end") : (f = n.state.selection.from, p = "start"), n.input.lastKeyCode = null;
|
|
8318
8321
|
let h = hf(d.content, c.doc.content, c.from, f, p);
|
|
8319
|
-
if (h && n.input.domChangeCount++, (ln && n.input.lastIOSEnter > Date.now() - 225 ||
|
|
8322
|
+
if (h && n.input.domChangeCount++, (ln && n.input.lastIOSEnter > Date.now() - 225 || Xe) && i.some((E) => E.nodeType == 1 && !uf.test(E.nodeName)) && (!h || h.endA >= h.endB) && n.someProp("handleKeyDown", (E) => E(n, Ot(13, "Enter")))) {
|
|
8320
8323
|
n.input.lastIOSEnter = 0;
|
|
8321
8324
|
return;
|
|
8322
8325
|
}
|
|
@@ -8325,7 +8328,7 @@ function df(n, e, t, r, i) {
|
|
|
8325
8328
|
h = { start: a.from, endA: a.to, endB: a.to };
|
|
8326
8329
|
else {
|
|
8327
8330
|
if (c.sel) {
|
|
8328
|
-
let E =
|
|
8331
|
+
let E = Ao(n, n.state.doc, c.sel);
|
|
8329
8332
|
if (E && !E.eq(n.state.selection)) {
|
|
8330
8333
|
let z = n.state.tr.setSelection(E);
|
|
8331
8334
|
s && z.setMeta("composition", s), n.dispatch(z);
|
|
@@ -8340,10 +8343,10 @@ function df(n, e, t, r, i) {
|
|
|
8340
8343
|
return;
|
|
8341
8344
|
}
|
|
8342
8345
|
if (n.state.selection.anchor > h.start && pf(u, h.start, h.endA, m, g) && n.someProp("handleKeyDown", (E) => E(n, Ot(8, "Backspace")))) {
|
|
8343
|
-
|
|
8346
|
+
Xe && ie && n.domObserver.suppressSelectionUpdates();
|
|
8344
8347
|
return;
|
|
8345
8348
|
}
|
|
8346
|
-
ie &&
|
|
8349
|
+
ie && h.endB == h.start && (n.input.lastChromeDelete = Date.now()), Xe && !w && m.start() != g.start() && g.parentOffset == 0 && m.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == h.endA && (h.endB -= 2, g = c.doc.resolveNoCache(h.endB - c.from), setTimeout(() => {
|
|
8347
8350
|
n.someProp("handleKeyDown", function(E) {
|
|
8348
8351
|
return E(n, Ot(13, "Enter"));
|
|
8349
8352
|
});
|
|
@@ -8365,12 +8368,12 @@ function df(n, e, t, r, i) {
|
|
|
8365
8368
|
}
|
|
8366
8369
|
}
|
|
8367
8370
|
if (k || (k = n.state.tr.replace(y, O, c.doc.slice(h.start - c.from, h.endB - c.from))), c.sel) {
|
|
8368
|
-
let E =
|
|
8369
|
-
E && !(ie &&
|
|
8371
|
+
let E = Ao(n, k.doc, c.sel);
|
|
8372
|
+
E && !(ie && n.composing && E.empty && (h.start != h.endB || n.input.lastChromeDelete < Date.now() - 100) && (E.head == y || E.head == k.mapping.map(O) - 1) || fe && E.empty && E.head == y) && k.setSelection(E);
|
|
8370
8373
|
}
|
|
8371
8374
|
I && k.ensureMarks(I), s && k.setMeta("composition", s), n.dispatch(k.scrollIntoView());
|
|
8372
8375
|
}
|
|
8373
|
-
function
|
|
8376
|
+
function Ao(n, e, t) {
|
|
8374
8377
|
return Math.max(t.anchor, t.head) > e.content.size ? null : us(n, e.resolve(t.anchor), e.resolve(t.head));
|
|
8375
8378
|
}
|
|
8376
8379
|
function ff(n, e) {
|
|
@@ -8395,7 +8398,7 @@ function pf(n, e, t, r, i) {
|
|
|
8395
8398
|
if (
|
|
8396
8399
|
// The content must have shrunk
|
|
8397
8400
|
t - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
|
|
8398
|
-
|
|
8401
|
+
yi(r, !0, !1) < i.pos
|
|
8399
8402
|
)
|
|
8400
8403
|
return !1;
|
|
8401
8404
|
let s = n.resolve(e);
|
|
@@ -8405,10 +8408,10 @@ function pf(n, e, t, r, i) {
|
|
|
8405
8408
|
}
|
|
8406
8409
|
if (s.parentOffset < s.parent.content.size || !s.parent.isTextblock)
|
|
8407
8410
|
return !1;
|
|
8408
|
-
let o = n.resolve(
|
|
8409
|
-
return !o.parent.isTextblock || o.pos > t ||
|
|
8411
|
+
let o = n.resolve(yi(s, !0, !0));
|
|
8412
|
+
return !o.parent.isTextblock || o.pos > t || yi(o, !0, !1) < t ? !1 : r.parent.content.cut(r.parentOffset).eq(o.parent.content);
|
|
8410
8413
|
}
|
|
8411
|
-
function
|
|
8414
|
+
function yi(n, e, t) {
|
|
8412
8415
|
let r = n.depth, i = e ? n.end() : n.pos;
|
|
8413
8416
|
for (; r > 0 && (e || n.indexAfter(r) == n.node(r).childCount); )
|
|
8414
8417
|
r--, i++, e = !1;
|
|
@@ -8452,7 +8455,7 @@ class mf {
|
|
|
8452
8455
|
added to the document.
|
|
8453
8456
|
*/
|
|
8454
8457
|
constructor(e, t) {
|
|
8455
|
-
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Rd(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Lo), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Po(this), Ro(this), this.nodeViews = Bo(this), this.docView = fo(this.state.doc, Io(this),
|
|
8458
|
+
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Rd(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Lo), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Po(this), Ro(this), this.nodeViews = Bo(this), this.docView = fo(this.state.doc, Io(this), gi(this), this.dom, this), this.domObserver = new rf(this, (r, i, s, o) => df(this, r, i, s, o)), this.domObserver.start(), Pd(this), this.updatePluginViews();
|
|
8456
8459
|
}
|
|
8457
8460
|
/**
|
|
8458
8461
|
Holds `true` when a
|
|
@@ -8515,7 +8518,7 @@ class mf {
|
|
|
8515
8518
|
yf(p, this.nodeViews) && (this.nodeViews = p, s = !0);
|
|
8516
8519
|
}
|
|
8517
8520
|
(l || t.handleDOMEvents != this._props.handleDOMEvents) && Ki(this), this.editable = Po(this), Ro(this);
|
|
8518
|
-
let a =
|
|
8521
|
+
let a = gi(this), c = Io(this), u = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", d = s || !this.docView.matchesNode(e.doc, c, a);
|
|
8519
8522
|
(d || !e.selection.eq(i.selection)) && (o = !0);
|
|
8520
8523
|
let f = u == "preserve" && o && this.dom.style.overflowAnchor == null && Uu(this);
|
|
8521
8524
|
if (o) {
|
|
@@ -8534,7 +8537,7 @@ class mf {
|
|
|
8534
8537
|
*/
|
|
8535
8538
|
scrollToSelection() {
|
|
8536
8539
|
let e = this.domSelectionRange().focusNode;
|
|
8537
|
-
if (!this.someProp("handleScrollToSelection", (t) => t(this))) if (this.state.selection instanceof
|
|
8540
|
+
if (!this.someProp("handleScrollToSelection", (t) => t(this))) if (this.state.selection instanceof N) {
|
|
8538
8541
|
let t = this.docView.domAfterPos(this.state.selection.from);
|
|
8539
8542
|
t.nodeType == 1 && so(this, t.getBoundingClientRect(), e);
|
|
8540
8543
|
} else
|
|
@@ -8570,7 +8573,7 @@ class mf {
|
|
|
8570
8573
|
let s = r.from + (this.state.doc.content.size - t.doc.content.size);
|
|
8571
8574
|
(s > 0 && this.state.doc.nodeAt(s)) == r.node && (i = s);
|
|
8572
8575
|
}
|
|
8573
|
-
this.dragging = new Ca(e.slice, e.move, i < 0 ? void 0 :
|
|
8576
|
+
this.dragging = new Ca(e.slice, e.move, i < 0 ? void 0 : N.create(this.state.doc, i));
|
|
8574
8577
|
}
|
|
8575
8578
|
someProp(e, t) {
|
|
8576
8579
|
let r = this._props && this._props[e], i;
|
|
@@ -8719,20 +8722,20 @@ class mf {
|
|
|
8719
8722
|
[`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
|
|
8720
8723
|
*/
|
|
8721
8724
|
pasteHTML(e, t) {
|
|
8722
|
-
return
|
|
8725
|
+
return $n(this, "", e, !1, t || new ClipboardEvent("paste"));
|
|
8723
8726
|
}
|
|
8724
8727
|
/**
|
|
8725
8728
|
Run the editor's paste logic with the given plain-text input.
|
|
8726
8729
|
*/
|
|
8727
8730
|
pasteText(e, t) {
|
|
8728
|
-
return
|
|
8731
|
+
return $n(this, e, null, !0, t || new ClipboardEvent("paste"));
|
|
8729
8732
|
}
|
|
8730
8733
|
/**
|
|
8731
8734
|
Removes the editor from the DOM and destroys all [node
|
|
8732
8735
|
views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
8733
8736
|
*/
|
|
8734
8737
|
destroy() {
|
|
8735
|
-
this.docView && (Bd(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [],
|
|
8738
|
+
this.docView && (Bd(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], gi(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, zu());
|
|
8736
8739
|
}
|
|
8737
8740
|
/**
|
|
8738
8741
|
This is true when the view has been
|
|
@@ -8873,7 +8876,7 @@ var mt = {
|
|
|
8873
8876
|
220: "\\",
|
|
8874
8877
|
221: "]",
|
|
8875
8878
|
222: "'"
|
|
8876
|
-
},
|
|
8879
|
+
}, zr = {
|
|
8877
8880
|
48: ")",
|
|
8878
8881
|
49: "!",
|
|
8879
8882
|
50: "@",
|
|
@@ -8902,10 +8905,10 @@ var mt = {
|
|
|
8902
8905
|
for (var Q = 0; Q < 10; Q++) mt[48 + Q] = mt[96 + Q] = String(Q);
|
|
8903
8906
|
for (var Q = 1; Q <= 24; Q++) mt[Q + 111] = "F" + Q;
|
|
8904
8907
|
for (var Q = 65; Q <= 90; Q++)
|
|
8905
|
-
mt[Q] = String.fromCharCode(Q + 32),
|
|
8906
|
-
for (var
|
|
8908
|
+
mt[Q] = String.fromCharCode(Q + 32), zr[Q] = String.fromCharCode(Q);
|
|
8909
|
+
for (var bi in mt) zr.hasOwnProperty(bi) || (zr[bi] = mt[bi]);
|
|
8907
8910
|
function kf(n) {
|
|
8908
|
-
var e = bf && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || vf && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ?
|
|
8911
|
+
var e = bf && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || vf && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? zr : mt)[n.keyCode] || n.key || "Unidentified";
|
|
8909
8912
|
return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
|
|
8910
8913
|
}
|
|
8911
8914
|
const xf = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
|
|
@@ -8936,26 +8939,26 @@ function Sf(n) {
|
|
|
8936
8939
|
e[wf(t)] = n[t];
|
|
8937
8940
|
return e;
|
|
8938
8941
|
}
|
|
8939
|
-
function
|
|
8942
|
+
function vi(n, e, t = !0) {
|
|
8940
8943
|
return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
|
|
8941
8944
|
}
|
|
8942
8945
|
function Mf(n) {
|
|
8943
|
-
return new oe({ props: { handleKeyDown:
|
|
8946
|
+
return new oe({ props: { handleKeyDown: Aa(n) } });
|
|
8944
8947
|
}
|
|
8945
|
-
function
|
|
8948
|
+
function Aa(n) {
|
|
8946
8949
|
let e = Sf(n);
|
|
8947
8950
|
return function(t, r) {
|
|
8948
|
-
let i = kf(r), s, o = e[
|
|
8951
|
+
let i = kf(r), s, o = e[vi(i, r)];
|
|
8949
8952
|
if (o && o(t.state, t.dispatch, t))
|
|
8950
8953
|
return !0;
|
|
8951
8954
|
if (i.length == 1 && i != " ") {
|
|
8952
8955
|
if (r.shiftKey) {
|
|
8953
|
-
let l = e[
|
|
8956
|
+
let l = e[vi(i, r, !1)];
|
|
8954
8957
|
if (l && l(t.state, t.dispatch, t))
|
|
8955
8958
|
return !0;
|
|
8956
8959
|
}
|
|
8957
8960
|
if ((r.shiftKey || r.altKey || r.metaKey || i.charCodeAt(0) > 127) && (s = mt[r.keyCode]) && s != i) {
|
|
8958
|
-
let l = e[
|
|
8961
|
+
let l = e[vi(s, r)];
|
|
8959
8962
|
if (l && l(t.state, t.dispatch, t))
|
|
8960
8963
|
return !0;
|
|
8961
8964
|
}
|
|
@@ -8980,13 +8983,13 @@ const Of = (n, e, t) => {
|
|
|
8980
8983
|
let s = i.nodeBefore;
|
|
8981
8984
|
if (Ba(n, i, e, -1))
|
|
8982
8985
|
return !0;
|
|
8983
|
-
if (r.parent.content.size == 0 && (an(s, "end") ||
|
|
8986
|
+
if (r.parent.content.size == 0 && (an(s, "end") || N.isSelectable(s)))
|
|
8984
8987
|
for (let o = r.depth; ; o--) {
|
|
8985
|
-
let l =
|
|
8988
|
+
let l = Kr(n.doc, r.before(o), r.after(o), S.empty);
|
|
8986
8989
|
if (l && l.slice.size < l.to - l.from) {
|
|
8987
8990
|
if (e) {
|
|
8988
8991
|
let a = n.tr.step(l);
|
|
8989
|
-
a.setSelection(an(s, "end") ? R.findFrom(a.doc.resolve(a.mapping.map(i.pos, -1)), -1) :
|
|
8992
|
+
a.setSelection(an(s, "end") ? R.findFrom(a.doc.resolve(a.mapping.map(i.pos, -1)), -1) : N.create(a.doc, i.pos - s.nodeSize)), e(a.scrollIntoView());
|
|
8990
8993
|
}
|
|
8991
8994
|
return !0;
|
|
8992
8995
|
}
|
|
@@ -9026,7 +9029,7 @@ function Ia(n, e, t) {
|
|
|
9026
9029
|
return !1;
|
|
9027
9030
|
l = u;
|
|
9028
9031
|
}
|
|
9029
|
-
let c =
|
|
9032
|
+
let c = Kr(n.doc, s, a, S.empty);
|
|
9030
9033
|
if (!c || c.from != s || c instanceof _ && c.slice.size >= a - s)
|
|
9031
9034
|
return !1;
|
|
9032
9035
|
if (t) {
|
|
@@ -9044,7 +9047,7 @@ function an(n, e, t = !1) {
|
|
|
9044
9047
|
}
|
|
9045
9048
|
return !1;
|
|
9046
9049
|
}
|
|
9047
|
-
const
|
|
9050
|
+
const Nf = (n, e, t) => {
|
|
9048
9051
|
let { $head: r, empty: i } = n.selection, s = r;
|
|
9049
9052
|
if (!i)
|
|
9050
9053
|
return !1;
|
|
@@ -9054,7 +9057,7 @@ const Af = (n, e, t) => {
|
|
|
9054
9057
|
s = gs(r);
|
|
9055
9058
|
}
|
|
9056
9059
|
let o = s && s.nodeBefore;
|
|
9057
|
-
return !o || !
|
|
9060
|
+
return !o || !N.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(N.create(n.doc, s.pos - o.nodeSize)).scrollIntoView()), !0);
|
|
9058
9061
|
};
|
|
9059
9062
|
function gs(n) {
|
|
9060
9063
|
if (!n.parent.type.spec.isolating)
|
|
@@ -9070,7 +9073,7 @@ function Ra(n, e) {
|
|
|
9070
9073
|
let { $cursor: t } = n.selection;
|
|
9071
9074
|
return !t || (e ? !e.endOfTextblock("forward", n) : t.parentOffset < t.parent.content.size) ? null : t;
|
|
9072
9075
|
}
|
|
9073
|
-
const
|
|
9076
|
+
const Af = (n, e, t) => {
|
|
9074
9077
|
let r = Ra(n, t);
|
|
9075
9078
|
if (!r)
|
|
9076
9079
|
return !1;
|
|
@@ -9080,12 +9083,12 @@ const Nf = (n, e, t) => {
|
|
|
9080
9083
|
let s = i.nodeAfter;
|
|
9081
9084
|
if (Ba(n, i, e, 1))
|
|
9082
9085
|
return !0;
|
|
9083
|
-
if (r.parent.content.size == 0 && (an(s, "start") ||
|
|
9084
|
-
let o =
|
|
9086
|
+
if (r.parent.content.size == 0 && (an(s, "start") || N.isSelectable(s))) {
|
|
9087
|
+
let o = Kr(n.doc, r.before(), r.after(), S.empty);
|
|
9085
9088
|
if (o && o.slice.size < o.to - o.from) {
|
|
9086
9089
|
if (e) {
|
|
9087
9090
|
let l = n.tr.step(o);
|
|
9088
|
-
l.setSelection(an(s, "start") ? R.findFrom(l.doc.resolve(l.mapping.map(i.pos)), 1) :
|
|
9091
|
+
l.setSelection(an(s, "start") ? R.findFrom(l.doc.resolve(l.mapping.map(i.pos)), 1) : N.create(l.doc, l.mapping.map(i.pos))), e(l.scrollIntoView());
|
|
9089
9092
|
}
|
|
9090
9093
|
return !0;
|
|
9091
9094
|
}
|
|
@@ -9101,7 +9104,7 @@ const Nf = (n, e, t) => {
|
|
|
9101
9104
|
s = ys(r);
|
|
9102
9105
|
}
|
|
9103
9106
|
let o = s && s.nodeAfter;
|
|
9104
|
-
return !o || !
|
|
9107
|
+
return !o || !N.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(N.create(n.doc, s.pos)).scrollIntoView()), !0);
|
|
9105
9108
|
};
|
|
9106
9109
|
function ys(n) {
|
|
9107
9110
|
if (!n.parent.type.spec.isolating)
|
|
@@ -9115,25 +9118,25 @@ function ys(n) {
|
|
|
9115
9118
|
return null;
|
|
9116
9119
|
}
|
|
9117
9120
|
const If = (n, e) => {
|
|
9118
|
-
let t = n.selection, r = t instanceof
|
|
9121
|
+
let t = n.selection, r = t instanceof N, i;
|
|
9119
9122
|
if (r) {
|
|
9120
9123
|
if (t.node.isTextblock || !yt(n.doc, t.from))
|
|
9121
9124
|
return !1;
|
|
9122
9125
|
i = t.from;
|
|
9123
|
-
} else if (i =
|
|
9126
|
+
} else if (i = qr(n.doc, t.from, -1), i == null)
|
|
9124
9127
|
return !1;
|
|
9125
9128
|
if (e) {
|
|
9126
9129
|
let s = n.tr.join(i);
|
|
9127
|
-
r && s.setSelection(
|
|
9130
|
+
r && s.setSelection(N.create(s.doc, i - n.doc.resolve(i).nodeBefore.nodeSize)), e(s.scrollIntoView());
|
|
9128
9131
|
}
|
|
9129
9132
|
return !0;
|
|
9130
9133
|
}, Rf = (n, e) => {
|
|
9131
9134
|
let t = n.selection, r;
|
|
9132
|
-
if (t instanceof
|
|
9135
|
+
if (t instanceof N) {
|
|
9133
9136
|
if (t.node.isTextblock || !yt(n.doc, t.to))
|
|
9134
9137
|
return !1;
|
|
9135
9138
|
r = t.to;
|
|
9136
|
-
} else if (r =
|
|
9139
|
+
} else if (r = qr(n.doc, t.to, 1), r == null)
|
|
9137
9140
|
return !1;
|
|
9138
9141
|
return e && e(n.tr.join(r).scrollIntoView()), !0;
|
|
9139
9142
|
}, Pf = (n, e) => {
|
|
@@ -9166,7 +9169,7 @@ const Lf = (n, e) => {
|
|
|
9166
9169
|
return !0;
|
|
9167
9170
|
}, zf = (n, e) => {
|
|
9168
9171
|
let t = n.selection, { $from: r, $to: i } = t;
|
|
9169
|
-
if (t instanceof
|
|
9172
|
+
if (t instanceof Ie || r.parent.inlineContent || i.parent.inlineContent)
|
|
9170
9173
|
return !1;
|
|
9171
9174
|
let s = Pa(i.parent.contentMatchAt(i.indexAfter()));
|
|
9172
9175
|
if (!s || !s.isTextblock)
|
|
@@ -9189,7 +9192,7 @@ const Lf = (n, e) => {
|
|
|
9189
9192
|
return i == null ? !1 : (e && e(n.tr.lift(r, i).scrollIntoView()), !0);
|
|
9190
9193
|
}, Ff = (n, e) => {
|
|
9191
9194
|
let { $from: t, to: r } = n.selection, i, s = t.sharedDepth(r);
|
|
9192
|
-
return s == 0 ? !1 : (i = t.before(s), e && e(n.tr.setSelection(
|
|
9195
|
+
return s == 0 ? !1 : (i = t.before(s), e && e(n.tr.setSelection(N.create(n.doc, i))), !0);
|
|
9193
9196
|
};
|
|
9194
9197
|
function $f(n, e, t) {
|
|
9195
9198
|
let r = e.nodeBefore, i = e.nodeAfter, s = e.index();
|
|
@@ -9363,7 +9366,7 @@ function Yf(n) {
|
|
|
9363
9366
|
return !0;
|
|
9364
9367
|
};
|
|
9365
9368
|
}
|
|
9366
|
-
function
|
|
9369
|
+
function Yr(n) {
|
|
9367
9370
|
const { state: e, transaction: t } = n;
|
|
9368
9371
|
let { selection: r } = t, { doc: i } = t, { storedMarks: s } = t;
|
|
9369
9372
|
return {
|
|
@@ -9388,7 +9391,7 @@ function Xr(n) {
|
|
|
9388
9391
|
}
|
|
9389
9392
|
};
|
|
9390
9393
|
}
|
|
9391
|
-
class
|
|
9394
|
+
class Xr {
|
|
9392
9395
|
constructor(e) {
|
|
9393
9396
|
this.editor = e.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = e.state;
|
|
9394
9397
|
}
|
|
@@ -9433,7 +9436,7 @@ class Zr {
|
|
|
9433
9436
|
tr: e,
|
|
9434
9437
|
editor: i,
|
|
9435
9438
|
view: o,
|
|
9436
|
-
state:
|
|
9439
|
+
state: Yr({
|
|
9437
9440
|
state: s,
|
|
9438
9441
|
transaction: e
|
|
9439
9442
|
}),
|
|
@@ -9479,7 +9482,7 @@ function C(n, e, t) {
|
|
|
9479
9482
|
parent: n.parent ? C(n.parent, e, t) : null
|
|
9480
9483
|
}) : n.config[e];
|
|
9481
9484
|
}
|
|
9482
|
-
function
|
|
9485
|
+
function Zr(n) {
|
|
9483
9486
|
const e = n.filter((i) => i.type === "extension"), t = n.filter((i) => i.type === "node"), r = n.filter((i) => i.type === "mark");
|
|
9484
9487
|
return {
|
|
9485
9488
|
baseExtensions: e,
|
|
@@ -9488,7 +9491,7 @@ function Qr(n) {
|
|
|
9488
9491
|
};
|
|
9489
9492
|
}
|
|
9490
9493
|
function za(n) {
|
|
9491
|
-
const e = [], { nodeExtensions: t, markExtensions: r } =
|
|
9494
|
+
const e = [], { nodeExtensions: t, markExtensions: r } = Zr(n), i = [...t, ...r], s = {
|
|
9492
9495
|
default: null,
|
|
9493
9496
|
rendered: !0,
|
|
9494
9497
|
renderHTML: null,
|
|
@@ -9617,7 +9620,7 @@ function Fo(n) {
|
|
|
9617
9620
|
}
|
|
9618
9621
|
function ep(n, e) {
|
|
9619
9622
|
var t;
|
|
9620
|
-
const r = za(n), { nodeExtensions: i, markExtensions: s } =
|
|
9623
|
+
const r = za(n), { nodeExtensions: i, markExtensions: s } = Zr(n), o = (t = i.find((c) => C(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
|
|
9621
9624
|
const u = r.filter((b) => b.type === c.name), d = {
|
|
9622
9625
|
name: c.name,
|
|
9623
9626
|
options: c.options,
|
|
@@ -9693,7 +9696,7 @@ function ep(n, e) {
|
|
|
9693
9696
|
marks: a
|
|
9694
9697
|
});
|
|
9695
9698
|
}
|
|
9696
|
-
function
|
|
9699
|
+
function ki(n, e) {
|
|
9697
9700
|
return e.nodes[n] || e.marks[n] || null;
|
|
9698
9701
|
}
|
|
9699
9702
|
function $o(n, e) {
|
|
@@ -9720,7 +9723,7 @@ const tp = (n, e = 500) => {
|
|
|
9720
9723
|
function vs(n) {
|
|
9721
9724
|
return Object.prototype.toString.call(n) === "[object RegExp]";
|
|
9722
9725
|
}
|
|
9723
|
-
class
|
|
9726
|
+
class Qr {
|
|
9724
9727
|
constructor(e) {
|
|
9725
9728
|
this.find = e.find, this.handler = e.handler;
|
|
9726
9729
|
}
|
|
@@ -9734,7 +9737,7 @@ const np = (n, e) => {
|
|
|
9734
9737
|
const r = [t.text];
|
|
9735
9738
|
return r.index = t.index, r.input = n, r.data = t.data, t.replaceWith && (t.text.includes(t.replaceWith) || console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'), r.push(t.replaceWith)), r;
|
|
9736
9739
|
};
|
|
9737
|
-
function
|
|
9740
|
+
function gr(n) {
|
|
9738
9741
|
var e;
|
|
9739
9742
|
const { editor: t, from: r, to: i, text: s, rules: o, plugin: l } = n, { view: a } = t;
|
|
9740
9743
|
if (a.composing)
|
|
@@ -9753,13 +9756,13 @@ function mr(n) {
|
|
|
9753
9756
|
const p = np(d, f.find);
|
|
9754
9757
|
if (!p)
|
|
9755
9758
|
return;
|
|
9756
|
-
const h = a.state.tr, m =
|
|
9759
|
+
const h = a.state.tr, m = Yr({
|
|
9757
9760
|
state: a.state,
|
|
9758
9761
|
transaction: h
|
|
9759
9762
|
}), g = {
|
|
9760
9763
|
from: r - (p[0].length - s.length),
|
|
9761
9764
|
to: i
|
|
9762
|
-
}, { commands: b, chain: w, can: M } = new
|
|
9765
|
+
}, { commands: b, chain: w, can: M } = new Xr({
|
|
9763
9766
|
editor: t,
|
|
9764
9767
|
state: m
|
|
9765
9768
|
});
|
|
@@ -9793,7 +9796,7 @@ function rp(n) {
|
|
|
9793
9796
|
let { text: u } = a;
|
|
9794
9797
|
typeof u == "string" ? u = u : u = bs(x.from(u), o.schema);
|
|
9795
9798
|
const { from: d } = a, f = d + u.length;
|
|
9796
|
-
|
|
9799
|
+
gr({
|
|
9797
9800
|
editor: e,
|
|
9798
9801
|
from: d,
|
|
9799
9802
|
to: f,
|
|
@@ -9806,7 +9809,7 @@ function rp(n) {
|
|
|
9806
9809
|
},
|
|
9807
9810
|
props: {
|
|
9808
9811
|
handleTextInput(i, s, o, l) {
|
|
9809
|
-
return
|
|
9812
|
+
return gr({
|
|
9810
9813
|
editor: e,
|
|
9811
9814
|
from: s,
|
|
9812
9815
|
to: o,
|
|
@@ -9818,7 +9821,7 @@ function rp(n) {
|
|
|
9818
9821
|
handleDOMEvents: {
|
|
9819
9822
|
compositionend: (i) => (setTimeout(() => {
|
|
9820
9823
|
const { $cursor: s } = i.state.selection;
|
|
9821
|
-
s &&
|
|
9824
|
+
s && gr({
|
|
9822
9825
|
editor: e,
|
|
9823
9826
|
from: s.pos,
|
|
9824
9827
|
to: s.pos,
|
|
@@ -9834,7 +9837,7 @@ function rp(n) {
|
|
|
9834
9837
|
if (s.key !== "Enter")
|
|
9835
9838
|
return !1;
|
|
9836
9839
|
const { $cursor: o } = i.state.selection;
|
|
9837
|
-
return o ?
|
|
9840
|
+
return o ? gr({
|
|
9838
9841
|
editor: e,
|
|
9839
9842
|
from: o.pos,
|
|
9840
9843
|
to: o.pos,
|
|
@@ -9853,13 +9856,13 @@ function rp(n) {
|
|
|
9853
9856
|
function ip(n) {
|
|
9854
9857
|
return Object.prototype.toString.call(n).slice(8, -1);
|
|
9855
9858
|
}
|
|
9856
|
-
function
|
|
9859
|
+
function yr(n) {
|
|
9857
9860
|
return ip(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
|
|
9858
9861
|
}
|
|
9859
|
-
function
|
|
9862
|
+
function ei(n, e) {
|
|
9860
9863
|
const t = { ...n };
|
|
9861
|
-
return
|
|
9862
|
-
|
|
9864
|
+
return yr(n) && yr(e) && Object.keys(e).forEach((r) => {
|
|
9865
|
+
yr(e[r]) && yr(n[r]) ? t[r] = ei(n[r], e[r]) : t[r] = e[r];
|
|
9863
9866
|
}), t;
|
|
9864
9867
|
}
|
|
9865
9868
|
class gt {
|
|
@@ -9883,7 +9886,7 @@ class gt {
|
|
|
9883
9886
|
configure(e = {}) {
|
|
9884
9887
|
const t = this.extend({
|
|
9885
9888
|
...this.config,
|
|
9886
|
-
addOptions: () =>
|
|
9889
|
+
addOptions: () => ei(this.options, e)
|
|
9887
9890
|
});
|
|
9888
9891
|
return t.name = this.name, t.parent = this.parent, t;
|
|
9889
9892
|
}
|
|
@@ -9926,7 +9929,7 @@ const lp = (n, e, t) => {
|
|
|
9926
9929
|
}) : [];
|
|
9927
9930
|
};
|
|
9928
9931
|
function ap(n) {
|
|
9929
|
-
const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: u } = new
|
|
9932
|
+
const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: u } = new Xr({
|
|
9930
9933
|
editor: e,
|
|
9931
9934
|
state: t
|
|
9932
9935
|
}), d = [];
|
|
@@ -9970,7 +9973,7 @@ function up(n) {
|
|
|
9970
9973
|
l = null;
|
|
9971
9974
|
}
|
|
9972
9975
|
const a = ({ state: u, from: d, to: f, rule: p, pasteEvt: h }) => {
|
|
9973
|
-
const m = u.tr, g =
|
|
9976
|
+
const m = u.tr, g = Yr({
|
|
9974
9977
|
state: u,
|
|
9975
9978
|
transaction: m
|
|
9976
9979
|
});
|
|
@@ -10097,7 +10100,7 @@ class Qt {
|
|
|
10097
10100
|
options: t.options,
|
|
10098
10101
|
storage: t.storage,
|
|
10099
10102
|
editor: this.editor,
|
|
10100
|
-
type:
|
|
10103
|
+
type: ki(t.name, this.schema)
|
|
10101
10104
|
}, i = C(t, "addCommands", r);
|
|
10102
10105
|
return i ? {
|
|
10103
10106
|
...e,
|
|
@@ -10116,7 +10119,7 @@ class Qt {
|
|
|
10116
10119
|
options: o.options,
|
|
10117
10120
|
storage: o.storage,
|
|
10118
10121
|
editor: e,
|
|
10119
|
-
type:
|
|
10122
|
+
type: ki(o.name, this.schema)
|
|
10120
10123
|
}, a = [], c = C(o, "addKeyboardShortcuts", l);
|
|
10121
10124
|
let u = {};
|
|
10122
10125
|
if (o.type === "mark" && C(o, "exitable", l) && (u.ArrowRight = () => gt.handleExit({ editor: e, mark: o })), c) {
|
|
@@ -10160,7 +10163,7 @@ class Qt {
|
|
|
10160
10163
|
* @returns An object with all node views where the key is the node name and the value is the node view function
|
|
10161
10164
|
*/
|
|
10162
10165
|
get nodeViews() {
|
|
10163
|
-
const { editor: e } = this, { nodeExtensions: t } =
|
|
10166
|
+
const { editor: e } = this, { nodeExtensions: t } = Zr(this.extensions);
|
|
10164
10167
|
return Object.fromEntries(t.filter((r) => !!C(r, "addNodeView")).map((r) => {
|
|
10165
10168
|
const i = this.attributes.filter((a) => a.type === r.name), s = {
|
|
10166
10169
|
name: r.name,
|
|
@@ -10202,7 +10205,7 @@ class Qt {
|
|
|
10202
10205
|
options: e.options,
|
|
10203
10206
|
storage: e.storage,
|
|
10204
10207
|
editor: this.editor,
|
|
10205
|
-
type:
|
|
10208
|
+
type: ki(e.name, this.schema)
|
|
10206
10209
|
};
|
|
10207
10210
|
e.type === "mark" && (!((t = P(C(e, "keepOnSplit", r))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
|
|
10208
10211
|
const i = C(e, "onBeforeCreate", r), s = C(e, "onCreate", r), o = C(e, "onUpdate", r), l = C(e, "onSelectionUpdate", r), a = C(e, "onTransaction", r), c = C(e, "onFocus", r), u = C(e, "onBlur", r), d = C(e, "onDestroy", r);
|
|
@@ -10231,7 +10234,7 @@ class ee {
|
|
|
10231
10234
|
configure(e = {}) {
|
|
10232
10235
|
const t = this.extend({
|
|
10233
10236
|
...this.config,
|
|
10234
|
-
addOptions: () =>
|
|
10237
|
+
addOptions: () => ei(this.options, e)
|
|
10235
10238
|
});
|
|
10236
10239
|
return t.name = this.name, t.parent = this.parent, t;
|
|
10237
10240
|
}
|
|
@@ -10278,7 +10281,7 @@ const fp = ee.create({
|
|
|
10278
10281
|
addProseMirrorPlugins() {
|
|
10279
10282
|
return [
|
|
10280
10283
|
new oe({
|
|
10281
|
-
key: new
|
|
10284
|
+
key: new Ne("clipboardTextSerializer"),
|
|
10282
10285
|
props: {
|
|
10283
10286
|
clipboardTextSerializer: () => {
|
|
10284
10287
|
const { editor: n } = this, { state: e, schema: t } = n, { doc: r, selection: i } = e, { ranges: s } = i, o = Math.min(...s.map((u) => u.$from.pos)), l = Math.max(...s.map((u) => u.$to.pos)), a = $a(t);
|
|
@@ -10345,12 +10348,12 @@ const fp = ee.create({
|
|
|
10345
10348
|
const { from: r, to: i } = n;
|
|
10346
10349
|
return t && e.delete(r, i), !0;
|
|
10347
10350
|
}, wp = () => ({ state: n, dispatch: e }) => Cf(n, e), Sp = () => ({ commands: n }) => n.keyboardShortcut("Enter"), Mp = () => ({ state: n, dispatch: e }) => Lf(n, e);
|
|
10348
|
-
function
|
|
10351
|
+
function Vr(n, e, t = { strict: !0 }) {
|
|
10349
10352
|
const r = Object.keys(e);
|
|
10350
10353
|
return r.length ? r.every((i) => t.strict ? e[i] === n[i] : vs(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
|
|
10351
10354
|
}
|
|
10352
10355
|
function Ha(n, e, t = {}) {
|
|
10353
|
-
return n.find((r) => r.type === e &&
|
|
10356
|
+
return n.find((r) => r.type === e && Vr(
|
|
10354
10357
|
// Only check equality for the attributes that are provided
|
|
10355
10358
|
Object.fromEntries(Object.keys(t).map((i) => [i, r.attrs[i]])),
|
|
10356
10359
|
t
|
|
@@ -10444,7 +10447,7 @@ const Tp = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
|
|
|
10444
10447
|
return o(), !0;
|
|
10445
10448
|
const l = ja(i.doc, n) || t.state.selection, a = t.state.selection.eq(l);
|
|
10446
10449
|
return s && (a || i.setSelection(l), a && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
|
|
10447
|
-
}, Ep = (n, e) => (t) => n.every((r, i) => e(r, { ...t, index: i })),
|
|
10450
|
+
}, Ep = (n, e) => (t) => n.every((r, i) => e(r, { ...t, index: i })), Np = (n, e) => ({ tr: t, commands: r }) => r.insertContentAt({ from: t.selection.from, to: t.selection.to }, n, e), Wa = (n) => {
|
|
10448
10451
|
const e = n.childNodes;
|
|
10449
10452
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
10450
10453
|
const r = e[t];
|
|
@@ -10452,11 +10455,11 @@ const Tp = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
|
|
|
10452
10455
|
}
|
|
10453
10456
|
return n;
|
|
10454
10457
|
};
|
|
10455
|
-
function
|
|
10458
|
+
function br(n) {
|
|
10456
10459
|
const e = `<body>${n}</body>`, t = new window.DOMParser().parseFromString(e, "text/html").body;
|
|
10457
10460
|
return Wa(t);
|
|
10458
10461
|
}
|
|
10459
|
-
function
|
|
10462
|
+
function Fr(n, e, t) {
|
|
10460
10463
|
if (n instanceof ut || n instanceof x)
|
|
10461
10464
|
return n;
|
|
10462
10465
|
t = {
|
|
@@ -10474,7 +10477,7 @@ function $r(n, e, t) {
|
|
|
10474
10477
|
} catch (s) {
|
|
10475
10478
|
if (t.errorOnInvalidContent)
|
|
10476
10479
|
throw new Error("[tiptap error]: Invalid JSON content", { cause: s });
|
|
10477
|
-
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", n, "Error:", s),
|
|
10480
|
+
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", n, "Error:", s), Fr("", e, t);
|
|
10478
10481
|
}
|
|
10479
10482
|
if (i) {
|
|
10480
10483
|
if (t.errorOnInvalidContent) {
|
|
@@ -10497,15 +10500,15 @@ function $r(n, e, t) {
|
|
|
10497
10500
|
}
|
|
10498
10501
|
})
|
|
10499
10502
|
});
|
|
10500
|
-
if (t.slice ? dt.fromSchema(a).parseSlice(
|
|
10503
|
+
if (t.slice ? dt.fromSchema(a).parseSlice(br(n), t.parseOptions) : dt.fromSchema(a).parse(br(n), t.parseOptions), t.errorOnInvalidContent && o)
|
|
10501
10504
|
throw new Error("[tiptap error]: Invalid HTML content", { cause: new Error(`Invalid element found: ${l}`) });
|
|
10502
10505
|
}
|
|
10503
10506
|
const s = dt.fromSchema(e);
|
|
10504
|
-
return t.slice ? s.parseSlice(
|
|
10507
|
+
return t.slice ? s.parseSlice(br(n), t.parseOptions).content : s.parse(br(n), t.parseOptions);
|
|
10505
10508
|
}
|
|
10506
|
-
return
|
|
10509
|
+
return Fr("", e, t);
|
|
10507
10510
|
}
|
|
10508
|
-
function
|
|
10511
|
+
function Ap(n, e, t) {
|
|
10509
10512
|
const r = n.steps.length - 1;
|
|
10510
10513
|
if (r < e)
|
|
10511
10514
|
return;
|
|
@@ -10530,7 +10533,7 @@ const Dp = (n) => !("type" in n), Ip = (n, e, t) => ({ tr: r, dispatch: i, edito
|
|
|
10530
10533
|
};
|
|
10531
10534
|
let l;
|
|
10532
10535
|
try {
|
|
10533
|
-
l =
|
|
10536
|
+
l = Fr(e, s.schema, {
|
|
10534
10537
|
parseOptions: {
|
|
10535
10538
|
preserveWhitespace: "full",
|
|
10536
10539
|
...t.parseOptions
|
|
@@ -10566,19 +10569,19 @@ const Dp = (n) => !("type" in n), Ip = (n, e, t) => ({ tr: r, dispatch: i, edito
|
|
|
10566
10569
|
r.insertText(p, a, c);
|
|
10567
10570
|
} else
|
|
10568
10571
|
p = l, r.replaceWith(a, c, p);
|
|
10569
|
-
t.updateSelection &&
|
|
10572
|
+
t.updateSelection && Ap(r, r.steps.length - 1, -1), t.applyInputRules && r.setMeta("applyInputRules", { from: a, text: p }), t.applyPasteRules && r.setMeta("applyPasteRules", { from: a, text: p });
|
|
10570
10573
|
}
|
|
10571
10574
|
return !0;
|
|
10572
|
-
}, Rp = () => ({ state: n, dispatch: e }) => If(n, e), Pp = () => ({ state: n, dispatch: e }) => Rf(n, e), Bp = () => ({ state: n, dispatch: e }) => Of(n, e), Lp = () => ({ state: n, dispatch: e }) =>
|
|
10575
|
+
}, Rp = () => ({ state: n, dispatch: e }) => If(n, e), Pp = () => ({ state: n, dispatch: e }) => Rf(n, e), Bp = () => ({ state: n, dispatch: e }) => Of(n, e), Lp = () => ({ state: n, dispatch: e }) => Af(n, e), zp = () => ({ state: n, dispatch: e, tr: t }) => {
|
|
10573
10576
|
try {
|
|
10574
|
-
const r =
|
|
10577
|
+
const r = qr(n.doc, n.selection.$from.pos, -1);
|
|
10575
10578
|
return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
|
|
10576
10579
|
} catch {
|
|
10577
10580
|
return !1;
|
|
10578
10581
|
}
|
|
10579
10582
|
}, Vp = () => ({ state: n, dispatch: e, tr: t }) => {
|
|
10580
10583
|
try {
|
|
10581
|
-
const r =
|
|
10584
|
+
const r = qr(n.doc, n.selection.$from.pos, 1);
|
|
10582
10585
|
return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
|
|
10583
10586
|
} catch {
|
|
10584
10587
|
return !1;
|
|
@@ -10626,7 +10629,7 @@ const jp = (n) => ({ editor: e, view: t, tr: r, dispatch: i }) => {
|
|
|
10626
10629
|
u && i && r.maybeStep(u);
|
|
10627
10630
|
}), !0;
|
|
10628
10631
|
};
|
|
10629
|
-
function
|
|
10632
|
+
function jn(n, e, t = {}) {
|
|
10630
10633
|
const { from: r, to: i, empty: s } = n.selection, o = e ? G(e, n.schema) : null, l = [];
|
|
10631
10634
|
n.doc.nodesBetween(r, i, (d, f) => {
|
|
10632
10635
|
if (d.isText)
|
|
@@ -10638,17 +10641,17 @@ function Hn(n, e, t = {}) {
|
|
|
10638
10641
|
to: h
|
|
10639
10642
|
});
|
|
10640
10643
|
});
|
|
10641
|
-
const a = i - r, c = l.filter((d) => o ? o.name === d.node.type.name : !0).filter((d) =>
|
|
10644
|
+
const a = i - r, c = l.filter((d) => o ? o.name === d.node.type.name : !0).filter((d) => Vr(d.node.attrs, t, { strict: !1 }));
|
|
10642
10645
|
return s ? !!c.length : c.reduce((d, f) => d + f.to - f.from, 0) >= a;
|
|
10643
10646
|
}
|
|
10644
10647
|
const Wp = (n, e = {}) => ({ state: t, dispatch: r }) => {
|
|
10645
10648
|
const i = G(n, t.schema);
|
|
10646
|
-
return
|
|
10649
|
+
return jn(t, i, e) ? Pf(t, r) : !1;
|
|
10647
10650
|
}, qp = () => ({ state: n, dispatch: e }) => Vf(n, e), Kp = (n) => ({ state: e, dispatch: t }) => {
|
|
10648
10651
|
const r = G(n, e.schema);
|
|
10649
10652
|
return Jf(r)(e, t);
|
|
10650
10653
|
}, _p = () => ({ state: n, dispatch: e }) => Bf(n, e);
|
|
10651
|
-
function
|
|
10654
|
+
function ti(n, e) {
|
|
10652
10655
|
return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
|
|
10653
10656
|
}
|
|
10654
10657
|
function jo(n, e) {
|
|
@@ -10657,7 +10660,7 @@ function jo(n, e) {
|
|
|
10657
10660
|
}
|
|
10658
10661
|
const Jp = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
|
|
10659
10662
|
let s = null, o = null;
|
|
10660
|
-
const l =
|
|
10663
|
+
const l = ti(typeof n == "string" ? n : n.name, r.schema);
|
|
10661
10664
|
return l ? (l === "node" && (s = G(n, r.schema)), l === "mark" && (o = vt(n, r.schema)), i && t.selection.ranges.forEach((a) => {
|
|
10662
10665
|
r.doc.nodesBetween(a.$from.pos, a.$to.pos, (c, u) => {
|
|
10663
10666
|
s && s === c.type && t.setNodeMarkup(u, void 0, jo(c.attrs, e)), o && c.marks.length && c.marks.forEach((d) => {
|
|
@@ -10668,9 +10671,9 @@ const Jp = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
10668
10671
|
}, Up = () => ({ tr: n, dispatch: e }) => (e && n.scrollIntoView(), !0), Gp = () => ({ tr: n, commands: e }) => e.setTextSelection({
|
|
10669
10672
|
from: 0,
|
|
10670
10673
|
to: n.doc.content.size
|
|
10671
|
-
}), Yp = () => ({ state: n, dispatch: e }) =>
|
|
10674
|
+
}), Yp = () => ({ state: n, dispatch: e }) => Nf(n, e), Xp = () => ({ state: n, dispatch: e }) => Df(n, e), Zp = () => ({ state: n, dispatch: e }) => Ff(n, e), Qp = () => ({ state: n, dispatch: e }) => jf(n, e), eh = () => ({ state: n, dispatch: e }) => Hf(n, e);
|
|
10672
10675
|
function Ji(n, e, t = {}, r = {}) {
|
|
10673
|
-
return
|
|
10676
|
+
return Fr(n, e, {
|
|
10674
10677
|
slice: !1,
|
|
10675
10678
|
parseOptions: t,
|
|
10676
10679
|
errorOnInvalidContent: r.errorOnInvalidContent
|
|
@@ -10737,7 +10740,7 @@ function sh(n, e) {
|
|
|
10737
10740
|
return o ? { ...o.attrs } : {};
|
|
10738
10741
|
}
|
|
10739
10742
|
function oh(n, e) {
|
|
10740
|
-
const t =
|
|
10743
|
+
const t = ti(typeof e == "string" ? e : e.name, n.schema);
|
|
10741
10744
|
return t === "node" ? sh(n, e) : t === "mark" ? Ka(n, e) : {};
|
|
10742
10745
|
}
|
|
10743
10746
|
function _a(n, e, t) {
|
|
@@ -10756,7 +10759,7 @@ function _a(n, e, t) {
|
|
|
10756
10759
|
})));
|
|
10757
10760
|
}), r;
|
|
10758
10761
|
}
|
|
10759
|
-
function
|
|
10762
|
+
function Mr(n, e, t) {
|
|
10760
10763
|
return Object.fromEntries(Object.entries(t).filter(([r]) => {
|
|
10761
10764
|
const i = n.find((s) => s.type === e && s.name === r);
|
|
10762
10765
|
return i ? i.attribute.keepOnSplit : !1;
|
|
@@ -10765,7 +10768,7 @@ function Sr(n, e, t) {
|
|
|
10765
10768
|
function Ui(n, e, t = {}) {
|
|
10766
10769
|
const { empty: r, ranges: i } = n.selection, s = e ? vt(e, n.schema) : null;
|
|
10767
10770
|
if (r)
|
|
10768
|
-
return !!(n.storedMarks || n.selection.$from.marks()).filter((d) => s ? s.name === d.type.name : !0).find((d) =>
|
|
10771
|
+
return !!(n.storedMarks || n.selection.$from.marks()).filter((d) => s ? s.name === d.type.name : !0).find((d) => Vr(d.attrs, t, { strict: !1 }));
|
|
10769
10772
|
let o = 0;
|
|
10770
10773
|
const l = [];
|
|
10771
10774
|
if (i.forEach(({ $from: d, $to: f }) => {
|
|
@@ -10782,17 +10785,17 @@ function Ui(n, e, t = {}) {
|
|
|
10782
10785
|
});
|
|
10783
10786
|
}), o === 0)
|
|
10784
10787
|
return !1;
|
|
10785
|
-
const a = l.filter((d) => s ? s.name === d.mark.type.name : !0).filter((d) =>
|
|
10788
|
+
const a = l.filter((d) => s ? s.name === d.mark.type.name : !0).filter((d) => Vr(d.mark.attrs, t, { strict: !1 })).reduce((d, f) => d + f.to - f.from, 0), c = l.filter((d) => s ? d.mark.type !== s && d.mark.type.excludes(s) : !0).reduce((d, f) => d + f.to - f.from, 0);
|
|
10786
10789
|
return (a > 0 ? a + c : a) >= o;
|
|
10787
10790
|
}
|
|
10788
10791
|
function lh(n, e, t = {}) {
|
|
10789
10792
|
if (!e)
|
|
10790
|
-
return
|
|
10791
|
-
const r =
|
|
10792
|
-
return r === "node" ?
|
|
10793
|
+
return jn(n, null, t) || Ui(n, null, t);
|
|
10794
|
+
const r = ti(e, n.schema);
|
|
10795
|
+
return r === "node" ? jn(n, e, t) : r === "mark" ? Ui(n, e, t) : !1;
|
|
10793
10796
|
}
|
|
10794
10797
|
function Wo(n, e) {
|
|
10795
|
-
const { nodeExtensions: t } =
|
|
10798
|
+
const { nodeExtensions: t } = Zr(e), r = t.find((o) => o.name === n);
|
|
10796
10799
|
if (!r)
|
|
10797
10800
|
return !1;
|
|
10798
10801
|
const i = {
|
|
@@ -10825,7 +10828,7 @@ function Ms(n, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
|
|
|
10825
10828
|
return !1;
|
|
10826
10829
|
}
|
|
10827
10830
|
function Ja(n) {
|
|
10828
|
-
return n instanceof
|
|
10831
|
+
return n instanceof N;
|
|
10829
10832
|
}
|
|
10830
10833
|
function Ua(n, e, t) {
|
|
10831
10834
|
const i = n.state.doc.content.size, s = Ze(e, 0, i), o = Ze(t, 0, i), l = n.coordsAtPos(s), a = n.coordsAtPos(o, -1), c = Math.min(l.top, a.top), u = Math.max(l.bottom, a.bottom), d = Math.min(l.left, a.left), f = Math.max(l.right, a.right), p = f - d, h = u - c, b = {
|
|
@@ -10894,7 +10897,7 @@ const ch = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
10894
10897
|
return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) => zo(s, { ...o, ...e })(t) ? !0 : l.clearNodes()).command(({ state: l }) => zo(s, { ...o, ...e })(l, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
|
|
10895
10898
|
}, fh = (n) => ({ tr: e, dispatch: t }) => {
|
|
10896
10899
|
if (t) {
|
|
10897
|
-
const { doc: r } = e, i = Ze(n, 0, r.content.size), s =
|
|
10900
|
+
const { doc: r } = e, i = Ze(n, 0, r.content.size), s = N.create(r, i);
|
|
10898
10901
|
e.setSelection(s);
|
|
10899
10902
|
}
|
|
10900
10903
|
return !0;
|
|
@@ -10916,8 +10919,8 @@ function qo(n, e) {
|
|
|
10916
10919
|
}
|
|
10917
10920
|
}
|
|
10918
10921
|
const mh = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
|
|
10919
|
-
const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, u =
|
|
10920
|
-
if (s instanceof
|
|
10922
|
+
const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, u = Mr(c, l.node().type.name, l.node().attrs);
|
|
10923
|
+
if (s instanceof N && s.node.isBlock)
|
|
10921
10924
|
return !l.parentOffset || !tn(o, l.pos) ? !1 : (r && (n && qo(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
|
|
10922
10925
|
if (!l.parent.isBlock)
|
|
10923
10926
|
return !1;
|
|
@@ -10959,7 +10962,7 @@ const mh = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
10959
10962
|
for (let B = a.depth - w; B >= a.depth - 3; B -= 1)
|
|
10960
10963
|
b = x.from(a.node(B).copy(b));
|
|
10961
10964
|
const M = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3, y = {
|
|
10962
|
-
...
|
|
10965
|
+
...Mr(f, a.node().type.name, a.node().attrs),
|
|
10963
10966
|
...e
|
|
10964
10967
|
}, O = ((o = l.contentMatch.defaultType) === null || o === void 0 ? void 0 : o.createAndFill(y)) || void 0;
|
|
10965
10968
|
b = b.append(x.from(l.createAndFill(null, O) || void 0));
|
|
@@ -10975,10 +10978,10 @@ const mh = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
10975
10978
|
return !0;
|
|
10976
10979
|
}
|
|
10977
10980
|
const p = c.pos === a.end() ? d.contentMatchAt(0).defaultType : null, h = {
|
|
10978
|
-
...
|
|
10981
|
+
...Mr(f, d.type.name, d.attrs),
|
|
10979
10982
|
...e
|
|
10980
10983
|
}, m = {
|
|
10981
|
-
...
|
|
10984
|
+
...Mr(f, a.node().type.name, a.node().attrs),
|
|
10982
10985
|
...e
|
|
10983
10986
|
};
|
|
10984
10987
|
t.delete(a.pos, c.pos);
|
|
@@ -10996,7 +10999,7 @@ const mh = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
10996
10999
|
t.ensureMarks(O);
|
|
10997
11000
|
}
|
|
10998
11001
|
return !0;
|
|
10999
|
-
},
|
|
11002
|
+
}, xi = (n, e) => {
|
|
11000
11003
|
const t = Ss((o) => o.type === e)(n.selection);
|
|
11001
11004
|
if (!t)
|
|
11002
11005
|
return !0;
|
|
@@ -11005,7 +11008,7 @@ const mh = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11005
11008
|
return !0;
|
|
11006
11009
|
const i = n.doc.nodeAt(r);
|
|
11007
11010
|
return t.node.type === i?.type && yt(n.doc, t.pos) && n.join(t.pos), !0;
|
|
11008
|
-
},
|
|
11011
|
+
}, wi = (n, e) => {
|
|
11009
11012
|
const t = Ss((o) => o.type === e)(n.selection);
|
|
11010
11013
|
if (!t)
|
|
11011
11014
|
return !0;
|
|
@@ -11023,22 +11026,22 @@ const mh = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11023
11026
|
if (O.node.type === p)
|
|
11024
11027
|
return c.liftListItem(h);
|
|
11025
11028
|
if (Wo(O.node.type.name, d) && p.validContent(O.node.content) && l)
|
|
11026
|
-
return a().command(() => (s.setNodeMarkup(O.pos, p), !0)).command(() =>
|
|
11029
|
+
return a().command(() => (s.setNodeMarkup(O.pos, p), !0)).command(() => xi(s, p)).command(() => wi(s, p)).run();
|
|
11027
11030
|
}
|
|
11028
|
-
return !t || !y || !l ? a().command(() => u().wrapInList(p, r) ? !0 : c.clearNodes()).wrapInList(p, r).command(() =>
|
|
11031
|
+
return !t || !y || !l ? a().command(() => u().wrapInList(p, r) ? !0 : c.clearNodes()).wrapInList(p, r).command(() => xi(s, p)).command(() => wi(s, p)).run() : a().command(() => {
|
|
11029
11032
|
const k = u().wrapInList(p, r), I = y.filter((B) => f.includes(B.type.name));
|
|
11030
11033
|
return s.ensureMarks(I), k ? !0 : c.clearNodes();
|
|
11031
|
-
}).wrapInList(p, r).command(() =>
|
|
11034
|
+
}).wrapInList(p, r).command(() => xi(s, p)).command(() => wi(s, p)).run();
|
|
11032
11035
|
}, bh = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
|
|
11033
11036
|
const { extendEmptyMarkRange: s = !1 } = t, o = vt(n, r.schema);
|
|
11034
11037
|
return Ui(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
|
|
11035
11038
|
}, vh = (n, e, t = {}) => ({ state: r, commands: i }) => {
|
|
11036
|
-
const s = G(n, r.schema), o = G(e, r.schema), l =
|
|
11039
|
+
const s = G(n, r.schema), o = G(e, r.schema), l = jn(r, s, t);
|
|
11037
11040
|
let a;
|
|
11038
11041
|
return r.selection.$anchor.sameParent(r.selection.$head) && (a = r.selection.$anchor.parent.attrs), l ? i.setNode(o, a) : i.setNode(s, { ...a, ...t });
|
|
11039
11042
|
}, kh = (n, e = {}) => ({ state: t, commands: r }) => {
|
|
11040
11043
|
const i = G(n, t.schema);
|
|
11041
|
-
return
|
|
11044
|
+
return jn(t, i, e) ? r.lift(i) : r.wrapIn(i, e);
|
|
11042
11045
|
}, xh = () => ({ state: n, dispatch: e }) => {
|
|
11043
11046
|
const t = n.plugins;
|
|
11044
11047
|
for (let r = 0; r < t.length; r += 1) {
|
|
@@ -11080,7 +11083,7 @@ const mh = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11080
11083
|
return t.removeStoredMark(a), !0;
|
|
11081
11084
|
}, Mh = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
11082
11085
|
let s = null, o = null;
|
|
11083
|
-
const l =
|
|
11086
|
+
const l = ti(typeof n == "string" ? n : n.name, r.schema);
|
|
11084
11087
|
return l ? (l === "node" && (s = G(n, r.schema)), l === "mark" && (o = vt(n, r.schema)), i && t.selection.ranges.forEach((a) => {
|
|
11085
11088
|
const c = a.$from.pos, u = a.$to.pos;
|
|
11086
11089
|
let d, f, p, h;
|
|
@@ -11134,7 +11137,7 @@ var Th = /* @__PURE__ */ Object.freeze({
|
|
|
11134
11137
|
first: Op,
|
|
11135
11138
|
focus: Tp,
|
|
11136
11139
|
forEach: Ep,
|
|
11137
|
-
insertContent:
|
|
11140
|
+
insertContent: Np,
|
|
11138
11141
|
insertContentAt: Ip,
|
|
11139
11142
|
joinBackward: Bp,
|
|
11140
11143
|
joinDown: Pp,
|
|
@@ -11184,12 +11187,12 @@ const Eh = ee.create({
|
|
|
11184
11187
|
...Th
|
|
11185
11188
|
};
|
|
11186
11189
|
}
|
|
11187
|
-
}),
|
|
11190
|
+
}), Nh = ee.create({
|
|
11188
11191
|
name: "drop",
|
|
11189
11192
|
addProseMirrorPlugins() {
|
|
11190
11193
|
return [
|
|
11191
11194
|
new oe({
|
|
11192
|
-
key: new
|
|
11195
|
+
key: new Ne("tiptapDrop"),
|
|
11193
11196
|
props: {
|
|
11194
11197
|
handleDrop: (n, e, t, r) => {
|
|
11195
11198
|
this.editor.emit("drop", {
|
|
@@ -11203,12 +11206,12 @@ const Eh = ee.create({
|
|
|
11203
11206
|
})
|
|
11204
11207
|
];
|
|
11205
11208
|
}
|
|
11206
|
-
}),
|
|
11209
|
+
}), Ah = ee.create({
|
|
11207
11210
|
name: "editable",
|
|
11208
11211
|
addProseMirrorPlugins() {
|
|
11209
11212
|
return [
|
|
11210
11213
|
new oe({
|
|
11211
|
-
key: new
|
|
11214
|
+
key: new Ne("editable"),
|
|
11212
11215
|
props: {
|
|
11213
11216
|
editable: () => this.editor.options.editable
|
|
11214
11217
|
}
|
|
@@ -11221,7 +11224,7 @@ const Eh = ee.create({
|
|
|
11221
11224
|
const { editor: n } = this;
|
|
11222
11225
|
return [
|
|
11223
11226
|
new oe({
|
|
11224
|
-
key: new
|
|
11227
|
+
key: new Ne("focusEvents"),
|
|
11225
11228
|
props: {
|
|
11226
11229
|
handleDOMEvents: {
|
|
11227
11230
|
focus: (e, t) => {
|
|
@@ -11294,7 +11297,7 @@ const Eh = ee.create({
|
|
|
11294
11297
|
// This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
|
|
11295
11298
|
// with many other commands.
|
|
11296
11299
|
new oe({
|
|
11297
|
-
key: new
|
|
11300
|
+
key: new Ne("clearDocument"),
|
|
11298
11301
|
appendTransaction: (n, e, t) => {
|
|
11299
11302
|
const r = n.some((m) => m.docChanged) && !e.doc.eq(t.doc), i = n.some((m) => m.getMeta("preventClearDocument"));
|
|
11300
11303
|
if (!r || i)
|
|
@@ -11302,10 +11305,10 @@ const Eh = ee.create({
|
|
|
11302
11305
|
const { empty: s, from: o, to: l } = e.selection, a = R.atStart(e.doc).from, c = R.atEnd(e.doc).to;
|
|
11303
11306
|
if (s || !(o === a && l === c) || !Ms(t.doc))
|
|
11304
11307
|
return;
|
|
11305
|
-
const f = t.tr, p =
|
|
11308
|
+
const f = t.tr, p = Yr({
|
|
11306
11309
|
state: t,
|
|
11307
11310
|
transaction: f
|
|
11308
|
-
}), { commands: h } = new
|
|
11311
|
+
}), { commands: h } = new Xr({
|
|
11309
11312
|
editor: this.editor,
|
|
11310
11313
|
state: p
|
|
11311
11314
|
});
|
|
@@ -11320,7 +11323,7 @@ const Eh = ee.create({
|
|
|
11320
11323
|
addProseMirrorPlugins() {
|
|
11321
11324
|
return [
|
|
11322
11325
|
new oe({
|
|
11323
|
-
key: new
|
|
11326
|
+
key: new Ne("tiptapPaste"),
|
|
11324
11327
|
props: {
|
|
11325
11328
|
handlePaste: (n, e, t) => {
|
|
11326
11329
|
this.editor.emit("paste", {
|
|
@@ -11338,7 +11341,7 @@ const Eh = ee.create({
|
|
|
11338
11341
|
addProseMirrorPlugins() {
|
|
11339
11342
|
return [
|
|
11340
11343
|
new oe({
|
|
11341
|
-
key: new
|
|
11344
|
+
key: new Ne("tabindex"),
|
|
11342
11345
|
props: {
|
|
11343
11346
|
attributes: () => this.editor.isEditable ? { tabindex: "0" } : {}
|
|
11344
11347
|
}
|
|
@@ -11682,7 +11685,7 @@ let zh = class extends Xf {
|
|
|
11682
11685
|
createExtensionManager() {
|
|
11683
11686
|
var e, t;
|
|
11684
11687
|
const i = [...this.options.enableCoreExtensions ? [
|
|
11685
|
-
|
|
11688
|
+
Ah,
|
|
11686
11689
|
fp.configure({
|
|
11687
11690
|
blockSeparator: (t = (e = this.options.coreExtensionOptions) === null || e === void 0 ? void 0 : e.clipboardTextSerializer) === null || t === void 0 ? void 0 : t.blockSeparator
|
|
11688
11691
|
}),
|
|
@@ -11690,7 +11693,7 @@ let zh = class extends Xf {
|
|
|
11690
11693
|
Dh,
|
|
11691
11694
|
Ih,
|
|
11692
11695
|
Ph,
|
|
11693
|
-
|
|
11696
|
+
Nh,
|
|
11694
11697
|
Rh
|
|
11695
11698
|
].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s?.type));
|
|
11696
11699
|
this.extensionManager = new Qt(i, this);
|
|
@@ -11699,7 +11702,7 @@ let zh = class extends Xf {
|
|
|
11699
11702
|
* Creates an command manager.
|
|
11700
11703
|
*/
|
|
11701
11704
|
createCommandManager() {
|
|
11702
|
-
this.commandManager = new
|
|
11705
|
+
this.commandManager = new Xr({
|
|
11703
11706
|
editor: this
|
|
11704
11707
|
});
|
|
11705
11708
|
}
|
|
@@ -11898,7 +11901,7 @@ let zh = class extends Xf {
|
|
|
11898
11901
|
}
|
|
11899
11902
|
};
|
|
11900
11903
|
function cn(n) {
|
|
11901
|
-
return new
|
|
11904
|
+
return new Qr({
|
|
11902
11905
|
find: n.find,
|
|
11903
11906
|
handler: ({ state: e, range: t, match: r }) => {
|
|
11904
11907
|
const i = P(n.getAttributes, void 0, r);
|
|
@@ -11917,7 +11920,7 @@ function cn(n) {
|
|
|
11917
11920
|
});
|
|
11918
11921
|
}
|
|
11919
11922
|
function Vh(n) {
|
|
11920
|
-
return new
|
|
11923
|
+
return new Qr({
|
|
11921
11924
|
find: n.find,
|
|
11922
11925
|
handler: ({ state: e, range: t, match: r }) => {
|
|
11923
11926
|
const i = P(n.getAttributes, void 0, r) || {}, { tr: s } = e, o = t.from;
|
|
@@ -11938,7 +11941,7 @@ function Vh(n) {
|
|
|
11938
11941
|
});
|
|
11939
11942
|
}
|
|
11940
11943
|
function Gi(n) {
|
|
11941
|
-
return new
|
|
11944
|
+
return new Qr({
|
|
11942
11945
|
find: n.find,
|
|
11943
11946
|
handler: ({ state: e, range: t, match: r }) => {
|
|
11944
11947
|
const i = e.doc.resolve(t.from), s = P(n.getAttributes, void 0, r) || {};
|
|
@@ -11948,8 +11951,8 @@ function Gi(n) {
|
|
|
11948
11951
|
}
|
|
11949
11952
|
});
|
|
11950
11953
|
}
|
|
11951
|
-
function
|
|
11952
|
-
return new
|
|
11954
|
+
function Wn(n) {
|
|
11955
|
+
return new Qr({
|
|
11953
11956
|
find: n.find,
|
|
11954
11957
|
handler: ({ state: e, range: t, match: r, chain: i }) => {
|
|
11955
11958
|
const s = P(n.getAttributes, void 0, r) || {}, o = e.tr.delete(t.from, t.to), a = o.doc.resolve(t.from).blockRange(), c = a && ss(a, n.type, s);
|
|
@@ -11992,7 +11995,7 @@ class me {
|
|
|
11992
11995
|
configure(e = {}) {
|
|
11993
11996
|
const t = this.extend({
|
|
11994
11997
|
...this.config,
|
|
11995
|
-
addOptions: () =>
|
|
11998
|
+
addOptions: () => ei(this.options, e)
|
|
11996
11999
|
});
|
|
11997
12000
|
return t.name = this.name, t.parent = this.parent, t;
|
|
11998
12001
|
}
|
|
@@ -12024,12 +12027,12 @@ function un(n) {
|
|
|
12024
12027
|
}
|
|
12025
12028
|
});
|
|
12026
12029
|
}
|
|
12027
|
-
var pe = "top", Te = "bottom", Ee = "right", he = "left", Cs = "auto",
|
|
12028
|
-
return n.concat([e + "-" + dn, e + "-" +
|
|
12029
|
-
}, []), Ya = /* @__PURE__ */ [].concat(
|
|
12030
|
-
return n.concat([e, e + "-" + dn, e + "-" +
|
|
12030
|
+
var pe = "top", Te = "bottom", Ee = "right", he = "left", Cs = "auto", Qn = [pe, Te, Ee, he], dn = "start", qn = "end", Fh = "clippingParents", Ga = "viewport", Mn = "popper", $h = "reference", Ko = /* @__PURE__ */ Qn.reduce(function(n, e) {
|
|
12031
|
+
return n.concat([e + "-" + dn, e + "-" + qn]);
|
|
12032
|
+
}, []), Ya = /* @__PURE__ */ [].concat(Qn, [Cs]).reduce(function(n, e) {
|
|
12033
|
+
return n.concat([e, e + "-" + dn, e + "-" + qn]);
|
|
12031
12034
|
}, []), Hh = "beforeRead", jh = "read", Wh = "afterRead", qh = "beforeMain", Kh = "main", _h = "afterMain", Jh = "beforeWrite", Uh = "write", Gh = "afterWrite", Yh = [Hh, jh, Wh, qh, Kh, _h, Jh, Uh, Gh];
|
|
12032
|
-
function
|
|
12035
|
+
function We(n) {
|
|
12033
12036
|
return n ? (n.nodeName || "").toLowerCase() : null;
|
|
12034
12037
|
}
|
|
12035
12038
|
function ke(n) {
|
|
@@ -12059,7 +12062,7 @@ function Xh(n) {
|
|
|
12059
12062
|
var e = n.state;
|
|
12060
12063
|
Object.keys(e.elements).forEach(function(t) {
|
|
12061
12064
|
var r = e.styles[t] || {}, i = e.attributes[t] || {}, s = e.elements[t];
|
|
12062
|
-
!Oe(s) || !
|
|
12065
|
+
!Oe(s) || !We(s) || (Object.assign(s.style, r), Object.keys(i).forEach(function(o) {
|
|
12063
12066
|
var l = i[o];
|
|
12064
12067
|
l === !1 ? s.removeAttribute(o) : s.setAttribute(o, l === !0 ? "" : l);
|
|
12065
12068
|
}));
|
|
@@ -12083,7 +12086,7 @@ function Zh(n) {
|
|
|
12083
12086
|
var i = e.elements[r], s = e.attributes[r] || {}, o = Object.keys(e.styles.hasOwnProperty(r) ? e.styles[r] : t[r]), l = o.reduce(function(a, c) {
|
|
12084
12087
|
return a[c] = "", a;
|
|
12085
12088
|
}, {});
|
|
12086
|
-
!Oe(i) || !
|
|
12089
|
+
!Oe(i) || !We(i) || (Object.assign(i.style, l), Object.keys(s).forEach(function(a) {
|
|
12087
12090
|
i.removeAttribute(a);
|
|
12088
12091
|
}));
|
|
12089
12092
|
});
|
|
@@ -12097,10 +12100,10 @@ const Xa = {
|
|
|
12097
12100
|
effect: Zh,
|
|
12098
12101
|
requires: ["computeStyles"]
|
|
12099
12102
|
};
|
|
12100
|
-
function
|
|
12103
|
+
function $e(n) {
|
|
12101
12104
|
return n.split("-")[0];
|
|
12102
12105
|
}
|
|
12103
|
-
var Pt = Math.max,
|
|
12106
|
+
var Pt = Math.max, $r = Math.min, fn = Math.round;
|
|
12104
12107
|
function Yi() {
|
|
12105
12108
|
var n = navigator.userAgentData;
|
|
12106
12109
|
return n != null && n.brands && Array.isArray(n.brands) ? n.brands.map(function(e) {
|
|
@@ -12153,7 +12156,7 @@ function et(n) {
|
|
|
12153
12156
|
return ke(n).getComputedStyle(n);
|
|
12154
12157
|
}
|
|
12155
12158
|
function Qh(n) {
|
|
12156
|
-
return ["table", "td", "th"].indexOf(
|
|
12159
|
+
return ["table", "td", "th"].indexOf(We(n)) >= 0;
|
|
12157
12160
|
}
|
|
12158
12161
|
function kt(n) {
|
|
12159
12162
|
return ((Ft(n) ? n.ownerDocument : (
|
|
@@ -12161,8 +12164,8 @@ function kt(n) {
|
|
|
12161
12164
|
n.document
|
|
12162
12165
|
)) || window.document).documentElement;
|
|
12163
12166
|
}
|
|
12164
|
-
function
|
|
12165
|
-
return
|
|
12167
|
+
function ni(n) {
|
|
12168
|
+
return We(n) === "html" ? n : (
|
|
12166
12169
|
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
12167
12170
|
// $FlowFixMe[incompatible-return]
|
|
12168
12171
|
// $FlowFixMe[prop-missing]
|
|
@@ -12184,8 +12187,8 @@ function em(n) {
|
|
|
12184
12187
|
if (r.position === "fixed")
|
|
12185
12188
|
return null;
|
|
12186
12189
|
}
|
|
12187
|
-
var i =
|
|
12188
|
-
for (Os(i) && (i = i.host); Oe(i) && ["html", "body"].indexOf(
|
|
12190
|
+
var i = ni(n);
|
|
12191
|
+
for (Os(i) && (i = i.host); Oe(i) && ["html", "body"].indexOf(We(i)) < 0; ) {
|
|
12189
12192
|
var s = et(i);
|
|
12190
12193
|
if (s.transform !== "none" || s.perspective !== "none" || s.contain === "paint" || ["transform", "perspective"].indexOf(s.willChange) !== -1 || e && s.willChange === "filter" || e && s.filter && s.filter !== "none")
|
|
12191
12194
|
return i;
|
|
@@ -12193,16 +12196,16 @@ function em(n) {
|
|
|
12193
12196
|
}
|
|
12194
12197
|
return null;
|
|
12195
12198
|
}
|
|
12196
|
-
function
|
|
12199
|
+
function er(n) {
|
|
12197
12200
|
for (var e = ke(n), t = _o(n); t && Qh(t) && et(t).position === "static"; )
|
|
12198
12201
|
t = _o(t);
|
|
12199
|
-
return t && (
|
|
12202
|
+
return t && (We(t) === "html" || We(t) === "body" && et(t).position === "static") ? e : t || em(n) || e;
|
|
12200
12203
|
}
|
|
12201
12204
|
function Es(n) {
|
|
12202
12205
|
return ["top", "bottom"].indexOf(n) >= 0 ? "x" : "y";
|
|
12203
12206
|
}
|
|
12204
12207
|
function In(n, e, t) {
|
|
12205
|
-
return Pt(n,
|
|
12208
|
+
return Pt(n, $r(e, t));
|
|
12206
12209
|
}
|
|
12207
12210
|
function tm(n, e, t) {
|
|
12208
12211
|
var r = In(n, e, t);
|
|
@@ -12227,12 +12230,12 @@ function nc(n, e) {
|
|
|
12227
12230
|
var nm = function(e, t) {
|
|
12228
12231
|
return e = typeof e == "function" ? e(Object.assign({}, t.rects, {
|
|
12229
12232
|
placement: t.placement
|
|
12230
|
-
})) : e, tc(typeof e != "number" ? e : nc(e,
|
|
12233
|
+
})) : e, tc(typeof e != "number" ? e : nc(e, Qn));
|
|
12231
12234
|
};
|
|
12232
12235
|
function rm(n) {
|
|
12233
|
-
var e, t = n.state, r = n.name, i = n.options, s = t.elements.arrow, o = t.modifiersData.popperOffsets, l =
|
|
12236
|
+
var e, t = n.state, r = n.name, i = n.options, s = t.elements.arrow, o = t.modifiersData.popperOffsets, l = $e(t.placement), a = Es(l), c = [he, Ee].indexOf(l) >= 0, u = c ? "height" : "width";
|
|
12234
12237
|
if (!(!s || !o)) {
|
|
12235
|
-
var d = nm(i.padding, t), f = Ts(s), p = a === "y" ? pe : he, h = a === "y" ? Te : Ee, m = t.rects.reference[u] + t.rects.reference[a] - o[a] - t.rects.popper[u], g = o[a] - t.rects.reference[a], b =
|
|
12238
|
+
var d = nm(i.padding, t), f = Ts(s), p = a === "y" ? pe : he, h = a === "y" ? Te : Ee, m = t.rects.reference[u] + t.rects.reference[a] - o[a] - t.rects.popper[u], g = o[a] - t.rects.reference[a], b = er(s), w = b ? a === "y" ? b.clientHeight || 0 : b.clientWidth || 0 : 0, M = m / 2 - g / 2, y = d[p], O = w - f[u] - d[h], k = w / 2 - f[u] / 2 + M, I = In(y, k, O), B = a;
|
|
12236
12239
|
t.modifiersData[r] = (e = {}, e[B] = I, e.centerOffset = I - k, e);
|
|
12237
12240
|
}
|
|
12238
12241
|
}
|
|
@@ -12276,8 +12279,8 @@ function Jo(n) {
|
|
|
12276
12279
|
p = g.x, m = g.y;
|
|
12277
12280
|
var b = o.hasOwnProperty("x"), w = o.hasOwnProperty("y"), M = he, y = pe, O = window;
|
|
12278
12281
|
if (c) {
|
|
12279
|
-
var k =
|
|
12280
|
-
if (k === ke(t) && (k = kt(t), et(k).position !== "static" && l === "absolute" && (I = "scrollHeight", B = "scrollWidth")), k = k, i === pe || (i === he || i === Ee) && s ===
|
|
12282
|
+
var k = er(t), I = "clientHeight", B = "clientWidth";
|
|
12283
|
+
if (k === ke(t) && (k = kt(t), et(k).position !== "static" && l === "absolute" && (I = "scrollHeight", B = "scrollWidth")), k = k, i === pe || (i === he || i === Ee) && s === qn) {
|
|
12281
12284
|
y = Te;
|
|
12282
12285
|
var E = d && k === O && O.visualViewport ? O.visualViewport.height : (
|
|
12283
12286
|
// $FlowFixMe[prop-missing]
|
|
@@ -12285,7 +12288,7 @@ function Jo(n) {
|
|
|
12285
12288
|
);
|
|
12286
12289
|
m -= E - r.height, m *= a ? 1 : -1;
|
|
12287
12290
|
}
|
|
12288
|
-
if (i === he || (i === pe || i === Te) && s ===
|
|
12291
|
+
if (i === he || (i === pe || i === Te) && s === qn) {
|
|
12289
12292
|
M = Ee;
|
|
12290
12293
|
var z = d && k === O && O.visualViewport ? O.visualViewport.width : (
|
|
12291
12294
|
// $FlowFixMe[prop-missing]
|
|
@@ -12311,7 +12314,7 @@ function Jo(n) {
|
|
|
12311
12314
|
}
|
|
12312
12315
|
function am(n) {
|
|
12313
12316
|
var e = n.state, t = n.options, r = t.gpuAcceleration, i = r === void 0 ? !0 : r, s = t.adaptive, o = s === void 0 ? !0 : s, l = t.roundOffsets, a = l === void 0 ? !0 : l, c = {
|
|
12314
|
-
placement:
|
|
12317
|
+
placement: $e(e.placement),
|
|
12315
12318
|
variation: hn(e.placement),
|
|
12316
12319
|
popper: e.elements.popper,
|
|
12317
12320
|
popperRect: e.rects.popper,
|
|
@@ -12339,17 +12342,17 @@ const cm = {
|
|
|
12339
12342
|
fn: am,
|
|
12340
12343
|
data: {}
|
|
12341
12344
|
};
|
|
12342
|
-
var
|
|
12345
|
+
var vr = {
|
|
12343
12346
|
passive: !0
|
|
12344
12347
|
};
|
|
12345
12348
|
function um(n) {
|
|
12346
12349
|
var e = n.state, t = n.instance, r = n.options, i = r.scroll, s = i === void 0 ? !0 : i, o = r.resize, l = o === void 0 ? !0 : o, a = ke(e.elements.popper), c = [].concat(e.scrollParents.reference, e.scrollParents.popper);
|
|
12347
12350
|
return s && c.forEach(function(u) {
|
|
12348
|
-
u.addEventListener("scroll", t.update,
|
|
12349
|
-
}), l && a.addEventListener("resize", t.update,
|
|
12351
|
+
u.addEventListener("scroll", t.update, vr);
|
|
12352
|
+
}), l && a.addEventListener("resize", t.update, vr), function() {
|
|
12350
12353
|
s && c.forEach(function(u) {
|
|
12351
|
-
u.removeEventListener("scroll", t.update,
|
|
12352
|
-
}), l && a.removeEventListener("resize", t.update,
|
|
12354
|
+
u.removeEventListener("scroll", t.update, vr);
|
|
12355
|
+
}), l && a.removeEventListener("resize", t.update, vr);
|
|
12353
12356
|
};
|
|
12354
12357
|
}
|
|
12355
12358
|
const dm = {
|
|
@@ -12367,7 +12370,7 @@ var fm = {
|
|
|
12367
12370
|
bottom: "top",
|
|
12368
12371
|
top: "bottom"
|
|
12369
12372
|
};
|
|
12370
|
-
function
|
|
12373
|
+
function Cr(n) {
|
|
12371
12374
|
return n.replace(/left|right|bottom|top/g, function(e) {
|
|
12372
12375
|
return fm[e];
|
|
12373
12376
|
});
|
|
@@ -12381,15 +12384,15 @@ function Uo(n) {
|
|
|
12381
12384
|
return pm[e];
|
|
12382
12385
|
});
|
|
12383
12386
|
}
|
|
12384
|
-
function
|
|
12387
|
+
function Ns(n) {
|
|
12385
12388
|
var e = ke(n), t = e.pageXOffset, r = e.pageYOffset;
|
|
12386
12389
|
return {
|
|
12387
12390
|
scrollLeft: t,
|
|
12388
12391
|
scrollTop: r
|
|
12389
12392
|
};
|
|
12390
12393
|
}
|
|
12391
|
-
function
|
|
12392
|
-
return pn(kt(n)).left +
|
|
12394
|
+
function As(n) {
|
|
12395
|
+
return pn(kt(n)).left + Ns(n).scrollLeft;
|
|
12393
12396
|
}
|
|
12394
12397
|
function hm(n, e) {
|
|
12395
12398
|
var t = ke(n), r = kt(n), i = t.visualViewport, s = r.clientWidth, o = r.clientHeight, l = 0, a = 0;
|
|
@@ -12401,12 +12404,12 @@ function hm(n, e) {
|
|
|
12401
12404
|
return {
|
|
12402
12405
|
width: s,
|
|
12403
12406
|
height: o,
|
|
12404
|
-
x: l +
|
|
12407
|
+
x: l + As(n),
|
|
12405
12408
|
y: a
|
|
12406
12409
|
};
|
|
12407
12410
|
}
|
|
12408
12411
|
function mm(n) {
|
|
12409
|
-
var e, t = kt(n), r =
|
|
12412
|
+
var e, t = kt(n), r = Ns(n), i = (e = n.ownerDocument) == null ? void 0 : e.body, s = Pt(t.scrollWidth, t.clientWidth, i ? i.scrollWidth : 0, i ? i.clientWidth : 0), o = Pt(t.scrollHeight, t.clientHeight, i ? i.scrollHeight : 0, i ? i.clientHeight : 0), l = -r.scrollLeft + As(n), a = -r.scrollTop;
|
|
12410
12413
|
return et(i || t).direction === "rtl" && (l += Pt(t.clientWidth, i ? i.clientWidth : 0) - s), {
|
|
12411
12414
|
width: s,
|
|
12412
12415
|
height: o,
|
|
@@ -12419,7 +12422,7 @@ function Ds(n) {
|
|
|
12419
12422
|
return /auto|scroll|overlay|hidden/.test(t + i + r);
|
|
12420
12423
|
}
|
|
12421
12424
|
function rc(n) {
|
|
12422
|
-
return ["html", "body", "#document"].indexOf(
|
|
12425
|
+
return ["html", "body", "#document"].indexOf(We(n)) >= 0 ? n.ownerDocument.body : Oe(n) && Ds(n) ? n : rc(ni(n));
|
|
12423
12426
|
}
|
|
12424
12427
|
function Rn(n, e) {
|
|
12425
12428
|
var t;
|
|
@@ -12427,7 +12430,7 @@ function Rn(n, e) {
|
|
|
12427
12430
|
var r = rc(n), i = r === ((t = n.ownerDocument) == null ? void 0 : t.body), s = ke(r), o = i ? [s].concat(s.visualViewport || [], Ds(r) ? r : []) : r, l = e.concat(o);
|
|
12428
12431
|
return i ? l : (
|
|
12429
12432
|
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
12430
|
-
l.concat(Rn(
|
|
12433
|
+
l.concat(Rn(ni(o)))
|
|
12431
12434
|
);
|
|
12432
12435
|
}
|
|
12433
12436
|
function Xi(n) {
|
|
@@ -12446,20 +12449,20 @@ function Go(n, e, t) {
|
|
|
12446
12449
|
return e === Ga ? Xi(hm(n, t)) : Ft(e) ? gm(e, t) : Xi(mm(kt(n)));
|
|
12447
12450
|
}
|
|
12448
12451
|
function ym(n) {
|
|
12449
|
-
var e = Rn(
|
|
12452
|
+
var e = Rn(ni(n)), t = ["absolute", "fixed"].indexOf(et(n).position) >= 0, r = t && Oe(n) ? er(n) : n;
|
|
12450
12453
|
return Ft(r) ? e.filter(function(i) {
|
|
12451
|
-
return Ft(i) && Qa(i, r) &&
|
|
12454
|
+
return Ft(i) && Qa(i, r) && We(i) !== "body";
|
|
12452
12455
|
}) : [];
|
|
12453
12456
|
}
|
|
12454
12457
|
function bm(n, e, t, r) {
|
|
12455
12458
|
var i = e === "clippingParents" ? ym(n) : [].concat(e), s = [].concat(i, [t]), o = s[0], l = s.reduce(function(a, c) {
|
|
12456
12459
|
var u = Go(n, c, r);
|
|
12457
|
-
return a.top = Pt(u.top, a.top), a.right =
|
|
12460
|
+
return a.top = Pt(u.top, a.top), a.right = $r(u.right, a.right), a.bottom = $r(u.bottom, a.bottom), a.left = Pt(u.left, a.left), a;
|
|
12458
12461
|
}, Go(n, o, r));
|
|
12459
12462
|
return l.width = l.right - l.left, l.height = l.bottom - l.top, l.x = l.left, l.y = l.top, l;
|
|
12460
12463
|
}
|
|
12461
12464
|
function ic(n) {
|
|
12462
|
-
var e = n.reference, t = n.element, r = n.placement, i = r ?
|
|
12465
|
+
var e = n.reference, t = n.element, r = n.placement, i = r ? $e(r) : null, s = r ? hn(r) : null, o = e.x + e.width / 2 - t.width / 2, l = e.y + e.height / 2 - t.height / 2, a;
|
|
12463
12466
|
switch (i) {
|
|
12464
12467
|
case pe:
|
|
12465
12468
|
a = {
|
|
@@ -12498,16 +12501,16 @@ function ic(n) {
|
|
|
12498
12501
|
case dn:
|
|
12499
12502
|
a[c] = a[c] - (e[u] / 2 - t[u] / 2);
|
|
12500
12503
|
break;
|
|
12501
|
-
case
|
|
12504
|
+
case qn:
|
|
12502
12505
|
a[c] = a[c] + (e[u] / 2 - t[u] / 2);
|
|
12503
12506
|
break;
|
|
12504
12507
|
}
|
|
12505
12508
|
}
|
|
12506
12509
|
return a;
|
|
12507
12510
|
}
|
|
12508
|
-
function
|
|
12511
|
+
function Kn(n, e) {
|
|
12509
12512
|
e === void 0 && (e = {});
|
|
12510
|
-
var t = e, r = t.placement, i = r === void 0 ? n.placement : r, s = t.strategy, o = s === void 0 ? n.strategy : s, l = t.boundary, a = l === void 0 ? Fh : l, c = t.rootBoundary, u = c === void 0 ? Ga : c, d = t.elementContext, f = d === void 0 ? Mn : d, p = t.altBoundary, h = p === void 0 ? !1 : p, m = t.padding, g = m === void 0 ? 0 : m, b = tc(typeof g != "number" ? g : nc(g,
|
|
12513
|
+
var t = e, r = t.placement, i = r === void 0 ? n.placement : r, s = t.strategy, o = s === void 0 ? n.strategy : s, l = t.boundary, a = l === void 0 ? Fh : l, c = t.rootBoundary, u = c === void 0 ? Ga : c, d = t.elementContext, f = d === void 0 ? Mn : d, p = t.altBoundary, h = p === void 0 ? !1 : p, m = t.padding, g = m === void 0 ? 0 : m, b = tc(typeof g != "number" ? g : nc(g, Qn)), w = f === Mn ? $h : Mn, M = n.rects.popper, y = n.elements[h ? w : f], O = bm(Ft(y) ? y : y.contextElement || kt(n.elements.popper), a, u, o), k = pn(n.elements.reference), I = ic({
|
|
12511
12514
|
reference: k,
|
|
12512
12515
|
element: M,
|
|
12513
12516
|
strategy: "absolute",
|
|
@@ -12531,71 +12534,71 @@ function vm(n, e) {
|
|
|
12531
12534
|
e === void 0 && (e = {});
|
|
12532
12535
|
var t = e, r = t.placement, i = t.boundary, s = t.rootBoundary, o = t.padding, l = t.flipVariations, a = t.allowedAutoPlacements, c = a === void 0 ? Ya : a, u = hn(r), d = u ? l ? Ko : Ko.filter(function(h) {
|
|
12533
12536
|
return hn(h) === u;
|
|
12534
|
-
}) :
|
|
12537
|
+
}) : Qn, f = d.filter(function(h) {
|
|
12535
12538
|
return c.indexOf(h) >= 0;
|
|
12536
12539
|
});
|
|
12537
12540
|
f.length === 0 && (f = d);
|
|
12538
12541
|
var p = f.reduce(function(h, m) {
|
|
12539
|
-
return h[m] =
|
|
12542
|
+
return h[m] = Kn(n, {
|
|
12540
12543
|
placement: m,
|
|
12541
12544
|
boundary: i,
|
|
12542
12545
|
rootBoundary: s,
|
|
12543
12546
|
padding: o
|
|
12544
|
-
})[
|
|
12547
|
+
})[$e(m)], h;
|
|
12545
12548
|
}, {});
|
|
12546
12549
|
return Object.keys(p).sort(function(h, m) {
|
|
12547
12550
|
return p[h] - p[m];
|
|
12548
12551
|
});
|
|
12549
12552
|
}
|
|
12550
12553
|
function km(n) {
|
|
12551
|
-
if (
|
|
12554
|
+
if ($e(n) === Cs)
|
|
12552
12555
|
return [];
|
|
12553
|
-
var e =
|
|
12556
|
+
var e = Cr(n);
|
|
12554
12557
|
return [Uo(n), e, Uo(e)];
|
|
12555
12558
|
}
|
|
12556
12559
|
function xm(n) {
|
|
12557
12560
|
var e = n.state, t = n.options, r = n.name;
|
|
12558
12561
|
if (!e.modifiersData[r]._skip) {
|
|
12559
|
-
for (var i = t.mainAxis, s = i === void 0 ? !0 : i, o = t.altAxis, l = o === void 0 ? !0 : o, a = t.fallbackPlacements, c = t.padding, u = t.boundary, d = t.rootBoundary, f = t.altBoundary, p = t.flipVariations, h = p === void 0 ? !0 : p, m = t.allowedAutoPlacements, g = e.options.placement, b =
|
|
12560
|
-
return
|
|
12561
|
-
placement:
|
|
12562
|
+
for (var i = t.mainAxis, s = i === void 0 ? !0 : i, o = t.altAxis, l = o === void 0 ? !0 : o, a = t.fallbackPlacements, c = t.padding, u = t.boundary, d = t.rootBoundary, f = t.altBoundary, p = t.flipVariations, h = p === void 0 ? !0 : p, m = t.allowedAutoPlacements, g = e.options.placement, b = $e(g), w = b === g, M = a || (w || !h ? [Cr(g)] : km(g)), y = [g].concat(M).reduce(function(qe, Ae) {
|
|
12563
|
+
return qe.concat($e(Ae) === Cs ? vm(e, {
|
|
12564
|
+
placement: Ae,
|
|
12562
12565
|
boundary: u,
|
|
12563
12566
|
rootBoundary: d,
|
|
12564
12567
|
padding: c,
|
|
12565
12568
|
flipVariations: h,
|
|
12566
12569
|
allowedAutoPlacements: m
|
|
12567
|
-
}) :
|
|
12570
|
+
}) : Ae);
|
|
12568
12571
|
}, []), O = e.rects.reference, k = e.rects.popper, I = /* @__PURE__ */ new Map(), B = !0, E = y[0], z = 0; z < y.length; z++) {
|
|
12569
|
-
var $ = y[z], H =
|
|
12572
|
+
var $ = y[z], H = $e($), j = hn($) === dn, ge = [pe, Te].indexOf(H) >= 0, ye = ge ? "width" : "height", te = Kn(e, {
|
|
12570
12573
|
placement: $,
|
|
12571
12574
|
boundary: u,
|
|
12572
12575
|
rootBoundary: d,
|
|
12573
12576
|
altBoundary: f,
|
|
12574
12577
|
padding: c
|
|
12575
12578
|
}), ne = ge ? j ? Ee : he : j ? Te : pe;
|
|
12576
|
-
O[ye] > k[ye] && (ne =
|
|
12577
|
-
var Y =
|
|
12578
|
-
if (s &&
|
|
12579
|
-
return
|
|
12579
|
+
O[ye] > k[ye] && (ne = Cr(ne));
|
|
12580
|
+
var Y = Cr(ne), Pe = [];
|
|
12581
|
+
if (s && Pe.push(te[H] <= 0), l && Pe.push(te[ne] <= 0, te[Y] <= 0), Pe.every(function(qe) {
|
|
12582
|
+
return qe;
|
|
12580
12583
|
})) {
|
|
12581
12584
|
E = $, B = !1;
|
|
12582
12585
|
break;
|
|
12583
12586
|
}
|
|
12584
|
-
I.set($,
|
|
12587
|
+
I.set($, Pe);
|
|
12585
12588
|
}
|
|
12586
12589
|
if (B)
|
|
12587
|
-
for (var
|
|
12588
|
-
var
|
|
12589
|
-
var
|
|
12590
|
-
if (
|
|
12591
|
-
return
|
|
12590
|
+
for (var Be = h ? 3 : 1, xt = function(Ae) {
|
|
12591
|
+
var Ke = y.find(function(Ht) {
|
|
12592
|
+
var _e = I.get(Ht);
|
|
12593
|
+
if (_e)
|
|
12594
|
+
return _e.slice(0, Ae).every(function(jt) {
|
|
12592
12595
|
return jt;
|
|
12593
12596
|
});
|
|
12594
12597
|
});
|
|
12595
|
-
if (
|
|
12596
|
-
return E =
|
|
12597
|
-
},
|
|
12598
|
-
var wt = xt(
|
|
12598
|
+
if (Ke)
|
|
12599
|
+
return E = Ke, "break";
|
|
12600
|
+
}, Le = Be; Le > 0; Le--) {
|
|
12601
|
+
var wt = xt(Le);
|
|
12599
12602
|
if (wt === "break") break;
|
|
12600
12603
|
}
|
|
12601
12604
|
e.placement !== E && (e.modifiersData[r]._skip = !0, e.placement = E, e.reset = !0);
|
|
@@ -12628,9 +12631,9 @@ function Xo(n) {
|
|
|
12628
12631
|
});
|
|
12629
12632
|
}
|
|
12630
12633
|
function Sm(n) {
|
|
12631
|
-
var e = n.state, t = n.name, r = e.rects.reference, i = e.rects.popper, s = e.modifiersData.preventOverflow, o =
|
|
12634
|
+
var e = n.state, t = n.name, r = e.rects.reference, i = e.rects.popper, s = e.modifiersData.preventOverflow, o = Kn(e, {
|
|
12632
12635
|
elementContext: "reference"
|
|
12633
|
-
}), l =
|
|
12636
|
+
}), l = Kn(e, {
|
|
12634
12637
|
altBoundary: !0
|
|
12635
12638
|
}), a = Yo(o, r), c = Yo(l, i, s), u = Xo(a), d = Xo(c);
|
|
12636
12639
|
e.modifiersData[t] = {
|
|
@@ -12651,7 +12654,7 @@ const Mm = {
|
|
|
12651
12654
|
fn: Sm
|
|
12652
12655
|
};
|
|
12653
12656
|
function Cm(n, e, t) {
|
|
12654
|
-
var r =
|
|
12657
|
+
var r = $e(n), i = [he, pe].indexOf(r) >= 0 ? -1 : 1, s = typeof t == "function" ? t(Object.assign({}, e, {
|
|
12655
12658
|
placement: n
|
|
12656
12659
|
})) : t, o = s[0], l = s[1];
|
|
12657
12660
|
return o = o || 0, l = (l || 0) * i, [he, Ee].indexOf(r) >= 0 ? {
|
|
@@ -12684,23 +12687,23 @@ function Em(n) {
|
|
|
12684
12687
|
placement: e.placement
|
|
12685
12688
|
});
|
|
12686
12689
|
}
|
|
12687
|
-
const
|
|
12690
|
+
const Nm = {
|
|
12688
12691
|
name: "popperOffsets",
|
|
12689
12692
|
enabled: !0,
|
|
12690
12693
|
phase: "read",
|
|
12691
12694
|
fn: Em,
|
|
12692
12695
|
data: {}
|
|
12693
12696
|
};
|
|
12694
|
-
function
|
|
12697
|
+
function Am(n) {
|
|
12695
12698
|
return n === "x" ? "y" : "x";
|
|
12696
12699
|
}
|
|
12697
12700
|
function Dm(n) {
|
|
12698
|
-
var e = n.state, t = n.options, r = n.name, i = t.mainAxis, s = i === void 0 ? !0 : i, o = t.altAxis, l = o === void 0 ? !1 : o, a = t.boundary, c = t.rootBoundary, u = t.altBoundary, d = t.padding, f = t.tether, p = f === void 0 ? !0 : f, h = t.tetherOffset, m = h === void 0 ? 0 : h, g =
|
|
12701
|
+
var e = n.state, t = n.options, r = n.name, i = t.mainAxis, s = i === void 0 ? !0 : i, o = t.altAxis, l = o === void 0 ? !1 : o, a = t.boundary, c = t.rootBoundary, u = t.altBoundary, d = t.padding, f = t.tether, p = f === void 0 ? !0 : f, h = t.tetherOffset, m = h === void 0 ? 0 : h, g = Kn(e, {
|
|
12699
12702
|
boundary: a,
|
|
12700
12703
|
rootBoundary: c,
|
|
12701
12704
|
padding: d,
|
|
12702
12705
|
altBoundary: u
|
|
12703
|
-
}), b =
|
|
12706
|
+
}), b = $e(e.placement), w = hn(e.placement), M = !w, y = Es(b), O = Am(y), k = e.modifiersData.popperOffsets, I = e.rects.reference, B = e.rects.popper, E = typeof m == "function" ? m(Object.assign({}, e.rects, {
|
|
12704
12707
|
placement: e.placement
|
|
12705
12708
|
})) : m, z = typeof E == "number" ? {
|
|
12706
12709
|
mainAxis: E,
|
|
@@ -12714,15 +12717,15 @@ function Dm(n) {
|
|
|
12714
12717
|
};
|
|
12715
12718
|
if (k) {
|
|
12716
12719
|
if (s) {
|
|
12717
|
-
var j, ge = y === "y" ? pe : he, ye = y === "y" ? Te : Ee, te = y === "y" ? "height" : "width", ne = k[y], Y = ne + g[ge],
|
|
12720
|
+
var j, ge = y === "y" ? pe : he, ye = y === "y" ? Te : Ee, te = y === "y" ? "height" : "width", ne = k[y], Y = ne + g[ge], Pe = ne - g[ye], Be = p ? -B[te] / 2 : 0, xt = w === dn ? I[te] : B[te], Le = w === dn ? -B[te] : -I[te], wt = e.elements.arrow, qe = p && wt ? Ts(wt) : {
|
|
12718
12721
|
width: 0,
|
|
12719
12722
|
height: 0
|
|
12720
|
-
},
|
|
12723
|
+
}, Ae = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : ec(), Ke = Ae[ge], Ht = Ae[ye], _e = In(0, I[te], qe[te]), jt = M ? I[te] / 2 - Be - _e - Ke - z.mainAxis : xt - _e - Ke - z.mainAxis, tt = M ? -I[te] / 2 + Be + _e + Ht + z.mainAxis : Le + _e + Ht + z.mainAxis, Wt = e.elements.arrow && er(e.elements.arrow), tr = Wt ? y === "y" ? Wt.clientTop || 0 : Wt.clientLeft || 0 : 0, bn = (j = $?.[y]) != null ? j : 0, nr = ne + jt - bn - tr, rr = ne + tt - bn, vn = In(p ? $r(Y, nr) : Y, ne, p ? Pt(Pe, rr) : Pe);
|
|
12721
12724
|
k[y] = vn, H[y] = vn - ne;
|
|
12722
12725
|
}
|
|
12723
12726
|
if (l) {
|
|
12724
|
-
var kn,
|
|
12725
|
-
k[O] =
|
|
12727
|
+
var kn, ir = y === "x" ? pe : he, sr = y === "x" ? Te : Ee, Je = k[O], nt = O === "y" ? "height" : "width", xn = Je + g[ir], St = Je - g[sr], wn = [pe, he].indexOf(b) !== -1, or = (kn = $?.[O]) != null ? kn : 0, lr = wn ? xn : Je - I[nt] - B[nt] - or + z.altAxis, ar = wn ? Je + I[nt] + B[nt] - or - z.altAxis : St, cr = p && wn ? tm(lr, Je, ar) : In(p ? lr : xn, Je, p ? ar : St);
|
|
12728
|
+
k[O] = cr, H[O] = cr - Je;
|
|
12726
12729
|
}
|
|
12727
12730
|
e.modifiersData[r] = H;
|
|
12728
12731
|
}
|
|
@@ -12741,7 +12744,7 @@ function Rm(n) {
|
|
|
12741
12744
|
};
|
|
12742
12745
|
}
|
|
12743
12746
|
function Pm(n) {
|
|
12744
|
-
return n === ke(n) || !Oe(n) ?
|
|
12747
|
+
return n === ke(n) || !Oe(n) ? Ns(n) : Rm(n);
|
|
12745
12748
|
}
|
|
12746
12749
|
function Bm(n) {
|
|
12747
12750
|
var e = n.getBoundingClientRect(), t = fn(e.width) / n.offsetWidth || 1, r = fn(e.height) / n.offsetHeight || 1;
|
|
@@ -12756,8 +12759,8 @@ function Lm(n, e, t) {
|
|
|
12756
12759
|
x: 0,
|
|
12757
12760
|
y: 0
|
|
12758
12761
|
};
|
|
12759
|
-
return (r || !r && !t) && ((
|
|
12760
|
-
Ds(s)) && (l = Pm(e)), Oe(e) ? (a = pn(e, !0), a.x += e.clientLeft, a.y += e.clientTop) : s && (a.x =
|
|
12762
|
+
return (r || !r && !t) && ((We(e) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
12763
|
+
Ds(s)) && (l = Pm(e)), Oe(e) ? (a = pn(e, !0), a.x += e.clientLeft, a.y += e.clientTop) : s && (a.x = As(s))), {
|
|
12761
12764
|
x: o.left + l.scrollLeft - a.x,
|
|
12762
12765
|
y: o.top + l.scrollTop - a.y,
|
|
12763
12766
|
width: o.width,
|
|
@@ -12864,7 +12867,7 @@ function Hm(n) {
|
|
|
12864
12867
|
var b = u.elements, w = b.reference, M = b.popper;
|
|
12865
12868
|
if (Qo(w, M)) {
|
|
12866
12869
|
u.rects = {
|
|
12867
|
-
reference: Lm(w,
|
|
12870
|
+
reference: Lm(w, er(M), u.options.strategy === "fixed"),
|
|
12868
12871
|
popper: Ts(M)
|
|
12869
12872
|
}, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(z) {
|
|
12870
12873
|
return u.modifiersData[z.name] = Object.assign({}, z.data);
|
|
@@ -12924,7 +12927,7 @@ function Hm(n) {
|
|
|
12924
12927
|
return p;
|
|
12925
12928
|
};
|
|
12926
12929
|
}
|
|
12927
|
-
var jm = [dm,
|
|
12930
|
+
var jm = [dm, Nm, cm, Xa, Tm, wm, Im, sm, Mm], Wm = /* @__PURE__ */ Hm({
|
|
12928
12931
|
defaultModifiers: jm
|
|
12929
12932
|
}), qm = "tippy-box", sc = "tippy-content", Km = "tippy-backdrop", oc = "tippy-arrow", lc = "tippy-svg-arrow", Ct = {
|
|
12930
12933
|
passive: !0,
|
|
@@ -12935,7 +12938,7 @@ var jm = [dm, Am, cm, Xa, Tm, wm, Im, sm, Mm], Wm = /* @__PURE__ */ Hm({
|
|
|
12935
12938
|
function _m(n, e) {
|
|
12936
12939
|
return {}.hasOwnProperty.call(n, e);
|
|
12937
12940
|
}
|
|
12938
|
-
function
|
|
12941
|
+
function Si(n, e, t) {
|
|
12939
12942
|
if (Array.isArray(n)) {
|
|
12940
12943
|
var r = n[e];
|
|
12941
12944
|
return r ?? (Array.isArray(t) ? t[e] : t);
|
|
@@ -12982,7 +12985,7 @@ function Gm(n) {
|
|
|
12982
12985
|
function Ym(n) {
|
|
12983
12986
|
return n.split("-")[0];
|
|
12984
12987
|
}
|
|
12985
|
-
function
|
|
12988
|
+
function Hr(n) {
|
|
12986
12989
|
return [].slice.call(n);
|
|
12987
12990
|
}
|
|
12988
12991
|
function nl(n) {
|
|
@@ -12993,7 +12996,7 @@ function nl(n) {
|
|
|
12993
12996
|
function Pn() {
|
|
12994
12997
|
return document.createElement("div");
|
|
12995
12998
|
}
|
|
12996
|
-
function
|
|
12999
|
+
function _n(n) {
|
|
12997
13000
|
return ["Element", "Fragment"].some(function(e) {
|
|
12998
13001
|
return Is(n, e);
|
|
12999
13002
|
});
|
|
@@ -13008,9 +13011,9 @@ function Qm(n) {
|
|
|
13008
13011
|
return !!(n && n._tippy && n._tippy.reference === n);
|
|
13009
13012
|
}
|
|
13010
13013
|
function eg(n) {
|
|
13011
|
-
return
|
|
13014
|
+
return _n(n) ? [n] : Xm(n) ? Hr(n) : Array.isArray(n) ? n : Hr(document.querySelectorAll(n));
|
|
13012
13015
|
}
|
|
13013
|
-
function
|
|
13016
|
+
function Mi(n, e) {
|
|
13014
13017
|
n.forEach(function(t) {
|
|
13015
13018
|
t && (t.style.transitionDuration = e + "ms");
|
|
13016
13019
|
});
|
|
@@ -13034,7 +13037,7 @@ function ng(n, e) {
|
|
|
13034
13037
|
return m || g || b || w;
|
|
13035
13038
|
});
|
|
13036
13039
|
}
|
|
13037
|
-
function
|
|
13040
|
+
function Ci(n, e, t) {
|
|
13038
13041
|
var r = e + "EventListener";
|
|
13039
13042
|
["transitionend", "webkitTransitionEnd"].forEach(function(i) {
|
|
13040
13043
|
n[r](i, t);
|
|
@@ -13049,15 +13052,15 @@ function il(n, e) {
|
|
|
13049
13052
|
}
|
|
13050
13053
|
return !1;
|
|
13051
13054
|
}
|
|
13052
|
-
var
|
|
13055
|
+
var Ve = {
|
|
13053
13056
|
isTouch: !1
|
|
13054
13057
|
}, sl = 0;
|
|
13055
13058
|
function rg() {
|
|
13056
|
-
|
|
13059
|
+
Ve.isTouch || (Ve.isTouch = !0, window.performance && document.addEventListener("mousemove", uc));
|
|
13057
13060
|
}
|
|
13058
13061
|
function uc() {
|
|
13059
13062
|
var n = performance.now();
|
|
13060
|
-
n - sl < 20 && (
|
|
13063
|
+
n - sl < 20 && (Ve.isTouch = !1, document.removeEventListener("mousemove", uc)), sl = n;
|
|
13061
13064
|
}
|
|
13062
13065
|
function ig() {
|
|
13063
13066
|
var n = document.activeElement;
|
|
@@ -13101,21 +13104,21 @@ function dc(n) {
|
|
|
13101
13104
|
"color: #a6a095;"
|
|
13102
13105
|
];
|
|
13103
13106
|
}
|
|
13104
|
-
var
|
|
13107
|
+
var Jn;
|
|
13105
13108
|
process.env.NODE_ENV !== "production" && cg();
|
|
13106
13109
|
function cg() {
|
|
13107
|
-
|
|
13110
|
+
Jn = /* @__PURE__ */ new Set();
|
|
13108
13111
|
}
|
|
13109
|
-
function
|
|
13110
|
-
if (n && !
|
|
13112
|
+
function Ye(n, e) {
|
|
13113
|
+
if (n && !Jn.has(e)) {
|
|
13111
13114
|
var t;
|
|
13112
|
-
|
|
13115
|
+
Jn.add(e), (t = console).warn.apply(t, dc(e));
|
|
13113
13116
|
}
|
|
13114
13117
|
}
|
|
13115
13118
|
function Zi(n, e) {
|
|
13116
|
-
if (n && !
|
|
13119
|
+
if (n && !Jn.has(e)) {
|
|
13117
13120
|
var t;
|
|
13118
|
-
|
|
13121
|
+
Jn.add(e), (t = console).error.apply(t, dc(e));
|
|
13119
13122
|
}
|
|
13120
13123
|
}
|
|
13121
13124
|
function ug(n) {
|
|
@@ -13238,7 +13241,7 @@ function hc(n, e) {
|
|
|
13238
13241
|
var i = Jm(ve, Object.keys(fc)), s = !_m(i, r);
|
|
13239
13242
|
s && (s = e.filter(function(o) {
|
|
13240
13243
|
return o.name === r;
|
|
13241
|
-
}).length === 0),
|
|
13244
|
+
}).length === 0), Ye(s, ["`" + r + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", "a plugin, forgot to pass it in an array as props.plugins.", `
|
|
13242
13245
|
|
|
13243
13246
|
`, `All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
13244
13247
|
`, "Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "));
|
|
@@ -13252,13 +13255,13 @@ function Qi(n, e) {
|
|
|
13252
13255
|
}
|
|
13253
13256
|
function al(n) {
|
|
13254
13257
|
var e = Pn();
|
|
13255
|
-
return n === !0 ? e.className = oc : (e.className = lc,
|
|
13258
|
+
return n === !0 ? e.className = oc : (e.className = lc, _n(n) ? e.appendChild(n) : Qi(e, n)), e;
|
|
13256
13259
|
}
|
|
13257
13260
|
function cl(n, e) {
|
|
13258
|
-
|
|
13261
|
+
_n(e.content) ? (Qi(n, ""), n.appendChild(e.content)) : typeof e.content != "function" && (e.allowHTML ? Qi(n, e.content) : n.textContent = e.content);
|
|
13259
13262
|
}
|
|
13260
13263
|
function es(n) {
|
|
13261
|
-
var e = n.firstElementChild, t =
|
|
13264
|
+
var e = n.firstElementChild, t = Hr(e.children);
|
|
13262
13265
|
return {
|
|
13263
13266
|
box: e,
|
|
13264
13267
|
content: t.find(function(r) {
|
|
@@ -13287,9 +13290,9 @@ function mc(n) {
|
|
|
13287
13290
|
};
|
|
13288
13291
|
}
|
|
13289
13292
|
mc.$$tippy = !0;
|
|
13290
|
-
var gg = 1,
|
|
13293
|
+
var gg = 1, kr = [], Oi = [];
|
|
13291
13294
|
function yg(n, e) {
|
|
13292
|
-
var t = ll(n, Object.assign({}, ve, pc(nl(e)))), r, i, s, o = !1, l = !1, a = !1, c = !1, u, d, f, p = [], h = el(
|
|
13295
|
+
var t = ll(n, Object.assign({}, ve, pc(nl(e)))), r, i, s, o = !1, l = !1, a = !1, c = !1, u, d, f, p = [], h = el(nr, t.interactiveDebounce), m, g = gg++, b = null, w = Gm(t.plugins), M = {
|
|
13293
13296
|
// Is the instance currently enabled?
|
|
13294
13297
|
isEnabled: !0,
|
|
13295
13298
|
// Is the tippy currently showing and not transitioning out?
|
|
@@ -13310,14 +13313,14 @@ function yg(n, e) {
|
|
|
13310
13313
|
state: M,
|
|
13311
13314
|
plugins: w,
|
|
13312
13315
|
// methods
|
|
13313
|
-
clearDelayTimeouts:
|
|
13314
|
-
setProps:
|
|
13315
|
-
setContent:
|
|
13316
|
+
clearDelayTimeouts: lr,
|
|
13317
|
+
setProps: ar,
|
|
13318
|
+
setContent: cr,
|
|
13316
13319
|
show: wc,
|
|
13317
13320
|
hide: Sc,
|
|
13318
13321
|
hideWithInteractivity: Mc,
|
|
13319
13322
|
enable: wn,
|
|
13320
|
-
disable:
|
|
13323
|
+
disable: or,
|
|
13321
13324
|
unmount: Cc,
|
|
13322
13325
|
destroy: Oc
|
|
13323
13326
|
};
|
|
@@ -13328,7 +13331,7 @@ function yg(n, e) {
|
|
|
13328
13331
|
var B = w.map(function(v) {
|
|
13329
13332
|
return v.fn(y);
|
|
13330
13333
|
}), E = n.hasAttribute("aria-expanded");
|
|
13331
|
-
return Wt(),
|
|
13334
|
+
return Wt(), Be(), ne(), Y("onCreate", [y]), t.showOnCreate && xn(), k.addEventListener("mouseenter", function() {
|
|
13332
13335
|
y.props.interactive && y.state.isVisible && y.clearDelayTimeouts();
|
|
13333
13336
|
}), k.addEventListener("mouseleave", function() {
|
|
13334
13337
|
y.props.interactive && y.props.trigger.indexOf("mouseenter") >= 0 && ge().addEventListener("mousemove", h);
|
|
@@ -13355,35 +13358,35 @@ function yg(n, e) {
|
|
|
13355
13358
|
return es(k);
|
|
13356
13359
|
}
|
|
13357
13360
|
function te(v) {
|
|
13358
|
-
return y.state.isMounted && !y.state.isVisible ||
|
|
13361
|
+
return y.state.isMounted && !y.state.isVisible || Ve.isTouch || u && u.type === "focus" ? 0 : Si(y.props.delay, v ? 0 : 1, ve.delay);
|
|
13359
13362
|
}
|
|
13360
13363
|
function ne(v) {
|
|
13361
13364
|
v === void 0 && (v = !1), k.style.pointerEvents = y.props.interactive && !v ? "" : "none", k.style.zIndex = "" + y.props.zIndex;
|
|
13362
13365
|
}
|
|
13363
|
-
function Y(v, T,
|
|
13364
|
-
if (
|
|
13366
|
+
function Y(v, T, A) {
|
|
13367
|
+
if (A === void 0 && (A = !0), B.forEach(function(L) {
|
|
13365
13368
|
L[v] && L[v].apply(L, T);
|
|
13366
|
-
}),
|
|
13369
|
+
}), A) {
|
|
13367
13370
|
var V;
|
|
13368
13371
|
(V = y.props)[v].apply(V, T);
|
|
13369
13372
|
}
|
|
13370
13373
|
}
|
|
13371
|
-
function
|
|
13374
|
+
function Pe() {
|
|
13372
13375
|
var v = y.props.aria;
|
|
13373
13376
|
if (v.content) {
|
|
13374
|
-
var T = "aria-" + v.content,
|
|
13377
|
+
var T = "aria-" + v.content, A = k.id, V = Xt(y.props.triggerTarget || n);
|
|
13375
13378
|
V.forEach(function(L) {
|
|
13376
13379
|
var le = L.getAttribute(T);
|
|
13377
13380
|
if (y.state.isVisible)
|
|
13378
|
-
L.setAttribute(T, le ? le + " " +
|
|
13381
|
+
L.setAttribute(T, le ? le + " " + A : A);
|
|
13379
13382
|
else {
|
|
13380
|
-
var xe = le && le.replace(
|
|
13383
|
+
var xe = le && le.replace(A, "").trim();
|
|
13381
13384
|
xe ? L.setAttribute(T, xe) : L.removeAttribute(T);
|
|
13382
13385
|
}
|
|
13383
13386
|
});
|
|
13384
13387
|
}
|
|
13385
13388
|
}
|
|
13386
|
-
function
|
|
13389
|
+
function Be() {
|
|
13387
13390
|
if (!(E || !y.props.aria.expanded)) {
|
|
13388
13391
|
var v = Xt(y.props.triggerTarget || n);
|
|
13389
13392
|
v.forEach(function(T) {
|
|
@@ -13392,80 +13395,80 @@ function yg(n, e) {
|
|
|
13392
13395
|
}
|
|
13393
13396
|
}
|
|
13394
13397
|
function xt() {
|
|
13395
|
-
ge().removeEventListener("mousemove", h),
|
|
13398
|
+
ge().removeEventListener("mousemove", h), kr = kr.filter(function(v) {
|
|
13396
13399
|
return v !== h;
|
|
13397
13400
|
});
|
|
13398
13401
|
}
|
|
13399
|
-
function
|
|
13400
|
-
if (!(
|
|
13402
|
+
function Le(v) {
|
|
13403
|
+
if (!(Ve.isTouch && (a || v.type === "mousedown"))) {
|
|
13401
13404
|
var T = v.composedPath && v.composedPath()[0] || v.target;
|
|
13402
13405
|
if (!(y.props.interactive && il(k, T))) {
|
|
13403
|
-
if (Xt(y.props.triggerTarget || n).some(function(
|
|
13404
|
-
return il(
|
|
13406
|
+
if (Xt(y.props.triggerTarget || n).some(function(A) {
|
|
13407
|
+
return il(A, T);
|
|
13405
13408
|
})) {
|
|
13406
|
-
if (
|
|
13409
|
+
if (Ve.isTouch || y.state.isVisible && y.props.trigger.indexOf("click") >= 0)
|
|
13407
13410
|
return;
|
|
13408
13411
|
} else
|
|
13409
13412
|
Y("onClickOutside", [y, v]);
|
|
13410
13413
|
y.props.hideOnClick === !0 && (y.clearDelayTimeouts(), y.hide(), l = !0, setTimeout(function() {
|
|
13411
13414
|
l = !1;
|
|
13412
|
-
}), y.state.isMounted ||
|
|
13415
|
+
}), y.state.isMounted || Ke());
|
|
13413
13416
|
}
|
|
13414
13417
|
}
|
|
13415
13418
|
}
|
|
13416
13419
|
function wt() {
|
|
13417
13420
|
a = !0;
|
|
13418
13421
|
}
|
|
13419
|
-
function
|
|
13422
|
+
function qe() {
|
|
13420
13423
|
a = !1;
|
|
13421
13424
|
}
|
|
13422
|
-
function
|
|
13425
|
+
function Ae() {
|
|
13423
13426
|
var v = ge();
|
|
13424
|
-
v.addEventListener("mousedown",
|
|
13427
|
+
v.addEventListener("mousedown", Le, !0), v.addEventListener("touchend", Le, Ct), v.addEventListener("touchstart", qe, Ct), v.addEventListener("touchmove", wt, Ct);
|
|
13425
13428
|
}
|
|
13426
|
-
function
|
|
13429
|
+
function Ke() {
|
|
13427
13430
|
var v = ge();
|
|
13428
|
-
v.removeEventListener("mousedown",
|
|
13431
|
+
v.removeEventListener("mousedown", Le, !0), v.removeEventListener("touchend", Le, Ct), v.removeEventListener("touchstart", qe, Ct), v.removeEventListener("touchmove", wt, Ct);
|
|
13429
13432
|
}
|
|
13430
13433
|
function Ht(v, T) {
|
|
13431
13434
|
jt(v, function() {
|
|
13432
13435
|
!y.state.isVisible && k.parentNode && k.parentNode.contains(k) && T();
|
|
13433
13436
|
});
|
|
13434
13437
|
}
|
|
13435
|
-
function
|
|
13438
|
+
function _e(v, T) {
|
|
13436
13439
|
jt(v, T);
|
|
13437
13440
|
}
|
|
13438
13441
|
function jt(v, T) {
|
|
13439
|
-
var
|
|
13442
|
+
var A = ye().box;
|
|
13440
13443
|
function V(L) {
|
|
13441
|
-
L.target ===
|
|
13444
|
+
L.target === A && (Ci(A, "remove", V), T());
|
|
13442
13445
|
}
|
|
13443
13446
|
if (v === 0)
|
|
13444
13447
|
return T();
|
|
13445
|
-
|
|
13448
|
+
Ci(A, "remove", d), Ci(A, "add", V), d = V;
|
|
13446
13449
|
}
|
|
13447
|
-
function tt(v, T,
|
|
13448
|
-
|
|
13450
|
+
function tt(v, T, A) {
|
|
13451
|
+
A === void 0 && (A = !1);
|
|
13449
13452
|
var V = Xt(y.props.triggerTarget || n);
|
|
13450
13453
|
V.forEach(function(L) {
|
|
13451
|
-
L.addEventListener(v, T,
|
|
13454
|
+
L.addEventListener(v, T, A), p.push({
|
|
13452
13455
|
node: L,
|
|
13453
13456
|
eventType: v,
|
|
13454
13457
|
handler: T,
|
|
13455
|
-
options:
|
|
13458
|
+
options: A
|
|
13456
13459
|
});
|
|
13457
13460
|
});
|
|
13458
13461
|
}
|
|
13459
13462
|
function Wt() {
|
|
13460
13463
|
$() && (tt("touchstart", bn, {
|
|
13461
13464
|
passive: !0
|
|
13462
|
-
}), tt("touchend",
|
|
13465
|
+
}), tt("touchend", rr, {
|
|
13463
13466
|
passive: !0
|
|
13464
13467
|
})), Um(y.props.trigger).forEach(function(v) {
|
|
13465
13468
|
if (v !== "manual")
|
|
13466
13469
|
switch (tt(v, bn), v) {
|
|
13467
13470
|
case "mouseenter":
|
|
13468
|
-
tt("mouseleave",
|
|
13471
|
+
tt("mouseleave", rr);
|
|
13469
13472
|
break;
|
|
13470
13473
|
case "focus":
|
|
13471
13474
|
tt(lg ? "focusout" : "blur", vn);
|
|
@@ -13476,24 +13479,24 @@ function yg(n, e) {
|
|
|
13476
13479
|
}
|
|
13477
13480
|
});
|
|
13478
13481
|
}
|
|
13479
|
-
function
|
|
13482
|
+
function tr() {
|
|
13480
13483
|
p.forEach(function(v) {
|
|
13481
|
-
var T = v.node,
|
|
13482
|
-
T.removeEventListener(
|
|
13484
|
+
var T = v.node, A = v.eventType, V = v.handler, L = v.options;
|
|
13485
|
+
T.removeEventListener(A, V, L);
|
|
13483
13486
|
}), p = [];
|
|
13484
13487
|
}
|
|
13485
13488
|
function bn(v) {
|
|
13486
|
-
var T,
|
|
13489
|
+
var T, A = !1;
|
|
13487
13490
|
if (!(!y.state.isEnabled || kn(v) || l)) {
|
|
13488
13491
|
var V = ((T = u) == null ? void 0 : T.type) === "focus";
|
|
13489
|
-
u = v, m = v.currentTarget,
|
|
13492
|
+
u = v, m = v.currentTarget, Be(), !y.state.isVisible && Zm(v) && kr.forEach(function(L) {
|
|
13490
13493
|
return L(v);
|
|
13491
|
-
}), v.type === "click" && (y.props.trigger.indexOf("mouseenter") < 0 || o) && y.props.hideOnClick !== !1 && y.state.isVisible ?
|
|
13494
|
+
}), v.type === "click" && (y.props.trigger.indexOf("mouseenter") < 0 || o) && y.props.hideOnClick !== !1 && y.state.isVisible ? A = !0 : xn(v), v.type === "click" && (o = !A), A && !V && St(v);
|
|
13492
13495
|
}
|
|
13493
13496
|
}
|
|
13494
|
-
function
|
|
13495
|
-
var T = v.target,
|
|
13496
|
-
if (!(v.type === "mousemove" &&
|
|
13497
|
+
function nr(v) {
|
|
13498
|
+
var T = v.target, A = j().contains(T) || k.contains(T);
|
|
13499
|
+
if (!(v.type === "mousemove" && A)) {
|
|
13497
13500
|
var V = nt().concat(k).map(function(L) {
|
|
13498
13501
|
var le, xe = L._tippy, qt = (le = xe.popperInstance) == null ? void 0 : le.state;
|
|
13499
13502
|
return qt ? {
|
|
@@ -13505,7 +13508,7 @@ function yg(n, e) {
|
|
|
13505
13508
|
ng(V, v) && (xt(), St(v));
|
|
13506
13509
|
}
|
|
13507
13510
|
}
|
|
13508
|
-
function
|
|
13511
|
+
function rr(v) {
|
|
13509
13512
|
var T = kn(v) || y.props.trigger.indexOf("click") >= 0 && o;
|
|
13510
13513
|
if (!T) {
|
|
13511
13514
|
if (y.props.interactive) {
|
|
@@ -13519,11 +13522,11 @@ function yg(n, e) {
|
|
|
13519
13522
|
y.props.trigger.indexOf("focusin") < 0 && v.target !== j() || y.props.interactive && v.relatedTarget && k.contains(v.relatedTarget) || St(v);
|
|
13520
13523
|
}
|
|
13521
13524
|
function kn(v) {
|
|
13522
|
-
return
|
|
13525
|
+
return Ve.isTouch ? $() !== v.type.indexOf("touch") >= 0 : !1;
|
|
13523
13526
|
}
|
|
13524
|
-
function
|
|
13525
|
-
|
|
13526
|
-
var v = y.props, T = v.popperOptions,
|
|
13527
|
+
function ir() {
|
|
13528
|
+
sr();
|
|
13529
|
+
var v = y.props, T = v.popperOptions, A = v.placement, V = v.offset, L = v.getReferenceClientRect, le = v.moveTransition, xe = H() ? es(k).arrow : null, qt = L ? {
|
|
13527
13530
|
getBoundingClientRect: L,
|
|
13528
13531
|
contextElement: L.contextElement || j()
|
|
13529
13532
|
} : n, Ps = {
|
|
@@ -13531,12 +13534,12 @@ function yg(n, e) {
|
|
|
13531
13534
|
enabled: !0,
|
|
13532
13535
|
phase: "beforeWrite",
|
|
13533
13536
|
requires: ["computeStyles"],
|
|
13534
|
-
fn: function(
|
|
13535
|
-
var Kt =
|
|
13537
|
+
fn: function(ur) {
|
|
13538
|
+
var Kt = ur.state;
|
|
13536
13539
|
if (H()) {
|
|
13537
|
-
var Tc = ye(),
|
|
13538
|
-
["placement", "reference-hidden", "escaped"].forEach(function(
|
|
13539
|
-
|
|
13540
|
+
var Tc = ye(), ii = Tc.box;
|
|
13541
|
+
["placement", "reference-hidden", "escaped"].forEach(function(dr) {
|
|
13542
|
+
dr === "placement" ? ii.setAttribute("data-placement", Kt.placement) : Kt.attributes.popper["data-popper-" + dr] ? ii.setAttribute("data-" + dr, "") : ii.removeAttribute("data-" + dr);
|
|
13540
13543
|
}), Kt.attributes.popper = {};
|
|
13541
13544
|
}
|
|
13542
13545
|
}
|
|
@@ -13573,17 +13576,17 @@ function yg(n, e) {
|
|
|
13573
13576
|
padding: 3
|
|
13574
13577
|
}
|
|
13575
13578
|
}), Mt.push.apply(Mt, T?.modifiers || []), y.popperInstance = Wm(qt, k, Object.assign({}, T, {
|
|
13576
|
-
placement:
|
|
13579
|
+
placement: A,
|
|
13577
13580
|
onFirstUpdate: f,
|
|
13578
13581
|
modifiers: Mt
|
|
13579
13582
|
}));
|
|
13580
13583
|
}
|
|
13581
|
-
function
|
|
13584
|
+
function sr() {
|
|
13582
13585
|
y.popperInstance && (y.popperInstance.destroy(), y.popperInstance = null);
|
|
13583
13586
|
}
|
|
13584
|
-
function
|
|
13585
|
-
var v = y.props.appendTo, T,
|
|
13586
|
-
y.props.interactive && v === ac || v === "parent" ? T =
|
|
13587
|
+
function Je() {
|
|
13588
|
+
var v = y.props.appendTo, T, A = j();
|
|
13589
|
+
y.props.interactive && v === ac || v === "parent" ? T = A.parentNode : T = cc(v, [A]), T.contains(k) || T.appendChild(k), y.state.isMounted = !0, ir(), process.env.NODE_ENV !== "production" && Ye(y.props.interactive && v === ve.appendTo && A.nextElementSibling !== k, ["Interactive tippy element may not be accessible via keyboard", "navigation because it is not directly after the reference element", "in the DOM source order.", `
|
|
13587
13590
|
|
|
13588
13591
|
`, "Using a wrapper <div> or <span> tag around the reference element", "solves this by creating a new parentNode context.", `
|
|
13589
13592
|
|
|
@@ -13592,18 +13595,18 @@ function yg(n, e) {
|
|
|
13592
13595
|
`, "See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "));
|
|
13593
13596
|
}
|
|
13594
13597
|
function nt() {
|
|
13595
|
-
return
|
|
13598
|
+
return Hr(k.querySelectorAll("[data-tippy-root]"));
|
|
13596
13599
|
}
|
|
13597
13600
|
function xn(v) {
|
|
13598
|
-
y.clearDelayTimeouts(), v && Y("onTrigger", [y, v]),
|
|
13599
|
-
var T = te(!0),
|
|
13600
|
-
|
|
13601
|
+
y.clearDelayTimeouts(), v && Y("onTrigger", [y, v]), Ae();
|
|
13602
|
+
var T = te(!0), A = z(), V = A[0], L = A[1];
|
|
13603
|
+
Ve.isTouch && V === "hold" && L && (T = L), T ? r = setTimeout(function() {
|
|
13601
13604
|
y.show();
|
|
13602
13605
|
}, T) : y.show();
|
|
13603
13606
|
}
|
|
13604
13607
|
function St(v) {
|
|
13605
13608
|
if (y.clearDelayTimeouts(), Y("onUntrigger", [y, v]), !y.state.isVisible) {
|
|
13606
|
-
|
|
13609
|
+
Ke();
|
|
13607
13610
|
return;
|
|
13608
13611
|
}
|
|
13609
13612
|
if (!(y.props.trigger.indexOf("mouseenter") >= 0 && y.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(v.type) >= 0 && o)) {
|
|
@@ -13618,75 +13621,75 @@ function yg(n, e) {
|
|
|
13618
13621
|
function wn() {
|
|
13619
13622
|
y.state.isEnabled = !0;
|
|
13620
13623
|
}
|
|
13621
|
-
function
|
|
13624
|
+
function or() {
|
|
13622
13625
|
y.hide(), y.state.isEnabled = !1;
|
|
13623
13626
|
}
|
|
13624
|
-
function
|
|
13627
|
+
function lr() {
|
|
13625
13628
|
clearTimeout(r), clearTimeout(i), cancelAnimationFrame(s);
|
|
13626
13629
|
}
|
|
13627
|
-
function
|
|
13628
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
13629
|
-
Y("onBeforeUpdate", [y, v]),
|
|
13630
|
-
var T = y.props,
|
|
13630
|
+
function ar(v) {
|
|
13631
|
+
if (process.env.NODE_ENV !== "production" && Ye(y.state.isDestroyed, Ut("setProps")), !y.state.isDestroyed) {
|
|
13632
|
+
Y("onBeforeUpdate", [y, v]), tr();
|
|
13633
|
+
var T = y.props, A = ll(n, Object.assign({}, T, nl(v), {
|
|
13631
13634
|
ignoreAttributes: !0
|
|
13632
13635
|
}));
|
|
13633
|
-
y.props =
|
|
13636
|
+
y.props = A, Wt(), T.interactiveDebounce !== A.interactiveDebounce && (xt(), h = el(nr, A.interactiveDebounce)), T.triggerTarget && !A.triggerTarget ? Xt(T.triggerTarget).forEach(function(V) {
|
|
13634
13637
|
V.removeAttribute("aria-expanded");
|
|
13635
|
-
}) :
|
|
13638
|
+
}) : A.triggerTarget && n.removeAttribute("aria-expanded"), Be(), ne(), I && I(T, A), y.popperInstance && (ir(), nt().forEach(function(V) {
|
|
13636
13639
|
requestAnimationFrame(V._tippy.popperInstance.forceUpdate);
|
|
13637
13640
|
})), Y("onAfterUpdate", [y, v]);
|
|
13638
13641
|
}
|
|
13639
13642
|
}
|
|
13640
|
-
function
|
|
13643
|
+
function cr(v) {
|
|
13641
13644
|
y.setProps({
|
|
13642
13645
|
content: v
|
|
13643
13646
|
});
|
|
13644
13647
|
}
|
|
13645
13648
|
function wc() {
|
|
13646
|
-
process.env.NODE_ENV !== "production" &&
|
|
13647
|
-
var v = y.state.isVisible, T = y.state.isDestroyed,
|
|
13648
|
-
if (!(v || T ||
|
|
13649
|
-
if (y.state.isVisible = !0, H() && (k.style.visibility = "visible"), ne(),
|
|
13649
|
+
process.env.NODE_ENV !== "production" && Ye(y.state.isDestroyed, Ut("show"));
|
|
13650
|
+
var v = y.state.isVisible, T = y.state.isDestroyed, A = !y.state.isEnabled, V = Ve.isTouch && !y.props.touch, L = Si(y.props.duration, 0, ve.duration);
|
|
13651
|
+
if (!(v || T || A || V) && !j().hasAttribute("disabled") && (Y("onShow", [y], !1), y.props.onShow(y) !== !1)) {
|
|
13652
|
+
if (y.state.isVisible = !0, H() && (k.style.visibility = "visible"), ne(), Ae(), y.state.isMounted || (k.style.transition = "none"), H()) {
|
|
13650
13653
|
var le = ye(), xe = le.box, qt = le.content;
|
|
13651
|
-
|
|
13654
|
+
Mi([xe, qt], 0);
|
|
13652
13655
|
}
|
|
13653
13656
|
f = function() {
|
|
13654
13657
|
var Mt;
|
|
13655
13658
|
if (!(!y.state.isVisible || c)) {
|
|
13656
13659
|
if (c = !0, k.offsetHeight, k.style.transition = y.props.moveTransition, H() && y.props.animation) {
|
|
13657
|
-
var
|
|
13658
|
-
|
|
13660
|
+
var ri = ye(), ur = ri.box, Kt = ri.content;
|
|
13661
|
+
Mi([ur, Kt], L), rl([ur, Kt], "visible");
|
|
13659
13662
|
}
|
|
13660
|
-
|
|
13663
|
+
Pe(), Be(), tl(Oi, y), (Mt = y.popperInstance) == null || Mt.forceUpdate(), Y("onMount", [y]), y.props.animation && H() && _e(L, function() {
|
|
13661
13664
|
y.state.isShown = !0, Y("onShown", [y]);
|
|
13662
13665
|
});
|
|
13663
13666
|
}
|
|
13664
|
-
},
|
|
13667
|
+
}, Je();
|
|
13665
13668
|
}
|
|
13666
13669
|
}
|
|
13667
13670
|
function Sc() {
|
|
13668
|
-
process.env.NODE_ENV !== "production" &&
|
|
13669
|
-
var v = !y.state.isVisible, T = y.state.isDestroyed,
|
|
13670
|
-
if (!(v || T ||
|
|
13671
|
-
if (y.state.isVisible = !1, y.state.isShown = !1, c = !1, o = !1, H() && (k.style.visibility = "hidden"), xt(),
|
|
13671
|
+
process.env.NODE_ENV !== "production" && Ye(y.state.isDestroyed, Ut("hide"));
|
|
13672
|
+
var v = !y.state.isVisible, T = y.state.isDestroyed, A = !y.state.isEnabled, V = Si(y.props.duration, 1, ve.duration);
|
|
13673
|
+
if (!(v || T || A) && (Y("onHide", [y], !1), y.props.onHide(y) !== !1)) {
|
|
13674
|
+
if (y.state.isVisible = !1, y.state.isShown = !1, c = !1, o = !1, H() && (k.style.visibility = "hidden"), xt(), Ke(), ne(!0), H()) {
|
|
13672
13675
|
var L = ye(), le = L.box, xe = L.content;
|
|
13673
|
-
y.props.animation && (
|
|
13676
|
+
y.props.animation && (Mi([le, xe], V), rl([le, xe], "hidden"));
|
|
13674
13677
|
}
|
|
13675
|
-
|
|
13678
|
+
Pe(), Be(), y.props.animation ? H() && Ht(V, y.unmount) : y.unmount();
|
|
13676
13679
|
}
|
|
13677
13680
|
}
|
|
13678
13681
|
function Mc(v) {
|
|
13679
|
-
process.env.NODE_ENV !== "production" &&
|
|
13682
|
+
process.env.NODE_ENV !== "production" && Ye(y.state.isDestroyed, Ut("hideWithInteractivity")), ge().addEventListener("mousemove", h), tl(kr, h), h(v);
|
|
13680
13683
|
}
|
|
13681
13684
|
function Cc() {
|
|
13682
|
-
process.env.NODE_ENV !== "production" &&
|
|
13685
|
+
process.env.NODE_ENV !== "production" && Ye(y.state.isDestroyed, Ut("unmount")), y.state.isVisible && y.hide(), y.state.isMounted && (sr(), nt().forEach(function(v) {
|
|
13683
13686
|
v._tippy.unmount();
|
|
13684
|
-
}), k.parentNode && k.parentNode.removeChild(k),
|
|
13687
|
+
}), k.parentNode && k.parentNode.removeChild(k), Oi = Oi.filter(function(v) {
|
|
13685
13688
|
return v !== y;
|
|
13686
13689
|
}), y.state.isMounted = !1, Y("onHidden", [y]));
|
|
13687
13690
|
}
|
|
13688
13691
|
function Oc() {
|
|
13689
|
-
process.env.NODE_ENV !== "production" &&
|
|
13692
|
+
process.env.NODE_ENV !== "production" && Ye(y.state.isDestroyed, Ut("destroy")), !y.state.isDestroyed && (y.clearDelayTimeouts(), y.unmount(), tr(), delete n._tippy, y.state.isDestroyed = !0, Y("onDestroy", [y]));
|
|
13690
13693
|
}
|
|
13691
13694
|
}
|
|
13692
13695
|
function yn(n, e) {
|
|
@@ -13697,8 +13700,8 @@ function yn(n, e) {
|
|
|
13697
13700
|
plugins: t
|
|
13698
13701
|
}), i = eg(n);
|
|
13699
13702
|
if (process.env.NODE_ENV !== "production") {
|
|
13700
|
-
var s =
|
|
13701
|
-
|
|
13703
|
+
var s = _n(r.content), o = i.length > 1;
|
|
13704
|
+
Ye(s && o, ["tippy() was passed an Element as the `content` prop, but more than", "one tippy instance was created by this invocation. This means the", "content element will only be appended to the last tippy instance.", `
|
|
13702
13705
|
|
|
13703
13706
|
`, "Instead, pass the .innerHTML of the element, or use a function that", "returns a cloned version of the element instead.", `
|
|
13704
13707
|
|
|
@@ -13709,11 +13712,11 @@ function yn(n, e) {
|
|
|
13709
13712
|
var u = c && yg(c, r);
|
|
13710
13713
|
return u && a.push(u), a;
|
|
13711
13714
|
}, []);
|
|
13712
|
-
return
|
|
13715
|
+
return _n(n) ? l[0] : l;
|
|
13713
13716
|
}
|
|
13714
13717
|
yn.defaultProps = ve;
|
|
13715
13718
|
yn.setDefaultProps = pg;
|
|
13716
|
-
yn.currentInput =
|
|
13719
|
+
yn.currentInput = Ve;
|
|
13717
13720
|
Object.assign({}, Xa, {
|
|
13718
13721
|
effect: function(e) {
|
|
13719
13722
|
var t = e.state, r = {
|
|
@@ -13829,7 +13832,7 @@ class bg {
|
|
|
13829
13832
|
}
|
|
13830
13833
|
}
|
|
13831
13834
|
const gc = (n) => new oe({
|
|
13832
|
-
key: typeof n.pluginKey == "string" ? new
|
|
13835
|
+
key: typeof n.pluginKey == "string" ? new Ne(n.pluginKey) : n.pluginKey,
|
|
13833
13836
|
view: (e) => new bg({ view: e, ...n })
|
|
13834
13837
|
});
|
|
13835
13838
|
ee.create({
|
|
@@ -13921,7 +13924,7 @@ class vg {
|
|
|
13921
13924
|
}
|
|
13922
13925
|
}
|
|
13923
13926
|
const yc = (n) => new oe({
|
|
13924
|
-
key: typeof n.pluginKey == "string" ? new
|
|
13927
|
+
key: typeof n.pluginKey == "string" ? new Ne(n.pluginKey) : n.pluginKey,
|
|
13925
13928
|
view: (e) => new vg({ view: e, ...n })
|
|
13926
13929
|
});
|
|
13927
13930
|
ee.create({
|
|
@@ -13982,12 +13985,12 @@ mn({
|
|
|
13982
13985
|
shouldShow: o,
|
|
13983
13986
|
tippyOptions: l
|
|
13984
13987
|
}));
|
|
13985
|
-
}),
|
|
13988
|
+
}), Un(() => {
|
|
13986
13989
|
const { pluginKey: r, editor: i } = n;
|
|
13987
13990
|
i.unregisterPlugin(r);
|
|
13988
13991
|
}), () => {
|
|
13989
13992
|
var r;
|
|
13990
|
-
return
|
|
13993
|
+
return Gn("div", { ref: t }, (r = e.default) === null || r === void 0 ? void 0 : r.call(e));
|
|
13991
13994
|
};
|
|
13992
13995
|
}
|
|
13993
13996
|
});
|
|
@@ -14042,9 +14045,9 @@ const xg = mn({
|
|
|
14042
14045
|
},
|
|
14043
14046
|
setup(n) {
|
|
14044
14047
|
const e = ts(), t = Ec();
|
|
14045
|
-
return
|
|
14048
|
+
return Nc(() => {
|
|
14046
14049
|
const r = n.editor;
|
|
14047
|
-
r && r.options.element && e.value &&
|
|
14050
|
+
r && r.options.element && e.value && Ac(() => {
|
|
14048
14051
|
if (!e.value || !r.options.element.firstChild)
|
|
14049
14052
|
return;
|
|
14050
14053
|
const i = Ni(e.value);
|
|
@@ -14058,13 +14061,13 @@ const xg = mn({
|
|
|
14058
14061
|
element: i
|
|
14059
14062
|
}), r.createNodeViews();
|
|
14060
14063
|
});
|
|
14061
|
-
}),
|
|
14064
|
+
}), Un(() => {
|
|
14062
14065
|
const r = n.editor;
|
|
14063
14066
|
r && (r.contentComponent = null, r.appContext = null);
|
|
14064
14067
|
}), { rootEl: e };
|
|
14065
14068
|
},
|
|
14066
14069
|
render() {
|
|
14067
|
-
return
|
|
14070
|
+
return Gn("div", {
|
|
14068
14071
|
ref: (n) => {
|
|
14069
14072
|
this.rootEl = n;
|
|
14070
14073
|
}
|
|
@@ -14104,12 +14107,12 @@ mn({
|
|
|
14104
14107
|
tippyOptions: s,
|
|
14105
14108
|
shouldShow: o
|
|
14106
14109
|
}));
|
|
14107
|
-
}),
|
|
14110
|
+
}), Un(() => {
|
|
14108
14111
|
const { pluginKey: r, editor: i } = n;
|
|
14109
14112
|
i.unregisterPlugin(r);
|
|
14110
14113
|
}), () => {
|
|
14111
14114
|
var r;
|
|
14112
|
-
return
|
|
14115
|
+
return Gn("div", { ref: t }, (r = e.default) === null || r === void 0 ? void 0 : r.call(e));
|
|
14113
14116
|
};
|
|
14114
14117
|
}
|
|
14115
14118
|
});
|
|
@@ -14122,7 +14125,7 @@ mn({
|
|
|
14122
14125
|
}
|
|
14123
14126
|
},
|
|
14124
14127
|
render() {
|
|
14125
|
-
return
|
|
14128
|
+
return Gn(this.as, {
|
|
14126
14129
|
style: {
|
|
14127
14130
|
whiteSpace: "pre-wrap"
|
|
14128
14131
|
},
|
|
@@ -14141,7 +14144,7 @@ mn({
|
|
|
14141
14144
|
inject: ["onDragStart", "decorationClasses"],
|
|
14142
14145
|
render() {
|
|
14143
14146
|
var n, e;
|
|
14144
|
-
return
|
|
14147
|
+
return Gn(this.as, {
|
|
14145
14148
|
// @ts-ignore
|
|
14146
14149
|
class: this.decorationClasses,
|
|
14147
14150
|
style: {
|
|
@@ -14157,7 +14160,7 @@ const wg = (n = {}) => {
|
|
|
14157
14160
|
const e = Dc();
|
|
14158
14161
|
return ns(() => {
|
|
14159
14162
|
e.value = new kg(n);
|
|
14160
|
-
}),
|
|
14163
|
+
}), Un(() => {
|
|
14161
14164
|
var t, r, i;
|
|
14162
14165
|
const s = (t = e.value) === null || t === void 0 ? void 0 : t.options.element, o = s?.cloneNode(!0);
|
|
14163
14166
|
(r = s?.parentNode) === null || r === void 0 || r.replaceChild(o, s), (i = e.value) === null || i === void 0 || i.destroy();
|
|
@@ -14194,13 +14197,13 @@ const wg = (n = {}) => {
|
|
|
14194
14197
|
},
|
|
14195
14198
|
addInputRules() {
|
|
14196
14199
|
return [
|
|
14197
|
-
|
|
14200
|
+
Wn({
|
|
14198
14201
|
find: Sg,
|
|
14199
14202
|
type: this.type
|
|
14200
14203
|
})
|
|
14201
14204
|
];
|
|
14202
14205
|
}
|
|
14203
|
-
}), Cg = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Og = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, Tg = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, Eg = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,
|
|
14206
|
+
}), Cg = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Og = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, Tg = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, Eg = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, Ng = gt.create({
|
|
14204
14207
|
name: "bold",
|
|
14205
14208
|
addOptions() {
|
|
14206
14209
|
return {
|
|
@@ -14266,7 +14269,7 @@ const wg = (n = {}) => {
|
|
|
14266
14269
|
})
|
|
14267
14270
|
];
|
|
14268
14271
|
}
|
|
14269
|
-
}),
|
|
14272
|
+
}), Ag = "listItem", dl = "textStyle", fl = /^\s*([-+*])\s$/, Dg = me.create({
|
|
14270
14273
|
name: "bulletList",
|
|
14271
14274
|
addOptions() {
|
|
14272
14275
|
return {
|
|
@@ -14290,7 +14293,7 @@ const wg = (n = {}) => {
|
|
|
14290
14293
|
},
|
|
14291
14294
|
addCommands() {
|
|
14292
14295
|
return {
|
|
14293
|
-
toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(
|
|
14296
|
+
toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Ag, this.editor.getAttributes(dl)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
14294
14297
|
};
|
|
14295
14298
|
},
|
|
14296
14299
|
addKeyboardShortcuts() {
|
|
@@ -14299,11 +14302,11 @@ const wg = (n = {}) => {
|
|
|
14299
14302
|
};
|
|
14300
14303
|
},
|
|
14301
14304
|
addInputRules() {
|
|
14302
|
-
let n =
|
|
14305
|
+
let n = Wn({
|
|
14303
14306
|
find: fl,
|
|
14304
14307
|
type: this.type
|
|
14305
14308
|
});
|
|
14306
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (n =
|
|
14309
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (n = Wn({
|
|
14307
14310
|
find: fl,
|
|
14308
14311
|
type: this.type,
|
|
14309
14312
|
keepMarks: this.options.keepMarks,
|
|
@@ -14471,7 +14474,7 @@ const wg = (n = {}) => {
|
|
|
14471
14474
|
// this plugin creates a code block for pasted content from VS Code
|
|
14472
14475
|
// we can also detect the copied code language
|
|
14473
14476
|
new oe({
|
|
14474
|
-
key: new
|
|
14477
|
+
key: new Ne("codeBlockVSCodeHandler"),
|
|
14475
14478
|
props: {
|
|
14476
14479
|
handlePaste: (n, e) => {
|
|
14477
14480
|
if (!e.clipboardData || this.editor.isActive(this.type.name))
|
|
@@ -14656,7 +14659,7 @@ class W extends R {
|
|
|
14656
14659
|
for (; ; ) {
|
|
14657
14660
|
let o = t > 0 ? s.firstChild : s.lastChild;
|
|
14658
14661
|
if (!o) {
|
|
14659
|
-
if (s.isAtom && !s.isText && !
|
|
14662
|
+
if (s.isAtom && !s.isText && !N.isSelectable(s)) {
|
|
14660
14663
|
e = e.doc.resolve(i + s.nodeSize * t), r = !1;
|
|
14661
14664
|
continue e;
|
|
14662
14665
|
}
|
|
@@ -14733,13 +14736,13 @@ function qg() {
|
|
|
14733
14736
|
}
|
|
14734
14737
|
});
|
|
14735
14738
|
}
|
|
14736
|
-
const Kg =
|
|
14737
|
-
ArrowLeft:
|
|
14738
|
-
ArrowRight:
|
|
14739
|
-
ArrowUp:
|
|
14740
|
-
ArrowDown:
|
|
14739
|
+
const Kg = Aa({
|
|
14740
|
+
ArrowLeft: xr("horiz", -1),
|
|
14741
|
+
ArrowRight: xr("horiz", 1),
|
|
14742
|
+
ArrowUp: xr("vert", -1),
|
|
14743
|
+
ArrowDown: xr("vert", 1)
|
|
14741
14744
|
});
|
|
14742
|
-
function
|
|
14745
|
+
function xr(n, e) {
|
|
14743
14746
|
const t = n == "vert" ? e > 0 ? "down" : "up" : e > 0 ? "right" : "left";
|
|
14744
14747
|
return function(r, i, s) {
|
|
14745
14748
|
let o = r.selection, l = e > 0 ? o.$to : o.$from, a = o.empty;
|
|
@@ -14759,7 +14762,7 @@ function _g(n, e, t) {
|
|
|
14759
14762
|
if (!W.valid(r))
|
|
14760
14763
|
return !1;
|
|
14761
14764
|
let i = n.posAtCoords({ left: t.clientX, top: t.clientY });
|
|
14762
|
-
return i && i.inside > -1 &&
|
|
14765
|
+
return i && i.inside > -1 && N.isSelectable(n.state.doc.nodeAt(i.inside)) ? !1 : (n.dispatch(n.state.tr.setSelection(new W(r))), !0);
|
|
14763
14766
|
}
|
|
14764
14767
|
function Jg(n, e) {
|
|
14765
14768
|
if (e.inputType != "insertCompositionText" || !(n.state.selection instanceof W))
|
|
@@ -14897,10 +14900,10 @@ const Gg = ee.create({
|
|
|
14897
14900
|
}));
|
|
14898
14901
|
}
|
|
14899
14902
|
});
|
|
14900
|
-
var
|
|
14903
|
+
var jr = 200, U = function() {
|
|
14901
14904
|
};
|
|
14902
14905
|
U.prototype.append = function(e) {
|
|
14903
|
-
return e.length ? (e = U.from(e), !this.length && e || e.length <
|
|
14906
|
+
return e.length ? (e = U.from(e), !this.length && e || e.length < jr && this.leafAppend(e) || this.length < jr && e.leafPrepend(this) || this.appendInner(e)) : this;
|
|
14904
14907
|
};
|
|
14905
14908
|
U.prototype.prepend = function(e) {
|
|
14906
14909
|
return e.length ? U.from(e).append(this) : this;
|
|
@@ -14949,10 +14952,10 @@ var bc = /* @__PURE__ */ function(n) {
|
|
|
14949
14952
|
if (i(this.values[a], l + a) === !1)
|
|
14950
14953
|
return !1;
|
|
14951
14954
|
}, e.prototype.leafAppend = function(i) {
|
|
14952
|
-
if (this.length + i.length <=
|
|
14955
|
+
if (this.length + i.length <= jr)
|
|
14953
14956
|
return new e(this.values.concat(i.flatten()));
|
|
14954
14957
|
}, e.prototype.leafPrepend = function(i) {
|
|
14955
|
-
if (this.length + i.length <=
|
|
14958
|
+
if (this.length + i.length <= jr)
|
|
14956
14959
|
return new e(i.flatten().concat(this.values));
|
|
14957
14960
|
}, t.length.get = function() {
|
|
14958
14961
|
return this.values.length;
|
|
@@ -14995,7 +14998,7 @@ var Zg = /* @__PURE__ */ function(n) {
|
|
|
14995
14998
|
}, e;
|
|
14996
14999
|
}(U);
|
|
14997
15000
|
const Qg = 500;
|
|
14998
|
-
class
|
|
15001
|
+
class De {
|
|
14999
15002
|
constructor(e, t) {
|
|
15000
15003
|
this.items = e, this.eventCount = t;
|
|
15001
15004
|
}
|
|
@@ -15019,24 +15022,24 @@ class Ie {
|
|
|
15019
15022
|
return;
|
|
15020
15023
|
}
|
|
15021
15024
|
if (i) {
|
|
15022
|
-
u.push(new
|
|
15025
|
+
u.push(new ze(d.map));
|
|
15023
15026
|
let p = d.step.map(i.slice(s)), h;
|
|
15024
|
-
p && o.maybeStep(p).doc && (h = o.mapping.maps[o.mapping.maps.length - 1], c.push(new
|
|
15027
|
+
p && o.maybeStep(p).doc && (h = o.mapping.maps[o.mapping.maps.length - 1], c.push(new ze(h, void 0, void 0, c.length + u.length))), s--, h && i.appendMap(h, s);
|
|
15025
15028
|
} else
|
|
15026
15029
|
o.maybeStep(d.step);
|
|
15027
15030
|
if (d.selection)
|
|
15028
|
-
return l = i ? d.selection.map(i.slice(s)) : d.selection, a = new
|
|
15031
|
+
return l = i ? d.selection.map(i.slice(s)) : d.selection, a = new De(this.items.slice(0, r).append(u.reverse().concat(c)), this.eventCount - 1), !1;
|
|
15029
15032
|
}, this.items.length, 0), { remaining: a, transform: o, selection: l };
|
|
15030
15033
|
}
|
|
15031
15034
|
// Create a new branch with the given transform added.
|
|
15032
15035
|
addTransform(e, t, r, i) {
|
|
15033
15036
|
let s = [], o = this.eventCount, l = this.items, a = !i && l.length ? l.get(l.length - 1) : null;
|
|
15034
15037
|
for (let u = 0; u < e.steps.length; u++) {
|
|
15035
|
-
let d = e.steps[u].invert(e.docs[u]), f = new
|
|
15038
|
+
let d = e.steps[u].invert(e.docs[u]), f = new ze(e.mapping.maps[u], d, t), p;
|
|
15036
15039
|
(p = a && a.merge(f)) && (f = p, u ? s.pop() : l = l.slice(0, l.length - 1)), s.push(f), t && (o++, t = void 0), i || (a = f);
|
|
15037
15040
|
}
|
|
15038
15041
|
let c = o - r.depth;
|
|
15039
|
-
return c > ty && (l = ey(l, c), o -= c), new
|
|
15042
|
+
return c > ty && (l = ey(l, c), o -= c), new De(l.append(s), o);
|
|
15040
15043
|
}
|
|
15041
15044
|
remapping(e, t) {
|
|
15042
15045
|
let r = new en();
|
|
@@ -15046,7 +15049,7 @@ class Ie {
|
|
|
15046
15049
|
}, e, t), r;
|
|
15047
15050
|
}
|
|
15048
15051
|
addMaps(e) {
|
|
15049
|
-
return this.eventCount == 0 ? this : new
|
|
15052
|
+
return this.eventCount == 0 ? this : new De(this.items.append(e.map((t) => new ze(t))), this.eventCount);
|
|
15050
15053
|
}
|
|
15051
15054
|
// When the collab module receives remote changes, the history has
|
|
15052
15055
|
// to know about those, so that it can adjust the steps that were
|
|
@@ -15068,14 +15071,14 @@ class Ie {
|
|
|
15068
15071
|
let h = s.maps[p];
|
|
15069
15072
|
if (f.step) {
|
|
15070
15073
|
let m = e.steps[p].invert(e.docs[p]), g = f.selection && f.selection.map(s.slice(a + 1, p));
|
|
15071
|
-
g && l++, r.push(new
|
|
15074
|
+
g && l++, r.push(new ze(h, m, g));
|
|
15072
15075
|
} else
|
|
15073
|
-
r.push(new
|
|
15076
|
+
r.push(new ze(h));
|
|
15074
15077
|
}, i);
|
|
15075
15078
|
let c = [];
|
|
15076
15079
|
for (let f = t; f < o; f++)
|
|
15077
|
-
c.push(new
|
|
15078
|
-
let u = this.items.slice(0, i).append(c).append(r), d = new
|
|
15080
|
+
c.push(new ze(s.maps[f]));
|
|
15081
|
+
let u = this.items.slice(0, i).append(c).append(r), d = new De(u, l);
|
|
15079
15082
|
return d.emptyItemCount() > Qg && (d = d.compress(this.items.length - r.length)), d;
|
|
15080
15083
|
}
|
|
15081
15084
|
emptyItemCount() {
|
|
@@ -15100,14 +15103,14 @@ class Ie {
|
|
|
15100
15103
|
if (r--, c && t.appendMap(c, r), a) {
|
|
15101
15104
|
let u = o.selection && o.selection.map(t.slice(r));
|
|
15102
15105
|
u && s++;
|
|
15103
|
-
let d = new
|
|
15106
|
+
let d = new ze(c.invert(), a, u), f, p = i.length - 1;
|
|
15104
15107
|
(f = i.length && i[p].merge(d)) ? i[p] = f : i.push(d);
|
|
15105
15108
|
}
|
|
15106
15109
|
} else o.map && r--;
|
|
15107
|
-
}, this.items.length, 0), new
|
|
15110
|
+
}, this.items.length, 0), new De(U.from(i.reverse()), s);
|
|
15108
15111
|
}
|
|
15109
15112
|
}
|
|
15110
|
-
|
|
15113
|
+
De.empty = new De(U.empty, 0);
|
|
15111
15114
|
function ey(n, e) {
|
|
15112
15115
|
let t;
|
|
15113
15116
|
return n.forEach((r, i) => {
|
|
@@ -15115,7 +15118,7 @@ function ey(n, e) {
|
|
|
15115
15118
|
return t = i, !1;
|
|
15116
15119
|
}), n.slice(t);
|
|
15117
15120
|
}
|
|
15118
|
-
class
|
|
15121
|
+
class ze {
|
|
15119
15122
|
constructor(e, t, r, i) {
|
|
15120
15123
|
this.map = e, this.step = t, this.selection = r, this.mirrorOffset = i;
|
|
15121
15124
|
}
|
|
@@ -15123,7 +15126,7 @@ class Ve {
|
|
|
15123
15126
|
if (this.step && e.step && !e.selection) {
|
|
15124
15127
|
let t = e.step.merge(this.step);
|
|
15125
15128
|
if (t)
|
|
15126
|
-
return new
|
|
15129
|
+
return new ze(t.getMap().invert(), t, this.selection);
|
|
15127
15130
|
}
|
|
15128
15131
|
}
|
|
15129
15132
|
}
|
|
@@ -15142,11 +15145,11 @@ function ny(n, e, t, r) {
|
|
|
15142
15145
|
if (t.steps.length == 0)
|
|
15143
15146
|
return n;
|
|
15144
15147
|
if (o && o.getMeta(Bt))
|
|
15145
|
-
return o.getMeta(Bt).redo ? new st(n.done.addTransform(t, void 0, r,
|
|
15148
|
+
return o.getMeta(Bt).redo ? new st(n.done.addTransform(t, void 0, r, Or(e)), n.undone, pl(t.mapping.maps), n.prevTime, n.prevComposition) : new st(n.done, n.undone.addTransform(t, void 0, r, Or(e)), null, n.prevTime, n.prevComposition);
|
|
15146
15149
|
if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
15147
|
-
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !ry(t, n.prevRanges)), c = o ?
|
|
15148
|
-
return new st(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r,
|
|
15149
|
-
} else return (s = t.getMeta("rebased")) ? new st(n.done.rebased(t, s), n.undone.rebased(t, s),
|
|
15150
|
+
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !ry(t, n.prevRanges)), c = o ? Ti(n.prevRanges, t.mapping) : pl(t.mapping.maps);
|
|
15151
|
+
return new st(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, Or(e)), De.empty, c, t.time, l ?? n.prevComposition);
|
|
15152
|
+
} else return (s = t.getMeta("rebased")) ? new st(n.done.rebased(t, s), n.undone.rebased(t, s), Ti(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new st(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), Ti(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
|
|
15150
15153
|
}
|
|
15151
15154
|
function ry(n, e) {
|
|
15152
15155
|
if (!e)
|
|
@@ -15165,7 +15168,7 @@ function pl(n) {
|
|
|
15165
15168
|
n[t].forEach((r, i, s, o) => e.push(s, o));
|
|
15166
15169
|
return e;
|
|
15167
15170
|
}
|
|
15168
|
-
function
|
|
15171
|
+
function Ti(n, e) {
|
|
15169
15172
|
if (!n)
|
|
15170
15173
|
return null;
|
|
15171
15174
|
let t = [];
|
|
@@ -15176,26 +15179,26 @@ function Ei(n, e) {
|
|
|
15176
15179
|
return t;
|
|
15177
15180
|
}
|
|
15178
15181
|
function iy(n, e, t) {
|
|
15179
|
-
let r =
|
|
15182
|
+
let r = Or(e), i = Bt.get(e).spec.config, s = (t ? n.undone : n.done).popEvent(e, r);
|
|
15180
15183
|
if (!s)
|
|
15181
15184
|
return null;
|
|
15182
15185
|
let o = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), i, r), a = new st(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
|
|
15183
15186
|
return s.transform.setSelection(o).setMeta(Bt, { redo: t, historyState: a });
|
|
15184
15187
|
}
|
|
15185
|
-
let
|
|
15186
|
-
function
|
|
15188
|
+
let Ei = !1, hl = null;
|
|
15189
|
+
function Or(n) {
|
|
15187
15190
|
let e = n.plugins;
|
|
15188
15191
|
if (hl != e) {
|
|
15189
|
-
|
|
15192
|
+
Ei = !1, hl = e;
|
|
15190
15193
|
for (let t = 0; t < e.length; t++)
|
|
15191
15194
|
if (e[t].spec.historyPreserveItems) {
|
|
15192
|
-
|
|
15195
|
+
Ei = !0;
|
|
15193
15196
|
break;
|
|
15194
15197
|
}
|
|
15195
15198
|
}
|
|
15196
|
-
return
|
|
15199
|
+
return Ei;
|
|
15197
15200
|
}
|
|
15198
|
-
const Bt = new
|
|
15201
|
+
const Bt = new Ne("history"), sy = new Ne("closeHistory");
|
|
15199
15202
|
function oy(n = {}) {
|
|
15200
15203
|
return n = {
|
|
15201
15204
|
depth: n.depth || 100,
|
|
@@ -15204,7 +15207,7 @@ function oy(n = {}) {
|
|
|
15204
15207
|
key: Bt,
|
|
15205
15208
|
state: {
|
|
15206
15209
|
init() {
|
|
15207
|
-
return new st(
|
|
15210
|
+
return new st(De.empty, De.empty, null, 0, -1);
|
|
15208
15211
|
},
|
|
15209
15212
|
apply(e, t, r) {
|
|
15210
15213
|
return ny(t, r, e, n);
|
|
@@ -15292,7 +15295,7 @@ const kc = vc(!1, !0), xc = vc(!0, !0), ly = ee.create({
|
|
|
15292
15295
|
if (l) {
|
|
15293
15296
|
const { $to: c } = o.selection, u = c.end();
|
|
15294
15297
|
if (c.nodeAfter)
|
|
15295
|
-
c.nodeAfter.isTextblock ? o.setSelection(D.create(o.doc, c.pos + 1)) : c.nodeAfter.isBlock ? o.setSelection(
|
|
15298
|
+
c.nodeAfter.isTextblock ? o.setSelection(D.create(o.doc, c.pos + 1)) : c.nodeAfter.isBlock ? o.setSelection(N.create(o.doc, c.pos)) : o.setSelection(D.create(o.doc, c.pos));
|
|
15296
15299
|
else {
|
|
15297
15300
|
const d = (a = c.parent.type.contentMatch.defaultType) === null || a === void 0 ? void 0 : a.create();
|
|
15298
15301
|
d && (o.insert(u, d), o.setSelection(D.create(o.doc, u + 1)));
|
|
@@ -15453,13 +15456,13 @@ const kc = vc(!1, !0), xc = vc(!0, !0), ly = ee.create({
|
|
|
15453
15456
|
};
|
|
15454
15457
|
},
|
|
15455
15458
|
addInputRules() {
|
|
15456
|
-
let n =
|
|
15459
|
+
let n = Wn({
|
|
15457
15460
|
find: gl,
|
|
15458
15461
|
type: this.type,
|
|
15459
15462
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
15460
15463
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1]
|
|
15461
15464
|
});
|
|
15462
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (n =
|
|
15465
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (n = Wn({
|
|
15463
15466
|
find: gl,
|
|
15464
15467
|
type: this.type,
|
|
15465
15468
|
keepMarks: this.options.keepMarks,
|
|
@@ -15563,7 +15566,7 @@ const kc = vc(!1, !0), xc = vc(!0, !0), ly = ee.create({
|
|
|
15563
15566
|
addExtensions() {
|
|
15564
15567
|
var n, e, t, r, i, s, o, l, a, c, u, d, f, p, h, m, g, b;
|
|
15565
15568
|
const w = [];
|
|
15566
|
-
return this.options.bold !== !1 && w.push(
|
|
15569
|
+
return this.options.bold !== !1 && w.push(Ng.configure((n = this.options) === null || n === void 0 ? void 0 : n.bold)), this.options.blockquote !== !1 && w.push(Mg.configure((e = this.options) === null || e === void 0 ? void 0 : e.blockquote)), this.options.bulletList !== !1 && w.push(Dg.configure((t = this.options) === null || t === void 0 ? void 0 : t.bulletList)), this.options.code !== !1 && w.push(Pg.configure((r = this.options) === null || r === void 0 ? void 0 : r.code)), this.options.codeBlock !== !1 && w.push(zg.configure((i = this.options) === null || i === void 0 ? void 0 : i.codeBlock)), this.options.document !== !1 && w.push(Vg.configure((s = this.options) === null || s === void 0 ? void 0 : s.document)), this.options.dropcursor !== !1 && w.push(Hg.configure((o = this.options) === null || o === void 0 ? void 0 : o.dropcursor)), this.options.gapcursor !== !1 && w.push(Gg.configure((l = this.options) === null || l === void 0 ? void 0 : l.gapcursor)), this.options.hardBreak !== !1 && w.push(Yg.configure((a = this.options) === null || a === void 0 ? void 0 : a.hardBreak)), this.options.heading !== !1 && w.push(Xg.configure((c = this.options) === null || c === void 0 ? void 0 : c.heading)), this.options.history !== !1 && w.push(ly.configure((u = this.options) === null || u === void 0 ? void 0 : u.history)), this.options.horizontalRule !== !1 && w.push(ay.configure((d = this.options) === null || d === void 0 ? void 0 : d.horizontalRule)), this.options.italic !== !1 && w.push(py.configure((f = this.options) === null || f === void 0 ? void 0 : f.italic)), this.options.listItem !== !1 && w.push(hy.configure((p = this.options) === null || p === void 0 ? void 0 : p.listItem)), this.options.orderedList !== !1 && w.push(gy.configure((h = this.options) === null || h === void 0 ? void 0 : h.orderedList)), this.options.paragraph !== !1 && w.push(yy.configure((m = this.options) === null || m === void 0 ? void 0 : m.paragraph)), this.options.strike !== !1 && w.push(ky.configure((g = this.options) === null || g === void 0 ? void 0 : g.strike)), this.options.text !== !1 && w.push(xy.configure((b = this.options) === null || b === void 0 ? void 0 : b.text)), w;
|
|
15567
15570
|
}
|
|
15568
15571
|
}), Sy = ["onClick"], My = /* @__PURE__ */ mn({
|
|
15569
15572
|
__name: "UiEditor",
|
|
@@ -15589,35 +15592,35 @@ const kc = vc(!1, !0), xc = vc(!0, !0), ly = ee.create({
|
|
|
15589
15592
|
(l) => {
|
|
15590
15593
|
s.value?.getHTML() !== l && s.value?.commands.setContent(l || "", !1);
|
|
15591
15594
|
}
|
|
15592
|
-
),
|
|
15595
|
+
), Un(() => {
|
|
15593
15596
|
s.value?.destroy();
|
|
15594
15597
|
}), (l, a) => (Bs(), Ls("div", {
|
|
15595
|
-
class:
|
|
15598
|
+
class: fr(l.$style.container)
|
|
15596
15599
|
}, [
|
|
15597
15600
|
zs("div", {
|
|
15598
|
-
class:
|
|
15601
|
+
class: fr(l.$style.actions)
|
|
15599
15602
|
}, [
|
|
15600
15603
|
(Bs(), Ls(Lc, null, zc(o, (c) => zs("button", {
|
|
15601
15604
|
key: c._id,
|
|
15602
15605
|
onClick: (u) => c.method(),
|
|
15603
|
-
class:
|
|
15606
|
+
class: fr(l.$style.action),
|
|
15604
15607
|
type: "button"
|
|
15605
15608
|
}, Vc(c.name), 11, Sy)), 64))
|
|
15606
15609
|
], 2),
|
|
15607
15610
|
Fc(Ni(xg), {
|
|
15608
15611
|
editor: Ni(s),
|
|
15609
|
-
class:
|
|
15612
|
+
class: fr(l.$style.editor)
|
|
15610
15613
|
}, null, 8, ["editor", "class"])
|
|
15611
15614
|
], 2));
|
|
15612
15615
|
}
|
|
15613
|
-
}), Cy = "_container_1jv52_1", Oy = "_actions_1jv52_18", Ty = "_action_1jv52_18", Ey = "_editor_1jv52_41",
|
|
15616
|
+
}), Cy = "_container_1jv52_1", Oy = "_actions_1jv52_18", Ty = "_action_1jv52_18", Ey = "_editor_1jv52_41", Ny = {
|
|
15614
15617
|
container: Cy,
|
|
15615
15618
|
actions: Oy,
|
|
15616
15619
|
action: Ty,
|
|
15617
15620
|
editor: Ey
|
|
15618
|
-
},
|
|
15619
|
-
$style:
|
|
15620
|
-
}, Py = /* @__PURE__ */ $c(My, [["__cssModules",
|
|
15621
|
+
}, Ay = {
|
|
15622
|
+
$style: Ny
|
|
15623
|
+
}, Py = /* @__PURE__ */ $c(My, [["__cssModules", Ay]]);
|
|
15621
15624
|
export {
|
|
15622
15625
|
Py as default
|
|
15623
15626
|
};
|