@nine-lab/nine-ux 0.1.65 → 0.1.69
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/nine-ux.es.js +483 -441
- package/dist/nine-ux.es.js.map +1 -1
- package/dist/nine-ux.umd.js +56 -20
- package/dist/nine-ux.umd.js.map +1 -1
- package/package.json +8 -8
- package/dist/css/nineEditor.css +0 -171
package/dist/nine-ux.es.js
CHANGED
|
@@ -4,7 +4,7 @@ var li = (n) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Sl = (n, e, t) => e in n ? xl(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
6
6
|
var ye = (n, e, t) => Sl(n, typeof e != "symbol" ? e + "" : e, t), Jn = (n, e, t) => e.has(n) || li("Cannot " + t);
|
|
7
|
-
var O = (n, e, t) => (Jn(n, e, "read from private field"), t ? t.call(n) : e.get(n)), F = (n, e, t) => e.has(n) ? li("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t),
|
|
7
|
+
var O = (n, e, t) => (Jn(n, e, "read from private field"), t ? t.call(n) : e.get(n)), F = (n, e, t) => e.has(n) ? li("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), ie = (n, e, t, r) => (Jn(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), q = (n, e, t) => (Jn(n, e, "access private method"), t);
|
|
8
8
|
import { nine as yt, subscribeConfig as Ml, trace as wl } from "@nine-lab/nine-util";
|
|
9
9
|
const Cl = `
|
|
10
10
|
dialog::backdrop {
|
|
@@ -403,11 +403,11 @@ dialog.out { pointer-events: none; }
|
|
|
403
403
|
dialog.out { animation: nx-fade-out 0.3s forwards; }
|
|
404
404
|
@keyframes nx-fade-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.9); } }
|
|
405
405
|
`;
|
|
406
|
-
var
|
|
406
|
+
var ve, j, Nn, An, Dn;
|
|
407
407
|
class Tl extends HTMLElement {
|
|
408
408
|
constructor() {
|
|
409
409
|
super();
|
|
410
|
-
F(this,
|
|
410
|
+
F(this, ve);
|
|
411
411
|
F(this, j);
|
|
412
412
|
ye(this, "showModal", () => {
|
|
413
413
|
O(this, j).showModal();
|
|
@@ -429,12 +429,12 @@ class Tl extends HTMLElement {
|
|
|
429
429
|
F(this, An, (t) => {
|
|
430
430
|
if (t.target.closest("buttons") || t.button !== 0 || t.altKey || t.ctrlKey || t.shiftKey) return;
|
|
431
431
|
const r = O(this, j).getBoundingClientRect();
|
|
432
|
-
|
|
432
|
+
ie(this, ve, {
|
|
433
433
|
x: t.clientX - r.left,
|
|
434
434
|
y: t.clientY - r.top
|
|
435
435
|
});
|
|
436
436
|
const i = (o) => {
|
|
437
|
-
O(this, j).style.position = "fixed", O(this, j).style.margin = "0", O(this, j).style.left = `${o.clientX - O(this,
|
|
437
|
+
O(this, j).style.position = "fixed", O(this, j).style.margin = "0", O(this, j).style.left = `${o.clientX - O(this, ve).x}px`, O(this, j).style.top = `${o.clientY - O(this, ve).y}px`;
|
|
438
438
|
}, s = () => {
|
|
439
439
|
document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", s);
|
|
440
440
|
};
|
|
@@ -443,13 +443,13 @@ class Tl extends HTMLElement {
|
|
|
443
443
|
F(this, Dn, (t) => {
|
|
444
444
|
if (t.target.closest("buttons")) return;
|
|
445
445
|
const r = O(this, j).getBoundingClientRect(), i = t.changedTouches[0];
|
|
446
|
-
|
|
446
|
+
ie(this, ve, {
|
|
447
447
|
x: i.pageX - r.left,
|
|
448
448
|
y: i.pageY - r.top
|
|
449
449
|
});
|
|
450
450
|
const s = (l) => {
|
|
451
451
|
const a = l.changedTouches[0];
|
|
452
|
-
O(this, j).style.position = "fixed", O(this, j).style.margin = "0", O(this, j).style.left = `${a.pageX - O(this,
|
|
452
|
+
O(this, j).style.position = "fixed", O(this, j).style.margin = "0", O(this, j).style.left = `${a.pageX - O(this, ve).x}px`, O(this, j).style.top = `${a.pageY - O(this, ve).y}px`;
|
|
453
453
|
}, o = () => {
|
|
454
454
|
document.removeEventListener("touchmove", s), document.removeEventListener("touchend", o);
|
|
455
455
|
};
|
|
@@ -489,10 +489,10 @@ class Tl extends HTMLElement {
|
|
|
489
489
|
</div>
|
|
490
490
|
</div>
|
|
491
491
|
</dialog>
|
|
492
|
-
`,
|
|
492
|
+
`, ie(this, j, this.querySelector("dialog")), O(this, Nn).call(this);
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
|
|
495
|
+
ve = new WeakMap(), j = new WeakMap(), Nn = new WeakMap(), An = new WeakMap(), Dn = new WeakMap();
|
|
496
496
|
customElements.get("nine-dialog") || customElements.define("nine-dialog", Tl);
|
|
497
497
|
class hn extends HTMLElement {
|
|
498
498
|
constructor() {
|
|
@@ -517,7 +517,7 @@ ye(hn, "confirm", async (e, t = "Confirm", r = {}) => {
|
|
|
517
517
|
"false-text": "No",
|
|
518
518
|
class: "",
|
|
519
519
|
animation: "",
|
|
520
|
-
...((d =
|
|
520
|
+
...((d = xe.options) == null ? void 0 : d.confirm) || {},
|
|
521
521
|
...r
|
|
522
522
|
};
|
|
523
523
|
document.querySelectorAll("nine-confirm-popup").forEach((u) => u.remove());
|
|
@@ -552,7 +552,7 @@ ye(pn, "alert", async (e, t = "Alert", r = {}) => {
|
|
|
552
552
|
const i = {
|
|
553
553
|
class: "",
|
|
554
554
|
animation: "",
|
|
555
|
-
...((c =
|
|
555
|
+
...((c = xe.options) == null ? void 0 : c.alert) || {},
|
|
556
556
|
...r
|
|
557
557
|
};
|
|
558
558
|
document.querySelectorAll("nine-alert-popup").forEach((d) => d.remove());
|
|
@@ -568,25 +568,25 @@ ye(pn, "alert", async (e, t = "Alert", r = {}) => {
|
|
|
568
568
|
});
|
|
569
569
|
customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", hn);
|
|
570
570
|
customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", pn);
|
|
571
|
-
var
|
|
571
|
+
var Kt, Jt, hr;
|
|
572
572
|
class Ol {
|
|
573
573
|
constructor() {
|
|
574
|
-
F(this,
|
|
575
|
-
F(this,
|
|
574
|
+
F(this, Jt);
|
|
575
|
+
F(this, Kt, "");
|
|
576
576
|
}
|
|
577
577
|
// 1. 값만 깔끔하게 반환
|
|
578
578
|
get cssPath() {
|
|
579
579
|
var e;
|
|
580
|
-
return ((e = yt.config.ux) == null ? void 0 : e.cssPath) || O(this,
|
|
580
|
+
return ((e = yt.config.ux) == null ? void 0 : e.cssPath) || O(this, Kt);
|
|
581
581
|
}
|
|
582
582
|
set cssPath(e) {
|
|
583
|
-
|
|
583
|
+
ie(this, Kt, e);
|
|
584
584
|
}
|
|
585
585
|
alert(e, t = "Alert") {
|
|
586
|
-
return q(this,
|
|
586
|
+
return q(this, Jt, hr).call(this, "alert", e, t, "classic");
|
|
587
587
|
}
|
|
588
588
|
confirm(e, t = "Confirm") {
|
|
589
|
-
return q(this,
|
|
589
|
+
return q(this, Jt, hr).call(this, "confirm", e, t, "classic");
|
|
590
590
|
}
|
|
591
591
|
// 이제 setup이나 window 교체 로직은 여기서 다 제거합니다.
|
|
592
592
|
// 오직 팝업을 실행하는 인터페이스 역할만 수행.
|
|
@@ -604,7 +604,7 @@ class Ol {
|
|
|
604
604
|
return t ? `${t.endsWith("/") ? t : t + "/"}${e}` : null;
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
|
|
607
|
+
Kt = new WeakMap(), Jt = new WeakSet(), hr = function(e, t, r, i) {
|
|
608
608
|
const s = { class: i, animation: "fade-in" }, o = e === "alert" ? pn : hn;
|
|
609
609
|
let l = !1;
|
|
610
610
|
const a = {
|
|
@@ -626,20 +626,20 @@ jt = new WeakMap(), Kt = new WeakSet(), hr = function(e, t, r, i) {
|
|
|
626
626
|
l || (l = !0, o[e](t, r, s));
|
|
627
627
|
}), a;
|
|
628
628
|
};
|
|
629
|
-
const
|
|
630
|
-
var
|
|
629
|
+
const xe = new Ol();
|
|
630
|
+
var Ut, Ze, _t, ce, vt, pr, mr, Gt, In;
|
|
631
631
|
class vl extends HTMLElement {
|
|
632
632
|
constructor() {
|
|
633
633
|
super();
|
|
634
|
-
F(this,
|
|
634
|
+
F(this, ce);
|
|
635
635
|
ye(this, "originContents");
|
|
636
|
-
F(this,
|
|
636
|
+
F(this, Ut, !1);
|
|
637
637
|
F(this, Ze);
|
|
638
638
|
// Shadow DOM 사용 여부에 따라 shadowRoot 또는 this를 가리킴
|
|
639
|
-
F(this,
|
|
639
|
+
F(this, _t, !1);
|
|
640
640
|
ye(this, "getData", () => {
|
|
641
641
|
const t = {};
|
|
642
|
-
return q(this,
|
|
642
|
+
return q(this, ce, vt).call(this).forEach((r) => {
|
|
643
643
|
const i = r.name;
|
|
644
644
|
if (!i) return;
|
|
645
645
|
let s;
|
|
@@ -652,26 +652,26 @@ class vl extends HTMLElement {
|
|
|
652
652
|
});
|
|
653
653
|
// 파라미터가 있으면 해당 값으로, 없으면 전체 공백 초기화
|
|
654
654
|
ye(this, "clearData", (t = {}) => {
|
|
655
|
-
q(this,
|
|
655
|
+
q(this, ce, mr).call(this), q(this, ce, vt).call(this).forEach((r) => {
|
|
656
656
|
const i = r.name;
|
|
657
657
|
if (!i) return;
|
|
658
658
|
const s = t && t[i] !== void 0 ? t[i] : "";
|
|
659
|
-
q(this,
|
|
659
|
+
q(this, ce, pr).call(this, r, s);
|
|
660
660
|
}), this.changed = !1;
|
|
661
661
|
});
|
|
662
662
|
ye(this, "setData", (t) => {
|
|
663
663
|
if (!t || typeof t != "object") return;
|
|
664
|
-
q(this,
|
|
664
|
+
q(this, ce, mr).call(this);
|
|
665
665
|
let r = !1;
|
|
666
|
-
q(this,
|
|
666
|
+
q(this, ce, vt).call(this).forEach((i) => {
|
|
667
667
|
const s = i.name;
|
|
668
|
-
!s || !t.hasOwnProperty(s) || q(this,
|
|
668
|
+
!s || !t.hasOwnProperty(s) || q(this, ce, pr).call(this, i, t[s]) && (r = !0);
|
|
669
669
|
}), r && (this.changed = !0);
|
|
670
670
|
});
|
|
671
671
|
ye(this, "initData", (t) => {
|
|
672
672
|
this.clearData(t), this.changed = !1;
|
|
673
673
|
});
|
|
674
|
-
F(this,
|
|
674
|
+
F(this, Gt, (t) => {
|
|
675
675
|
this.changed = !0;
|
|
676
676
|
});
|
|
677
677
|
F(this, In, () => {
|
|
@@ -681,14 +681,14 @@ class vl extends HTMLElement {
|
|
|
681
681
|
});
|
|
682
682
|
}
|
|
683
683
|
connectedCallback() {
|
|
684
|
-
return O(this,
|
|
684
|
+
return O(this, Ut) ? !1 : (this.getAttribute("use-shadow") !== "false" && !this.shadowRoot ? (this.attachShadow({ mode: "open" }), ie(this, Ze, this.shadowRoot)) : ie(this, Ze, this), O(this, In).call(this), ie(this, Ut, !0), !0);
|
|
685
685
|
}
|
|
686
686
|
get changed() {
|
|
687
|
-
return O(this,
|
|
687
|
+
return O(this, _t);
|
|
688
688
|
}
|
|
689
689
|
set changed(t) {
|
|
690
690
|
const r = !!t;
|
|
691
|
-
|
|
691
|
+
ie(this, _t, r);
|
|
692
692
|
const i = this.closest(".detail-wrapper");
|
|
693
693
|
if (i) {
|
|
694
694
|
const s = i.querySelector("nx-title2");
|
|
@@ -700,8 +700,8 @@ class vl extends HTMLElement {
|
|
|
700
700
|
return O(this, Ze) || this;
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
|
-
|
|
704
|
-
|
|
703
|
+
Ut = new WeakMap(), Ze = new WeakMap(), _t = new WeakMap(), ce = new WeakSet(), // 공통 쿼리 함수: 현재 root(Shadow 또는 Light DOM)에서 요소를 찾음
|
|
704
|
+
vt = function() {
|
|
705
705
|
return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]", O(this, Ze));
|
|
706
706
|
}, // [공통 로직 1] 특정 요소에 값을 쓰거나 초기화하는 핵심 함수
|
|
707
707
|
pr = function(t, r) {
|
|
@@ -721,10 +721,10 @@ pr = function(t, r) {
|
|
|
721
721
|
return o;
|
|
722
722
|
}, // [공통 로직 2] 이벤트 리스너 일괄 등록
|
|
723
723
|
mr = function() {
|
|
724
|
-
q(this,
|
|
725
|
-
t.removeEventListener("input", O(this,
|
|
724
|
+
q(this, ce, vt).call(this).forEach((t) => {
|
|
725
|
+
t.removeEventListener("input", O(this, Gt)), t.addEventListener("input", O(this, Gt));
|
|
726
726
|
});
|
|
727
|
-
},
|
|
727
|
+
}, Gt = new WeakMap(), In = new WeakMap();
|
|
728
728
|
function K(n) {
|
|
729
729
|
this.content = n;
|
|
730
730
|
}
|
|
@@ -1396,7 +1396,7 @@ function Qe(n, e) {
|
|
|
1396
1396
|
let t = e.length - 1;
|
|
1397
1397
|
t >= 0 && n.isText && n.sameMarkup(e[t]) ? e[t] = n.withText(e[t].text + n.text) : e.push(n);
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1399
|
+
function Dt(n, e, t, r) {
|
|
1400
1400
|
let i = (e || n).node(t), s = 0, o = e ? e.index(t) : i.childCount;
|
|
1401
1401
|
n && (s = n.index(t), n.depth > t ? s++ : n.textOffset && (Qe(n.nodeAfter, r), s++));
|
|
1402
1402
|
for (let l = s; l < o; l++)
|
|
@@ -1408,15 +1408,15 @@ function et(n, e) {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
function As(n, e, t, r, i) {
|
|
1410
1410
|
let s = n.depth > i && yr(n, e, i + 1), o = r.depth > i && yr(t, r, i + 1), l = [];
|
|
1411
|
-
return
|
|
1411
|
+
return Dt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Ns(s, o), Qe(et(s, As(n, e, t, r, i + 1)), l)) : (s && Qe(et(s, yn(n, e, i + 1)), l), Dt(e, t, i, l), o && Qe(et(o, yn(t, r, i + 1)), l)), Dt(r, null, i, l), new b(l);
|
|
1412
1412
|
}
|
|
1413
1413
|
function yn(n, e, t) {
|
|
1414
1414
|
let r = [];
|
|
1415
|
-
if (
|
|
1415
|
+
if (Dt(null, n, t, r), n.depth > t) {
|
|
1416
1416
|
let i = yr(n, e, t + 1);
|
|
1417
1417
|
Qe(et(i, yn(n, e, t + 1)), r);
|
|
1418
1418
|
}
|
|
1419
|
-
return
|
|
1419
|
+
return Dt(e, null, t, r), new b(r);
|
|
1420
1420
|
}
|
|
1421
1421
|
function Nl(n, e) {
|
|
1422
1422
|
let t = e.depth - n.openStart, i = e.node(t).copy(n.content);
|
|
@@ -1427,7 +1427,7 @@ function Nl(n, e) {
|
|
|
1427
1427
|
end: i.resolveNoCache(i.content.size - n.openEnd - t)
|
|
1428
1428
|
};
|
|
1429
1429
|
}
|
|
1430
|
-
class
|
|
1430
|
+
class Bt {
|
|
1431
1431
|
/**
|
|
1432
1432
|
@internal
|
|
1433
1433
|
*/
|
|
@@ -1655,7 +1655,7 @@ class Pt {
|
|
|
1655
1655
|
break;
|
|
1656
1656
|
s = c - 1, i += a + 1;
|
|
1657
1657
|
}
|
|
1658
|
-
return new
|
|
1658
|
+
return new Bt(t, r, s);
|
|
1659
1659
|
}
|
|
1660
1660
|
/**
|
|
1661
1661
|
@internal
|
|
@@ -1670,7 +1670,7 @@ class Pt {
|
|
|
1670
1670
|
}
|
|
1671
1671
|
else
|
|
1672
1672
|
ai.set(e, r = new Al());
|
|
1673
|
-
let i = r.elts[r.i] =
|
|
1673
|
+
let i = r.elts[r.i] = Bt.resolve(e, t);
|
|
1674
1674
|
return r.i = (r.i + 1) % Dl, i;
|
|
1675
1675
|
}
|
|
1676
1676
|
}
|
|
@@ -1925,13 +1925,13 @@ let Fe = class br {
|
|
|
1925
1925
|
[object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.
|
|
1926
1926
|
*/
|
|
1927
1927
|
resolve(e) {
|
|
1928
|
-
return
|
|
1928
|
+
return Bt.resolveCached(this, e);
|
|
1929
1929
|
}
|
|
1930
1930
|
/**
|
|
1931
1931
|
@internal
|
|
1932
1932
|
*/
|
|
1933
1933
|
resolveNoCache(e) {
|
|
1934
|
-
return
|
|
1934
|
+
return Bt.resolve(this, e);
|
|
1935
1935
|
}
|
|
1936
1936
|
/**
|
|
1937
1937
|
Test whether a given mark or mark type occurs in this document
|
|
@@ -3014,13 +3014,13 @@ const Vs = {
|
|
|
3014
3014
|
script: !0,
|
|
3015
3015
|
style: !0,
|
|
3016
3016
|
title: !0
|
|
3017
|
-
}, Hs = { ol: !0, ul: !0 },
|
|
3017
|
+
}, Hs = { ol: !0, ul: !0 }, Lt = 1, kr = 2, It = 4;
|
|
3018
3018
|
function hi(n, e, t) {
|
|
3019
|
-
return e != null ? (e ?
|
|
3019
|
+
return e != null ? (e ? Lt : 0) | (e === "full" ? kr : 0) : n && n.whitespace == "pre" ? Lt | kr : t & ~It;
|
|
3020
3020
|
}
|
|
3021
3021
|
class tn {
|
|
3022
3022
|
constructor(e, t, r, i, s, o) {
|
|
3023
|
-
this.type = e, this.attrs = t, this.marks = r, this.solid = i, this.options = o, this.content = [], this.activeMarks = A.none, this.match = s || (o &
|
|
3023
|
+
this.type = e, this.attrs = t, this.marks = r, this.solid = i, this.options = o, this.content = [], this.activeMarks = A.none, this.match = s || (o & It ? null : e.contentMatch);
|
|
3024
3024
|
}
|
|
3025
3025
|
findWrapping(e) {
|
|
3026
3026
|
if (!this.match) {
|
|
@@ -3037,7 +3037,7 @@ class tn {
|
|
|
3037
3037
|
return this.match.findWrapping(e.type);
|
|
3038
3038
|
}
|
|
3039
3039
|
finish(e) {
|
|
3040
|
-
if (!(this.options &
|
|
3040
|
+
if (!(this.options & Lt)) {
|
|
3041
3041
|
let r = this.content[this.content.length - 1], i;
|
|
3042
3042
|
if (r && r.isText && (i = /[ \t\r\n\u000c]+$/.exec(r.text))) {
|
|
3043
3043
|
let s = r;
|
|
@@ -3054,7 +3054,7 @@ class tn {
|
|
|
3054
3054
|
class pi {
|
|
3055
3055
|
constructor(e, t, r) {
|
|
3056
3056
|
this.parser = e, this.options = t, this.isOpen = r, this.open = 0, this.localPreserveWS = !1;
|
|
3057
|
-
let i = t.topNode, s, o = hi(null, t.preserveWhitespace, 0) | (r ?
|
|
3057
|
+
let i = t.topNode, s, o = hi(null, t.preserveWhitespace, 0) | (r ? It : 0);
|
|
3058
3058
|
i ? s = new tn(i.type, i.attrs, A.none, !0, t.topMatch || i.type.contentMatch, o) : r ? s = new tn(null, null, A.none, !0, null, o) : s = new tn(e.schema.topNodeType, null, A.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
|
|
3059
3059
|
}
|
|
3060
3060
|
get top() {
|
|
@@ -3067,7 +3067,7 @@ class pi {
|
|
|
3067
3067
|
e.nodeType == 3 ? this.addTextNode(e, t) : e.nodeType == 1 && this.addElement(e, t);
|
|
3068
3068
|
}
|
|
3069
3069
|
addTextNode(e, t) {
|
|
3070
|
-
let r = e.nodeValue, i = this.top, s = i.options & kr ? "full" : this.localPreserveWS || (i.options &
|
|
3070
|
+
let r = e.nodeValue, i = this.top, s = i.options & kr ? "full" : this.localPreserveWS || (i.options & Lt) > 0, { schema: o } = this.parser;
|
|
3071
3071
|
if (s === "full" || i.inlineContext(e) || /[^ \t\r\n\u000c]/.test(r)) {
|
|
3072
3072
|
if (s)
|
|
3073
3073
|
if (s === "full")
|
|
@@ -3237,7 +3237,7 @@ class pi {
|
|
|
3237
3237
|
let o = this.top;
|
|
3238
3238
|
o.match = o.match && o.match.matchType(e);
|
|
3239
3239
|
let l = hi(e, s, o.options);
|
|
3240
|
-
o.options &
|
|
3240
|
+
o.options & It && o.content.length == 0 && (l |= It);
|
|
3241
3241
|
let a = A.none;
|
|
3242
3242
|
return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : gi(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new tn(e, t, a, i, null, l)), this.open++, r;
|
|
3243
3243
|
}
|
|
@@ -3258,7 +3258,7 @@ class pi {
|
|
|
3258
3258
|
for (let t = this.open; t >= 0; t--) {
|
|
3259
3259
|
if (this.nodes[t] == e)
|
|
3260
3260
|
return this.open = t, !0;
|
|
3261
|
-
this.localPreserveWS && (this.nodes[t].options |=
|
|
3261
|
+
this.localPreserveWS && (this.nodes[t].options |= Lt);
|
|
3262
3262
|
}
|
|
3263
3263
|
return !1;
|
|
3264
3264
|
}
|
|
@@ -3484,9 +3484,9 @@ function _n(n) {
|
|
|
3484
3484
|
const bi = /* @__PURE__ */ new WeakMap();
|
|
3485
3485
|
function Gl(n) {
|
|
3486
3486
|
let e = bi.get(n);
|
|
3487
|
-
return e === void 0 && bi.set(n, e =
|
|
3487
|
+
return e === void 0 && bi.set(n, e = Yl(n)), e;
|
|
3488
3488
|
}
|
|
3489
|
-
function
|
|
3489
|
+
function Yl(n) {
|
|
3490
3490
|
let e = null;
|
|
3491
3491
|
function t(r) {
|
|
3492
3492
|
if (r && typeof r == "object")
|
|
@@ -3543,7 +3543,7 @@ function cn(n, e, t, r) {
|
|
|
3543
3543
|
return { dom: a, contentDOM: l };
|
|
3544
3544
|
}
|
|
3545
3545
|
const Ws = 65535, qs = Math.pow(2, 16);
|
|
3546
|
-
function
|
|
3546
|
+
function Xl(n, e) {
|
|
3547
3547
|
return n + e * qs;
|
|
3548
3548
|
}
|
|
3549
3549
|
function ki(n) {
|
|
@@ -3589,15 +3589,15 @@ class xr {
|
|
|
3589
3589
|
return (this.delInfo & dn) > 0;
|
|
3590
3590
|
}
|
|
3591
3591
|
}
|
|
3592
|
-
class
|
|
3592
|
+
class ae {
|
|
3593
3593
|
/**
|
|
3594
3594
|
Create a position map. The modifications to the document are
|
|
3595
3595
|
represented as an array of numbers, in which each group of three
|
|
3596
3596
|
represents a modified chunk as `[start, oldSize, newSize]`.
|
|
3597
3597
|
*/
|
|
3598
3598
|
constructor(e, t = !1) {
|
|
3599
|
-
if (this.ranges = e, this.inverted = t, !e.length &&
|
|
3600
|
-
return
|
|
3599
|
+
if (this.ranges = e, this.inverted = t, !e.length && ae.empty)
|
|
3600
|
+
return ae.empty;
|
|
3601
3601
|
}
|
|
3602
3602
|
/**
|
|
3603
3603
|
@internal
|
|
@@ -3629,7 +3629,7 @@ class le {
|
|
|
3629
3629
|
let f = c ? e == a ? -1 : e == u ? 1 : t : t, h = a + i + (f < 0 ? 0 : d);
|
|
3630
3630
|
if (r)
|
|
3631
3631
|
return h;
|
|
3632
|
-
let p = e == (t < 0 ? a : u) ? null :
|
|
3632
|
+
let p = e == (t < 0 ? a : u) ? null : Xl(l / 3, e - a), m = e == a ? Ks : e == u ? js : dn;
|
|
3633
3633
|
return (t < 0 ? e != a : e != u) && (m |= Js), new xr(h, m, p);
|
|
3634
3634
|
}
|
|
3635
3635
|
i += d - c;
|
|
@@ -3668,7 +3668,7 @@ class le {
|
|
|
3668
3668
|
map positions in the post-step document to the pre-step document.
|
|
3669
3669
|
*/
|
|
3670
3670
|
invert() {
|
|
3671
|
-
return new
|
|
3671
|
+
return new ae(this.ranges, !this.inverted);
|
|
3672
3672
|
}
|
|
3673
3673
|
/**
|
|
3674
3674
|
@internal
|
|
@@ -3682,11 +3682,11 @@ class le {
|
|
|
3682
3682
|
sub-document to a larger document, or vice-versa.
|
|
3683
3683
|
*/
|
|
3684
3684
|
static offset(e) {
|
|
3685
|
-
return e == 0 ?
|
|
3685
|
+
return e == 0 ? ae.empty : new ae(e < 0 ? [0, -e, 0] : [0, 0, e]);
|
|
3686
3686
|
}
|
|
3687
3687
|
}
|
|
3688
|
-
|
|
3689
|
-
class
|
|
3688
|
+
ae.empty = new ae([]);
|
|
3689
|
+
class zt {
|
|
3690
3690
|
/**
|
|
3691
3691
|
Create a new mapping with the given position maps.
|
|
3692
3692
|
*/
|
|
@@ -3703,7 +3703,7 @@ class Lt {
|
|
|
3703
3703
|
Create a mapping that maps only through a part of this one.
|
|
3704
3704
|
*/
|
|
3705
3705
|
slice(e = 0, t = this.maps.length) {
|
|
3706
|
-
return new
|
|
3706
|
+
return new zt(this._maps, this.mirror, e, t);
|
|
3707
3707
|
}
|
|
3708
3708
|
/**
|
|
3709
3709
|
Add a step map to the end of this mapping. If `mirrors` is
|
|
@@ -3754,7 +3754,7 @@ class Lt {
|
|
|
3754
3754
|
Create an inverted version of this mapping.
|
|
3755
3755
|
*/
|
|
3756
3756
|
invert() {
|
|
3757
|
-
let e = new
|
|
3757
|
+
let e = new zt();
|
|
3758
3758
|
return e.appendMappingInverted(this), e;
|
|
3759
3759
|
}
|
|
3760
3760
|
/**
|
|
@@ -3801,7 +3801,7 @@ class Q {
|
|
|
3801
3801
|
and the new document.
|
|
3802
3802
|
*/
|
|
3803
3803
|
getMap() {
|
|
3804
|
-
return
|
|
3804
|
+
return ae.empty;
|
|
3805
3805
|
}
|
|
3806
3806
|
/**
|
|
3807
3807
|
Try to merge this step with another one, to be applied directly
|
|
@@ -4051,7 +4051,7 @@ class P extends Q {
|
|
|
4051
4051
|
return this.structure && Sr(e, this.from, this.to) ? B.fail("Structure replace would overwrite content") : B.fromReplace(e, this.from, this.to, this.slice);
|
|
4052
4052
|
}
|
|
4053
4053
|
getMap() {
|
|
4054
|
-
return new
|
|
4054
|
+
return new ae([this.from, this.to - this.from, this.slice.size]);
|
|
4055
4055
|
}
|
|
4056
4056
|
invert(e) {
|
|
4057
4057
|
return new P(this.from, this.from + this.slice.size, e.slice(this.from, this.to));
|
|
@@ -4107,7 +4107,7 @@ class $ extends Q {
|
|
|
4107
4107
|
return r ? B.fromReplace(e, this.from, this.to, r) : B.fail("Content does not fit in gap");
|
|
4108
4108
|
}
|
|
4109
4109
|
getMap() {
|
|
4110
|
-
return new
|
|
4110
|
+
return new ae([
|
|
4111
4111
|
this.from,
|
|
4112
4112
|
this.gapFrom - this.from,
|
|
4113
4113
|
this.insert,
|
|
@@ -4226,7 +4226,7 @@ function Fr(n, e, t, r = t.contentMatch, i = !0) {
|
|
|
4226
4226
|
function ta(n, e, t) {
|
|
4227
4227
|
return (e == 0 || n.canReplace(e, n.childCount)) && (t == n.childCount || n.canReplace(0, t));
|
|
4228
4228
|
}
|
|
4229
|
-
function
|
|
4229
|
+
function Tt(n) {
|
|
4230
4230
|
let t = n.parent.content.cutByIndex(n.startIndex, n.endIndex);
|
|
4231
4231
|
for (let r = n.depth, i = 0, s = 0; ; --r) {
|
|
4232
4232
|
let o = n.$from.node(r), l = n.$from.index(r) + i, a = n.$to.indexAfter(r) - s;
|
|
@@ -4337,7 +4337,7 @@ function aa(n, e, t, r, i) {
|
|
|
4337
4337
|
throw new RangeError("Invalid content for node type " + t.name);
|
|
4338
4338
|
n.step(new $(e, e + s.nodeSize, e + 1, e + s.nodeSize - 1, new k(b.from(o), 0, 0), 1, !0));
|
|
4339
4339
|
}
|
|
4340
|
-
function
|
|
4340
|
+
function Ne(n, e, t = 1, r) {
|
|
4341
4341
|
let i = n.resolve(e), s = i.depth - t, o = r && r[r.length - 1] || i.parent;
|
|
4342
4342
|
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)))
|
|
4343
4343
|
return !1;
|
|
@@ -4432,7 +4432,7 @@ function fa(n, e, t) {
|
|
|
4432
4432
|
}
|
|
4433
4433
|
return null;
|
|
4434
4434
|
}
|
|
4435
|
-
function
|
|
4435
|
+
function Ys(n, e, t) {
|
|
4436
4436
|
let r = n.resolve(e);
|
|
4437
4437
|
if (!t.content.size)
|
|
4438
4438
|
return e;
|
|
@@ -4457,9 +4457,9 @@ function Bn(n, e, t = e, r = k.empty) {
|
|
|
4457
4457
|
if (e == t && !r.size)
|
|
4458
4458
|
return null;
|
|
4459
4459
|
let i = n.resolve(e), s = n.resolve(t);
|
|
4460
|
-
return
|
|
4460
|
+
return Xs(i, s, r) ? new P(e, t, r) : new ha(i, s, r).fit();
|
|
4461
4461
|
}
|
|
4462
|
-
function
|
|
4462
|
+
function Xs(n, e, t) {
|
|
4463
4463
|
return !t.openStart && !t.openEnd && n.start() == e.start() && n.parent.canReplace(n.index(), e.index(), t.content);
|
|
4464
4464
|
}
|
|
4465
4465
|
class ha {
|
|
@@ -4508,7 +4508,7 @@ class ha {
|
|
|
4508
4508
|
for (let t = 1; t <= 2; t++)
|
|
4509
4509
|
for (let r = t == 1 ? e : this.unplaced.openStart; r >= 0; r--) {
|
|
4510
4510
|
let i, s = null;
|
|
4511
|
-
r ? (s =
|
|
4511
|
+
r ? (s = Yn(this.unplaced.content, r - 1).firstChild, i = s.content) : i = this.unplaced.content;
|
|
4512
4512
|
let o = i.firstChild;
|
|
4513
4513
|
for (let l = this.depth; l >= 0; l--) {
|
|
4514
4514
|
let { type: a, match: c } = this.frontier[l], d, u = null;
|
|
@@ -4522,16 +4522,16 @@ class ha {
|
|
|
4522
4522
|
}
|
|
4523
4523
|
}
|
|
4524
4524
|
openMore() {
|
|
4525
|
-
let { content: e, openStart: t, openEnd: r } = this.unplaced, i =
|
|
4525
|
+
let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Yn(e, t);
|
|
4526
4526
|
return !i.childCount || i.firstChild.isLeaf ? !1 : (this.unplaced = new k(e, t + 1, Math.max(r, i.size + t >= e.size - r ? t + 1 : 0)), !0);
|
|
4527
4527
|
}
|
|
4528
4528
|
dropNode() {
|
|
4529
|
-
let { content: e, openStart: t, openEnd: r } = this.unplaced, i =
|
|
4529
|
+
let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Yn(e, t);
|
|
4530
4530
|
if (i.childCount <= 1 && t > 0) {
|
|
4531
4531
|
let s = e.size - t <= t + i.size;
|
|
4532
|
-
this.unplaced = new k(
|
|
4532
|
+
this.unplaced = new k(Et(e, t - 1, 1), t - 1, s ? t - 1 : r);
|
|
4533
4533
|
} else
|
|
4534
|
-
this.unplaced = new k(
|
|
4534
|
+
this.unplaced = new k(Et(e, t, 1), t, r);
|
|
4535
4535
|
}
|
|
4536
4536
|
// Move content from the unplaced slice at `sliceDepth` to the
|
|
4537
4537
|
// frontier node at `frontierDepth`. Close that frontier node when
|
|
@@ -4556,18 +4556,18 @@ class ha {
|
|
|
4556
4556
|
c++, (c > 1 || a == 0 || m.content.size) && (u = g, d.push(Zs(m.mark(f.allowedMarks(m.marks)), c == 1 ? a : 0, c == l.childCount ? h : -1)));
|
|
4557
4557
|
}
|
|
4558
4558
|
let p = c == l.childCount;
|
|
4559
|
-
p || (h = -1), this.placed =
|
|
4559
|
+
p || (h = -1), this.placed = Nt(this.placed, t, b.from(d)), this.frontier[t].match = u, p && h < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
|
|
4560
4560
|
for (let m = 0, g = l; m < h; m++) {
|
|
4561
4561
|
let y = g.lastChild;
|
|
4562
4562
|
this.frontier.push({ type: y.type, match: y.contentMatchAt(y.childCount) }), g = y.content;
|
|
4563
4563
|
}
|
|
4564
|
-
this.unplaced = p ? e == 0 ? k.empty : new k(
|
|
4564
|
+
this.unplaced = p ? e == 0 ? k.empty : new k(Et(o.content, e - 1, 1), e - 1, h < 0 ? o.openEnd : e - 1) : new k(Et(o.content, e, c), o.openStart, o.openEnd);
|
|
4565
4565
|
}
|
|
4566
4566
|
mustMoveInline() {
|
|
4567
4567
|
if (!this.$to.parent.isTextblock)
|
|
4568
4568
|
return -1;
|
|
4569
4569
|
let e = this.frontier[this.depth], t;
|
|
4570
|
-
if (!e.type.isTextblock || !
|
|
4570
|
+
if (!e.type.isTextblock || !Xn(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
|
|
4571
4571
|
return -1;
|
|
4572
4572
|
let { depth: r } = this.$to, i = this.$to.after(r);
|
|
4573
4573
|
for (; r > 1 && i == this.$to.end(--r); )
|
|
@@ -4576,10 +4576,10 @@ class ha {
|
|
|
4576
4576
|
}
|
|
4577
4577
|
findCloseLevel(e) {
|
|
4578
4578
|
e: for (let t = Math.min(this.depth, e.depth); t >= 0; t--) {
|
|
4579
|
-
let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o =
|
|
4579
|
+
let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = Xn(e, t, i, r, s);
|
|
4580
4580
|
if (o) {
|
|
4581
4581
|
for (let l = t - 1; l >= 0; l--) {
|
|
4582
|
-
let { match: a, type: c } = this.frontier[l], d =
|
|
4582
|
+
let { match: a, type: c } = this.frontier[l], d = Xn(e, l, c, a, !0);
|
|
4583
4583
|
if (!d || d.childCount)
|
|
4584
4584
|
continue e;
|
|
4585
4585
|
}
|
|
@@ -4593,7 +4593,7 @@ class ha {
|
|
|
4593
4593
|
return null;
|
|
4594
4594
|
for (; this.depth > t.depth; )
|
|
4595
4595
|
this.closeFrontierNode();
|
|
4596
|
-
t.fit.childCount && (this.placed =
|
|
4596
|
+
t.fit.childCount && (this.placed = Nt(this.placed, t.depth, t.fit)), e = t.move;
|
|
4597
4597
|
for (let r = t.depth + 1; r <= e.depth; r++) {
|
|
4598
4598
|
let i = e.node(r), s = i.type.contentMatch.fillBefore(i.content, !0, e.index(r));
|
|
4599
4599
|
this.openFrontierNode(i.type, i.attrs, s);
|
|
@@ -4602,20 +4602,20 @@ class ha {
|
|
|
4602
4602
|
}
|
|
4603
4603
|
openFrontierNode(e, t = null, r) {
|
|
4604
4604
|
let i = this.frontier[this.depth];
|
|
4605
|
-
i.match = i.match.matchType(e), this.placed =
|
|
4605
|
+
i.match = i.match.matchType(e), this.placed = Nt(this.placed, this.depth, b.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
|
|
4606
4606
|
}
|
|
4607
4607
|
closeFrontierNode() {
|
|
4608
4608
|
let t = this.frontier.pop().match.fillBefore(b.empty, !0);
|
|
4609
|
-
t.childCount && (this.placed =
|
|
4609
|
+
t.childCount && (this.placed = Nt(this.placed, this.frontier.length, t));
|
|
4610
4610
|
}
|
|
4611
4611
|
}
|
|
4612
|
-
function vt(n, e, t) {
|
|
4613
|
-
return e == 0 ? n.cutByIndex(t, n.childCount) : n.replaceChild(0, n.firstChild.copy(vt(n.firstChild.content, e - 1, t)));
|
|
4614
|
-
}
|
|
4615
4612
|
function Et(n, e, t) {
|
|
4616
|
-
return e == 0 ? n.
|
|
4613
|
+
return e == 0 ? n.cutByIndex(t, n.childCount) : n.replaceChild(0, n.firstChild.copy(Et(n.firstChild.content, e - 1, t)));
|
|
4614
|
+
}
|
|
4615
|
+
function Nt(n, e, t) {
|
|
4616
|
+
return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(Nt(n.lastChild.content, e - 1, t)));
|
|
4617
4617
|
}
|
|
4618
|
-
function
|
|
4618
|
+
function Yn(n, e) {
|
|
4619
4619
|
for (let t = 0; t < e; t++)
|
|
4620
4620
|
n = n.firstChild.content;
|
|
4621
4621
|
return n;
|
|
@@ -4626,7 +4626,7 @@ function Zs(n, e, t) {
|
|
|
4626
4626
|
let r = n.content;
|
|
4627
4627
|
return e > 1 && (r = r.replaceChild(0, Zs(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(b.empty, !0)))), n.copy(r);
|
|
4628
4628
|
}
|
|
4629
|
-
function
|
|
4629
|
+
function Xn(n, e, t, r, i) {
|
|
4630
4630
|
let s = n.node(e), o = i ? n.indexAfter(e) : n.index(e);
|
|
4631
4631
|
if (o == s.childCount && !t.compatibleContent(s.type))
|
|
4632
4632
|
return null;
|
|
@@ -4646,7 +4646,7 @@ function ga(n, e, t, r) {
|
|
|
4646
4646
|
if (!r.size)
|
|
4647
4647
|
return n.deleteRange(e, t);
|
|
4648
4648
|
let i = n.doc.resolve(e), s = n.doc.resolve(t);
|
|
4649
|
-
if (
|
|
4649
|
+
if (Xs(i, s, r))
|
|
4650
4650
|
return n.step(new P(e, t, r));
|
|
4651
4651
|
let o = eo(i, s);
|
|
4652
4652
|
o[o.length - 1] == 0 && o.pop();
|
|
@@ -4765,7 +4765,7 @@ class bt extends Q {
|
|
|
4765
4765
|
return B.fromReplace(e, this.pos, this.pos + 1, new k(b.from(i), 0, t.isLeaf ? 0 : 1));
|
|
4766
4766
|
}
|
|
4767
4767
|
getMap() {
|
|
4768
|
-
return
|
|
4768
|
+
return ae.empty;
|
|
4769
4769
|
}
|
|
4770
4770
|
invert(e) {
|
|
4771
4771
|
return new bt(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);
|
|
@@ -4784,7 +4784,7 @@ class bt extends Q {
|
|
|
4784
4784
|
}
|
|
4785
4785
|
}
|
|
4786
4786
|
Q.jsonID("attr", bt);
|
|
4787
|
-
class
|
|
4787
|
+
class Ft extends Q {
|
|
4788
4788
|
/**
|
|
4789
4789
|
Construct an attribute step.
|
|
4790
4790
|
*/
|
|
@@ -4800,10 +4800,10 @@ class zt extends Q {
|
|
|
4800
4800
|
return B.ok(r);
|
|
4801
4801
|
}
|
|
4802
4802
|
getMap() {
|
|
4803
|
-
return
|
|
4803
|
+
return ae.empty;
|
|
4804
4804
|
}
|
|
4805
4805
|
invert(e) {
|
|
4806
|
-
return new
|
|
4806
|
+
return new Ft(this.attr, e.attrs[this.attr]);
|
|
4807
4807
|
}
|
|
4808
4808
|
map(e) {
|
|
4809
4809
|
return this;
|
|
@@ -4814,25 +4814,25 @@ class zt extends Q {
|
|
|
4814
4814
|
static fromJSON(e, t) {
|
|
4815
4815
|
if (typeof t.attr != "string")
|
|
4816
4816
|
throw new RangeError("Invalid input for DocAttrStep.fromJSON");
|
|
4817
|
-
return new
|
|
4817
|
+
return new Ft(t.attr, t.value);
|
|
4818
4818
|
}
|
|
4819
4819
|
}
|
|
4820
|
-
Q.jsonID("docAttr",
|
|
4821
|
-
let
|
|
4820
|
+
Q.jsonID("docAttr", Ft);
|
|
4821
|
+
let St = class extends Error {
|
|
4822
4822
|
};
|
|
4823
|
-
|
|
4823
|
+
St = function n(e) {
|
|
4824
4824
|
let t = Error.call(this, e);
|
|
4825
4825
|
return t.__proto__ = n.prototype, t;
|
|
4826
4826
|
};
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4827
|
+
St.prototype = Object.create(Error.prototype);
|
|
4828
|
+
St.prototype.constructor = St;
|
|
4829
|
+
St.prototype.name = "TransformError";
|
|
4830
4830
|
class ka {
|
|
4831
4831
|
/**
|
|
4832
4832
|
Create a transform that starts with the given document.
|
|
4833
4833
|
*/
|
|
4834
4834
|
constructor(e) {
|
|
4835
|
-
this.doc = e, this.steps = [], this.docs = [], this.mapping = new
|
|
4835
|
+
this.doc = e, this.steps = [], this.docs = [], this.mapping = new zt();
|
|
4836
4836
|
}
|
|
4837
4837
|
/**
|
|
4838
4838
|
The starting document.
|
|
@@ -4847,7 +4847,7 @@ class ka {
|
|
|
4847
4847
|
step(e) {
|
|
4848
4848
|
let t = this.maybeStep(e);
|
|
4849
4849
|
if (t.failed)
|
|
4850
|
-
throw new
|
|
4850
|
+
throw new St(t.failed);
|
|
4851
4851
|
return this;
|
|
4852
4852
|
}
|
|
4853
4853
|
/**
|
|
@@ -5006,7 +5006,7 @@ class ka {
|
|
|
5006
5006
|
Set a single attribute on the document to a new value.
|
|
5007
5007
|
*/
|
|
5008
5008
|
setDocAttribute(e, t) {
|
|
5009
|
-
return this.step(new
|
|
5009
|
+
return this.step(new Ft(e, t)), this;
|
|
5010
5010
|
}
|
|
5011
5011
|
/**
|
|
5012
5012
|
Add a mark to the node at position `pos`.
|
|
@@ -5179,7 +5179,7 @@ class v {
|
|
|
5179
5179
|
negative, it will search backwards first.
|
|
5180
5180
|
*/
|
|
5181
5181
|
static near(e, t = 1) {
|
|
5182
|
-
return this.findFrom(e, t) || this.findFrom(e, -t) || new
|
|
5182
|
+
return this.findFrom(e, t) || this.findFrom(e, -t) || new de(e.node(0));
|
|
5183
5183
|
}
|
|
5184
5184
|
/**
|
|
5185
5185
|
Find the cursor or leaf node selection closest to the start of
|
|
@@ -5188,14 +5188,14 @@ class v {
|
|
|
5188
5188
|
exists.
|
|
5189
5189
|
*/
|
|
5190
5190
|
static atStart(e) {
|
|
5191
|
-
return ht(e, e, 0, 0, 1) || new
|
|
5191
|
+
return ht(e, e, 0, 0, 1) || new de(e);
|
|
5192
5192
|
}
|
|
5193
5193
|
/**
|
|
5194
5194
|
Find the cursor or leaf node selection closest to the end of the
|
|
5195
5195
|
given document.
|
|
5196
5196
|
*/
|
|
5197
5197
|
static atEnd(e) {
|
|
5198
|
-
return ht(e, e, e.content.size, e.childCount, -1) || new
|
|
5198
|
+
return ht(e, e, e.content.size, e.childCount, -1) || new de(e);
|
|
5199
5199
|
}
|
|
5200
5200
|
/**
|
|
5201
5201
|
Deserialize the JSON representation of a selection. Must be
|
|
@@ -5391,7 +5391,7 @@ class Vr {
|
|
|
5391
5391
|
return r && S.isSelectable(r) ? new S(t) : v.near(t);
|
|
5392
5392
|
}
|
|
5393
5393
|
}
|
|
5394
|
-
class
|
|
5394
|
+
class de extends v {
|
|
5395
5395
|
/**
|
|
5396
5396
|
Create an all-selection over the given document.
|
|
5397
5397
|
*/
|
|
@@ -5413,25 +5413,25 @@ class ce extends v {
|
|
|
5413
5413
|
@internal
|
|
5414
5414
|
*/
|
|
5415
5415
|
static fromJSON(e) {
|
|
5416
|
-
return new
|
|
5416
|
+
return new de(e);
|
|
5417
5417
|
}
|
|
5418
5418
|
map(e) {
|
|
5419
|
-
return new
|
|
5419
|
+
return new de(e);
|
|
5420
5420
|
}
|
|
5421
5421
|
eq(e) {
|
|
5422
|
-
return e instanceof
|
|
5422
|
+
return e instanceof de;
|
|
5423
5423
|
}
|
|
5424
5424
|
getBookmark() {
|
|
5425
5425
|
return Sa;
|
|
5426
5426
|
}
|
|
5427
5427
|
}
|
|
5428
|
-
v.jsonID("all",
|
|
5428
|
+
v.jsonID("all", de);
|
|
5429
5429
|
const Sa = {
|
|
5430
5430
|
map() {
|
|
5431
5431
|
return this;
|
|
5432
5432
|
},
|
|
5433
5433
|
resolve(n) {
|
|
5434
|
-
return new
|
|
5434
|
+
return new de(n);
|
|
5435
5435
|
}
|
|
5436
5436
|
};
|
|
5437
5437
|
function ht(n, e, t, r, i, s = !1) {
|
|
@@ -5618,13 +5618,13 @@ class Ma extends ka {
|
|
|
5618
5618
|
function Oi(n, e) {
|
|
5619
5619
|
return !e || !n ? n : n.bind(e);
|
|
5620
5620
|
}
|
|
5621
|
-
class
|
|
5621
|
+
class At {
|
|
5622
5622
|
constructor(e, t, r) {
|
|
5623
5623
|
this.name = e, this.init = Oi(t.init, r), this.apply = Oi(t.apply, r);
|
|
5624
5624
|
}
|
|
5625
5625
|
}
|
|
5626
5626
|
const wa = [
|
|
5627
|
-
new
|
|
5627
|
+
new At("doc", {
|
|
5628
5628
|
init(n) {
|
|
5629
5629
|
return n.doc || n.schema.topNodeType.createAndFill();
|
|
5630
5630
|
},
|
|
@@ -5632,7 +5632,7 @@ const wa = [
|
|
|
5632
5632
|
return n.doc;
|
|
5633
5633
|
}
|
|
5634
5634
|
}),
|
|
5635
|
-
new
|
|
5635
|
+
new At("selection", {
|
|
5636
5636
|
init(n, e) {
|
|
5637
5637
|
return n.selection || v.atStart(e.doc);
|
|
5638
5638
|
},
|
|
@@ -5640,7 +5640,7 @@ const wa = [
|
|
|
5640
5640
|
return n.selection;
|
|
5641
5641
|
}
|
|
5642
5642
|
}),
|
|
5643
|
-
new
|
|
5643
|
+
new At("storedMarks", {
|
|
5644
5644
|
init(n) {
|
|
5645
5645
|
return n.storedMarks || null;
|
|
5646
5646
|
},
|
|
@@ -5648,7 +5648,7 @@ const wa = [
|
|
|
5648
5648
|
return r.selection.$cursor ? n.storedMarks : null;
|
|
5649
5649
|
}
|
|
5650
5650
|
}),
|
|
5651
|
-
new
|
|
5651
|
+
new At("scrollToSelection", {
|
|
5652
5652
|
init() {
|
|
5653
5653
|
return 0;
|
|
5654
5654
|
},
|
|
@@ -5662,7 +5662,7 @@ class Qn {
|
|
|
5662
5662
|
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = wa.slice(), t && t.forEach((r) => {
|
|
5663
5663
|
if (this.pluginsByKey[r.key])
|
|
5664
5664
|
throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
|
|
5665
|
-
this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new
|
|
5665
|
+
this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new At(r.key, r.spec.state, r));
|
|
5666
5666
|
});
|
|
5667
5667
|
}
|
|
5668
5668
|
}
|
|
@@ -5838,7 +5838,7 @@ function to(n, e, t) {
|
|
|
5838
5838
|
}
|
|
5839
5839
|
return t;
|
|
5840
5840
|
}
|
|
5841
|
-
class
|
|
5841
|
+
class le {
|
|
5842
5842
|
/**
|
|
5843
5843
|
Create a plugin.
|
|
5844
5844
|
*/
|
|
@@ -5856,7 +5856,7 @@ const er = /* @__PURE__ */ Object.create(null);
|
|
|
5856
5856
|
function no(n) {
|
|
5857
5857
|
return n in er ? n + "$" + ++er[n] : (er[n] = 0, n + "$");
|
|
5858
5858
|
}
|
|
5859
|
-
class
|
|
5859
|
+
class Ce {
|
|
5860
5860
|
/**
|
|
5861
5861
|
Create a plugin key.
|
|
5862
5862
|
*/
|
|
@@ -5881,12 +5881,12 @@ const J = function(n) {
|
|
|
5881
5881
|
for (var e = 0; ; e++)
|
|
5882
5882
|
if (n = n.previousSibling, !n)
|
|
5883
5883
|
return e;
|
|
5884
|
-
},
|
|
5884
|
+
}, Mt = function(n) {
|
|
5885
5885
|
let e = n.assignedSlot || n.parentNode;
|
|
5886
5886
|
return e && e.nodeType == 11 ? e.host : e;
|
|
5887
5887
|
};
|
|
5888
5888
|
let Mr = null;
|
|
5889
|
-
const
|
|
5889
|
+
const Oe = function(n, e, t) {
|
|
5890
5890
|
let r = Mr || (Mr = document.createRange());
|
|
5891
5891
|
return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
|
|
5892
5892
|
}, Ca = function() {
|
|
@@ -5900,7 +5900,7 @@ function vi(n, e, t, r, i) {
|
|
|
5900
5900
|
return !0;
|
|
5901
5901
|
if (e == (i < 0 ? 0 : fe(n))) {
|
|
5902
5902
|
let o = n.parentNode;
|
|
5903
|
-
if (!o || o.nodeType != 1 ||
|
|
5903
|
+
if (!o || o.nodeType != 1 || Xt(n) || Ta.test(n.nodeName) || n.contentEditable == "false")
|
|
5904
5904
|
return !1;
|
|
5905
5905
|
e = J(n) + (i < 0 ? 0 : 1), n = o;
|
|
5906
5906
|
} else if (n.nodeType == 1) {
|
|
@@ -5927,7 +5927,7 @@ function Oa(n, e) {
|
|
|
5927
5927
|
if (n.contentEditable == "false")
|
|
5928
5928
|
return null;
|
|
5929
5929
|
n = n.childNodes[e - 1], e = fe(n);
|
|
5930
|
-
} else if (n.parentNode && !
|
|
5930
|
+
} else if (n.parentNode && !Xt(n))
|
|
5931
5931
|
e = J(n), n = n.parentNode;
|
|
5932
5932
|
else
|
|
5933
5933
|
return null;
|
|
@@ -5941,7 +5941,7 @@ function va(n, e) {
|
|
|
5941
5941
|
if (n.contentEditable == "false")
|
|
5942
5942
|
return null;
|
|
5943
5943
|
n = n.childNodes[e], e = 0;
|
|
5944
|
-
} else if (n.parentNode && !
|
|
5944
|
+
} else if (n.parentNode && !Xt(n))
|
|
5945
5945
|
e = J(n) + 1, n = n.parentNode;
|
|
5946
5946
|
else
|
|
5947
5947
|
return null;
|
|
@@ -5957,7 +5957,7 @@ function Ea(n, e, t) {
|
|
|
5957
5957
|
r = r && s == 0, i = i && s == fe(n);
|
|
5958
5958
|
}
|
|
5959
5959
|
}
|
|
5960
|
-
function
|
|
5960
|
+
function Xt(n) {
|
|
5961
5961
|
let e;
|
|
5962
5962
|
for (let t = n; t && !(e = t.pmViewDesc); t = t.parentNode)
|
|
5963
5963
|
;
|
|
@@ -5990,9 +5990,9 @@ function Aa(n, e, t) {
|
|
|
5990
5990
|
return { node: r.startContainer, offset: Math.min(fe(r.startContainer), r.startOffset) };
|
|
5991
5991
|
}
|
|
5992
5992
|
}
|
|
5993
|
-
const
|
|
5993
|
+
const Se = typeof navigator < "u" ? navigator : null, Ei = typeof document < "u" ? document : null, Ke = Se && Se.userAgent || "", wr = /Edge\/(\d+)/.exec(Ke), ro = /MSIE \d/.exec(Ke), Cr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ke), se = !!(ro || Cr || wr), Ve = ro ? document.documentMode : Cr ? +Cr[1] : wr ? +wr[1] : 0, pe = !se && /gecko\/(\d+)/i.test(Ke);
|
|
5994
5994
|
pe && +(/Firefox\/(\d+)/.exec(Ke) || [0, 0])[1];
|
|
5995
|
-
const Tr = !
|
|
5995
|
+
const Tr = !se && /Chrome\/(\d+)/.exec(Ke), _ = !!Tr, io = Tr ? +Tr[1] : 0, Z = !se && !!Se && /Apple Computer/.test(Se.vendor), wt = Z && (/Mobile\/\w+/.test(Ke) || !!Se && Se.maxTouchPoints > 2), ue = wt || (Se ? /Mac/.test(Se.platform) : !1), so = Se ? /Win/.test(Se.platform) : !1, Ee = /Android \d/.test(Ke), Zt = !!Ei && "webkitFontSmoothing" in Ei.documentElement.style, Da = Zt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
5996
5996
|
function Ia(n) {
|
|
5997
5997
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
5998
5998
|
return e ? {
|
|
@@ -6007,7 +6007,7 @@ function Ia(n) {
|
|
|
6007
6007
|
bottom: n.documentElement.clientHeight
|
|
6008
6008
|
};
|
|
6009
6009
|
}
|
|
6010
|
-
function
|
|
6010
|
+
function Te(n, e) {
|
|
6011
6011
|
return typeof n == "number" ? n : n[e];
|
|
6012
6012
|
}
|
|
6013
6013
|
function Ra(n) {
|
|
@@ -6023,11 +6023,11 @@ function Ni(n, e, t) {
|
|
|
6023
6023
|
let r = n.someProp("scrollThreshold") || 0, i = n.someProp("scrollMargin") || 5, s = n.dom.ownerDocument;
|
|
6024
6024
|
for (let o = t || n.dom; o; ) {
|
|
6025
6025
|
if (o.nodeType != 1) {
|
|
6026
|
-
o =
|
|
6026
|
+
o = Mt(o);
|
|
6027
6027
|
continue;
|
|
6028
6028
|
}
|
|
6029
6029
|
let l = o, a = l == s.body, c = a ? Ia(s) : Ra(l), d = 0, u = 0;
|
|
6030
|
-
if (e.top < c.top +
|
|
6030
|
+
if (e.top < c.top + Te(r, "top") ? u = -(c.top - e.top + Te(i, "top")) : e.bottom > c.bottom - Te(r, "bottom") && (u = e.bottom - e.top > c.bottom - c.top ? e.top + Te(i, "top") - c.top : e.bottom - c.bottom + Te(i, "bottom")), e.left < c.left + Te(r, "left") ? d = -(c.left - e.left + Te(i, "left")) : e.right > c.right - Te(r, "right") && (d = e.right - c.right + Te(i, "right")), d || u)
|
|
6031
6031
|
if (a)
|
|
6032
6032
|
s.defaultView.scrollBy(d, u);
|
|
6033
6033
|
else {
|
|
@@ -6039,7 +6039,7 @@ function Ni(n, e, t) {
|
|
|
6039
6039
|
let f = a ? "fixed" : getComputedStyle(o).position;
|
|
6040
6040
|
if (/^(fixed|sticky)$/.test(f))
|
|
6041
6041
|
break;
|
|
6042
|
-
o = f == "absolute" ? o.offsetParent :
|
|
6042
|
+
o = f == "absolute" ? o.offsetParent : Mt(o);
|
|
6043
6043
|
}
|
|
6044
6044
|
}
|
|
6045
6045
|
function Pa(n) {
|
|
@@ -6058,7 +6058,7 @@ function Pa(n) {
|
|
|
6058
6058
|
}
|
|
6059
6059
|
function oo(n) {
|
|
6060
6060
|
let e = [], t = n.ownerDocument;
|
|
6061
|
-
for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r =
|
|
6061
|
+
for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r = Mt(r))
|
|
6062
6062
|
;
|
|
6063
6063
|
return e;
|
|
6064
6064
|
}
|
|
@@ -6092,7 +6092,7 @@ function ao(n, e) {
|
|
|
6092
6092
|
if (d.nodeType == 1)
|
|
6093
6093
|
f = d.getClientRects();
|
|
6094
6094
|
else if (d.nodeType == 3)
|
|
6095
|
-
f =
|
|
6095
|
+
f = Oe(d).getClientRects();
|
|
6096
6096
|
else
|
|
6097
6097
|
continue;
|
|
6098
6098
|
for (let h = 0; h < f.length; h++) {
|
|
@@ -6181,7 +6181,7 @@ function Ha(n, e) {
|
|
|
6181
6181
|
return null;
|
|
6182
6182
|
}
|
|
6183
6183
|
if (Z)
|
|
6184
|
-
for (let c = o; r && c; c =
|
|
6184
|
+
for (let c = o; r && c; c = Mt(c))
|
|
6185
6185
|
c.draggable && (r = void 0);
|
|
6186
6186
|
if (o = Fa(o, e), r) {
|
|
6187
6187
|
if (pe && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
|
|
@@ -6212,19 +6212,19 @@ function uo(n, e, t) {
|
|
|
6212
6212
|
let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = Zt || pe;
|
|
6213
6213
|
if (r.nodeType == 3)
|
|
6214
6214
|
if (o && (Wa.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
|
|
6215
|
-
let a = De(
|
|
6215
|
+
let a = De(Oe(r, i, i), t);
|
|
6216
6216
|
if (pe && i && /\s/.test(r.nodeValue[i - 1]) && i < r.nodeValue.length) {
|
|
6217
|
-
let c = De(
|
|
6217
|
+
let c = De(Oe(r, i - 1, i - 1), -1);
|
|
6218
6218
|
if (c.top == a.top) {
|
|
6219
|
-
let d = De(
|
|
6219
|
+
let d = De(Oe(r, i, i + 1), -1);
|
|
6220
6220
|
if (d.top != a.top)
|
|
6221
|
-
return
|
|
6221
|
+
return Ot(d, d.left < c.left);
|
|
6222
6222
|
}
|
|
6223
6223
|
}
|
|
6224
6224
|
return a;
|
|
6225
6225
|
} else {
|
|
6226
6226
|
let a = i, c = i, d = t < 0 ? 1 : -1;
|
|
6227
|
-
return t < 0 && !i ? (c++, d = -1) : t >= 0 && i == r.nodeValue.length ? (a--, d = 1) : t < 0 ? a-- : c++,
|
|
6227
|
+
return t < 0 && !i ? (c++, d = -1) : t >= 0 && i == r.nodeValue.length ? (a--, d = 1) : t < 0 ? a-- : c++, Ot(De(Oe(r, a, c), d), d < 0);
|
|
6228
6228
|
}
|
|
6229
6229
|
if (!n.state.doc.resolve(e - (s || 0)).parent.inlineContent) {
|
|
6230
6230
|
if (s == null && i && (t < 0 || i == fe(r))) {
|
|
@@ -6240,21 +6240,21 @@ function uo(n, e, t) {
|
|
|
6240
6240
|
return tr(r.getBoundingClientRect(), t >= 0);
|
|
6241
6241
|
}
|
|
6242
6242
|
if (s == null && i && (t < 0 || i == fe(r))) {
|
|
6243
|
-
let a = r.childNodes[i - 1], c = a.nodeType == 3 ?
|
|
6243
|
+
let a = r.childNodes[i - 1], c = a.nodeType == 3 ? Oe(a, fe(a) - (o ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
|
|
6244
6244
|
if (c)
|
|
6245
|
-
return
|
|
6245
|
+
return Ot(De(c, 1), !1);
|
|
6246
6246
|
}
|
|
6247
6247
|
if (s == null && i < fe(r)) {
|
|
6248
6248
|
let a = r.childNodes[i];
|
|
6249
6249
|
for (; a.pmViewDesc && a.pmViewDesc.ignoreForCoords; )
|
|
6250
6250
|
a = a.nextSibling;
|
|
6251
|
-
let c = a ? a.nodeType == 3 ?
|
|
6251
|
+
let c = a ? a.nodeType == 3 ? Oe(a, 0, o ? 0 : 1) : a.nodeType == 1 ? a : null : null;
|
|
6252
6252
|
if (c)
|
|
6253
|
-
return
|
|
6253
|
+
return Ot(De(c, -1), !0);
|
|
6254
6254
|
}
|
|
6255
|
-
return
|
|
6255
|
+
return Ot(De(r.nodeType == 3 ? Oe(r) : r, -t), t >= 0);
|
|
6256
6256
|
}
|
|
6257
|
-
function
|
|
6257
|
+
function Ot(n, e) {
|
|
6258
6258
|
if (n.width == 0)
|
|
6259
6259
|
return n;
|
|
6260
6260
|
let t = e ? n.left : n.right;
|
|
@@ -6295,7 +6295,7 @@ function qa(n, e, t) {
|
|
|
6295
6295
|
if (l.nodeType == 1)
|
|
6296
6296
|
a = l.getClientRects();
|
|
6297
6297
|
else if (l.nodeType == 3)
|
|
6298
|
-
a =
|
|
6298
|
+
a = Oe(l, 0, l.nodeValue.length).getClientRects();
|
|
6299
6299
|
else
|
|
6300
6300
|
continue;
|
|
6301
6301
|
for (let c = 0; c < a.length; c++) {
|
|
@@ -6328,7 +6328,7 @@ let Di = null, Ii = null, Ri = !1;
|
|
|
6328
6328
|
function Ja(n, e, t) {
|
|
6329
6329
|
return Di == e && Ii == t ? Ri : (Di = e, Ii = t, Ri = t == "up" || t == "down" ? qa(n, e, t) : Ka(n, e, t));
|
|
6330
6330
|
}
|
|
6331
|
-
const me = 0, Pi = 1, Ge = 2,
|
|
6331
|
+
const me = 0, Pi = 1, Ge = 2, Me = 3;
|
|
6332
6332
|
class Qt {
|
|
6333
6333
|
constructor(e, t, r, i) {
|
|
6334
6334
|
this.parent = e, this.children = t, this.dom = r, this.contentDOM = i, this.dirty = me, r.pmViewDesc = this;
|
|
@@ -6644,10 +6644,10 @@ class Qt {
|
|
|
6644
6644
|
if (r == o ? e <= o && t >= r : e < o && t > r) {
|
|
6645
6645
|
let l = r + s.border, a = o - s.border;
|
|
6646
6646
|
if (e >= l && t <= a) {
|
|
6647
|
-
this.dirty = e == r || t == o ? Ge : Pi, e == l && t == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty =
|
|
6647
|
+
this.dirty = e == r || t == o ? Ge : Pi, e == l && t == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = Me : s.markDirty(e - l, t - l);
|
|
6648
6648
|
return;
|
|
6649
6649
|
} else
|
|
6650
|
-
s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? Ge :
|
|
6650
|
+
s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? Ge : Me;
|
|
6651
6651
|
}
|
|
6652
6652
|
r = o;
|
|
6653
6653
|
}
|
|
@@ -6742,10 +6742,10 @@ class lt extends Qt {
|
|
|
6742
6742
|
return (!o || !o.dom) && (o = dt.renderSpec(document, t.type.spec.toDOM(t, r), null, t.attrs)), new lt(e, t, o.dom, o.contentDOM || o.dom, o);
|
|
6743
6743
|
}
|
|
6744
6744
|
parseRule() {
|
|
6745
|
-
return this.dirty &
|
|
6745
|
+
return this.dirty & Me || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
|
|
6746
6746
|
}
|
|
6747
6747
|
matchesMark(e) {
|
|
6748
|
-
return this.dirty !=
|
|
6748
|
+
return this.dirty != Me && this.mark.eq(e);
|
|
6749
6749
|
}
|
|
6750
6750
|
markDirty(e, t) {
|
|
6751
6751
|
if (super.markDirty(e, t), this.dirty != me) {
|
|
@@ -6833,14 +6833,14 @@ class He extends Qt {
|
|
|
6833
6833
|
// separate step, syncs the DOM inside `this.contentDOM` to
|
|
6834
6834
|
// `this.children`.
|
|
6835
6835
|
updateChildren(e, t) {
|
|
6836
|
-
let r = 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
|
|
6836
|
+
let r = 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 Ya(this, o && o.node, e);
|
|
6837
6837
|
Qa(this.node, this.innerDeco, (c, d, u) => {
|
|
6838
6838
|
c.spec.marks ? a.syncToMarks(c.spec.marks, r, e, d) : c.type.side >= 0 && !u && a.syncToMarks(d == this.node.childCount ? A.none : this.node.child(d).marks, r, e, d), a.placeWidget(c, e, i);
|
|
6839
6839
|
}, (c, d, u, f) => {
|
|
6840
6840
|
a.syncToMarks(c.marks, r, e, f);
|
|
6841
6841
|
let h;
|
|
6842
6842
|
a.findNodeMatch(c, d, u, f) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (h = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, d, u, h, e) || a.updateNextNode(c, d, u, e, f, i) || a.addNode(c, d, u, e, i), i += c.nodeSize;
|
|
6843
|
-
}), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Ge) && (o && this.protectLocalComposition(e, o), mo(this.contentDOM, this.children, e),
|
|
6843
|
+
}), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Ge) && (o && this.protectLocalComposition(e, o), mo(this.contentDOM, this.children, e), wt && ec(this.dom));
|
|
6844
6844
|
}
|
|
6845
6845
|
localCompositionInfo(e, t) {
|
|
6846
6846
|
let { from: r, to: i } = e.state.selection;
|
|
@@ -6872,7 +6872,7 @@ class He extends Qt {
|
|
|
6872
6872
|
// If this desc must be updated to match the given node decoration,
|
|
6873
6873
|
// do so and return true.
|
|
6874
6874
|
update(e, t, r, i) {
|
|
6875
|
-
return this.dirty ==
|
|
6875
|
+
return this.dirty == Me || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, r, i), !0);
|
|
6876
6876
|
}
|
|
6877
6877
|
updateInner(e, t, r, i) {
|
|
6878
6878
|
this.updateOuterDeco(t), this.node = e, this.innerDeco = r, this.contentDOM && this.updateChildren(i, this.posAtStart), this.dirty = me;
|
|
@@ -6911,7 +6911,7 @@ class Fn extends He {
|
|
|
6911
6911
|
return { skip: e || !0 };
|
|
6912
6912
|
}
|
|
6913
6913
|
update(e, t, r, i) {
|
|
6914
|
-
return this.dirty ==
|
|
6914
|
+
return this.dirty == Me || this.dirty != me && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(t), (this.dirty != me || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, i.trackWrites == this.nodeDOM && (i.trackWrites = null)), this.node = e, this.dirty = me, !0);
|
|
6915
6915
|
}
|
|
6916
6916
|
inParent() {
|
|
6917
6917
|
let e = this.parent.contentDOM;
|
|
@@ -6934,7 +6934,7 @@ class Fn extends He {
|
|
|
6934
6934
|
return new Fn(this.parent, i, this.outerDeco, this.innerDeco, s, s, r);
|
|
6935
6935
|
}
|
|
6936
6936
|
markDirty(e, t) {
|
|
6937
|
-
super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty =
|
|
6937
|
+
super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Me);
|
|
6938
6938
|
}
|
|
6939
6939
|
get domAtom() {
|
|
6940
6940
|
return !1;
|
|
@@ -6965,7 +6965,7 @@ class _a extends He {
|
|
|
6965
6965
|
// through. If it does, and there's a `contentDOM` node, our logic
|
|
6966
6966
|
// updates the children.
|
|
6967
6967
|
update(e, t, r, i) {
|
|
6968
|
-
if (this.dirty ==
|
|
6968
|
+
if (this.dirty == Me)
|
|
6969
6969
|
return !1;
|
|
6970
6970
|
if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
|
|
6971
6971
|
let s = this.spec.update(e, t, r);
|
|
@@ -7010,38 +7010,38 @@ function mo(n, e, t) {
|
|
|
7010
7010
|
r = Li(r), i = !0;
|
|
7011
7011
|
i && t.trackWrites == n && (t.trackWrites = null);
|
|
7012
7012
|
}
|
|
7013
|
-
const
|
|
7013
|
+
const Rt = function(n) {
|
|
7014
7014
|
n && (this.nodeName = n);
|
|
7015
7015
|
};
|
|
7016
|
-
|
|
7017
|
-
const
|
|
7016
|
+
Rt.prototype = /* @__PURE__ */ Object.create(null);
|
|
7017
|
+
const Ye = [new Rt()];
|
|
7018
7018
|
function Or(n, e, t) {
|
|
7019
7019
|
if (n.length == 0)
|
|
7020
|
-
return
|
|
7021
|
-
let r = t ?
|
|
7020
|
+
return Ye;
|
|
7021
|
+
let r = t ? Ye[0] : new Rt(), i = [r];
|
|
7022
7022
|
for (let s = 0; s < n.length; s++) {
|
|
7023
7023
|
let o = n[s].type.attrs;
|
|
7024
7024
|
if (o) {
|
|
7025
|
-
o.nodeName && i.push(r = new
|
|
7025
|
+
o.nodeName && i.push(r = new Rt(o.nodeName));
|
|
7026
7026
|
for (let l in o) {
|
|
7027
7027
|
let a = o[l];
|
|
7028
|
-
a != null && (t && i.length == 1 && i.push(r = new
|
|
7028
|
+
a != null && (t && i.length == 1 && i.push(r = new Rt(e.isInline ? "span" : "div")), l == "class" ? r.class = (r.class ? r.class + " " : "") + a : l == "style" ? r.style = (r.style ? r.style + ";" : "") + a : l != "nodeName" && (r[l] = a));
|
|
7029
7029
|
}
|
|
7030
7030
|
}
|
|
7031
7031
|
}
|
|
7032
7032
|
return i;
|
|
7033
7033
|
}
|
|
7034
7034
|
function go(n, e, t, r) {
|
|
7035
|
-
if (t ==
|
|
7035
|
+
if (t == Ye && r == Ye)
|
|
7036
7036
|
return e;
|
|
7037
7037
|
let i = e;
|
|
7038
7038
|
for (let s = 0; s < r.length; s++) {
|
|
7039
7039
|
let o = r[s], l = t[s];
|
|
7040
7040
|
if (s) {
|
|
7041
7041
|
let a;
|
|
7042
|
-
l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l =
|
|
7042
|
+
l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = Ye[0]), i = a;
|
|
7043
7043
|
}
|
|
7044
|
-
Ga(i, l ||
|
|
7044
|
+
Ga(i, l || Ye[0], o);
|
|
7045
7045
|
}
|
|
7046
7046
|
return i;
|
|
7047
7047
|
}
|
|
@@ -7068,7 +7068,7 @@ function Ga(n, e, t) {
|
|
|
7068
7068
|
}
|
|
7069
7069
|
}
|
|
7070
7070
|
function yo(n, e, t) {
|
|
7071
|
-
return go(n, n,
|
|
7071
|
+
return go(n, n, Ye, Or(e, t, n.nodeType != 1));
|
|
7072
7072
|
}
|
|
7073
7073
|
function xn(n, e) {
|
|
7074
7074
|
if (n.length != e.length)
|
|
@@ -7082,9 +7082,9 @@ function Li(n) {
|
|
|
7082
7082
|
let e = n.nextSibling;
|
|
7083
7083
|
return n.parentNode.removeChild(n), e;
|
|
7084
7084
|
}
|
|
7085
|
-
class
|
|
7085
|
+
class Ya {
|
|
7086
7086
|
constructor(e, t, r) {
|
|
7087
|
-
this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch =
|
|
7087
|
+
this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = Xa(e.node.content, e);
|
|
7088
7088
|
}
|
|
7089
7089
|
// Destroy and remove the children between the given indices in
|
|
7090
7090
|
// `this.top`.
|
|
@@ -7145,7 +7145,7 @@ class Xa {
|
|
|
7145
7145
|
}
|
|
7146
7146
|
updateNodeAt(e, t, r, i, s) {
|
|
7147
7147
|
let o = this.top.children[i];
|
|
7148
|
-
return o.dirty ==
|
|
7148
|
+
return o.dirty == Me && o.dom == o.contentDOM && (o.dirty = Ge), o.update(e, t, r, s) ? (this.destroyBetween(this.index, i), this.index++, !0) : !1;
|
|
7149
7149
|
}
|
|
7150
7150
|
findIndexWithChild(e) {
|
|
7151
7151
|
for (; ; ) {
|
|
@@ -7173,7 +7173,7 @@ class Xa {
|
|
|
7173
7173
|
let c = this.preMatch.matched.get(a);
|
|
7174
7174
|
if (c != null && c != s)
|
|
7175
7175
|
return !1;
|
|
7176
|
-
let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty !=
|
|
7176
|
+
let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != Me && xn(t, a.outerDeco));
|
|
7177
7177
|
if (!f && a.update(e, t, r, i))
|
|
7178
7178
|
return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
|
|
7179
7179
|
if (!f && (u = this.recreateWrapper(a, e, t, r, i, o)))
|
|
@@ -7233,7 +7233,7 @@ class Xa {
|
|
|
7233
7233
|
return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
|
|
7234
7234
|
}
|
|
7235
7235
|
}
|
|
7236
|
-
function
|
|
7236
|
+
function Xa(n, e) {
|
|
7237
7237
|
let t = e, r = t.children.length, i = n.childCount, s = /* @__PURE__ */ new Map(), o = [];
|
|
7238
7238
|
e: for (; i > 0; ) {
|
|
7239
7239
|
let l;
|
|
@@ -7390,7 +7390,7 @@ function Wr(n, e = null) {
|
|
|
7390
7390
|
function bo(n) {
|
|
7391
7391
|
return n.editable ? n.hasFocus() : xo(n) && document.activeElement && document.activeElement.contains(n.dom);
|
|
7392
7392
|
}
|
|
7393
|
-
function
|
|
7393
|
+
function Ae(n, e = !1) {
|
|
7394
7394
|
let t = n.state.selection;
|
|
7395
7395
|
if (ko(n, t), !!bo(n)) {
|
|
7396
7396
|
if (!e && n.input.mouseDown && n.input.mouseDown.allowDefault && _) {
|
|
@@ -7442,7 +7442,7 @@ function rc(n) {
|
|
|
7442
7442
|
if (!e)
|
|
7443
7443
|
return;
|
|
7444
7444
|
let t = n.cursorWrapper.dom, r = t.nodeName == "IMG";
|
|
7445
|
-
r ? e.collapse(t.parentNode, J(t) + 1) : e.collapse(t, 0), !r && !n.state.selection.visible &&
|
|
7445
|
+
r ? e.collapse(t.parentNode, J(t) + 1) : e.collapse(t, 0), !r && !n.state.selection.visible && se && Ve <= 11 && (t.disabled = !0, t.disabled = !1);
|
|
7446
7446
|
}
|
|
7447
7447
|
function ko(n, e) {
|
|
7448
7448
|
if (e instanceof S) {
|
|
@@ -7514,7 +7514,7 @@ function Wi(n, e, t) {
|
|
|
7514
7514
|
function Sn(n) {
|
|
7515
7515
|
return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
|
|
7516
7516
|
}
|
|
7517
|
-
function
|
|
7517
|
+
function Pt(n, e) {
|
|
7518
7518
|
let t = n.pmViewDesc;
|
|
7519
7519
|
return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
|
|
7520
7520
|
}
|
|
@@ -7526,13 +7526,13 @@ function sc(n) {
|
|
|
7526
7526
|
if (!t)
|
|
7527
7527
|
return;
|
|
7528
7528
|
let i, s, o = !1;
|
|
7529
|
-
for (pe && t.nodeType == 1 && r < Sn(t) &&
|
|
7529
|
+
for (pe && t.nodeType == 1 && r < Sn(t) && Pt(t.childNodes[r], -1) && (o = !0); ; )
|
|
7530
7530
|
if (r > 0) {
|
|
7531
7531
|
if (t.nodeType != 1)
|
|
7532
7532
|
break;
|
|
7533
7533
|
{
|
|
7534
7534
|
let l = t.childNodes[r - 1];
|
|
7535
|
-
if (
|
|
7535
|
+
if (Pt(l, -1))
|
|
7536
7536
|
i = t, s = --r;
|
|
7537
7537
|
else if (l.nodeType == 3)
|
|
7538
7538
|
t = l, r = t.nodeValue.length;
|
|
@@ -7544,7 +7544,7 @@ function sc(n) {
|
|
|
7544
7544
|
break;
|
|
7545
7545
|
{
|
|
7546
7546
|
let l = t.previousSibling;
|
|
7547
|
-
for (; l &&
|
|
7547
|
+
for (; l && Pt(l, -1); )
|
|
7548
7548
|
i = t.parentNode, s = J(l), l = l.previousSibling;
|
|
7549
7549
|
if (l)
|
|
7550
7550
|
t = l, r = Sn(t);
|
|
@@ -7567,7 +7567,7 @@ function oc(n) {
|
|
|
7567
7567
|
if (t.nodeType != 1)
|
|
7568
7568
|
break;
|
|
7569
7569
|
let l = t.childNodes[r];
|
|
7570
|
-
if (
|
|
7570
|
+
if (Pt(l, 1))
|
|
7571
7571
|
s = t, o = ++r;
|
|
7572
7572
|
else
|
|
7573
7573
|
break;
|
|
@@ -7576,7 +7576,7 @@ function oc(n) {
|
|
|
7576
7576
|
break;
|
|
7577
7577
|
{
|
|
7578
7578
|
let l = t.nextSibling;
|
|
7579
|
-
for (; l &&
|
|
7579
|
+
for (; l && Pt(l, 1); )
|
|
7580
7580
|
s = l.parentNode, o = J(l) + 1, l = l.nextSibling;
|
|
7581
7581
|
if (l)
|
|
7582
7582
|
t = l, r = 0, i = Sn(t);
|
|
@@ -7594,7 +7594,7 @@ function So(n) {
|
|
|
7594
7594
|
return e && e.node && e.node.isBlock;
|
|
7595
7595
|
}
|
|
7596
7596
|
function lc(n, e) {
|
|
7597
|
-
for (; n && e == n.childNodes.length && !
|
|
7597
|
+
for (; n && e == n.childNodes.length && !Xt(n); )
|
|
7598
7598
|
e = J(n) + 1, n = n.parentNode;
|
|
7599
7599
|
for (; n && e < n.childNodes.length; ) {
|
|
7600
7600
|
let t = n.childNodes[e];
|
|
@@ -7606,7 +7606,7 @@ function lc(n, e) {
|
|
|
7606
7606
|
}
|
|
7607
7607
|
}
|
|
7608
7608
|
function ac(n, e) {
|
|
7609
|
-
for (; n && !e && !
|
|
7609
|
+
for (; n && !e && !Xt(n); )
|
|
7610
7610
|
e = J(n), n = n.parentNode;
|
|
7611
7611
|
for (; n && e; ) {
|
|
7612
7612
|
let t = n.childNodes[e - 1];
|
|
@@ -7632,7 +7632,7 @@ function Nr(n, e, t) {
|
|
|
7632
7632
|
n.domObserver.setCurSelection();
|
|
7633
7633
|
let { state: i } = n;
|
|
7634
7634
|
setTimeout(() => {
|
|
7635
|
-
n.state == i &&
|
|
7635
|
+
n.state == i && Ae(n);
|
|
7636
7636
|
}, 50);
|
|
7637
7637
|
}
|
|
7638
7638
|
function qi(n, e) {
|
|
@@ -7663,7 +7663,7 @@ function ji(n, e, t) {
|
|
|
7663
7663
|
return Ie(n, o);
|
|
7664
7664
|
}
|
|
7665
7665
|
if (!i.parent.inlineContent) {
|
|
7666
|
-
let o = e < 0 ? i : s, l = r instanceof
|
|
7666
|
+
let o = e < 0 ? i : s, l = r instanceof de ? v.near(o, e) : v.findFrom(o, e);
|
|
7667
7667
|
return l ? Ie(n, l) : !1;
|
|
7668
7668
|
}
|
|
7669
7669
|
return !1;
|
|
@@ -7916,17 +7916,17 @@ function yc(n, e) {
|
|
|
7916
7916
|
}
|
|
7917
7917
|
return new k(i, s, o);
|
|
7918
7918
|
}
|
|
7919
|
-
const
|
|
7919
|
+
const te = {}, ne = {}, bc = { touchstart: !0, touchmove: !0 };
|
|
7920
7920
|
class kc {
|
|
7921
7921
|
constructor() {
|
|
7922
7922
|
this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "", button: 0 }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.badSafariComposition = !1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
|
|
7923
7923
|
}
|
|
7924
7924
|
}
|
|
7925
7925
|
function xc(n) {
|
|
7926
|
-
for (let e in
|
|
7927
|
-
let t =
|
|
7926
|
+
for (let e in te) {
|
|
7927
|
+
let t = te[e];
|
|
7928
7928
|
n.dom.addEventListener(e, n.input.eventHandlers[e] = (r) => {
|
|
7929
|
-
Mc(n, r) && !Kr(n, r) && (n.editable || !(r.type in
|
|
7929
|
+
Mc(n, r) && !Kr(n, r) && (n.editable || !(r.type in ne)) && t(n, r);
|
|
7930
7930
|
}, bc[e] ? { passive: !0 } : void 0);
|
|
7931
7931
|
}
|
|
7932
7932
|
Z && n.dom.addEventListener("input", () => null), Dr(n);
|
|
@@ -7963,22 +7963,22 @@ function Mc(n, e) {
|
|
|
7963
7963
|
return !0;
|
|
7964
7964
|
}
|
|
7965
7965
|
function wc(n, e) {
|
|
7966
|
-
!Kr(n, e) &&
|
|
7966
|
+
!Kr(n, e) && te[e.type] && (n.editable || !(e.type in ne)) && te[e.type](n, e);
|
|
7967
7967
|
}
|
|
7968
|
-
|
|
7968
|
+
ne.keydown = (n, e) => {
|
|
7969
7969
|
let t = e;
|
|
7970
|
-
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !No(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(
|
|
7971
|
-
if (t.keyCode != 229 && n.domObserver.forceFlush(),
|
|
7970
|
+
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !No(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(Ee && _ && t.keyCode == 13)))
|
|
7971
|
+
if (t.keyCode != 229 && n.domObserver.forceFlush(), wt && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
7972
7972
|
let r = Date.now();
|
|
7973
7973
|
n.input.lastIOSEnter = r, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
7974
7974
|
n.input.lastIOSEnter == r && (n.someProp("handleKeyDown", (i) => i(n, Ue(13, "Enter"))), n.input.lastIOSEnter = 0);
|
|
7975
7975
|
}, 200);
|
|
7976
7976
|
} else n.someProp("handleKeyDown", (r) => r(n, t)) || uc(n, t) ? t.preventDefault() : ze(n, "key");
|
|
7977
7977
|
};
|
|
7978
|
-
|
|
7978
|
+
ne.keyup = (n, e) => {
|
|
7979
7979
|
e.keyCode == 16 && (n.input.shiftKey = !1);
|
|
7980
7980
|
};
|
|
7981
|
-
|
|
7981
|
+
ne.keypress = (n, e) => {
|
|
7982
7982
|
let t = e;
|
|
7983
7983
|
if (No(n, t) || !t.charCode || t.ctrlKey && !t.altKey || ue && t.metaKey)
|
|
7984
7984
|
return;
|
|
@@ -8066,7 +8066,7 @@ function Ur(n) {
|
|
|
8066
8066
|
return Mn(n);
|
|
8067
8067
|
}
|
|
8068
8068
|
const Eo = ue ? "metaKey" : "ctrlKey";
|
|
8069
|
-
|
|
8069
|
+
te.mousedown = (n, e) => {
|
|
8070
8070
|
let t = e;
|
|
8071
8071
|
n.input.shiftKey = t.shiftKey;
|
|
8072
8072
|
let r = Ur(n), i = Date.now(), s = "singleClick";
|
|
@@ -8097,7 +8097,7 @@ class Dc {
|
|
|
8097
8097
|
}, 20), this.view.domObserver.start()), e.root.addEventListener("mouseup", this.up = this.up.bind(this)), e.root.addEventListener("mousemove", this.move = this.move.bind(this)), ze(e, "pointer");
|
|
8098
8098
|
}
|
|
8099
8099
|
done() {
|
|
8100
|
-
this.view.root.removeEventListener("mouseup", this.up), this.view.root.removeEventListener("mousemove", this.move), this.mightDrag && this.target && (this.view.domObserver.stop(), this.mightDrag.addAttr && this.target.removeAttribute("draggable"), this.mightDrag.setUneditable && this.target.removeAttribute("contentEditable"), this.view.domObserver.start()), this.delayedSelectionSync && setTimeout(() =>
|
|
8100
|
+
this.view.root.removeEventListener("mouseup", this.up), this.view.root.removeEventListener("mousemove", this.move), this.mightDrag && this.target && (this.view.domObserver.stop(), this.mightDrag.addAttr && this.target.removeAttribute("draggable"), this.mightDrag.setUneditable && this.target.removeAttribute("contentEditable"), this.view.domObserver.start()), this.delayedSelectionSync && setTimeout(() => Ae(this.view)), this.view.input.mouseDown = null;
|
|
8101
8101
|
}
|
|
8102
8102
|
up(e) {
|
|
8103
8103
|
if (this.done(), !this.view.dom.contains(e.target))
|
|
@@ -8120,18 +8120,18 @@ class Dc {
|
|
|
8120
8120
|
!this.allowDefault && (Math.abs(this.event.x - e.clientX) > 4 || Math.abs(this.event.y - e.clientY) > 4) && (this.allowDefault = !0);
|
|
8121
8121
|
}
|
|
8122
8122
|
}
|
|
8123
|
-
|
|
8123
|
+
te.touchstart = (n) => {
|
|
8124
8124
|
n.input.lastTouch = Date.now(), Ur(n), ze(n, "pointer");
|
|
8125
8125
|
};
|
|
8126
|
-
|
|
8126
|
+
te.touchmove = (n) => {
|
|
8127
8127
|
n.input.lastTouch = Date.now(), ze(n, "pointer");
|
|
8128
8128
|
};
|
|
8129
|
-
|
|
8129
|
+
te.contextmenu = (n) => Ur(n);
|
|
8130
8130
|
function No(n, e) {
|
|
8131
8131
|
return n.composing ? !0 : Z && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
|
|
8132
8132
|
}
|
|
8133
|
-
const Ic =
|
|
8134
|
-
|
|
8133
|
+
const Ic = Ee ? 5e3 : -1;
|
|
8134
|
+
ne.compositionstart = ne.compositionupdate = (n) => {
|
|
8135
8135
|
if (!n.composing) {
|
|
8136
8136
|
n.domObserver.flush();
|
|
8137
8137
|
let { state: e } = n, t = e.selection.$to;
|
|
@@ -8162,7 +8162,7 @@ function Rc(n) {
|
|
|
8162
8162
|
let r = e.childNodes[t];
|
|
8163
8163
|
return r.nodeType == 1 && r.contentEditable == "false";
|
|
8164
8164
|
}
|
|
8165
|
-
|
|
8165
|
+
ne.compositionend = (n, e) => {
|
|
8166
8166
|
n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.badSafariComposition ? n.domObserver.forceFlush() : n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, Ao(n, 20));
|
|
8167
8167
|
};
|
|
8168
8168
|
function Ao(n, e) {
|
|
@@ -8196,7 +8196,7 @@ function Bc() {
|
|
|
8196
8196
|
return n.initEvent("event", !0, !0), n.timeStamp;
|
|
8197
8197
|
}
|
|
8198
8198
|
function Mn(n, e = !1) {
|
|
8199
|
-
if (!(
|
|
8199
|
+
if (!(Ee && n.domObserver.flushingSoon >= 0)) {
|
|
8200
8200
|
if (n.domObserver.forceFlush(), Do(n), e || n.docView && n.docView.dirty) {
|
|
8201
8201
|
let t = Wr(n), r = n.state.selection;
|
|
8202
8202
|
return t && !t.eq(r) ? n.dispatch(n.state.tr.setSelection(t)) : (n.markCursor || e) && !r.$from.node(r.$from.sharedDepth(r.to)).inlineContent ? n.dispatch(n.state.tr.deleteSelection()) : n.updateState(n.state), !0;
|
|
@@ -8214,12 +8214,12 @@ function Lc(n, e) {
|
|
|
8214
8214
|
t.parentNode && t.parentNode.removeChild(t), n.focus();
|
|
8215
8215
|
}, 50);
|
|
8216
8216
|
}
|
|
8217
|
-
const
|
|
8218
|
-
|
|
8217
|
+
const $t = se && Ve < 15 || wt && Da < 604;
|
|
8218
|
+
te.copy = ne.cut = (n, e) => {
|
|
8219
8219
|
let t = e, r = n.state.selection, i = t.type == "cut";
|
|
8220
8220
|
if (r.empty)
|
|
8221
8221
|
return;
|
|
8222
|
-
let s =
|
|
8222
|
+
let s = $t ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = jr(n, o);
|
|
8223
8223
|
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : Lc(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
8224
8224
|
};
|
|
8225
8225
|
function zc(n) {
|
|
@@ -8232,10 +8232,10 @@ function Fc(n, e) {
|
|
|
8232
8232
|
t || (r.contentEditable = "true"), r.style.cssText = "position: fixed; left: -10000px; top: 10px", r.focus();
|
|
8233
8233
|
let i = n.input.shiftKey && n.input.lastKeyCode != 45;
|
|
8234
8234
|
setTimeout(() => {
|
|
8235
|
-
n.focus(), r.parentNode && r.parentNode.removeChild(r), t ?
|
|
8235
|
+
n.focus(), r.parentNode && r.parentNode.removeChild(r), t ? Vt(n, r.value, null, i, e) : Vt(n, r.textContent, r.innerHTML, i, e);
|
|
8236
8236
|
}, 50);
|
|
8237
8237
|
}
|
|
8238
|
-
function
|
|
8238
|
+
function Vt(n, e, t, r, i) {
|
|
8239
8239
|
let s = Mo(n, e, t, r, n.state.selection.$from);
|
|
8240
8240
|
if (n.someProp("handlePaste", (a) => a(n, i, s || k.empty)))
|
|
8241
8241
|
return !0;
|
|
@@ -8251,12 +8251,12 @@ function Io(n) {
|
|
|
8251
8251
|
let t = n.getData("text/uri-list");
|
|
8252
8252
|
return t ? t.replace(/\r?\n/g, " ") : "";
|
|
8253
8253
|
}
|
|
8254
|
-
|
|
8254
|
+
ne.paste = (n, e) => {
|
|
8255
8255
|
let t = e;
|
|
8256
|
-
if (n.composing && !
|
|
8256
|
+
if (n.composing && !Ee)
|
|
8257
8257
|
return;
|
|
8258
|
-
let r =
|
|
8259
|
-
r &&
|
|
8258
|
+
let r = $t ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
|
|
8259
|
+
r && Vt(n, Io(r), r.getData("text/html"), i, t) ? t.preventDefault() : Fc(n, t);
|
|
8260
8260
|
};
|
|
8261
8261
|
class Ro {
|
|
8262
8262
|
constructor(e, t, r) {
|
|
@@ -8270,7 +8270,7 @@ function Po(n, e) {
|
|
|
8270
8270
|
t = t || r(e);
|
|
8271
8271
|
}), t != null ? !t : !e[$c];
|
|
8272
8272
|
}
|
|
8273
|
-
|
|
8273
|
+
te.dragstart = (n, e) => {
|
|
8274
8274
|
let t = e, r = n.input.mouseDown;
|
|
8275
8275
|
if (r && r.done(), !t.dataTransfer)
|
|
8276
8276
|
return;
|
|
@@ -8284,16 +8284,16 @@ ee.dragstart = (n, e) => {
|
|
|
8284
8284
|
}
|
|
8285
8285
|
}
|
|
8286
8286
|
let l = (o || n.state.selection).content(), { dom: a, text: c, slice: d } = jr(n, l);
|
|
8287
|
-
(!t.dataTransfer.files.length || !_ || io > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(
|
|
8287
|
+
(!t.dataTransfer.files.length || !_ || io > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData($t ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", $t || t.dataTransfer.setData("text/plain", c), n.dragging = new Ro(d, Po(n, t), o);
|
|
8288
8288
|
};
|
|
8289
|
-
|
|
8289
|
+
te.dragend = (n) => {
|
|
8290
8290
|
let e = n.dragging;
|
|
8291
8291
|
window.setTimeout(() => {
|
|
8292
8292
|
n.dragging == e && (n.dragging = null);
|
|
8293
8293
|
}, 50);
|
|
8294
8294
|
};
|
|
8295
|
-
|
|
8296
|
-
|
|
8295
|
+
ne.dragover = ne.dragenter = (n, e) => e.preventDefault();
|
|
8296
|
+
ne.drop = (n, e) => {
|
|
8297
8297
|
try {
|
|
8298
8298
|
Vc(n, e, n.dragging);
|
|
8299
8299
|
} finally {
|
|
@@ -8309,7 +8309,7 @@ function Vc(n, e, t) {
|
|
|
8309
8309
|
let i = n.state.doc.resolve(r.pos), s = t && t.slice;
|
|
8310
8310
|
s ? n.someProp("transformPasted", (h) => {
|
|
8311
8311
|
s = h(s, n, !1);
|
|
8312
|
-
}) : s = Mo(n, Io(e.dataTransfer),
|
|
8312
|
+
}) : s = Mo(n, Io(e.dataTransfer), $t ? null : e.dataTransfer.getData("text/html"), !1, i);
|
|
8313
8313
|
let o = !!(t && Po(n, e));
|
|
8314
8314
|
if (n.someProp("handleDrop", (h) => h(n, e, s || k.empty, o))) {
|
|
8315
8315
|
e.preventDefault();
|
|
@@ -8318,7 +8318,7 @@ function Vc(n, e, t) {
|
|
|
8318
8318
|
if (!s)
|
|
8319
8319
|
return;
|
|
8320
8320
|
e.preventDefault();
|
|
8321
|
-
let l = s ?
|
|
8321
|
+
let l = s ? Ys(n.state.doc, i.pos, s) : i.pos;
|
|
8322
8322
|
l == null && (l = i.pos);
|
|
8323
8323
|
let a = n.state.tr;
|
|
8324
8324
|
if (o) {
|
|
@@ -8337,17 +8337,17 @@ function Vc(n, e, t) {
|
|
|
8337
8337
|
}
|
|
8338
8338
|
n.focus(), n.dispatch(a.setMeta("uiEvent", "drop"));
|
|
8339
8339
|
}
|
|
8340
|
-
|
|
8340
|
+
te.focus = (n) => {
|
|
8341
8341
|
n.input.lastFocus = Date.now(), n.focused || (n.domObserver.stop(), n.dom.classList.add("ProseMirror-focused"), n.domObserver.start(), n.focused = !0, setTimeout(() => {
|
|
8342
|
-
n.docView && n.hasFocus() && !n.domObserver.currentSelection.eq(n.domSelectionRange()) &&
|
|
8342
|
+
n.docView && n.hasFocus() && !n.domObserver.currentSelection.eq(n.domSelectionRange()) && Ae(n);
|
|
8343
8343
|
}, 20));
|
|
8344
8344
|
};
|
|
8345
|
-
|
|
8345
|
+
te.blur = (n, e) => {
|
|
8346
8346
|
let t = e;
|
|
8347
8347
|
n.focused && (n.domObserver.stop(), n.dom.classList.remove("ProseMirror-focused"), n.domObserver.start(), t.relatedTarget && n.dom.contains(t.relatedTarget) && n.domObserver.currentSelection.clear(), n.focused = !1);
|
|
8348
8348
|
};
|
|
8349
|
-
|
|
8350
|
-
if (_ &&
|
|
8349
|
+
te.beforeinput = (n, e) => {
|
|
8350
|
+
if (_ && Ee && e.inputType == "deleteContentBackward") {
|
|
8351
8351
|
n.domObserver.flushSoon();
|
|
8352
8352
|
let { domChangeCount: r } = n.input;
|
|
8353
8353
|
setTimeout(() => {
|
|
@@ -8358,9 +8358,9 @@ ee.beforeinput = (n, e) => {
|
|
|
8358
8358
|
}, 50);
|
|
8359
8359
|
}
|
|
8360
8360
|
};
|
|
8361
|
-
for (let n in
|
|
8362
|
-
|
|
8363
|
-
function
|
|
8361
|
+
for (let n in ne)
|
|
8362
|
+
te[n] = ne[n];
|
|
8363
|
+
function Ht(n, e) {
|
|
8364
8364
|
if (n == e)
|
|
8365
8365
|
return !0;
|
|
8366
8366
|
for (let t in n)
|
|
@@ -8383,7 +8383,7 @@ class wn {
|
|
|
8383
8383
|
return !0;
|
|
8384
8384
|
}
|
|
8385
8385
|
eq(e) {
|
|
8386
|
-
return this == e || e instanceof wn && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM &&
|
|
8386
|
+
return this == e || e instanceof wn && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Ht(this.spec, e.spec));
|
|
8387
8387
|
}
|
|
8388
8388
|
destroy(e) {
|
|
8389
8389
|
this.spec.destroy && this.spec.destroy(e);
|
|
@@ -8401,7 +8401,7 @@ class We {
|
|
|
8401
8401
|
return t.from < t.to;
|
|
8402
8402
|
}
|
|
8403
8403
|
eq(e) {
|
|
8404
|
-
return this == e || e instanceof We &&
|
|
8404
|
+
return this == e || e instanceof We && Ht(this.attrs, e.attrs) && Ht(this.spec, e.spec);
|
|
8405
8405
|
}
|
|
8406
8406
|
static is(e) {
|
|
8407
8407
|
return e.type instanceof We;
|
|
@@ -8425,7 +8425,7 @@ class _r {
|
|
|
8425
8425
|
return i == t.from && !(s = e.child(r)).isText && i + s.nodeSize == t.to;
|
|
8426
8426
|
}
|
|
8427
8427
|
eq(e) {
|
|
8428
|
-
return this == e || e instanceof _r &&
|
|
8428
|
+
return this == e || e instanceof _r && Ht(this.attrs, e.attrs) && Ht(this.spec, e.spec);
|
|
8429
8429
|
}
|
|
8430
8430
|
destroy() {
|
|
8431
8431
|
}
|
|
@@ -8515,7 +8515,7 @@ class z {
|
|
|
8515
8515
|
you must make a copy if you want need to preserve that.
|
|
8516
8516
|
*/
|
|
8517
8517
|
static create(e, t) {
|
|
8518
|
-
return t.length ? Cn(t, e, 0, tt) :
|
|
8518
|
+
return t.length ? Cn(t, e, 0, tt) : X;
|
|
8519
8519
|
}
|
|
8520
8520
|
/**
|
|
8521
8521
|
Find all decorations in this set which touch the given range
|
|
@@ -8545,7 +8545,7 @@ class z {
|
|
|
8545
8545
|
document.
|
|
8546
8546
|
*/
|
|
8547
8547
|
map(e, t, r) {
|
|
8548
|
-
return this ==
|
|
8548
|
+
return this == X || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, r || tt);
|
|
8549
8549
|
}
|
|
8550
8550
|
/**
|
|
8551
8551
|
@internal
|
|
@@ -8556,7 +8556,7 @@ class z {
|
|
|
8556
8556
|
let a = this.local[l].map(e, r, i);
|
|
8557
8557
|
a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
|
|
8558
8558
|
}
|
|
8559
|
-
return this.children.length ? Hc(this.children, o || [], e, t, r, i, s) : o ? new z(o.sort(nt), pt) :
|
|
8559
|
+
return this.children.length ? Hc(this.children, o || [], e, t, r, i, s) : o ? new z(o.sort(nt), pt) : X;
|
|
8560
8560
|
}
|
|
8561
8561
|
/**
|
|
8562
8562
|
Add the given array of decorations to the ones in the set,
|
|
@@ -8565,7 +8565,7 @@ class z {
|
|
|
8565
8565
|
structure.
|
|
8566
8566
|
*/
|
|
8567
8567
|
add(e, t) {
|
|
8568
|
-
return t.length ? this ==
|
|
8568
|
+
return t.length ? this == X ? z.create(e, t) : this.addInner(e, t, 0) : this;
|
|
8569
8569
|
}
|
|
8570
8570
|
addInner(e, t, r) {
|
|
8571
8571
|
let i, s = 0;
|
|
@@ -8587,7 +8587,7 @@ class z {
|
|
|
8587
8587
|
the ones in the given array.
|
|
8588
8588
|
*/
|
|
8589
8589
|
remove(e) {
|
|
8590
|
-
return e.length == 0 || this ==
|
|
8590
|
+
return e.length == 0 || this == X ? this : this.removeInner(e, 0);
|
|
8591
8591
|
}
|
|
8592
8592
|
removeInner(e, t) {
|
|
8593
8593
|
let r = this.children, i = this.local;
|
|
@@ -8599,7 +8599,7 @@ class z {
|
|
|
8599
8599
|
continue;
|
|
8600
8600
|
r == this.children && (r = this.children.slice());
|
|
8601
8601
|
let c = r[s + 2].removeInner(o, l + 1);
|
|
8602
|
-
c !=
|
|
8602
|
+
c != X ? r[s + 2] = c : (r.splice(s, 3), s -= 3);
|
|
8603
8603
|
}
|
|
8604
8604
|
if (i.length) {
|
|
8605
8605
|
for (let s = 0, o; s < e.length; s++)
|
|
@@ -8607,10 +8607,10 @@ class z {
|
|
|
8607
8607
|
for (let l = 0; l < i.length; l++)
|
|
8608
8608
|
i[l].eq(o, t) && (i == this.local && (i = this.local.slice()), i.splice(l--, 1));
|
|
8609
8609
|
}
|
|
8610
|
-
return r == this.children && i == this.local ? this : i.length || r.length ? new z(i, r) :
|
|
8610
|
+
return r == this.children && i == this.local ? this : i.length || r.length ? new z(i, r) : X;
|
|
8611
8611
|
}
|
|
8612
8612
|
forChild(e, t) {
|
|
8613
|
-
if (this ==
|
|
8613
|
+
if (this == X)
|
|
8614
8614
|
return this;
|
|
8615
8615
|
if (t.isLeaf)
|
|
8616
8616
|
return z.empty;
|
|
@@ -8632,7 +8632,7 @@ class z {
|
|
|
8632
8632
|
let l = new z(i.sort(nt), pt);
|
|
8633
8633
|
return r ? new Pe([l, r]) : l;
|
|
8634
8634
|
}
|
|
8635
|
-
return r ||
|
|
8635
|
+
return r || X;
|
|
8636
8636
|
}
|
|
8637
8637
|
/**
|
|
8638
8638
|
@internal
|
|
@@ -8660,7 +8660,7 @@ class z {
|
|
|
8660
8660
|
@internal
|
|
8661
8661
|
*/
|
|
8662
8662
|
localsInner(e) {
|
|
8663
|
-
if (this ==
|
|
8663
|
+
if (this == X)
|
|
8664
8664
|
return pt;
|
|
8665
8665
|
if (e.inlineContent || !this.local.some(We.is))
|
|
8666
8666
|
return this.local;
|
|
@@ -8675,7 +8675,7 @@ class z {
|
|
|
8675
8675
|
}
|
|
8676
8676
|
z.empty = new z([], []);
|
|
8677
8677
|
z.removeOverlap = Gr;
|
|
8678
|
-
const
|
|
8678
|
+
const X = z.empty;
|
|
8679
8679
|
class Pe {
|
|
8680
8680
|
constructor(e) {
|
|
8681
8681
|
this.members = e;
|
|
@@ -8690,7 +8690,7 @@ class Pe {
|
|
|
8690
8690
|
let r = [];
|
|
8691
8691
|
for (let i = 0; i < this.members.length; i++) {
|
|
8692
8692
|
let s = this.members[i].forChild(e, t);
|
|
8693
|
-
s !=
|
|
8693
|
+
s != X && (s instanceof Pe ? r = r.concat(s.members) : r.push(s));
|
|
8694
8694
|
}
|
|
8695
8695
|
return Pe.from(r);
|
|
8696
8696
|
}
|
|
@@ -8722,7 +8722,7 @@ class Pe {
|
|
|
8722
8722
|
static from(e) {
|
|
8723
8723
|
switch (e.length) {
|
|
8724
8724
|
case 0:
|
|
8725
|
-
return
|
|
8725
|
+
return X;
|
|
8726
8726
|
case 1:
|
|
8727
8727
|
return e[0];
|
|
8728
8728
|
default:
|
|
@@ -8765,7 +8765,7 @@ function Hc(n, e, t, r, i, s, o) {
|
|
|
8765
8765
|
let f = t.map(n[c + 1] + s, -1), h = f - i, { index: p, offset: m } = r.content.findIndex(u), g = r.maybeChild(p);
|
|
8766
8766
|
if (g && m == u && m + g.nodeSize == h) {
|
|
8767
8767
|
let y = l[c + 2].mapInner(t, g, d + 1, n[c] + s + 1, o);
|
|
8768
|
-
y !=
|
|
8768
|
+
y != X ? (l[c] = u, l[c + 1] = h, l[c + 2] = y) : (l[c + 1] = -2, a = !0);
|
|
8769
8769
|
} else
|
|
8770
8770
|
a = !0;
|
|
8771
8771
|
}
|
|
@@ -8827,13 +8827,13 @@ function Cn(n, e, t, r) {
|
|
|
8827
8827
|
if (c) {
|
|
8828
8828
|
s = !0;
|
|
8829
8829
|
let d = Cn(c, l, t + a + 1, r);
|
|
8830
|
-
d !=
|
|
8830
|
+
d != X && i.push(a, a + l.nodeSize, d);
|
|
8831
8831
|
}
|
|
8832
8832
|
});
|
|
8833
8833
|
let o = Bo(s ? zo(n) : n, -t).sort(nt);
|
|
8834
8834
|
for (let l = 0; l < o.length; l++)
|
|
8835
8835
|
o[l].type.valid(e, o[l]) || (r.onRemove && r.onRemove(o[l].spec), o.splice(l--, 1));
|
|
8836
|
-
return o.length || i.length ? new z(o, i) :
|
|
8836
|
+
return o.length || i.length ? new z(o, i) : X;
|
|
8837
8837
|
}
|
|
8838
8838
|
function nt(n, e) {
|
|
8839
8839
|
return n.from - e.from || n.to - e.to;
|
|
@@ -8865,7 +8865,7 @@ function ir(n) {
|
|
|
8865
8865
|
let e = [];
|
|
8866
8866
|
return n.someProp("decorations", (t) => {
|
|
8867
8867
|
let r = t(n.state);
|
|
8868
|
-
r && r !=
|
|
8868
|
+
r && r != X && e.push(r);
|
|
8869
8869
|
}), n.cursorWrapper && e.push(z.create(n.state.doc, [n.cursorWrapper.deco])), Pe.from(e);
|
|
8870
8870
|
}
|
|
8871
8871
|
const qc = {
|
|
@@ -8875,7 +8875,7 @@ const qc = {
|
|
|
8875
8875
|
attributes: !0,
|
|
8876
8876
|
attributeOldValue: !0,
|
|
8877
8877
|
subtree: !0
|
|
8878
|
-
}, jc =
|
|
8878
|
+
}, jc = se && Ve <= 11;
|
|
8879
8879
|
class Kc {
|
|
8880
8880
|
constructor() {
|
|
8881
8881
|
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
|
|
@@ -8895,7 +8895,7 @@ class Jc {
|
|
|
8895
8895
|
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Kc(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
|
|
8896
8896
|
for (let i = 0; i < r.length; i++)
|
|
8897
8897
|
this.queue.push(r[i]);
|
|
8898
|
-
|
|
8898
|
+
se && Ve <= 11 && r.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : Z && e.composing && r.some((i) => i.type == "childList" && i.target.nodeName == "TR") ? (e.input.badSafariComposition = !0, this.flushSoon()) : this.flush();
|
|
8899
8899
|
}), jc && (this.onCharData = (r) => {
|
|
8900
8900
|
this.queue.push({ target: r.target, type: "characterData", oldValue: r.prevValue }), this.flushSoon();
|
|
8901
8901
|
}), this.onSelectionChange = this.onSelectionChange.bind(this);
|
|
@@ -8935,8 +8935,8 @@ class Jc {
|
|
|
8935
8935
|
onSelectionChange() {
|
|
8936
8936
|
if (Hi(this.view)) {
|
|
8937
8937
|
if (this.suppressingSelectionUpdates)
|
|
8938
|
-
return
|
|
8939
|
-
if (
|
|
8938
|
+
return Ae(this.view);
|
|
8939
|
+
if (se && Ve <= 11 && !this.view.state.selection.empty) {
|
|
8940
8940
|
let e = this.view.domSelectionRange();
|
|
8941
8941
|
if (e.focusNode && ot(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
|
|
8942
8942
|
return this.flushSoon();
|
|
@@ -8951,9 +8951,9 @@ class Jc {
|
|
|
8951
8951
|
if (!e.focusNode)
|
|
8952
8952
|
return !0;
|
|
8953
8953
|
let t = /* @__PURE__ */ new Set(), r;
|
|
8954
|
-
for (let s = e.focusNode; s; s =
|
|
8954
|
+
for (let s = e.focusNode; s; s = Mt(s))
|
|
8955
8955
|
t.add(s);
|
|
8956
|
-
for (let s = e.anchorNode; s; s =
|
|
8956
|
+
for (let s = e.anchorNode; s; s = Mt(s))
|
|
8957
8957
|
if (t.has(s)) {
|
|
8958
8958
|
r = s;
|
|
8959
8959
|
break;
|
|
@@ -9009,7 +9009,7 @@ class Jc {
|
|
|
9009
9009
|
}
|
|
9010
9010
|
}
|
|
9011
9011
|
let c = null;
|
|
9012
|
-
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && zn(r) && (c = Wr(e)) && c.eq(v.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0,
|
|
9012
|
+
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && zn(r) && (c = Wr(e)) && c.eq(v.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Ae(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Uc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, Yc(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || Ae(e), this.currentSelection.set(r));
|
|
9013
9013
|
}
|
|
9014
9014
|
registerMutation(e, t) {
|
|
9015
9015
|
if (t.indexOf(e.target) > -1)
|
|
@@ -9026,7 +9026,7 @@ class Jc {
|
|
|
9026
9026
|
if (r.contentDOM && r.contentDOM != r.dom && !r.contentDOM.contains(e.target))
|
|
9027
9027
|
return { from: r.posBefore, to: r.posAfter };
|
|
9028
9028
|
let i = e.previousSibling, s = e.nextSibling;
|
|
9029
|
-
if (
|
|
9029
|
+
if (se && Ve <= 11 && e.addedNodes.length)
|
|
9030
9030
|
for (let d = 0; d < e.addedNodes.length; d++) {
|
|
9031
9031
|
let { previousSibling: u, nextSibling: f } = e.addedNodes[d];
|
|
9032
9032
|
(!u || Array.prototype.indexOf.call(e.addedNodes, u) < 0) && (i = u), (!f || Array.prototype.indexOf.call(e.addedNodes, f) < 0) && (s = f);
|
|
@@ -9044,12 +9044,12 @@ class Jc {
|
|
|
9044
9044
|
});
|
|
9045
9045
|
}
|
|
9046
9046
|
}
|
|
9047
|
-
let
|
|
9047
|
+
let Yi = /* @__PURE__ */ new WeakMap(), Xi = !1;
|
|
9048
9048
|
function Uc(n) {
|
|
9049
|
-
if (!
|
|
9050
|
-
if (n.requiresGeckoHackNode = pe,
|
|
9049
|
+
if (!Yi.has(n) && (Yi.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
|
|
9050
|
+
if (n.requiresGeckoHackNode = pe, Xi)
|
|
9051
9051
|
return;
|
|
9052
|
-
console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),
|
|
9052
|
+
console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), Xi = !0;
|
|
9053
9053
|
}
|
|
9054
9054
|
}
|
|
9055
9055
|
function Zi(n, e) {
|
|
@@ -9076,7 +9076,7 @@ function Gc(n, e) {
|
|
|
9076
9076
|
}
|
|
9077
9077
|
return null;
|
|
9078
9078
|
}
|
|
9079
|
-
function
|
|
9079
|
+
function Yc(n, e) {
|
|
9080
9080
|
var t;
|
|
9081
9081
|
let { focusNode: r, focusOffset: i } = n.domSelectionRange();
|
|
9082
9082
|
for (let s of e)
|
|
@@ -9097,7 +9097,7 @@ function Xc(n, e) {
|
|
|
9097
9097
|
s.parentNode.removeChild(s);
|
|
9098
9098
|
}
|
|
9099
9099
|
}
|
|
9100
|
-
function
|
|
9100
|
+
function Xc(n, e, t) {
|
|
9101
9101
|
let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
|
|
9102
9102
|
if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], zn(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), _ && n.input.lastKeyCode === 8)
|
|
9103
9103
|
for (let g = s; g > i; g--) {
|
|
@@ -9146,19 +9146,19 @@ function ed(n, e, t, r, i) {
|
|
|
9146
9146
|
if (n.input.compositionPendingChanges = 0, e < 0) {
|
|
9147
9147
|
let C = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, N = Wr(n, C);
|
|
9148
9148
|
if (N && !n.state.selection.eq(N)) {
|
|
9149
|
-
if (_ &&
|
|
9149
|
+
if (_ && Ee && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (kl) => kl(n, Ue(13, "Enter"))))
|
|
9150
9150
|
return;
|
|
9151
|
-
let
|
|
9152
|
-
C == "pointer" ?
|
|
9151
|
+
let Y = n.state.tr.setSelection(N);
|
|
9152
|
+
C == "pointer" ? Y.setMeta("pointer", !0) : C == "key" && Y.scrollIntoView(), s && Y.setMeta("composition", s), n.dispatch(Y);
|
|
9153
9153
|
}
|
|
9154
9154
|
return;
|
|
9155
9155
|
}
|
|
9156
9156
|
let o = n.state.doc.resolve(e), l = o.sharedDepth(t);
|
|
9157
9157
|
e = o.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
|
|
9158
|
-
let a = n.state.selection, c =
|
|
9158
|
+
let a = n.state.selection, c = Xc(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, h;
|
|
9159
9159
|
n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (f = n.state.selection.to, h = "end") : (f = n.state.selection.from, h = "start"), n.input.lastKeyCode = null;
|
|
9160
9160
|
let p = rd(u.content, c.doc.content, c.from, f, h);
|
|
9161
|
-
if (p && n.input.domChangeCount++, (
|
|
9161
|
+
if (p && n.input.domChangeCount++, (wt && n.input.lastIOSEnter > Date.now() - 225 || Ee) && i.some((C) => C.nodeType == 1 && !Qc.test(C.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (C) => C(n, Ue(13, "Enter")))) {
|
|
9162
9162
|
n.input.lastIOSEnter = 0;
|
|
9163
9163
|
return;
|
|
9164
9164
|
}
|
|
@@ -9175,17 +9175,17 @@ function ed(n, e, t, r, i) {
|
|
|
9175
9175
|
}
|
|
9176
9176
|
return;
|
|
9177
9177
|
}
|
|
9178
|
-
n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof M && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)),
|
|
9178
|
+
n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof M && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)), se && Ve <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == " " && (p.start--, p.endA--, p.endB--);
|
|
9179
9179
|
let m = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), y = d.resolve(p.start), T = m.sameParent(g) && m.parent.inlineContent && y.end() >= p.endA;
|
|
9180
|
-
if ((
|
|
9180
|
+
if ((wt && n.input.lastIOSEnter > Date.now() - 225 && (!T || i.some((C) => C.nodeName == "DIV" || C.nodeName == "P")) || !T && m.pos < c.doc.content.size && (!m.sameParent(g) || !m.parent.inlineContent) && m.pos < g.pos && !/\S/.test(c.doc.textBetween(m.pos, g.pos, "", ""))) && n.someProp("handleKeyDown", (C) => C(n, Ue(13, "Enter")))) {
|
|
9181
9181
|
n.input.lastIOSEnter = 0;
|
|
9182
9182
|
return;
|
|
9183
9183
|
}
|
|
9184
9184
|
if (n.state.selection.anchor > p.start && nd(d, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (C) => C(n, Ue(8, "Backspace")))) {
|
|
9185
|
-
|
|
9185
|
+
Ee && _ && n.domObserver.suppressSelectionUpdates();
|
|
9186
9186
|
return;
|
|
9187
9187
|
}
|
|
9188
|
-
_ && p.endB == p.start && (n.input.lastChromeDelete = Date.now()),
|
|
9188
|
+
_ && p.endB == p.start && (n.input.lastChromeDelete = Date.now()), Ee && !T && 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(() => {
|
|
9189
9189
|
n.someProp("handleKeyDown", function(C) {
|
|
9190
9190
|
return C(n, Ue(13, "Enter"));
|
|
9191
9191
|
});
|
|
@@ -9193,14 +9193,14 @@ function ed(n, e, t, r, i) {
|
|
|
9193
9193
|
let w = p.start, I = p.endA, D = (C) => {
|
|
9194
9194
|
let N = C || n.state.tr.replace(w, I, c.doc.slice(p.start - c.from, p.endB - c.from));
|
|
9195
9195
|
if (c.sel) {
|
|
9196
|
-
let
|
|
9197
|
-
|
|
9196
|
+
let Y = Qi(n, N.doc, c.sel);
|
|
9197
|
+
Y && !(_ && n.composing && Y.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (Y.head == w || Y.head == N.mapping.map(I) - 1) || se && Y.empty && Y.head == w) && N.setSelection(Y);
|
|
9198
9198
|
}
|
|
9199
9199
|
return s && N.setMeta("composition", s), N.scrollIntoView();
|
|
9200
9200
|
}, L;
|
|
9201
9201
|
if (T)
|
|
9202
9202
|
if (m.pos == g.pos) {
|
|
9203
|
-
|
|
9203
|
+
se && Ve <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => Ae(n), 20));
|
|
9204
9204
|
let C = D(n.state.tr.delete(w, I)), N = d.resolve(p.start).marksAcross(d.resolve(p.endA));
|
|
9205
9205
|
N && C.ensureMarks(N), n.dispatch(C);
|
|
9206
9206
|
} else if (
|
|
@@ -9211,7 +9211,7 @@ function ed(n, e, t, r, i) {
|
|
|
9211
9211
|
L.type == "add" ? C.addMark(w, I, L.mark) : C.removeMark(w, I, L.mark), n.dispatch(C);
|
|
9212
9212
|
} else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
|
|
9213
9213
|
let C = m.parent.textBetween(m.parentOffset, g.parentOffset), N = () => D(n.state.tr.insertText(C, w, I));
|
|
9214
|
-
n.someProp("handleTextInput", (
|
|
9214
|
+
n.someProp("handleTextInput", (Y) => Y(n, w, I, C, N)) || n.dispatch(N());
|
|
9215
9215
|
} else
|
|
9216
9216
|
n.dispatch(D());
|
|
9217
9217
|
else
|
|
@@ -9367,12 +9367,12 @@ class Fo {
|
|
|
9367
9367
|
let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Pa(this);
|
|
9368
9368
|
if (o) {
|
|
9369
9369
|
this.domObserver.stop();
|
|
9370
|
-
let h = u && (
|
|
9370
|
+
let h = u && (se || _) && !this.composing && !i.selection.empty && !e.selection.empty && id(i.selection, e.selection);
|
|
9371
9371
|
if (u) {
|
|
9372
9372
|
let p = _ ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
9373
9373
|
this.composing && (this.input.compositionNode = Pc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = Bi(e.doc, c, a, this.dom, this)), p && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (h = !0);
|
|
9374
9374
|
}
|
|
9375
|
-
h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && ic(this)) ?
|
|
9375
|
+
h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && ic(this)) ? Ae(this, h) : (ko(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
9376
9376
|
}
|
|
9377
9377
|
this.updatePluginViews(i), !((r = this.dragging) === null || r === void 0) && r.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && Ba(f);
|
|
9378
9378
|
}
|
|
@@ -9442,7 +9442,7 @@ class Fo {
|
|
|
9442
9442
|
Query whether the view has focus.
|
|
9443
9443
|
*/
|
|
9444
9444
|
hasFocus() {
|
|
9445
|
-
if (
|
|
9445
|
+
if (se) {
|
|
9446
9446
|
let e = this.root.activeElement;
|
|
9447
9447
|
if (e == this.dom)
|
|
9448
9448
|
return !0;
|
|
@@ -9461,7 +9461,7 @@ class Fo {
|
|
|
9461
9461
|
Focus the editor.
|
|
9462
9462
|
*/
|
|
9463
9463
|
focus() {
|
|
9464
|
-
this.domObserver.stop(), this.editable && La(this.dom),
|
|
9464
|
+
this.domObserver.stop(), this.editable && La(this.dom), Ae(this), this.domObserver.start();
|
|
9465
9465
|
}
|
|
9466
9466
|
/**
|
|
9467
9467
|
Get the document root in which the editor exists. This will
|
|
@@ -9568,13 +9568,13 @@ class Fo {
|
|
|
9568
9568
|
[`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
|
|
9569
9569
|
*/
|
|
9570
9570
|
pasteHTML(e, t) {
|
|
9571
|
-
return
|
|
9571
|
+
return Vt(this, "", e, !1, t || new ClipboardEvent("paste"));
|
|
9572
9572
|
}
|
|
9573
9573
|
/**
|
|
9574
9574
|
Run the editor's paste logic with the given plain-text input.
|
|
9575
9575
|
*/
|
|
9576
9576
|
pasteText(e, t) {
|
|
9577
|
-
return
|
|
9577
|
+
return Vt(this, e, null, !0, t || new ClipboardEvent("paste"));
|
|
9578
9578
|
}
|
|
9579
9579
|
/**
|
|
9580
9580
|
Serialize the given slice as it would be if it was copied from
|
|
@@ -9791,7 +9791,7 @@ function lr(n, e, t = !0) {
|
|
|
9791
9791
|
return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
|
|
9792
9792
|
}
|
|
9793
9793
|
function hd(n) {
|
|
9794
|
-
return new
|
|
9794
|
+
return new le({ props: { handleKeyDown: $o(n) } });
|
|
9795
9795
|
}
|
|
9796
9796
|
function $o(n) {
|
|
9797
9797
|
let e = fd(n);
|
|
@@ -9815,7 +9815,7 @@ function $o(n) {
|
|
|
9815
9815
|
return !1;
|
|
9816
9816
|
};
|
|
9817
9817
|
}
|
|
9818
|
-
const
|
|
9818
|
+
const Yr = (n, e) => n.selection.empty ? !1 : (e && e(n.tr.deleteSelection().scrollIntoView()), !0);
|
|
9819
9819
|
function Vo(n, e) {
|
|
9820
9820
|
let { $cursor: t } = n.selection;
|
|
9821
9821
|
return !t || (e ? !e.endOfTextblock("backward", n) : t.parentOffset > 0) ? null : t;
|
|
@@ -9824,21 +9824,21 @@ const Ho = (n, e, t) => {
|
|
|
9824
9824
|
let r = Vo(n, t);
|
|
9825
9825
|
if (!r)
|
|
9826
9826
|
return !1;
|
|
9827
|
-
let i =
|
|
9827
|
+
let i = Xr(r);
|
|
9828
9828
|
if (!i) {
|
|
9829
|
-
let o = r.blockRange(), l = o &&
|
|
9829
|
+
let o = r.blockRange(), l = o && Tt(o);
|
|
9830
9830
|
return l == null ? !1 : (e && e(n.tr.lift(o, l).scrollIntoView()), !0);
|
|
9831
9831
|
}
|
|
9832
9832
|
let s = i.nodeBefore;
|
|
9833
|
-
if (
|
|
9833
|
+
if (Yo(n, i, e, -1))
|
|
9834
9834
|
return !0;
|
|
9835
|
-
if (r.parent.content.size == 0 && (
|
|
9835
|
+
if (r.parent.content.size == 0 && (Ct(s, "end") || S.isSelectable(s)))
|
|
9836
9836
|
for (let o = r.depth; ; o--) {
|
|
9837
9837
|
let l = Bn(n.doc, r.before(o), r.after(o), k.empty);
|
|
9838
9838
|
if (l && l.slice.size < l.to - l.from) {
|
|
9839
9839
|
if (e) {
|
|
9840
9840
|
let a = n.tr.step(l);
|
|
9841
|
-
a.setSelection(
|
|
9841
|
+
a.setSelection(Ct(s, "end") ? v.findFrom(a.doc.resolve(a.mapping.map(i.pos, -1)), -1) : S.create(a.doc, i.pos - s.nodeSize)), e(a.scrollIntoView());
|
|
9842
9842
|
}
|
|
9843
9843
|
return !0;
|
|
9844
9844
|
}
|
|
@@ -9850,7 +9850,7 @@ const Ho = (n, e, t) => {
|
|
|
9850
9850
|
let r = Vo(n, t);
|
|
9851
9851
|
if (!r)
|
|
9852
9852
|
return !1;
|
|
9853
|
-
let i =
|
|
9853
|
+
let i = Xr(r);
|
|
9854
9854
|
return i ? Wo(n, i, e) : !1;
|
|
9855
9855
|
}, md = (n, e, t) => {
|
|
9856
9856
|
let r = jo(n, t);
|
|
@@ -9887,7 +9887,7 @@ function Wo(n, e, t) {
|
|
|
9887
9887
|
}
|
|
9888
9888
|
return !0;
|
|
9889
9889
|
}
|
|
9890
|
-
function
|
|
9890
|
+
function Ct(n, e, t = !1) {
|
|
9891
9891
|
for (let r = n; r; r = e == "start" ? r.firstChild : r.lastChild) {
|
|
9892
9892
|
if (r.isTextblock)
|
|
9893
9893
|
return !0;
|
|
@@ -9903,12 +9903,12 @@ const qo = (n, e, t) => {
|
|
|
9903
9903
|
if (r.parent.isTextblock) {
|
|
9904
9904
|
if (t ? !t.endOfTextblock("backward", n) : r.parentOffset > 0)
|
|
9905
9905
|
return !1;
|
|
9906
|
-
s =
|
|
9906
|
+
s = Xr(r);
|
|
9907
9907
|
}
|
|
9908
9908
|
let o = s && s.nodeBefore;
|
|
9909
9909
|
return !o || !S.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(S.create(n.doc, s.pos - o.nodeSize)).scrollIntoView()), !0);
|
|
9910
9910
|
};
|
|
9911
|
-
function
|
|
9911
|
+
function Xr(n) {
|
|
9912
9912
|
if (!n.parent.type.spec.isolating)
|
|
9913
9913
|
for (let e = n.depth - 1; e >= 0; e--) {
|
|
9914
9914
|
if (n.index(e) > 0)
|
|
@@ -9930,14 +9930,14 @@ const Ko = (n, e, t) => {
|
|
|
9930
9930
|
if (!i)
|
|
9931
9931
|
return !1;
|
|
9932
9932
|
let s = i.nodeAfter;
|
|
9933
|
-
if (
|
|
9933
|
+
if (Yo(n, i, e, 1))
|
|
9934
9934
|
return !0;
|
|
9935
|
-
if (r.parent.content.size == 0 && (
|
|
9935
|
+
if (r.parent.content.size == 0 && (Ct(s, "start") || S.isSelectable(s))) {
|
|
9936
9936
|
let o = Bn(n.doc, r.before(), r.after(), k.empty);
|
|
9937
9937
|
if (o && o.slice.size < o.to - o.from) {
|
|
9938
9938
|
if (e) {
|
|
9939
9939
|
let l = n.tr.step(o);
|
|
9940
|
-
l.setSelection(
|
|
9940
|
+
l.setSelection(Ct(s, "start") ? v.findFrom(l.doc.resolve(l.mapping.map(i.pos)), 1) : S.create(l.doc, l.mapping.map(i.pos))), e(l.scrollIntoView());
|
|
9941
9941
|
}
|
|
9942
9942
|
return !0;
|
|
9943
9943
|
}
|
|
@@ -9989,7 +9989,7 @@ const gd = (n, e) => {
|
|
|
9989
9989
|
return !1;
|
|
9990
9990
|
return e && e(n.tr.join(r).scrollIntoView()), !0;
|
|
9991
9991
|
}, bd = (n, e) => {
|
|
9992
|
-
let { $from: t, $to: r } = n.selection, i = t.blockRange(r), s = i &&
|
|
9992
|
+
let { $from: t, $to: r } = n.selection, i = t.blockRange(r), s = i && Tt(i);
|
|
9993
9993
|
return s == null ? !1 : (e && e(n.tr.lift(i, s).scrollIntoView()), !0);
|
|
9994
9994
|
}, Uo = (n, e) => {
|
|
9995
9995
|
let { $head: t, $anchor: r } = n.selection;
|
|
@@ -10018,7 +10018,7 @@ const kd = (n, e) => {
|
|
|
10018
10018
|
return !0;
|
|
10019
10019
|
}, _o = (n, e) => {
|
|
10020
10020
|
let t = n.selection, { $from: r, $to: i } = t;
|
|
10021
|
-
if (t instanceof
|
|
10021
|
+
if (t instanceof de || r.parent.inlineContent || i.parent.inlineContent)
|
|
10022
10022
|
return !1;
|
|
10023
10023
|
let s = Qr(i.parent.contentMatchAt(i.indexAfter()));
|
|
10024
10024
|
if (!s || !s.isTextblock)
|
|
@@ -10034,17 +10034,17 @@ const kd = (n, e) => {
|
|
|
10034
10034
|
return !1;
|
|
10035
10035
|
if (t.depth > 1 && t.after() != t.end(-1)) {
|
|
10036
10036
|
let s = t.before();
|
|
10037
|
-
if (
|
|
10037
|
+
if (Ne(n.doc, s))
|
|
10038
10038
|
return e && e(n.tr.split(s).scrollIntoView()), !0;
|
|
10039
10039
|
}
|
|
10040
|
-
let r = t.blockRange(), i = r &&
|
|
10040
|
+
let r = t.blockRange(), i = r && Tt(r);
|
|
10041
10041
|
return i == null ? !1 : (e && e(n.tr.lift(r, i).scrollIntoView()), !0);
|
|
10042
10042
|
};
|
|
10043
10043
|
function xd(n) {
|
|
10044
10044
|
return (e, t) => {
|
|
10045
10045
|
let { $from: r, $to: i } = e.selection;
|
|
10046
10046
|
if (e.selection instanceof S && e.selection.node.isBlock)
|
|
10047
|
-
return !r.parentOffset || !
|
|
10047
|
+
return !r.parentOffset || !Ne(e.doc, r.pos) ? !1 : (t && t(e.tr.split(r.pos).scrollIntoView()), !0);
|
|
10048
10048
|
if (!r.depth)
|
|
10049
10049
|
return !1;
|
|
10050
10050
|
let s = [], o, l, a = !1, c = !1;
|
|
@@ -10058,9 +10058,9 @@ function xd(n) {
|
|
|
10058
10058
|
s.unshift(null);
|
|
10059
10059
|
}
|
|
10060
10060
|
let d = e.tr;
|
|
10061
|
-
(e.selection instanceof M || e.selection instanceof
|
|
10062
|
-
let u = d.mapping.map(r.pos), f =
|
|
10063
|
-
if (f || (s[0] = l ? { type: l } : null, f =
|
|
10061
|
+
(e.selection instanceof M || e.selection instanceof de) && d.deleteSelection();
|
|
10062
|
+
let u = d.mapping.map(r.pos), f = Ne(d.doc, u, s.length, s);
|
|
10063
|
+
if (f || (s[0] = l ? { type: l } : null, f = Ne(d.doc, u, s.length, s)), !f)
|
|
10064
10064
|
return !1;
|
|
10065
10065
|
if (d.split(u, s.length, s), !a && c && r.node(o).type != l) {
|
|
10066
10066
|
let h = d.mapping.map(r.before(o)), p = d.doc.resolve(h);
|
|
@@ -10077,7 +10077,7 @@ function wd(n, e, t) {
|
|
|
10077
10077
|
let r = e.nodeBefore, i = e.nodeAfter, s = e.index();
|
|
10078
10078
|
return !r || !i || !r.type.compatibleContent(i.type) ? !1 : !r.content.size && e.parent.canReplace(s - 1, s) ? (t && t(n.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(s, s + 1) || !(i.isTextblock || je(n.doc, e.pos)) ? !1 : (t && t(n.tr.join(e.pos).scrollIntoView()), !0);
|
|
10079
10079
|
}
|
|
10080
|
-
function
|
|
10080
|
+
function Yo(n, e, t, r) {
|
|
10081
10081
|
let i = e.nodeBefore, s = e.nodeAfter, o, l, a = i.type.spec.isolating || s.type.spec.isolating;
|
|
10082
10082
|
if (!a && wd(n, e, t))
|
|
10083
10083
|
return !0;
|
|
@@ -10093,10 +10093,10 @@ function Xo(n, e, t, r) {
|
|
|
10093
10093
|
}
|
|
10094
10094
|
return !0;
|
|
10095
10095
|
}
|
|
10096
|
-
let d = s.type.spec.isolating || r > 0 && a ? null : v.findFrom(e, 1), u = d && d.$from.blockRange(d.$to), f = u &&
|
|
10096
|
+
let d = s.type.spec.isolating || r > 0 && a ? null : v.findFrom(e, 1), u = d && d.$from.blockRange(d.$to), f = u && Tt(u);
|
|
10097
10097
|
if (f != null && f >= e.depth)
|
|
10098
10098
|
return t && t(n.tr.lift(u, f).scrollIntoView()), !0;
|
|
10099
|
-
if (c &&
|
|
10099
|
+
if (c && Ct(s, "start", !0) && Ct(i, "end")) {
|
|
10100
10100
|
let h = i, p = [];
|
|
10101
10101
|
for (; p.push(h), !h.isTextblock; )
|
|
10102
10102
|
h = h.lastChild;
|
|
@@ -10116,7 +10116,7 @@ function Xo(n, e, t, r) {
|
|
|
10116
10116
|
}
|
|
10117
10117
|
return !1;
|
|
10118
10118
|
}
|
|
10119
|
-
function
|
|
10119
|
+
function Xo(n) {
|
|
10120
10120
|
return function(e, t) {
|
|
10121
10121
|
let r = e.selection, i = n < 0 ? r.$from : r.$to, s = i.depth;
|
|
10122
10122
|
for (; i.node(s).isInline; ) {
|
|
@@ -10127,7 +10127,7 @@ function Yo(n) {
|
|
|
10127
10127
|
return i.node(s).isTextblock ? (t && t(e.tr.setSelection(M.create(e.doc, n < 0 ? i.start(s) : i.end(s)))), !0) : !1;
|
|
10128
10128
|
};
|
|
10129
10129
|
}
|
|
10130
|
-
const Cd =
|
|
10130
|
+
const Cd = Xo(-1), Td = Xo(1);
|
|
10131
10131
|
function Od(n, e = null) {
|
|
10132
10132
|
return function(t, r) {
|
|
10133
10133
|
let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = o && $r(o, n, e);
|
|
@@ -10172,8 +10172,8 @@ function ei(...n) {
|
|
|
10172
10172
|
return !1;
|
|
10173
10173
|
};
|
|
10174
10174
|
}
|
|
10175
|
-
ei(
|
|
10176
|
-
ei(
|
|
10175
|
+
ei(Yr, Ho, qo);
|
|
10176
|
+
ei(Yr, Ko, Jo);
|
|
10177
10177
|
ei(Uo, _o, Go, Sd);
|
|
10178
10178
|
typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
|
|
10179
10179
|
function vd(n, e = null) {
|
|
@@ -10206,7 +10206,7 @@ function Nd(n, e, t, r, i) {
|
|
|
10206
10206
|
t[d].type == i && (o = d + 1);
|
|
10207
10207
|
let l = t.length - o, a = e.start + t.length - (r ? 2 : 0), c = e.parent;
|
|
10208
10208
|
for (let d = e.startIndex, u = e.endIndex, f = !0; d < u; d++, f = !1)
|
|
10209
|
-
!f &&
|
|
10209
|
+
!f && Ne(n.doc, a, l) && (n.split(a, l), a += 2 * l), a += c.child(d).nodeSize;
|
|
10210
10210
|
return n;
|
|
10211
10211
|
}
|
|
10212
10212
|
function Ad(n) {
|
|
@@ -10218,7 +10218,7 @@ function Ad(n) {
|
|
|
10218
10218
|
function Dd(n, e, t, r) {
|
|
10219
10219
|
let i = n.tr, s = r.end, o = r.$to.end(r.depth);
|
|
10220
10220
|
s < o && (i.step(new $(s - 1, o, s, o, new k(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new bn(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
|
|
10221
|
-
const l =
|
|
10221
|
+
const l = Tt(r);
|
|
10222
10222
|
if (l == null)
|
|
10223
10223
|
return !1;
|
|
10224
10224
|
i.lift(r, l);
|
|
@@ -10672,7 +10672,7 @@ function rn(n) {
|
|
|
10672
10672
|
}), d;
|
|
10673
10673
|
}
|
|
10674
10674
|
function Vd(n) {
|
|
10675
|
-
const { editor: e, rules: t } = n, r = new
|
|
10675
|
+
const { editor: e, rules: t } = n, r = new le({
|
|
10676
10676
|
state: {
|
|
10677
10677
|
init() {
|
|
10678
10678
|
return null;
|
|
@@ -10755,7 +10755,7 @@ function jn(n, e) {
|
|
|
10755
10755
|
sn(e[r]) && sn(n[r]) ? t[r] = jn(n[r], e[r]) : t[r] = e[r];
|
|
10756
10756
|
}), t;
|
|
10757
10757
|
}
|
|
10758
|
-
class
|
|
10758
|
+
class we {
|
|
10759
10759
|
constructor(e = {}) {
|
|
10760
10760
|
this.type = "mark", this.name = "mark", this.parent = null, this.child = null, this.config = {
|
|
10761
10761
|
name: this.name,
|
|
@@ -10771,7 +10771,7 @@ class Me {
|
|
|
10771
10771
|
})) || {};
|
|
10772
10772
|
}
|
|
10773
10773
|
static create(e = {}) {
|
|
10774
|
-
return new
|
|
10774
|
+
return new we(e);
|
|
10775
10775
|
}
|
|
10776
10776
|
configure(e = {}) {
|
|
10777
10777
|
const t = this.extend({
|
|
@@ -10781,7 +10781,7 @@ class Me {
|
|
|
10781
10781
|
return t.name = this.name, t.parent = this.parent, t;
|
|
10782
10782
|
}
|
|
10783
10783
|
extend(e = {}) {
|
|
10784
|
-
const t = new
|
|
10784
|
+
const t = new we(e);
|
|
10785
10785
|
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = E(x(t, "addOptions", {
|
|
10786
10786
|
name: t.name
|
|
10787
10787
|
})), t.storage = E(x(t, "addStorage", {
|
|
@@ -10885,7 +10885,7 @@ function Ud(n) {
|
|
|
10885
10885
|
return o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, m;
|
|
10886
10886
|
}
|
|
10887
10887
|
};
|
|
10888
|
-
return t.map((d) => new
|
|
10888
|
+
return t.map((d) => new le({
|
|
10889
10889
|
// we register a global drag handler to track the current drag source element
|
|
10890
10890
|
view(u) {
|
|
10891
10891
|
const f = (p) => {
|
|
@@ -11024,7 +11024,7 @@ class gt {
|
|
|
11024
11024
|
type: ar(o.name, this.schema)
|
|
11025
11025
|
}, a = [], c = x(o, "addKeyboardShortcuts", l);
|
|
11026
11026
|
let d = {};
|
|
11027
|
-
if (o.type === "mark" && x(o, "exitable", l) && (d.ArrowRight = () =>
|
|
11027
|
+
if (o.type === "mark" && x(o, "exitable", l) && (d.ArrowRight = () => we.handleExit({ editor: e, mark: o })), c) {
|
|
11028
11028
|
const m = Object.fromEntries(Object.entries(c()).map(([g, y]) => [g, () => y({ editor: e })]));
|
|
11029
11029
|
d = { ...d, ...m };
|
|
11030
11030
|
}
|
|
@@ -11182,8 +11182,8 @@ const Gd = G.create({
|
|
|
11182
11182
|
},
|
|
11183
11183
|
addProseMirrorPlugins() {
|
|
11184
11184
|
return [
|
|
11185
|
-
new
|
|
11186
|
-
key: new
|
|
11185
|
+
new le({
|
|
11186
|
+
key: new Ce("clipboardTextSerializer"),
|
|
11187
11187
|
props: {
|
|
11188
11188
|
clipboardTextSerializer: () => {
|
|
11189
11189
|
const { editor: n } = this, { state: e, schema: t } = n, { doc: r, selection: i } = e, { ranges: s } = i, o = Math.min(...s.map((d) => d.$from.pos)), l = Math.max(...s.map((d) => d.$to.pos)), a = tl(t);
|
|
@@ -11196,10 +11196,10 @@ const Gd = G.create({
|
|
|
11196
11196
|
})
|
|
11197
11197
|
];
|
|
11198
11198
|
}
|
|
11199
|
-
}),
|
|
11199
|
+
}), Yd = () => ({ editor: n, view: e }) => (requestAnimationFrame(() => {
|
|
11200
11200
|
var t;
|
|
11201
11201
|
n.isDestroyed || (e.dom.blur(), (t = window == null ? void 0 : window.getSelection()) === null || t === void 0 || t.removeAllRanges());
|
|
11202
|
-
}), !0),
|
|
11202
|
+
}), !0), Xd = (n = !1) => ({ commands: e }) => e.setContent("", n), Zd = () => ({ state: n, tr: e, dispatch: t }) => {
|
|
11203
11203
|
const { selection: r } = e, { ranges: i } = r;
|
|
11204
11204
|
return t && i.forEach(({ $from: s, $to: o }) => {
|
|
11205
11205
|
n.doc.nodesBetween(s.pos, o.pos, (l, a) => {
|
|
@@ -11208,7 +11208,7 @@ const Gd = G.create({
|
|
|
11208
11208
|
const { doc: c, mapping: d } = e, u = c.resolve(d.map(a)), f = c.resolve(d.map(a + l.nodeSize)), h = u.blockRange(f);
|
|
11209
11209
|
if (!h)
|
|
11210
11210
|
return;
|
|
11211
|
-
const p =
|
|
11211
|
+
const p = Tt(h);
|
|
11212
11212
|
if (l.type.isTextblock) {
|
|
11213
11213
|
const { defaultType: m } = u.parent.contentMatchAt(u.index());
|
|
11214
11214
|
e.setNodeMarkup(h.start, m);
|
|
@@ -11249,7 +11249,7 @@ const Gd = G.create({
|
|
|
11249
11249
|
}, iu = (n) => ({ tr: e, dispatch: t }) => {
|
|
11250
11250
|
const { from: r, to: i } = n;
|
|
11251
11251
|
return t && e.delete(r, i), !0;
|
|
11252
|
-
}, su = () => ({ state: n, dispatch: e }) =>
|
|
11252
|
+
}, su = () => ({ state: n, dispatch: e }) => Yr(n, e), ou = () => ({ commands: n }) => n.keyboardShortcut("Enter"), lu = () => ({ state: n, dispatch: e }) => kd(n, e);
|
|
11253
11253
|
function On(n, e, t = { strict: !0 }) {
|
|
11254
11254
|
const r = Object.keys(e);
|
|
11255
11255
|
return r.length ? r.every((i) => t.strict ? e[i] === n[i] : ni(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
|
|
@@ -11309,7 +11309,7 @@ const au = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11309
11309
|
function rl(n) {
|
|
11310
11310
|
return n instanceof M;
|
|
11311
11311
|
}
|
|
11312
|
-
function
|
|
11312
|
+
function Xe(n = 0, e = 0, t = 0) {
|
|
11313
11313
|
return Math.min(Math.max(n, e), t);
|
|
11314
11314
|
}
|
|
11315
11315
|
function il(n, e = null) {
|
|
@@ -11321,7 +11321,7 @@ function il(n, e = null) {
|
|
|
11321
11321
|
if (e === "end")
|
|
11322
11322
|
return r;
|
|
11323
11323
|
const i = t.from, s = r.to;
|
|
11324
|
-
return e === "all" ? M.create(n,
|
|
11324
|
+
return e === "all" ? M.create(n, Xe(0, i, s), Xe(n.content.size, i, s)) : M.create(n, Xe(e, i, s), Xe(e, i, s));
|
|
11325
11325
|
}
|
|
11326
11326
|
function fs() {
|
|
11327
11327
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
@@ -11367,7 +11367,7 @@ function ln(n) {
|
|
|
11367
11367
|
const e = `<body>${n}</body>`, t = new window.DOMParser().parseFromString(e, "text/html").body;
|
|
11368
11368
|
return sl(t);
|
|
11369
11369
|
}
|
|
11370
|
-
function
|
|
11370
|
+
function Wt(n, e, t) {
|
|
11371
11371
|
if (n instanceof Fe || n instanceof b)
|
|
11372
11372
|
return n;
|
|
11373
11373
|
t = {
|
|
@@ -11385,7 +11385,7 @@ function Ht(n, e, t) {
|
|
|
11385
11385
|
} catch (s) {
|
|
11386
11386
|
if (t.errorOnInvalidContent)
|
|
11387
11387
|
throw new Error("[tiptap error]: Invalid JSON content", { cause: s });
|
|
11388
|
-
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", n, "Error:", s),
|
|
11388
|
+
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", n, "Error:", s), Wt("", e, t);
|
|
11389
11389
|
}
|
|
11390
11390
|
if (i) {
|
|
11391
11391
|
if (t.errorOnInvalidContent) {
|
|
@@ -11414,7 +11414,7 @@ function Ht(n, e, t) {
|
|
|
11414
11414
|
const s = $e.fromSchema(e);
|
|
11415
11415
|
return t.slice ? s.parseSlice(ln(n), t.parseOptions).content : s.parse(ln(n), t.parseOptions);
|
|
11416
11416
|
}
|
|
11417
|
-
return
|
|
11417
|
+
return Wt("", e, t);
|
|
11418
11418
|
}
|
|
11419
11419
|
function pu(n, e, t) {
|
|
11420
11420
|
const r = n.steps.length - 1;
|
|
@@ -11454,7 +11454,7 @@ const mu = (n) => !("type" in n), gu = (n, e, t) => ({ tr: r, dispatch: i, edito
|
|
|
11454
11454
|
};
|
|
11455
11455
|
if (!t.errorOnInvalidContent && !s.options.enableContentCheck && s.options.emitContentError)
|
|
11456
11456
|
try {
|
|
11457
|
-
|
|
11457
|
+
Wt(e, s.schema, {
|
|
11458
11458
|
parseOptions: c,
|
|
11459
11459
|
errorOnInvalidContent: !0
|
|
11460
11460
|
});
|
|
@@ -11462,7 +11462,7 @@ const mu = (n) => !("type" in n), gu = (n, e, t) => ({ tr: r, dispatch: i, edito
|
|
|
11462
11462
|
a(g);
|
|
11463
11463
|
}
|
|
11464
11464
|
try {
|
|
11465
|
-
l =
|
|
11465
|
+
l = Wt(e, s.schema, {
|
|
11466
11466
|
parseOptions: c,
|
|
11467
11467
|
errorOnInvalidContent: (o = t.errorOnInvalidContent) !== null && o !== void 0 ? o : s.options.enableContentCheck
|
|
11468
11468
|
});
|
|
@@ -11549,7 +11549,7 @@ const Ou = (n) => ({ editor: e, view: t, tr: r, dispatch: i }) => {
|
|
|
11549
11549
|
d && i && r.maybeStep(d);
|
|
11550
11550
|
}), !0;
|
|
11551
11551
|
};
|
|
11552
|
-
function
|
|
11552
|
+
function qt(n, e, t = {}) {
|
|
11553
11553
|
const { from: r, to: i, empty: s } = n.selection, o = e ? H(e, n.schema) : null, l = [];
|
|
11554
11554
|
n.doc.nodesBetween(r, i, (u, f) => {
|
|
11555
11555
|
if (u.isText)
|
|
@@ -11566,7 +11566,7 @@ function Wt(n, e, t = {}) {
|
|
|
11566
11566
|
}
|
|
11567
11567
|
const vu = (n, e = {}) => ({ state: t, dispatch: r }) => {
|
|
11568
11568
|
const i = H(n, t.schema);
|
|
11569
|
-
return
|
|
11569
|
+
return qt(t, i, e) ? bd(t, r) : !1;
|
|
11570
11570
|
}, Eu = () => ({ state: n, dispatch: e }) => Go(n, e), Nu = (n) => ({ state: e, dispatch: t }) => {
|
|
11571
11571
|
const r = H(n, e.schema);
|
|
11572
11572
|
return Ad(r)(e, t);
|
|
@@ -11590,13 +11590,13 @@ const Du = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11590
11590
|
}), !0) : !1;
|
|
11591
11591
|
}, Iu = () => ({ tr: n, dispatch: e }) => (e && n.scrollIntoView(), !0), Ru = () => ({ tr: n, dispatch: e }) => {
|
|
11592
11592
|
if (e) {
|
|
11593
|
-
const t = new
|
|
11593
|
+
const t = new de(n.doc);
|
|
11594
11594
|
n.setSelection(t);
|
|
11595
11595
|
}
|
|
11596
11596
|
return !0;
|
|
11597
11597
|
}, Pu = () => ({ state: n, dispatch: e }) => qo(n, e), Bu = () => ({ state: n, dispatch: e }) => Jo(n, e), Lu = () => ({ state: n, dispatch: e }) => Md(n, e), zu = () => ({ state: n, dispatch: e }) => Td(n, e), Fu = () => ({ state: n, dispatch: e }) => Cd(n, e);
|
|
11598
11598
|
function Rr(n, e, t = {}, r = {}) {
|
|
11599
|
-
return
|
|
11599
|
+
return Wt(n, e, {
|
|
11600
11600
|
slice: !1,
|
|
11601
11601
|
parseOptions: t,
|
|
11602
11602
|
errorOnInvalidContent: r.errorOnInvalidContent
|
|
@@ -11713,9 +11713,9 @@ function Pr(n, e, t = {}) {
|
|
|
11713
11713
|
}
|
|
11714
11714
|
function Ku(n, e, t = {}) {
|
|
11715
11715
|
if (!e)
|
|
11716
|
-
return
|
|
11716
|
+
return qt(n, null, t) || Pr(n, null, t);
|
|
11717
11717
|
const r = Kn(e, n.schema);
|
|
11718
|
-
return r === "node" ?
|
|
11718
|
+
return r === "node" ? qt(n, e, t) : r === "mark" ? Pr(n, e, t) : !1;
|
|
11719
11719
|
}
|
|
11720
11720
|
function ps(n, e) {
|
|
11721
11721
|
const { nodeExtensions: t } = Wn(e), r = t.find((o) => o.name === n);
|
|
@@ -11798,19 +11798,19 @@ const _u = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11798
11798
|
});
|
|
11799
11799
|
});
|
|
11800
11800
|
return Uu(r, t, a);
|
|
11801
|
-
}, Gu = (n, e) => ({ tr: t }) => (t.setMeta(n, e), !0),
|
|
11801
|
+
}, Gu = (n, e) => ({ tr: t }) => (t.setMeta(n, e), !0), Yu = (n, e = {}) => ({ state: t, dispatch: r, chain: i }) => {
|
|
11802
11802
|
const s = H(n, t.schema);
|
|
11803
11803
|
let o;
|
|
11804
11804
|
return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) => ls(s, { ...o, ...e })(t) ? !0 : l.clearNodes()).command(({ state: l }) => ls(s, { ...o, ...e })(l, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
|
|
11805
|
-
},
|
|
11805
|
+
}, Xu = (n) => ({ tr: e, dispatch: t }) => {
|
|
11806
11806
|
if (t) {
|
|
11807
|
-
const { doc: r } = e, i =
|
|
11807
|
+
const { doc: r } = e, i = Xe(n, 0, r.content.size), s = S.create(r, i);
|
|
11808
11808
|
e.setSelection(s);
|
|
11809
11809
|
}
|
|
11810
11810
|
return !0;
|
|
11811
11811
|
}, Zu = (n) => ({ tr: e, dispatch: t }) => {
|
|
11812
11812
|
if (t) {
|
|
11813
|
-
const { doc: r } = e, { from: i, to: s } = typeof n == "number" ? { from: n, to: n } : n, o = M.atStart(r).from, l = M.atEnd(r).to, a =
|
|
11813
|
+
const { doc: r } = e, { from: i, to: s } = typeof n == "number" ? { from: n, to: n } : n, o = M.atStart(r).from, l = M.atEnd(r).to, a = Xe(i, o, l), c = Xe(s, o, l), d = M.create(r, a, c);
|
|
11814
11814
|
e.setSelection(d);
|
|
11815
11815
|
}
|
|
11816
11816
|
return !0;
|
|
@@ -11828,7 +11828,7 @@ function ms(n, e) {
|
|
|
11828
11828
|
const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
|
|
11829
11829
|
const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, d = un(c, l.node().type.name, l.node().attrs);
|
|
11830
11830
|
if (s instanceof S && s.node.isBlock)
|
|
11831
|
-
return !l.parentOffset || !
|
|
11831
|
+
return !l.parentOffset || !Ne(o, l.pos) ? !1 : (r && (n && ms(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
|
|
11832
11832
|
if (!l.parent.isBlock)
|
|
11833
11833
|
return !1;
|
|
11834
11834
|
const u = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : Vu(l.node(-1).contentMatchAt(l.indexAfter(-1)));
|
|
@@ -11837,8 +11837,8 @@ const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11837
11837
|
type: f,
|
|
11838
11838
|
attrs: d
|
|
11839
11839
|
}
|
|
11840
|
-
] : void 0, p =
|
|
11841
|
-
if (!h && !p &&
|
|
11840
|
+
] : void 0, p = Ne(e.doc, e.mapping.map(l.pos), 1, h);
|
|
11841
|
+
if (!h && !p && Ne(e.doc, e.mapping.map(l.pos), 1, f ? [{ type: f }] : void 0) && (p = !0, h = f ? [
|
|
11842
11842
|
{
|
|
11843
11843
|
type: f,
|
|
11844
11844
|
attrs: d
|
|
@@ -11876,10 +11876,10 @@ const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11876
11876
|
const L = a.before(a.depth - (T - 1));
|
|
11877
11877
|
t.replace(L, a.after(-w), new k(y, 4 - T, 0));
|
|
11878
11878
|
let C = -1;
|
|
11879
|
-
t.doc.nodesBetween(L, t.doc.content.size, (N,
|
|
11879
|
+
t.doc.nodesBetween(L, t.doc.content.size, (N, Y) => {
|
|
11880
11880
|
if (C > -1)
|
|
11881
11881
|
return !1;
|
|
11882
|
-
N.isTextblock && N.content.size === 0 && (C =
|
|
11882
|
+
N.isTextblock && N.content.size === 0 && (C = Y + 1);
|
|
11883
11883
|
}), C > -1 && t.setSelection(M.near(t.doc.resolve(C))), t.scrollIntoView();
|
|
11884
11884
|
}
|
|
11885
11885
|
return !0;
|
|
@@ -11896,7 +11896,7 @@ const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11896
11896
|
{ type: l, attrs: p },
|
|
11897
11897
|
{ type: h, attrs: m }
|
|
11898
11898
|
] : [{ type: l, attrs: p }];
|
|
11899
|
-
if (!
|
|
11899
|
+
if (!Ne(t.doc, a.pos, 2))
|
|
11900
11900
|
return !1;
|
|
11901
11901
|
if (i) {
|
|
11902
11902
|
const { selection: y, storedMarks: T } = r, { splittableMarks: w } = s.extensionManager, I = T || y.$to.parentOffset && y.$from.marks();
|
|
@@ -11943,12 +11943,12 @@ const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11943
11943
|
const { extendEmptyMarkRange: s = !1 } = t, o = Je(n, r.schema);
|
|
11944
11944
|
return Pr(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
|
|
11945
11945
|
}, sf = (n, e, t = {}) => ({ state: r, commands: i }) => {
|
|
11946
|
-
const s = H(n, r.schema), o = H(e, r.schema), l =
|
|
11946
|
+
const s = H(n, r.schema), o = H(e, r.schema), l = qt(r, s, t);
|
|
11947
11947
|
let a;
|
|
11948
11948
|
return r.selection.$anchor.sameParent(r.selection.$head) && (a = r.selection.$anchor.parent.attrs), l ? i.setNode(o, a) : i.setNode(s, { ...a, ...t });
|
|
11949
11949
|
}, of = (n, e = {}) => ({ state: t, commands: r }) => {
|
|
11950
11950
|
const i = H(n, t.schema);
|
|
11951
|
-
return
|
|
11951
|
+
return qt(t, i, e) ? r.lift(i) : r.wrapIn(i, e);
|
|
11952
11952
|
}, lf = () => ({ state: n, dispatch: e }) => {
|
|
11953
11953
|
const t = n.plugins;
|
|
11954
11954
|
for (let r = 0; r < t.length; r += 1) {
|
|
@@ -12028,8 +12028,8 @@ const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
12028
12028
|
};
|
|
12029
12029
|
var hf = /* @__PURE__ */ Object.freeze({
|
|
12030
12030
|
__proto__: null,
|
|
12031
|
-
blur:
|
|
12032
|
-
clearContent:
|
|
12031
|
+
blur: Yd,
|
|
12032
|
+
clearContent: Xd,
|
|
12033
12033
|
clearNodes: Zd,
|
|
12034
12034
|
command: Qd,
|
|
12035
12035
|
createParagraphNear: eu,
|
|
@@ -12070,8 +12070,8 @@ var hf = /* @__PURE__ */ Object.freeze({
|
|
|
12070
12070
|
setContent: $u,
|
|
12071
12071
|
setMark: _u,
|
|
12072
12072
|
setMeta: Gu,
|
|
12073
|
-
setNode:
|
|
12074
|
-
setNodeSelection:
|
|
12073
|
+
setNode: Yu,
|
|
12074
|
+
setNodeSelection: Xu,
|
|
12075
12075
|
setTextSelection: Zu,
|
|
12076
12076
|
sinkListItem: Qu,
|
|
12077
12077
|
splitBlock: ef,
|
|
@@ -12098,8 +12098,8 @@ const pf = G.create({
|
|
|
12098
12098
|
name: "drop",
|
|
12099
12099
|
addProseMirrorPlugins() {
|
|
12100
12100
|
return [
|
|
12101
|
-
new
|
|
12102
|
-
key: new
|
|
12101
|
+
new le({
|
|
12102
|
+
key: new Ce("tiptapDrop"),
|
|
12103
12103
|
props: {
|
|
12104
12104
|
handleDrop: (n, e, t, r) => {
|
|
12105
12105
|
this.editor.emit("drop", {
|
|
@@ -12117,20 +12117,20 @@ const pf = G.create({
|
|
|
12117
12117
|
name: "editable",
|
|
12118
12118
|
addProseMirrorPlugins() {
|
|
12119
12119
|
return [
|
|
12120
|
-
new
|
|
12121
|
-
key: new
|
|
12120
|
+
new le({
|
|
12121
|
+
key: new Ce("editable"),
|
|
12122
12122
|
props: {
|
|
12123
12123
|
editable: () => this.editor.options.editable
|
|
12124
12124
|
}
|
|
12125
12125
|
})
|
|
12126
12126
|
];
|
|
12127
12127
|
}
|
|
12128
|
-
}), yf = new
|
|
12128
|
+
}), yf = new Ce("focusEvents"), bf = G.create({
|
|
12129
12129
|
name: "focusEvents",
|
|
12130
12130
|
addProseMirrorPlugins() {
|
|
12131
12131
|
const { editor: n } = this;
|
|
12132
12132
|
return [
|
|
12133
|
-
new
|
|
12133
|
+
new le({
|
|
12134
12134
|
key: yf,
|
|
12135
12135
|
props: {
|
|
12136
12136
|
handleDOMEvents: {
|
|
@@ -12203,8 +12203,8 @@ const pf = G.create({
|
|
|
12203
12203
|
// to a paragraph if necessary.
|
|
12204
12204
|
// This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
|
|
12205
12205
|
// with many other commands.
|
|
12206
|
-
new
|
|
12207
|
-
key: new
|
|
12206
|
+
new le({
|
|
12207
|
+
key: new Ce("clearDocument"),
|
|
12208
12208
|
appendTransaction: (n, e, t) => {
|
|
12209
12209
|
if (n.some((m) => m.getMeta("composition")))
|
|
12210
12210
|
return;
|
|
@@ -12231,8 +12231,8 @@ const pf = G.create({
|
|
|
12231
12231
|
name: "paste",
|
|
12232
12232
|
addProseMirrorPlugins() {
|
|
12233
12233
|
return [
|
|
12234
|
-
new
|
|
12235
|
-
key: new
|
|
12234
|
+
new le({
|
|
12235
|
+
key: new Ce("tiptapPaste"),
|
|
12236
12236
|
props: {
|
|
12237
12237
|
handlePaste: (n, e, t) => {
|
|
12238
12238
|
this.editor.emit("paste", {
|
|
@@ -12249,8 +12249,8 @@ const pf = G.create({
|
|
|
12249
12249
|
name: "tabindex",
|
|
12250
12250
|
addProseMirrorPlugins() {
|
|
12251
12251
|
return [
|
|
12252
|
-
new
|
|
12253
|
-
key: new
|
|
12252
|
+
new le({
|
|
12253
|
+
key: new Ce("tabindex"),
|
|
12254
12254
|
props: {
|
|
12255
12255
|
attributes: () => this.editor.isEditable ? { tabindex: "0" } : {}
|
|
12256
12256
|
}
|
|
@@ -12864,7 +12864,7 @@ function Br(n) {
|
|
|
12864
12864
|
}
|
|
12865
12865
|
});
|
|
12866
12866
|
}
|
|
12867
|
-
function
|
|
12867
|
+
function jt(n) {
|
|
12868
12868
|
return new qn({
|
|
12869
12869
|
find: n.find,
|
|
12870
12870
|
handler: ({ state: e, range: t, match: r, chain: i }) => {
|
|
@@ -12887,7 +12887,7 @@ function qt(n) {
|
|
|
12887
12887
|
}
|
|
12888
12888
|
});
|
|
12889
12889
|
}
|
|
12890
|
-
class
|
|
12890
|
+
class re {
|
|
12891
12891
|
constructor(e = {}) {
|
|
12892
12892
|
this.type = "node", this.name = "node", this.parent = null, this.child = null, this.config = {
|
|
12893
12893
|
name: this.name,
|
|
@@ -12903,7 +12903,7 @@ class ne {
|
|
|
12903
12903
|
})) || {};
|
|
12904
12904
|
}
|
|
12905
12905
|
static create(e = {}) {
|
|
12906
|
-
return new
|
|
12906
|
+
return new re(e);
|
|
12907
12907
|
}
|
|
12908
12908
|
configure(e = {}) {
|
|
12909
12909
|
const t = this.extend({
|
|
@@ -12913,7 +12913,7 @@ class ne {
|
|
|
12913
12913
|
return t.name = this.name, t.parent = this.parent, t;
|
|
12914
12914
|
}
|
|
12915
12915
|
extend(e = {}) {
|
|
12916
|
-
const t = new
|
|
12916
|
+
const t = new re(e);
|
|
12917
12917
|
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = E(x(t, "addOptions", {
|
|
12918
12918
|
name: t.name
|
|
12919
12919
|
})), t.storage = E(x(t, "addStorage", {
|
|
@@ -12955,7 +12955,7 @@ function Tf(n, e) {
|
|
|
12955
12955
|
}
|
|
12956
12956
|
return !1;
|
|
12957
12957
|
}
|
|
12958
|
-
const Of = /^\s*>\s$/, vf =
|
|
12958
|
+
const Of = /^\s*>\s$/, vf = re.create({
|
|
12959
12959
|
name: "blockquote",
|
|
12960
12960
|
addOptions() {
|
|
12961
12961
|
return {
|
|
@@ -12987,13 +12987,13 @@ const Of = /^\s*>\s$/, vf = ne.create({
|
|
|
12987
12987
|
},
|
|
12988
12988
|
addInputRules() {
|
|
12989
12989
|
return [
|
|
12990
|
-
|
|
12990
|
+
jt({
|
|
12991
12991
|
find: Of,
|
|
12992
12992
|
type: this.type
|
|
12993
12993
|
})
|
|
12994
12994
|
];
|
|
12995
12995
|
}
|
|
12996
|
-
}), Ef = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Nf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, Af = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, Df = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, If =
|
|
12996
|
+
}), Ef = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Nf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, Af = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, Df = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, If = we.create({
|
|
12997
12997
|
name: "bold",
|
|
12998
12998
|
addOptions() {
|
|
12999
12999
|
return {
|
|
@@ -13059,7 +13059,7 @@ const Of = /^\s*>\s$/, vf = ne.create({
|
|
|
13059
13059
|
})
|
|
13060
13060
|
];
|
|
13061
13061
|
}
|
|
13062
|
-
}), Rf = "listItem", gs = "textStyle", ys = /^\s*([-+*])\s$/, Pf =
|
|
13062
|
+
}), Rf = "listItem", gs = "textStyle", ys = /^\s*([-+*])\s$/, Pf = re.create({
|
|
13063
13063
|
name: "bulletList",
|
|
13064
13064
|
addOptions() {
|
|
13065
13065
|
return {
|
|
@@ -13092,11 +13092,11 @@ const Of = /^\s*>\s$/, vf = ne.create({
|
|
|
13092
13092
|
};
|
|
13093
13093
|
},
|
|
13094
13094
|
addInputRules() {
|
|
13095
|
-
let n =
|
|
13095
|
+
let n = jt({
|
|
13096
13096
|
find: ys,
|
|
13097
13097
|
type: this.type
|
|
13098
13098
|
});
|
|
13099
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (n =
|
|
13099
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (n = jt({
|
|
13100
13100
|
find: ys,
|
|
13101
13101
|
type: this.type,
|
|
13102
13102
|
keepMarks: this.options.keepMarks,
|
|
@@ -13107,7 +13107,7 @@ const Of = /^\s*>\s$/, vf = ne.create({
|
|
|
13107
13107
|
n
|
|
13108
13108
|
];
|
|
13109
13109
|
}
|
|
13110
|
-
}), Bf = /(^|[^`])`([^`]+)`(?!`)/, Lf = /(^|[^`])`([^`]+)`(?!`)/g, zf =
|
|
13110
|
+
}), Bf = /(^|[^`])`([^`]+)`(?!`)/, Lf = /(^|[^`])`([^`]+)`(?!`)/g, zf = we.create({
|
|
13111
13111
|
name: "code",
|
|
13112
13112
|
addOptions() {
|
|
13113
13113
|
return {
|
|
@@ -13153,7 +13153,7 @@ const Of = /^\s*>\s$/, vf = ne.create({
|
|
|
13153
13153
|
})
|
|
13154
13154
|
];
|
|
13155
13155
|
}
|
|
13156
|
-
}), Ff = /^```([a-z]+)?[\s\n]$/, $f = /^~~~([a-z]+)?[\s\n]$/, Vf =
|
|
13156
|
+
}), Ff = /^```([a-z]+)?[\s\n]$/, $f = /^~~~([a-z]+)?[\s\n]$/, Vf = re.create({
|
|
13157
13157
|
name: "codeBlock",
|
|
13158
13158
|
addOptions() {
|
|
13159
13159
|
return {
|
|
@@ -13263,8 +13263,8 @@ const Of = /^\s*>\s$/, vf = ne.create({
|
|
|
13263
13263
|
return [
|
|
13264
13264
|
// this plugin creates a code block for pasted content from VS Code
|
|
13265
13265
|
// we can also detect the copied code language
|
|
13266
|
-
new
|
|
13267
|
-
key: new
|
|
13266
|
+
new le({
|
|
13267
|
+
key: new Ce("codeBlockVSCodeHandler"),
|
|
13268
13268
|
props: {
|
|
13269
13269
|
handlePaste: (n, e) => {
|
|
13270
13270
|
if (!e.clipboardData || this.editor.isActive(this.type.name))
|
|
@@ -13280,13 +13280,13 @@ const Of = /^\s*>\s$/, vf = ne.create({
|
|
|
13280
13280
|
})
|
|
13281
13281
|
];
|
|
13282
13282
|
}
|
|
13283
|
-
}), Hf =
|
|
13283
|
+
}), Hf = re.create({
|
|
13284
13284
|
name: "doc",
|
|
13285
13285
|
topNode: !0,
|
|
13286
13286
|
content: "block+"
|
|
13287
13287
|
});
|
|
13288
13288
|
function Wf(n = {}) {
|
|
13289
|
-
return new
|
|
13289
|
+
return new le({
|
|
13290
13290
|
view(e) {
|
|
13291
13291
|
return new qf(e, n);
|
|
13292
13292
|
}
|
|
@@ -13350,7 +13350,7 @@ class qf {
|
|
|
13350
13350
|
if (t && !s) {
|
|
13351
13351
|
let o = t.pos;
|
|
13352
13352
|
if (this.editorView.dragging && this.editorView.dragging.slice) {
|
|
13353
|
-
let l =
|
|
13353
|
+
let l = Ys(this.editorView.state.doc, o, this.editorView.dragging.slice);
|
|
13354
13354
|
l != null && (o = l);
|
|
13355
13355
|
}
|
|
13356
13356
|
this.setCursor(o), this.scheduleRemoval(5e3);
|
|
@@ -13519,15 +13519,15 @@ function Jf(n) {
|
|
|
13519
13519
|
return !0;
|
|
13520
13520
|
}
|
|
13521
13521
|
function Uf() {
|
|
13522
|
-
return new
|
|
13522
|
+
return new le({
|
|
13523
13523
|
props: {
|
|
13524
|
-
decorations:
|
|
13524
|
+
decorations: Xf,
|
|
13525
13525
|
createSelectionBetween(n, e, t) {
|
|
13526
13526
|
return e.pos == t.pos && R.valid(t) ? new R(t) : null;
|
|
13527
13527
|
},
|
|
13528
13528
|
handleClick: Gf,
|
|
13529
13529
|
handleKeyDown: _f,
|
|
13530
|
-
handleDOMEvents: { beforeinput:
|
|
13530
|
+
handleDOMEvents: { beforeinput: Yf }
|
|
13531
13531
|
}
|
|
13532
13532
|
});
|
|
13533
13533
|
}
|
|
@@ -13559,7 +13559,7 @@ function Gf(n, e, t) {
|
|
|
13559
13559
|
let i = n.posAtCoords({ left: t.clientX, top: t.clientY });
|
|
13560
13560
|
return i && i.inside > -1 && S.isSelectable(n.state.doc.nodeAt(i.inside)) ? !1 : (n.dispatch(n.state.tr.setSelection(new R(r))), !0);
|
|
13561
13561
|
}
|
|
13562
|
-
function
|
|
13562
|
+
function Yf(n, e) {
|
|
13563
13563
|
if (e.inputType != "insertCompositionText" || !(n.state.selection instanceof R))
|
|
13564
13564
|
return !1;
|
|
13565
13565
|
let { $from: t } = n.state.selection, r = t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);
|
|
@@ -13571,7 +13571,7 @@ function Xf(n, e) {
|
|
|
13571
13571
|
let s = n.state.tr.replace(t.pos, t.pos, new k(i, 0, 0));
|
|
13572
13572
|
return s.setSelection(M.near(s.doc.resolve(t.pos + 1))), n.dispatch(s), !1;
|
|
13573
13573
|
}
|
|
13574
|
-
function
|
|
13574
|
+
function Xf(n) {
|
|
13575
13575
|
if (!(n.selection instanceof R))
|
|
13576
13576
|
return null;
|
|
13577
13577
|
let e = document.createElement("div");
|
|
@@ -13595,7 +13595,7 @@ const Zf = G.create({
|
|
|
13595
13595
|
allowGapCursor: (e = E(x(n, "allowGapCursor", t))) !== null && e !== void 0 ? e : null
|
|
13596
13596
|
};
|
|
13597
13597
|
}
|
|
13598
|
-
}), Qf =
|
|
13598
|
+
}), Qf = re.create({
|
|
13599
13599
|
name: "hardBreak",
|
|
13600
13600
|
addOptions() {
|
|
13601
13601
|
return {
|
|
@@ -13645,7 +13645,7 @@ const Zf = G.create({
|
|
|
13645
13645
|
"Shift-Enter": () => this.editor.commands.setHardBreak()
|
|
13646
13646
|
};
|
|
13647
13647
|
}
|
|
13648
|
-
}), eh =
|
|
13648
|
+
}), eh = re.create({
|
|
13649
13649
|
name: "heading",
|
|
13650
13650
|
addOptions() {
|
|
13651
13651
|
return {
|
|
@@ -13837,7 +13837,7 @@ class ge {
|
|
|
13837
13837
|
return c > ih && (l = rh(l, c), o -= c), new ge(l.append(s), o);
|
|
13838
13838
|
}
|
|
13839
13839
|
remapping(e, t) {
|
|
13840
|
-
let r = new
|
|
13840
|
+
let r = new zt();
|
|
13841
13841
|
return this.items.forEach((i, s) => {
|
|
13842
13842
|
let o = i.mirrorOffset != null && s - i.mirrorOffset >= e ? r.maps.length - i.mirrorOffset : void 0;
|
|
13843
13843
|
r.appendMap(i.map, o);
|
|
@@ -13993,12 +13993,12 @@ function fn(n) {
|
|
|
13993
13993
|
}
|
|
13994
13994
|
return fr;
|
|
13995
13995
|
}
|
|
13996
|
-
const rt = new
|
|
13996
|
+
const rt = new Ce("history"), ah = new Ce("closeHistory");
|
|
13997
13997
|
function ch(n = {}) {
|
|
13998
13998
|
return n = {
|
|
13999
13999
|
depth: n.depth || 100,
|
|
14000
14000
|
newGroupDelay: n.newGroupDelay || 500
|
|
14001
|
-
}, new
|
|
14001
|
+
}, new le({
|
|
14002
14002
|
key: rt,
|
|
14003
14003
|
state: {
|
|
14004
14004
|
init() {
|
|
@@ -14060,7 +14060,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
|
|
|
14060
14060
|
"Shift-Mod-я": () => this.editor.commands.redo()
|
|
14061
14061
|
};
|
|
14062
14062
|
}
|
|
14063
|
-
}), uh =
|
|
14063
|
+
}), uh = re.create({
|
|
14064
14064
|
name: "horizontalRule",
|
|
14065
14065
|
addOptions() {
|
|
14066
14066
|
return {
|
|
@@ -14112,7 +14112,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
|
|
|
14112
14112
|
})
|
|
14113
14113
|
];
|
|
14114
14114
|
}
|
|
14115
|
-
}), fh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, hh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, ph = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, mh = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, gh =
|
|
14115
|
+
}), fh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, hh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, ph = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, mh = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, gh = we.create({
|
|
14116
14116
|
name: "italic",
|
|
14117
14117
|
addOptions() {
|
|
14118
14118
|
return {
|
|
@@ -14177,7 +14177,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
|
|
|
14177
14177
|
})
|
|
14178
14178
|
];
|
|
14179
14179
|
}
|
|
14180
|
-
}), yh =
|
|
14180
|
+
}), yh = re.create({
|
|
14181
14181
|
name: "listItem",
|
|
14182
14182
|
addOptions() {
|
|
14183
14183
|
return {
|
|
@@ -14205,7 +14205,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
|
|
|
14205
14205
|
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
|
|
14206
14206
|
};
|
|
14207
14207
|
}
|
|
14208
|
-
}), bh = "listItem", xs = "textStyle", Ss = /^(\d+)\.\s$/, kh =
|
|
14208
|
+
}), bh = "listItem", xs = "textStyle", Ss = /^(\d+)\.\s$/, kh = re.create({
|
|
14209
14209
|
name: "orderedList",
|
|
14210
14210
|
addOptions() {
|
|
14211
14211
|
return {
|
|
@@ -14253,13 +14253,13 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
|
|
|
14253
14253
|
};
|
|
14254
14254
|
},
|
|
14255
14255
|
addInputRules() {
|
|
14256
|
-
let n =
|
|
14256
|
+
let n = jt({
|
|
14257
14257
|
find: Ss,
|
|
14258
14258
|
type: this.type,
|
|
14259
14259
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
14260
14260
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1]
|
|
14261
14261
|
});
|
|
14262
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (n =
|
|
14262
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (n = jt({
|
|
14263
14263
|
find: Ss,
|
|
14264
14264
|
type: this.type,
|
|
14265
14265
|
keepMarks: this.options.keepMarks,
|
|
@@ -14271,7 +14271,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
|
|
|
14271
14271
|
n
|
|
14272
14272
|
];
|
|
14273
14273
|
}
|
|
14274
|
-
}), xh =
|
|
14274
|
+
}), xh = re.create({
|
|
14275
14275
|
name: "paragraph",
|
|
14276
14276
|
priority: 1e3,
|
|
14277
14277
|
addOptions() {
|
|
@@ -14299,7 +14299,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
|
|
|
14299
14299
|
"Mod-Alt-0": () => this.editor.commands.setParagraph()
|
|
14300
14300
|
};
|
|
14301
14301
|
}
|
|
14302
|
-
}), Sh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, Mh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, wh =
|
|
14302
|
+
}), Sh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, Mh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, wh = we.create({
|
|
14303
14303
|
name: "strike",
|
|
14304
14304
|
addOptions() {
|
|
14305
14305
|
return {
|
|
@@ -14355,7 +14355,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
|
|
|
14355
14355
|
})
|
|
14356
14356
|
];
|
|
14357
14357
|
}
|
|
14358
|
-
}), Ch =
|
|
14358
|
+
}), Ch = re.create({
|
|
14359
14359
|
name: "text",
|
|
14360
14360
|
group: "inline"
|
|
14361
14361
|
}), Th = G.create({
|
|
@@ -14373,7 +14373,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
|
|
|
14373
14373
|
const s = t.getAttribute("style"), o = (i = (r = t.parentElement) === null || r === void 0 ? void 0 : r.closest("span")) === null || i === void 0 ? void 0 : i.getAttribute("style");
|
|
14374
14374
|
t.setAttribute("style", `${o};${s}`);
|
|
14375
14375
|
});
|
|
14376
|
-
}, vh =
|
|
14376
|
+
}, vh = we.create({
|
|
14377
14377
|
name: "textStyle",
|
|
14378
14378
|
priority: 101,
|
|
14379
14379
|
addOptions() {
|
|
@@ -14437,7 +14437,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
|
|
|
14437
14437
|
unsetColor: () => ({ chain: n }) => n().setMark("textStyle", { color: null }).removeEmptyTextStyle().run()
|
|
14438
14438
|
};
|
|
14439
14439
|
}
|
|
14440
|
-
}), Nh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, Ah = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, Dh =
|
|
14440
|
+
}), Nh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, Ah = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, Dh = we.create({
|
|
14441
14441
|
name: "highlight",
|
|
14442
14442
|
addOptions() {
|
|
14443
14443
|
return {
|
|
@@ -14536,7 +14536,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
|
|
|
14536
14536
|
"Mod-Shift-j": () => this.editor.commands.setTextAlign("justify")
|
|
14537
14537
|
};
|
|
14538
14538
|
}
|
|
14539
|
-
}), Rh = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Ph =
|
|
14539
|
+
}), Rh = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Ph = re.create({
|
|
14540
14540
|
name: "image",
|
|
14541
14541
|
addOptions() {
|
|
14542
14542
|
return {
|
|
@@ -14596,25 +14596,25 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
|
|
|
14596
14596
|
];
|
|
14597
14597
|
}
|
|
14598
14598
|
});
|
|
14599
|
-
var
|
|
14599
|
+
var ee, xt, Yt, oe, Lr, ml, Lh, gl, yl, bl;
|
|
14600
14600
|
class Bh extends vl {
|
|
14601
14601
|
constructor() {
|
|
14602
14602
|
super();
|
|
14603
|
-
F(this,
|
|
14604
|
-
F(this,
|
|
14605
|
-
F(this,
|
|
14606
|
-
F(this,
|
|
14603
|
+
F(this, oe);
|
|
14604
|
+
F(this, ee, null);
|
|
14605
|
+
F(this, xt, null);
|
|
14606
|
+
F(this, Yt, null);
|
|
14607
14607
|
}
|
|
14608
14608
|
connectedCallback() {
|
|
14609
|
-
super.connectedCallback() && (q(this,
|
|
14609
|
+
super.connectedCallback() && (q(this, oe, ml).call(this), q(this, oe, gl).call(this), q(this, oe, Lr).call(this));
|
|
14610
14610
|
}
|
|
14611
14611
|
get value() {
|
|
14612
|
-
return O(this,
|
|
14612
|
+
return O(this, ee).getHTML();
|
|
14613
14613
|
}
|
|
14614
14614
|
set value(t) {
|
|
14615
14615
|
let r = t || "";
|
|
14616
14616
|
r && !/<\/?[a-z][^>]*>/i.test(r) && (r = r.split(`
|
|
14617
|
-
`).map((i) => `<p>${i}</p>`).join("")), O(this,
|
|
14617
|
+
`).map((i) => `<p>${i}</p>`).join("")), O(this, ee) ? O(this, ee).commands.setContent(r, !1) : ie(this, Yt, r);
|
|
14618
14618
|
}
|
|
14619
14619
|
get id() {
|
|
14620
14620
|
return this.getAttribute("id");
|
|
@@ -14633,25 +14633,67 @@ class Bh extends vl {
|
|
|
14633
14633
|
return this.hasAttribute("readonly");
|
|
14634
14634
|
}
|
|
14635
14635
|
set readonly(t) {
|
|
14636
|
-
t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), q(this,
|
|
14636
|
+
t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), q(this, oe, Lr).call(this);
|
|
14637
14637
|
}
|
|
14638
14638
|
disconnectedCallback() {
|
|
14639
|
-
O(this,
|
|
14639
|
+
O(this, ee) && (O(this, ee).destroy(), ie(this, ee, null));
|
|
14640
14640
|
}
|
|
14641
14641
|
}
|
|
14642
|
-
|
|
14642
|
+
ee = new WeakMap(), xt = new WeakMap(), Yt = new WeakMap(), oe = new WeakSet(), // 2. 에디터 상태 업데이트 로직 분리
|
|
14643
14643
|
Lr = function() {
|
|
14644
|
-
if (O(this,
|
|
14644
|
+
if (O(this, ee)) {
|
|
14645
14645
|
const t = this.readonly;
|
|
14646
|
-
O(this,
|
|
14646
|
+
O(this, ee).setEditable(!t);
|
|
14647
14647
|
const r = this.shadowRoot.querySelector(".menu-bar");
|
|
14648
14648
|
r && (r.style.display = t ? "none" : "flex");
|
|
14649
14649
|
}
|
|
14650
14650
|
}, ml = function() {
|
|
14651
|
-
const t =
|
|
14651
|
+
const t = xe.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
|
|
14652
|
+
this.shadowRoot.innerHTML = `
|
|
14653
|
+
<style>
|
|
14654
|
+
${r}
|
|
14655
|
+
</style>
|
|
14656
|
+
|
|
14657
|
+
<div class="menu-bar">
|
|
14658
|
+
<button type="button" data-cmd="bold" title="굵게 (Ctrl+B)"><b>B</b></button>
|
|
14659
|
+
<button type="button" data-cmd="italic" title="기울임 (Ctrl+I)"><em>I</em></button>
|
|
14660
|
+
<button type="button" data-cmd="underline" title="밑줄 (Ctrl+U)"><u>U</u></button>
|
|
14661
|
+
<button type="button" data-cmd="strike" title="취소선"><s>S</s></button>
|
|
14662
|
+
|
|
14663
|
+
<select id="font-size" title="글자 크기">
|
|
14664
|
+
<option value="12px">12px</option>
|
|
14665
|
+
<option value="14px" selected>14px</option>
|
|
14666
|
+
<option value="16px">16px</option>
|
|
14667
|
+
<option value="18px">18px</option>
|
|
14668
|
+
<option value="24px">24px</option>
|
|
14669
|
+
<option value="32px">32px</option>
|
|
14670
|
+
</select>
|
|
14671
|
+
|
|
14672
|
+
<input type="color" id="color-picker" title="글자 색상">
|
|
14673
|
+
|
|
14674
|
+
<button type="button" data-cmd="highlight" title="형광펜"><i class="icon-highlight"></i></button>
|
|
14675
|
+
|
|
14676
|
+
<button type="button" data-align="left" title="왼쪽 정렬"><i class="icon-left"></i></button>
|
|
14677
|
+
<button type="button" data-align="center" title="가운데 정렬"><i class="icon-center"></i></button>
|
|
14678
|
+
<button type="button" data-align="right" title="오른쪽 정렬"><i class="icon-right"></i></button>
|
|
14679
|
+
|
|
14680
|
+
<button type="button" data-cmd="bulletList" title="글머리 기호"><i class="icon-ul"></i></button>
|
|
14681
|
+
<button type="button" data-cmd="orderedList" title="번호 매기기"><i class="icon-ol"></i></button>
|
|
14682
|
+
|
|
14683
|
+
<button type="button" id="img-btn" title="이미지 삽입"><i class="icon-image"></i></button>
|
|
14684
|
+
<button type="button" data-cmd="undo" title="실행 취소(Ctrl+Z)"><i class="icon-undo"></i></button>
|
|
14685
|
+
<button type="button" data-cmd="redo" title="다시 실행(Ctrl+Y)"><i class="icon-redo"></i></button>
|
|
14686
|
+
</div>
|
|
14687
|
+
<div id="editor-container"></div>
|
|
14688
|
+
`, ie(this, xt, this.shadowRoot.querySelector("#editor-container")), this.shadowRoot.querySelector("#font-size").onchange = (i) => {
|
|
14689
|
+
const s = i.target.value;
|
|
14690
|
+
console.log(i.target, s), O(this, ee).chain().focus().setMark("textStyle", { fontSize: s }).run();
|
|
14691
|
+
};
|
|
14692
|
+
}, Lh = function() {
|
|
14693
|
+
const t = xe.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
|
|
14652
14694
|
this.shadowRoot.innerHTML = `
|
|
14653
14695
|
<style>
|
|
14654
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
14696
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.69/dist/css/nineEditor.css";
|
|
14655
14697
|
${r}
|
|
14656
14698
|
</style>
|
|
14657
14699
|
|
|
@@ -14686,13 +14728,13 @@ Lr = function() {
|
|
|
14686
14728
|
<button type="button" data-cmd="redo" title="다시 실행(Ctrl+Y)"><i class="icon-redo"></i></button>
|
|
14687
14729
|
</div>
|
|
14688
14730
|
<div id="editor-container"></div>
|
|
14689
|
-
`,
|
|
14731
|
+
`, ie(this, xt, this.shadowRoot.querySelector("#editor-container")), this.shadowRoot.querySelector("#font-size").onchange = (i) => {
|
|
14690
14732
|
const s = i.target.value;
|
|
14691
|
-
console.log(i.target, s), O(this,
|
|
14733
|
+
console.log(i.target, s), O(this, ee).chain().focus().setMark("textStyle", { fontSize: s }).run();
|
|
14692
14734
|
};
|
|
14693
14735
|
}, gl = function() {
|
|
14694
|
-
|
|
14695
|
-
element: O(this,
|
|
14736
|
+
ie(this, ee, new Cf({
|
|
14737
|
+
element: O(this, xt),
|
|
14696
14738
|
editable: !this.readonly,
|
|
14697
14739
|
// 4. 생성 시 readonly 여부 반영
|
|
14698
14740
|
extensions: [
|
|
@@ -14718,14 +14760,14 @@ Lr = function() {
|
|
|
14718
14760
|
}
|
|
14719
14761
|
})
|
|
14720
14762
|
],
|
|
14721
|
-
content: O(this,
|
|
14763
|
+
content: O(this, Yt) || this.originContents || "",
|
|
14722
14764
|
onUpdate: ({ editor: t }) => {
|
|
14723
14765
|
this.dispatchEvent(new CustomEvent("change", { detail: t.getHTML() }));
|
|
14724
14766
|
},
|
|
14725
14767
|
onSelectionUpdate: ({ editor: t }) => {
|
|
14726
|
-
this.readonly || q(this,
|
|
14768
|
+
this.readonly || q(this, oe, yl).call(this, t);
|
|
14727
14769
|
}
|
|
14728
|
-
})), q(this,
|
|
14770
|
+
})), q(this, oe, bl).call(this);
|
|
14729
14771
|
}, yl = function(t) {
|
|
14730
14772
|
this.shadowRoot.querySelectorAll("[data-cmd]").forEach((o) => {
|
|
14731
14773
|
t.isActive(o.dataset.cmd) ? o.classList.add("is-active") : o.classList.remove("is-active");
|
|
@@ -14737,7 +14779,7 @@ Lr = function() {
|
|
|
14737
14779
|
const s = this.shadowRoot.querySelector("#color-picker");
|
|
14738
14780
|
s && (s.value = r.color || "#000000");
|
|
14739
14781
|
}, bl = function() {
|
|
14740
|
-
const t = O(this,
|
|
14782
|
+
const t = O(this, ee);
|
|
14741
14783
|
this.shadowRoot.querySelectorAll("[data-cmd]").forEach((r) => {
|
|
14742
14784
|
r.onclick = () => {
|
|
14743
14785
|
const i = r.dataset.cmd;
|
|
@@ -14759,14 +14801,14 @@ const Ms = {
|
|
|
14759
14801
|
var t, r;
|
|
14760
14802
|
wl.log(yt);
|
|
14761
14803
|
const { nativeOverride: n } = ((r = (t = yt) == null ? void 0 : t.config) == null ? void 0 : r.ux) || {}, e = Array.isArray(n) ? n : n === !0 ? ["alert", "confirm"] : [];
|
|
14762
|
-
console.log(e), window.alert = e.includes("alert") ? (i) =>
|
|
14763
|
-
},
|
|
14804
|
+
console.log(e), window.alert = e.includes("alert") ? (i) => xe.alert(i) : Ms.alert, window.confirm = e.includes("confirm") ? async (i) => await xe.confirm(i) : Ms.confirm, yt.config.debug && e.length > 0 && console.log(`[nine-ux] Native API Overridden: ${e.join(", ")}`);
|
|
14805
|
+
}, zh = () => {
|
|
14764
14806
|
ws(), Ml((n) => {
|
|
14765
14807
|
(n === "ux" || n === "config") && ws();
|
|
14766
14808
|
});
|
|
14767
14809
|
};
|
|
14768
|
-
|
|
14769
|
-
yt.alert =
|
|
14770
|
-
yt.confirm =
|
|
14810
|
+
zh();
|
|
14811
|
+
yt.alert = xe.alert.bind(xe);
|
|
14812
|
+
yt.confirm = xe.confirm.bind(xe);
|
|
14771
14813
|
typeof window < "u" && (customElements.get("nine-editor") || customElements.define("nine-editor", Bh));
|
|
14772
14814
|
//# sourceMappingURL=nine-ux.es.js.map
|