@nine-lab/nine-ux 0.1.54 → 0.1.56
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 +357 -298
- package/dist/nine-ux.es.js.map +1 -1
- package/dist/nine-ux.umd.js +69 -18
- 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 li = (n) => {
|
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
5
|
var Sl = (n, e, t) => e in n ? xl(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
6
|
-
var ye = (n, e, t) => Sl(n, typeof e != "symbol" ? e + "" : e, t),
|
|
7
|
-
var O = (n, e, t) => (
|
|
6
|
+
var ye = (n, e, t) => Sl(n, typeof e != "symbol" ? e + "" : e, t), Jn = (n, e, t) => e.has(n) || li("Cannot " + t);
|
|
7
|
+
var O = (n, e, t) => (Jn(n, e, "read from private field"), t ? t.call(n) : e.get(n)), F = (n, e, t) => e.has(n) ? li("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), oe = (n, e, t, r) => (Jn(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), q = (n, e, t) => (Jn(n, e, "access private method"), t);
|
|
8
8
|
import { nine as Rt, subscribeConfig as Ml } from "@nine-lab/nine-util";
|
|
9
9
|
const wl = `
|
|
10
10
|
dialog::backdrop {
|
|
@@ -318,8 +318,59 @@ const wl = `
|
|
|
318
318
|
:host(.rgb) div.head:hover {
|
|
319
319
|
filter: unset;
|
|
320
320
|
}
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
/* 1. 기본 애니메이션 설정 */
|
|
324
|
+
:host {
|
|
325
|
+
--animation-duration: 0.3s;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
dialog {
|
|
329
|
+
transition: opacity var(--animation-duration) ease,
|
|
330
|
+
transform var(--animation-duration) cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/* 2. Fade In 효과 */
|
|
334
|
+
:host(.fade-in) dialog {
|
|
335
|
+
animation: fade-in var(--animation-duration) forwards;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
@keyframes fade-in {
|
|
339
|
+
from { opacity: 0; }
|
|
340
|
+
to { opacity: 1; }
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/* 3. Zoom In 효과 */
|
|
344
|
+
:host(.zoom-in) dialog {
|
|
345
|
+
animation: zoom-in var(--animation-duration) forwards;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
@keyframes zoom-in {
|
|
349
|
+
from { opacity: 0; transform: scale(0.8); }
|
|
350
|
+
to { opacity: 1; transform: scale(1); }
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/* 4. 닫기 애니메이션 (out 클래스 대응) */
|
|
354
|
+
dialog.out {
|
|
355
|
+
animation: fade-out var(--animation-duration) forwards;
|
|
356
|
+
pointer-events: none;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
@keyframes fade-out {
|
|
360
|
+
from { opacity: 1; transform: scale(1); }
|
|
361
|
+
to { opacity: 0; transform: scale(0.95); }
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/* 5. 백드롭(배경) 애니메이션 */
|
|
365
|
+
dialog::backdrop {
|
|
366
|
+
transition: opacity var(--animation-duration) ease;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
:host(.fade-in) dialog::backdrop {
|
|
370
|
+
background: rgba(0, 0, 0, 0.3);
|
|
371
|
+
}
|
|
321
372
|
`;
|
|
322
|
-
var Oe, j,
|
|
373
|
+
var Oe, j, Nn, An, Dn;
|
|
323
374
|
class Cl extends HTMLElement {
|
|
324
375
|
constructor() {
|
|
325
376
|
super();
|
|
@@ -331,7 +382,7 @@ class Cl extends HTMLElement {
|
|
|
331
382
|
ye(this, "close", () => {
|
|
332
383
|
O(this, j).close(), this.remove();
|
|
333
384
|
});
|
|
334
|
-
F(this,
|
|
385
|
+
F(this, Nn, () => {
|
|
335
386
|
const t = this.querySelector(".head");
|
|
336
387
|
this.querySelectorAll(".close, .close2").forEach((r) => {
|
|
337
388
|
r.onclick = () => {
|
|
@@ -339,10 +390,10 @@ class Cl extends HTMLElement {
|
|
|
339
390
|
this.close();
|
|
340
391
|
}, 300);
|
|
341
392
|
};
|
|
342
|
-
}), t.addEventListener("mousedown", O(this,
|
|
393
|
+
}), t.addEventListener("mousedown", O(this, An)), t.addEventListener("touchstart", O(this, Dn), { passive: !1 });
|
|
343
394
|
});
|
|
344
395
|
// --- 드래그 로직 (Vanilla JS) ---
|
|
345
|
-
F(this,
|
|
396
|
+
F(this, An, (t) => {
|
|
346
397
|
if (t.target.closest("buttons") || t.button !== 0 || t.altKey || t.ctrlKey || t.shiftKey) return;
|
|
347
398
|
const r = O(this, j).getBoundingClientRect();
|
|
348
399
|
oe(this, Oe, {
|
|
@@ -356,7 +407,7 @@ class Cl extends HTMLElement {
|
|
|
356
407
|
};
|
|
357
408
|
document.addEventListener("mousemove", i), document.addEventListener("mouseup", s);
|
|
358
409
|
});
|
|
359
|
-
F(this,
|
|
410
|
+
F(this, Dn, (t) => {
|
|
360
411
|
if (t.target.closest("buttons")) return;
|
|
361
412
|
const r = O(this, j).getBoundingClientRect(), i = t.changedTouches[0];
|
|
362
413
|
oe(this, Oe, {
|
|
@@ -405,12 +456,12 @@ class Cl extends HTMLElement {
|
|
|
405
456
|
</div>
|
|
406
457
|
</div>
|
|
407
458
|
</dialog>
|
|
408
|
-
`, oe(this, j, this.querySelector("dialog")), O(this,
|
|
459
|
+
`, oe(this, j, this.querySelector("dialog")), O(this, Nn).call(this);
|
|
409
460
|
}
|
|
410
461
|
}
|
|
411
|
-
Oe = new WeakMap(), j = new WeakMap(),
|
|
462
|
+
Oe = new WeakMap(), j = new WeakMap(), Nn = new WeakMap(), An = new WeakMap(), Dn = new WeakMap();
|
|
412
463
|
customElements.get("nine-dialog") || customElements.define("nine-dialog", Cl);
|
|
413
|
-
class
|
|
464
|
+
class hn extends HTMLElement {
|
|
414
465
|
constructor() {
|
|
415
466
|
super(), this.attachShadow({ mode: "open" });
|
|
416
467
|
}
|
|
@@ -426,7 +477,7 @@ class Br extends HTMLElement {
|
|
|
426
477
|
`;
|
|
427
478
|
}
|
|
428
479
|
}
|
|
429
|
-
ye(
|
|
480
|
+
ye(hn, "confirm", async (e, t = "Confirm", r = {}) => {
|
|
430
481
|
var d;
|
|
431
482
|
const i = {
|
|
432
483
|
"true-text": "Yes",
|
|
@@ -448,7 +499,7 @@ ye(Br, "confirm", async (e, t = "Confirm", r = {}) => {
|
|
|
448
499
|
}, o.addEventListener("close", () => u(void 0)), o.showModal();
|
|
449
500
|
});
|
|
450
501
|
});
|
|
451
|
-
class
|
|
502
|
+
class pn extends HTMLElement {
|
|
452
503
|
constructor() {
|
|
453
504
|
super(), this.attachShadow({ mode: "open" });
|
|
454
505
|
}
|
|
@@ -463,7 +514,7 @@ class Lr extends HTMLElement {
|
|
|
463
514
|
`;
|
|
464
515
|
}
|
|
465
516
|
}
|
|
466
|
-
ye(
|
|
517
|
+
ye(pn, "alert", async (e, t = "Alert", r = {}) => {
|
|
467
518
|
var c;
|
|
468
519
|
const i = {
|
|
469
520
|
class: "",
|
|
@@ -482,9 +533,9 @@ ye(Lr, "alert", async (e, t = "Alert", r = {}) => {
|
|
|
482
533
|
l.onclick = u, o.showModal();
|
|
483
534
|
});
|
|
484
535
|
});
|
|
485
|
-
customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup",
|
|
486
|
-
customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup",
|
|
487
|
-
var jt, Kt,
|
|
536
|
+
customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", hn);
|
|
537
|
+
customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", pn);
|
|
538
|
+
var jt, Kt, hr;
|
|
488
539
|
class Tl {
|
|
489
540
|
constructor() {
|
|
490
541
|
F(this, Kt);
|
|
@@ -499,10 +550,18 @@ class Tl {
|
|
|
499
550
|
oe(this, jt, e);
|
|
500
551
|
}
|
|
501
552
|
alert(e, t = "Alert") {
|
|
502
|
-
return q(this, Kt,
|
|
553
|
+
return q(this, Kt, hr).call(this, "alert", e, t, "classic");
|
|
503
554
|
}
|
|
504
555
|
confirm(e, t = "Confirm") {
|
|
505
|
-
return q(this, Kt,
|
|
556
|
+
return q(this, Kt, hr).call(this, "confirm", e, t, "classic");
|
|
557
|
+
}
|
|
558
|
+
// 이제 setup이나 window 교체 로직은 여기서 다 제거합니다.
|
|
559
|
+
// 오직 팝업을 실행하는 인터페이스 역할만 수행.
|
|
560
|
+
async alert1(e, t = "Alert", r = {}) {
|
|
561
|
+
return await pn.alert(e, t, r);
|
|
562
|
+
}
|
|
563
|
+
async confirm1(e, t = "Confirm", r = {}) {
|
|
564
|
+
return await hn.confirm(e, t, r);
|
|
506
565
|
}
|
|
507
566
|
/**
|
|
508
567
|
* 컴포넌트별 CSS 경로 생성 헬퍼 (복구!)
|
|
@@ -512,23 +571,23 @@ class Tl {
|
|
|
512
571
|
return t ? `${t.endsWith("/") ? t : t + "/"}${e}` : null;
|
|
513
572
|
}
|
|
514
573
|
}
|
|
515
|
-
jt = new WeakMap(), Kt = new WeakSet(),
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
// Promise 호환성 (await 사용 가능하게 함)
|
|
526
|
-
then: (a, c) => o[e](t, r, s).then(a, c)
|
|
574
|
+
jt = new WeakMap(), Kt = new WeakSet(), hr = function(e, t, r, i) {
|
|
575
|
+
const s = { class: i, animation: "fade-in" }, o = e === "alert" ? pn : hn;
|
|
576
|
+
let l = !1;
|
|
577
|
+
const a = {
|
|
578
|
+
rgb: () => (s.class = "rgb", a),
|
|
579
|
+
classic: () => (s.class = "classic", a),
|
|
580
|
+
fade: () => (s.animation = "fade-in", a),
|
|
581
|
+
zoom: () => (s.animation = "zoom-in", a),
|
|
582
|
+
// await 사용 시 호출됨
|
|
583
|
+
then: (c, d) => (l = !0, o[e](t, r, s).then(c, d))
|
|
527
584
|
};
|
|
528
|
-
return
|
|
585
|
+
return Promise.resolve().then(() => {
|
|
586
|
+
l || (l = !0, o[e](t, r, s));
|
|
587
|
+
}), a;
|
|
529
588
|
};
|
|
530
589
|
const Ae = new Tl();
|
|
531
|
-
var Jt, Ze, Ut, ae, Tt,
|
|
590
|
+
var Jt, Ze, Ut, ae, Tt, pr, mr, _t, In;
|
|
532
591
|
class Ol extends HTMLElement {
|
|
533
592
|
constructor() {
|
|
534
593
|
super();
|
|
@@ -553,20 +612,20 @@ class Ol extends HTMLElement {
|
|
|
553
612
|
});
|
|
554
613
|
// 파라미터가 있으면 해당 값으로, 없으면 전체 공백 초기화
|
|
555
614
|
ye(this, "clearData", (t = {}) => {
|
|
556
|
-
q(this, ae,
|
|
615
|
+
q(this, ae, mr).call(this), q(this, ae, Tt).call(this).forEach((r) => {
|
|
557
616
|
const i = r.name;
|
|
558
617
|
if (!i) return;
|
|
559
618
|
const s = t && t[i] !== void 0 ? t[i] : "";
|
|
560
|
-
q(this, ae,
|
|
619
|
+
q(this, ae, pr).call(this, r, s);
|
|
561
620
|
}), this.changed = !1;
|
|
562
621
|
});
|
|
563
622
|
ye(this, "setData", (t) => {
|
|
564
623
|
if (!t || typeof t != "object") return;
|
|
565
|
-
q(this, ae,
|
|
624
|
+
q(this, ae, mr).call(this);
|
|
566
625
|
let r = !1;
|
|
567
626
|
q(this, ae, Tt).call(this).forEach((i) => {
|
|
568
627
|
const s = i.name;
|
|
569
|
-
!s || !t.hasOwnProperty(s) || q(this, ae,
|
|
628
|
+
!s || !t.hasOwnProperty(s) || q(this, ae, pr).call(this, i, t[s]) && (r = !0);
|
|
570
629
|
}), r && (this.changed = !0);
|
|
571
630
|
});
|
|
572
631
|
ye(this, "initData", (t) => {
|
|
@@ -575,14 +634,14 @@ class Ol extends HTMLElement {
|
|
|
575
634
|
F(this, _t, (t) => {
|
|
576
635
|
this.changed = !0;
|
|
577
636
|
});
|
|
578
|
-
F(this,
|
|
637
|
+
F(this, In, () => {
|
|
579
638
|
for (const t of this.attributes)
|
|
580
639
|
t.name.startsWith("css-") && this.style.setProperty(t.name.substring(4), t.value);
|
|
581
640
|
this.originContents = this.innerHTML.trim(), this.innerHTML = "", this.shadowRoot && this.tagName.toLowerCase() === "nx-div" && (this.shadowRoot.innerHTML = this.originContents);
|
|
582
641
|
});
|
|
583
642
|
}
|
|
584
643
|
connectedCallback() {
|
|
585
|
-
return O(this, Jt) ? !1 : (this.getAttribute("use-shadow") !== "false" && !this.shadowRoot ? (this.attachShadow({ mode: "open" }), oe(this, Ze, this.shadowRoot)) : oe(this, Ze, this), O(this,
|
|
644
|
+
return O(this, Jt) ? !1 : (this.getAttribute("use-shadow") !== "false" && !this.shadowRoot ? (this.attachShadow({ mode: "open" }), oe(this, Ze, this.shadowRoot)) : oe(this, Ze, this), O(this, In).call(this), oe(this, Jt, !0), !0);
|
|
586
645
|
}
|
|
587
646
|
get changed() {
|
|
588
647
|
return O(this, Ut);
|
|
@@ -605,7 +664,7 @@ Jt = new WeakMap(), Ze = new WeakMap(), Ut = new WeakMap(), ae = new WeakSet(),
|
|
|
605
664
|
Tt = function() {
|
|
606
665
|
return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]", O(this, Ze));
|
|
607
666
|
}, // [공통 로직 1] 특정 요소에 값을 쓰거나 초기화하는 핵심 함수
|
|
608
|
-
|
|
667
|
+
pr = function(t, r) {
|
|
609
668
|
const i = t.tagName.toUpperCase(), s = t.type;
|
|
610
669
|
let o = !1;
|
|
611
670
|
if (["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"].includes(i))
|
|
@@ -621,11 +680,11 @@ fr = function(t, r) {
|
|
|
621
680
|
t.textContent !== r && (o = !0), t.textContent = r;
|
|
622
681
|
return o;
|
|
623
682
|
}, // [공통 로직 2] 이벤트 리스너 일괄 등록
|
|
624
|
-
|
|
683
|
+
mr = function() {
|
|
625
684
|
q(this, ae, Tt).call(this).forEach((t) => {
|
|
626
685
|
t.removeEventListener("input", O(this, _t)), t.addEventListener("input", O(this, _t));
|
|
627
686
|
});
|
|
628
|
-
}, _t = new WeakMap(),
|
|
687
|
+
}, _t = new WeakMap(), In = new WeakMap();
|
|
629
688
|
function K(n) {
|
|
630
689
|
this.content = n;
|
|
631
690
|
}
|
|
@@ -1028,11 +1087,11 @@ class b {
|
|
|
1028
1087
|
}
|
|
1029
1088
|
}
|
|
1030
1089
|
b.empty = new b([], 0);
|
|
1031
|
-
const
|
|
1090
|
+
const Un = { index: 0, offset: 0 };
|
|
1032
1091
|
function en(n, e) {
|
|
1033
|
-
return
|
|
1092
|
+
return Un.index = n, Un.offset = e, Un;
|
|
1034
1093
|
}
|
|
1035
|
-
function
|
|
1094
|
+
function mn(n, e) {
|
|
1036
1095
|
if (n === e)
|
|
1037
1096
|
return !0;
|
|
1038
1097
|
if (!(n && typeof n == "object") || !(e && typeof e == "object"))
|
|
@@ -1044,11 +1103,11 @@ function hn(n, e) {
|
|
|
1044
1103
|
if (n.length != e.length)
|
|
1045
1104
|
return !1;
|
|
1046
1105
|
for (let r = 0; r < n.length; r++)
|
|
1047
|
-
if (!
|
|
1106
|
+
if (!mn(n[r], e[r]))
|
|
1048
1107
|
return !1;
|
|
1049
1108
|
} else {
|
|
1050
1109
|
for (let r in n)
|
|
1051
|
-
if (!(r in e) || !
|
|
1110
|
+
if (!(r in e) || !mn(n[r], e[r]))
|
|
1052
1111
|
return !1;
|
|
1053
1112
|
for (let r in e)
|
|
1054
1113
|
if (!(r in n))
|
|
@@ -1056,7 +1115,7 @@ function hn(n, e) {
|
|
|
1056
1115
|
}
|
|
1057
1116
|
return !0;
|
|
1058
1117
|
}
|
|
1059
|
-
let A = class
|
|
1118
|
+
let A = class gr {
|
|
1060
1119
|
/**
|
|
1061
1120
|
@internal
|
|
1062
1121
|
*/
|
|
@@ -1110,7 +1169,7 @@ let A = class pr {
|
|
|
1110
1169
|
another mark.
|
|
1111
1170
|
*/
|
|
1112
1171
|
eq(e) {
|
|
1113
|
-
return this == e || this.type == e.type &&
|
|
1172
|
+
return this == e || this.type == e.type && mn(this.attrs, e.attrs);
|
|
1114
1173
|
}
|
|
1115
1174
|
/**
|
|
1116
1175
|
Convert this mark to a JSON-serializeable representation.
|
|
@@ -1154,15 +1213,15 @@ let A = class pr {
|
|
|
1154
1213
|
*/
|
|
1155
1214
|
static setFrom(e) {
|
|
1156
1215
|
if (!e || Array.isArray(e) && e.length == 0)
|
|
1157
|
-
return
|
|
1158
|
-
if (e instanceof
|
|
1216
|
+
return gr.none;
|
|
1217
|
+
if (e instanceof gr)
|
|
1159
1218
|
return [e];
|
|
1160
1219
|
let t = e.slice();
|
|
1161
1220
|
return t.sort((r, i) => r.type.rank - i.type.rank), t;
|
|
1162
1221
|
}
|
|
1163
1222
|
};
|
|
1164
1223
|
A.none = [];
|
|
1165
|
-
class
|
|
1224
|
+
class gn extends Error {
|
|
1166
1225
|
}
|
|
1167
1226
|
class k {
|
|
1168
1227
|
/**
|
|
@@ -1265,9 +1324,9 @@ function Es(n, e, t, r) {
|
|
|
1265
1324
|
}
|
|
1266
1325
|
function El(n, e, t) {
|
|
1267
1326
|
if (t.openStart > n.depth)
|
|
1268
|
-
throw new
|
|
1327
|
+
throw new gn("Inserted content deeper than insertion position");
|
|
1269
1328
|
if (n.depth - t.openStart != e.depth - t.openEnd)
|
|
1270
|
-
throw new
|
|
1329
|
+
throw new gn("Inconsistent open depths");
|
|
1271
1330
|
return vs(n, e, t, 0);
|
|
1272
1331
|
}
|
|
1273
1332
|
function vs(n, e, t, r) {
|
|
@@ -1283,13 +1342,13 @@ function vs(n, e, t, r) {
|
|
|
1283
1342
|
let { start: o, end: l } = vl(t, n);
|
|
1284
1343
|
return et(s, As(n, o, l, e, r));
|
|
1285
1344
|
}
|
|
1286
|
-
else return et(s,
|
|
1345
|
+
else return et(s, yn(n, e, r));
|
|
1287
1346
|
}
|
|
1288
1347
|
function Ns(n, e) {
|
|
1289
1348
|
if (!e.type.compatibleContent(n.type))
|
|
1290
|
-
throw new
|
|
1349
|
+
throw new gn("Cannot join " + e.type.name + " onto " + n.type.name);
|
|
1291
1350
|
}
|
|
1292
|
-
function
|
|
1351
|
+
function yr(n, e, t) {
|
|
1293
1352
|
let r = n.node(t);
|
|
1294
1353
|
return Ns(r, e.node(t)), r;
|
|
1295
1354
|
}
|
|
@@ -1308,14 +1367,14 @@ function et(n, e) {
|
|
|
1308
1367
|
return n.type.checkContent(e), n.copy(e);
|
|
1309
1368
|
}
|
|
1310
1369
|
function As(n, e, t, r, i) {
|
|
1311
|
-
let s = n.depth > i &&
|
|
1312
|
-
return Nt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Ns(s, o), Qe(et(s, As(n, e, t, r, i + 1)), l)) : (s && Qe(et(s,
|
|
1370
|
+
let s = n.depth > i && yr(n, e, i + 1), o = r.depth > i && yr(t, r, i + 1), l = [];
|
|
1371
|
+
return Nt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Ns(s, o), Qe(et(s, As(n, e, t, r, i + 1)), l)) : (s && Qe(et(s, yn(n, e, i + 1)), l), Nt(e, t, i, l), o && Qe(et(o, yn(t, r, i + 1)), l)), Nt(r, null, i, l), new b(l);
|
|
1313
1372
|
}
|
|
1314
|
-
function
|
|
1373
|
+
function yn(n, e, t) {
|
|
1315
1374
|
let r = [];
|
|
1316
1375
|
if (Nt(null, n, t, r), n.depth > t) {
|
|
1317
|
-
let i =
|
|
1318
|
-
Qe(et(i,
|
|
1376
|
+
let i = yr(n, e, t + 1);
|
|
1377
|
+
Qe(et(i, yn(n, e, t + 1)), r);
|
|
1319
1378
|
}
|
|
1320
1379
|
return Nt(e, null, t, r), new b(r);
|
|
1321
1380
|
}
|
|
@@ -1513,7 +1572,7 @@ class Pt {
|
|
|
1513
1572
|
return e.blockRange(this);
|
|
1514
1573
|
for (let r = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); r >= 0; r--)
|
|
1515
1574
|
if (e.pos <= this.end(r) && (!t || t(this.node(r))))
|
|
1516
|
-
return new
|
|
1575
|
+
return new bn(this, e, r);
|
|
1517
1576
|
return null;
|
|
1518
1577
|
}
|
|
1519
1578
|
/**
|
|
@@ -1581,7 +1640,7 @@ class Nl {
|
|
|
1581
1640
|
}
|
|
1582
1641
|
}
|
|
1583
1642
|
const Al = 12, ai = /* @__PURE__ */ new WeakMap();
|
|
1584
|
-
class
|
|
1643
|
+
class bn {
|
|
1585
1644
|
/**
|
|
1586
1645
|
Construct a node range. `$from` and `$to` should point into the
|
|
1587
1646
|
same node until at least the given `depth`, since a node range
|
|
@@ -1622,7 +1681,7 @@ class gn {
|
|
|
1622
1681
|
}
|
|
1623
1682
|
}
|
|
1624
1683
|
const Dl = /* @__PURE__ */ Object.create(null);
|
|
1625
|
-
let Fe = class
|
|
1684
|
+
let Fe = class br {
|
|
1626
1685
|
/**
|
|
1627
1686
|
@internal
|
|
1628
1687
|
*/
|
|
@@ -1740,21 +1799,21 @@ let Fe = class gr {
|
|
|
1740
1799
|
attributes, and marks.
|
|
1741
1800
|
*/
|
|
1742
1801
|
hasMarkup(e, t, r) {
|
|
1743
|
-
return this.type == e &&
|
|
1802
|
+
return this.type == e && mn(this.attrs, t || e.defaultAttrs || Dl) && A.sameSet(this.marks, r || A.none);
|
|
1744
1803
|
}
|
|
1745
1804
|
/**
|
|
1746
1805
|
Create a new node with the same markup as this node, containing
|
|
1747
1806
|
the given content (or empty, if no content is given).
|
|
1748
1807
|
*/
|
|
1749
1808
|
copy(e = null) {
|
|
1750
|
-
return e == this.content ? this : new
|
|
1809
|
+
return e == this.content ? this : new br(this.type, this.attrs, e, this.marks);
|
|
1751
1810
|
}
|
|
1752
1811
|
/**
|
|
1753
1812
|
Create a copy of this node, with the given set of marks instead
|
|
1754
1813
|
of the node's own marks.
|
|
1755
1814
|
*/
|
|
1756
1815
|
mark(e) {
|
|
1757
|
-
return e == this.marks ? this : new
|
|
1816
|
+
return e == this.marks ? this : new br(this.type, this.attrs, this.content, e);
|
|
1758
1817
|
}
|
|
1759
1818
|
/**
|
|
1760
1819
|
Create a copy of this node with only the content between the
|
|
@@ -1992,7 +2051,7 @@ let Fe = class gr {
|
|
|
1992
2051
|
}
|
|
1993
2052
|
};
|
|
1994
2053
|
Fe.prototype.text = void 0;
|
|
1995
|
-
class
|
|
2054
|
+
class kn extends Fe {
|
|
1996
2055
|
/**
|
|
1997
2056
|
@internal
|
|
1998
2057
|
*/
|
|
@@ -2014,10 +2073,10 @@ class yn extends Fe {
|
|
|
2014
2073
|
return this.text.length;
|
|
2015
2074
|
}
|
|
2016
2075
|
mark(e) {
|
|
2017
|
-
return e == this.marks ? this : new
|
|
2076
|
+
return e == this.marks ? this : new kn(this.type, this.attrs, this.text, e);
|
|
2018
2077
|
}
|
|
2019
2078
|
withText(e) {
|
|
2020
|
-
return e == this.text ? this : new
|
|
2079
|
+
return e == this.text ? this : new kn(this.type, this.attrs, e, this.marks);
|
|
2021
2080
|
}
|
|
2022
2081
|
cut(e = 0, t = this.text.length) {
|
|
2023
2082
|
return e == 0 && t == this.text.length ? this : this.withText(this.text.slice(e, t));
|
|
@@ -2614,7 +2673,7 @@ class Wl {
|
|
|
2614
2673
|
return !this.hasDefault;
|
|
2615
2674
|
}
|
|
2616
2675
|
}
|
|
2617
|
-
class
|
|
2676
|
+
class Rn {
|
|
2618
2677
|
/**
|
|
2619
2678
|
@internal
|
|
2620
2679
|
*/
|
|
@@ -2636,7 +2695,7 @@ class Dn {
|
|
|
2636
2695
|
*/
|
|
2637
2696
|
static compile(e, t) {
|
|
2638
2697
|
let r = /* @__PURE__ */ Object.create(null), i = 0;
|
|
2639
|
-
return e.forEach((s, o) => r[s] = new
|
|
2698
|
+
return e.forEach((s, o) => r[s] = new Rn(s, i++, t, o)), r;
|
|
2640
2699
|
}
|
|
2641
2700
|
/**
|
|
2642
2701
|
When there is a mark of this type in the given set, a new set
|
|
@@ -2678,7 +2737,7 @@ class $s {
|
|
|
2678
2737
|
let t = this.spec = {};
|
|
2679
2738
|
for (let i in e)
|
|
2680
2739
|
t[i] = e[i];
|
|
2681
|
-
t.nodes = K.from(e.nodes), t.marks = K.from(e.marks || {}), this.nodes = ui.compile(this.spec.nodes, this), this.marks =
|
|
2740
|
+
t.nodes = K.from(e.nodes), t.marks = K.from(e.marks || {}), this.nodes = ui.compile(this.spec.nodes, this), this.marks = Rn.compile(this.spec.marks, this);
|
|
2682
2741
|
let r = /* @__PURE__ */ Object.create(null);
|
|
2683
2742
|
for (let i in this.nodes) {
|
|
2684
2743
|
if (i in this.marks)
|
|
@@ -2720,7 +2779,7 @@ class $s {
|
|
|
2720
2779
|
*/
|
|
2721
2780
|
text(e, t) {
|
|
2722
2781
|
let r = this.nodes.text;
|
|
2723
|
-
return new
|
|
2782
|
+
return new kn(r, r.defaultAttrs, e, A.setFrom(t));
|
|
2724
2783
|
}
|
|
2725
2784
|
/**
|
|
2726
2785
|
Create a mark with the given type and attributes.
|
|
@@ -2915,9 +2974,9 @@ const Vs = {
|
|
|
2915
2974
|
script: !0,
|
|
2916
2975
|
style: !0,
|
|
2917
2976
|
title: !0
|
|
2918
|
-
}, Hs = { ol: !0, ul: !0 }, Bt = 1,
|
|
2977
|
+
}, Hs = { ol: !0, ul: !0 }, Bt = 1, kr = 2, At = 4;
|
|
2919
2978
|
function hi(n, e, t) {
|
|
2920
|
-
return e != null ? (e ? Bt : 0) | (e === "full" ?
|
|
2979
|
+
return e != null ? (e ? Bt : 0) | (e === "full" ? kr : 0) : n && n.whitespace == "pre" ? Bt | kr : t & ~At;
|
|
2921
2980
|
}
|
|
2922
2981
|
class tn {
|
|
2923
2982
|
constructor(e, t, r, i, s, o) {
|
|
@@ -2968,7 +3027,7 @@ class pi {
|
|
|
2968
3027
|
e.nodeType == 3 ? this.addTextNode(e, t) : e.nodeType == 1 && this.addElement(e, t);
|
|
2969
3028
|
}
|
|
2970
3029
|
addTextNode(e, t) {
|
|
2971
|
-
let r = e.nodeValue, i = this.top, s = i.options &
|
|
3030
|
+
let r = e.nodeValue, i = this.top, s = i.options & kr ? "full" : this.localPreserveWS || (i.options & Bt) > 0, { schema: o } = this.parser;
|
|
2972
3031
|
if (s === "full" || i.inlineContext(e) || /[^ \t\r\n\u000c]/.test(r)) {
|
|
2973
3032
|
if (s)
|
|
2974
3033
|
if (s === "full")
|
|
@@ -3287,7 +3346,7 @@ class dt {
|
|
|
3287
3346
|
nodes.
|
|
3288
3347
|
*/
|
|
3289
3348
|
serializeFragment(e, t = {}, r) {
|
|
3290
|
-
r || (r =
|
|
3349
|
+
r || (r = _n(t).createDocumentFragment());
|
|
3291
3350
|
let i = r, s = [];
|
|
3292
3351
|
return e.forEach((o) => {
|
|
3293
3352
|
if (s.length || o.marks.length) {
|
|
@@ -3316,7 +3375,7 @@ class dt {
|
|
|
3316
3375
|
@internal
|
|
3317
3376
|
*/
|
|
3318
3377
|
serializeNodeInner(e, t) {
|
|
3319
|
-
let { dom: r, contentDOM: i } = cn(
|
|
3378
|
+
let { dom: r, contentDOM: i } = cn(_n(t), this.nodes[e.type.name](e), null, e.attrs);
|
|
3320
3379
|
if (i) {
|
|
3321
3380
|
if (e.isLeaf)
|
|
3322
3381
|
throw new RangeError("Content hole not allowed in a leaf node spec");
|
|
@@ -3344,7 +3403,7 @@ class dt {
|
|
|
3344
3403
|
*/
|
|
3345
3404
|
serializeMark(e, t, r = {}) {
|
|
3346
3405
|
let i = this.marks[e.type.name];
|
|
3347
|
-
return i && cn(
|
|
3406
|
+
return i && cn(_n(r), i(e, t), null, e.attrs);
|
|
3348
3407
|
}
|
|
3349
3408
|
static renderSpec(e, t, r = null, i) {
|
|
3350
3409
|
return cn(e, t, r, i);
|
|
@@ -3379,7 +3438,7 @@ function yi(n) {
|
|
|
3379
3438
|
}
|
|
3380
3439
|
return e;
|
|
3381
3440
|
}
|
|
3382
|
-
function
|
|
3441
|
+
function _n(n) {
|
|
3383
3442
|
return n.document || window.document;
|
|
3384
3443
|
}
|
|
3385
3444
|
const bi = /* @__PURE__ */ new WeakMap();
|
|
@@ -3454,7 +3513,7 @@ function Xl(n) {
|
|
|
3454
3513
|
return (n - (n & Ws)) / qs;
|
|
3455
3514
|
}
|
|
3456
3515
|
const js = 1, Ks = 2, dn = 4, Js = 8;
|
|
3457
|
-
class
|
|
3516
|
+
class xr {
|
|
3458
3517
|
/**
|
|
3459
3518
|
@internal
|
|
3460
3519
|
*/
|
|
@@ -3531,11 +3590,11 @@ class le {
|
|
|
3531
3590
|
if (r)
|
|
3532
3591
|
return h;
|
|
3533
3592
|
let p = e == (t < 0 ? a : u) ? null : Yl(l / 3, e - a), m = e == a ? Ks : e == u ? js : dn;
|
|
3534
|
-
return (t < 0 ? e != a : e != u) && (m |= Js), new
|
|
3593
|
+
return (t < 0 ? e != a : e != u) && (m |= Js), new xr(h, m, p);
|
|
3535
3594
|
}
|
|
3536
3595
|
i += d - c;
|
|
3537
3596
|
}
|
|
3538
|
-
return r ? e + i : new
|
|
3597
|
+
return r ? e + i : new xr(e + i, 0, null);
|
|
3539
3598
|
}
|
|
3540
3599
|
/**
|
|
3541
3600
|
@internal
|
|
@@ -3691,10 +3750,10 @@ class Lt {
|
|
|
3691
3750
|
}
|
|
3692
3751
|
i |= l.delInfo, e = l.pos;
|
|
3693
3752
|
}
|
|
3694
|
-
return r ? e : new
|
|
3753
|
+
return r ? e : new xr(e, i, null);
|
|
3695
3754
|
}
|
|
3696
3755
|
}
|
|
3697
|
-
const
|
|
3756
|
+
const Gn = /* @__PURE__ */ Object.create(null);
|
|
3698
3757
|
class Q {
|
|
3699
3758
|
/**
|
|
3700
3759
|
Get the step map that represents the changes made by this step,
|
|
@@ -3719,7 +3778,7 @@ class Q {
|
|
|
3719
3778
|
static fromJSON(e, t) {
|
|
3720
3779
|
if (!t || !t.stepType)
|
|
3721
3780
|
throw new RangeError("Invalid input for Step.fromJSON");
|
|
3722
|
-
let r =
|
|
3781
|
+
let r = Gn[t.stepType];
|
|
3723
3782
|
if (!r)
|
|
3724
3783
|
throw new RangeError(`No step type ${t.stepType} defined`);
|
|
3725
3784
|
return r.fromJSON(e, t);
|
|
@@ -3731,9 +3790,9 @@ class Q {
|
|
|
3731
3790
|
that's unlikely to clash with steps from other modules.
|
|
3732
3791
|
*/
|
|
3733
3792
|
static jsonID(e, t) {
|
|
3734
|
-
if (e in
|
|
3793
|
+
if (e in Gn)
|
|
3735
3794
|
throw new RangeError("Duplicate use of step JSON ID " + e);
|
|
3736
|
-
return
|
|
3795
|
+
return Gn[e] = t, t.prototype.jsonID = e, t;
|
|
3737
3796
|
}
|
|
3738
3797
|
}
|
|
3739
3798
|
class B {
|
|
@@ -3764,7 +3823,7 @@ class B {
|
|
|
3764
3823
|
try {
|
|
3765
3824
|
return B.ok(e.replace(t, r, i));
|
|
3766
3825
|
} catch (s) {
|
|
3767
|
-
if (s instanceof
|
|
3826
|
+
if (s instanceof gn)
|
|
3768
3827
|
return B.fail(s.message);
|
|
3769
3828
|
throw s;
|
|
3770
3829
|
}
|
|
@@ -3949,7 +4008,7 @@ class P extends Q {
|
|
|
3949
4008
|
super(), this.from = e, this.to = t, this.slice = r, this.structure = i;
|
|
3950
4009
|
}
|
|
3951
4010
|
apply(e) {
|
|
3952
|
-
return this.structure &&
|
|
4011
|
+
return this.structure && Sr(e, this.from, this.to) ? B.fail("Structure replace would overwrite content") : B.fromReplace(e, this.from, this.to, this.slice);
|
|
3953
4012
|
}
|
|
3954
4013
|
getMap() {
|
|
3955
4014
|
return new le([this.from, this.to - this.from, this.slice.size]);
|
|
@@ -3999,7 +4058,7 @@ class $ extends Q {
|
|
|
3999
4058
|
super(), this.from = e, this.to = t, this.gapFrom = r, this.gapTo = i, this.slice = s, this.insert = o, this.structure = l;
|
|
4000
4059
|
}
|
|
4001
4060
|
apply(e) {
|
|
4002
|
-
if (this.structure && (
|
|
4061
|
+
if (this.structure && (Sr(e, this.from, this.gapFrom) || Sr(e, this.gapTo, this.to)))
|
|
4003
4062
|
return B.fail("Structure gap-replace would overwrite content");
|
|
4004
4063
|
let t = e.slice(this.gapFrom, this.gapTo);
|
|
4005
4064
|
if (t.openStart || t.openEnd)
|
|
@@ -4046,7 +4105,7 @@ class $ extends Q {
|
|
|
4046
4105
|
}
|
|
4047
4106
|
}
|
|
4048
4107
|
Q.jsonID("replaceAround", $);
|
|
4049
|
-
function
|
|
4108
|
+
function Sr(n, e, t) {
|
|
4050
4109
|
let r = n.resolve(e), i = t - e, s = r.depth;
|
|
4051
4110
|
for (; i > 0 && s > 0 && r.indexAfter(s) == r.node(s).childCount; )
|
|
4052
4111
|
s--, i--;
|
|
@@ -4081,7 +4140,7 @@ function Ql(n, e, t, r) {
|
|
|
4081
4140
|
return;
|
|
4082
4141
|
s++;
|
|
4083
4142
|
let a = null;
|
|
4084
|
-
if (r instanceof
|
|
4143
|
+
if (r instanceof Rn) {
|
|
4085
4144
|
let c = o.marks, d;
|
|
4086
4145
|
for (; d = r.isInSet(c); )
|
|
4087
4146
|
(a || (a = [])).push(d), c = d.removeFromSet(c);
|
|
@@ -4281,7 +4340,7 @@ function ca(n, e) {
|
|
|
4281
4340
|
function Gs(n, e) {
|
|
4282
4341
|
return !!(n && e && !n.isLeaf && ca(n, e));
|
|
4283
4342
|
}
|
|
4284
|
-
function
|
|
4343
|
+
function Pn(n, e, t = -1) {
|
|
4285
4344
|
let r = n.resolve(e);
|
|
4286
4345
|
for (let i = r.depth; ; i--) {
|
|
4287
4346
|
let s, o, l = r.index(i);
|
|
@@ -4354,7 +4413,7 @@ function Ys(n, e, t) {
|
|
|
4354
4413
|
}
|
|
4355
4414
|
return null;
|
|
4356
4415
|
}
|
|
4357
|
-
function
|
|
4416
|
+
function Bn(n, e, t = e, r = k.empty) {
|
|
4358
4417
|
if (e == t && !r.size)
|
|
4359
4418
|
return null;
|
|
4360
4419
|
let i = n.resolve(e), s = n.resolve(t);
|
|
@@ -4409,7 +4468,7 @@ class fa {
|
|
|
4409
4468
|
for (let t = 1; t <= 2; t++)
|
|
4410
4469
|
for (let r = t == 1 ? e : this.unplaced.openStart; r >= 0; r--) {
|
|
4411
4470
|
let i, s = null;
|
|
4412
|
-
r ? (s =
|
|
4471
|
+
r ? (s = Yn(this.unplaced.content, r - 1).firstChild, i = s.content) : i = this.unplaced.content;
|
|
4413
4472
|
let o = i.firstChild;
|
|
4414
4473
|
for (let l = this.depth; l >= 0; l--) {
|
|
4415
4474
|
let { type: a, match: c } = this.frontier[l], d, u = null;
|
|
@@ -4423,11 +4482,11 @@ class fa {
|
|
|
4423
4482
|
}
|
|
4424
4483
|
}
|
|
4425
4484
|
openMore() {
|
|
4426
|
-
let { content: e, openStart: t, openEnd: r } = this.unplaced, i =
|
|
4485
|
+
let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Yn(e, t);
|
|
4427
4486
|
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);
|
|
4428
4487
|
}
|
|
4429
4488
|
dropNode() {
|
|
4430
|
-
let { content: e, openStart: t, openEnd: r } = this.unplaced, i =
|
|
4489
|
+
let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Yn(e, t);
|
|
4431
4490
|
if (i.childCount <= 1 && t > 0) {
|
|
4432
4491
|
let s = e.size - t <= t + i.size;
|
|
4433
4492
|
this.unplaced = new k(Ot(e, t - 1, 1), t - 1, s ? t - 1 : r);
|
|
@@ -4468,7 +4527,7 @@ class fa {
|
|
|
4468
4527
|
if (!this.$to.parent.isTextblock)
|
|
4469
4528
|
return -1;
|
|
4470
4529
|
let e = this.frontier[this.depth], t;
|
|
4471
|
-
if (!e.type.isTextblock || !
|
|
4530
|
+
if (!e.type.isTextblock || !Xn(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
|
|
4472
4531
|
return -1;
|
|
4473
4532
|
let { depth: r } = this.$to, i = this.$to.after(r);
|
|
4474
4533
|
for (; r > 1 && i == this.$to.end(--r); )
|
|
@@ -4477,10 +4536,10 @@ class fa {
|
|
|
4477
4536
|
}
|
|
4478
4537
|
findCloseLevel(e) {
|
|
4479
4538
|
e: for (let t = Math.min(this.depth, e.depth); t >= 0; t--) {
|
|
4480
|
-
let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o =
|
|
4539
|
+
let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = Xn(e, t, i, r, s);
|
|
4481
4540
|
if (o) {
|
|
4482
4541
|
for (let l = t - 1; l >= 0; l--) {
|
|
4483
|
-
let { match: a, type: c } = this.frontier[l], d =
|
|
4542
|
+
let { match: a, type: c } = this.frontier[l], d = Xn(e, l, c, a, !0);
|
|
4484
4543
|
if (!d || d.childCount)
|
|
4485
4544
|
continue e;
|
|
4486
4545
|
}
|
|
@@ -4516,7 +4575,7 @@ function Ot(n, e, t) {
|
|
|
4516
4575
|
function Et(n, e, t) {
|
|
4517
4576
|
return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(Et(n.lastChild.content, e - 1, t)));
|
|
4518
4577
|
}
|
|
4519
|
-
function
|
|
4578
|
+
function Yn(n, e) {
|
|
4520
4579
|
for (let t = 0; t < e; t++)
|
|
4521
4580
|
n = n.firstChild.content;
|
|
4522
4581
|
return n;
|
|
@@ -4527,7 +4586,7 @@ function Zs(n, e, t) {
|
|
|
4527
4586
|
let r = n.content;
|
|
4528
4587
|
return e > 1 && (r = r.replaceChild(0, Zs(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(b.empty, !0)))), n.copy(r);
|
|
4529
4588
|
}
|
|
4530
|
-
function
|
|
4589
|
+
function Xn(n, e, t, r, i) {
|
|
4531
4590
|
let s = n.node(e), o = i ? n.indexAfter(e) : n.index(e);
|
|
4532
4591
|
if (o == s.childCount && !t.compatibleContent(s.type))
|
|
4533
4592
|
return null;
|
|
@@ -4793,7 +4852,7 @@ class ba {
|
|
|
4793
4852
|
given `slice`.
|
|
4794
4853
|
*/
|
|
4795
4854
|
replace(e, t = e, r = k.empty) {
|
|
4796
|
-
let i =
|
|
4855
|
+
let i = Bn(this.doc, e, t, r);
|
|
4797
4856
|
return i && this.step(i), this;
|
|
4798
4857
|
}
|
|
4799
4858
|
/**
|
|
@@ -4969,7 +5028,7 @@ class ba {
|
|
|
4969
5028
|
return Fr(this, e, t, r), this;
|
|
4970
5029
|
}
|
|
4971
5030
|
}
|
|
4972
|
-
const
|
|
5031
|
+
const Zn = /* @__PURE__ */ Object.create(null);
|
|
4973
5032
|
class E {
|
|
4974
5033
|
/**
|
|
4975
5034
|
Initialize a selection with the head and anchor and ranges. If no
|
|
@@ -5105,7 +5164,7 @@ class E {
|
|
|
5105
5164
|
static fromJSON(e, t) {
|
|
5106
5165
|
if (!t || !t.type)
|
|
5107
5166
|
throw new RangeError("Invalid input for Selection.fromJSON");
|
|
5108
|
-
let r =
|
|
5167
|
+
let r = Zn[t.type];
|
|
5109
5168
|
if (!r)
|
|
5110
5169
|
throw new RangeError(`No selection type ${t.type} defined`);
|
|
5111
5170
|
return r.fromJSON(e, t);
|
|
@@ -5117,9 +5176,9 @@ class E {
|
|
|
5117
5176
|
clash with classes from other modules.
|
|
5118
5177
|
*/
|
|
5119
5178
|
static jsonID(e, t) {
|
|
5120
|
-
if (e in
|
|
5179
|
+
if (e in Zn)
|
|
5121
5180
|
throw new RangeError("Duplicate use of selection JSON ID " + e);
|
|
5122
|
-
return
|
|
5181
|
+
return Zn[e] = t, t.prototype.jsonID = e, t;
|
|
5123
5182
|
}
|
|
5124
5183
|
/**
|
|
5125
5184
|
Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
|
|
@@ -5178,7 +5237,7 @@ class M extends E {
|
|
|
5178
5237
|
return e instanceof M && e.anchor == this.anchor && e.head == this.head;
|
|
5179
5238
|
}
|
|
5180
5239
|
getBookmark() {
|
|
5181
|
-
return new
|
|
5240
|
+
return new Ln(this.anchor, this.head);
|
|
5182
5241
|
}
|
|
5183
5242
|
toJSON() {
|
|
5184
5243
|
return { type: "text", anchor: this.anchor, head: this.head };
|
|
@@ -5219,12 +5278,12 @@ class M extends E {
|
|
|
5219
5278
|
}
|
|
5220
5279
|
}
|
|
5221
5280
|
E.jsonID("text", M);
|
|
5222
|
-
class
|
|
5281
|
+
class Ln {
|
|
5223
5282
|
constructor(e, t) {
|
|
5224
5283
|
this.anchor = e, this.head = t;
|
|
5225
5284
|
}
|
|
5226
5285
|
map(e) {
|
|
5227
|
-
return new
|
|
5286
|
+
return new Ln(e.map(this.anchor), e.map(this.head));
|
|
5228
5287
|
}
|
|
5229
5288
|
resolve(e) {
|
|
5230
5289
|
return M.between(e.resolve(this.anchor), e.resolve(this.head));
|
|
@@ -5285,7 +5344,7 @@ class Vr {
|
|
|
5285
5344
|
}
|
|
5286
5345
|
map(e) {
|
|
5287
5346
|
let { deleted: t, pos: r } = e.mapResult(this.anchor);
|
|
5288
|
-
return t ? new
|
|
5347
|
+
return t ? new Ln(r, r) : new Vr(r);
|
|
5289
5348
|
}
|
|
5290
5349
|
resolve(e) {
|
|
5291
5350
|
let t = e.resolve(this.anchor), r = t.nodeAfter;
|
|
@@ -5558,7 +5617,7 @@ const Ma = [
|
|
|
5558
5617
|
}
|
|
5559
5618
|
})
|
|
5560
5619
|
];
|
|
5561
|
-
class
|
|
5620
|
+
class Qn {
|
|
5562
5621
|
constructor(e, t) {
|
|
5563
5622
|
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Ma.slice(), t && t.forEach((r) => {
|
|
5564
5623
|
if (this.pluginsByKey[r.key])
|
|
@@ -5659,7 +5718,7 @@ class mt {
|
|
|
5659
5718
|
Create a new state.
|
|
5660
5719
|
*/
|
|
5661
5720
|
static create(e) {
|
|
5662
|
-
let t = new
|
|
5721
|
+
let t = new Qn(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new mt(t);
|
|
5663
5722
|
for (let i = 0; i < t.fields.length; i++)
|
|
5664
5723
|
r[t.fields[i].name] = t.fields[i].init(e, r);
|
|
5665
5724
|
return r;
|
|
@@ -5673,7 +5732,7 @@ class mt {
|
|
|
5673
5732
|
configuration object..
|
|
5674
5733
|
*/
|
|
5675
5734
|
reconfigure(e) {
|
|
5676
|
-
let t = new
|
|
5735
|
+
let t = new Qn(this.schema, e.plugins), r = t.fields, i = new mt(t);
|
|
5677
5736
|
for (let s = 0; s < r.length; s++) {
|
|
5678
5737
|
let o = r[s].name;
|
|
5679
5738
|
i[o] = this.hasOwnProperty(o) ? this[o] : r[s].init(e, i);
|
|
@@ -5710,7 +5769,7 @@ class mt {
|
|
|
5710
5769
|
throw new RangeError("Invalid input for EditorState.fromJSON");
|
|
5711
5770
|
if (!e.schema)
|
|
5712
5771
|
throw new RangeError("Required config field 'schema' missing");
|
|
5713
|
-
let i = new
|
|
5772
|
+
let i = new Qn(e.schema, e.plugins), s = new mt(i);
|
|
5714
5773
|
return i.fields.forEach((o) => {
|
|
5715
5774
|
if (o.name == "doc")
|
|
5716
5775
|
s.doc = Fe.fromJSON(e.schema, t.doc);
|
|
@@ -5753,9 +5812,9 @@ class se {
|
|
|
5753
5812
|
return e[this.key];
|
|
5754
5813
|
}
|
|
5755
5814
|
}
|
|
5756
|
-
const
|
|
5815
|
+
const er = /* @__PURE__ */ Object.create(null);
|
|
5757
5816
|
function no(n) {
|
|
5758
|
-
return n in
|
|
5817
|
+
return n in er ? n + "$" + ++er[n] : (er[n] = 0, n + "$");
|
|
5759
5818
|
}
|
|
5760
5819
|
class we {
|
|
5761
5820
|
/**
|
|
@@ -5786,12 +5845,12 @@ const J = function(n) {
|
|
|
5786
5845
|
let e = n.assignedSlot || n.parentNode;
|
|
5787
5846
|
return e && e.nodeType == 11 ? e.host : e;
|
|
5788
5847
|
};
|
|
5789
|
-
let
|
|
5848
|
+
let Mr = null;
|
|
5790
5849
|
const Te = function(n, e, t) {
|
|
5791
|
-
let r =
|
|
5850
|
+
let r = Mr || (Mr = document.createRange());
|
|
5792
5851
|
return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
|
|
5793
5852
|
}, wa = function() {
|
|
5794
|
-
|
|
5853
|
+
Mr = null;
|
|
5795
5854
|
}, ot = function(n, e, t, r) {
|
|
5796
5855
|
return t && (Ei(n, e, t, r, -1) || Ei(n, e, t, r, 1));
|
|
5797
5856
|
}, Ca = /^(img|br|input|textarea|hr)$/i;
|
|
@@ -5864,7 +5923,7 @@ function Xt(n) {
|
|
|
5864
5923
|
;
|
|
5865
5924
|
return e && e.node && e.node.isBlock && (e.dom == n || e.contentDOM == n);
|
|
5866
5925
|
}
|
|
5867
|
-
const
|
|
5926
|
+
const zn = function(n) {
|
|
5868
5927
|
return n.focusNode && ot(n.focusNode, n.focusOffset, n.anchorNode, n.anchorOffset);
|
|
5869
5928
|
};
|
|
5870
5929
|
function Ue(n, e) {
|
|
@@ -5891,9 +5950,9 @@ function Na(n, e, t) {
|
|
|
5891
5950
|
return { node: r.startContainer, offset: Math.min(fe(r.startContainer), r.startOffset) };
|
|
5892
5951
|
}
|
|
5893
5952
|
}
|
|
5894
|
-
const xe = typeof navigator < "u" ? navigator : null, vi = typeof document < "u" ? document : null, Ke = xe && xe.userAgent || "",
|
|
5953
|
+
const xe = typeof navigator < "u" ? navigator : null, vi = typeof document < "u" ? document : null, Ke = xe && xe.userAgent || "", wr = /Edge\/(\d+)/.exec(Ke), ro = /MSIE \d/.exec(Ke), Cr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ke), ie = !!(ro || Cr || wr), Ve = ro ? document.documentMode : Cr ? +Cr[1] : wr ? +wr[1] : 0, pe = !ie && /gecko\/(\d+)/i.test(Ke);
|
|
5895
5954
|
pe && +(/Firefox\/(\d+)/.exec(Ke) || [0, 0])[1];
|
|
5896
|
-
const
|
|
5955
|
+
const Tr = !ie && /Chrome\/(\d+)/.exec(Ke), _ = !!Tr, io = Tr ? +Tr[1] : 0, Z = !ie && !!xe && /Apple Computer/.test(xe.vendor), St = Z && (/Mobile\/\w+/.test(Ke) || !!xe && xe.maxTouchPoints > 2), ue = St || (xe ? /Mac/.test(xe.platform) : !1), so = xe ? /Win/.test(xe.platform) : !1, Ee = /Android \d/.test(Ke), Zt = !!vi && "webkitFontSmoothing" in vi.documentElement.style, Aa = Zt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
5897
5956
|
function Da(n) {
|
|
5898
5957
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
5899
5958
|
return e ? {
|
|
@@ -6131,14 +6190,14 @@ function uo(n, e, t) {
|
|
|
6131
6190
|
if (s == null && i && (t < 0 || i == fe(r))) {
|
|
6132
6191
|
let a = r.childNodes[i - 1];
|
|
6133
6192
|
if (a.nodeType == 1)
|
|
6134
|
-
return
|
|
6193
|
+
return tr(a.getBoundingClientRect(), !1);
|
|
6135
6194
|
}
|
|
6136
6195
|
if (s == null && i < fe(r)) {
|
|
6137
6196
|
let a = r.childNodes[i];
|
|
6138
6197
|
if (a.nodeType == 1)
|
|
6139
|
-
return
|
|
6198
|
+
return tr(a.getBoundingClientRect(), !0);
|
|
6140
6199
|
}
|
|
6141
|
-
return
|
|
6200
|
+
return tr(r.getBoundingClientRect(), t >= 0);
|
|
6142
6201
|
}
|
|
6143
6202
|
if (s == null && i && (t < 0 || i == fe(r))) {
|
|
6144
6203
|
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;
|
|
@@ -6161,7 +6220,7 @@ function Ct(n, e) {
|
|
|
6161
6220
|
let t = e ? n.left : n.right;
|
|
6162
6221
|
return { top: n.top, bottom: n.bottom, left: t, right: t };
|
|
6163
6222
|
}
|
|
6164
|
-
function
|
|
6223
|
+
function tr(n, e) {
|
|
6165
6224
|
if (n.height == 0)
|
|
6166
6225
|
return n;
|
|
6167
6226
|
let t = e ? n.top : n.bottom;
|
|
@@ -6658,7 +6717,7 @@ class lt extends Qt {
|
|
|
6658
6717
|
}
|
|
6659
6718
|
slice(e, t, r) {
|
|
6660
6719
|
let i = lt.create(this.parent, this.mark, !0, r), s = this.children, o = this.size;
|
|
6661
|
-
t < o && (s =
|
|
6720
|
+
t < o && (s = Er(s, t, o, r)), e > 0 && (s = Er(s, 0, e, r));
|
|
6662
6721
|
for (let l = 0; l < s.length; l++)
|
|
6663
6722
|
s[l].parent = i;
|
|
6664
6723
|
return i.children = s, i;
|
|
@@ -6698,7 +6757,7 @@ class He extends Qt {
|
|
|
6698
6757
|
} else d || ({ dom: d, contentDOM: u } = dt.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
|
|
6699
6758
|
!u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
|
|
6700
6759
|
let f = d;
|
|
6701
|
-
return d = yo(d, r, t), c ? a = new Ua(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new
|
|
6760
|
+
return d = yo(d, r, t), c ? a = new Ua(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Fn(e, t, r, i, d, f, s) : new He(e, t, r, i, d, u || null, f, s, o + 1);
|
|
6702
6761
|
}
|
|
6703
6762
|
parseRule() {
|
|
6704
6763
|
if (this.node.type.spec.reparseInView)
|
|
@@ -6721,7 +6780,7 @@ class He extends Qt {
|
|
|
6721
6780
|
return e;
|
|
6722
6781
|
}
|
|
6723
6782
|
matchesNode(e, t, r) {
|
|
6724
|
-
return this.dirty == me && e.eq(this.node) &&
|
|
6783
|
+
return this.dirty == me && e.eq(this.node) && xn(t, this.outerDeco) && r.eq(this.innerDeco);
|
|
6725
6784
|
}
|
|
6726
6785
|
get size() {
|
|
6727
6786
|
return this.node.nodeSize;
|
|
@@ -6768,7 +6827,7 @@ class He extends Qt {
|
|
|
6768
6827
|
s.pmViewDesc && (s.pmViewDesc = void 0);
|
|
6769
6828
|
}
|
|
6770
6829
|
let o = new Ja(this, s, t, i);
|
|
6771
|
-
e.input.compositionNodes.push(o), this.children =
|
|
6830
|
+
e.input.compositionNodes.push(o), this.children = Er(this.children, r, r + i.length, e, o);
|
|
6772
6831
|
}
|
|
6773
6832
|
// If this desc must be updated to match the given node decoration,
|
|
6774
6833
|
// do so and return true.
|
|
@@ -6779,10 +6838,10 @@ class He extends Qt {
|
|
|
6779
6838
|
this.updateOuterDeco(t), this.node = e, this.innerDeco = r, this.contentDOM && this.updateChildren(i, this.posAtStart), this.dirty = me;
|
|
6780
6839
|
}
|
|
6781
6840
|
updateOuterDeco(e) {
|
|
6782
|
-
if (
|
|
6841
|
+
if (xn(e, this.outerDeco))
|
|
6783
6842
|
return;
|
|
6784
6843
|
let t = this.nodeDOM.nodeType != 1, r = this.dom;
|
|
6785
|
-
this.dom = go(this.dom, this.nodeDOM,
|
|
6844
|
+
this.dom = go(this.dom, this.nodeDOM, Or(this.outerDeco, this.node, t), Or(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
|
|
6786
6845
|
}
|
|
6787
6846
|
// Mark this node as being the selected node.
|
|
6788
6847
|
selectNode() {
|
|
@@ -6801,7 +6860,7 @@ function Bi(n, e, t, r, i) {
|
|
|
6801
6860
|
let s = new He(void 0, n, e, t, r, r, r, i, 0);
|
|
6802
6861
|
return s.contentDOM && s.updateChildren(i, 0), s;
|
|
6803
6862
|
}
|
|
6804
|
-
class
|
|
6863
|
+
class Fn extends He {
|
|
6805
6864
|
constructor(e, t, r, i, s, o, l) {
|
|
6806
6865
|
super(e, t, r, i, s, null, o, l, 0);
|
|
6807
6866
|
}
|
|
@@ -6832,7 +6891,7 @@ class Ln extends He {
|
|
|
6832
6891
|
}
|
|
6833
6892
|
slice(e, t, r) {
|
|
6834
6893
|
let i = this.node.cut(e, t), s = document.createTextNode(i.text);
|
|
6835
|
-
return new
|
|
6894
|
+
return new Fn(this.parent, i, this.outerDeco, this.innerDeco, s, s, r);
|
|
6836
6895
|
}
|
|
6837
6896
|
markDirty(e, t) {
|
|
6838
6897
|
super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Se);
|
|
@@ -6916,7 +6975,7 @@ const Dt = function(n) {
|
|
|
6916
6975
|
};
|
|
6917
6976
|
Dt.prototype = /* @__PURE__ */ Object.create(null);
|
|
6918
6977
|
const Ye = [new Dt()];
|
|
6919
|
-
function
|
|
6978
|
+
function Or(n, e, t) {
|
|
6920
6979
|
if (n.length == 0)
|
|
6921
6980
|
return Ye;
|
|
6922
6981
|
let r = t ? Ye[0] : new Dt(), i = [r];
|
|
@@ -6969,9 +7028,9 @@ function _a(n, e, t) {
|
|
|
6969
7028
|
}
|
|
6970
7029
|
}
|
|
6971
7030
|
function yo(n, e, t) {
|
|
6972
|
-
return go(n, n, Ye,
|
|
7031
|
+
return go(n, n, Ye, Or(e, t, n.nodeType != 1));
|
|
6973
7032
|
}
|
|
6974
|
-
function
|
|
7033
|
+
function xn(n, e) {
|
|
6975
7034
|
if (n.length != e.length)
|
|
6976
7035
|
return !1;
|
|
6977
7036
|
for (let t = 0; t < n.length; t++)
|
|
@@ -7074,7 +7133,7 @@ class Ga {
|
|
|
7074
7133
|
let c = this.preMatch.matched.get(a);
|
|
7075
7134
|
if (c != null && c != s)
|
|
7076
7135
|
return !1;
|
|
7077
|
-
let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != Se &&
|
|
7136
|
+
let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != Se && xn(t, a.outerDeco));
|
|
7078
7137
|
if (!f && a.update(e, t, r, i))
|
|
7079
7138
|
return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
|
|
7080
7139
|
if (!f && (u = this.recreateWrapper(a, e, t, r, i, o)))
|
|
@@ -7087,7 +7146,7 @@ class Ga {
|
|
|
7087
7146
|
// When a node with content is replaced by a different node with
|
|
7088
7147
|
// identical content, move over its children.
|
|
7089
7148
|
recreateWrapper(e, t, r, i, s, o) {
|
|
7090
|
-
if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !
|
|
7149
|
+
if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !xn(r, e.outerDeco) || !i.eq(e.innerDeco))
|
|
7091
7150
|
return null;
|
|
7092
7151
|
let l = He.create(this.top, t, r, i, s, o);
|
|
7093
7152
|
if (l.contentDOM) {
|
|
@@ -7118,7 +7177,7 @@ class Ga {
|
|
|
7118
7177
|
for (; e instanceof lt; )
|
|
7119
7178
|
t = e, e = t.children[t.children.length - 1];
|
|
7120
7179
|
(!e || // Empty textblock
|
|
7121
|
-
!(e instanceof
|
|
7180
|
+
!(e instanceof Fn) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((Z || _) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
|
|
7122
7181
|
}
|
|
7123
7182
|
addHackNode(e, t) {
|
|
7124
7183
|
if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))
|
|
@@ -7242,7 +7301,7 @@ function ec(n, e, t, r) {
|
|
|
7242
7301
|
}
|
|
7243
7302
|
return -1;
|
|
7244
7303
|
}
|
|
7245
|
-
function
|
|
7304
|
+
function Er(n, e, t, r, i) {
|
|
7246
7305
|
let s = [];
|
|
7247
7306
|
for (let o = 0, l = 0; o < n.length; o++) {
|
|
7248
7307
|
let a = n[o], c = l, d = l += a.size;
|
|
@@ -7258,7 +7317,7 @@ function Wr(n, e = null) {
|
|
|
7258
7317
|
if (o < 0)
|
|
7259
7318
|
return null;
|
|
7260
7319
|
let l = r.resolve(o), a, c;
|
|
7261
|
-
if (
|
|
7320
|
+
if (zn(t)) {
|
|
7262
7321
|
for (a = o; i && !i.node; )
|
|
7263
7322
|
i = i.parent;
|
|
7264
7323
|
let u = i.node;
|
|
@@ -7314,15 +7373,15 @@ const zi = Z || _ && io < 63;
|
|
|
7314
7373
|
function Fi(n, e) {
|
|
7315
7374
|
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;
|
|
7316
7375
|
if (Z && i && i.contentEditable == "false")
|
|
7317
|
-
return
|
|
7376
|
+
return nr(i);
|
|
7318
7377
|
if ((!i || i.contentEditable == "false") && (!s || s.contentEditable == "false")) {
|
|
7319
7378
|
if (i)
|
|
7320
|
-
return
|
|
7379
|
+
return nr(i);
|
|
7321
7380
|
if (s)
|
|
7322
|
-
return
|
|
7381
|
+
return nr(s);
|
|
7323
7382
|
}
|
|
7324
7383
|
}
|
|
7325
|
-
function
|
|
7384
|
+
function nr(n) {
|
|
7326
7385
|
return n.contentEditable = "true", Z && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
|
|
7327
7386
|
}
|
|
7328
7387
|
function $i(n) {
|
|
@@ -7375,7 +7434,7 @@ function rc(n) {
|
|
|
7375
7434
|
let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
|
|
7376
7435
|
return ot(e.node, e.offset, t.anchorNode, t.anchorOffset);
|
|
7377
7436
|
}
|
|
7378
|
-
function
|
|
7437
|
+
function vr(n, e) {
|
|
7379
7438
|
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;
|
|
7380
7439
|
return s && E.findFrom(s, e);
|
|
7381
7440
|
}
|
|
@@ -7393,7 +7452,7 @@ function Wi(n, e, t) {
|
|
|
7393
7452
|
return Ie(n, new M(r.$anchor, o));
|
|
7394
7453
|
} else if (r.empty) {
|
|
7395
7454
|
if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
|
|
7396
|
-
let i =
|
|
7455
|
+
let i = vr(n.state, e);
|
|
7397
7456
|
return i && i instanceof S ? Ie(n, i) : !1;
|
|
7398
7457
|
} else if (!(ue && t.indexOf("m") > -1)) {
|
|
7399
7458
|
let i = r.$head, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, o;
|
|
@@ -7407,12 +7466,12 @@ function Wi(n, e, t) {
|
|
|
7407
7466
|
if (r instanceof S && r.node.isInline)
|
|
7408
7467
|
return Ie(n, new M(e > 0 ? r.$to : r.$from));
|
|
7409
7468
|
{
|
|
7410
|
-
let i =
|
|
7469
|
+
let i = vr(n.state, e);
|
|
7411
7470
|
return i ? Ie(n, i) : !1;
|
|
7412
7471
|
}
|
|
7413
7472
|
}
|
|
7414
7473
|
}
|
|
7415
|
-
function
|
|
7474
|
+
function Sn(n) {
|
|
7416
7475
|
return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
|
|
7417
7476
|
}
|
|
7418
7477
|
function It(n, e) {
|
|
@@ -7427,7 +7486,7 @@ function ic(n) {
|
|
|
7427
7486
|
if (!t)
|
|
7428
7487
|
return;
|
|
7429
7488
|
let i, s, o = !1;
|
|
7430
|
-
for (pe && t.nodeType == 1 && r <
|
|
7489
|
+
for (pe && t.nodeType == 1 && r < Sn(t) && It(t.childNodes[r], -1) && (o = !0); ; )
|
|
7431
7490
|
if (r > 0) {
|
|
7432
7491
|
if (t.nodeType != 1)
|
|
7433
7492
|
break;
|
|
@@ -7448,7 +7507,7 @@ function ic(n) {
|
|
|
7448
7507
|
for (; l && It(l, -1); )
|
|
7449
7508
|
i = t.parentNode, s = J(l), l = l.previousSibling;
|
|
7450
7509
|
if (l)
|
|
7451
|
-
t = l, r =
|
|
7510
|
+
t = l, r = Sn(t);
|
|
7452
7511
|
else {
|
|
7453
7512
|
if (t = t.parentNode, t == n.dom)
|
|
7454
7513
|
break;
|
|
@@ -7456,13 +7515,13 @@ function ic(n) {
|
|
|
7456
7515
|
}
|
|
7457
7516
|
}
|
|
7458
7517
|
}
|
|
7459
|
-
o ?
|
|
7518
|
+
o ? Nr(n, t, r) : i && Nr(n, i, s);
|
|
7460
7519
|
}
|
|
7461
7520
|
function sc(n) {
|
|
7462
7521
|
let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
|
|
7463
7522
|
if (!t)
|
|
7464
7523
|
return;
|
|
7465
|
-
let i =
|
|
7524
|
+
let i = Sn(t), s, o;
|
|
7466
7525
|
for (; ; )
|
|
7467
7526
|
if (r < i) {
|
|
7468
7527
|
if (t.nodeType != 1)
|
|
@@ -7480,7 +7539,7 @@ function sc(n) {
|
|
|
7480
7539
|
for (; l && It(l, 1); )
|
|
7481
7540
|
s = l.parentNode, o = J(l) + 1, l = l.nextSibling;
|
|
7482
7541
|
if (l)
|
|
7483
|
-
t = l, r = 0, i =
|
|
7542
|
+
t = l, r = 0, i = Sn(t);
|
|
7484
7543
|
else {
|
|
7485
7544
|
if (t = t.parentNode, t == n.dom)
|
|
7486
7545
|
break;
|
|
@@ -7488,7 +7547,7 @@ function sc(n) {
|
|
|
7488
7547
|
}
|
|
7489
7548
|
}
|
|
7490
7549
|
}
|
|
7491
|
-
s &&
|
|
7550
|
+
s && Nr(n, s, o);
|
|
7492
7551
|
}
|
|
7493
7552
|
function So(n) {
|
|
7494
7553
|
let e = n.pmViewDesc;
|
|
@@ -7518,7 +7577,7 @@ function lc(n, e) {
|
|
|
7518
7577
|
n = t, e = n.childNodes.length;
|
|
7519
7578
|
}
|
|
7520
7579
|
}
|
|
7521
|
-
function
|
|
7580
|
+
function Nr(n, e, t) {
|
|
7522
7581
|
if (e.nodeType != 3) {
|
|
7523
7582
|
let s, o;
|
|
7524
7583
|
(o = oc(e, t)) ? (e = o, t = 0) : (s = lc(e, t)) && (e = s, t = s.nodeValue.length);
|
|
@@ -7526,7 +7585,7 @@ function Er(n, e, t) {
|
|
|
7526
7585
|
let r = n.domSelection();
|
|
7527
7586
|
if (!r)
|
|
7528
7587
|
return;
|
|
7529
|
-
if (
|
|
7588
|
+
if (zn(r)) {
|
|
7530
7589
|
let s = document.createRange();
|
|
7531
7590
|
s.setEnd(e, t), s.setStart(e, t), r.removeAllRanges(), r.addRange(s);
|
|
7532
7591
|
} else r.extend && r.extend(e, t);
|
|
@@ -7559,7 +7618,7 @@ function ji(n, e, t) {
|
|
|
7559
7618
|
return !1;
|
|
7560
7619
|
let { $from: i, $to: s } = r;
|
|
7561
7620
|
if (!i.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
|
|
7562
|
-
let o =
|
|
7621
|
+
let o = vr(n.state, e);
|
|
7563
7622
|
if (o && o instanceof S)
|
|
7564
7623
|
return Ie(n, o);
|
|
7565
7624
|
}
|
|
@@ -7756,12 +7815,12 @@ function To(n, e) {
|
|
|
7756
7815
|
let t = n.content.replaceChild(n.childCount - 1, To(n.lastChild, e - 1)), r = n.contentMatchAt(n.childCount).fillBefore(b.empty, !0);
|
|
7757
7816
|
return n.copy(t.append(r));
|
|
7758
7817
|
}
|
|
7759
|
-
function
|
|
7818
|
+
function Ar(n, e, t, r, i, s) {
|
|
7760
7819
|
let o = e < 0 ? n.firstChild : n.lastChild, l = o.content;
|
|
7761
|
-
return n.childCount > 1 && (s = 0), i < r - 1 && (l =
|
|
7820
|
+
return n.childCount > 1 && (s = 0), i < r - 1 && (l = Ar(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));
|
|
7762
7821
|
}
|
|
7763
7822
|
function Ui(n, e, t) {
|
|
7764
|
-
return e < n.openStart && (n = new k(
|
|
7823
|
+
return e < n.openStart && (n = new k(Ar(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new k(Ar(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
|
|
7765
7824
|
}
|
|
7766
7825
|
const Oo = {
|
|
7767
7826
|
thead: ["table"],
|
|
@@ -7778,10 +7837,10 @@ let _i = null;
|
|
|
7778
7837
|
function Eo() {
|
|
7779
7838
|
return _i || (_i = document.implementation.createHTMLDocument("title"));
|
|
7780
7839
|
}
|
|
7781
|
-
let
|
|
7840
|
+
let rr = null;
|
|
7782
7841
|
function hc(n) {
|
|
7783
7842
|
let e = window.trustedTypes;
|
|
7784
|
-
return e ? (
|
|
7843
|
+
return e ? (rr || (rr = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), rr.createHTML(n)) : n;
|
|
7785
7844
|
}
|
|
7786
7845
|
function pc(n) {
|
|
7787
7846
|
let e = /^(\s*<meta [^>]*>)*/.exec(n);
|
|
@@ -7830,7 +7889,7 @@ function kc(n) {
|
|
|
7830
7889
|
Sc(n, r) && !Kr(n, r) && (n.editable || !(r.type in te)) && t(n, r);
|
|
7831
7890
|
}, yc[e] ? { passive: !0 } : void 0);
|
|
7832
7891
|
}
|
|
7833
|
-
Z && n.dom.addEventListener("input", () => null),
|
|
7892
|
+
Z && n.dom.addEventListener("input", () => null), Dr(n);
|
|
7834
7893
|
}
|
|
7835
7894
|
function ze(n, e) {
|
|
7836
7895
|
n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
|
|
@@ -7841,7 +7900,7 @@ function xc(n) {
|
|
|
7841
7900
|
n.dom.removeEventListener(e, n.input.eventHandlers[e]);
|
|
7842
7901
|
clearTimeout(n.input.composingTimeout), clearTimeout(n.input.lastIOSEnterFallbackTimeout);
|
|
7843
7902
|
}
|
|
7844
|
-
function
|
|
7903
|
+
function Dr(n) {
|
|
7845
7904
|
n.someProp("handleDOMEvents", (e) => {
|
|
7846
7905
|
for (let t in e)
|
|
7847
7906
|
n.input.eventHandlers[t] || n.dom.addEventListener(t, n.input.eventHandlers[t] = (r) => Kr(n, r));
|
|
@@ -7893,7 +7952,7 @@ te.keypress = (n, e) => {
|
|
|
7893
7952
|
!/[\r\n]/.test(i) && !n.someProp("handleTextInput", (o) => o(n, r.$from.pos, r.$to.pos, i, s)) && n.dispatch(s()), t.preventDefault();
|
|
7894
7953
|
}
|
|
7895
7954
|
};
|
|
7896
|
-
function
|
|
7955
|
+
function $n(n) {
|
|
7897
7956
|
return { left: n.clientX, top: n.clientY };
|
|
7898
7957
|
}
|
|
7899
7958
|
function wc(n, e) {
|
|
@@ -7964,7 +8023,7 @@ function Nc(n, e, t) {
|
|
|
7964
8023
|
}
|
|
7965
8024
|
}
|
|
7966
8025
|
function Ur(n) {
|
|
7967
|
-
return
|
|
8026
|
+
return Mn(n);
|
|
7968
8027
|
}
|
|
7969
8028
|
const vo = ue ? "metaKey" : "ctrlKey";
|
|
7970
8029
|
ee.mousedown = (n, e) => {
|
|
@@ -7972,7 +8031,7 @@ ee.mousedown = (n, e) => {
|
|
|
7972
8031
|
n.input.shiftKey = t.shiftKey;
|
|
7973
8032
|
let r = Ur(n), i = Date.now(), s = "singleClick";
|
|
7974
8033
|
i - n.input.lastClick.time < 500 && wc(t, n.input.lastClick) && !t[vo] && 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 };
|
|
7975
|
-
let o = n.posAtCoords(
|
|
8034
|
+
let o = n.posAtCoords($n(t));
|
|
7976
8035
|
o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Ac(n, o, t, !!r)) : (s == "doubleClick" ? Ec : vc)(n, o.pos, o.inside, t) ? t.preventDefault() : ze(n, "pointer"));
|
|
7977
8036
|
};
|
|
7978
8037
|
class Ac {
|
|
@@ -8004,7 +8063,7 @@ class Ac {
|
|
|
8004
8063
|
if (this.done(), !this.view.dom.contains(e.target))
|
|
8005
8064
|
return;
|
|
8006
8065
|
let t = this.pos;
|
|
8007
|
-
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(
|
|
8066
|
+
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords($n(e))), this.updateAllowDefault(e), this.allowDefault || !t ? ze(this.view, "pointer") : Oc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
8008
8067
|
Z && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
8009
8068
|
// cursor, but still report that the node is selected
|
|
8010
8069
|
// when asked through getSelection. You'll then get a
|
|
@@ -8037,8 +8096,8 @@ te.compositionstart = te.compositionupdate = (n) => {
|
|
|
8037
8096
|
n.domObserver.flush();
|
|
8038
8097
|
let { state: e } = n, t = e.selection.$to;
|
|
8039
8098
|
if (e.selection instanceof M && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || _ && so && Ic(n)))
|
|
8040
|
-
n.markCursor = n.state.storedMarks || t.marks(),
|
|
8041
|
-
else if (
|
|
8099
|
+
n.markCursor = n.state.storedMarks || t.marks(), Mn(n, !0), n.markCursor = null;
|
|
8100
|
+
else if (Mn(n, !e.selection.empty), pe && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
|
|
8042
8101
|
let r = n.domSelectionRange();
|
|
8043
8102
|
for (let i = r.focusNode, s = r.focusOffset; i && i.nodeType == 1 && s != 0; ) {
|
|
8044
8103
|
let o = s < 0 ? i.lastChild : i.childNodes[s - 1];
|
|
@@ -8067,7 +8126,7 @@ te.compositionend = (n, e) => {
|
|
|
8067
8126
|
n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.badSafariComposition ? n.domObserver.forceFlush() : n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, Ao(n, 20));
|
|
8068
8127
|
};
|
|
8069
8128
|
function Ao(n, e) {
|
|
8070
|
-
clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() =>
|
|
8129
|
+
clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => Mn(n), e));
|
|
8071
8130
|
}
|
|
8072
8131
|
function Do(n) {
|
|
8073
8132
|
for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Pc()); n.input.compositionNodes.length > 0; )
|
|
@@ -8096,7 +8155,7 @@ function Pc() {
|
|
|
8096
8155
|
let n = document.createEvent("Event");
|
|
8097
8156
|
return n.initEvent("event", !0, !0), n.timeStamp;
|
|
8098
8157
|
}
|
|
8099
|
-
function
|
|
8158
|
+
function Mn(n, e = !1) {
|
|
8100
8159
|
if (!(Ee && n.domObserver.flushingSoon >= 0)) {
|
|
8101
8160
|
if (n.domObserver.forceFlush(), Do(n), e || n.docView && n.docView.dirty) {
|
|
8102
8161
|
let t = Wr(n), r = n.state.selection;
|
|
@@ -8175,7 +8234,7 @@ ee.dragstart = (n, e) => {
|
|
|
8175
8234
|
let t = e, r = n.input.mouseDown;
|
|
8176
8235
|
if (r && r.done(), !t.dataTransfer)
|
|
8177
8236
|
return;
|
|
8178
|
-
let i = n.state.selection, s = i.empty ? null : n.posAtCoords(
|
|
8237
|
+
let i = n.state.selection, s = i.empty ? null : n.posAtCoords($n(t)), o;
|
|
8179
8238
|
if (!(s && s.pos >= i.from && s.pos <= (i instanceof S ? i.to - 1 : i.to))) {
|
|
8180
8239
|
if (r && r.mightDrag)
|
|
8181
8240
|
o = S.create(n.state.doc, r.mightDrag.pos);
|
|
@@ -8204,7 +8263,7 @@ te.drop = (n, e) => {
|
|
|
8204
8263
|
function $c(n, e, t) {
|
|
8205
8264
|
if (!e.dataTransfer)
|
|
8206
8265
|
return;
|
|
8207
|
-
let r = n.posAtCoords(
|
|
8266
|
+
let r = n.posAtCoords($n(e));
|
|
8208
8267
|
if (!r)
|
|
8209
8268
|
return;
|
|
8210
8269
|
let i = n.state.doc.resolve(r.pos), s = t && t.slice;
|
|
@@ -8272,7 +8331,7 @@ function Vt(n, e) {
|
|
|
8272
8331
|
return !1;
|
|
8273
8332
|
return !0;
|
|
8274
8333
|
}
|
|
8275
|
-
class
|
|
8334
|
+
class wn {
|
|
8276
8335
|
constructor(e, t) {
|
|
8277
8336
|
this.toDOM = e, this.spec = t || tt, this.side = this.spec.side || 0;
|
|
8278
8337
|
}
|
|
@@ -8284,7 +8343,7 @@ class Sn {
|
|
|
8284
8343
|
return !0;
|
|
8285
8344
|
}
|
|
8286
8345
|
eq(e) {
|
|
8287
|
-
return this == e || e instanceof
|
|
8346
|
+
return this == e || e instanceof wn && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Vt(this.spec, e.spec));
|
|
8288
8347
|
}
|
|
8289
8348
|
destroy(e) {
|
|
8290
8349
|
this.spec.destroy && this.spec.destroy(e);
|
|
@@ -8365,7 +8424,7 @@ class he {
|
|
|
8365
8424
|
widget's current document position.
|
|
8366
8425
|
*/
|
|
8367
8426
|
static widget(e, t, r) {
|
|
8368
|
-
return new he(e, e, new
|
|
8427
|
+
return new he(e, e, new wn(t, r));
|
|
8369
8428
|
}
|
|
8370
8429
|
/**
|
|
8371
8430
|
Creates an inline decoration, which adds the given attributes to
|
|
@@ -8399,7 +8458,7 @@ class he {
|
|
|
8399
8458
|
@internal
|
|
8400
8459
|
*/
|
|
8401
8460
|
get widget() {
|
|
8402
|
-
return this.type instanceof
|
|
8461
|
+
return this.type instanceof wn;
|
|
8403
8462
|
}
|
|
8404
8463
|
}
|
|
8405
8464
|
const pt = [], tt = {};
|
|
@@ -8416,7 +8475,7 @@ class z {
|
|
|
8416
8475
|
you must make a copy if you want need to preserve that.
|
|
8417
8476
|
*/
|
|
8418
8477
|
static create(e, t) {
|
|
8419
|
-
return t.length ?
|
|
8478
|
+
return t.length ? Cn(t, e, 0, tt) : X;
|
|
8420
8479
|
}
|
|
8421
8480
|
/**
|
|
8422
8481
|
Find all decorations in this set which touch the given range
|
|
@@ -8475,7 +8534,7 @@ class z {
|
|
|
8475
8534
|
if (d = Lo(t, l, c)) {
|
|
8476
8535
|
for (i || (i = this.children.slice()); s < i.length && i[s] < a; )
|
|
8477
8536
|
s += 3;
|
|
8478
|
-
i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize,
|
|
8537
|
+
i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize, Cn(d, l, c + 1, tt)), s += 3;
|
|
8479
8538
|
}
|
|
8480
8539
|
});
|
|
8481
8540
|
let o = Bo(s ? zo(t) : t, -r);
|
|
@@ -8671,7 +8730,7 @@ function Vc(n, e, t, r, i, s, o) {
|
|
|
8671
8730
|
a = !0;
|
|
8672
8731
|
}
|
|
8673
8732
|
if (a) {
|
|
8674
|
-
let c = Hc(l, n, e, t, i, s, o), d =
|
|
8733
|
+
let c = Hc(l, n, e, t, i, s, o), d = Cn(c, r, 0, o);
|
|
8675
8734
|
e = d.local;
|
|
8676
8735
|
for (let u = 0; u < l.length; u += 3)
|
|
8677
8736
|
l[u + 1] < 0 && (l.splice(u, 3), u -= 3);
|
|
@@ -8721,13 +8780,13 @@ function zo(n) {
|
|
|
8721
8780
|
n[t] != null && e.push(n[t]);
|
|
8722
8781
|
return e;
|
|
8723
8782
|
}
|
|
8724
|
-
function
|
|
8783
|
+
function Cn(n, e, t, r) {
|
|
8725
8784
|
let i = [], s = !1;
|
|
8726
8785
|
e.forEach((l, a) => {
|
|
8727
8786
|
let c = Lo(n, l, a + t);
|
|
8728
8787
|
if (c) {
|
|
8729
8788
|
s = !0;
|
|
8730
|
-
let d =
|
|
8789
|
+
let d = Cn(c, l, t + a + 1, r);
|
|
8731
8790
|
d != X && i.push(a, a + l.nodeSize, d);
|
|
8732
8791
|
}
|
|
8733
8792
|
});
|
|
@@ -8762,7 +8821,7 @@ function Gi(n, e, t) {
|
|
|
8762
8821
|
e++;
|
|
8763
8822
|
n.splice(e, 0, t);
|
|
8764
8823
|
}
|
|
8765
|
-
function
|
|
8824
|
+
function ir(n) {
|
|
8766
8825
|
let e = [];
|
|
8767
8826
|
return n.someProp("decorations", (t) => {
|
|
8768
8827
|
let r = t(n.state);
|
|
@@ -8910,7 +8969,7 @@ class Kc {
|
|
|
8910
8969
|
}
|
|
8911
8970
|
}
|
|
8912
8971
|
let c = null;
|
|
8913
|
-
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 &&
|
|
8972
|
+
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && zn(r) && (c = Wr(e)) && c.eq(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, Gc(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));
|
|
8914
8973
|
}
|
|
8915
8974
|
registerMutation(e, t) {
|
|
8916
8975
|
if (t.indexOf(e.target) > -1)
|
|
@@ -9000,7 +9059,7 @@ function Gc(n, e) {
|
|
|
9000
9059
|
}
|
|
9001
9060
|
function Yc(n, e, t) {
|
|
9002
9061
|
let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
|
|
9003
|
-
if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }],
|
|
9062
|
+
if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], zn(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), _ && n.input.lastKeyCode === 8)
|
|
9004
9063
|
for (let g = s; g > i; g--) {
|
|
9005
9064
|
let y = r.childNodes[g - 1], T = y.pmViewDesc;
|
|
9006
9065
|
if (y.nodeName == "BR" && !T) {
|
|
@@ -9143,7 +9202,7 @@ function td(n, e, t, r, i) {
|
|
|
9143
9202
|
if (
|
|
9144
9203
|
// The content must have shrunk
|
|
9145
9204
|
t - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
|
|
9146
|
-
|
|
9205
|
+
sr(r, !0, !1) < i.pos
|
|
9147
9206
|
)
|
|
9148
9207
|
return !1;
|
|
9149
9208
|
let s = n.resolve(e);
|
|
@@ -9153,10 +9212,10 @@ function td(n, e, t, r, i) {
|
|
|
9153
9212
|
}
|
|
9154
9213
|
if (s.parentOffset < s.parent.content.size || !s.parent.isTextblock)
|
|
9155
9214
|
return !1;
|
|
9156
|
-
let o = n.resolve(
|
|
9157
|
-
return !o.parent.isTextblock || o.pos > t ||
|
|
9215
|
+
let o = n.resolve(sr(s, !0, !0));
|
|
9216
|
+
return !o.parent.isTextblock || o.pos > t || sr(o, !0, !1) < t ? !1 : r.parent.content.cut(r.parentOffset).eq(o.parent.content);
|
|
9158
9217
|
}
|
|
9159
|
-
function
|
|
9218
|
+
function sr(n, e, t) {
|
|
9160
9219
|
let r = n.depth, i = e ? n.end() : n.pos;
|
|
9161
9220
|
for (; r > 0 && (e || n.indexAfter(r) == n.node(r).childCount); )
|
|
9162
9221
|
r--, i++, e = !1;
|
|
@@ -9200,7 +9259,7 @@ class Fo {
|
|
|
9200
9259
|
added to the document.
|
|
9201
9260
|
*/
|
|
9202
9261
|
constructor(e, t) {
|
|
9203
|
-
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 bc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ss), 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 = rs(this), ns(this), this.nodeViews = is(this), this.docView = Bi(this.state.doc, ts(this),
|
|
9262
|
+
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 bc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ss), 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 = rs(this), ns(this), this.nodeViews = is(this), this.docView = Bi(this.state.doc, ts(this), ir(this), this.dom, this), this.domObserver = new Kc(this, (r, i, s, o) => Qc(this, r, i, s, o)), this.domObserver.start(), kc(this), this.updatePluginViews();
|
|
9204
9263
|
}
|
|
9205
9264
|
/**
|
|
9206
9265
|
Holds `true` when a
|
|
@@ -9228,7 +9287,7 @@ class Fo {
|
|
|
9228
9287
|
the DOM.
|
|
9229
9288
|
*/
|
|
9230
9289
|
update(e) {
|
|
9231
|
-
e.handleDOMEvents != this._props.handleDOMEvents &&
|
|
9290
|
+
e.handleDOMEvents != this._props.handleDOMEvents && Dr(this);
|
|
9232
9291
|
let t = this._props;
|
|
9233
9292
|
this._props = e, e.plugins && (e.plugins.forEach(ss), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);
|
|
9234
9293
|
}
|
|
@@ -9262,8 +9321,8 @@ class Fo {
|
|
|
9262
9321
|
let h = is(this);
|
|
9263
9322
|
id(h, this.nodeViews) && (this.nodeViews = h, s = !0);
|
|
9264
9323
|
}
|
|
9265
|
-
(l || t.handleDOMEvents != this._props.handleDOMEvents) &&
|
|
9266
|
-
let a =
|
|
9324
|
+
(l || t.handleDOMEvents != this._props.handleDOMEvents) && Dr(this), this.editable = rs(this), ns(this);
|
|
9325
|
+
let a = ir(this), c = ts(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);
|
|
9267
9326
|
(u || !e.selection.eq(i.selection)) && (o = !0);
|
|
9268
9327
|
let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Ra(this);
|
|
9269
9328
|
if (o) {
|
|
@@ -9493,7 +9552,7 @@ class Fo {
|
|
|
9493
9552
|
views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
9494
9553
|
*/
|
|
9495
9554
|
destroy() {
|
|
9496
|
-
this.docView && (xc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [],
|
|
9555
|
+
this.docView && (xc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], ir(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, wa());
|
|
9497
9556
|
}
|
|
9498
9557
|
/**
|
|
9499
9558
|
This is true when the view has been
|
|
@@ -9625,7 +9684,7 @@ var qe = {
|
|
|
9625
9684
|
220: "\\",
|
|
9626
9685
|
221: "]",
|
|
9627
9686
|
222: "'"
|
|
9628
|
-
},
|
|
9687
|
+
}, Tn = {
|
|
9629
9688
|
48: ")",
|
|
9630
9689
|
49: "!",
|
|
9631
9690
|
50: "@",
|
|
@@ -9654,10 +9713,10 @@ var qe = {
|
|
|
9654
9713
|
for (var U = 0; U < 10; U++) qe[48 + U] = qe[96 + U] = String(U);
|
|
9655
9714
|
for (var U = 1; U <= 24; U++) qe[U + 111] = "F" + U;
|
|
9656
9715
|
for (var U = 65; U <= 90; U++)
|
|
9657
|
-
qe[U] = String.fromCharCode(U + 32),
|
|
9658
|
-
for (var
|
|
9716
|
+
qe[U] = String.fromCharCode(U + 32), Tn[U] = String.fromCharCode(U);
|
|
9717
|
+
for (var or in qe) Tn.hasOwnProperty(or) || (Tn[or] = qe[or]);
|
|
9659
9718
|
function ld(n) {
|
|
9660
|
-
var e = sd && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || od && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ?
|
|
9719
|
+
var e = sd && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || od && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? Tn : qe)[n.keyCode] || n.key || "Unidentified";
|
|
9661
9720
|
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;
|
|
9662
9721
|
}
|
|
9663
9722
|
const ad = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), cd = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
@@ -9688,7 +9747,7 @@ function ud(n) {
|
|
|
9688
9747
|
e[dd(t)] = n[t];
|
|
9689
9748
|
return e;
|
|
9690
9749
|
}
|
|
9691
|
-
function
|
|
9750
|
+
function lr(n, e, t = !0) {
|
|
9692
9751
|
return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
|
|
9693
9752
|
}
|
|
9694
9753
|
function fd(n) {
|
|
@@ -9697,18 +9756,18 @@ function fd(n) {
|
|
|
9697
9756
|
function $o(n) {
|
|
9698
9757
|
let e = ud(n);
|
|
9699
9758
|
return function(t, r) {
|
|
9700
|
-
let i = ld(r), s, o = e[
|
|
9759
|
+
let i = ld(r), s, o = e[lr(i, r)];
|
|
9701
9760
|
if (o && o(t.state, t.dispatch, t))
|
|
9702
9761
|
return !0;
|
|
9703
9762
|
if (i.length == 1 && i != " ") {
|
|
9704
9763
|
if (r.shiftKey) {
|
|
9705
|
-
let l = e[
|
|
9764
|
+
let l = e[lr(i, r, !1)];
|
|
9706
9765
|
if (l && l(t.state, t.dispatch, t))
|
|
9707
9766
|
return !0;
|
|
9708
9767
|
}
|
|
9709
9768
|
if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
|
|
9710
9769
|
!(cd && r.ctrlKey && r.altKey) && (s = qe[r.keyCode]) && s != i) {
|
|
9711
|
-
let l = e[
|
|
9770
|
+
let l = e[lr(s, r)];
|
|
9712
9771
|
if (l && l(t.state, t.dispatch, t))
|
|
9713
9772
|
return !0;
|
|
9714
9773
|
}
|
|
@@ -9735,7 +9794,7 @@ const Ho = (n, e, t) => {
|
|
|
9735
9794
|
return !0;
|
|
9736
9795
|
if (r.parent.content.size == 0 && (Mt(s, "end") || S.isSelectable(s)))
|
|
9737
9796
|
for (let o = r.depth; ; o--) {
|
|
9738
|
-
let l =
|
|
9797
|
+
let l = Bn(n.doc, r.before(o), r.after(o), k.empty);
|
|
9739
9798
|
if (l && l.slice.size < l.to - l.from) {
|
|
9740
9799
|
if (e) {
|
|
9741
9800
|
let a = n.tr.step(l);
|
|
@@ -9779,7 +9838,7 @@ function Wo(n, e, t) {
|
|
|
9779
9838
|
return !1;
|
|
9780
9839
|
l = d;
|
|
9781
9840
|
}
|
|
9782
|
-
let c =
|
|
9841
|
+
let c = Bn(n.doc, s, a, k.empty);
|
|
9783
9842
|
if (!c || c.from != s || c instanceof P && c.slice.size >= a - s)
|
|
9784
9843
|
return !1;
|
|
9785
9844
|
if (t) {
|
|
@@ -9834,7 +9893,7 @@ const Ko = (n, e, t) => {
|
|
|
9834
9893
|
if (Yo(n, i, e, 1))
|
|
9835
9894
|
return !0;
|
|
9836
9895
|
if (r.parent.content.size == 0 && (Mt(s, "start") || S.isSelectable(s))) {
|
|
9837
|
-
let o =
|
|
9896
|
+
let o = Bn(n.doc, r.before(), r.after(), k.empty);
|
|
9838
9897
|
if (o && o.slice.size < o.to - o.from) {
|
|
9839
9898
|
if (e) {
|
|
9840
9899
|
let l = n.tr.step(o);
|
|
@@ -9873,7 +9932,7 @@ const md = (n, e) => {
|
|
|
9873
9932
|
if (t.node.isTextblock || !je(n.doc, t.from))
|
|
9874
9933
|
return !1;
|
|
9875
9934
|
i = t.from;
|
|
9876
|
-
} else if (i =
|
|
9935
|
+
} else if (i = Pn(n.doc, t.from, -1), i == null)
|
|
9877
9936
|
return !1;
|
|
9878
9937
|
if (e) {
|
|
9879
9938
|
let s = n.tr.join(i);
|
|
@@ -9886,7 +9945,7 @@ const md = (n, e) => {
|
|
|
9886
9945
|
if (t.node.isTextblock || !je(n.doc, t.to))
|
|
9887
9946
|
return !1;
|
|
9888
9947
|
r = t.to;
|
|
9889
|
-
} else if (r =
|
|
9948
|
+
} else if (r = Pn(n.doc, t.to, 1), r == null)
|
|
9890
9949
|
return !1;
|
|
9891
9950
|
return e && e(n.tr.join(r).scrollIntoView()), !0;
|
|
9892
9951
|
}, yd = (n, e) => {
|
|
@@ -10092,7 +10151,7 @@ function Ed(n, e, t, r = null) {
|
|
|
10092
10151
|
if (e.$from.index(e.depth - 1) == 0)
|
|
10093
10152
|
return !1;
|
|
10094
10153
|
let a = o.resolve(e.start - 2);
|
|
10095
|
-
s = new
|
|
10154
|
+
s = new bn(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new bn(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), i = !0;
|
|
10096
10155
|
}
|
|
10097
10156
|
let l = $r(s, t, r, e);
|
|
10098
10157
|
return l ? (n && vd(n, e, l, i, t), !0) : !1;
|
|
@@ -10118,7 +10177,7 @@ function Nd(n) {
|
|
|
10118
10177
|
}
|
|
10119
10178
|
function Ad(n, e, t, r) {
|
|
10120
10179
|
let i = n.tr, s = r.end, o = r.$to.end(r.depth);
|
|
10121
|
-
s < o && (i.step(new $(s - 1, o, s, o, new k(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new
|
|
10180
|
+
s < o && (i.step(new $(s - 1, o, s, o, new k(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new bn(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
|
|
10122
10181
|
const l = wt(r);
|
|
10123
10182
|
if (l == null)
|
|
10124
10183
|
return !1;
|
|
@@ -10157,7 +10216,7 @@ function Id(n) {
|
|
|
10157
10216
|
return !0;
|
|
10158
10217
|
};
|
|
10159
10218
|
}
|
|
10160
|
-
function
|
|
10219
|
+
function Vn(n) {
|
|
10161
10220
|
const { state: e, transaction: t } = n;
|
|
10162
10221
|
let { selection: r } = t, { doc: i } = t, { storedMarks: s } = t;
|
|
10163
10222
|
return {
|
|
@@ -10182,7 +10241,7 @@ function Fn(n) {
|
|
|
10182
10241
|
}
|
|
10183
10242
|
};
|
|
10184
10243
|
}
|
|
10185
|
-
class
|
|
10244
|
+
class Hn {
|
|
10186
10245
|
constructor(e) {
|
|
10187
10246
|
this.editor = e.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = e.state;
|
|
10188
10247
|
}
|
|
@@ -10227,7 +10286,7 @@ class $n {
|
|
|
10227
10286
|
tr: e,
|
|
10228
10287
|
editor: i,
|
|
10229
10288
|
view: o,
|
|
10230
|
-
state:
|
|
10289
|
+
state: Vn({
|
|
10231
10290
|
state: s,
|
|
10232
10291
|
transaction: e
|
|
10233
10292
|
}),
|
|
@@ -10273,7 +10332,7 @@ function x(n, e, t) {
|
|
|
10273
10332
|
parent: n.parent ? x(n.parent, e, t) : null
|
|
10274
10333
|
}) : n.config[e];
|
|
10275
10334
|
}
|
|
10276
|
-
function
|
|
10335
|
+
function Wn(n) {
|
|
10277
10336
|
const e = n.filter((i) => i.type === "extension"), t = n.filter((i) => i.type === "node"), r = n.filter((i) => i.type === "mark");
|
|
10278
10337
|
return {
|
|
10279
10338
|
baseExtensions: e,
|
|
@@ -10282,7 +10341,7 @@ function Vn(n) {
|
|
|
10282
10341
|
};
|
|
10283
10342
|
}
|
|
10284
10343
|
function Zo(n) {
|
|
10285
|
-
const e = [], { nodeExtensions: t, markExtensions: r } =
|
|
10344
|
+
const e = [], { nodeExtensions: t, markExtensions: r } = Wn(n), i = [...t, ...r], s = {
|
|
10286
10345
|
default: null,
|
|
10287
10346
|
rendered: !0,
|
|
10288
10347
|
renderHTML: null,
|
|
@@ -10368,7 +10427,7 @@ function W(...n) {
|
|
|
10368
10427
|
}), r;
|
|
10369
10428
|
}, {});
|
|
10370
10429
|
}
|
|
10371
|
-
function
|
|
10430
|
+
function Ir(n, e) {
|
|
10372
10431
|
return e.filter((t) => t.type === n.type.name).filter((t) => t.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(n.attrs) || {} : {
|
|
10373
10432
|
[t.name]: n.attrs[t.name]
|
|
10374
10433
|
}).reduce((t, r) => W(t, r), {});
|
|
@@ -10411,7 +10470,7 @@ function cs(n) {
|
|
|
10411
10470
|
}
|
|
10412
10471
|
function Ld(n, e) {
|
|
10413
10472
|
var t;
|
|
10414
|
-
const r = Zo(n), { nodeExtensions: i, markExtensions: s } =
|
|
10473
|
+
const r = Zo(n), { nodeExtensions: i, markExtensions: s } = Wn(n), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
|
|
10415
10474
|
const d = r.filter((y) => y.type === c.name), u = {
|
|
10416
10475
|
name: c.name,
|
|
10417
10476
|
options: c.options,
|
|
@@ -10446,7 +10505,7 @@ function Ld(n, e) {
|
|
|
10446
10505
|
const m = x(c, "renderHTML", u);
|
|
10447
10506
|
m && (h.toDOM = (y) => m({
|
|
10448
10507
|
node: y,
|
|
10449
|
-
HTMLAttributes:
|
|
10508
|
+
HTMLAttributes: Ir(y, d)
|
|
10450
10509
|
}));
|
|
10451
10510
|
const g = x(c, "renderText", u);
|
|
10452
10511
|
return g && (h.toText = g), [c.name, h];
|
|
@@ -10478,7 +10537,7 @@ function Ld(n, e) {
|
|
|
10478
10537
|
const m = x(c, "renderHTML", u);
|
|
10479
10538
|
return m && (h.toDOM = (g) => m({
|
|
10480
10539
|
mark: g,
|
|
10481
|
-
HTMLAttributes:
|
|
10540
|
+
HTMLAttributes: Ir(g, d)
|
|
10482
10541
|
})), [c.name, h];
|
|
10483
10542
|
}));
|
|
10484
10543
|
return new $s({
|
|
@@ -10487,7 +10546,7 @@ function Ld(n, e) {
|
|
|
10487
10546
|
marks: a
|
|
10488
10547
|
});
|
|
10489
10548
|
}
|
|
10490
|
-
function
|
|
10549
|
+
function ar(n, e) {
|
|
10491
10550
|
return e.nodes[n] || e.marks[n] || null;
|
|
10492
10551
|
}
|
|
10493
10552
|
function ds(n, e) {
|
|
@@ -10514,7 +10573,7 @@ const zd = (n, e = 500) => {
|
|
|
10514
10573
|
function ni(n) {
|
|
10515
10574
|
return Object.prototype.toString.call(n) === "[object RegExp]";
|
|
10516
10575
|
}
|
|
10517
|
-
class
|
|
10576
|
+
class qn {
|
|
10518
10577
|
constructor(e) {
|
|
10519
10578
|
this.find = e.find, this.handler = e.handler;
|
|
10520
10579
|
}
|
|
@@ -10547,13 +10606,13 @@ function rn(n) {
|
|
|
10547
10606
|
const h = Fd(u, f.find);
|
|
10548
10607
|
if (!h)
|
|
10549
10608
|
return;
|
|
10550
|
-
const p = a.state.tr, m =
|
|
10609
|
+
const p = a.state.tr, m = Vn({
|
|
10551
10610
|
state: a.state,
|
|
10552
10611
|
transaction: p
|
|
10553
10612
|
}), g = {
|
|
10554
10613
|
from: r - (h[0].length - s.length),
|
|
10555
10614
|
to: i
|
|
10556
|
-
}, { commands: y, chain: T, can: w } = new
|
|
10615
|
+
}, { commands: y, chain: T, can: w } = new Hn({
|
|
10557
10616
|
editor: t,
|
|
10558
10617
|
state: m
|
|
10559
10618
|
});
|
|
@@ -10650,10 +10709,10 @@ function Vd(n) {
|
|
|
10650
10709
|
function sn(n) {
|
|
10651
10710
|
return Vd(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
|
|
10652
10711
|
}
|
|
10653
|
-
function
|
|
10712
|
+
function jn(n, e) {
|
|
10654
10713
|
const t = { ...n };
|
|
10655
10714
|
return sn(n) && sn(e) && Object.keys(e).forEach((r) => {
|
|
10656
|
-
sn(e[r]) && sn(n[r]) ? t[r] =
|
|
10715
|
+
sn(e[r]) && sn(n[r]) ? t[r] = jn(n[r], e[r]) : t[r] = e[r];
|
|
10657
10716
|
}), t;
|
|
10658
10717
|
}
|
|
10659
10718
|
class Me {
|
|
@@ -10677,7 +10736,7 @@ class Me {
|
|
|
10677
10736
|
configure(e = {}) {
|
|
10678
10737
|
const t = this.extend({
|
|
10679
10738
|
...this.config,
|
|
10680
|
-
addOptions: () =>
|
|
10739
|
+
addOptions: () => jn(this.options, e)
|
|
10681
10740
|
});
|
|
10682
10741
|
return t.name = this.name, t.parent = this.parent, t;
|
|
10683
10742
|
}
|
|
@@ -10720,7 +10779,7 @@ const qd = (n, e, t) => {
|
|
|
10720
10779
|
}) : [];
|
|
10721
10780
|
};
|
|
10722
10781
|
function jd(n) {
|
|
10723
|
-
const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new
|
|
10782
|
+
const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new Hn({
|
|
10724
10783
|
editor: e,
|
|
10725
10784
|
state: t
|
|
10726
10785
|
}), u = [];
|
|
@@ -10765,7 +10824,7 @@ function Jd(n) {
|
|
|
10765
10824
|
l = null;
|
|
10766
10825
|
}
|
|
10767
10826
|
const a = ({ state: d, from: u, to: f, rule: h, pasteEvt: p }) => {
|
|
10768
|
-
const m = d.tr, g =
|
|
10827
|
+
const m = d.tr, g = Vn({
|
|
10769
10828
|
state: d,
|
|
10770
10829
|
transaction: m
|
|
10771
10830
|
});
|
|
@@ -10903,7 +10962,7 @@ class gt {
|
|
|
10903
10962
|
options: t.options,
|
|
10904
10963
|
storage: t.storage,
|
|
10905
10964
|
editor: this.editor,
|
|
10906
|
-
type:
|
|
10965
|
+
type: ar(t.name, this.schema)
|
|
10907
10966
|
}, i = x(t, "addCommands", r);
|
|
10908
10967
|
return i ? {
|
|
10909
10968
|
...e,
|
|
@@ -10922,7 +10981,7 @@ class gt {
|
|
|
10922
10981
|
options: o.options,
|
|
10923
10982
|
storage: o.storage,
|
|
10924
10983
|
editor: e,
|
|
10925
|
-
type:
|
|
10984
|
+
type: ar(o.name, this.schema)
|
|
10926
10985
|
}, a = [], c = x(o, "addKeyboardShortcuts", l);
|
|
10927
10986
|
let d = {};
|
|
10928
10987
|
if (o.type === "mark" && x(o, "exitable", l) && (d.ArrowRight = () => Me.handleExit({ editor: e, mark: o })), c) {
|
|
@@ -10966,7 +11025,7 @@ class gt {
|
|
|
10966
11025
|
* @returns An object with all node views where the key is the node name and the value is the node view function
|
|
10967
11026
|
*/
|
|
10968
11027
|
get nodeViews() {
|
|
10969
|
-
const { editor: e } = this, { nodeExtensions: t } =
|
|
11028
|
+
const { editor: e } = this, { nodeExtensions: t } = Wn(this.extensions);
|
|
10970
11029
|
return Object.fromEntries(t.filter((r) => !!x(r, "addNodeView")).map((r) => {
|
|
10971
11030
|
const i = this.attributes.filter((a) => a.type === r.name), s = {
|
|
10972
11031
|
name: r.name,
|
|
@@ -10978,7 +11037,7 @@ class gt {
|
|
|
10978
11037
|
if (!o)
|
|
10979
11038
|
return [];
|
|
10980
11039
|
const l = (a, c, d, u, f) => {
|
|
10981
|
-
const h =
|
|
11040
|
+
const h = Ir(a, i);
|
|
10982
11041
|
return o()({
|
|
10983
11042
|
// pass-through
|
|
10984
11043
|
node: a,
|
|
@@ -11008,7 +11067,7 @@ class gt {
|
|
|
11008
11067
|
options: e.options,
|
|
11009
11068
|
storage: e.storage,
|
|
11010
11069
|
editor: this.editor,
|
|
11011
|
-
type:
|
|
11070
|
+
type: ar(e.name, this.schema)
|
|
11012
11071
|
};
|
|
11013
11072
|
e.type === "mark" && (!((t = v(x(e, "keepOnSplit", r))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
|
|
11014
11073
|
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);
|
|
@@ -11037,7 +11096,7 @@ class G {
|
|
|
11037
11096
|
configure(e = {}) {
|
|
11038
11097
|
const t = this.extend({
|
|
11039
11098
|
...this.config,
|
|
11040
|
-
addOptions: () =>
|
|
11099
|
+
addOptions: () => jn(this.options, e)
|
|
11041
11100
|
});
|
|
11042
11101
|
return t.name = this.name, t.parent = this.parent, t;
|
|
11043
11102
|
}
|
|
@@ -11151,12 +11210,12 @@ const _d = G.create({
|
|
|
11151
11210
|
const { from: r, to: i } = n;
|
|
11152
11211
|
return t && e.delete(r, i), !0;
|
|
11153
11212
|
}, iu = () => ({ state: n, dispatch: e }) => Yr(n, e), su = () => ({ commands: n }) => n.keyboardShortcut("Enter"), ou = () => ({ state: n, dispatch: e }) => bd(n, e);
|
|
11154
|
-
function
|
|
11213
|
+
function On(n, e, t = { strict: !0 }) {
|
|
11155
11214
|
const r = Object.keys(e);
|
|
11156
11215
|
return r.length ? r.every((i) => t.strict ? e[i] === n[i] : ni(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
|
|
11157
11216
|
}
|
|
11158
11217
|
function nl(n, e, t = {}) {
|
|
11159
|
-
return n.find((r) => r.type === e &&
|
|
11218
|
+
return n.find((r) => r.type === e && On(
|
|
11160
11219
|
// Only check equality for the attributes that are provided
|
|
11161
11220
|
Object.fromEntries(Object.keys(t).map((i) => [i, r.attrs[i]])),
|
|
11162
11221
|
t
|
|
@@ -11227,7 +11286,7 @@ function il(n, e = null) {
|
|
|
11227
11286
|
function fs() {
|
|
11228
11287
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
11229
11288
|
}
|
|
11230
|
-
function
|
|
11289
|
+
function En() {
|
|
11231
11290
|
return [
|
|
11232
11291
|
"iPad Simulator",
|
|
11233
11292
|
"iPhone Simulator",
|
|
@@ -11246,8 +11305,8 @@ const du = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
|
|
|
11246
11305
|
...e
|
|
11247
11306
|
};
|
|
11248
11307
|
const o = () => {
|
|
11249
|
-
(
|
|
11250
|
-
t.isDestroyed || (r.focus(), cu() && !
|
|
11308
|
+
(En() || fs()) && r.dom.focus(), requestAnimationFrame(() => {
|
|
11309
|
+
t.isDestroyed || (r.focus(), cu() && !En() && !fs() && r.dom.focus({ preventScroll: !0 }));
|
|
11251
11310
|
});
|
|
11252
11311
|
};
|
|
11253
11312
|
if (r.hasFocus() && n === null || n === !1)
|
|
@@ -11395,14 +11454,14 @@ const pu = (n) => !("type" in n), mu = (n, e, t) => ({ tr: r, dispatch: i, edito
|
|
|
11395
11454
|
return !0;
|
|
11396
11455
|
}, gu = () => ({ state: n, dispatch: e }) => md(n, e), yu = () => ({ state: n, dispatch: e }) => gd(n, e), bu = () => ({ state: n, dispatch: e }) => Ho(n, e), ku = () => ({ state: n, dispatch: e }) => Ko(n, e), xu = () => ({ state: n, dispatch: e, tr: t }) => {
|
|
11397
11456
|
try {
|
|
11398
|
-
const r =
|
|
11457
|
+
const r = Pn(n.doc, n.selection.$from.pos, -1);
|
|
11399
11458
|
return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
|
|
11400
11459
|
} catch {
|
|
11401
11460
|
return !1;
|
|
11402
11461
|
}
|
|
11403
11462
|
}, Su = () => ({ state: n, dispatch: e, tr: t }) => {
|
|
11404
11463
|
try {
|
|
11405
|
-
const r =
|
|
11464
|
+
const r = Pn(n.doc, n.selection.$from.pos, 1);
|
|
11406
11465
|
return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
|
|
11407
11466
|
} catch {
|
|
11408
11467
|
return !1;
|
|
@@ -11427,7 +11486,7 @@ function Cu(n) {
|
|
|
11427
11486
|
else if (/^s(hift)?$/i.test(a))
|
|
11428
11487
|
s = !0;
|
|
11429
11488
|
else if (/^mod$/i.test(a))
|
|
11430
|
-
|
|
11489
|
+
En() || ol() ? o = !0 : i = !0;
|
|
11431
11490
|
else
|
|
11432
11491
|
throw new Error(`Unrecognized modifier name: ${a}`);
|
|
11433
11492
|
}
|
|
@@ -11462,7 +11521,7 @@ function Wt(n, e, t = {}) {
|
|
|
11462
11521
|
to: p
|
|
11463
11522
|
});
|
|
11464
11523
|
});
|
|
11465
|
-
const a = i - r, c = l.filter((u) => o ? o.name === u.node.type.name : !0).filter((u) =>
|
|
11524
|
+
const a = i - r, c = l.filter((u) => o ? o.name === u.node.type.name : !0).filter((u) => On(u.node.attrs, t, { strict: !1 }));
|
|
11466
11525
|
return s ? !!c.length : c.reduce((u, f) => u + f.to - f.from, 0) >= a;
|
|
11467
11526
|
}
|
|
11468
11527
|
const Ou = (n, e = {}) => ({ state: t, dispatch: r }) => {
|
|
@@ -11472,7 +11531,7 @@ const Ou = (n, e = {}) => ({ state: t, dispatch: r }) => {
|
|
|
11472
11531
|
const r = H(n, e.schema);
|
|
11473
11532
|
return Nd(r)(e, t);
|
|
11474
11533
|
}, Nu = () => ({ state: n, dispatch: e }) => Uo(n, e);
|
|
11475
|
-
function
|
|
11534
|
+
function Kn(n, e) {
|
|
11476
11535
|
return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
|
|
11477
11536
|
}
|
|
11478
11537
|
function hs(n, e) {
|
|
@@ -11481,7 +11540,7 @@ function hs(n, e) {
|
|
|
11481
11540
|
}
|
|
11482
11541
|
const Au = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
|
|
11483
11542
|
let s = null, o = null;
|
|
11484
|
-
const l =
|
|
11543
|
+
const l = Kn(typeof n == "string" ? n : n.name, r.schema);
|
|
11485
11544
|
return l ? (l === "node" && (s = H(n, r.schema)), l === "mark" && (o = Je(n, r.schema)), i && t.selection.ranges.forEach((a) => {
|
|
11486
11545
|
r.doc.nodesBetween(a.$from.pos, a.$to.pos, (c, d) => {
|
|
11487
11546
|
s && s === c.type && t.setNodeMarkup(d, void 0, hs(c.attrs, e)), o && c.marks.length && c.marks.forEach((u) => {
|
|
@@ -11496,7 +11555,7 @@ const Au = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11496
11555
|
}
|
|
11497
11556
|
return !0;
|
|
11498
11557
|
}, Ru = () => ({ state: n, dispatch: e }) => qo(n, e), Pu = () => ({ state: n, dispatch: e }) => Jo(n, e), Bu = () => ({ state: n, dispatch: e }) => Sd(n, e), Lu = () => ({ state: n, dispatch: e }) => Cd(n, e), zu = () => ({ state: n, dispatch: e }) => wd(n, e);
|
|
11499
|
-
function
|
|
11558
|
+
function Rr(n, e, t = {}, r = {}) {
|
|
11500
11559
|
return Ht(n, e, {
|
|
11501
11560
|
slice: !1,
|
|
11502
11561
|
parseOptions: t,
|
|
@@ -11507,7 +11566,7 @@ const Fu = (n, e = !1, t = {}, r = {}) => ({ editor: i, tr: s, dispatch: o, comm
|
|
|
11507
11566
|
var a, c;
|
|
11508
11567
|
const { doc: d } = s;
|
|
11509
11568
|
if (t.preserveWhitespace !== "full") {
|
|
11510
|
-
const u =
|
|
11569
|
+
const u = Rr(n, i.schema, t, {
|
|
11511
11570
|
errorOnInvalidContent: (a = r.errorOnInvalidContent) !== null && a !== void 0 ? a : i.options.enableContentCheck
|
|
11512
11571
|
});
|
|
11513
11572
|
return o && s.replaceWith(0, d.content.size, u).setMeta("preventUpdate", !e), !0;
|
|
@@ -11564,7 +11623,7 @@ function Wu(n, e) {
|
|
|
11564
11623
|
return o ? { ...o.attrs } : {};
|
|
11565
11624
|
}
|
|
11566
11625
|
function qu(n, e) {
|
|
11567
|
-
const t =
|
|
11626
|
+
const t = Kn(typeof e == "string" ? e : e.name, n.schema);
|
|
11568
11627
|
return t === "node" ? Wu(n, e) : t === "mark" ? ll(n, e) : {};
|
|
11569
11628
|
}
|
|
11570
11629
|
function al(n, e, t) {
|
|
@@ -11589,10 +11648,10 @@ function un(n, e, t) {
|
|
|
11589
11648
|
return i ? i.attribute.keepOnSplit : !1;
|
|
11590
11649
|
}));
|
|
11591
11650
|
}
|
|
11592
|
-
function
|
|
11651
|
+
function Pr(n, e, t = {}) {
|
|
11593
11652
|
const { empty: r, ranges: i } = n.selection, s = e ? Je(e, n.schema) : null;
|
|
11594
11653
|
if (r)
|
|
11595
|
-
return !!(n.storedMarks || n.selection.$from.marks()).filter((u) => s ? s.name === u.type.name : !0).find((u) =>
|
|
11654
|
+
return !!(n.storedMarks || n.selection.$from.marks()).filter((u) => s ? s.name === u.type.name : !0).find((u) => On(u.attrs, t, { strict: !1 }));
|
|
11596
11655
|
let o = 0;
|
|
11597
11656
|
const l = [];
|
|
11598
11657
|
if (i.forEach(({ $from: u, $to: f }) => {
|
|
@@ -11609,17 +11668,17 @@ function Ir(n, e, t = {}) {
|
|
|
11609
11668
|
});
|
|
11610
11669
|
}), o === 0)
|
|
11611
11670
|
return !1;
|
|
11612
|
-
const a = l.filter((u) => s ? s.name === u.mark.type.name : !0).filter((u) =>
|
|
11671
|
+
const a = l.filter((u) => s ? s.name === u.mark.type.name : !0).filter((u) => On(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);
|
|
11613
11672
|
return (a > 0 ? a + c : a) >= o;
|
|
11614
11673
|
}
|
|
11615
11674
|
function ju(n, e, t = {}) {
|
|
11616
11675
|
if (!e)
|
|
11617
|
-
return Wt(n, null, t) ||
|
|
11618
|
-
const r =
|
|
11619
|
-
return r === "node" ? Wt(n, e, t) : r === "mark" ?
|
|
11676
|
+
return Wt(n, null, t) || Pr(n, null, t);
|
|
11677
|
+
const r = Kn(e, n.schema);
|
|
11678
|
+
return r === "node" ? Wt(n, e, t) : r === "mark" ? Pr(n, e, t) : !1;
|
|
11620
11679
|
}
|
|
11621
11680
|
function ps(n, e) {
|
|
11622
|
-
const { nodeExtensions: t } =
|
|
11681
|
+
const { nodeExtensions: t } = Wn(e), r = t.find((o) => o.name === n);
|
|
11623
11682
|
if (!r)
|
|
11624
11683
|
return !1;
|
|
11625
11684
|
const i = {
|
|
@@ -11807,7 +11866,7 @@ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11807
11866
|
t.ensureMarks(D);
|
|
11808
11867
|
}
|
|
11809
11868
|
return !0;
|
|
11810
|
-
},
|
|
11869
|
+
}, cr = (n, e) => {
|
|
11811
11870
|
const t = ii((o) => o.type === e)(n.selection);
|
|
11812
11871
|
if (!t)
|
|
11813
11872
|
return !0;
|
|
@@ -11816,7 +11875,7 @@ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11816
11875
|
return !0;
|
|
11817
11876
|
const i = n.doc.nodeAt(r);
|
|
11818
11877
|
return t.node.type === (i == null ? void 0 : i.type) && je(n.doc, t.pos) && n.join(t.pos), !0;
|
|
11819
|
-
},
|
|
11878
|
+
}, dr = (n, e) => {
|
|
11820
11879
|
const t = ii((o) => o.type === e)(n.selection);
|
|
11821
11880
|
if (!t)
|
|
11822
11881
|
return !0;
|
|
@@ -11834,15 +11893,15 @@ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11834
11893
|
if (D.node.type === h)
|
|
11835
11894
|
return c.liftListItem(p);
|
|
11836
11895
|
if (ps(D.node.type.name, u) && h.validContent(D.node.content) && l)
|
|
11837
|
-
return a().command(() => (s.setNodeMarkup(D.pos, h), !0)).command(() =>
|
|
11896
|
+
return a().command(() => (s.setNodeMarkup(D.pos, h), !0)).command(() => cr(s, h)).command(() => dr(s, h)).run();
|
|
11838
11897
|
}
|
|
11839
|
-
return !t || !I || !l ? a().command(() => d().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() =>
|
|
11898
|
+
return !t || !I || !l ? a().command(() => d().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => cr(s, h)).command(() => dr(s, h)).run() : a().command(() => {
|
|
11840
11899
|
const L = d().wrapInList(h, r), C = I.filter((N) => f.includes(N.type.name));
|
|
11841
11900
|
return s.ensureMarks(C), L ? !0 : c.clearNodes();
|
|
11842
|
-
}).wrapInList(h, r).command(() =>
|
|
11901
|
+
}).wrapInList(h, r).command(() => cr(s, h)).command(() => dr(s, h)).run();
|
|
11843
11902
|
}, nf = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
|
|
11844
11903
|
const { extendEmptyMarkRange: s = !1 } = t, o = Je(n, r.schema);
|
|
11845
|
-
return
|
|
11904
|
+
return Pr(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
|
|
11846
11905
|
}, rf = (n, e, t = {}) => ({ state: r, commands: i }) => {
|
|
11847
11906
|
const s = H(n, r.schema), o = H(e, r.schema), l = Wt(r, s, t);
|
|
11848
11907
|
let a;
|
|
@@ -11891,7 +11950,7 @@ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11891
11950
|
return t.removeStoredMark(a), !0;
|
|
11892
11951
|
}, cf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
11893
11952
|
let s = null, o = null;
|
|
11894
|
-
const l =
|
|
11953
|
+
const l = Kn(typeof n == "string" ? n : n.name, r.schema);
|
|
11895
11954
|
return l ? (l === "node" && (s = H(n, r.schema)), l === "mark" && (o = Je(n, r.schema)), i && t.selection.ranges.forEach((a) => {
|
|
11896
11955
|
const c = a.$from.pos, d = a.$to.pos;
|
|
11897
11956
|
let u, f, h, p;
|
|
@@ -12095,7 +12154,7 @@ const hf = G.create({
|
|
|
12095
12154
|
"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
|
|
12096
12155
|
"Ctrl-e": () => this.editor.commands.selectTextblockEnd()
|
|
12097
12156
|
};
|
|
12098
|
-
return
|
|
12157
|
+
return En() || ol() ? s : i;
|
|
12099
12158
|
},
|
|
12100
12159
|
addProseMirrorPlugins() {
|
|
12101
12160
|
return [
|
|
@@ -12115,10 +12174,10 @@ const hf = G.create({
|
|
|
12115
12174
|
const { empty: s, from: o, to: l } = e.selection, a = E.atStart(e.doc).from, c = E.atEnd(e.doc).to;
|
|
12116
12175
|
if (s || !(o === a && l === c) || !si(t.doc))
|
|
12117
12176
|
return;
|
|
12118
|
-
const f = t.tr, h =
|
|
12177
|
+
const f = t.tr, h = Vn({
|
|
12119
12178
|
state: t,
|
|
12120
12179
|
transaction: f
|
|
12121
|
-
}), { commands: p } = new
|
|
12180
|
+
}), { commands: p } = new Hn({
|
|
12122
12181
|
editor: this.editor,
|
|
12123
12182
|
state: h
|
|
12124
12183
|
});
|
|
@@ -12516,7 +12575,7 @@ class wf extends Rd {
|
|
|
12516
12575
|
* Creates an command manager.
|
|
12517
12576
|
*/
|
|
12518
12577
|
createCommandManager() {
|
|
12519
|
-
this.commandManager = new
|
|
12578
|
+
this.commandManager = new Hn({
|
|
12520
12579
|
editor: this
|
|
12521
12580
|
});
|
|
12522
12581
|
}
|
|
@@ -12533,7 +12592,7 @@ class wf extends Rd {
|
|
|
12533
12592
|
var e;
|
|
12534
12593
|
let t;
|
|
12535
12594
|
try {
|
|
12536
|
-
t =
|
|
12595
|
+
t = Rr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
|
|
12537
12596
|
} catch (o) {
|
|
12538
12597
|
if (!(o instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(o.message))
|
|
12539
12598
|
throw o;
|
|
@@ -12543,7 +12602,7 @@ class wf extends Rd {
|
|
|
12543
12602
|
disableCollaboration: () => {
|
|
12544
12603
|
this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((l) => l.name !== "collaboration"), this.createExtensionManager();
|
|
12545
12604
|
}
|
|
12546
|
-
}), t =
|
|
12605
|
+
}), t = Rr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
|
|
12547
12606
|
}
|
|
12548
12607
|
const r = il(t, this.options.autofocus);
|
|
12549
12608
|
this.view = new Fo(this.options.element, {
|
|
@@ -12715,7 +12774,7 @@ class wf extends Rd {
|
|
|
12715
12774
|
}
|
|
12716
12775
|
}
|
|
12717
12776
|
function at(n) {
|
|
12718
|
-
return new
|
|
12777
|
+
return new qn({
|
|
12719
12778
|
find: n.find,
|
|
12720
12779
|
handler: ({ state: e, range: t, match: r }) => {
|
|
12721
12780
|
const i = v(n.getAttributes, void 0, r);
|
|
@@ -12734,7 +12793,7 @@ function at(n) {
|
|
|
12734
12793
|
});
|
|
12735
12794
|
}
|
|
12736
12795
|
function cl(n) {
|
|
12737
|
-
return new
|
|
12796
|
+
return new qn({
|
|
12738
12797
|
find: n.find,
|
|
12739
12798
|
handler: ({ state: e, range: t, match: r }) => {
|
|
12740
12799
|
const i = v(n.getAttributes, void 0, r) || {}, { tr: s } = e, o = t.from;
|
|
@@ -12754,8 +12813,8 @@ function cl(n) {
|
|
|
12754
12813
|
}
|
|
12755
12814
|
});
|
|
12756
12815
|
}
|
|
12757
|
-
function
|
|
12758
|
-
return new
|
|
12816
|
+
function Br(n) {
|
|
12817
|
+
return new qn({
|
|
12759
12818
|
find: n.find,
|
|
12760
12819
|
handler: ({ state: e, range: t, match: r }) => {
|
|
12761
12820
|
const i = e.doc.resolve(t.from), s = v(n.getAttributes, void 0, r) || {};
|
|
@@ -12766,7 +12825,7 @@ function Rr(n) {
|
|
|
12766
12825
|
});
|
|
12767
12826
|
}
|
|
12768
12827
|
function qt(n) {
|
|
12769
|
-
return new
|
|
12828
|
+
return new qn({
|
|
12770
12829
|
find: n.find,
|
|
12771
12830
|
handler: ({ state: e, range: t, match: r, chain: i }) => {
|
|
12772
12831
|
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 && $r(a, n.type, s);
|
|
@@ -12809,7 +12868,7 @@ class ne {
|
|
|
12809
12868
|
configure(e = {}) {
|
|
12810
12869
|
const t = this.extend({
|
|
12811
12870
|
...this.config,
|
|
12812
|
-
addOptions: () =>
|
|
12871
|
+
addOptions: () => jn(this.options, e)
|
|
12813
12872
|
});
|
|
12814
12873
|
return t.name = this.name, t.parent = this.parent, t;
|
|
12815
12874
|
}
|
|
@@ -13144,14 +13203,14 @@ const Tf = /^\s*>\s$/, Of = ne.create({
|
|
|
13144
13203
|
},
|
|
13145
13204
|
addInputRules() {
|
|
13146
13205
|
return [
|
|
13147
|
-
|
|
13206
|
+
Br({
|
|
13148
13207
|
find: zf,
|
|
13149
13208
|
type: this.type,
|
|
13150
13209
|
getAttributes: (n) => ({
|
|
13151
13210
|
language: n[1]
|
|
13152
13211
|
})
|
|
13153
13212
|
}),
|
|
13154
|
-
|
|
13213
|
+
Br({
|
|
13155
13214
|
find: Ff,
|
|
13156
13215
|
type: this.type,
|
|
13157
13216
|
getAttributes: (n) => ({
|
|
@@ -13587,7 +13646,7 @@ const Xf = G.create({
|
|
|
13587
13646
|
}), {});
|
|
13588
13647
|
},
|
|
13589
13648
|
addInputRules() {
|
|
13590
|
-
return this.options.levels.map((n) =>
|
|
13649
|
+
return this.options.levels.map((n) => Br({
|
|
13591
13650
|
find: new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),
|
|
13592
13651
|
type: this.type,
|
|
13593
13652
|
getAttributes: {
|
|
@@ -13596,10 +13655,10 @@ const Xf = G.create({
|
|
|
13596
13655
|
}));
|
|
13597
13656
|
}
|
|
13598
13657
|
});
|
|
13599
|
-
var
|
|
13658
|
+
var vn = 200, V = function() {
|
|
13600
13659
|
};
|
|
13601
13660
|
V.prototype.append = function(e) {
|
|
13602
|
-
return e.length ? (e = V.from(e), !this.length && e || e.length <
|
|
13661
|
+
return e.length ? (e = V.from(e), !this.length && e || e.length < vn && this.leafAppend(e) || this.length < vn && e.leafPrepend(this) || this.appendInner(e)) : this;
|
|
13603
13662
|
};
|
|
13604
13663
|
V.prototype.prepend = function(e) {
|
|
13605
13664
|
return e.length ? V.from(e).append(this) : this;
|
|
@@ -13648,10 +13707,10 @@ var ul = /* @__PURE__ */ function(n) {
|
|
|
13648
13707
|
if (i(this.values[a], l + a) === !1)
|
|
13649
13708
|
return !1;
|
|
13650
13709
|
}, e.prototype.leafAppend = function(i) {
|
|
13651
|
-
if (this.length + i.length <=
|
|
13710
|
+
if (this.length + i.length <= vn)
|
|
13652
13711
|
return new e(this.values.concat(i.flatten()));
|
|
13653
13712
|
}, e.prototype.leafPrepend = function(i) {
|
|
13654
|
-
if (this.length + i.length <=
|
|
13713
|
+
if (this.length + i.length <= vn)
|
|
13655
13714
|
return new e(i.flatten().concat(this.values));
|
|
13656
13715
|
}, t.length.get = function() {
|
|
13657
13716
|
return this.values.length;
|
|
@@ -13843,9 +13902,9 @@ function ih(n, e, t, r) {
|
|
|
13843
13902
|
if (o && o.getMeta(rt))
|
|
13844
13903
|
return o.getMeta(rt).redo ? new Re(n.done.addTransform(t, void 0, r, fn(e)), n.undone, bs(t.mapping.maps), n.prevTime, n.prevComposition) : new Re(n.done, n.undone.addTransform(t, void 0, r, fn(e)), null, n.prevTime, n.prevComposition);
|
|
13845
13904
|
if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
13846
|
-
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !sh(t, n.prevRanges)), c = o ?
|
|
13905
|
+
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !sh(t, n.prevRanges)), c = o ? ur(n.prevRanges, t.mapping) : bs(t.mapping.maps);
|
|
13847
13906
|
return new Re(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, fn(e)), ge.empty, c, t.time, l ?? n.prevComposition);
|
|
13848
|
-
} else return (s = t.getMeta("rebased")) ? new Re(n.done.rebased(t, s), n.undone.rebased(t, s),
|
|
13907
|
+
} else return (s = t.getMeta("rebased")) ? new Re(n.done.rebased(t, s), n.undone.rebased(t, s), ur(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new Re(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), ur(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
|
|
13849
13908
|
}
|
|
13850
13909
|
function sh(n, e) {
|
|
13851
13910
|
if (!e)
|
|
@@ -13864,7 +13923,7 @@ function bs(n) {
|
|
|
13864
13923
|
n[t].forEach((r, i, s, o) => e.push(s, o));
|
|
13865
13924
|
return e;
|
|
13866
13925
|
}
|
|
13867
|
-
function
|
|
13926
|
+
function ur(n, e) {
|
|
13868
13927
|
if (!n)
|
|
13869
13928
|
return null;
|
|
13870
13929
|
let t = [];
|
|
@@ -13881,18 +13940,18 @@ function oh(n, e, t) {
|
|
|
13881
13940
|
let o = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), i, r), a = new Re(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
|
|
13882
13941
|
return s.transform.setSelection(o).setMeta(rt, { redo: t, historyState: a });
|
|
13883
13942
|
}
|
|
13884
|
-
let
|
|
13943
|
+
let fr = !1, ks = null;
|
|
13885
13944
|
function fn(n) {
|
|
13886
13945
|
let e = n.plugins;
|
|
13887
13946
|
if (ks != e) {
|
|
13888
|
-
|
|
13947
|
+
fr = !1, ks = e;
|
|
13889
13948
|
for (let t = 0; t < e.length; t++)
|
|
13890
13949
|
if (e[t].spec.historyPreserveItems) {
|
|
13891
|
-
|
|
13950
|
+
fr = !0;
|
|
13892
13951
|
break;
|
|
13893
13952
|
}
|
|
13894
13953
|
}
|
|
13895
|
-
return
|
|
13954
|
+
return fr;
|
|
13896
13955
|
}
|
|
13897
13956
|
const rt = new we("history"), lh = new we("closeHistory");
|
|
13898
13957
|
function ah(n = {}) {
|
|
@@ -14497,7 +14556,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), ch = G.create({
|
|
|
14497
14556
|
];
|
|
14498
14557
|
}
|
|
14499
14558
|
});
|
|
14500
|
-
var re, Gt, Yt, de,
|
|
14559
|
+
var re, Gt, Yt, de, Lr, ml, gl, yl, bl;
|
|
14501
14560
|
class Ph extends Ol {
|
|
14502
14561
|
constructor() {
|
|
14503
14562
|
super();
|
|
@@ -14507,7 +14566,7 @@ class Ph extends Ol {
|
|
|
14507
14566
|
F(this, Yt, null);
|
|
14508
14567
|
}
|
|
14509
14568
|
connectedCallback() {
|
|
14510
|
-
super.connectedCallback() && (q(this, de, ml).call(this), q(this, de, gl).call(this), q(this, de,
|
|
14569
|
+
super.connectedCallback() && (q(this, de, ml).call(this), q(this, de, gl).call(this), q(this, de, Lr).call(this));
|
|
14511
14570
|
}
|
|
14512
14571
|
get value() {
|
|
14513
14572
|
return O(this, re).getHTML();
|
|
@@ -14534,14 +14593,14 @@ class Ph extends Ol {
|
|
|
14534
14593
|
return this.hasAttribute("readonly");
|
|
14535
14594
|
}
|
|
14536
14595
|
set readonly(t) {
|
|
14537
|
-
t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), q(this, de,
|
|
14596
|
+
t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), q(this, de, Lr).call(this);
|
|
14538
14597
|
}
|
|
14539
14598
|
disconnectedCallback() {
|
|
14540
14599
|
O(this, re) && (O(this, re).destroy(), oe(this, re, null));
|
|
14541
14600
|
}
|
|
14542
14601
|
}
|
|
14543
14602
|
re = new WeakMap(), Gt = new WeakMap(), Yt = new WeakMap(), de = new WeakSet(), // 2. 에디터 상태 업데이트 로직 분리
|
|
14544
|
-
|
|
14603
|
+
Lr = function() {
|
|
14545
14604
|
if (O(this, re)) {
|
|
14546
14605
|
const t = this.readonly;
|
|
14547
14606
|
O(this, re).setEditable(!t);
|
|
@@ -14552,7 +14611,7 @@ Pr = function() {
|
|
|
14552
14611
|
const t = Ae.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
|
|
14553
14612
|
this.shadowRoot.innerHTML = `
|
|
14554
14613
|
<style>
|
|
14555
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
14614
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.56/dist/css/nineEditor.css";
|
|
14556
14615
|
${r}
|
|
14557
14616
|
</style>
|
|
14558
14617
|
|