@nine-lab/nine-ux 0.1.105 → 0.1.106
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/css/nine-code-block.css +59 -0
- package/dist/nine-ux.js +216 -216
- package/dist/nine-ux.umd.js +37 -37
- package/package.json +1 -1
package/dist/nine-ux.js
CHANGED
|
@@ -4,7 +4,7 @@ var ui = (n) => {
|
|
|
4
4
|
};
|
|
5
5
|
var El = (n, e, t) => e in n ? vl(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
6
6
|
var be = (n, e, t) => El(n, typeof e != "symbol" ? e + "" : e, t), _n = (n, e, t) => e.has(n) || ui("Cannot " + t);
|
|
7
|
-
var
|
|
7
|
+
var O = (n, e, t) => (_n(n, e, "read from private field"), t ? t.call(n) : e.get(n)), B = (n, e, t) => e.has(n) ? ui("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), Y = (n, e, t, r) => (_n(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), R = (n, e, t) => (_n(n, e, "access private method"), t);
|
|
8
8
|
import { nine as Es } from "@nine-lab/nine-util";
|
|
9
9
|
const Al = `
|
|
10
10
|
dialog::backdrop {
|
|
@@ -422,31 +422,31 @@ class Nl extends HTMLElement {
|
|
|
422
422
|
B(this, Ee);
|
|
423
423
|
B(this, j);
|
|
424
424
|
be(this, "showModal", () => {
|
|
425
|
-
|
|
425
|
+
O(this, j).showModal();
|
|
426
426
|
});
|
|
427
427
|
be(this, "close", () => {
|
|
428
|
-
|
|
428
|
+
O(this, j).close(), this.remove();
|
|
429
429
|
});
|
|
430
430
|
B(this, Dn, () => {
|
|
431
431
|
const t = this.querySelector(".head");
|
|
432
432
|
this.querySelectorAll(".close, .close2").forEach((r) => {
|
|
433
433
|
r.onclick = () => {
|
|
434
|
-
|
|
434
|
+
O(this, j).classList.add("out"), setTimeout(() => {
|
|
435
435
|
this.close();
|
|
436
436
|
}, 300);
|
|
437
437
|
};
|
|
438
|
-
}), t.addEventListener("mousedown",
|
|
438
|
+
}), t.addEventListener("mousedown", O(this, In)), t.addEventListener("touchstart", O(this, Rn), { passive: !1 });
|
|
439
439
|
});
|
|
440
440
|
// --- 드래그 로직 (Vanilla JS) ---
|
|
441
441
|
B(this, In, (t) => {
|
|
442
442
|
if (t.target.closest("buttons") || t.button !== 0 || t.altKey || t.ctrlKey || t.shiftKey) return;
|
|
443
|
-
const r =
|
|
443
|
+
const r = O(this, j).getBoundingClientRect();
|
|
444
444
|
Y(this, Ee, {
|
|
445
445
|
x: t.clientX - r.left,
|
|
446
446
|
y: t.clientY - r.top
|
|
447
447
|
});
|
|
448
448
|
const i = (o) => {
|
|
449
|
-
|
|
449
|
+
O(this, j).style.position = "fixed", O(this, j).style.margin = "0", O(this, j).style.left = `${o.clientX - O(this, Ee).x}px`, O(this, j).style.top = `${o.clientY - O(this, Ee).y}px`;
|
|
450
450
|
}, s = () => {
|
|
451
451
|
document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", s);
|
|
452
452
|
};
|
|
@@ -454,14 +454,14 @@ class Nl extends HTMLElement {
|
|
|
454
454
|
});
|
|
455
455
|
B(this, Rn, (t) => {
|
|
456
456
|
if (t.target.closest("buttons")) return;
|
|
457
|
-
const r =
|
|
457
|
+
const r = O(this, j).getBoundingClientRect(), i = t.changedTouches[0];
|
|
458
458
|
Y(this, Ee, {
|
|
459
459
|
x: i.pageX - r.left,
|
|
460
460
|
y: i.pageY - r.top
|
|
461
461
|
});
|
|
462
462
|
const s = (l) => {
|
|
463
463
|
const a = l.changedTouches[0];
|
|
464
|
-
|
|
464
|
+
O(this, j).style.position = "fixed", O(this, j).style.margin = "0", O(this, j).style.left = `${a.pageX - O(this, Ee).x}px`, O(this, j).style.top = `${a.pageY - O(this, Ee).y}px`;
|
|
465
465
|
}, o = () => {
|
|
466
466
|
document.removeEventListener("touchmove", s), document.removeEventListener("touchend", o);
|
|
467
467
|
};
|
|
@@ -501,7 +501,7 @@ class Nl extends HTMLElement {
|
|
|
501
501
|
</div>
|
|
502
502
|
</div>
|
|
503
503
|
</dialog>
|
|
504
|
-
`, Y(this, j, this.querySelector("dialog")),
|
|
504
|
+
`, Y(this, j, this.querySelector("dialog")), O(this, Dn).call(this);
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
Ee = new WeakMap(), j = new WeakMap(), Dn = new WeakMap(), In = new WeakMap(), Rn = new WeakMap();
|
|
@@ -590,7 +590,7 @@ class Il {
|
|
|
590
590
|
// 1. 값만 깔끔하게 반환
|
|
591
591
|
get cssPath() {
|
|
592
592
|
var e;
|
|
593
|
-
return ((e = Dl.config.ux) == null ? void 0 : e.cssPath) ||
|
|
593
|
+
return ((e = Dl.config.ux) == null ? void 0 : e.cssPath) || O(this, _t);
|
|
594
594
|
}
|
|
595
595
|
set cssPath(e) {
|
|
596
596
|
Y(this, _t, e);
|
|
@@ -686,10 +686,10 @@ class Rl extends HTMLElement {
|
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
688
|
connectedCallback() {
|
|
689
|
-
return
|
|
689
|
+
return O(this, Xt) ? !1 : (this.getAttribute("use-shadow") !== "false" && !this.shadowRoot ? (this.attachShadow({ mode: "open" }), Y(this, Qe, this.shadowRoot)) : Y(this, Qe, this), O(this, Pn).call(this), Y(this, Xt, !0), !0);
|
|
690
690
|
}
|
|
691
691
|
get changed() {
|
|
692
|
-
return
|
|
692
|
+
return O(this, Yt);
|
|
693
693
|
}
|
|
694
694
|
set changed(t) {
|
|
695
695
|
const r = !!t;
|
|
@@ -702,12 +702,12 @@ class Rl extends HTMLElement {
|
|
|
702
702
|
}
|
|
703
703
|
// 자식 클래스에서 접근 가능하도록 getter 제공
|
|
704
704
|
get root() {
|
|
705
|
-
return
|
|
705
|
+
return O(this, Qe) || this;
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
708
|
Xt = new WeakMap(), Qe = new WeakMap(), Yt = new WeakMap(), ae = new WeakSet(), // 공통 쿼리 함수: 현재 root(Shadow 또는 Light DOM)에서 요소를 찾음
|
|
709
709
|
Et = function() {
|
|
710
|
-
return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]",
|
|
710
|
+
return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]", O(this, Qe));
|
|
711
711
|
}, // [공통 로직 1] 특정 요소에 값을 쓰거나 초기화하는 핵심 함수
|
|
712
712
|
gr = function(t, r) {
|
|
713
713
|
const i = t.tagName.toUpperCase(), s = t.type;
|
|
@@ -727,7 +727,7 @@ gr = function(t, r) {
|
|
|
727
727
|
}, // [공통 로직 2] 이벤트 리스너 일괄 등록
|
|
728
728
|
yr = function() {
|
|
729
729
|
R(this, ae, Et).call(this).forEach((t) => {
|
|
730
|
-
t.removeEventListener("input",
|
|
730
|
+
t.removeEventListener("input", O(this, Zt)), t.addEventListener("input", O(this, Zt));
|
|
731
731
|
});
|
|
732
732
|
}, Zt = new WeakMap(), Pn = new WeakMap();
|
|
733
733
|
function K(n) {
|
|
@@ -1382,12 +1382,12 @@ function Rs(n, e, t, r) {
|
|
|
1382
1382
|
} else if (t.content.size)
|
|
1383
1383
|
if (!t.openStart && !t.openEnd && n.depth == r && e.depth == r) {
|
|
1384
1384
|
let o = n.parent, l = o.content;
|
|
1385
|
-
return
|
|
1385
|
+
return tt(o, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
|
|
1386
1386
|
} else {
|
|
1387
1387
|
let { start: o, end: l } = Bl(t, n);
|
|
1388
|
-
return
|
|
1388
|
+
return tt(s, Bs(n, o, l, e, r));
|
|
1389
1389
|
}
|
|
1390
|
-
else return
|
|
1390
|
+
else return tt(s, kn(n, e, r));
|
|
1391
1391
|
}
|
|
1392
1392
|
function Ps(n, e) {
|
|
1393
1393
|
if (!e.type.compatibleContent(n.type))
|
|
@@ -1397,29 +1397,29 @@ function kr(n, e, t) {
|
|
|
1397
1397
|
let r = n.node(t);
|
|
1398
1398
|
return Ps(r, e.node(t)), r;
|
|
1399
1399
|
}
|
|
1400
|
-
function
|
|
1400
|
+
function et(n, e) {
|
|
1401
1401
|
let t = e.length - 1;
|
|
1402
1402
|
t >= 0 && n.isText && n.sameMarkup(e[t]) ? e[t] = n.withText(e[t].text + n.text) : e.push(n);
|
|
1403
1403
|
}
|
|
1404
1404
|
function Rt(n, e, t, r) {
|
|
1405
1405
|
let i = (e || n).node(t), s = 0, o = e ? e.index(t) : i.childCount;
|
|
1406
|
-
n && (s = n.index(t), n.depth > t ? s++ : n.textOffset && (
|
|
1406
|
+
n && (s = n.index(t), n.depth > t ? s++ : n.textOffset && (et(n.nodeAfter, r), s++));
|
|
1407
1407
|
for (let l = s; l < o; l++)
|
|
1408
|
-
|
|
1409
|
-
e && e.depth == t && e.textOffset &&
|
|
1408
|
+
et(i.child(l), r);
|
|
1409
|
+
e && e.depth == t && e.textOffset && et(e.nodeBefore, r);
|
|
1410
1410
|
}
|
|
1411
|
-
function
|
|
1411
|
+
function tt(n, e) {
|
|
1412
1412
|
return n.type.checkContent(e), n.copy(e);
|
|
1413
1413
|
}
|
|
1414
1414
|
function Bs(n, e, t, r, i) {
|
|
1415
1415
|
let s = n.depth > i && kr(n, e, i + 1), o = r.depth > i && kr(t, r, i + 1), l = [];
|
|
1416
|
-
return Rt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Ps(s, o), tt(
|
|
1416
|
+
return Rt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Ps(s, o), et(tt(s, Bs(n, e, t, r, i + 1)), l)) : (s && et(tt(s, kn(n, e, i + 1)), l), Rt(e, t, i, l), o && et(tt(o, kn(t, r, i + 1)), l)), Rt(r, null, i, l), new b(l);
|
|
1417
1417
|
}
|
|
1418
1418
|
function kn(n, e, t) {
|
|
1419
1419
|
let r = [];
|
|
1420
1420
|
if (Rt(null, n, t, r), n.depth > t) {
|
|
1421
1421
|
let i = kr(n, e, t + 1);
|
|
1422
|
-
tt(
|
|
1422
|
+
et(tt(i, kn(n, e, t + 1)), r);
|
|
1423
1423
|
}
|
|
1424
1424
|
return Rt(e, null, t, r), new b(r);
|
|
1425
1425
|
}
|
|
@@ -2139,7 +2139,7 @@ function Ls(n, e) {
|
|
|
2139
2139
|
e = n[t].type.name + "(" + e + ")";
|
|
2140
2140
|
return e;
|
|
2141
2141
|
}
|
|
2142
|
-
class
|
|
2142
|
+
class st {
|
|
2143
2143
|
/**
|
|
2144
2144
|
@internal
|
|
2145
2145
|
*/
|
|
@@ -2152,7 +2152,7 @@ class ot {
|
|
|
2152
2152
|
static parse(e, t) {
|
|
2153
2153
|
let r = new $l(e, t);
|
|
2154
2154
|
if (r.next == null)
|
|
2155
|
-
return
|
|
2155
|
+
return st.empty;
|
|
2156
2156
|
let i = zs(r);
|
|
2157
2157
|
r.next && r.err("Unexpected trailing text");
|
|
2158
2158
|
let s = Jl(Kl(i));
|
|
@@ -2301,7 +2301,7 @@ class ot {
|
|
|
2301
2301
|
`);
|
|
2302
2302
|
}
|
|
2303
2303
|
}
|
|
2304
|
-
|
|
2304
|
+
st.empty = new st(!0);
|
|
2305
2305
|
class $l {
|
|
2306
2306
|
constructor(e, t) {
|
|
2307
2307
|
this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
|
|
@@ -2464,7 +2464,7 @@ function Jl(n) {
|
|
|
2464
2464
|
});
|
|
2465
2465
|
});
|
|
2466
2466
|
});
|
|
2467
|
-
let s = e[r.join(",")] = new
|
|
2467
|
+
let s = e[r.join(",")] = new st(r.indexOf(n.length - 1) > -1);
|
|
2468
2468
|
for (let o = 0; o < i.length; o++) {
|
|
2469
2469
|
let l = i[o][1].sort(Fs);
|
|
2470
2470
|
s.next.push({ type: i[o][0], next: e[l.join(",")] || t(l) });
|
|
@@ -2547,7 +2547,7 @@ let mi = class qs {
|
|
|
2547
2547
|
True for node types that allow no content.
|
|
2548
2548
|
*/
|
|
2549
2549
|
get isLeaf() {
|
|
2550
|
-
return this.contentMatch ==
|
|
2550
|
+
return this.contentMatch == st.empty;
|
|
2551
2551
|
}
|
|
2552
2552
|
/**
|
|
2553
2553
|
True when this node is an atom, i.e. when it does not have
|
|
@@ -2788,7 +2788,7 @@ class js {
|
|
|
2788
2788
|
if (i in this.marks)
|
|
2789
2789
|
throw new RangeError(i + " can not be both a node and a mark");
|
|
2790
2790
|
let s = this.nodes[i], o = s.spec.content || "", l = s.spec.marks;
|
|
2791
|
-
if (s.contentMatch = r[o] || (r[o] =
|
|
2791
|
+
if (s.contentMatch = r[o] || (r[o] = st.parse(o, this.nodes)), s.inlineContent = s.contentMatch.inlineContent, s.spec.linebreakReplacement) {
|
|
2792
2792
|
if (this.linebreakReplacement)
|
|
2793
2793
|
throw new RangeError("Multiple linebreak nodes defined");
|
|
2794
2794
|
if (!s.isInline || !s.isLeaf)
|
|
@@ -3371,7 +3371,7 @@ function xi(n, e) {
|
|
|
3371
3371
|
return !0;
|
|
3372
3372
|
}
|
|
3373
3373
|
}
|
|
3374
|
-
class
|
|
3374
|
+
class ut {
|
|
3375
3375
|
/**
|
|
3376
3376
|
Create a serializer. `nodes` should map node names to functions
|
|
3377
3377
|
that take a node and return a description of the corresponding
|
|
@@ -3458,7 +3458,7 @@ class ft {
|
|
|
3458
3458
|
properties in a schema's node and mark specs.
|
|
3459
3459
|
*/
|
|
3460
3460
|
static fromSchema(e) {
|
|
3461
|
-
return e.cached.domSerializer || (e.cached.domSerializer = new
|
|
3461
|
+
return e.cached.domSerializer || (e.cached.domSerializer = new ut(this.nodesFromSchema(e), this.marksFromSchema(e)));
|
|
3462
3462
|
}
|
|
3463
3463
|
/**
|
|
3464
3464
|
Gather the serializers in a schema's node specs into an object.
|
|
@@ -3985,7 +3985,7 @@ class ze extends ee {
|
|
|
3985
3985
|
return new ze(this.pos, this.mark);
|
|
3986
3986
|
}
|
|
3987
3987
|
}
|
|
3988
|
-
return new
|
|
3988
|
+
return new ot(this.pos, this.mark);
|
|
3989
3989
|
}
|
|
3990
3990
|
map(e) {
|
|
3991
3991
|
let t = e.mapResult(this.pos, 1);
|
|
@@ -4004,7 +4004,7 @@ class ze extends ee {
|
|
|
4004
4004
|
}
|
|
4005
4005
|
}
|
|
4006
4006
|
ee.jsonID("addNodeMark", ze);
|
|
4007
|
-
class
|
|
4007
|
+
class ot extends ee {
|
|
4008
4008
|
/**
|
|
4009
4009
|
Create a mark-removing step.
|
|
4010
4010
|
*/
|
|
@@ -4024,7 +4024,7 @@ class lt extends ee {
|
|
|
4024
4024
|
}
|
|
4025
4025
|
map(e) {
|
|
4026
4026
|
let t = e.mapResult(this.pos, 1);
|
|
4027
|
-
return t.deletedAfter ? null : new
|
|
4027
|
+
return t.deletedAfter ? null : new ot(t.pos, this.mark);
|
|
4028
4028
|
}
|
|
4029
4029
|
toJSON() {
|
|
4030
4030
|
return { stepType: "removeNodeMark", pos: this.pos, mark: this.mark.toJSON() };
|
|
@@ -4035,10 +4035,10 @@ class lt extends ee {
|
|
|
4035
4035
|
static fromJSON(e, t) {
|
|
4036
4036
|
if (typeof t.pos != "number")
|
|
4037
4037
|
throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");
|
|
4038
|
-
return new
|
|
4038
|
+
return new ot(t.pos, e.markFromJSON(t.mark));
|
|
4039
4039
|
}
|
|
4040
4040
|
}
|
|
4041
|
-
ee.jsonID("removeNodeMark",
|
|
4041
|
+
ee.jsonID("removeNodeMark", ot);
|
|
4042
4042
|
class L extends ee {
|
|
4043
4043
|
/**
|
|
4044
4044
|
The given `slice` should fit the 'gap' between `from` and
|
|
@@ -4683,8 +4683,8 @@ function wa(n, e, t, r) {
|
|
|
4683
4683
|
for (let m = 0; m < o.length; m++) {
|
|
4684
4684
|
let g = o[(m + a) % o.length], y = !0;
|
|
4685
4685
|
g < 0 && (y = !1, g = -g);
|
|
4686
|
-
let
|
|
4687
|
-
if (
|
|
4686
|
+
let T = i.node(g - 1), M = i.index(g - 1);
|
|
4687
|
+
if (T.canReplaceWith(M, M, p.type, p.marks))
|
|
4688
4688
|
return n.replace(i.before(g), y ? s.after(g) : t, new k(io(r.content, 0, r.openStart, h), h, r.openEnd));
|
|
4689
4689
|
}
|
|
4690
4690
|
}
|
|
@@ -4751,7 +4751,7 @@ function so(n, e) {
|
|
|
4751
4751
|
}
|
|
4752
4752
|
return t;
|
|
4753
4753
|
}
|
|
4754
|
-
class
|
|
4754
|
+
class bt extends ee {
|
|
4755
4755
|
/**
|
|
4756
4756
|
Construct an attribute step.
|
|
4757
4757
|
*/
|
|
@@ -4773,11 +4773,11 @@ class kt extends ee {
|
|
|
4773
4773
|
return le.empty;
|
|
4774
4774
|
}
|
|
4775
4775
|
invert(e) {
|
|
4776
|
-
return new
|
|
4776
|
+
return new bt(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);
|
|
4777
4777
|
}
|
|
4778
4778
|
map(e) {
|
|
4779
4779
|
let t = e.mapResult(this.pos, 1);
|
|
4780
|
-
return t.deletedAfter ? null : new
|
|
4780
|
+
return t.deletedAfter ? null : new bt(t.pos, this.attr, this.value);
|
|
4781
4781
|
}
|
|
4782
4782
|
toJSON() {
|
|
4783
4783
|
return { stepType: "attr", pos: this.pos, attr: this.attr, value: this.value };
|
|
@@ -4785,10 +4785,10 @@ class kt extends ee {
|
|
|
4785
4785
|
static fromJSON(e, t) {
|
|
4786
4786
|
if (typeof t.pos != "number" || typeof t.attr != "string")
|
|
4787
4787
|
throw new RangeError("Invalid input for AttrStep.fromJSON");
|
|
4788
|
-
return new
|
|
4788
|
+
return new bt(t.pos, t.attr, t.value);
|
|
4789
4789
|
}
|
|
4790
4790
|
}
|
|
4791
|
-
ee.jsonID("attr",
|
|
4791
|
+
ee.jsonID("attr", bt);
|
|
4792
4792
|
class Ht extends ee {
|
|
4793
4793
|
/**
|
|
4794
4794
|
Construct an attribute step.
|
|
@@ -5005,7 +5005,7 @@ class Ta {
|
|
|
5005
5005
|
to set attributes on the document itself.
|
|
5006
5006
|
*/
|
|
5007
5007
|
setNodeAttribute(e, t, r) {
|
|
5008
|
-
return this.step(new
|
|
5008
|
+
return this.step(new bt(e, t, r)), this;
|
|
5009
5009
|
}
|
|
5010
5010
|
/**
|
|
5011
5011
|
Set a single attribute on the document to a new value.
|
|
@@ -5028,11 +5028,11 @@ class Ta {
|
|
|
5028
5028
|
if (!r)
|
|
5029
5029
|
throw new RangeError("No node at position " + e);
|
|
5030
5030
|
if (t instanceof N)
|
|
5031
|
-
t.isInSet(r.marks) && this.step(new
|
|
5031
|
+
t.isInSet(r.marks) && this.step(new ot(e, t));
|
|
5032
5032
|
else {
|
|
5033
5033
|
let i = r.marks, s, o = [];
|
|
5034
5034
|
for (; s = t.isInSet(i); )
|
|
5035
|
-
o.push(new
|
|
5035
|
+
o.push(new ot(e, s)), i = s.removeFromSet(i);
|
|
5036
5036
|
for (let l = o.length - 1; l >= 0; l--)
|
|
5037
5037
|
this.step(o[l]);
|
|
5038
5038
|
}
|
|
@@ -5168,11 +5168,11 @@ class v {
|
|
|
5168
5168
|
found.
|
|
5169
5169
|
*/
|
|
5170
5170
|
static findFrom(e, t, r = !1) {
|
|
5171
|
-
let i = e.parent.inlineContent ? new w(e) :
|
|
5171
|
+
let i = e.parent.inlineContent ? new w(e) : pt(e.node(0), e.parent, e.pos, e.index(), t, r);
|
|
5172
5172
|
if (i)
|
|
5173
5173
|
return i;
|
|
5174
5174
|
for (let s = e.depth - 1; s >= 0; s--) {
|
|
5175
|
-
let o = t < 0 ?
|
|
5175
|
+
let o = t < 0 ? pt(e.node(0), e.node(s), e.before(s + 1), e.index(s), t, r) : pt(e.node(0), e.node(s), e.after(s + 1), e.index(s) + 1, t, r);
|
|
5176
5176
|
if (o)
|
|
5177
5177
|
return o;
|
|
5178
5178
|
}
|
|
@@ -5193,14 +5193,14 @@ class v {
|
|
|
5193
5193
|
exists.
|
|
5194
5194
|
*/
|
|
5195
5195
|
static atStart(e) {
|
|
5196
|
-
return
|
|
5196
|
+
return pt(e, e, 0, 0, 1) || new ce(e);
|
|
5197
5197
|
}
|
|
5198
5198
|
/**
|
|
5199
5199
|
Find the cursor or leaf node selection closest to the end of the
|
|
5200
5200
|
given document.
|
|
5201
5201
|
*/
|
|
5202
5202
|
static atEnd(e) {
|
|
5203
|
-
return
|
|
5203
|
+
return pt(e, e, e.content.size, e.childCount, -1) || new ce(e);
|
|
5204
5204
|
}
|
|
5205
5205
|
/**
|
|
5206
5206
|
Deserialize the JSON representation of a selection. Must be
|
|
@@ -5439,7 +5439,7 @@ const va = {
|
|
|
5439
5439
|
return new ce(n);
|
|
5440
5440
|
}
|
|
5441
5441
|
};
|
|
5442
|
-
function
|
|
5442
|
+
function pt(n, e, t, r, i, s = !1) {
|
|
5443
5443
|
if (e.inlineContent)
|
|
5444
5444
|
return w.create(n, t);
|
|
5445
5445
|
for (let o = r - (i > 0 ? 0 : 1); i > 0 ? o < e.childCount : o >= 0; o += i) {
|
|
@@ -5448,7 +5448,7 @@ function mt(n, e, t, r, i, s = !1) {
|
|
|
5448
5448
|
if (!s && S.isSelectable(l))
|
|
5449
5449
|
return S.create(n, t - (i < 0 ? l.nodeSize : 0));
|
|
5450
5450
|
} else {
|
|
5451
|
-
let a =
|
|
5451
|
+
let a = pt(n, l, t + i, i < 0 ? l.childCount : 0, i, s);
|
|
5452
5452
|
if (a)
|
|
5453
5453
|
return a;
|
|
5454
5454
|
}
|
|
@@ -5671,7 +5671,7 @@ class tr {
|
|
|
5671
5671
|
});
|
|
5672
5672
|
}
|
|
5673
5673
|
}
|
|
5674
|
-
class
|
|
5674
|
+
class gt {
|
|
5675
5675
|
/**
|
|
5676
5676
|
@internal
|
|
5677
5677
|
*/
|
|
@@ -5746,7 +5746,7 @@ class yt {
|
|
|
5746
5746
|
applyInner(e) {
|
|
5747
5747
|
if (!e.before.eq(this.doc))
|
|
5748
5748
|
throw new RangeError("Applying a mismatched transaction");
|
|
5749
|
-
let t = new
|
|
5749
|
+
let t = new gt(this.config), r = this.config.fields;
|
|
5750
5750
|
for (let i = 0; i < r.length; i++) {
|
|
5751
5751
|
let s = r[i];
|
|
5752
5752
|
t[s.name] = s.apply(e, this[s.name], this, t);
|
|
@@ -5763,7 +5763,7 @@ class yt {
|
|
|
5763
5763
|
Create a new state.
|
|
5764
5764
|
*/
|
|
5765
5765
|
static create(e) {
|
|
5766
|
-
let t = new tr(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new
|
|
5766
|
+
let t = new tr(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new gt(t);
|
|
5767
5767
|
for (let i = 0; i < t.fields.length; i++)
|
|
5768
5768
|
r[t.fields[i].name] = t.fields[i].init(e, r);
|
|
5769
5769
|
return r;
|
|
@@ -5777,7 +5777,7 @@ class yt {
|
|
|
5777
5777
|
configuration object..
|
|
5778
5778
|
*/
|
|
5779
5779
|
reconfigure(e) {
|
|
5780
|
-
let t = new tr(this.schema, e.plugins), r = t.fields, i = new
|
|
5780
|
+
let t = new tr(this.schema, e.plugins), r = t.fields, i = new gt(t);
|
|
5781
5781
|
for (let s = 0; s < r.length; s++) {
|
|
5782
5782
|
let o = r[s].name;
|
|
5783
5783
|
i[o] = this.hasOwnProperty(o) ? this[o] : r[s].init(e, i);
|
|
@@ -5814,7 +5814,7 @@ class yt {
|
|
|
5814
5814
|
throw new RangeError("Invalid input for EditorState.fromJSON");
|
|
5815
5815
|
if (!e.schema)
|
|
5816
5816
|
throw new RangeError("Required config field 'schema' missing");
|
|
5817
|
-
let i = new tr(e.schema, e.plugins), s = new
|
|
5817
|
+
let i = new tr(e.schema, e.plugins), s = new gt(i);
|
|
5818
5818
|
return i.fields.forEach((o) => {
|
|
5819
5819
|
if (o.name == "doc")
|
|
5820
5820
|
s.doc = $e.fromJSON(e.schema, t.doc);
|
|
@@ -5896,7 +5896,7 @@ const Oe = function(n, e, t) {
|
|
|
5896
5896
|
return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
|
|
5897
5897
|
}, Na = function() {
|
|
5898
5898
|
Cr = null;
|
|
5899
|
-
},
|
|
5899
|
+
}, lt = function(n, e, t, r) {
|
|
5900
5900
|
return t && (Di(n, e, t, r, -1) || Di(n, e, t, r, 1));
|
|
5901
5901
|
}, Da = /^(img|br|input|textarea|hr)$/i;
|
|
5902
5902
|
function Di(n, e, t, r, i) {
|
|
@@ -5969,7 +5969,7 @@ function tn(n) {
|
|
|
5969
5969
|
return e && e.node && e.node.isBlock && (e.dom == n || e.contentDOM == n);
|
|
5970
5970
|
}
|
|
5971
5971
|
const $n = function(n) {
|
|
5972
|
-
return n.focusNode &&
|
|
5972
|
+
return n.focusNode && lt(n.focusNode, n.focusOffset, n.anchorNode, n.anchorOffset);
|
|
5973
5973
|
};
|
|
5974
5974
|
function _e(n, e) {
|
|
5975
5975
|
let t = document.createEvent("Event");
|
|
@@ -6077,18 +6077,18 @@ function ho(n, e) {
|
|
|
6077
6077
|
r.scrollTop != i + e && (r.scrollTop = i + e), r.scrollLeft != s && (r.scrollLeft = s);
|
|
6078
6078
|
}
|
|
6079
6079
|
}
|
|
6080
|
-
let
|
|
6080
|
+
let ft = null;
|
|
6081
6081
|
function Wa(n) {
|
|
6082
6082
|
if (n.setActive)
|
|
6083
6083
|
return n.setActive();
|
|
6084
|
-
if (
|
|
6085
|
-
return n.focus(
|
|
6084
|
+
if (ft)
|
|
6085
|
+
return n.focus(ft);
|
|
6086
6086
|
let e = fo(n);
|
|
6087
|
-
n.focus(
|
|
6087
|
+
n.focus(ft == null ? {
|
|
6088
6088
|
get preventScroll() {
|
|
6089
|
-
return
|
|
6089
|
+
return ft = { preventScroll: !0 }, !0;
|
|
6090
6090
|
}
|
|
6091
|
-
} : void 0),
|
|
6091
|
+
} : void 0), ft || (ft = !1, ho(e, 0));
|
|
6092
6092
|
}
|
|
6093
6093
|
function po(n, e) {
|
|
6094
6094
|
let t, r = 2e8, i, s = 0, o = e.top, l = e.top, a, c;
|
|
@@ -6616,7 +6616,7 @@ class rn {
|
|
|
6616
6616
|
let h = d.focusNode.childNodes[d.focusOffset];
|
|
6617
6617
|
h && h.contentEditable == "false" && (i = !0);
|
|
6618
6618
|
}
|
|
6619
|
-
if (!(i || u && Q) &&
|
|
6619
|
+
if (!(i || u && Q) && lt(l.node, l.offset, d.anchorNode, d.anchorOffset) && lt(a.node, a.offset, d.focusNode, d.focusOffset))
|
|
6620
6620
|
return;
|
|
6621
6621
|
let f = !1;
|
|
6622
6622
|
if ((c.extend || e == t) && !(u && pe)) {
|
|
@@ -6738,13 +6738,13 @@ class Qa extends rn {
|
|
|
6738
6738
|
return e.type === "characterData" && e.target.nodeValue == e.oldValue;
|
|
6739
6739
|
}
|
|
6740
6740
|
}
|
|
6741
|
-
class
|
|
6741
|
+
class at extends rn {
|
|
6742
6742
|
constructor(e, t, r, i, s) {
|
|
6743
6743
|
super(e, [], r, i), this.mark = t, this.spec = s;
|
|
6744
6744
|
}
|
|
6745
6745
|
static create(e, t, r, i) {
|
|
6746
6746
|
let s = i.nodeViews[t.type.name], o = s && s(t, i, r);
|
|
6747
|
-
return (!o || !o.dom) && (o =
|
|
6747
|
+
return (!o || !o.dom) && (o = ut.renderSpec(document, t.type.spec.toDOM(t, r), null, t.attrs)), new at(e, t, o.dom, o.contentDOM || o.dom, o);
|
|
6748
6748
|
}
|
|
6749
6749
|
parseRule() {
|
|
6750
6750
|
return this.dirty & we || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
|
|
@@ -6761,7 +6761,7 @@ class ct extends rn {
|
|
|
6761
6761
|
}
|
|
6762
6762
|
}
|
|
6763
6763
|
slice(e, t, r) {
|
|
6764
|
-
let i =
|
|
6764
|
+
let i = at.create(this.parent, this.mark, !0, r), s = this.children, o = this.size;
|
|
6765
6765
|
t < o && (s = Ar(s, t, o, r)), e > 0 && (s = Ar(s, 0, e, r));
|
|
6766
6766
|
for (let l = 0; l < s.length; l++)
|
|
6767
6767
|
s[l].parent = i;
|
|
@@ -6799,7 +6799,7 @@ class We extends rn {
|
|
|
6799
6799
|
d = document.createTextNode(t.text);
|
|
6800
6800
|
else if (d.nodeType != 3)
|
|
6801
6801
|
throw new RangeError("Text must be rendered as a DOM text node");
|
|
6802
|
-
} else d || ({ dom: d, contentDOM: u } =
|
|
6802
|
+
} else d || ({ dom: d, contentDOM: u } = ut.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
|
|
6803
6803
|
!u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
|
|
6804
6804
|
let f = d;
|
|
6805
6805
|
return d = wo(d, r, t), c ? a = new ec(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Vn(e, t, r, i, d, f, s) : new We(e, t, r, i, d, u || null, f, s, o + 1);
|
|
@@ -7006,7 +7006,7 @@ function xo(n, e, t) {
|
|
|
7006
7006
|
r = r.nextSibling;
|
|
7007
7007
|
} else
|
|
7008
7008
|
i = !0, n.insertBefore(l, r);
|
|
7009
|
-
if (o instanceof
|
|
7009
|
+
if (o instanceof at) {
|
|
7010
7010
|
let a = r ? r.previousSibling : n.lastChild;
|
|
7011
7011
|
xo(o.contentDOM, o.children, t), r = a ? a.nextSibling : n.firstChild;
|
|
7012
7012
|
}
|
|
@@ -7126,7 +7126,7 @@ class nc {
|
|
|
7126
7126
|
if (a > -1)
|
|
7127
7127
|
a > this.index && (this.changed = !0, this.destroyBetween(this.index, a)), this.top = this.top.children[this.index];
|
|
7128
7128
|
else {
|
|
7129
|
-
let d =
|
|
7129
|
+
let d = at.create(this.top, e[o], t, r);
|
|
7130
7130
|
this.top.children.splice(this.index, 0, d), this.top = d, this.changed = !0;
|
|
7131
7131
|
}
|
|
7132
7132
|
this.index = 0, o++;
|
|
@@ -7219,7 +7219,7 @@ class nc {
|
|
|
7219
7219
|
// contentEditable.
|
|
7220
7220
|
addTextblockHacks() {
|
|
7221
7221
|
let e = this.top.children[this.index - 1], t = this.top;
|
|
7222
|
-
for (; e instanceof
|
|
7222
|
+
for (; e instanceof at; )
|
|
7223
7223
|
t = e, e = t.children[t.children.length - 1];
|
|
7224
7224
|
(!e || // Empty textblock
|
|
7225
7225
|
!(e instanceof Vn) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((Q || _) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
|
|
@@ -7245,7 +7245,7 @@ function rc(n, e) {
|
|
|
7245
7245
|
for (; ; )
|
|
7246
7246
|
if (r) {
|
|
7247
7247
|
let c = t.children[r - 1];
|
|
7248
|
-
if (c instanceof
|
|
7248
|
+
if (c instanceof at)
|
|
7249
7249
|
t = c, r = c.children.length;
|
|
7250
7250
|
else {
|
|
7251
7251
|
l = c, r--;
|
|
@@ -7400,7 +7400,7 @@ function De(n, e = !1) {
|
|
|
7400
7400
|
if (Co(n, t), !!Mo(n)) {
|
|
7401
7401
|
if (!e && n.input.mouseDown && n.input.mouseDown.allowDefault && _) {
|
|
7402
7402
|
let r = n.domSelectionRange(), i = n.domObserver.currentSelection;
|
|
7403
|
-
if (r.anchorNode && i.anchorNode &&
|
|
7403
|
+
if (r.anchorNode && i.anchorNode && lt(r.anchorNode, r.anchorOffset, i.anchorNode, i.anchorOffset)) {
|
|
7404
7404
|
n.input.mouseDown.delayedSelectionSync = !0, n.domObserver.setCurSelection();
|
|
7405
7405
|
return;
|
|
7406
7406
|
}
|
|
@@ -7477,7 +7477,7 @@ function To(n) {
|
|
|
7477
7477
|
}
|
|
7478
7478
|
function dc(n) {
|
|
7479
7479
|
let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
|
|
7480
|
-
return
|
|
7480
|
+
return lt(e.node, e.offset, t.anchorNode, t.anchorOffset);
|
|
7481
7481
|
}
|
|
7482
7482
|
function Nr(n, e) {
|
|
7483
7483
|
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;
|
|
@@ -7523,7 +7523,7 @@ function Lt(n, e) {
|
|
|
7523
7523
|
let t = n.pmViewDesc;
|
|
7524
7524
|
return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
|
|
7525
7525
|
}
|
|
7526
|
-
function
|
|
7526
|
+
function ht(n, e) {
|
|
7527
7527
|
return e < 0 ? uc(n) : fc(n);
|
|
7528
7528
|
}
|
|
7529
7529
|
function uc(n) {
|
|
@@ -7710,22 +7710,22 @@ function gc(n) {
|
|
|
7710
7710
|
function yc(n, e) {
|
|
7711
7711
|
let t = e.keyCode, r = gc(e);
|
|
7712
7712
|
if (t == 8 || ue && t == 72 && r == "c")
|
|
7713
|
-
return Gi(n, -1) ||
|
|
7713
|
+
return Gi(n, -1) || ht(n, -1);
|
|
7714
7714
|
if (t == 46 && !e.shiftKey || ue && t == 68 && r == "c")
|
|
7715
|
-
return Gi(n, 1) ||
|
|
7715
|
+
return Gi(n, 1) || ht(n, 1);
|
|
7716
7716
|
if (t == 13 || t == 27)
|
|
7717
7717
|
return !0;
|
|
7718
7718
|
if (t == 37 || ue && t == 66 && r == "c") {
|
|
7719
7719
|
let i = t == 37 ? Ui(n, n.state.selection.from) == "ltr" ? -1 : 1 : -1;
|
|
7720
|
-
return Ji(n, i, r) ||
|
|
7720
|
+
return Ji(n, i, r) || ht(n, i);
|
|
7721
7721
|
} else if (t == 39 || ue && t == 70 && r == "c") {
|
|
7722
7722
|
let i = t == 39 ? Ui(n, n.state.selection.from) == "ltr" ? 1 : -1 : 1;
|
|
7723
|
-
return Ji(n, i, r) ||
|
|
7723
|
+
return Ji(n, i, r) || ht(n, i);
|
|
7724
7724
|
} else {
|
|
7725
7725
|
if (t == 38 || ue && t == 80 && r == "c")
|
|
7726
|
-
return _i(n, -1, r) ||
|
|
7726
|
+
return _i(n, -1, r) || ht(n, -1);
|
|
7727
7727
|
if (t == 40 || ue && t == 78 && r == "c")
|
|
7728
|
-
return mc(n) || _i(n, 1, r) ||
|
|
7728
|
+
return mc(n) || _i(n, 1, r) || ht(n, 1);
|
|
7729
7729
|
if (r == (ue ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
7730
7730
|
return !0;
|
|
7731
7731
|
}
|
|
@@ -7741,7 +7741,7 @@ function _r(n, e) {
|
|
|
7741
7741
|
let h = r.firstChild;
|
|
7742
7742
|
t.push(h.type.name, h.attrs != h.type.defaultAttrs ? h.attrs : null), r = h.content;
|
|
7743
7743
|
}
|
|
7744
|
-
let o = n.someProp("clipboardSerializer") ||
|
|
7744
|
+
let o = n.someProp("clipboardSerializer") || ut.fromSchema(n.state.schema), l = Io(), a = l.createElement("div");
|
|
7745
7745
|
a.appendChild(o.serializeFragment(r, { document: l }));
|
|
7746
7746
|
let c = a.firstChild, d, u = 0;
|
|
7747
7747
|
for (; c && c.nodeType == 1 && (d = Do[c.nodeName.toLowerCase()]); ) {
|
|
@@ -7776,7 +7776,7 @@ function vo(n, e, t, r, i) {
|
|
|
7776
7776
|
if (u)
|
|
7777
7777
|
l = u;
|
|
7778
7778
|
else {
|
|
7779
|
-
let f = i.marks(), { schema: h } = n.state, p =
|
|
7779
|
+
let f = i.marks(), { schema: h } = n.state, p = ut.fromSchema(h);
|
|
7780
7780
|
o = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((m) => {
|
|
7781
7781
|
let g = o.appendChild(document.createElement("p"));
|
|
7782
7782
|
m && g.appendChild(p.serializeNode(h.text(m, f)));
|
|
@@ -8013,7 +8013,7 @@ function Xr(n, e, t, r, i) {
|
|
|
8013
8013
|
return !0;
|
|
8014
8014
|
return !1;
|
|
8015
8015
|
}
|
|
8016
|
-
function
|
|
8016
|
+
function kt(n, e, t) {
|
|
8017
8017
|
if (n.focused || n.focus(), n.state.selection.eq(e))
|
|
8018
8018
|
return;
|
|
8019
8019
|
let r = n.state.tr.setSelection(e);
|
|
@@ -8023,7 +8023,7 @@ function Dc(n, e) {
|
|
|
8023
8023
|
if (e == -1)
|
|
8024
8024
|
return !1;
|
|
8025
8025
|
let t = n.state.doc.resolve(e), r = t.nodeAfter;
|
|
8026
|
-
return r && r.isAtom && S.isSelectable(r) ? (
|
|
8026
|
+
return r && r.isAtom && S.isSelectable(r) ? (kt(n, new S(t)), !0) : !1;
|
|
8027
8027
|
}
|
|
8028
8028
|
function Ic(n, e) {
|
|
8029
8029
|
if (e == -1)
|
|
@@ -8038,7 +8038,7 @@ function Ic(n, e) {
|
|
|
8038
8038
|
break;
|
|
8039
8039
|
}
|
|
8040
8040
|
}
|
|
8041
|
-
return i != null ? (
|
|
8041
|
+
return i != null ? (kt(n, S.create(n.state.doc, i)), !0) : !1;
|
|
8042
8042
|
}
|
|
8043
8043
|
function Rc(n, e, t, r, i) {
|
|
8044
8044
|
return Xr(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? Ic(n, t) : Dc(n, t));
|
|
@@ -8054,14 +8054,14 @@ function Lc(n, e, t) {
|
|
|
8054
8054
|
return !1;
|
|
8055
8055
|
let r = n.state.doc;
|
|
8056
8056
|
if (e == -1)
|
|
8057
|
-
return r.inlineContent ? (
|
|
8057
|
+
return r.inlineContent ? (kt(n, w.create(r, 0, r.content.size)), !0) : !1;
|
|
8058
8058
|
let i = r.resolve(e);
|
|
8059
8059
|
for (let s = i.depth + 1; s > 0; s--) {
|
|
8060
8060
|
let o = s > i.depth ? i.nodeAfter : i.node(s), l = i.before(s);
|
|
8061
8061
|
if (o.inlineContent)
|
|
8062
|
-
|
|
8062
|
+
kt(n, w.create(r, l + 1, l + 1 + o.content.size));
|
|
8063
8063
|
else if (S.isSelectable(o))
|
|
8064
|
-
|
|
8064
|
+
kt(n, S.create(r, l));
|
|
8065
8065
|
else
|
|
8066
8066
|
continue;
|
|
8067
8067
|
return !0;
|
|
@@ -8116,7 +8116,7 @@ class zc {
|
|
|
8116
8116
|
// (hidden) cursor is doesn't change the selection, and
|
|
8117
8117
|
// thus doesn't get a reaction from ProseMirror. This
|
|
8118
8118
|
// works around that.
|
|
8119
|
-
_ && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (
|
|
8119
|
+
_ && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (kt(this.view, v.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : Fe(this.view, "pointer");
|
|
8120
8120
|
}
|
|
8121
8121
|
move(e) {
|
|
8122
8122
|
this.updateAllowDefault(e), Fe(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
@@ -8378,7 +8378,7 @@ function jt(n, e) {
|
|
|
8378
8378
|
}
|
|
8379
8379
|
class Tn {
|
|
8380
8380
|
constructor(e, t) {
|
|
8381
|
-
this.toDOM = e, this.spec = t ||
|
|
8381
|
+
this.toDOM = e, this.spec = t || nt, this.side = this.spec.side || 0;
|
|
8382
8382
|
}
|
|
8383
8383
|
map(e, t, r, i) {
|
|
8384
8384
|
let { pos: s, deleted: o } = e.mapResult(t.from + i, this.side < 0 ? -1 : 1);
|
|
@@ -8396,7 +8396,7 @@ class Tn {
|
|
|
8396
8396
|
}
|
|
8397
8397
|
class qe {
|
|
8398
8398
|
constructor(e, t) {
|
|
8399
|
-
this.attrs = e, this.spec = t ||
|
|
8399
|
+
this.attrs = e, this.spec = t || nt;
|
|
8400
8400
|
}
|
|
8401
8401
|
map(e, t, r, i) {
|
|
8402
8402
|
let s = e.map(t.from + i, this.spec.inclusiveStart ? -1 : 1) - r, o = e.map(t.to + i, this.spec.inclusiveEnd ? 1 : -1) - r;
|
|
@@ -8416,7 +8416,7 @@ class qe {
|
|
|
8416
8416
|
}
|
|
8417
8417
|
class Zr {
|
|
8418
8418
|
constructor(e, t) {
|
|
8419
|
-
this.attrs = e, this.spec = t ||
|
|
8419
|
+
this.attrs = e, this.spec = t || nt;
|
|
8420
8420
|
}
|
|
8421
8421
|
map(e, t, r, i) {
|
|
8422
8422
|
let s = e.mapResult(t.from + i, 1);
|
|
@@ -8506,13 +8506,13 @@ class he {
|
|
|
8506
8506
|
return this.type instanceof Tn;
|
|
8507
8507
|
}
|
|
8508
8508
|
}
|
|
8509
|
-
const
|
|
8509
|
+
const mt = [], nt = {};
|
|
8510
8510
|
class $ {
|
|
8511
8511
|
/**
|
|
8512
8512
|
@internal
|
|
8513
8513
|
*/
|
|
8514
8514
|
constructor(e, t) {
|
|
8515
|
-
this.local = e.length ? e :
|
|
8515
|
+
this.local = e.length ? e : mt, this.children = t.length ? t : mt;
|
|
8516
8516
|
}
|
|
8517
8517
|
/**
|
|
8518
8518
|
Create a set of decorations, using the structure of the given
|
|
@@ -8520,7 +8520,7 @@ class $ {
|
|
|
8520
8520
|
you must make a copy if you want need to preserve that.
|
|
8521
8521
|
*/
|
|
8522
8522
|
static create(e, t) {
|
|
8523
|
-
return t.length ? On(t, e, 0,
|
|
8523
|
+
return t.length ? On(t, e, 0, nt) : Z;
|
|
8524
8524
|
}
|
|
8525
8525
|
/**
|
|
8526
8526
|
Find all decorations in this set which touch the given range
|
|
@@ -8550,7 +8550,7 @@ class $ {
|
|
|
8550
8550
|
document.
|
|
8551
8551
|
*/
|
|
8552
8552
|
map(e, t, r) {
|
|
8553
|
-
return this == Z || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, r ||
|
|
8553
|
+
return this == Z || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, r || nt);
|
|
8554
8554
|
}
|
|
8555
8555
|
/**
|
|
8556
8556
|
@internal
|
|
@@ -8561,7 +8561,7 @@ class $ {
|
|
|
8561
8561
|
let a = this.local[l].map(e, r, i);
|
|
8562
8562
|
a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
|
|
8563
8563
|
}
|
|
8564
|
-
return this.children.length ? Uc(this.children, o || [], e, t, r, i, s) : o ? new $(o.sort(
|
|
8564
|
+
return this.children.length ? Uc(this.children, o || [], e, t, r, i, s) : o ? new $(o.sort(rt), mt) : Z;
|
|
8565
8565
|
}
|
|
8566
8566
|
/**
|
|
8567
8567
|
Add the given array of decorations to the ones in the set,
|
|
@@ -8579,13 +8579,13 @@ class $ {
|
|
|
8579
8579
|
if (d = Ho(t, l, c)) {
|
|
8580
8580
|
for (i || (i = this.children.slice()); s < i.length && i[s] < a; )
|
|
8581
8581
|
s += 3;
|
|
8582
|
-
i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize, On(d, l, c + 1,
|
|
8582
|
+
i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize, On(d, l, c + 1, nt)), s += 3;
|
|
8583
8583
|
}
|
|
8584
8584
|
});
|
|
8585
8585
|
let o = Vo(s ? Wo(t) : t, -r);
|
|
8586
8586
|
for (let l = 0; l < o.length; l++)
|
|
8587
8587
|
o[l].type.valid(e, o[l]) || o.splice(l--, 1);
|
|
8588
|
-
return new $(o.length ? this.local.concat(o).sort(
|
|
8588
|
+
return new $(o.length ? this.local.concat(o).sort(rt) : this.local, i || this.children);
|
|
8589
8589
|
}
|
|
8590
8590
|
/**
|
|
8591
8591
|
Create a new set that contains the decorations in this set, minus
|
|
@@ -8634,7 +8634,7 @@ class $ {
|
|
|
8634
8634
|
}
|
|
8635
8635
|
}
|
|
8636
8636
|
if (i) {
|
|
8637
|
-
let l = new $(i.sort(
|
|
8637
|
+
let l = new $(i.sort(rt), mt);
|
|
8638
8638
|
return r ? new Be([l, r]) : l;
|
|
8639
8639
|
}
|
|
8640
8640
|
return r || Z;
|
|
@@ -8666,7 +8666,7 @@ class $ {
|
|
|
8666
8666
|
*/
|
|
8667
8667
|
localsInner(e) {
|
|
8668
8668
|
if (this == Z)
|
|
8669
|
-
return
|
|
8669
|
+
return mt;
|
|
8670
8670
|
if (e.inlineContent || !this.local.some(qe.is))
|
|
8671
8671
|
return this.local;
|
|
8672
8672
|
let t = [];
|
|
@@ -8686,7 +8686,7 @@ class Be {
|
|
|
8686
8686
|
this.members = e;
|
|
8687
8687
|
}
|
|
8688
8688
|
map(e, t) {
|
|
8689
|
-
const r = this.members.map((i) => i.map(e, t,
|
|
8689
|
+
const r = this.members.map((i) => i.map(e, t, nt));
|
|
8690
8690
|
return Be.from(r);
|
|
8691
8691
|
}
|
|
8692
8692
|
forChild(e, t) {
|
|
@@ -8720,7 +8720,7 @@ class Be {
|
|
|
8720
8720
|
t.push(s[o]);
|
|
8721
8721
|
}
|
|
8722
8722
|
}
|
|
8723
|
-
return t ? Qr(r ? t : t.sort(
|
|
8723
|
+
return t ? Qr(r ? t : t.sort(rt)) : mt;
|
|
8724
8724
|
}
|
|
8725
8725
|
// Create a group for the given array of decoration sets, or return
|
|
8726
8726
|
// a single set when possible.
|
|
@@ -8746,8 +8746,8 @@ function Uc(n, e, t, r, i, s, o) {
|
|
|
8746
8746
|
t.maps[c].forEach((f, h, p, m) => {
|
|
8747
8747
|
let g = m - p - (h - f);
|
|
8748
8748
|
for (let y = 0; y < l.length; y += 3) {
|
|
8749
|
-
let
|
|
8750
|
-
if (
|
|
8749
|
+
let T = l[y + 1];
|
|
8750
|
+
if (T < 0 || f > T + d - u)
|
|
8751
8751
|
continue;
|
|
8752
8752
|
let M = l[y] + d - u;
|
|
8753
8753
|
h >= M ? l[y + 1] = f <= M ? -2 : -1 : f >= d && g && (l[y] += g, l[y + 1] += g);
|
|
@@ -8786,7 +8786,7 @@ function Uc(n, e, t, r, i, s, o) {
|
|
|
8786
8786
|
l.splice(f, 0, d.children[u], d.children[u + 1], d.children[u + 2]);
|
|
8787
8787
|
}
|
|
8788
8788
|
}
|
|
8789
|
-
return new $(e.sort(
|
|
8789
|
+
return new $(e.sort(rt), l);
|
|
8790
8790
|
}
|
|
8791
8791
|
function Vo(n, e) {
|
|
8792
8792
|
if (!e || !n.length)
|
|
@@ -8835,12 +8835,12 @@ function On(n, e, t, r) {
|
|
|
8835
8835
|
d != Z && i.push(a, a + l.nodeSize, d);
|
|
8836
8836
|
}
|
|
8837
8837
|
});
|
|
8838
|
-
let o = Vo(s ? Wo(n) : n, -t).sort(
|
|
8838
|
+
let o = Vo(s ? Wo(n) : n, -t).sort(rt);
|
|
8839
8839
|
for (let l = 0; l < o.length; l++)
|
|
8840
8840
|
o[l].type.valid(e, o[l]) || (r.onRemove && r.onRemove(o[l].spec), o.splice(l--, 1));
|
|
8841
8841
|
return o.length || i.length ? new $(o, i) : Z;
|
|
8842
8842
|
}
|
|
8843
|
-
function
|
|
8843
|
+
function rt(n, e) {
|
|
8844
8844
|
return n.from - e.from || n.to - e.to;
|
|
8845
8845
|
}
|
|
8846
8846
|
function Qr(n) {
|
|
@@ -8862,7 +8862,7 @@ function Qr(n) {
|
|
|
8862
8862
|
return e;
|
|
8863
8863
|
}
|
|
8864
8864
|
function Qi(n, e, t) {
|
|
8865
|
-
for (; e < n.length &&
|
|
8865
|
+
for (; e < n.length && rt(t, n[e]) > 0; )
|
|
8866
8866
|
e++;
|
|
8867
8867
|
n.splice(e, 0, t);
|
|
8868
8868
|
}
|
|
@@ -8943,7 +8943,7 @@ class Zc {
|
|
|
8943
8943
|
return De(this.view);
|
|
8944
8944
|
if (se && He <= 11 && !this.view.state.selection.empty) {
|
|
8945
8945
|
let e = this.view.domSelectionRange();
|
|
8946
|
-
if (e.focusNode &&
|
|
8946
|
+
if (e.focusNode && lt(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
|
|
8947
8947
|
return this.flushSoon();
|
|
8948
8948
|
}
|
|
8949
8949
|
this.flush();
|
|
@@ -9059,7 +9059,7 @@ function Qc(n) {
|
|
|
9059
9059
|
}
|
|
9060
9060
|
function ns(n, e) {
|
|
9061
9061
|
let t = e.startContainer, r = e.startOffset, i = e.endContainer, s = e.endOffset, o = n.domAtPos(n.state.selection.anchor);
|
|
9062
|
-
return
|
|
9062
|
+
return lt(o.node, o.offset, i, s) && ([t, r, i, s] = [i, s, t, r]), { anchorNode: t, anchorOffset: r, focusNode: i, focusOffset: s };
|
|
9063
9063
|
}
|
|
9064
9064
|
function ed(n, e) {
|
|
9065
9065
|
if (e.getComposedRanges) {
|
|
@@ -9106,12 +9106,12 @@ function rd(n, e, t) {
|
|
|
9106
9106
|
let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
|
|
9107
9107
|
if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], $n(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), _ && n.input.lastKeyCode === 8)
|
|
9108
9108
|
for (let g = s; g > i; g--) {
|
|
9109
|
-
let y = r.childNodes[g - 1],
|
|
9110
|
-
if (y.nodeName == "BR" && !
|
|
9109
|
+
let y = r.childNodes[g - 1], T = y.pmViewDesc;
|
|
9110
|
+
if (y.nodeName == "BR" && !T) {
|
|
9111
9111
|
s = g;
|
|
9112
9112
|
break;
|
|
9113
9113
|
}
|
|
9114
|
-
if (!
|
|
9114
|
+
if (!T || T.size)
|
|
9115
9115
|
break;
|
|
9116
9116
|
}
|
|
9117
9117
|
let u = n.state.doc, f = n.someProp("domParser") || Ve.fromSchema(n.state.schema), h = u.resolve(o), p = null, m = f.parse(r, {
|
|
@@ -9181,8 +9181,8 @@ function od(n, e, t, r, i) {
|
|
|
9181
9181
|
return;
|
|
9182
9182
|
}
|
|
9183
9183
|
n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof w && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)), se && He <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == " " && (p.start--, p.endA--, p.endB--);
|
|
9184
|
-
let m = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), y = d.resolve(p.start),
|
|
9185
|
-
if ((Ct && n.input.lastIOSEnter > Date.now() - 225 && (!
|
|
9184
|
+
let m = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), y = d.resolve(p.start), T = m.sameParent(g) && m.parent.inlineContent && y.end() >= p.endA;
|
|
9185
|
+
if ((Ct && n.input.lastIOSEnter > Date.now() - 225 && (!T || i.some((C) => C.nodeName == "DIV" || C.nodeName == "P")) || !T && m.pos < c.doc.content.size && (!m.sameParent(g) || !m.parent.inlineContent) && m.pos < g.pos && !/\S/.test(c.doc.textBetween(m.pos, g.pos, "", ""))) && n.someProp("handleKeyDown", (C) => C(n, _e(13, "Enter")))) {
|
|
9186
9186
|
n.input.lastIOSEnter = 0;
|
|
9187
9187
|
return;
|
|
9188
9188
|
}
|
|
@@ -9190,7 +9190,7 @@ function od(n, e, t, r, i) {
|
|
|
9190
9190
|
Ae && _ && n.domObserver.suppressSelectionUpdates();
|
|
9191
9191
|
return;
|
|
9192
9192
|
}
|
|
9193
|
-
_ && p.endB == p.start && (n.input.lastChromeDelete = Date.now()), Ae && !
|
|
9193
|
+
_ && p.endB == p.start && (n.input.lastChromeDelete = Date.now()), Ae && !T && m.start() != g.start() && g.parentOffset == 0 && m.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, g = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
|
|
9194
9194
|
n.someProp("handleKeyDown", function(C) {
|
|
9195
9195
|
return C(n, _e(13, "Enter"));
|
|
9196
9196
|
});
|
|
@@ -9203,7 +9203,7 @@ function od(n, e, t, r, i) {
|
|
|
9203
9203
|
}
|
|
9204
9204
|
return s && A.setMeta("composition", s), A.scrollIntoView();
|
|
9205
9205
|
}, F;
|
|
9206
|
-
if (
|
|
9206
|
+
if (T)
|
|
9207
9207
|
if (m.pos == g.pos) {
|
|
9208
9208
|
se && He <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => De(n), 20));
|
|
9209
9209
|
let C = D(n.state.tr.delete(M, I)), A = d.resolve(p.start).marksAcross(d.resolve(p.endA));
|
|
@@ -10113,8 +10113,8 @@ function tl(n, e, t, r) {
|
|
|
10113
10113
|
let y = b.empty;
|
|
10114
10114
|
for (let M = p.length - 1; M >= 0; M--)
|
|
10115
10115
|
y = b.from(p[M].copy(y));
|
|
10116
|
-
let
|
|
10117
|
-
t(
|
|
10116
|
+
let T = n.tr.step(new V(e.pos - p.length, e.pos + s.nodeSize, e.pos + g, e.pos + s.nodeSize - g, new k(y, p.length, 0), 0, !0));
|
|
10117
|
+
t(T.scrollIntoView());
|
|
10118
10118
|
}
|
|
10119
10119
|
return !0;
|
|
10120
10120
|
}
|
|
@@ -10521,8 +10521,8 @@ function qd(n, e) {
|
|
|
10521
10521
|
options: c.options,
|
|
10522
10522
|
storage: c.storage,
|
|
10523
10523
|
editor: e
|
|
10524
|
-
}, f = n.reduce((y,
|
|
10525
|
-
const M = x(
|
|
10524
|
+
}, f = n.reduce((y, T) => {
|
|
10525
|
+
const M = x(T, "extendNodeSchema", u);
|
|
10526
10526
|
return {
|
|
10527
10527
|
...y,
|
|
10528
10528
|
...M ? M(c) : {}
|
|
@@ -10542,8 +10542,8 @@ function qd(n, e) {
|
|
|
10542
10542
|
defining: E(x(c, "defining", u)),
|
|
10543
10543
|
isolating: E(x(c, "isolating", u)),
|
|
10544
10544
|
attrs: Object.fromEntries(d.map((y) => {
|
|
10545
|
-
var
|
|
10546
|
-
return [y.name, { default: (
|
|
10545
|
+
var T;
|
|
10546
|
+
return [y.name, { default: (T = y == null ? void 0 : y.attribute) === null || T === void 0 ? void 0 : T.default }];
|
|
10547
10547
|
}))
|
|
10548
10548
|
}), p = E(x(c, "parseHTML", u));
|
|
10549
10549
|
p && (h.parseDOM = p.map((y) => fs(y, d)));
|
|
@@ -10561,10 +10561,10 @@ function qd(n, e) {
|
|
|
10561
10561
|
storage: c.storage,
|
|
10562
10562
|
editor: e
|
|
10563
10563
|
}, f = n.reduce((g, y) => {
|
|
10564
|
-
const
|
|
10564
|
+
const T = x(y, "extendMarkSchema", u);
|
|
10565
10565
|
return {
|
|
10566
10566
|
...g,
|
|
10567
|
-
...
|
|
10567
|
+
...T ? T(c) : {}
|
|
10568
10568
|
};
|
|
10569
10569
|
}, {}), h = hs({
|
|
10570
10570
|
...f,
|
|
@@ -10598,7 +10598,7 @@ function ps(n, e) {
|
|
|
10598
10598
|
return Array.isArray(e) ? e.some((t) => (typeof t == "string" ? t : t.name) === n.name) : e;
|
|
10599
10599
|
}
|
|
10600
10600
|
function si(n, e) {
|
|
10601
|
-
const t =
|
|
10601
|
+
const t = ut.fromSchema(e).serializeFragment(n), i = document.implementation.createHTMLDocument().createElement("div");
|
|
10602
10602
|
return i.appendChild(t), i.innerHTML;
|
|
10603
10603
|
}
|
|
10604
10604
|
const jd = (n, e = 500) => {
|
|
@@ -10657,7 +10657,7 @@ function an(n) {
|
|
|
10657
10657
|
}), g = {
|
|
10658
10658
|
from: r - (h[0].length - s.length),
|
|
10659
10659
|
to: i
|
|
10660
|
-
}, { commands: y, chain:
|
|
10660
|
+
}, { commands: y, chain: T, can: M } = new qn({
|
|
10661
10661
|
editor: t,
|
|
10662
10662
|
state: m
|
|
10663
10663
|
});
|
|
@@ -10666,7 +10666,7 @@ function an(n) {
|
|
|
10666
10666
|
range: g,
|
|
10667
10667
|
match: h,
|
|
10668
10668
|
commands: y,
|
|
10669
|
-
chain:
|
|
10669
|
+
chain: T,
|
|
10670
10670
|
can: M
|
|
10671
10671
|
}) === null || !p.steps.length || (p.setMeta(l, {
|
|
10672
10672
|
transform: p,
|
|
@@ -10925,10 +10925,10 @@ function Qd(n) {
|
|
|
10925
10925
|
}
|
|
10926
10926
|
},
|
|
10927
10927
|
appendTransaction: (u, f, h) => {
|
|
10928
|
-
const p = u[0], m = p.getMeta("uiEvent") === "paste" && !i, g = p.getMeta("uiEvent") === "drop" && !s, y = p.getMeta("applyPasteRules"),
|
|
10929
|
-
if (!m && !g && !
|
|
10928
|
+
const p = u[0], m = p.getMeta("uiEvent") === "paste" && !i, g = p.getMeta("uiEvent") === "drop" && !s, y = p.getMeta("applyPasteRules"), T = !!y;
|
|
10929
|
+
if (!m && !g && !T)
|
|
10930
10930
|
return;
|
|
10931
|
-
if (
|
|
10931
|
+
if (T) {
|
|
10932
10932
|
let { text: D } = y;
|
|
10933
10933
|
typeof D == "string" ? D = D : D = si(b.from(D), h.schema);
|
|
10934
10934
|
const { from: F } = y, C = F + D.length, A = Zd(D);
|
|
@@ -10956,9 +10956,9 @@ function eu(n) {
|
|
|
10956
10956
|
const e = n.filter((t, r) => n.indexOf(t) !== r);
|
|
10957
10957
|
return Array.from(new Set(e));
|
|
10958
10958
|
}
|
|
10959
|
-
class
|
|
10959
|
+
class yt {
|
|
10960
10960
|
constructor(e, t) {
|
|
10961
|
-
this.splittableMarks = [], this.editor = t, this.extensions =
|
|
10961
|
+
this.splittableMarks = [], this.editor = t, this.extensions = yt.resolve(e), this.schema = qd(this.extensions, t), this.setupExtensions();
|
|
10962
10962
|
}
|
|
10963
10963
|
/**
|
|
10964
10964
|
* Returns a flattened and sorted extension list while
|
|
@@ -10967,7 +10967,7 @@ class bt {
|
|
|
10967
10967
|
* @returns An flattened and sorted array of Tiptap extensions
|
|
10968
10968
|
*/
|
|
10969
10969
|
static resolve(e) {
|
|
10970
|
-
const t =
|
|
10970
|
+
const t = yt.sort(yt.flatten(e)), r = eu(t.map((i) => i.name));
|
|
10971
10971
|
return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((i) => `'${i}'`).join(", ")}]. This can lead to issues.`), t;
|
|
10972
10972
|
}
|
|
10973
10973
|
/**
|
|
@@ -11020,7 +11020,7 @@ class bt {
|
|
|
11020
11020
|
* @returns An array of Prosemirror plugins
|
|
11021
11021
|
*/
|
|
11022
11022
|
get plugins() {
|
|
11023
|
-
const { editor: e } = this, t =
|
|
11023
|
+
const { editor: e } = this, t = yt.sort([...this.extensions].reverse()), r = [], i = [], s = t.map((o) => {
|
|
11024
11024
|
const l = {
|
|
11025
11025
|
name: o.name,
|
|
11026
11026
|
options: o.options,
|
|
@@ -11704,11 +11704,11 @@ function Lr(n, e, t = {}) {
|
|
|
11704
11704
|
n.doc.nodesBetween(h, p, (m, g) => {
|
|
11705
11705
|
if (!m.isText && !m.marks.length)
|
|
11706
11706
|
return;
|
|
11707
|
-
const y = Math.max(h, g),
|
|
11707
|
+
const y = Math.max(h, g), T = Math.min(p, g + m.nodeSize), M = T - y;
|
|
11708
11708
|
o += M, l.push(...m.marks.map((I) => ({
|
|
11709
11709
|
mark: I,
|
|
11710
11710
|
from: y,
|
|
11711
|
-
to:
|
|
11711
|
+
to: T
|
|
11712
11712
|
})));
|
|
11713
11713
|
});
|
|
11714
11714
|
}), o === 0)
|
|
@@ -11870,16 +11870,16 @@ const lf = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11870
11870
|
return !1;
|
|
11871
11871
|
if (i) {
|
|
11872
11872
|
let y = b.empty;
|
|
11873
|
-
const
|
|
11874
|
-
for (let A = a.depth -
|
|
11873
|
+
const T = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
|
|
11874
|
+
for (let A = a.depth - T; A >= a.depth - 3; A -= 1)
|
|
11875
11875
|
y = b.from(a.node(A).copy(y));
|
|
11876
11876
|
const M = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3, I = {
|
|
11877
11877
|
...mn(f, a.node().type.name, a.node().attrs),
|
|
11878
11878
|
...e
|
|
11879
11879
|
}, D = ((o = l.contentMatch.defaultType) === null || o === void 0 ? void 0 : o.createAndFill(I)) || void 0;
|
|
11880
11880
|
y = y.append(b.from(l.createAndFill(null, D) || void 0));
|
|
11881
|
-
const F = a.before(a.depth - (
|
|
11882
|
-
t.replace(F, a.after(-M), new k(y, 4 -
|
|
11881
|
+
const F = a.before(a.depth - (T - 1));
|
|
11882
|
+
t.replace(F, a.after(-M), new k(y, 4 - T, 0));
|
|
11883
11883
|
let C = -1;
|
|
11884
11884
|
t.doc.nodesBetween(F, t.doc.content.size, (A, X) => {
|
|
11885
11885
|
if (C > -1)
|
|
@@ -11904,7 +11904,7 @@ const lf = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11904
11904
|
if (!Ne(t.doc, a.pos, 2))
|
|
11905
11905
|
return !1;
|
|
11906
11906
|
if (i) {
|
|
11907
|
-
const { selection: y, storedMarks:
|
|
11907
|
+
const { selection: y, storedMarks: T } = r, { splittableMarks: M } = s.extensionManager, I = T || y.$to.parentOffset && y.$from.marks();
|
|
11908
11908
|
if (t.split(a.pos, 2, g).scrollIntoView(), !I || !i)
|
|
11909
11909
|
return !0;
|
|
11910
11910
|
const D = I.filter((F) => M.includes(F.type.name));
|
|
@@ -11930,7 +11930,7 @@ const lf = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11930
11930
|
const i = n.doc.nodeAt(r);
|
|
11931
11931
|
return t.node.type === (i == null ? void 0 : i.type) && Ke(n.doc, r) && n.join(r), !0;
|
|
11932
11932
|
}, cf = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: d }) => {
|
|
11933
|
-
const { extensions: u, splittableMarks: f } = i.extensionManager, h = W(n, o.schema), p = W(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to:
|
|
11933
|
+
const { extensions: u, splittableMarks: f } = i.extensionManager, h = W(n, o.schema), p = W(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: T } = m, M = y.blockRange(T), I = g || m.$to.parentOffset && m.$from.marks();
|
|
11934
11934
|
if (!M)
|
|
11935
11935
|
return !1;
|
|
11936
11936
|
const D = ai((F) => bs(F.type.name, u))(m);
|
|
@@ -12007,8 +12007,8 @@ const lf = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
12007
12007
|
...e
|
|
12008
12008
|
}), o && m.marks.length && m.marks.forEach((y) => {
|
|
12009
12009
|
if (o === y.type) {
|
|
12010
|
-
const
|
|
12011
|
-
t.addMark(
|
|
12010
|
+
const T = Math.max(g, c), M = Math.min(g + m.nodeSize, d);
|
|
12011
|
+
t.addMark(T, M, o.create({
|
|
12012
12012
|
...y.attrs,
|
|
12013
12013
|
...e
|
|
12014
12014
|
}));
|
|
@@ -12614,7 +12614,7 @@ class Nf extends Vd {
|
|
|
12614
12614
|
Sf,
|
|
12615
12615
|
Of
|
|
12616
12616
|
].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s == null ? void 0 : s.type));
|
|
12617
|
-
this.extensionManager = new
|
|
12617
|
+
this.extensionManager = new yt(i, this);
|
|
12618
12618
|
}
|
|
12619
12619
|
/**
|
|
12620
12620
|
* Creates an command manager.
|
|
@@ -12658,7 +12658,7 @@ class Nf extends Vd {
|
|
|
12658
12658
|
...(e = this.options.editorProps) === null || e === void 0 ? void 0 : e.attributes
|
|
12659
12659
|
},
|
|
12660
12660
|
dispatchTransaction: this.dispatchTransaction.bind(this),
|
|
12661
|
-
state:
|
|
12661
|
+
state: gt.create({
|
|
12662
12662
|
doc: t,
|
|
12663
12663
|
selection: r || void 0
|
|
12664
12664
|
})
|
|
@@ -12818,7 +12818,7 @@ class Nf extends Vd {
|
|
|
12818
12818
|
return this.$pos(0);
|
|
12819
12819
|
}
|
|
12820
12820
|
}
|
|
12821
|
-
function
|
|
12821
|
+
function ct(n) {
|
|
12822
12822
|
return new Kn({
|
|
12823
12823
|
find: n.find,
|
|
12824
12824
|
handler: ({ state: e, range: t, match: r }) => {
|
|
@@ -12927,7 +12927,7 @@ class re {
|
|
|
12927
12927
|
})), t;
|
|
12928
12928
|
}
|
|
12929
12929
|
}
|
|
12930
|
-
function
|
|
12930
|
+
function dt(n) {
|
|
12931
12931
|
return new Gd({
|
|
12932
12932
|
find: n.find,
|
|
12933
12933
|
handler: ({ state: e, range: t, match: r, pasteEvent: i }) => {
|
|
@@ -13042,11 +13042,11 @@ const If = /^\s*>\s$/, Rf = re.create({
|
|
|
13042
13042
|
},
|
|
13043
13043
|
addInputRules() {
|
|
13044
13044
|
return [
|
|
13045
|
-
|
|
13045
|
+
ct({
|
|
13046
13046
|
find: Pf,
|
|
13047
13047
|
type: this.type
|
|
13048
13048
|
}),
|
|
13049
|
-
|
|
13049
|
+
ct({
|
|
13050
13050
|
find: Lf,
|
|
13051
13051
|
type: this.type
|
|
13052
13052
|
})
|
|
@@ -13054,11 +13054,11 @@ const If = /^\s*>\s$/, Rf = re.create({
|
|
|
13054
13054
|
},
|
|
13055
13055
|
addPasteRules() {
|
|
13056
13056
|
return [
|
|
13057
|
-
|
|
13057
|
+
dt({
|
|
13058
13058
|
find: Bf,
|
|
13059
13059
|
type: this.type
|
|
13060
13060
|
}),
|
|
13061
|
-
|
|
13061
|
+
dt({
|
|
13062
13062
|
find: zf,
|
|
13063
13063
|
type: this.type
|
|
13064
13064
|
})
|
|
@@ -13144,7 +13144,7 @@ const If = /^\s*>\s$/, Rf = re.create({
|
|
|
13144
13144
|
},
|
|
13145
13145
|
addInputRules() {
|
|
13146
13146
|
return [
|
|
13147
|
-
|
|
13147
|
+
ct({
|
|
13148
13148
|
find: Hf,
|
|
13149
13149
|
type: this.type
|
|
13150
13150
|
})
|
|
@@ -13152,7 +13152,7 @@ const If = /^\s*>\s$/, Rf = re.create({
|
|
|
13152
13152
|
},
|
|
13153
13153
|
addPasteRules() {
|
|
13154
13154
|
return [
|
|
13155
|
-
|
|
13155
|
+
dt({
|
|
13156
13156
|
find: Wf,
|
|
13157
13157
|
type: this.type
|
|
13158
13158
|
})
|
|
@@ -13937,15 +13937,15 @@ class Pe {
|
|
|
13937
13937
|
}
|
|
13938
13938
|
const dh = 20;
|
|
13939
13939
|
function uh(n, e, t, r) {
|
|
13940
|
-
let i = t.getMeta(
|
|
13940
|
+
let i = t.getMeta(it), s;
|
|
13941
13941
|
if (i)
|
|
13942
13942
|
return i.historyState;
|
|
13943
13943
|
t.getMeta(ph) && (n = new Pe(n.done, n.undone, null, 0, -1));
|
|
13944
13944
|
let o = t.getMeta("appendedTransaction");
|
|
13945
13945
|
if (t.steps.length == 0)
|
|
13946
13946
|
return n;
|
|
13947
|
-
if (o && o.getMeta(
|
|
13948
|
-
return o.getMeta(
|
|
13947
|
+
if (o && o.getMeta(it))
|
|
13948
|
+
return o.getMeta(it).redo ? new Pe(n.done.addTransform(t, void 0, r, gn(e)), n.undone, ws(t.mapping.maps), n.prevTime, n.prevComposition) : new Pe(n.done, n.undone.addTransform(t, void 0, r, gn(e)), null, n.prevTime, n.prevComposition);
|
|
13949
13949
|
if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
13950
13950
|
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !fh(t, n.prevRanges)), c = o ? hr(n.prevRanges, t.mapping) : ws(t.mapping.maps);
|
|
13951
13951
|
return new Pe(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, gn(e)), ge.empty, c, t.time, l ?? n.prevComposition);
|
|
@@ -13979,11 +13979,11 @@ function hr(n, e) {
|
|
|
13979
13979
|
return t;
|
|
13980
13980
|
}
|
|
13981
13981
|
function hh(n, e, t) {
|
|
13982
|
-
let r = gn(e), i =
|
|
13982
|
+
let r = gn(e), i = it.get(e).spec.config, s = (t ? n.undone : n.done).popEvent(e, r);
|
|
13983
13983
|
if (!s)
|
|
13984
13984
|
return null;
|
|
13985
13985
|
let o = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), i, r), a = new Pe(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
|
|
13986
|
-
return s.transform.setSelection(o).setMeta(
|
|
13986
|
+
return s.transform.setSelection(o).setMeta(it, { redo: t, historyState: a });
|
|
13987
13987
|
}
|
|
13988
13988
|
let pr = !1, Ms = null;
|
|
13989
13989
|
function gn(n) {
|
|
@@ -13998,13 +13998,13 @@ function gn(n) {
|
|
|
13998
13998
|
}
|
|
13999
13999
|
return pr;
|
|
14000
14000
|
}
|
|
14001
|
-
const
|
|
14001
|
+
const it = new Ce("history"), ph = new Ce("closeHistory");
|
|
14002
14002
|
function mh(n = {}) {
|
|
14003
14003
|
return n = {
|
|
14004
14004
|
depth: n.depth || 100,
|
|
14005
14005
|
newGroupDelay: n.newGroupDelay || 500
|
|
14006
14006
|
}, new oe({
|
|
14007
|
-
key:
|
|
14007
|
+
key: it,
|
|
14008
14008
|
state: {
|
|
14009
14009
|
init() {
|
|
14010
14010
|
return new Pe(ge.empty, ge.empty, null, 0, -1);
|
|
@@ -14026,7 +14026,7 @@ function mh(n = {}) {
|
|
|
14026
14026
|
}
|
|
14027
14027
|
function yl(n, e) {
|
|
14028
14028
|
return (t, r) => {
|
|
14029
|
-
let i =
|
|
14029
|
+
let i = it.getState(t);
|
|
14030
14030
|
if (!i || (n ? i.undone : i.done).eventCount == 0)
|
|
14031
14031
|
return !1;
|
|
14032
14032
|
if (r) {
|
|
@@ -14160,11 +14160,11 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
|
|
|
14160
14160
|
},
|
|
14161
14161
|
addInputRules() {
|
|
14162
14162
|
return [
|
|
14163
|
-
|
|
14163
|
+
ct({
|
|
14164
14164
|
find: bh,
|
|
14165
14165
|
type: this.type
|
|
14166
14166
|
}),
|
|
14167
|
-
|
|
14167
|
+
ct({
|
|
14168
14168
|
find: xh,
|
|
14169
14169
|
type: this.type
|
|
14170
14170
|
})
|
|
@@ -14172,11 +14172,11 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
|
|
|
14172
14172
|
},
|
|
14173
14173
|
addPasteRules() {
|
|
14174
14174
|
return [
|
|
14175
|
-
|
|
14175
|
+
dt({
|
|
14176
14176
|
find: kh,
|
|
14177
14177
|
type: this.type
|
|
14178
14178
|
}),
|
|
14179
|
-
|
|
14179
|
+
dt({
|
|
14180
14180
|
find: Sh,
|
|
14181
14181
|
type: this.type
|
|
14182
14182
|
})
|
|
@@ -14346,7 +14346,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
|
|
|
14346
14346
|
},
|
|
14347
14347
|
addInputRules() {
|
|
14348
14348
|
return [
|
|
14349
|
-
|
|
14349
|
+
ct({
|
|
14350
14350
|
find: vh,
|
|
14351
14351
|
type: this.type
|
|
14352
14352
|
})
|
|
@@ -14354,7 +14354,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
|
|
|
14354
14354
|
},
|
|
14355
14355
|
addPasteRules() {
|
|
14356
14356
|
return [
|
|
14357
|
-
|
|
14357
|
+
dt({
|
|
14358
14358
|
find: Eh,
|
|
14359
14359
|
type: this.type
|
|
14360
14360
|
})
|
|
@@ -14486,7 +14486,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
|
|
|
14486
14486
|
},
|
|
14487
14487
|
addInputRules() {
|
|
14488
14488
|
return [
|
|
14489
|
-
|
|
14489
|
+
ct({
|
|
14490
14490
|
find: Bh,
|
|
14491
14491
|
type: this.type
|
|
14492
14492
|
})
|
|
@@ -14494,7 +14494,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), gh = G.create({
|
|
|
14494
14494
|
},
|
|
14495
14495
|
addPasteRules() {
|
|
14496
14496
|
return [
|
|
14497
|
-
|
|
14497
|
+
dt({
|
|
14498
14498
|
find: Lh,
|
|
14499
14499
|
type: this.type
|
|
14500
14500
|
})
|
|
@@ -14614,12 +14614,12 @@ class Hh extends Rl {
|
|
|
14614
14614
|
super.connectedCallback() && (R(this, de, xl).call(this), R(this, de, Sl).call(this), R(this, de, Fr).call(this));
|
|
14615
14615
|
}
|
|
14616
14616
|
get value() {
|
|
14617
|
-
return
|
|
14617
|
+
return O(this, ie).getHTML();
|
|
14618
14618
|
}
|
|
14619
14619
|
set value(t) {
|
|
14620
14620
|
let r = t || "";
|
|
14621
14621
|
r && !/<\/?[a-z][^>]*>/i.test(r) && (r = r.split(`
|
|
14622
|
-
`).map((i) => `<p>${i}</p>`).join("")),
|
|
14622
|
+
`).map((i) => `<p>${i}</p>`).join("")), O(this, ie) ? O(this, ie).commands.setContent(r, !1) : Y(this, en, r);
|
|
14623
14623
|
}
|
|
14624
14624
|
get id() {
|
|
14625
14625
|
return this.getAttribute("id");
|
|
@@ -14641,14 +14641,14 @@ class Hh extends Rl {
|
|
|
14641
14641
|
t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), R(this, de, Fr).call(this);
|
|
14642
14642
|
}
|
|
14643
14643
|
disconnectedCallback() {
|
|
14644
|
-
|
|
14644
|
+
O(this, ie) && (O(this, ie).destroy(), Y(this, ie, null));
|
|
14645
14645
|
}
|
|
14646
14646
|
}
|
|
14647
14647
|
ie = new WeakMap(), Qt = new WeakMap(), en = new WeakMap(), de = new WeakSet(), // 2. 에디터 상태 업데이트 로직 분리
|
|
14648
14648
|
Fr = function() {
|
|
14649
|
-
if (
|
|
14649
|
+
if (O(this, ie)) {
|
|
14650
14650
|
const t = this.readonly;
|
|
14651
|
-
|
|
14651
|
+
O(this, ie).setEditable(!t);
|
|
14652
14652
|
const r = this.shadowRoot.querySelector(".menu-bar");
|
|
14653
14653
|
r && (r.style.display = t ? "none" : "flex");
|
|
14654
14654
|
}
|
|
@@ -14656,7 +14656,7 @@ Fr = function() {
|
|
|
14656
14656
|
const t = zt.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
|
|
14657
14657
|
this.shadowRoot.innerHTML = `
|
|
14658
14658
|
<style>
|
|
14659
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
14659
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.106/dist/css/nineEditor.css";
|
|
14660
14660
|
${r}
|
|
14661
14661
|
</style>
|
|
14662
14662
|
|
|
@@ -14693,11 +14693,11 @@ Fr = function() {
|
|
|
14693
14693
|
<div id="editor-container"></div>
|
|
14694
14694
|
`, Y(this, Qt, this.shadowRoot.querySelector("#editor-container")), this.shadowRoot.querySelector("#font-size").onchange = (i) => {
|
|
14695
14695
|
const s = i.target.value;
|
|
14696
|
-
console.log(i.target, s),
|
|
14696
|
+
console.log(i.target, s), O(this, ie).chain().focus().setMark("textStyle", { fontSize: s }).run();
|
|
14697
14697
|
};
|
|
14698
14698
|
}, Sl = function() {
|
|
14699
14699
|
Y(this, ie, new Nf({
|
|
14700
|
-
element:
|
|
14700
|
+
element: O(this, Qt),
|
|
14701
14701
|
editable: !this.readonly,
|
|
14702
14702
|
// 4. 생성 시 readonly 여부 반영
|
|
14703
14703
|
extensions: [
|
|
@@ -14723,7 +14723,7 @@ Fr = function() {
|
|
|
14723
14723
|
}
|
|
14724
14724
|
})
|
|
14725
14725
|
],
|
|
14726
|
-
content:
|
|
14726
|
+
content: O(this, en) || this.originContents || "",
|
|
14727
14727
|
onUpdate: ({ editor: t }) => {
|
|
14728
14728
|
this.dispatchEvent(new CustomEvent("change", { detail: t.getHTML() }));
|
|
14729
14729
|
},
|
|
@@ -14742,7 +14742,7 @@ Fr = function() {
|
|
|
14742
14742
|
const s = this.shadowRoot.querySelector("#color-picker");
|
|
14743
14743
|
s && (s.value = r.color || "#000000");
|
|
14744
14744
|
}, Ml = function() {
|
|
14745
|
-
const t =
|
|
14745
|
+
const t = O(this, ie);
|
|
14746
14746
|
this.shadowRoot.querySelectorAll("[data-cmd]").forEach((r) => {
|
|
14747
14747
|
r.onclick = () => {
|
|
14748
14748
|
const i = r.dataset.cmd;
|
|
@@ -14771,12 +14771,12 @@ const ve = typeof window < "u" && window.nine ? window.nine : Es, Os = {
|
|
|
14771
14771
|
});
|
|
14772
14772
|
};
|
|
14773
14773
|
Wh();
|
|
14774
|
-
var
|
|
14774
|
+
var xt, St, ye, Cl, It, Tl;
|
|
14775
14775
|
class qh extends HTMLElement {
|
|
14776
14776
|
constructor() {
|
|
14777
14777
|
super();
|
|
14778
14778
|
B(this, ye);
|
|
14779
|
-
B(this,
|
|
14779
|
+
B(this, xt, !1);
|
|
14780
14780
|
B(this, St);
|
|
14781
14781
|
Y(this, St, this.attachShadow({ mode: "open" }));
|
|
14782
14782
|
}
|
|
@@ -14784,44 +14784,44 @@ class qh extends HTMLElement {
|
|
|
14784
14784
|
return ["lang", "code"];
|
|
14785
14785
|
}
|
|
14786
14786
|
connectedCallback() {
|
|
14787
|
-
R(this, ye, It).call(this);
|
|
14787
|
+
!this.getAttribute("code") && this.textContent.trim() && this.setAttribute("code", this.textContent.trim()), R(this, ye, It).call(this);
|
|
14788
14788
|
}
|
|
14789
14789
|
attributeChangedCallback() {
|
|
14790
14790
|
R(this, ye, It).call(this);
|
|
14791
14791
|
}
|
|
14792
14792
|
}
|
|
14793
|
-
|
|
14793
|
+
xt = new WeakMap(), St = new WeakMap(), ye = new WeakSet(), Cl = async function() {
|
|
14794
14794
|
const t = this.getAttribute("code") || "";
|
|
14795
14795
|
try {
|
|
14796
|
-
await navigator.clipboard.writeText(t), Y(this,
|
|
14797
|
-
Y(this,
|
|
14796
|
+
await navigator.clipboard.writeText(t), Y(this, xt, !0), R(this, ye, It).call(this), setTimeout(() => {
|
|
14797
|
+
Y(this, xt, !1), R(this, ye, It).call(this);
|
|
14798
14798
|
}, 2e3);
|
|
14799
14799
|
} catch (r) {
|
|
14800
14800
|
console.error("Code copy failed:", r);
|
|
14801
14801
|
}
|
|
14802
14802
|
}, It = function() {
|
|
14803
|
-
const t = this.getAttribute("lang") || "Bash", r = this.getAttribute("code") || "", i = this.getAttribute("css-path")
|
|
14804
|
-
|
|
14805
|
-
|
|
14806
|
-
|
|
14807
|
-
|
|
14808
|
-
|
|
14809
|
-
|
|
14810
|
-
|
|
14811
|
-
|
|
14812
|
-
|
|
14813
|
-
|
|
14814
|
-
|
|
14815
|
-
|
|
14816
|
-
|
|
14817
|
-
|
|
14818
|
-
|
|
14819
|
-
|
|
14820
|
-
|
|
14821
|
-
|
|
14822
|
-
|
|
14823
|
-
|
|
14824
|
-
|
|
14803
|
+
const t = this.getAttribute("lang") || "Bash", r = this.getAttribute("code") || this.textContent.trim() || "", i = this.getAttribute("css-path");
|
|
14804
|
+
O(this, St).innerHTML = `
|
|
14805
|
+
<style>
|
|
14806
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.106/dist/css/nine-code-block.css";
|
|
14807
|
+
${i ? `@import "${i}";` : ""}
|
|
14808
|
+
</style>
|
|
14809
|
+
|
|
14810
|
+
<div class="wrapper">
|
|
14811
|
+
<div class="header">
|
|
14812
|
+
<div class="dots">
|
|
14813
|
+
<span class="dot red"></span>
|
|
14814
|
+
<span class="dot yellow"></span>
|
|
14815
|
+
<span class="dot green"></span>
|
|
14816
|
+
</div>
|
|
14817
|
+
<span class="lang">${t}</span>
|
|
14818
|
+
<button class="copy-btn ${O(this, xt) ? "copied" : ""}" aria-label="Copy Code"></button>
|
|
14819
|
+
</div>
|
|
14820
|
+
<div class="content">
|
|
14821
|
+
<pre><code>${R(this, ye, Tl).call(this, r)}</code></pre>
|
|
14822
|
+
</div>
|
|
14823
|
+
</div>
|
|
14824
|
+
`, O(this, St).querySelector(".copy-btn").onclick = () => R(this, ye, Cl).call(this);
|
|
14825
14825
|
}, Tl = function(t) {
|
|
14826
14826
|
const r = document.createElement("div");
|
|
14827
14827
|
return r.textContent = t, r.innerHTML;
|