@nine-lab/nine-ux 0.1.6 → 0.1.8
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 +274 -274
- package/dist/nine-ux.es.js.map +1 -1
- package/dist/nine-ux.umd.js +3 -3
- package/dist/nine-ux.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-ux.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var ul = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var Qr = (n) => {
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
5
|
var dl = (n, e, t) => e in n ? ul(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
6
|
-
var Ne = (n, e, t) => dl(n, typeof e != "symbol" ? e + "" : e, t), zn = (n, e, t) => e.has(n) ||
|
|
7
|
-
var I = (n, e, t) => (zn(n, e, "read from private field"), t ? t.call(n) : e.get(n)), ae = (n, e, t) => e.has(n) ?
|
|
8
|
-
class
|
|
6
|
+
var Ne = (n, e, t) => dl(n, typeof e != "symbol" ? e + "" : e, t), zn = (n, e, t) => e.has(n) || Qr("Cannot " + t);
|
|
7
|
+
var I = (n, e, t) => (zn(n, e, "read from private field"), t ? t.call(n) : e.get(n)), ae = (n, e, t) => e.has(n) ? Qr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), me = (n, e, t, r) => (zn(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), X = (n, e, t) => (zn(n, e, "access private method"), t);
|
|
8
|
+
class Er extends HTMLElement {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(), this.attachShadow({ mode: "open" });
|
|
11
11
|
}
|
|
@@ -21,7 +21,7 @@ class fs extends HTMLElement {
|
|
|
21
21
|
`;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
Ne(
|
|
24
|
+
Ne(Er, "confirm", async (e, t = "Confirm", r = {}) => {
|
|
25
25
|
var u;
|
|
26
26
|
const i = {
|
|
27
27
|
"true-text": "Yes",
|
|
@@ -31,7 +31,7 @@ Ne(fs, "confirm", async (e, t = "Confirm", r = {}) => {
|
|
|
31
31
|
...((u = Cn.options) == null ? void 0 : u.confirm) || {},
|
|
32
32
|
...r
|
|
33
33
|
};
|
|
34
|
-
document.querySelectorAll("
|
|
34
|
+
document.querySelectorAll("nine-confirm-popup").forEach((d) => d.remove());
|
|
35
35
|
const s = document.createElement("nx-confirm-popup");
|
|
36
36
|
i.class && s.classList.add(...i.class.split(" ")), i.animation && s.classList.add(i.animation), document.body.appendChild(s);
|
|
37
37
|
const o = s.shadowRoot.querySelector("nine-dialog"), l = s.shadowRoot.querySelector(".ok"), a = s.shadowRoot.querySelector(".cancel"), c = s.shadowRoot.querySelector(".msg");
|
|
@@ -43,7 +43,7 @@ Ne(fs, "confirm", async (e, t = "Confirm", r = {}) => {
|
|
|
43
43
|
}, o.addEventListener("close", () => d(void 0)), o.showModal();
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
|
-
class
|
|
46
|
+
class Nr extends HTMLElement {
|
|
47
47
|
constructor() {
|
|
48
48
|
super(), this.attachShadow({ mode: "open" });
|
|
49
49
|
}
|
|
@@ -58,7 +58,7 @@ class hs extends HTMLElement {
|
|
|
58
58
|
`;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
Ne(
|
|
61
|
+
Ne(Nr, "alert", async (e, t = "Alert", r = {}) => {
|
|
62
62
|
var c;
|
|
63
63
|
const i = {
|
|
64
64
|
class: "",
|
|
@@ -66,19 +66,19 @@ Ne(hs, "alert", async (e, t = "Alert", r = {}) => {
|
|
|
66
66
|
...((c = Cn.options) == null ? void 0 : c.alert) || {},
|
|
67
67
|
...r
|
|
68
68
|
};
|
|
69
|
-
document.querySelectorAll("
|
|
69
|
+
document.querySelectorAll("nine-alert-popup").forEach((u) => u.remove());
|
|
70
70
|
const s = document.createElement("nx-alert-popup");
|
|
71
71
|
i.class && s.classList.add(...i.class.split(" ")), i.animation && s.classList.add(i.animation), document.body.appendChild(s);
|
|
72
72
|
const o = s.shadowRoot.querySelector("nine-dialog"), l = s.shadowRoot.querySelector(".cancel"), a = s.shadowRoot.querySelector(".msg");
|
|
73
|
-
return o.setAttribute("title", t), a.innerHTML = e.replace(/\n/g, "<br/>"), new Promise((u) => {
|
|
73
|
+
return console.log("======================="), console.log(o), console.log("======================="), o == null || o.setAttribute("title", t), a.innerHTML = e.replace(/\n/g, "<br/>"), new Promise((u) => {
|
|
74
74
|
const d = () => {
|
|
75
75
|
u(!1), o.querySelector(".close").click();
|
|
76
76
|
};
|
|
77
77
|
l.onclick = d, o.showModal();
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
|
-
customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup",
|
|
81
|
-
customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup",
|
|
80
|
+
customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", Er);
|
|
81
|
+
customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", Nr);
|
|
82
82
|
var we;
|
|
83
83
|
class fl {
|
|
84
84
|
constructor() {
|
|
@@ -109,13 +109,13 @@ class fl {
|
|
|
109
109
|
* 알림창(Alert) 실행
|
|
110
110
|
*/
|
|
111
111
|
async alert(e, t = "Alert", r = {}) {
|
|
112
|
-
return await
|
|
112
|
+
return await Nr.alert(e, t, r);
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
115
|
* 확인창(Confirm) 실행
|
|
116
116
|
*/
|
|
117
117
|
async confirm(e, t = "Confirm", r = {}) {
|
|
118
|
-
return await
|
|
118
|
+
return await Er.confirm(e, t, r);
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
121
|
* 컴포넌트별 CSS 경로 생성 헬퍼
|
|
@@ -1160,7 +1160,7 @@ class Dt {
|
|
|
1160
1160
|
@internal
|
|
1161
1161
|
*/
|
|
1162
1162
|
static resolveCached(e, t) {
|
|
1163
|
-
let r =
|
|
1163
|
+
let r = ei.get(e);
|
|
1164
1164
|
if (r)
|
|
1165
1165
|
for (let s = 0; s < r.elts.length; s++) {
|
|
1166
1166
|
let o = r.elts[s];
|
|
@@ -1168,7 +1168,7 @@ class Dt {
|
|
|
1168
1168
|
return o;
|
|
1169
1169
|
}
|
|
1170
1170
|
else
|
|
1171
|
-
|
|
1171
|
+
ei.set(e, r = new gl());
|
|
1172
1172
|
let i = r.elts[r.i] = Dt.resolve(e, t);
|
|
1173
1173
|
return r.i = (r.i + 1) % yl, i;
|
|
1174
1174
|
}
|
|
@@ -1178,7 +1178,7 @@ class gl {
|
|
|
1178
1178
|
this.elts = [], this.i = 0;
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
1181
|
-
const yl = 12,
|
|
1181
|
+
const yl = 12, ei = /* @__PURE__ */ new WeakMap();
|
|
1182
1182
|
class dn {
|
|
1183
1183
|
/**
|
|
1184
1184
|
Construct a node range. `$from` and `$to` should point into the
|
|
@@ -1839,14 +1839,14 @@ function Sl(n) {
|
|
|
1839
1839
|
break;
|
|
1840
1840
|
return e;
|
|
1841
1841
|
}
|
|
1842
|
-
function
|
|
1842
|
+
function ti(n) {
|
|
1843
1843
|
/\D/.test(n.next) && n.err("Expected number, got '" + n.next + "'");
|
|
1844
1844
|
let e = Number(n.next);
|
|
1845
1845
|
return n.pos++, e;
|
|
1846
1846
|
}
|
|
1847
1847
|
function Ml(n, e) {
|
|
1848
|
-
let t =
|
|
1849
|
-
return n.eat(",") && (n.next != "}" ? r =
|
|
1848
|
+
let t = ti(n), r = t;
|
|
1849
|
+
return n.eat(",") && (n.next != "}" ? r = ti(n) : r = -1), n.eat("}") || n.err("Unclosed braced range"), { type: "range", min: t, max: r, expr: e };
|
|
1850
1850
|
}
|
|
1851
1851
|
function Cl(n, e) {
|
|
1852
1852
|
let t = n.nodeTypes, r = t[e];
|
|
@@ -1927,7 +1927,7 @@ function Tl(n) {
|
|
|
1927
1927
|
function Cs(n, e) {
|
|
1928
1928
|
return e - n;
|
|
1929
1929
|
}
|
|
1930
|
-
function
|
|
1930
|
+
function ni(n, e) {
|
|
1931
1931
|
let t = [];
|
|
1932
1932
|
return r(e), t.sort(Cs);
|
|
1933
1933
|
function r(i) {
|
|
@@ -1943,7 +1943,7 @@ function ei(n, e) {
|
|
|
1943
1943
|
}
|
|
1944
1944
|
function Ol(n) {
|
|
1945
1945
|
let e = /* @__PURE__ */ Object.create(null);
|
|
1946
|
-
return t(
|
|
1946
|
+
return t(ni(n, 0));
|
|
1947
1947
|
function t(r) {
|
|
1948
1948
|
let i = [];
|
|
1949
1949
|
r.forEach((o) => {
|
|
@@ -1953,7 +1953,7 @@ function Ol(n) {
|
|
|
1953
1953
|
let c;
|
|
1954
1954
|
for (let u = 0; u < i.length; u++)
|
|
1955
1955
|
i[u][0] == l && (c = i[u][1]);
|
|
1956
|
-
|
|
1956
|
+
ni(n, a).forEach((u) => {
|
|
1957
1957
|
c || i.push([l, c = []]), c.indexOf(u) == -1 && c.push(u);
|
|
1958
1958
|
});
|
|
1959
1959
|
});
|
|
@@ -2017,7 +2017,7 @@ function Es(n, e) {
|
|
|
2017
2017
|
t[r] = new Al(n, r, e[r]);
|
|
2018
2018
|
return t;
|
|
2019
2019
|
}
|
|
2020
|
-
let
|
|
2020
|
+
let ri = class Ns {
|
|
2021
2021
|
/**
|
|
2022
2022
|
@internal
|
|
2023
2023
|
*/
|
|
@@ -2276,7 +2276,7 @@ class As {
|
|
|
2276
2276
|
let t = this.spec = {};
|
|
2277
2277
|
for (let i in e)
|
|
2278
2278
|
t[i] = e[i];
|
|
2279
|
-
t.nodes = W.from(e.nodes), t.marks = W.from(e.marks || {}), this.nodes =
|
|
2279
|
+
t.nodes = W.from(e.nodes), t.marks = W.from(e.marks || {}), this.nodes = ri.compile(this.spec.nodes, this), this.marks = wn.compile(this.spec.marks, this);
|
|
2280
2280
|
let r = /* @__PURE__ */ Object.create(null);
|
|
2281
2281
|
for (let i in this.nodes) {
|
|
2282
2282
|
if (i in this.marks)
|
|
@@ -2289,11 +2289,11 @@ class As {
|
|
|
2289
2289
|
throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");
|
|
2290
2290
|
this.linebreakReplacement = s;
|
|
2291
2291
|
}
|
|
2292
|
-
s.markSet = l == "_" ? null : l ?
|
|
2292
|
+
s.markSet = l == "_" ? null : l ? ii(this, l.split(" ")) : l == "" || !s.inlineContent ? [] : null;
|
|
2293
2293
|
}
|
|
2294
2294
|
for (let i in this.marks) {
|
|
2295
2295
|
let s = this.marks[i], o = s.spec.excludes;
|
|
2296
|
-
s.excluded = o == null ? [s] : o == "" ? [] :
|
|
2296
|
+
s.excluded = o == null ? [s] : o == "" ? [] : ii(this, o.split(" "));
|
|
2297
2297
|
}
|
|
2298
2298
|
this.nodeFromJSON = (i) => Le.fromJSON(this, i), this.markFromJSON = (i) => A.fromJSON(this, i), this.topNodeType = this.nodes[this.spec.topNode || "doc"], this.cached.wrappings = /* @__PURE__ */ Object.create(null);
|
|
2299
2299
|
}
|
|
@@ -2306,7 +2306,7 @@ class As {
|
|
|
2306
2306
|
node(e, t = null, r, i) {
|
|
2307
2307
|
if (typeof e == "string")
|
|
2308
2308
|
e = this.nodeType(e);
|
|
2309
|
-
else if (e instanceof
|
|
2309
|
+
else if (e instanceof ri) {
|
|
2310
2310
|
if (e.schema != this)
|
|
2311
2311
|
throw new RangeError("Node type from different schema used (" + e.name + ")");
|
|
2312
2312
|
} else throw new RangeError("Invalid node type: " + e);
|
|
@@ -2336,7 +2336,7 @@ class As {
|
|
|
2336
2336
|
return t;
|
|
2337
2337
|
}
|
|
2338
2338
|
}
|
|
2339
|
-
function
|
|
2339
|
+
function ii(n, e) {
|
|
2340
2340
|
let t = [];
|
|
2341
2341
|
for (let r = 0; r < e.length; r++) {
|
|
2342
2342
|
let i = e[r], s = n.marks[i], o = s;
|
|
@@ -2384,7 +2384,7 @@ class ze {
|
|
|
2384
2384
|
Parse a document from the content of a DOM node.
|
|
2385
2385
|
*/
|
|
2386
2386
|
parse(e, t = {}) {
|
|
2387
|
-
let r = new
|
|
2387
|
+
let r = new oi(this, t, !1);
|
|
2388
2388
|
return r.addAll(e, A.none, t.from, t.to), r.finish();
|
|
2389
2389
|
}
|
|
2390
2390
|
/**
|
|
@@ -2396,7 +2396,7 @@ class ze {
|
|
|
2396
2396
|
the left of the input and the end of nodes at the end.
|
|
2397
2397
|
*/
|
|
2398
2398
|
parseSlice(e, t = {}) {
|
|
2399
|
-
let r = new
|
|
2399
|
+
let r = new oi(this, t, !0);
|
|
2400
2400
|
return r.addAll(e, A.none, t.from, t.to), k.maxOpen(r.finish());
|
|
2401
2401
|
}
|
|
2402
2402
|
/**
|
|
@@ -2453,13 +2453,13 @@ class ze {
|
|
|
2453
2453
|
for (let i in e.marks) {
|
|
2454
2454
|
let s = e.marks[i].spec.parseDOM;
|
|
2455
2455
|
s && s.forEach((o) => {
|
|
2456
|
-
r(o =
|
|
2456
|
+
r(o = li(o)), o.mark || o.ignore || o.clearMark || (o.mark = i);
|
|
2457
2457
|
});
|
|
2458
2458
|
}
|
|
2459
2459
|
for (let i in e.nodes) {
|
|
2460
2460
|
let s = e.nodes[i].spec.parseDOM;
|
|
2461
2461
|
s && s.forEach((o) => {
|
|
2462
|
-
r(o =
|
|
2462
|
+
r(o = li(o)), o.node || o.ignore || o.mark || (o.node = i);
|
|
2463
2463
|
});
|
|
2464
2464
|
}
|
|
2465
2465
|
return t;
|
|
@@ -2514,7 +2514,7 @@ const vs = {
|
|
|
2514
2514
|
style: !0,
|
|
2515
2515
|
title: !0
|
|
2516
2516
|
}, Ds = { ol: !0, ul: !0 }, It = 1, cr = 2, Nt = 4;
|
|
2517
|
-
function
|
|
2517
|
+
function si(n, e, t) {
|
|
2518
2518
|
return e != null ? (e ? It : 0) | (e === "full" ? cr : 0) : n && n.whitespace == "pre" ? It | cr : t & ~Nt;
|
|
2519
2519
|
}
|
|
2520
2520
|
class Yt {
|
|
@@ -2550,10 +2550,10 @@ class Yt {
|
|
|
2550
2550
|
return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !vs.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
|
|
2551
2551
|
}
|
|
2552
2552
|
}
|
|
2553
|
-
class
|
|
2553
|
+
class oi {
|
|
2554
2554
|
constructor(e, t, r) {
|
|
2555
2555
|
this.parser = e, this.options = t, this.isOpen = r, this.open = 0, this.localPreserveWS = !1;
|
|
2556
|
-
let i = t.topNode, s, o =
|
|
2556
|
+
let i = t.topNode, s, o = si(null, t.preserveWhitespace, 0) | (r ? Nt : 0);
|
|
2557
2557
|
i ? s = new Yt(i.type, i.attrs, A.none, !0, t.topMatch || i.type.contentMatch, o) : r ? s = new Yt(null, null, A.none, !0, null, o) : s = new Yt(e.schema.topNodeType, null, A.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
|
|
2558
2558
|
}
|
|
2559
2559
|
get top() {
|
|
@@ -2719,7 +2719,7 @@ class ii {
|
|
|
2719
2719
|
s.match && (s.match = s.match.matchType(e.type));
|
|
2720
2720
|
let o = A.none;
|
|
2721
2721
|
for (let l of i.concat(e.marks))
|
|
2722
|
-
(s.type ? s.type.allowsMarkType(l.type) :
|
|
2722
|
+
(s.type ? s.type.allowsMarkType(l.type) : ai(l.type, e.type)) && (o = l.addToSet(o));
|
|
2723
2723
|
return s.content.push(e.mark(o)), !0;
|
|
2724
2724
|
}
|
|
2725
2725
|
return !1;
|
|
@@ -2735,10 +2735,10 @@ class ii {
|
|
|
2735
2735
|
this.closeExtra();
|
|
2736
2736
|
let o = this.top;
|
|
2737
2737
|
o.match = o.match && o.match.matchType(e);
|
|
2738
|
-
let l =
|
|
2738
|
+
let l = si(e, s, o.options);
|
|
2739
2739
|
o.options & Nt && o.content.length == 0 && (l |= Nt);
|
|
2740
2740
|
let a = A.none;
|
|
2741
|
-
return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) :
|
|
2741
|
+
return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : ai(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new Yt(e, t, a, i, null, l)), this.open++, r;
|
|
2742
2742
|
}
|
|
2743
2743
|
// Make sure all nodes above this.open are finished and added to
|
|
2744
2744
|
// their parents
|
|
@@ -2841,13 +2841,13 @@ function Rl(n) {
|
|
|
2841
2841
|
function Pl(n, e) {
|
|
2842
2842
|
return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
|
|
2843
2843
|
}
|
|
2844
|
-
function
|
|
2844
|
+
function li(n) {
|
|
2845
2845
|
let e = {};
|
|
2846
2846
|
for (let t in n)
|
|
2847
2847
|
e[t] = n[t];
|
|
2848
2848
|
return e;
|
|
2849
2849
|
}
|
|
2850
|
-
function
|
|
2850
|
+
function ai(n, e) {
|
|
2851
2851
|
let t = e.schema.nodes;
|
|
2852
2852
|
for (let r in t) {
|
|
2853
2853
|
let i = t[r];
|
|
@@ -2959,17 +2959,17 @@ class at {
|
|
|
2959
2959
|
This can be useful as a base to build a custom serializer from.
|
|
2960
2960
|
*/
|
|
2961
2961
|
static nodesFromSchema(e) {
|
|
2962
|
-
let t =
|
|
2962
|
+
let t = ci(e.nodes);
|
|
2963
2963
|
return t.text || (t.text = (r) => r.text), t;
|
|
2964
2964
|
}
|
|
2965
2965
|
/**
|
|
2966
2966
|
Gather the serializers in a schema's mark specs into an object.
|
|
2967
2967
|
*/
|
|
2968
2968
|
static marksFromSchema(e) {
|
|
2969
|
-
return
|
|
2969
|
+
return ci(e.marks);
|
|
2970
2970
|
}
|
|
2971
2971
|
}
|
|
2972
|
-
function
|
|
2972
|
+
function ci(n) {
|
|
2973
2973
|
let e = {};
|
|
2974
2974
|
for (let t in n) {
|
|
2975
2975
|
let r = n[t].spec.toDOM;
|
|
@@ -2980,10 +2980,10 @@ function li(n) {
|
|
|
2980
2980
|
function $n(n) {
|
|
2981
2981
|
return n.document || window.document;
|
|
2982
2982
|
}
|
|
2983
|
-
const
|
|
2983
|
+
const ui = /* @__PURE__ */ new WeakMap();
|
|
2984
2984
|
function Bl(n) {
|
|
2985
|
-
let e =
|
|
2986
|
-
return e === void 0 &&
|
|
2985
|
+
let e = ui.get(n);
|
|
2986
|
+
return e === void 0 && ui.set(n, e = Ll(n)), e;
|
|
2987
2987
|
}
|
|
2988
2988
|
function Ll(n) {
|
|
2989
2989
|
let e = null;
|
|
@@ -3045,7 +3045,7 @@ const Is = 65535, Rs = Math.pow(2, 16);
|
|
|
3045
3045
|
function zl(n, e) {
|
|
3046
3046
|
return n + e * Rs;
|
|
3047
3047
|
}
|
|
3048
|
-
function
|
|
3048
|
+
function di(n) {
|
|
3049
3049
|
return n & Is;
|
|
3050
3050
|
}
|
|
3051
3051
|
function Fl(n) {
|
|
@@ -3102,7 +3102,7 @@ class ie {
|
|
|
3102
3102
|
@internal
|
|
3103
3103
|
*/
|
|
3104
3104
|
recover(e) {
|
|
3105
|
-
let t = 0, r =
|
|
3105
|
+
let t = 0, r = di(e);
|
|
3106
3106
|
if (!this.inverted)
|
|
3107
3107
|
for (let i = 0; i < r; i++)
|
|
3108
3108
|
t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
|
|
@@ -3139,7 +3139,7 @@ class ie {
|
|
|
3139
3139
|
@internal
|
|
3140
3140
|
*/
|
|
3141
3141
|
touches(e, t) {
|
|
3142
|
-
let r = 0, i =
|
|
3142
|
+
let r = 0, i = di(t), s = this.inverted ? 2 : 1, o = this.inverted ? 1 : 2;
|
|
3143
3143
|
for (let l = 0; l < this.ranges.length; l += 3) {
|
|
3144
3144
|
let a = this.ranges[l] - (this.inverted ? r : 0);
|
|
3145
3145
|
if (a > e)
|
|
@@ -3368,11 +3368,11 @@ class B {
|
|
|
3368
3368
|
}
|
|
3369
3369
|
}
|
|
3370
3370
|
}
|
|
3371
|
-
function
|
|
3371
|
+
function Ar(n, e, t) {
|
|
3372
3372
|
let r = [];
|
|
3373
3373
|
for (let i = 0; i < n.childCount; i++) {
|
|
3374
3374
|
let s = n.child(i);
|
|
3375
|
-
s.content.size && (s = s.copy(
|
|
3375
|
+
s.content.size && (s = s.copy(Ar(s.content, e, s))), s.isInline && (s = e(s, t, i)), r.push(s);
|
|
3376
3376
|
}
|
|
3377
3377
|
return b.fromArray(r);
|
|
3378
3378
|
}
|
|
@@ -3384,7 +3384,7 @@ class Re extends Y {
|
|
|
3384
3384
|
super(), this.from = e, this.to = t, this.mark = r;
|
|
3385
3385
|
}
|
|
3386
3386
|
apply(e) {
|
|
3387
|
-
let t = e.slice(this.from, this.to), r = e.resolve(this.from), i = r.node(r.sharedDepth(this.to)), s = new k(
|
|
3387
|
+
let t = e.slice(this.from, this.to), r = e.resolve(this.from), i = r.node(r.sharedDepth(this.to)), s = new k(Ar(t.content, (o, l) => !o.isAtom || !l.type.allowsMarkType(this.mark.type) ? o : o.mark(this.mark.addToSet(o.marks)), i), t.openStart, t.openEnd);
|
|
3388
3388
|
return B.fromReplace(e, this.from, this.to, s);
|
|
3389
3389
|
}
|
|
3390
3390
|
invert() {
|
|
@@ -3423,7 +3423,7 @@ class ye extends Y {
|
|
|
3423
3423
|
super(), this.from = e, this.to = t, this.mark = r;
|
|
3424
3424
|
}
|
|
3425
3425
|
apply(e) {
|
|
3426
|
-
let t = e.slice(this.from, this.to), r = new k(
|
|
3426
|
+
let t = e.slice(this.from, this.to), r = new k(Ar(t.content, (i) => i.mark(this.mark.removeFromSet(i.marks)), e), t.openStart, t.openEnd);
|
|
3427
3427
|
return B.fromReplace(e, this.from, this.to, r);
|
|
3428
3428
|
}
|
|
3429
3429
|
invert() {
|
|
@@ -3697,7 +3697,7 @@ function Vl(n, e, t, r) {
|
|
|
3697
3697
|
}
|
|
3698
3698
|
}), i.forEach((o) => n.step(new ye(o.from, o.to, o.style)));
|
|
3699
3699
|
}
|
|
3700
|
-
function
|
|
3700
|
+
function vr(n, e, t, r = t.contentMatch, i = !0) {
|
|
3701
3701
|
let s = n.doc.nodeAt(e), o = [], l = e + 1;
|
|
3702
3702
|
for (let a = 0; a < s.childCount; a++) {
|
|
3703
3703
|
let c = s.child(a), u = l + c.nodeSize, d = r.matchType(c.type);
|
|
@@ -3746,11 +3746,11 @@ function Wl(n, e, t) {
|
|
|
3746
3746
|
m || i.after(p + 1) < i.end(p) ? (m = !0, f = b.from(i.node(p).copy(f)), h++) : c++;
|
|
3747
3747
|
n.step(new F(a, c, o, l, new k(u.append(f), d, h), u.size - d, !0));
|
|
3748
3748
|
}
|
|
3749
|
-
function
|
|
3749
|
+
function Dr(n, e, t = null, r = n) {
|
|
3750
3750
|
let i = ql(n, e), s = i && jl(r, e);
|
|
3751
|
-
return s ? i.map(
|
|
3751
|
+
return s ? i.map(fi).concat({ type: e, attrs: t }).concat(s.map(fi)) : null;
|
|
3752
3752
|
}
|
|
3753
|
-
function
|
|
3753
|
+
function fi(n) {
|
|
3754
3754
|
return { type: n, attrs: null };
|
|
3755
3755
|
}
|
|
3756
3756
|
function ql(n, e) {
|
|
@@ -3794,7 +3794,7 @@ function Kl(n, e, t, r, i) {
|
|
|
3794
3794
|
let h = r.whitespace == "pre", p = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
|
|
3795
3795
|
h && !p ? c = !1 : !h && p && (c = !0);
|
|
3796
3796
|
}
|
|
3797
|
-
c === !1 && Fs(n, o, l, s),
|
|
3797
|
+
c === !1 && Fs(n, o, l, s), vr(n, n.mapping.slice(s).map(l, 1), r, void 0, c === null);
|
|
3798
3798
|
let u = n.mapping.slice(s), d = u.map(l, 1), f = u.map(l + o.nodeSize, 1);
|
|
3799
3799
|
return n.step(new F(d, f, d + 1, f - 1, new k(b.from(r.create(a, null, o.marks)), 0, 0), 1, !0)), c === !0 && zs(n, o, l, s), !1;
|
|
3800
3800
|
}
|
|
@@ -3901,7 +3901,7 @@ function Xl(n, e, t) {
|
|
|
3901
3901
|
let u = n.doc.resolve(e + t);
|
|
3902
3902
|
Fs(n, u.node(), u.before(), l);
|
|
3903
3903
|
}
|
|
3904
|
-
o.inlineContent &&
|
|
3904
|
+
o.inlineContent && vr(n, e + t - 1, o, s.node().contentMatchAt(s.index()), r == null);
|
|
3905
3905
|
let a = n.mapping.slice(l), c = a.map(e - t);
|
|
3906
3906
|
if (n.step(new P(c, a.map(e + t, -1), k.empty, !0)), r === !0) {
|
|
3907
3907
|
let u = n.doc.resolve(c);
|
|
@@ -4564,7 +4564,7 @@ class sa {
|
|
|
4564
4564
|
third argument.
|
|
4565
4565
|
*/
|
|
4566
4566
|
clearIncompatible(e, t, r) {
|
|
4567
|
-
return
|
|
4567
|
+
return vr(this, e, t, r), this;
|
|
4568
4568
|
}
|
|
4569
4569
|
}
|
|
4570
4570
|
const qn = /* @__PURE__ */ Object.create(null);
|
|
@@ -4640,7 +4640,7 @@ class O {
|
|
|
4640
4640
|
let s = e.steps.length, o = this.ranges;
|
|
4641
4641
|
for (let l = 0; l < o.length; l++) {
|
|
4642
4642
|
let { $from: a, $to: c } = o[l], u = e.mapping.slice(s);
|
|
4643
|
-
e.replaceRange(u.map(a.pos), u.map(c.pos), l ? k.empty : t), l == 0 &&
|
|
4643
|
+
e.replaceRange(u.map(a.pos), u.map(c.pos), l ? k.empty : t), l == 0 && mi(e, s, (r ? r.isInline : i && i.isTextblock) ? -1 : 1);
|
|
4644
4644
|
}
|
|
4645
4645
|
}
|
|
4646
4646
|
/**
|
|
@@ -4651,7 +4651,7 @@ class O {
|
|
|
4651
4651
|
let r = e.steps.length, i = this.ranges;
|
|
4652
4652
|
for (let s = 0; s < i.length; s++) {
|
|
4653
4653
|
let { $from: o, $to: l } = i[s], a = e.mapping.slice(r), c = a.map(o.pos), u = a.map(l.pos);
|
|
4654
|
-
s ? e.deleteRange(c, u) : (e.replaceRangeWith(c, u, t),
|
|
4654
|
+
s ? e.deleteRange(c, u) : (e.replaceRangeWith(c, u, t), mi(e, r, t.isInline ? -1 : 1));
|
|
4655
4655
|
}
|
|
4656
4656
|
}
|
|
4657
4657
|
/**
|
|
@@ -4741,16 +4741,16 @@ class oa {
|
|
|
4741
4741
|
this.$from = e, this.$to = t;
|
|
4742
4742
|
}
|
|
4743
4743
|
}
|
|
4744
|
-
let
|
|
4745
|
-
function
|
|
4746
|
-
!
|
|
4744
|
+
let hi = !1;
|
|
4745
|
+
function pi(n) {
|
|
4746
|
+
!hi && !n.parent.inlineContent && (hi = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
|
|
4747
4747
|
}
|
|
4748
4748
|
class M extends O {
|
|
4749
4749
|
/**
|
|
4750
4750
|
Construct a text selection between the given points.
|
|
4751
4751
|
*/
|
|
4752
4752
|
constructor(e, t = e) {
|
|
4753
|
-
|
|
4753
|
+
pi(e), pi(t), super(e, t);
|
|
4754
4754
|
}
|
|
4755
4755
|
/**
|
|
4756
4756
|
Returns a resolved position if this is a cursor selection (an
|
|
@@ -4851,7 +4851,7 @@ class S extends O {
|
|
|
4851
4851
|
return { type: "node", anchor: this.anchor };
|
|
4852
4852
|
}
|
|
4853
4853
|
getBookmark() {
|
|
4854
|
-
return new
|
|
4854
|
+
return new Ir(this.anchor);
|
|
4855
4855
|
}
|
|
4856
4856
|
/**
|
|
4857
4857
|
@internal
|
|
@@ -4877,13 +4877,13 @@ class S extends O {
|
|
|
4877
4877
|
}
|
|
4878
4878
|
S.prototype.visible = !1;
|
|
4879
4879
|
O.jsonID("node", S);
|
|
4880
|
-
class
|
|
4880
|
+
class Ir {
|
|
4881
4881
|
constructor(e) {
|
|
4882
4882
|
this.anchor = e;
|
|
4883
4883
|
}
|
|
4884
4884
|
map(e) {
|
|
4885
4885
|
let { deleted: t, pos: r } = e.mapResult(this.anchor);
|
|
4886
|
-
return t ? new En(r, r) : new
|
|
4886
|
+
return t ? new En(r, r) : new Ir(r);
|
|
4887
4887
|
}
|
|
4888
4888
|
resolve(e) {
|
|
4889
4889
|
let t = e.resolve(this.anchor), r = t.nodeAfter;
|
|
@@ -4950,7 +4950,7 @@ function dt(n, e, t, r, i, s = !1) {
|
|
|
4950
4950
|
}
|
|
4951
4951
|
return null;
|
|
4952
4952
|
}
|
|
4953
|
-
function
|
|
4953
|
+
function mi(n, e, t) {
|
|
4954
4954
|
let r = n.steps.length - 1;
|
|
4955
4955
|
if (r < e)
|
|
4956
4956
|
return;
|
|
@@ -4962,7 +4962,7 @@ function hi(n, e, t) {
|
|
|
4962
4962
|
o == null && (o = u);
|
|
4963
4963
|
}), n.setSelection(O.near(n.doc.resolve(o), t));
|
|
4964
4964
|
}
|
|
4965
|
-
const
|
|
4965
|
+
const gi = 1, Xt = 2, yi = 4;
|
|
4966
4966
|
class aa extends sa {
|
|
4967
4967
|
/**
|
|
4968
4968
|
@internal
|
|
@@ -4986,13 +4986,13 @@ class aa extends sa {
|
|
|
4986
4986
|
setSelection(e) {
|
|
4987
4987
|
if (e.$from.doc != this.doc)
|
|
4988
4988
|
throw new RangeError("Selection passed to setSelection must point at the current document");
|
|
4989
|
-
return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated |
|
|
4989
|
+
return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | gi) & ~Xt, this.storedMarks = null, this;
|
|
4990
4990
|
}
|
|
4991
4991
|
/**
|
|
4992
4992
|
Whether the selection was explicitly updated by this transaction.
|
|
4993
4993
|
*/
|
|
4994
4994
|
get selectionSet() {
|
|
4995
|
-
return (this.updated &
|
|
4995
|
+
return (this.updated & gi) > 0;
|
|
4996
4996
|
}
|
|
4997
4997
|
/**
|
|
4998
4998
|
Set the current stored marks.
|
|
@@ -5105,21 +5105,21 @@ class aa extends sa {
|
|
|
5105
5105
|
when updated to the state produced by this transaction.
|
|
5106
5106
|
*/
|
|
5107
5107
|
scrollIntoView() {
|
|
5108
|
-
return this.updated |=
|
|
5108
|
+
return this.updated |= yi, this;
|
|
5109
5109
|
}
|
|
5110
5110
|
/**
|
|
5111
5111
|
True when this transaction has had `scrollIntoView` called on it.
|
|
5112
5112
|
*/
|
|
5113
5113
|
get scrolledIntoView() {
|
|
5114
|
-
return (this.updated &
|
|
5114
|
+
return (this.updated & yi) > 0;
|
|
5115
5115
|
}
|
|
5116
5116
|
}
|
|
5117
|
-
function
|
|
5117
|
+
function bi(n, e) {
|
|
5118
5118
|
return !e || !n ? n : n.bind(e);
|
|
5119
5119
|
}
|
|
5120
5120
|
class Ot {
|
|
5121
5121
|
constructor(e, t, r) {
|
|
5122
|
-
this.name = e, this.init =
|
|
5122
|
+
this.name = e, this.init = bi(t.init, r), this.apply = bi(t.apply, r);
|
|
5123
5123
|
}
|
|
5124
5124
|
}
|
|
5125
5125
|
const ca = [
|
|
@@ -5391,9 +5391,9 @@ const Ce = function(n, e, t) {
|
|
|
5391
5391
|
}, ua = function() {
|
|
5392
5392
|
fr = null;
|
|
5393
5393
|
}, it = function(n, e, t, r) {
|
|
5394
|
-
return t && (
|
|
5394
|
+
return t && (ki(n, e, t, r, -1) || ki(n, e, t, r, 1));
|
|
5395
5395
|
}, da = /^(img|br|input|textarea|hr)$/i;
|
|
5396
|
-
function
|
|
5396
|
+
function ki(n, e, t, r, i) {
|
|
5397
5397
|
for (var s; ; ) {
|
|
5398
5398
|
if (n == t && e == r)
|
|
5399
5399
|
return !0;
|
|
@@ -5489,9 +5489,9 @@ function ga(n, e, t) {
|
|
|
5489
5489
|
return { node: r.startContainer, offset: Math.min(ue(r.startContainer), r.startOffset) };
|
|
5490
5490
|
}
|
|
5491
5491
|
}
|
|
5492
|
-
const be = typeof navigator < "u" ? navigator : null,
|
|
5492
|
+
const be = typeof navigator < "u" ? navigator : null, xi = typeof document < "u" ? document : null, qe = be && be.userAgent || "", hr = /Edge\/(\d+)/.exec(qe), Us = /MSIE \d/.exec(qe), pr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(qe), ne = !!(Us || pr || hr), Fe = Us ? document.documentMode : pr ? +pr[1] : hr ? +hr[1] : 0, fe = !ne && /gecko\/(\d+)/i.test(qe);
|
|
5493
5493
|
fe && +(/Firefox\/(\d+)/.exec(qe) || [0, 0])[1];
|
|
5494
|
-
const mr = !ne && /Chrome\/(\d+)/.exec(qe), J = !!mr, _s = mr ? +mr[1] : 0, G = !ne && !!be && /Apple Computer/.test(be.vendor), kt = G && (/Mobile\/\w+/.test(qe) || !!be && be.maxTouchPoints > 2), ce = kt || (be ? /Mac/.test(be.platform) : !1), Gs = be ? /Win/.test(be.platform) : !1, Te = /Android \d/.test(qe), Ut = !!
|
|
5494
|
+
const mr = !ne && /Chrome\/(\d+)/.exec(qe), J = !!mr, _s = mr ? +mr[1] : 0, G = !ne && !!be && /Apple Computer/.test(be.vendor), kt = G && (/Mobile\/\w+/.test(qe) || !!be && be.maxTouchPoints > 2), ce = kt || (be ? /Mac/.test(be.platform) : !1), Gs = be ? /Win/.test(be.platform) : !1, Te = /Android \d/.test(qe), Ut = !!xi && "webkitFontSmoothing" in xi.documentElement.style, ya = Ut ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
5495
5495
|
function ba(n) {
|
|
5496
5496
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
5497
5497
|
return e ? {
|
|
@@ -5518,7 +5518,7 @@ function ka(n) {
|
|
|
5518
5518
|
bottom: e.top + n.clientHeight * r
|
|
5519
5519
|
};
|
|
5520
5520
|
}
|
|
5521
|
-
function
|
|
5521
|
+
function Si(n, e, t) {
|
|
5522
5522
|
let r = n.someProp("scrollThreshold") || 0, i = n.someProp("scrollMargin") || 5, s = n.dom.ownerDocument;
|
|
5523
5523
|
for (let o = t || n.dom; o; ) {
|
|
5524
5524
|
if (o.nodeType != 1) {
|
|
@@ -5617,14 +5617,14 @@ function Ca(n, e) {
|
|
|
5617
5617
|
for (let s = 0; s < t; s++) {
|
|
5618
5618
|
r.setEnd(n, s + 1), r.setStart(n, s);
|
|
5619
5619
|
let o = Ae(r, 1);
|
|
5620
|
-
if (o.top != o.bottom &&
|
|
5620
|
+
if (o.top != o.bottom && Rr(e, o)) {
|
|
5621
5621
|
i = { node: n, offset: s + (e.left >= (o.left + o.right) / 2 ? 1 : 0) };
|
|
5622
5622
|
break;
|
|
5623
5623
|
}
|
|
5624
5624
|
}
|
|
5625
5625
|
return r.detach(), i || { node: n, offset: 0 };
|
|
5626
5626
|
}
|
|
5627
|
-
function
|
|
5627
|
+
function Rr(n, e) {
|
|
5628
5628
|
return n.left >= e.left - 1 && n.left <= e.right + 1 && n.top >= e.top - 1 && n.top <= e.bottom + 1;
|
|
5629
5629
|
}
|
|
5630
5630
|
function wa(n, e) {
|
|
@@ -5661,7 +5661,7 @@ function Qs(n, e, t) {
|
|
|
5661
5661
|
let l = o.getClientRects();
|
|
5662
5662
|
for (let a = 0; a < l.length; a++) {
|
|
5663
5663
|
let c = l[a];
|
|
5664
|
-
if (
|
|
5664
|
+
if (Rr(e, c))
|
|
5665
5665
|
return Qs(o, e, c);
|
|
5666
5666
|
}
|
|
5667
5667
|
}
|
|
@@ -5676,7 +5676,7 @@ function Ea(n, e) {
|
|
|
5676
5676
|
let o = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
|
|
5677
5677
|
if (!o || !n.dom.contains(o.nodeType != 1 ? o.parentNode : o)) {
|
|
5678
5678
|
let c = n.dom.getBoundingClientRect();
|
|
5679
|
-
if (!
|
|
5679
|
+
if (!Rr(e, c) || (o = Qs(n.dom, e, c), !o))
|
|
5680
5680
|
return null;
|
|
5681
5681
|
}
|
|
5682
5682
|
if (G)
|
|
@@ -5694,17 +5694,17 @@ function Ea(n, e) {
|
|
|
5694
5694
|
let a = n.docView.nearestDesc(o, !0);
|
|
5695
5695
|
return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
|
|
5696
5696
|
}
|
|
5697
|
-
function
|
|
5697
|
+
function Mi(n) {
|
|
5698
5698
|
return n.top < n.bottom || n.left < n.right;
|
|
5699
5699
|
}
|
|
5700
5700
|
function Ae(n, e) {
|
|
5701
5701
|
let t = n.getClientRects();
|
|
5702
5702
|
if (t.length) {
|
|
5703
5703
|
let r = t[e < 0 ? 0 : t.length - 1];
|
|
5704
|
-
if (
|
|
5704
|
+
if (Mi(r))
|
|
5705
5705
|
return r;
|
|
5706
5706
|
}
|
|
5707
|
-
return Array.prototype.find.call(t,
|
|
5707
|
+
return Array.prototype.find.call(t, Mi) || n.getBoundingClientRect();
|
|
5708
5708
|
}
|
|
5709
5709
|
const Na = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
|
|
5710
5710
|
function eo(n, e, t) {
|
|
@@ -5823,11 +5823,11 @@ function Da(n, e, t) {
|
|
|
5823
5823
|
return f != null && (l.caretBidiLevel = f), g;
|
|
5824
5824
|
}) : r.pos == r.start() || r.pos == r.end();
|
|
5825
5825
|
}
|
|
5826
|
-
let
|
|
5826
|
+
let Ci = null, wi = null, Ti = !1;
|
|
5827
5827
|
function Ia(n, e, t) {
|
|
5828
|
-
return
|
|
5828
|
+
return Ci == e && wi == t ? Ti : (Ci = e, wi = t, Ti = t == "up" || t == "down" ? Aa(n, e, t) : Da(n, e, t));
|
|
5829
5829
|
}
|
|
5830
|
-
const he = 0,
|
|
5830
|
+
const he = 0, Oi = 1, Ue = 2, ke = 3;
|
|
5831
5831
|
class _t {
|
|
5832
5832
|
constructor(e, t, r, i) {
|
|
5833
5833
|
this.parent = e, this.children = t, this.dom = r, this.contentDOM = i, this.dirty = he, r.pmViewDesc = this;
|
|
@@ -6143,7 +6143,7 @@ class _t {
|
|
|
6143
6143
|
if (r == o ? e <= o && t >= r : e < o && t > r) {
|
|
6144
6144
|
let l = r + s.border, a = o - s.border;
|
|
6145
6145
|
if (e >= l && t <= a) {
|
|
6146
|
-
this.dirty = e == r || t == o ? Ue :
|
|
6146
|
+
this.dirty = e == r || t == o ? Ue : Oi, e == l && t == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = ke : s.markDirty(e - l, t - l);
|
|
6147
6147
|
return;
|
|
6148
6148
|
} else
|
|
6149
6149
|
s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? Ue : ke;
|
|
@@ -6155,7 +6155,7 @@ class _t {
|
|
|
6155
6155
|
markParentsDirty() {
|
|
6156
6156
|
let e = 1;
|
|
6157
6157
|
for (let t = this.parent; t; t = t.parent, e++) {
|
|
6158
|
-
let r = e == 1 ? Ue :
|
|
6158
|
+
let r = e == 1 ? Ue : Oi;
|
|
6159
6159
|
t.dirty < r && (t.dirty = r);
|
|
6160
6160
|
}
|
|
6161
6161
|
}
|
|
@@ -6394,7 +6394,7 @@ class $e extends _t {
|
|
|
6394
6394
|
return this.node.isAtom;
|
|
6395
6395
|
}
|
|
6396
6396
|
}
|
|
6397
|
-
function
|
|
6397
|
+
function Ei(n, e, t, r, i) {
|
|
6398
6398
|
oo(r, e, n);
|
|
6399
6399
|
let s = new $e(void 0, n, e, t, r, r, r, i, 0);
|
|
6400
6400
|
return s.contentDOM && s.updateChildren(i, 0), s;
|
|
@@ -6496,7 +6496,7 @@ function io(n, e, t) {
|
|
|
6496
6496
|
let o = e[s], l = o.dom;
|
|
6497
6497
|
if (l.parentNode == n) {
|
|
6498
6498
|
for (; l != r; )
|
|
6499
|
-
r =
|
|
6499
|
+
r = Ni(r), i = !0;
|
|
6500
6500
|
r = r.nextSibling;
|
|
6501
6501
|
} else
|
|
6502
6502
|
i = !0, n.insertBefore(l, r);
|
|
@@ -6506,7 +6506,7 @@ function io(n, e, t) {
|
|
|
6506
6506
|
}
|
|
6507
6507
|
}
|
|
6508
6508
|
for (; r; )
|
|
6509
|
-
r =
|
|
6509
|
+
r = Ni(r), i = !0;
|
|
6510
6510
|
i && t.trackWrites == n && (t.trackWrites = null);
|
|
6511
6511
|
}
|
|
6512
6512
|
const At = function(n) {
|
|
@@ -6577,7 +6577,7 @@ function hn(n, e) {
|
|
|
6577
6577
|
return !1;
|
|
6578
6578
|
return !0;
|
|
6579
6579
|
}
|
|
6580
|
-
function
|
|
6580
|
+
function Ni(n) {
|
|
6581
6581
|
let e = n.nextSibling;
|
|
6582
6582
|
return n.parentNode.removeChild(n), e;
|
|
6583
6583
|
}
|
|
@@ -6848,7 +6848,7 @@ function yr(n, e, t, r, i) {
|
|
|
6848
6848
|
}
|
|
6849
6849
|
return s;
|
|
6850
6850
|
}
|
|
6851
|
-
function
|
|
6851
|
+
function Pr(n, e = null) {
|
|
6852
6852
|
let t = n.domSelectionRange(), r = n.state.doc;
|
|
6853
6853
|
if (!t.focusNode)
|
|
6854
6854
|
return null;
|
|
@@ -6882,7 +6882,7 @@ function Ir(n, e = null) {
|
|
|
6882
6882
|
let u = r.resolve(a);
|
|
6883
6883
|
if (!c) {
|
|
6884
6884
|
let d = e == "pointer" || n.state.selection.head < l.pos && !s ? 1 : -1;
|
|
6885
|
-
c =
|
|
6885
|
+
c = Br(n, u, l, d);
|
|
6886
6886
|
}
|
|
6887
6887
|
return c;
|
|
6888
6888
|
}
|
|
@@ -6903,13 +6903,13 @@ function Ee(n, e = !1) {
|
|
|
6903
6903
|
qa(n);
|
|
6904
6904
|
else {
|
|
6905
6905
|
let { anchor: r, head: i } = t, s, o;
|
|
6906
|
-
|
|
6906
|
+
Ai && !(t instanceof M) && (t.$from.parent.inlineContent || (s = vi(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = vi(n, t.to))), n.docView.setSelection(r, i, n, e), Ai && (s && Di(s), o && Di(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Wa(n));
|
|
6907
6907
|
}
|
|
6908
6908
|
n.domObserver.setCurSelection(), n.domObserver.connectSelection();
|
|
6909
6909
|
}
|
|
6910
6910
|
}
|
|
6911
|
-
const
|
|
6912
|
-
function
|
|
6911
|
+
const Ai = G || J && _s < 63;
|
|
6912
|
+
function vi(n, e) {
|
|
6913
6913
|
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;
|
|
6914
6914
|
if (G && i && i.contentEditable == "false")
|
|
6915
6915
|
return Un(i);
|
|
@@ -6923,7 +6923,7 @@ function Ni(n, e) {
|
|
|
6923
6923
|
function Un(n) {
|
|
6924
6924
|
return n.contentEditable = "true", G && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
|
|
6925
6925
|
}
|
|
6926
|
-
function
|
|
6926
|
+
function Di(n) {
|
|
6927
6927
|
n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
|
|
6928
6928
|
}
|
|
6929
6929
|
function Wa(n) {
|
|
@@ -6946,17 +6946,17 @@ function qa(n) {
|
|
|
6946
6946
|
function ao(n, e) {
|
|
6947
6947
|
if (e instanceof S) {
|
|
6948
6948
|
let t = n.docView.descAt(e.from);
|
|
6949
|
-
t != n.lastSelectedViewDesc && (
|
|
6949
|
+
t != n.lastSelectedViewDesc && (Ii(n), t && t.selectNode(), n.lastSelectedViewDesc = t);
|
|
6950
6950
|
} else
|
|
6951
|
-
|
|
6951
|
+
Ii(n);
|
|
6952
6952
|
}
|
|
6953
|
-
function
|
|
6953
|
+
function Ii(n) {
|
|
6954
6954
|
n.lastSelectedViewDesc && (n.lastSelectedViewDesc.parent && n.lastSelectedViewDesc.deselectNode(), n.lastSelectedViewDesc = void 0);
|
|
6955
6955
|
}
|
|
6956
|
-
function
|
|
6956
|
+
function Br(n, e, t, r) {
|
|
6957
6957
|
return n.someProp("createSelectionBetween", (i) => i(n, e, t)) || M.between(e, t, r);
|
|
6958
6958
|
}
|
|
6959
|
-
function
|
|
6959
|
+
function Ri(n) {
|
|
6960
6960
|
return n.editable && !n.hasFocus() ? !1 : co(n);
|
|
6961
6961
|
}
|
|
6962
6962
|
function co(n) {
|
|
@@ -6980,7 +6980,7 @@ function br(n, e) {
|
|
|
6980
6980
|
function ve(n, e) {
|
|
6981
6981
|
return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()), !0;
|
|
6982
6982
|
}
|
|
6983
|
-
function
|
|
6983
|
+
function Pi(n, e, t) {
|
|
6984
6984
|
let r = n.state.selection;
|
|
6985
6985
|
if (r instanceof M)
|
|
6986
6986
|
if (t.indexOf("s") > -1) {
|
|
@@ -7134,7 +7134,7 @@ function kr(n, e, t) {
|
|
|
7134
7134
|
n.state == i && Ee(n);
|
|
7135
7135
|
}, 50);
|
|
7136
7136
|
}
|
|
7137
|
-
function
|
|
7137
|
+
function Bi(n, e) {
|
|
7138
7138
|
let t = n.state.doc.resolve(e);
|
|
7139
7139
|
if (!(J || Gs) && t.parent.inlineContent) {
|
|
7140
7140
|
let i = n.coordsAtPos(e);
|
|
@@ -7151,7 +7151,7 @@ function Ri(n, e) {
|
|
|
7151
7151
|
}
|
|
7152
7152
|
return getComputedStyle(n.dom).direction == "rtl" ? "rtl" : "ltr";
|
|
7153
7153
|
}
|
|
7154
|
-
function
|
|
7154
|
+
function Li(n, e, t) {
|
|
7155
7155
|
let r = n.state.selection;
|
|
7156
7156
|
if (r instanceof M && !r.empty || t.indexOf("s") > -1 || ce && t.indexOf("m") > -1)
|
|
7157
7157
|
return !1;
|
|
@@ -7167,7 +7167,7 @@ function Pi(n, e, t) {
|
|
|
7167
7167
|
}
|
|
7168
7168
|
return !1;
|
|
7169
7169
|
}
|
|
7170
|
-
function
|
|
7170
|
+
function zi(n, e) {
|
|
7171
7171
|
if (!(n.state.selection instanceof M))
|
|
7172
7172
|
return !0;
|
|
7173
7173
|
let { $head: t, $anchor: r, empty: i } = n.state.selection;
|
|
@@ -7184,7 +7184,7 @@ function Bi(n, e) {
|
|
|
7184
7184
|
}
|
|
7185
7185
|
return !1;
|
|
7186
7186
|
}
|
|
7187
|
-
function
|
|
7187
|
+
function Fi(n, e, t) {
|
|
7188
7188
|
n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
|
|
7189
7189
|
}
|
|
7190
7190
|
function Ga(n) {
|
|
@@ -7193,7 +7193,7 @@ function Ga(n) {
|
|
|
7193
7193
|
let { focusNode: e, focusOffset: t } = n.domSelectionRange();
|
|
7194
7194
|
if (e && e.nodeType == 1 && t == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
|
|
7195
7195
|
let r = e.firstChild;
|
|
7196
|
-
|
|
7196
|
+
Fi(n, r, "true"), setTimeout(() => Fi(n, r, "false"), 20);
|
|
7197
7197
|
}
|
|
7198
7198
|
return !1;
|
|
7199
7199
|
}
|
|
@@ -7204,28 +7204,28 @@ function Ya(n) {
|
|
|
7204
7204
|
function Xa(n, e) {
|
|
7205
7205
|
let t = e.keyCode, r = Ya(e);
|
|
7206
7206
|
if (t == 8 || ce && t == 72 && r == "c")
|
|
7207
|
-
return
|
|
7207
|
+
return zi(n, -1) || ut(n, -1);
|
|
7208
7208
|
if (t == 46 && !e.shiftKey || ce && t == 68 && r == "c")
|
|
7209
|
-
return
|
|
7209
|
+
return zi(n, 1) || ut(n, 1);
|
|
7210
7210
|
if (t == 13 || t == 27)
|
|
7211
7211
|
return !0;
|
|
7212
7212
|
if (t == 37 || ce && t == 66 && r == "c") {
|
|
7213
|
-
let i = t == 37 ?
|
|
7214
|
-
return
|
|
7213
|
+
let i = t == 37 ? Bi(n, n.state.selection.from) == "ltr" ? -1 : 1 : -1;
|
|
7214
|
+
return Pi(n, i, r) || ut(n, i);
|
|
7215
7215
|
} else if (t == 39 || ce && t == 70 && r == "c") {
|
|
7216
|
-
let i = t == 39 ?
|
|
7217
|
-
return
|
|
7216
|
+
let i = t == 39 ? Bi(n, n.state.selection.from) == "ltr" ? 1 : -1 : 1;
|
|
7217
|
+
return Pi(n, i, r) || ut(n, i);
|
|
7218
7218
|
} else {
|
|
7219
7219
|
if (t == 38 || ce && t == 80 && r == "c")
|
|
7220
|
-
return
|
|
7220
|
+
return Li(n, -1, r) || ut(n, -1);
|
|
7221
7221
|
if (t == 40 || ce && t == 78 && r == "c")
|
|
7222
|
-
return Ga(n) ||
|
|
7222
|
+
return Ga(n) || Li(n, 1, r) || ut(n, 1);
|
|
7223
7223
|
if (r == (ce ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
7224
7224
|
return !0;
|
|
7225
7225
|
}
|
|
7226
7226
|
return !1;
|
|
7227
7227
|
}
|
|
7228
|
-
function
|
|
7228
|
+
function Lr(n, e) {
|
|
7229
7229
|
n.someProp("transformCopied", (h) => {
|
|
7230
7230
|
e = h(e, n);
|
|
7231
7231
|
});
|
|
@@ -7297,14 +7297,14 @@ function fo(n, e, t, r, i) {
|
|
|
7297
7297
|
return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !Za.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
|
|
7298
7298
|
}
|
|
7299
7299
|
})), u)
|
|
7300
|
-
l = rc(
|
|
7300
|
+
l = rc($i(l, +u[1], +u[2]), u[4]);
|
|
7301
7301
|
else if (l = k.maxOpen(Qa(l.content, i), !0), l.openStart || l.openEnd) {
|
|
7302
7302
|
let d = 0, f = 0;
|
|
7303
7303
|
for (let h = l.content.firstChild; d < l.openStart && !h.type.spec.isolating; d++, h = h.firstChild)
|
|
7304
7304
|
;
|
|
7305
7305
|
for (let h = l.content.lastChild; f < l.openEnd && !h.type.spec.isolating; f++, h = h.lastChild)
|
|
7306
7306
|
;
|
|
7307
|
-
l =
|
|
7307
|
+
l = $i(l, d, f);
|
|
7308
7308
|
}
|
|
7309
7309
|
return n.someProp("transformPasted", (d) => {
|
|
7310
7310
|
l = d(l, n, a);
|
|
@@ -7358,7 +7358,7 @@ function xr(n, e, t, r, i, s) {
|
|
|
7358
7358
|
let o = e < 0 ? n.firstChild : n.lastChild, l = o.content;
|
|
7359
7359
|
return n.childCount > 1 && (s = 0), i < r - 1 && (l = xr(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));
|
|
7360
7360
|
}
|
|
7361
|
-
function
|
|
7361
|
+
function $i(n, e, t) {
|
|
7362
7362
|
return e < n.openStart && (n = new k(xr(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new k(xr(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
|
|
7363
7363
|
}
|
|
7364
7364
|
const go = {
|
|
@@ -7372,9 +7372,9 @@ const go = {
|
|
|
7372
7372
|
td: ["table", "tbody", "tr"],
|
|
7373
7373
|
th: ["table", "tbody", "tr"]
|
|
7374
7374
|
};
|
|
7375
|
-
let
|
|
7375
|
+
let Vi = null;
|
|
7376
7376
|
function yo() {
|
|
7377
|
-
return
|
|
7377
|
+
return Vi || (Vi = document.implementation.createHTMLDocument("title"));
|
|
7378
7378
|
}
|
|
7379
7379
|
let _n = null;
|
|
7380
7380
|
function ec(n) {
|
|
@@ -7425,7 +7425,7 @@ function oc(n) {
|
|
|
7425
7425
|
for (let e in Z) {
|
|
7426
7426
|
let t = Z[e];
|
|
7427
7427
|
n.dom.addEventListener(e, n.input.eventHandlers[e] = (r) => {
|
|
7428
|
-
ac(n, r) && !
|
|
7428
|
+
ac(n, r) && !zr(n, r) && (n.editable || !(r.type in Q)) && t(n, r);
|
|
7429
7429
|
}, ic[e] ? { passive: !0 } : void 0);
|
|
7430
7430
|
}
|
|
7431
7431
|
G && n.dom.addEventListener("input", () => null), Sr(n);
|
|
@@ -7442,10 +7442,10 @@ function lc(n) {
|
|
|
7442
7442
|
function Sr(n) {
|
|
7443
7443
|
n.someProp("handleDOMEvents", (e) => {
|
|
7444
7444
|
for (let t in e)
|
|
7445
|
-
n.input.eventHandlers[t] || n.dom.addEventListener(t, n.input.eventHandlers[t] = (r) =>
|
|
7445
|
+
n.input.eventHandlers[t] || n.dom.addEventListener(t, n.input.eventHandlers[t] = (r) => zr(n, r));
|
|
7446
7446
|
});
|
|
7447
7447
|
}
|
|
7448
|
-
function
|
|
7448
|
+
function zr(n, e) {
|
|
7449
7449
|
return n.someProp("handleDOMEvents", (t) => {
|
|
7450
7450
|
let r = t[e.type];
|
|
7451
7451
|
return r ? r(n, e) || e.defaultPrevented : !1;
|
|
@@ -7462,7 +7462,7 @@ function ac(n, e) {
|
|
|
7462
7462
|
return !0;
|
|
7463
7463
|
}
|
|
7464
7464
|
function cc(n, e) {
|
|
7465
|
-
!
|
|
7465
|
+
!zr(n, e) && Z[e.type] && (n.editable || !(e.type in Q)) && Z[e.type](n, e);
|
|
7466
7466
|
}
|
|
7467
7467
|
Q.keydown = (n, e) => {
|
|
7468
7468
|
let t = e;
|
|
@@ -7498,7 +7498,7 @@ function uc(n, e) {
|
|
|
7498
7498
|
let t = e.x - n.clientX, r = e.y - n.clientY;
|
|
7499
7499
|
return t * t + r * r < 100;
|
|
7500
7500
|
}
|
|
7501
|
-
function
|
|
7501
|
+
function Fr(n, e, t, r, i) {
|
|
7502
7502
|
if (r == -1)
|
|
7503
7503
|
return !1;
|
|
7504
7504
|
let s = n.state.doc.resolve(r);
|
|
@@ -7535,13 +7535,13 @@ function fc(n, e) {
|
|
|
7535
7535
|
return i != null ? (gt(n, S.create(n.state.doc, i)), !0) : !1;
|
|
7536
7536
|
}
|
|
7537
7537
|
function hc(n, e, t, r, i) {
|
|
7538
|
-
return
|
|
7538
|
+
return Fr(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? fc(n, t) : dc(n, t));
|
|
7539
7539
|
}
|
|
7540
7540
|
function pc(n, e, t, r) {
|
|
7541
|
-
return
|
|
7541
|
+
return Fr(n, "handleDoubleClickOn", e, t, r) || n.someProp("handleDoubleClick", (i) => i(n, e, r));
|
|
7542
7542
|
}
|
|
7543
7543
|
function mc(n, e, t, r) {
|
|
7544
|
-
return
|
|
7544
|
+
return Fr(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) || gc(n, t, r);
|
|
7545
7545
|
}
|
|
7546
7546
|
function gc(n, e, t) {
|
|
7547
7547
|
if (t.button != 0)
|
|
@@ -7561,14 +7561,14 @@ function gc(n, e, t) {
|
|
|
7561
7561
|
return !0;
|
|
7562
7562
|
}
|
|
7563
7563
|
}
|
|
7564
|
-
function
|
|
7564
|
+
function $r(n) {
|
|
7565
7565
|
return mn(n);
|
|
7566
7566
|
}
|
|
7567
7567
|
const bo = ce ? "metaKey" : "ctrlKey";
|
|
7568
7568
|
Z.mousedown = (n, e) => {
|
|
7569
7569
|
let t = e;
|
|
7570
7570
|
n.input.shiftKey = t.shiftKey;
|
|
7571
|
-
let r =
|
|
7571
|
+
let r = $r(n), i = Date.now(), s = "singleClick";
|
|
7572
7572
|
i - n.input.lastClick.time < 500 && uc(t, n.input.lastClick) && !t[bo] && 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 };
|
|
7573
7573
|
let o = n.posAtCoords(vn(t));
|
|
7574
7574
|
o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new yc(n, o, t, !!r)) : (s == "doubleClick" ? pc : mc)(n, o.pos, o.inside, t) ? t.preventDefault() : Be(n, "pointer"));
|
|
@@ -7620,12 +7620,12 @@ class yc {
|
|
|
7620
7620
|
}
|
|
7621
7621
|
}
|
|
7622
7622
|
Z.touchstart = (n) => {
|
|
7623
|
-
n.input.lastTouch = Date.now(),
|
|
7623
|
+
n.input.lastTouch = Date.now(), $r(n), Be(n, "pointer");
|
|
7624
7624
|
};
|
|
7625
7625
|
Z.touchmove = (n) => {
|
|
7626
7626
|
n.input.lastTouch = Date.now(), Be(n, "pointer");
|
|
7627
7627
|
};
|
|
7628
|
-
Z.contextmenu = (n) =>
|
|
7628
|
+
Z.contextmenu = (n) => $r(n);
|
|
7629
7629
|
function ko(n, e) {
|
|
7630
7630
|
return n.composing ? !0 : G && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
|
|
7631
7631
|
}
|
|
@@ -7697,7 +7697,7 @@ function Sc() {
|
|
|
7697
7697
|
function mn(n, e = !1) {
|
|
7698
7698
|
if (!(Te && n.domObserver.flushingSoon >= 0)) {
|
|
7699
7699
|
if (n.domObserver.forceFlush(), So(n), e || n.docView && n.docView.dirty) {
|
|
7700
|
-
let t =
|
|
7700
|
+
let t = Pr(n), r = n.state.selection;
|
|
7701
7701
|
return t && !t.eq(r) ? n.dispatch(n.state.tr.setSelection(t)) : (n.markCursor || e) && !r.$from.node(r.$from.sharedDepth(r.to)).inlineContent ? n.dispatch(n.state.tr.deleteSelection()) : n.updateState(n.state), !0;
|
|
7702
7702
|
}
|
|
7703
7703
|
return !1;
|
|
@@ -7718,7 +7718,7 @@ Z.copy = Q.cut = (n, e) => {
|
|
|
7718
7718
|
let t = e, r = n.state.selection, i = t.type == "cut";
|
|
7719
7719
|
if (r.empty)
|
|
7720
7720
|
return;
|
|
7721
|
-
let s = Bt ? null : t.clipboardData, o = r.content(), { dom: l, text: a } =
|
|
7721
|
+
let s = Bt ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = Lr(n, o);
|
|
7722
7722
|
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : Mc(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
7723
7723
|
};
|
|
7724
7724
|
function Cc(n) {
|
|
@@ -7782,7 +7782,7 @@ Z.dragstart = (n, e) => {
|
|
|
7782
7782
|
d && d.node.type.spec.draggable && d != n.docView && (o = S.create(n.state.doc, d.posBefore));
|
|
7783
7783
|
}
|
|
7784
7784
|
}
|
|
7785
|
-
let l = (o || n.state.selection).content(), { dom: a, text: c, slice: u } =
|
|
7785
|
+
let l = (o || n.state.selection).content(), { dom: a, text: c, slice: u } = Lr(n, l);
|
|
7786
7786
|
(!t.dataTransfer.files.length || !J || _s > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Bt ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Bt || t.dataTransfer.setData("text/plain", c), n.dragging = new Co(u, wo(n, t), o);
|
|
7787
7787
|
};
|
|
7788
7788
|
Z.dragend = (n) => {
|
|
@@ -7832,7 +7832,7 @@ function Oc(n, e, t) {
|
|
|
7832
7832
|
a.setSelection(new S(f));
|
|
7833
7833
|
else {
|
|
7834
7834
|
let h = a.mapping.map(l);
|
|
7835
|
-
a.mapping.maps[a.mapping.maps.length - 1].forEach((p, m, g, y) => h = y), a.setSelection(
|
|
7835
|
+
a.mapping.maps[a.mapping.maps.length - 1].forEach((p, m, g, y) => h = y), a.setSelection(Br(n, f, a.doc.resolve(h)));
|
|
7836
7836
|
}
|
|
7837
7837
|
n.focus(), n.dispatch(a.setMeta("uiEvent", "drop"));
|
|
7838
7838
|
}
|
|
@@ -7908,7 +7908,7 @@ class Ve {
|
|
|
7908
7908
|
destroy() {
|
|
7909
7909
|
}
|
|
7910
7910
|
}
|
|
7911
|
-
class
|
|
7911
|
+
class Vr {
|
|
7912
7912
|
constructor(e, t) {
|
|
7913
7913
|
this.attrs = e, this.spec = t || Qe;
|
|
7914
7914
|
}
|
|
@@ -7924,7 +7924,7 @@ class Fr {
|
|
|
7924
7924
|
return i == t.from && !(s = e.child(r)).isText && i + s.nodeSize == t.to;
|
|
7925
7925
|
}
|
|
7926
7926
|
eq(e) {
|
|
7927
|
-
return this == e || e instanceof
|
|
7927
|
+
return this == e || e instanceof Vr && zt(this.attrs, e.attrs) && zt(this.spec, e.spec);
|
|
7928
7928
|
}
|
|
7929
7929
|
destroy() {
|
|
7930
7930
|
}
|
|
@@ -7978,7 +7978,7 @@ class de {
|
|
|
7978
7978
|
node, will receive the given attributes.
|
|
7979
7979
|
*/
|
|
7980
7980
|
static node(e, t, r, i) {
|
|
7981
|
-
return new de(e, t, new
|
|
7981
|
+
return new de(e, t, new Vr(r, i));
|
|
7982
7982
|
}
|
|
7983
7983
|
/**
|
|
7984
7984
|
The spec provided when creating this decoration. Can be useful
|
|
@@ -8153,7 +8153,7 @@ class z {
|
|
|
8153
8153
|
@internal
|
|
8154
8154
|
*/
|
|
8155
8155
|
locals(e) {
|
|
8156
|
-
return
|
|
8156
|
+
return Hr(this.localsInner(e));
|
|
8157
8157
|
}
|
|
8158
8158
|
/**
|
|
8159
8159
|
@internal
|
|
@@ -8173,7 +8173,7 @@ class z {
|
|
|
8173
8173
|
}
|
|
8174
8174
|
}
|
|
8175
8175
|
z.empty = new z([], []);
|
|
8176
|
-
z.removeOverlap =
|
|
8176
|
+
z.removeOverlap = Hr;
|
|
8177
8177
|
const _ = z.empty;
|
|
8178
8178
|
class Ie {
|
|
8179
8179
|
constructor(e) {
|
|
@@ -8214,7 +8214,7 @@ class Ie {
|
|
|
8214
8214
|
t.push(s[o]);
|
|
8215
8215
|
}
|
|
8216
8216
|
}
|
|
8217
|
-
return t ?
|
|
8217
|
+
return t ? Hr(r ? t : t.sort(et)) : ft;
|
|
8218
8218
|
}
|
|
8219
8219
|
// Create a group for the given array of decoration sets, or return
|
|
8220
8220
|
// a single set when possible.
|
|
@@ -8337,7 +8337,7 @@ function yn(n, e, t, r) {
|
|
|
8337
8337
|
function et(n, e) {
|
|
8338
8338
|
return n.from - e.from || n.to - e.to;
|
|
8339
8339
|
}
|
|
8340
|
-
function
|
|
8340
|
+
function Hr(n) {
|
|
8341
8341
|
let e = n;
|
|
8342
8342
|
for (let t = 0; t < e.length - 1; t++) {
|
|
8343
8343
|
let r = e[t];
|
|
@@ -8345,17 +8345,17 @@ function $r(n) {
|
|
|
8345
8345
|
for (let i = t + 1; i < e.length; i++) {
|
|
8346
8346
|
let s = e[i];
|
|
8347
8347
|
if (s.from == r.from) {
|
|
8348
|
-
s.to != r.to && (e == n && (e = n.slice()), e[i] = s.copy(s.from, r.to),
|
|
8348
|
+
s.to != r.to && (e == n && (e = n.slice()), e[i] = s.copy(s.from, r.to), Hi(e, i + 1, s.copy(r.to, s.to)));
|
|
8349
8349
|
continue;
|
|
8350
8350
|
} else {
|
|
8351
|
-
s.from < r.to && (e == n && (e = n.slice()), e[t] = r.copy(r.from, s.from),
|
|
8351
|
+
s.from < r.to && (e == n && (e = n.slice()), e[t] = r.copy(r.from, s.from), Hi(e, i, r.copy(s.from, r.to)));
|
|
8352
8352
|
break;
|
|
8353
8353
|
}
|
|
8354
8354
|
}
|
|
8355
8355
|
}
|
|
8356
8356
|
return e;
|
|
8357
8357
|
}
|
|
8358
|
-
function
|
|
8358
|
+
function Hi(n, e, t) {
|
|
8359
8359
|
for (; e < n.length && et(t, n[e]) > 0; )
|
|
8360
8360
|
e++;
|
|
8361
8361
|
n.splice(e, 0, t);
|
|
@@ -8432,7 +8432,7 @@ class Ic {
|
|
|
8432
8432
|
this.suppressingSelectionUpdates = !0, setTimeout(() => this.suppressingSelectionUpdates = !1, 50);
|
|
8433
8433
|
}
|
|
8434
8434
|
onSelectionChange() {
|
|
8435
|
-
if (
|
|
8435
|
+
if (Ri(this.view)) {
|
|
8436
8436
|
if (this.suppressingSelectionUpdates)
|
|
8437
8437
|
return Ee(this.view);
|
|
8438
8438
|
if (ne && Fe <= 11 && !this.view.state.selection.empty) {
|
|
@@ -8476,7 +8476,7 @@ class Ic {
|
|
|
8476
8476
|
return;
|
|
8477
8477
|
let t = this.pendingRecords();
|
|
8478
8478
|
t.length && (this.queue = []);
|
|
8479
|
-
let r = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(r) &&
|
|
8479
|
+
let r = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(r) && Ri(e) && !this.ignoreSelectionChange(r), s = -1, o = -1, l = !1, a = [];
|
|
8480
8480
|
if (e.editable)
|
|
8481
8481
|
for (let u = 0; u < t.length; u++) {
|
|
8482
8482
|
let d = this.registerMutation(t[u], a);
|
|
@@ -8508,7 +8508,7 @@ class Ic {
|
|
|
8508
8508
|
}
|
|
8509
8509
|
}
|
|
8510
8510
|
let c = null;
|
|
8511
|
-
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Nn(r) && (c =
|
|
8511
|
+
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Nn(r) && (c = Pr(e)) && c.eq(O.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Ee(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Rc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, Lc(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || Ee(e), this.currentSelection.set(r));
|
|
8512
8512
|
}
|
|
8513
8513
|
registerMutation(e, t) {
|
|
8514
8514
|
if (t.indexOf(e.target) > -1)
|
|
@@ -8543,15 +8543,15 @@ class Ic {
|
|
|
8543
8543
|
});
|
|
8544
8544
|
}
|
|
8545
8545
|
}
|
|
8546
|
-
let
|
|
8546
|
+
let Wi = /* @__PURE__ */ new WeakMap(), qi = !1;
|
|
8547
8547
|
function Rc(n) {
|
|
8548
|
-
if (!
|
|
8549
|
-
if (n.requiresGeckoHackNode = fe,
|
|
8548
|
+
if (!Wi.has(n) && (Wi.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
|
|
8549
|
+
if (n.requiresGeckoHackNode = fe, qi)
|
|
8550
8550
|
return;
|
|
8551
|
-
console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),
|
|
8551
|
+
console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), qi = !0;
|
|
8552
8552
|
}
|
|
8553
8553
|
}
|
|
8554
|
-
function
|
|
8554
|
+
function ji(n, e) {
|
|
8555
8555
|
let t = e.startContainer, r = e.startOffset, i = e.endContainer, s = e.endOffset, o = n.domAtPos(n.state.selection.anchor);
|
|
8556
8556
|
return it(o.node, o.offset, i, s) && ([t, r, i, s] = [i, s, t, r]), { anchorNode: t, anchorOffset: r, focusNode: i, focusOffset: s };
|
|
8557
8557
|
}
|
|
@@ -8559,13 +8559,13 @@ function Pc(n, e) {
|
|
|
8559
8559
|
if (e.getComposedRanges) {
|
|
8560
8560
|
let i = e.getComposedRanges(n.root)[0];
|
|
8561
8561
|
if (i)
|
|
8562
|
-
return
|
|
8562
|
+
return ji(n, i);
|
|
8563
8563
|
}
|
|
8564
8564
|
let t;
|
|
8565
8565
|
function r(i) {
|
|
8566
8566
|
i.preventDefault(), i.stopImmediatePropagation(), t = i.getTargetRanges()[0];
|
|
8567
8567
|
}
|
|
8568
|
-
return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ?
|
|
8568
|
+
return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? ji(n, t) : null;
|
|
8569
8569
|
}
|
|
8570
8570
|
function Bc(n, e) {
|
|
8571
8571
|
for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
|
|
@@ -8643,7 +8643,7 @@ const $c = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|df
|
|
|
8643
8643
|
function Vc(n, e, t, r, i) {
|
|
8644
8644
|
let s = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
|
|
8645
8645
|
if (n.input.compositionPendingChanges = 0, e < 0) {
|
|
8646
|
-
let w = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, N =
|
|
8646
|
+
let w = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, N = Pr(n, w);
|
|
8647
8647
|
if (N && !n.state.selection.eq(N)) {
|
|
8648
8648
|
if (J && Te && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (cl) => cl(n, Je(13, "Enter"))))
|
|
8649
8649
|
return;
|
|
@@ -8666,7 +8666,7 @@ function Vc(n, e, t, r, i) {
|
|
|
8666
8666
|
p = { start: a.from, endA: a.to, endB: a.to };
|
|
8667
8667
|
else {
|
|
8668
8668
|
if (c.sel) {
|
|
8669
|
-
let w =
|
|
8669
|
+
let w = Ji(n, n.state.doc, c.sel);
|
|
8670
8670
|
if (w && !w.eq(n.state.selection)) {
|
|
8671
8671
|
let N = n.state.tr.setSelection(w);
|
|
8672
8672
|
s && N.setMeta("composition", s), n.dispatch(N);
|
|
@@ -8692,7 +8692,7 @@ function Vc(n, e, t, r, i) {
|
|
|
8692
8692
|
let C = p.start, D = p.endA, v = (w) => {
|
|
8693
8693
|
let N = w || n.state.tr.replace(C, D, c.doc.slice(p.start - c.from, p.endB - c.from));
|
|
8694
8694
|
if (c.sel) {
|
|
8695
|
-
let U =
|
|
8695
|
+
let U = Ji(n, N.doc, c.sel);
|
|
8696
8696
|
U && !(J && n.composing && U.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (U.head == C || U.head == N.mapping.map(D) - 1) || ne && U.empty && U.head == C) && N.setSelection(U);
|
|
8697
8697
|
}
|
|
8698
8698
|
return s && N.setMeta("composition", s), N.scrollIntoView();
|
|
@@ -8716,8 +8716,8 @@ function Vc(n, e, t, r, i) {
|
|
|
8716
8716
|
else
|
|
8717
8717
|
n.dispatch(v());
|
|
8718
8718
|
}
|
|
8719
|
-
function
|
|
8720
|
-
return Math.max(t.anchor, t.head) > e.content.size ? null :
|
|
8719
|
+
function Ji(n, e, t) {
|
|
8720
|
+
return Math.max(t.anchor, t.head) > e.content.size ? null : Br(n, e.resolve(t.anchor), e.resolve(t.head));
|
|
8721
8721
|
}
|
|
8722
8722
|
function Hc(n, e) {
|
|
8723
8723
|
let t = n.firstChild.marks, r = e.firstChild.marks, i = t, s = r, o, l, a;
|
|
@@ -8776,14 +8776,14 @@ function qc(n, e, t, r, i) {
|
|
|
8776
8776
|
}
|
|
8777
8777
|
if (o < s && n.size < e.size) {
|
|
8778
8778
|
let a = r <= s && r >= o ? s - r : 0;
|
|
8779
|
-
s -= a, s && s < e.size &&
|
|
8779
|
+
s -= a, s && s < e.size && Ki(e.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), l = s + (l - o), o = s;
|
|
8780
8780
|
} else if (l < s) {
|
|
8781
8781
|
let a = r <= s && r >= l ? s - r : 0;
|
|
8782
|
-
s -= a, s && s < n.size &&
|
|
8782
|
+
s -= a, s && s < n.size && Ki(n.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), o = s + (o - l), l = s;
|
|
8783
8783
|
}
|
|
8784
8784
|
return { start: s, endA: o, endB: l };
|
|
8785
8785
|
}
|
|
8786
|
-
function
|
|
8786
|
+
function Ki(n) {
|
|
8787
8787
|
if (n.length != 2)
|
|
8788
8788
|
return !1;
|
|
8789
8789
|
let e = n.charCodeAt(0), t = n.charCodeAt(1);
|
|
@@ -8798,7 +8798,7 @@ class No {
|
|
|
8798
8798
|
added to the document.
|
|
8799
8799
|
*/
|
|
8800
8800
|
constructor(e, t) {
|
|
8801
|
-
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 sc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(
|
|
8801
|
+
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 sc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Xi), 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 = Gi(this), _i(this), this.nodeViews = Yi(this), this.docView = Ei(this.state.doc, Ui(this), Gn(this), this.dom, this), this.domObserver = new Ic(this, (r, i, s, o) => Vc(this, r, i, s, o)), this.domObserver.start(), oc(this), this.updatePluginViews();
|
|
8802
8802
|
}
|
|
8803
8803
|
/**
|
|
8804
8804
|
Holds `true` when a
|
|
@@ -8828,7 +8828,7 @@ class No {
|
|
|
8828
8828
|
update(e) {
|
|
8829
8829
|
e.handleDOMEvents != this._props.handleDOMEvents && Sr(this);
|
|
8830
8830
|
let t = this._props;
|
|
8831
|
-
this._props = e, e.plugins && (e.plugins.forEach(
|
|
8831
|
+
this._props = e, e.plugins && (e.plugins.forEach(Xi), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);
|
|
8832
8832
|
}
|
|
8833
8833
|
/**
|
|
8834
8834
|
Update the view by updating existing props object with the object
|
|
@@ -8857,11 +8857,11 @@ class No {
|
|
|
8857
8857
|
e.storedMarks && this.composing && (So(this), o = !0), this.state = e;
|
|
8858
8858
|
let l = i.plugins != e.plugins || this._props.plugins != t.plugins;
|
|
8859
8859
|
if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
|
|
8860
|
-
let h =
|
|
8860
|
+
let h = Yi(this);
|
|
8861
8861
|
Jc(h, this.nodeViews) && (this.nodeViews = h, s = !0);
|
|
8862
8862
|
}
|
|
8863
|
-
(l || t.handleDOMEvents != this._props.handleDOMEvents) && Sr(this), this.editable =
|
|
8864
|
-
let a = Gn(this), c =
|
|
8863
|
+
(l || t.handleDOMEvents != this._props.handleDOMEvents) && Sr(this), this.editable = Gi(this), _i(this);
|
|
8864
|
+
let a = Gn(this), c = Ui(this), u = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", d = s || !this.docView.matchesNode(e.doc, c, a);
|
|
8865
8865
|
(d || !e.selection.eq(i.selection)) && (o = !0);
|
|
8866
8866
|
let f = u == "preserve" && o && this.dom.style.overflowAnchor == null && xa(this);
|
|
8867
8867
|
if (o) {
|
|
@@ -8869,7 +8869,7 @@ class No {
|
|
|
8869
8869
|
let h = d && (ne || J) && !this.composing && !i.selection.empty && !e.selection.empty && jc(i.selection, e.selection);
|
|
8870
8870
|
if (d) {
|
|
8871
8871
|
let p = J ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
8872
|
-
this.composing && (this.input.compositionNode = xc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView =
|
|
8872
|
+
this.composing && (this.input.compositionNode = xc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = Ei(e.doc, c, a, this.dom, this)), p && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (h = !0);
|
|
8873
8873
|
}
|
|
8874
8874
|
h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && ja(this)) ? Ee(this, h) : (ao(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
8875
8875
|
}
|
|
@@ -8883,9 +8883,9 @@ class No {
|
|
|
8883
8883
|
if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode))) {
|
|
8884
8884
|
if (!this.someProp("handleScrollToSelection", (t) => t(this))) if (this.state.selection instanceof S) {
|
|
8885
8885
|
let t = this.docView.domAfterPos(this.state.selection.from);
|
|
8886
|
-
t.nodeType == 1 &&
|
|
8886
|
+
t.nodeType == 1 && Si(this, t.getBoundingClientRect(), e);
|
|
8887
8887
|
} else
|
|
8888
|
-
|
|
8888
|
+
Si(this, this.coordsAtPos(this.state.selection.head, 1), e);
|
|
8889
8889
|
}
|
|
8890
8890
|
}
|
|
8891
8891
|
destroyPluginViews() {
|
|
@@ -9084,7 +9084,7 @@ class No {
|
|
|
9084
9084
|
[`transformCopied`](https://prosemirror.net/docs/ref/#view.EditorProps.transformCopied)).
|
|
9085
9085
|
*/
|
|
9086
9086
|
serializeForClipboard(e) {
|
|
9087
|
-
return
|
|
9087
|
+
return Lr(this, e);
|
|
9088
9088
|
}
|
|
9089
9089
|
/**
|
|
9090
9090
|
Removes the editor from the DOM and destroys all [node
|
|
@@ -9125,7 +9125,7 @@ No.prototype.dispatch = function(n) {
|
|
|
9125
9125
|
let e = this._props.dispatchTransaction;
|
|
9126
9126
|
e ? e.call(this, n) : this.updateState(this.state.apply(n));
|
|
9127
9127
|
};
|
|
9128
|
-
function
|
|
9128
|
+
function Ui(n) {
|
|
9129
9129
|
let e = /* @__PURE__ */ Object.create(null);
|
|
9130
9130
|
return e.class = "ProseMirror", e.contenteditable = String(n.editable), n.someProp("attributes", (t) => {
|
|
9131
9131
|
if (typeof t == "function" && (t = t(n.state)), t)
|
|
@@ -9133,21 +9133,21 @@ function Ji(n) {
|
|
|
9133
9133
|
r == "class" ? e.class += " " + t[r] : r == "style" ? e.style = (e.style ? e.style + ";" : "") + t[r] : !e[r] && r != "contenteditable" && r != "nodeName" && (e[r] = String(t[r]));
|
|
9134
9134
|
}), e.translate || (e.translate = "no"), [de.node(0, n.state.doc.content.size, e)];
|
|
9135
9135
|
}
|
|
9136
|
-
function
|
|
9136
|
+
function _i(n) {
|
|
9137
9137
|
if (n.markCursor) {
|
|
9138
9138
|
let e = document.createElement("img");
|
|
9139
9139
|
e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), n.cursorWrapper = { dom: e, deco: de.widget(n.state.selection.from, e, { raw: !0, marks: n.markCursor }) };
|
|
9140
9140
|
} else
|
|
9141
9141
|
n.cursorWrapper = null;
|
|
9142
9142
|
}
|
|
9143
|
-
function
|
|
9143
|
+
function Gi(n) {
|
|
9144
9144
|
return !n.someProp("editable", (e) => e(n.state) === !1);
|
|
9145
9145
|
}
|
|
9146
9146
|
function jc(n, e) {
|
|
9147
9147
|
let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
|
|
9148
9148
|
return n.$anchor.start(t) != e.$anchor.start(t);
|
|
9149
9149
|
}
|
|
9150
|
-
function
|
|
9150
|
+
function Yi(n) {
|
|
9151
9151
|
let e = /* @__PURE__ */ Object.create(null);
|
|
9152
9152
|
function t(r) {
|
|
9153
9153
|
for (let i in r)
|
|
@@ -9166,7 +9166,7 @@ function Jc(n, e) {
|
|
|
9166
9166
|
r++;
|
|
9167
9167
|
return t != r;
|
|
9168
9168
|
}
|
|
9169
|
-
function
|
|
9169
|
+
function Xi(n) {
|
|
9170
9170
|
if (n.spec.state || n.spec.filterTransaction || n.spec.appendTransaction)
|
|
9171
9171
|
throw new RangeError("Plugins passed directly to the view must not have a state component");
|
|
9172
9172
|
}
|
|
@@ -9314,7 +9314,7 @@ function Ao(n) {
|
|
|
9314
9314
|
return !1;
|
|
9315
9315
|
};
|
|
9316
9316
|
}
|
|
9317
|
-
const
|
|
9317
|
+
const Wr = (n, e) => n.selection.empty ? !1 : (e && e(n.tr.deleteSelection().scrollIntoView()), !0);
|
|
9318
9318
|
function vo(n, e) {
|
|
9319
9319
|
let { $cursor: t } = n.selection;
|
|
9320
9320
|
return !t || (e ? !e.endOfTextblock("backward", n) : t.parentOffset > 0) ? null : t;
|
|
@@ -9323,7 +9323,7 @@ const Do = (n, e, t) => {
|
|
|
9323
9323
|
let r = vo(n, t);
|
|
9324
9324
|
if (!r)
|
|
9325
9325
|
return !1;
|
|
9326
|
-
let i =
|
|
9326
|
+
let i = qr(r);
|
|
9327
9327
|
if (!i) {
|
|
9328
9328
|
let o = r.blockRange(), l = o && St(o);
|
|
9329
9329
|
return l == null ? !1 : (e && e(n.tr.lift(o, l).scrollIntoView()), !0);
|
|
@@ -9349,13 +9349,13 @@ const Do = (n, e, t) => {
|
|
|
9349
9349
|
let r = vo(n, t);
|
|
9350
9350
|
if (!r)
|
|
9351
9351
|
return !1;
|
|
9352
|
-
let i =
|
|
9352
|
+
let i = qr(r);
|
|
9353
9353
|
return i ? Io(n, i, e) : !1;
|
|
9354
9354
|
}, tu = (n, e, t) => {
|
|
9355
9355
|
let r = Po(n, t);
|
|
9356
9356
|
if (!r)
|
|
9357
9357
|
return !1;
|
|
9358
|
-
let i =
|
|
9358
|
+
let i = jr(r);
|
|
9359
9359
|
return i ? Io(n, i, e) : !1;
|
|
9360
9360
|
};
|
|
9361
9361
|
function Io(n, e, t) {
|
|
@@ -9402,12 +9402,12 @@ const Ro = (n, e, t) => {
|
|
|
9402
9402
|
if (r.parent.isTextblock) {
|
|
9403
9403
|
if (t ? !t.endOfTextblock("backward", n) : r.parentOffset > 0)
|
|
9404
9404
|
return !1;
|
|
9405
|
-
s =
|
|
9405
|
+
s = qr(r);
|
|
9406
9406
|
}
|
|
9407
9407
|
let o = s && s.nodeBefore;
|
|
9408
9408
|
return !o || !S.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(S.create(n.doc, s.pos - o.nodeSize)).scrollIntoView()), !0);
|
|
9409
9409
|
};
|
|
9410
|
-
function
|
|
9410
|
+
function qr(n) {
|
|
9411
9411
|
if (!n.parent.type.spec.isolating)
|
|
9412
9412
|
for (let e = n.depth - 1; e >= 0; e--) {
|
|
9413
9413
|
if (n.index(e) > 0)
|
|
@@ -9425,7 +9425,7 @@ const Bo = (n, e, t) => {
|
|
|
9425
9425
|
let r = Po(n, t);
|
|
9426
9426
|
if (!r)
|
|
9427
9427
|
return !1;
|
|
9428
|
-
let i =
|
|
9428
|
+
let i = jr(r);
|
|
9429
9429
|
if (!i)
|
|
9430
9430
|
return !1;
|
|
9431
9431
|
let s = i.nodeAfter;
|
|
@@ -9449,12 +9449,12 @@ const Bo = (n, e, t) => {
|
|
|
9449
9449
|
if (r.parent.isTextblock) {
|
|
9450
9450
|
if (t ? !t.endOfTextblock("forward", n) : r.parentOffset < r.parent.content.size)
|
|
9451
9451
|
return !1;
|
|
9452
|
-
s =
|
|
9452
|
+
s = jr(r);
|
|
9453
9453
|
}
|
|
9454
9454
|
let o = s && s.nodeAfter;
|
|
9455
9455
|
return !o || !S.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(S.create(n.doc, s.pos)).scrollIntoView()), !0);
|
|
9456
9456
|
};
|
|
9457
|
-
function
|
|
9457
|
+
function jr(n) {
|
|
9458
9458
|
if (!n.parent.type.spec.isolating)
|
|
9459
9459
|
for (let e = n.depth - 1; e >= 0; e--) {
|
|
9460
9460
|
let t = n.node(e);
|
|
@@ -9495,7 +9495,7 @@ const nu = (n, e) => {
|
|
|
9495
9495
|
return !t.parent.type.spec.code || !t.sameParent(r) ? !1 : (e && e(n.tr.insertText(`
|
|
9496
9496
|
`).scrollIntoView()), !0);
|
|
9497
9497
|
};
|
|
9498
|
-
function
|
|
9498
|
+
function Jr(n) {
|
|
9499
9499
|
for (let e = 0; e < n.edgeCount; e++) {
|
|
9500
9500
|
let { type: t } = n.edge(e);
|
|
9501
9501
|
if (t.isTextblock && !t.hasRequiredAttrs())
|
|
@@ -9507,7 +9507,7 @@ const su = (n, e) => {
|
|
|
9507
9507
|
let { $head: t, $anchor: r } = n.selection;
|
|
9508
9508
|
if (!t.parent.type.spec.code || !t.sameParent(r))
|
|
9509
9509
|
return !1;
|
|
9510
|
-
let i = t.node(-1), s = t.indexAfter(-1), o =
|
|
9510
|
+
let i = t.node(-1), s = t.indexAfter(-1), o = Jr(i.contentMatchAt(s));
|
|
9511
9511
|
if (!o || !i.canReplaceWith(s, s, o))
|
|
9512
9512
|
return !1;
|
|
9513
9513
|
if (e) {
|
|
@@ -9519,7 +9519,7 @@ const su = (n, e) => {
|
|
|
9519
9519
|
let t = n.selection, { $from: r, $to: i } = t;
|
|
9520
9520
|
if (t instanceof oe || r.parent.inlineContent || i.parent.inlineContent)
|
|
9521
9521
|
return !1;
|
|
9522
|
-
let s =
|
|
9522
|
+
let s = Jr(i.parent.contentMatchAt(i.indexAfter()));
|
|
9523
9523
|
if (!s || !s.isTextblock)
|
|
9524
9524
|
return !1;
|
|
9525
9525
|
if (e) {
|
|
@@ -9549,7 +9549,7 @@ function ou(n) {
|
|
|
9549
9549
|
let s = [], o, l, a = !1, c = !1;
|
|
9550
9550
|
for (let h = r.depth; ; h--)
|
|
9551
9551
|
if (r.node(h).isBlock) {
|
|
9552
|
-
a = r.end(h) == r.pos + (r.depth - h), c = r.start(h) == r.pos - (r.depth - h), l =
|
|
9552
|
+
a = r.end(h) == r.pos + (r.depth - h), c = r.start(h) == r.pos - (r.depth - h), l = Jr(r.node(h - 1).contentMatchAt(r.indexAfter(h - 1))), s.unshift(a && l ? { type: l } : null), o = h;
|
|
9553
9553
|
break;
|
|
9554
9554
|
} else {
|
|
9555
9555
|
if (h == 1)
|
|
@@ -9629,11 +9629,11 @@ function Ho(n) {
|
|
|
9629
9629
|
const uu = Ho(-1), du = Ho(1);
|
|
9630
9630
|
function fu(n, e = null) {
|
|
9631
9631
|
return function(t, r) {
|
|
9632
|
-
let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = o &&
|
|
9632
|
+
let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = o && Dr(o, n, e);
|
|
9633
9633
|
return l ? (r && r(t.tr.wrap(o, l).scrollIntoView()), !0) : !1;
|
|
9634
9634
|
};
|
|
9635
9635
|
}
|
|
9636
|
-
function
|
|
9636
|
+
function Zi(n, e = null) {
|
|
9637
9637
|
return function(t, r) {
|
|
9638
9638
|
let i = !1;
|
|
9639
9639
|
for (let s = 0; s < t.selection.ranges.length && !i; s++) {
|
|
@@ -9663,7 +9663,7 @@ function Yi(n, e = null) {
|
|
|
9663
9663
|
return !0;
|
|
9664
9664
|
};
|
|
9665
9665
|
}
|
|
9666
|
-
function
|
|
9666
|
+
function Kr(...n) {
|
|
9667
9667
|
return function(e, t, r) {
|
|
9668
9668
|
for (let i = 0; i < n.length; i++)
|
|
9669
9669
|
if (n[i](e, t, r))
|
|
@@ -9671,9 +9671,9 @@ function jr(...n) {
|
|
|
9671
9671
|
return !1;
|
|
9672
9672
|
};
|
|
9673
9673
|
}
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9674
|
+
Kr(Wr, Do, Ro);
|
|
9675
|
+
Kr(Wr, Bo, Lo);
|
|
9676
|
+
Kr(zo, Fo, $o, lu);
|
|
9677
9677
|
typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
|
|
9678
9678
|
function hu(n, e = null) {
|
|
9679
9679
|
return function(t, r) {
|
|
@@ -9692,7 +9692,7 @@ function pu(n, e, t, r = null) {
|
|
|
9692
9692
|
let a = o.resolve(e.start - 2);
|
|
9693
9693
|
s = new dn(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new dn(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), i = !0;
|
|
9694
9694
|
}
|
|
9695
|
-
let l =
|
|
9695
|
+
let l = Dr(s, t, r, e);
|
|
9696
9696
|
return l ? (n && mu(n, e, l, i, t), !0) : !1;
|
|
9697
9697
|
}
|
|
9698
9698
|
function mu(n, e, t, r, i) {
|
|
@@ -9983,7 +9983,7 @@ function Su(n = {}) {
|
|
|
9983
9983
|
function Mu(n) {
|
|
9984
9984
|
return typeof n != "string" ? n : n.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(n) : n === "true" ? !0 : n === "false" ? !1 : n;
|
|
9985
9985
|
}
|
|
9986
|
-
function
|
|
9986
|
+
function Qi(n, e) {
|
|
9987
9987
|
return "style" in n ? n : {
|
|
9988
9988
|
...n,
|
|
9989
9989
|
getAttrs: (t) => {
|
|
@@ -10001,7 +10001,7 @@ function Xi(n, e) {
|
|
|
10001
10001
|
}
|
|
10002
10002
|
};
|
|
10003
10003
|
}
|
|
10004
|
-
function
|
|
10004
|
+
function es(n) {
|
|
10005
10005
|
return Object.fromEntries(
|
|
10006
10006
|
// @ts-ignore
|
|
10007
10007
|
Object.entries(n).filter(([e, t]) => e === "attrs" && Su(t) ? !1 : t != null)
|
|
@@ -10021,7 +10021,7 @@ function Cu(n, e) {
|
|
|
10021
10021
|
...y,
|
|
10022
10022
|
...C ? C(c) : {}
|
|
10023
10023
|
};
|
|
10024
|
-
}, {}), h =
|
|
10024
|
+
}, {}), h = es({
|
|
10025
10025
|
...f,
|
|
10026
10026
|
content: E(x(c, "content", d)),
|
|
10027
10027
|
marks: E(x(c, "marks", d)),
|
|
@@ -10040,7 +10040,7 @@ function Cu(n, e) {
|
|
|
10040
10040
|
return [y.name, { default: (T = y == null ? void 0 : y.attribute) === null || T === void 0 ? void 0 : T.default }];
|
|
10041
10041
|
}))
|
|
10042
10042
|
}), p = E(x(c, "parseHTML", d));
|
|
10043
|
-
p && (h.parseDOM = p.map((y) =>
|
|
10043
|
+
p && (h.parseDOM = p.map((y) => Qi(y, u)));
|
|
10044
10044
|
const m = x(c, "renderHTML", d);
|
|
10045
10045
|
m && (h.toDOM = (y) => m({
|
|
10046
10046
|
node: y,
|
|
@@ -10060,7 +10060,7 @@ function Cu(n, e) {
|
|
|
10060
10060
|
...g,
|
|
10061
10061
|
...T ? T(c) : {}
|
|
10062
10062
|
};
|
|
10063
|
-
}, {}), h =
|
|
10063
|
+
}, {}), h = es({
|
|
10064
10064
|
...f,
|
|
10065
10065
|
inclusive: E(x(c, "inclusive", d)),
|
|
10066
10066
|
excludes: E(x(c, "excludes", d)),
|
|
@@ -10072,7 +10072,7 @@ function Cu(n, e) {
|
|
|
10072
10072
|
return [g.name, { default: (y = g == null ? void 0 : g.attribute) === null || y === void 0 ? void 0 : y.default }];
|
|
10073
10073
|
}))
|
|
10074
10074
|
}), p = E(x(c, "parseHTML", d));
|
|
10075
|
-
p && (h.parseDOM = p.map((g) =>
|
|
10075
|
+
p && (h.parseDOM = p.map((g) => Qi(g, u)));
|
|
10076
10076
|
const m = x(c, "renderHTML", d);
|
|
10077
10077
|
return m && (h.toDOM = (g) => m({
|
|
10078
10078
|
mark: g,
|
|
@@ -10088,10 +10088,10 @@ function Cu(n, e) {
|
|
|
10088
10088
|
function Qn(n, e) {
|
|
10089
10089
|
return e.nodes[n] || e.marks[n] || null;
|
|
10090
10090
|
}
|
|
10091
|
-
function
|
|
10091
|
+
function ts(n, e) {
|
|
10092
10092
|
return Array.isArray(e) ? e.some((t) => (typeof t == "string" ? t : t.name) === n.name) : e;
|
|
10093
10093
|
}
|
|
10094
|
-
function
|
|
10094
|
+
function Ur(n, e) {
|
|
10095
10095
|
const t = at.fromSchema(e).serializeFragment(n), i = document.implementation.createHTMLDocument().createElement("div");
|
|
10096
10096
|
return i.appendChild(t), i.innerHTML;
|
|
10097
10097
|
}
|
|
@@ -10109,7 +10109,7 @@ const wu = (n, e = 500) => {
|
|
|
10109
10109
|
t += i.isAtom && !i.isText ? u : u.slice(0, Math.max(0, r - s));
|
|
10110
10110
|
}), t;
|
|
10111
10111
|
};
|
|
10112
|
-
function
|
|
10112
|
+
function _r(n) {
|
|
10113
10113
|
return Object.prototype.toString.call(n) === "[object RegExp]";
|
|
10114
10114
|
}
|
|
10115
10115
|
class Pn {
|
|
@@ -10118,7 +10118,7 @@ class Pn {
|
|
|
10118
10118
|
}
|
|
10119
10119
|
}
|
|
10120
10120
|
const Tu = (n, e) => {
|
|
10121
|
-
if (
|
|
10121
|
+
if (_r(e))
|
|
10122
10122
|
return e.exec(n);
|
|
10123
10123
|
const t = e(n);
|
|
10124
10124
|
if (!t)
|
|
@@ -10183,7 +10183,7 @@ function Ou(n) {
|
|
|
10183
10183
|
const a = i.getMeta("applyInputRules");
|
|
10184
10184
|
return !!a && setTimeout(() => {
|
|
10185
10185
|
let { text: u } = a;
|
|
10186
|
-
typeof u == "string" ? u = u : u =
|
|
10186
|
+
typeof u == "string" ? u = u : u = Ur(b.from(u), o.schema);
|
|
10187
10187
|
const { from: d } = a, f = d + u.length;
|
|
10188
10188
|
Zt({
|
|
10189
10189
|
editor: e,
|
|
@@ -10309,7 +10309,7 @@ class Au {
|
|
|
10309
10309
|
}
|
|
10310
10310
|
}
|
|
10311
10311
|
const vu = (n, e, t) => {
|
|
10312
|
-
if (
|
|
10312
|
+
if (_r(e))
|
|
10313
10313
|
return [...n.matchAll(e)];
|
|
10314
10314
|
const r = e(n, t);
|
|
10315
10315
|
return r ? r.map((i) => {
|
|
@@ -10424,7 +10424,7 @@ function Ru(n) {
|
|
|
10424
10424
|
return;
|
|
10425
10425
|
if (T) {
|
|
10426
10426
|
let { text: v } = y;
|
|
10427
|
-
typeof v == "string" ? v = v : v =
|
|
10427
|
+
typeof v == "string" ? v = v : v = Ur(b.from(v), h.schema);
|
|
10428
10428
|
const { from: L } = y, w = L + v.length, N = Iu(v);
|
|
10429
10429
|
return a({
|
|
10430
10430
|
rule: u,
|
|
@@ -10530,9 +10530,9 @@ class pt {
|
|
|
10530
10530
|
const d = Qc(u);
|
|
10531
10531
|
a.push(d);
|
|
10532
10532
|
const f = x(o, "addInputRules", l);
|
|
10533
|
-
|
|
10533
|
+
ts(o, e.options.enableInputRules) && f && r.push(...f());
|
|
10534
10534
|
const h = x(o, "addPasteRules", l);
|
|
10535
|
-
|
|
10535
|
+
ts(o, e.options.enablePasteRules) && h && i.push(...h());
|
|
10536
10536
|
const p = x(o, "addProseMirrorPlugins", l);
|
|
10537
10537
|
if (p) {
|
|
10538
10538
|
const m = p();
|
|
@@ -10748,10 +10748,10 @@ const Bu = K.create({
|
|
|
10748
10748
|
}, ju = (n) => ({ tr: e, dispatch: t }) => {
|
|
10749
10749
|
const { from: r, to: i } = n;
|
|
10750
10750
|
return t && e.delete(r, i), !0;
|
|
10751
|
-
}, Ju = () => ({ state: n, dispatch: e }) =>
|
|
10751
|
+
}, Ju = () => ({ state: n, dispatch: e }) => Wr(n, e), Ku = () => ({ commands: n }) => n.keyboardShortcut("Enter"), Uu = () => ({ state: n, dispatch: e }) => su(n, e);
|
|
10752
10752
|
function kn(n, e, t = { strict: !0 }) {
|
|
10753
10753
|
const r = Object.keys(e);
|
|
10754
|
-
return r.length ? r.every((i) => t.strict ? e[i] === n[i] :
|
|
10754
|
+
return r.length ? r.every((i) => t.strict ? e[i] === n[i] : _r(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
|
|
10755
10755
|
}
|
|
10756
10756
|
function Ko(n, e, t = {}) {
|
|
10757
10757
|
return n.find((r) => r.type === e && kn(
|
|
@@ -10760,10 +10760,10 @@ function Ko(n, e, t = {}) {
|
|
|
10760
10760
|
t
|
|
10761
10761
|
));
|
|
10762
10762
|
}
|
|
10763
|
-
function
|
|
10763
|
+
function ns(n, e, t = {}) {
|
|
10764
10764
|
return !!Ko(n, e, t);
|
|
10765
10765
|
}
|
|
10766
|
-
function
|
|
10766
|
+
function Gr(n, e, t) {
|
|
10767
10767
|
var r;
|
|
10768
10768
|
if (!n || !e)
|
|
10769
10769
|
return;
|
|
@@ -10771,9 +10771,9 @@ function Ur(n, e, t) {
|
|
|
10771
10771
|
if ((!i.node || !i.node.marks.some((u) => u.type === e)) && (i = n.parent.childBefore(n.parentOffset)), !i.node || !i.node.marks.some((u) => u.type === e) || (t = t || ((r = i.node.marks[0]) === null || r === void 0 ? void 0 : r.attrs), !Ko([...i.node.marks], e, t)))
|
|
10772
10772
|
return;
|
|
10773
10773
|
let o = i.index, l = n.start() + i.offset, a = o + 1, c = l + i.node.nodeSize;
|
|
10774
|
-
for (; o > 0 &&
|
|
10774
|
+
for (; o > 0 && ns([...n.parent.child(o - 1).marks], e, t); )
|
|
10775
10775
|
o -= 1, l -= n.parent.child(o).nodeSize;
|
|
10776
|
-
for (; a < n.parent.childCount &&
|
|
10776
|
+
for (; a < n.parent.childCount && ns([...n.parent.child(a).marks], e, t); )
|
|
10777
10777
|
c += n.parent.child(a).nodeSize, a += 1;
|
|
10778
10778
|
return {
|
|
10779
10779
|
from: l,
|
|
@@ -10791,7 +10791,7 @@ function je(n, e) {
|
|
|
10791
10791
|
const _u = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
10792
10792
|
const s = je(n, r.schema), { doc: o, selection: l } = t, { $from: a, from: c, to: u } = l;
|
|
10793
10793
|
if (i) {
|
|
10794
|
-
const d =
|
|
10794
|
+
const d = Gr(a, s, e);
|
|
10795
10795
|
if (d && d.from <= c && d.to >= u) {
|
|
10796
10796
|
const f = M.create(o, d.from, d.to);
|
|
10797
10797
|
t.setSelection(f);
|
|
@@ -10822,7 +10822,7 @@ function _o(n, e = null) {
|
|
|
10822
10822
|
const i = t.from, s = r.to;
|
|
10823
10823
|
return e === "all" ? M.create(n, Ge(0, i, s), Ge(n.content.size, i, s)) : M.create(n, Ge(e, i, s), Ge(e, i, s));
|
|
10824
10824
|
}
|
|
10825
|
-
function
|
|
10825
|
+
function rs() {
|
|
10826
10826
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
10827
10827
|
}
|
|
10828
10828
|
function xn() {
|
|
@@ -10844,8 +10844,8 @@ const Xu = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
|
|
|
10844
10844
|
...e
|
|
10845
10845
|
};
|
|
10846
10846
|
const o = () => {
|
|
10847
|
-
(xn() ||
|
|
10848
|
-
t.isDestroyed || (r.focus(), Yu() && !xn() && !
|
|
10847
|
+
(xn() || rs()) && r.dom.focus(), requestAnimationFrame(() => {
|
|
10848
|
+
t.isDestroyed || (r.focus(), Yu() && !xn() && !rs() && r.dom.focus({ preventScroll: !0 }));
|
|
10849
10849
|
});
|
|
10850
10850
|
};
|
|
10851
10851
|
if (r.hasFocus() && n === null || n === !1)
|
|
@@ -11073,7 +11073,7 @@ const hd = (n, e = {}) => ({ state: t, dispatch: r }) => {
|
|
|
11073
11073
|
function Ln(n, e) {
|
|
11074
11074
|
return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
|
|
11075
11075
|
}
|
|
11076
|
-
function
|
|
11076
|
+
function is(n, e) {
|
|
11077
11077
|
const t = typeof e == "string" ? [e] : e;
|
|
11078
11078
|
return Object.keys(n).reduce((r, i) => (t.includes(i) || (r[i] = n[i]), r), {});
|
|
11079
11079
|
}
|
|
@@ -11082,8 +11082,8 @@ const yd = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11082
11082
|
const l = Ln(typeof n == "string" ? n : n.name, r.schema);
|
|
11083
11083
|
return l ? (l === "node" && (s = V(n, r.schema)), l === "mark" && (o = je(n, r.schema)), i && t.selection.ranges.forEach((a) => {
|
|
11084
11084
|
r.doc.nodesBetween(a.$from.pos, a.$to.pos, (c, u) => {
|
|
11085
|
-
s && s === c.type && t.setNodeMarkup(u, void 0,
|
|
11086
|
-
o === d.type && t.addMark(u, u + c.nodeSize, o.create(
|
|
11085
|
+
s && s === c.type && t.setNodeMarkup(u, void 0, is(c.attrs, e)), o && c.marks.length && c.marks.forEach((d) => {
|
|
11086
|
+
o === d.type && t.addMark(u, u + c.nodeSize, o.create(is(d.attrs, e)));
|
|
11087
11087
|
});
|
|
11088
11088
|
});
|
|
11089
11089
|
}), !0) : !1;
|
|
@@ -11143,7 +11143,7 @@ function Ed(n, e) {
|
|
|
11143
11143
|
};
|
|
11144
11144
|
}
|
|
11145
11145
|
}
|
|
11146
|
-
function
|
|
11146
|
+
function Yr(n) {
|
|
11147
11147
|
return (e) => Ed(e.$from, n);
|
|
11148
11148
|
}
|
|
11149
11149
|
function Nd(n, e) {
|
|
@@ -11168,7 +11168,7 @@ function vd(n, e) {
|
|
|
11168
11168
|
function Zo(n, e, t) {
|
|
11169
11169
|
const r = [];
|
|
11170
11170
|
return n === e ? t.resolve(n).marks().forEach((i) => {
|
|
11171
|
-
const s = t.resolve(n), o =
|
|
11171
|
+
const s = t.resolve(n), o = Gr(s, i.type);
|
|
11172
11172
|
o && r.push({
|
|
11173
11173
|
mark: i,
|
|
11174
11174
|
...o
|
|
@@ -11216,7 +11216,7 @@ function Dd(n, e, t = {}) {
|
|
|
11216
11216
|
const r = Ln(e, n.schema);
|
|
11217
11217
|
return r === "node" ? $t(n, e, t) : r === "mark" ? wr(n, e, t) : !1;
|
|
11218
11218
|
}
|
|
11219
|
-
function
|
|
11219
|
+
function ss(n, e) {
|
|
11220
11220
|
const { nodeExtensions: t } = Rn(e), r = t.find((o) => o.name === n);
|
|
11221
11221
|
if (!r)
|
|
11222
11222
|
return !1;
|
|
@@ -11227,7 +11227,7 @@ function rs(n, e) {
|
|
|
11227
11227
|
}, s = E(x(r, "group", i));
|
|
11228
11228
|
return typeof s != "string" ? !1 : s.split(" ").includes("list");
|
|
11229
11229
|
}
|
|
11230
|
-
function
|
|
11230
|
+
function Xr(n, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
|
|
11231
11231
|
var r;
|
|
11232
11232
|
if (t) {
|
|
11233
11233
|
if (n.type.name === "hardBreak")
|
|
@@ -11244,7 +11244,7 @@ function Gr(n, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
|
|
|
11244
11244
|
if (e) {
|
|
11245
11245
|
let i = !0;
|
|
11246
11246
|
return n.content.forEach((s) => {
|
|
11247
|
-
i !== !1 && (
|
|
11247
|
+
i !== !1 && (Xr(s, { ignoreWhitespace: t, checkChildren: e }) || (i = !1));
|
|
11248
11248
|
}), i;
|
|
11249
11249
|
}
|
|
11250
11250
|
return !1;
|
|
@@ -11300,7 +11300,7 @@ const Pd = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11300
11300
|
}, Bd = (n, e) => ({ tr: t }) => (t.setMeta(n, e), !0), Ld = (n, e = {}) => ({ state: t, dispatch: r, chain: i }) => {
|
|
11301
11301
|
const s = V(n, t.schema);
|
|
11302
11302
|
let o;
|
|
11303
|
-
return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) =>
|
|
11303
|
+
return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) => Zi(s, { ...o, ...e })(t) ? !0 : l.clearNodes()).command(({ state: l }) => Zi(s, { ...o, ...e })(l, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
|
|
11304
11304
|
}, zd = (n) => ({ tr: e, dispatch: t }) => {
|
|
11305
11305
|
if (t) {
|
|
11306
11306
|
const { doc: r } = e, i = Ge(n, 0, r.content.size), s = S.create(r, i);
|
|
@@ -11317,7 +11317,7 @@ const Pd = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11317
11317
|
const r = V(n, e.schema);
|
|
11318
11318
|
return ku(r)(e, t);
|
|
11319
11319
|
};
|
|
11320
|
-
function
|
|
11320
|
+
function ls(n, e) {
|
|
11321
11321
|
const t = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
|
|
11322
11322
|
if (t) {
|
|
11323
11323
|
const r = t.filter((i) => e == null ? void 0 : e.includes(i.type.name));
|
|
@@ -11327,7 +11327,7 @@ function is(n, e) {
|
|
|
11327
11327
|
const Vd = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
|
|
11328
11328
|
const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, u = on(c, l.node().type.name, l.node().attrs);
|
|
11329
11329
|
if (s instanceof S && s.node.isBlock)
|
|
11330
|
-
return !l.parentOffset || !Oe(o, l.pos) ? !1 : (r && (n &&
|
|
11330
|
+
return !l.parentOffset || !Oe(o, l.pos) ? !1 : (r && (n && ls(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
|
|
11331
11331
|
if (!l.parent.isBlock)
|
|
11332
11332
|
return !1;
|
|
11333
11333
|
const d = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : Od(l.node(-1).contentMatchAt(l.indexAfter(-1)));
|
|
@@ -11347,7 +11347,7 @@ const Vd = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11347
11347
|
const m = e.mapping.map(l.before()), g = e.doc.resolve(m);
|
|
11348
11348
|
l.node(-1).canReplaceWith(g.index(), g.index() + 1, f) && e.setNodeMarkup(e.mapping.map(l.before()), f);
|
|
11349
11349
|
}
|
|
11350
|
-
n &&
|
|
11350
|
+
n && ls(t, i.extensionManager.splittableMarks), e.scrollIntoView();
|
|
11351
11351
|
}
|
|
11352
11352
|
return p;
|
|
11353
11353
|
}, Hd = (n, e = {}) => ({ tr: t, state: r, dispatch: i, editor: s }) => {
|
|
@@ -11406,7 +11406,7 @@ const Vd = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11406
11406
|
}
|
|
11407
11407
|
return !0;
|
|
11408
11408
|
}, er = (n, e) => {
|
|
11409
|
-
const t =
|
|
11409
|
+
const t = Yr((o) => o.type === e)(n.selection);
|
|
11410
11410
|
if (!t)
|
|
11411
11411
|
return !0;
|
|
11412
11412
|
const r = n.doc.resolve(Math.max(0, t.pos - 1)).before(t.depth);
|
|
@@ -11415,7 +11415,7 @@ const Vd = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11415
11415
|
const i = n.doc.nodeAt(r);
|
|
11416
11416
|
return t.node.type === (i == null ? void 0 : i.type) && We(n.doc, t.pos) && n.join(t.pos), !0;
|
|
11417
11417
|
}, tr = (n, e) => {
|
|
11418
|
-
const t =
|
|
11418
|
+
const t = Yr((o) => o.type === e)(n.selection);
|
|
11419
11419
|
if (!t)
|
|
11420
11420
|
return !0;
|
|
11421
11421
|
const r = n.doc.resolve(t.start).after(t.depth);
|
|
@@ -11427,11 +11427,11 @@ const Vd = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11427
11427
|
const { extensions: d, splittableMarks: f } = i.extensionManager, h = V(n, o.schema), p = V(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: T } = m, C = y.blockRange(T), D = g || m.$to.parentOffset && m.$from.marks();
|
|
11428
11428
|
if (!C)
|
|
11429
11429
|
return !1;
|
|
11430
|
-
const v =
|
|
11430
|
+
const v = Yr((L) => ss(L.type.name, d))(m);
|
|
11431
11431
|
if (C.depth >= 1 && v && C.depth - v.depth <= 1) {
|
|
11432
11432
|
if (v.node.type === h)
|
|
11433
11433
|
return c.liftListItem(p);
|
|
11434
|
-
if (
|
|
11434
|
+
if (ss(v.node.type.name, d) && h.validContent(v.node.content) && l)
|
|
11435
11435
|
return a().command(() => (s.setNodeMarkup(v.pos, h), !0)).command(() => er(s, h)).command(() => tr(s, h)).run();
|
|
11436
11436
|
}
|
|
11437
11437
|
return !t || !D || !l ? a().command(() => u().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => er(s, h)).command(() => tr(s, h)).run() : a().command(() => {
|
|
@@ -11480,7 +11480,7 @@ const Vd = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11480
11480
|
return !0;
|
|
11481
11481
|
if (u && o) {
|
|
11482
11482
|
let { from: f, to: h } = l;
|
|
11483
|
-
const p = (s = c.marks().find((g) => g.type === a)) === null || s === void 0 ? void 0 : s.attrs, m =
|
|
11483
|
+
const p = (s = c.marks().find((g) => g.type === a)) === null || s === void 0 ? void 0 : s.attrs, m = Gr(c, a, p);
|
|
11484
11484
|
m && (f = m.from, h = m.to), t.removeMark(f, h, a);
|
|
11485
11485
|
} else
|
|
11486
11486
|
d.forEach((f) => {
|
|
@@ -11711,7 +11711,7 @@ const Qd = K.create({
|
|
|
11711
11711
|
if (!r || i)
|
|
11712
11712
|
return;
|
|
11713
11713
|
const { empty: s, from: o, to: l } = e.selection, a = O.atStart(e.doc).from, c = O.atEnd(e.doc).to;
|
|
11714
|
-
if (s || !(o === a && l === c) || !
|
|
11714
|
+
if (s || !(o === a && l === c) || !Xr(t.doc))
|
|
11715
11715
|
return;
|
|
11716
11716
|
const f = t.tr, h = Dn({
|
|
11717
11717
|
state: t,
|
|
@@ -12248,7 +12248,7 @@ class uf extends xu {
|
|
|
12248
12248
|
* Get the document as HTML.
|
|
12249
12249
|
*/
|
|
12250
12250
|
getHTML() {
|
|
12251
|
-
return
|
|
12251
|
+
return Ur(this.state.doc.content, this.schema);
|
|
12252
12252
|
}
|
|
12253
12253
|
/**
|
|
12254
12254
|
* Get the document as text.
|
|
@@ -12269,7 +12269,7 @@ class uf extends xu {
|
|
|
12269
12269
|
* Check if there is no content.
|
|
12270
12270
|
*/
|
|
12271
12271
|
get isEmpty() {
|
|
12272
|
-
return
|
|
12272
|
+
return Xr(this.state.doc);
|
|
12273
12273
|
}
|
|
12274
12274
|
/**
|
|
12275
12275
|
* Get the number of characters for the current document.
|
|
@@ -12367,7 +12367,7 @@ function Vt(n) {
|
|
|
12367
12367
|
return new Pn({
|
|
12368
12368
|
find: n.find,
|
|
12369
12369
|
handler: ({ state: e, range: t, match: r, chain: i }) => {
|
|
12370
|
-
const s = E(n.getAttributes, void 0, r) || {}, o = e.tr.delete(t.from, t.to), a = o.doc.resolve(t.from).blockRange(), c = a &&
|
|
12370
|
+
const s = E(n.getAttributes, void 0, r) || {}, o = e.tr.delete(t.from, t.to), a = o.doc.resolve(t.from).blockRange(), c = a && Dr(a, n.type, s);
|
|
12371
12371
|
if (!c)
|
|
12372
12372
|
return null;
|
|
12373
12373
|
if (o.wrap(a, c), n.keepMarks && n.editor) {
|
|
@@ -12558,7 +12558,7 @@ const ff = /^\s*>\s$/, hf = ee.create({
|
|
|
12558
12558
|
})
|
|
12559
12559
|
];
|
|
12560
12560
|
}
|
|
12561
|
-
}), kf = "listItem",
|
|
12561
|
+
}), kf = "listItem", as = "textStyle", cs = /^\s*([-+*])\s$/, xf = ee.create({
|
|
12562
12562
|
name: "bulletList",
|
|
12563
12563
|
addOptions() {
|
|
12564
12564
|
return {
|
|
@@ -12582,7 +12582,7 @@ const ff = /^\s*>\s$/, hf = ee.create({
|
|
|
12582
12582
|
},
|
|
12583
12583
|
addCommands() {
|
|
12584
12584
|
return {
|
|
12585
|
-
toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(kf, this.editor.getAttributes(
|
|
12585
|
+
toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(kf, this.editor.getAttributes(as)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
12586
12586
|
};
|
|
12587
12587
|
},
|
|
12588
12588
|
addKeyboardShortcuts() {
|
|
@@ -12592,15 +12592,15 @@ const ff = /^\s*>\s$/, hf = ee.create({
|
|
|
12592
12592
|
},
|
|
12593
12593
|
addInputRules() {
|
|
12594
12594
|
let n = Vt({
|
|
12595
|
-
find:
|
|
12595
|
+
find: cs,
|
|
12596
12596
|
type: this.type
|
|
12597
12597
|
});
|
|
12598
12598
|
return (this.options.keepMarks || this.options.keepAttributes) && (n = Vt({
|
|
12599
|
-
find:
|
|
12599
|
+
find: cs,
|
|
12600
12600
|
type: this.type,
|
|
12601
12601
|
keepMarks: this.options.keepMarks,
|
|
12602
12602
|
keepAttributes: this.options.keepAttributes,
|
|
12603
|
-
getAttributes: () => this.editor.getAttributes(
|
|
12603
|
+
getAttributes: () => this.editor.getAttributes(as),
|
|
12604
12604
|
editor: this.editor
|
|
12605
12605
|
})), [
|
|
12606
12606
|
n
|
|
@@ -12912,7 +12912,7 @@ class R extends O {
|
|
|
12912
12912
|
@internal
|
|
12913
12913
|
*/
|
|
12914
12914
|
getBookmark() {
|
|
12915
|
-
return new
|
|
12915
|
+
return new Zr(this.anchor);
|
|
12916
12916
|
}
|
|
12917
12917
|
/**
|
|
12918
12918
|
@internal
|
|
@@ -12968,12 +12968,12 @@ class R extends O {
|
|
|
12968
12968
|
R.prototype.visible = !1;
|
|
12969
12969
|
R.findFrom = R.findGapCursorFrom;
|
|
12970
12970
|
O.jsonID("gapcursor", R);
|
|
12971
|
-
class
|
|
12971
|
+
class Zr {
|
|
12972
12972
|
constructor(e) {
|
|
12973
12973
|
this.pos = e;
|
|
12974
12974
|
}
|
|
12975
12975
|
map(e) {
|
|
12976
|
-
return new
|
|
12976
|
+
return new Zr(e.map(this.pos));
|
|
12977
12977
|
}
|
|
12978
12978
|
resolve(e) {
|
|
12979
12979
|
let t = e.resolve(this.pos);
|
|
@@ -13439,9 +13439,9 @@ function Jf(n, e, t, r) {
|
|
|
13439
13439
|
if (t.steps.length == 0)
|
|
13440
13440
|
return n;
|
|
13441
13441
|
if (o && o.getMeta(tt))
|
|
13442
|
-
return o.getMeta(tt).redo ? new De(n.done.addTransform(t, void 0, r, ln(e)), n.undone,
|
|
13442
|
+
return o.getMeta(tt).redo ? new De(n.done.addTransform(t, void 0, r, ln(e)), n.undone, us(t.mapping.maps), n.prevTime, n.prevComposition) : new De(n.done, n.undone.addTransform(t, void 0, r, ln(e)), null, n.prevTime, n.prevComposition);
|
|
13443
13443
|
if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
13444
|
-
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !Kf(t, n.prevRanges)), c = o ? nr(n.prevRanges, t.mapping) :
|
|
13444
|
+
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !Kf(t, n.prevRanges)), c = o ? nr(n.prevRanges, t.mapping) : us(t.mapping.maps);
|
|
13445
13445
|
return new De(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, ln(e)), pe.empty, c, t.time, l ?? n.prevComposition);
|
|
13446
13446
|
} else return (s = t.getMeta("rebased")) ? new De(n.done.rebased(t, s), n.undone.rebased(t, s), nr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new De(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), nr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
|
|
13447
13447
|
}
|
|
@@ -13456,7 +13456,7 @@ function Kf(n, e) {
|
|
|
13456
13456
|
r <= e[s + 1] && i >= e[s] && (t = !0);
|
|
13457
13457
|
}), t;
|
|
13458
13458
|
}
|
|
13459
|
-
function
|
|
13459
|
+
function us(n) {
|
|
13460
13460
|
let e = [];
|
|
13461
13461
|
for (let t = n.length - 1; t >= 0 && e.length == 0; t--)
|
|
13462
13462
|
n[t].forEach((r, i, s, o) => e.push(s, o));
|
|
@@ -13479,11 +13479,11 @@ function Uf(n, e, t) {
|
|
|
13479
13479
|
let o = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), i, r), a = new De(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
|
|
13480
13480
|
return s.transform.setSelection(o).setMeta(tt, { redo: t, historyState: a });
|
|
13481
13481
|
}
|
|
13482
|
-
let rr = !1,
|
|
13482
|
+
let rr = !1, ds = null;
|
|
13483
13483
|
function ln(n) {
|
|
13484
13484
|
let e = n.plugins;
|
|
13485
|
-
if (
|
|
13486
|
-
rr = !1,
|
|
13485
|
+
if (ds != e) {
|
|
13486
|
+
rr = !1, ds = e;
|
|
13487
13487
|
for (let t = 0; t < e.length; t++)
|
|
13488
13488
|
if (e[t].spec.historyPreserveItems) {
|
|
13489
13489
|
rr = !0;
|
|
@@ -13704,7 +13704,7 @@ const rl = nl(!1, !0), il = nl(!0, !0), Yf = K.create({
|
|
|
13704
13704
|
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
|
|
13705
13705
|
};
|
|
13706
13706
|
}
|
|
13707
|
-
}), ih = "listItem",
|
|
13707
|
+
}), ih = "listItem", fs = "textStyle", hs = /^(\d+)\.\s$/, sh = ee.create({
|
|
13708
13708
|
name: "orderedList",
|
|
13709
13709
|
addOptions() {
|
|
13710
13710
|
return {
|
|
@@ -13743,7 +13743,7 @@ const rl = nl(!1, !0), il = nl(!0, !0), Yf = K.create({
|
|
|
13743
13743
|
},
|
|
13744
13744
|
addCommands() {
|
|
13745
13745
|
return {
|
|
13746
|
-
toggleOrderedList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ih, this.editor.getAttributes(
|
|
13746
|
+
toggleOrderedList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ih, this.editor.getAttributes(fs)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
13747
13747
|
};
|
|
13748
13748
|
},
|
|
13749
13749
|
addKeyboardShortcuts() {
|
|
@@ -13753,17 +13753,17 @@ const rl = nl(!1, !0), il = nl(!0, !0), Yf = K.create({
|
|
|
13753
13753
|
},
|
|
13754
13754
|
addInputRules() {
|
|
13755
13755
|
let n = Vt({
|
|
13756
|
-
find:
|
|
13756
|
+
find: hs,
|
|
13757
13757
|
type: this.type,
|
|
13758
13758
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
13759
13759
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1]
|
|
13760
13760
|
});
|
|
13761
13761
|
return (this.options.keepMarks || this.options.keepAttributes) && (n = Vt({
|
|
13762
|
-
find:
|
|
13762
|
+
find: hs,
|
|
13763
13763
|
type: this.type,
|
|
13764
13764
|
keepMarks: this.options.keepMarks,
|
|
13765
13765
|
keepAttributes: this.options.keepAttributes,
|
|
13766
|
-
getAttributes: (e) => ({ start: +e[1], ...this.editor.getAttributes(
|
|
13766
|
+
getAttributes: (e) => ({ start: +e[1], ...this.editor.getAttributes(fs) }),
|
|
13767
13767
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1],
|
|
13768
13768
|
editor: this.editor
|
|
13769
13769
|
})), [
|
|
@@ -14150,7 +14150,7 @@ Or = function() {
|
|
|
14150
14150
|
const t = Cn.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
|
|
14151
14151
|
this.shadowRoot.innerHTML = `
|
|
14152
14152
|
<style>
|
|
14153
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
14153
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.8/dist/css/nineEditor.css";
|
|
14154
14154
|
${r}
|
|
14155
14155
|
</style>
|
|
14156
14156
|
|