@jinntec/jinntap 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jinn-tap.es.js +541 -532
- package/dist/jinn-tap.umd.js +19 -16
- package/package.json +1 -1
package/dist/jinn-tap.es.js
CHANGED
|
@@ -1492,9 +1492,9 @@ class je {
|
|
|
1492
1492
|
let { type: u, next: d } = o.next[c];
|
|
1493
1493
|
if (!(u.isText || u.hasRequiredAttrs()) && i.indexOf(d) == -1) {
|
|
1494
1494
|
i.push(d);
|
|
1495
|
-
let
|
|
1496
|
-
if (
|
|
1497
|
-
return
|
|
1495
|
+
let f = s(d, l.concat(u));
|
|
1496
|
+
if (f)
|
|
1497
|
+
return f;
|
|
1498
1498
|
}
|
|
1499
1499
|
}
|
|
1500
1500
|
return null;
|
|
@@ -2795,19 +2795,19 @@ function Bt(r, e, t, n) {
|
|
|
2795
2795
|
u = 2;
|
|
2796
2796
|
for (let d in c)
|
|
2797
2797
|
if (c[d] != null) {
|
|
2798
|
-
let
|
|
2799
|
-
|
|
2798
|
+
let f = d.indexOf(" ");
|
|
2799
|
+
f > 0 ? a.setAttributeNS(d.slice(0, f), d.slice(f + 1), c[d]) : a.setAttribute(d, c[d]);
|
|
2800
2800
|
}
|
|
2801
2801
|
}
|
|
2802
2802
|
for (let d = u; d < e.length; d++) {
|
|
2803
|
-
let
|
|
2804
|
-
if (
|
|
2803
|
+
let f = e[d];
|
|
2804
|
+
if (f === 0) {
|
|
2805
2805
|
if (d < e.length - 1 || d > u)
|
|
2806
2806
|
throw new RangeError("Content hole must be the only child of its parent node");
|
|
2807
2807
|
return { dom: a, contentDOM: a };
|
|
2808
2808
|
} else {
|
|
2809
|
-
let { dom:
|
|
2810
|
-
if (a.appendChild(
|
|
2809
|
+
let { dom: h, contentDOM: p } = Bt(r, f, t, n);
|
|
2810
|
+
if (a.appendChild(h), p) {
|
|
2811
2811
|
if (l)
|
|
2812
2812
|
throw new RangeError("Multiple content holes");
|
|
2813
2813
|
l = p;
|
|
@@ -2900,11 +2900,11 @@ class X {
|
|
|
2900
2900
|
break;
|
|
2901
2901
|
let c = this.ranges[l + s], u = this.ranges[l + o], d = a + c;
|
|
2902
2902
|
if (e <= d) {
|
|
2903
|
-
let
|
|
2903
|
+
let f = c ? e == a ? -1 : e == d ? 1 : t : t, h = a + i + (f < 0 ? 0 : u);
|
|
2904
2904
|
if (n)
|
|
2905
|
-
return
|
|
2905
|
+
return h;
|
|
2906
2906
|
let p = e == (t < 0 ? a : d) ? null : Qo(l / 3, e - a), m = e == a ? as : e == d ? ls : zt;
|
|
2907
|
-
return (t < 0 ? e != a : e != d) && (m |= cs), new Vn(
|
|
2907
|
+
return (t < 0 ? e != a : e != d) && (m |= cs), new Vn(h, m, p);
|
|
2908
2908
|
}
|
|
2909
2909
|
i += u - c;
|
|
2910
2910
|
}
|
|
@@ -3439,10 +3439,10 @@ function tl(r, e, t, n) {
|
|
|
3439
3439
|
return;
|
|
3440
3440
|
let d = a.marks;
|
|
3441
3441
|
if (!n.isInSet(d) && u.type.allowsMarkType(n.type)) {
|
|
3442
|
-
let
|
|
3442
|
+
let f = Math.max(c, e), h = Math.min(c + a.nodeSize, t), p = n.addToSet(d);
|
|
3443
3443
|
for (let m = 0; m < d.length; m++)
|
|
3444
|
-
d[m].isInSet(p) || (o && o.to ==
|
|
3445
|
-
l && l.to ==
|
|
3444
|
+
d[m].isInSet(p) || (o && o.to == f && o.mark.eq(d[m]) ? o.to = h : i.push(o = new ae(f, h, d[m])));
|
|
3445
|
+
l && l.to == f ? l.to = h : s.push(l = new Se(f, h, n));
|
|
3446
3446
|
}
|
|
3447
3447
|
}), i.forEach((a) => r.step(a)), s.forEach((a) => r.step(a));
|
|
3448
3448
|
}
|
|
@@ -3461,12 +3461,12 @@ function nl(r, e, t, n) {
|
|
|
3461
3461
|
if (a && a.length) {
|
|
3462
3462
|
let c = Math.min(l + o.nodeSize, t);
|
|
3463
3463
|
for (let u = 0; u < a.length; u++) {
|
|
3464
|
-
let d = a[u],
|
|
3465
|
-
for (let
|
|
3466
|
-
let p = i[
|
|
3467
|
-
p.step == s - 1 && d.eq(i[
|
|
3464
|
+
let d = a[u], f;
|
|
3465
|
+
for (let h = 0; h < i.length; h++) {
|
|
3466
|
+
let p = i[h];
|
|
3467
|
+
p.step == s - 1 && d.eq(i[h].style) && (f = p);
|
|
3468
3468
|
}
|
|
3469
|
-
|
|
3469
|
+
f ? (f.to = c, f.step = s) : i.push({ style: d, from: Math.max(l, e), to: c, step: s });
|
|
3470
3470
|
}
|
|
3471
3471
|
}
|
|
3472
3472
|
}), i.forEach((o) => r.step(new ae(o.from, o.to, o.style)));
|
|
@@ -3479,12 +3479,12 @@ function sr(r, e, t, n = t.contentMatch, i = !0) {
|
|
|
3479
3479
|
o.push(new R(l, u, k.empty));
|
|
3480
3480
|
else {
|
|
3481
3481
|
n = d;
|
|
3482
|
-
for (let
|
|
3483
|
-
t.allowsMarkType(c.marks[
|
|
3482
|
+
for (let f = 0; f < c.marks.length; f++)
|
|
3483
|
+
t.allowsMarkType(c.marks[f].type) || r.step(new ae(l, u, c.marks[f]));
|
|
3484
3484
|
if (i && c.isText && t.whitespace != "pre") {
|
|
3485
|
-
let
|
|
3486
|
-
for (;
|
|
3487
|
-
p || (p = new k(b.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), o.push(new R(l +
|
|
3485
|
+
let f, h = /\r?\n|\r/g, p;
|
|
3486
|
+
for (; f = h.exec(c.text); )
|
|
3487
|
+
p || (p = new k(b.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), o.push(new R(l + f.index, l + f.index + f[0].length, p));
|
|
3488
3488
|
}
|
|
3489
3489
|
}
|
|
3490
3490
|
l = u;
|
|
@@ -3514,10 +3514,10 @@ function il(r, e, t) {
|
|
|
3514
3514
|
let { $from: n, $to: i, depth: s } = e, o = n.before(s + 1), l = i.after(s + 1), a = o, c = l, u = b.empty, d = 0;
|
|
3515
3515
|
for (let p = s, m = !1; p > t; p--)
|
|
3516
3516
|
m || n.index(p) > 0 ? (m = !0, u = b.from(n.node(p).copy(u)), d++) : a--;
|
|
3517
|
-
let
|
|
3517
|
+
let f = b.empty, h = 0;
|
|
3518
3518
|
for (let p = s, m = !1; p > t; p--)
|
|
3519
|
-
m || i.after(p + 1) < i.end(p) ? (m = !0,
|
|
3520
|
-
r.step(new F(a, c, o, l, new k(u.append(
|
|
3519
|
+
m || i.after(p + 1) < i.end(p) ? (m = !0, f = b.from(i.node(p).copy(f)), h++) : c++;
|
|
3520
|
+
r.step(new F(a, c, o, l, new k(u.append(f), d, h), u.size - d, !0));
|
|
3521
3521
|
}
|
|
3522
3522
|
function us(r, e, t = null, n = r) {
|
|
3523
3523
|
let i = sl(r, e), s = i && ol(n, e);
|
|
@@ -3564,12 +3564,12 @@ function al(r, e, t, n, i) {
|
|
|
3564
3564
|
if (o.isTextblock && !o.hasMarkup(n, a) && cl(r.doc, r.mapping.slice(s).map(l), n)) {
|
|
3565
3565
|
let c = null;
|
|
3566
3566
|
if (n.schema.linebreakReplacement) {
|
|
3567
|
-
let
|
|
3568
|
-
|
|
3567
|
+
let h = n.whitespace == "pre", p = !!n.contentMatch.matchType(n.schema.linebreakReplacement);
|
|
3568
|
+
h && !p ? c = !1 : !h && p && (c = !0);
|
|
3569
3569
|
}
|
|
3570
|
-
c === !1 &&
|
|
3571
|
-
let u = r.mapping.slice(s), d = u.map(l, 1),
|
|
3572
|
-
return r.step(new F(d,
|
|
3570
|
+
c === !1 && fs(r, o, l, s), sr(r, r.mapping.slice(s).map(l, 1), n, void 0, c === null);
|
|
3571
|
+
let u = r.mapping.slice(s), d = u.map(l, 1), f = u.map(l + o.nodeSize, 1);
|
|
3572
|
+
return r.step(new F(d, f, d + 1, f - 1, new k(b.from(n.create(a, null, o.marks)), 0, 0), 1, !0)), c === !0 && ds(r, o, l, s), !1;
|
|
3573
3573
|
}
|
|
3574
3574
|
});
|
|
3575
3575
|
}
|
|
@@ -3584,7 +3584,7 @@ function ds(r, e, t, n) {
|
|
|
3584
3584
|
}
|
|
3585
3585
|
});
|
|
3586
3586
|
}
|
|
3587
|
-
function
|
|
3587
|
+
function fs(r, e, t, n) {
|
|
3588
3588
|
e.forEach((i, s) => {
|
|
3589
3589
|
if (i.type == i.type.schema.linebreakReplacement) {
|
|
3590
3590
|
let o = r.mapping.slice(n).map(t + 1 + s);
|
|
@@ -3614,13 +3614,13 @@ function pe(r, e, t = 1, n) {
|
|
|
3614
3614
|
if (s < 0 || i.parent.type.spec.isolating || !i.parent.canReplace(i.index(), i.parent.childCount) || !o.type.validContent(i.parent.content.cutByIndex(i.index(), i.parent.childCount)))
|
|
3615
3615
|
return !1;
|
|
3616
3616
|
for (let c = i.depth - 1, u = t - 2; c > s; c--, u--) {
|
|
3617
|
-
let d = i.node(c),
|
|
3617
|
+
let d = i.node(c), f = i.index(c);
|
|
3618
3618
|
if (d.type.spec.isolating)
|
|
3619
3619
|
return !1;
|
|
3620
|
-
let
|
|
3621
|
-
p && (
|
|
3620
|
+
let h = d.content.cutByIndex(f, d.childCount), p = n && n[u + 1];
|
|
3621
|
+
p && (h = h.replaceChild(0, p.type.create(p.attrs)));
|
|
3622
3622
|
let m = n && n[u] || d;
|
|
3623
|
-
if (!d.canReplace(
|
|
3623
|
+
if (!d.canReplace(f + 1, d.childCount) || !m.type.validContent(h))
|
|
3624
3624
|
return !1;
|
|
3625
3625
|
}
|
|
3626
3626
|
let l = i.indexAfter(s), a = n && n[0];
|
|
@@ -3637,9 +3637,9 @@ function dl(r, e, t = 1, n) {
|
|
|
3637
3637
|
}
|
|
3638
3638
|
function qe(r, e) {
|
|
3639
3639
|
let t = r.resolve(e), n = t.index();
|
|
3640
|
-
return
|
|
3640
|
+
return hs(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(n, n + 1);
|
|
3641
3641
|
}
|
|
3642
|
-
function
|
|
3642
|
+
function fl(r, e) {
|
|
3643
3643
|
e.content.size || r.type.compatibleContent(e.type);
|
|
3644
3644
|
let t = r.contentMatchAt(r.childCount), { linebreakReplacement: n } = r.type.schema;
|
|
3645
3645
|
for (let i = 0; i < e.childCount; i++) {
|
|
@@ -3649,21 +3649,21 @@ function hl(r, e) {
|
|
|
3649
3649
|
}
|
|
3650
3650
|
return t.validEnd;
|
|
3651
3651
|
}
|
|
3652
|
-
function
|
|
3653
|
-
return !!(r && e && !r.isLeaf &&
|
|
3652
|
+
function hs(r, e) {
|
|
3653
|
+
return !!(r && e && !r.isLeaf && fl(r, e));
|
|
3654
3654
|
}
|
|
3655
3655
|
function tn(r, e, t = -1) {
|
|
3656
3656
|
let n = r.resolve(e);
|
|
3657
3657
|
for (let i = n.depth; ; i--) {
|
|
3658
3658
|
let s, o, l = n.index(i);
|
|
3659
|
-
if (i == n.depth ? (s = n.nodeBefore, o = n.nodeAfter) : t > 0 ? (s = n.node(i + 1), l++, o = n.node(i).maybeChild(l)) : (s = n.node(i).maybeChild(l - 1), o = n.node(i + 1)), s && !s.isTextblock &&
|
|
3659
|
+
if (i == n.depth ? (s = n.nodeBefore, o = n.nodeAfter) : t > 0 ? (s = n.node(i + 1), l++, o = n.node(i).maybeChild(l)) : (s = n.node(i).maybeChild(l - 1), o = n.node(i + 1)), s && !s.isTextblock && hs(s, o) && n.node(i).canReplace(l, l + 1))
|
|
3660
3660
|
return e;
|
|
3661
3661
|
if (i == 0)
|
|
3662
3662
|
break;
|
|
3663
3663
|
e = t < 0 ? n.before(i) : n.after(i);
|
|
3664
3664
|
}
|
|
3665
3665
|
}
|
|
3666
|
-
function
|
|
3666
|
+
function hl(r, e, t) {
|
|
3667
3667
|
let n = null, { linebreakReplacement: i } = r.doc.type.schema, s = r.doc.resolve(e - t), o = s.node().type;
|
|
3668
3668
|
if (i && o.inlineContent) {
|
|
3669
3669
|
let u = o.whitespace == "pre", d = !!o.contentMatch.matchType(i);
|
|
@@ -3672,7 +3672,7 @@ function fl(r, e, t) {
|
|
|
3672
3672
|
let l = r.steps.length;
|
|
3673
3673
|
if (n === !1) {
|
|
3674
3674
|
let u = r.doc.resolve(e + t);
|
|
3675
|
-
|
|
3675
|
+
fs(r, u.node(), u.before(), l);
|
|
3676
3676
|
}
|
|
3677
3677
|
o.inlineContent && sr(r, e + t - 1, o, s.node().contentMatchAt(s.index()), n == null);
|
|
3678
3678
|
let a = r.mapping.slice(l), c = a.map(e - t);
|
|
@@ -3814,26 +3814,26 @@ class gl {
|
|
|
3814
3814
|
if (s)
|
|
3815
3815
|
for (let m = 0; m < s.length; m++)
|
|
3816
3816
|
this.openFrontierNode(s[m]);
|
|
3817
|
-
let o = this.unplaced, l = n ? n.content : o.content, a = o.openStart - e, c = 0, u = [], { match: d, type:
|
|
3817
|
+
let o = this.unplaced, l = n ? n.content : o.content, a = o.openStart - e, c = 0, u = [], { match: d, type: f } = this.frontier[t];
|
|
3818
3818
|
if (i) {
|
|
3819
3819
|
for (let m = 0; m < i.childCount; m++)
|
|
3820
3820
|
u.push(i.child(m));
|
|
3821
3821
|
d = d.matchFragment(i);
|
|
3822
3822
|
}
|
|
3823
|
-
let
|
|
3823
|
+
let h = l.size + e - (o.content.size - o.openEnd);
|
|
3824
3824
|
for (; c < l.childCount; ) {
|
|
3825
3825
|
let m = l.child(c), g = d.matchType(m.type);
|
|
3826
3826
|
if (!g)
|
|
3827
3827
|
break;
|
|
3828
|
-
c++, (c > 1 || a == 0 || m.content.size) && (d = g, u.push(ms(m.mark(
|
|
3828
|
+
c++, (c > 1 || a == 0 || m.content.size) && (d = g, u.push(ms(m.mark(f.allowedMarks(m.marks)), c == 1 ? a : 0, c == l.childCount ? h : -1)));
|
|
3829
3829
|
}
|
|
3830
3830
|
let p = c == l.childCount;
|
|
3831
|
-
p || (
|
|
3832
|
-
for (let m = 0, g = l; m <
|
|
3831
|
+
p || (h = -1), this.placed = at(this.placed, t, b.from(u)), this.frontier[t].match = d, p && h < 0 && n && n.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
|
|
3832
|
+
for (let m = 0, g = l; m < h; m++) {
|
|
3833
3833
|
let y = g.lastChild;
|
|
3834
3834
|
this.frontier.push({ type: y.type, match: y.contentMatchAt(y.childCount) }), g = y.content;
|
|
3835
3835
|
}
|
|
3836
|
-
this.unplaced = p ? e == 0 ? k.empty : new k(lt(o.content, e - 1, 1), e - 1,
|
|
3836
|
+
this.unplaced = p ? e == 0 ? k.empty : new k(lt(o.content, e - 1, 1), e - 1, h < 0 ? o.openEnd : e - 1) : new k(lt(o.content, e, c), o.openStart, o.openEnd);
|
|
3837
3837
|
}
|
|
3838
3838
|
mustMoveInline() {
|
|
3839
3839
|
if (!this.$to.parent.isTextblock)
|
|
@@ -3924,41 +3924,41 @@ function kl(r, e, t, n) {
|
|
|
3924
3924
|
o[o.length - 1] == 0 && o.pop();
|
|
3925
3925
|
let l = -(i.depth + 1);
|
|
3926
3926
|
o.unshift(l);
|
|
3927
|
-
for (let
|
|
3928
|
-
let p = i.node(
|
|
3927
|
+
for (let f = i.depth, h = i.pos - 1; f > 0; f--, h--) {
|
|
3928
|
+
let p = i.node(f).type.spec;
|
|
3929
3929
|
if (p.defining || p.definingAsContext || p.isolating)
|
|
3930
3930
|
break;
|
|
3931
|
-
o.indexOf(
|
|
3931
|
+
o.indexOf(f) > -1 ? l = f : i.before(f) == h && o.splice(1, 0, -f);
|
|
3932
3932
|
}
|
|
3933
3933
|
let a = o.indexOf(l), c = [], u = n.openStart;
|
|
3934
|
-
for (let
|
|
3935
|
-
let p =
|
|
3936
|
-
if (c.push(p),
|
|
3934
|
+
for (let f = n.content, h = 0; ; h++) {
|
|
3935
|
+
let p = f.firstChild;
|
|
3936
|
+
if (c.push(p), h == n.openStart)
|
|
3937
3937
|
break;
|
|
3938
|
-
|
|
3938
|
+
f = p.content;
|
|
3939
3939
|
}
|
|
3940
|
-
for (let
|
|
3941
|
-
let
|
|
3942
|
-
if (p && !
|
|
3943
|
-
u =
|
|
3944
|
-
else if (p || !
|
|
3940
|
+
for (let f = u - 1; f >= 0; f--) {
|
|
3941
|
+
let h = c[f], p = bl(h.type);
|
|
3942
|
+
if (p && !h.sameMarkup(i.node(Math.abs(l) - 1)))
|
|
3943
|
+
u = f;
|
|
3944
|
+
else if (p || !h.type.isTextblock)
|
|
3945
3945
|
break;
|
|
3946
3946
|
}
|
|
3947
|
-
for (let
|
|
3948
|
-
let
|
|
3947
|
+
for (let f = n.openStart; f >= 0; f--) {
|
|
3948
|
+
let h = (f + u + 1) % (n.openStart + 1), p = c[h];
|
|
3949
3949
|
if (p)
|
|
3950
3950
|
for (let m = 0; m < o.length; m++) {
|
|
3951
3951
|
let g = o[(m + a) % o.length], y = !0;
|
|
3952
3952
|
g < 0 && (y = !1, g = -g);
|
|
3953
3953
|
let S = i.node(g - 1), w = i.index(g - 1);
|
|
3954
3954
|
if (S.canReplaceWith(w, w, p.type, p.marks))
|
|
3955
|
-
return r.replace(i.before(g), y ? s.after(g) : t, new k(gs(n.content, 0, n.openStart,
|
|
3955
|
+
return r.replace(i.before(g), y ? s.after(g) : t, new k(gs(n.content, 0, n.openStart, h), h, n.openEnd));
|
|
3956
3956
|
}
|
|
3957
3957
|
}
|
|
3958
3958
|
let d = r.steps.length;
|
|
3959
|
-
for (let
|
|
3960
|
-
let
|
|
3961
|
-
|
|
3959
|
+
for (let f = o.length - 1; f >= 0 && (r.replace(e, t, n), !(r.steps.length > d)); f--) {
|
|
3960
|
+
let h = o[f];
|
|
3961
|
+
h < 0 || (e = i.before(h), t = s.after(h));
|
|
3962
3962
|
}
|
|
3963
3963
|
}
|
|
3964
3964
|
function gs(r, e, t, n, i) {
|
|
@@ -4211,7 +4211,7 @@ class Cl {
|
|
|
4211
4211
|
last and first siblings are also joined, and so on.
|
|
4212
4212
|
*/
|
|
4213
4213
|
join(e, t = 1) {
|
|
4214
|
-
return
|
|
4214
|
+
return hl(this, e, t), this;
|
|
4215
4215
|
}
|
|
4216
4216
|
/**
|
|
4217
4217
|
Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.
|
|
@@ -5122,7 +5122,7 @@ const j = function(r) {
|
|
|
5122
5122
|
return e && e.nodeType == 11 ? e.host : e;
|
|
5123
5123
|
};
|
|
5124
5124
|
let Wn = null;
|
|
5125
|
-
const
|
|
5125
|
+
const fe = function(r, e, t) {
|
|
5126
5126
|
let n = Wn || (Wn = document.createRange());
|
|
5127
5127
|
return n.setEnd(r, t ?? r.nodeValue.length), n.setStart(r, e || 0), n;
|
|
5128
5128
|
}, Ol = function() {
|
|
@@ -5223,7 +5223,7 @@ function Pl(r, e, t) {
|
|
|
5223
5223
|
}
|
|
5224
5224
|
const ce = typeof navigator < "u" ? navigator : null, _r = typeof document < "u" ? document : null, Ae = ce && ce.userAgent || "", Hn = /Edge\/(\d+)/.exec(Ae), xs = /MSIE \d/.exec(Ae), Jn = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ae), G = !!(xs || Jn || Hn), Ee = xs ? document.documentMode : Jn ? +Jn[1] : Hn ? +Hn[1] : 0, se = !G && /gecko\/(\d+)/i.test(Ae);
|
|
5225
5225
|
se && +(/Firefox\/(\d+)/.exec(Ae) || [0, 0])[1];
|
|
5226
|
-
const qn = !G && /Chrome\/(\d+)/.exec(Ae), J = !!qn, Ss = qn ? +qn[1] : 0, K = !G && !!ce && /Apple Computer/.test(ce.vendor), rt = K && (/Mobile\/\w+/.test(Ae) || !!ce && ce.maxTouchPoints > 2), ee = rt || (ce ? /Mac/.test(ce.platform) : !1), Rl = ce ? /Win/.test(ce.platform) : !1,
|
|
5226
|
+
const qn = !G && /Chrome\/(\d+)/.exec(Ae), J = !!qn, Ss = qn ? +qn[1] : 0, K = !G && !!ce && /Apple Computer/.test(ce.vendor), rt = K && (/Mobile\/\w+/.test(Ae) || !!ce && ce.maxTouchPoints > 2), ee = rt || (ce ? /Mac/.test(ce.platform) : !1), Rl = ce ? /Win/.test(ce.platform) : !1, he = /Android \d/.test(Ae), Et = !!_r && "webkitFontSmoothing" in _r.documentElement.style, Bl = Et ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
5227
5227
|
function zl(r) {
|
|
5228
5228
|
let e = r.defaultView && r.defaultView.visualViewport;
|
|
5229
5229
|
return e ? {
|
|
@@ -5262,15 +5262,15 @@ function Gr(r, e, t) {
|
|
|
5262
5262
|
if (a)
|
|
5263
5263
|
s.defaultView.scrollBy(u, d);
|
|
5264
5264
|
else {
|
|
5265
|
-
let
|
|
5265
|
+
let h = l.scrollLeft, p = l.scrollTop;
|
|
5266
5266
|
d && (l.scrollTop += d), u && (l.scrollLeft += u);
|
|
5267
|
-
let m = l.scrollLeft -
|
|
5267
|
+
let m = l.scrollLeft - h, g = l.scrollTop - p;
|
|
5268
5268
|
e = { left: e.left - m, top: e.top - g, right: e.right - m, bottom: e.bottom - g };
|
|
5269
5269
|
}
|
|
5270
|
-
let
|
|
5271
|
-
if (/^(fixed|sticky)$/.test(
|
|
5270
|
+
let f = a ? "fixed" : getComputedStyle(o).position;
|
|
5271
|
+
if (/^(fixed|sticky)$/.test(f))
|
|
5272
5272
|
break;
|
|
5273
|
-
o =
|
|
5273
|
+
o = f == "absolute" ? o.offsetParent : nt(o);
|
|
5274
5274
|
}
|
|
5275
5275
|
}
|
|
5276
5276
|
function Ll(r) {
|
|
@@ -5319,15 +5319,15 @@ function Vl(r) {
|
|
|
5319
5319
|
function Ms(r, e) {
|
|
5320
5320
|
let t, n = 2e8, i, s = 0, o = e.top, l = e.top, a, c;
|
|
5321
5321
|
for (let u = r.firstChild, d = 0; u; u = u.nextSibling, d++) {
|
|
5322
|
-
let
|
|
5322
|
+
let f;
|
|
5323
5323
|
if (u.nodeType == 1)
|
|
5324
|
-
|
|
5324
|
+
f = u.getClientRects();
|
|
5325
5325
|
else if (u.nodeType == 3)
|
|
5326
|
-
|
|
5326
|
+
f = fe(u).getClientRects();
|
|
5327
5327
|
else
|
|
5328
5328
|
continue;
|
|
5329
|
-
for (let
|
|
5330
|
-
let p = h
|
|
5329
|
+
for (let h = 0; h < f.length; h++) {
|
|
5330
|
+
let p = f[h];
|
|
5331
5331
|
if (p.top <= o && p.bottom >= l) {
|
|
5332
5332
|
o = Math.max(p.bottom, o), l = Math.min(p.top, l);
|
|
5333
5333
|
let m = p.left > e.left ? p.left - e.left : p.right < e.left ? e.left - p.right : 0;
|
|
@@ -5441,11 +5441,11 @@ function Ts(r, e, t) {
|
|
|
5441
5441
|
let { node: n, offset: i, atom: s } = r.docView.domFromPos(e, t < 0 ? -1 : 1), o = Et || se;
|
|
5442
5442
|
if (n.nodeType == 3)
|
|
5443
5443
|
if (o && (Kl.test(n.nodeValue) || (t < 0 ? !i : i == n.nodeValue.length))) {
|
|
5444
|
-
let a = ye(
|
|
5444
|
+
let a = ye(fe(n, i, i), t);
|
|
5445
5445
|
if (se && i && /\s/.test(n.nodeValue[i - 1]) && i < n.nodeValue.length) {
|
|
5446
|
-
let c = ye(
|
|
5446
|
+
let c = ye(fe(n, i - 1, i - 1), -1);
|
|
5447
5447
|
if (c.top == a.top) {
|
|
5448
|
-
let u = ye(
|
|
5448
|
+
let u = ye(fe(n, i, i + 1), -1);
|
|
5449
5449
|
if (u.top != a.top)
|
|
5450
5450
|
return ot(u, u.left < c.left);
|
|
5451
5451
|
}
|
|
@@ -5453,7 +5453,7 @@ function Ts(r, e, t) {
|
|
|
5453
5453
|
return a;
|
|
5454
5454
|
} else {
|
|
5455
5455
|
let a = i, c = i, u = t < 0 ? 1 : -1;
|
|
5456
|
-
return t < 0 && !i ? (c++, u = -1) : t >= 0 && i == n.nodeValue.length ? (a--, u = 1) : t < 0 ? a-- : c++, ot(ye(
|
|
5456
|
+
return t < 0 && !i ? (c++, u = -1) : t >= 0 && i == n.nodeValue.length ? (a--, u = 1) : t < 0 ? a-- : c++, ot(ye(fe(n, a, c), u), u < 0);
|
|
5457
5457
|
}
|
|
5458
5458
|
if (!r.state.doc.resolve(e - (s || 0)).parent.inlineContent) {
|
|
5459
5459
|
if (s == null && i && (t < 0 || i == te(n))) {
|
|
@@ -5469,7 +5469,7 @@ function Ts(r, e, t) {
|
|
|
5469
5469
|
return wn(n.getBoundingClientRect(), t >= 0);
|
|
5470
5470
|
}
|
|
5471
5471
|
if (s == null && i && (t < 0 || i == te(n))) {
|
|
5472
|
-
let a = n.childNodes[i - 1], c = a.nodeType == 3 ?
|
|
5472
|
+
let a = n.childNodes[i - 1], c = a.nodeType == 3 ? fe(a, te(a) - (o ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
|
|
5473
5473
|
if (c)
|
|
5474
5474
|
return ot(ye(c, 1), !1);
|
|
5475
5475
|
}
|
|
@@ -5477,11 +5477,11 @@ function Ts(r, e, t) {
|
|
|
5477
5477
|
let a = n.childNodes[i];
|
|
5478
5478
|
for (; a.pmViewDesc && a.pmViewDesc.ignoreForCoords; )
|
|
5479
5479
|
a = a.nextSibling;
|
|
5480
|
-
let c = a ? a.nodeType == 3 ?
|
|
5480
|
+
let c = a ? a.nodeType == 3 ? fe(a, 0, o ? 0 : 1) : a.nodeType == 1 ? a : null : null;
|
|
5481
5481
|
if (c)
|
|
5482
5482
|
return ot(ye(c, -1), !0);
|
|
5483
5483
|
}
|
|
5484
|
-
return ot(ye(n.nodeType == 3 ?
|
|
5484
|
+
return ot(ye(n.nodeType == 3 ? fe(n) : n, -t), t >= 0);
|
|
5485
5485
|
}
|
|
5486
5486
|
function ot(r, e) {
|
|
5487
5487
|
if (r.width == 0)
|
|
@@ -5524,7 +5524,7 @@ function Ul(r, e, t) {
|
|
|
5524
5524
|
if (l.nodeType == 1)
|
|
5525
5525
|
a = l.getClientRects();
|
|
5526
5526
|
else if (l.nodeType == 3)
|
|
5527
|
-
a =
|
|
5527
|
+
a = fe(l, 0, l.nodeValue.length).getClientRects();
|
|
5528
5528
|
else
|
|
5529
5529
|
continue;
|
|
5530
5530
|
for (let c = 0; c < a.length; c++) {
|
|
@@ -5543,14 +5543,14 @@ function Gl(r, e, t) {
|
|
|
5543
5543
|
return !1;
|
|
5544
5544
|
let i = n.parentOffset, s = !i, o = i == n.parent.content.size, l = r.domSelection();
|
|
5545
5545
|
return l ? !_l.test(n.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : Os(r, e, () => {
|
|
5546
|
-
let { focusNode: a, focusOffset: c, anchorNode: u, anchorOffset: d } = r.domSelectionRange(),
|
|
5546
|
+
let { focusNode: a, focusOffset: c, anchorNode: u, anchorOffset: d } = r.domSelectionRange(), f = l.caretBidiLevel;
|
|
5547
5547
|
l.modify("move", t, "character");
|
|
5548
|
-
let
|
|
5548
|
+
let h = n.depth ? r.docView.domAfterPos(n.before()) : r.dom, { focusNode: p, focusOffset: m } = r.domSelectionRange(), g = p && !h.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == m;
|
|
5549
5549
|
try {
|
|
5550
5550
|
l.collapse(u, d), a && (a != u || c != d) && l.extend && l.extend(a, c);
|
|
5551
5551
|
} catch {
|
|
5552
5552
|
}
|
|
5553
|
-
return
|
|
5553
|
+
return f != null && (l.caretBidiLevel = f), g;
|
|
5554
5554
|
}) : n.pos == n.start() || n.pos == n.end();
|
|
5555
5555
|
}
|
|
5556
5556
|
let Xr = null, Zr = null, Qr = !1;
|
|
@@ -5765,12 +5765,12 @@ class Tt {
|
|
|
5765
5765
|
return a.parseRange(e, t, u);
|
|
5766
5766
|
e = o;
|
|
5767
5767
|
for (let d = l; d > 0; d--) {
|
|
5768
|
-
let
|
|
5769
|
-
if (
|
|
5770
|
-
i = j(
|
|
5768
|
+
let f = this.children[d - 1];
|
|
5769
|
+
if (f.size && f.dom.parentNode == this.contentDOM && !f.emptyChildAt(1)) {
|
|
5770
|
+
i = j(f.dom) + 1;
|
|
5771
5771
|
break;
|
|
5772
5772
|
}
|
|
5773
|
-
e -=
|
|
5773
|
+
e -= f.size;
|
|
5774
5774
|
}
|
|
5775
5775
|
i == -1 && (i = 0);
|
|
5776
5776
|
}
|
|
@@ -5810,19 +5810,19 @@ class Tt {
|
|
|
5810
5810
|
// case we just use whatever domFromPos produces as a best effort.
|
|
5811
5811
|
setSelection(e, t, n, i = !1) {
|
|
5812
5812
|
let s = Math.min(e, t), o = Math.max(e, t);
|
|
5813
|
-
for (let
|
|
5814
|
-
let m = this.children[
|
|
5813
|
+
for (let h = 0, p = 0; h < this.children.length; h++) {
|
|
5814
|
+
let m = this.children[h], g = p + m.size;
|
|
5815
5815
|
if (s > p && o < g)
|
|
5816
5816
|
return m.setSelection(e - p - m.border, t - p - m.border, n, i);
|
|
5817
5817
|
p = g;
|
|
5818
5818
|
}
|
|
5819
5819
|
let l = this.domFromPos(e, e ? -1 : 1), a = t == e ? l : this.domFromPos(t, t ? -1 : 1), c = n.root.getSelection(), u = n.domSelectionRange(), d = !1;
|
|
5820
5820
|
if ((se || K) && e == t) {
|
|
5821
|
-
let { node:
|
|
5822
|
-
if (
|
|
5823
|
-
if (d = !!(p &&
|
|
5824
|
-
`), d && p ==
|
|
5825
|
-
for (let m =
|
|
5821
|
+
let { node: h, offset: p } = l;
|
|
5822
|
+
if (h.nodeType == 3) {
|
|
5823
|
+
if (d = !!(p && h.nodeValue[p - 1] == `
|
|
5824
|
+
`), d && p == h.nodeValue.length)
|
|
5825
|
+
for (let m = h, g; m; m = m.parentNode) {
|
|
5826
5826
|
if (g = m.nextSibling) {
|
|
5827
5827
|
g.nodeName == "BR" && (l = a = { node: g.parentNode, offset: j(g) + 1 });
|
|
5828
5828
|
break;
|
|
@@ -5832,31 +5832,31 @@ class Tt {
|
|
|
5832
5832
|
break;
|
|
5833
5833
|
}
|
|
5834
5834
|
} else {
|
|
5835
|
-
let m =
|
|
5835
|
+
let m = h.childNodes[p - 1];
|
|
5836
5836
|
d = m && (m.nodeName == "BR" || m.contentEditable == "false");
|
|
5837
5837
|
}
|
|
5838
5838
|
}
|
|
5839
5839
|
if (se && u.focusNode && u.focusNode != a.node && u.focusNode.nodeType == 1) {
|
|
5840
|
-
let
|
|
5841
|
-
|
|
5840
|
+
let h = u.focusNode.childNodes[u.focusOffset];
|
|
5841
|
+
h && h.contentEditable == "false" && (i = !0);
|
|
5842
5842
|
}
|
|
5843
5843
|
if (!(i || d && K) && We(l.node, l.offset, u.anchorNode, u.anchorOffset) && We(a.node, a.offset, u.focusNode, u.focusOffset))
|
|
5844
5844
|
return;
|
|
5845
|
-
let
|
|
5845
|
+
let f = !1;
|
|
5846
5846
|
if ((c.extend || e == t) && !d) {
|
|
5847
5847
|
c.collapse(l.node, l.offset);
|
|
5848
5848
|
try {
|
|
5849
|
-
e != t && c.extend(a.node, a.offset),
|
|
5849
|
+
e != t && c.extend(a.node, a.offset), f = !0;
|
|
5850
5850
|
} catch {
|
|
5851
5851
|
}
|
|
5852
5852
|
}
|
|
5853
|
-
if (!
|
|
5853
|
+
if (!f) {
|
|
5854
5854
|
if (e > t) {
|
|
5855
5855
|
let p = l;
|
|
5856
5856
|
l = a, a = p;
|
|
5857
5857
|
}
|
|
5858
|
-
let
|
|
5859
|
-
|
|
5858
|
+
let h = document.createRange();
|
|
5859
|
+
h.setEnd(a.node, a.offset), h.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(h);
|
|
5860
5860
|
}
|
|
5861
5861
|
}
|
|
5862
5862
|
ignoreMutation(e) {
|
|
@@ -6019,8 +6019,8 @@ class Te extends Tt {
|
|
|
6019
6019
|
throw new RangeError("Text must be rendered as a DOM text node");
|
|
6020
6020
|
} else u || ({ dom: u, contentDOM: d } = Je.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
|
|
6021
6021
|
!d && !t.isText && u.nodeName != "BR" && (u.hasAttribute("contenteditable") || (u.contentEditable = "false"), t.type.spec.draggable && (u.draggable = !0));
|
|
6022
|
-
let
|
|
6023
|
-
return u = Is(u, n, t), c ? a = new Zl(e, t, n, i, u, d || null,
|
|
6022
|
+
let f = u;
|
|
6023
|
+
return u = Is(u, n, t), c ? a = new Zl(e, t, n, i, u, d || null, f, c, s, o + 1) : t.isText ? new on(e, t, n, i, u, f, s) : new Te(e, t, n, i, u, d || null, f, s, o + 1);
|
|
6024
6024
|
}
|
|
6025
6025
|
parseRule() {
|
|
6026
6026
|
if (this.node.type.spec.reparseInView)
|
|
@@ -6059,10 +6059,10 @@ class Te extends Tt {
|
|
|
6059
6059
|
let n = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new ea(this, o && o.node, e);
|
|
6060
6060
|
ra(this.node, this.innerDeco, (c, u, d) => {
|
|
6061
6061
|
c.spec.marks ? a.syncToMarks(c.spec.marks, n, e) : c.type.side >= 0 && !d && a.syncToMarks(u == this.node.childCount ? D.none : this.node.child(u).marks, n, e), a.placeWidget(c, e, i);
|
|
6062
|
-
}, (c, u, d,
|
|
6062
|
+
}, (c, u, d, f) => {
|
|
6063
6063
|
a.syncToMarks(c.marks, n, e);
|
|
6064
|
-
let
|
|
6065
|
-
a.findNodeMatch(c, u, d,
|
|
6064
|
+
let h;
|
|
6065
|
+
a.findNodeMatch(c, u, d, f) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (h = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, u, d, h, e) || a.updateNextNode(c, u, d, e, f, i) || a.addNode(c, u, d, e, i), i += c.nodeSize;
|
|
6066
6066
|
}), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Pe) && (o && this.protectLocalComposition(e, o), vs(this.contentDOM, this.children, e), rt && ia(this.dom));
|
|
6067
6067
|
}
|
|
6068
6068
|
localCompositionInfo(e, t) {
|
|
@@ -6233,22 +6233,22 @@ function vs(r, e, t) {
|
|
|
6233
6233
|
n = ni(n), i = !0;
|
|
6234
6234
|
i && t.trackWrites == r && (t.trackWrites = null);
|
|
6235
6235
|
}
|
|
6236
|
-
const
|
|
6236
|
+
const ft = function(r) {
|
|
6237
6237
|
r && (this.nodeName = r);
|
|
6238
6238
|
};
|
|
6239
|
-
|
|
6240
|
-
const Re = [new
|
|
6239
|
+
ft.prototype = /* @__PURE__ */ Object.create(null);
|
|
6240
|
+
const Re = [new ft()];
|
|
6241
6241
|
function Kn(r, e, t) {
|
|
6242
6242
|
if (r.length == 0)
|
|
6243
6243
|
return Re;
|
|
6244
|
-
let n = t ? Re[0] : new
|
|
6244
|
+
let n = t ? Re[0] : new ft(), i = [n];
|
|
6245
6245
|
for (let s = 0; s < r.length; s++) {
|
|
6246
6246
|
let o = r[s].type.attrs;
|
|
6247
6247
|
if (o) {
|
|
6248
|
-
o.nodeName && i.push(n = new
|
|
6248
|
+
o.nodeName && i.push(n = new ft(o.nodeName));
|
|
6249
6249
|
for (let l in o) {
|
|
6250
6250
|
let a = o[l];
|
|
6251
|
-
a != null && (t && i.length == 1 && i.push(n = new
|
|
6251
|
+
a != null && (t && i.length == 1 && i.push(n = new ft(e.isInline ? "span" : "div")), l == "class" ? n.class = (n.class ? n.class + " " : "") + a : l == "style" ? n.style = (n.style ? n.style + ";" : "") + a : l != "nodeName" && (n[l] = a));
|
|
6252
6252
|
}
|
|
6253
6253
|
}
|
|
6254
6254
|
}
|
|
@@ -6395,10 +6395,10 @@ class ea {
|
|
|
6395
6395
|
let c = this.preMatch.matched.get(a);
|
|
6396
6396
|
if (c != null && c != s)
|
|
6397
6397
|
return !1;
|
|
6398
|
-
let u = a.dom, d,
|
|
6399
|
-
if (!
|
|
6398
|
+
let u = a.dom, d, f = this.isLocked(u) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != ue && qt(t, a.outerDeco));
|
|
6399
|
+
if (!f && a.update(e, t, n, i))
|
|
6400
6400
|
return this.destroyBetween(this.index, l), a.dom != u && (this.changed = !0), this.index++, !0;
|
|
6401
|
-
if (!
|
|
6401
|
+
if (!f && (d = this.recreateWrapper(a, e, t, n, i, o)))
|
|
6402
6402
|
return this.destroyBetween(this.index, l), this.top.children[this.index] = d, d.contentDOM && (d.dirty = Pe, d.updateChildren(i, o + 1), d.dirty = re), this.changed = !0, this.index++, !0;
|
|
6403
6403
|
break;
|
|
6404
6404
|
}
|
|
@@ -6508,29 +6508,29 @@ function ra(r, e, t, n) {
|
|
|
6508
6508
|
t(d[g], c, !!a);
|
|
6509
6509
|
} else
|
|
6510
6510
|
t(u, c, !!a);
|
|
6511
|
-
let
|
|
6511
|
+
let f, h;
|
|
6512
6512
|
if (a)
|
|
6513
|
-
|
|
6513
|
+
h = -1, f = a, a = null;
|
|
6514
6514
|
else if (c < r.childCount)
|
|
6515
|
-
|
|
6515
|
+
h = c, f = r.child(c++);
|
|
6516
6516
|
else
|
|
6517
6517
|
break;
|
|
6518
6518
|
for (let g = 0; g < l.length; g++)
|
|
6519
6519
|
l[g].to <= s && l.splice(g--, 1);
|
|
6520
6520
|
for (; o < i.length && i[o].from <= s && i[o].to > s; )
|
|
6521
6521
|
l.push(i[o++]);
|
|
6522
|
-
let p = s +
|
|
6523
|
-
if (
|
|
6522
|
+
let p = s + f.nodeSize;
|
|
6523
|
+
if (f.isText) {
|
|
6524
6524
|
let g = p;
|
|
6525
6525
|
o < i.length && i[o].from < g && (g = i[o].from);
|
|
6526
6526
|
for (let y = 0; y < l.length; y++)
|
|
6527
6527
|
l[y].to < g && (g = l[y].to);
|
|
6528
|
-
g < p && (a =
|
|
6528
|
+
g < p && (a = f.cut(g - s), f = f.cut(0, g - s), p = g, h = -1);
|
|
6529
6529
|
} else
|
|
6530
6530
|
for (; o < i.length && i[o].to < p; )
|
|
6531
6531
|
o++;
|
|
6532
|
-
let m =
|
|
6533
|
-
n(
|
|
6532
|
+
let m = f.isInline && !f.isLeaf ? l.filter((g) => !g.inline) : l.slice();
|
|
6533
|
+
n(f, m, e.forChild(s, f), h), s = p;
|
|
6534
6534
|
}
|
|
6535
6535
|
}
|
|
6536
6536
|
function ia(r) {
|
|
@@ -6584,19 +6584,19 @@ function ar(r, e = null) {
|
|
|
6584
6584
|
i = i.parent;
|
|
6585
6585
|
let d = i.node;
|
|
6586
6586
|
if (i && d.isAtom && C.isSelectable(d) && i.parent && !(d.isInline && Dl(t.focusNode, t.focusOffset, i.dom))) {
|
|
6587
|
-
let
|
|
6588
|
-
c = new C(o ==
|
|
6587
|
+
let f = i.posBefore;
|
|
6588
|
+
c = new C(o == f ? l : n.resolve(f));
|
|
6589
6589
|
}
|
|
6590
6590
|
} else {
|
|
6591
6591
|
if (t instanceof r.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1) {
|
|
6592
|
-
let d = o,
|
|
6593
|
-
for (let
|
|
6594
|
-
let p = t.getRangeAt(
|
|
6595
|
-
d = Math.min(d, r.docView.posFromDOM(p.startContainer, p.startOffset, 1)),
|
|
6592
|
+
let d = o, f = o;
|
|
6593
|
+
for (let h = 0; h < t.rangeCount; h++) {
|
|
6594
|
+
let p = t.getRangeAt(h);
|
|
6595
|
+
d = Math.min(d, r.docView.posFromDOM(p.startContainer, p.startOffset, 1)), f = Math.max(f, r.docView.posFromDOM(p.endContainer, p.endOffset, -1));
|
|
6596
6596
|
}
|
|
6597
6597
|
if (d < 0)
|
|
6598
6598
|
return null;
|
|
6599
|
-
[a, o] =
|
|
6599
|
+
[a, o] = f == r.state.selection.anchor ? [f, d] : [d, f], l = n.resolve(o);
|
|
6600
6600
|
} else
|
|
6601
6601
|
a = r.docView.posFromDOM(t.anchorNode, t.anchorOffset, 1);
|
|
6602
6602
|
if (a < 0)
|
|
@@ -6736,7 +6736,7 @@ function ai(r, e, t) {
|
|
|
6736
6736
|
function Kt(r) {
|
|
6737
6737
|
return r.nodeType == 3 ? r.nodeValue.length : r.childNodes.length;
|
|
6738
6738
|
}
|
|
6739
|
-
function
|
|
6739
|
+
function ht(r, e) {
|
|
6740
6740
|
let t = r.pmViewDesc;
|
|
6741
6741
|
return t && t.size == 0 && (e < 0 || r.nextSibling || r.nodeName != "BR");
|
|
6742
6742
|
}
|
|
@@ -6748,13 +6748,13 @@ function ca(r) {
|
|
|
6748
6748
|
if (!t)
|
|
6749
6749
|
return;
|
|
6750
6750
|
let i, s, o = !1;
|
|
6751
|
-
for (se && t.nodeType == 1 && n < Kt(t) &&
|
|
6751
|
+
for (se && t.nodeType == 1 && n < Kt(t) && ht(t.childNodes[n], -1) && (o = !0); ; )
|
|
6752
6752
|
if (n > 0) {
|
|
6753
6753
|
if (t.nodeType != 1)
|
|
6754
6754
|
break;
|
|
6755
6755
|
{
|
|
6756
6756
|
let l = t.childNodes[n - 1];
|
|
6757
|
-
if (
|
|
6757
|
+
if (ht(l, -1))
|
|
6758
6758
|
i = t, s = --n;
|
|
6759
6759
|
else if (l.nodeType == 3)
|
|
6760
6760
|
t = l, n = t.nodeValue.length;
|
|
@@ -6766,7 +6766,7 @@ function ca(r) {
|
|
|
6766
6766
|
break;
|
|
6767
6767
|
{
|
|
6768
6768
|
let l = t.previousSibling;
|
|
6769
|
-
for (; l &&
|
|
6769
|
+
for (; l && ht(l, -1); )
|
|
6770
6770
|
i = t.parentNode, s = j(l), l = l.previousSibling;
|
|
6771
6771
|
if (l)
|
|
6772
6772
|
t = l, n = Kt(t);
|
|
@@ -6789,7 +6789,7 @@ function ua(r) {
|
|
|
6789
6789
|
if (t.nodeType != 1)
|
|
6790
6790
|
break;
|
|
6791
6791
|
let l = t.childNodes[n];
|
|
6792
|
-
if (
|
|
6792
|
+
if (ht(l, 1))
|
|
6793
6793
|
s = t, o = ++n;
|
|
6794
6794
|
else
|
|
6795
6795
|
break;
|
|
@@ -6798,7 +6798,7 @@ function ua(r) {
|
|
|
6798
6798
|
break;
|
|
6799
6799
|
{
|
|
6800
6800
|
let l = t.nextSibling;
|
|
6801
|
-
for (; l &&
|
|
6801
|
+
for (; l && ht(l, 1); )
|
|
6802
6802
|
s = l.parentNode, o = j(l) + 1, l = l.nextSibling;
|
|
6803
6803
|
if (l)
|
|
6804
6804
|
t = l, n = 0, i = Kt(t);
|
|
@@ -6827,7 +6827,7 @@ function da(r, e) {
|
|
|
6827
6827
|
r = t, e = 0;
|
|
6828
6828
|
}
|
|
6829
6829
|
}
|
|
6830
|
-
function
|
|
6830
|
+
function fa(r, e) {
|
|
6831
6831
|
for (; r && !e && !Mt(r); )
|
|
6832
6832
|
e = j(r), r = r.parentNode;
|
|
6833
6833
|
for (; r && e; ) {
|
|
@@ -6842,7 +6842,7 @@ function ha(r, e) {
|
|
|
6842
6842
|
function Gn(r, e, t) {
|
|
6843
6843
|
if (e.nodeType != 3) {
|
|
6844
6844
|
let s, o;
|
|
6845
|
-
(o = da(e, t)) ? (e = o, t = 0) : (s =
|
|
6845
|
+
(o = da(e, t)) ? (e = o, t = 0) : (s = fa(e, t)) && (e = s, t = s.nodeValue.length);
|
|
6846
6846
|
}
|
|
6847
6847
|
let n = r.domSelection();
|
|
6848
6848
|
if (!n)
|
|
@@ -6907,16 +6907,16 @@ function di(r, e) {
|
|
|
6907
6907
|
}
|
|
6908
6908
|
return !1;
|
|
6909
6909
|
}
|
|
6910
|
-
function
|
|
6910
|
+
function fi(r, e, t) {
|
|
6911
6911
|
r.domObserver.stop(), e.contentEditable = t, r.domObserver.start();
|
|
6912
6912
|
}
|
|
6913
|
-
function
|
|
6913
|
+
function ha(r) {
|
|
6914
6914
|
if (!K || r.state.selection.$head.parentOffset > 0)
|
|
6915
6915
|
return !1;
|
|
6916
6916
|
let { focusNode: e, focusOffset: t } = r.domSelectionRange();
|
|
6917
6917
|
if (e && e.nodeType == 1 && t == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
|
|
6918
6918
|
let n = e.firstChild;
|
|
6919
|
-
|
|
6919
|
+
fi(r, n, "true"), setTimeout(() => fi(r, n, "false"), 20);
|
|
6920
6920
|
}
|
|
6921
6921
|
return !1;
|
|
6922
6922
|
}
|
|
@@ -6942,28 +6942,28 @@ function ma(r, e) {
|
|
|
6942
6942
|
if (t == 38 || ee && t == 80 && n == "c")
|
|
6943
6943
|
return ui(r, -1, n) || Ue(r, -1);
|
|
6944
6944
|
if (t == 40 || ee && t == 78 && n == "c")
|
|
6945
|
-
return
|
|
6945
|
+
return ha(r) || ui(r, 1, n) || Ue(r, 1);
|
|
6946
6946
|
if (n == (ee ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
6947
6947
|
return !0;
|
|
6948
6948
|
}
|
|
6949
6949
|
return !1;
|
|
6950
6950
|
}
|
|
6951
6951
|
function ur(r, e) {
|
|
6952
|
-
r.someProp("transformCopied", (
|
|
6953
|
-
e =
|
|
6952
|
+
r.someProp("transformCopied", (h) => {
|
|
6953
|
+
e = h(e, r);
|
|
6954
6954
|
});
|
|
6955
6955
|
let t = [], { content: n, openStart: i, openEnd: s } = e;
|
|
6956
6956
|
for (; i > 1 && s > 1 && n.childCount == 1 && n.firstChild.childCount == 1; ) {
|
|
6957
6957
|
i--, s--;
|
|
6958
|
-
let
|
|
6959
|
-
t.push(
|
|
6958
|
+
let h = n.firstChild;
|
|
6959
|
+
t.push(h.type.name, h.attrs != h.type.defaultAttrs ? h.attrs : null), n = h.content;
|
|
6960
6960
|
}
|
|
6961
6961
|
let o = r.someProp("clipboardSerializer") || Je.fromSchema(r.state.schema), l = Ws(), a = l.createElement("div");
|
|
6962
6962
|
a.appendChild(o.serializeFragment(n, { document: l }));
|
|
6963
6963
|
let c = a.firstChild, u, d = 0;
|
|
6964
6964
|
for (; c && c.nodeType == 1 && (u = js[c.nodeName.toLowerCase()]); ) {
|
|
6965
|
-
for (let
|
|
6966
|
-
let p = l.createElement(u[
|
|
6965
|
+
for (let h = u.length - 1; h >= 0; h--) {
|
|
6966
|
+
let p = l.createElement(u[h]);
|
|
6967
6967
|
for (; a.firstChild; )
|
|
6968
6968
|
p.appendChild(a.firstChild);
|
|
6969
6969
|
a.appendChild(p), d++;
|
|
@@ -6971,10 +6971,10 @@ function ur(r, e) {
|
|
|
6971
6971
|
c = a.firstChild;
|
|
6972
6972
|
}
|
|
6973
6973
|
c && c.nodeType == 1 && c.setAttribute("data-pm-slice", `${i} ${s}${d ? ` -${d}` : ""} ${JSON.stringify(t)}`);
|
|
6974
|
-
let
|
|
6974
|
+
let f = r.someProp("clipboardTextSerializer", (h) => h(e, r)) || e.content.textBetween(0, e.content.size, `
|
|
6975
6975
|
|
|
6976
6976
|
`);
|
|
6977
|
-
return { dom: a, text:
|
|
6977
|
+
return { dom: a, text: f, slice: e };
|
|
6978
6978
|
}
|
|
6979
6979
|
function Fs(r, e, t, n, i) {
|
|
6980
6980
|
let s = i.parent.type.spec.code, o, l;
|
|
@@ -6982,19 +6982,19 @@ function Fs(r, e, t, n, i) {
|
|
|
6982
6982
|
return null;
|
|
6983
6983
|
let a = e && (n || s || !t);
|
|
6984
6984
|
if (a) {
|
|
6985
|
-
if (r.someProp("transformPastedText", (
|
|
6986
|
-
e =
|
|
6985
|
+
if (r.someProp("transformPastedText", (f) => {
|
|
6986
|
+
e = f(e, s || n, r);
|
|
6987
6987
|
}), s)
|
|
6988
6988
|
return e ? new k(b.from(r.state.schema.text(e.replace(/\r\n?/g, `
|
|
6989
6989
|
`))), 0, 0) : k.empty;
|
|
6990
|
-
let d = r.someProp("clipboardTextParser", (
|
|
6990
|
+
let d = r.someProp("clipboardTextParser", (f) => f(e, i, n, r));
|
|
6991
6991
|
if (d)
|
|
6992
6992
|
l = d;
|
|
6993
6993
|
else {
|
|
6994
|
-
let
|
|
6994
|
+
let f = i.marks(), { schema: h } = r.state, p = Je.fromSchema(h);
|
|
6995
6995
|
o = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((m) => {
|
|
6996
6996
|
let g = o.appendChild(document.createElement("p"));
|
|
6997
|
-
m && g.appendChild(p.serializeNode(
|
|
6997
|
+
m && g.appendChild(p.serializeNode(h.text(m, f)));
|
|
6998
6998
|
});
|
|
6999
6999
|
}
|
|
7000
7000
|
} else
|
|
@@ -7004,28 +7004,28 @@ function Fs(r, e, t, n, i) {
|
|
|
7004
7004
|
let c = o && o.querySelector("[data-pm-slice]"), u = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
|
|
7005
7005
|
if (u && u[3])
|
|
7006
7006
|
for (let d = +u[3]; d > 0; d--) {
|
|
7007
|
-
let
|
|
7008
|
-
for (;
|
|
7009
|
-
|
|
7010
|
-
if (!
|
|
7007
|
+
let f = o.firstChild;
|
|
7008
|
+
for (; f && f.nodeType != 1; )
|
|
7009
|
+
f = f.nextSibling;
|
|
7010
|
+
if (!f)
|
|
7011
7011
|
break;
|
|
7012
|
-
o =
|
|
7012
|
+
o = f;
|
|
7013
7013
|
}
|
|
7014
7014
|
if (l || (l = (r.someProp("clipboardParser") || r.someProp("domParser") || dt.fromSchema(r.state.schema)).parseSlice(o, {
|
|
7015
7015
|
preserveWhitespace: !!(a || u),
|
|
7016
7016
|
context: i,
|
|
7017
|
-
ruleFromNode(
|
|
7018
|
-
return
|
|
7017
|
+
ruleFromNode(f) {
|
|
7018
|
+
return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !ga.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
|
|
7019
7019
|
}
|
|
7020
7020
|
})), u)
|
|
7021
|
-
l = Sa(
|
|
7021
|
+
l = Sa(hi(l, +u[1], +u[2]), u[4]);
|
|
7022
7022
|
else if (l = k.maxOpen(ya(l.content, i), !0), l.openStart || l.openEnd) {
|
|
7023
|
-
let d = 0,
|
|
7024
|
-
for (let
|
|
7023
|
+
let d = 0, f = 0;
|
|
7024
|
+
for (let h = l.content.firstChild; d < l.openStart && !h.type.spec.isolating; d++, h = h.firstChild)
|
|
7025
7025
|
;
|
|
7026
|
-
for (let
|
|
7026
|
+
for (let h = l.content.lastChild; f < l.openEnd && !h.type.spec.isolating; f++, h = h.lastChild)
|
|
7027
7027
|
;
|
|
7028
|
-
l =
|
|
7028
|
+
l = hi(l, d, f);
|
|
7029
7029
|
}
|
|
7030
7030
|
return r.someProp("transformPasted", (d) => {
|
|
7031
7031
|
l = d(l, r);
|
|
@@ -7079,7 +7079,7 @@ function Yn(r, e, t, n, i, s) {
|
|
|
7079
7079
|
let o = e < 0 ? r.firstChild : r.lastChild, l = o.content;
|
|
7080
7080
|
return r.childCount > 1 && (s = 0), i < n - 1 && (l = Yn(l, e, t, n, i + 1, s)), i >= t && (l = e < 0 ? o.contentMatchAt(0).fillBefore(l, s <= i).append(l) : l.append(o.contentMatchAt(o.childCount).fillBefore(b.empty, !0))), r.replaceChild(e < 0 ? 0 : r.childCount - 1, o.copy(l));
|
|
7081
7081
|
}
|
|
7082
|
-
function
|
|
7082
|
+
function hi(r, e, t) {
|
|
7083
7083
|
return e < r.openStart && (r = new k(Yn(r.content, -1, e, r.openStart, 0, r.openEnd), e, r.openEnd)), t < r.openEnd && (r = new k(Yn(r.content, 1, t, r.openEnd, 0, 0), r.openStart, t)), r;
|
|
7084
7084
|
}
|
|
7085
7085
|
const js = {
|
|
@@ -7187,7 +7187,7 @@ function Oa(r, e) {
|
|
|
7187
7187
|
}
|
|
7188
7188
|
_.keydown = (r, e) => {
|
|
7189
7189
|
let t = e;
|
|
7190
|
-
if (r.input.shiftKey = t.keyCode == 16 || t.shiftKey, !Js(r, t) && (r.input.lastKeyCode = t.keyCode, r.input.lastKeyCodeTime = Date.now(), !(
|
|
7190
|
+
if (r.input.shiftKey = t.keyCode == 16 || t.shiftKey, !Js(r, t) && (r.input.lastKeyCode = t.keyCode, r.input.lastKeyCodeTime = Date.now(), !(he && J && t.keyCode == 13)))
|
|
7191
7191
|
if (t.keyCode != 229 && r.domObserver.forceFlush(), rt && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
7192
7192
|
let n = Date.now();
|
|
7193
7193
|
r.input.lastIOSEnter = n, r.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
@@ -7219,7 +7219,7 @@ function Na(r, e) {
|
|
|
7219
7219
|
let t = e.x - r.clientX, n = e.y - r.clientY;
|
|
7220
7220
|
return t * t + n * n < 100;
|
|
7221
7221
|
}
|
|
7222
|
-
function
|
|
7222
|
+
function fr(r, e, t, n, i) {
|
|
7223
7223
|
if (n == -1)
|
|
7224
7224
|
return !1;
|
|
7225
7225
|
let s = r.state.doc.resolve(n);
|
|
@@ -7256,13 +7256,13 @@ function va(r, e) {
|
|
|
7256
7256
|
return i != null ? (Qe(r, C.create(r.state.doc, i)), !0) : !1;
|
|
7257
7257
|
}
|
|
7258
7258
|
function Da(r, e, t, n, i) {
|
|
7259
|
-
return
|
|
7259
|
+
return fr(r, "handleClickOn", e, t, n) || r.someProp("handleClick", (s) => s(r, e, n)) || (i ? va(r, t) : Aa(r, t));
|
|
7260
7260
|
}
|
|
7261
7261
|
function Ia(r, e, t, n) {
|
|
7262
|
-
return
|
|
7262
|
+
return fr(r, "handleDoubleClickOn", e, t, n) || r.someProp("handleDoubleClick", (i) => i(r, e, n));
|
|
7263
7263
|
}
|
|
7264
7264
|
function Pa(r, e, t, n) {
|
|
7265
|
-
return
|
|
7265
|
+
return fr(r, "handleTripleClickOn", e, t, n) || r.someProp("handleTripleClick", (i) => i(r, e, n)) || Ra(r, t, n);
|
|
7266
7266
|
}
|
|
7267
7267
|
function Ra(r, e, t) {
|
|
7268
7268
|
if (t.button != 0)
|
|
@@ -7282,14 +7282,14 @@ function Ra(r, e, t) {
|
|
|
7282
7282
|
return !0;
|
|
7283
7283
|
}
|
|
7284
7284
|
}
|
|
7285
|
-
function
|
|
7285
|
+
function hr(r) {
|
|
7286
7286
|
return Ut(r);
|
|
7287
7287
|
}
|
|
7288
7288
|
const Hs = ee ? "metaKey" : "ctrlKey";
|
|
7289
7289
|
U.mousedown = (r, e) => {
|
|
7290
7290
|
let t = e;
|
|
7291
7291
|
r.input.shiftKey = t.shiftKey;
|
|
7292
|
-
let n =
|
|
7292
|
+
let n = hr(r), i = Date.now(), s = "singleClick";
|
|
7293
7293
|
i - r.input.lastClick.time < 500 && Na(t, r.input.lastClick) && !t[Hs] && (r.input.lastClick.type == "singleClick" ? s = "doubleClick" : r.input.lastClick.type == "doubleClick" && (s = "tripleClick")), r.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s };
|
|
7294
7294
|
let o = r.posAtCoords(ln(t));
|
|
7295
7295
|
o && (s == "singleClick" ? (r.input.mouseDown && r.input.mouseDown.done(), r.input.mouseDown = new Ba(r, o, t, !!n)) : (s == "doubleClick" ? Ia : Pa)(r, o.pos, o.inside, t) ? t.preventDefault() : we(r, "pointer"));
|
|
@@ -7341,16 +7341,16 @@ class Ba {
|
|
|
7341
7341
|
}
|
|
7342
7342
|
}
|
|
7343
7343
|
U.touchstart = (r) => {
|
|
7344
|
-
r.input.lastTouch = Date.now(),
|
|
7344
|
+
r.input.lastTouch = Date.now(), hr(r), we(r, "pointer");
|
|
7345
7345
|
};
|
|
7346
7346
|
U.touchmove = (r) => {
|
|
7347
7347
|
r.input.lastTouch = Date.now(), we(r, "pointer");
|
|
7348
7348
|
};
|
|
7349
|
-
U.contextmenu = (r) =>
|
|
7349
|
+
U.contextmenu = (r) => hr(r);
|
|
7350
7350
|
function Js(r, e) {
|
|
7351
7351
|
return r.composing ? !0 : K && Math.abs(e.timeStamp - r.input.compositionEndedAt) < 500 ? (r.input.compositionEndedAt = -2e8, !0) : !1;
|
|
7352
7352
|
}
|
|
7353
|
-
const za =
|
|
7353
|
+
const za = he ? 5e3 : -1;
|
|
7354
7354
|
_.compositionstart = _.compositionupdate = (r) => {
|
|
7355
7355
|
if (!r.composing) {
|
|
7356
7356
|
r.domObserver.flush();
|
|
@@ -7409,7 +7409,7 @@ function La() {
|
|
|
7409
7409
|
return r.initEvent("event", !0, !0), r.timeStamp;
|
|
7410
7410
|
}
|
|
7411
7411
|
function Ut(r, e = !1) {
|
|
7412
|
-
if (!(
|
|
7412
|
+
if (!(he && r.domObserver.flushingSoon >= 0)) {
|
|
7413
7413
|
if (r.domObserver.forceFlush(), Ks(r), e || r.docView && r.docView.dirty) {
|
|
7414
7414
|
let t = ar(r);
|
|
7415
7415
|
return t && !t.eq(r.state.selection) ? r.dispatch(r.state.tr.setSelection(t)) : (r.markCursor || e) && !r.state.selection.empty ? r.dispatch(r.state.tr.deleteSelection()) : r.updateState(r.state), !0;
|
|
@@ -7466,7 +7466,7 @@ function Us(r) {
|
|
|
7466
7466
|
}
|
|
7467
7467
|
_.paste = (r, e) => {
|
|
7468
7468
|
let t = e;
|
|
7469
|
-
if (r.composing && !
|
|
7469
|
+
if (r.composing && !he)
|
|
7470
7470
|
return;
|
|
7471
7471
|
let n = bt ? null : t.clipboardData, i = r.input.shiftKey && r.input.lastKeyCode != 45;
|
|
7472
7472
|
n && kt(r, Us(n), n.getData("text/html"), i, t) ? t.preventDefault() : ja(r, t);
|
|
@@ -7530,15 +7530,15 @@ _.drop = (r, e) => {
|
|
|
7530
7530
|
let { node: p } = n;
|
|
7531
7531
|
p ? p.replace(c) : c.deleteSelection();
|
|
7532
7532
|
}
|
|
7533
|
-
let u = c.mapping.map(a), d = o.openStart == 0 && o.openEnd == 0 && o.content.childCount == 1,
|
|
7534
|
-
if (d ? c.replaceRangeWith(u, u, o.content.firstChild) : c.replaceRange(u, u, o), c.doc.eq(
|
|
7533
|
+
let u = c.mapping.map(a), d = o.openStart == 0 && o.openEnd == 0 && o.content.childCount == 1, f = c.doc;
|
|
7534
|
+
if (d ? c.replaceRangeWith(u, u, o.content.firstChild) : c.replaceRange(u, u, o), c.doc.eq(f))
|
|
7535
7535
|
return;
|
|
7536
|
-
let
|
|
7537
|
-
if (d && C.isSelectable(o.content.firstChild) &&
|
|
7538
|
-
c.setSelection(new C(
|
|
7536
|
+
let h = c.doc.resolve(u);
|
|
7537
|
+
if (d && C.isSelectable(o.content.firstChild) && h.nodeAfter && h.nodeAfter.sameMarkup(o.content.firstChild))
|
|
7538
|
+
c.setSelection(new C(h));
|
|
7539
7539
|
else {
|
|
7540
7540
|
let p = c.mapping.map(a);
|
|
7541
|
-
c.mapping.maps[c.mapping.maps.length - 1].forEach((m, g, y, S) => p = S), c.setSelection(cr(r,
|
|
7541
|
+
c.mapping.maps[c.mapping.maps.length - 1].forEach((m, g, y, S) => p = S), c.setSelection(cr(r, h, c.doc.resolve(p)));
|
|
7542
7542
|
}
|
|
7543
7543
|
r.focus(), r.dispatch(c.setMeta("uiEvent", "drop"));
|
|
7544
7544
|
};
|
|
@@ -7552,7 +7552,7 @@ U.blur = (r, e) => {
|
|
|
7552
7552
|
r.focused && (r.domObserver.stop(), r.dom.classList.remove("ProseMirror-focused"), r.domObserver.start(), t.relatedTarget && r.dom.contains(t.relatedTarget) && r.domObserver.currentSelection.clear(), r.focused = !1);
|
|
7553
7553
|
};
|
|
7554
7554
|
U.beforeinput = (r, e) => {
|
|
7555
|
-
if (J &&
|
|
7555
|
+
if (J && he && e.inputType == "deleteContentBackward") {
|
|
7556
7556
|
r.domObserver.flushSoon();
|
|
7557
7557
|
let { domChangeCount: n } = r.input;
|
|
7558
7558
|
setTimeout(() => {
|
|
@@ -7943,14 +7943,14 @@ function Ha(r, e, t, n, i, s, o) {
|
|
|
7943
7943
|
let l = r.slice();
|
|
7944
7944
|
for (let c = 0, u = s; c < t.maps.length; c++) {
|
|
7945
7945
|
let d = 0;
|
|
7946
|
-
t.maps[c].forEach((
|
|
7947
|
-
let g = m - p - (
|
|
7946
|
+
t.maps[c].forEach((f, h, p, m) => {
|
|
7947
|
+
let g = m - p - (h - f);
|
|
7948
7948
|
for (let y = 0; y < l.length; y += 3) {
|
|
7949
7949
|
let S = l[y + 1];
|
|
7950
|
-
if (S < 0 ||
|
|
7950
|
+
if (S < 0 || f > S + u - d)
|
|
7951
7951
|
continue;
|
|
7952
7952
|
let w = l[y] + u - d;
|
|
7953
|
-
|
|
7953
|
+
h >= w ? l[y + 1] = f <= w ? -2 : -1 : f >= u && g && (l[y] += g, l[y + 1] += g);
|
|
7954
7954
|
}
|
|
7955
7955
|
d += g;
|
|
7956
7956
|
}), u = t.maps[c].map(u, -1);
|
|
@@ -7967,10 +7967,10 @@ function Ha(r, e, t, n, i, s, o) {
|
|
|
7967
7967
|
a = !0;
|
|
7968
7968
|
continue;
|
|
7969
7969
|
}
|
|
7970
|
-
let
|
|
7971
|
-
if (g && m == d && m + g.nodeSize ==
|
|
7970
|
+
let f = t.map(r[c + 1] + s, -1), h = f - i, { index: p, offset: m } = n.content.findIndex(d), g = n.maybeChild(p);
|
|
7971
|
+
if (g && m == d && m + g.nodeSize == h) {
|
|
7972
7972
|
let y = l[c + 2].mapInner(t, g, u + 1, r[c] + s + 1, o);
|
|
7973
|
-
y != H ? (l[c] = d, l[c + 1] =
|
|
7973
|
+
y != H ? (l[c] = d, l[c + 1] = h, l[c + 2] = y) : (l[c + 1] = -2, a = !0);
|
|
7974
7974
|
} else
|
|
7975
7975
|
a = !0;
|
|
7976
7976
|
}
|
|
@@ -7979,11 +7979,11 @@ function Ha(r, e, t, n, i, s, o) {
|
|
|
7979
7979
|
e = u.local;
|
|
7980
7980
|
for (let d = 0; d < l.length; d += 3)
|
|
7981
7981
|
l[d + 1] < 0 && (l.splice(d, 3), d -= 3);
|
|
7982
|
-
for (let d = 0,
|
|
7983
|
-
let
|
|
7984
|
-
for (;
|
|
7985
|
-
|
|
7986
|
-
l.splice(
|
|
7982
|
+
for (let d = 0, f = 0; d < u.children.length; d += 3) {
|
|
7983
|
+
let h = u.children[d];
|
|
7984
|
+
for (; f < l.length && l[f] < h; )
|
|
7985
|
+
f += 3;
|
|
7986
|
+
l.splice(f, 0, u.children[d], u.children[d + 1], u.children[d + 2]);
|
|
7987
7987
|
}
|
|
7988
7988
|
}
|
|
7989
7989
|
return new z(e.sort($e), l);
|
|
@@ -8191,13 +8191,13 @@ class _a {
|
|
|
8191
8191
|
if (se && a.length) {
|
|
8192
8192
|
let u = a.filter((d) => d.nodeName == "BR");
|
|
8193
8193
|
if (u.length == 2) {
|
|
8194
|
-
let [d,
|
|
8195
|
-
d.parentNode && d.parentNode.parentNode ==
|
|
8194
|
+
let [d, f] = u;
|
|
8195
|
+
d.parentNode && d.parentNode.parentNode == f.parentNode ? f.remove() : d.remove();
|
|
8196
8196
|
} else {
|
|
8197
8197
|
let { focusNode: d } = this.currentSelection;
|
|
8198
|
-
for (let
|
|
8199
|
-
let
|
|
8200
|
-
|
|
8198
|
+
for (let f of u) {
|
|
8199
|
+
let h = f.parentNode;
|
|
8200
|
+
h && h.nodeName == "LI" && (!d || Xa(e, d) != h) && f.remove();
|
|
8201
8201
|
}
|
|
8202
8202
|
}
|
|
8203
8203
|
}
|
|
@@ -8221,8 +8221,8 @@ class _a {
|
|
|
8221
8221
|
let i = e.previousSibling, s = e.nextSibling;
|
|
8222
8222
|
if (G && Ee <= 11 && e.addedNodes.length)
|
|
8223
8223
|
for (let u = 0; u < e.addedNodes.length; u++) {
|
|
8224
|
-
let { previousSibling: d, nextSibling:
|
|
8225
|
-
(!d || Array.prototype.indexOf.call(e.addedNodes, d) < 0) && (i = d), (!
|
|
8224
|
+
let { previousSibling: d, nextSibling: f } = e.addedNodes[u];
|
|
8225
|
+
(!d || Array.prototype.indexOf.call(e.addedNodes, d) < 0) && (i = d), (!f || Array.prototype.indexOf.call(e.addedNodes, f) < 0) && (s = f);
|
|
8226
8226
|
}
|
|
8227
8227
|
let o = i && i.parentNode == e.target ? j(i) + 1 : 0, l = n.localPosFromDOM(e.target, o, -1), a = s && s.parentNode == e.target ? j(s) : e.target.childNodes.length, c = n.localPosFromDOM(e.target, a, 1);
|
|
8228
8228
|
return { from: l, to: c };
|
|
@@ -8281,16 +8281,16 @@ function Za(r, e, t) {
|
|
|
8281
8281
|
if (!S || S.size)
|
|
8282
8282
|
break;
|
|
8283
8283
|
}
|
|
8284
|
-
let d = r.state.doc,
|
|
8285
|
-
topNode:
|
|
8286
|
-
topMatch:
|
|
8284
|
+
let d = r.state.doc, f = r.someProp("domParser") || dt.fromSchema(r.state.schema), h = d.resolve(o), p = null, m = f.parse(n, {
|
|
8285
|
+
topNode: h.parent,
|
|
8286
|
+
topMatch: h.parent.contentMatchAt(h.index()),
|
|
8287
8287
|
topOpen: !0,
|
|
8288
8288
|
from: i,
|
|
8289
8289
|
to: s,
|
|
8290
|
-
preserveWhitespace:
|
|
8290
|
+
preserveWhitespace: h.parent.type.whitespace == "pre" ? "full" : !0,
|
|
8291
8291
|
findPositions: c,
|
|
8292
8292
|
ruleFromNode: Qa,
|
|
8293
|
-
context:
|
|
8293
|
+
context: h
|
|
8294
8294
|
});
|
|
8295
8295
|
if (c && c[0].pos != null) {
|
|
8296
8296
|
let g = c[0].pos, y = c[1] && c[1].pos;
|
|
@@ -8318,7 +8318,7 @@ function tc(r, e, t, n, i) {
|
|
|
8318
8318
|
if (r.input.compositionPendingChanges = 0, e < 0) {
|
|
8319
8319
|
let T = r.input.lastSelectionTime > Date.now() - 50 ? r.input.lastSelectionOrigin : null, ge = ar(r, T);
|
|
8320
8320
|
if (ge && !r.state.selection.eq(ge)) {
|
|
8321
|
-
if (J &&
|
|
8321
|
+
if (J && he && r.input.lastKeyCode === 13 && Date.now() - 100 < r.input.lastKeyCodeTime && r.someProp("handleKeyDown", (Ao) => Ao(r, De(13, "Enter"))))
|
|
8322
8322
|
return;
|
|
8323
8323
|
let Ot = r.state.tr.setSelection(ge);
|
|
8324
8324
|
T == "pointer" ? Ot.setMeta("pointer", !0) : T == "key" && Ot.scrollIntoView(), s && Ot.setMeta("composition", s), r.dispatch(Ot);
|
|
@@ -8327,10 +8327,10 @@ function tc(r, e, t, n, i) {
|
|
|
8327
8327
|
}
|
|
8328
8328
|
let o = r.state.doc.resolve(e), l = o.sharedDepth(t);
|
|
8329
8329
|
e = o.before(l + 1), t = r.state.doc.resolve(t).after(l + 1);
|
|
8330
|
-
let a = r.state.selection, c = Za(r, e, t), u = r.state.doc, d = u.slice(c.from, c.to),
|
|
8331
|
-
r.input.lastKeyCode === 8 && Date.now() - 100 < r.input.lastKeyCodeTime ? (
|
|
8332
|
-
let p = ic(d.content, c.doc.content, c.from,
|
|
8333
|
-
if (p && r.input.domChangeCount++, (rt && r.input.lastIOSEnter > Date.now() - 225 ||
|
|
8330
|
+
let a = r.state.selection, c = Za(r, e, t), u = r.state.doc, d = u.slice(c.from, c.to), f, h;
|
|
8331
|
+
r.input.lastKeyCode === 8 && Date.now() - 100 < r.input.lastKeyCodeTime ? (f = r.state.selection.to, h = "end") : (f = r.state.selection.from, h = "start"), r.input.lastKeyCode = null;
|
|
8332
|
+
let p = ic(d.content, c.doc.content, c.from, f, h);
|
|
8333
|
+
if (p && r.input.domChangeCount++, (rt && r.input.lastIOSEnter > Date.now() - 225 || he) && i.some((T) => T.nodeType == 1 && !ec.test(T.nodeName)) && (!p || p.endA >= p.endB) && r.someProp("handleKeyDown", (T) => T(r, De(13, "Enter")))) {
|
|
8334
8334
|
r.input.lastIOSEnter = 0;
|
|
8335
8335
|
return;
|
|
8336
8336
|
}
|
|
@@ -8354,10 +8354,10 @@ function tc(r, e, t, n, i) {
|
|
|
8354
8354
|
return;
|
|
8355
8355
|
}
|
|
8356
8356
|
if (r.state.selection.anchor > p.start && rc(u, p.start, p.endA, m, g) && r.someProp("handleKeyDown", (T) => T(r, De(8, "Backspace")))) {
|
|
8357
|
-
|
|
8357
|
+
he && J && r.domObserver.suppressSelectionUpdates();
|
|
8358
8358
|
return;
|
|
8359
8359
|
}
|
|
8360
|
-
J && p.endB == p.start && (r.input.lastChromeDelete = Date.now()),
|
|
8360
|
+
J && p.endB == p.start && (r.input.lastChromeDelete = Date.now()), he && !S && m.start() != g.start() && g.parentOffset == 0 && m.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, g = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
|
|
8361
8361
|
r.someProp("handleKeyDown", function(T) {
|
|
8362
8362
|
return T(r, De(13, "Enter"));
|
|
8363
8363
|
});
|
|
@@ -8525,23 +8525,23 @@ class sc {
|
|
|
8525
8525
|
e.storedMarks && this.composing && (Ks(this), o = !0), this.state = e;
|
|
8526
8526
|
let l = i.plugins != e.plugins || this._props.plugins != t.plugins;
|
|
8527
8527
|
if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
|
|
8528
|
-
let
|
|
8529
|
-
lc(
|
|
8528
|
+
let h = Mi(this);
|
|
8529
|
+
lc(h, this.nodeViews) && (this.nodeViews = h, s = !0);
|
|
8530
8530
|
}
|
|
8531
8531
|
(l || t.handleDOMEvents != this._props.handleDOMEvents) && Xn(this), this.editable = wi(this), Ci(this);
|
|
8532
8532
|
let a = Tn(this), c = Si(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);
|
|
8533
8533
|
(d || !e.selection.eq(i.selection)) && (o = !0);
|
|
8534
|
-
let
|
|
8534
|
+
let f = u == "preserve" && o && this.dom.style.overflowAnchor == null && Ll(this);
|
|
8535
8535
|
if (o) {
|
|
8536
8536
|
this.domObserver.stop();
|
|
8537
|
-
let
|
|
8537
|
+
let h = d && (G || J) && !this.composing && !i.selection.empty && !e.selection.empty && oc(i.selection, e.selection);
|
|
8538
8538
|
if (d) {
|
|
8539
8539
|
let p = J ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
8540
|
-
this.composing && (this.input.compositionNode = Fa(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ti(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (
|
|
8540
|
+
this.composing && (this.input.compositionNode = Fa(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ti(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (h = !0);
|
|
8541
8541
|
}
|
|
8542
|
-
|
|
8542
|
+
h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && aa(this)) ? me(this, h) : (Rs(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
8543
8543
|
}
|
|
8544
|
-
this.updatePluginViews(i), !((n = this.dragging) === null || n === void 0) && n.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), u == "reset" ? this.dom.scrollTop = 0 : u == "to selection" ? this.scrollToSelection() :
|
|
8544
|
+
this.updatePluginViews(i), !((n = this.dragging) === null || n === void 0) && n.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), u == "reset" ? this.dom.scrollTop = 0 : u == "to selection" ? this.scrollToSelection() : f && $l(f);
|
|
8545
8545
|
}
|
|
8546
8546
|
/**
|
|
8547
8547
|
@internal
|
|
@@ -8936,7 +8936,7 @@ function uc(r) {
|
|
|
8936
8936
|
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;
|
|
8937
8937
|
}
|
|
8938
8938
|
const dc = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
|
|
8939
|
-
function
|
|
8939
|
+
function fc(r) {
|
|
8940
8940
|
let e = r.split(/-(?!$)/), t = e[e.length - 1];
|
|
8941
8941
|
t == "Space" && (t = " ");
|
|
8942
8942
|
let n, i, s, o;
|
|
@@ -8957,10 +8957,10 @@ function hc(r) {
|
|
|
8957
8957
|
}
|
|
8958
8958
|
return n && (t = "Alt-" + t), i && (t = "Ctrl-" + t), o && (t = "Meta-" + t), s && (t = "Shift-" + t), t;
|
|
8959
8959
|
}
|
|
8960
|
-
function
|
|
8960
|
+
function hc(r) {
|
|
8961
8961
|
let e = /* @__PURE__ */ Object.create(null);
|
|
8962
8962
|
for (let t in r)
|
|
8963
|
-
e[
|
|
8963
|
+
e[fc(t)] = r[t];
|
|
8964
8964
|
return e;
|
|
8965
8965
|
}
|
|
8966
8966
|
function An(r, e, t = !0) {
|
|
@@ -8970,7 +8970,7 @@ function pc(r) {
|
|
|
8970
8970
|
return new Q({ props: { handleKeyDown: mc(r) } });
|
|
8971
8971
|
}
|
|
8972
8972
|
function mc(r) {
|
|
8973
|
-
let e =
|
|
8973
|
+
let e = hc(r);
|
|
8974
8974
|
return function(t, n) {
|
|
8975
8975
|
let i = uc(n), s, o = e[An(i, n)];
|
|
8976
8976
|
if (o && o(t.state, t.dispatch, t))
|
|
@@ -9223,22 +9223,22 @@ function Cc(r) {
|
|
|
9223
9223
|
if (!n.depth)
|
|
9224
9224
|
return !1;
|
|
9225
9225
|
let s = [], o, l, a = !1, c = !1;
|
|
9226
|
-
for (let
|
|
9227
|
-
if (n.node(
|
|
9228
|
-
a = n.end(
|
|
9226
|
+
for (let h = n.depth; ; h--)
|
|
9227
|
+
if (n.node(h).isBlock) {
|
|
9228
|
+
a = n.end(h) == n.pos + (n.depth - h), c = n.start(h) == n.pos - (n.depth - h), l = kr(n.node(h - 1).contentMatchAt(n.indexAfter(h - 1))), s.unshift(a && l ? { type: l } : null), o = h;
|
|
9229
9229
|
break;
|
|
9230
9230
|
} else {
|
|
9231
|
-
if (
|
|
9231
|
+
if (h == 1)
|
|
9232
9232
|
return !1;
|
|
9233
9233
|
s.unshift(null);
|
|
9234
9234
|
}
|
|
9235
9235
|
let u = e.tr;
|
|
9236
9236
|
(e.selection instanceof E || e.selection instanceof Z) && u.deleteSelection();
|
|
9237
|
-
let d = u.mapping.map(n.pos),
|
|
9238
|
-
if (
|
|
9237
|
+
let d = u.mapping.map(n.pos), f = pe(u.doc, d, s.length, s);
|
|
9238
|
+
if (f || (s[0] = l ? { type: l } : null, f = pe(u.doc, d, s.length, s)), !f)
|
|
9239
9239
|
return !1;
|
|
9240
9240
|
if (u.split(d, s.length, s), !a && c && n.node(o).type != l) {
|
|
9241
|
-
let
|
|
9241
|
+
let h = u.mapping.map(n.before(o)), p = u.doc.resolve(h);
|
|
9242
9242
|
l && n.node(o - 1).canReplaceWith(p.index(), p.index() + 1, l) && u.setNodeMarkup(u.mapping.map(n.before(o)), l);
|
|
9243
9243
|
}
|
|
9244
9244
|
return t && t(u.scrollIntoView()), !0;
|
|
@@ -9259,26 +9259,26 @@ function co(r, e, t, n) {
|
|
|
9259
9259
|
let c = !a && e.parent.canReplace(e.index(), e.index() + 1);
|
|
9260
9260
|
if (c && (o = (l = i.contentMatchAt(i.childCount)).findWrapping(s.type)) && l.matchType(o[0] || s.type).validEnd) {
|
|
9261
9261
|
if (t) {
|
|
9262
|
-
let
|
|
9262
|
+
let h = e.pos + s.nodeSize, p = b.empty;
|
|
9263
9263
|
for (let y = o.length - 1; y >= 0; y--)
|
|
9264
9264
|
p = b.from(o[y].create(null, p));
|
|
9265
9265
|
p = b.from(i.copy(p));
|
|
9266
|
-
let m = r.tr.step(new F(e.pos - 1,
|
|
9266
|
+
let m = r.tr.step(new F(e.pos - 1, h, e.pos, h, new k(p, 1, 0), o.length, !0)), g = m.doc.resolve(h + 2 * o.length);
|
|
9267
9267
|
g.nodeAfter && g.nodeAfter.type == i.type && qe(m.doc, g.pos) && m.join(g.pos), t(m.scrollIntoView());
|
|
9268
9268
|
}
|
|
9269
9269
|
return !0;
|
|
9270
9270
|
}
|
|
9271
|
-
let u = s.type.spec.isolating || n > 0 && a ? null : O.findFrom(e, 1), d = u && u.$from.blockRange(u.$to),
|
|
9272
|
-
if (
|
|
9273
|
-
return t && t(r.tr.lift(d,
|
|
9271
|
+
let u = s.type.spec.isolating || n > 0 && a ? null : O.findFrom(e, 1), d = u && u.$from.blockRange(u.$to), f = d && st(d);
|
|
9272
|
+
if (f != null && f >= e.depth)
|
|
9273
|
+
return t && t(r.tr.lift(d, f).scrollIntoView()), !0;
|
|
9274
9274
|
if (c && it(s, "start", !0) && it(i, "end")) {
|
|
9275
|
-
let
|
|
9276
|
-
for (; p.push(
|
|
9277
|
-
|
|
9275
|
+
let h = i, p = [];
|
|
9276
|
+
for (; p.push(h), !h.isTextblock; )
|
|
9277
|
+
h = h.lastChild;
|
|
9278
9278
|
let m = s, g = 1;
|
|
9279
9279
|
for (; !m.isTextblock; m = m.firstChild)
|
|
9280
9280
|
g++;
|
|
9281
|
-
if (
|
|
9281
|
+
if (h.canReplace(h.childCount, h.childCount, m.content)) {
|
|
9282
9282
|
if (t) {
|
|
9283
9283
|
let y = b.empty;
|
|
9284
9284
|
for (let w = p.length - 1; w >= 0; w--)
|
|
@@ -9380,8 +9380,8 @@ function Dc(r, e, t, n, i) {
|
|
|
9380
9380
|
for (let u = 0; u < t.length; u++)
|
|
9381
9381
|
t[u].type == i && (o = u + 1);
|
|
9382
9382
|
let l = t.length - o, a = e.start + t.length - (n ? 2 : 0), c = e.parent;
|
|
9383
|
-
for (let u = e.startIndex, d = e.endIndex,
|
|
9384
|
-
!
|
|
9383
|
+
for (let u = e.startIndex, d = e.endIndex, f = !0; u < d; u++, f = !1)
|
|
9384
|
+
!f && pe(r.doc, a, l) && (r.split(a, l), a += 2 * l), a += c.child(u).nodeSize;
|
|
9385
9385
|
return r;
|
|
9386
9386
|
}
|
|
9387
9387
|
function Ic(r) {
|
|
@@ -9402,16 +9402,16 @@ function Pc(r, e, t, n) {
|
|
|
9402
9402
|
}
|
|
9403
9403
|
function Rc(r, e, t) {
|
|
9404
9404
|
let n = r.tr, i = t.parent;
|
|
9405
|
-
for (let
|
|
9406
|
-
|
|
9405
|
+
for (let h = t.end, p = t.endIndex - 1, m = t.startIndex; p > m; p--)
|
|
9406
|
+
h -= i.child(p).nodeSize, n.delete(h - 1, h + 1);
|
|
9407
9407
|
let s = n.doc.resolve(t.start), o = s.nodeAfter;
|
|
9408
9408
|
if (n.mapping.map(t.end) != t.start + s.nodeAfter.nodeSize)
|
|
9409
9409
|
return !1;
|
|
9410
9410
|
let l = t.startIndex == 0, a = t.endIndex == i.childCount, c = s.node(-1), u = s.index(-1);
|
|
9411
9411
|
if (!c.canReplace(u + (l ? 0 : 1), u + 1, o.content.append(a ? b.empty : b.from(i))))
|
|
9412
9412
|
return !1;
|
|
9413
|
-
let d = s.pos,
|
|
9414
|
-
return n.step(new F(d - (l ? 1 : 0),
|
|
9413
|
+
let d = s.pos, f = d + o.nodeSize;
|
|
9414
|
+
return n.step(new F(d - (l ? 1 : 0), f + (a ? 1 : 0), d + 1, f - 1, new k((l ? b.empty : b.from(i.copy(b.empty))).append(a ? b.empty : b.from(i.copy(b.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(n.scrollIntoView()), !0;
|
|
9415
9415
|
}
|
|
9416
9416
|
function Bc(r) {
|
|
9417
9417
|
return function(e, t) {
|
|
@@ -9425,8 +9425,8 @@ function Bc(r) {
|
|
|
9425
9425
|
if (a.type != r)
|
|
9426
9426
|
return !1;
|
|
9427
9427
|
if (t) {
|
|
9428
|
-
let c = a.lastChild && a.lastChild.type == l.type, u = b.from(c ? r.create() : null), d = new k(b.from(r.create(null, b.from(l.type.create(null, u)))), c ? 3 : 1, 0),
|
|
9429
|
-
t(e.tr.step(new F(
|
|
9428
|
+
let c = a.lastChild && a.lastChild.type == l.type, u = b.from(c ? r.create() : null), d = new k(b.from(r.create(null, b.from(l.type.create(null, u)))), c ? 3 : 1, 0), f = s.start, h = s.end;
|
|
9429
|
+
t(e.tr.step(new F(f - (c ? 3 : 1), h, f, h, d, 1, !0)).scrollIntoView());
|
|
9430
9430
|
}
|
|
9431
9431
|
return !0;
|
|
9432
9432
|
};
|
|
@@ -9480,9 +9480,9 @@ class cn {
|
|
|
9480
9480
|
return () => this.createCan();
|
|
9481
9481
|
}
|
|
9482
9482
|
createChain(e, t = !0) {
|
|
9483
|
-
const { rawCommands: n, editor: i, state: s } = this, { view: o } = i, l = [], a = !!e, c = e || s.tr, u = () => (!a && t && !c.getMeta("preventDispatch") && !this.hasCustomState && o.dispatch(c), l.every((
|
|
9484
|
-
...Object.fromEntries(Object.entries(n).map(([
|
|
9485
|
-
const g = this.buildProps(c, t), y =
|
|
9483
|
+
const { rawCommands: n, editor: i, state: s } = this, { view: o } = i, l = [], a = !!e, c = e || s.tr, u = () => (!a && t && !c.getMeta("preventDispatch") && !this.hasCustomState && o.dispatch(c), l.every((f) => f === !0)), d = {
|
|
9484
|
+
...Object.fromEntries(Object.entries(n).map(([f, h]) => [f, (...m) => {
|
|
9485
|
+
const g = this.buildProps(c, t), y = h(...m)(g);
|
|
9486
9486
|
return l.push(y), d;
|
|
9487
9487
|
}])),
|
|
9488
9488
|
run: u
|
|
@@ -9555,7 +9555,7 @@ function un(r) {
|
|
|
9555
9555
|
markExtensions: n
|
|
9556
9556
|
};
|
|
9557
9557
|
}
|
|
9558
|
-
function
|
|
9558
|
+
function fo(r) {
|
|
9559
9559
|
const e = [], { nodeExtensions: t, markExtensions: n } = un(r), i = [...t, ...n], s = {
|
|
9560
9560
|
default: null,
|
|
9561
9561
|
rendered: !0,
|
|
@@ -9575,13 +9575,13 @@ function ho(r) {
|
|
|
9575
9575
|
return;
|
|
9576
9576
|
a().forEach((u) => {
|
|
9577
9577
|
u.types.forEach((d) => {
|
|
9578
|
-
Object.entries(u.attributes).forEach(([
|
|
9578
|
+
Object.entries(u.attributes).forEach(([f, h]) => {
|
|
9579
9579
|
e.push({
|
|
9580
9580
|
type: d,
|
|
9581
|
-
name:
|
|
9581
|
+
name: f,
|
|
9582
9582
|
attribute: {
|
|
9583
9583
|
...s,
|
|
9584
|
-
...
|
|
9584
|
+
...h
|
|
9585
9585
|
}
|
|
9586
9586
|
});
|
|
9587
9587
|
});
|
|
@@ -9597,14 +9597,14 @@ function ho(r) {
|
|
|
9597
9597
|
return;
|
|
9598
9598
|
const c = a();
|
|
9599
9599
|
Object.entries(c).forEach(([u, d]) => {
|
|
9600
|
-
const
|
|
9600
|
+
const f = {
|
|
9601
9601
|
...s,
|
|
9602
9602
|
...d
|
|
9603
9603
|
};
|
|
9604
|
-
typeof (
|
|
9604
|
+
typeof (f == null ? void 0 : f.default) == "function" && (f.default = f.default()), f != null && f.isRequired && (f == null ? void 0 : f.default) === void 0 && delete f.default, e.push({
|
|
9605
9605
|
type: o.name,
|
|
9606
9606
|
name: u,
|
|
9607
|
-
attribute:
|
|
9607
|
+
attribute: f
|
|
9608
9608
|
});
|
|
9609
9609
|
});
|
|
9610
9610
|
}), e;
|
|
@@ -9631,11 +9631,11 @@ function Fc(...r) {
|
|
|
9631
9631
|
} else if (i === "style") {
|
|
9632
9632
|
const l = s ? s.split(";").map((u) => u.trim()).filter(Boolean) : [], a = n[i] ? n[i].split(";").map((u) => u.trim()).filter(Boolean) : [], c = /* @__PURE__ */ new Map();
|
|
9633
9633
|
a.forEach((u) => {
|
|
9634
|
-
const [d,
|
|
9635
|
-
c.set(d,
|
|
9634
|
+
const [d, f] = u.split(":").map((h) => h.trim());
|
|
9635
|
+
c.set(d, f);
|
|
9636
9636
|
}), l.forEach((u) => {
|
|
9637
|
-
const [d,
|
|
9638
|
-
c.set(d,
|
|
9637
|
+
const [d, f] = u.split(":").map((h) => h.trim());
|
|
9638
|
+
c.set(d, f);
|
|
9639
9639
|
}), n[i] = Array.from(c.entries()).map(([u, d]) => `${u}: ${d}`).join("; ");
|
|
9640
9640
|
} else
|
|
9641
9641
|
n[i] = s;
|
|
@@ -9647,11 +9647,11 @@ function Zn(r, e) {
|
|
|
9647
9647
|
[t.name]: r.attrs[t.name]
|
|
9648
9648
|
}).reduce((t, n) => Fc(t, n), {});
|
|
9649
9649
|
}
|
|
9650
|
-
function
|
|
9650
|
+
function ho(r) {
|
|
9651
9651
|
return typeof r == "function";
|
|
9652
9652
|
}
|
|
9653
9653
|
function N(r, e = void 0, ...t) {
|
|
9654
|
-
return
|
|
9654
|
+
return ho(r) ? e ? r.bind(e)(...t) : r(...t) : r;
|
|
9655
9655
|
}
|
|
9656
9656
|
function Lc(r = {}) {
|
|
9657
9657
|
return Object.keys(r).length === 0 && r.constructor === Object;
|
|
@@ -9685,20 +9685,20 @@ function Ni(r) {
|
|
|
9685
9685
|
}
|
|
9686
9686
|
function Vc(r, e) {
|
|
9687
9687
|
var t;
|
|
9688
|
-
const n =
|
|
9688
|
+
const n = fo(r), { nodeExtensions: i, markExtensions: s } = un(r), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
|
|
9689
9689
|
const u = n.filter((y) => y.type === c.name), d = {
|
|
9690
9690
|
name: c.name,
|
|
9691
9691
|
options: c.options,
|
|
9692
9692
|
storage: c.storage,
|
|
9693
9693
|
editor: e
|
|
9694
|
-
},
|
|
9694
|
+
}, f = r.reduce((y, S) => {
|
|
9695
9695
|
const w = x(S, "extendNodeSchema", d);
|
|
9696
9696
|
return {
|
|
9697
9697
|
...y,
|
|
9698
9698
|
...w ? w(c) : {}
|
|
9699
9699
|
};
|
|
9700
|
-
}, {}),
|
|
9701
|
-
...
|
|
9700
|
+
}, {}), h = Ni({
|
|
9701
|
+
...f,
|
|
9702
9702
|
content: N(x(c, "content", d)),
|
|
9703
9703
|
marks: N(x(c, "marks", d)),
|
|
9704
9704
|
group: N(x(c, "group", d)),
|
|
@@ -9716,28 +9716,28 @@ function Vc(r, e) {
|
|
|
9716
9716
|
return [y.name, { default: (S = y == null ? void 0 : y.attribute) === null || S === void 0 ? void 0 : S.default }];
|
|
9717
9717
|
}))
|
|
9718
9718
|
}), p = N(x(c, "parseHTML", d));
|
|
9719
|
-
p && (
|
|
9719
|
+
p && (h.parseDOM = p.map((y) => Oi(y, u)));
|
|
9720
9720
|
const m = x(c, "renderHTML", d);
|
|
9721
|
-
m && (
|
|
9721
|
+
m && (h.toDOM = (y) => m({
|
|
9722
9722
|
node: y,
|
|
9723
9723
|
HTMLAttributes: Zn(y, u)
|
|
9724
9724
|
}));
|
|
9725
9725
|
const g = x(c, "renderText", d);
|
|
9726
|
-
return g && (
|
|
9726
|
+
return g && (h.toText = g), [c.name, h];
|
|
9727
9727
|
})), a = Object.fromEntries(s.map((c) => {
|
|
9728
9728
|
const u = n.filter((g) => g.type === c.name), d = {
|
|
9729
9729
|
name: c.name,
|
|
9730
9730
|
options: c.options,
|
|
9731
9731
|
storage: c.storage,
|
|
9732
9732
|
editor: e
|
|
9733
|
-
},
|
|
9733
|
+
}, f = r.reduce((g, y) => {
|
|
9734
9734
|
const S = x(y, "extendMarkSchema", d);
|
|
9735
9735
|
return {
|
|
9736
9736
|
...g,
|
|
9737
9737
|
...S ? S(c) : {}
|
|
9738
9738
|
};
|
|
9739
|
-
}, {}),
|
|
9740
|
-
...
|
|
9739
|
+
}, {}), h = Ni({
|
|
9740
|
+
...f,
|
|
9741
9741
|
inclusive: N(x(c, "inclusive", d)),
|
|
9742
9742
|
excludes: N(x(c, "excludes", d)),
|
|
9743
9743
|
group: N(x(c, "group", d)),
|
|
@@ -9748,12 +9748,12 @@ function Vc(r, e) {
|
|
|
9748
9748
|
return [g.name, { default: (y = g == null ? void 0 : g.attribute) === null || y === void 0 ? void 0 : y.default }];
|
|
9749
9749
|
}))
|
|
9750
9750
|
}), p = N(x(c, "parseHTML", d));
|
|
9751
|
-
p && (
|
|
9751
|
+
p && (h.parseDOM = p.map((g) => Oi(g, u)));
|
|
9752
9752
|
const m = x(c, "renderHTML", d);
|
|
9753
|
-
return m && (
|
|
9753
|
+
return m && (h.toDOM = (g) => m({
|
|
9754
9754
|
mark: g,
|
|
9755
9755
|
HTMLAttributes: Zn(g, u)
|
|
9756
|
-
})), [c.name,
|
|
9756
|
+
})), [c.name, h];
|
|
9757
9757
|
}));
|
|
9758
9758
|
return new ts({
|
|
9759
9759
|
topNode: o,
|
|
@@ -9805,31 +9805,31 @@ function vt(r) {
|
|
|
9805
9805
|
const c = a.state.doc.resolve(n);
|
|
9806
9806
|
if (
|
|
9807
9807
|
// check for code node
|
|
9808
|
-
c.parent.type.spec.code || !((e = c.nodeBefore || c.nodeAfter) === null || e === void 0) && e.marks.find((
|
|
9808
|
+
c.parent.type.spec.code || !((e = c.nodeBefore || c.nodeAfter) === null || e === void 0) && e.marks.find((f) => f.type.spec.code)
|
|
9809
9809
|
)
|
|
9810
9810
|
return !1;
|
|
9811
9811
|
let u = !1;
|
|
9812
9812
|
const d = jc(c) + s;
|
|
9813
|
-
return o.forEach((
|
|
9813
|
+
return o.forEach((f) => {
|
|
9814
9814
|
if (u)
|
|
9815
9815
|
return;
|
|
9816
|
-
const
|
|
9817
|
-
if (!
|
|
9816
|
+
const h = Wc(d, f.find);
|
|
9817
|
+
if (!h)
|
|
9818
9818
|
return;
|
|
9819
9819
|
const p = a.state.tr, m = an({
|
|
9820
9820
|
state: a.state,
|
|
9821
9821
|
transaction: p
|
|
9822
9822
|
}), g = {
|
|
9823
|
-
from: n - (
|
|
9823
|
+
from: n - (h[0].length - s.length),
|
|
9824
9824
|
to: i
|
|
9825
9825
|
}, { commands: y, chain: S, can: w } = new cn({
|
|
9826
9826
|
editor: t,
|
|
9827
9827
|
state: m
|
|
9828
9828
|
});
|
|
9829
|
-
|
|
9829
|
+
f.handler({
|
|
9830
9830
|
state: m,
|
|
9831
9831
|
range: g,
|
|
9832
|
-
match:
|
|
9832
|
+
match: h,
|
|
9833
9833
|
commands: y,
|
|
9834
9834
|
chain: S,
|
|
9835
9835
|
can: w
|
|
@@ -9855,11 +9855,11 @@ function Hc(r) {
|
|
|
9855
9855
|
return !!a && setTimeout(() => {
|
|
9856
9856
|
let { text: u } = a;
|
|
9857
9857
|
typeof u == "string" ? u = u : u = Sr(b.from(u), o.schema);
|
|
9858
|
-
const { from: d } = a,
|
|
9858
|
+
const { from: d } = a, f = d + u.length;
|
|
9859
9859
|
vt({
|
|
9860
9860
|
editor: e,
|
|
9861
9861
|
from: d,
|
|
9862
|
-
to:
|
|
9862
|
+
to: f,
|
|
9863
9863
|
text: u,
|
|
9864
9864
|
rules: t,
|
|
9865
9865
|
plugin: n
|
|
@@ -9988,10 +9988,10 @@ function Uc(r) {
|
|
|
9988
9988
|
editor: e,
|
|
9989
9989
|
state: t
|
|
9990
9990
|
}), d = [];
|
|
9991
|
-
return t.doc.nodesBetween(n, i, (
|
|
9992
|
-
if (!
|
|
9991
|
+
return t.doc.nodesBetween(n, i, (h, p) => {
|
|
9992
|
+
if (!h.isTextblock || h.type.spec.code)
|
|
9993
9993
|
return;
|
|
9994
|
-
const m = Math.max(n, p), g = Math.min(i, p +
|
|
9994
|
+
const m = Math.max(n, p), g = Math.min(i, p + h.content.size), y = h.textBetween(m - p, g - p, void 0, "");
|
|
9995
9995
|
Kc(y, s.find, o).forEach((w) => {
|
|
9996
9996
|
if (w.index === void 0)
|
|
9997
9997
|
return;
|
|
@@ -10010,7 +10010,7 @@ function Uc(r) {
|
|
|
10010
10010
|
});
|
|
10011
10011
|
d.push(P);
|
|
10012
10012
|
});
|
|
10013
|
-
}), d.every((
|
|
10013
|
+
}), d.every((h) => h !== null);
|
|
10014
10014
|
}
|
|
10015
10015
|
let It = null;
|
|
10016
10016
|
const _c = (r) => {
|
|
@@ -10028,7 +10028,7 @@ function Gc(r) {
|
|
|
10028
10028
|
} catch {
|
|
10029
10029
|
l = null;
|
|
10030
10030
|
}
|
|
10031
|
-
const a = ({ state: u, from: d, to:
|
|
10031
|
+
const a = ({ state: u, from: d, to: f, rule: h, pasteEvt: p }) => {
|
|
10032
10032
|
const m = u.tr, g = an({
|
|
10033
10033
|
state: u,
|
|
10034
10034
|
transaction: m
|
|
@@ -10037,8 +10037,8 @@ function Gc(r) {
|
|
|
10037
10037
|
editor: e,
|
|
10038
10038
|
state: g,
|
|
10039
10039
|
from: Math.max(d - 1, 0),
|
|
10040
|
-
to:
|
|
10041
|
-
rule:
|
|
10040
|
+
to: f.b - 1,
|
|
10041
|
+
rule: h,
|
|
10042
10042
|
pasteEvent: p,
|
|
10043
10043
|
dropEvent: l
|
|
10044
10044
|
}) || !m.steps.length)) {
|
|
@@ -10053,58 +10053,58 @@ function Gc(r) {
|
|
|
10053
10053
|
return t.map((u) => new Q({
|
|
10054
10054
|
// we register a global drag handler to track the current drag source element
|
|
10055
10055
|
view(d) {
|
|
10056
|
-
const
|
|
10056
|
+
const f = (p) => {
|
|
10057
10057
|
var m;
|
|
10058
10058
|
n = !((m = d.dom.parentElement) === null || m === void 0) && m.contains(p.target) ? d.dom.parentElement : null, n && (It = e);
|
|
10059
|
-
},
|
|
10059
|
+
}, h = () => {
|
|
10060
10060
|
It && (It = null);
|
|
10061
10061
|
};
|
|
10062
|
-
return window.addEventListener("dragstart",
|
|
10062
|
+
return window.addEventListener("dragstart", f), window.addEventListener("dragend", h), {
|
|
10063
10063
|
destroy() {
|
|
10064
|
-
window.removeEventListener("dragstart",
|
|
10064
|
+
window.removeEventListener("dragstart", f), window.removeEventListener("dragend", h);
|
|
10065
10065
|
}
|
|
10066
10066
|
};
|
|
10067
10067
|
},
|
|
10068
10068
|
props: {
|
|
10069
10069
|
handleDOMEvents: {
|
|
10070
|
-
drop: (d,
|
|
10071
|
-
if (s = n === d.dom.parentElement, l =
|
|
10072
|
-
const
|
|
10073
|
-
|
|
10074
|
-
const p =
|
|
10075
|
-
p &&
|
|
10070
|
+
drop: (d, f) => {
|
|
10071
|
+
if (s = n === d.dom.parentElement, l = f, !s) {
|
|
10072
|
+
const h = It;
|
|
10073
|
+
h && setTimeout(() => {
|
|
10074
|
+
const p = h.state.selection;
|
|
10075
|
+
p && h.commands.deleteRange({ from: p.from, to: p.to });
|
|
10076
10076
|
}, 10);
|
|
10077
10077
|
}
|
|
10078
10078
|
return !1;
|
|
10079
10079
|
},
|
|
10080
|
-
paste: (d,
|
|
10081
|
-
var
|
|
10082
|
-
const p = (
|
|
10083
|
-
return o =
|
|
10080
|
+
paste: (d, f) => {
|
|
10081
|
+
var h;
|
|
10082
|
+
const p = (h = f.clipboardData) === null || h === void 0 ? void 0 : h.getData("text/html");
|
|
10083
|
+
return o = f, i = !!(p != null && p.includes("data-pm-slice")), !1;
|
|
10084
10084
|
}
|
|
10085
10085
|
}
|
|
10086
10086
|
},
|
|
10087
|
-
appendTransaction: (d,
|
|
10087
|
+
appendTransaction: (d, f, h) => {
|
|
10088
10088
|
const p = d[0], m = p.getMeta("uiEvent") === "paste" && !i, g = p.getMeta("uiEvent") === "drop" && !s, y = p.getMeta("applyPasteRules"), S = !!y;
|
|
10089
10089
|
if (!m && !g && !S)
|
|
10090
10090
|
return;
|
|
10091
10091
|
if (S) {
|
|
10092
10092
|
let { text: A } = y;
|
|
10093
|
-
typeof A == "string" ? A = A : A = Sr(b.from(A),
|
|
10093
|
+
typeof A == "string" ? A = A : A = Sr(b.from(A), h.schema);
|
|
10094
10094
|
const { from: M } = y, P = M + A.length, I = _c(A);
|
|
10095
10095
|
return a({
|
|
10096
10096
|
rule: u,
|
|
10097
|
-
state:
|
|
10097
|
+
state: h,
|
|
10098
10098
|
from: M,
|
|
10099
10099
|
to: { b: P },
|
|
10100
10100
|
pasteEvt: I
|
|
10101
10101
|
});
|
|
10102
10102
|
}
|
|
10103
|
-
const w =
|
|
10103
|
+
const w = f.doc.content.findDiffStart(h.doc.content), v = f.doc.content.findDiffEnd(h.doc.content);
|
|
10104
10104
|
if (!(!qc(w) || !v || w === v.b))
|
|
10105
10105
|
return a({
|
|
10106
10106
|
rule: u,
|
|
10107
|
-
state:
|
|
10107
|
+
state: h,
|
|
10108
10108
|
from: w,
|
|
10109
10109
|
to: v,
|
|
10110
10110
|
pasteEvt: o
|
|
@@ -10195,10 +10195,10 @@ class Xe {
|
|
|
10195
10195
|
}
|
|
10196
10196
|
const d = pc(u);
|
|
10197
10197
|
a.push(d);
|
|
10198
|
-
const
|
|
10199
|
-
Ai(o, e.options.enableInputRules) &&
|
|
10200
|
-
const
|
|
10201
|
-
Ai(o, e.options.enablePasteRules) &&
|
|
10198
|
+
const f = x(o, "addInputRules", l);
|
|
10199
|
+
Ai(o, e.options.enableInputRules) && f && n.push(...f());
|
|
10200
|
+
const h = x(o, "addPasteRules", l);
|
|
10201
|
+
Ai(o, e.options.enablePasteRules) && h && i.push(...h());
|
|
10202
10202
|
const p = x(o, "addProseMirrorPlugins", l);
|
|
10203
10203
|
if (p) {
|
|
10204
10204
|
const m = p();
|
|
@@ -10223,7 +10223,7 @@ class Xe {
|
|
|
10223
10223
|
* @returns An array of attributes
|
|
10224
10224
|
*/
|
|
10225
10225
|
get attributes() {
|
|
10226
|
-
return
|
|
10226
|
+
return fo(this.extensions);
|
|
10227
10227
|
}
|
|
10228
10228
|
/**
|
|
10229
10229
|
* Get all node views from the extensions.
|
|
@@ -10241,19 +10241,19 @@ class Xe {
|
|
|
10241
10241
|
}, o = x(n, "addNodeView", s);
|
|
10242
10242
|
if (!o)
|
|
10243
10243
|
return [];
|
|
10244
|
-
const l = (a, c, u, d,
|
|
10245
|
-
const
|
|
10244
|
+
const l = (a, c, u, d, f) => {
|
|
10245
|
+
const h = Zn(a, i);
|
|
10246
10246
|
return o()({
|
|
10247
10247
|
// pass-through
|
|
10248
10248
|
node: a,
|
|
10249
10249
|
view: c,
|
|
10250
10250
|
getPos: u,
|
|
10251
10251
|
decorations: d,
|
|
10252
|
-
innerDecorations:
|
|
10252
|
+
innerDecorations: f,
|
|
10253
10253
|
// tiptap-specific
|
|
10254
10254
|
editor: e,
|
|
10255
10255
|
extension: n,
|
|
10256
|
-
HTMLAttributes:
|
|
10256
|
+
HTMLAttributes: h
|
|
10257
10257
|
});
|
|
10258
10258
|
};
|
|
10259
10259
|
return [n.name, l];
|
|
@@ -10321,18 +10321,18 @@ function po(r, e, t) {
|
|
|
10321
10321
|
`, textSerializers: o = {} } = t || {};
|
|
10322
10322
|
let l = "";
|
|
10323
10323
|
return r.nodesBetween(n, i, (a, c, u, d) => {
|
|
10324
|
-
var
|
|
10324
|
+
var f;
|
|
10325
10325
|
a.isBlock && c > n && (l += s);
|
|
10326
|
-
const
|
|
10327
|
-
if (
|
|
10328
|
-
return u && (l +=
|
|
10326
|
+
const h = o == null ? void 0 : o[a.type.name];
|
|
10327
|
+
if (h)
|
|
10328
|
+
return u && (l += h({
|
|
10329
10329
|
node: a,
|
|
10330
10330
|
pos: c,
|
|
10331
10331
|
parent: u,
|
|
10332
10332
|
index: d,
|
|
10333
10333
|
range: e
|
|
10334
10334
|
})), !1;
|
|
10335
|
-
a.isText && (l += (
|
|
10335
|
+
a.isText && (l += (f = a == null ? void 0 : a.text) === null || f === void 0 ? void 0 : f.slice(Math.max(n, c) - c, i - c));
|
|
10336
10336
|
}), l;
|
|
10337
10337
|
}
|
|
10338
10338
|
function mo(r) {
|
|
@@ -10370,15 +10370,15 @@ const Xc = Y.create({
|
|
|
10370
10370
|
r.doc.nodesBetween(s.pos, o.pos, (l, a) => {
|
|
10371
10371
|
if (l.type.isText)
|
|
10372
10372
|
return;
|
|
10373
|
-
const { doc: c, mapping: u } = e, d = c.resolve(u.map(a)),
|
|
10374
|
-
if (!
|
|
10373
|
+
const { doc: c, mapping: u } = e, d = c.resolve(u.map(a)), f = c.resolve(u.map(a + l.nodeSize)), h = d.blockRange(f);
|
|
10374
|
+
if (!h)
|
|
10375
10375
|
return;
|
|
10376
|
-
const p = st(
|
|
10376
|
+
const p = st(h);
|
|
10377
10377
|
if (l.type.isTextblock) {
|
|
10378
10378
|
const { defaultType: m } = d.parent.contentMatchAt(d.index());
|
|
10379
|
-
e.setNodeMarkup(
|
|
10379
|
+
e.setNodeMarkup(h.start, m);
|
|
10380
10380
|
}
|
|
10381
|
-
(p || p === 0) && e.lift(
|
|
10381
|
+
(p || p === 0) && e.lift(h, p);
|
|
10382
10382
|
});
|
|
10383
10383
|
}), !0;
|
|
10384
10384
|
}, tu = (r) => (e) => r(e), nu = () => ({ state: r, dispatch: e }) => lo(r, e), ru = (r, e) => ({ editor: t, tr: n }) => {
|
|
@@ -10459,8 +10459,8 @@ const uu = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
|
|
|
10459
10459
|
if (i) {
|
|
10460
10460
|
const d = wr(a, s, e);
|
|
10461
10461
|
if (d && d.from <= c && d.to >= u) {
|
|
10462
|
-
const
|
|
10463
|
-
t.setSelection(
|
|
10462
|
+
const f = E.create(o, d.from, d.to);
|
|
10463
|
+
t.setSelection(f);
|
|
10464
10464
|
}
|
|
10465
10465
|
}
|
|
10466
10466
|
return !0;
|
|
@@ -10488,7 +10488,7 @@ function bo(r, e = null) {
|
|
|
10488
10488
|
const i = t.from, s = n.to;
|
|
10489
10489
|
return e === "all" ? E.create(r, Be(0, i, s), Be(r.content.size, i, s)) : E.create(r, Be(e, i, s), Be(e, i, s));
|
|
10490
10490
|
}
|
|
10491
|
-
function
|
|
10491
|
+
function fu() {
|
|
10492
10492
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
10493
10493
|
}
|
|
10494
10494
|
function Mr() {
|
|
@@ -10501,13 +10501,13 @@ function Mr() {
|
|
|
10501
10501
|
"iPod"
|
|
10502
10502
|
].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
10503
10503
|
}
|
|
10504
|
-
const
|
|
10504
|
+
const hu = (r = null, e = {}) => ({ editor: t, view: n, tr: i, dispatch: s }) => {
|
|
10505
10505
|
e = {
|
|
10506
10506
|
scrollIntoView: !0,
|
|
10507
10507
|
...e
|
|
10508
10508
|
};
|
|
10509
10509
|
const o = () => {
|
|
10510
|
-
(Mr() ||
|
|
10510
|
+
(Mr() || fu()) && n.dom.focus(), requestAnimationFrame(() => {
|
|
10511
10511
|
t.isDestroyed || (n.focus(), e != null && e.scrollIntoView && t.commands.scrollIntoView());
|
|
10512
10512
|
});
|
|
10513
10513
|
};
|
|
@@ -10626,20 +10626,20 @@ const yu = (r) => !("type" in r), bu = (r, e, t) => ({ tr: n, dispatch: i, edito
|
|
|
10626
10626
|
const { parent: p } = n.doc.resolve(a);
|
|
10627
10627
|
p.isTextblock && !p.type.spec.code && !p.childCount && (a -= 1, c += 1);
|
|
10628
10628
|
}
|
|
10629
|
-
let
|
|
10629
|
+
let h;
|
|
10630
10630
|
if (u) {
|
|
10631
10631
|
if (Array.isArray(e))
|
|
10632
|
-
|
|
10632
|
+
h = e.map((p) => p.text || "").join("");
|
|
10633
10633
|
else if (e instanceof b) {
|
|
10634
10634
|
let p = "";
|
|
10635
10635
|
e.forEach((m) => {
|
|
10636
10636
|
m.text && (p += m.text);
|
|
10637
|
-
}),
|
|
10638
|
-
} else typeof e == "object" && e && e.text ?
|
|
10639
|
-
n.insertText(
|
|
10637
|
+
}), h = p;
|
|
10638
|
+
} else typeof e == "object" && e && e.text ? h = e.text : h = e;
|
|
10639
|
+
n.insertText(h, a, c);
|
|
10640
10640
|
} else
|
|
10641
|
-
|
|
10642
|
-
t.updateSelection && gu(n, n.steps.length - 1, -1), t.applyInputRules && n.setMeta("applyInputRules", { from: a, text:
|
|
10641
|
+
h = l, n.replaceWith(a, c, h);
|
|
10642
|
+
t.updateSelection && gu(n, n.steps.length - 1, -1), t.applyInputRules && n.setMeta("applyInputRules", { from: a, text: h }), t.applyPasteRules && n.setMeta("applyPasteRules", { from: a, text: h });
|
|
10643
10643
|
}
|
|
10644
10644
|
return !0;
|
|
10645
10645
|
}, ku = () => ({ state: r, dispatch: e }) => bc(r, e), xu = () => ({ state: r, dispatch: e }) => kc(r, e), Su = () => ({ state: r, dispatch: e }) => eo(r, e), Cu = () => ({ state: r, dispatch: e }) => io(r, e), wu = () => ({ state: r, dispatch: e, tr: t }) => {
|
|
@@ -10701,18 +10701,18 @@ const Nu = (r) => ({ editor: e, view: t, tr: n, dispatch: i }) => {
|
|
|
10701
10701
|
};
|
|
10702
10702
|
function Ct(r, e, t = {}) {
|
|
10703
10703
|
const { from: n, to: i, empty: s } = r.selection, o = e ? $(e, r.schema) : null, l = [];
|
|
10704
|
-
r.doc.nodesBetween(n, i, (d,
|
|
10704
|
+
r.doc.nodesBetween(n, i, (d, f) => {
|
|
10705
10705
|
if (d.isText)
|
|
10706
10706
|
return;
|
|
10707
|
-
const
|
|
10707
|
+
const h = Math.max(n, f), p = Math.min(i, f + d.nodeSize);
|
|
10708
10708
|
l.push({
|
|
10709
10709
|
node: d,
|
|
10710
|
-
from:
|
|
10710
|
+
from: h,
|
|
10711
10711
|
to: p
|
|
10712
10712
|
});
|
|
10713
10713
|
});
|
|
10714
10714
|
const a = i - n, c = l.filter((d) => o ? o.name === d.node.type.name : !0).filter((d) => Xt(d.node.attrs, t, { strict: !1 }));
|
|
10715
|
-
return s ? !!c.length : c.reduce((d,
|
|
10715
|
+
return s ? !!c.length : c.reduce((d, f) => d + f.to - f.from, 0) >= a;
|
|
10716
10716
|
}
|
|
10717
10717
|
const Au = (r, e = {}) => ({ state: t, dispatch: n }) => {
|
|
10718
10718
|
const i = $(r, t.schema);
|
|
@@ -10721,7 +10721,7 @@ const Au = (r, e = {}) => ({ state: t, dispatch: n }) => {
|
|
|
10721
10721
|
const n = $(r, e.schema);
|
|
10722
10722
|
return Ic(n)(e, t);
|
|
10723
10723
|
}, Iu = () => ({ state: r, dispatch: e }) => oo(r, e);
|
|
10724
|
-
function
|
|
10724
|
+
function fn(r, e) {
|
|
10725
10725
|
return e.nodes[r] ? "node" : e.marks[r] ? "mark" : null;
|
|
10726
10726
|
}
|
|
10727
10727
|
function Di(r, e) {
|
|
@@ -10730,7 +10730,7 @@ function Di(r, e) {
|
|
|
10730
10730
|
}
|
|
10731
10731
|
const Pu = (r, e) => ({ tr: t, state: n, dispatch: i }) => {
|
|
10732
10732
|
let s = null, o = null;
|
|
10733
|
-
const l =
|
|
10733
|
+
const l = fn(typeof r == "string" ? r : r.name, n.schema);
|
|
10734
10734
|
return l ? (l === "node" && (s = $(r, n.schema)), l === "mark" && (o = ve(r, n.schema)), i && t.selection.ranges.forEach((a) => {
|
|
10735
10735
|
n.doc.nodesBetween(a.$from.pos, a.$to.pos, (c, u) => {
|
|
10736
10736
|
s && s === c.type && t.setNodeMarkup(u, void 0, Di(c.attrs, e)), o && c.marks.length && c.marks.forEach((d) => {
|
|
@@ -10813,7 +10813,7 @@ function Ju(r, e) {
|
|
|
10813
10813
|
return o ? { ...o.attrs } : {};
|
|
10814
10814
|
}
|
|
10815
10815
|
function qu(r, e) {
|
|
10816
|
-
const t =
|
|
10816
|
+
const t = fn(typeof e == "string" ? e : e.name, r.schema);
|
|
10817
10817
|
return t === "node" ? Ju(r, e) : t === "mark" ? So(r, e) : {};
|
|
10818
10818
|
}
|
|
10819
10819
|
function Ft(r, e, t) {
|
|
@@ -10828,12 +10828,12 @@ function er(r, e, t = {}) {
|
|
|
10828
10828
|
return !!(r.storedMarks || r.selection.$from.marks()).filter((d) => s ? s.name === d.type.name : !0).find((d) => Xt(d.attrs, t, { strict: !1 }));
|
|
10829
10829
|
let o = 0;
|
|
10830
10830
|
const l = [];
|
|
10831
|
-
if (i.forEach(({ $from: d, $to:
|
|
10832
|
-
const
|
|
10833
|
-
r.doc.nodesBetween(
|
|
10831
|
+
if (i.forEach(({ $from: d, $to: f }) => {
|
|
10832
|
+
const h = d.pos, p = f.pos;
|
|
10833
|
+
r.doc.nodesBetween(h, p, (m, g) => {
|
|
10834
10834
|
if (!m.isText && !m.marks.length)
|
|
10835
10835
|
return;
|
|
10836
|
-
const y = Math.max(
|
|
10836
|
+
const y = Math.max(h, g), S = Math.min(p, g + m.nodeSize), w = S - y;
|
|
10837
10837
|
o += w, l.push(...m.marks.map((v) => ({
|
|
10838
10838
|
mark: v,
|
|
10839
10839
|
from: y,
|
|
@@ -10842,13 +10842,13 @@ function er(r, e, t = {}) {
|
|
|
10842
10842
|
});
|
|
10843
10843
|
}), o === 0)
|
|
10844
10844
|
return !1;
|
|
10845
|
-
const a = l.filter((d) => s ? s.name === d.mark.type.name : !0).filter((d) => Xt(d.mark.attrs, t, { strict: !1 })).reduce((d,
|
|
10845
|
+
const a = l.filter((d) => s ? s.name === d.mark.type.name : !0).filter((d) => Xt(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);
|
|
10846
10846
|
return (a > 0 ? a + c : a) >= o;
|
|
10847
10847
|
}
|
|
10848
10848
|
function Ku(r, e, t = {}) {
|
|
10849
10849
|
if (!e)
|
|
10850
10850
|
return Ct(r, null, t) || er(r, null, t);
|
|
10851
|
-
const n =
|
|
10851
|
+
const n = fn(e, r.schema);
|
|
10852
10852
|
return n === "node" ? Ct(r, e, t) : n === "mark" ? er(r, e, t) : !1;
|
|
10853
10853
|
}
|
|
10854
10854
|
function Ii(r, e) {
|
|
@@ -10862,7 +10862,7 @@ function Ii(r, e) {
|
|
|
10862
10862
|
}, s = N(x(n, "group", i));
|
|
10863
10863
|
return typeof s != "string" ? !1 : s.split(" ").includes("list");
|
|
10864
10864
|
}
|
|
10865
|
-
function
|
|
10865
|
+
function hn(r, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
|
|
10866
10866
|
var n;
|
|
10867
10867
|
if (t) {
|
|
10868
10868
|
if (r.type.name === "hardBreak")
|
|
@@ -10879,7 +10879,7 @@ function fn(r, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
|
|
|
10879
10879
|
if (e) {
|
|
10880
10880
|
let i = !0;
|
|
10881
10881
|
return r.content.forEach((s) => {
|
|
10882
|
-
i !== !1 && (
|
|
10882
|
+
i !== !1 && (hn(s, { ignoreWhitespace: t, checkChildren: e }) || (i = !1));
|
|
10883
10883
|
}), i;
|
|
10884
10884
|
}
|
|
10885
10885
|
return !1;
|
|
@@ -10895,12 +10895,12 @@ function Uu(r, e, t) {
|
|
|
10895
10895
|
const { ranges: o } = i;
|
|
10896
10896
|
return o.some(({ $from: l, $to: a }) => {
|
|
10897
10897
|
let c = l.depth === 0 ? r.doc.inlineContent && r.doc.type.allowsMarkType(t) : !1;
|
|
10898
|
-
return r.doc.nodesBetween(l.pos, a.pos, (u, d,
|
|
10898
|
+
return r.doc.nodesBetween(l.pos, a.pos, (u, d, f) => {
|
|
10899
10899
|
if (c)
|
|
10900
10900
|
return !1;
|
|
10901
10901
|
if (u.isInline) {
|
|
10902
|
-
const
|
|
10903
|
-
c =
|
|
10902
|
+
const h = !f || f.type.allowsMarkType(t), p = !!t.isInSet(u.marks) || !u.marks.some((m) => m.type.excludes(t));
|
|
10903
|
+
c = h && p;
|
|
10904
10904
|
}
|
|
10905
10905
|
return !c;
|
|
10906
10906
|
}), c;
|
|
@@ -10918,9 +10918,9 @@ const _u = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
|
|
|
10918
10918
|
} else
|
|
10919
10919
|
l.forEach((c) => {
|
|
10920
10920
|
const u = c.$from.pos, d = c.$to.pos;
|
|
10921
|
-
n.doc.nodesBetween(u, d, (
|
|
10922
|
-
const p = Math.max(
|
|
10923
|
-
|
|
10921
|
+
n.doc.nodesBetween(u, d, (f, h) => {
|
|
10922
|
+
const p = Math.max(h, u), m = Math.min(h + f.nodeSize, d);
|
|
10923
|
+
f.marks.find((y) => y.type === a) ? f.marks.forEach((y) => {
|
|
10924
10924
|
a === y.type && t.addMark(p, m, a.create({
|
|
10925
10925
|
...y.attrs,
|
|
10926
10926
|
...e
|
|
@@ -10962,22 +10962,22 @@ const ed = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
10962
10962
|
return !l.parentOffset || !pe(o, l.pos) ? !1 : (n && (r && Pi(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
|
|
10963
10963
|
if (!l.parent.isBlock)
|
|
10964
10964
|
return !1;
|
|
10965
|
-
const d = a.parentOffset === a.parent.content.size,
|
|
10966
|
-
let
|
|
10965
|
+
const d = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : Wu(l.node(-1).contentMatchAt(l.indexAfter(-1)));
|
|
10966
|
+
let h = d && f ? [
|
|
10967
10967
|
{
|
|
10968
|
-
type:
|
|
10968
|
+
type: f,
|
|
10969
10969
|
attrs: u
|
|
10970
10970
|
}
|
|
10971
|
-
] : void 0, p = pe(e.doc, e.mapping.map(l.pos), 1,
|
|
10972
|
-
if (!
|
|
10971
|
+
] : void 0, p = pe(e.doc, e.mapping.map(l.pos), 1, h);
|
|
10972
|
+
if (!h && !p && pe(e.doc, e.mapping.map(l.pos), 1, f ? [{ type: f }] : void 0) && (p = !0, h = f ? [
|
|
10973
10973
|
{
|
|
10974
|
-
type:
|
|
10974
|
+
type: f,
|
|
10975
10975
|
attrs: u
|
|
10976
10976
|
}
|
|
10977
10977
|
] : void 0), n) {
|
|
10978
|
-
if (p && (s instanceof E && e.deleteSelection(), e.split(e.mapping.map(l.pos), 1,
|
|
10978
|
+
if (p && (s instanceof E && e.deleteSelection(), e.split(e.mapping.map(l.pos), 1, h), f && !d && !l.parentOffset && l.parent.type !== f)) {
|
|
10979
10979
|
const m = e.mapping.map(l.before()), g = e.doc.resolve(m);
|
|
10980
|
-
l.node(-1).canReplaceWith(g.index(), g.index() + 1,
|
|
10980
|
+
l.node(-1).canReplaceWith(g.index(), g.index() + 1, f) && e.setNodeMarkup(e.mapping.map(l.before()), f);
|
|
10981
10981
|
}
|
|
10982
10982
|
r && Pi(t, i.extensionManager.splittableMarks), e.scrollIntoView();
|
|
10983
10983
|
}
|
|
@@ -10990,7 +10990,7 @@ const ed = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
10990
10990
|
const d = a.node(-1);
|
|
10991
10991
|
if (d.type !== l)
|
|
10992
10992
|
return !1;
|
|
10993
|
-
const
|
|
10993
|
+
const f = s.extensionManager.attributes;
|
|
10994
10994
|
if (a.parent.content.size === 0 && a.node(-1).childCount === a.indexAfter(-1)) {
|
|
10995
10995
|
if (a.depth === 2 || a.node(-3).type !== l || a.index(-2) !== a.node(-2).childCount - 1)
|
|
10996
10996
|
return !1;
|
|
@@ -11000,7 +11000,7 @@ const ed = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11000
11000
|
for (let I = a.depth - S; I >= a.depth - 3; I -= 1)
|
|
11001
11001
|
y = b.from(a.node(I).copy(y));
|
|
11002
11002
|
const w = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3, v = {
|
|
11003
|
-
...Ft(
|
|
11003
|
+
...Ft(f, a.node().type.name, a.node().attrs),
|
|
11004
11004
|
...e
|
|
11005
11005
|
}, A = ((o = l.contentMatch.defaultType) === null || o === void 0 ? void 0 : o.createAndFill(v)) || void 0;
|
|
11006
11006
|
y = y.append(b.from(l.createAndFill(null, A) || void 0));
|
|
@@ -11015,17 +11015,17 @@ const ed = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11015
11015
|
}
|
|
11016
11016
|
return !0;
|
|
11017
11017
|
}
|
|
11018
|
-
const
|
|
11019
|
-
...Ft(
|
|
11018
|
+
const h = c.pos === a.end() ? d.contentMatchAt(0).defaultType : null, p = {
|
|
11019
|
+
...Ft(f, d.type.name, d.attrs),
|
|
11020
11020
|
...e
|
|
11021
11021
|
}, m = {
|
|
11022
|
-
...Ft(
|
|
11022
|
+
...Ft(f, a.node().type.name, a.node().attrs),
|
|
11023
11023
|
...e
|
|
11024
11024
|
};
|
|
11025
11025
|
t.delete(a.pos, c.pos);
|
|
11026
|
-
const g =
|
|
11026
|
+
const g = h ? [
|
|
11027
11027
|
{ type: l, attrs: p },
|
|
11028
|
-
{ type:
|
|
11028
|
+
{ type: h, attrs: m }
|
|
11029
11029
|
] : [{ type: l, attrs: p }];
|
|
11030
11030
|
if (!pe(t.doc, a.pos, 2))
|
|
11031
11031
|
return !1;
|
|
@@ -11056,20 +11056,20 @@ const ed = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11056
11056
|
const i = r.doc.nodeAt(n);
|
|
11057
11057
|
return t.node.type === (i == null ? void 0 : i.type) && qe(r.doc, n) && r.join(n), !0;
|
|
11058
11058
|
}, nd = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: u }) => {
|
|
11059
|
-
const { extensions: d, splittableMarks:
|
|
11059
|
+
const { extensions: d, splittableMarks: f } = i.extensionManager, h = $(r, o.schema), p = $(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: S } = m, w = y.blockRange(S), v = g || m.$to.parentOffset && m.$from.marks();
|
|
11060
11060
|
if (!w)
|
|
11061
11061
|
return !1;
|
|
11062
11062
|
const A = Er((M) => Ii(M.type.name, d))(m);
|
|
11063
11063
|
if (w.depth >= 1 && A && w.depth - A.depth <= 1) {
|
|
11064
|
-
if (A.node.type ===
|
|
11064
|
+
if (A.node.type === h)
|
|
11065
11065
|
return c.liftListItem(p);
|
|
11066
|
-
if (Ii(A.node.type.name, d) &&
|
|
11067
|
-
return a().command(() => (s.setNodeMarkup(A.pos,
|
|
11066
|
+
if (Ii(A.node.type.name, d) && h.validContent(A.node.content) && l)
|
|
11067
|
+
return a().command(() => (s.setNodeMarkup(A.pos, h), !0)).command(() => Dn(s, h)).command(() => In(s, h)).run();
|
|
11068
11068
|
}
|
|
11069
|
-
return !t || !v || !l ? a().command(() => u().wrapInList(
|
|
11070
|
-
const M = u().wrapInList(
|
|
11069
|
+
return !t || !v || !l ? a().command(() => u().wrapInList(h, n) ? !0 : c.clearNodes()).wrapInList(h, n).command(() => Dn(s, h)).command(() => In(s, h)).run() : a().command(() => {
|
|
11070
|
+
const M = u().wrapInList(h, n), P = v.filter((I) => f.includes(I.type.name));
|
|
11071
11071
|
return s.ensureMarks(P), M ? !0 : c.clearNodes();
|
|
11072
|
-
}).wrapInList(
|
|
11072
|
+
}).wrapInList(h, n).command(() => Dn(s, h)).command(() => In(s, h)).run();
|
|
11073
11073
|
}, rd = (r, e = {}, t = {}) => ({ state: n, commands: i }) => {
|
|
11074
11074
|
const { extendEmptyMarkRange: s = !1 } = t, o = ve(r, n.schema);
|
|
11075
11075
|
return er(n, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
|
|
@@ -11111,24 +11111,24 @@ const ed = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11111
11111
|
if (!i)
|
|
11112
11112
|
return !0;
|
|
11113
11113
|
if (u && o) {
|
|
11114
|
-
let { from:
|
|
11114
|
+
let { from: f, to: h } = l;
|
|
11115
11115
|
const p = (s = c.marks().find((g) => g.type === a)) === null || s === void 0 ? void 0 : s.attrs, m = wr(c, a, p);
|
|
11116
|
-
m && (
|
|
11116
|
+
m && (f = m.from, h = m.to), t.removeMark(f, h, a);
|
|
11117
11117
|
} else
|
|
11118
|
-
d.forEach((
|
|
11119
|
-
t.removeMark(
|
|
11118
|
+
d.forEach((f) => {
|
|
11119
|
+
t.removeMark(f.$from.pos, f.$to.pos, a);
|
|
11120
11120
|
});
|
|
11121
11121
|
return t.removeStoredMark(a), !0;
|
|
11122
11122
|
}, cd = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
|
|
11123
11123
|
let s = null, o = null;
|
|
11124
|
-
const l =
|
|
11124
|
+
const l = fn(typeof r == "string" ? r : r.name, n.schema);
|
|
11125
11125
|
return l ? (l === "node" && (s = $(r, n.schema)), l === "mark" && (o = ve(r, n.schema)), i && t.selection.ranges.forEach((a) => {
|
|
11126
11126
|
const c = a.$from.pos, u = a.$to.pos;
|
|
11127
|
-
let d,
|
|
11127
|
+
let d, f, h, p;
|
|
11128
11128
|
t.selection.empty ? n.doc.nodesBetween(c, u, (m, g) => {
|
|
11129
|
-
s && s === m.type && (
|
|
11129
|
+
s && s === m.type && (h = Math.max(g, c), p = Math.min(g + m.nodeSize, u), d = g, f = m);
|
|
11130
11130
|
}) : n.doc.nodesBetween(c, u, (m, g) => {
|
|
11131
|
-
g < c && s && s === m.type && (
|
|
11131
|
+
g < c && s && s === m.type && (h = Math.max(g, c), p = Math.min(g + m.nodeSize, u), d = g, f = m), g >= c && g <= u && (s && s === m.type && t.setNodeMarkup(g, void 0, {
|
|
11132
11132
|
...m.attrs,
|
|
11133
11133
|
...e
|
|
11134
11134
|
}), o && m.marks.length && m.marks.forEach((y) => {
|
|
@@ -11140,11 +11140,11 @@ const ed = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11140
11140
|
}));
|
|
11141
11141
|
}
|
|
11142
11142
|
}));
|
|
11143
|
-
}),
|
|
11144
|
-
...
|
|
11143
|
+
}), f && (d !== void 0 && t.setNodeMarkup(d, void 0, {
|
|
11144
|
+
...f.attrs,
|
|
11145
11145
|
...e
|
|
11146
|
-
}), o &&
|
|
11147
|
-
o === m.type && t.addMark(
|
|
11146
|
+
}), o && f.marks.length && f.marks.forEach((m) => {
|
|
11147
|
+
o === m.type && t.addMark(h, p, o.create({
|
|
11148
11148
|
...m.attrs,
|
|
11149
11149
|
...e
|
|
11150
11150
|
}));
|
|
@@ -11157,7 +11157,7 @@ const ed = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
|
|
|
11157
11157
|
const i = $(r, t.schema);
|
|
11158
11158
|
return Ac(i, e)(t, n);
|
|
11159
11159
|
};
|
|
11160
|
-
var
|
|
11160
|
+
var fd = /* @__PURE__ */ Object.freeze({
|
|
11161
11161
|
__proto__: null,
|
|
11162
11162
|
blur: Zc,
|
|
11163
11163
|
clearContent: Qc,
|
|
@@ -11173,7 +11173,7 @@ var hd = /* @__PURE__ */ Object.freeze({
|
|
|
11173
11173
|
exitCode: cu,
|
|
11174
11174
|
extendMarkRange: uu,
|
|
11175
11175
|
first: du,
|
|
11176
|
-
focus:
|
|
11176
|
+
focus: hu,
|
|
11177
11177
|
forEach: pu,
|
|
11178
11178
|
insertContent: mu,
|
|
11179
11179
|
insertContentAt: bu,
|
|
@@ -11218,11 +11218,11 @@ var hd = /* @__PURE__ */ Object.freeze({
|
|
|
11218
11218
|
wrapIn: ud,
|
|
11219
11219
|
wrapInList: dd
|
|
11220
11220
|
});
|
|
11221
|
-
const
|
|
11221
|
+
const hd = Y.create({
|
|
11222
11222
|
name: "commands",
|
|
11223
11223
|
addCommands() {
|
|
11224
11224
|
return {
|
|
11225
|
-
...
|
|
11225
|
+
...fd
|
|
11226
11226
|
};
|
|
11227
11227
|
}
|
|
11228
11228
|
}), pd = Y.create({
|
|
@@ -11287,8 +11287,8 @@ const fd = Y.create({
|
|
|
11287
11287
|
() => o.undoInputRule(),
|
|
11288
11288
|
// maybe convert first text block node to default node
|
|
11289
11289
|
() => o.command(({ tr: l }) => {
|
|
11290
|
-
const { selection: a, doc: c } = l, { empty: u, $anchor: d } = a, { pos:
|
|
11291
|
-
return !u || !
|
|
11290
|
+
const { selection: a, doc: c } = l, { empty: u, $anchor: d } = a, { pos: f, parent: h } = d, p = d.parent.isTextblock && f > 0 ? l.doc.resolve(f - 1) : d, m = p.parent.type.spec.isolating, g = d.pos - d.parentOffset, y = m && p.parent.childCount === 1 ? g === d.pos : O.atStart(c).from === f;
|
|
11291
|
+
return !u || !h.type.isTextblock || h.textContent.length || !y || y && d.parent.type.name === "paragraph" ? !1 : o.clearNodes();
|
|
11292
11292
|
}),
|
|
11293
11293
|
() => o.deleteSelection(),
|
|
11294
11294
|
() => o.joinBackward(),
|
|
@@ -11343,17 +11343,17 @@ const fd = Y.create({
|
|
|
11343
11343
|
if (!n || i)
|
|
11344
11344
|
return;
|
|
11345
11345
|
const { empty: s, from: o, to: l } = e.selection, a = O.atStart(e.doc).from, c = O.atEnd(e.doc).to;
|
|
11346
|
-
if (s || !(o === a && l === c) || !
|
|
11346
|
+
if (s || !(o === a && l === c) || !hn(t.doc))
|
|
11347
11347
|
return;
|
|
11348
|
-
const
|
|
11348
|
+
const f = t.tr, h = an({
|
|
11349
11349
|
state: t,
|
|
11350
|
-
transaction:
|
|
11350
|
+
transaction: f
|
|
11351
11351
|
}), { commands: p } = new cn({
|
|
11352
11352
|
editor: this.editor,
|
|
11353
|
-
state:
|
|
11353
|
+
state: h
|
|
11354
11354
|
});
|
|
11355
|
-
if (p.clearNodes(), !!
|
|
11356
|
-
return
|
|
11355
|
+
if (p.clearNodes(), !!f.steps.length)
|
|
11356
|
+
return f;
|
|
11357
11357
|
}
|
|
11358
11358
|
})
|
|
11359
11359
|
];
|
|
@@ -11695,7 +11695,7 @@ class wd extends zc {
|
|
|
11695
11695
|
* @returns The new editor state
|
|
11696
11696
|
*/
|
|
11697
11697
|
registerPlugin(e, t) {
|
|
11698
|
-
const n =
|
|
11698
|
+
const n = ho(t) ? t(e, [...this.state.plugins]) : [...this.state.plugins, e], i = this.state.reconfigure({ plugins: n });
|
|
11699
11699
|
return this.view.updateState(i), i;
|
|
11700
11700
|
}
|
|
11701
11701
|
/**
|
|
@@ -11729,7 +11729,7 @@ class wd extends zc {
|
|
|
11729
11729
|
Xc.configure({
|
|
11730
11730
|
blockSeparator: (t = (e = this.options.coreExtensionOptions) === null || e === void 0 ? void 0 : e.clipboardTextSerializer) === null || t === void 0 ? void 0 : t.blockSeparator
|
|
11731
11731
|
}),
|
|
11732
|
-
|
|
11732
|
+
hd,
|
|
11733
11733
|
yd,
|
|
11734
11734
|
bd,
|
|
11735
11735
|
xd,
|
|
@@ -11897,7 +11897,7 @@ class wd extends zc {
|
|
|
11897
11897
|
* Check if there is no content.
|
|
11898
11898
|
*/
|
|
11899
11899
|
get isEmpty() {
|
|
11900
|
-
return
|
|
11900
|
+
return hn(this.state.doc);
|
|
11901
11901
|
}
|
|
11902
11902
|
/**
|
|
11903
11903
|
* Get the number of characters for the current document.
|
|
@@ -12091,15 +12091,15 @@ class ie {
|
|
|
12091
12091
|
let i, s;
|
|
12092
12092
|
t && (i = this.remapping(n, this.items.length), s = i.maps.length);
|
|
12093
12093
|
let o = e.tr, l, a, c = [], u = [];
|
|
12094
|
-
return this.items.forEach((d,
|
|
12094
|
+
return this.items.forEach((d, f) => {
|
|
12095
12095
|
if (!d.step) {
|
|
12096
|
-
i || (i = this.remapping(n,
|
|
12096
|
+
i || (i = this.remapping(n, f + 1), s = i.maps.length), s--, u.push(d);
|
|
12097
12097
|
return;
|
|
12098
12098
|
}
|
|
12099
12099
|
if (i) {
|
|
12100
12100
|
u.push(new le(d.map));
|
|
12101
|
-
let
|
|
12102
|
-
|
|
12101
|
+
let h = d.step.map(i.slice(s)), p;
|
|
12102
|
+
h && o.maybeStep(h).doc && (p = o.mapping.maps[o.mapping.maps.length - 1], c.push(new le(p, void 0, void 0, c.length + u.length))), s--, p && i.appendMap(p, s);
|
|
12103
12103
|
} else
|
|
12104
12104
|
o.maybeStep(d.step);
|
|
12105
12105
|
if (d.selection)
|
|
@@ -12110,8 +12110,8 @@ class ie {
|
|
|
12110
12110
|
addTransform(e, t, n, i) {
|
|
12111
12111
|
let s = [], o = this.eventCount, l = this.items, a = !i && l.length ? l.get(l.length - 1) : null;
|
|
12112
12112
|
for (let u = 0; u < e.steps.length; u++) {
|
|
12113
|
-
let d = e.steps[u].invert(e.docs[u]),
|
|
12114
|
-
(
|
|
12113
|
+
let d = e.steps[u].invert(e.docs[u]), f = new le(e.mapping.maps[u], d, t), h;
|
|
12114
|
+
(h = a && a.merge(f)) && (f = h, u ? s.pop() : l = l.slice(0, l.length - 1)), s.push(f), t && (o++, t = void 0), i || (a = f);
|
|
12115
12115
|
}
|
|
12116
12116
|
let c = o - n.depth;
|
|
12117
12117
|
return c > Od && (l = Td(l, c), o -= c), new ie(l.append(s), o);
|
|
@@ -12134,25 +12134,25 @@ class ie {
|
|
|
12134
12134
|
if (!this.eventCount)
|
|
12135
12135
|
return this;
|
|
12136
12136
|
let n = [], i = Math.max(0, this.items.length - t), s = e.mapping, o = e.steps.length, l = this.eventCount;
|
|
12137
|
-
this.items.forEach((
|
|
12138
|
-
|
|
12137
|
+
this.items.forEach((f) => {
|
|
12138
|
+
f.selection && l--;
|
|
12139
12139
|
}, i);
|
|
12140
12140
|
let a = t;
|
|
12141
|
-
this.items.forEach((
|
|
12142
|
-
let
|
|
12143
|
-
if (
|
|
12141
|
+
this.items.forEach((f) => {
|
|
12142
|
+
let h = s.getMirror(--a);
|
|
12143
|
+
if (h == null)
|
|
12144
12144
|
return;
|
|
12145
|
-
o = Math.min(o,
|
|
12146
|
-
let p = s.maps[
|
|
12147
|
-
if (
|
|
12148
|
-
let m = e.steps[
|
|
12145
|
+
o = Math.min(o, h);
|
|
12146
|
+
let p = s.maps[h];
|
|
12147
|
+
if (f.step) {
|
|
12148
|
+
let m = e.steps[h].invert(e.docs[h]), g = f.selection && f.selection.map(s.slice(a + 1, h));
|
|
12149
12149
|
g && l++, n.push(new le(p, m, g));
|
|
12150
12150
|
} else
|
|
12151
12151
|
n.push(new le(p));
|
|
12152
12152
|
}, i);
|
|
12153
12153
|
let c = [];
|
|
12154
|
-
for (let
|
|
12155
|
-
c.push(new le(s.maps[
|
|
12154
|
+
for (let f = t; f < o; f++)
|
|
12155
|
+
c.push(new le(s.maps[f]));
|
|
12156
12156
|
let u = this.items.slice(0, i).append(c).append(n), d = new ie(u, l);
|
|
12157
12157
|
return d.emptyItemCount() > Ed && (d = d.compress(this.items.length - n.length)), d;
|
|
12158
12158
|
}
|
|
@@ -12178,8 +12178,8 @@ class ie {
|
|
|
12178
12178
|
if (n--, c && t.appendMap(c, n), a) {
|
|
12179
12179
|
let u = o.selection && o.selection.map(t.slice(n));
|
|
12180
12180
|
u && s++;
|
|
12181
|
-
let d = new le(c.invert(), a, u),
|
|
12182
|
-
(
|
|
12181
|
+
let d = new le(c.invert(), a, u), f, h = i.length - 1;
|
|
12182
|
+
(f = i.length && i[h].merge(d)) ? i[h] = f : i.push(d);
|
|
12183
12183
|
}
|
|
12184
12184
|
} else o.map && n--;
|
|
12185
12185
|
}, this.items.length, 0), new ie(L.from(i.reverse()), s);
|
|
@@ -12363,7 +12363,7 @@ const Eo = Mo(!1, !0), To = Mo(!0, !0), Pd = Y.create({
|
|
|
12363
12363
|
return null;
|
|
12364
12364
|
const s = this.editor.isEmpty;
|
|
12365
12365
|
return r.descendants((o, l) => {
|
|
12366
|
-
const a = n >= l && n <= l + o.nodeSize, c = !o.isLeaf &&
|
|
12366
|
+
const a = n >= l && n <= l + o.nodeSize, c = !o.isLeaf && hn(o);
|
|
12367
12367
|
if ((a || !this.options.showOnlyCurrent) && c) {
|
|
12368
12368
|
const u = [this.options.emptyNodeClass];
|
|
12369
12369
|
s && u.push(this.options.emptyEditorClass);
|
|
@@ -12670,8 +12670,8 @@ function Hd(r, e, t = null) {
|
|
|
12670
12670
|
if (c.type.name === "note") {
|
|
12671
12671
|
const d = c.attrs.target;
|
|
12672
12672
|
if (d && d.startsWith("#")) {
|
|
12673
|
-
const
|
|
12674
|
-
s.push({ node: c, reference:
|
|
12673
|
+
const f = d.substring(1), h = wt(f);
|
|
12674
|
+
s.push({ node: c, reference: h, originalIndex: s.length }), t && d === `#${t}` && (o = s.length - 1);
|
|
12675
12675
|
}
|
|
12676
12676
|
}
|
|
12677
12677
|
}), s.sort((c, u) => c.reference - u.reference);
|
|
@@ -12684,8 +12684,8 @@ function Hd(r, e, t = null) {
|
|
|
12684
12684
|
if (r = r.replaceWith(n, n + i.nodeSize, a), l !== -1) {
|
|
12685
12685
|
let u = n + 1;
|
|
12686
12686
|
for (let d = 0; d < l; d++) {
|
|
12687
|
-
const
|
|
12688
|
-
|
|
12687
|
+
const f = r.doc.nodeAt(u);
|
|
12688
|
+
f && (u += f.nodeSize);
|
|
12689
12689
|
}
|
|
12690
12690
|
r = r.setSelection(E.create(
|
|
12691
12691
|
r.doc,
|
|
@@ -12809,15 +12809,15 @@ const qd = Oo.extend({
|
|
|
12809
12809
|
if ((m == null ? void 0 : m.type.name) == "anchor")
|
|
12810
12810
|
return i = m.attrs.id, s = !0, !1;
|
|
12811
12811
|
});
|
|
12812
|
-
const d = a.docs[0],
|
|
12812
|
+
const d = a.docs[0], f = a.doc, h = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
12813
12813
|
d.descendants((m, g) => {
|
|
12814
|
-
m.type.name === "anchor" &&
|
|
12815
|
-
}),
|
|
12814
|
+
m.type.name === "anchor" && h.set(m.attrs.id, g);
|
|
12815
|
+
}), f.descendants((m, g) => {
|
|
12816
12816
|
m.type.name === "anchor" && p.set(m.attrs.id, g);
|
|
12817
12817
|
});
|
|
12818
|
-
for (const [m, g] of
|
|
12818
|
+
for (const [m, g] of h)
|
|
12819
12819
|
p.has(m) || (o.add(m), s = !0);
|
|
12820
|
-
(
|
|
12820
|
+
(h.size !== p.size || Array.from(h.entries()).some(([m, g]) => p.get(m) !== g)) && (s = !0);
|
|
12821
12821
|
}
|
|
12822
12822
|
if (o.size > 0 && t.doc.descendants((a, c) => {
|
|
12823
12823
|
if (a.type.name === "note") {
|
|
@@ -12846,12 +12846,12 @@ const qd = Oo.extend({
|
|
|
12846
12846
|
target: `#${i}`,
|
|
12847
12847
|
_reference: "1"
|
|
12848
12848
|
// Will be updated later
|
|
12849
|
-
}),
|
|
12850
|
-
n = n.insert(
|
|
12851
|
-
const
|
|
12852
|
-
n.doc.nodeAt(
|
|
12849
|
+
}), f = c + u.nodeSize - 1;
|
|
12850
|
+
n = n.insert(f, d);
|
|
12851
|
+
const h = f;
|
|
12852
|
+
n.doc.nodeAt(h) && (n = n.setSelection(E.create(
|
|
12853
12853
|
n.doc,
|
|
12854
|
-
|
|
12854
|
+
h + 1
|
|
12855
12855
|
)));
|
|
12856
12856
|
}
|
|
12857
12857
|
return s && (jd(n.doc), n = Jd(n, n.doc), n = Wd(n, n.doc), n = Hd(n, n.doc, i)), n;
|
|
@@ -12974,7 +12974,7 @@ function Qd(r, e, t, n = 3) {
|
|
|
12974
12974
|
}
|
|
12975
12975
|
return `… ${r.substring(i, e)}<mark>${r.substring(e, t)}</mark>${r.substring(t, o + 1)} …`;
|
|
12976
12976
|
}
|
|
12977
|
-
class
|
|
12977
|
+
class ef {
|
|
12978
12978
|
constructor(e, t) {
|
|
12979
12979
|
this.editor = e.tiptap, this.schemaDef = t, this.panel = e.querySelector(".attribute-panel"), this.currentElement = null, this.currentMark = null, this.setupEventListeners(), this.overlay = document.createElement("div"), this.overlay.className = "jinn-tap overlay", this.overlay.style.display = "block", this.overlay.style.position = "fixed", this.overlay.style.pointerEvents = "none", this.overlay.style.zIndex = "1000", this.overlay.style.display = "none";
|
|
12980
12980
|
}
|
|
@@ -13053,17 +13053,17 @@ class eh {
|
|
|
13053
13053
|
u.readOnly = !0;
|
|
13054
13054
|
const d = document.createElement("details");
|
|
13055
13055
|
d.open = !e.attrs[a];
|
|
13056
|
-
const
|
|
13057
|
-
|
|
13058
|
-
const
|
|
13059
|
-
|
|
13056
|
+
const f = document.createElement("summary");
|
|
13057
|
+
f.textContent = "Lookup", d.appendChild(f);
|
|
13058
|
+
const h = document.createElement("pb-authority-lookup");
|
|
13059
|
+
h.setAttribute("type", c.connector.type), h.setAttribute("query", t), h.setAttribute("auto", e.attrs[a] ? "true" : "false"), h.setAttribute("no-occurrences", !0);
|
|
13060
13060
|
const p = document.createElement("pb-authority");
|
|
13061
|
-
if (p.setAttribute("connector", c.connector.name), p.setAttribute("name", c.connector.type), c.connector.user && p.setAttribute("user", c.connector.user),
|
|
13061
|
+
if (p.setAttribute("connector", c.connector.name), p.setAttribute("name", c.connector.type), c.connector.user && p.setAttribute("user", c.connector.user), h.appendChild(p), document.addEventListener("pb-authority-select", (m) => {
|
|
13062
13062
|
const g = `${c.connector.prefix}-${m.detail.properties.ref}`;
|
|
13063
13063
|
u.value = g, d.open = !1, this.handleAttributeUpdate(e, { [a]: g });
|
|
13064
|
-
}), d.appendChild(
|
|
13064
|
+
}), d.appendChild(h), o.appendChild(d), e.attrs[a]) {
|
|
13065
13065
|
const m = e.attrs[a].substring(e.attrs[a].indexOf("-") + 1);
|
|
13066
|
-
|
|
13066
|
+
h.lookup(c.connector.type, m, s).then((g) => {
|
|
13067
13067
|
const y = g.strings;
|
|
13068
13068
|
y.sort((S, w) => w.length - S.length), y.unshift(t), this.updateOccurrences(this.editor, e, y);
|
|
13069
13069
|
});
|
|
@@ -13106,9 +13106,9 @@ class eh {
|
|
|
13106
13106
|
const l = [];
|
|
13107
13107
|
for (const [c, u] of Object.entries(i))
|
|
13108
13108
|
for (const d of u) {
|
|
13109
|
-
const
|
|
13110
|
-
let
|
|
13111
|
-
|
|
13109
|
+
const f = e.state.doc.resolve(d.pos);
|
|
13110
|
+
let h = f.node(), p = null;
|
|
13111
|
+
h.isText || e.state.doc.nodesBetween(d.pos, d.pos + d.length, (M, P) => {
|
|
13112
13112
|
if (M.isText)
|
|
13113
13113
|
return p = M, !1;
|
|
13114
13114
|
});
|
|
@@ -13119,7 +13119,7 @@ class eh {
|
|
|
13119
13119
|
to: d.pos + d.index + d.length,
|
|
13120
13120
|
hasMark: m
|
|
13121
13121
|
});
|
|
13122
|
-
const w = e.state.doc.textBetween(d.pos,
|
|
13122
|
+
const w = e.state.doc.textBetween(d.pos, f.end()), v = Qd(w, d.index, d.index + d.length), A = document.createElement("span");
|
|
13123
13123
|
A.innerHTML = v, y.appendChild(A), g.appendChild(y), o.appendChild(g), y.addEventListener("mouseenter", (M) => {
|
|
13124
13124
|
M.preventDefault(), M.stopPropagation();
|
|
13125
13125
|
const P = e.view.nodeDOM(d.pos);
|
|
@@ -13143,14 +13143,14 @@ class eh {
|
|
|
13143
13143
|
const u = l.filter((d) => !d.checkbox.checked);
|
|
13144
13144
|
if (u.length > 0) {
|
|
13145
13145
|
let d = this.editor.chain().focus();
|
|
13146
|
-
u.forEach((
|
|
13147
|
-
d = d.setTextSelection({ from:
|
|
13146
|
+
u.forEach((f) => {
|
|
13147
|
+
d = d.setTextSelection({ from: f.from, to: f.to }).toggleMark(t.type, t.attrs), f.checkbox.checked = !0;
|
|
13148
13148
|
}), d.run();
|
|
13149
13149
|
}
|
|
13150
13150
|
});
|
|
13151
13151
|
}
|
|
13152
13152
|
}
|
|
13153
|
-
class
|
|
13153
|
+
class tf {
|
|
13154
13154
|
constructor(e, t) {
|
|
13155
13155
|
this.editor = e.tiptap, this.attributePanel = t, this.panel = e.querySelector(".navigation-panel"), this.setupEventListeners();
|
|
13156
13156
|
}
|
|
@@ -13170,12 +13170,12 @@ class th {
|
|
|
13170
13170
|
for (; c > 0; ) {
|
|
13171
13171
|
const d = u.node(c);
|
|
13172
13172
|
if (d) {
|
|
13173
|
-
const
|
|
13173
|
+
const f = {
|
|
13174
13174
|
type: d.type.name,
|
|
13175
13175
|
node: d,
|
|
13176
13176
|
pos: { from: u.start(c), to: u.end(c) }
|
|
13177
13177
|
};
|
|
13178
|
-
s.push(
|
|
13178
|
+
s.push(f);
|
|
13179
13179
|
}
|
|
13180
13180
|
c--;
|
|
13181
13181
|
}
|
|
@@ -13183,8 +13183,8 @@ class th {
|
|
|
13183
13183
|
let l = document.createElement("ul");
|
|
13184
13184
|
s.reverse().forEach((a, c) => {
|
|
13185
13185
|
const u = document.createElement("li"), d = document.createElement("a");
|
|
13186
|
-
d.setAttribute("href", "#"), d.textContent = a.type, d.addEventListener("click", (
|
|
13187
|
-
|
|
13186
|
+
d.setAttribute("href", "#"), d.textContent = a.type, d.addEventListener("click", (f) => {
|
|
13187
|
+
f.preventDefault(), this.editor.chain().focus().setTextSelection(a.pos).run(), this.attributePanel.showNodeAttributes(a.node);
|
|
13188
13188
|
}), u.appendChild(d), l.appendChild(u);
|
|
13189
13189
|
}), o && o.forEach((a) => {
|
|
13190
13190
|
const c = document.createElement("li"), u = document.createElement("a");
|
|
@@ -13194,7 +13194,7 @@ class th {
|
|
|
13194
13194
|
}), this.panel.appendChild(l);
|
|
13195
13195
|
}
|
|
13196
13196
|
}
|
|
13197
|
-
class
|
|
13197
|
+
class nf {
|
|
13198
13198
|
/**
|
|
13199
13199
|
* Create a new Toolbar instance.
|
|
13200
13200
|
*
|
|
@@ -13202,19 +13202,16 @@ class nh {
|
|
|
13202
13202
|
* @param {Object} schemaDef - The schema definition.
|
|
13203
13203
|
* @param {Element} toolbarSlot - The toolbar slot element.
|
|
13204
13204
|
*/
|
|
13205
|
-
constructor(e, t
|
|
13205
|
+
constructor(e, t) {
|
|
13206
13206
|
this.editor = e.tiptap, this.toolbar = e.querySelector(".toolbar"), this.schemaDef = t, this.addButtons(t);
|
|
13207
|
-
const
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
const
|
|
13211
|
-
|
|
13212
|
-
});
|
|
13213
|
-
const s = document.createElement("li");
|
|
13214
|
-
s.appendChild(i), this.toolbar.appendChild(s), n && Array.from(n.children).forEach((l) => {
|
|
13215
|
-
const a = document.createElement("li");
|
|
13216
|
-
a.appendChild(l.cloneNode(!0)), this.toolbar.appendChild(a);
|
|
13207
|
+
const n = document.createElement("a");
|
|
13208
|
+
n.href = "#", n.dataset.tooltip = "Toggle debug mode", n.dataset.placement = "bottom", n.className = "outline toolbar-button", n.innerHTML = '<i class="bi bi-question-circle"></i>', n.title = "Toggle debug mode", n.addEventListener("click", (s) => {
|
|
13209
|
+
s.preventDefault();
|
|
13210
|
+
const o = this.toolbar.closest("jinn-tap");
|
|
13211
|
+
o.hasAttribute("debug") ? o.removeAttribute("debug") : o.setAttribute("debug", "");
|
|
13217
13212
|
});
|
|
13213
|
+
const i = document.createElement("li");
|
|
13214
|
+
i.appendChild(n), this.toolbar.appendChild(i);
|
|
13218
13215
|
}
|
|
13219
13216
|
addButtons(e) {
|
|
13220
13217
|
const t = Object.entries(e.schema).sort(([, i], [, s]) => {
|
|
@@ -13292,49 +13289,49 @@ class nh {
|
|
|
13292
13289
|
addOptionToSelect(e, t, n, i, s) {
|
|
13293
13290
|
const o = document.createElement("li"), l = document.createElement("a");
|
|
13294
13291
|
l.innerHTML = s.label, l.appendChild(document.createTextNode(" " + i)), l.href = "#", o.appendChild(l), l.addEventListener("click", (a) => {
|
|
13295
|
-
a.preventDefault(), this.handleNodeAction(t, n, s);
|
|
13292
|
+
a.preventDefault(), e.open = !1, this.handleNodeAction(t, n, s);
|
|
13296
13293
|
}), this.editor.on("selectionUpdate", ({ editor: a }) => {
|
|
13297
13294
|
this.updateButtonState(l, t, n, a);
|
|
13298
13295
|
}), e.querySelector("ul").appendChild(o);
|
|
13299
13296
|
}
|
|
13300
13297
|
}
|
|
13301
|
-
function
|
|
13298
|
+
function rf(r) {
|
|
13302
13299
|
const e = "#E48500", t = {}, n = [], i = (u) => {
|
|
13303
|
-
let d = parseInt(u.substring(1, 3), 16) / 255,
|
|
13300
|
+
let d = parseInt(u.substring(1, 3), 16) / 255, f = parseInt(u.substring(3, 5), 16) / 255, h = parseInt(u.substring(5, 7), 16) / 255, p = Math.max(d, f, h), m = Math.min(d, f, h), g, y, S = (p + m) / 2;
|
|
13304
13301
|
if (p === m)
|
|
13305
13302
|
g = y = 0;
|
|
13306
13303
|
else {
|
|
13307
13304
|
let w = p - m;
|
|
13308
13305
|
switch (y = S > 0.5 ? w / (2 - p - m) : w / (p + m), p) {
|
|
13309
13306
|
case d:
|
|
13310
|
-
g = (
|
|
13311
|
-
break;
|
|
13312
|
-
case h:
|
|
13313
|
-
g = (f - d) / w + 2;
|
|
13307
|
+
g = (f - h) / w + (f < h ? 6 : 0);
|
|
13314
13308
|
break;
|
|
13315
13309
|
case f:
|
|
13316
|
-
g = (
|
|
13310
|
+
g = (h - d) / w + 2;
|
|
13311
|
+
break;
|
|
13312
|
+
case h:
|
|
13313
|
+
g = (d - f) / w + 4;
|
|
13317
13314
|
break;
|
|
13318
13315
|
}
|
|
13319
13316
|
g /= 6;
|
|
13320
13317
|
}
|
|
13321
13318
|
return [g * 360, y * 100, S * 100];
|
|
13322
|
-
}, s = (u, d,
|
|
13323
|
-
|
|
13324
|
-
const
|
|
13325
|
-
const g = (m + u / 30) % 12, y =
|
|
13319
|
+
}, s = (u, d, f) => {
|
|
13320
|
+
f /= 100;
|
|
13321
|
+
const h = d * Math.min(f, 1 - f) / 100, p = (m) => {
|
|
13322
|
+
const g = (m + u / 30) % 12, y = f - h * Math.max(Math.min(g - 3, 9 - g, 1), -1);
|
|
13326
13323
|
return Math.round(255 * y).toString(16).padStart(2, "0");
|
|
13327
13324
|
};
|
|
13328
13325
|
return `#${p(0)}${p(8)}${p(4)}`;
|
|
13329
13326
|
}, [o, l, a] = i(e);
|
|
13330
13327
|
for (let u = 0; u < 5; u++) {
|
|
13331
|
-
const d = (o + u * 40) % 360,
|
|
13332
|
-
t[`--tei-div-color-${u}`] =
|
|
13328
|
+
const d = (o + u * 40) % 360, f = s(d, l, a);
|
|
13329
|
+
t[`--tei-div-color-${u}`] = f;
|
|
13333
13330
|
}
|
|
13334
13331
|
let c = 5;
|
|
13335
13332
|
return Object.entries(r.schema).forEach(([u, d]) => {
|
|
13336
|
-
const
|
|
13337
|
-
t[`--tei-${u}-color`] = `${
|
|
13333
|
+
const f = (o + c * 60) % 360, h = s(f, l, a);
|
|
13334
|
+
t[`--tei-${u}-color`] = `${h}`, (d.type === "inline" || d.type === "empty") && n.push(`
|
|
13338
13335
|
.debug tei-${u}::after {
|
|
13339
13336
|
background-color: var(--tei-${u}-color);
|
|
13340
13337
|
content: "${u}";
|
|
@@ -13350,14 +13347,14 @@ function rh(r) {
|
|
|
13350
13347
|
`)}
|
|
13351
13348
|
`;
|
|
13352
13349
|
}
|
|
13353
|
-
const
|
|
13350
|
+
const sf = {
|
|
13354
13351
|
rend: {
|
|
13355
13352
|
type: "string"
|
|
13356
13353
|
},
|
|
13357
13354
|
id: {
|
|
13358
13355
|
type: "string"
|
|
13359
13356
|
}
|
|
13360
|
-
},
|
|
13357
|
+
}, of = {
|
|
13361
13358
|
div: {
|
|
13362
13359
|
type: "block",
|
|
13363
13360
|
defining: !0,
|
|
@@ -13751,8 +13748,8 @@ const ih = {
|
|
|
13751
13748
|
}
|
|
13752
13749
|
}
|
|
13753
13750
|
}, $t = {
|
|
13754
|
-
attributes:
|
|
13755
|
-
schema:
|
|
13751
|
+
attributes: sf,
|
|
13752
|
+
schema: of
|
|
13756
13753
|
}, rr = document.createElement("style");
|
|
13757
13754
|
rr.textContent = `
|
|
13758
13755
|
jinn-tap {
|
|
@@ -13839,10 +13836,10 @@ rr.textContent = `
|
|
|
13839
13836
|
border-radius: 5px;
|
|
13840
13837
|
}
|
|
13841
13838
|
|
|
13842
|
-
${
|
|
13839
|
+
${rf($t)}
|
|
13843
13840
|
`;
|
|
13844
13841
|
document.querySelector("#jinn-tap-styles") || (rr.id = "jinn-tap-styles", document.head.appendChild(rr));
|
|
13845
|
-
class
|
|
13842
|
+
class lf extends HTMLElement {
|
|
13846
13843
|
static get observedAttributes() {
|
|
13847
13844
|
return ["debug", "url"];
|
|
13848
13845
|
}
|
|
@@ -13869,26 +13866,25 @@ class oh extends HTMLElement {
|
|
|
13869
13866
|
this.setupEditor();
|
|
13870
13867
|
}
|
|
13871
13868
|
setupEditor() {
|
|
13872
|
-
const e =
|
|
13873
|
-
|
|
13874
|
-
const n = t.querySelector('[slot="toolbar"]');
|
|
13875
|
-
n && n.remove();
|
|
13876
|
-
const i = t.innerHTML.trim();
|
|
13877
|
-
this.innerHTML = `
|
|
13869
|
+
const e = document.createElement("div");
|
|
13870
|
+
e.innerHTML = this.innerHTML, this.innerHTML = `
|
|
13878
13871
|
<nav>
|
|
13879
|
-
<ul class="toolbar"
|
|
13872
|
+
<ul class="toolbar">
|
|
13873
|
+
<slot name="toolbar"></slot>
|
|
13874
|
+
</ul>
|
|
13880
13875
|
</nav>
|
|
13881
13876
|
<div class="editor-area"></div>
|
|
13882
13877
|
<div class="aside">
|
|
13878
|
+
<slot name="aside"></slot>
|
|
13883
13879
|
<nav class="navigation-panel" aria-label="breadcrumb"></nav>
|
|
13884
13880
|
<div class="attribute-panel"></div>
|
|
13885
13881
|
</div>
|
|
13886
|
-
|
|
13887
|
-
const
|
|
13882
|
+
`, this.applySlots(e);
|
|
13883
|
+
const t = e.innerHTML.trim(), n = Ud($t);
|
|
13888
13884
|
this.editor = new wd({
|
|
13889
13885
|
element: this.querySelector(".editor-area"),
|
|
13890
13886
|
extensions: [
|
|
13891
|
-
...
|
|
13887
|
+
...n,
|
|
13892
13888
|
Kd,
|
|
13893
13889
|
Pd,
|
|
13894
13890
|
Rd.configure({
|
|
@@ -13896,7 +13892,7 @@ class oh extends HTMLElement {
|
|
|
13896
13892
|
includeChildren: !0
|
|
13897
13893
|
})
|
|
13898
13894
|
],
|
|
13899
|
-
content: this._pendingContent ||
|
|
13895
|
+
content: this._pendingContent || t || `
|
|
13900
13896
|
<tei-div>
|
|
13901
13897
|
<tei-p></tei-p>
|
|
13902
13898
|
</tei-div>
|
|
@@ -13906,9 +13902,9 @@ class oh extends HTMLElement {
|
|
|
13906
13902
|
this.dispatchContentChange(), this.dispatchEvent(new CustomEvent("ready"));
|
|
13907
13903
|
},
|
|
13908
13904
|
onUpdate: () => this.dispatchContentChange()
|
|
13909
|
-
}), this.toolbar = new
|
|
13910
|
-
const
|
|
13911
|
-
|
|
13905
|
+
}), this.toolbar = new nf(this, $t), this.attributePanel = new ef(this, $t), this.navigationPanel = new tf(this, this.attributePanel);
|
|
13906
|
+
const i = this.getAttribute("url");
|
|
13907
|
+
i && this.loadFromUrl(i);
|
|
13912
13908
|
}
|
|
13913
13909
|
dispatchContentChange() {
|
|
13914
13910
|
this.dispatchEvent(new CustomEvent("content-change", {
|
|
@@ -13938,9 +13934,22 @@ class oh extends HTMLElement {
|
|
|
13938
13934
|
get tiptap() {
|
|
13939
13935
|
return this.editor;
|
|
13940
13936
|
}
|
|
13937
|
+
applySlots(e) {
|
|
13938
|
+
const t = this.querySelectorAll("slot");
|
|
13939
|
+
for (const n of t) {
|
|
13940
|
+
const i = n.name, s = e.querySelector(`[slot="${i}"]`);
|
|
13941
|
+
if (s) {
|
|
13942
|
+
const o = document.createElement("div");
|
|
13943
|
+
o.innerHTML = s.outerHTML;
|
|
13944
|
+
const l = n.parentNode;
|
|
13945
|
+
Array.from(o.children).forEach((c) => l.insertBefore(c, n)), s.remove();
|
|
13946
|
+
}
|
|
13947
|
+
}
|
|
13948
|
+
return t.forEach((n) => n.remove()), e;
|
|
13949
|
+
}
|
|
13941
13950
|
}
|
|
13942
|
-
customElements.define("jinn-tap",
|
|
13951
|
+
customElements.define("jinn-tap", lf);
|
|
13943
13952
|
export {
|
|
13944
|
-
|
|
13953
|
+
lf as JinnTap
|
|
13945
13954
|
};
|
|
13946
13955
|
//# sourceMappingURL=jinn-tap.es.js.map
|