@nine-lab/nine-ux 0.1.27 → 0.1.28
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 +653 -647
- package/dist/nine-ux.es.js.map +1 -1
- package/dist/nine-ux.umd.js +21 -21
- package/dist/nine-ux.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-ux.es.js
CHANGED
|
@@ -3,8 +3,8 @@ var ii = (n) => {
|
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
5
|
var bl = (n, e, t) => e in n ? yl(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
6
|
-
var ye = (n, e, t) => bl(n, typeof e != "symbol" ? e + "" : e, t),
|
|
7
|
-
var
|
|
6
|
+
var ye = (n, e, t) => bl(n, typeof e != "symbol" ? e + "" : e, t), Wn = (n, e, t) => e.has(n) || ii("Cannot " + t);
|
|
7
|
+
var O = (n, e, t) => (Wn(n, e, "read from private field"), t ? t.call(n) : e.get(n)), W = (n, e, t) => e.has(n) ? ii("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), de = (n, e, t, r) => (Wn(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), Q = (n, e, t) => (Wn(n, e, "access private method"), t);
|
|
8
8
|
import { subscribeConfig as kl, nine as xl } from "@nine-lab/nine-util";
|
|
9
9
|
const Sl = `
|
|
10
10
|
dialog::backdrop {
|
|
@@ -319,53 +319,53 @@ const Sl = `
|
|
|
319
319
|
filter: unset;
|
|
320
320
|
}
|
|
321
321
|
`;
|
|
322
|
-
var Oe, q,
|
|
322
|
+
var Oe, q, Tn, On, En;
|
|
323
323
|
class Ml extends HTMLElement {
|
|
324
324
|
constructor() {
|
|
325
325
|
super();
|
|
326
326
|
W(this, Oe);
|
|
327
327
|
W(this, q);
|
|
328
328
|
ye(this, "showModal", () => {
|
|
329
|
-
|
|
329
|
+
O(this, q).showModal();
|
|
330
330
|
});
|
|
331
331
|
ye(this, "close", () => {
|
|
332
|
-
|
|
332
|
+
O(this, q).close(), this.remove();
|
|
333
333
|
});
|
|
334
|
-
W(this,
|
|
334
|
+
W(this, Tn, () => {
|
|
335
335
|
const t = this.querySelector(".head");
|
|
336
336
|
this.querySelectorAll(".close, .close2").forEach((r) => {
|
|
337
337
|
r.onclick = () => {
|
|
338
|
-
|
|
338
|
+
O(this, q).classList.add("out"), setTimeout(() => {
|
|
339
339
|
this.close();
|
|
340
340
|
}, 300);
|
|
341
341
|
};
|
|
342
|
-
}), t.addEventListener("mousedown",
|
|
342
|
+
}), t.addEventListener("mousedown", O(this, On)), t.addEventListener("touchstart", O(this, En), { passive: !1 });
|
|
343
343
|
});
|
|
344
344
|
// --- 드래그 로직 (Vanilla JS) ---
|
|
345
|
-
W(this,
|
|
345
|
+
W(this, On, (t) => {
|
|
346
346
|
if (t.target.closest("buttons") || t.button !== 0 || t.altKey || t.ctrlKey || t.shiftKey) return;
|
|
347
|
-
const r =
|
|
347
|
+
const r = O(this, q).getBoundingClientRect();
|
|
348
348
|
de(this, Oe, {
|
|
349
349
|
x: t.clientX - r.left,
|
|
350
350
|
y: t.clientY - r.top
|
|
351
351
|
});
|
|
352
352
|
const i = (o) => {
|
|
353
|
-
|
|
353
|
+
O(this, q).style.position = "fixed", O(this, q).style.margin = "0", O(this, q).style.left = `${o.clientX - O(this, Oe).x}px`, O(this, q).style.top = `${o.clientY - O(this, Oe).y}px`;
|
|
354
354
|
}, s = () => {
|
|
355
355
|
document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", s);
|
|
356
356
|
};
|
|
357
357
|
document.addEventListener("mousemove", i), document.addEventListener("mouseup", s);
|
|
358
358
|
});
|
|
359
|
-
W(this,
|
|
359
|
+
W(this, En, (t) => {
|
|
360
360
|
if (t.target.closest("buttons")) return;
|
|
361
|
-
const r =
|
|
361
|
+
const r = O(this, q).getBoundingClientRect(), i = t.changedTouches[0];
|
|
362
362
|
de(this, Oe, {
|
|
363
363
|
x: i.pageX - r.left,
|
|
364
364
|
y: i.pageY - r.top
|
|
365
365
|
});
|
|
366
366
|
const s = (l) => {
|
|
367
367
|
const a = l.changedTouches[0];
|
|
368
|
-
|
|
368
|
+
O(this, q).style.position = "fixed", O(this, q).style.margin = "0", O(this, q).style.left = `${a.pageX - O(this, Oe).x}px`, O(this, q).style.top = `${a.pageY - O(this, Oe).y}px`;
|
|
369
369
|
}, o = () => {
|
|
370
370
|
document.removeEventListener("touchmove", s), document.removeEventListener("touchend", o);
|
|
371
371
|
};
|
|
@@ -405,10 +405,10 @@ class Ml extends HTMLElement {
|
|
|
405
405
|
</div>
|
|
406
406
|
</div>
|
|
407
407
|
</dialog>
|
|
408
|
-
`, de(this, q, this.querySelector("dialog")),
|
|
408
|
+
`, de(this, q, this.querySelector("dialog")), O(this, Tn).call(this);
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
-
Oe = new WeakMap(), q = new WeakMap(),
|
|
411
|
+
Oe = new WeakMap(), q = new WeakMap(), Tn = new WeakMap(), On = new WeakMap(), En = new WeakMap();
|
|
412
412
|
customElements.get("nine-dialog") || customElements.define("nine-dialog", Ml);
|
|
413
413
|
class Ir extends HTMLElement {
|
|
414
414
|
constructor() {
|
|
@@ -433,7 +433,7 @@ ye(Ir, "confirm", async (e, t = "Confirm", r = {}) => {
|
|
|
433
433
|
"false-text": "No",
|
|
434
434
|
class: "",
|
|
435
435
|
animation: "",
|
|
436
|
-
...((d =
|
|
436
|
+
...((d = kt.options) == null ? void 0 : d.confirm) || {},
|
|
437
437
|
...r
|
|
438
438
|
};
|
|
439
439
|
document.querySelectorAll("nine-confirm-popup").forEach((u) => u.remove());
|
|
@@ -468,7 +468,7 @@ ye(Rr, "alert", async (e, t = "Alert", r = {}) => {
|
|
|
468
468
|
const i = {
|
|
469
469
|
class: "",
|
|
470
470
|
animation: "",
|
|
471
|
-
...((c =
|
|
471
|
+
...((c = kt.options) == null ? void 0 : c.alert) || {},
|
|
472
472
|
...r
|
|
473
473
|
};
|
|
474
474
|
document.querySelectorAll("nine-alert-popup").forEach((d) => d.remove());
|
|
@@ -484,10 +484,10 @@ ye(Rr, "alert", async (e, t = "Alert", r = {}) => {
|
|
|
484
484
|
});
|
|
485
485
|
customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", Ir);
|
|
486
486
|
customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", Rr);
|
|
487
|
-
var
|
|
487
|
+
var Xe;
|
|
488
488
|
class wl {
|
|
489
489
|
constructor() {
|
|
490
|
-
W(this,
|
|
490
|
+
W(this, Xe, "");
|
|
491
491
|
}
|
|
492
492
|
// 이제 setup이나 window 교체 로직은 여기서 다 제거합니다.
|
|
493
493
|
// 오직 팝업을 실행하는 인터페이스 역할만 수행.
|
|
@@ -497,22 +497,28 @@ class wl {
|
|
|
497
497
|
async confirm(e, t = "Confirm", r = {}) {
|
|
498
498
|
return await Ir.confirm(e, t, r);
|
|
499
499
|
}
|
|
500
|
+
/**
|
|
501
|
+
* 컴포넌트별 CSS 경로 생성 헬퍼 (복구!)
|
|
502
|
+
*/
|
|
503
|
+
getComponentCssPath(e) {
|
|
504
|
+
return O(this, Xe) ? `${O(this, Xe).endsWith("/") ? O(this, Xe) : `${O(this, Xe)}/`}${e}` : null;
|
|
505
|
+
}
|
|
500
506
|
}
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
var
|
|
507
|
+
Xe = new WeakMap();
|
|
508
|
+
const kt = new wl();
|
|
509
|
+
var jt, Ze, Kt, le, Ot, cr, dr, Jt, vn;
|
|
504
510
|
class Cl extends HTMLElement {
|
|
505
511
|
constructor() {
|
|
506
512
|
super();
|
|
507
513
|
W(this, le);
|
|
508
514
|
ye(this, "originContents");
|
|
509
|
-
W(this, qt, !1);
|
|
510
|
-
W(this, Xe);
|
|
511
|
-
// Shadow DOM 사용 여부에 따라 shadowRoot 또는 this를 가리킴
|
|
512
515
|
W(this, jt, !1);
|
|
516
|
+
W(this, Ze);
|
|
517
|
+
// Shadow DOM 사용 여부에 따라 shadowRoot 또는 this를 가리킴
|
|
518
|
+
W(this, Kt, !1);
|
|
513
519
|
ye(this, "getData", () => {
|
|
514
520
|
const t = {};
|
|
515
|
-
return Q(this, le,
|
|
521
|
+
return Q(this, le, Ot).call(this).forEach((r) => {
|
|
516
522
|
const i = r.name;
|
|
517
523
|
if (!i) return;
|
|
518
524
|
let s;
|
|
@@ -525,43 +531,43 @@ class Cl extends HTMLElement {
|
|
|
525
531
|
});
|
|
526
532
|
// 파라미터가 있으면 해당 값으로, 없으면 전체 공백 초기화
|
|
527
533
|
ye(this, "clearData", (t = {}) => {
|
|
528
|
-
Q(this, le,
|
|
534
|
+
Q(this, le, dr).call(this), Q(this, le, Ot).call(this).forEach((r) => {
|
|
529
535
|
const i = r.name;
|
|
530
536
|
if (!i) return;
|
|
531
537
|
const s = t && t[i] !== void 0 ? t[i] : "";
|
|
532
|
-
Q(this, le,
|
|
538
|
+
Q(this, le, cr).call(this, r, s);
|
|
533
539
|
}), this.changed = !1;
|
|
534
540
|
});
|
|
535
541
|
ye(this, "setData", (t) => {
|
|
536
542
|
if (!t || typeof t != "object") return;
|
|
537
|
-
Q(this, le,
|
|
543
|
+
Q(this, le, dr).call(this);
|
|
538
544
|
let r = !1;
|
|
539
|
-
Q(this, le,
|
|
545
|
+
Q(this, le, Ot).call(this).forEach((i) => {
|
|
540
546
|
const s = i.name;
|
|
541
|
-
!s || !t.hasOwnProperty(s) || Q(this, le,
|
|
547
|
+
!s || !t.hasOwnProperty(s) || Q(this, le, cr).call(this, i, t[s]) && (r = !0);
|
|
542
548
|
}), r && (this.changed = !0);
|
|
543
549
|
});
|
|
544
550
|
ye(this, "initData", (t) => {
|
|
545
551
|
this.clearData(t), this.changed = !1;
|
|
546
552
|
});
|
|
547
|
-
W(this,
|
|
553
|
+
W(this, Jt, (t) => {
|
|
548
554
|
this.changed = !0;
|
|
549
555
|
});
|
|
550
|
-
W(this,
|
|
556
|
+
W(this, vn, () => {
|
|
551
557
|
for (const t of this.attributes)
|
|
552
558
|
t.name.startsWith("css-") && this.style.setProperty(t.name.substring(4), t.value);
|
|
553
559
|
this.originContents = this.innerHTML.trim(), this.innerHTML = "", this.shadowRoot && this.tagName.toLowerCase() === "nx-div" && (this.shadowRoot.innerHTML = this.originContents);
|
|
554
560
|
});
|
|
555
561
|
}
|
|
556
562
|
connectedCallback() {
|
|
557
|
-
return
|
|
563
|
+
return O(this, jt) ? !1 : (this.getAttribute("use-shadow") !== "false" && !this.shadowRoot ? (this.attachShadow({ mode: "open" }), de(this, Ze, this.shadowRoot)) : de(this, Ze, this), O(this, vn).call(this), de(this, jt, !0), !0);
|
|
558
564
|
}
|
|
559
565
|
get changed() {
|
|
560
|
-
return
|
|
566
|
+
return O(this, Kt);
|
|
561
567
|
}
|
|
562
568
|
set changed(t) {
|
|
563
569
|
const r = !!t;
|
|
564
|
-
de(this,
|
|
570
|
+
de(this, Kt, r);
|
|
565
571
|
const i = this.closest(".detail-wrapper");
|
|
566
572
|
if (i) {
|
|
567
573
|
const s = i.querySelector("nx-title2");
|
|
@@ -570,14 +576,14 @@ class Cl extends HTMLElement {
|
|
|
570
576
|
}
|
|
571
577
|
// 자식 클래스에서 접근 가능하도록 getter 제공
|
|
572
578
|
get root() {
|
|
573
|
-
return
|
|
579
|
+
return O(this, Ze) || this;
|
|
574
580
|
}
|
|
575
581
|
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]",
|
|
582
|
+
jt = new WeakMap(), Ze = new WeakMap(), Kt = new WeakMap(), le = new WeakSet(), // 공통 쿼리 함수: 현재 root(Shadow 또는 Light DOM)에서 요소를 찾음
|
|
583
|
+
Ot = function() {
|
|
584
|
+
return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]", O(this, Ze));
|
|
579
585
|
}, // [공통 로직 1] 특정 요소에 값을 쓰거나 초기화하는 핵심 함수
|
|
580
|
-
|
|
586
|
+
cr = function(t, r) {
|
|
581
587
|
const i = t.tagName.toUpperCase(), s = t.type;
|
|
582
588
|
let o = !1;
|
|
583
589
|
if (["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"].includes(i))
|
|
@@ -593,11 +599,11 @@ ar = function(t, r) {
|
|
|
593
599
|
t.textContent !== r && (o = !0), t.textContent = r;
|
|
594
600
|
return o;
|
|
595
601
|
}, // [공통 로직 2] 이벤트 리스너 일괄 등록
|
|
596
|
-
|
|
597
|
-
Q(this, le,
|
|
598
|
-
t.removeEventListener("input",
|
|
602
|
+
dr = function() {
|
|
603
|
+
Q(this, le, Ot).call(this).forEach((t) => {
|
|
604
|
+
t.removeEventListener("input", O(this, Jt)), t.addEventListener("input", O(this, Jt));
|
|
599
605
|
});
|
|
600
|
-
},
|
|
606
|
+
}, Jt = new WeakMap(), vn = new WeakMap();
|
|
601
607
|
function j(n) {
|
|
602
608
|
this.content = n;
|
|
603
609
|
}
|
|
@@ -927,15 +933,15 @@ class b {
|
|
|
927
933
|
*/
|
|
928
934
|
findIndex(e) {
|
|
929
935
|
if (e == 0)
|
|
930
|
-
return
|
|
936
|
+
return Zt(0, e);
|
|
931
937
|
if (e == this.size)
|
|
932
|
-
return
|
|
938
|
+
return Zt(this.content.length, e);
|
|
933
939
|
if (e > this.size || e < 0)
|
|
934
940
|
throw new RangeError(`Position ${e} outside of fragment (${this})`);
|
|
935
941
|
for (let t = 0, r = 0; ; t++) {
|
|
936
942
|
let i = this.child(t), s = r + i.nodeSize;
|
|
937
943
|
if (s >= e)
|
|
938
|
-
return s == e ?
|
|
944
|
+
return s == e ? Zt(t + 1, s) : Zt(t, r);
|
|
939
945
|
r = s;
|
|
940
946
|
}
|
|
941
947
|
}
|
|
@@ -1000,11 +1006,11 @@ class b {
|
|
|
1000
1006
|
}
|
|
1001
1007
|
}
|
|
1002
1008
|
b.empty = new b([], 0);
|
|
1003
|
-
const
|
|
1004
|
-
function
|
|
1005
|
-
return
|
|
1009
|
+
const qn = { index: 0, offset: 0 };
|
|
1010
|
+
function Zt(n, e) {
|
|
1011
|
+
return qn.index = n, qn.offset = e, qn;
|
|
1006
1012
|
}
|
|
1007
|
-
function
|
|
1013
|
+
function un(n, e) {
|
|
1008
1014
|
if (n === e)
|
|
1009
1015
|
return !0;
|
|
1010
1016
|
if (!(n && typeof n == "object") || !(e && typeof e == "object"))
|
|
@@ -1016,11 +1022,11 @@ function dn(n, e) {
|
|
|
1016
1022
|
if (n.length != e.length)
|
|
1017
1023
|
return !1;
|
|
1018
1024
|
for (let r = 0; r < n.length; r++)
|
|
1019
|
-
if (!
|
|
1025
|
+
if (!un(n[r], e[r]))
|
|
1020
1026
|
return !1;
|
|
1021
1027
|
} else {
|
|
1022
1028
|
for (let r in n)
|
|
1023
|
-
if (!(r in e) || !
|
|
1029
|
+
if (!(r in e) || !un(n[r], e[r]))
|
|
1024
1030
|
return !1;
|
|
1025
1031
|
for (let r in e)
|
|
1026
1032
|
if (!(r in n))
|
|
@@ -1028,7 +1034,7 @@ function dn(n, e) {
|
|
|
1028
1034
|
}
|
|
1029
1035
|
return !0;
|
|
1030
1036
|
}
|
|
1031
|
-
let A = class
|
|
1037
|
+
let A = class ur {
|
|
1032
1038
|
/**
|
|
1033
1039
|
@internal
|
|
1034
1040
|
*/
|
|
@@ -1082,7 +1088,7 @@ let A = class dr {
|
|
|
1082
1088
|
another mark.
|
|
1083
1089
|
*/
|
|
1084
1090
|
eq(e) {
|
|
1085
|
-
return this == e || this.type == e.type &&
|
|
1091
|
+
return this == e || this.type == e.type && un(this.attrs, e.attrs);
|
|
1086
1092
|
}
|
|
1087
1093
|
/**
|
|
1088
1094
|
Convert this mark to a JSON-serializeable representation.
|
|
@@ -1126,15 +1132,15 @@ let A = class dr {
|
|
|
1126
1132
|
*/
|
|
1127
1133
|
static setFrom(e) {
|
|
1128
1134
|
if (!e || Array.isArray(e) && e.length == 0)
|
|
1129
|
-
return
|
|
1130
|
-
if (e instanceof
|
|
1135
|
+
return ur.none;
|
|
1136
|
+
if (e instanceof ur)
|
|
1131
1137
|
return [e];
|
|
1132
1138
|
let t = e.slice();
|
|
1133
1139
|
return t.sort((r, i) => r.type.rank - i.type.rank), t;
|
|
1134
1140
|
}
|
|
1135
1141
|
};
|
|
1136
1142
|
A.none = [];
|
|
1137
|
-
class
|
|
1143
|
+
class fn extends Error {
|
|
1138
1144
|
}
|
|
1139
1145
|
class k {
|
|
1140
1146
|
/**
|
|
@@ -1237,9 +1243,9 @@ function ws(n, e, t, r) {
|
|
|
1237
1243
|
}
|
|
1238
1244
|
function Tl(n, e, t) {
|
|
1239
1245
|
if (t.openStart > n.depth)
|
|
1240
|
-
throw new
|
|
1246
|
+
throw new fn("Inserted content deeper than insertion position");
|
|
1241
1247
|
if (n.depth - t.openStart != e.depth - t.openEnd)
|
|
1242
|
-
throw new
|
|
1248
|
+
throw new fn("Inconsistent open depths");
|
|
1243
1249
|
return Cs(n, e, t, 0);
|
|
1244
1250
|
}
|
|
1245
1251
|
function Cs(n, e, t, r) {
|
|
@@ -1250,46 +1256,46 @@ function Cs(n, e, t, r) {
|
|
|
1250
1256
|
} else if (t.content.size)
|
|
1251
1257
|
if (!t.openStart && !t.openEnd && n.depth == r && e.depth == r) {
|
|
1252
1258
|
let o = n.parent, l = o.content;
|
|
1253
|
-
return
|
|
1259
|
+
return et(o, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
|
|
1254
1260
|
} else {
|
|
1255
1261
|
let { start: o, end: l } = Ol(t, n);
|
|
1256
|
-
return
|
|
1262
|
+
return et(s, Os(n, o, l, e, r));
|
|
1257
1263
|
}
|
|
1258
|
-
else return
|
|
1264
|
+
else return et(s, hn(n, e, r));
|
|
1259
1265
|
}
|
|
1260
1266
|
function Ts(n, e) {
|
|
1261
1267
|
if (!e.type.compatibleContent(n.type))
|
|
1262
|
-
throw new
|
|
1268
|
+
throw new fn("Cannot join " + e.type.name + " onto " + n.type.name);
|
|
1263
1269
|
}
|
|
1264
|
-
function
|
|
1270
|
+
function fr(n, e, t) {
|
|
1265
1271
|
let r = n.node(t);
|
|
1266
1272
|
return Ts(r, e.node(t)), r;
|
|
1267
1273
|
}
|
|
1268
|
-
function
|
|
1274
|
+
function Qe(n, e) {
|
|
1269
1275
|
let t = e.length - 1;
|
|
1270
1276
|
t >= 0 && n.isText && n.sameMarkup(e[t]) ? e[t] = n.withText(e[t].text + n.text) : e.push(n);
|
|
1271
1277
|
}
|
|
1272
|
-
function
|
|
1278
|
+
function At(n, e, t, r) {
|
|
1273
1279
|
let i = (e || n).node(t), s = 0, o = e ? e.index(t) : i.childCount;
|
|
1274
|
-
n && (s = n.index(t), n.depth > t ? s++ : n.textOffset && (
|
|
1280
|
+
n && (s = n.index(t), n.depth > t ? s++ : n.textOffset && (Qe(n.nodeAfter, r), s++));
|
|
1275
1281
|
for (let l = s; l < o; l++)
|
|
1276
|
-
|
|
1277
|
-
e && e.depth == t && e.textOffset &&
|
|
1282
|
+
Qe(i.child(l), r);
|
|
1283
|
+
e && e.depth == t && e.textOffset && Qe(e.nodeBefore, r);
|
|
1278
1284
|
}
|
|
1279
|
-
function
|
|
1285
|
+
function et(n, e) {
|
|
1280
1286
|
return n.type.checkContent(e), n.copy(e);
|
|
1281
1287
|
}
|
|
1282
1288
|
function Os(n, e, t, r, i) {
|
|
1283
|
-
let s = n.depth > i &&
|
|
1284
|
-
return
|
|
1289
|
+
let s = n.depth > i && fr(n, e, i + 1), o = r.depth > i && fr(t, r, i + 1), l = [];
|
|
1290
|
+
return At(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Ts(s, o), Qe(et(s, Os(n, e, t, r, i + 1)), l)) : (s && Qe(et(s, hn(n, e, i + 1)), l), At(e, t, i, l), o && Qe(et(o, hn(t, r, i + 1)), l)), At(r, null, i, l), new b(l);
|
|
1285
1291
|
}
|
|
1286
|
-
function
|
|
1292
|
+
function hn(n, e, t) {
|
|
1287
1293
|
let r = [];
|
|
1288
|
-
if (
|
|
1289
|
-
let i =
|
|
1290
|
-
|
|
1294
|
+
if (At(null, n, t, r), n.depth > t) {
|
|
1295
|
+
let i = fr(n, e, t + 1);
|
|
1296
|
+
Qe(et(i, hn(n, e, t + 1)), r);
|
|
1291
1297
|
}
|
|
1292
|
-
return
|
|
1298
|
+
return At(e, null, t, r), new b(r);
|
|
1293
1299
|
}
|
|
1294
1300
|
function Ol(n, e) {
|
|
1295
1301
|
let t = e.depth - n.openStart, i = e.node(t).copy(n.content);
|
|
@@ -1300,7 +1306,7 @@ function Ol(n, e) {
|
|
|
1300
1306
|
end: i.resolveNoCache(i.content.size - n.openEnd - t)
|
|
1301
1307
|
};
|
|
1302
1308
|
}
|
|
1303
|
-
class
|
|
1309
|
+
class Pt {
|
|
1304
1310
|
/**
|
|
1305
1311
|
@internal
|
|
1306
1312
|
*/
|
|
@@ -1485,7 +1491,7 @@ class Rt {
|
|
|
1485
1491
|
return e.blockRange(this);
|
|
1486
1492
|
for (let r = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); r >= 0; r--)
|
|
1487
1493
|
if (e.pos <= this.end(r) && (!t || t(this.node(r))))
|
|
1488
|
-
return new
|
|
1494
|
+
return new pn(this, e, r);
|
|
1489
1495
|
return null;
|
|
1490
1496
|
}
|
|
1491
1497
|
/**
|
|
@@ -1528,7 +1534,7 @@ class Rt {
|
|
|
1528
1534
|
break;
|
|
1529
1535
|
s = c - 1, i += a + 1;
|
|
1530
1536
|
}
|
|
1531
|
-
return new
|
|
1537
|
+
return new Pt(t, r, s);
|
|
1532
1538
|
}
|
|
1533
1539
|
/**
|
|
1534
1540
|
@internal
|
|
@@ -1543,7 +1549,7 @@ class Rt {
|
|
|
1543
1549
|
}
|
|
1544
1550
|
else
|
|
1545
1551
|
si.set(e, r = new El());
|
|
1546
|
-
let i = r.elts[r.i] =
|
|
1552
|
+
let i = r.elts[r.i] = Pt.resolve(e, t);
|
|
1547
1553
|
return r.i = (r.i + 1) % vl, i;
|
|
1548
1554
|
}
|
|
1549
1555
|
}
|
|
@@ -1553,7 +1559,7 @@ class El {
|
|
|
1553
1559
|
}
|
|
1554
1560
|
}
|
|
1555
1561
|
const vl = 12, si = /* @__PURE__ */ new WeakMap();
|
|
1556
|
-
class
|
|
1562
|
+
class pn {
|
|
1557
1563
|
/**
|
|
1558
1564
|
Construct a node range. `$from` and `$to` should point into the
|
|
1559
1565
|
same node until at least the given `depth`, since a node range
|
|
@@ -1594,7 +1600,7 @@ class hn {
|
|
|
1594
1600
|
}
|
|
1595
1601
|
}
|
|
1596
1602
|
const Nl = /* @__PURE__ */ Object.create(null);
|
|
1597
|
-
let ze = class
|
|
1603
|
+
let ze = class hr {
|
|
1598
1604
|
/**
|
|
1599
1605
|
@internal
|
|
1600
1606
|
*/
|
|
@@ -1712,21 +1718,21 @@ let ze = class fr {
|
|
|
1712
1718
|
attributes, and marks.
|
|
1713
1719
|
*/
|
|
1714
1720
|
hasMarkup(e, t, r) {
|
|
1715
|
-
return this.type == e &&
|
|
1721
|
+
return this.type == e && un(this.attrs, t || e.defaultAttrs || Nl) && A.sameSet(this.marks, r || A.none);
|
|
1716
1722
|
}
|
|
1717
1723
|
/**
|
|
1718
1724
|
Create a new node with the same markup as this node, containing
|
|
1719
1725
|
the given content (or empty, if no content is given).
|
|
1720
1726
|
*/
|
|
1721
1727
|
copy(e = null) {
|
|
1722
|
-
return e == this.content ? this : new
|
|
1728
|
+
return e == this.content ? this : new hr(this.type, this.attrs, e, this.marks);
|
|
1723
1729
|
}
|
|
1724
1730
|
/**
|
|
1725
1731
|
Create a copy of this node, with the given set of marks instead
|
|
1726
1732
|
of the node's own marks.
|
|
1727
1733
|
*/
|
|
1728
1734
|
mark(e) {
|
|
1729
|
-
return e == this.marks ? this : new
|
|
1735
|
+
return e == this.marks ? this : new hr(this.type, this.attrs, this.content, e);
|
|
1730
1736
|
}
|
|
1731
1737
|
/**
|
|
1732
1738
|
Create a copy of this node with only the content between the
|
|
@@ -1798,13 +1804,13 @@ let ze = class fr {
|
|
|
1798
1804
|
[object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.
|
|
1799
1805
|
*/
|
|
1800
1806
|
resolve(e) {
|
|
1801
|
-
return
|
|
1807
|
+
return Pt.resolveCached(this, e);
|
|
1802
1808
|
}
|
|
1803
1809
|
/**
|
|
1804
1810
|
@internal
|
|
1805
1811
|
*/
|
|
1806
1812
|
resolveNoCache(e) {
|
|
1807
|
-
return
|
|
1813
|
+
return Pt.resolve(this, e);
|
|
1808
1814
|
}
|
|
1809
1815
|
/**
|
|
1810
1816
|
Test whether a given mark or mark type occurs in this document
|
|
@@ -1964,7 +1970,7 @@ let ze = class fr {
|
|
|
1964
1970
|
}
|
|
1965
1971
|
};
|
|
1966
1972
|
ze.prototype.text = void 0;
|
|
1967
|
-
class
|
|
1973
|
+
class mn extends ze {
|
|
1968
1974
|
/**
|
|
1969
1975
|
@internal
|
|
1970
1976
|
*/
|
|
@@ -1986,10 +1992,10 @@ class pn extends ze {
|
|
|
1986
1992
|
return this.text.length;
|
|
1987
1993
|
}
|
|
1988
1994
|
mark(e) {
|
|
1989
|
-
return e == this.marks ? this : new
|
|
1995
|
+
return e == this.marks ? this : new mn(this.type, this.attrs, this.text, e);
|
|
1990
1996
|
}
|
|
1991
1997
|
withText(e) {
|
|
1992
|
-
return e == this.text ? this : new
|
|
1998
|
+
return e == this.text ? this : new mn(this.type, this.attrs, e, this.marks);
|
|
1993
1999
|
}
|
|
1994
2000
|
cut(e = 0, t = this.text.length) {
|
|
1995
2001
|
return e == 0 && t == this.text.length ? this : this.withText(this.text.slice(e, t));
|
|
@@ -2007,7 +2013,7 @@ function Es(n, e) {
|
|
|
2007
2013
|
e = n[t].type.name + "(" + e + ")";
|
|
2008
2014
|
return e;
|
|
2009
2015
|
}
|
|
2010
|
-
class
|
|
2016
|
+
class it {
|
|
2011
2017
|
/**
|
|
2012
2018
|
@internal
|
|
2013
2019
|
*/
|
|
@@ -2020,7 +2026,7 @@ class rt {
|
|
|
2020
2026
|
static parse(e, t) {
|
|
2021
2027
|
let r = new Al(e, t);
|
|
2022
2028
|
if (r.next == null)
|
|
2023
|
-
return
|
|
2029
|
+
return it.empty;
|
|
2024
2030
|
let i = vs(r);
|
|
2025
2031
|
r.next && r.err("Unexpected trailing text");
|
|
2026
2032
|
let s = zl(Ll(i));
|
|
@@ -2169,7 +2175,7 @@ class rt {
|
|
|
2169
2175
|
`);
|
|
2170
2176
|
}
|
|
2171
2177
|
}
|
|
2172
|
-
|
|
2178
|
+
it.empty = new it(!0);
|
|
2173
2179
|
class Al {
|
|
2174
2180
|
constructor(e, t) {
|
|
2175
2181
|
this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
|
|
@@ -2332,7 +2338,7 @@ function zl(n) {
|
|
|
2332
2338
|
});
|
|
2333
2339
|
});
|
|
2334
2340
|
});
|
|
2335
|
-
let s = e[r.join(",")] = new
|
|
2341
|
+
let s = e[r.join(",")] = new it(r.indexOf(n.length - 1) > -1);
|
|
2336
2342
|
for (let o = 0; o < i.length; o++) {
|
|
2337
2343
|
let l = i[o][1].sort(Ns);
|
|
2338
2344
|
s.next.push({ type: i[o][0], next: e[l.join(",")] || t(l) });
|
|
@@ -2415,7 +2421,7 @@ let ai = class Ps {
|
|
|
2415
2421
|
True for node types that allow no content.
|
|
2416
2422
|
*/
|
|
2417
2423
|
get isLeaf() {
|
|
2418
|
-
return this.contentMatch ==
|
|
2424
|
+
return this.contentMatch == it.empty;
|
|
2419
2425
|
}
|
|
2420
2426
|
/**
|
|
2421
2427
|
True when this node is an atom, i.e. when it does not have
|
|
@@ -2586,7 +2592,7 @@ class Vl {
|
|
|
2586
2592
|
return !this.hasDefault;
|
|
2587
2593
|
}
|
|
2588
2594
|
}
|
|
2589
|
-
class
|
|
2595
|
+
class Nn {
|
|
2590
2596
|
/**
|
|
2591
2597
|
@internal
|
|
2592
2598
|
*/
|
|
@@ -2608,7 +2614,7 @@ class vn {
|
|
|
2608
2614
|
*/
|
|
2609
2615
|
static compile(e, t) {
|
|
2610
2616
|
let r = /* @__PURE__ */ Object.create(null), i = 0;
|
|
2611
|
-
return e.forEach((s, o) => r[s] = new
|
|
2617
|
+
return e.forEach((s, o) => r[s] = new Nn(s, i++, t, o)), r;
|
|
2612
2618
|
}
|
|
2613
2619
|
/**
|
|
2614
2620
|
When there is a mark of this type in the given set, a new set
|
|
@@ -2650,13 +2656,13 @@ class Bs {
|
|
|
2650
2656
|
let t = this.spec = {};
|
|
2651
2657
|
for (let i in e)
|
|
2652
2658
|
t[i] = e[i];
|
|
2653
|
-
t.nodes = j.from(e.nodes), t.marks = j.from(e.marks || {}), this.nodes = ai.compile(this.spec.nodes, this), this.marks =
|
|
2659
|
+
t.nodes = j.from(e.nodes), t.marks = j.from(e.marks || {}), this.nodes = ai.compile(this.spec.nodes, this), this.marks = Nn.compile(this.spec.marks, this);
|
|
2654
2660
|
let r = /* @__PURE__ */ Object.create(null);
|
|
2655
2661
|
for (let i in this.nodes) {
|
|
2656
2662
|
if (i in this.marks)
|
|
2657
2663
|
throw new RangeError(i + " can not be both a node and a mark");
|
|
2658
2664
|
let s = this.nodes[i], o = s.spec.content || "", l = s.spec.marks;
|
|
2659
|
-
if (s.contentMatch = r[o] || (r[o] =
|
|
2665
|
+
if (s.contentMatch = r[o] || (r[o] = it.parse(o, this.nodes)), s.inlineContent = s.contentMatch.inlineContent, s.spec.linebreakReplacement) {
|
|
2660
2666
|
if (this.linebreakReplacement)
|
|
2661
2667
|
throw new RangeError("Multiple linebreak nodes defined");
|
|
2662
2668
|
if (!s.isInline || !s.isLeaf)
|
|
@@ -2692,7 +2698,7 @@ class Bs {
|
|
|
2692
2698
|
*/
|
|
2693
2699
|
text(e, t) {
|
|
2694
2700
|
let r = this.nodes.text;
|
|
2695
|
-
return new
|
|
2701
|
+
return new mn(r, r.defaultAttrs, e, A.setFrom(t));
|
|
2696
2702
|
}
|
|
2697
2703
|
/**
|
|
2698
2704
|
Create a mark with the given type and attributes.
|
|
@@ -2887,13 +2893,13 @@ const Ls = {
|
|
|
2887
2893
|
script: !0,
|
|
2888
2894
|
style: !0,
|
|
2889
2895
|
title: !0
|
|
2890
|
-
}, zs = { ol: !0, ul: !0 },
|
|
2896
|
+
}, zs = { ol: !0, ul: !0 }, Bt = 1, pr = 2, Dt = 4;
|
|
2891
2897
|
function di(n, e, t) {
|
|
2892
|
-
return e != null ? (e ?
|
|
2898
|
+
return e != null ? (e ? Bt : 0) | (e === "full" ? pr : 0) : n && n.whitespace == "pre" ? Bt | pr : t & ~Dt;
|
|
2893
2899
|
}
|
|
2894
|
-
class
|
|
2900
|
+
class Qt {
|
|
2895
2901
|
constructor(e, t, r, i, s, o) {
|
|
2896
|
-
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 &
|
|
2902
|
+
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 & Dt ? null : e.contentMatch);
|
|
2897
2903
|
}
|
|
2898
2904
|
findWrapping(e) {
|
|
2899
2905
|
if (!this.match) {
|
|
@@ -2910,7 +2916,7 @@ class Zt {
|
|
|
2910
2916
|
return this.match.findWrapping(e.type);
|
|
2911
2917
|
}
|
|
2912
2918
|
finish(e) {
|
|
2913
|
-
if (!(this.options &
|
|
2919
|
+
if (!(this.options & Bt)) {
|
|
2914
2920
|
let r = this.content[this.content.length - 1], i;
|
|
2915
2921
|
if (r && r.isText && (i = /[ \t\r\n\u000c]+$/.exec(r.text))) {
|
|
2916
2922
|
let s = r;
|
|
@@ -2927,8 +2933,8 @@ class Zt {
|
|
|
2927
2933
|
class ui {
|
|
2928
2934
|
constructor(e, t, r) {
|
|
2929
2935
|
this.parser = e, this.options = t, this.isOpen = r, this.open = 0, this.localPreserveWS = !1;
|
|
2930
|
-
let i = t.topNode, s, o = di(null, t.preserveWhitespace, 0) | (r ?
|
|
2931
|
-
i ? s = new
|
|
2936
|
+
let i = t.topNode, s, o = di(null, t.preserveWhitespace, 0) | (r ? Dt : 0);
|
|
2937
|
+
i ? s = new Qt(i.type, i.attrs, A.none, !0, t.topMatch || i.type.contentMatch, o) : r ? s = new Qt(null, null, A.none, !0, null, o) : s = new Qt(e.schema.topNodeType, null, A.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
|
|
2932
2938
|
}
|
|
2933
2939
|
get top() {
|
|
2934
2940
|
return this.nodes[this.open];
|
|
@@ -2940,7 +2946,7 @@ class ui {
|
|
|
2940
2946
|
e.nodeType == 3 ? this.addTextNode(e, t) : e.nodeType == 1 && this.addElement(e, t);
|
|
2941
2947
|
}
|
|
2942
2948
|
addTextNode(e, t) {
|
|
2943
|
-
let r = e.nodeValue, i = this.top, s = i.options &
|
|
2949
|
+
let r = e.nodeValue, i = this.top, s = i.options & pr ? "full" : this.localPreserveWS || (i.options & Bt) > 0, { schema: o } = this.parser;
|
|
2944
2950
|
if (s === "full" || i.inlineContext(e) || /[^ \t\r\n\u000c]/.test(r)) {
|
|
2945
2951
|
if (s)
|
|
2946
2952
|
if (s === "full")
|
|
@@ -3110,9 +3116,9 @@ class ui {
|
|
|
3110
3116
|
let o = this.top;
|
|
3111
3117
|
o.match = o.match && o.match.matchType(e);
|
|
3112
3118
|
let l = di(e, s, o.options);
|
|
3113
|
-
o.options &
|
|
3119
|
+
o.options & Dt && o.content.length == 0 && (l |= Dt);
|
|
3114
3120
|
let a = A.none;
|
|
3115
|
-
return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : hi(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new
|
|
3121
|
+
return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : hi(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new Qt(e, t, a, i, null, l)), this.open++, r;
|
|
3116
3122
|
}
|
|
3117
3123
|
// Make sure all nodes above this.open are finished and added to
|
|
3118
3124
|
// their parents
|
|
@@ -3131,7 +3137,7 @@ class ui {
|
|
|
3131
3137
|
for (let t = this.open; t >= 0; t--) {
|
|
3132
3138
|
if (this.nodes[t] == e)
|
|
3133
3139
|
return this.open = t, !0;
|
|
3134
|
-
this.localPreserveWS && (this.nodes[t].options |=
|
|
3140
|
+
this.localPreserveWS && (this.nodes[t].options |= Bt);
|
|
3135
3141
|
}
|
|
3136
3142
|
return !1;
|
|
3137
3143
|
}
|
|
@@ -3239,7 +3245,7 @@ function hi(n, e) {
|
|
|
3239
3245
|
return !0;
|
|
3240
3246
|
}
|
|
3241
3247
|
}
|
|
3242
|
-
class
|
|
3248
|
+
class dt {
|
|
3243
3249
|
/**
|
|
3244
3250
|
Create a serializer. `nodes` should map node names to functions
|
|
3245
3251
|
that take a node and return a description of the corresponding
|
|
@@ -3259,7 +3265,7 @@ class ct {
|
|
|
3259
3265
|
nodes.
|
|
3260
3266
|
*/
|
|
3261
3267
|
serializeFragment(e, t = {}, r) {
|
|
3262
|
-
r || (r =
|
|
3268
|
+
r || (r = jn(t).createDocumentFragment());
|
|
3263
3269
|
let i = r, s = [];
|
|
3264
3270
|
return e.forEach((o) => {
|
|
3265
3271
|
if (s.length || o.marks.length) {
|
|
@@ -3288,7 +3294,7 @@ class ct {
|
|
|
3288
3294
|
@internal
|
|
3289
3295
|
*/
|
|
3290
3296
|
serializeNodeInner(e, t) {
|
|
3291
|
-
let { dom: r, contentDOM: i } =
|
|
3297
|
+
let { dom: r, contentDOM: i } = ln(jn(t), this.nodes[e.type.name](e), null, e.attrs);
|
|
3292
3298
|
if (i) {
|
|
3293
3299
|
if (e.isLeaf)
|
|
3294
3300
|
throw new RangeError("Content hole not allowed in a leaf node spec");
|
|
@@ -3316,17 +3322,17 @@ class ct {
|
|
|
3316
3322
|
*/
|
|
3317
3323
|
serializeMark(e, t, r = {}) {
|
|
3318
3324
|
let i = this.marks[e.type.name];
|
|
3319
|
-
return i &&
|
|
3325
|
+
return i && ln(jn(r), i(e, t), null, e.attrs);
|
|
3320
3326
|
}
|
|
3321
3327
|
static renderSpec(e, t, r = null, i) {
|
|
3322
|
-
return
|
|
3328
|
+
return ln(e, t, r, i);
|
|
3323
3329
|
}
|
|
3324
3330
|
/**
|
|
3325
3331
|
Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
|
|
3326
3332
|
properties in a schema's node and mark specs.
|
|
3327
3333
|
*/
|
|
3328
3334
|
static fromSchema(e) {
|
|
3329
|
-
return e.cached.domSerializer || (e.cached.domSerializer = new
|
|
3335
|
+
return e.cached.domSerializer || (e.cached.domSerializer = new dt(this.nodesFromSchema(e), this.marksFromSchema(e)));
|
|
3330
3336
|
}
|
|
3331
3337
|
/**
|
|
3332
3338
|
Gather the serializers in a schema's node specs into an object.
|
|
@@ -3351,7 +3357,7 @@ function pi(n) {
|
|
|
3351
3357
|
}
|
|
3352
3358
|
return e;
|
|
3353
3359
|
}
|
|
3354
|
-
function
|
|
3360
|
+
function jn(n) {
|
|
3355
3361
|
return n.document || window.document;
|
|
3356
3362
|
}
|
|
3357
3363
|
const mi = /* @__PURE__ */ new WeakMap();
|
|
@@ -3375,7 +3381,7 @@ function Ul(n) {
|
|
|
3375
3381
|
}
|
|
3376
3382
|
return t(n), e;
|
|
3377
3383
|
}
|
|
3378
|
-
function
|
|
3384
|
+
function ln(n, e, t, r) {
|
|
3379
3385
|
if (typeof e == "string")
|
|
3380
3386
|
return { dom: n.createTextNode(e) };
|
|
3381
3387
|
if (e.nodeType != null)
|
|
@@ -3405,7 +3411,7 @@ function on(n, e, t, r) {
|
|
|
3405
3411
|
throw new RangeError("Content hole must be the only child of its parent node");
|
|
3406
3412
|
return { dom: a, contentDOM: a };
|
|
3407
3413
|
} else {
|
|
3408
|
-
let { dom: h, contentDOM: p } =
|
|
3414
|
+
let { dom: h, contentDOM: p } = ln(n, f, t, r);
|
|
3409
3415
|
if (a.appendChild(h), p) {
|
|
3410
3416
|
if (l)
|
|
3411
3417
|
throw new RangeError("Multiple content holes");
|
|
@@ -3425,8 +3431,8 @@ function gi(n) {
|
|
|
3425
3431
|
function Gl(n) {
|
|
3426
3432
|
return (n - (n & Fs)) / $s;
|
|
3427
3433
|
}
|
|
3428
|
-
const Vs = 1, Hs = 2,
|
|
3429
|
-
class
|
|
3434
|
+
const Vs = 1, Hs = 2, an = 4, Ws = 8;
|
|
3435
|
+
class mr {
|
|
3430
3436
|
/**
|
|
3431
3437
|
@internal
|
|
3432
3438
|
*/
|
|
@@ -3445,13 +3451,13 @@ class pr {
|
|
|
3445
3451
|
Tells you whether the token before the mapped position was deleted.
|
|
3446
3452
|
*/
|
|
3447
3453
|
get deletedBefore() {
|
|
3448
|
-
return (this.delInfo & (Vs |
|
|
3454
|
+
return (this.delInfo & (Vs | an)) > 0;
|
|
3449
3455
|
}
|
|
3450
3456
|
/**
|
|
3451
3457
|
True when the token after the mapped position was deleted.
|
|
3452
3458
|
*/
|
|
3453
3459
|
get deletedAfter() {
|
|
3454
|
-
return (this.delInfo & (Hs |
|
|
3460
|
+
return (this.delInfo & (Hs | an)) > 0;
|
|
3455
3461
|
}
|
|
3456
3462
|
/**
|
|
3457
3463
|
Tells whether any of the steps mapped through deletes across the
|
|
@@ -3459,7 +3465,7 @@ class pr {
|
|
|
3459
3465
|
position).
|
|
3460
3466
|
*/
|
|
3461
3467
|
get deletedAcross() {
|
|
3462
|
-
return (this.delInfo &
|
|
3468
|
+
return (this.delInfo & an) > 0;
|
|
3463
3469
|
}
|
|
3464
3470
|
}
|
|
3465
3471
|
class oe {
|
|
@@ -3502,12 +3508,12 @@ class oe {
|
|
|
3502
3508
|
let f = c ? e == a ? -1 : e == u ? 1 : t : t, h = a + i + (f < 0 ? 0 : d);
|
|
3503
3509
|
if (r)
|
|
3504
3510
|
return h;
|
|
3505
|
-
let p = e == (t < 0 ? a : u) ? null : _l(l / 3, e - a), m = e == a ? Hs : e == u ? Vs :
|
|
3506
|
-
return (t < 0 ? e != a : e != u) && (m |= Ws), new
|
|
3511
|
+
let p = e == (t < 0 ? a : u) ? null : _l(l / 3, e - a), m = e == a ? Hs : e == u ? Vs : an;
|
|
3512
|
+
return (t < 0 ? e != a : e != u) && (m |= Ws), new mr(h, m, p);
|
|
3507
3513
|
}
|
|
3508
3514
|
i += d - c;
|
|
3509
3515
|
}
|
|
3510
|
-
return r ? e + i : new
|
|
3516
|
+
return r ? e + i : new mr(e + i, 0, null);
|
|
3511
3517
|
}
|
|
3512
3518
|
/**
|
|
3513
3519
|
@internal
|
|
@@ -3559,7 +3565,7 @@ class oe {
|
|
|
3559
3565
|
}
|
|
3560
3566
|
}
|
|
3561
3567
|
oe.empty = new oe([]);
|
|
3562
|
-
class
|
|
3568
|
+
class Lt {
|
|
3563
3569
|
/**
|
|
3564
3570
|
Create a new mapping with the given position maps.
|
|
3565
3571
|
*/
|
|
@@ -3576,7 +3582,7 @@ class Bt {
|
|
|
3576
3582
|
Create a mapping that maps only through a part of this one.
|
|
3577
3583
|
*/
|
|
3578
3584
|
slice(e = 0, t = this.maps.length) {
|
|
3579
|
-
return new
|
|
3585
|
+
return new Lt(this._maps, this.mirror, e, t);
|
|
3580
3586
|
}
|
|
3581
3587
|
/**
|
|
3582
3588
|
Add a step map to the end of this mapping. If `mirrors` is
|
|
@@ -3627,7 +3633,7 @@ class Bt {
|
|
|
3627
3633
|
Create an inverted version of this mapping.
|
|
3628
3634
|
*/
|
|
3629
3635
|
invert() {
|
|
3630
|
-
let e = new
|
|
3636
|
+
let e = new Lt();
|
|
3631
3637
|
return e.appendMappingInverted(this), e;
|
|
3632
3638
|
}
|
|
3633
3639
|
/**
|
|
@@ -3663,10 +3669,10 @@ class Bt {
|
|
|
3663
3669
|
}
|
|
3664
3670
|
i |= l.delInfo, e = l.pos;
|
|
3665
3671
|
}
|
|
3666
|
-
return r ? e : new
|
|
3672
|
+
return r ? e : new mr(e, i, null);
|
|
3667
3673
|
}
|
|
3668
3674
|
}
|
|
3669
|
-
const
|
|
3675
|
+
const Kn = /* @__PURE__ */ Object.create(null);
|
|
3670
3676
|
class Z {
|
|
3671
3677
|
/**
|
|
3672
3678
|
Get the step map that represents the changes made by this step,
|
|
@@ -3691,7 +3697,7 @@ class Z {
|
|
|
3691
3697
|
static fromJSON(e, t) {
|
|
3692
3698
|
if (!t || !t.stepType)
|
|
3693
3699
|
throw new RangeError("Invalid input for Step.fromJSON");
|
|
3694
|
-
let r =
|
|
3700
|
+
let r = Kn[t.stepType];
|
|
3695
3701
|
if (!r)
|
|
3696
3702
|
throw new RangeError(`No step type ${t.stepType} defined`);
|
|
3697
3703
|
return r.fromJSON(e, t);
|
|
@@ -3703,9 +3709,9 @@ class Z {
|
|
|
3703
3709
|
that's unlikely to clash with steps from other modules.
|
|
3704
3710
|
*/
|
|
3705
3711
|
static jsonID(e, t) {
|
|
3706
|
-
if (e in
|
|
3712
|
+
if (e in Kn)
|
|
3707
3713
|
throw new RangeError("Duplicate use of step JSON ID " + e);
|
|
3708
|
-
return
|
|
3714
|
+
return Kn[e] = t, t.prototype.jsonID = e, t;
|
|
3709
3715
|
}
|
|
3710
3716
|
}
|
|
3711
3717
|
class B {
|
|
@@ -3736,7 +3742,7 @@ class B {
|
|
|
3736
3742
|
try {
|
|
3737
3743
|
return B.ok(e.replace(t, r, i));
|
|
3738
3744
|
} catch (s) {
|
|
3739
|
-
if (s instanceof
|
|
3745
|
+
if (s instanceof fn)
|
|
3740
3746
|
return B.fail(s.message);
|
|
3741
3747
|
throw s;
|
|
3742
3748
|
}
|
|
@@ -3853,7 +3859,7 @@ class Be extends Z {
|
|
|
3853
3859
|
return new Be(this.pos, this.mark);
|
|
3854
3860
|
}
|
|
3855
3861
|
}
|
|
3856
|
-
return new
|
|
3862
|
+
return new st(this.pos, this.mark);
|
|
3857
3863
|
}
|
|
3858
3864
|
map(e) {
|
|
3859
3865
|
let t = e.mapResult(this.pos, 1);
|
|
@@ -3872,7 +3878,7 @@ class Be extends Z {
|
|
|
3872
3878
|
}
|
|
3873
3879
|
}
|
|
3874
3880
|
Z.jsonID("addNodeMark", Be);
|
|
3875
|
-
class
|
|
3881
|
+
class st extends Z {
|
|
3876
3882
|
/**
|
|
3877
3883
|
Create a mark-removing step.
|
|
3878
3884
|
*/
|
|
@@ -3892,7 +3898,7 @@ class it extends Z {
|
|
|
3892
3898
|
}
|
|
3893
3899
|
map(e) {
|
|
3894
3900
|
let t = e.mapResult(this.pos, 1);
|
|
3895
|
-
return t.deletedAfter ? null : new
|
|
3901
|
+
return t.deletedAfter ? null : new st(t.pos, this.mark);
|
|
3896
3902
|
}
|
|
3897
3903
|
toJSON() {
|
|
3898
3904
|
return { stepType: "removeNodeMark", pos: this.pos, mark: this.mark.toJSON() };
|
|
@@ -3903,10 +3909,10 @@ class it extends Z {
|
|
|
3903
3909
|
static fromJSON(e, t) {
|
|
3904
3910
|
if (typeof t.pos != "number")
|
|
3905
3911
|
throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");
|
|
3906
|
-
return new
|
|
3912
|
+
return new st(t.pos, e.markFromJSON(t.mark));
|
|
3907
3913
|
}
|
|
3908
3914
|
}
|
|
3909
|
-
Z.jsonID("removeNodeMark",
|
|
3915
|
+
Z.jsonID("removeNodeMark", st);
|
|
3910
3916
|
class P extends Z {
|
|
3911
3917
|
/**
|
|
3912
3918
|
The given `slice` should fit the 'gap' between `from` and
|
|
@@ -3921,7 +3927,7 @@ class P extends Z {
|
|
|
3921
3927
|
super(), this.from = e, this.to = t, this.slice = r, this.structure = i;
|
|
3922
3928
|
}
|
|
3923
3929
|
apply(e) {
|
|
3924
|
-
return this.structure &&
|
|
3930
|
+
return this.structure && gr(e, this.from, this.to) ? B.fail("Structure replace would overwrite content") : B.fromReplace(e, this.from, this.to, this.slice);
|
|
3925
3931
|
}
|
|
3926
3932
|
getMap() {
|
|
3927
3933
|
return new oe([this.from, this.to - this.from, this.slice.size]);
|
|
@@ -3971,7 +3977,7 @@ class F extends Z {
|
|
|
3971
3977
|
super(), this.from = e, this.to = t, this.gapFrom = r, this.gapTo = i, this.slice = s, this.insert = o, this.structure = l;
|
|
3972
3978
|
}
|
|
3973
3979
|
apply(e) {
|
|
3974
|
-
if (this.structure && (
|
|
3980
|
+
if (this.structure && (gr(e, this.from, this.gapFrom) || gr(e, this.gapTo, this.to)))
|
|
3975
3981
|
return B.fail("Structure gap-replace would overwrite content");
|
|
3976
3982
|
let t = e.slice(this.gapFrom, this.gapTo);
|
|
3977
3983
|
if (t.openStart || t.openEnd)
|
|
@@ -4018,7 +4024,7 @@ class F extends Z {
|
|
|
4018
4024
|
}
|
|
4019
4025
|
}
|
|
4020
4026
|
Z.jsonID("replaceAround", F);
|
|
4021
|
-
function
|
|
4027
|
+
function gr(n, e, t) {
|
|
4022
4028
|
let r = n.resolve(e), i = t - e, s = r.depth;
|
|
4023
4029
|
for (; i > 0 && s > 0 && r.indexAfter(s) == r.node(s).childCount; )
|
|
4024
4030
|
s--, i--;
|
|
@@ -4053,7 +4059,7 @@ function Xl(n, e, t, r) {
|
|
|
4053
4059
|
return;
|
|
4054
4060
|
s++;
|
|
4055
4061
|
let a = null;
|
|
4056
|
-
if (r instanceof
|
|
4062
|
+
if (r instanceof Nn) {
|
|
4057
4063
|
let c = o.marks, d;
|
|
4058
4064
|
for (; d = r.isInSet(c); )
|
|
4059
4065
|
(a || (a = [])).push(d), c = d.removeFromSet(c);
|
|
@@ -4099,7 +4105,7 @@ function Br(n, e, t, r = t.contentMatch, i = !0) {
|
|
|
4099
4105
|
function Zl(n, e, t) {
|
|
4100
4106
|
return (e == 0 || n.canReplace(e, n.childCount)) && (t == n.childCount || n.canReplace(0, t));
|
|
4101
4107
|
}
|
|
4102
|
-
function
|
|
4108
|
+
function Ct(n) {
|
|
4103
4109
|
let t = n.parent.content.cutByIndex(n.startIndex, n.endIndex);
|
|
4104
4110
|
for (let r = n.depth, i = 0, s = 0; ; --r) {
|
|
4105
4111
|
let o = n.$from.node(r), l = n.$from.index(r) + i, a = n.$to.indexAfter(r) - s;
|
|
@@ -4253,7 +4259,7 @@ function la(n, e) {
|
|
|
4253
4259
|
function Ks(n, e) {
|
|
4254
4260
|
return !!(n && e && !n.isLeaf && la(n, e));
|
|
4255
4261
|
}
|
|
4256
|
-
function
|
|
4262
|
+
function An(n, e, t = -1) {
|
|
4257
4263
|
let r = n.resolve(e);
|
|
4258
4264
|
for (let i = r.depth; ; i--) {
|
|
4259
4265
|
let s, o, l = r.index(i);
|
|
@@ -4326,7 +4332,7 @@ function Js(n, e, t) {
|
|
|
4326
4332
|
}
|
|
4327
4333
|
return null;
|
|
4328
4334
|
}
|
|
4329
|
-
function
|
|
4335
|
+
function Dn(n, e, t = e, r = k.empty) {
|
|
4330
4336
|
if (e == t && !r.size)
|
|
4331
4337
|
return null;
|
|
4332
4338
|
let i = n.resolve(e), s = n.resolve(t);
|
|
@@ -4381,7 +4387,7 @@ class da {
|
|
|
4381
4387
|
for (let t = 1; t <= 2; t++)
|
|
4382
4388
|
for (let r = t == 1 ? e : this.unplaced.openStart; r >= 0; r--) {
|
|
4383
4389
|
let i, s = null;
|
|
4384
|
-
r ? (s =
|
|
4390
|
+
r ? (s = Jn(this.unplaced.content, r - 1).firstChild, i = s.content) : i = this.unplaced.content;
|
|
4385
4391
|
let o = i.firstChild;
|
|
4386
4392
|
for (let l = this.depth; l >= 0; l--) {
|
|
4387
4393
|
let { type: a, match: c } = this.frontier[l], d, u = null;
|
|
@@ -4395,16 +4401,16 @@ class da {
|
|
|
4395
4401
|
}
|
|
4396
4402
|
}
|
|
4397
4403
|
openMore() {
|
|
4398
|
-
let { content: e, openStart: t, openEnd: r } = this.unplaced, i =
|
|
4404
|
+
let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Jn(e, t);
|
|
4399
4405
|
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);
|
|
4400
4406
|
}
|
|
4401
4407
|
dropNode() {
|
|
4402
|
-
let { content: e, openStart: t, openEnd: r } = this.unplaced, i =
|
|
4408
|
+
let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Jn(e, t);
|
|
4403
4409
|
if (i.childCount <= 1 && t > 0) {
|
|
4404
4410
|
let s = e.size - t <= t + i.size;
|
|
4405
|
-
this.unplaced = new k(
|
|
4411
|
+
this.unplaced = new k(Et(e, t - 1, 1), t - 1, s ? t - 1 : r);
|
|
4406
4412
|
} else
|
|
4407
|
-
this.unplaced = new k(
|
|
4413
|
+
this.unplaced = new k(Et(e, t, 1), t, r);
|
|
4408
4414
|
}
|
|
4409
4415
|
// Move content from the unplaced slice at `sliceDepth` to the
|
|
4410
4416
|
// frontier node at `frontierDepth`. Close that frontier node when
|
|
@@ -4429,18 +4435,18 @@ class da {
|
|
|
4429
4435
|
c++, (c > 1 || a == 0 || m.content.size) && (u = g, d.push(_s(m.mark(f.allowedMarks(m.marks)), c == 1 ? a : 0, c == l.childCount ? h : -1)));
|
|
4430
4436
|
}
|
|
4431
4437
|
let p = c == l.childCount;
|
|
4432
|
-
p || (h = -1), this.placed =
|
|
4438
|
+
p || (h = -1), this.placed = vt(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();
|
|
4433
4439
|
for (let m = 0, g = l; m < h; m++) {
|
|
4434
4440
|
let y = g.lastChild;
|
|
4435
4441
|
this.frontier.push({ type: y.type, match: y.contentMatchAt(y.childCount) }), g = y.content;
|
|
4436
4442
|
}
|
|
4437
|
-
this.unplaced = p ? e == 0 ? k.empty : new k(
|
|
4443
|
+
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);
|
|
4438
4444
|
}
|
|
4439
4445
|
mustMoveInline() {
|
|
4440
4446
|
if (!this.$to.parent.isTextblock)
|
|
4441
4447
|
return -1;
|
|
4442
4448
|
let e = this.frontier[this.depth], t;
|
|
4443
|
-
if (!e.type.isTextblock || !
|
|
4449
|
+
if (!e.type.isTextblock || !Un(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
|
|
4444
4450
|
return -1;
|
|
4445
4451
|
let { depth: r } = this.$to, i = this.$to.after(r);
|
|
4446
4452
|
for (; r > 1 && i == this.$to.end(--r); )
|
|
@@ -4449,10 +4455,10 @@ class da {
|
|
|
4449
4455
|
}
|
|
4450
4456
|
findCloseLevel(e) {
|
|
4451
4457
|
e: for (let t = Math.min(this.depth, e.depth); t >= 0; t--) {
|
|
4452
|
-
let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o =
|
|
4458
|
+
let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = Un(e, t, i, r, s);
|
|
4453
4459
|
if (o) {
|
|
4454
4460
|
for (let l = t - 1; l >= 0; l--) {
|
|
4455
|
-
let { match: a, type: c } = this.frontier[l], d =
|
|
4461
|
+
let { match: a, type: c } = this.frontier[l], d = Un(e, l, c, a, !0);
|
|
4456
4462
|
if (!d || d.childCount)
|
|
4457
4463
|
continue e;
|
|
4458
4464
|
}
|
|
@@ -4466,7 +4472,7 @@ class da {
|
|
|
4466
4472
|
return null;
|
|
4467
4473
|
for (; this.depth > t.depth; )
|
|
4468
4474
|
this.closeFrontierNode();
|
|
4469
|
-
t.fit.childCount && (this.placed =
|
|
4475
|
+
t.fit.childCount && (this.placed = vt(this.placed, t.depth, t.fit)), e = t.move;
|
|
4470
4476
|
for (let r = t.depth + 1; r <= e.depth; r++) {
|
|
4471
4477
|
let i = e.node(r), s = i.type.contentMatch.fillBefore(i.content, !0, e.index(r));
|
|
4472
4478
|
this.openFrontierNode(i.type, i.attrs, s);
|
|
@@ -4475,20 +4481,20 @@ class da {
|
|
|
4475
4481
|
}
|
|
4476
4482
|
openFrontierNode(e, t = null, r) {
|
|
4477
4483
|
let i = this.frontier[this.depth];
|
|
4478
|
-
i.match = i.match.matchType(e), this.placed =
|
|
4484
|
+
i.match = i.match.matchType(e), this.placed = vt(this.placed, this.depth, b.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
|
|
4479
4485
|
}
|
|
4480
4486
|
closeFrontierNode() {
|
|
4481
4487
|
let t = this.frontier.pop().match.fillBefore(b.empty, !0);
|
|
4482
|
-
t.childCount && (this.placed =
|
|
4488
|
+
t.childCount && (this.placed = vt(this.placed, this.frontier.length, t));
|
|
4483
4489
|
}
|
|
4484
4490
|
}
|
|
4485
|
-
function Ot(n, e, t) {
|
|
4486
|
-
return e == 0 ? n.cutByIndex(t, n.childCount) : n.replaceChild(0, n.firstChild.copy(Ot(n.firstChild.content, e - 1, t)));
|
|
4487
|
-
}
|
|
4488
4491
|
function Et(n, e, t) {
|
|
4489
|
-
return e == 0 ? n.
|
|
4492
|
+
return e == 0 ? n.cutByIndex(t, n.childCount) : n.replaceChild(0, n.firstChild.copy(Et(n.firstChild.content, e - 1, t)));
|
|
4490
4493
|
}
|
|
4491
|
-
function
|
|
4494
|
+
function vt(n, e, t) {
|
|
4495
|
+
return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(vt(n.lastChild.content, e - 1, t)));
|
|
4496
|
+
}
|
|
4497
|
+
function Jn(n, e) {
|
|
4492
4498
|
for (let t = 0; t < e; t++)
|
|
4493
4499
|
n = n.firstChild.content;
|
|
4494
4500
|
return n;
|
|
@@ -4499,7 +4505,7 @@ function _s(n, e, t) {
|
|
|
4499
4505
|
let r = n.content;
|
|
4500
4506
|
return e > 1 && (r = r.replaceChild(0, _s(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);
|
|
4501
4507
|
}
|
|
4502
|
-
function
|
|
4508
|
+
function Un(n, e, t, r, i) {
|
|
4503
4509
|
let s = n.node(e), o = i ? n.indexAfter(e) : n.index(e);
|
|
4504
4510
|
if (o == s.childCount && !t.compatibleContent(s.type))
|
|
4505
4511
|
return null;
|
|
@@ -4619,7 +4625,7 @@ function Ys(n, e) {
|
|
|
4619
4625
|
}
|
|
4620
4626
|
return t;
|
|
4621
4627
|
}
|
|
4622
|
-
class
|
|
4628
|
+
class yt extends Z {
|
|
4623
4629
|
/**
|
|
4624
4630
|
Construct an attribute step.
|
|
4625
4631
|
*/
|
|
@@ -4641,11 +4647,11 @@ class gt extends Z {
|
|
|
4641
4647
|
return oe.empty;
|
|
4642
4648
|
}
|
|
4643
4649
|
invert(e) {
|
|
4644
|
-
return new
|
|
4650
|
+
return new yt(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);
|
|
4645
4651
|
}
|
|
4646
4652
|
map(e) {
|
|
4647
4653
|
let t = e.mapResult(this.pos, 1);
|
|
4648
|
-
return t.deletedAfter ? null : new
|
|
4654
|
+
return t.deletedAfter ? null : new yt(t.pos, this.attr, this.value);
|
|
4649
4655
|
}
|
|
4650
4656
|
toJSON() {
|
|
4651
4657
|
return { stepType: "attr", pos: this.pos, attr: this.attr, value: this.value };
|
|
@@ -4653,11 +4659,11 @@ class gt extends Z {
|
|
|
4653
4659
|
static fromJSON(e, t) {
|
|
4654
4660
|
if (typeof t.pos != "number" || typeof t.attr != "string")
|
|
4655
4661
|
throw new RangeError("Invalid input for AttrStep.fromJSON");
|
|
4656
|
-
return new
|
|
4662
|
+
return new yt(t.pos, t.attr, t.value);
|
|
4657
4663
|
}
|
|
4658
4664
|
}
|
|
4659
|
-
Z.jsonID("attr",
|
|
4660
|
-
class
|
|
4665
|
+
Z.jsonID("attr", yt);
|
|
4666
|
+
class zt extends Z {
|
|
4661
4667
|
/**
|
|
4662
4668
|
Construct an attribute step.
|
|
4663
4669
|
*/
|
|
@@ -4676,7 +4682,7 @@ class Lt extends Z {
|
|
|
4676
4682
|
return oe.empty;
|
|
4677
4683
|
}
|
|
4678
4684
|
invert(e) {
|
|
4679
|
-
return new
|
|
4685
|
+
return new zt(this.attr, e.attrs[this.attr]);
|
|
4680
4686
|
}
|
|
4681
4687
|
map(e) {
|
|
4682
4688
|
return this;
|
|
@@ -4687,25 +4693,25 @@ class Lt extends Z {
|
|
|
4687
4693
|
static fromJSON(e, t) {
|
|
4688
4694
|
if (typeof t.attr != "string")
|
|
4689
4695
|
throw new RangeError("Invalid input for DocAttrStep.fromJSON");
|
|
4690
|
-
return new
|
|
4696
|
+
return new zt(t.attr, t.value);
|
|
4691
4697
|
}
|
|
4692
4698
|
}
|
|
4693
|
-
Z.jsonID("docAttr",
|
|
4694
|
-
let
|
|
4699
|
+
Z.jsonID("docAttr", zt);
|
|
4700
|
+
let xt = class extends Error {
|
|
4695
4701
|
};
|
|
4696
|
-
|
|
4702
|
+
xt = function n(e) {
|
|
4697
4703
|
let t = Error.call(this, e);
|
|
4698
4704
|
return t.__proto__ = n.prototype, t;
|
|
4699
4705
|
};
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4706
|
+
xt.prototype = Object.create(Error.prototype);
|
|
4707
|
+
xt.prototype.constructor = xt;
|
|
4708
|
+
xt.prototype.name = "TransformError";
|
|
4703
4709
|
class ga {
|
|
4704
4710
|
/**
|
|
4705
4711
|
Create a transform that starts with the given document.
|
|
4706
4712
|
*/
|
|
4707
4713
|
constructor(e) {
|
|
4708
|
-
this.doc = e, this.steps = [], this.docs = [], this.mapping = new
|
|
4714
|
+
this.doc = e, this.steps = [], this.docs = [], this.mapping = new Lt();
|
|
4709
4715
|
}
|
|
4710
4716
|
/**
|
|
4711
4717
|
The starting document.
|
|
@@ -4720,7 +4726,7 @@ class ga {
|
|
|
4720
4726
|
step(e) {
|
|
4721
4727
|
let t = this.maybeStep(e);
|
|
4722
4728
|
if (t.failed)
|
|
4723
|
-
throw new
|
|
4729
|
+
throw new xt(t.failed);
|
|
4724
4730
|
return this;
|
|
4725
4731
|
}
|
|
4726
4732
|
/**
|
|
@@ -4765,7 +4771,7 @@ class ga {
|
|
|
4765
4771
|
given `slice`.
|
|
4766
4772
|
*/
|
|
4767
4773
|
replace(e, t = e, r = k.empty) {
|
|
4768
|
-
let i =
|
|
4774
|
+
let i = Dn(this.doc, e, t, r);
|
|
4769
4775
|
return i && this.step(i), this;
|
|
4770
4776
|
}
|
|
4771
4777
|
/**
|
|
@@ -4873,13 +4879,13 @@ class ga {
|
|
|
4873
4879
|
to set attributes on the document itself.
|
|
4874
4880
|
*/
|
|
4875
4881
|
setNodeAttribute(e, t, r) {
|
|
4876
|
-
return this.step(new
|
|
4882
|
+
return this.step(new yt(e, t, r)), this;
|
|
4877
4883
|
}
|
|
4878
4884
|
/**
|
|
4879
4885
|
Set a single attribute on the document to a new value.
|
|
4880
4886
|
*/
|
|
4881
4887
|
setDocAttribute(e, t) {
|
|
4882
|
-
return this.step(new
|
|
4888
|
+
return this.step(new zt(e, t)), this;
|
|
4883
4889
|
}
|
|
4884
4890
|
/**
|
|
4885
4891
|
Add a mark to the node at position `pos`.
|
|
@@ -4896,11 +4902,11 @@ class ga {
|
|
|
4896
4902
|
if (!r)
|
|
4897
4903
|
throw new RangeError("No node at position " + e);
|
|
4898
4904
|
if (t instanceof A)
|
|
4899
|
-
t.isInSet(r.marks) && this.step(new
|
|
4905
|
+
t.isInSet(r.marks) && this.step(new st(e, t));
|
|
4900
4906
|
else {
|
|
4901
4907
|
let i = r.marks, s, o = [];
|
|
4902
4908
|
for (; s = t.isInSet(i); )
|
|
4903
|
-
o.push(new
|
|
4909
|
+
o.push(new st(e, s)), i = s.removeFromSet(i);
|
|
4904
4910
|
for (let l = o.length - 1; l >= 0; l--)
|
|
4905
4911
|
this.step(o[l]);
|
|
4906
4912
|
}
|
|
@@ -4941,8 +4947,8 @@ class ga {
|
|
|
4941
4947
|
return Br(this, e, t, r), this;
|
|
4942
4948
|
}
|
|
4943
4949
|
}
|
|
4944
|
-
const
|
|
4945
|
-
class
|
|
4950
|
+
const _n = /* @__PURE__ */ Object.create(null);
|
|
4951
|
+
class E {
|
|
4946
4952
|
/**
|
|
4947
4953
|
Initialize a selection with the head and anchor and ranges. If no
|
|
4948
4954
|
ranges are given, constructs a single range across `$anchor` and
|
|
@@ -5036,11 +5042,11 @@ class O {
|
|
|
5036
5042
|
found.
|
|
5037
5043
|
*/
|
|
5038
5044
|
static findFrom(e, t, r = !1) {
|
|
5039
|
-
let i = e.parent.inlineContent ? new M(e) :
|
|
5045
|
+
let i = e.parent.inlineContent ? new M(e) : ht(e.node(0), e.parent, e.pos, e.index(), t, r);
|
|
5040
5046
|
if (i)
|
|
5041
5047
|
return i;
|
|
5042
5048
|
for (let s = e.depth - 1; s >= 0; s--) {
|
|
5043
|
-
let o = t < 0 ?
|
|
5049
|
+
let o = t < 0 ? ht(e.node(0), e.node(s), e.before(s + 1), e.index(s), t, r) : ht(e.node(0), e.node(s), e.after(s + 1), e.index(s) + 1, t, r);
|
|
5044
5050
|
if (o)
|
|
5045
5051
|
return o;
|
|
5046
5052
|
}
|
|
@@ -5061,14 +5067,14 @@ class O {
|
|
|
5061
5067
|
exists.
|
|
5062
5068
|
*/
|
|
5063
5069
|
static atStart(e) {
|
|
5064
|
-
return
|
|
5070
|
+
return ht(e, e, 0, 0, 1) || new ae(e);
|
|
5065
5071
|
}
|
|
5066
5072
|
/**
|
|
5067
5073
|
Find the cursor or leaf node selection closest to the end of the
|
|
5068
5074
|
given document.
|
|
5069
5075
|
*/
|
|
5070
5076
|
static atEnd(e) {
|
|
5071
|
-
return
|
|
5077
|
+
return ht(e, e, e.content.size, e.childCount, -1) || new ae(e);
|
|
5072
5078
|
}
|
|
5073
5079
|
/**
|
|
5074
5080
|
Deserialize the JSON representation of a selection. Must be
|
|
@@ -5077,7 +5083,7 @@ class O {
|
|
|
5077
5083
|
static fromJSON(e, t) {
|
|
5078
5084
|
if (!t || !t.type)
|
|
5079
5085
|
throw new RangeError("Invalid input for Selection.fromJSON");
|
|
5080
|
-
let r =
|
|
5086
|
+
let r = _n[t.type];
|
|
5081
5087
|
if (!r)
|
|
5082
5088
|
throw new RangeError(`No selection type ${t.type} defined`);
|
|
5083
5089
|
return r.fromJSON(e, t);
|
|
@@ -5089,9 +5095,9 @@ class O {
|
|
|
5089
5095
|
clash with classes from other modules.
|
|
5090
5096
|
*/
|
|
5091
5097
|
static jsonID(e, t) {
|
|
5092
|
-
if (e in
|
|
5098
|
+
if (e in _n)
|
|
5093
5099
|
throw new RangeError("Duplicate use of selection JSON ID " + e);
|
|
5094
|
-
return
|
|
5100
|
+
return _n[e] = t, t.prototype.jsonID = e, t;
|
|
5095
5101
|
}
|
|
5096
5102
|
/**
|
|
5097
5103
|
Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
|
|
@@ -5106,7 +5112,7 @@ class O {
|
|
|
5106
5112
|
return M.between(this.$anchor, this.$head).getBookmark();
|
|
5107
5113
|
}
|
|
5108
5114
|
}
|
|
5109
|
-
|
|
5115
|
+
E.prototype.visible = !0;
|
|
5110
5116
|
class ya {
|
|
5111
5117
|
/**
|
|
5112
5118
|
Create a range.
|
|
@@ -5119,7 +5125,7 @@ let bi = !1;
|
|
|
5119
5125
|
function ki(n) {
|
|
5120
5126
|
!bi && !n.parent.inlineContent && (bi = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
|
|
5121
5127
|
}
|
|
5122
|
-
class M extends
|
|
5128
|
+
class M extends E {
|
|
5123
5129
|
/**
|
|
5124
5130
|
Construct a text selection between the given points.
|
|
5125
5131
|
*/
|
|
@@ -5136,7 +5142,7 @@ class M extends O {
|
|
|
5136
5142
|
map(e, t) {
|
|
5137
5143
|
let r = e.resolve(t.map(this.head));
|
|
5138
5144
|
if (!r.parent.inlineContent)
|
|
5139
|
-
return
|
|
5145
|
+
return E.near(r);
|
|
5140
5146
|
let i = e.resolve(t.map(this.anchor));
|
|
5141
5147
|
return new M(i.parent.inlineContent ? i : r, r);
|
|
5142
5148
|
}
|
|
@@ -5150,7 +5156,7 @@ class M extends O {
|
|
|
5150
5156
|
return e instanceof M && e.anchor == this.anchor && e.head == this.head;
|
|
5151
5157
|
}
|
|
5152
5158
|
getBookmark() {
|
|
5153
|
-
return new
|
|
5159
|
+
return new In(this.anchor, this.head);
|
|
5154
5160
|
}
|
|
5155
5161
|
toJSON() {
|
|
5156
5162
|
return { type: "text", anchor: this.anchor, head: this.head };
|
|
@@ -5181,28 +5187,28 @@ class M extends O {
|
|
|
5181
5187
|
static between(e, t, r) {
|
|
5182
5188
|
let i = e.pos - t.pos;
|
|
5183
5189
|
if ((!r || i) && (r = i >= 0 ? 1 : -1), !t.parent.inlineContent) {
|
|
5184
|
-
let s =
|
|
5190
|
+
let s = E.findFrom(t, r, !0) || E.findFrom(t, -r, !0);
|
|
5185
5191
|
if (s)
|
|
5186
5192
|
t = s.$head;
|
|
5187
5193
|
else
|
|
5188
|
-
return
|
|
5194
|
+
return E.near(t, r);
|
|
5189
5195
|
}
|
|
5190
|
-
return e.parent.inlineContent || (i == 0 ? e = t : (e = (
|
|
5196
|
+
return e.parent.inlineContent || (i == 0 ? e = t : (e = (E.findFrom(e, -r, !0) || E.findFrom(e, r, !0)).$anchor, e.pos < t.pos != i < 0 && (e = t))), new M(e, t);
|
|
5191
5197
|
}
|
|
5192
5198
|
}
|
|
5193
|
-
|
|
5194
|
-
class
|
|
5199
|
+
E.jsonID("text", M);
|
|
5200
|
+
class In {
|
|
5195
5201
|
constructor(e, t) {
|
|
5196
5202
|
this.anchor = e, this.head = t;
|
|
5197
5203
|
}
|
|
5198
5204
|
map(e) {
|
|
5199
|
-
return new
|
|
5205
|
+
return new In(e.map(this.anchor), e.map(this.head));
|
|
5200
5206
|
}
|
|
5201
5207
|
resolve(e) {
|
|
5202
5208
|
return M.between(e.resolve(this.anchor), e.resolve(this.head));
|
|
5203
5209
|
}
|
|
5204
5210
|
}
|
|
5205
|
-
class S extends
|
|
5211
|
+
class S extends E {
|
|
5206
5212
|
/**
|
|
5207
5213
|
Create a node selection. Does not verify the validity of its
|
|
5208
5214
|
argument.
|
|
@@ -5213,7 +5219,7 @@ class S extends O {
|
|
|
5213
5219
|
}
|
|
5214
5220
|
map(e, t) {
|
|
5215
5221
|
let { deleted: r, pos: i } = t.mapResult(this.anchor), s = e.resolve(i);
|
|
5216
|
-
return r ?
|
|
5222
|
+
return r ? E.near(s) : new S(s);
|
|
5217
5223
|
}
|
|
5218
5224
|
content() {
|
|
5219
5225
|
return new k(b.from(this.node), 0, 0);
|
|
@@ -5250,21 +5256,21 @@ class S extends O {
|
|
|
5250
5256
|
}
|
|
5251
5257
|
}
|
|
5252
5258
|
S.prototype.visible = !1;
|
|
5253
|
-
|
|
5259
|
+
E.jsonID("node", S);
|
|
5254
5260
|
class zr {
|
|
5255
5261
|
constructor(e) {
|
|
5256
5262
|
this.anchor = e;
|
|
5257
5263
|
}
|
|
5258
5264
|
map(e) {
|
|
5259
5265
|
let { deleted: t, pos: r } = e.mapResult(this.anchor);
|
|
5260
|
-
return t ? new
|
|
5266
|
+
return t ? new In(r, r) : new zr(r);
|
|
5261
5267
|
}
|
|
5262
5268
|
resolve(e) {
|
|
5263
5269
|
let t = e.resolve(this.anchor), r = t.nodeAfter;
|
|
5264
|
-
return r && S.isSelectable(r) ? new S(t) :
|
|
5270
|
+
return r && S.isSelectable(r) ? new S(t) : E.near(t);
|
|
5265
5271
|
}
|
|
5266
5272
|
}
|
|
5267
|
-
class ae extends
|
|
5273
|
+
class ae extends E {
|
|
5268
5274
|
/**
|
|
5269
5275
|
Create an all-selection over the given document.
|
|
5270
5276
|
*/
|
|
@@ -5274,7 +5280,7 @@ class ae extends O {
|
|
|
5274
5280
|
replace(e, t = k.empty) {
|
|
5275
5281
|
if (t == k.empty) {
|
|
5276
5282
|
e.delete(0, e.doc.content.size);
|
|
5277
|
-
let r =
|
|
5283
|
+
let r = E.atStart(e.doc);
|
|
5278
5284
|
r.eq(e.selection) || e.setSelection(r);
|
|
5279
5285
|
} else
|
|
5280
5286
|
super.replace(e, t);
|
|
@@ -5298,7 +5304,7 @@ class ae extends O {
|
|
|
5298
5304
|
return ba;
|
|
5299
5305
|
}
|
|
5300
5306
|
}
|
|
5301
|
-
|
|
5307
|
+
E.jsonID("all", ae);
|
|
5302
5308
|
const ba = {
|
|
5303
5309
|
map() {
|
|
5304
5310
|
return this;
|
|
@@ -5307,7 +5313,7 @@ const ba = {
|
|
|
5307
5313
|
return new ae(n);
|
|
5308
5314
|
}
|
|
5309
5315
|
};
|
|
5310
|
-
function
|
|
5316
|
+
function ht(n, e, t, r, i, s = !1) {
|
|
5311
5317
|
if (e.inlineContent)
|
|
5312
5318
|
return M.create(n, t);
|
|
5313
5319
|
for (let o = r - (i > 0 ? 0 : 1); i > 0 ? o < e.childCount : o >= 0; o += i) {
|
|
@@ -5316,7 +5322,7 @@ function ft(n, e, t, r, i, s = !1) {
|
|
|
5316
5322
|
if (!s && S.isSelectable(l))
|
|
5317
5323
|
return S.create(n, t - (i < 0 ? l.nodeSize : 0));
|
|
5318
5324
|
} else {
|
|
5319
|
-
let a =
|
|
5325
|
+
let a = ht(n, l, t + i, i < 0 ? l.childCount : 0, i, s);
|
|
5320
5326
|
if (a)
|
|
5321
5327
|
return a;
|
|
5322
5328
|
}
|
|
@@ -5334,9 +5340,9 @@ function xi(n, e, t) {
|
|
|
5334
5340
|
let s = n.mapping.maps[r], o;
|
|
5335
5341
|
s.forEach((l, a, c, d) => {
|
|
5336
5342
|
o == null && (o = d);
|
|
5337
|
-
}), n.setSelection(
|
|
5343
|
+
}), n.setSelection(E.near(n.doc.resolve(o), t));
|
|
5338
5344
|
}
|
|
5339
|
-
const Si = 1,
|
|
5345
|
+
const Si = 1, en = 2, Mi = 4;
|
|
5340
5346
|
class ka extends ga {
|
|
5341
5347
|
/**
|
|
5342
5348
|
@internal
|
|
@@ -5360,7 +5366,7 @@ class ka extends ga {
|
|
|
5360
5366
|
setSelection(e) {
|
|
5361
5367
|
if (e.$from.doc != this.doc)
|
|
5362
5368
|
throw new RangeError("Selection passed to setSelection must point at the current document");
|
|
5363
|
-
return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | Si) & ~
|
|
5369
|
+
return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | Si) & ~en, this.storedMarks = null, this;
|
|
5364
5370
|
}
|
|
5365
5371
|
/**
|
|
5366
5372
|
Whether the selection was explicitly updated by this transaction.
|
|
@@ -5372,7 +5378,7 @@ class ka extends ga {
|
|
|
5372
5378
|
Set the current stored marks.
|
|
5373
5379
|
*/
|
|
5374
5380
|
setStoredMarks(e) {
|
|
5375
|
-
return this.storedMarks = e, this.updated |=
|
|
5381
|
+
return this.storedMarks = e, this.updated |= en, this;
|
|
5376
5382
|
}
|
|
5377
5383
|
/**
|
|
5378
5384
|
Make sure the current stored marks or, if that is null, the marks
|
|
@@ -5398,13 +5404,13 @@ class ka extends ga {
|
|
|
5398
5404
|
Whether the stored marks were explicitly set for this transaction.
|
|
5399
5405
|
*/
|
|
5400
5406
|
get storedMarksSet() {
|
|
5401
|
-
return (this.updated &
|
|
5407
|
+
return (this.updated & en) > 0;
|
|
5402
5408
|
}
|
|
5403
5409
|
/**
|
|
5404
5410
|
@internal
|
|
5405
5411
|
*/
|
|
5406
5412
|
addStep(e, t) {
|
|
5407
|
-
super.addStep(e, t), this.updated = this.updated & ~
|
|
5413
|
+
super.addStep(e, t), this.updated = this.updated & ~en, this.storedMarks = null;
|
|
5408
5414
|
}
|
|
5409
5415
|
/**
|
|
5410
5416
|
Update the timestamp for the transaction.
|
|
@@ -5449,7 +5455,7 @@ class ka extends ga {
|
|
|
5449
5455
|
let o = this.doc.resolve(t);
|
|
5450
5456
|
s = r == t ? o.marks() : o.marksAcross(this.doc.resolve(r));
|
|
5451
5457
|
}
|
|
5452
|
-
return this.replaceRangeWith(t, r, i.text(e, s)), !this.selection.empty && this.selection.to == t + e.length && this.setSelection(
|
|
5458
|
+
return this.replaceRangeWith(t, r, i.text(e, s)), !this.selection.empty && this.selection.to == t + e.length && this.setSelection(E.near(this.selection.$to)), this;
|
|
5453
5459
|
}
|
|
5454
5460
|
}
|
|
5455
5461
|
/**
|
|
@@ -5491,13 +5497,13 @@ class ka extends ga {
|
|
|
5491
5497
|
function wi(n, e) {
|
|
5492
5498
|
return !e || !n ? n : n.bind(e);
|
|
5493
5499
|
}
|
|
5494
|
-
class
|
|
5500
|
+
class Nt {
|
|
5495
5501
|
constructor(e, t, r) {
|
|
5496
5502
|
this.name = e, this.init = wi(t.init, r), this.apply = wi(t.apply, r);
|
|
5497
5503
|
}
|
|
5498
5504
|
}
|
|
5499
5505
|
const xa = [
|
|
5500
|
-
new
|
|
5506
|
+
new Nt("doc", {
|
|
5501
5507
|
init(n) {
|
|
5502
5508
|
return n.doc || n.schema.topNodeType.createAndFill();
|
|
5503
5509
|
},
|
|
@@ -5505,15 +5511,15 @@ const xa = [
|
|
|
5505
5511
|
return n.doc;
|
|
5506
5512
|
}
|
|
5507
5513
|
}),
|
|
5508
|
-
new
|
|
5514
|
+
new Nt("selection", {
|
|
5509
5515
|
init(n, e) {
|
|
5510
|
-
return n.selection ||
|
|
5516
|
+
return n.selection || E.atStart(e.doc);
|
|
5511
5517
|
},
|
|
5512
5518
|
apply(n) {
|
|
5513
5519
|
return n.selection;
|
|
5514
5520
|
}
|
|
5515
5521
|
}),
|
|
5516
|
-
new
|
|
5522
|
+
new Nt("storedMarks", {
|
|
5517
5523
|
init(n) {
|
|
5518
5524
|
return n.storedMarks || null;
|
|
5519
5525
|
},
|
|
@@ -5521,7 +5527,7 @@ const xa = [
|
|
|
5521
5527
|
return r.selection.$cursor ? n.storedMarks : null;
|
|
5522
5528
|
}
|
|
5523
5529
|
}),
|
|
5524
|
-
new
|
|
5530
|
+
new Nt("scrollToSelection", {
|
|
5525
5531
|
init() {
|
|
5526
5532
|
return 0;
|
|
5527
5533
|
},
|
|
@@ -5530,16 +5536,16 @@ const xa = [
|
|
|
5530
5536
|
}
|
|
5531
5537
|
})
|
|
5532
5538
|
];
|
|
5533
|
-
class
|
|
5539
|
+
class Gn {
|
|
5534
5540
|
constructor(e, t) {
|
|
5535
5541
|
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = xa.slice(), t && t.forEach((r) => {
|
|
5536
5542
|
if (this.pluginsByKey[r.key])
|
|
5537
5543
|
throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
|
|
5538
|
-
this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new
|
|
5544
|
+
this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new Nt(r.key, r.spec.state, r));
|
|
5539
5545
|
});
|
|
5540
5546
|
}
|
|
5541
5547
|
}
|
|
5542
|
-
class
|
|
5548
|
+
class mt {
|
|
5543
5549
|
/**
|
|
5544
5550
|
@internal
|
|
5545
5551
|
*/
|
|
@@ -5614,7 +5620,7 @@ class pt {
|
|
|
5614
5620
|
applyInner(e) {
|
|
5615
5621
|
if (!e.before.eq(this.doc))
|
|
5616
5622
|
throw new RangeError("Applying a mismatched transaction");
|
|
5617
|
-
let t = new
|
|
5623
|
+
let t = new mt(this.config), r = this.config.fields;
|
|
5618
5624
|
for (let i = 0; i < r.length; i++) {
|
|
5619
5625
|
let s = r[i];
|
|
5620
5626
|
t[s.name] = s.apply(e, this[s.name], this, t);
|
|
@@ -5631,7 +5637,7 @@ class pt {
|
|
|
5631
5637
|
Create a new state.
|
|
5632
5638
|
*/
|
|
5633
5639
|
static create(e) {
|
|
5634
|
-
let t = new
|
|
5640
|
+
let t = new Gn(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new mt(t);
|
|
5635
5641
|
for (let i = 0; i < t.fields.length; i++)
|
|
5636
5642
|
r[t.fields[i].name] = t.fields[i].init(e, r);
|
|
5637
5643
|
return r;
|
|
@@ -5645,7 +5651,7 @@ class pt {
|
|
|
5645
5651
|
configuration object..
|
|
5646
5652
|
*/
|
|
5647
5653
|
reconfigure(e) {
|
|
5648
|
-
let t = new
|
|
5654
|
+
let t = new Gn(this.schema, e.plugins), r = t.fields, i = new mt(t);
|
|
5649
5655
|
for (let s = 0; s < r.length; s++) {
|
|
5650
5656
|
let o = r[s].name;
|
|
5651
5657
|
i[o] = this.hasOwnProperty(o) ? this[o] : r[s].init(e, i);
|
|
@@ -5682,12 +5688,12 @@ class pt {
|
|
|
5682
5688
|
throw new RangeError("Invalid input for EditorState.fromJSON");
|
|
5683
5689
|
if (!e.schema)
|
|
5684
5690
|
throw new RangeError("Required config field 'schema' missing");
|
|
5685
|
-
let i = new
|
|
5691
|
+
let i = new Gn(e.schema, e.plugins), s = new mt(i);
|
|
5686
5692
|
return i.fields.forEach((o) => {
|
|
5687
5693
|
if (o.name == "doc")
|
|
5688
5694
|
s.doc = ze.fromJSON(e.schema, t.doc);
|
|
5689
5695
|
else if (o.name == "selection")
|
|
5690
|
-
s.selection =
|
|
5696
|
+
s.selection = E.fromJSON(s.doc, t.selection);
|
|
5691
5697
|
else if (o.name == "storedMarks")
|
|
5692
5698
|
t.storedMarks && (s.storedMarks = t.storedMarks.map(e.schema.markFromJSON));
|
|
5693
5699
|
else {
|
|
@@ -5725,9 +5731,9 @@ class se {
|
|
|
5725
5731
|
return e[this.key];
|
|
5726
5732
|
}
|
|
5727
5733
|
}
|
|
5728
|
-
const
|
|
5734
|
+
const Yn = /* @__PURE__ */ Object.create(null);
|
|
5729
5735
|
function Zs(n) {
|
|
5730
|
-
return n in
|
|
5736
|
+
return n in Yn ? n + "$" + ++Yn[n] : (Yn[n] = 0, n + "$");
|
|
5731
5737
|
}
|
|
5732
5738
|
class we {
|
|
5733
5739
|
/**
|
|
@@ -5754,17 +5760,17 @@ const K = function(n) {
|
|
|
5754
5760
|
for (var e = 0; ; e++)
|
|
5755
5761
|
if (n = n.previousSibling, !n)
|
|
5756
5762
|
return e;
|
|
5757
|
-
},
|
|
5763
|
+
}, St = function(n) {
|
|
5758
5764
|
let e = n.assignedSlot || n.parentNode;
|
|
5759
5765
|
return e && e.nodeType == 11 ? e.host : e;
|
|
5760
5766
|
};
|
|
5761
|
-
let
|
|
5767
|
+
let yr = null;
|
|
5762
5768
|
const Te = function(n, e, t) {
|
|
5763
|
-
let r =
|
|
5769
|
+
let r = yr || (yr = document.createRange());
|
|
5764
5770
|
return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
|
|
5765
5771
|
}, Sa = function() {
|
|
5766
|
-
|
|
5767
|
-
},
|
|
5772
|
+
yr = null;
|
|
5773
|
+
}, ot = function(n, e, t, r) {
|
|
5768
5774
|
return t && (Ci(n, e, t, r, -1) || Ci(n, e, t, r, 1));
|
|
5769
5775
|
}, Ma = /^(img|br|input|textarea|hr)$/i;
|
|
5770
5776
|
function Ci(n, e, t, r, i) {
|
|
@@ -5773,7 +5779,7 @@ function Ci(n, e, t, r, i) {
|
|
|
5773
5779
|
return !0;
|
|
5774
5780
|
if (e == (i < 0 ? 0 : fe(n))) {
|
|
5775
5781
|
let o = n.parentNode;
|
|
5776
|
-
if (!o || o.nodeType != 1 ||
|
|
5782
|
+
if (!o || o.nodeType != 1 || Gt(n) || Ma.test(n.nodeName) || n.contentEditable == "false")
|
|
5777
5783
|
return !1;
|
|
5778
5784
|
e = K(n) + (i < 0 ? 0 : 1), n = o;
|
|
5779
5785
|
} else if (n.nodeType == 1) {
|
|
@@ -5800,7 +5806,7 @@ function wa(n, e) {
|
|
|
5800
5806
|
if (n.contentEditable == "false")
|
|
5801
5807
|
return null;
|
|
5802
5808
|
n = n.childNodes[e - 1], e = fe(n);
|
|
5803
|
-
} else if (n.parentNode && !
|
|
5809
|
+
} else if (n.parentNode && !Gt(n))
|
|
5804
5810
|
e = K(n), n = n.parentNode;
|
|
5805
5811
|
else
|
|
5806
5812
|
return null;
|
|
@@ -5814,7 +5820,7 @@ function Ca(n, e) {
|
|
|
5814
5820
|
if (n.contentEditable == "false")
|
|
5815
5821
|
return null;
|
|
5816
5822
|
n = n.childNodes[e], e = 0;
|
|
5817
|
-
} else if (n.parentNode && !
|
|
5823
|
+
} else if (n.parentNode && !Gt(n))
|
|
5818
5824
|
e = K(n) + 1, n = n.parentNode;
|
|
5819
5825
|
else
|
|
5820
5826
|
return null;
|
|
@@ -5830,14 +5836,14 @@ function Ta(n, e, t) {
|
|
|
5830
5836
|
r = r && s == 0, i = i && s == fe(n);
|
|
5831
5837
|
}
|
|
5832
5838
|
}
|
|
5833
|
-
function
|
|
5839
|
+
function Gt(n) {
|
|
5834
5840
|
let e;
|
|
5835
5841
|
for (let t = n; t && !(e = t.pmViewDesc); t = t.parentNode)
|
|
5836
5842
|
;
|
|
5837
5843
|
return e && e.node && e.node.isBlock && (e.dom == n || e.contentDOM == n);
|
|
5838
5844
|
}
|
|
5839
|
-
const
|
|
5840
|
-
return n.focusNode &&
|
|
5845
|
+
const Rn = function(n) {
|
|
5846
|
+
return n.focusNode && ot(n.focusNode, n.focusOffset, n.anchorNode, n.anchorOffset);
|
|
5841
5847
|
};
|
|
5842
5848
|
function Je(n, e) {
|
|
5843
5849
|
let t = document.createEvent("Event");
|
|
@@ -5863,9 +5869,9 @@ function Ea(n, e, t) {
|
|
|
5863
5869
|
return { node: r.startContainer, offset: Math.min(fe(r.startContainer), r.startOffset) };
|
|
5864
5870
|
}
|
|
5865
5871
|
}
|
|
5866
|
-
const xe = typeof navigator < "u" ? navigator : null, Ti = typeof document < "u" ? document : null, je = xe && xe.userAgent || "",
|
|
5872
|
+
const xe = typeof navigator < "u" ? navigator : null, Ti = typeof document < "u" ? document : null, je = xe && xe.userAgent || "", br = /Edge\/(\d+)/.exec(je), Qs = /MSIE \d/.exec(je), kr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(je), ie = !!(Qs || kr || br), $e = Qs ? document.documentMode : kr ? +kr[1] : br ? +br[1] : 0, pe = !ie && /gecko\/(\d+)/i.test(je);
|
|
5867
5873
|
pe && +(/Firefox\/(\d+)/.exec(je) || [0, 0])[1];
|
|
5868
|
-
const
|
|
5874
|
+
const xr = !ie && /Chrome\/(\d+)/.exec(je), U = !!xr, eo = xr ? +xr[1] : 0, X = !ie && !!xe && /Apple Computer/.test(xe.vendor), Mt = X && (/Mobile\/\w+/.test(je) || !!xe && xe.maxTouchPoints > 2), ue = Mt || (xe ? /Mac/.test(xe.platform) : !1), to = xe ? /Win/.test(xe.platform) : !1, Ee = /Android \d/.test(je), Yt = !!Ti && "webkitFontSmoothing" in Ti.documentElement.style, va = Yt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
5869
5875
|
function Na(n) {
|
|
5870
5876
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
5871
5877
|
return e ? {
|
|
@@ -5896,7 +5902,7 @@ function Oi(n, e, t) {
|
|
|
5896
5902
|
let r = n.someProp("scrollThreshold") || 0, i = n.someProp("scrollMargin") || 5, s = n.dom.ownerDocument;
|
|
5897
5903
|
for (let o = t || n.dom; o; ) {
|
|
5898
5904
|
if (o.nodeType != 1) {
|
|
5899
|
-
o =
|
|
5905
|
+
o = St(o);
|
|
5900
5906
|
continue;
|
|
5901
5907
|
}
|
|
5902
5908
|
let l = o, a = l == s.body, c = a ? Na(s) : Aa(l), d = 0, u = 0;
|
|
@@ -5912,7 +5918,7 @@ function Oi(n, e, t) {
|
|
|
5912
5918
|
let f = a ? "fixed" : getComputedStyle(o).position;
|
|
5913
5919
|
if (/^(fixed|sticky)$/.test(f))
|
|
5914
5920
|
break;
|
|
5915
|
-
o = f == "absolute" ? o.offsetParent :
|
|
5921
|
+
o = f == "absolute" ? o.offsetParent : St(o);
|
|
5916
5922
|
}
|
|
5917
5923
|
}
|
|
5918
5924
|
function Da(n) {
|
|
@@ -5931,7 +5937,7 @@ function Da(n) {
|
|
|
5931
5937
|
}
|
|
5932
5938
|
function no(n) {
|
|
5933
5939
|
let e = [], t = n.ownerDocument;
|
|
5934
|
-
for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r =
|
|
5940
|
+
for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r = St(r))
|
|
5935
5941
|
;
|
|
5936
5942
|
return e;
|
|
5937
5943
|
}
|
|
@@ -5945,18 +5951,18 @@ function ro(n, e) {
|
|
|
5945
5951
|
r.scrollTop != i + e && (r.scrollTop = i + e), r.scrollLeft != s && (r.scrollLeft = s);
|
|
5946
5952
|
}
|
|
5947
5953
|
}
|
|
5948
|
-
let
|
|
5954
|
+
let ut = null;
|
|
5949
5955
|
function Ra(n) {
|
|
5950
5956
|
if (n.setActive)
|
|
5951
5957
|
return n.setActive();
|
|
5952
|
-
if (
|
|
5953
|
-
return n.focus(
|
|
5958
|
+
if (ut)
|
|
5959
|
+
return n.focus(ut);
|
|
5954
5960
|
let e = no(n);
|
|
5955
|
-
n.focus(
|
|
5961
|
+
n.focus(ut == null ? {
|
|
5956
5962
|
get preventScroll() {
|
|
5957
|
-
return
|
|
5963
|
+
return ut = { preventScroll: !0 }, !0;
|
|
5958
5964
|
}
|
|
5959
|
-
} : void 0),
|
|
5965
|
+
} : void 0), ut || (ut = !1, ro(e, 0));
|
|
5960
5966
|
}
|
|
5961
5967
|
function io(n, e) {
|
|
5962
5968
|
let t, r = 2e8, i, s = 0, o = e.top, l = e.top, a, c;
|
|
@@ -6054,7 +6060,7 @@ function Fa(n, e) {
|
|
|
6054
6060
|
return null;
|
|
6055
6061
|
}
|
|
6056
6062
|
if (X)
|
|
6057
|
-
for (let c = o; r && c; c =
|
|
6063
|
+
for (let c = o; r && c; c = St(c))
|
|
6058
6064
|
c.draggable && (r = void 0);
|
|
6059
6065
|
if (o = Ba(o, e), r) {
|
|
6060
6066
|
if (pe && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
|
|
@@ -6062,7 +6068,7 @@ function Fa(n, e) {
|
|
|
6062
6068
|
d.nodeName == "IMG" && (u = d.getBoundingClientRect()).right <= e.left && u.bottom > e.top && i++;
|
|
6063
6069
|
}
|
|
6064
6070
|
let c;
|
|
6065
|
-
|
|
6071
|
+
Yt && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = za(n, r, i, e));
|
|
6066
6072
|
}
|
|
6067
6073
|
l == null && (l = La(n, o, e));
|
|
6068
6074
|
let a = n.docView.nearestDesc(o, !0);
|
|
@@ -6082,7 +6088,7 @@ function Ae(n, e) {
|
|
|
6082
6088
|
}
|
|
6083
6089
|
const $a = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
|
|
6084
6090
|
function oo(n, e, t) {
|
|
6085
|
-
let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o =
|
|
6091
|
+
let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = Yt || pe;
|
|
6086
6092
|
if (r.nodeType == 3)
|
|
6087
6093
|
if (o && ($a.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
|
|
6088
6094
|
let a = Ae(Te(r, i, i), t);
|
|
@@ -6091,31 +6097,31 @@ function oo(n, e, t) {
|
|
|
6091
6097
|
if (c.top == a.top) {
|
|
6092
6098
|
let d = Ae(Te(r, i, i + 1), -1);
|
|
6093
6099
|
if (d.top != a.top)
|
|
6094
|
-
return
|
|
6100
|
+
return Tt(d, d.left < c.left);
|
|
6095
6101
|
}
|
|
6096
6102
|
}
|
|
6097
6103
|
return a;
|
|
6098
6104
|
} else {
|
|
6099
6105
|
let a = i, c = i, d = t < 0 ? 1 : -1;
|
|
6100
|
-
return t < 0 && !i ? (c++, d = -1) : t >= 0 && i == r.nodeValue.length ? (a--, d = 1) : t < 0 ? a-- : c++,
|
|
6106
|
+
return t < 0 && !i ? (c++, d = -1) : t >= 0 && i == r.nodeValue.length ? (a--, d = 1) : t < 0 ? a-- : c++, Tt(Ae(Te(r, a, c), d), d < 0);
|
|
6101
6107
|
}
|
|
6102
6108
|
if (!n.state.doc.resolve(e - (s || 0)).parent.inlineContent) {
|
|
6103
6109
|
if (s == null && i && (t < 0 || i == fe(r))) {
|
|
6104
6110
|
let a = r.childNodes[i - 1];
|
|
6105
6111
|
if (a.nodeType == 1)
|
|
6106
|
-
return
|
|
6112
|
+
return Xn(a.getBoundingClientRect(), !1);
|
|
6107
6113
|
}
|
|
6108
6114
|
if (s == null && i < fe(r)) {
|
|
6109
6115
|
let a = r.childNodes[i];
|
|
6110
6116
|
if (a.nodeType == 1)
|
|
6111
|
-
return
|
|
6117
|
+
return Xn(a.getBoundingClientRect(), !0);
|
|
6112
6118
|
}
|
|
6113
|
-
return
|
|
6119
|
+
return Xn(r.getBoundingClientRect(), t >= 0);
|
|
6114
6120
|
}
|
|
6115
6121
|
if (s == null && i && (t < 0 || i == fe(r))) {
|
|
6116
6122
|
let a = r.childNodes[i - 1], c = a.nodeType == 3 ? Te(a, fe(a) - (o ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
|
|
6117
6123
|
if (c)
|
|
6118
|
-
return
|
|
6124
|
+
return Tt(Ae(c, 1), !1);
|
|
6119
6125
|
}
|
|
6120
6126
|
if (s == null && i < fe(r)) {
|
|
6121
6127
|
let a = r.childNodes[i];
|
|
@@ -6123,17 +6129,17 @@ function oo(n, e, t) {
|
|
|
6123
6129
|
a = a.nextSibling;
|
|
6124
6130
|
let c = a ? a.nodeType == 3 ? Te(a, 0, o ? 0 : 1) : a.nodeType == 1 ? a : null : null;
|
|
6125
6131
|
if (c)
|
|
6126
|
-
return
|
|
6132
|
+
return Tt(Ae(c, -1), !0);
|
|
6127
6133
|
}
|
|
6128
|
-
return
|
|
6134
|
+
return Tt(Ae(r.nodeType == 3 ? Te(r) : r, -t), t >= 0);
|
|
6129
6135
|
}
|
|
6130
|
-
function
|
|
6136
|
+
function Tt(n, e) {
|
|
6131
6137
|
if (n.width == 0)
|
|
6132
6138
|
return n;
|
|
6133
6139
|
let t = e ? n.left : n.right;
|
|
6134
6140
|
return { top: n.top, bottom: n.bottom, left: t, right: t };
|
|
6135
6141
|
}
|
|
6136
|
-
function
|
|
6142
|
+
function Xn(n, e) {
|
|
6137
6143
|
if (n.height == 0)
|
|
6138
6144
|
return n;
|
|
6139
6145
|
let t = e ? n.top : n.bottom;
|
|
@@ -6202,7 +6208,7 @@ function qa(n, e, t) {
|
|
|
6202
6208
|
return vi == e && Ni == t ? Ai : (vi = e, Ni = t, Ai = t == "up" || t == "down" ? Va(n, e, t) : Wa(n, e, t));
|
|
6203
6209
|
}
|
|
6204
6210
|
const me = 0, Di = 1, _e = 2, Se = 3;
|
|
6205
|
-
class
|
|
6211
|
+
class Xt {
|
|
6206
6212
|
constructor(e, t, r, i) {
|
|
6207
6213
|
this.parent = e, this.children = t, this.dom = r, this.contentDOM = i, this.dirty = me, r.pmViewDesc = this;
|
|
6208
6214
|
}
|
|
@@ -6484,7 +6490,7 @@ class Yt {
|
|
|
6484
6490
|
let h = d.focusNode.childNodes[d.focusOffset];
|
|
6485
6491
|
h && h.contentEditable == "false" && (i = !0);
|
|
6486
6492
|
}
|
|
6487
|
-
if (!(i || u && X) &&
|
|
6493
|
+
if (!(i || u && X) && ot(l.node, l.offset, d.anchorNode, d.anchorOffset) && ot(a.node, a.offset, d.focusNode, d.focusOffset))
|
|
6488
6494
|
return;
|
|
6489
6495
|
let f = !1;
|
|
6490
6496
|
if ((c.extend || e == t) && !(u && pe)) {
|
|
@@ -6546,7 +6552,7 @@ class Yt {
|
|
|
6546
6552
|
return !1;
|
|
6547
6553
|
}
|
|
6548
6554
|
}
|
|
6549
|
-
class ao extends
|
|
6555
|
+
class ao extends Xt {
|
|
6550
6556
|
constructor(e, t, r, i) {
|
|
6551
6557
|
let s, o = t.type.toDOM;
|
|
6552
6558
|
if (typeof o == "function" && (o = o(r, () => {
|
|
@@ -6589,7 +6595,7 @@ class ao extends Yt {
|
|
|
6589
6595
|
return this.widget.type.side;
|
|
6590
6596
|
}
|
|
6591
6597
|
}
|
|
6592
|
-
class ja extends
|
|
6598
|
+
class ja extends Xt {
|
|
6593
6599
|
constructor(e, t, r, i) {
|
|
6594
6600
|
super(e, [], t, null), this.textDOM = r, this.text = i;
|
|
6595
6601
|
}
|
|
@@ -6606,13 +6612,13 @@ class ja extends Yt {
|
|
|
6606
6612
|
return e.type === "characterData" && e.target.nodeValue == e.oldValue;
|
|
6607
6613
|
}
|
|
6608
6614
|
}
|
|
6609
|
-
class
|
|
6615
|
+
class lt extends Xt {
|
|
6610
6616
|
constructor(e, t, r, i, s) {
|
|
6611
6617
|
super(e, [], r, i), this.mark = t, this.spec = s;
|
|
6612
6618
|
}
|
|
6613
6619
|
static create(e, t, r, i) {
|
|
6614
6620
|
let s = i.nodeViews[t.type.name], o = s && s(t, i, r);
|
|
6615
|
-
return (!o || !o.dom) && (o =
|
|
6621
|
+
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);
|
|
6616
6622
|
}
|
|
6617
6623
|
parseRule() {
|
|
6618
6624
|
return this.dirty & Se || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
|
|
@@ -6629,8 +6635,8 @@ class ot extends Yt {
|
|
|
6629
6635
|
}
|
|
6630
6636
|
}
|
|
6631
6637
|
slice(e, t, r) {
|
|
6632
|
-
let i =
|
|
6633
|
-
t < o && (s =
|
|
6638
|
+
let i = lt.create(this.parent, this.mark, !0, r), s = this.children, o = this.size;
|
|
6639
|
+
t < o && (s = Mr(s, t, o, r)), e > 0 && (s = Mr(s, 0, e, r));
|
|
6634
6640
|
for (let l = 0; l < s.length; l++)
|
|
6635
6641
|
s[l].parent = i;
|
|
6636
6642
|
return i.children = s, i;
|
|
@@ -6642,7 +6648,7 @@ class ot extends Yt {
|
|
|
6642
6648
|
this.spec.destroy && this.spec.destroy(), super.destroy();
|
|
6643
6649
|
}
|
|
6644
6650
|
}
|
|
6645
|
-
class Ve extends
|
|
6651
|
+
class Ve extends Xt {
|
|
6646
6652
|
constructor(e, t, r, i, s, o, l, a, c) {
|
|
6647
6653
|
super(e, [], s, o), this.node = t, this.outerDeco = r, this.innerDeco = i, this.nodeDOM = l;
|
|
6648
6654
|
}
|
|
@@ -6667,10 +6673,10 @@ class Ve extends Yt {
|
|
|
6667
6673
|
d = document.createTextNode(t.text);
|
|
6668
6674
|
else if (d.nodeType != 3)
|
|
6669
6675
|
throw new RangeError("Text must be rendered as a DOM text node");
|
|
6670
|
-
} else d || ({ dom: d, contentDOM: u } =
|
|
6676
|
+
} else d || ({ dom: d, contentDOM: u } = dt.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
|
|
6671
6677
|
!u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
|
|
6672
6678
|
let f = d;
|
|
6673
|
-
return d = ho(d, r, t), c ? a = new Ka(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new
|
|
6679
|
+
return d = ho(d, r, t), c ? a = new Ka(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Pn(e, t, r, i, d, f, s) : new Ve(e, t, r, i, d, u || null, f, s, o + 1);
|
|
6674
6680
|
}
|
|
6675
6681
|
parseRule() {
|
|
6676
6682
|
if (this.node.type.spec.reparseInView)
|
|
@@ -6693,7 +6699,7 @@ class Ve extends Yt {
|
|
|
6693
6699
|
return e;
|
|
6694
6700
|
}
|
|
6695
6701
|
matchesNode(e, t, r) {
|
|
6696
|
-
return this.dirty == me && e.eq(this.node) &&
|
|
6702
|
+
return this.dirty == me && e.eq(this.node) && gn(t, this.outerDeco) && r.eq(this.innerDeco);
|
|
6697
6703
|
}
|
|
6698
6704
|
get size() {
|
|
6699
6705
|
return this.node.nodeSize;
|
|
@@ -6713,7 +6719,7 @@ class Ve extends Yt {
|
|
|
6713
6719
|
a.syncToMarks(c.marks, r, e, f);
|
|
6714
6720
|
let h;
|
|
6715
6721
|
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;
|
|
6716
|
-
}), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == _e) && (o && this.protectLocalComposition(e, o), uo(this.contentDOM, this.children, e),
|
|
6722
|
+
}), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == _e) && (o && this.protectLocalComposition(e, o), uo(this.contentDOM, this.children, e), Mt && Xa(this.dom));
|
|
6717
6723
|
}
|
|
6718
6724
|
localCompositionInfo(e, t) {
|
|
6719
6725
|
let { from: r, to: i } = e.state.selection;
|
|
@@ -6740,7 +6746,7 @@ class Ve extends Yt {
|
|
|
6740
6746
|
s.pmViewDesc && (s.pmViewDesc = void 0);
|
|
6741
6747
|
}
|
|
6742
6748
|
let o = new ja(this, s, t, i);
|
|
6743
|
-
e.input.compositionNodes.push(o), this.children =
|
|
6749
|
+
e.input.compositionNodes.push(o), this.children = Mr(this.children, r, r + i.length, e, o);
|
|
6744
6750
|
}
|
|
6745
6751
|
// If this desc must be updated to match the given node decoration,
|
|
6746
6752
|
// do so and return true.
|
|
@@ -6751,10 +6757,10 @@ class Ve extends Yt {
|
|
|
6751
6757
|
this.updateOuterDeco(t), this.node = e, this.innerDeco = r, this.contentDOM && this.updateChildren(i, this.posAtStart), this.dirty = me;
|
|
6752
6758
|
}
|
|
6753
6759
|
updateOuterDeco(e) {
|
|
6754
|
-
if (
|
|
6760
|
+
if (gn(e, this.outerDeco))
|
|
6755
6761
|
return;
|
|
6756
6762
|
let t = this.nodeDOM.nodeType != 1, r = this.dom;
|
|
6757
|
-
this.dom = fo(this.dom, this.nodeDOM,
|
|
6763
|
+
this.dom = fo(this.dom, this.nodeDOM, Sr(this.outerDeco, this.node, t), Sr(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
|
|
6758
6764
|
}
|
|
6759
6765
|
// Mark this node as being the selected node.
|
|
6760
6766
|
selectNode() {
|
|
@@ -6773,7 +6779,7 @@ function Ii(n, e, t, r, i) {
|
|
|
6773
6779
|
let s = new Ve(void 0, n, e, t, r, r, r, i, 0);
|
|
6774
6780
|
return s.contentDOM && s.updateChildren(i, 0), s;
|
|
6775
6781
|
}
|
|
6776
|
-
class
|
|
6782
|
+
class Pn extends Ve {
|
|
6777
6783
|
constructor(e, t, r, i, s, o, l) {
|
|
6778
6784
|
super(e, t, r, i, s, null, o, l, 0);
|
|
6779
6785
|
}
|
|
@@ -6804,7 +6810,7 @@ class Rn extends Ve {
|
|
|
6804
6810
|
}
|
|
6805
6811
|
slice(e, t, r) {
|
|
6806
6812
|
let i = this.node.cut(e, t), s = document.createTextNode(i.text);
|
|
6807
|
-
return new
|
|
6813
|
+
return new Pn(this.parent, i, this.outerDeco, this.innerDeco, s, s, r);
|
|
6808
6814
|
}
|
|
6809
6815
|
markDirty(e, t) {
|
|
6810
6816
|
super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Se);
|
|
@@ -6816,7 +6822,7 @@ class Rn extends Ve {
|
|
|
6816
6822
|
return this.node.text == e;
|
|
6817
6823
|
}
|
|
6818
6824
|
}
|
|
6819
|
-
class co extends
|
|
6825
|
+
class co extends Xt {
|
|
6820
6826
|
parseRule() {
|
|
6821
6827
|
return { ignore: !0 };
|
|
6822
6828
|
}
|
|
@@ -6874,7 +6880,7 @@ function uo(n, e, t) {
|
|
|
6874
6880
|
r = r.nextSibling;
|
|
6875
6881
|
} else
|
|
6876
6882
|
i = !0, n.insertBefore(l, r);
|
|
6877
|
-
if (o instanceof
|
|
6883
|
+
if (o instanceof lt) {
|
|
6878
6884
|
let a = r ? r.previousSibling : n.lastChild;
|
|
6879
6885
|
uo(o.contentDOM, o.children, t), r = a ? a.nextSibling : n.firstChild;
|
|
6880
6886
|
}
|
|
@@ -6883,22 +6889,22 @@ function uo(n, e, t) {
|
|
|
6883
6889
|
r = Ri(r), i = !0;
|
|
6884
6890
|
i && t.trackWrites == n && (t.trackWrites = null);
|
|
6885
6891
|
}
|
|
6886
|
-
const
|
|
6892
|
+
const It = function(n) {
|
|
6887
6893
|
n && (this.nodeName = n);
|
|
6888
6894
|
};
|
|
6889
|
-
|
|
6890
|
-
const Ge = [new
|
|
6891
|
-
function
|
|
6895
|
+
It.prototype = /* @__PURE__ */ Object.create(null);
|
|
6896
|
+
const Ge = [new It()];
|
|
6897
|
+
function Sr(n, e, t) {
|
|
6892
6898
|
if (n.length == 0)
|
|
6893
6899
|
return Ge;
|
|
6894
|
-
let r = t ? Ge[0] : new
|
|
6900
|
+
let r = t ? Ge[0] : new It(), i = [r];
|
|
6895
6901
|
for (let s = 0; s < n.length; s++) {
|
|
6896
6902
|
let o = n[s].type.attrs;
|
|
6897
6903
|
if (o) {
|
|
6898
|
-
o.nodeName && i.push(r = new
|
|
6904
|
+
o.nodeName && i.push(r = new It(o.nodeName));
|
|
6899
6905
|
for (let l in o) {
|
|
6900
6906
|
let a = o[l];
|
|
6901
|
-
a != null && (t && i.length == 1 && i.push(r = new
|
|
6907
|
+
a != null && (t && i.length == 1 && i.push(r = new It(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));
|
|
6902
6908
|
}
|
|
6903
6909
|
}
|
|
6904
6910
|
}
|
|
@@ -6941,9 +6947,9 @@ function Ja(n, e, t) {
|
|
|
6941
6947
|
}
|
|
6942
6948
|
}
|
|
6943
6949
|
function ho(n, e, t) {
|
|
6944
|
-
return fo(n, n, Ge,
|
|
6950
|
+
return fo(n, n, Ge, Sr(e, t, n.nodeType != 1));
|
|
6945
6951
|
}
|
|
6946
|
-
function
|
|
6952
|
+
function gn(n, e) {
|
|
6947
6953
|
if (n.length != e.length)
|
|
6948
6954
|
return !1;
|
|
6949
6955
|
for (let t = 0; t < n.length; t++)
|
|
@@ -6994,7 +7000,7 @@ class Ua {
|
|
|
6994
7000
|
if (a > -1)
|
|
6995
7001
|
a > this.index && (this.changed = !0, this.destroyBetween(this.index, a)), this.top = this.top.children[this.index];
|
|
6996
7002
|
else {
|
|
6997
|
-
let d =
|
|
7003
|
+
let d = lt.create(this.top, e[o], t, r);
|
|
6998
7004
|
this.top.children.splice(this.index, 0, d), this.top = d, this.changed = !0;
|
|
6999
7005
|
}
|
|
7000
7006
|
this.index = 0, o++;
|
|
@@ -7046,7 +7052,7 @@ class Ua {
|
|
|
7046
7052
|
let c = this.preMatch.matched.get(a);
|
|
7047
7053
|
if (c != null && c != s)
|
|
7048
7054
|
return !1;
|
|
7049
|
-
let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != Se &&
|
|
7055
|
+
let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != Se && gn(t, a.outerDeco));
|
|
7050
7056
|
if (!f && a.update(e, t, r, i))
|
|
7051
7057
|
return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
|
|
7052
7058
|
if (!f && (u = this.recreateWrapper(a, e, t, r, i, o)))
|
|
@@ -7059,7 +7065,7 @@ class Ua {
|
|
|
7059
7065
|
// When a node with content is replaced by a different node with
|
|
7060
7066
|
// identical content, move over its children.
|
|
7061
7067
|
recreateWrapper(e, t, r, i, s, o) {
|
|
7062
|
-
if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !
|
|
7068
|
+
if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !gn(r, e.outerDeco) || !i.eq(e.innerDeco))
|
|
7063
7069
|
return null;
|
|
7064
7070
|
let l = Ve.create(this.top, t, r, i, s, o);
|
|
7065
7071
|
if (l.contentDOM) {
|
|
@@ -7087,10 +7093,10 @@ class Ua {
|
|
|
7087
7093
|
// contentEditable.
|
|
7088
7094
|
addTextblockHacks() {
|
|
7089
7095
|
let e = this.top.children[this.index - 1], t = this.top;
|
|
7090
|
-
for (; e instanceof
|
|
7096
|
+
for (; e instanceof lt; )
|
|
7091
7097
|
t = e, e = t.children[t.children.length - 1];
|
|
7092
7098
|
(!e || // Empty textblock
|
|
7093
|
-
!(e instanceof
|
|
7099
|
+
!(e instanceof Pn) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((X || U) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
|
|
7094
7100
|
}
|
|
7095
7101
|
addHackNode(e, t) {
|
|
7096
7102
|
if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))
|
|
@@ -7113,7 +7119,7 @@ function _a(n, e) {
|
|
|
7113
7119
|
for (; ; )
|
|
7114
7120
|
if (r) {
|
|
7115
7121
|
let c = t.children[r - 1];
|
|
7116
|
-
if (c instanceof
|
|
7122
|
+
if (c instanceof lt)
|
|
7117
7123
|
t = c, r = c.children.length;
|
|
7118
7124
|
else {
|
|
7119
7125
|
l = c, r--;
|
|
@@ -7214,7 +7220,7 @@ function Za(n, e, t, r) {
|
|
|
7214
7220
|
}
|
|
7215
7221
|
return -1;
|
|
7216
7222
|
}
|
|
7217
|
-
function
|
|
7223
|
+
function Mr(n, e, t, r, i) {
|
|
7218
7224
|
let s = [];
|
|
7219
7225
|
for (let o = 0, l = 0; o < n.length; o++) {
|
|
7220
7226
|
let a = n[o], c = l, d = l += a.size;
|
|
@@ -7230,7 +7236,7 @@ function $r(n, e = null) {
|
|
|
7230
7236
|
if (o < 0)
|
|
7231
7237
|
return null;
|
|
7232
7238
|
let l = r.resolve(o), a, c;
|
|
7233
|
-
if (
|
|
7239
|
+
if (Rn(t)) {
|
|
7234
7240
|
for (a = o; i && !i.node; )
|
|
7235
7241
|
i = i.parent;
|
|
7236
7242
|
let u = i.node;
|
|
@@ -7268,7 +7274,7 @@ function Ne(n, e = !1) {
|
|
|
7268
7274
|
if (mo(n, t), !!po(n)) {
|
|
7269
7275
|
if (!e && n.input.mouseDown && n.input.mouseDown.allowDefault && U) {
|
|
7270
7276
|
let r = n.domSelectionRange(), i = n.domObserver.currentSelection;
|
|
7271
|
-
if (r.anchorNode && i.anchorNode &&
|
|
7277
|
+
if (r.anchorNode && i.anchorNode && ot(r.anchorNode, r.anchorOffset, i.anchorNode, i.anchorOffset)) {
|
|
7272
7278
|
n.input.mouseDown.delayedSelectionSync = !0, n.domObserver.setCurSelection();
|
|
7273
7279
|
return;
|
|
7274
7280
|
}
|
|
@@ -7286,15 +7292,15 @@ const Pi = X || U && eo < 63;
|
|
|
7286
7292
|
function Bi(n, e) {
|
|
7287
7293
|
let { node: t, offset: r } = n.docView.domFromPos(e, 0), i = r < t.childNodes.length ? t.childNodes[r] : null, s = r ? t.childNodes[r - 1] : null;
|
|
7288
7294
|
if (X && i && i.contentEditable == "false")
|
|
7289
|
-
return
|
|
7295
|
+
return Zn(i);
|
|
7290
7296
|
if ((!i || i.contentEditable == "false") && (!s || s.contentEditable == "false")) {
|
|
7291
7297
|
if (i)
|
|
7292
|
-
return
|
|
7298
|
+
return Zn(i);
|
|
7293
7299
|
if (s)
|
|
7294
|
-
return
|
|
7300
|
+
return Zn(s);
|
|
7295
7301
|
}
|
|
7296
7302
|
}
|
|
7297
|
-
function
|
|
7303
|
+
function Zn(n) {
|
|
7298
7304
|
return n.contentEditable = "true", X && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
|
|
7299
7305
|
}
|
|
7300
7306
|
function Li(n) {
|
|
@@ -7345,11 +7351,11 @@ function go(n) {
|
|
|
7345
7351
|
}
|
|
7346
7352
|
function tc(n) {
|
|
7347
7353
|
let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
|
|
7348
|
-
return
|
|
7354
|
+
return ot(e.node, e.offset, t.anchorNode, t.anchorOffset);
|
|
7349
7355
|
}
|
|
7350
|
-
function
|
|
7356
|
+
function wr(n, e) {
|
|
7351
7357
|
let { $anchor: t, $head: r } = n.selection, i = e > 0 ? t.max(r) : t.min(r), s = i.parent.inlineContent ? i.depth ? n.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
|
|
7352
|
-
return s &&
|
|
7358
|
+
return s && E.findFrom(s, e);
|
|
7353
7359
|
}
|
|
7354
7360
|
function De(n, e) {
|
|
7355
7361
|
return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()), !0;
|
|
@@ -7365,33 +7371,33 @@ function $i(n, e, t) {
|
|
|
7365
7371
|
return De(n, new M(r.$anchor, o));
|
|
7366
7372
|
} else if (r.empty) {
|
|
7367
7373
|
if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
|
|
7368
|
-
let i =
|
|
7374
|
+
let i = wr(n.state, e);
|
|
7369
7375
|
return i && i instanceof S ? De(n, i) : !1;
|
|
7370
7376
|
} else if (!(ue && t.indexOf("m") > -1)) {
|
|
7371
7377
|
let i = r.$head, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, o;
|
|
7372
7378
|
if (!s || s.isText)
|
|
7373
7379
|
return !1;
|
|
7374
7380
|
let l = e < 0 ? i.pos - s.nodeSize : i.pos;
|
|
7375
|
-
return s.isAtom || (o = n.docView.descAt(l)) && !o.contentDOM ? S.isSelectable(s) ? De(n, new S(e < 0 ? n.state.doc.resolve(i.pos - s.nodeSize) : i)) :
|
|
7381
|
+
return s.isAtom || (o = n.docView.descAt(l)) && !o.contentDOM ? S.isSelectable(s) ? De(n, new S(e < 0 ? n.state.doc.resolve(i.pos - s.nodeSize) : i)) : Yt ? De(n, new M(n.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
|
|
7376
7382
|
}
|
|
7377
7383
|
} else return !1;
|
|
7378
7384
|
else {
|
|
7379
7385
|
if (r instanceof S && r.node.isInline)
|
|
7380
7386
|
return De(n, new M(e > 0 ? r.$to : r.$from));
|
|
7381
7387
|
{
|
|
7382
|
-
let i =
|
|
7388
|
+
let i = wr(n.state, e);
|
|
7383
7389
|
return i ? De(n, i) : !1;
|
|
7384
7390
|
}
|
|
7385
7391
|
}
|
|
7386
7392
|
}
|
|
7387
|
-
function
|
|
7393
|
+
function yn(n) {
|
|
7388
7394
|
return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
|
|
7389
7395
|
}
|
|
7390
|
-
function
|
|
7396
|
+
function Rt(n, e) {
|
|
7391
7397
|
let t = n.pmViewDesc;
|
|
7392
7398
|
return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
|
|
7393
7399
|
}
|
|
7394
|
-
function
|
|
7400
|
+
function ft(n, e) {
|
|
7395
7401
|
return e < 0 ? nc(n) : rc(n);
|
|
7396
7402
|
}
|
|
7397
7403
|
function nc(n) {
|
|
@@ -7399,13 +7405,13 @@ function nc(n) {
|
|
|
7399
7405
|
if (!t)
|
|
7400
7406
|
return;
|
|
7401
7407
|
let i, s, o = !1;
|
|
7402
|
-
for (pe && t.nodeType == 1 && r <
|
|
7408
|
+
for (pe && t.nodeType == 1 && r < yn(t) && Rt(t.childNodes[r], -1) && (o = !0); ; )
|
|
7403
7409
|
if (r > 0) {
|
|
7404
7410
|
if (t.nodeType != 1)
|
|
7405
7411
|
break;
|
|
7406
7412
|
{
|
|
7407
7413
|
let l = t.childNodes[r - 1];
|
|
7408
|
-
if (
|
|
7414
|
+
if (Rt(l, -1))
|
|
7409
7415
|
i = t, s = --r;
|
|
7410
7416
|
else if (l.nodeType == 3)
|
|
7411
7417
|
t = l, r = t.nodeValue.length;
|
|
@@ -7417,10 +7423,10 @@ function nc(n) {
|
|
|
7417
7423
|
break;
|
|
7418
7424
|
{
|
|
7419
7425
|
let l = t.previousSibling;
|
|
7420
|
-
for (; l &&
|
|
7426
|
+
for (; l && Rt(l, -1); )
|
|
7421
7427
|
i = t.parentNode, s = K(l), l = l.previousSibling;
|
|
7422
7428
|
if (l)
|
|
7423
|
-
t = l, r =
|
|
7429
|
+
t = l, r = yn(t);
|
|
7424
7430
|
else {
|
|
7425
7431
|
if (t = t.parentNode, t == n.dom)
|
|
7426
7432
|
break;
|
|
@@ -7428,19 +7434,19 @@ function nc(n) {
|
|
|
7428
7434
|
}
|
|
7429
7435
|
}
|
|
7430
7436
|
}
|
|
7431
|
-
o ?
|
|
7437
|
+
o ? Cr(n, t, r) : i && Cr(n, i, s);
|
|
7432
7438
|
}
|
|
7433
7439
|
function rc(n) {
|
|
7434
7440
|
let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
|
|
7435
7441
|
if (!t)
|
|
7436
7442
|
return;
|
|
7437
|
-
let i =
|
|
7443
|
+
let i = yn(t), s, o;
|
|
7438
7444
|
for (; ; )
|
|
7439
7445
|
if (r < i) {
|
|
7440
7446
|
if (t.nodeType != 1)
|
|
7441
7447
|
break;
|
|
7442
7448
|
let l = t.childNodes[r];
|
|
7443
|
-
if (
|
|
7449
|
+
if (Rt(l, 1))
|
|
7444
7450
|
s = t, o = ++r;
|
|
7445
7451
|
else
|
|
7446
7452
|
break;
|
|
@@ -7449,10 +7455,10 @@ function rc(n) {
|
|
|
7449
7455
|
break;
|
|
7450
7456
|
{
|
|
7451
7457
|
let l = t.nextSibling;
|
|
7452
|
-
for (; l &&
|
|
7458
|
+
for (; l && Rt(l, 1); )
|
|
7453
7459
|
s = l.parentNode, o = K(l) + 1, l = l.nextSibling;
|
|
7454
7460
|
if (l)
|
|
7455
|
-
t = l, r = 0, i =
|
|
7461
|
+
t = l, r = 0, i = yn(t);
|
|
7456
7462
|
else {
|
|
7457
7463
|
if (t = t.parentNode, t == n.dom)
|
|
7458
7464
|
break;
|
|
@@ -7460,14 +7466,14 @@ function rc(n) {
|
|
|
7460
7466
|
}
|
|
7461
7467
|
}
|
|
7462
7468
|
}
|
|
7463
|
-
s &&
|
|
7469
|
+
s && Cr(n, s, o);
|
|
7464
7470
|
}
|
|
7465
7471
|
function yo(n) {
|
|
7466
7472
|
let e = n.pmViewDesc;
|
|
7467
7473
|
return e && e.node && e.node.isBlock;
|
|
7468
7474
|
}
|
|
7469
7475
|
function ic(n, e) {
|
|
7470
|
-
for (; n && e == n.childNodes.length && !
|
|
7476
|
+
for (; n && e == n.childNodes.length && !Gt(n); )
|
|
7471
7477
|
e = K(n) + 1, n = n.parentNode;
|
|
7472
7478
|
for (; n && e < n.childNodes.length; ) {
|
|
7473
7479
|
let t = n.childNodes[e];
|
|
@@ -7479,7 +7485,7 @@ function ic(n, e) {
|
|
|
7479
7485
|
}
|
|
7480
7486
|
}
|
|
7481
7487
|
function sc(n, e) {
|
|
7482
|
-
for (; n && !e && !
|
|
7488
|
+
for (; n && !e && !Gt(n); )
|
|
7483
7489
|
e = K(n), n = n.parentNode;
|
|
7484
7490
|
for (; n && e; ) {
|
|
7485
7491
|
let t = n.childNodes[e - 1];
|
|
@@ -7490,7 +7496,7 @@ function sc(n, e) {
|
|
|
7490
7496
|
n = t, e = n.childNodes.length;
|
|
7491
7497
|
}
|
|
7492
7498
|
}
|
|
7493
|
-
function
|
|
7499
|
+
function Cr(n, e, t) {
|
|
7494
7500
|
if (e.nodeType != 3) {
|
|
7495
7501
|
let s, o;
|
|
7496
7502
|
(o = ic(e, t)) ? (e = o, t = 0) : (s = sc(e, t)) && (e = s, t = s.nodeValue.length);
|
|
@@ -7498,7 +7504,7 @@ function wr(n, e, t) {
|
|
|
7498
7504
|
let r = n.domSelection();
|
|
7499
7505
|
if (!r)
|
|
7500
7506
|
return;
|
|
7501
|
-
if (
|
|
7507
|
+
if (Rn(r)) {
|
|
7502
7508
|
let s = document.createRange();
|
|
7503
7509
|
s.setEnd(e, t), s.setStart(e, t), r.removeAllRanges(), r.addRange(s);
|
|
7504
7510
|
} else r.extend && r.extend(e, t);
|
|
@@ -7531,12 +7537,12 @@ function Hi(n, e, t) {
|
|
|
7531
7537
|
return !1;
|
|
7532
7538
|
let { $from: i, $to: s } = r;
|
|
7533
7539
|
if (!i.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
|
|
7534
|
-
let o =
|
|
7540
|
+
let o = wr(n.state, e);
|
|
7535
7541
|
if (o && o instanceof S)
|
|
7536
7542
|
return De(n, o);
|
|
7537
7543
|
}
|
|
7538
7544
|
if (!i.parent.inlineContent) {
|
|
7539
|
-
let o = e < 0 ? i : s, l = r instanceof ae ?
|
|
7545
|
+
let o = e < 0 ? i : s, l = r instanceof ae ? E.near(o, e) : E.findFrom(o, e);
|
|
7540
7546
|
return l ? De(n, l) : !1;
|
|
7541
7547
|
}
|
|
7542
7548
|
return !1;
|
|
@@ -7578,22 +7584,22 @@ function lc(n) {
|
|
|
7578
7584
|
function ac(n, e) {
|
|
7579
7585
|
let t = e.keyCode, r = lc(e);
|
|
7580
7586
|
if (t == 8 || ue && t == 72 && r == "c")
|
|
7581
|
-
return Wi(n, -1) ||
|
|
7587
|
+
return Wi(n, -1) || ft(n, -1);
|
|
7582
7588
|
if (t == 46 && !e.shiftKey || ue && t == 68 && r == "c")
|
|
7583
|
-
return Wi(n, 1) ||
|
|
7589
|
+
return Wi(n, 1) || ft(n, 1);
|
|
7584
7590
|
if (t == 13 || t == 27)
|
|
7585
7591
|
return !0;
|
|
7586
7592
|
if (t == 37 || ue && t == 66 && r == "c") {
|
|
7587
7593
|
let i = t == 37 ? Vi(n, n.state.selection.from) == "ltr" ? -1 : 1 : -1;
|
|
7588
|
-
return $i(n, i, r) ||
|
|
7594
|
+
return $i(n, i, r) || ft(n, i);
|
|
7589
7595
|
} else if (t == 39 || ue && t == 70 && r == "c") {
|
|
7590
7596
|
let i = t == 39 ? Vi(n, n.state.selection.from) == "ltr" ? 1 : -1 : 1;
|
|
7591
|
-
return $i(n, i, r) ||
|
|
7597
|
+
return $i(n, i, r) || ft(n, i);
|
|
7592
7598
|
} else {
|
|
7593
7599
|
if (t == 38 || ue && t == 80 && r == "c")
|
|
7594
|
-
return Hi(n, -1, r) ||
|
|
7600
|
+
return Hi(n, -1, r) || ft(n, -1);
|
|
7595
7601
|
if (t == 40 || ue && t == 78 && r == "c")
|
|
7596
|
-
return oc(n) || Hi(n, 1, r) ||
|
|
7602
|
+
return oc(n) || Hi(n, 1, r) || ft(n, 1);
|
|
7597
7603
|
if (r == (ue ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
7598
7604
|
return !0;
|
|
7599
7605
|
}
|
|
@@ -7609,7 +7615,7 @@ function Hr(n, e) {
|
|
|
7609
7615
|
let h = r.firstChild;
|
|
7610
7616
|
t.push(h.type.name, h.attrs != h.type.defaultAttrs ? h.attrs : null), r = h.content;
|
|
7611
7617
|
}
|
|
7612
|
-
let o = n.someProp("clipboardSerializer") ||
|
|
7618
|
+
let o = n.someProp("clipboardSerializer") || dt.fromSchema(n.state.schema), l = wo(), a = l.createElement("div");
|
|
7613
7619
|
a.appendChild(o.serializeFragment(r, { document: l }));
|
|
7614
7620
|
let c = a.firstChild, d, u = 0;
|
|
7615
7621
|
for (; c && c.nodeType == 1 && (d = Mo[c.nodeName.toLowerCase()]); ) {
|
|
@@ -7644,7 +7650,7 @@ function bo(n, e, t, r, i) {
|
|
|
7644
7650
|
if (u)
|
|
7645
7651
|
l = u;
|
|
7646
7652
|
else {
|
|
7647
|
-
let f = i.marks(), { schema: h } = n.state, p =
|
|
7653
|
+
let f = i.marks(), { schema: h } = n.state, p = dt.fromSchema(h);
|
|
7648
7654
|
o = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((m) => {
|
|
7649
7655
|
let g = o.appendChild(document.createElement("p"));
|
|
7650
7656
|
m && g.appendChild(p.serializeNode(h.text(m, f)));
|
|
@@ -7653,7 +7659,7 @@ function bo(n, e, t, r, i) {
|
|
|
7653
7659
|
} else
|
|
7654
7660
|
n.someProp("transformPastedHTML", (u) => {
|
|
7655
7661
|
t = u(t, n);
|
|
7656
|
-
}), o = fc(t),
|
|
7662
|
+
}), o = fc(t), Yt && hc(o);
|
|
7657
7663
|
let c = o && o.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
|
|
7658
7664
|
if (d && d[3])
|
|
7659
7665
|
for (let u = +d[3]; u > 0; u--) {
|
|
@@ -7728,12 +7734,12 @@ function So(n, e) {
|
|
|
7728
7734
|
let t = n.content.replaceChild(n.childCount - 1, So(n.lastChild, e - 1)), r = n.contentMatchAt(n.childCount).fillBefore(b.empty, !0);
|
|
7729
7735
|
return n.copy(t.append(r));
|
|
7730
7736
|
}
|
|
7731
|
-
function
|
|
7737
|
+
function Tr(n, e, t, r, i, s) {
|
|
7732
7738
|
let o = e < 0 ? n.firstChild : n.lastChild, l = o.content;
|
|
7733
|
-
return n.childCount > 1 && (s = 0), i < r - 1 && (l =
|
|
7739
|
+
return n.childCount > 1 && (s = 0), i < r - 1 && (l = Tr(l, e, t, r, i + 1, s)), i >= t && (l = e < 0 ? o.contentMatchAt(0).fillBefore(l, s <= i).append(l) : l.append(o.contentMatchAt(o.childCount).fillBefore(b.empty, !0))), n.replaceChild(e < 0 ? 0 : n.childCount - 1, o.copy(l));
|
|
7734
7740
|
}
|
|
7735
7741
|
function ji(n, e, t) {
|
|
7736
|
-
return e < n.openStart && (n = new k(
|
|
7742
|
+
return e < n.openStart && (n = new k(Tr(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new k(Tr(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
|
|
7737
7743
|
}
|
|
7738
7744
|
const Mo = {
|
|
7739
7745
|
thead: ["table"],
|
|
@@ -7750,10 +7756,10 @@ let Ki = null;
|
|
|
7750
7756
|
function wo() {
|
|
7751
7757
|
return Ki || (Ki = document.implementation.createHTMLDocument("title"));
|
|
7752
7758
|
}
|
|
7753
|
-
let
|
|
7759
|
+
let Qn = null;
|
|
7754
7760
|
function uc(n) {
|
|
7755
7761
|
let e = window.trustedTypes;
|
|
7756
|
-
return e ? (
|
|
7762
|
+
return e ? (Qn || (Qn = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), Qn.createHTML(n)) : n;
|
|
7757
7763
|
}
|
|
7758
7764
|
function fc(n) {
|
|
7759
7765
|
let e = /^(\s*<meta [^>]*>)*/.exec(n);
|
|
@@ -7802,7 +7808,7 @@ function yc(n) {
|
|
|
7802
7808
|
kc(n, r) && !Wr(n, r) && (n.editable || !(r.type in te)) && t(n, r);
|
|
7803
7809
|
}, mc[e] ? { passive: !0 } : void 0);
|
|
7804
7810
|
}
|
|
7805
|
-
X && n.dom.addEventListener("input", () => null),
|
|
7811
|
+
X && n.dom.addEventListener("input", () => null), Or(n);
|
|
7806
7812
|
}
|
|
7807
7813
|
function Le(n, e) {
|
|
7808
7814
|
n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
|
|
@@ -7813,7 +7819,7 @@ function bc(n) {
|
|
|
7813
7819
|
n.dom.removeEventListener(e, n.input.eventHandlers[e]);
|
|
7814
7820
|
clearTimeout(n.input.composingTimeout), clearTimeout(n.input.lastIOSEnterFallbackTimeout);
|
|
7815
7821
|
}
|
|
7816
|
-
function
|
|
7822
|
+
function Or(n) {
|
|
7817
7823
|
n.someProp("handleDOMEvents", (e) => {
|
|
7818
7824
|
for (let t in e)
|
|
7819
7825
|
n.input.eventHandlers[t] || n.dom.addEventListener(t, n.input.eventHandlers[t] = (r) => Wr(n, r));
|
|
@@ -7841,7 +7847,7 @@ function xc(n, e) {
|
|
|
7841
7847
|
te.keydown = (n, e) => {
|
|
7842
7848
|
let t = e;
|
|
7843
7849
|
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !To(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(Ee && U && t.keyCode == 13)))
|
|
7844
|
-
if (t.keyCode != 229 && n.domObserver.forceFlush(),
|
|
7850
|
+
if (t.keyCode != 229 && n.domObserver.forceFlush(), Mt && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
7845
7851
|
let r = Date.now();
|
|
7846
7852
|
n.input.lastIOSEnter = r, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
7847
7853
|
n.input.lastIOSEnter == r && (n.someProp("handleKeyDown", (i) => i(n, Je(13, "Enter"))), n.input.lastIOSEnter = 0);
|
|
@@ -7865,7 +7871,7 @@ te.keypress = (n, e) => {
|
|
|
7865
7871
|
!/[\r\n]/.test(i) && !n.someProp("handleTextInput", (o) => o(n, r.$from.pos, r.$to.pos, i, s)) && n.dispatch(s()), t.preventDefault();
|
|
7866
7872
|
}
|
|
7867
7873
|
};
|
|
7868
|
-
function
|
|
7874
|
+
function Bn(n) {
|
|
7869
7875
|
return { left: n.clientX, top: n.clientY };
|
|
7870
7876
|
}
|
|
7871
7877
|
function Sc(n, e) {
|
|
@@ -7881,7 +7887,7 @@ function qr(n, e, t, r, i) {
|
|
|
7881
7887
|
return !0;
|
|
7882
7888
|
return !1;
|
|
7883
7889
|
}
|
|
7884
|
-
function
|
|
7890
|
+
function bt(n, e, t) {
|
|
7885
7891
|
if (n.focused || n.focus(), n.state.selection.eq(e))
|
|
7886
7892
|
return;
|
|
7887
7893
|
let r = n.state.tr.setSelection(e);
|
|
@@ -7891,7 +7897,7 @@ function Mc(n, e) {
|
|
|
7891
7897
|
if (e == -1)
|
|
7892
7898
|
return !1;
|
|
7893
7899
|
let t = n.state.doc.resolve(e), r = t.nodeAfter;
|
|
7894
|
-
return r && r.isAtom && S.isSelectable(r) ? (
|
|
7900
|
+
return r && r.isAtom && S.isSelectable(r) ? (bt(n, new S(t)), !0) : !1;
|
|
7895
7901
|
}
|
|
7896
7902
|
function wc(n, e) {
|
|
7897
7903
|
if (e == -1)
|
|
@@ -7906,7 +7912,7 @@ function wc(n, e) {
|
|
|
7906
7912
|
break;
|
|
7907
7913
|
}
|
|
7908
7914
|
}
|
|
7909
|
-
return i != null ? (
|
|
7915
|
+
return i != null ? (bt(n, S.create(n.state.doc, i)), !0) : !1;
|
|
7910
7916
|
}
|
|
7911
7917
|
function Cc(n, e, t, r, i) {
|
|
7912
7918
|
return qr(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? wc(n, t) : Mc(n, t));
|
|
@@ -7922,21 +7928,21 @@ function Ec(n, e, t) {
|
|
|
7922
7928
|
return !1;
|
|
7923
7929
|
let r = n.state.doc;
|
|
7924
7930
|
if (e == -1)
|
|
7925
|
-
return r.inlineContent ? (
|
|
7931
|
+
return r.inlineContent ? (bt(n, M.create(r, 0, r.content.size)), !0) : !1;
|
|
7926
7932
|
let i = r.resolve(e);
|
|
7927
7933
|
for (let s = i.depth + 1; s > 0; s--) {
|
|
7928
7934
|
let o = s > i.depth ? i.nodeAfter : i.node(s), l = i.before(s);
|
|
7929
7935
|
if (o.inlineContent)
|
|
7930
|
-
|
|
7936
|
+
bt(n, M.create(r, l + 1, l + 1 + o.content.size));
|
|
7931
7937
|
else if (S.isSelectable(o))
|
|
7932
|
-
|
|
7938
|
+
bt(n, S.create(r, l));
|
|
7933
7939
|
else
|
|
7934
7940
|
continue;
|
|
7935
7941
|
return !0;
|
|
7936
7942
|
}
|
|
7937
7943
|
}
|
|
7938
7944
|
function jr(n) {
|
|
7939
|
-
return
|
|
7945
|
+
return bn(n);
|
|
7940
7946
|
}
|
|
7941
7947
|
const Co = ue ? "metaKey" : "ctrlKey";
|
|
7942
7948
|
ee.mousedown = (n, e) => {
|
|
@@ -7944,7 +7950,7 @@ ee.mousedown = (n, e) => {
|
|
|
7944
7950
|
n.input.shiftKey = t.shiftKey;
|
|
7945
7951
|
let r = jr(n), i = Date.now(), s = "singleClick";
|
|
7946
7952
|
i - n.input.lastClick.time < 500 && Sc(t, n.input.lastClick) && !t[Co] && n.input.lastClick.button == t.button && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s, button: t.button };
|
|
7947
|
-
let o = n.posAtCoords(
|
|
7953
|
+
let o = n.posAtCoords(Bn(t));
|
|
7948
7954
|
o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new vc(n, o, t, !!r)) : (s == "doubleClick" ? Tc : Oc)(n, o.pos, o.inside, t) ? t.preventDefault() : Le(n, "pointer"));
|
|
7949
7955
|
};
|
|
7950
7956
|
class vc {
|
|
@@ -7976,7 +7982,7 @@ class vc {
|
|
|
7976
7982
|
if (this.done(), !this.view.dom.contains(e.target))
|
|
7977
7983
|
return;
|
|
7978
7984
|
let t = this.pos;
|
|
7979
|
-
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(
|
|
7985
|
+
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Bn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Le(this.view, "pointer") : Cc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
7980
7986
|
X && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
7981
7987
|
// cursor, but still report that the node is selected
|
|
7982
7988
|
// when asked through getSelection. You'll then get a
|
|
@@ -7984,7 +7990,7 @@ class vc {
|
|
|
7984
7990
|
// (hidden) cursor is doesn't change the selection, and
|
|
7985
7991
|
// thus doesn't get a reaction from ProseMirror. This
|
|
7986
7992
|
// works around that.
|
|
7987
|
-
U && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (
|
|
7993
|
+
U && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (bt(this.view, E.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : Le(this.view, "pointer");
|
|
7988
7994
|
}
|
|
7989
7995
|
move(e) {
|
|
7990
7996
|
this.updateAllowDefault(e), Le(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
@@ -8009,8 +8015,8 @@ te.compositionstart = te.compositionupdate = (n) => {
|
|
|
8009
8015
|
n.domObserver.flush();
|
|
8010
8016
|
let { state: e } = n, t = e.selection.$to;
|
|
8011
8017
|
if (e.selection instanceof M && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || U && to && Ac(n)))
|
|
8012
|
-
n.markCursor = n.state.storedMarks || t.marks(),
|
|
8013
|
-
else if (
|
|
8018
|
+
n.markCursor = n.state.storedMarks || t.marks(), bn(n, !0), n.markCursor = null;
|
|
8019
|
+
else if (bn(n, !e.selection.empty), pe && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
|
|
8014
8020
|
let r = n.domSelectionRange();
|
|
8015
8021
|
for (let i = r.focusNode, s = r.focusOffset; i && i.nodeType == 1 && s != 0; ) {
|
|
8016
8022
|
let o = s < 0 ? i.lastChild : i.childNodes[s - 1];
|
|
@@ -8039,7 +8045,7 @@ te.compositionend = (n, e) => {
|
|
|
8039
8045
|
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++, Oo(n, 20));
|
|
8040
8046
|
};
|
|
8041
8047
|
function Oo(n, e) {
|
|
8042
|
-
clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() =>
|
|
8048
|
+
clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => bn(n), e));
|
|
8043
8049
|
}
|
|
8044
8050
|
function Eo(n) {
|
|
8045
8051
|
for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Ic()); n.input.compositionNodes.length > 0; )
|
|
@@ -8068,7 +8074,7 @@ function Ic() {
|
|
|
8068
8074
|
let n = document.createEvent("Event");
|
|
8069
8075
|
return n.initEvent("event", !0, !0), n.timeStamp;
|
|
8070
8076
|
}
|
|
8071
|
-
function
|
|
8077
|
+
function bn(n, e = !1) {
|
|
8072
8078
|
if (!(Ee && n.domObserver.flushingSoon >= 0)) {
|
|
8073
8079
|
if (n.domObserver.forceFlush(), Eo(n), e || n.docView && n.docView.dirty) {
|
|
8074
8080
|
let t = $r(n), r = n.state.selection;
|
|
@@ -8087,12 +8093,12 @@ function Rc(n, e) {
|
|
|
8087
8093
|
t.parentNode && t.parentNode.removeChild(t), n.focus();
|
|
8088
8094
|
}, 50);
|
|
8089
8095
|
}
|
|
8090
|
-
const
|
|
8096
|
+
const Ft = ie && $e < 15 || Mt && va < 604;
|
|
8091
8097
|
ee.copy = te.cut = (n, e) => {
|
|
8092
8098
|
let t = e, r = n.state.selection, i = t.type == "cut";
|
|
8093
8099
|
if (r.empty)
|
|
8094
8100
|
return;
|
|
8095
|
-
let s =
|
|
8101
|
+
let s = Ft ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = Hr(n, o);
|
|
8096
8102
|
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : Rc(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
8097
8103
|
};
|
|
8098
8104
|
function Pc(n) {
|
|
@@ -8105,10 +8111,10 @@ function Bc(n, e) {
|
|
|
8105
8111
|
t || (r.contentEditable = "true"), r.style.cssText = "position: fixed; left: -10000px; top: 10px", r.focus();
|
|
8106
8112
|
let i = n.input.shiftKey && n.input.lastKeyCode != 45;
|
|
8107
8113
|
setTimeout(() => {
|
|
8108
|
-
n.focus(), r.parentNode && r.parentNode.removeChild(r), t ?
|
|
8114
|
+
n.focus(), r.parentNode && r.parentNode.removeChild(r), t ? $t(n, r.value, null, i, e) : $t(n, r.textContent, r.innerHTML, i, e);
|
|
8109
8115
|
}, 50);
|
|
8110
8116
|
}
|
|
8111
|
-
function
|
|
8117
|
+
function $t(n, e, t, r, i) {
|
|
8112
8118
|
let s = bo(n, e, t, r, n.state.selection.$from);
|
|
8113
8119
|
if (n.someProp("handlePaste", (a) => a(n, i, s || k.empty)))
|
|
8114
8120
|
return !0;
|
|
@@ -8128,8 +8134,8 @@ te.paste = (n, e) => {
|
|
|
8128
8134
|
let t = e;
|
|
8129
8135
|
if (n.composing && !Ee)
|
|
8130
8136
|
return;
|
|
8131
|
-
let r =
|
|
8132
|
-
r &&
|
|
8137
|
+
let r = Ft ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
|
|
8138
|
+
r && $t(n, vo(r), r.getData("text/html"), i, t) ? t.preventDefault() : Bc(n, t);
|
|
8133
8139
|
};
|
|
8134
8140
|
class No {
|
|
8135
8141
|
constructor(e, t, r) {
|
|
@@ -8147,7 +8153,7 @@ ee.dragstart = (n, e) => {
|
|
|
8147
8153
|
let t = e, r = n.input.mouseDown;
|
|
8148
8154
|
if (r && r.done(), !t.dataTransfer)
|
|
8149
8155
|
return;
|
|
8150
|
-
let i = n.state.selection, s = i.empty ? null : n.posAtCoords(
|
|
8156
|
+
let i = n.state.selection, s = i.empty ? null : n.posAtCoords(Bn(t)), o;
|
|
8151
8157
|
if (!(s && s.pos >= i.from && s.pos <= (i instanceof S ? i.to - 1 : i.to))) {
|
|
8152
8158
|
if (r && r.mightDrag)
|
|
8153
8159
|
o = S.create(n.state.doc, r.mightDrag.pos);
|
|
@@ -8157,7 +8163,7 @@ ee.dragstart = (n, e) => {
|
|
|
8157
8163
|
}
|
|
8158
8164
|
}
|
|
8159
8165
|
let l = (o || n.state.selection).content(), { dom: a, text: c, slice: d } = Hr(n, l);
|
|
8160
|
-
(!t.dataTransfer.files.length || !U || eo > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(
|
|
8166
|
+
(!t.dataTransfer.files.length || !U || eo > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Ft ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Ft || t.dataTransfer.setData("text/plain", c), n.dragging = new No(d, Ao(n, t), o);
|
|
8161
8167
|
};
|
|
8162
8168
|
ee.dragend = (n) => {
|
|
8163
8169
|
let e = n.dragging;
|
|
@@ -8176,13 +8182,13 @@ te.drop = (n, e) => {
|
|
|
8176
8182
|
function zc(n, e, t) {
|
|
8177
8183
|
if (!e.dataTransfer)
|
|
8178
8184
|
return;
|
|
8179
|
-
let r = n.posAtCoords(
|
|
8185
|
+
let r = n.posAtCoords(Bn(e));
|
|
8180
8186
|
if (!r)
|
|
8181
8187
|
return;
|
|
8182
8188
|
let i = n.state.doc.resolve(r.pos), s = t && t.slice;
|
|
8183
8189
|
s ? n.someProp("transformPasted", (h) => {
|
|
8184
8190
|
s = h(s, n, !1);
|
|
8185
|
-
}) : s = bo(n, vo(e.dataTransfer),
|
|
8191
|
+
}) : s = bo(n, vo(e.dataTransfer), Ft ? null : e.dataTransfer.getData("text/html"), !1, i);
|
|
8186
8192
|
let o = !!(t && Ao(n, e));
|
|
8187
8193
|
if (n.someProp("handleDrop", (h) => h(n, e, s || k.empty, o))) {
|
|
8188
8194
|
e.preventDefault();
|
|
@@ -8233,7 +8239,7 @@ ee.beforeinput = (n, e) => {
|
|
|
8233
8239
|
};
|
|
8234
8240
|
for (let n in te)
|
|
8235
8241
|
ee[n] = te[n];
|
|
8236
|
-
function
|
|
8242
|
+
function Vt(n, e) {
|
|
8237
8243
|
if (n == e)
|
|
8238
8244
|
return !0;
|
|
8239
8245
|
for (let t in n)
|
|
@@ -8244,9 +8250,9 @@ function $t(n, e) {
|
|
|
8244
8250
|
return !1;
|
|
8245
8251
|
return !0;
|
|
8246
8252
|
}
|
|
8247
|
-
class
|
|
8253
|
+
class kn {
|
|
8248
8254
|
constructor(e, t) {
|
|
8249
|
-
this.toDOM = e, this.spec = t ||
|
|
8255
|
+
this.toDOM = e, this.spec = t || tt, this.side = this.spec.side || 0;
|
|
8250
8256
|
}
|
|
8251
8257
|
map(e, t, r, i) {
|
|
8252
8258
|
let { pos: s, deleted: o } = e.mapResult(t.from + i, this.side < 0 ? -1 : 1);
|
|
@@ -8256,7 +8262,7 @@ class bn {
|
|
|
8256
8262
|
return !0;
|
|
8257
8263
|
}
|
|
8258
8264
|
eq(e) {
|
|
8259
|
-
return this == e || e instanceof
|
|
8265
|
+
return this == e || e instanceof kn && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Vt(this.spec, e.spec));
|
|
8260
8266
|
}
|
|
8261
8267
|
destroy(e) {
|
|
8262
8268
|
this.spec.destroy && this.spec.destroy(e);
|
|
@@ -8264,7 +8270,7 @@ class bn {
|
|
|
8264
8270
|
}
|
|
8265
8271
|
class He {
|
|
8266
8272
|
constructor(e, t) {
|
|
8267
|
-
this.attrs = e, this.spec = t ||
|
|
8273
|
+
this.attrs = e, this.spec = t || tt;
|
|
8268
8274
|
}
|
|
8269
8275
|
map(e, t, r, i) {
|
|
8270
8276
|
let s = e.map(t.from + i, this.spec.inclusiveStart ? -1 : 1) - r, o = e.map(t.to + i, this.spec.inclusiveEnd ? 1 : -1) - r;
|
|
@@ -8274,7 +8280,7 @@ class He {
|
|
|
8274
8280
|
return t.from < t.to;
|
|
8275
8281
|
}
|
|
8276
8282
|
eq(e) {
|
|
8277
|
-
return this == e || e instanceof He &&
|
|
8283
|
+
return this == e || e instanceof He && Vt(this.attrs, e.attrs) && Vt(this.spec, e.spec);
|
|
8278
8284
|
}
|
|
8279
8285
|
static is(e) {
|
|
8280
8286
|
return e.type instanceof He;
|
|
@@ -8284,7 +8290,7 @@ class He {
|
|
|
8284
8290
|
}
|
|
8285
8291
|
class Kr {
|
|
8286
8292
|
constructor(e, t) {
|
|
8287
|
-
this.attrs = e, this.spec = t ||
|
|
8293
|
+
this.attrs = e, this.spec = t || tt;
|
|
8288
8294
|
}
|
|
8289
8295
|
map(e, t, r, i) {
|
|
8290
8296
|
let s = e.mapResult(t.from + i, 1);
|
|
@@ -8298,7 +8304,7 @@ class Kr {
|
|
|
8298
8304
|
return i == t.from && !(s = e.child(r)).isText && i + s.nodeSize == t.to;
|
|
8299
8305
|
}
|
|
8300
8306
|
eq(e) {
|
|
8301
|
-
return this == e || e instanceof Kr &&
|
|
8307
|
+
return this == e || e instanceof Kr && Vt(this.attrs, e.attrs) && Vt(this.spec, e.spec);
|
|
8302
8308
|
}
|
|
8303
8309
|
destroy() {
|
|
8304
8310
|
}
|
|
@@ -8337,7 +8343,7 @@ class he {
|
|
|
8337
8343
|
widget's current document position.
|
|
8338
8344
|
*/
|
|
8339
8345
|
static widget(e, t, r) {
|
|
8340
|
-
return new he(e, e, new
|
|
8346
|
+
return new he(e, e, new kn(t, r));
|
|
8341
8347
|
}
|
|
8342
8348
|
/**
|
|
8343
8349
|
Creates an inline decoration, which adds the given attributes to
|
|
@@ -8371,16 +8377,16 @@ class he {
|
|
|
8371
8377
|
@internal
|
|
8372
8378
|
*/
|
|
8373
8379
|
get widget() {
|
|
8374
|
-
return this.type instanceof
|
|
8380
|
+
return this.type instanceof kn;
|
|
8375
8381
|
}
|
|
8376
8382
|
}
|
|
8377
|
-
const
|
|
8383
|
+
const pt = [], tt = {};
|
|
8378
8384
|
class z {
|
|
8379
8385
|
/**
|
|
8380
8386
|
@internal
|
|
8381
8387
|
*/
|
|
8382
8388
|
constructor(e, t) {
|
|
8383
|
-
this.local = e.length ? e :
|
|
8389
|
+
this.local = e.length ? e : pt, this.children = t.length ? t : pt;
|
|
8384
8390
|
}
|
|
8385
8391
|
/**
|
|
8386
8392
|
Create a set of decorations, using the structure of the given
|
|
@@ -8388,7 +8394,7 @@ class z {
|
|
|
8388
8394
|
you must make a copy if you want need to preserve that.
|
|
8389
8395
|
*/
|
|
8390
8396
|
static create(e, t) {
|
|
8391
|
-
return t.length ?
|
|
8397
|
+
return t.length ? xn(t, e, 0, tt) : Y;
|
|
8392
8398
|
}
|
|
8393
8399
|
/**
|
|
8394
8400
|
Find all decorations in this set which touch the given range
|
|
@@ -8418,7 +8424,7 @@ class z {
|
|
|
8418
8424
|
document.
|
|
8419
8425
|
*/
|
|
8420
8426
|
map(e, t, r) {
|
|
8421
|
-
return this == Y || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, r ||
|
|
8427
|
+
return this == Y || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, r || tt);
|
|
8422
8428
|
}
|
|
8423
8429
|
/**
|
|
8424
8430
|
@internal
|
|
@@ -8429,7 +8435,7 @@ class z {
|
|
|
8429
8435
|
let a = this.local[l].map(e, r, i);
|
|
8430
8436
|
a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
|
|
8431
8437
|
}
|
|
8432
|
-
return this.children.length ? Fc(this.children, o || [], e, t, r, i, s) : o ? new z(o.sort(
|
|
8438
|
+
return this.children.length ? Fc(this.children, o || [], e, t, r, i, s) : o ? new z(o.sort(nt), pt) : Y;
|
|
8433
8439
|
}
|
|
8434
8440
|
/**
|
|
8435
8441
|
Add the given array of decorations to the ones in the set,
|
|
@@ -8447,13 +8453,13 @@ class z {
|
|
|
8447
8453
|
if (d = Io(t, l, c)) {
|
|
8448
8454
|
for (i || (i = this.children.slice()); s < i.length && i[s] < a; )
|
|
8449
8455
|
s += 3;
|
|
8450
|
-
i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize,
|
|
8456
|
+
i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize, xn(d, l, c + 1, tt)), s += 3;
|
|
8451
8457
|
}
|
|
8452
8458
|
});
|
|
8453
8459
|
let o = Do(s ? Ro(t) : t, -r);
|
|
8454
8460
|
for (let l = 0; l < o.length; l++)
|
|
8455
8461
|
o[l].type.valid(e, o[l]) || o.splice(l--, 1);
|
|
8456
|
-
return new z(o.length ? this.local.concat(o).sort(
|
|
8462
|
+
return new z(o.length ? this.local.concat(o).sort(nt) : this.local, i || this.children);
|
|
8457
8463
|
}
|
|
8458
8464
|
/**
|
|
8459
8465
|
Create a new set that contains the decorations in this set, minus
|
|
@@ -8502,7 +8508,7 @@ class z {
|
|
|
8502
8508
|
}
|
|
8503
8509
|
}
|
|
8504
8510
|
if (i) {
|
|
8505
|
-
let l = new z(i.sort(
|
|
8511
|
+
let l = new z(i.sort(nt), pt);
|
|
8506
8512
|
return r ? new Re([l, r]) : l;
|
|
8507
8513
|
}
|
|
8508
8514
|
return r || Y;
|
|
@@ -8534,7 +8540,7 @@ class z {
|
|
|
8534
8540
|
*/
|
|
8535
8541
|
localsInner(e) {
|
|
8536
8542
|
if (this == Y)
|
|
8537
|
-
return
|
|
8543
|
+
return pt;
|
|
8538
8544
|
if (e.inlineContent || !this.local.some(He.is))
|
|
8539
8545
|
return this.local;
|
|
8540
8546
|
let t = [];
|
|
@@ -8554,7 +8560,7 @@ class Re {
|
|
|
8554
8560
|
this.members = e;
|
|
8555
8561
|
}
|
|
8556
8562
|
map(e, t) {
|
|
8557
|
-
const r = this.members.map((i) => i.map(e, t,
|
|
8563
|
+
const r = this.members.map((i) => i.map(e, t, tt));
|
|
8558
8564
|
return Re.from(r);
|
|
8559
8565
|
}
|
|
8560
8566
|
forChild(e, t) {
|
|
@@ -8588,7 +8594,7 @@ class Re {
|
|
|
8588
8594
|
t.push(s[o]);
|
|
8589
8595
|
}
|
|
8590
8596
|
}
|
|
8591
|
-
return t ? Jr(r ? t : t.sort(
|
|
8597
|
+
return t ? Jr(r ? t : t.sort(nt)) : pt;
|
|
8592
8598
|
}
|
|
8593
8599
|
// Create a group for the given array of decoration sets, or return
|
|
8594
8600
|
// a single set when possible.
|
|
@@ -8643,7 +8649,7 @@ function Fc(n, e, t, r, i, s, o) {
|
|
|
8643
8649
|
a = !0;
|
|
8644
8650
|
}
|
|
8645
8651
|
if (a) {
|
|
8646
|
-
let c = $c(l, n, e, t, i, s, o), d =
|
|
8652
|
+
let c = $c(l, n, e, t, i, s, o), d = xn(c, r, 0, o);
|
|
8647
8653
|
e = d.local;
|
|
8648
8654
|
for (let u = 0; u < l.length; u += 3)
|
|
8649
8655
|
l[u + 1] < 0 && (l.splice(u, 3), u -= 3);
|
|
@@ -8654,7 +8660,7 @@ function Fc(n, e, t, r, i, s, o) {
|
|
|
8654
8660
|
l.splice(f, 0, d.children[u], d.children[u + 1], d.children[u + 2]);
|
|
8655
8661
|
}
|
|
8656
8662
|
}
|
|
8657
|
-
return new z(e.sort(
|
|
8663
|
+
return new z(e.sort(nt), l);
|
|
8658
8664
|
}
|
|
8659
8665
|
function Do(n, e) {
|
|
8660
8666
|
if (!e || !n.length)
|
|
@@ -8693,22 +8699,22 @@ function Ro(n) {
|
|
|
8693
8699
|
n[t] != null && e.push(n[t]);
|
|
8694
8700
|
return e;
|
|
8695
8701
|
}
|
|
8696
|
-
function
|
|
8702
|
+
function xn(n, e, t, r) {
|
|
8697
8703
|
let i = [], s = !1;
|
|
8698
8704
|
e.forEach((l, a) => {
|
|
8699
8705
|
let c = Io(n, l, a + t);
|
|
8700
8706
|
if (c) {
|
|
8701
8707
|
s = !0;
|
|
8702
|
-
let d =
|
|
8708
|
+
let d = xn(c, l, t + a + 1, r);
|
|
8703
8709
|
d != Y && i.push(a, a + l.nodeSize, d);
|
|
8704
8710
|
}
|
|
8705
8711
|
});
|
|
8706
|
-
let o = Do(s ? Ro(n) : n, -t).sort(
|
|
8712
|
+
let o = Do(s ? Ro(n) : n, -t).sort(nt);
|
|
8707
8713
|
for (let l = 0; l < o.length; l++)
|
|
8708
8714
|
o[l].type.valid(e, o[l]) || (r.onRemove && r.onRemove(o[l].spec), o.splice(l--, 1));
|
|
8709
8715
|
return o.length || i.length ? new z(o, i) : Y;
|
|
8710
8716
|
}
|
|
8711
|
-
function
|
|
8717
|
+
function nt(n, e) {
|
|
8712
8718
|
return n.from - e.from || n.to - e.to;
|
|
8713
8719
|
}
|
|
8714
8720
|
function Jr(n) {
|
|
@@ -8730,11 +8736,11 @@ function Jr(n) {
|
|
|
8730
8736
|
return e;
|
|
8731
8737
|
}
|
|
8732
8738
|
function Ji(n, e, t) {
|
|
8733
|
-
for (; e < n.length &&
|
|
8739
|
+
for (; e < n.length && nt(t, n[e]) > 0; )
|
|
8734
8740
|
e++;
|
|
8735
8741
|
n.splice(e, 0, t);
|
|
8736
8742
|
}
|
|
8737
|
-
function
|
|
8743
|
+
function er(n) {
|
|
8738
8744
|
let e = [];
|
|
8739
8745
|
return n.someProp("decorations", (t) => {
|
|
8740
8746
|
let r = t(n.state);
|
|
@@ -8811,7 +8817,7 @@ class qc {
|
|
|
8811
8817
|
return Ne(this.view);
|
|
8812
8818
|
if (ie && $e <= 11 && !this.view.state.selection.empty) {
|
|
8813
8819
|
let e = this.view.domSelectionRange();
|
|
8814
|
-
if (e.focusNode &&
|
|
8820
|
+
if (e.focusNode && ot(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
|
|
8815
8821
|
return this.flushSoon();
|
|
8816
8822
|
}
|
|
8817
8823
|
this.flush();
|
|
@@ -8824,9 +8830,9 @@ class qc {
|
|
|
8824
8830
|
if (!e.focusNode)
|
|
8825
8831
|
return !0;
|
|
8826
8832
|
let t = /* @__PURE__ */ new Set(), r;
|
|
8827
|
-
for (let s = e.focusNode; s; s =
|
|
8833
|
+
for (let s = e.focusNode; s; s = St(s))
|
|
8828
8834
|
t.add(s);
|
|
8829
|
-
for (let s = e.anchorNode; s; s =
|
|
8835
|
+
for (let s = e.anchorNode; s; s = St(s))
|
|
8830
8836
|
if (t.has(s)) {
|
|
8831
8837
|
r = s;
|
|
8832
8838
|
break;
|
|
@@ -8882,7 +8888,7 @@ class qc {
|
|
|
8882
8888
|
}
|
|
8883
8889
|
}
|
|
8884
8890
|
let c = null;
|
|
8885
|
-
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 &&
|
|
8891
|
+
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Rn(r) && (c = $r(e)) && c.eq(E.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Ne(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), jc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, Uc(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || Ne(e), this.currentSelection.set(r));
|
|
8886
8892
|
}
|
|
8887
8893
|
registerMutation(e, t) {
|
|
8888
8894
|
if (t.indexOf(e.target) > -1)
|
|
@@ -8927,7 +8933,7 @@ function jc(n) {
|
|
|
8927
8933
|
}
|
|
8928
8934
|
function Gi(n, e) {
|
|
8929
8935
|
let t = e.startContainer, r = e.startOffset, i = e.endContainer, s = e.endOffset, o = n.domAtPos(n.state.selection.anchor);
|
|
8930
|
-
return
|
|
8936
|
+
return ot(o.node, o.offset, i, s) && ([t, r, i, s] = [i, s, t, r]), { anchorNode: t, anchorOffset: r, focusNode: i, focusOffset: s };
|
|
8931
8937
|
}
|
|
8932
8938
|
function Kc(n, e) {
|
|
8933
8939
|
if (e.getComposedRanges) {
|
|
@@ -8972,7 +8978,7 @@ function Uc(n, e) {
|
|
|
8972
8978
|
}
|
|
8973
8979
|
function _c(n, e, t) {
|
|
8974
8980
|
let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
|
|
8975
|
-
if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }],
|
|
8981
|
+
if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], Rn(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), U && n.input.lastKeyCode === 8)
|
|
8976
8982
|
for (let g = s; g > i; g--) {
|
|
8977
8983
|
let y = r.childNodes[g - 1], T = y.pmViewDesc;
|
|
8978
8984
|
if (y.nodeName == "BR" && !T) {
|
|
@@ -9031,7 +9037,7 @@ function Xc(n, e, t, r, i) {
|
|
|
9031
9037
|
let a = n.state.selection, c = _c(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, h;
|
|
9032
9038
|
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;
|
|
9033
9039
|
let p = ed(u.content, c.doc.content, c.from, f, h);
|
|
9034
|
-
if (p && n.input.domChangeCount++, (
|
|
9040
|
+
if (p && n.input.domChangeCount++, (Mt && n.input.lastIOSEnter > Date.now() - 225 || Ee) && i.some((C) => C.nodeType == 1 && !Yc.test(C.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (C) => C(n, Je(13, "Enter")))) {
|
|
9035
9041
|
n.input.lastIOSEnter = 0;
|
|
9036
9042
|
return;
|
|
9037
9043
|
}
|
|
@@ -9050,7 +9056,7 @@ function Xc(n, e, t, r, i) {
|
|
|
9050
9056
|
}
|
|
9051
9057
|
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)), ie && $e <= 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--);
|
|
9052
9058
|
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;
|
|
9053
|
-
if ((
|
|
9059
|
+
if ((Mt && 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, Je(13, "Enter")))) {
|
|
9054
9060
|
n.input.lastIOSEnter = 0;
|
|
9055
9061
|
return;
|
|
9056
9062
|
}
|
|
@@ -9115,7 +9121,7 @@ function Qc(n, e, t, r, i) {
|
|
|
9115
9121
|
if (
|
|
9116
9122
|
// The content must have shrunk
|
|
9117
9123
|
t - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
|
|
9118
|
-
|
|
9124
|
+
tr(r, !0, !1) < i.pos
|
|
9119
9125
|
)
|
|
9120
9126
|
return !1;
|
|
9121
9127
|
let s = n.resolve(e);
|
|
@@ -9125,10 +9131,10 @@ function Qc(n, e, t, r, i) {
|
|
|
9125
9131
|
}
|
|
9126
9132
|
if (s.parentOffset < s.parent.content.size || !s.parent.isTextblock)
|
|
9127
9133
|
return !1;
|
|
9128
|
-
let o = n.resolve(
|
|
9129
|
-
return !o.parent.isTextblock || o.pos > t ||
|
|
9134
|
+
let o = n.resolve(tr(s, !0, !0));
|
|
9135
|
+
return !o.parent.isTextblock || o.pos > t || tr(o, !0, !1) < t ? !1 : r.parent.content.cut(r.parentOffset).eq(o.parent.content);
|
|
9130
9136
|
}
|
|
9131
|
-
function
|
|
9137
|
+
function tr(n, e, t) {
|
|
9132
9138
|
let r = n.depth, i = e ? n.end() : n.pos;
|
|
9133
9139
|
for (; r > 0 && (e || n.indexAfter(r) == n.node(r).childCount); )
|
|
9134
9140
|
r--, i++, e = !1;
|
|
@@ -9172,7 +9178,7 @@ class Po {
|
|
|
9172
9178
|
added to the document.
|
|
9173
9179
|
*/
|
|
9174
9180
|
constructor(e, t) {
|
|
9175
|
-
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new gc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ns), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = es(this), Qi(this), this.nodeViews = ts(this), this.docView = Ii(this.state.doc, Zi(this),
|
|
9181
|
+
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new gc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ns), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = es(this), Qi(this), this.nodeViews = ts(this), this.docView = Ii(this.state.doc, Zi(this), er(this), this.dom, this), this.domObserver = new qc(this, (r, i, s, o) => Xc(this, r, i, s, o)), this.domObserver.start(), yc(this), this.updatePluginViews();
|
|
9176
9182
|
}
|
|
9177
9183
|
/**
|
|
9178
9184
|
Holds `true` when a
|
|
@@ -9200,7 +9206,7 @@ class Po {
|
|
|
9200
9206
|
the DOM.
|
|
9201
9207
|
*/
|
|
9202
9208
|
update(e) {
|
|
9203
|
-
e.handleDOMEvents != this._props.handleDOMEvents &&
|
|
9209
|
+
e.handleDOMEvents != this._props.handleDOMEvents && Or(this);
|
|
9204
9210
|
let t = this._props;
|
|
9205
9211
|
this._props = e, e.plugins && (e.plugins.forEach(ns), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);
|
|
9206
9212
|
}
|
|
@@ -9234,8 +9240,8 @@ class Po {
|
|
|
9234
9240
|
let h = ts(this);
|
|
9235
9241
|
nd(h, this.nodeViews) && (this.nodeViews = h, s = !0);
|
|
9236
9242
|
}
|
|
9237
|
-
(l || t.handleDOMEvents != this._props.handleDOMEvents) &&
|
|
9238
|
-
let a =
|
|
9243
|
+
(l || t.handleDOMEvents != this._props.handleDOMEvents) && Or(this), this.editable = es(this), Qi(this);
|
|
9244
|
+
let a = er(this), c = Zi(this), d = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", u = s || !this.docView.matchesNode(e.doc, c, a);
|
|
9239
9245
|
(u || !e.selection.eq(i.selection)) && (o = !0);
|
|
9240
9246
|
let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Da(this);
|
|
9241
9247
|
if (o) {
|
|
@@ -9441,13 +9447,13 @@ class Po {
|
|
|
9441
9447
|
[`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
|
|
9442
9448
|
*/
|
|
9443
9449
|
pasteHTML(e, t) {
|
|
9444
|
-
return
|
|
9450
|
+
return $t(this, "", e, !1, t || new ClipboardEvent("paste"));
|
|
9445
9451
|
}
|
|
9446
9452
|
/**
|
|
9447
9453
|
Run the editor's paste logic with the given plain-text input.
|
|
9448
9454
|
*/
|
|
9449
9455
|
pasteText(e, t) {
|
|
9450
|
-
return
|
|
9456
|
+
return $t(this, e, null, !0, t || new ClipboardEvent("paste"));
|
|
9451
9457
|
}
|
|
9452
9458
|
/**
|
|
9453
9459
|
Serialize the given slice as it would be if it was copied from
|
|
@@ -9465,7 +9471,7 @@ class Po {
|
|
|
9465
9471
|
views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
9466
9472
|
*/
|
|
9467
9473
|
destroy() {
|
|
9468
|
-
this.docView && (bc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [],
|
|
9474
|
+
this.docView && (bc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], er(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, Sa());
|
|
9469
9475
|
}
|
|
9470
9476
|
/**
|
|
9471
9477
|
This is true when the view has been
|
|
@@ -9597,7 +9603,7 @@ var We = {
|
|
|
9597
9603
|
220: "\\",
|
|
9598
9604
|
221: "]",
|
|
9599
9605
|
222: "'"
|
|
9600
|
-
},
|
|
9606
|
+
}, Sn = {
|
|
9601
9607
|
48: ")",
|
|
9602
9608
|
49: "!",
|
|
9603
9609
|
50: "@",
|
|
@@ -9626,10 +9632,10 @@ var We = {
|
|
|
9626
9632
|
for (var J = 0; J < 10; J++) We[48 + J] = We[96 + J] = String(J);
|
|
9627
9633
|
for (var J = 1; J <= 24; J++) We[J + 111] = "F" + J;
|
|
9628
9634
|
for (var J = 65; J <= 90; J++)
|
|
9629
|
-
We[J] = String.fromCharCode(J + 32),
|
|
9630
|
-
for (var
|
|
9635
|
+
We[J] = String.fromCharCode(J + 32), Sn[J] = String.fromCharCode(J);
|
|
9636
|
+
for (var nr in We) Sn.hasOwnProperty(nr) || (Sn[nr] = We[nr]);
|
|
9631
9637
|
function sd(n) {
|
|
9632
|
-
var e = rd && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || id && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ?
|
|
9638
|
+
var e = rd && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || id && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? Sn : We)[n.keyCode] || n.key || "Unidentified";
|
|
9633
9639
|
return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
|
|
9634
9640
|
}
|
|
9635
9641
|
const od = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), ld = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
@@ -9660,7 +9666,7 @@ function cd(n) {
|
|
|
9660
9666
|
e[ad(t)] = n[t];
|
|
9661
9667
|
return e;
|
|
9662
9668
|
}
|
|
9663
|
-
function
|
|
9669
|
+
function rr(n, e, t = !0) {
|
|
9664
9670
|
return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
|
|
9665
9671
|
}
|
|
9666
9672
|
function dd(n) {
|
|
@@ -9669,18 +9675,18 @@ function dd(n) {
|
|
|
9669
9675
|
function Bo(n) {
|
|
9670
9676
|
let e = cd(n);
|
|
9671
9677
|
return function(t, r) {
|
|
9672
|
-
let i = sd(r), s, o = e[
|
|
9678
|
+
let i = sd(r), s, o = e[rr(i, r)];
|
|
9673
9679
|
if (o && o(t.state, t.dispatch, t))
|
|
9674
9680
|
return !0;
|
|
9675
9681
|
if (i.length == 1 && i != " ") {
|
|
9676
9682
|
if (r.shiftKey) {
|
|
9677
|
-
let l = e[
|
|
9683
|
+
let l = e[rr(i, r, !1)];
|
|
9678
9684
|
if (l && l(t.state, t.dispatch, t))
|
|
9679
9685
|
return !0;
|
|
9680
9686
|
}
|
|
9681
9687
|
if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
|
|
9682
9688
|
!(ld && r.ctrlKey && r.altKey) && (s = We[r.keyCode]) && s != i) {
|
|
9683
|
-
let l = e[
|
|
9689
|
+
let l = e[rr(s, r)];
|
|
9684
9690
|
if (l && l(t.state, t.dispatch, t))
|
|
9685
9691
|
return !0;
|
|
9686
9692
|
}
|
|
@@ -9699,19 +9705,19 @@ const zo = (n, e, t) => {
|
|
|
9699
9705
|
return !1;
|
|
9700
9706
|
let i = _r(r);
|
|
9701
9707
|
if (!i) {
|
|
9702
|
-
let o = r.blockRange(), l = o &&
|
|
9708
|
+
let o = r.blockRange(), l = o && Ct(o);
|
|
9703
9709
|
return l == null ? !1 : (e && e(n.tr.lift(o, l).scrollIntoView()), !0);
|
|
9704
9710
|
}
|
|
9705
9711
|
let s = i.nodeBefore;
|
|
9706
9712
|
if (Jo(n, i, e, -1))
|
|
9707
9713
|
return !0;
|
|
9708
|
-
if (r.parent.content.size == 0 && (
|
|
9714
|
+
if (r.parent.content.size == 0 && (wt(s, "end") || S.isSelectable(s)))
|
|
9709
9715
|
for (let o = r.depth; ; o--) {
|
|
9710
|
-
let l =
|
|
9716
|
+
let l = Dn(n.doc, r.before(o), r.after(o), k.empty);
|
|
9711
9717
|
if (l && l.slice.size < l.to - l.from) {
|
|
9712
9718
|
if (e) {
|
|
9713
9719
|
let a = n.tr.step(l);
|
|
9714
|
-
a.setSelection(
|
|
9720
|
+
a.setSelection(wt(s, "end") ? E.findFrom(a.doc.resolve(a.mapping.map(i.pos, -1)), -1) : S.create(a.doc, i.pos - s.nodeSize)), e(a.scrollIntoView());
|
|
9715
9721
|
}
|
|
9716
9722
|
return !0;
|
|
9717
9723
|
}
|
|
@@ -9751,7 +9757,7 @@ function Fo(n, e, t) {
|
|
|
9751
9757
|
return !1;
|
|
9752
9758
|
l = d;
|
|
9753
9759
|
}
|
|
9754
|
-
let c =
|
|
9760
|
+
let c = Dn(n.doc, s, a, k.empty);
|
|
9755
9761
|
if (!c || c.from != s || c instanceof P && c.slice.size >= a - s)
|
|
9756
9762
|
return !1;
|
|
9757
9763
|
if (t) {
|
|
@@ -9760,7 +9766,7 @@ function Fo(n, e, t) {
|
|
|
9760
9766
|
}
|
|
9761
9767
|
return !0;
|
|
9762
9768
|
}
|
|
9763
|
-
function
|
|
9769
|
+
function wt(n, e, t = !1) {
|
|
9764
9770
|
for (let r = n; r; r = e == "start" ? r.firstChild : r.lastChild) {
|
|
9765
9771
|
if (r.isTextblock)
|
|
9766
9772
|
return !0;
|
|
@@ -9805,12 +9811,12 @@ const Ho = (n, e, t) => {
|
|
|
9805
9811
|
let s = i.nodeAfter;
|
|
9806
9812
|
if (Jo(n, i, e, 1))
|
|
9807
9813
|
return !0;
|
|
9808
|
-
if (r.parent.content.size == 0 && (
|
|
9809
|
-
let o =
|
|
9814
|
+
if (r.parent.content.size == 0 && (wt(s, "start") || S.isSelectable(s))) {
|
|
9815
|
+
let o = Dn(n.doc, r.before(), r.after(), k.empty);
|
|
9810
9816
|
if (o && o.slice.size < o.to - o.from) {
|
|
9811
9817
|
if (e) {
|
|
9812
9818
|
let l = n.tr.step(o);
|
|
9813
|
-
l.setSelection(
|
|
9819
|
+
l.setSelection(wt(s, "start") ? E.findFrom(l.doc.resolve(l.mapping.map(i.pos)), 1) : S.create(l.doc, l.mapping.map(i.pos))), e(l.scrollIntoView());
|
|
9814
9820
|
}
|
|
9815
9821
|
return !0;
|
|
9816
9822
|
}
|
|
@@ -9845,7 +9851,7 @@ const hd = (n, e) => {
|
|
|
9845
9851
|
if (t.node.isTextblock || !qe(n.doc, t.from))
|
|
9846
9852
|
return !1;
|
|
9847
9853
|
i = t.from;
|
|
9848
|
-
} else if (i =
|
|
9854
|
+
} else if (i = An(n.doc, t.from, -1), i == null)
|
|
9849
9855
|
return !1;
|
|
9850
9856
|
if (e) {
|
|
9851
9857
|
let s = n.tr.join(i);
|
|
@@ -9858,11 +9864,11 @@ const hd = (n, e) => {
|
|
|
9858
9864
|
if (t.node.isTextblock || !qe(n.doc, t.to))
|
|
9859
9865
|
return !1;
|
|
9860
9866
|
r = t.to;
|
|
9861
|
-
} else if (r =
|
|
9867
|
+
} else if (r = An(n.doc, t.to, 1), r == null)
|
|
9862
9868
|
return !1;
|
|
9863
9869
|
return e && e(n.tr.join(r).scrollIntoView()), !0;
|
|
9864
9870
|
}, md = (n, e) => {
|
|
9865
|
-
let { $from: t, $to: r } = n.selection, i = t.blockRange(r), s = i &&
|
|
9871
|
+
let { $from: t, $to: r } = n.selection, i = t.blockRange(r), s = i && Ct(i);
|
|
9866
9872
|
return s == null ? !1 : (e && e(n.tr.lift(i, s).scrollIntoView()), !0);
|
|
9867
9873
|
}, qo = (n, e) => {
|
|
9868
9874
|
let { $head: t, $anchor: r } = n.selection;
|
|
@@ -9886,7 +9892,7 @@ const gd = (n, e) => {
|
|
|
9886
9892
|
return !1;
|
|
9887
9893
|
if (e) {
|
|
9888
9894
|
let l = t.after(), a = n.tr.replaceWith(l, l, o.createAndFill());
|
|
9889
|
-
a.setSelection(
|
|
9895
|
+
a.setSelection(E.near(a.doc.resolve(l), 1)), e(a.scrollIntoView());
|
|
9890
9896
|
}
|
|
9891
9897
|
return !0;
|
|
9892
9898
|
}, jo = (n, e) => {
|
|
@@ -9910,7 +9916,7 @@ const gd = (n, e) => {
|
|
|
9910
9916
|
if (ve(n.doc, s))
|
|
9911
9917
|
return e && e(n.tr.split(s).scrollIntoView()), !0;
|
|
9912
9918
|
}
|
|
9913
|
-
let r = t.blockRange(), i = r &&
|
|
9919
|
+
let r = t.blockRange(), i = r && Ct(r);
|
|
9914
9920
|
return i == null ? !1 : (e && e(n.tr.lift(r, i).scrollIntoView()), !0);
|
|
9915
9921
|
};
|
|
9916
9922
|
function yd(n) {
|
|
@@ -9966,10 +9972,10 @@ function Jo(n, e, t, r) {
|
|
|
9966
9972
|
}
|
|
9967
9973
|
return !0;
|
|
9968
9974
|
}
|
|
9969
|
-
let d = s.type.spec.isolating || r > 0 && a ? null :
|
|
9975
|
+
let d = s.type.spec.isolating || r > 0 && a ? null : E.findFrom(e, 1), u = d && d.$from.blockRange(d.$to), f = u && Ct(u);
|
|
9970
9976
|
if (f != null && f >= e.depth)
|
|
9971
9977
|
return t && t(n.tr.lift(u, f).scrollIntoView()), !0;
|
|
9972
|
-
if (c &&
|
|
9978
|
+
if (c && wt(s, "start", !0) && wt(i, "end")) {
|
|
9973
9979
|
let h = i, p = [];
|
|
9974
9980
|
for (; p.push(h), !h.isTextblock; )
|
|
9975
9981
|
h = h.lastChild;
|
|
@@ -10064,7 +10070,7 @@ function Td(n, e, t, r = null) {
|
|
|
10064
10070
|
if (e.$from.index(e.depth - 1) == 0)
|
|
10065
10071
|
return !1;
|
|
10066
10072
|
let a = o.resolve(e.start - 2);
|
|
10067
|
-
s = new
|
|
10073
|
+
s = new pn(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new pn(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), i = !0;
|
|
10068
10074
|
}
|
|
10069
10075
|
let l = Lr(s, t, r, e);
|
|
10070
10076
|
return l ? (n && Od(n, e, l, i, t), !0) : !1;
|
|
@@ -10090,8 +10096,8 @@ function Ed(n) {
|
|
|
10090
10096
|
}
|
|
10091
10097
|
function vd(n, e, t, r) {
|
|
10092
10098
|
let i = n.tr, s = r.end, o = r.$to.end(r.depth);
|
|
10093
|
-
s < o && (i.step(new F(s - 1, o, s, o, new k(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new
|
|
10094
|
-
const l =
|
|
10099
|
+
s < o && (i.step(new F(s - 1, o, s, o, new k(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new pn(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
|
|
10100
|
+
const l = Ct(r);
|
|
10095
10101
|
if (l == null)
|
|
10096
10102
|
return !1;
|
|
10097
10103
|
i.lift(r, l);
|
|
@@ -10129,7 +10135,7 @@ function Ad(n) {
|
|
|
10129
10135
|
return !0;
|
|
10130
10136
|
};
|
|
10131
10137
|
}
|
|
10132
|
-
function
|
|
10138
|
+
function Ln(n) {
|
|
10133
10139
|
const { state: e, transaction: t } = n;
|
|
10134
10140
|
let { selection: r } = t, { doc: i } = t, { storedMarks: s } = t;
|
|
10135
10141
|
return {
|
|
@@ -10154,7 +10160,7 @@ function Bn(n) {
|
|
|
10154
10160
|
}
|
|
10155
10161
|
};
|
|
10156
10162
|
}
|
|
10157
|
-
class
|
|
10163
|
+
class zn {
|
|
10158
10164
|
constructor(e) {
|
|
10159
10165
|
this.editor = e.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = e.state;
|
|
10160
10166
|
}
|
|
@@ -10199,7 +10205,7 @@ class Ln {
|
|
|
10199
10205
|
tr: e,
|
|
10200
10206
|
editor: i,
|
|
10201
10207
|
view: o,
|
|
10202
|
-
state:
|
|
10208
|
+
state: Ln({
|
|
10203
10209
|
state: s,
|
|
10204
10210
|
transaction: e
|
|
10205
10211
|
}),
|
|
@@ -10245,7 +10251,7 @@ function x(n, e, t) {
|
|
|
10245
10251
|
parent: n.parent ? x(n.parent, e, t) : null
|
|
10246
10252
|
}) : n.config[e];
|
|
10247
10253
|
}
|
|
10248
|
-
function
|
|
10254
|
+
function Fn(n) {
|
|
10249
10255
|
const e = n.filter((i) => i.type === "extension"), t = n.filter((i) => i.type === "node"), r = n.filter((i) => i.type === "mark");
|
|
10250
10256
|
return {
|
|
10251
10257
|
baseExtensions: e,
|
|
@@ -10254,7 +10260,7 @@ function zn(n) {
|
|
|
10254
10260
|
};
|
|
10255
10261
|
}
|
|
10256
10262
|
function _o(n) {
|
|
10257
|
-
const e = [], { nodeExtensions: t, markExtensions: r } =
|
|
10263
|
+
const e = [], { nodeExtensions: t, markExtensions: r } = Fn(n), i = [...t, ...r], s = {
|
|
10258
10264
|
default: null,
|
|
10259
10265
|
rendered: !0,
|
|
10260
10266
|
renderHTML: null,
|
|
@@ -10340,7 +10346,7 @@ function H(...n) {
|
|
|
10340
10346
|
}), r;
|
|
10341
10347
|
}, {});
|
|
10342
10348
|
}
|
|
10343
|
-
function
|
|
10349
|
+
function Er(n, e) {
|
|
10344
10350
|
return e.filter((t) => t.type === n.type.name).filter((t) => t.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(n.attrs) || {} : {
|
|
10345
10351
|
[t.name]: n.attrs[t.name]
|
|
10346
10352
|
}).reduce((t, r) => H(t, r), {});
|
|
@@ -10383,7 +10389,7 @@ function ss(n) {
|
|
|
10383
10389
|
}
|
|
10384
10390
|
function Pd(n, e) {
|
|
10385
10391
|
var t;
|
|
10386
|
-
const r = _o(n), { nodeExtensions: i, markExtensions: s } =
|
|
10392
|
+
const r = _o(n), { nodeExtensions: i, markExtensions: s } = Fn(n), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
|
|
10387
10393
|
const d = r.filter((y) => y.type === c.name), u = {
|
|
10388
10394
|
name: c.name,
|
|
10389
10395
|
options: c.options,
|
|
@@ -10418,7 +10424,7 @@ function Pd(n, e) {
|
|
|
10418
10424
|
const m = x(c, "renderHTML", u);
|
|
10419
10425
|
m && (h.toDOM = (y) => m({
|
|
10420
10426
|
node: y,
|
|
10421
|
-
HTMLAttributes:
|
|
10427
|
+
HTMLAttributes: Er(y, d)
|
|
10422
10428
|
}));
|
|
10423
10429
|
const g = x(c, "renderText", u);
|
|
10424
10430
|
return g && (h.toText = g), [c.name, h];
|
|
@@ -10450,7 +10456,7 @@ function Pd(n, e) {
|
|
|
10450
10456
|
const m = x(c, "renderHTML", u);
|
|
10451
10457
|
return m && (h.toDOM = (g) => m({
|
|
10452
10458
|
mark: g,
|
|
10453
|
-
HTMLAttributes:
|
|
10459
|
+
HTMLAttributes: Er(g, d)
|
|
10454
10460
|
})), [c.name, h];
|
|
10455
10461
|
}));
|
|
10456
10462
|
return new Bs({
|
|
@@ -10459,14 +10465,14 @@ function Pd(n, e) {
|
|
|
10459
10465
|
marks: a
|
|
10460
10466
|
});
|
|
10461
10467
|
}
|
|
10462
|
-
function
|
|
10468
|
+
function ir(n, e) {
|
|
10463
10469
|
return e.nodes[n] || e.marks[n] || null;
|
|
10464
10470
|
}
|
|
10465
10471
|
function ls(n, e) {
|
|
10466
10472
|
return Array.isArray(e) ? e.some((t) => (typeof t == "string" ? t : t.name) === n.name) : e;
|
|
10467
10473
|
}
|
|
10468
10474
|
function Zr(n, e) {
|
|
10469
|
-
const t =
|
|
10475
|
+
const t = dt.fromSchema(e).serializeFragment(n), i = document.implementation.createHTMLDocument().createElement("div");
|
|
10470
10476
|
return i.appendChild(t), i.innerHTML;
|
|
10471
10477
|
}
|
|
10472
10478
|
const Bd = (n, e = 500) => {
|
|
@@ -10486,7 +10492,7 @@ const Bd = (n, e = 500) => {
|
|
|
10486
10492
|
function Qr(n) {
|
|
10487
10493
|
return Object.prototype.toString.call(n) === "[object RegExp]";
|
|
10488
10494
|
}
|
|
10489
|
-
class
|
|
10495
|
+
class $n {
|
|
10490
10496
|
constructor(e) {
|
|
10491
10497
|
this.find = e.find, this.handler = e.handler;
|
|
10492
10498
|
}
|
|
@@ -10500,7 +10506,7 @@ const Ld = (n, e) => {
|
|
|
10500
10506
|
const r = [t.text];
|
|
10501
10507
|
return r.index = t.index, r.input = n, r.data = t.data, t.replaceWith && (t.text.includes(t.replaceWith) || console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'), r.push(t.replaceWith)), r;
|
|
10502
10508
|
};
|
|
10503
|
-
function
|
|
10509
|
+
function tn(n) {
|
|
10504
10510
|
var e;
|
|
10505
10511
|
const { editor: t, from: r, to: i, text: s, rules: o, plugin: l } = n, { view: a } = t;
|
|
10506
10512
|
if (a.composing)
|
|
@@ -10519,13 +10525,13 @@ function en(n) {
|
|
|
10519
10525
|
const h = Ld(u, f.find);
|
|
10520
10526
|
if (!h)
|
|
10521
10527
|
return;
|
|
10522
|
-
const p = a.state.tr, m =
|
|
10528
|
+
const p = a.state.tr, m = Ln({
|
|
10523
10529
|
state: a.state,
|
|
10524
10530
|
transaction: p
|
|
10525
10531
|
}), g = {
|
|
10526
10532
|
from: r - (h[0].length - s.length),
|
|
10527
10533
|
to: i
|
|
10528
|
-
}, { commands: y, chain: T, can: w } = new
|
|
10534
|
+
}, { commands: y, chain: T, can: w } = new zn({
|
|
10529
10535
|
editor: t,
|
|
10530
10536
|
state: m
|
|
10531
10537
|
});
|
|
@@ -10559,7 +10565,7 @@ function zd(n) {
|
|
|
10559
10565
|
let { text: d } = a;
|
|
10560
10566
|
typeof d == "string" ? d = d : d = Zr(b.from(d), o.schema);
|
|
10561
10567
|
const { from: u } = a, f = u + d.length;
|
|
10562
|
-
|
|
10568
|
+
tn({
|
|
10563
10569
|
editor: e,
|
|
10564
10570
|
from: u,
|
|
10565
10571
|
to: f,
|
|
@@ -10572,7 +10578,7 @@ function zd(n) {
|
|
|
10572
10578
|
},
|
|
10573
10579
|
props: {
|
|
10574
10580
|
handleTextInput(i, s, o, l) {
|
|
10575
|
-
return
|
|
10581
|
+
return tn({
|
|
10576
10582
|
editor: e,
|
|
10577
10583
|
from: s,
|
|
10578
10584
|
to: o,
|
|
@@ -10584,7 +10590,7 @@ function zd(n) {
|
|
|
10584
10590
|
handleDOMEvents: {
|
|
10585
10591
|
compositionend: (i) => (setTimeout(() => {
|
|
10586
10592
|
const { $cursor: s } = i.state.selection;
|
|
10587
|
-
s &&
|
|
10593
|
+
s && tn({
|
|
10588
10594
|
editor: e,
|
|
10589
10595
|
from: s.pos,
|
|
10590
10596
|
to: s.pos,
|
|
@@ -10600,7 +10606,7 @@ function zd(n) {
|
|
|
10600
10606
|
if (s.key !== "Enter")
|
|
10601
10607
|
return !1;
|
|
10602
10608
|
const { $cursor: o } = i.state.selection;
|
|
10603
|
-
return o ?
|
|
10609
|
+
return o ? tn({
|
|
10604
10610
|
editor: e,
|
|
10605
10611
|
from: o.pos,
|
|
10606
10612
|
to: o.pos,
|
|
@@ -10619,13 +10625,13 @@ function zd(n) {
|
|
|
10619
10625
|
function Fd(n) {
|
|
10620
10626
|
return Object.prototype.toString.call(n).slice(8, -1);
|
|
10621
10627
|
}
|
|
10622
|
-
function
|
|
10628
|
+
function nn(n) {
|
|
10623
10629
|
return Fd(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
|
|
10624
10630
|
}
|
|
10625
|
-
function
|
|
10631
|
+
function Vn(n, e) {
|
|
10626
10632
|
const t = { ...n };
|
|
10627
|
-
return
|
|
10628
|
-
|
|
10633
|
+
return nn(n) && nn(e) && Object.keys(e).forEach((r) => {
|
|
10634
|
+
nn(e[r]) && nn(n[r]) ? t[r] = Vn(n[r], e[r]) : t[r] = e[r];
|
|
10629
10635
|
}), t;
|
|
10630
10636
|
}
|
|
10631
10637
|
class Me {
|
|
@@ -10649,7 +10655,7 @@ class Me {
|
|
|
10649
10655
|
configure(e = {}) {
|
|
10650
10656
|
const t = this.extend({
|
|
10651
10657
|
...this.config,
|
|
10652
|
-
addOptions: () =>
|
|
10658
|
+
addOptions: () => Vn(this.options, e)
|
|
10653
10659
|
});
|
|
10654
10660
|
return t.name = this.name, t.parent = this.parent, t;
|
|
10655
10661
|
}
|
|
@@ -10692,7 +10698,7 @@ const Hd = (n, e, t) => {
|
|
|
10692
10698
|
}) : [];
|
|
10693
10699
|
};
|
|
10694
10700
|
function Wd(n) {
|
|
10695
|
-
const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new
|
|
10701
|
+
const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new zn({
|
|
10696
10702
|
editor: e,
|
|
10697
10703
|
state: t
|
|
10698
10704
|
}), u = [];
|
|
@@ -10720,7 +10726,7 @@ function Wd(n) {
|
|
|
10720
10726
|
});
|
|
10721
10727
|
}), u.every((h) => h !== null);
|
|
10722
10728
|
}
|
|
10723
|
-
let
|
|
10729
|
+
let rn = null;
|
|
10724
10730
|
const qd = (n) => {
|
|
10725
10731
|
var e;
|
|
10726
10732
|
const t = new ClipboardEvent("paste", {
|
|
@@ -10737,7 +10743,7 @@ function jd(n) {
|
|
|
10737
10743
|
l = null;
|
|
10738
10744
|
}
|
|
10739
10745
|
const a = ({ state: d, from: u, to: f, rule: h, pasteEvt: p }) => {
|
|
10740
|
-
const m = d.tr, g =
|
|
10746
|
+
const m = d.tr, g = Ln({
|
|
10741
10747
|
state: d,
|
|
10742
10748
|
transaction: m
|
|
10743
10749
|
});
|
|
@@ -10763,9 +10769,9 @@ function jd(n) {
|
|
|
10763
10769
|
view(u) {
|
|
10764
10770
|
const f = (p) => {
|
|
10765
10771
|
var m;
|
|
10766
|
-
r = !((m = u.dom.parentElement) === null || m === void 0) && m.contains(p.target) ? u.dom.parentElement : null, r && (
|
|
10772
|
+
r = !((m = u.dom.parentElement) === null || m === void 0) && m.contains(p.target) ? u.dom.parentElement : null, r && (rn = e);
|
|
10767
10773
|
}, h = () => {
|
|
10768
|
-
|
|
10774
|
+
rn && (rn = null);
|
|
10769
10775
|
};
|
|
10770
10776
|
return window.addEventListener("dragstart", f), window.addEventListener("dragend", h), {
|
|
10771
10777
|
destroy() {
|
|
@@ -10777,7 +10783,7 @@ function jd(n) {
|
|
|
10777
10783
|
handleDOMEvents: {
|
|
10778
10784
|
drop: (u, f) => {
|
|
10779
10785
|
if (s = r === u.dom.parentElement, l = f, !s) {
|
|
10780
|
-
const h =
|
|
10786
|
+
const h = rn;
|
|
10781
10787
|
h != null && h.isEditable && setTimeout(() => {
|
|
10782
10788
|
const p = h.state.selection;
|
|
10783
10789
|
p && h.commands.deleteRange({ from: p.from, to: p.to });
|
|
@@ -10824,9 +10830,9 @@ function Kd(n) {
|
|
|
10824
10830
|
const e = n.filter((t, r) => n.indexOf(t) !== r);
|
|
10825
10831
|
return Array.from(new Set(e));
|
|
10826
10832
|
}
|
|
10827
|
-
class
|
|
10833
|
+
class gt {
|
|
10828
10834
|
constructor(e, t) {
|
|
10829
|
-
this.splittableMarks = [], this.editor = t, this.extensions =
|
|
10835
|
+
this.splittableMarks = [], this.editor = t, this.extensions = gt.resolve(e), this.schema = Pd(this.extensions, t), this.setupExtensions();
|
|
10830
10836
|
}
|
|
10831
10837
|
/**
|
|
10832
10838
|
* Returns a flattened and sorted extension list while
|
|
@@ -10835,7 +10841,7 @@ class mt {
|
|
|
10835
10841
|
* @returns An flattened and sorted array of Tiptap extensions
|
|
10836
10842
|
*/
|
|
10837
10843
|
static resolve(e) {
|
|
10838
|
-
const t =
|
|
10844
|
+
const t = gt.sort(gt.flatten(e)), r = Kd(t.map((i) => i.name));
|
|
10839
10845
|
return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((i) => `'${i}'`).join(", ")}]. This can lead to issues.`), t;
|
|
10840
10846
|
}
|
|
10841
10847
|
/**
|
|
@@ -10875,7 +10881,7 @@ class mt {
|
|
|
10875
10881
|
options: t.options,
|
|
10876
10882
|
storage: t.storage,
|
|
10877
10883
|
editor: this.editor,
|
|
10878
|
-
type:
|
|
10884
|
+
type: ir(t.name, this.schema)
|
|
10879
10885
|
}, i = x(t, "addCommands", r);
|
|
10880
10886
|
return i ? {
|
|
10881
10887
|
...e,
|
|
@@ -10888,13 +10894,13 @@ class mt {
|
|
|
10888
10894
|
* @returns An array of Prosemirror plugins
|
|
10889
10895
|
*/
|
|
10890
10896
|
get plugins() {
|
|
10891
|
-
const { editor: e } = this, t =
|
|
10897
|
+
const { editor: e } = this, t = gt.sort([...this.extensions].reverse()), r = [], i = [], s = t.map((o) => {
|
|
10892
10898
|
const l = {
|
|
10893
10899
|
name: o.name,
|
|
10894
10900
|
options: o.options,
|
|
10895
10901
|
storage: o.storage,
|
|
10896
10902
|
editor: e,
|
|
10897
|
-
type:
|
|
10903
|
+
type: ir(o.name, this.schema)
|
|
10898
10904
|
}, a = [], c = x(o, "addKeyboardShortcuts", l);
|
|
10899
10905
|
let d = {};
|
|
10900
10906
|
if (o.type === "mark" && x(o, "exitable", l) && (d.ArrowRight = () => Me.handleExit({ editor: e, mark: o })), c) {
|
|
@@ -10938,7 +10944,7 @@ class mt {
|
|
|
10938
10944
|
* @returns An object with all node views where the key is the node name and the value is the node view function
|
|
10939
10945
|
*/
|
|
10940
10946
|
get nodeViews() {
|
|
10941
|
-
const { editor: e } = this, { nodeExtensions: t } =
|
|
10947
|
+
const { editor: e } = this, { nodeExtensions: t } = Fn(this.extensions);
|
|
10942
10948
|
return Object.fromEntries(t.filter((r) => !!x(r, "addNodeView")).map((r) => {
|
|
10943
10949
|
const i = this.attributes.filter((a) => a.type === r.name), s = {
|
|
10944
10950
|
name: r.name,
|
|
@@ -10950,7 +10956,7 @@ class mt {
|
|
|
10950
10956
|
if (!o)
|
|
10951
10957
|
return [];
|
|
10952
10958
|
const l = (a, c, d, u, f) => {
|
|
10953
|
-
const h =
|
|
10959
|
+
const h = Er(a, i);
|
|
10954
10960
|
return o()({
|
|
10955
10961
|
// pass-through
|
|
10956
10962
|
node: a,
|
|
@@ -10980,7 +10986,7 @@ class mt {
|
|
|
10980
10986
|
options: e.options,
|
|
10981
10987
|
storage: e.storage,
|
|
10982
10988
|
editor: this.editor,
|
|
10983
|
-
type:
|
|
10989
|
+
type: ir(e.name, this.schema)
|
|
10984
10990
|
};
|
|
10985
10991
|
e.type === "mark" && (!((t = v(x(e, "keepOnSplit", r))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
|
|
10986
10992
|
const i = x(e, "onBeforeCreate", r), s = x(e, "onCreate", r), o = x(e, "onUpdate", r), l = x(e, "onSelectionUpdate", r), a = x(e, "onTransaction", r), c = x(e, "onFocus", r), d = x(e, "onBlur", r), u = x(e, "onDestroy", r);
|
|
@@ -11009,7 +11015,7 @@ class _ {
|
|
|
11009
11015
|
configure(e = {}) {
|
|
11010
11016
|
const t = this.extend({
|
|
11011
11017
|
...this.config,
|
|
11012
|
-
addOptions: () =>
|
|
11018
|
+
addOptions: () => Vn(this.options, e)
|
|
11013
11019
|
});
|
|
11014
11020
|
return t.name = this.name, t.parent = this.parent, t;
|
|
11015
11021
|
}
|
|
@@ -11081,7 +11087,7 @@ const Jd = _.create({
|
|
|
11081
11087
|
const { doc: c, mapping: d } = e, u = c.resolve(d.map(a)), f = c.resolve(d.map(a + l.nodeSize)), h = u.blockRange(f);
|
|
11082
11088
|
if (!h)
|
|
11083
11089
|
return;
|
|
11084
|
-
const p =
|
|
11090
|
+
const p = Ct(h);
|
|
11085
11091
|
if (l.type.isTextblock) {
|
|
11086
11092
|
const { defaultType: m } = u.parent.contentMatchAt(u.index());
|
|
11087
11093
|
e.setNodeMarkup(h.start, m);
|
|
@@ -11123,12 +11129,12 @@ const Jd = _.create({
|
|
|
11123
11129
|
const { from: r, to: i } = n;
|
|
11124
11130
|
return t && e.delete(r, i), !0;
|
|
11125
11131
|
}, nu = () => ({ state: n, dispatch: e }) => Ur(n, e), ru = () => ({ commands: n }) => n.keyboardShortcut("Enter"), iu = () => ({ state: n, dispatch: e }) => gd(n, e);
|
|
11126
|
-
function
|
|
11132
|
+
function Mn(n, e, t = { strict: !0 }) {
|
|
11127
11133
|
const r = Object.keys(e);
|
|
11128
11134
|
return r.length ? r.every((i) => t.strict ? e[i] === n[i] : Qr(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
|
|
11129
11135
|
}
|
|
11130
11136
|
function Zo(n, e, t = {}) {
|
|
11131
|
-
return n.find((r) => r.type === e &&
|
|
11137
|
+
return n.find((r) => r.type === e && Mn(
|
|
11132
11138
|
// Only check equality for the attributes that are provided
|
|
11133
11139
|
Object.fromEntries(Object.keys(t).map((i) => [i, r.attrs[i]])),
|
|
11134
11140
|
t
|
|
@@ -11188,7 +11194,7 @@ function Ye(n = 0, e = 0, t = 0) {
|
|
|
11188
11194
|
function el(n, e = null) {
|
|
11189
11195
|
if (!e)
|
|
11190
11196
|
return null;
|
|
11191
|
-
const t =
|
|
11197
|
+
const t = E.atStart(n), r = E.atEnd(n);
|
|
11192
11198
|
if (e === "start" || e === !0)
|
|
11193
11199
|
return t;
|
|
11194
11200
|
if (e === "end")
|
|
@@ -11199,7 +11205,7 @@ function el(n, e = null) {
|
|
|
11199
11205
|
function cs() {
|
|
11200
11206
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
11201
11207
|
}
|
|
11202
|
-
function
|
|
11208
|
+
function wn() {
|
|
11203
11209
|
return [
|
|
11204
11210
|
"iPad Simulator",
|
|
11205
11211
|
"iPhone Simulator",
|
|
@@ -11218,8 +11224,8 @@ const au = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
|
|
|
11218
11224
|
...e
|
|
11219
11225
|
};
|
|
11220
11226
|
const o = () => {
|
|
11221
|
-
(
|
|
11222
|
-
t.isDestroyed || (r.focus(), lu() && !
|
|
11227
|
+
(wn() || cs()) && r.dom.focus(), requestAnimationFrame(() => {
|
|
11228
|
+
t.isDestroyed || (r.focus(), lu() && !wn() && !cs() && r.dom.focus({ preventScroll: !0 }));
|
|
11223
11229
|
});
|
|
11224
11230
|
};
|
|
11225
11231
|
if (r.hasFocus() && n === null || n === !1)
|
|
@@ -11236,11 +11242,11 @@ const au = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
|
|
|
11236
11242
|
}
|
|
11237
11243
|
return n;
|
|
11238
11244
|
};
|
|
11239
|
-
function
|
|
11245
|
+
function sn(n) {
|
|
11240
11246
|
const e = `<body>${n}</body>`, t = new window.DOMParser().parseFromString(e, "text/html").body;
|
|
11241
11247
|
return tl(t);
|
|
11242
11248
|
}
|
|
11243
|
-
function
|
|
11249
|
+
function Ht(n, e, t) {
|
|
11244
11250
|
if (n instanceof ze || n instanceof b)
|
|
11245
11251
|
return n;
|
|
11246
11252
|
t = {
|
|
@@ -11258,7 +11264,7 @@ function Vt(n, e, t) {
|
|
|
11258
11264
|
} catch (s) {
|
|
11259
11265
|
if (t.errorOnInvalidContent)
|
|
11260
11266
|
throw new Error("[tiptap error]: Invalid JSON content", { cause: s });
|
|
11261
|
-
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", n, "Error:", s),
|
|
11267
|
+
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", n, "Error:", s), Ht("", e, t);
|
|
11262
11268
|
}
|
|
11263
11269
|
if (i) {
|
|
11264
11270
|
if (t.errorOnInvalidContent) {
|
|
@@ -11281,13 +11287,13 @@ function Vt(n, e, t) {
|
|
|
11281
11287
|
}
|
|
11282
11288
|
})
|
|
11283
11289
|
});
|
|
11284
|
-
if (t.slice ? Fe.fromSchema(a).parseSlice(
|
|
11290
|
+
if (t.slice ? Fe.fromSchema(a).parseSlice(sn(n), t.parseOptions) : Fe.fromSchema(a).parse(sn(n), t.parseOptions), t.errorOnInvalidContent && o)
|
|
11285
11291
|
throw new Error("[tiptap error]: Invalid HTML content", { cause: new Error(`Invalid element found: ${l}`) });
|
|
11286
11292
|
}
|
|
11287
11293
|
const s = Fe.fromSchema(e);
|
|
11288
|
-
return t.slice ? s.parseSlice(
|
|
11294
|
+
return t.slice ? s.parseSlice(sn(n), t.parseOptions).content : s.parse(sn(n), t.parseOptions);
|
|
11289
11295
|
}
|
|
11290
|
-
return
|
|
11296
|
+
return Ht("", e, t);
|
|
11291
11297
|
}
|
|
11292
11298
|
function uu(n, e, t) {
|
|
11293
11299
|
const r = n.steps.length - 1;
|
|
@@ -11300,7 +11306,7 @@ function uu(n, e, t) {
|
|
|
11300
11306
|
let o = 0;
|
|
11301
11307
|
s.forEach((l, a, c, d) => {
|
|
11302
11308
|
o === 0 && (o = d);
|
|
11303
|
-
}), n.setSelection(
|
|
11309
|
+
}), n.setSelection(E.near(n.doc.resolve(o), t));
|
|
11304
11310
|
}
|
|
11305
11311
|
const fu = (n) => !("type" in n), hu = (n, e, t) => ({ tr: r, dispatch: i, editor: s }) => {
|
|
11306
11312
|
var o;
|
|
@@ -11327,7 +11333,7 @@ const fu = (n) => !("type" in n), hu = (n, e, t) => ({ tr: r, dispatch: i, edito
|
|
|
11327
11333
|
};
|
|
11328
11334
|
if (!t.errorOnInvalidContent && !s.options.enableContentCheck && s.options.emitContentError)
|
|
11329
11335
|
try {
|
|
11330
|
-
|
|
11336
|
+
Ht(e, s.schema, {
|
|
11331
11337
|
parseOptions: c,
|
|
11332
11338
|
errorOnInvalidContent: !0
|
|
11333
11339
|
});
|
|
@@ -11335,7 +11341,7 @@ const fu = (n) => !("type" in n), hu = (n, e, t) => ({ tr: r, dispatch: i, edito
|
|
|
11335
11341
|
a(g);
|
|
11336
11342
|
}
|
|
11337
11343
|
try {
|
|
11338
|
-
l =
|
|
11344
|
+
l = Ht(e, s.schema, {
|
|
11339
11345
|
parseOptions: c,
|
|
11340
11346
|
errorOnInvalidContent: (o = t.errorOnInvalidContent) !== null && o !== void 0 ? o : s.options.enableContentCheck
|
|
11341
11347
|
});
|
|
@@ -11367,14 +11373,14 @@ const fu = (n) => !("type" in n), hu = (n, e, t) => ({ tr: r, dispatch: i, edito
|
|
|
11367
11373
|
return !0;
|
|
11368
11374
|
}, pu = () => ({ state: n, dispatch: e }) => hd(n, e), mu = () => ({ state: n, dispatch: e }) => pd(n, e), gu = () => ({ state: n, dispatch: e }) => zo(n, e), yu = () => ({ state: n, dispatch: e }) => Ho(n, e), bu = () => ({ state: n, dispatch: e, tr: t }) => {
|
|
11369
11375
|
try {
|
|
11370
|
-
const r =
|
|
11376
|
+
const r = An(n.doc, n.selection.$from.pos, -1);
|
|
11371
11377
|
return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
|
|
11372
11378
|
} catch {
|
|
11373
11379
|
return !1;
|
|
11374
11380
|
}
|
|
11375
11381
|
}, ku = () => ({ state: n, dispatch: e, tr: t }) => {
|
|
11376
11382
|
try {
|
|
11377
|
-
const r =
|
|
11383
|
+
const r = An(n.doc, n.selection.$from.pos, 1);
|
|
11378
11384
|
return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
|
|
11379
11385
|
} catch {
|
|
11380
11386
|
return !1;
|
|
@@ -11399,7 +11405,7 @@ function Mu(n) {
|
|
|
11399
11405
|
else if (/^s(hift)?$/i.test(a))
|
|
11400
11406
|
s = !0;
|
|
11401
11407
|
else if (/^mod$/i.test(a))
|
|
11402
|
-
|
|
11408
|
+
wn() || nl() ? o = !0 : i = !0;
|
|
11403
11409
|
else
|
|
11404
11410
|
throw new Error(`Unrecognized modifier name: ${a}`);
|
|
11405
11411
|
}
|
|
@@ -11422,7 +11428,7 @@ const wu = (n) => ({ editor: e, view: t, tr: r, dispatch: i }) => {
|
|
|
11422
11428
|
d && i && r.maybeStep(d);
|
|
11423
11429
|
}), !0;
|
|
11424
11430
|
};
|
|
11425
|
-
function
|
|
11431
|
+
function Wt(n, e, t = {}) {
|
|
11426
11432
|
const { from: r, to: i, empty: s } = n.selection, o = e ? V(e, n.schema) : null, l = [];
|
|
11427
11433
|
n.doc.nodesBetween(r, i, (u, f) => {
|
|
11428
11434
|
if (u.isText)
|
|
@@ -11434,17 +11440,17 @@ function Ht(n, e, t = {}) {
|
|
|
11434
11440
|
to: p
|
|
11435
11441
|
});
|
|
11436
11442
|
});
|
|
11437
|
-
const a = i - r, c = l.filter((u) => o ? o.name === u.node.type.name : !0).filter((u) =>
|
|
11443
|
+
const a = i - r, c = l.filter((u) => o ? o.name === u.node.type.name : !0).filter((u) => Mn(u.node.attrs, t, { strict: !1 }));
|
|
11438
11444
|
return s ? !!c.length : c.reduce((u, f) => u + f.to - f.from, 0) >= a;
|
|
11439
11445
|
}
|
|
11440
11446
|
const Cu = (n, e = {}) => ({ state: t, dispatch: r }) => {
|
|
11441
11447
|
const i = V(n, t.schema);
|
|
11442
|
-
return
|
|
11448
|
+
return Wt(t, i, e) ? md(t, r) : !1;
|
|
11443
11449
|
}, Tu = () => ({ state: n, dispatch: e }) => Ko(n, e), Ou = (n) => ({ state: e, dispatch: t }) => {
|
|
11444
11450
|
const r = V(n, e.schema);
|
|
11445
11451
|
return Ed(r)(e, t);
|
|
11446
11452
|
}, Eu = () => ({ state: n, dispatch: e }) => qo(n, e);
|
|
11447
|
-
function
|
|
11453
|
+
function Hn(n, e) {
|
|
11448
11454
|
return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
|
|
11449
11455
|
}
|
|
11450
11456
|
function ds(n, e) {
|
|
@@ -11453,7 +11459,7 @@ function ds(n, e) {
|
|
|
11453
11459
|
}
|
|
11454
11460
|
const vu = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
|
|
11455
11461
|
let s = null, o = null;
|
|
11456
|
-
const l =
|
|
11462
|
+
const l = Hn(typeof n == "string" ? n : n.name, r.schema);
|
|
11457
11463
|
return l ? (l === "node" && (s = V(n, r.schema)), l === "mark" && (o = Ke(n, r.schema)), i && t.selection.ranges.forEach((a) => {
|
|
11458
11464
|
r.doc.nodesBetween(a.$from.pos, a.$to.pos, (c, d) => {
|
|
11459
11465
|
s && s === c.type && t.setNodeMarkup(d, void 0, ds(c.attrs, e)), o && c.marks.length && c.marks.forEach((u) => {
|
|
@@ -11468,8 +11474,8 @@ const vu = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11468
11474
|
}
|
|
11469
11475
|
return !0;
|
|
11470
11476
|
}, Du = () => ({ state: n, dispatch: e }) => $o(n, e), Iu = () => ({ state: n, dispatch: e }) => Wo(n, e), Ru = () => ({ state: n, dispatch: e }) => kd(n, e), Pu = () => ({ state: n, dispatch: e }) => Md(n, e), Bu = () => ({ state: n, dispatch: e }) => Sd(n, e);
|
|
11471
|
-
function
|
|
11472
|
-
return
|
|
11477
|
+
function vr(n, e, t = {}, r = {}) {
|
|
11478
|
+
return Ht(n, e, {
|
|
11473
11479
|
slice: !1,
|
|
11474
11480
|
parseOptions: t,
|
|
11475
11481
|
errorOnInvalidContent: r.errorOnInvalidContent
|
|
@@ -11479,7 +11485,7 @@ const Lu = (n, e = !1, t = {}, r = {}) => ({ editor: i, tr: s, dispatch: o, comm
|
|
|
11479
11485
|
var a, c;
|
|
11480
11486
|
const { doc: d } = s;
|
|
11481
11487
|
if (t.preserveWhitespace !== "full") {
|
|
11482
|
-
const u =
|
|
11488
|
+
const u = vr(n, i.schema, t, {
|
|
11483
11489
|
errorOnInvalidContent: (a = r.errorOnInvalidContent) !== null && a !== void 0 ? a : i.options.enableContentCheck
|
|
11484
11490
|
});
|
|
11485
11491
|
return o && s.replaceWith(0, d.content.size, u).setMeta("preventUpdate", !e), !0;
|
|
@@ -11536,7 +11542,7 @@ function Vu(n, e) {
|
|
|
11536
11542
|
return o ? { ...o.attrs } : {};
|
|
11537
11543
|
}
|
|
11538
11544
|
function Hu(n, e) {
|
|
11539
|
-
const t =
|
|
11545
|
+
const t = Hn(typeof e == "string" ? e : e.name, n.schema);
|
|
11540
11546
|
return t === "node" ? Vu(n, e) : t === "mark" ? rl(n, e) : {};
|
|
11541
11547
|
}
|
|
11542
11548
|
function il(n, e, t) {
|
|
@@ -11555,16 +11561,16 @@ function il(n, e, t) {
|
|
|
11555
11561
|
})));
|
|
11556
11562
|
}), r;
|
|
11557
11563
|
}
|
|
11558
|
-
function
|
|
11564
|
+
function cn(n, e, t) {
|
|
11559
11565
|
return Object.fromEntries(Object.entries(t).filter(([r]) => {
|
|
11560
11566
|
const i = n.find((s) => s.type === e && s.name === r);
|
|
11561
11567
|
return i ? i.attribute.keepOnSplit : !1;
|
|
11562
11568
|
}));
|
|
11563
11569
|
}
|
|
11564
|
-
function
|
|
11570
|
+
function Nr(n, e, t = {}) {
|
|
11565
11571
|
const { empty: r, ranges: i } = n.selection, s = e ? Ke(e, n.schema) : null;
|
|
11566
11572
|
if (r)
|
|
11567
|
-
return !!(n.storedMarks || n.selection.$from.marks()).filter((u) => s ? s.name === u.type.name : !0).find((u) =>
|
|
11573
|
+
return !!(n.storedMarks || n.selection.$from.marks()).filter((u) => s ? s.name === u.type.name : !0).find((u) => Mn(u.attrs, t, { strict: !1 }));
|
|
11568
11574
|
let o = 0;
|
|
11569
11575
|
const l = [];
|
|
11570
11576
|
if (i.forEach(({ $from: u, $to: f }) => {
|
|
@@ -11581,17 +11587,17 @@ function vr(n, e, t = {}) {
|
|
|
11581
11587
|
});
|
|
11582
11588
|
}), o === 0)
|
|
11583
11589
|
return !1;
|
|
11584
|
-
const a = l.filter((u) => s ? s.name === u.mark.type.name : !0).filter((u) =>
|
|
11590
|
+
const a = l.filter((u) => s ? s.name === u.mark.type.name : !0).filter((u) => Mn(u.mark.attrs, t, { strict: !1 })).reduce((u, f) => u + f.to - f.from, 0), c = l.filter((u) => s ? u.mark.type !== s && u.mark.type.excludes(s) : !0).reduce((u, f) => u + f.to - f.from, 0);
|
|
11585
11591
|
return (a > 0 ? a + c : a) >= o;
|
|
11586
11592
|
}
|
|
11587
11593
|
function Wu(n, e, t = {}) {
|
|
11588
11594
|
if (!e)
|
|
11589
|
-
return
|
|
11590
|
-
const r =
|
|
11591
|
-
return r === "node" ?
|
|
11595
|
+
return Wt(n, null, t) || Nr(n, null, t);
|
|
11596
|
+
const r = Hn(e, n.schema);
|
|
11597
|
+
return r === "node" ? Wt(n, e, t) : r === "mark" ? Nr(n, e, t) : !1;
|
|
11592
11598
|
}
|
|
11593
11599
|
function us(n, e) {
|
|
11594
|
-
const { nodeExtensions: t } =
|
|
11600
|
+
const { nodeExtensions: t } = Fn(e), r = t.find((o) => o.name === n);
|
|
11595
11601
|
if (!r)
|
|
11596
11602
|
return !1;
|
|
11597
11603
|
const i = {
|
|
@@ -11699,7 +11705,7 @@ function fs(n, e) {
|
|
|
11699
11705
|
}
|
|
11700
11706
|
}
|
|
11701
11707
|
const Xu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
|
|
11702
|
-
const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, d =
|
|
11708
|
+
const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, d = cn(c, l.node().type.name, l.node().attrs);
|
|
11703
11709
|
if (s instanceof S && s.node.isBlock)
|
|
11704
11710
|
return !l.parentOffset || !ve(o, l.pos) ? !1 : (r && (n && fs(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
|
|
11705
11711
|
if (!l.parent.isBlock)
|
|
@@ -11742,7 +11748,7 @@ const Xu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11742
11748
|
for (let N = a.depth - T; N >= a.depth - 3; N -= 1)
|
|
11743
11749
|
y = b.from(a.node(N).copy(y));
|
|
11744
11750
|
const w = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3, I = {
|
|
11745
|
-
...
|
|
11751
|
+
...cn(f, a.node().type.name, a.node().attrs),
|
|
11746
11752
|
...e
|
|
11747
11753
|
}, D = ((o = l.contentMatch.defaultType) === null || o === void 0 ? void 0 : o.createAndFill(I)) || void 0;
|
|
11748
11754
|
y = y.append(b.from(l.createAndFill(null, D) || void 0));
|
|
@@ -11758,10 +11764,10 @@ const Xu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11758
11764
|
return !0;
|
|
11759
11765
|
}
|
|
11760
11766
|
const h = c.pos === a.end() ? u.contentMatchAt(0).defaultType : null, p = {
|
|
11761
|
-
...
|
|
11767
|
+
...cn(f, u.type.name, u.attrs),
|
|
11762
11768
|
...e
|
|
11763
11769
|
}, m = {
|
|
11764
|
-
...
|
|
11770
|
+
...cn(f, a.node().type.name, a.node().attrs),
|
|
11765
11771
|
...e
|
|
11766
11772
|
};
|
|
11767
11773
|
t.delete(a.pos, c.pos);
|
|
@@ -11779,7 +11785,7 @@ const Xu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11779
11785
|
t.ensureMarks(D);
|
|
11780
11786
|
}
|
|
11781
11787
|
return !0;
|
|
11782
|
-
},
|
|
11788
|
+
}, sr = (n, e) => {
|
|
11783
11789
|
const t = ti((o) => o.type === e)(n.selection);
|
|
11784
11790
|
if (!t)
|
|
11785
11791
|
return !0;
|
|
@@ -11788,7 +11794,7 @@ const Xu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11788
11794
|
return !0;
|
|
11789
11795
|
const i = n.doc.nodeAt(r);
|
|
11790
11796
|
return t.node.type === (i == null ? void 0 : i.type) && qe(n.doc, t.pos) && n.join(t.pos), !0;
|
|
11791
|
-
},
|
|
11797
|
+
}, or = (n, e) => {
|
|
11792
11798
|
const t = ti((o) => o.type === e)(n.selection);
|
|
11793
11799
|
if (!t)
|
|
11794
11800
|
return !0;
|
|
@@ -11806,22 +11812,22 @@ const Xu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11806
11812
|
if (D.node.type === h)
|
|
11807
11813
|
return c.liftListItem(p);
|
|
11808
11814
|
if (us(D.node.type.name, u) && h.validContent(D.node.content) && l)
|
|
11809
|
-
return a().command(() => (s.setNodeMarkup(D.pos, h), !0)).command(() =>
|
|
11815
|
+
return a().command(() => (s.setNodeMarkup(D.pos, h), !0)).command(() => sr(s, h)).command(() => or(s, h)).run();
|
|
11810
11816
|
}
|
|
11811
|
-
return !t || !I || !l ? a().command(() => d().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() =>
|
|
11817
|
+
return !t || !I || !l ? a().command(() => d().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => sr(s, h)).command(() => or(s, h)).run() : a().command(() => {
|
|
11812
11818
|
const L = d().wrapInList(h, r), C = I.filter((N) => f.includes(N.type.name));
|
|
11813
11819
|
return s.ensureMarks(C), L ? !0 : c.clearNodes();
|
|
11814
|
-
}).wrapInList(h, r).command(() =>
|
|
11820
|
+
}).wrapInList(h, r).command(() => sr(s, h)).command(() => or(s, h)).run();
|
|
11815
11821
|
}, ef = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
|
|
11816
11822
|
const { extendEmptyMarkRange: s = !1 } = t, o = Ke(n, r.schema);
|
|
11817
|
-
return
|
|
11823
|
+
return Nr(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
|
|
11818
11824
|
}, tf = (n, e, t = {}) => ({ state: r, commands: i }) => {
|
|
11819
|
-
const s = V(n, r.schema), o = V(e, r.schema), l =
|
|
11825
|
+
const s = V(n, r.schema), o = V(e, r.schema), l = Wt(r, s, t);
|
|
11820
11826
|
let a;
|
|
11821
11827
|
return r.selection.$anchor.sameParent(r.selection.$head) && (a = r.selection.$anchor.parent.attrs), l ? i.setNode(o, a) : i.setNode(s, { ...a, ...t });
|
|
11822
11828
|
}, nf = (n, e = {}) => ({ state: t, commands: r }) => {
|
|
11823
11829
|
const i = V(n, t.schema);
|
|
11824
|
-
return
|
|
11830
|
+
return Wt(t, i, e) ? r.lift(i) : r.wrapIn(i, e);
|
|
11825
11831
|
}, rf = () => ({ state: n, dispatch: e }) => {
|
|
11826
11832
|
const t = n.plugins;
|
|
11827
11833
|
for (let r = 0; r < t.length; r += 1) {
|
|
@@ -11863,7 +11869,7 @@ const Xu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11863
11869
|
return t.removeStoredMark(a), !0;
|
|
11864
11870
|
}, lf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
11865
11871
|
let s = null, o = null;
|
|
11866
|
-
const l =
|
|
11872
|
+
const l = Hn(typeof n == "string" ? n : n.name, r.schema);
|
|
11867
11873
|
return l ? (l === "node" && (s = V(n, r.schema)), l === "mark" && (o = Ke(n, r.schema)), i && t.selection.ranges.forEach((a) => {
|
|
11868
11874
|
const c = a.$from.pos, d = a.$to.pos;
|
|
11869
11875
|
let u, f, h, p;
|
|
@@ -12029,7 +12035,7 @@ const uf = _.create({
|
|
|
12029
12035
|
() => o.undoInputRule(),
|
|
12030
12036
|
// maybe convert first text block node to default node
|
|
12031
12037
|
() => o.command(({ tr: l }) => {
|
|
12032
|
-
const { selection: a, doc: c } = l, { empty: d, $anchor: u } = a, { pos: f, parent: h } = u, p = u.parent.isTextblock && f > 0 ? l.doc.resolve(f - 1) : u, m = p.parent.type.spec.isolating, g = u.pos - u.parentOffset, y = m && p.parent.childCount === 1 ? g === u.pos :
|
|
12038
|
+
const { selection: a, doc: c } = l, { empty: d, $anchor: u } = a, { pos: f, parent: h } = u, p = u.parent.isTextblock && f > 0 ? l.doc.resolve(f - 1) : u, m = p.parent.type.spec.isolating, g = u.pos - u.parentOffset, y = m && p.parent.childCount === 1 ? g === u.pos : E.atStart(c).from === f;
|
|
12033
12039
|
return !d || !h.type.isTextblock || h.textContent.length || !y || y && u.parent.type.name === "paragraph" ? !1 : o.clearNodes();
|
|
12034
12040
|
}),
|
|
12035
12041
|
() => o.deleteSelection(),
|
|
@@ -12067,7 +12073,7 @@ const uf = _.create({
|
|
|
12067
12073
|
"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
|
|
12068
12074
|
"Ctrl-e": () => this.editor.commands.selectTextblockEnd()
|
|
12069
12075
|
};
|
|
12070
|
-
return
|
|
12076
|
+
return wn() || nl() ? s : i;
|
|
12071
12077
|
},
|
|
12072
12078
|
addProseMirrorPlugins() {
|
|
12073
12079
|
return [
|
|
@@ -12084,13 +12090,13 @@ const uf = _.create({
|
|
|
12084
12090
|
const r = n.some((m) => m.docChanged) && !e.doc.eq(t.doc), i = n.some((m) => m.getMeta("preventClearDocument"));
|
|
12085
12091
|
if (!r || i)
|
|
12086
12092
|
return;
|
|
12087
|
-
const { empty: s, from: o, to: l } = e.selection, a =
|
|
12093
|
+
const { empty: s, from: o, to: l } = e.selection, a = E.atStart(e.doc).from, c = E.atEnd(e.doc).to;
|
|
12088
12094
|
if (s || !(o === a && l === c) || !ni(t.doc))
|
|
12089
12095
|
return;
|
|
12090
|
-
const f = t.tr, h =
|
|
12096
|
+
const f = t.tr, h = Ln({
|
|
12091
12097
|
state: t,
|
|
12092
12098
|
transaction: f
|
|
12093
|
-
}), { commands: p } = new
|
|
12099
|
+
}), { commands: p } = new zn({
|
|
12094
12100
|
editor: this.editor,
|
|
12095
12101
|
state: h
|
|
12096
12102
|
});
|
|
@@ -12482,13 +12488,13 @@ class Sf extends Dd {
|
|
|
12482
12488
|
ff,
|
|
12483
12489
|
yf
|
|
12484
12490
|
].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s == null ? void 0 : s.type));
|
|
12485
|
-
this.extensionManager = new
|
|
12491
|
+
this.extensionManager = new gt(i, this);
|
|
12486
12492
|
}
|
|
12487
12493
|
/**
|
|
12488
12494
|
* Creates an command manager.
|
|
12489
12495
|
*/
|
|
12490
12496
|
createCommandManager() {
|
|
12491
|
-
this.commandManager = new
|
|
12497
|
+
this.commandManager = new zn({
|
|
12492
12498
|
editor: this
|
|
12493
12499
|
});
|
|
12494
12500
|
}
|
|
@@ -12505,7 +12511,7 @@ class Sf extends Dd {
|
|
|
12505
12511
|
var e;
|
|
12506
12512
|
let t;
|
|
12507
12513
|
try {
|
|
12508
|
-
t =
|
|
12514
|
+
t = vr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
|
|
12509
12515
|
} catch (o) {
|
|
12510
12516
|
if (!(o instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(o.message))
|
|
12511
12517
|
throw o;
|
|
@@ -12515,7 +12521,7 @@ class Sf extends Dd {
|
|
|
12515
12521
|
disableCollaboration: () => {
|
|
12516
12522
|
this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((l) => l.name !== "collaboration"), this.createExtensionManager();
|
|
12517
12523
|
}
|
|
12518
|
-
}), t =
|
|
12524
|
+
}), t = vr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
|
|
12519
12525
|
}
|
|
12520
12526
|
const r = el(t, this.options.autofocus);
|
|
12521
12527
|
this.view = new Po(this.options.element, {
|
|
@@ -12526,7 +12532,7 @@ class Sf extends Dd {
|
|
|
12526
12532
|
...(e = this.options.editorProps) === null || e === void 0 ? void 0 : e.attributes
|
|
12527
12533
|
},
|
|
12528
12534
|
dispatchTransaction: this.dispatchTransaction.bind(this),
|
|
12529
|
-
state:
|
|
12535
|
+
state: mt.create({
|
|
12530
12536
|
doc: t,
|
|
12531
12537
|
selection: r || void 0
|
|
12532
12538
|
})
|
|
@@ -12686,8 +12692,8 @@ class Sf extends Dd {
|
|
|
12686
12692
|
return this.$pos(0);
|
|
12687
12693
|
}
|
|
12688
12694
|
}
|
|
12689
|
-
function
|
|
12690
|
-
return new
|
|
12695
|
+
function at(n) {
|
|
12696
|
+
return new $n({
|
|
12691
12697
|
find: n.find,
|
|
12692
12698
|
handler: ({ state: e, range: t, match: r }) => {
|
|
12693
12699
|
const i = v(n.getAttributes, void 0, r);
|
|
@@ -12706,7 +12712,7 @@ function lt(n) {
|
|
|
12706
12712
|
});
|
|
12707
12713
|
}
|
|
12708
12714
|
function sl(n) {
|
|
12709
|
-
return new
|
|
12715
|
+
return new $n({
|
|
12710
12716
|
find: n.find,
|
|
12711
12717
|
handler: ({ state: e, range: t, match: r }) => {
|
|
12712
12718
|
const i = v(n.getAttributes, void 0, r) || {}, { tr: s } = e, o = t.from;
|
|
@@ -12726,8 +12732,8 @@ function sl(n) {
|
|
|
12726
12732
|
}
|
|
12727
12733
|
});
|
|
12728
12734
|
}
|
|
12729
|
-
function
|
|
12730
|
-
return new
|
|
12735
|
+
function Ar(n) {
|
|
12736
|
+
return new $n({
|
|
12731
12737
|
find: n.find,
|
|
12732
12738
|
handler: ({ state: e, range: t, match: r }) => {
|
|
12733
12739
|
const i = e.doc.resolve(t.from), s = v(n.getAttributes, void 0, r) || {};
|
|
@@ -12737,8 +12743,8 @@ function Nr(n) {
|
|
|
12737
12743
|
}
|
|
12738
12744
|
});
|
|
12739
12745
|
}
|
|
12740
|
-
function
|
|
12741
|
-
return new
|
|
12746
|
+
function qt(n) {
|
|
12747
|
+
return new $n({
|
|
12742
12748
|
find: n.find,
|
|
12743
12749
|
handler: ({ state: e, range: t, match: r, chain: i }) => {
|
|
12744
12750
|
const s = v(n.getAttributes, void 0, r) || {}, o = e.tr.delete(t.from, t.to), a = o.doc.resolve(t.from).blockRange(), c = a && Lr(a, n.type, s);
|
|
@@ -12781,7 +12787,7 @@ class ne {
|
|
|
12781
12787
|
configure(e = {}) {
|
|
12782
12788
|
const t = this.extend({
|
|
12783
12789
|
...this.config,
|
|
12784
|
-
addOptions: () =>
|
|
12790
|
+
addOptions: () => Vn(this.options, e)
|
|
12785
12791
|
});
|
|
12786
12792
|
return t.name = this.name, t.parent = this.parent, t;
|
|
12787
12793
|
}
|
|
@@ -12795,7 +12801,7 @@ class ne {
|
|
|
12795
12801
|
})), t;
|
|
12796
12802
|
}
|
|
12797
12803
|
}
|
|
12798
|
-
function
|
|
12804
|
+
function ct(n) {
|
|
12799
12805
|
return new Vd({
|
|
12800
12806
|
find: n.find,
|
|
12801
12807
|
handler: ({ state: e, range: t, match: r, pasteEvent: i }) => {
|
|
@@ -12860,7 +12866,7 @@ const wf = /^\s*>\s$/, Cf = ne.create({
|
|
|
12860
12866
|
},
|
|
12861
12867
|
addInputRules() {
|
|
12862
12868
|
return [
|
|
12863
|
-
|
|
12869
|
+
qt({
|
|
12864
12870
|
find: wf,
|
|
12865
12871
|
type: this.type
|
|
12866
12872
|
})
|
|
@@ -12910,11 +12916,11 @@ const wf = /^\s*>\s$/, Cf = ne.create({
|
|
|
12910
12916
|
},
|
|
12911
12917
|
addInputRules() {
|
|
12912
12918
|
return [
|
|
12913
|
-
|
|
12919
|
+
at({
|
|
12914
12920
|
find: Tf,
|
|
12915
12921
|
type: this.type
|
|
12916
12922
|
}),
|
|
12917
|
-
|
|
12923
|
+
at({
|
|
12918
12924
|
find: Ef,
|
|
12919
12925
|
type: this.type
|
|
12920
12926
|
})
|
|
@@ -12922,11 +12928,11 @@ const wf = /^\s*>\s$/, Cf = ne.create({
|
|
|
12922
12928
|
},
|
|
12923
12929
|
addPasteRules() {
|
|
12924
12930
|
return [
|
|
12925
|
-
|
|
12931
|
+
ct({
|
|
12926
12932
|
find: Of,
|
|
12927
12933
|
type: this.type
|
|
12928
12934
|
}),
|
|
12929
|
-
|
|
12935
|
+
ct({
|
|
12930
12936
|
find: vf,
|
|
12931
12937
|
type: this.type
|
|
12932
12938
|
})
|
|
@@ -12965,11 +12971,11 @@ const wf = /^\s*>\s$/, Cf = ne.create({
|
|
|
12965
12971
|
};
|
|
12966
12972
|
},
|
|
12967
12973
|
addInputRules() {
|
|
12968
|
-
let n =
|
|
12974
|
+
let n = qt({
|
|
12969
12975
|
find: ps,
|
|
12970
12976
|
type: this.type
|
|
12971
12977
|
});
|
|
12972
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (n =
|
|
12978
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (n = qt({
|
|
12973
12979
|
find: ps,
|
|
12974
12980
|
type: this.type,
|
|
12975
12981
|
keepMarks: this.options.keepMarks,
|
|
@@ -13012,7 +13018,7 @@ const wf = /^\s*>\s$/, Cf = ne.create({
|
|
|
13012
13018
|
},
|
|
13013
13019
|
addInputRules() {
|
|
13014
13020
|
return [
|
|
13015
|
-
|
|
13021
|
+
at({
|
|
13016
13022
|
find: If,
|
|
13017
13023
|
type: this.type
|
|
13018
13024
|
})
|
|
@@ -13020,7 +13026,7 @@ const wf = /^\s*>\s$/, Cf = ne.create({
|
|
|
13020
13026
|
},
|
|
13021
13027
|
addPasteRules() {
|
|
13022
13028
|
return [
|
|
13023
|
-
|
|
13029
|
+
ct({
|
|
13024
13030
|
find: Rf,
|
|
13025
13031
|
type: this.type
|
|
13026
13032
|
})
|
|
@@ -13110,20 +13116,20 @@ const wf = /^\s*>\s$/, Cf = ne.create({
|
|
|
13110
13116
|
if (!s || i.parent.type !== this.type || !(i.parentOffset === i.parent.nodeSize - 2))
|
|
13111
13117
|
return !1;
|
|
13112
13118
|
const l = i.after();
|
|
13113
|
-
return l === void 0 ? !1 : r.nodeAt(l) ? n.commands.command(({ tr: c }) => (c.setSelection(
|
|
13119
|
+
return l === void 0 ? !1 : r.nodeAt(l) ? n.commands.command(({ tr: c }) => (c.setSelection(E.near(r.resolve(l))), !0)) : n.commands.exitCode();
|
|
13114
13120
|
}
|
|
13115
13121
|
};
|
|
13116
13122
|
},
|
|
13117
13123
|
addInputRules() {
|
|
13118
13124
|
return [
|
|
13119
|
-
|
|
13125
|
+
Ar({
|
|
13120
13126
|
find: Bf,
|
|
13121
13127
|
type: this.type,
|
|
13122
13128
|
getAttributes: (n) => ({
|
|
13123
13129
|
language: n[1]
|
|
13124
13130
|
})
|
|
13125
13131
|
}),
|
|
13126
|
-
|
|
13132
|
+
Ar({
|
|
13127
13133
|
find: Lf,
|
|
13128
13134
|
type: this.type,
|
|
13129
13135
|
getAttributes: (n) => ({
|
|
@@ -13254,7 +13260,7 @@ const Hf = _.create({
|
|
|
13254
13260
|
];
|
|
13255
13261
|
}
|
|
13256
13262
|
});
|
|
13257
|
-
class R extends
|
|
13263
|
+
class R extends E {
|
|
13258
13264
|
/**
|
|
13259
13265
|
Create a gap cursor.
|
|
13260
13266
|
*/
|
|
@@ -13263,7 +13269,7 @@ class R extends O {
|
|
|
13263
13269
|
}
|
|
13264
13270
|
map(e, t) {
|
|
13265
13271
|
let r = e.resolve(t.map(this.head));
|
|
13266
|
-
return R.valid(r) ? new R(r) :
|
|
13272
|
+
return R.valid(r) ? new R(r) : E.near(r);
|
|
13267
13273
|
}
|
|
13268
13274
|
content() {
|
|
13269
13275
|
return k.empty;
|
|
@@ -13341,7 +13347,7 @@ class R extends O {
|
|
|
13341
13347
|
}
|
|
13342
13348
|
R.prototype.visible = !1;
|
|
13343
13349
|
R.findFrom = R.findGapCursorFrom;
|
|
13344
|
-
|
|
13350
|
+
E.jsonID("gapcursor", R);
|
|
13345
13351
|
class ri {
|
|
13346
13352
|
constructor(e) {
|
|
13347
13353
|
this.pos = e;
|
|
@@ -13351,7 +13357,7 @@ class ri {
|
|
|
13351
13357
|
}
|
|
13352
13358
|
resolve(e) {
|
|
13353
13359
|
let t = e.resolve(this.pos);
|
|
13354
|
-
return R.valid(t) ? new R(t) :
|
|
13360
|
+
return R.valid(t) ? new R(t) : E.near(t);
|
|
13355
13361
|
}
|
|
13356
13362
|
}
|
|
13357
13363
|
function ol(n) {
|
|
@@ -13405,12 +13411,12 @@ function jf() {
|
|
|
13405
13411
|
});
|
|
13406
13412
|
}
|
|
13407
13413
|
const Kf = Bo({
|
|
13408
|
-
ArrowLeft:
|
|
13409
|
-
ArrowRight:
|
|
13410
|
-
ArrowUp:
|
|
13411
|
-
ArrowDown:
|
|
13414
|
+
ArrowLeft: on("horiz", -1),
|
|
13415
|
+
ArrowRight: on("horiz", 1),
|
|
13416
|
+
ArrowUp: on("vert", -1),
|
|
13417
|
+
ArrowDown: on("vert", 1)
|
|
13412
13418
|
});
|
|
13413
|
-
function
|
|
13419
|
+
function on(n, e) {
|
|
13414
13420
|
const t = n == "vert" ? e > 0 ? "down" : "up" : e > 0 ? "right" : "left";
|
|
13415
13421
|
return function(r, i, s) {
|
|
13416
13422
|
let o = r.selection, l = e > 0 ? o.$to : o.$from, a = o.empty;
|
|
@@ -13559,7 +13565,7 @@ const Gf = _.create({
|
|
|
13559
13565
|
}), {});
|
|
13560
13566
|
},
|
|
13561
13567
|
addInputRules() {
|
|
13562
|
-
return this.options.levels.map((n) =>
|
|
13568
|
+
return this.options.levels.map((n) => Ar({
|
|
13563
13569
|
find: new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),
|
|
13564
13570
|
type: this.type,
|
|
13565
13571
|
getAttributes: {
|
|
@@ -13568,10 +13574,10 @@ const Gf = _.create({
|
|
|
13568
13574
|
}));
|
|
13569
13575
|
}
|
|
13570
13576
|
});
|
|
13571
|
-
var
|
|
13577
|
+
var Cn = 200, $ = function() {
|
|
13572
13578
|
};
|
|
13573
13579
|
$.prototype.append = function(e) {
|
|
13574
|
-
return e.length ? (e = $.from(e), !this.length && e || e.length <
|
|
13580
|
+
return e.length ? (e = $.from(e), !this.length && e || e.length < Cn && this.leafAppend(e) || this.length < Cn && e.leafPrepend(this) || this.appendInner(e)) : this;
|
|
13575
13581
|
};
|
|
13576
13582
|
$.prototype.prepend = function(e) {
|
|
13577
13583
|
return e.length ? $.from(e).append(this) : this;
|
|
@@ -13620,10 +13626,10 @@ var ll = /* @__PURE__ */ function(n) {
|
|
|
13620
13626
|
if (i(this.values[a], l + a) === !1)
|
|
13621
13627
|
return !1;
|
|
13622
13628
|
}, e.prototype.leafAppend = function(i) {
|
|
13623
|
-
if (this.length + i.length <=
|
|
13629
|
+
if (this.length + i.length <= Cn)
|
|
13624
13630
|
return new e(this.values.concat(i.flatten()));
|
|
13625
13631
|
}, e.prototype.leafPrepend = function(i) {
|
|
13626
|
-
if (this.length + i.length <=
|
|
13632
|
+
if (this.length + i.length <= Cn)
|
|
13627
13633
|
return new e(i.flatten().concat(this.values));
|
|
13628
13634
|
}, t.length.get = function() {
|
|
13629
13635
|
return this.values.length;
|
|
@@ -13710,7 +13716,7 @@ class ge {
|
|
|
13710
13716
|
return c > th && (l = eh(l, c), o -= c), new ge(l.append(s), o);
|
|
13711
13717
|
}
|
|
13712
13718
|
remapping(e, t) {
|
|
13713
|
-
let r = new
|
|
13719
|
+
let r = new Lt();
|
|
13714
13720
|
return this.items.forEach((i, s) => {
|
|
13715
13721
|
let o = i.mirrorOffset != null && s - i.mirrorOffset >= e ? r.maps.length - i.mirrorOffset : void 0;
|
|
13716
13722
|
r.appendMap(i.map, o);
|
|
@@ -13805,19 +13811,19 @@ class Ie {
|
|
|
13805
13811
|
}
|
|
13806
13812
|
const th = 20;
|
|
13807
13813
|
function nh(n, e, t, r) {
|
|
13808
|
-
let i = t.getMeta(
|
|
13814
|
+
let i = t.getMeta(rt), s;
|
|
13809
13815
|
if (i)
|
|
13810
13816
|
return i.historyState;
|
|
13811
13817
|
t.getMeta(sh) && (n = new Ie(n.done, n.undone, null, 0, -1));
|
|
13812
13818
|
let o = t.getMeta("appendedTransaction");
|
|
13813
13819
|
if (t.steps.length == 0)
|
|
13814
13820
|
return n;
|
|
13815
|
-
if (o && o.getMeta(
|
|
13816
|
-
return o.getMeta(
|
|
13821
|
+
if (o && o.getMeta(rt))
|
|
13822
|
+
return o.getMeta(rt).redo ? new Ie(n.done.addTransform(t, void 0, r, dn(e)), n.undone, ms(t.mapping.maps), n.prevTime, n.prevComposition) : new Ie(n.done, n.undone.addTransform(t, void 0, r, dn(e)), null, n.prevTime, n.prevComposition);
|
|
13817
13823
|
if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
13818
|
-
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !rh(t, n.prevRanges)), c = o ?
|
|
13819
|
-
return new Ie(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r,
|
|
13820
|
-
} else return (s = t.getMeta("rebased")) ? new Ie(n.done.rebased(t, s), n.undone.rebased(t, s),
|
|
13824
|
+
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !rh(t, n.prevRanges)), c = o ? lr(n.prevRanges, t.mapping) : ms(t.mapping.maps);
|
|
13825
|
+
return new Ie(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, dn(e)), ge.empty, c, t.time, l ?? n.prevComposition);
|
|
13826
|
+
} else return (s = t.getMeta("rebased")) ? new Ie(n.done.rebased(t, s), n.undone.rebased(t, s), lr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new Ie(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), lr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
|
|
13821
13827
|
}
|
|
13822
13828
|
function rh(n, e) {
|
|
13823
13829
|
if (!e)
|
|
@@ -13836,7 +13842,7 @@ function ms(n) {
|
|
|
13836
13842
|
n[t].forEach((r, i, s, o) => e.push(s, o));
|
|
13837
13843
|
return e;
|
|
13838
13844
|
}
|
|
13839
|
-
function
|
|
13845
|
+
function lr(n, e) {
|
|
13840
13846
|
if (!n)
|
|
13841
13847
|
return null;
|
|
13842
13848
|
let t = [];
|
|
@@ -13847,32 +13853,32 @@ function or(n, e) {
|
|
|
13847
13853
|
return t;
|
|
13848
13854
|
}
|
|
13849
13855
|
function ih(n, e, t) {
|
|
13850
|
-
let r =
|
|
13856
|
+
let r = dn(e), i = rt.get(e).spec.config, s = (t ? n.undone : n.done).popEvent(e, r);
|
|
13851
13857
|
if (!s)
|
|
13852
13858
|
return null;
|
|
13853
13859
|
let o = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), i, r), a = new Ie(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
|
|
13854
|
-
return s.transform.setSelection(o).setMeta(
|
|
13860
|
+
return s.transform.setSelection(o).setMeta(rt, { redo: t, historyState: a });
|
|
13855
13861
|
}
|
|
13856
|
-
let
|
|
13857
|
-
function
|
|
13862
|
+
let ar = !1, gs = null;
|
|
13863
|
+
function dn(n) {
|
|
13858
13864
|
let e = n.plugins;
|
|
13859
13865
|
if (gs != e) {
|
|
13860
|
-
|
|
13866
|
+
ar = !1, gs = e;
|
|
13861
13867
|
for (let t = 0; t < e.length; t++)
|
|
13862
13868
|
if (e[t].spec.historyPreserveItems) {
|
|
13863
|
-
|
|
13869
|
+
ar = !0;
|
|
13864
13870
|
break;
|
|
13865
13871
|
}
|
|
13866
13872
|
}
|
|
13867
|
-
return
|
|
13873
|
+
return ar;
|
|
13868
13874
|
}
|
|
13869
|
-
const
|
|
13875
|
+
const rt = new we("history"), sh = new we("closeHistory");
|
|
13870
13876
|
function oh(n = {}) {
|
|
13871
13877
|
return n = {
|
|
13872
13878
|
depth: n.depth || 100,
|
|
13873
13879
|
newGroupDelay: n.newGroupDelay || 500
|
|
13874
13880
|
}, new se({
|
|
13875
|
-
key:
|
|
13881
|
+
key: rt,
|
|
13876
13882
|
state: {
|
|
13877
13883
|
init() {
|
|
13878
13884
|
return new Ie(ge.empty, ge.empty, null, 0, -1);
|
|
@@ -13894,7 +13900,7 @@ function oh(n = {}) {
|
|
|
13894
13900
|
}
|
|
13895
13901
|
function al(n, e) {
|
|
13896
13902
|
return (t, r) => {
|
|
13897
|
-
let i =
|
|
13903
|
+
let i = rt.getState(t);
|
|
13898
13904
|
if (!i || (n ? i.undone : i.done).eventCount == 0)
|
|
13899
13905
|
return !1;
|
|
13900
13906
|
if (r) {
|
|
@@ -14028,11 +14034,11 @@ const cl = al(!1, !0), dl = al(!0, !0), lh = _.create({
|
|
|
14028
14034
|
},
|
|
14029
14035
|
addInputRules() {
|
|
14030
14036
|
return [
|
|
14031
|
-
|
|
14037
|
+
at({
|
|
14032
14038
|
find: ch,
|
|
14033
14039
|
type: this.type
|
|
14034
14040
|
}),
|
|
14035
|
-
|
|
14041
|
+
at({
|
|
14036
14042
|
find: uh,
|
|
14037
14043
|
type: this.type
|
|
14038
14044
|
})
|
|
@@ -14040,11 +14046,11 @@ const cl = al(!1, !0), dl = al(!0, !0), lh = _.create({
|
|
|
14040
14046
|
},
|
|
14041
14047
|
addPasteRules() {
|
|
14042
14048
|
return [
|
|
14043
|
-
|
|
14049
|
+
ct({
|
|
14044
14050
|
find: dh,
|
|
14045
14051
|
type: this.type
|
|
14046
14052
|
}),
|
|
14047
|
-
|
|
14053
|
+
ct({
|
|
14048
14054
|
find: fh,
|
|
14049
14055
|
type: this.type
|
|
14050
14056
|
})
|
|
@@ -14126,13 +14132,13 @@ const cl = al(!1, !0), dl = al(!0, !0), lh = _.create({
|
|
|
14126
14132
|
};
|
|
14127
14133
|
},
|
|
14128
14134
|
addInputRules() {
|
|
14129
|
-
let n =
|
|
14135
|
+
let n = qt({
|
|
14130
14136
|
find: bs,
|
|
14131
14137
|
type: this.type,
|
|
14132
14138
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
14133
14139
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1]
|
|
14134
14140
|
});
|
|
14135
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (n =
|
|
14141
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (n = qt({
|
|
14136
14142
|
find: bs,
|
|
14137
14143
|
type: this.type,
|
|
14138
14144
|
keepMarks: this.options.keepMarks,
|
|
@@ -14214,7 +14220,7 @@ const cl = al(!1, !0), dl = al(!0, !0), lh = _.create({
|
|
|
14214
14220
|
},
|
|
14215
14221
|
addInputRules() {
|
|
14216
14222
|
return [
|
|
14217
|
-
|
|
14223
|
+
at({
|
|
14218
14224
|
find: bh,
|
|
14219
14225
|
type: this.type
|
|
14220
14226
|
})
|
|
@@ -14222,7 +14228,7 @@ const cl = al(!1, !0), dl = al(!0, !0), lh = _.create({
|
|
|
14222
14228
|
},
|
|
14223
14229
|
addPasteRules() {
|
|
14224
14230
|
return [
|
|
14225
|
-
|
|
14231
|
+
ct({
|
|
14226
14232
|
find: kh,
|
|
14227
14233
|
type: this.type
|
|
14228
14234
|
})
|
|
@@ -14354,7 +14360,7 @@ const cl = al(!1, !0), dl = al(!0, !0), lh = _.create({
|
|
|
14354
14360
|
},
|
|
14355
14361
|
addInputRules() {
|
|
14356
14362
|
return [
|
|
14357
|
-
|
|
14363
|
+
at({
|
|
14358
14364
|
find: Oh,
|
|
14359
14365
|
type: this.type
|
|
14360
14366
|
})
|
|
@@ -14362,7 +14368,7 @@ const cl = al(!1, !0), dl = al(!0, !0), lh = _.create({
|
|
|
14362
14368
|
},
|
|
14363
14369
|
addPasteRules() {
|
|
14364
14370
|
return [
|
|
14365
|
-
|
|
14371
|
+
ct({
|
|
14366
14372
|
find: Eh,
|
|
14367
14373
|
type: this.type
|
|
14368
14374
|
})
|
|
@@ -14469,25 +14475,25 @@ const cl = al(!1, !0), dl = al(!0, !0), lh = _.create({
|
|
|
14469
14475
|
];
|
|
14470
14476
|
}
|
|
14471
14477
|
});
|
|
14472
|
-
var re,
|
|
14478
|
+
var re, Ut, _t, ce, Dr, ul, fl, hl, pl;
|
|
14473
14479
|
class Ih extends Cl {
|
|
14474
14480
|
constructor() {
|
|
14475
14481
|
super();
|
|
14476
14482
|
W(this, ce);
|
|
14477
14483
|
W(this, re, null);
|
|
14478
|
-
W(this, Jt, null);
|
|
14479
14484
|
W(this, Ut, null);
|
|
14485
|
+
W(this, _t, null);
|
|
14480
14486
|
}
|
|
14481
14487
|
connectedCallback() {
|
|
14482
|
-
super.connectedCallback() && (Q(this, ce, ul).call(this), Q(this, ce, fl).call(this), Q(this, ce,
|
|
14488
|
+
super.connectedCallback() && (Q(this, ce, ul).call(this), Q(this, ce, fl).call(this), Q(this, ce, Dr).call(this));
|
|
14483
14489
|
}
|
|
14484
14490
|
get value() {
|
|
14485
|
-
return
|
|
14491
|
+
return O(this, re).getHTML();
|
|
14486
14492
|
}
|
|
14487
14493
|
set value(t) {
|
|
14488
14494
|
let r = t || "";
|
|
14489
14495
|
r && !/<\/?[a-z][^>]*>/i.test(r) && (r = r.split(`
|
|
14490
|
-
`).map((i) => `<p>${i}</p>`).join("")),
|
|
14496
|
+
`).map((i) => `<p>${i}</p>`).join("")), O(this, re) ? O(this, re).commands.setContent(r, !1) : de(this, _t, r);
|
|
14491
14497
|
}
|
|
14492
14498
|
get id() {
|
|
14493
14499
|
return this.getAttribute("id");
|
|
@@ -14506,25 +14512,25 @@ class Ih extends Cl {
|
|
|
14506
14512
|
return this.hasAttribute("readonly");
|
|
14507
14513
|
}
|
|
14508
14514
|
set readonly(t) {
|
|
14509
|
-
t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), Q(this, ce,
|
|
14515
|
+
t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), Q(this, ce, Dr).call(this);
|
|
14510
14516
|
}
|
|
14511
14517
|
disconnectedCallback() {
|
|
14512
|
-
|
|
14518
|
+
O(this, re) && (O(this, re).destroy(), de(this, re, null));
|
|
14513
14519
|
}
|
|
14514
14520
|
}
|
|
14515
|
-
re = new WeakMap(),
|
|
14516
|
-
|
|
14517
|
-
if (
|
|
14521
|
+
re = new WeakMap(), Ut = new WeakMap(), _t = new WeakMap(), ce = new WeakSet(), // 2. 에디터 상태 업데이트 로직 분리
|
|
14522
|
+
Dr = function() {
|
|
14523
|
+
if (O(this, re)) {
|
|
14518
14524
|
const t = this.readonly;
|
|
14519
|
-
|
|
14525
|
+
O(this, re).setEditable(!t);
|
|
14520
14526
|
const r = this.shadowRoot.querySelector(".menu-bar");
|
|
14521
14527
|
r && (r.style.display = t ? "none" : "flex");
|
|
14522
14528
|
}
|
|
14523
14529
|
}, ul = function() {
|
|
14524
|
-
const t =
|
|
14530
|
+
const t = kt.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
|
|
14525
14531
|
this.shadowRoot.innerHTML = `
|
|
14526
14532
|
<style>
|
|
14527
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
14533
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.28/dist/css/nineEditor.css";
|
|
14528
14534
|
${r}
|
|
14529
14535
|
</style>
|
|
14530
14536
|
|
|
@@ -14559,13 +14565,13 @@ Ar = function() {
|
|
|
14559
14565
|
<button type="button" data-cmd="redo" title="다시 실행(Ctrl+Y)"><i class="icon-redo"></i></button>
|
|
14560
14566
|
</div>
|
|
14561
14567
|
<div id="editor-container"></div>
|
|
14562
|
-
`, de(this,
|
|
14568
|
+
`, de(this, Ut, this.shadowRoot.querySelector("#editor-container")), this.shadowRoot.querySelector("#font-size").onchange = (i) => {
|
|
14563
14569
|
const s = i.target.value;
|
|
14564
|
-
console.log(i.target, s),
|
|
14570
|
+
console.log(i.target, s), O(this, re).chain().focus().setMark("textStyle", { fontSize: s }).run();
|
|
14565
14571
|
};
|
|
14566
14572
|
}, fl = function() {
|
|
14567
14573
|
de(this, re, new Sf({
|
|
14568
|
-
element:
|
|
14574
|
+
element: O(this, Ut),
|
|
14569
14575
|
editable: !this.readonly,
|
|
14570
14576
|
// 4. 생성 시 readonly 여부 반영
|
|
14571
14577
|
extensions: [
|
|
@@ -14591,7 +14597,7 @@ Ar = function() {
|
|
|
14591
14597
|
}
|
|
14592
14598
|
})
|
|
14593
14599
|
],
|
|
14594
|
-
content:
|
|
14600
|
+
content: O(this, _t) || this.originContents || "",
|
|
14595
14601
|
onUpdate: ({ editor: t }) => {
|
|
14596
14602
|
this.dispatchEvent(new CustomEvent("change", { detail: t.getHTML() }));
|
|
14597
14603
|
},
|
|
@@ -14610,7 +14616,7 @@ Ar = function() {
|
|
|
14610
14616
|
const s = this.shadowRoot.querySelector("#color-picker");
|
|
14611
14617
|
s && (s.value = r.color || "#000000");
|
|
14612
14618
|
}, pl = function() {
|
|
14613
|
-
const t =
|
|
14619
|
+
const t = O(this, re);
|
|
14614
14620
|
this.shadowRoot.querySelectorAll("[data-cmd]").forEach((r) => {
|
|
14615
14621
|
r.onclick = () => {
|
|
14616
14622
|
const i = r.dataset.cmd;
|
|
@@ -14627,15 +14633,15 @@ Ar = function() {
|
|
|
14627
14633
|
};
|
|
14628
14634
|
const ks = { alert: window.alert, confirm: window.confirm }, ml = () => {
|
|
14629
14635
|
const { nativeOverride: n } = xl.config.ux || {}, e = Array.isArray(n) ? n : n === !0 ? ["alert", "confirm"] : [];
|
|
14630
|
-
console.log(n), window.alert = e.includes("alert") ? (t) =>
|
|
14636
|
+
console.log(n), window.alert = e.includes("alert") ? (t) => kt.alert(t) : ks.alert, window.confirm = e.includes("confirm") ? (t) => kt.confirm(t) : ks.confirm;
|
|
14631
14637
|
};
|
|
14632
14638
|
kl((n) => {
|
|
14633
14639
|
n === "ux" && ml();
|
|
14634
14640
|
});
|
|
14635
14641
|
ml();
|
|
14636
|
-
typeof window < "u" && (window.nineUx =
|
|
14642
|
+
typeof window < "u" && (window.nineUx = kt, customElements.get("nine-editor") || customElements.define("nine-editor", Ih));
|
|
14637
14643
|
export {
|
|
14638
14644
|
Ih as nineEditor,
|
|
14639
|
-
|
|
14645
|
+
kt as nineUx
|
|
14640
14646
|
};
|
|
14641
14647
|
//# sourceMappingURL=nine-ux.es.js.map
|