@nine-lab/nine-ux 0.1.114 → 0.1.115
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.js +459 -459
- package/dist/nine-ux.umd.js +8 -8
- package/package.json +1 -1
package/dist/nine-ux.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
1
|
+
var El = Object.defineProperty;
|
|
2
2
|
var ui = (n) => {
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var be = (n, e, t) =>
|
|
5
|
+
var Al = (n, e, t) => e in n ? El(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
6
|
+
var be = (n, e, t) => Al(n, typeof e != "symbol" ? e + "" : e, t), _n = (n, e, t) => e.has(n) || ui("Cannot " + t);
|
|
7
7
|
var O = (n, e, t) => (_n(n, e, "read from private field"), t ? t.call(n) : e.get(n)), B = (n, e, t) => e.has(n) ? ui("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), Y = (n, e, t, r) => (_n(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), R = (n, e, t) => (_n(n, e, "access private method"), t);
|
|
8
|
-
import { trace as
|
|
9
|
-
const
|
|
8
|
+
import { trace as Nl, nine as As } from "@nine-lab/nine-util";
|
|
9
|
+
const fi = `
|
|
10
10
|
dialog::backdrop {
|
|
11
11
|
background: rgba(0, 0, 0, 0.3);
|
|
12
12
|
}
|
|
@@ -472,8 +472,8 @@ class Dl extends HTMLElement {
|
|
|
472
472
|
}
|
|
473
473
|
connectedCallback() {
|
|
474
474
|
const t = this.innerHTML, r = this.getAttribute("title") || "Details";
|
|
475
|
-
|
|
476
|
-
<style>${
|
|
475
|
+
Nl.log("================================", fi), this.innerHTML = `
|
|
476
|
+
<style>${fi}</style>
|
|
477
477
|
|
|
478
478
|
<dialog>
|
|
479
479
|
<div class="head">
|
|
@@ -582,7 +582,7 @@ be(Vr, "alert", async (e, t = "Alert", r = {}) => {
|
|
|
582
582
|
});
|
|
583
583
|
customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", $r);
|
|
584
584
|
customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", Vr);
|
|
585
|
-
const Il = typeof window < "u" && window.nine ? window.nine :
|
|
585
|
+
const Il = typeof window < "u" && window.nine ? window.nine : As;
|
|
586
586
|
var _t, Gt, mr;
|
|
587
587
|
class Rl {
|
|
588
588
|
constructor() {
|
|
@@ -832,7 +832,7 @@ K.from = function(n) {
|
|
|
832
832
|
if (n) for (var t in n) e.push(t, n[t]);
|
|
833
833
|
return new K(e);
|
|
834
834
|
};
|
|
835
|
-
function
|
|
835
|
+
function Ns(n, e, t) {
|
|
836
836
|
for (let r = 0; ; r++) {
|
|
837
837
|
if (r == n.childCount || r == e.childCount)
|
|
838
838
|
return n.childCount == e.childCount ? null : t;
|
|
@@ -849,14 +849,14 @@ function As(n, e, t) {
|
|
|
849
849
|
return t;
|
|
850
850
|
}
|
|
851
851
|
if (i.content.size || s.content.size) {
|
|
852
|
-
let o =
|
|
852
|
+
let o = Ns(i.content, s.content, t + 1);
|
|
853
853
|
if (o != null)
|
|
854
854
|
return o;
|
|
855
855
|
}
|
|
856
856
|
t += i.nodeSize;
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function Ds(n, e, t, r) {
|
|
860
860
|
for (let i = n.childCount, s = e.childCount; ; ) {
|
|
861
861
|
if (i == 0 || s == 0)
|
|
862
862
|
return i == s ? null : { a: t, b: r };
|
|
@@ -874,7 +874,7 @@ function Ns(n, e, t, r) {
|
|
|
874
874
|
return { a: t, b: r };
|
|
875
875
|
}
|
|
876
876
|
if (o.content.size || l.content.size) {
|
|
877
|
-
let c =
|
|
877
|
+
let c = Ds(o.content, l.content, t - 1, r - 1);
|
|
878
878
|
if (c)
|
|
879
879
|
return c;
|
|
880
880
|
}
|
|
@@ -1043,7 +1043,7 @@ class b {
|
|
|
1043
1043
|
fragment differ, or `null` if they are the same.
|
|
1044
1044
|
*/
|
|
1045
1045
|
findDiffStart(e, t = 0) {
|
|
1046
|
-
return
|
|
1046
|
+
return Ns(this, e, t);
|
|
1047
1047
|
}
|
|
1048
1048
|
/**
|
|
1049
1049
|
Find the first position, searching from the end, at which this
|
|
@@ -1052,7 +1052,7 @@ class b {
|
|
|
1052
1052
|
nodes, an object with two separate positions is returned.
|
|
1053
1053
|
*/
|
|
1054
1054
|
findDiffEnd(e, t = this.size, r = e.size) {
|
|
1055
|
-
return
|
|
1055
|
+
return Ds(this, e, t, r);
|
|
1056
1056
|
}
|
|
1057
1057
|
/**
|
|
1058
1058
|
Find the index and inner offset corresponding to a given relative
|
|
@@ -1296,14 +1296,14 @@ class k {
|
|
|
1296
1296
|
@internal
|
|
1297
1297
|
*/
|
|
1298
1298
|
insertAt(e, t) {
|
|
1299
|
-
let r =
|
|
1299
|
+
let r = Rs(this.content, e + this.openStart, t);
|
|
1300
1300
|
return r && new k(r, this.openStart, this.openEnd);
|
|
1301
1301
|
}
|
|
1302
1302
|
/**
|
|
1303
1303
|
@internal
|
|
1304
1304
|
*/
|
|
1305
1305
|
removeBetween(e, t) {
|
|
1306
|
-
return new k(
|
|
1306
|
+
return new k(Is(this.content, e + this.openStart, t + this.openStart), this.openStart, this.openEnd);
|
|
1307
1307
|
}
|
|
1308
1308
|
/**
|
|
1309
1309
|
Tests whether this slice is equal to another slice.
|
|
@@ -1351,7 +1351,7 @@ class k {
|
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
1353
1353
|
k.empty = new k(b.empty, 0, 0);
|
|
1354
|
-
function
|
|
1354
|
+
function Is(n, e, t) {
|
|
1355
1355
|
let { index: r, offset: i } = n.findIndex(e), s = n.maybeChild(r), { index: o, offset: l } = n.findIndex(t);
|
|
1356
1356
|
if (i == e || s.isText) {
|
|
1357
1357
|
if (l != t && !n.child(o).isText)
|
|
@@ -1360,13 +1360,13 @@ function Ds(n, e, t) {
|
|
|
1360
1360
|
}
|
|
1361
1361
|
if (r != o)
|
|
1362
1362
|
throw new RangeError("Removing non-flat range");
|
|
1363
|
-
return n.replaceChild(r, s.copy(
|
|
1363
|
+
return n.replaceChild(r, s.copy(Is(s.content, e - i - 1, t - i - 1)));
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1365
|
+
function Rs(n, e, t, r) {
|
|
1366
1366
|
let { index: i, offset: s } = n.findIndex(e), o = n.maybeChild(i);
|
|
1367
1367
|
if (s == e || o.isText)
|
|
1368
1368
|
return r && !r.canReplace(i, i, t) ? null : n.cut(0, e).append(t).append(n.cut(e));
|
|
1369
|
-
let l =
|
|
1369
|
+
let l = Rs(o.content, e - s - 1, t, o);
|
|
1370
1370
|
return l && n.replaceChild(i, o.copy(l));
|
|
1371
1371
|
}
|
|
1372
1372
|
function Bl(n, e, t) {
|
|
@@ -1374,12 +1374,12 @@ function Bl(n, e, t) {
|
|
|
1374
1374
|
throw new bn("Inserted content deeper than insertion position");
|
|
1375
1375
|
if (n.depth - t.openStart != e.depth - t.openEnd)
|
|
1376
1376
|
throw new bn("Inconsistent open depths");
|
|
1377
|
-
return
|
|
1377
|
+
return Ps(n, e, t, 0);
|
|
1378
1378
|
}
|
|
1379
|
-
function
|
|
1379
|
+
function Ps(n, e, t, r) {
|
|
1380
1380
|
let i = n.index(r), s = n.node(r);
|
|
1381
1381
|
if (i == e.index(r) && r < n.depth - t.openStart) {
|
|
1382
|
-
let o =
|
|
1382
|
+
let o = Ps(n, e, t, r + 1);
|
|
1383
1383
|
return s.copy(s.content.replaceChild(i, o));
|
|
1384
1384
|
} else if (t.content.size)
|
|
1385
1385
|
if (!t.openStart && !t.openEnd && n.depth == r && e.depth == r) {
|
|
@@ -1387,17 +1387,17 @@ function Rs(n, e, t, r) {
|
|
|
1387
1387
|
return tt(o, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
|
|
1388
1388
|
} else {
|
|
1389
1389
|
let { start: o, end: l } = Ll(t, n);
|
|
1390
|
-
return tt(s,
|
|
1390
|
+
return tt(s, Ls(n, o, l, e, r));
|
|
1391
1391
|
}
|
|
1392
1392
|
else return tt(s, kn(n, e, r));
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1394
|
+
function Bs(n, e) {
|
|
1395
1395
|
if (!e.type.compatibleContent(n.type))
|
|
1396
1396
|
throw new bn("Cannot join " + e.type.name + " onto " + n.type.name);
|
|
1397
1397
|
}
|
|
1398
1398
|
function kr(n, e, t) {
|
|
1399
1399
|
let r = n.node(t);
|
|
1400
|
-
return
|
|
1400
|
+
return Bs(r, e.node(t)), r;
|
|
1401
1401
|
}
|
|
1402
1402
|
function et(n, e) {
|
|
1403
1403
|
let t = e.length - 1;
|
|
@@ -1413,9 +1413,9 @@ function Rt(n, e, t, r) {
|
|
|
1413
1413
|
function tt(n, e) {
|
|
1414
1414
|
return n.type.checkContent(e), n.copy(e);
|
|
1415
1415
|
}
|
|
1416
|
-
function
|
|
1416
|
+
function Ls(n, e, t, r, i) {
|
|
1417
1417
|
let s = n.depth > i && kr(n, e, i + 1), o = r.depth > i && kr(t, r, i + 1), l = [];
|
|
1418
|
-
return Rt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (
|
|
1418
|
+
return Rt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Bs(s, o), et(tt(s, Ls(n, e, t, r, i + 1)), l)) : (s && et(tt(s, kn(n, e, i + 1)), l), Rt(e, t, i, l), o && et(tt(o, kn(t, r, i + 1)), l)), Rt(r, null, i, l), new b(l);
|
|
1419
1419
|
}
|
|
1420
1420
|
function kn(n, e, t) {
|
|
1421
1421
|
let r = [];
|
|
@@ -1668,7 +1668,7 @@ class Ft {
|
|
|
1668
1668
|
@internal
|
|
1669
1669
|
*/
|
|
1670
1670
|
static resolveCached(e, t) {
|
|
1671
|
-
let r =
|
|
1671
|
+
let r = hi.get(e);
|
|
1672
1672
|
if (r)
|
|
1673
1673
|
for (let s = 0; s < r.elts.length; s++) {
|
|
1674
1674
|
let o = r.elts[s];
|
|
@@ -1676,7 +1676,7 @@ class Ft {
|
|
|
1676
1676
|
return o;
|
|
1677
1677
|
}
|
|
1678
1678
|
else
|
|
1679
|
-
|
|
1679
|
+
hi.set(e, r = new zl());
|
|
1680
1680
|
let i = r.elts[r.i] = Ft.resolve(e, t);
|
|
1681
1681
|
return r.i = (r.i + 1) % Fl, i;
|
|
1682
1682
|
}
|
|
@@ -1686,7 +1686,7 @@ class zl {
|
|
|
1686
1686
|
this.elts = [], this.i = 0;
|
|
1687
1687
|
}
|
|
1688
1688
|
}
|
|
1689
|
-
const Fl = 12,
|
|
1689
|
+
const Fl = 12, hi = /* @__PURE__ */ new WeakMap();
|
|
1690
1690
|
class xn {
|
|
1691
1691
|
/**
|
|
1692
1692
|
Construct a node range. `$from` and `$to` should point into the
|
|
@@ -2004,7 +2004,7 @@ let $e = class xr {
|
|
|
2004
2004
|
if (this.type.spec.toDebugString)
|
|
2005
2005
|
return this.type.spec.toDebugString(this);
|
|
2006
2006
|
let e = this.type.name;
|
|
2007
|
-
return this.content.size && (e += "(" + this.content.toStringInner() + ")"),
|
|
2007
|
+
return this.content.size && (e += "(" + this.content.toStringInner() + ")"), zs(this.marks, e);
|
|
2008
2008
|
}
|
|
2009
2009
|
/**
|
|
2010
2010
|
Get the content match in this node at the given index.
|
|
@@ -2108,7 +2108,7 @@ class Sn extends $e {
|
|
|
2108
2108
|
this.text = r;
|
|
2109
2109
|
}
|
|
2110
2110
|
toString() {
|
|
2111
|
-
return this.type.spec.toDebugString ? this.type.spec.toDebugString(this) :
|
|
2111
|
+
return this.type.spec.toDebugString ? this.type.spec.toDebugString(this) : zs(this.marks, JSON.stringify(this.text));
|
|
2112
2112
|
}
|
|
2113
2113
|
get textContent() {
|
|
2114
2114
|
return this.text;
|
|
@@ -2136,7 +2136,7 @@ class Sn extends $e {
|
|
|
2136
2136
|
return e.text = this.text, e;
|
|
2137
2137
|
}
|
|
2138
2138
|
}
|
|
2139
|
-
function
|
|
2139
|
+
function zs(n, e) {
|
|
2140
2140
|
for (let t = n.length - 1; t >= 0; t--)
|
|
2141
2141
|
e = n[t].type.name + "(" + e + ")";
|
|
2142
2142
|
return e;
|
|
@@ -2155,7 +2155,7 @@ class st {
|
|
|
2155
2155
|
let r = new Vl(e, t);
|
|
2156
2156
|
if (r.next == null)
|
|
2157
2157
|
return st.empty;
|
|
2158
|
-
let i =
|
|
2158
|
+
let i = Fs(r);
|
|
2159
2159
|
r.next && r.err("Unexpected trailing text");
|
|
2160
2160
|
let s = Ul(Jl(i));
|
|
2161
2161
|
return _l(s, r), s;
|
|
@@ -2318,7 +2318,7 @@ class Vl {
|
|
|
2318
2318
|
throw new SyntaxError(e + " (in content expression '" + this.string + "')");
|
|
2319
2319
|
}
|
|
2320
2320
|
}
|
|
2321
|
-
function
|
|
2321
|
+
function Fs(n) {
|
|
2322
2322
|
let e = [];
|
|
2323
2323
|
do
|
|
2324
2324
|
e.push(Hl(n));
|
|
@@ -2347,14 +2347,14 @@ function Wl(n) {
|
|
|
2347
2347
|
break;
|
|
2348
2348
|
return e;
|
|
2349
2349
|
}
|
|
2350
|
-
function
|
|
2350
|
+
function pi(n) {
|
|
2351
2351
|
/\D/.test(n.next) && n.err("Expected number, got '" + n.next + "'");
|
|
2352
2352
|
let e = Number(n.next);
|
|
2353
2353
|
return n.pos++, e;
|
|
2354
2354
|
}
|
|
2355
2355
|
function ql(n, e) {
|
|
2356
|
-
let t =
|
|
2357
|
-
return n.eat(",") && (n.next != "}" ? r =
|
|
2356
|
+
let t = pi(n), r = t;
|
|
2357
|
+
return n.eat(",") && (n.next != "}" ? r = pi(n) : r = -1), n.eat("}") || n.err("Unclosed braced range"), { type: "range", min: t, max: r, expr: e };
|
|
2358
2358
|
}
|
|
2359
2359
|
function jl(n, e) {
|
|
2360
2360
|
let t = n.nodeTypes, r = t[e];
|
|
@@ -2369,7 +2369,7 @@ function jl(n, e) {
|
|
|
2369
2369
|
}
|
|
2370
2370
|
function Kl(n) {
|
|
2371
2371
|
if (n.eat("(")) {
|
|
2372
|
-
let e =
|
|
2372
|
+
let e = Fs(n);
|
|
2373
2373
|
return n.eat(")") || n.err("Missing closing paren"), e;
|
|
2374
2374
|
} else if (/\W/.test(n.next))
|
|
2375
2375
|
n.err("Unexpected token '" + n.next + "'");
|
|
@@ -2432,12 +2432,12 @@ function Jl(n) {
|
|
|
2432
2432
|
}
|
|
2433
2433
|
}
|
|
2434
2434
|
}
|
|
2435
|
-
function
|
|
2435
|
+
function $s(n, e) {
|
|
2436
2436
|
return e - n;
|
|
2437
2437
|
}
|
|
2438
|
-
function
|
|
2438
|
+
function mi(n, e) {
|
|
2439
2439
|
let t = [];
|
|
2440
|
-
return r(e), t.sort(
|
|
2440
|
+
return r(e), t.sort($s);
|
|
2441
2441
|
function r(i) {
|
|
2442
2442
|
let s = n[i];
|
|
2443
2443
|
if (s.length == 1 && !s[0].term)
|
|
@@ -2451,7 +2451,7 @@ function pi(n, e) {
|
|
|
2451
2451
|
}
|
|
2452
2452
|
function Ul(n) {
|
|
2453
2453
|
let e = /* @__PURE__ */ Object.create(null);
|
|
2454
|
-
return t(
|
|
2454
|
+
return t(mi(n, 0));
|
|
2455
2455
|
function t(r) {
|
|
2456
2456
|
let i = [];
|
|
2457
2457
|
r.forEach((o) => {
|
|
@@ -2461,14 +2461,14 @@ function Ul(n) {
|
|
|
2461
2461
|
let c;
|
|
2462
2462
|
for (let d = 0; d < i.length; d++)
|
|
2463
2463
|
i[d][0] == l && (c = i[d][1]);
|
|
2464
|
-
|
|
2464
|
+
mi(n, a).forEach((d) => {
|
|
2465
2465
|
c || i.push([l, c = []]), c.indexOf(d) == -1 && c.push(d);
|
|
2466
2466
|
});
|
|
2467
2467
|
});
|
|
2468
2468
|
});
|
|
2469
2469
|
let s = e[r.join(",")] = new st(r.indexOf(n.length - 1) > -1);
|
|
2470
2470
|
for (let o = 0; o < i.length; o++) {
|
|
2471
|
-
let l = i[o][1].sort(
|
|
2471
|
+
let l = i[o][1].sort($s);
|
|
2472
2472
|
s.next.push({ type: i[o][0], next: e[l.join(",")] || t(l) });
|
|
2473
2473
|
}
|
|
2474
2474
|
return s;
|
|
@@ -2484,7 +2484,7 @@ function _l(n, e) {
|
|
|
2484
2484
|
s && e.err("Only non-generatable nodes (" + o.join(", ") + ") in a required position (see https://prosemirror.net/docs/guide/#generatable)");
|
|
2485
2485
|
}
|
|
2486
2486
|
}
|
|
2487
|
-
function
|
|
2487
|
+
function Vs(n) {
|
|
2488
2488
|
let e = /* @__PURE__ */ Object.create(null);
|
|
2489
2489
|
for (let t in n) {
|
|
2490
2490
|
let r = n[t];
|
|
@@ -2494,7 +2494,7 @@ function $s(n) {
|
|
|
2494
2494
|
}
|
|
2495
2495
|
return e;
|
|
2496
2496
|
}
|
|
2497
|
-
function
|
|
2497
|
+
function Hs(n, e) {
|
|
2498
2498
|
let t = /* @__PURE__ */ Object.create(null);
|
|
2499
2499
|
for (let r in n) {
|
|
2500
2500
|
let i = e && e[r];
|
|
@@ -2509,7 +2509,7 @@ function Vs(n, e) {
|
|
|
2509
2509
|
}
|
|
2510
2510
|
return t;
|
|
2511
2511
|
}
|
|
2512
|
-
function
|
|
2512
|
+
function Ws(n, e, t, r) {
|
|
2513
2513
|
for (let i in e)
|
|
2514
2514
|
if (!(i in n))
|
|
2515
2515
|
throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);
|
|
@@ -2518,19 +2518,19 @@ function Hs(n, e, t, r) {
|
|
|
2518
2518
|
s.validate && s.validate(e[i]);
|
|
2519
2519
|
}
|
|
2520
2520
|
}
|
|
2521
|
-
function
|
|
2521
|
+
function qs(n, e) {
|
|
2522
2522
|
let t = /* @__PURE__ */ Object.create(null);
|
|
2523
2523
|
if (e)
|
|
2524
2524
|
for (let r in e)
|
|
2525
2525
|
t[r] = new Xl(n, r, e[r]);
|
|
2526
2526
|
return t;
|
|
2527
2527
|
}
|
|
2528
|
-
let
|
|
2528
|
+
let gi = class js {
|
|
2529
2529
|
/**
|
|
2530
2530
|
@internal
|
|
2531
2531
|
*/
|
|
2532
2532
|
constructor(e, t, r) {
|
|
2533
|
-
this.name = e, this.schema = t, this.spec = r, this.markSet = null, this.groups = r.group ? r.group.split(" ") : [], this.attrs =
|
|
2533
|
+
this.name = e, this.schema = t, this.spec = r, this.markSet = null, this.groups = r.group ? r.group.split(" ") : [], this.attrs = qs(e, r.attrs), this.defaultAttrs = Vs(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(r.inline || e == "text"), this.isText = e == "text";
|
|
2534
2534
|
}
|
|
2535
2535
|
/**
|
|
2536
2536
|
True if this is an inline type.
|
|
@@ -2591,7 +2591,7 @@ let mi = class qs {
|
|
|
2591
2591
|
@internal
|
|
2592
2592
|
*/
|
|
2593
2593
|
computeAttrs(e) {
|
|
2594
|
-
return !e && this.defaultAttrs ? this.defaultAttrs :
|
|
2594
|
+
return !e && this.defaultAttrs ? this.defaultAttrs : Hs(this.attrs, e);
|
|
2595
2595
|
}
|
|
2596
2596
|
/**
|
|
2597
2597
|
Create a `Node` of this type. The given attributes are
|
|
@@ -2658,7 +2658,7 @@ let mi = class qs {
|
|
|
2658
2658
|
@internal
|
|
2659
2659
|
*/
|
|
2660
2660
|
checkAttrs(e) {
|
|
2661
|
-
|
|
2661
|
+
Ws(this.attrs, e, "node", this.name);
|
|
2662
2662
|
}
|
|
2663
2663
|
/**
|
|
2664
2664
|
Check whether the given mark type is allowed in this node.
|
|
@@ -2693,7 +2693,7 @@ let mi = class qs {
|
|
|
2693
2693
|
*/
|
|
2694
2694
|
static compile(e, t) {
|
|
2695
2695
|
let r = /* @__PURE__ */ Object.create(null);
|
|
2696
|
-
e.forEach((s, o) => r[s] = new
|
|
2696
|
+
e.forEach((s, o) => r[s] = new js(s, t, o));
|
|
2697
2697
|
let i = t.spec.topNode || "doc";
|
|
2698
2698
|
if (!r[i])
|
|
2699
2699
|
throw new RangeError("Schema is missing its top node type ('" + i + "')");
|
|
@@ -2725,8 +2725,8 @@ class Bn {
|
|
|
2725
2725
|
@internal
|
|
2726
2726
|
*/
|
|
2727
2727
|
constructor(e, t, r, i) {
|
|
2728
|
-
this.name = e, this.rank = t, this.schema = r, this.spec = i, this.attrs =
|
|
2729
|
-
let s =
|
|
2728
|
+
this.name = e, this.rank = t, this.schema = r, this.spec = i, this.attrs = qs(e, i.attrs), this.excluded = null;
|
|
2729
|
+
let s = Vs(this.attrs);
|
|
2730
2730
|
this.instance = s ? new N(this, s) : null;
|
|
2731
2731
|
}
|
|
2732
2732
|
/**
|
|
@@ -2735,7 +2735,7 @@ class Bn {
|
|
|
2735
2735
|
they have defaults, will be added.
|
|
2736
2736
|
*/
|
|
2737
2737
|
create(e = null) {
|
|
2738
|
-
return !e && this.instance ? this.instance : new N(this,
|
|
2738
|
+
return !e && this.instance ? this.instance : new N(this, Hs(this.attrs, e));
|
|
2739
2739
|
}
|
|
2740
2740
|
/**
|
|
2741
2741
|
@internal
|
|
@@ -2765,7 +2765,7 @@ class Bn {
|
|
|
2765
2765
|
@internal
|
|
2766
2766
|
*/
|
|
2767
2767
|
checkAttrs(e) {
|
|
2768
|
-
|
|
2768
|
+
Ws(this.attrs, e, "mark", this.name);
|
|
2769
2769
|
}
|
|
2770
2770
|
/**
|
|
2771
2771
|
Queries whether a given mark type is
|
|
@@ -2775,7 +2775,7 @@ class Bn {
|
|
|
2775
2775
|
return this.excluded.indexOf(e) > -1;
|
|
2776
2776
|
}
|
|
2777
2777
|
}
|
|
2778
|
-
class
|
|
2778
|
+
class Ks {
|
|
2779
2779
|
/**
|
|
2780
2780
|
Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).
|
|
2781
2781
|
*/
|
|
@@ -2784,7 +2784,7 @@ class js {
|
|
|
2784
2784
|
let t = this.spec = {};
|
|
2785
2785
|
for (let i in e)
|
|
2786
2786
|
t[i] = e[i];
|
|
2787
|
-
t.nodes = K.from(e.nodes), t.marks = K.from(e.marks || {}), this.nodes =
|
|
2787
|
+
t.nodes = K.from(e.nodes), t.marks = K.from(e.marks || {}), this.nodes = gi.compile(this.spec.nodes, this), this.marks = Bn.compile(this.spec.marks, this);
|
|
2788
2788
|
let r = /* @__PURE__ */ Object.create(null);
|
|
2789
2789
|
for (let i in this.nodes) {
|
|
2790
2790
|
if (i in this.marks)
|
|
@@ -2797,11 +2797,11 @@ class js {
|
|
|
2797
2797
|
throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");
|
|
2798
2798
|
this.linebreakReplacement = s;
|
|
2799
2799
|
}
|
|
2800
|
-
s.markSet = l == "_" ? null : l ?
|
|
2800
|
+
s.markSet = l == "_" ? null : l ? yi(this, l.split(" ")) : l == "" || !s.inlineContent ? [] : null;
|
|
2801
2801
|
}
|
|
2802
2802
|
for (let i in this.marks) {
|
|
2803
2803
|
let s = this.marks[i], o = s.spec.excludes;
|
|
2804
|
-
s.excluded = o == null ? [s] : o == "" ? [] :
|
|
2804
|
+
s.excluded = o == null ? [s] : o == "" ? [] : yi(this, o.split(" "));
|
|
2805
2805
|
}
|
|
2806
2806
|
this.nodeFromJSON = (i) => $e.fromJSON(this, i), this.markFromJSON = (i) => N.fromJSON(this, i), this.topNodeType = this.nodes[this.spec.topNode || "doc"], this.cached.wrappings = /* @__PURE__ */ Object.create(null);
|
|
2807
2807
|
}
|
|
@@ -2814,7 +2814,7 @@ class js {
|
|
|
2814
2814
|
node(e, t = null, r, i) {
|
|
2815
2815
|
if (typeof e == "string")
|
|
2816
2816
|
e = this.nodeType(e);
|
|
2817
|
-
else if (e instanceof
|
|
2817
|
+
else if (e instanceof gi) {
|
|
2818
2818
|
if (e.schema != this)
|
|
2819
2819
|
throw new RangeError("Node type from different schema used (" + e.name + ")");
|
|
2820
2820
|
} else throw new RangeError("Invalid node type: " + e);
|
|
@@ -2844,7 +2844,7 @@ class js {
|
|
|
2844
2844
|
return t;
|
|
2845
2845
|
}
|
|
2846
2846
|
}
|
|
2847
|
-
function
|
|
2847
|
+
function yi(n, e) {
|
|
2848
2848
|
let t = [];
|
|
2849
2849
|
for (let r = 0; r < e.length; r++) {
|
|
2850
2850
|
let i = e[r], s = n.marks[i], o = s;
|
|
@@ -2892,7 +2892,7 @@ class Ve {
|
|
|
2892
2892
|
Parse a document from the content of a DOM node.
|
|
2893
2893
|
*/
|
|
2894
2894
|
parse(e, t = {}) {
|
|
2895
|
-
let r = new
|
|
2895
|
+
let r = new ki(this, t, !1);
|
|
2896
2896
|
return r.addAll(e, N.none, t.from, t.to), r.finish();
|
|
2897
2897
|
}
|
|
2898
2898
|
/**
|
|
@@ -2904,7 +2904,7 @@ class Ve {
|
|
|
2904
2904
|
the left of the input and the end of nodes at the end.
|
|
2905
2905
|
*/
|
|
2906
2906
|
parseSlice(e, t = {}) {
|
|
2907
|
-
let r = new
|
|
2907
|
+
let r = new ki(this, t, !0);
|
|
2908
2908
|
return r.addAll(e, N.none, t.from, t.to), k.maxOpen(r.finish());
|
|
2909
2909
|
}
|
|
2910
2910
|
/**
|
|
@@ -2961,13 +2961,13 @@ class Ve {
|
|
|
2961
2961
|
for (let i in e.marks) {
|
|
2962
2962
|
let s = e.marks[i].spec.parseDOM;
|
|
2963
2963
|
s && s.forEach((o) => {
|
|
2964
|
-
r(o =
|
|
2964
|
+
r(o = xi(o)), o.mark || o.ignore || o.clearMark || (o.mark = i);
|
|
2965
2965
|
});
|
|
2966
2966
|
}
|
|
2967
2967
|
for (let i in e.nodes) {
|
|
2968
2968
|
let s = e.nodes[i].spec.parseDOM;
|
|
2969
2969
|
s && s.forEach((o) => {
|
|
2970
|
-
r(o =
|
|
2970
|
+
r(o = xi(o)), o.node || o.ignore || o.mark || (o.node = i);
|
|
2971
2971
|
});
|
|
2972
2972
|
}
|
|
2973
2973
|
return t;
|
|
@@ -2981,7 +2981,7 @@ class Ve {
|
|
|
2981
2981
|
return e.cached.domParser || (e.cached.domParser = new Ve(e, Ve.schemaRules(e)));
|
|
2982
2982
|
}
|
|
2983
2983
|
}
|
|
2984
|
-
const
|
|
2984
|
+
const Js = {
|
|
2985
2985
|
address: !0,
|
|
2986
2986
|
article: !0,
|
|
2987
2987
|
aside: !0,
|
|
@@ -3021,8 +3021,8 @@ const Ks = {
|
|
|
3021
3021
|
script: !0,
|
|
3022
3022
|
style: !0,
|
|
3023
3023
|
title: !0
|
|
3024
|
-
},
|
|
3025
|
-
function
|
|
3024
|
+
}, Us = { ol: !0, ul: !0 }, $t = 1, Sr = 2, Pt = 4;
|
|
3025
|
+
function bi(n, e, t) {
|
|
3026
3026
|
return e != null ? (e ? $t : 0) | (e === "full" ? Sr : 0) : n && n.whitespace == "pre" ? $t | Sr : t & ~Pt;
|
|
3027
3027
|
}
|
|
3028
3028
|
class on {
|
|
@@ -3055,13 +3055,13 @@ class on {
|
|
|
3055
3055
|
return !e && this.match && (t = t.append(this.match.fillBefore(b.empty, !0))), this.type ? this.type.create(this.attrs, t, this.marks) : t;
|
|
3056
3056
|
}
|
|
3057
3057
|
inlineContext(e) {
|
|
3058
|
-
return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !
|
|
3058
|
+
return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !Js.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
|
|
3059
3059
|
}
|
|
3060
3060
|
}
|
|
3061
|
-
class
|
|
3061
|
+
class ki {
|
|
3062
3062
|
constructor(e, t, r) {
|
|
3063
3063
|
this.parser = e, this.options = t, this.isOpen = r, this.open = 0, this.localPreserveWS = !1;
|
|
3064
|
-
let i = t.topNode, s, o =
|
|
3064
|
+
let i = t.topNode, s, o = bi(null, t.preserveWhitespace, 0) | (r ? Pt : 0);
|
|
3065
3065
|
i ? s = new on(i.type, i.attrs, N.none, !0, t.topMatch || i.type.contentMatch, o) : r ? s = new on(null, null, N.none, !0, null, o) : s = new on(e.schema.topNodeType, null, N.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
|
|
3066
3066
|
}
|
|
3067
3067
|
get top() {
|
|
@@ -3101,14 +3101,14 @@ class bi {
|
|
|
3101
3101
|
let i = this.localPreserveWS, s = this.top;
|
|
3102
3102
|
(e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
|
|
3103
3103
|
let o = e.nodeName.toLowerCase(), l;
|
|
3104
|
-
|
|
3104
|
+
Us.hasOwnProperty(o) && this.parser.normalizeLists && ea(e);
|
|
3105
3105
|
let a = this.options.ruleFromNode && this.options.ruleFromNode(e) || (l = this.parser.matchTag(e, this, r));
|
|
3106
3106
|
e: if (a ? a.ignore : Ql.hasOwnProperty(o))
|
|
3107
3107
|
this.findInside(e), this.ignoreFallback(e, t);
|
|
3108
3108
|
else if (!a || a.skip || a.closeParent) {
|
|
3109
3109
|
a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
|
|
3110
3110
|
let c, d = this.needsBlock;
|
|
3111
|
-
if (
|
|
3111
|
+
if (Js.hasOwnProperty(o))
|
|
3112
3112
|
s.content.length && s.content[0].isInline && this.open && (this.open--, s = this.top), c = !0, s.type || (this.needsBlock = !0);
|
|
3113
3113
|
else if (!e.firstChild) {
|
|
3114
3114
|
this.leafFallback(e, t);
|
|
@@ -3227,7 +3227,7 @@ class bi {
|
|
|
3227
3227
|
s.match && (s.match = s.match.matchType(e.type));
|
|
3228
3228
|
let o = N.none;
|
|
3229
3229
|
for (let l of i.concat(e.marks))
|
|
3230
|
-
(s.type ? s.type.allowsMarkType(l.type) :
|
|
3230
|
+
(s.type ? s.type.allowsMarkType(l.type) : Si(l.type, e.type)) && (o = l.addToSet(o));
|
|
3231
3231
|
return s.content.push(e.mark(o)), !0;
|
|
3232
3232
|
}
|
|
3233
3233
|
return !1;
|
|
@@ -3243,10 +3243,10 @@ class bi {
|
|
|
3243
3243
|
this.closeExtra();
|
|
3244
3244
|
let o = this.top;
|
|
3245
3245
|
o.match = o.match && o.match.matchType(e);
|
|
3246
|
-
let l =
|
|
3246
|
+
let l = bi(e, s, o.options);
|
|
3247
3247
|
o.options & Pt && o.content.length == 0 && (l |= Pt);
|
|
3248
3248
|
let a = N.none;
|
|
3249
|
-
return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) :
|
|
3249
|
+
return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : Si(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new on(e, t, a, i, null, l)), this.open++, r;
|
|
3250
3250
|
}
|
|
3251
3251
|
// Make sure all nodes above this.open are finished and added to
|
|
3252
3252
|
// their parents
|
|
@@ -3343,19 +3343,19 @@ class bi {
|
|
|
3343
3343
|
function ea(n) {
|
|
3344
3344
|
for (let e = n.firstChild, t = null; e; e = e.nextSibling) {
|
|
3345
3345
|
let r = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
|
|
3346
|
-
r &&
|
|
3346
|
+
r && Us.hasOwnProperty(r) && t ? (t.appendChild(e), e = t) : r == "li" ? t = e : r && (t = null);
|
|
3347
3347
|
}
|
|
3348
3348
|
}
|
|
3349
3349
|
function ta(n, e) {
|
|
3350
3350
|
return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
|
|
3351
3351
|
}
|
|
3352
|
-
function
|
|
3352
|
+
function xi(n) {
|
|
3353
3353
|
let e = {};
|
|
3354
3354
|
for (let t in n)
|
|
3355
3355
|
e[t] = n[t];
|
|
3356
3356
|
return e;
|
|
3357
3357
|
}
|
|
3358
|
-
function
|
|
3358
|
+
function Si(n, e) {
|
|
3359
3359
|
let t = e.schema.nodes;
|
|
3360
3360
|
for (let r in t) {
|
|
3361
3361
|
let i = t[r];
|
|
@@ -3467,17 +3467,17 @@ class ut {
|
|
|
3467
3467
|
This can be useful as a base to build a custom serializer from.
|
|
3468
3468
|
*/
|
|
3469
3469
|
static nodesFromSchema(e) {
|
|
3470
|
-
let t =
|
|
3470
|
+
let t = wi(e.nodes);
|
|
3471
3471
|
return t.text || (t.text = (r) => r.text), t;
|
|
3472
3472
|
}
|
|
3473
3473
|
/**
|
|
3474
3474
|
Gather the serializers in a schema's mark specs into an object.
|
|
3475
3475
|
*/
|
|
3476
3476
|
static marksFromSchema(e) {
|
|
3477
|
-
return
|
|
3477
|
+
return wi(e.marks);
|
|
3478
3478
|
}
|
|
3479
3479
|
}
|
|
3480
|
-
function
|
|
3480
|
+
function wi(n) {
|
|
3481
3481
|
let e = {};
|
|
3482
3482
|
for (let t in n) {
|
|
3483
3483
|
let r = n[t].spec.toDOM;
|
|
@@ -3488,10 +3488,10 @@ function Si(n) {
|
|
|
3488
3488
|
function Xn(n) {
|
|
3489
3489
|
return n.document || window.document;
|
|
3490
3490
|
}
|
|
3491
|
-
const
|
|
3491
|
+
const Mi = /* @__PURE__ */ new WeakMap();
|
|
3492
3492
|
function na(n) {
|
|
3493
|
-
let e =
|
|
3494
|
-
return e === void 0 &&
|
|
3493
|
+
let e = Mi.get(n);
|
|
3494
|
+
return e === void 0 && Mi.set(n, e = ra(n)), e;
|
|
3495
3495
|
}
|
|
3496
3496
|
function ra(n) {
|
|
3497
3497
|
let e = null;
|
|
@@ -3549,17 +3549,17 @@ function hn(n, e, t, r) {
|
|
|
3549
3549
|
}
|
|
3550
3550
|
return { dom: a, contentDOM: l };
|
|
3551
3551
|
}
|
|
3552
|
-
const
|
|
3552
|
+
const _s = 65535, Gs = Math.pow(2, 16);
|
|
3553
3553
|
function ia(n, e) {
|
|
3554
|
-
return n + e *
|
|
3554
|
+
return n + e * Gs;
|
|
3555
3555
|
}
|
|
3556
|
-
function
|
|
3557
|
-
return n &
|
|
3556
|
+
function Ci(n) {
|
|
3557
|
+
return n & _s;
|
|
3558
3558
|
}
|
|
3559
3559
|
function sa(n) {
|
|
3560
|
-
return (n - (n &
|
|
3560
|
+
return (n - (n & _s)) / Gs;
|
|
3561
3561
|
}
|
|
3562
|
-
const
|
|
3562
|
+
const Xs = 1, Ys = 2, pn = 4, Zs = 8;
|
|
3563
3563
|
class wr {
|
|
3564
3564
|
/**
|
|
3565
3565
|
@internal
|
|
@@ -3573,19 +3573,19 @@ class wr {
|
|
|
3573
3573
|
argument from the document.
|
|
3574
3574
|
*/
|
|
3575
3575
|
get deleted() {
|
|
3576
|
-
return (this.delInfo &
|
|
3576
|
+
return (this.delInfo & Zs) > 0;
|
|
3577
3577
|
}
|
|
3578
3578
|
/**
|
|
3579
3579
|
Tells you whether the token before the mapped position was deleted.
|
|
3580
3580
|
*/
|
|
3581
3581
|
get deletedBefore() {
|
|
3582
|
-
return (this.delInfo & (
|
|
3582
|
+
return (this.delInfo & (Xs | pn)) > 0;
|
|
3583
3583
|
}
|
|
3584
3584
|
/**
|
|
3585
3585
|
True when the token after the mapped position was deleted.
|
|
3586
3586
|
*/
|
|
3587
3587
|
get deletedAfter() {
|
|
3588
|
-
return (this.delInfo & (
|
|
3588
|
+
return (this.delInfo & (Ys | pn)) > 0;
|
|
3589
3589
|
}
|
|
3590
3590
|
/**
|
|
3591
3591
|
Tells whether any of the steps mapped through deletes across the
|
|
@@ -3610,7 +3610,7 @@ class le {
|
|
|
3610
3610
|
@internal
|
|
3611
3611
|
*/
|
|
3612
3612
|
recover(e) {
|
|
3613
|
-
let t = 0, r =
|
|
3613
|
+
let t = 0, r = Ci(e);
|
|
3614
3614
|
if (!this.inverted)
|
|
3615
3615
|
for (let i = 0; i < r; i++)
|
|
3616
3616
|
t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
|
|
@@ -3636,8 +3636,8 @@ class le {
|
|
|
3636
3636
|
let f = c ? e == a ? -1 : e == u ? 1 : t : t, h = a + i + (f < 0 ? 0 : d);
|
|
3637
3637
|
if (r)
|
|
3638
3638
|
return h;
|
|
3639
|
-
let p = e == (t < 0 ? a : u) ? null : ia(l / 3, e - a), m = e == a ?
|
|
3640
|
-
return (t < 0 ? e != a : e != u) && (m |=
|
|
3639
|
+
let p = e == (t < 0 ? a : u) ? null : ia(l / 3, e - a), m = e == a ? Ys : e == u ? Xs : pn;
|
|
3640
|
+
return (t < 0 ? e != a : e != u) && (m |= Zs), new wr(h, m, p);
|
|
3641
3641
|
}
|
|
3642
3642
|
i += d - c;
|
|
3643
3643
|
}
|
|
@@ -3647,7 +3647,7 @@ class le {
|
|
|
3647
3647
|
@internal
|
|
3648
3648
|
*/
|
|
3649
3649
|
touches(e, t) {
|
|
3650
|
-
let r = 0, i =
|
|
3650
|
+
let r = 0, i = Ci(t), s = this.inverted ? 2 : 1, o = this.inverted ? 1 : 2;
|
|
3651
3651
|
for (let l = 0; l < this.ranges.length; l += 3) {
|
|
3652
3652
|
let a = this.ranges[l] - (this.inverted ? r : 0);
|
|
3653
3653
|
if (a > e)
|
|
@@ -4256,9 +4256,9 @@ function ca(n, e, t) {
|
|
|
4256
4256
|
}
|
|
4257
4257
|
function qr(n, e, t = null, r = n) {
|
|
4258
4258
|
let i = da(n, e), s = i && ua(r, e);
|
|
4259
|
-
return s ? i.map(
|
|
4259
|
+
return s ? i.map(Ti).concat({ type: e, attrs: t }).concat(s.map(Ti)) : null;
|
|
4260
4260
|
}
|
|
4261
|
-
function
|
|
4261
|
+
function Ti(n) {
|
|
4262
4262
|
return { type: n, attrs: null };
|
|
4263
4263
|
}
|
|
4264
4264
|
function da(n, e) {
|
|
@@ -4302,13 +4302,13 @@ function ha(n, e, t, r, i) {
|
|
|
4302
4302
|
let h = r.whitespace == "pre", p = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
|
|
4303
4303
|
h && !p ? c = !1 : !h && p && (c = !0);
|
|
4304
4304
|
}
|
|
4305
|
-
c === !1 &&
|
|
4305
|
+
c === !1 && eo(n, o, l, s), Wr(n, n.mapping.slice(s).map(l, 1), r, void 0, c === null);
|
|
4306
4306
|
let d = n.mapping.slice(s), u = d.map(l, 1), f = d.map(l + o.nodeSize, 1);
|
|
4307
|
-
return n.step(new V(u, f, u + 1, f - 1, new k(b.from(r.create(a, null, o.marks)), 0, 0), 1, !0)), c === !0 &&
|
|
4307
|
+
return n.step(new V(u, f, u + 1, f - 1, new k(b.from(r.create(a, null, o.marks)), 0, 0), 1, !0)), c === !0 && Qs(n, o, l, s), !1;
|
|
4308
4308
|
}
|
|
4309
4309
|
});
|
|
4310
4310
|
}
|
|
4311
|
-
function
|
|
4311
|
+
function Qs(n, e, t, r) {
|
|
4312
4312
|
e.forEach((i, s) => {
|
|
4313
4313
|
if (i.isText) {
|
|
4314
4314
|
let o, l = /\r?\n|\r/g;
|
|
@@ -4319,7 +4319,7 @@ function Zs(n, e, t, r) {
|
|
|
4319
4319
|
}
|
|
4320
4320
|
});
|
|
4321
4321
|
}
|
|
4322
|
-
function
|
|
4322
|
+
function eo(n, e, t, r) {
|
|
4323
4323
|
e.forEach((i, s) => {
|
|
4324
4324
|
if (i.type == i.type.schema.linebreakReplacement) {
|
|
4325
4325
|
let o = n.mapping.slice(r).map(t + 1 + s);
|
|
@@ -4372,7 +4372,7 @@ function ga(n, e, t = 1, r) {
|
|
|
4372
4372
|
}
|
|
4373
4373
|
function Ke(n, e) {
|
|
4374
4374
|
let t = n.resolve(e), r = t.index();
|
|
4375
|
-
return
|
|
4375
|
+
return to(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(r, r + 1);
|
|
4376
4376
|
}
|
|
4377
4377
|
function ya(n, e) {
|
|
4378
4378
|
e.content.size || n.type.compatibleContent(e.type);
|
|
@@ -4384,14 +4384,14 @@ function ya(n, e) {
|
|
|
4384
4384
|
}
|
|
4385
4385
|
return t.validEnd;
|
|
4386
4386
|
}
|
|
4387
|
-
function
|
|
4387
|
+
function to(n, e) {
|
|
4388
4388
|
return !!(n && e && !n.isLeaf && ya(n, e));
|
|
4389
4389
|
}
|
|
4390
4390
|
function Ln(n, e, t = -1) {
|
|
4391
4391
|
let r = n.resolve(e);
|
|
4392
4392
|
for (let i = r.depth; ; i--) {
|
|
4393
4393
|
let s, o, l = r.index(i);
|
|
4394
|
-
if (i == r.depth ? (s = r.nodeBefore, o = r.nodeAfter) : t > 0 ? (s = r.node(i + 1), l++, o = r.node(i).maybeChild(l)) : (s = r.node(i).maybeChild(l - 1), o = r.node(i + 1)), s && !s.isTextblock &&
|
|
4394
|
+
if (i == r.depth ? (s = r.nodeBefore, o = r.nodeAfter) : t > 0 ? (s = r.node(i + 1), l++, o = r.node(i).maybeChild(l)) : (s = r.node(i).maybeChild(l - 1), o = r.node(i + 1)), s && !s.isTextblock && to(s, o) && r.node(i).canReplace(l, l + 1))
|
|
4395
4395
|
return e;
|
|
4396
4396
|
if (i == 0)
|
|
4397
4397
|
break;
|
|
@@ -4407,13 +4407,13 @@ function ba(n, e, t) {
|
|
|
4407
4407
|
let l = n.steps.length;
|
|
4408
4408
|
if (r === !1) {
|
|
4409
4409
|
let d = n.doc.resolve(e + t);
|
|
4410
|
-
|
|
4410
|
+
eo(n, d.node(), d.before(), l);
|
|
4411
4411
|
}
|
|
4412
4412
|
o.inlineContent && Wr(n, e + t - 1, o, s.node().contentMatchAt(s.index()), r == null);
|
|
4413
4413
|
let a = n.mapping.slice(l), c = a.map(e - t);
|
|
4414
4414
|
if (n.step(new L(c, a.map(e + t, -1), k.empty, !0)), r === !0) {
|
|
4415
4415
|
let d = n.doc.resolve(c);
|
|
4416
|
-
|
|
4416
|
+
Qs(n, d.node(), d.before(), n.steps.length);
|
|
4417
4417
|
}
|
|
4418
4418
|
return n;
|
|
4419
4419
|
}
|
|
@@ -4439,7 +4439,7 @@ function ka(n, e, t) {
|
|
|
4439
4439
|
}
|
|
4440
4440
|
return null;
|
|
4441
4441
|
}
|
|
4442
|
-
function
|
|
4442
|
+
function no(n, e, t) {
|
|
4443
4443
|
let r = n.resolve(e);
|
|
4444
4444
|
if (!t.content.size)
|
|
4445
4445
|
return e;
|
|
@@ -4464,9 +4464,9 @@ function zn(n, e, t = e, r = k.empty) {
|
|
|
4464
4464
|
if (e == t && !r.size)
|
|
4465
4465
|
return null;
|
|
4466
4466
|
let i = n.resolve(e), s = n.resolve(t);
|
|
4467
|
-
return
|
|
4467
|
+
return ro(i, s, r) ? new L(e, t, r) : new xa(i, s, r).fit();
|
|
4468
4468
|
}
|
|
4469
|
-
function
|
|
4469
|
+
function ro(n, e, t) {
|
|
4470
4470
|
return !t.openStart && !t.openEnd && n.start() == e.start() && n.parent.canReplace(n.index(), e.index(), t.content);
|
|
4471
4471
|
}
|
|
4472
4472
|
class xa {
|
|
@@ -4560,7 +4560,7 @@ class xa {
|
|
|
4560
4560
|
let m = l.child(c), g = u.matchType(m.type);
|
|
4561
4561
|
if (!g)
|
|
4562
4562
|
break;
|
|
4563
|
-
c++, (c > 1 || a == 0 || m.content.size) && (u = g, d.push(
|
|
4563
|
+
c++, (c > 1 || a == 0 || m.content.size) && (u = g, d.push(io(m.mark(f.allowedMarks(m.marks)), c == 1 ? a : 0, c == l.childCount ? h : -1)));
|
|
4564
4564
|
}
|
|
4565
4565
|
let p = c == l.childCount;
|
|
4566
4566
|
p || (h = -1), this.placed = Nt(this.placed, t, b.from(d)), this.frontier[t].match = u, p && h < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
|
|
@@ -4627,11 +4627,11 @@ function Zn(n, e) {
|
|
|
4627
4627
|
n = n.firstChild.content;
|
|
4628
4628
|
return n;
|
|
4629
4629
|
}
|
|
4630
|
-
function
|
|
4630
|
+
function io(n, e, t) {
|
|
4631
4631
|
if (e <= 0)
|
|
4632
4632
|
return n;
|
|
4633
4633
|
let r = n.content;
|
|
4634
|
-
return e > 1 && (r = r.replaceChild(0,
|
|
4634
|
+
return e > 1 && (r = r.replaceChild(0, io(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(b.empty, !0)))), n.copy(r);
|
|
4635
4635
|
}
|
|
4636
4636
|
function Qn(n, e, t, r, i) {
|
|
4637
4637
|
let s = n.node(e), o = i ? n.indexAfter(e) : n.index(e);
|
|
@@ -4653,9 +4653,9 @@ function Ma(n, e, t, r) {
|
|
|
4653
4653
|
if (!r.size)
|
|
4654
4654
|
return n.deleteRange(e, t);
|
|
4655
4655
|
let i = n.doc.resolve(e), s = n.doc.resolve(t);
|
|
4656
|
-
if (
|
|
4656
|
+
if (ro(i, s, r))
|
|
4657
4657
|
return n.step(new L(e, t, r));
|
|
4658
|
-
let o =
|
|
4658
|
+
let o = oo(i, s);
|
|
4659
4659
|
o[o.length - 1] == 0 && o.pop();
|
|
4660
4660
|
let l = -(i.depth + 1);
|
|
4661
4661
|
o.unshift(l);
|
|
@@ -4687,7 +4687,7 @@ function Ma(n, e, t, r) {
|
|
|
4687
4687
|
g < 0 && (y = !1, g = -g);
|
|
4688
4688
|
let T = i.node(g - 1), M = i.index(g - 1);
|
|
4689
4689
|
if (T.canReplaceWith(M, M, p.type, p.marks))
|
|
4690
|
-
return n.replace(i.before(g), y ? s.after(g) : t, new k(
|
|
4690
|
+
return n.replace(i.before(g), y ? s.after(g) : t, new k(so(r.content, 0, r.openStart, h), h, r.openEnd));
|
|
4691
4691
|
}
|
|
4692
4692
|
}
|
|
4693
4693
|
let u = n.steps.length;
|
|
@@ -4696,10 +4696,10 @@ function Ma(n, e, t, r) {
|
|
|
4696
4696
|
h < 0 || (e = i.before(h), t = s.after(h));
|
|
4697
4697
|
}
|
|
4698
4698
|
}
|
|
4699
|
-
function
|
|
4699
|
+
function so(n, e, t, r, i) {
|
|
4700
4700
|
if (e < t) {
|
|
4701
4701
|
let s = n.firstChild;
|
|
4702
|
-
n = n.replaceChild(0, s.copy(
|
|
4702
|
+
n = n.replaceChild(0, s.copy(so(s.content, e + 1, t, r, s)));
|
|
4703
4703
|
}
|
|
4704
4704
|
if (e > r) {
|
|
4705
4705
|
let s = i.contentMatchAt(0), o = s.fillBefore(n).append(n);
|
|
@@ -4730,7 +4730,7 @@ function Ta(n, e, t) {
|
|
|
4730
4730
|
r = n.doc.resolve(e), i = n.doc.resolve(t);
|
|
4731
4731
|
}
|
|
4732
4732
|
}
|
|
4733
|
-
let s =
|
|
4733
|
+
let s = oo(r, i);
|
|
4734
4734
|
for (let o = 0; o < s.length; o++) {
|
|
4735
4735
|
let l = s[o], a = o == s.length - 1;
|
|
4736
4736
|
if (a && l == 0 || r.node(l).type.contentMatch.validEnd)
|
|
@@ -4743,7 +4743,7 @@ function Ta(n, e, t) {
|
|
|
4743
4743
|
return n.delete(r.before(o), t);
|
|
4744
4744
|
n.delete(e, t);
|
|
4745
4745
|
}
|
|
4746
|
-
function
|
|
4746
|
+
function oo(n, e) {
|
|
4747
4747
|
let t = [], r = Math.min(n.depth, e.depth);
|
|
4748
4748
|
for (let i = r; i >= 0; i--) {
|
|
4749
4749
|
let s = n.start(i);
|
|
@@ -5148,7 +5148,7 @@ class v {
|
|
|
5148
5148
|
let s = e.steps.length, o = this.ranges;
|
|
5149
5149
|
for (let l = 0; l < o.length; l++) {
|
|
5150
5150
|
let { $from: a, $to: c } = o[l], d = e.mapping.slice(s);
|
|
5151
|
-
e.replaceRange(d.map(a.pos), d.map(c.pos), l ? k.empty : t), l == 0 &&
|
|
5151
|
+
e.replaceRange(d.map(a.pos), d.map(c.pos), l ? k.empty : t), l == 0 && Ei(e, s, (r ? r.isInline : i && i.isTextblock) ? -1 : 1);
|
|
5152
5152
|
}
|
|
5153
5153
|
}
|
|
5154
5154
|
/**
|
|
@@ -5159,7 +5159,7 @@ class v {
|
|
|
5159
5159
|
let r = e.steps.length, i = this.ranges;
|
|
5160
5160
|
for (let s = 0; s < i.length; s++) {
|
|
5161
5161
|
let { $from: o, $to: l } = i[s], a = e.mapping.slice(r), c = a.map(o.pos), d = a.map(l.pos);
|
|
5162
|
-
s ? e.deleteRange(c, d) : (e.replaceRangeWith(c, d, t),
|
|
5162
|
+
s ? e.deleteRange(c, d) : (e.replaceRangeWith(c, d, t), Ei(e, r, t.isInline ? -1 : 1));
|
|
5163
5163
|
}
|
|
5164
5164
|
}
|
|
5165
5165
|
/**
|
|
@@ -5249,16 +5249,16 @@ class va {
|
|
|
5249
5249
|
this.$from = e, this.$to = t;
|
|
5250
5250
|
}
|
|
5251
5251
|
}
|
|
5252
|
-
let
|
|
5253
|
-
function
|
|
5254
|
-
!
|
|
5252
|
+
let Oi = !1;
|
|
5253
|
+
function vi(n) {
|
|
5254
|
+
!Oi && !n.parent.inlineContent && (Oi = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
|
|
5255
5255
|
}
|
|
5256
5256
|
class w extends v {
|
|
5257
5257
|
/**
|
|
5258
5258
|
Construct a text selection between the given points.
|
|
5259
5259
|
*/
|
|
5260
5260
|
constructor(e, t = e) {
|
|
5261
|
-
|
|
5261
|
+
vi(e), vi(t), super(e, t);
|
|
5262
5262
|
}
|
|
5263
5263
|
/**
|
|
5264
5264
|
Returns a resolved position if this is a cursor selection (an
|
|
@@ -5458,7 +5458,7 @@ function pt(n, e, t, r, i, s = !1) {
|
|
|
5458
5458
|
}
|
|
5459
5459
|
return null;
|
|
5460
5460
|
}
|
|
5461
|
-
function
|
|
5461
|
+
function Ei(n, e, t) {
|
|
5462
5462
|
let r = n.steps.length - 1;
|
|
5463
5463
|
if (r < e)
|
|
5464
5464
|
return;
|
|
@@ -5470,7 +5470,7 @@ function vi(n, e, t) {
|
|
|
5470
5470
|
o == null && (o = d);
|
|
5471
5471
|
}), n.setSelection(v.near(n.doc.resolve(o), t));
|
|
5472
5472
|
}
|
|
5473
|
-
const
|
|
5473
|
+
const Ai = 1, ln = 2, Ni = 4;
|
|
5474
5474
|
class Aa extends Oa {
|
|
5475
5475
|
/**
|
|
5476
5476
|
@internal
|
|
@@ -5494,13 +5494,13 @@ class Aa extends Oa {
|
|
|
5494
5494
|
setSelection(e) {
|
|
5495
5495
|
if (e.$from.doc != this.doc)
|
|
5496
5496
|
throw new RangeError("Selection passed to setSelection must point at the current document");
|
|
5497
|
-
return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated |
|
|
5497
|
+
return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | Ai) & ~ln, this.storedMarks = null, this;
|
|
5498
5498
|
}
|
|
5499
5499
|
/**
|
|
5500
5500
|
Whether the selection was explicitly updated by this transaction.
|
|
5501
5501
|
*/
|
|
5502
5502
|
get selectionSet() {
|
|
5503
|
-
return (this.updated &
|
|
5503
|
+
return (this.updated & Ai) > 0;
|
|
5504
5504
|
}
|
|
5505
5505
|
/**
|
|
5506
5506
|
Set the current stored marks.
|
|
@@ -5613,21 +5613,21 @@ class Aa extends Oa {
|
|
|
5613
5613
|
when updated to the state produced by this transaction.
|
|
5614
5614
|
*/
|
|
5615
5615
|
scrollIntoView() {
|
|
5616
|
-
return this.updated |=
|
|
5616
|
+
return this.updated |= Ni, this;
|
|
5617
5617
|
}
|
|
5618
5618
|
/**
|
|
5619
5619
|
True when this transaction has had `scrollIntoView` called on it.
|
|
5620
5620
|
*/
|
|
5621
5621
|
get scrolledIntoView() {
|
|
5622
|
-
return (this.updated &
|
|
5622
|
+
return (this.updated & Ni) > 0;
|
|
5623
5623
|
}
|
|
5624
5624
|
}
|
|
5625
|
-
function
|
|
5625
|
+
function Di(n, e) {
|
|
5626
5626
|
return !e || !n ? n : n.bind(e);
|
|
5627
5627
|
}
|
|
5628
5628
|
class Dt {
|
|
5629
5629
|
constructor(e, t, r) {
|
|
5630
|
-
this.name = e, this.init =
|
|
5630
|
+
this.name = e, this.init = Di(t.init, r), this.apply = Di(t.apply, r);
|
|
5631
5631
|
}
|
|
5632
5632
|
}
|
|
5633
5633
|
const Na = [
|
|
@@ -5838,10 +5838,10 @@ class gt {
|
|
|
5838
5838
|
}), s;
|
|
5839
5839
|
}
|
|
5840
5840
|
}
|
|
5841
|
-
function
|
|
5841
|
+
function lo(n, e, t) {
|
|
5842
5842
|
for (let r in n) {
|
|
5843
5843
|
let i = n[r];
|
|
5844
|
-
i instanceof Function ? i = i.bind(e) : r == "handleDOMEvents" && (i =
|
|
5844
|
+
i instanceof Function ? i = i.bind(e) : r == "handleDOMEvents" && (i = lo(i, e, {})), t[r] = i;
|
|
5845
5845
|
}
|
|
5846
5846
|
return t;
|
|
5847
5847
|
}
|
|
@@ -5850,7 +5850,7 @@ class oe {
|
|
|
5850
5850
|
Create a plugin.
|
|
5851
5851
|
*/
|
|
5852
5852
|
constructor(e) {
|
|
5853
|
-
this.spec = e, this.props = {}, e.props &&
|
|
5853
|
+
this.spec = e, this.props = {}, e.props && lo(e.props, this, this.props), this.key = e.key ? e.key.key : ao("plugin");
|
|
5854
5854
|
}
|
|
5855
5855
|
/**
|
|
5856
5856
|
Extract the plugin's state field from an editor state.
|
|
@@ -5860,7 +5860,7 @@ class oe {
|
|
|
5860
5860
|
}
|
|
5861
5861
|
}
|
|
5862
5862
|
const nr = /* @__PURE__ */ Object.create(null);
|
|
5863
|
-
function
|
|
5863
|
+
function ao(n) {
|
|
5864
5864
|
return n in nr ? n + "$" + ++nr[n] : (nr[n] = 0, n + "$");
|
|
5865
5865
|
}
|
|
5866
5866
|
class Ce {
|
|
@@ -5868,7 +5868,7 @@ class Ce {
|
|
|
5868
5868
|
Create a plugin key.
|
|
5869
5869
|
*/
|
|
5870
5870
|
constructor(e = "key") {
|
|
5871
|
-
this.key =
|
|
5871
|
+
this.key = ao(e);
|
|
5872
5872
|
}
|
|
5873
5873
|
/**
|
|
5874
5874
|
Get the active plugin with this key, if any, from an editor
|
|
@@ -5899,9 +5899,9 @@ const Oe = function(n, e, t) {
|
|
|
5899
5899
|
}, Da = function() {
|
|
5900
5900
|
Cr = null;
|
|
5901
5901
|
}, lt = function(n, e, t, r) {
|
|
5902
|
-
return t && (
|
|
5902
|
+
return t && (Ii(n, e, t, r, -1) || Ii(n, e, t, r, 1));
|
|
5903
5903
|
}, Ia = /^(img|br|input|textarea|hr)$/i;
|
|
5904
|
-
function
|
|
5904
|
+
function Ii(n, e, t, r, i) {
|
|
5905
5905
|
for (var s; ; ) {
|
|
5906
5906
|
if (n == t && e == r)
|
|
5907
5907
|
return !0;
|
|
@@ -5997,9 +5997,9 @@ function za(n, e, t) {
|
|
|
5997
5997
|
return { node: r.startContainer, offset: Math.min(fe(r.startContainer), r.startOffset) };
|
|
5998
5998
|
}
|
|
5999
5999
|
}
|
|
6000
|
-
const Se = typeof navigator < "u" ? navigator : null,
|
|
6000
|
+
const Se = typeof navigator < "u" ? navigator : null, Ri = typeof document < "u" ? document : null, Je = Se && Se.userAgent || "", Tr = /Edge\/(\d+)/.exec(Je), co = /MSIE \d/.exec(Je), Or = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Je), se = !!(co || Or || Tr), He = co ? document.documentMode : Or ? +Or[1] : Tr ? +Tr[1] : 0, pe = !se && /gecko\/(\d+)/i.test(Je);
|
|
6001
6001
|
pe && +(/Firefox\/(\d+)/.exec(Je) || [0, 0])[1];
|
|
6002
|
-
const vr = !se && /Chrome\/(\d+)/.exec(Je), _ = !!vr,
|
|
6002
|
+
const vr = !se && /Chrome\/(\d+)/.exec(Je), _ = !!vr, uo = vr ? +vr[1] : 0, Q = !se && !!Se && /Apple Computer/.test(Se.vendor), Ct = Q && (/Mobile\/\w+/.test(Je) || !!Se && Se.maxTouchPoints > 2), ue = Ct || (Se ? /Mac/.test(Se.platform) : !1), fo = Se ? /Win/.test(Se.platform) : !1, Ae = /Android \d/.test(Je), nn = !!Ri && "webkitFontSmoothing" in Ri.documentElement.style, Fa = nn ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
6003
6003
|
function $a(n) {
|
|
6004
6004
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
6005
6005
|
return e ? {
|
|
@@ -6026,7 +6026,7 @@ function Va(n) {
|
|
|
6026
6026
|
bottom: e.top + n.clientHeight * r
|
|
6027
6027
|
};
|
|
6028
6028
|
}
|
|
6029
|
-
function
|
|
6029
|
+
function Pi(n, e, t) {
|
|
6030
6030
|
let r = n.someProp("scrollThreshold") || 0, i = n.someProp("scrollMargin") || 5, s = n.dom.ownerDocument;
|
|
6031
6031
|
for (let o = t || n.dom; o; ) {
|
|
6032
6032
|
if (o.nodeType != 1) {
|
|
@@ -6061,9 +6061,9 @@ function Ha(n) {
|
|
|
6061
6061
|
break;
|
|
6062
6062
|
}
|
|
6063
6063
|
}
|
|
6064
|
-
return { refDOM: r, refTop: i, stack:
|
|
6064
|
+
return { refDOM: r, refTop: i, stack: ho(n.dom) };
|
|
6065
6065
|
}
|
|
6066
|
-
function
|
|
6066
|
+
function ho(n) {
|
|
6067
6067
|
let e = [], t = n.ownerDocument;
|
|
6068
6068
|
for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r = Mt(r))
|
|
6069
6069
|
;
|
|
@@ -6071,9 +6071,9 @@ function fo(n) {
|
|
|
6071
6071
|
}
|
|
6072
6072
|
function Wa({ refDOM: n, refTop: e, stack: t }) {
|
|
6073
6073
|
let r = n ? n.getBoundingClientRect().top : 0;
|
|
6074
|
-
|
|
6074
|
+
po(t, r == 0 ? 0 : r - e);
|
|
6075
6075
|
}
|
|
6076
|
-
function
|
|
6076
|
+
function po(n, e) {
|
|
6077
6077
|
for (let t = 0; t < n.length; t++) {
|
|
6078
6078
|
let { dom: r, top: i, left: s } = n[t];
|
|
6079
6079
|
r.scrollTop != i + e && (r.scrollTop = i + e), r.scrollLeft != s && (r.scrollLeft = s);
|
|
@@ -6085,14 +6085,14 @@ function qa(n) {
|
|
|
6085
6085
|
return n.setActive();
|
|
6086
6086
|
if (ft)
|
|
6087
6087
|
return n.focus(ft);
|
|
6088
|
-
let e =
|
|
6088
|
+
let e = ho(n);
|
|
6089
6089
|
n.focus(ft == null ? {
|
|
6090
6090
|
get preventScroll() {
|
|
6091
6091
|
return ft = { preventScroll: !0 }, !0;
|
|
6092
6092
|
}
|
|
6093
|
-
} : void 0), ft || (ft = !1,
|
|
6093
|
+
} : void 0), ft || (ft = !1, po(e, 0));
|
|
6094
6094
|
}
|
|
6095
|
-
function
|
|
6095
|
+
function mo(n, e) {
|
|
6096
6096
|
let t, r = 2e8, i, s = 0, o = e.top, l = e.top, a, c;
|
|
6097
6097
|
for (let d = n.firstChild, u = 0; d; d = d.nextSibling, u++) {
|
|
6098
6098
|
let f;
|
|
@@ -6118,7 +6118,7 @@ function po(n, e) {
|
|
|
6118
6118
|
!t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (s = u + 1);
|
|
6119
6119
|
}
|
|
6120
6120
|
}
|
|
6121
|
-
return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ? ja(t, i) : !t || r && t.nodeType == 1 ? { node: n, offset: s } :
|
|
6121
|
+
return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ? ja(t, i) : !t || r && t.nodeType == 1 ? { node: n, offset: s } : mo(t, i);
|
|
6122
6122
|
}
|
|
6123
6123
|
function ja(n, e) {
|
|
6124
6124
|
let t = n.nodeValue.length, r = document.createRange(), i;
|
|
@@ -6140,7 +6140,7 @@ function Ka(n, e) {
|
|
|
6140
6140
|
return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
|
|
6141
6141
|
}
|
|
6142
6142
|
function Ja(n, e, t) {
|
|
6143
|
-
let { node: r, offset: i } =
|
|
6143
|
+
let { node: r, offset: i } = mo(e, t), s = -1;
|
|
6144
6144
|
if (r.nodeType == 1 && !r.firstChild) {
|
|
6145
6145
|
let o = r.getBoundingClientRect();
|
|
6146
6146
|
s = o.left != o.right && t.left > (o.left + o.right) / 2 ? 1 : -1;
|
|
@@ -6160,7 +6160,7 @@ function Ua(n, e, t, r) {
|
|
|
6160
6160
|
}
|
|
6161
6161
|
return i > -1 ? i : n.docView.posFromDOM(e, t, -1);
|
|
6162
6162
|
}
|
|
6163
|
-
function
|
|
6163
|
+
function go(n, e, t) {
|
|
6164
6164
|
let r = n.childNodes.length;
|
|
6165
6165
|
if (r && t.top < t.bottom)
|
|
6166
6166
|
for (let i = Math.max(0, Math.min(r - 1, Math.floor(r * (e.top - t.top) / (t.bottom - t.top)) - 2)), s = i; ; ) {
|
|
@@ -6170,7 +6170,7 @@ function mo(n, e, t) {
|
|
|
6170
6170
|
for (let a = 0; a < l.length; a++) {
|
|
6171
6171
|
let c = l[a];
|
|
6172
6172
|
if (Kr(e, c))
|
|
6173
|
-
return
|
|
6173
|
+
return go(o, e, c);
|
|
6174
6174
|
}
|
|
6175
6175
|
}
|
|
6176
6176
|
if ((s = (s + 1) % r) == i)
|
|
@@ -6184,7 +6184,7 @@ function _a(n, e) {
|
|
|
6184
6184
|
let o = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
|
|
6185
6185
|
if (!o || !n.dom.contains(o.nodeType != 1 ? o.parentNode : o)) {
|
|
6186
6186
|
let c = n.dom.getBoundingClientRect();
|
|
6187
|
-
if (!Kr(e, c) || (o =
|
|
6187
|
+
if (!Kr(e, c) || (o = go(n.dom, e, c), !o))
|
|
6188
6188
|
return null;
|
|
6189
6189
|
}
|
|
6190
6190
|
if (Q)
|
|
@@ -6202,20 +6202,20 @@ function _a(n, e) {
|
|
|
6202
6202
|
let a = n.docView.nearestDesc(o, !0);
|
|
6203
6203
|
return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
|
|
6204
6204
|
}
|
|
6205
|
-
function
|
|
6205
|
+
function Bi(n) {
|
|
6206
6206
|
return n.top < n.bottom || n.left < n.right;
|
|
6207
6207
|
}
|
|
6208
6208
|
function Ie(n, e) {
|
|
6209
6209
|
let t = n.getClientRects();
|
|
6210
6210
|
if (t.length) {
|
|
6211
6211
|
let r = t[e < 0 ? 0 : t.length - 1];
|
|
6212
|
-
if (
|
|
6212
|
+
if (Bi(r))
|
|
6213
6213
|
return r;
|
|
6214
6214
|
}
|
|
6215
|
-
return Array.prototype.find.call(t,
|
|
6215
|
+
return Array.prototype.find.call(t, Bi) || n.getBoundingClientRect();
|
|
6216
6216
|
}
|
|
6217
6217
|
const Ga = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
|
|
6218
|
-
function
|
|
6218
|
+
function yo(n, e, t) {
|
|
6219
6219
|
let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = nn || pe;
|
|
6220
6220
|
if (r.nodeType == 3)
|
|
6221
6221
|
if (o && (Ga.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
|
|
@@ -6273,7 +6273,7 @@ function rr(n, e) {
|
|
|
6273
6273
|
let t = e ? n.top : n.bottom;
|
|
6274
6274
|
return { top: t, bottom: t, left: n.left, right: n.right };
|
|
6275
6275
|
}
|
|
6276
|
-
function
|
|
6276
|
+
function bo(n, e, t) {
|
|
6277
6277
|
let r = n.state, i = n.root.activeElement;
|
|
6278
6278
|
r != e && n.updateState(e), i != n.dom && n.focus();
|
|
6279
6279
|
try {
|
|
@@ -6284,7 +6284,7 @@ function yo(n, e, t) {
|
|
|
6284
6284
|
}
|
|
6285
6285
|
function Xa(n, e, t) {
|
|
6286
6286
|
let r = e.selection, i = t == "up" ? r.$from : r.$to;
|
|
6287
|
-
return
|
|
6287
|
+
return bo(n, e, () => {
|
|
6288
6288
|
let { node: s } = n.docView.domFromPos(i.pos, t == "up" ? -1 : 1);
|
|
6289
6289
|
for (; ; ) {
|
|
6290
6290
|
let l = n.docView.nearestDesc(s, !0);
|
|
@@ -6296,7 +6296,7 @@ function Xa(n, e, t) {
|
|
|
6296
6296
|
}
|
|
6297
6297
|
s = l.dom.parentNode;
|
|
6298
6298
|
}
|
|
6299
|
-
let o =
|
|
6299
|
+
let o = yo(n, i.pos, 1);
|
|
6300
6300
|
for (let l = s.firstChild; l; l = l.nextSibling) {
|
|
6301
6301
|
let a;
|
|
6302
6302
|
if (l.nodeType == 1)
|
|
@@ -6320,7 +6320,7 @@ function Za(n, e, t) {
|
|
|
6320
6320
|
if (!r.parent.isTextblock)
|
|
6321
6321
|
return !1;
|
|
6322
6322
|
let i = r.parentOffset, s = !i, o = i == r.parent.content.size, l = n.domSelection();
|
|
6323
|
-
return l ? !Ya.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o :
|
|
6323
|
+
return l ? !Ya.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : bo(n, e, () => {
|
|
6324
6324
|
let { focusNode: a, focusOffset: c, anchorNode: d, anchorOffset: u } = n.domSelectionRange(), f = l.caretBidiLevel;
|
|
6325
6325
|
l.modify("move", t, "character");
|
|
6326
6326
|
let h = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: p, focusOffset: m } = n.domSelectionRange(), g = p && !h.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == m;
|
|
@@ -6331,11 +6331,11 @@ function Za(n, e, t) {
|
|
|
6331
6331
|
return f != null && (l.caretBidiLevel = f), g;
|
|
6332
6332
|
}) : r.pos == r.start() || r.pos == r.end();
|
|
6333
6333
|
}
|
|
6334
|
-
let
|
|
6334
|
+
let Li = null, zi = null, Fi = !1;
|
|
6335
6335
|
function Qa(n, e, t) {
|
|
6336
|
-
return
|
|
6336
|
+
return Li == e && zi == t ? Fi : (Li = e, zi = t, Fi = t == "up" || t == "down" ? Xa(n, e, t) : Za(n, e, t));
|
|
6337
6337
|
}
|
|
6338
|
-
const me = 0,
|
|
6338
|
+
const me = 0, $i = 1, Xe = 2, we = 3;
|
|
6339
6339
|
class rn {
|
|
6340
6340
|
constructor(e, t, r, i) {
|
|
6341
6341
|
this.parent = e, this.children = t, this.dom = r, this.contentDOM = i, this.dirty = me, r.pmViewDesc = this;
|
|
@@ -6507,7 +6507,7 @@ class rn {
|
|
|
6507
6507
|
let r = 0, i = 0;
|
|
6508
6508
|
for (let s = 0; r < this.children.length; r++) {
|
|
6509
6509
|
let o = this.children[r], l = s + o.size;
|
|
6510
|
-
if (l > e || o instanceof
|
|
6510
|
+
if (l > e || o instanceof xo) {
|
|
6511
6511
|
i = e - s;
|
|
6512
6512
|
break;
|
|
6513
6513
|
}
|
|
@@ -6515,7 +6515,7 @@ class rn {
|
|
|
6515
6515
|
}
|
|
6516
6516
|
if (i)
|
|
6517
6517
|
return this.children[r].domFromPos(i - this.children[r].border, t);
|
|
6518
|
-
for (let s; r && !(s = this.children[r - 1]).size && s instanceof
|
|
6518
|
+
for (let s; r && !(s = this.children[r - 1]).size && s instanceof ko && s.side >= 0; r--)
|
|
6519
6519
|
;
|
|
6520
6520
|
if (t <= 0) {
|
|
6521
6521
|
let s, o = !0;
|
|
@@ -6651,7 +6651,7 @@ class rn {
|
|
|
6651
6651
|
if (r == o ? e <= o && t >= r : e < o && t > r) {
|
|
6652
6652
|
let l = r + s.border, a = o - s.border;
|
|
6653
6653
|
if (e >= l && t <= a) {
|
|
6654
|
-
this.dirty = e == r || t == o ? Xe :
|
|
6654
|
+
this.dirty = e == r || t == o ? Xe : $i, e == l && t == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = we : s.markDirty(e - l, t - l);
|
|
6655
6655
|
return;
|
|
6656
6656
|
} else
|
|
6657
6657
|
s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? Xe : we;
|
|
@@ -6663,7 +6663,7 @@ class rn {
|
|
|
6663
6663
|
markParentsDirty() {
|
|
6664
6664
|
let e = 1;
|
|
6665
6665
|
for (let t = this.parent; t; t = t.parent, e++) {
|
|
6666
|
-
let r = e == 1 ? Xe :
|
|
6666
|
+
let r = e == 1 ? Xe : $i;
|
|
6667
6667
|
t.dirty < r && (t.dirty = r);
|
|
6668
6668
|
}
|
|
6669
6669
|
}
|
|
@@ -6680,7 +6680,7 @@ class rn {
|
|
|
6680
6680
|
return !1;
|
|
6681
6681
|
}
|
|
6682
6682
|
}
|
|
6683
|
-
class
|
|
6683
|
+
class ko extends rn {
|
|
6684
6684
|
constructor(e, t, r, i) {
|
|
6685
6685
|
let s, o = t.type.toDOM;
|
|
6686
6686
|
if (typeof o == "function" && (o = o(r, () => {
|
|
@@ -6804,7 +6804,7 @@ class We extends rn {
|
|
|
6804
6804
|
} else d || ({ dom: d, contentDOM: u } = ut.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
|
|
6805
6805
|
!u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
|
|
6806
6806
|
let f = d;
|
|
6807
|
-
return d =
|
|
6807
|
+
return d = Mo(d, r, t), c ? a = new tc(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Vn(e, t, r, i, d, f, s) : new We(e, t, r, i, d, u || null, f, s, o + 1);
|
|
6808
6808
|
}
|
|
6809
6809
|
parseRule() {
|
|
6810
6810
|
if (this.node.type.spec.reparseInView)
|
|
@@ -6847,7 +6847,7 @@ class We extends rn {
|
|
|
6847
6847
|
a.syncToMarks(c.marks, r, e, f);
|
|
6848
6848
|
let h;
|
|
6849
6849
|
a.findNodeMatch(c, d, u, f) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (h = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, d, u, h, e) || a.updateNextNode(c, d, u, e, f, i) || a.addNode(c, d, u, e, i), i += c.nodeSize;
|
|
6850
|
-
}), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Xe) && (o && this.protectLocalComposition(e, o),
|
|
6850
|
+
}), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Xe) && (o && this.protectLocalComposition(e, o), So(this.contentDOM, this.children, e), Ct && lc(this.dom));
|
|
6851
6851
|
}
|
|
6852
6852
|
localCompositionInfo(e, t) {
|
|
6853
6853
|
let { from: r, to: i } = e.state.selection;
|
|
@@ -6888,7 +6888,7 @@ class We extends rn {
|
|
|
6888
6888
|
if (wn(e, this.outerDeco))
|
|
6889
6889
|
return;
|
|
6890
6890
|
let t = this.nodeDOM.nodeType != 1, r = this.dom;
|
|
6891
|
-
this.dom =
|
|
6891
|
+
this.dom = wo(this.dom, this.nodeDOM, Er(this.outerDeco, this.node, t), Er(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
|
|
6892
6892
|
}
|
|
6893
6893
|
// Mark this node as being the selected node.
|
|
6894
6894
|
selectNode() {
|
|
@@ -6902,8 +6902,8 @@ class We extends rn {
|
|
|
6902
6902
|
return this.node.isAtom;
|
|
6903
6903
|
}
|
|
6904
6904
|
}
|
|
6905
|
-
function
|
|
6906
|
-
|
|
6905
|
+
function Vi(n, e, t, r, i) {
|
|
6906
|
+
Mo(r, e, n);
|
|
6907
6907
|
let s = new We(void 0, n, e, t, r, r, r, i, 0);
|
|
6908
6908
|
return s.contentDOM && s.updateChildren(i, 0), s;
|
|
6909
6909
|
}
|
|
@@ -6950,7 +6950,7 @@ class Vn extends We {
|
|
|
6950
6950
|
return this.node.text == e;
|
|
6951
6951
|
}
|
|
6952
6952
|
}
|
|
6953
|
-
class
|
|
6953
|
+
class xo extends rn {
|
|
6954
6954
|
parseRule() {
|
|
6955
6955
|
return { ignore: !0 };
|
|
6956
6956
|
}
|
|
@@ -6998,23 +6998,23 @@ class tc extends We {
|
|
|
6998
6998
|
return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
|
|
6999
6999
|
}
|
|
7000
7000
|
}
|
|
7001
|
-
function
|
|
7001
|
+
function So(n, e, t) {
|
|
7002
7002
|
let r = n.firstChild, i = !1;
|
|
7003
7003
|
for (let s = 0; s < e.length; s++) {
|
|
7004
7004
|
let o = e[s], l = o.dom;
|
|
7005
7005
|
if (l.parentNode == n) {
|
|
7006
7006
|
for (; l != r; )
|
|
7007
|
-
r =
|
|
7007
|
+
r = Hi(r), i = !0;
|
|
7008
7008
|
r = r.nextSibling;
|
|
7009
7009
|
} else
|
|
7010
7010
|
i = !0, n.insertBefore(l, r);
|
|
7011
7011
|
if (o instanceof at) {
|
|
7012
7012
|
let a = r ? r.previousSibling : n.lastChild;
|
|
7013
|
-
|
|
7013
|
+
So(o.contentDOM, o.children, t), r = a ? a.nextSibling : n.firstChild;
|
|
7014
7014
|
}
|
|
7015
7015
|
}
|
|
7016
7016
|
for (; r; )
|
|
7017
|
-
r =
|
|
7017
|
+
r = Hi(r), i = !0;
|
|
7018
7018
|
i && t.trackWrites == n && (t.trackWrites = null);
|
|
7019
7019
|
}
|
|
7020
7020
|
const Bt = function(n) {
|
|
@@ -7038,7 +7038,7 @@ function Er(n, e, t) {
|
|
|
7038
7038
|
}
|
|
7039
7039
|
return i;
|
|
7040
7040
|
}
|
|
7041
|
-
function
|
|
7041
|
+
function wo(n, e, t, r) {
|
|
7042
7042
|
if (t == Ye && r == Ye)
|
|
7043
7043
|
return e;
|
|
7044
7044
|
let i = e;
|
|
@@ -7074,8 +7074,8 @@ function nc(n, e, t) {
|
|
|
7074
7074
|
t.style && (n.style.cssText += t.style);
|
|
7075
7075
|
}
|
|
7076
7076
|
}
|
|
7077
|
-
function
|
|
7078
|
-
return
|
|
7077
|
+
function Mo(n, e, t) {
|
|
7078
|
+
return wo(n, n, Ye, Er(e, t, n.nodeType != 1));
|
|
7079
7079
|
}
|
|
7080
7080
|
function wn(n, e) {
|
|
7081
7081
|
if (n.length != e.length)
|
|
@@ -7085,7 +7085,7 @@ function wn(n, e) {
|
|
|
7085
7085
|
return !1;
|
|
7086
7086
|
return !0;
|
|
7087
7087
|
}
|
|
7088
|
-
function
|
|
7088
|
+
function Hi(n) {
|
|
7089
7089
|
let e = n.nextSibling;
|
|
7090
7090
|
return n.parentNode.removeChild(n), e;
|
|
7091
7091
|
}
|
|
@@ -7213,7 +7213,7 @@ class rc {
|
|
|
7213
7213
|
if (i && i.matchesWidget(e) && (e == i.widget || !i.widget.type.toDOM.parentNode))
|
|
7214
7214
|
this.index++;
|
|
7215
7215
|
else {
|
|
7216
|
-
let s = new
|
|
7216
|
+
let s = new ko(this.top, e, t, r);
|
|
7217
7217
|
this.top.children.splice(this.index++, 0, s), this.changed = !0;
|
|
7218
7218
|
}
|
|
7219
7219
|
}
|
|
@@ -7232,7 +7232,7 @@ class rc {
|
|
|
7232
7232
|
else {
|
|
7233
7233
|
let r = document.createElement(e);
|
|
7234
7234
|
e == "IMG" && (r.className = "ProseMirror-separator", r.alt = ""), e == "BR" && (r.className = "ProseMirror-trailingBreak");
|
|
7235
|
-
let i = new
|
|
7235
|
+
let i = new xo(this.top, [], r, null);
|
|
7236
7236
|
t != this.top ? t.children.push(i) : t.children.splice(this.index++, 0, i), this.changed = !0;
|
|
7237
7237
|
}
|
|
7238
7238
|
}
|
|
@@ -7394,12 +7394,12 @@ function Jr(n, e = null) {
|
|
|
7394
7394
|
}
|
|
7395
7395
|
return c;
|
|
7396
7396
|
}
|
|
7397
|
-
function
|
|
7398
|
-
return n.editable ? n.hasFocus() :
|
|
7397
|
+
function Co(n) {
|
|
7398
|
+
return n.editable ? n.hasFocus() : Oo(n) && document.activeElement && document.activeElement.contains(n.dom);
|
|
7399
7399
|
}
|
|
7400
7400
|
function De(n, e = !1) {
|
|
7401
7401
|
let t = n.state.selection;
|
|
7402
|
-
if (
|
|
7402
|
+
if (To(n, t), !!Co(n)) {
|
|
7403
7403
|
if (!e && n.input.mouseDown && n.input.mouseDown.allowDefault && _) {
|
|
7404
7404
|
let r = n.domSelectionRange(), i = n.domObserver.currentSelection;
|
|
7405
7405
|
if (r.anchorNode && i.anchorNode && lt(r.anchorNode, r.anchorOffset, i.anchorNode, i.anchorOffset)) {
|
|
@@ -7411,13 +7411,13 @@ function De(n, e = !1) {
|
|
|
7411
7411
|
dc(n);
|
|
7412
7412
|
else {
|
|
7413
7413
|
let { anchor: r, head: i } = t, s, o;
|
|
7414
|
-
|
|
7414
|
+
Wi && !(t instanceof w) && (t.$from.parent.inlineContent || (s = qi(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = qi(n, t.to))), n.docView.setSelection(r, i, n, e), Wi && (s && ji(s), o && ji(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && cc(n));
|
|
7415
7415
|
}
|
|
7416
7416
|
n.domObserver.setCurSelection(), n.domObserver.connectSelection();
|
|
7417
7417
|
}
|
|
7418
7418
|
}
|
|
7419
|
-
const
|
|
7420
|
-
function
|
|
7419
|
+
const Wi = Q || _ && uo < 63;
|
|
7420
|
+
function qi(n, e) {
|
|
7421
7421
|
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;
|
|
7422
7422
|
if (Q && i && i.contentEditable == "false")
|
|
7423
7423
|
return ir(i);
|
|
@@ -7431,7 +7431,7 @@ function Wi(n, e) {
|
|
|
7431
7431
|
function ir(n) {
|
|
7432
7432
|
return n.contentEditable = "true", Q && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
|
|
7433
7433
|
}
|
|
7434
|
-
function
|
|
7434
|
+
function ji(n) {
|
|
7435
7435
|
n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
|
|
7436
7436
|
}
|
|
7437
7437
|
function cc(n) {
|
|
@@ -7440,7 +7440,7 @@ function cc(n) {
|
|
|
7440
7440
|
let t = n.domSelectionRange(), r = t.anchorNode, i = t.anchorOffset;
|
|
7441
7441
|
e.addEventListener("selectionchange", n.input.hideSelectionGuard = () => {
|
|
7442
7442
|
(t.anchorNode != r || t.anchorOffset != i) && (e.removeEventListener("selectionchange", n.input.hideSelectionGuard), setTimeout(() => {
|
|
7443
|
-
(!
|
|
7443
|
+
(!Co(n) || n.state.selection.visible) && n.dom.classList.remove("ProseMirror-hideselection");
|
|
7444
7444
|
}, 20));
|
|
7445
7445
|
});
|
|
7446
7446
|
}
|
|
@@ -7451,23 +7451,23 @@ function dc(n) {
|
|
|
7451
7451
|
let t = n.cursorWrapper.dom, r = t.nodeName == "IMG";
|
|
7452
7452
|
r ? e.collapse(t.parentNode, J(t) + 1) : e.collapse(t, 0), !r && !n.state.selection.visible && se && He <= 11 && (t.disabled = !0, t.disabled = !1);
|
|
7453
7453
|
}
|
|
7454
|
-
function
|
|
7454
|
+
function To(n, e) {
|
|
7455
7455
|
if (e instanceof S) {
|
|
7456
7456
|
let t = n.docView.descAt(e.from);
|
|
7457
|
-
t != n.lastSelectedViewDesc && (
|
|
7457
|
+
t != n.lastSelectedViewDesc && (Ki(n), t && t.selectNode(), n.lastSelectedViewDesc = t);
|
|
7458
7458
|
} else
|
|
7459
|
-
|
|
7459
|
+
Ki(n);
|
|
7460
7460
|
}
|
|
7461
|
-
function
|
|
7461
|
+
function Ki(n) {
|
|
7462
7462
|
n.lastSelectedViewDesc && (n.lastSelectedViewDesc.parent && n.lastSelectedViewDesc.deselectNode(), n.lastSelectedViewDesc = void 0);
|
|
7463
7463
|
}
|
|
7464
7464
|
function Ur(n, e, t, r) {
|
|
7465
7465
|
return n.someProp("createSelectionBetween", (i) => i(n, e, t)) || w.between(e, t, r);
|
|
7466
7466
|
}
|
|
7467
|
-
function
|
|
7468
|
-
return n.editable && !n.hasFocus() ? !1 :
|
|
7467
|
+
function Ji(n) {
|
|
7468
|
+
return n.editable && !n.hasFocus() ? !1 : Oo(n);
|
|
7469
7469
|
}
|
|
7470
|
-
function
|
|
7470
|
+
function Oo(n) {
|
|
7471
7471
|
let e = n.domSelectionRange();
|
|
7472
7472
|
if (!e.anchorNode)
|
|
7473
7473
|
return !1;
|
|
@@ -7488,7 +7488,7 @@ function Nr(n, e) {
|
|
|
7488
7488
|
function Re(n, e) {
|
|
7489
7489
|
return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()), !0;
|
|
7490
7490
|
}
|
|
7491
|
-
function
|
|
7491
|
+
function Ui(n, e, t) {
|
|
7492
7492
|
let r = n.state.selection;
|
|
7493
7493
|
if (r instanceof w)
|
|
7494
7494
|
if (t.indexOf("s") > -1) {
|
|
@@ -7547,7 +7547,7 @@ function fc(n) {
|
|
|
7547
7547
|
break;
|
|
7548
7548
|
}
|
|
7549
7549
|
} else {
|
|
7550
|
-
if (
|
|
7550
|
+
if (vo(t))
|
|
7551
7551
|
break;
|
|
7552
7552
|
{
|
|
7553
7553
|
let l = t.previousSibling;
|
|
@@ -7579,7 +7579,7 @@ function hc(n) {
|
|
|
7579
7579
|
else
|
|
7580
7580
|
break;
|
|
7581
7581
|
} else {
|
|
7582
|
-
if (
|
|
7582
|
+
if (vo(t))
|
|
7583
7583
|
break;
|
|
7584
7584
|
{
|
|
7585
7585
|
let l = t.nextSibling;
|
|
@@ -7596,7 +7596,7 @@ function hc(n) {
|
|
|
7596
7596
|
}
|
|
7597
7597
|
s && Dr(n, s, o);
|
|
7598
7598
|
}
|
|
7599
|
-
function
|
|
7599
|
+
function vo(n) {
|
|
7600
7600
|
let e = n.pmViewDesc;
|
|
7601
7601
|
return e && e.node && e.node.isBlock;
|
|
7602
7602
|
}
|
|
@@ -7642,9 +7642,9 @@ function Dr(n, e, t) {
|
|
|
7642
7642
|
n.state == i && De(n);
|
|
7643
7643
|
}, 50);
|
|
7644
7644
|
}
|
|
7645
|
-
function
|
|
7645
|
+
function _i(n, e) {
|
|
7646
7646
|
let t = n.state.doc.resolve(e);
|
|
7647
|
-
if (!(_ ||
|
|
7647
|
+
if (!(_ || fo) && t.parent.inlineContent) {
|
|
7648
7648
|
let i = n.coordsAtPos(e);
|
|
7649
7649
|
if (e > t.start()) {
|
|
7650
7650
|
let s = n.coordsAtPos(e - 1), o = (s.top + s.bottom) / 2;
|
|
@@ -7659,7 +7659,7 @@ function Ui(n, e) {
|
|
|
7659
7659
|
}
|
|
7660
7660
|
return getComputedStyle(n.dom).direction == "rtl" ? "rtl" : "ltr";
|
|
7661
7661
|
}
|
|
7662
|
-
function
|
|
7662
|
+
function Gi(n, e, t) {
|
|
7663
7663
|
let r = n.state.selection;
|
|
7664
7664
|
if (r instanceof w && !r.empty || t.indexOf("s") > -1 || ue && t.indexOf("m") > -1)
|
|
7665
7665
|
return !1;
|
|
@@ -7675,7 +7675,7 @@ function _i(n, e, t) {
|
|
|
7675
7675
|
}
|
|
7676
7676
|
return !1;
|
|
7677
7677
|
}
|
|
7678
|
-
function
|
|
7678
|
+
function Xi(n, e) {
|
|
7679
7679
|
if (!(n.state.selection instanceof w))
|
|
7680
7680
|
return !0;
|
|
7681
7681
|
let { $head: t, $anchor: r, empty: i } = n.state.selection;
|
|
@@ -7692,7 +7692,7 @@ function Gi(n, e) {
|
|
|
7692
7692
|
}
|
|
7693
7693
|
return !1;
|
|
7694
7694
|
}
|
|
7695
|
-
function
|
|
7695
|
+
function Yi(n, e, t) {
|
|
7696
7696
|
n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
|
|
7697
7697
|
}
|
|
7698
7698
|
function gc(n) {
|
|
@@ -7701,7 +7701,7 @@ function gc(n) {
|
|
|
7701
7701
|
let { focusNode: e, focusOffset: t } = n.domSelectionRange();
|
|
7702
7702
|
if (e && e.nodeType == 1 && t == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
|
|
7703
7703
|
let r = e.firstChild;
|
|
7704
|
-
|
|
7704
|
+
Yi(n, r, "true"), setTimeout(() => Yi(n, r, "false"), 20);
|
|
7705
7705
|
}
|
|
7706
7706
|
return !1;
|
|
7707
7707
|
}
|
|
@@ -7712,22 +7712,22 @@ function yc(n) {
|
|
|
7712
7712
|
function bc(n, e) {
|
|
7713
7713
|
let t = e.keyCode, r = yc(e);
|
|
7714
7714
|
if (t == 8 || ue && t == 72 && r == "c")
|
|
7715
|
-
return
|
|
7715
|
+
return Xi(n, -1) || ht(n, -1);
|
|
7716
7716
|
if (t == 46 && !e.shiftKey || ue && t == 68 && r == "c")
|
|
7717
|
-
return
|
|
7717
|
+
return Xi(n, 1) || ht(n, 1);
|
|
7718
7718
|
if (t == 13 || t == 27)
|
|
7719
7719
|
return !0;
|
|
7720
7720
|
if (t == 37 || ue && t == 66 && r == "c") {
|
|
7721
|
-
let i = t == 37 ?
|
|
7722
|
-
return
|
|
7721
|
+
let i = t == 37 ? _i(n, n.state.selection.from) == "ltr" ? -1 : 1 : -1;
|
|
7722
|
+
return Ui(n, i, r) || ht(n, i);
|
|
7723
7723
|
} else if (t == 39 || ue && t == 70 && r == "c") {
|
|
7724
|
-
let i = t == 39 ?
|
|
7725
|
-
return
|
|
7724
|
+
let i = t == 39 ? _i(n, n.state.selection.from) == "ltr" ? 1 : -1 : 1;
|
|
7725
|
+
return Ui(n, i, r) || ht(n, i);
|
|
7726
7726
|
} else {
|
|
7727
7727
|
if (t == 38 || ue && t == 80 && r == "c")
|
|
7728
|
-
return
|
|
7728
|
+
return Gi(n, -1, r) || ht(n, -1);
|
|
7729
7729
|
if (t == 40 || ue && t == 78 && r == "c")
|
|
7730
|
-
return gc(n) ||
|
|
7730
|
+
return gc(n) || Gi(n, 1, r) || ht(n, 1);
|
|
7731
7731
|
if (r == (ue ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
7732
7732
|
return !0;
|
|
7733
7733
|
}
|
|
@@ -7743,10 +7743,10 @@ function _r(n, e) {
|
|
|
7743
7743
|
let h = r.firstChild;
|
|
7744
7744
|
t.push(h.type.name, h.attrs != h.type.defaultAttrs ? h.attrs : null), r = h.content;
|
|
7745
7745
|
}
|
|
7746
|
-
let o = n.someProp("clipboardSerializer") || ut.fromSchema(n.state.schema), l =
|
|
7746
|
+
let o = n.someProp("clipboardSerializer") || ut.fromSchema(n.state.schema), l = Ro(), a = l.createElement("div");
|
|
7747
7747
|
a.appendChild(o.serializeFragment(r, { document: l }));
|
|
7748
7748
|
let c = a.firstChild, d, u = 0;
|
|
7749
|
-
for (; c && c.nodeType == 1 && (d =
|
|
7749
|
+
for (; c && c.nodeType == 1 && (d = Io[c.nodeName.toLowerCase()]); ) {
|
|
7750
7750
|
for (let h = d.length - 1; h >= 0; h--) {
|
|
7751
7751
|
let p = l.createElement(d[h]);
|
|
7752
7752
|
for (; a.firstChild; )
|
|
@@ -7761,7 +7761,7 @@ function _r(n, e) {
|
|
|
7761
7761
|
`);
|
|
7762
7762
|
return { dom: a, text: f, slice: e };
|
|
7763
7763
|
}
|
|
7764
|
-
function
|
|
7764
|
+
function Eo(n, e, t, r, i) {
|
|
7765
7765
|
let s = i.parent.type.spec.code, o, l;
|
|
7766
7766
|
if (!t && !e)
|
|
7767
7767
|
return null;
|
|
@@ -7805,14 +7805,14 @@ function vo(n, e, t, r, i) {
|
|
|
7805
7805
|
return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !kc.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
|
|
7806
7806
|
}
|
|
7807
7807
|
})), d)
|
|
7808
|
-
l = Cc(
|
|
7808
|
+
l = Cc(Zi(l, +d[1], +d[2]), d[4]);
|
|
7809
7809
|
else if (l = k.maxOpen(xc(l.content, i), !0), l.openStart || l.openEnd) {
|
|
7810
7810
|
let u = 0, f = 0;
|
|
7811
7811
|
for (let h = l.content.firstChild; u < l.openStart && !h.type.spec.isolating; u++, h = h.firstChild)
|
|
7812
7812
|
;
|
|
7813
7813
|
for (let h = l.content.lastChild; f < l.openEnd && !h.type.spec.isolating; f++, h = h.lastChild)
|
|
7814
7814
|
;
|
|
7815
|
-
l =
|
|
7815
|
+
l = Zi(l, u, f);
|
|
7816
7816
|
}
|
|
7817
7817
|
return n.someProp("transformPasted", (u) => {
|
|
7818
7818
|
l = u(l, n, a);
|
|
@@ -7830,11 +7830,11 @@ function xc(n, e) {
|
|
|
7830
7830
|
let a = i.findWrapping(l.type), c;
|
|
7831
7831
|
if (!a)
|
|
7832
7832
|
return o = null;
|
|
7833
|
-
if (c = o.length && s.length &&
|
|
7833
|
+
if (c = o.length && s.length && No(a, s, l, o[o.length - 1], 0))
|
|
7834
7834
|
o[o.length - 1] = c;
|
|
7835
7835
|
else {
|
|
7836
|
-
o.length && (o[o.length - 1] =
|
|
7837
|
-
let d =
|
|
7836
|
+
o.length && (o[o.length - 1] = Do(o[o.length - 1], s.length));
|
|
7837
|
+
let d = Ao(l, a);
|
|
7838
7838
|
o.push(d), i = i.matchType(d.type), s = a;
|
|
7839
7839
|
}
|
|
7840
7840
|
}), o)
|
|
@@ -7842,34 +7842,34 @@ function xc(n, e) {
|
|
|
7842
7842
|
}
|
|
7843
7843
|
return n;
|
|
7844
7844
|
}
|
|
7845
|
-
function
|
|
7845
|
+
function Ao(n, e, t = 0) {
|
|
7846
7846
|
for (let r = e.length - 1; r >= t; r--)
|
|
7847
7847
|
n = e[r].create(null, b.from(n));
|
|
7848
7848
|
return n;
|
|
7849
7849
|
}
|
|
7850
|
-
function
|
|
7850
|
+
function No(n, e, t, r, i) {
|
|
7851
7851
|
if (i < n.length && i < e.length && n[i] == e[i]) {
|
|
7852
|
-
let s =
|
|
7852
|
+
let s = No(n, e, t, r.lastChild, i + 1);
|
|
7853
7853
|
if (s)
|
|
7854
7854
|
return r.copy(r.content.replaceChild(r.childCount - 1, s));
|
|
7855
7855
|
if (r.contentMatchAt(r.childCount).matchType(i == n.length - 1 ? t.type : n[i + 1]))
|
|
7856
|
-
return r.copy(r.content.append(b.from(
|
|
7856
|
+
return r.copy(r.content.append(b.from(Ao(t, n, i + 1))));
|
|
7857
7857
|
}
|
|
7858
7858
|
}
|
|
7859
|
-
function
|
|
7859
|
+
function Do(n, e) {
|
|
7860
7860
|
if (e == 0)
|
|
7861
7861
|
return n;
|
|
7862
|
-
let t = n.content.replaceChild(n.childCount - 1,
|
|
7862
|
+
let t = n.content.replaceChild(n.childCount - 1, Do(n.lastChild, e - 1)), r = n.contentMatchAt(n.childCount).fillBefore(b.empty, !0);
|
|
7863
7863
|
return n.copy(t.append(r));
|
|
7864
7864
|
}
|
|
7865
7865
|
function Ir(n, e, t, r, i, s) {
|
|
7866
7866
|
let o = e < 0 ? n.firstChild : n.lastChild, l = o.content;
|
|
7867
7867
|
return n.childCount > 1 && (s = 0), i < r - 1 && (l = Ir(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));
|
|
7868
7868
|
}
|
|
7869
|
-
function
|
|
7869
|
+
function Zi(n, e, t) {
|
|
7870
7870
|
return e < n.openStart && (n = new k(Ir(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new k(Ir(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
|
|
7871
7871
|
}
|
|
7872
|
-
const
|
|
7872
|
+
const Io = {
|
|
7873
7873
|
thead: ["table"],
|
|
7874
7874
|
tbody: ["table"],
|
|
7875
7875
|
tfoot: ["table"],
|
|
@@ -7880,9 +7880,9 @@ const Do = {
|
|
|
7880
7880
|
td: ["table", "tbody", "tr"],
|
|
7881
7881
|
th: ["table", "tbody", "tr"]
|
|
7882
7882
|
};
|
|
7883
|
-
let
|
|
7884
|
-
function
|
|
7885
|
-
return
|
|
7883
|
+
let Qi = null;
|
|
7884
|
+
function Ro() {
|
|
7885
|
+
return Qi || (Qi = document.implementation.createHTMLDocument("title"));
|
|
7886
7886
|
}
|
|
7887
7887
|
let sr = null;
|
|
7888
7888
|
function Sc(n) {
|
|
@@ -7892,8 +7892,8 @@ function Sc(n) {
|
|
|
7892
7892
|
function wc(n) {
|
|
7893
7893
|
let e = /^(\s*<meta [^>]*>)*/.exec(n);
|
|
7894
7894
|
e && (n = n.slice(e[0].length));
|
|
7895
|
-
let t =
|
|
7896
|
-
if ((i = r &&
|
|
7895
|
+
let t = Ro().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), i;
|
|
7896
|
+
if ((i = r && Io[r[1].toLowerCase()]) && (n = i.map((s) => "<" + s + ">").join("") + n + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = Sc(n), i)
|
|
7897
7897
|
for (let s = 0; s < i.length; s++)
|
|
7898
7898
|
t = t.querySelector(i[s]) || t;
|
|
7899
7899
|
return t;
|
|
@@ -7974,7 +7974,7 @@ function Nc(n, e) {
|
|
|
7974
7974
|
}
|
|
7975
7975
|
ne.keydown = (n, e) => {
|
|
7976
7976
|
let t = e;
|
|
7977
|
-
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !
|
|
7977
|
+
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !Bo(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(Ae && _ && t.keyCode == 13)))
|
|
7978
7978
|
if (t.keyCode != 229 && n.domObserver.forceFlush(), Ct && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
7979
7979
|
let r = Date.now();
|
|
7980
7980
|
n.input.lastIOSEnter = r, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
@@ -7987,7 +7987,7 @@ ne.keyup = (n, e) => {
|
|
|
7987
7987
|
};
|
|
7988
7988
|
ne.keypress = (n, e) => {
|
|
7989
7989
|
let t = e;
|
|
7990
|
-
if (
|
|
7990
|
+
if (Bo(n, t) || !t.charCode || t.ctrlKey && !t.altKey || ue && t.metaKey)
|
|
7991
7991
|
return;
|
|
7992
7992
|
if (n.someProp("handleKeyPress", (i) => i(n, t))) {
|
|
7993
7993
|
t.preventDefault();
|
|
@@ -8072,18 +8072,18 @@ function zc(n, e, t) {
|
|
|
8072
8072
|
function Yr(n) {
|
|
8073
8073
|
return Cn(n);
|
|
8074
8074
|
}
|
|
8075
|
-
const
|
|
8075
|
+
const Po = ue ? "metaKey" : "ctrlKey";
|
|
8076
8076
|
te.mousedown = (n, e) => {
|
|
8077
8077
|
let t = e;
|
|
8078
8078
|
n.input.shiftKey = t.shiftKey;
|
|
8079
8079
|
let r = Yr(n), i = Date.now(), s = "singleClick";
|
|
8080
|
-
i - n.input.lastClick.time < 500 && Dc(t, n.input.lastClick) && !t[
|
|
8080
|
+
i - n.input.lastClick.time < 500 && Dc(t, n.input.lastClick) && !t[Po] && 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 };
|
|
8081
8081
|
let o = n.posAtCoords(Hn(t));
|
|
8082
8082
|
o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Fc(n, o, t, !!r)) : (s == "doubleClick" ? Bc : Lc)(n, o.pos, o.inside, t) ? t.preventDefault() : Fe(n, "pointer"));
|
|
8083
8083
|
};
|
|
8084
8084
|
class Fc {
|
|
8085
8085
|
constructor(e, t, r, i) {
|
|
8086
|
-
this.view = e, this.pos = t, this.event = r, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[
|
|
8086
|
+
this.view = e, this.pos = t, this.event = r, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[Po], this.allowDefault = r.shiftKey;
|
|
8087
8087
|
let s, o;
|
|
8088
8088
|
if (t.inside > -1)
|
|
8089
8089
|
s = e.state.doc.nodeAt(t.inside), o = t.inside;
|
|
@@ -8134,7 +8134,7 @@ te.touchmove = (n) => {
|
|
|
8134
8134
|
n.input.lastTouch = Date.now(), Fe(n, "pointer");
|
|
8135
8135
|
};
|
|
8136
8136
|
te.contextmenu = (n) => Yr(n);
|
|
8137
|
-
function
|
|
8137
|
+
function Bo(n, e) {
|
|
8138
8138
|
return n.composing ? !0 : Q && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
|
|
8139
8139
|
}
|
|
8140
8140
|
const $c = Ae ? 5e3 : -1;
|
|
@@ -8142,7 +8142,7 @@ ne.compositionstart = ne.compositionupdate = (n) => {
|
|
|
8142
8142
|
if (!n.composing) {
|
|
8143
8143
|
n.domObserver.flush();
|
|
8144
8144
|
let { state: e } = n, t = e.selection.$to;
|
|
8145
|
-
if (e.selection instanceof w && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || _ &&
|
|
8145
|
+
if (e.selection instanceof w && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || _ && fo && Vc(n)))
|
|
8146
8146
|
n.markCursor = n.state.storedMarks || t.marks(), Cn(n, !0), n.markCursor = null;
|
|
8147
8147
|
else if (Cn(n, !e.selection.empty), pe && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
|
|
8148
8148
|
let r = n.domSelectionRange();
|
|
@@ -8160,7 +8160,7 @@ ne.compositionstart = ne.compositionupdate = (n) => {
|
|
|
8160
8160
|
}
|
|
8161
8161
|
n.input.composing = !0;
|
|
8162
8162
|
}
|
|
8163
|
-
|
|
8163
|
+
Lo(n, $c);
|
|
8164
8164
|
};
|
|
8165
8165
|
function Vc(n) {
|
|
8166
8166
|
let { focusNode: e, focusOffset: t } = n.domSelectionRange();
|
|
@@ -8170,12 +8170,12 @@ function Vc(n) {
|
|
|
8170
8170
|
return r.nodeType == 1 && r.contentEditable == "false";
|
|
8171
8171
|
}
|
|
8172
8172
|
ne.compositionend = (n, e) => {
|
|
8173
|
-
n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.badSafariComposition ? n.domObserver.forceFlush() : n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++,
|
|
8173
|
+
n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.badSafariComposition ? n.domObserver.forceFlush() : n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, Lo(n, 20));
|
|
8174
8174
|
};
|
|
8175
|
-
function
|
|
8175
|
+
function Lo(n, e) {
|
|
8176
8176
|
clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => Cn(n), e));
|
|
8177
8177
|
}
|
|
8178
|
-
function
|
|
8178
|
+
function zo(n) {
|
|
8179
8179
|
for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Wc()); n.input.compositionNodes.length > 0; )
|
|
8180
8180
|
n.input.compositionNodes.pop().markParentsDirty();
|
|
8181
8181
|
}
|
|
@@ -8204,7 +8204,7 @@ function Wc() {
|
|
|
8204
8204
|
}
|
|
8205
8205
|
function Cn(n, e = !1) {
|
|
8206
8206
|
if (!(Ae && n.domObserver.flushingSoon >= 0)) {
|
|
8207
|
-
if (n.domObserver.forceFlush(),
|
|
8207
|
+
if (n.domObserver.forceFlush(), zo(n), e || n.docView && n.docView.dirty) {
|
|
8208
8208
|
let t = Jr(n), r = n.state.selection;
|
|
8209
8209
|
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;
|
|
8210
8210
|
}
|
|
@@ -8243,7 +8243,7 @@ function Kc(n, e) {
|
|
|
8243
8243
|
}, 50);
|
|
8244
8244
|
}
|
|
8245
8245
|
function qt(n, e, t, r, i) {
|
|
8246
|
-
let s =
|
|
8246
|
+
let s = Eo(n, e, t, r, n.state.selection.$from);
|
|
8247
8247
|
if (n.someProp("handlePaste", (a) => a(n, i, s || k.empty)))
|
|
8248
8248
|
return !0;
|
|
8249
8249
|
if (!s)
|
|
@@ -8251,7 +8251,7 @@ function qt(n, e, t, r, i) {
|
|
|
8251
8251
|
let o = jc(s), l = o ? n.state.tr.replaceSelectionWith(o, r) : n.state.tr.replaceSelection(s);
|
|
8252
8252
|
return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
|
|
8253
8253
|
}
|
|
8254
|
-
function
|
|
8254
|
+
function Fo(n) {
|
|
8255
8255
|
let e = n.getData("text/plain") || n.getData("Text");
|
|
8256
8256
|
if (e)
|
|
8257
8257
|
return e;
|
|
@@ -8263,15 +8263,15 @@ ne.paste = (n, e) => {
|
|
|
8263
8263
|
if (n.composing && !Ae)
|
|
8264
8264
|
return;
|
|
8265
8265
|
let r = Wt ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
|
|
8266
|
-
r && qt(n,
|
|
8266
|
+
r && qt(n, Fo(r), r.getData("text/html"), i, t) ? t.preventDefault() : Kc(n, t);
|
|
8267
8267
|
};
|
|
8268
|
-
class
|
|
8268
|
+
class $o {
|
|
8269
8269
|
constructor(e, t, r) {
|
|
8270
8270
|
this.slice = e, this.move = t, this.node = r;
|
|
8271
8271
|
}
|
|
8272
8272
|
}
|
|
8273
8273
|
const Jc = ue ? "altKey" : "ctrlKey";
|
|
8274
|
-
function
|
|
8274
|
+
function Vo(n, e) {
|
|
8275
8275
|
let t;
|
|
8276
8276
|
return n.someProp("dragCopies", (r) => {
|
|
8277
8277
|
t = t || r(e);
|
|
@@ -8291,7 +8291,7 @@ te.dragstart = (n, e) => {
|
|
|
8291
8291
|
}
|
|
8292
8292
|
}
|
|
8293
8293
|
let l = (o || n.state.selection).content(), { dom: a, text: c, slice: d } = _r(n, l);
|
|
8294
|
-
(!t.dataTransfer.files.length || !_ ||
|
|
8294
|
+
(!t.dataTransfer.files.length || !_ || uo > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Wt ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Wt || t.dataTransfer.setData("text/plain", c), n.dragging = new $o(d, Vo(n, t), o);
|
|
8295
8295
|
};
|
|
8296
8296
|
te.dragend = (n) => {
|
|
8297
8297
|
let e = n.dragging;
|
|
@@ -8316,8 +8316,8 @@ function Uc(n, e, t) {
|
|
|
8316
8316
|
let i = n.state.doc.resolve(r.pos), s = t && t.slice;
|
|
8317
8317
|
s ? n.someProp("transformPasted", (h) => {
|
|
8318
8318
|
s = h(s, n, !1);
|
|
8319
|
-
}) : s =
|
|
8320
|
-
let o = !!(t &&
|
|
8319
|
+
}) : s = Eo(n, Fo(e.dataTransfer), Wt ? null : e.dataTransfer.getData("text/html"), !1, i);
|
|
8320
|
+
let o = !!(t && Vo(n, e));
|
|
8321
8321
|
if (n.someProp("handleDrop", (h) => h(n, e, s || k.empty, o))) {
|
|
8322
8322
|
e.preventDefault();
|
|
8323
8323
|
return;
|
|
@@ -8325,7 +8325,7 @@ function Uc(n, e, t) {
|
|
|
8325
8325
|
if (!s)
|
|
8326
8326
|
return;
|
|
8327
8327
|
e.preventDefault();
|
|
8328
|
-
let l = s ?
|
|
8328
|
+
let l = s ? no(n.state.doc, i.pos, s) : i.pos;
|
|
8329
8329
|
l == null && (l = i.pos);
|
|
8330
8330
|
let a = n.state.tr;
|
|
8331
8331
|
if (o) {
|
|
@@ -8578,13 +8578,13 @@ class $ {
|
|
|
8578
8578
|
let i, s = 0;
|
|
8579
8579
|
e.forEach((l, a) => {
|
|
8580
8580
|
let c = a + r, d;
|
|
8581
|
-
if (d =
|
|
8581
|
+
if (d = Wo(t, l, c)) {
|
|
8582
8582
|
for (i || (i = this.children.slice()); s < i.length && i[s] < a; )
|
|
8583
8583
|
s += 3;
|
|
8584
8584
|
i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize, On(d, l, c + 1, nt)), s += 3;
|
|
8585
8585
|
}
|
|
8586
8586
|
});
|
|
8587
|
-
let o =
|
|
8587
|
+
let o = Ho(s ? qo(t) : t, -r);
|
|
8588
8588
|
for (let l = 0; l < o.length; l++)
|
|
8589
8589
|
o[l].type.valid(e, o[l]) || o.splice(l--, 1);
|
|
8590
8590
|
return new $(o.length ? this.local.concat(o).sort(rt) : this.local, i || this.children);
|
|
@@ -8790,7 +8790,7 @@ function _c(n, e, t, r, i, s, o) {
|
|
|
8790
8790
|
}
|
|
8791
8791
|
return new $(e.sort(rt), l);
|
|
8792
8792
|
}
|
|
8793
|
-
function
|
|
8793
|
+
function Ho(n, e) {
|
|
8794
8794
|
if (!e || !n.length)
|
|
8795
8795
|
return n;
|
|
8796
8796
|
let t = [];
|
|
@@ -8813,7 +8813,7 @@ function Gc(n, e, t, r, i, s, o) {
|
|
|
8813
8813
|
n[a + 1] == -1 && l(n[a + 2], e[a] + s + 1);
|
|
8814
8814
|
return t;
|
|
8815
8815
|
}
|
|
8816
|
-
function
|
|
8816
|
+
function Wo(n, e, t) {
|
|
8817
8817
|
if (e.isLeaf)
|
|
8818
8818
|
return null;
|
|
8819
8819
|
let r = t + e.nodeSize, i = null;
|
|
@@ -8821,7 +8821,7 @@ function Ho(n, e, t) {
|
|
|
8821
8821
|
(o = n[s]) && o.from > t && o.to < r && ((i || (i = [])).push(o), n[s] = null);
|
|
8822
8822
|
return i;
|
|
8823
8823
|
}
|
|
8824
|
-
function
|
|
8824
|
+
function qo(n) {
|
|
8825
8825
|
let e = [];
|
|
8826
8826
|
for (let t = 0; t < n.length; t++)
|
|
8827
8827
|
n[t] != null && e.push(n[t]);
|
|
@@ -8830,14 +8830,14 @@ function Wo(n) {
|
|
|
8830
8830
|
function On(n, e, t, r) {
|
|
8831
8831
|
let i = [], s = !1;
|
|
8832
8832
|
e.forEach((l, a) => {
|
|
8833
|
-
let c =
|
|
8833
|
+
let c = Wo(n, l, a + t);
|
|
8834
8834
|
if (c) {
|
|
8835
8835
|
s = !0;
|
|
8836
8836
|
let d = On(c, l, t + a + 1, r);
|
|
8837
8837
|
d != Z && i.push(a, a + l.nodeSize, d);
|
|
8838
8838
|
}
|
|
8839
8839
|
});
|
|
8840
|
-
let o =
|
|
8840
|
+
let o = Ho(s ? qo(n) : n, -t).sort(rt);
|
|
8841
8841
|
for (let l = 0; l < o.length; l++)
|
|
8842
8842
|
o[l].type.valid(e, o[l]) || (r.onRemove && r.onRemove(o[l].spec), o.splice(l--, 1));
|
|
8843
8843
|
return o.length || i.length ? new $(o, i) : Z;
|
|
@@ -8853,17 +8853,17 @@ function Qr(n) {
|
|
|
8853
8853
|
for (let i = t + 1; i < e.length; i++) {
|
|
8854
8854
|
let s = e[i];
|
|
8855
8855
|
if (s.from == r.from) {
|
|
8856
|
-
s.to != r.to && (e == n && (e = n.slice()), e[i] = s.copy(s.from, r.to),
|
|
8856
|
+
s.to != r.to && (e == n && (e = n.slice()), e[i] = s.copy(s.from, r.to), es(e, i + 1, s.copy(r.to, s.to)));
|
|
8857
8857
|
continue;
|
|
8858
8858
|
} else {
|
|
8859
|
-
s.from < r.to && (e == n && (e = n.slice()), e[t] = r.copy(r.from, s.from),
|
|
8859
|
+
s.from < r.to && (e == n && (e = n.slice()), e[t] = r.copy(r.from, s.from), es(e, i, r.copy(s.from, r.to)));
|
|
8860
8860
|
break;
|
|
8861
8861
|
}
|
|
8862
8862
|
}
|
|
8863
8863
|
}
|
|
8864
8864
|
return e;
|
|
8865
8865
|
}
|
|
8866
|
-
function
|
|
8866
|
+
function es(n, e, t) {
|
|
8867
8867
|
for (; e < n.length && rt(t, n[e]) > 0; )
|
|
8868
8868
|
e++;
|
|
8869
8869
|
n.splice(e, 0, t);
|
|
@@ -8940,7 +8940,7 @@ class Qc {
|
|
|
8940
8940
|
this.suppressingSelectionUpdates = !0, setTimeout(() => this.suppressingSelectionUpdates = !1, 50);
|
|
8941
8941
|
}
|
|
8942
8942
|
onSelectionChange() {
|
|
8943
|
-
if (
|
|
8943
|
+
if (Ji(this.view)) {
|
|
8944
8944
|
if (this.suppressingSelectionUpdates)
|
|
8945
8945
|
return De(this.view);
|
|
8946
8946
|
if (se && He <= 11 && !this.view.state.selection.empty) {
|
|
@@ -8984,7 +8984,7 @@ class Qc {
|
|
|
8984
8984
|
return;
|
|
8985
8985
|
let t = this.pendingRecords();
|
|
8986
8986
|
t.length && (this.queue = []);
|
|
8987
|
-
let r = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(r) &&
|
|
8987
|
+
let r = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(r) && Ji(e) && !this.ignoreSelectionChange(r), s = -1, o = -1, l = !1, a = [];
|
|
8988
8988
|
if (e.editable)
|
|
8989
8989
|
for (let d = 0; d < t.length; d++) {
|
|
8990
8990
|
let u = this.registerMutation(t[d], a);
|
|
@@ -9051,15 +9051,15 @@ class Qc {
|
|
|
9051
9051
|
});
|
|
9052
9052
|
}
|
|
9053
9053
|
}
|
|
9054
|
-
let
|
|
9054
|
+
let ts = /* @__PURE__ */ new WeakMap(), ns = !1;
|
|
9055
9055
|
function ed(n) {
|
|
9056
|
-
if (!
|
|
9057
|
-
if (n.requiresGeckoHackNode = pe,
|
|
9056
|
+
if (!ts.has(n) && (ts.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
|
|
9057
|
+
if (n.requiresGeckoHackNode = pe, ns)
|
|
9058
9058
|
return;
|
|
9059
|
-
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."),
|
|
9059
|
+
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."), ns = !0;
|
|
9060
9060
|
}
|
|
9061
9061
|
}
|
|
9062
|
-
function
|
|
9062
|
+
function rs(n, e) {
|
|
9063
9063
|
let t = e.startContainer, r = e.startOffset, i = e.endContainer, s = e.endOffset, o = n.domAtPos(n.state.selection.anchor);
|
|
9064
9064
|
return lt(o.node, o.offset, i, s) && ([t, r, i, s] = [i, s, t, r]), { anchorNode: t, anchorOffset: r, focusNode: i, focusOffset: s };
|
|
9065
9065
|
}
|
|
@@ -9067,13 +9067,13 @@ function td(n, e) {
|
|
|
9067
9067
|
if (e.getComposedRanges) {
|
|
9068
9068
|
let i = e.getComposedRanges(n.root)[0];
|
|
9069
9069
|
if (i)
|
|
9070
|
-
return
|
|
9070
|
+
return rs(n, i);
|
|
9071
9071
|
}
|
|
9072
9072
|
let t;
|
|
9073
9073
|
function r(i) {
|
|
9074
9074
|
i.preventDefault(), i.stopImmediatePropagation(), t = i.getTargetRanges()[0];
|
|
9075
9075
|
}
|
|
9076
|
-
return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ?
|
|
9076
|
+
return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? rs(n, t) : null;
|
|
9077
9077
|
}
|
|
9078
9078
|
function nd(n, e) {
|
|
9079
9079
|
for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
|
|
@@ -9153,7 +9153,7 @@ function ld(n, e, t, r, i) {
|
|
|
9153
9153
|
if (n.input.compositionPendingChanges = 0, e < 0) {
|
|
9154
9154
|
let C = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, A = Jr(n, C);
|
|
9155
9155
|
if (A && !n.state.selection.eq(A)) {
|
|
9156
|
-
if (_ && Ae && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (
|
|
9156
|
+
if (_ && Ae && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (vl) => vl(n, _e(13, "Enter"))))
|
|
9157
9157
|
return;
|
|
9158
9158
|
let X = n.state.tr.setSelection(A);
|
|
9159
9159
|
C == "pointer" ? X.setMeta("pointer", !0) : C == "key" && X.scrollIntoView(), s && X.setMeta("composition", s), n.dispatch(X);
|
|
@@ -9174,7 +9174,7 @@ function ld(n, e, t, r, i) {
|
|
|
9174
9174
|
p = { start: a.from, endA: a.to, endB: a.to };
|
|
9175
9175
|
else {
|
|
9176
9176
|
if (c.sel) {
|
|
9177
|
-
let C =
|
|
9177
|
+
let C = is(n, n.state.doc, c.sel);
|
|
9178
9178
|
if (C && !C.eq(n.state.selection)) {
|
|
9179
9179
|
let A = n.state.tr.setSelection(C);
|
|
9180
9180
|
s && A.setMeta("composition", s), n.dispatch(A);
|
|
@@ -9200,7 +9200,7 @@ function ld(n, e, t, r, i) {
|
|
|
9200
9200
|
let M = p.start, I = p.endA, D = (C) => {
|
|
9201
9201
|
let A = C || n.state.tr.replace(M, I, c.doc.slice(p.start - c.from, p.endB - c.from));
|
|
9202
9202
|
if (c.sel) {
|
|
9203
|
-
let X =
|
|
9203
|
+
let X = is(n, A.doc, c.sel);
|
|
9204
9204
|
X && !(_ && n.composing && X.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (X.head == M || X.head == A.mapping.map(I) - 1) || se && X.empty && X.head == M) && A.setSelection(X);
|
|
9205
9205
|
}
|
|
9206
9206
|
return s && A.setMeta("composition", s), A.scrollIntoView();
|
|
@@ -9224,7 +9224,7 @@ function ld(n, e, t, r, i) {
|
|
|
9224
9224
|
else
|
|
9225
9225
|
n.dispatch(D());
|
|
9226
9226
|
}
|
|
9227
|
-
function
|
|
9227
|
+
function is(n, e, t) {
|
|
9228
9228
|
return Math.max(t.anchor, t.head) > e.content.size ? null : Ur(n, e.resolve(t.anchor), e.resolve(t.head));
|
|
9229
9229
|
}
|
|
9230
9230
|
function ad(n, e) {
|
|
@@ -9284,20 +9284,20 @@ function dd(n, e, t, r, i) {
|
|
|
9284
9284
|
}
|
|
9285
9285
|
if (o < s && n.size < e.size) {
|
|
9286
9286
|
let a = r <= s && r >= o ? s - r : 0;
|
|
9287
|
-
s -= a, s && s < e.size &&
|
|
9287
|
+
s -= a, s && s < e.size && ss(e.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), l = s + (l - o), o = s;
|
|
9288
9288
|
} else if (l < s) {
|
|
9289
9289
|
let a = r <= s && r >= l ? s - r : 0;
|
|
9290
|
-
s -= a, s && s < n.size &&
|
|
9290
|
+
s -= a, s && s < n.size && ss(n.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), o = s + (o - l), l = s;
|
|
9291
9291
|
}
|
|
9292
9292
|
return { start: s, endA: o, endB: l };
|
|
9293
9293
|
}
|
|
9294
|
-
function
|
|
9294
|
+
function ss(n) {
|
|
9295
9295
|
if (n.length != 2)
|
|
9296
9296
|
return !1;
|
|
9297
9297
|
let e = n.charCodeAt(0), t = n.charCodeAt(1);
|
|
9298
9298
|
return e >= 56320 && e <= 57343 && t >= 55296 && t <= 56319;
|
|
9299
9299
|
}
|
|
9300
|
-
class
|
|
9300
|
+
class jo {
|
|
9301
9301
|
/**
|
|
9302
9302
|
Create a view. `place` may be a DOM node that the editor should
|
|
9303
9303
|
be appended to, a function that will place it into the document,
|
|
@@ -9306,7 +9306,7 @@ class qo {
|
|
|
9306
9306
|
added to the document.
|
|
9307
9307
|
*/
|
|
9308
9308
|
constructor(e, t) {
|
|
9309
|
-
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 Oc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(
|
|
9309
|
+
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 Oc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(us), 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 = cs(this), as(this), this.nodeViews = ds(this), this.docView = Vi(this.state.doc, ls(this), or(this), this.dom, this), this.domObserver = new Qc(this, (r, i, s, o) => ld(this, r, i, s, o)), this.domObserver.start(), vc(this), this.updatePluginViews();
|
|
9310
9310
|
}
|
|
9311
9311
|
/**
|
|
9312
9312
|
Holds `true` when a
|
|
@@ -9336,7 +9336,7 @@ class qo {
|
|
|
9336
9336
|
update(e) {
|
|
9337
9337
|
e.handleDOMEvents != this._props.handleDOMEvents && Rr(this);
|
|
9338
9338
|
let t = this._props;
|
|
9339
|
-
this._props = e, e.plugins && (e.plugins.forEach(
|
|
9339
|
+
this._props = e, e.plugins && (e.plugins.forEach(us), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);
|
|
9340
9340
|
}
|
|
9341
9341
|
/**
|
|
9342
9342
|
Update the view by updating existing props object with the object
|
|
@@ -9362,14 +9362,14 @@ class qo {
|
|
|
9362
9362
|
updateStateInner(e, t) {
|
|
9363
9363
|
var r;
|
|
9364
9364
|
let i = this.state, s = !1, o = !1;
|
|
9365
|
-
e.storedMarks && this.composing && (
|
|
9365
|
+
e.storedMarks && this.composing && (zo(this), o = !0), this.state = e;
|
|
9366
9366
|
let l = i.plugins != e.plugins || this._props.plugins != t.plugins;
|
|
9367
9367
|
if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
|
|
9368
|
-
let h =
|
|
9368
|
+
let h = ds(this);
|
|
9369
9369
|
fd(h, this.nodeViews) && (this.nodeViews = h, s = !0);
|
|
9370
9370
|
}
|
|
9371
|
-
(l || t.handleDOMEvents != this._props.handleDOMEvents) && Rr(this), this.editable =
|
|
9372
|
-
let a = or(this), c =
|
|
9371
|
+
(l || t.handleDOMEvents != this._props.handleDOMEvents) && Rr(this), this.editable = cs(this), as(this);
|
|
9372
|
+
let a = or(this), c = ls(this), d = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", u = s || !this.docView.matchesNode(e.doc, c, a);
|
|
9373
9373
|
(u || !e.selection.eq(i.selection)) && (o = !0);
|
|
9374
9374
|
let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Ha(this);
|
|
9375
9375
|
if (o) {
|
|
@@ -9377,9 +9377,9 @@ class qo {
|
|
|
9377
9377
|
let h = u && (se || _) && !this.composing && !i.selection.empty && !e.selection.empty && ud(i.selection, e.selection);
|
|
9378
9378
|
if (u) {
|
|
9379
9379
|
let p = _ ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
9380
|
-
this.composing && (this.input.compositionNode = Hc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView =
|
|
9380
|
+
this.composing && (this.input.compositionNode = Hc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = Vi(e.doc, c, a, this.dom, this)), p && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (h = !0);
|
|
9381
9381
|
}
|
|
9382
|
-
h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && uc(this)) ? De(this, h) : (
|
|
9382
|
+
h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && uc(this)) ? De(this, h) : (To(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
9383
9383
|
}
|
|
9384
9384
|
this.updatePluginViews(i), !((r = this.dragging) === null || r === void 0) && r.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && Wa(f);
|
|
9385
9385
|
}
|
|
@@ -9391,9 +9391,9 @@ class qo {
|
|
|
9391
9391
|
if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode))) {
|
|
9392
9392
|
if (!this.someProp("handleScrollToSelection", (t) => t(this))) if (this.state.selection instanceof S) {
|
|
9393
9393
|
let t = this.docView.domAfterPos(this.state.selection.from);
|
|
9394
|
-
t.nodeType == 1 &&
|
|
9394
|
+
t.nodeType == 1 && Pi(this, t.getBoundingClientRect(), e);
|
|
9395
9395
|
} else
|
|
9396
|
-
|
|
9396
|
+
Pi(this, this.coordsAtPos(this.state.selection.head, 1), e);
|
|
9397
9397
|
}
|
|
9398
9398
|
}
|
|
9399
9399
|
destroyPluginViews() {
|
|
@@ -9426,7 +9426,7 @@ class qo {
|
|
|
9426
9426
|
let s = r.from + (this.state.doc.content.size - t.doc.content.size);
|
|
9427
9427
|
(s > 0 && s < this.state.doc.content.size && this.state.doc.nodeAt(s)) == r.node && (i = s);
|
|
9428
9428
|
}
|
|
9429
|
-
this.dragging = new
|
|
9429
|
+
this.dragging = new $o(e.slice, e.move, i < 0 ? void 0 : S.create(this.state.doc, i));
|
|
9430
9430
|
}
|
|
9431
9431
|
someProp(e, t) {
|
|
9432
9432
|
let r = this._props && this._props[e], i;
|
|
@@ -9513,7 +9513,7 @@ class qo {
|
|
|
9513
9513
|
otherwise the element after.
|
|
9514
9514
|
*/
|
|
9515
9515
|
coordsAtPos(e, t = 1) {
|
|
9516
|
-
return
|
|
9516
|
+
return yo(this, e, t);
|
|
9517
9517
|
}
|
|
9518
9518
|
/**
|
|
9519
9519
|
Find the DOM position that corresponds to the given document
|
|
@@ -9629,11 +9629,11 @@ class qo {
|
|
|
9629
9629
|
return this.root.getSelection();
|
|
9630
9630
|
}
|
|
9631
9631
|
}
|
|
9632
|
-
|
|
9632
|
+
jo.prototype.dispatch = function(n) {
|
|
9633
9633
|
let e = this._props.dispatchTransaction;
|
|
9634
9634
|
e ? e.call(this, n) : this.updateState(this.state.apply(n));
|
|
9635
9635
|
};
|
|
9636
|
-
function
|
|
9636
|
+
function ls(n) {
|
|
9637
9637
|
let e = /* @__PURE__ */ Object.create(null);
|
|
9638
9638
|
return e.class = "ProseMirror", e.contenteditable = String(n.editable), n.someProp("attributes", (t) => {
|
|
9639
9639
|
if (typeof t == "function" && (t = t(n.state)), t)
|
|
@@ -9641,21 +9641,21 @@ function ss(n) {
|
|
|
9641
9641
|
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]));
|
|
9642
9642
|
}), e.translate || (e.translate = "no"), [he.node(0, n.state.doc.content.size, e)];
|
|
9643
9643
|
}
|
|
9644
|
-
function
|
|
9644
|
+
function as(n) {
|
|
9645
9645
|
if (n.markCursor) {
|
|
9646
9646
|
let e = document.createElement("img");
|
|
9647
9647
|
e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), n.cursorWrapper = { dom: e, deco: he.widget(n.state.selection.from, e, { raw: !0, marks: n.markCursor }) };
|
|
9648
9648
|
} else
|
|
9649
9649
|
n.cursorWrapper = null;
|
|
9650
9650
|
}
|
|
9651
|
-
function
|
|
9651
|
+
function cs(n) {
|
|
9652
9652
|
return !n.someProp("editable", (e) => e(n.state) === !1);
|
|
9653
9653
|
}
|
|
9654
9654
|
function ud(n, e) {
|
|
9655
9655
|
let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
|
|
9656
9656
|
return n.$anchor.start(t) != e.$anchor.start(t);
|
|
9657
9657
|
}
|
|
9658
|
-
function
|
|
9658
|
+
function ds(n) {
|
|
9659
9659
|
let e = /* @__PURE__ */ Object.create(null);
|
|
9660
9660
|
function t(r) {
|
|
9661
9661
|
for (let i in r)
|
|
@@ -9674,7 +9674,7 @@ function fd(n, e) {
|
|
|
9674
9674
|
r++;
|
|
9675
9675
|
return t != r;
|
|
9676
9676
|
}
|
|
9677
|
-
function
|
|
9677
|
+
function us(n) {
|
|
9678
9678
|
if (n.spec.state || n.spec.filterTransaction || n.spec.appendTransaction)
|
|
9679
9679
|
throw new RangeError("Plugins passed directly to the view must not have a state component");
|
|
9680
9680
|
}
|
|
@@ -9798,9 +9798,9 @@ function cr(n, e, t = !0) {
|
|
|
9798
9798
|
return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
|
|
9799
9799
|
}
|
|
9800
9800
|
function xd(n) {
|
|
9801
|
-
return new oe({ props: { handleKeyDown:
|
|
9801
|
+
return new oe({ props: { handleKeyDown: Ko(n) } });
|
|
9802
9802
|
}
|
|
9803
|
-
function
|
|
9803
|
+
function Ko(n) {
|
|
9804
9804
|
let e = kd(n);
|
|
9805
9805
|
return function(t, r) {
|
|
9806
9806
|
let i = md(r), s, o = e[cr(i, r)];
|
|
@@ -9823,12 +9823,12 @@ function jo(n) {
|
|
|
9823
9823
|
};
|
|
9824
9824
|
}
|
|
9825
9825
|
const ei = (n, e) => n.selection.empty ? !1 : (e && e(n.tr.deleteSelection().scrollIntoView()), !0);
|
|
9826
|
-
function
|
|
9826
|
+
function Jo(n, e) {
|
|
9827
9827
|
let { $cursor: t } = n.selection;
|
|
9828
9828
|
return !t || (e ? !e.endOfTextblock("backward", n) : t.parentOffset > 0) ? null : t;
|
|
9829
9829
|
}
|
|
9830
|
-
const
|
|
9831
|
-
let r =
|
|
9830
|
+
const Uo = (n, e, t) => {
|
|
9831
|
+
let r = Jo(n, t);
|
|
9832
9832
|
if (!r)
|
|
9833
9833
|
return !1;
|
|
9834
9834
|
let i = ti(r);
|
|
@@ -9837,7 +9837,7 @@ const Jo = (n, e, t) => {
|
|
|
9837
9837
|
return l == null ? !1 : (e && e(n.tr.lift(o, l).scrollIntoView()), !0);
|
|
9838
9838
|
}
|
|
9839
9839
|
let s = i.nodeBefore;
|
|
9840
|
-
if (
|
|
9840
|
+
if (nl(n, i, e, -1))
|
|
9841
9841
|
return !0;
|
|
9842
9842
|
if (r.parent.content.size == 0 && (Tt(s, "end") || S.isSelectable(s)))
|
|
9843
9843
|
for (let o = r.depth; ; o--) {
|
|
@@ -9854,19 +9854,19 @@ const Jo = (n, e, t) => {
|
|
|
9854
9854
|
}
|
|
9855
9855
|
return s.isAtom && i.depth == r.depth - 1 ? (e && e(n.tr.delete(i.pos - s.nodeSize, i.pos).scrollIntoView()), !0) : !1;
|
|
9856
9856
|
}, Sd = (n, e, t) => {
|
|
9857
|
-
let r =
|
|
9857
|
+
let r = Jo(n, t);
|
|
9858
9858
|
if (!r)
|
|
9859
9859
|
return !1;
|
|
9860
9860
|
let i = ti(r);
|
|
9861
|
-
return i ?
|
|
9861
|
+
return i ? _o(n, i, e) : !1;
|
|
9862
9862
|
}, wd = (n, e, t) => {
|
|
9863
|
-
let r =
|
|
9863
|
+
let r = Xo(n, t);
|
|
9864
9864
|
if (!r)
|
|
9865
9865
|
return !1;
|
|
9866
9866
|
let i = ni(r);
|
|
9867
|
-
return i ?
|
|
9867
|
+
return i ? _o(n, i, e) : !1;
|
|
9868
9868
|
};
|
|
9869
|
-
function
|
|
9869
|
+
function _o(n, e, t) {
|
|
9870
9870
|
let r = e.nodeBefore, i = r, s = e.pos - 1;
|
|
9871
9871
|
for (; !i.isTextblock; s--) {
|
|
9872
9872
|
if (i.type.spec.isolating)
|
|
@@ -9903,7 +9903,7 @@ function Tt(n, e, t = !1) {
|
|
|
9903
9903
|
}
|
|
9904
9904
|
return !1;
|
|
9905
9905
|
}
|
|
9906
|
-
const
|
|
9906
|
+
const Go = (n, e, t) => {
|
|
9907
9907
|
let { $head: r, empty: i } = n.selection, s = r;
|
|
9908
9908
|
if (!i)
|
|
9909
9909
|
return !1;
|
|
@@ -9925,19 +9925,19 @@ function ti(n) {
|
|
|
9925
9925
|
}
|
|
9926
9926
|
return null;
|
|
9927
9927
|
}
|
|
9928
|
-
function
|
|
9928
|
+
function Xo(n, e) {
|
|
9929
9929
|
let { $cursor: t } = n.selection;
|
|
9930
9930
|
return !t || (e ? !e.endOfTextblock("forward", n) : t.parentOffset < t.parent.content.size) ? null : t;
|
|
9931
9931
|
}
|
|
9932
|
-
const
|
|
9933
|
-
let r =
|
|
9932
|
+
const Yo = (n, e, t) => {
|
|
9933
|
+
let r = Xo(n, t);
|
|
9934
9934
|
if (!r)
|
|
9935
9935
|
return !1;
|
|
9936
9936
|
let i = ni(r);
|
|
9937
9937
|
if (!i)
|
|
9938
9938
|
return !1;
|
|
9939
9939
|
let s = i.nodeAfter;
|
|
9940
|
-
if (
|
|
9940
|
+
if (nl(n, i, e, 1))
|
|
9941
9941
|
return !0;
|
|
9942
9942
|
if (r.parent.content.size == 0 && (Tt(s, "start") || S.isSelectable(s))) {
|
|
9943
9943
|
let o = zn(n.doc, r.before(), r.after(), k.empty);
|
|
@@ -9950,7 +9950,7 @@ const Xo = (n, e, t) => {
|
|
|
9950
9950
|
}
|
|
9951
9951
|
}
|
|
9952
9952
|
return s.isAtom && i.depth == r.depth - 1 ? (e && e(n.tr.delete(i.pos, i.pos + s.nodeSize).scrollIntoView()), !0) : !1;
|
|
9953
|
-
},
|
|
9953
|
+
}, Zo = (n, e, t) => {
|
|
9954
9954
|
let { $head: r, empty: i } = n.selection, s = r;
|
|
9955
9955
|
if (!i)
|
|
9956
9956
|
return !1;
|
|
@@ -9998,7 +9998,7 @@ const Md = (n, e) => {
|
|
|
9998
9998
|
}, Td = (n, e) => {
|
|
9999
9999
|
let { $from: t, $to: r } = n.selection, i = t.blockRange(r), s = i && Ot(i);
|
|
10000
10000
|
return s == null ? !1 : (e && e(n.tr.lift(i, s).scrollIntoView()), !0);
|
|
10001
|
-
},
|
|
10001
|
+
}, Qo = (n, e) => {
|
|
10002
10002
|
let { $head: t, $anchor: r } = n.selection;
|
|
10003
10003
|
return !t.parent.type.spec.code || !t.sameParent(r) ? !1 : (e && e(n.tr.insertText(`
|
|
10004
10004
|
`).scrollIntoView()), !0);
|
|
@@ -10023,7 +10023,7 @@ const Od = (n, e) => {
|
|
|
10023
10023
|
a.setSelection(v.near(a.doc.resolve(l), 1)), e(a.scrollIntoView());
|
|
10024
10024
|
}
|
|
10025
10025
|
return !0;
|
|
10026
|
-
},
|
|
10026
|
+
}, el = (n, e) => {
|
|
10027
10027
|
let t = n.selection, { $from: r, $to: i } = t;
|
|
10028
10028
|
if (t instanceof ce || r.parent.inlineContent || i.parent.inlineContent)
|
|
10029
10029
|
return !1;
|
|
@@ -10035,7 +10035,7 @@ const Od = (n, e) => {
|
|
|
10035
10035
|
l.setSelection(w.create(l.doc, o + 1)), e(l.scrollIntoView());
|
|
10036
10036
|
}
|
|
10037
10037
|
return !0;
|
|
10038
|
-
},
|
|
10038
|
+
}, tl = (n, e) => {
|
|
10039
10039
|
let { $cursor: t } = n.selection;
|
|
10040
10040
|
if (!t || t.parent.content.size)
|
|
10041
10041
|
return !1;
|
|
@@ -10084,7 +10084,7 @@ function Nd(n, e, t) {
|
|
|
10084
10084
|
let r = e.nodeBefore, i = e.nodeAfter, s = e.index();
|
|
10085
10085
|
return !r || !i || !r.type.compatibleContent(i.type) ? !1 : !r.content.size && e.parent.canReplace(s - 1, s) ? (t && t(n.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(s, s + 1) || !(i.isTextblock || Ke(n.doc, e.pos)) ? !1 : (t && t(n.tr.join(e.pos).scrollIntoView()), !0);
|
|
10086
10086
|
}
|
|
10087
|
-
function
|
|
10087
|
+
function nl(n, e, t, r) {
|
|
10088
10088
|
let i = e.nodeBefore, s = e.nodeAfter, o, l, a = i.type.spec.isolating || s.type.spec.isolating;
|
|
10089
10089
|
if (!a && Nd(n, e, t))
|
|
10090
10090
|
return !0;
|
|
@@ -10123,7 +10123,7 @@ function tl(n, e, t, r) {
|
|
|
10123
10123
|
}
|
|
10124
10124
|
return !1;
|
|
10125
10125
|
}
|
|
10126
|
-
function
|
|
10126
|
+
function rl(n) {
|
|
10127
10127
|
return function(e, t) {
|
|
10128
10128
|
let r = e.selection, i = n < 0 ? r.$from : r.$to, s = i.depth;
|
|
10129
10129
|
for (; i.node(s).isInline; ) {
|
|
@@ -10134,14 +10134,14 @@ function nl(n) {
|
|
|
10134
10134
|
return i.node(s).isTextblock ? (t && t(e.tr.setSelection(w.create(e.doc, n < 0 ? i.start(s) : i.end(s)))), !0) : !1;
|
|
10135
10135
|
};
|
|
10136
10136
|
}
|
|
10137
|
-
const Dd =
|
|
10137
|
+
const Dd = rl(-1), Id = rl(1);
|
|
10138
10138
|
function Rd(n, e = null) {
|
|
10139
10139
|
return function(t, r) {
|
|
10140
10140
|
let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = o && qr(o, n, e);
|
|
10141
10141
|
return l ? (r && r(t.tr.wrap(o, l).scrollIntoView()), !0) : !1;
|
|
10142
10142
|
};
|
|
10143
10143
|
}
|
|
10144
|
-
function
|
|
10144
|
+
function fs(n, e = null) {
|
|
10145
10145
|
return function(t, r) {
|
|
10146
10146
|
let i = !1;
|
|
10147
10147
|
for (let s = 0; s < t.selection.ranges.length && !i; s++) {
|
|
@@ -10179,9 +10179,9 @@ function ii(...n) {
|
|
|
10179
10179
|
return !1;
|
|
10180
10180
|
};
|
|
10181
10181
|
}
|
|
10182
|
-
ii(ei,
|
|
10183
|
-
ii(ei,
|
|
10184
|
-
ii(
|
|
10182
|
+
ii(ei, Uo, Go);
|
|
10183
|
+
ii(ei, Yo, Zo);
|
|
10184
|
+
ii(Qo, el, tl, Ed);
|
|
10185
10185
|
typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
|
|
10186
10186
|
function Pd(n, e = null) {
|
|
10187
10187
|
return function(t, r) {
|
|
@@ -10387,7 +10387,7 @@ function jn(n) {
|
|
|
10387
10387
|
markExtensions: r
|
|
10388
10388
|
};
|
|
10389
10389
|
}
|
|
10390
|
-
function
|
|
10390
|
+
function il(n) {
|
|
10391
10391
|
const e = [], { nodeExtensions: t, markExtensions: r } = jn(n), i = [...t, ...r], s = {
|
|
10392
10392
|
default: null,
|
|
10393
10393
|
rendered: !0,
|
|
@@ -10479,11 +10479,11 @@ function Pr(n, e) {
|
|
|
10479
10479
|
[t.name]: n.attrs[t.name]
|
|
10480
10480
|
}).reduce((t, r) => q(t, r), {});
|
|
10481
10481
|
}
|
|
10482
|
-
function
|
|
10482
|
+
function sl(n) {
|
|
10483
10483
|
return typeof n == "function";
|
|
10484
10484
|
}
|
|
10485
10485
|
function E(n, e = void 0, ...t) {
|
|
10486
|
-
return
|
|
10486
|
+
return sl(n) ? e ? n.bind(e)(...t) : n(...t) : n;
|
|
10487
10487
|
}
|
|
10488
10488
|
function Wd(n = {}) {
|
|
10489
10489
|
return Object.keys(n).length === 0 && n.constructor === Object;
|
|
@@ -10491,7 +10491,7 @@ function Wd(n = {}) {
|
|
|
10491
10491
|
function qd(n) {
|
|
10492
10492
|
return typeof n != "string" ? n : n.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(n) : n === "true" ? !0 : n === "false" ? !1 : n;
|
|
10493
10493
|
}
|
|
10494
|
-
function
|
|
10494
|
+
function hs(n, e) {
|
|
10495
10495
|
return "style" in n ? n : {
|
|
10496
10496
|
...n,
|
|
10497
10497
|
getAttrs: (t) => {
|
|
@@ -10509,7 +10509,7 @@ function fs(n, e) {
|
|
|
10509
10509
|
}
|
|
10510
10510
|
};
|
|
10511
10511
|
}
|
|
10512
|
-
function
|
|
10512
|
+
function ps(n) {
|
|
10513
10513
|
return Object.fromEntries(
|
|
10514
10514
|
// @ts-ignore
|
|
10515
10515
|
Object.entries(n).filter(([e, t]) => e === "attrs" && Wd(t) ? !1 : t != null)
|
|
@@ -10517,7 +10517,7 @@ function hs(n) {
|
|
|
10517
10517
|
}
|
|
10518
10518
|
function jd(n, e) {
|
|
10519
10519
|
var t;
|
|
10520
|
-
const r =
|
|
10520
|
+
const r = il(n), { nodeExtensions: i, markExtensions: s } = jn(n), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
|
|
10521
10521
|
const d = r.filter((y) => y.type === c.name), u = {
|
|
10522
10522
|
name: c.name,
|
|
10523
10523
|
options: c.options,
|
|
@@ -10529,7 +10529,7 @@ function jd(n, e) {
|
|
|
10529
10529
|
...y,
|
|
10530
10530
|
...M ? M(c) : {}
|
|
10531
10531
|
};
|
|
10532
|
-
}, {}), h =
|
|
10532
|
+
}, {}), h = ps({
|
|
10533
10533
|
...f,
|
|
10534
10534
|
content: E(x(c, "content", u)),
|
|
10535
10535
|
marks: E(x(c, "marks", u)),
|
|
@@ -10548,7 +10548,7 @@ function jd(n, e) {
|
|
|
10548
10548
|
return [y.name, { default: (T = y == null ? void 0 : y.attribute) === null || T === void 0 ? void 0 : T.default }];
|
|
10549
10549
|
}))
|
|
10550
10550
|
}), p = E(x(c, "parseHTML", u));
|
|
10551
|
-
p && (h.parseDOM = p.map((y) =>
|
|
10551
|
+
p && (h.parseDOM = p.map((y) => hs(y, d)));
|
|
10552
10552
|
const m = x(c, "renderHTML", u);
|
|
10553
10553
|
m && (h.toDOM = (y) => m({
|
|
10554
10554
|
node: y,
|
|
@@ -10568,7 +10568,7 @@ function jd(n, e) {
|
|
|
10568
10568
|
...g,
|
|
10569
10569
|
...T ? T(c) : {}
|
|
10570
10570
|
};
|
|
10571
|
-
}, {}), h =
|
|
10571
|
+
}, {}), h = ps({
|
|
10572
10572
|
...f,
|
|
10573
10573
|
inclusive: E(x(c, "inclusive", u)),
|
|
10574
10574
|
excludes: E(x(c, "excludes", u)),
|
|
@@ -10580,14 +10580,14 @@ function jd(n, e) {
|
|
|
10580
10580
|
return [g.name, { default: (y = g == null ? void 0 : g.attribute) === null || y === void 0 ? void 0 : y.default }];
|
|
10581
10581
|
}))
|
|
10582
10582
|
}), p = E(x(c, "parseHTML", u));
|
|
10583
|
-
p && (h.parseDOM = p.map((g) =>
|
|
10583
|
+
p && (h.parseDOM = p.map((g) => hs(g, d)));
|
|
10584
10584
|
const m = x(c, "renderHTML", u);
|
|
10585
10585
|
return m && (h.toDOM = (g) => m({
|
|
10586
10586
|
mark: g,
|
|
10587
10587
|
HTMLAttributes: Pr(g, d)
|
|
10588
10588
|
})), [c.name, h];
|
|
10589
10589
|
}));
|
|
10590
|
-
return new
|
|
10590
|
+
return new Ks({
|
|
10591
10591
|
topNode: o,
|
|
10592
10592
|
nodes: l,
|
|
10593
10593
|
marks: a
|
|
@@ -10596,7 +10596,7 @@ function jd(n, e) {
|
|
|
10596
10596
|
function dr(n, e) {
|
|
10597
10597
|
return e.nodes[n] || e.marks[n] || null;
|
|
10598
10598
|
}
|
|
10599
|
-
function
|
|
10599
|
+
function ms(n, e) {
|
|
10600
10600
|
return Array.isArray(e) ? e.some((t) => (typeof t == "string" ? t : t.name) === n.name) : e;
|
|
10601
10601
|
}
|
|
10602
10602
|
function si(n, e) {
|
|
@@ -11038,9 +11038,9 @@ class yt {
|
|
|
11038
11038
|
const u = xd(d);
|
|
11039
11039
|
a.push(u);
|
|
11040
11040
|
const f = x(o, "addInputRules", l);
|
|
11041
|
-
|
|
11041
|
+
ms(o, e.options.enableInputRules) && f && r.push(...f());
|
|
11042
11042
|
const h = x(o, "addPasteRules", l);
|
|
11043
|
-
|
|
11043
|
+
ms(o, e.options.enablePasteRules) && h && i.push(...h());
|
|
11044
11044
|
const p = x(o, "addProseMirrorPlugins", l);
|
|
11045
11045
|
if (p) {
|
|
11046
11046
|
const m = p();
|
|
@@ -11065,7 +11065,7 @@ class yt {
|
|
|
11065
11065
|
* @returns An array of attributes
|
|
11066
11066
|
*/
|
|
11067
11067
|
get attributes() {
|
|
11068
|
-
return
|
|
11068
|
+
return il(this.extensions);
|
|
11069
11069
|
}
|
|
11070
11070
|
/**
|
|
11071
11071
|
* Get all node views from the extensions.
|
|
@@ -11157,7 +11157,7 @@ class G {
|
|
|
11157
11157
|
})), t;
|
|
11158
11158
|
}
|
|
11159
11159
|
}
|
|
11160
|
-
function
|
|
11160
|
+
function ol(n, e, t) {
|
|
11161
11161
|
const { from: r, to: i } = e, { blockSeparator: s = `
|
|
11162
11162
|
|
|
11163
11163
|
`, textSerializers: o = {} } = t || {};
|
|
@@ -11177,7 +11177,7 @@ function sl(n, e, t) {
|
|
|
11177
11177
|
a.isText && (l += (f = a == null ? void 0 : a.text) === null || f === void 0 ? void 0 : f.slice(Math.max(r, c) - c, i - c));
|
|
11178
11178
|
}), l;
|
|
11179
11179
|
}
|
|
11180
|
-
function
|
|
11180
|
+
function ll(n) {
|
|
11181
11181
|
return Object.fromEntries(Object.entries(n.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText]));
|
|
11182
11182
|
}
|
|
11183
11183
|
const nu = G.create({
|
|
@@ -11193,8 +11193,8 @@ const nu = G.create({
|
|
|
11193
11193
|
key: new Ce("clipboardTextSerializer"),
|
|
11194
11194
|
props: {
|
|
11195
11195
|
clipboardTextSerializer: () => {
|
|
11196
|
-
const { editor: n } = this, { state: e, schema: t } = n, { doc: r, selection: i } = e, { ranges: s } = i, o = Math.min(...s.map((d) => d.$from.pos)), l = Math.max(...s.map((d) => d.$to.pos)), a =
|
|
11197
|
-
return
|
|
11196
|
+
const { editor: n } = this, { state: e, schema: t } = n, { doc: r, selection: i } = e, { ranges: s } = i, o = Math.min(...s.map((d) => d.$from.pos)), l = Math.max(...s.map((d) => d.$to.pos)), a = ll(t);
|
|
11197
|
+
return ol(r, { from: o, to: l }, {
|
|
11198
11198
|
...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
|
|
11199
11199
|
textSerializers: a
|
|
11200
11200
|
});
|
|
@@ -11223,7 +11223,7 @@ const nu = G.create({
|
|
|
11223
11223
|
(p || p === 0) && e.lift(h, p);
|
|
11224
11224
|
});
|
|
11225
11225
|
}), !0;
|
|
11226
|
-
}, ou = (n) => (e) => n(e), lu = () => ({ state: n, dispatch: e }) =>
|
|
11226
|
+
}, ou = (n) => (e) => n(e), lu = () => ({ state: n, dispatch: e }) => el(n, e), au = (n, e) => ({ editor: t, tr: r }) => {
|
|
11227
11227
|
const { state: i } = t, s = i.doc.slice(n.from, n.to);
|
|
11228
11228
|
r.deleteRange(n.from, n.to);
|
|
11229
11229
|
const o = r.mapping.map(e);
|
|
@@ -11261,27 +11261,27 @@ function En(n, e, t = { strict: !0 }) {
|
|
|
11261
11261
|
const r = Object.keys(e);
|
|
11262
11262
|
return r.length ? r.every((i) => t.strict ? e[i] === n[i] : oi(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
|
|
11263
11263
|
}
|
|
11264
|
-
function
|
|
11264
|
+
function al(n, e, t = {}) {
|
|
11265
11265
|
return n.find((r) => r.type === e && En(
|
|
11266
11266
|
// Only check equality for the attributes that are provided
|
|
11267
11267
|
Object.fromEntries(Object.keys(t).map((i) => [i, r.attrs[i]])),
|
|
11268
11268
|
t
|
|
11269
11269
|
));
|
|
11270
11270
|
}
|
|
11271
|
-
function
|
|
11272
|
-
return !!
|
|
11271
|
+
function gs(n, e, t = {}) {
|
|
11272
|
+
return !!al(n, e, t);
|
|
11273
11273
|
}
|
|
11274
11274
|
function li(n, e, t) {
|
|
11275
11275
|
var r;
|
|
11276
11276
|
if (!n || !e)
|
|
11277
11277
|
return;
|
|
11278
11278
|
let i = n.parent.childAfter(n.parentOffset);
|
|
11279
|
-
if ((!i.node || !i.node.marks.some((d) => d.type === e)) && (i = n.parent.childBefore(n.parentOffset)), !i.node || !i.node.marks.some((d) => d.type === e) || (t = t || ((r = i.node.marks[0]) === null || r === void 0 ? void 0 : r.attrs), !
|
|
11279
|
+
if ((!i.node || !i.node.marks.some((d) => d.type === e)) && (i = n.parent.childBefore(n.parentOffset)), !i.node || !i.node.marks.some((d) => d.type === e) || (t = t || ((r = i.node.marks[0]) === null || r === void 0 ? void 0 : r.attrs), !al([...i.node.marks], e, t)))
|
|
11280
11280
|
return;
|
|
11281
11281
|
let o = i.index, l = n.start() + i.offset, a = o + 1, c = l + i.node.nodeSize;
|
|
11282
|
-
for (; o > 0 &&
|
|
11282
|
+
for (; o > 0 && gs([...n.parent.child(o - 1).marks], e, t); )
|
|
11283
11283
|
o -= 1, l -= n.parent.child(o).nodeSize;
|
|
11284
|
-
for (; a < n.parent.childCount &&
|
|
11284
|
+
for (; a < n.parent.childCount && gs([...n.parent.child(a).marks], e, t); )
|
|
11285
11285
|
c += n.parent.child(a).nodeSize, a += 1;
|
|
11286
11286
|
return {
|
|
11287
11287
|
from: l,
|
|
@@ -11313,13 +11313,13 @@ const mu = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11313
11313
|
return !0;
|
|
11314
11314
|
return !1;
|
|
11315
11315
|
};
|
|
11316
|
-
function
|
|
11316
|
+
function cl(n) {
|
|
11317
11317
|
return n instanceof w;
|
|
11318
11318
|
}
|
|
11319
11319
|
function Ze(n = 0, e = 0, t = 0) {
|
|
11320
11320
|
return Math.min(Math.max(n, e), t);
|
|
11321
11321
|
}
|
|
11322
|
-
function
|
|
11322
|
+
function dl(n, e = null) {
|
|
11323
11323
|
if (!e)
|
|
11324
11324
|
return null;
|
|
11325
11325
|
const t = v.atStart(n), r = v.atEnd(n);
|
|
@@ -11330,7 +11330,7 @@ function cl(n, e = null) {
|
|
|
11330
11330
|
const i = t.from, s = r.to;
|
|
11331
11331
|
return e === "all" ? w.create(n, Ze(0, i, s), Ze(n.content.size, i, s)) : w.create(n, Ze(e, i, s), Ze(e, i, s));
|
|
11332
11332
|
}
|
|
11333
|
-
function
|
|
11333
|
+
function ys() {
|
|
11334
11334
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
11335
11335
|
}
|
|
11336
11336
|
function An() {
|
|
@@ -11352,27 +11352,27 @@ const bu = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
|
|
|
11352
11352
|
...e
|
|
11353
11353
|
};
|
|
11354
11354
|
const o = () => {
|
|
11355
|
-
(An() ||
|
|
11356
|
-
t.isDestroyed || (r.focus(), yu() && !An() && !
|
|
11355
|
+
(An() || ys()) && r.dom.focus(), requestAnimationFrame(() => {
|
|
11356
|
+
t.isDestroyed || (r.focus(), yu() && !An() && !ys() && r.dom.focus({ preventScroll: !0 }));
|
|
11357
11357
|
});
|
|
11358
11358
|
};
|
|
11359
11359
|
if (r.hasFocus() && n === null || n === !1)
|
|
11360
11360
|
return !0;
|
|
11361
|
-
if (s && n === null && !
|
|
11361
|
+
if (s && n === null && !cl(t.state.selection))
|
|
11362
11362
|
return o(), !0;
|
|
11363
|
-
const l =
|
|
11363
|
+
const l = dl(i.doc, n) || t.state.selection, a = t.state.selection.eq(l);
|
|
11364
11364
|
return s && (a || i.setSelection(l), a && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
|
|
11365
|
-
}, ku = (n, e) => (t) => n.every((r, i) => e(r, { ...t, index: i })), xu = (n, e) => ({ tr: t, commands: r }) => r.insertContentAt({ from: t.selection.from, to: t.selection.to }, n, e),
|
|
11365
|
+
}, ku = (n, e) => (t) => n.every((r, i) => e(r, { ...t, index: i })), xu = (n, e) => ({ tr: t, commands: r }) => r.insertContentAt({ from: t.selection.from, to: t.selection.to }, n, e), ul = (n) => {
|
|
11366
11366
|
const e = n.childNodes;
|
|
11367
11367
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
11368
11368
|
const r = e[t];
|
|
11369
|
-
r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? n.removeChild(r) : r.nodeType === 1 &&
|
|
11369
|
+
r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? n.removeChild(r) : r.nodeType === 1 && ul(r);
|
|
11370
11370
|
}
|
|
11371
11371
|
return n;
|
|
11372
11372
|
};
|
|
11373
11373
|
function un(n) {
|
|
11374
11374
|
const e = `<body>${n}</body>`, t = new window.DOMParser().parseFromString(e, "text/html").body;
|
|
11375
|
-
return
|
|
11375
|
+
return ul(t);
|
|
11376
11376
|
}
|
|
11377
11377
|
function Kt(n, e, t) {
|
|
11378
11378
|
if (n instanceof $e || n instanceof b)
|
|
@@ -11397,7 +11397,7 @@ function Kt(n, e, t) {
|
|
|
11397
11397
|
if (i) {
|
|
11398
11398
|
if (t.errorOnInvalidContent) {
|
|
11399
11399
|
let o = !1, l = "";
|
|
11400
|
-
const a = new
|
|
11400
|
+
const a = new Ks({
|
|
11401
11401
|
topNode: e.spec.topNode,
|
|
11402
11402
|
marks: e.spec.marks,
|
|
11403
11403
|
// Prosemirror's schemas are executed such that: the last to execute, matches last
|
|
@@ -11499,7 +11499,7 @@ const wu = (n) => !("type" in n), Mu = (n, e, t) => ({ tr: r, dispatch: i, edito
|
|
|
11499
11499
|
t.updateSelection && Su(r, r.steps.length - 1, -1), t.applyInputRules && r.setMeta("applyInputRules", { from: d, text: m }), t.applyPasteRules && r.setMeta("applyPasteRules", { from: d, text: m });
|
|
11500
11500
|
}
|
|
11501
11501
|
return !0;
|
|
11502
|
-
}, Cu = () => ({ state: n, dispatch: e }) => Md(n, e), Tu = () => ({ state: n, dispatch: e }) => Cd(n, e), Ou = () => ({ state: n, dispatch: e }) =>
|
|
11502
|
+
}, Cu = () => ({ state: n, dispatch: e }) => Md(n, e), Tu = () => ({ state: n, dispatch: e }) => Cd(n, e), Ou = () => ({ state: n, dispatch: e }) => Uo(n, e), vu = () => ({ state: n, dispatch: e }) => Yo(n, e), Eu = () => ({ state: n, dispatch: e, tr: t }) => {
|
|
11503
11503
|
try {
|
|
11504
11504
|
const r = Ln(n.doc, n.selection.$from.pos, -1);
|
|
11505
11505
|
return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
|
|
@@ -11514,7 +11514,7 @@ const wu = (n) => !("type" in n), Mu = (n, e, t) => ({ tr: r, dispatch: i, edito
|
|
|
11514
11514
|
return !1;
|
|
11515
11515
|
}
|
|
11516
11516
|
}, Nu = () => ({ state: n, dispatch: e }) => Sd(n, e), Du = () => ({ state: n, dispatch: e }) => wd(n, e);
|
|
11517
|
-
function
|
|
11517
|
+
function fl() {
|
|
11518
11518
|
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
|
|
11519
11519
|
}
|
|
11520
11520
|
function Iu(n) {
|
|
@@ -11533,7 +11533,7 @@ function Iu(n) {
|
|
|
11533
11533
|
else if (/^s(hift)?$/i.test(a))
|
|
11534
11534
|
s = !0;
|
|
11535
11535
|
else if (/^mod$/i.test(a))
|
|
11536
|
-
An() ||
|
|
11536
|
+
An() || fl() ? o = !0 : i = !0;
|
|
11537
11537
|
else
|
|
11538
11538
|
throw new Error(`Unrecognized modifier name: ${a}`);
|
|
11539
11539
|
}
|
|
@@ -11574,14 +11574,14 @@ function Jt(n, e, t = {}) {
|
|
|
11574
11574
|
const Pu = (n, e = {}) => ({ state: t, dispatch: r }) => {
|
|
11575
11575
|
const i = W(n, t.schema);
|
|
11576
11576
|
return Jt(t, i, e) ? Td(t, r) : !1;
|
|
11577
|
-
}, Bu = () => ({ state: n, dispatch: e }) =>
|
|
11577
|
+
}, Bu = () => ({ state: n, dispatch: e }) => tl(n, e), Lu = (n) => ({ state: e, dispatch: t }) => {
|
|
11578
11578
|
const r = W(n, e.schema);
|
|
11579
11579
|
return zd(r)(e, t);
|
|
11580
|
-
}, zu = () => ({ state: n, dispatch: e }) =>
|
|
11580
|
+
}, zu = () => ({ state: n, dispatch: e }) => Qo(n, e);
|
|
11581
11581
|
function Un(n, e) {
|
|
11582
11582
|
return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
|
|
11583
11583
|
}
|
|
11584
|
-
function
|
|
11584
|
+
function bs(n, e) {
|
|
11585
11585
|
const t = typeof e == "string" ? [e] : e;
|
|
11586
11586
|
return Object.keys(n).reduce((r, i) => (t.includes(i) || (r[i] = n[i]), r), {});
|
|
11587
11587
|
}
|
|
@@ -11590,8 +11590,8 @@ const Fu = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11590
11590
|
const l = Un(typeof n == "string" ? n : n.name, r.schema);
|
|
11591
11591
|
return l ? (l === "node" && (s = W(n, r.schema)), l === "mark" && (o = Ue(n, r.schema)), i && t.selection.ranges.forEach((a) => {
|
|
11592
11592
|
r.doc.nodesBetween(a.$from.pos, a.$to.pos, (c, d) => {
|
|
11593
|
-
s && s === c.type && t.setNodeMarkup(d, void 0,
|
|
11594
|
-
o === u.type && t.addMark(d, d + c.nodeSize, o.create(
|
|
11593
|
+
s && s === c.type && t.setNodeMarkup(d, void 0, bs(c.attrs, e)), o && c.marks.length && c.marks.forEach((u) => {
|
|
11594
|
+
o === u.type && t.addMark(d, d + c.nodeSize, o.create(bs(u.attrs, e)));
|
|
11595
11595
|
});
|
|
11596
11596
|
});
|
|
11597
11597
|
}), !0) : !1;
|
|
@@ -11601,7 +11601,7 @@ const Fu = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11601
11601
|
n.setSelection(t);
|
|
11602
11602
|
}
|
|
11603
11603
|
return !0;
|
|
11604
|
-
}, Hu = () => ({ state: n, dispatch: e }) =>
|
|
11604
|
+
}, Hu = () => ({ state: n, dispatch: e }) => Go(n, e), Wu = () => ({ state: n, dispatch: e }) => Zo(n, e), qu = () => ({ state: n, dispatch: e }) => Ad(n, e), ju = () => ({ state: n, dispatch: e }) => Id(n, e), Ku = () => ({ state: n, dispatch: e }) => Dd(n, e);
|
|
11605
11605
|
function Br(n, e, t = {}, r = {}) {
|
|
11606
11606
|
return Kt(n, e, {
|
|
11607
11607
|
slice: !1,
|
|
@@ -11623,7 +11623,7 @@ const Ju = (n, e = !1, t = {}, r = {}) => ({ editor: i, tr: s, dispatch: o, comm
|
|
|
11623
11623
|
errorOnInvalidContent: (c = r.errorOnInvalidContent) !== null && c !== void 0 ? c : i.options.enableContentCheck
|
|
11624
11624
|
});
|
|
11625
11625
|
};
|
|
11626
|
-
function
|
|
11626
|
+
function hl(n, e) {
|
|
11627
11627
|
const t = Ue(e, n.schema), { from: r, to: i, empty: s } = n.selection, o = [];
|
|
11628
11628
|
s ? (n.storedMarks && o.push(...n.storedMarks), o.push(...n.selection.$head.marks())) : n.doc.nodesBetween(r, i, (a) => {
|
|
11629
11629
|
o.push(...a.marks);
|
|
@@ -11659,7 +11659,7 @@ function Gu(n, e) {
|
|
|
11659
11659
|
from: 0,
|
|
11660
11660
|
to: n.content.size
|
|
11661
11661
|
};
|
|
11662
|
-
return
|
|
11662
|
+
return ol(n, t, e);
|
|
11663
11663
|
}
|
|
11664
11664
|
function Xu(n, e) {
|
|
11665
11665
|
const t = W(e, n.schema), { from: r, to: i } = n.selection, s = [];
|
|
@@ -11671,9 +11671,9 @@ function Xu(n, e) {
|
|
|
11671
11671
|
}
|
|
11672
11672
|
function Yu(n, e) {
|
|
11673
11673
|
const t = Un(typeof e == "string" ? e : e.name, n.schema);
|
|
11674
|
-
return t === "node" ? Xu(n, e) : t === "mark" ?
|
|
11674
|
+
return t === "node" ? Xu(n, e) : t === "mark" ? hl(n, e) : {};
|
|
11675
11675
|
}
|
|
11676
|
-
function
|
|
11676
|
+
function pl(n, e, t) {
|
|
11677
11677
|
const r = [];
|
|
11678
11678
|
return n === e ? t.resolve(n).marks().forEach((i) => {
|
|
11679
11679
|
const s = t.resolve(n), o = li(s, i.type);
|
|
@@ -11724,7 +11724,7 @@ function Zu(n, e, t = {}) {
|
|
|
11724
11724
|
const r = Un(e, n.schema);
|
|
11725
11725
|
return r === "node" ? Jt(n, e, t) : r === "mark" ? Lr(n, e, t) : !1;
|
|
11726
11726
|
}
|
|
11727
|
-
function
|
|
11727
|
+
function ks(n, e) {
|
|
11728
11728
|
const { nodeExtensions: t } = jn(e), r = t.find((o) => o.name === n);
|
|
11729
11729
|
if (!r)
|
|
11730
11730
|
return !1;
|
|
@@ -11764,7 +11764,7 @@ function ef(n, e, t) {
|
|
|
11764
11764
|
var r;
|
|
11765
11765
|
const { selection: i } = e;
|
|
11766
11766
|
let s = null;
|
|
11767
|
-
if (
|
|
11767
|
+
if (cl(i) && (s = i.$cursor), s) {
|
|
11768
11768
|
const l = (r = n.storedMarks) !== null && r !== void 0 ? r : s.marks();
|
|
11769
11769
|
return !!t.isInSet(l) || !l.some((a) => a.type.excludes(t));
|
|
11770
11770
|
}
|
|
@@ -11786,7 +11786,7 @@ const tf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11786
11786
|
const { selection: s } = t, { empty: o, ranges: l } = s, a = Ue(n, r.schema);
|
|
11787
11787
|
if (i)
|
|
11788
11788
|
if (o) {
|
|
11789
|
-
const c =
|
|
11789
|
+
const c = hl(r, a);
|
|
11790
11790
|
t.addStoredMark(a.create({
|
|
11791
11791
|
...c,
|
|
11792
11792
|
...e
|
|
@@ -11808,7 +11808,7 @@ const tf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11808
11808
|
}, nf = (n, e) => ({ tr: t }) => (t.setMeta(n, e), !0), rf = (n, e = {}) => ({ state: t, dispatch: r, chain: i }) => {
|
|
11809
11809
|
const s = W(n, t.schema);
|
|
11810
11810
|
let o;
|
|
11811
|
-
return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) =>
|
|
11811
|
+
return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) => fs(s, { ...o, ...e })(t) ? !0 : l.clearNodes()).command(({ state: l }) => fs(s, { ...o, ...e })(l, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
|
|
11812
11812
|
}, sf = (n) => ({ tr: e, dispatch: t }) => {
|
|
11813
11813
|
if (t) {
|
|
11814
11814
|
const { doc: r } = e, i = Ze(n, 0, r.content.size), s = S.create(r, i);
|
|
@@ -11825,7 +11825,7 @@ const tf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11825
11825
|
const r = W(n, e.schema);
|
|
11826
11826
|
return Vd(r)(e, t);
|
|
11827
11827
|
};
|
|
11828
|
-
function
|
|
11828
|
+
function xs(n, e) {
|
|
11829
11829
|
const t = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
|
|
11830
11830
|
if (t) {
|
|
11831
11831
|
const r = t.filter((i) => e == null ? void 0 : e.includes(i.type.name));
|
|
@@ -11835,7 +11835,7 @@ function ks(n, e) {
|
|
|
11835
11835
|
const af = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
|
|
11836
11836
|
const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, d = mn(c, l.node().type.name, l.node().attrs);
|
|
11837
11837
|
if (s instanceof S && s.node.isBlock)
|
|
11838
|
-
return !l.parentOffset || !Ne(o, l.pos) ? !1 : (r && (n &&
|
|
11838
|
+
return !l.parentOffset || !Ne(o, l.pos) ? !1 : (r && (n && xs(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
|
|
11839
11839
|
if (!l.parent.isBlock)
|
|
11840
11840
|
return !1;
|
|
11841
11841
|
const u = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : Uu(l.node(-1).contentMatchAt(l.indexAfter(-1)));
|
|
@@ -11855,7 +11855,7 @@ const af = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11855
11855
|
const m = e.mapping.map(l.before()), g = e.doc.resolve(m);
|
|
11856
11856
|
l.node(-1).canReplaceWith(g.index(), g.index() + 1, f) && e.setNodeMarkup(e.mapping.map(l.before()), f);
|
|
11857
11857
|
}
|
|
11858
|
-
n &&
|
|
11858
|
+
n && xs(t, i.extensionManager.splittableMarks), e.scrollIntoView();
|
|
11859
11859
|
}
|
|
11860
11860
|
return p;
|
|
11861
11861
|
}, cf = (n, e = {}) => ({ tr: t, state: r, dispatch: i, editor: s }) => {
|
|
@@ -11935,11 +11935,11 @@ const af = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11935
11935
|
const { extensions: u, splittableMarks: f } = i.extensionManager, h = W(n, o.schema), p = W(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: T } = m, M = y.blockRange(T), I = g || m.$to.parentOffset && m.$from.marks();
|
|
11936
11936
|
if (!M)
|
|
11937
11937
|
return !1;
|
|
11938
|
-
const D = ai((F) =>
|
|
11938
|
+
const D = ai((F) => ks(F.type.name, u))(m);
|
|
11939
11939
|
if (M.depth >= 1 && D && M.depth - D.depth <= 1) {
|
|
11940
11940
|
if (D.node.type === h)
|
|
11941
11941
|
return c.liftListItem(p);
|
|
11942
|
-
if (
|
|
11942
|
+
if (ks(D.node.type.name, u) && h.validContent(D.node.content) && l)
|
|
11943
11943
|
return a().command(() => (s.setNodeMarkup(D.pos, h), !0)).command(() => ur(s, h)).command(() => fr(s, h)).run();
|
|
11944
11944
|
}
|
|
11945
11945
|
return !t || !I || !l ? a().command(() => d().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => ur(s, h)).command(() => fr(s, h)).run() : a().command(() => {
|
|
@@ -12201,7 +12201,7 @@ const Sf = G.create({
|
|
|
12201
12201
|
"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
|
|
12202
12202
|
"Ctrl-e": () => this.editor.commands.selectTextblockEnd()
|
|
12203
12203
|
};
|
|
12204
|
-
return An() ||
|
|
12204
|
+
return An() || fl() ? s : i;
|
|
12205
12205
|
},
|
|
12206
12206
|
addProseMirrorPlugins() {
|
|
12207
12207
|
return [
|
|
@@ -12575,7 +12575,7 @@ class Df extends Hd {
|
|
|
12575
12575
|
* @returns The new editor state
|
|
12576
12576
|
*/
|
|
12577
12577
|
registerPlugin(e, t) {
|
|
12578
|
-
const r =
|
|
12578
|
+
const r = sl(t) ? t(e, [...this.state.plugins]) : [...this.state.plugins, e], i = this.state.reconfigure({ plugins: r });
|
|
12579
12579
|
return this.view.updateState(i), i;
|
|
12580
12580
|
}
|
|
12581
12581
|
/**
|
|
@@ -12651,8 +12651,8 @@ class Df extends Hd {
|
|
|
12651
12651
|
}
|
|
12652
12652
|
}), t = Br(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
|
|
12653
12653
|
}
|
|
12654
|
-
const r =
|
|
12655
|
-
this.view = new
|
|
12654
|
+
const r = dl(t, this.options.autofocus);
|
|
12655
|
+
this.view = new jo(this.options.element, {
|
|
12656
12656
|
...this.options.editorProps,
|
|
12657
12657
|
attributes: {
|
|
12658
12658
|
// add `role="textbox"` to the editor element
|
|
@@ -12768,7 +12768,7 @@ class Df extends Hd {
|
|
|
12768
12768
|
return Gu(this.state.doc, {
|
|
12769
12769
|
blockSeparator: t,
|
|
12770
12770
|
textSerializers: {
|
|
12771
|
-
...
|
|
12771
|
+
...ll(this.schema),
|
|
12772
12772
|
...r
|
|
12773
12773
|
}
|
|
12774
12774
|
});
|
|
@@ -12830,7 +12830,7 @@ function ct(n) {
|
|
|
12830
12830
|
const { tr: s } = e, o = r[r.length - 1], l = r[0];
|
|
12831
12831
|
if (o) {
|
|
12832
12832
|
const a = l.search(/\S/), c = t.from + l.indexOf(o), d = c + o.length;
|
|
12833
|
-
if (
|
|
12833
|
+
if (pl(t.from, t.to, e.doc).filter((h) => h.mark.type.excluded.find((m) => m === n.type && m !== h.mark.type)).filter((h) => h.to > c).length)
|
|
12834
12834
|
return null;
|
|
12835
12835
|
d < t.to && s.delete(d, t.to), c > t.from && s.delete(t.from + a, c);
|
|
12836
12836
|
const f = t.from + a + o.length;
|
|
@@ -12839,7 +12839,7 @@ function ct(n) {
|
|
|
12839
12839
|
}
|
|
12840
12840
|
});
|
|
12841
12841
|
}
|
|
12842
|
-
function
|
|
12842
|
+
function ml(n) {
|
|
12843
12843
|
return new Kn({
|
|
12844
12844
|
find: n.find,
|
|
12845
12845
|
handler: ({ state: e, range: t, match: r }) => {
|
|
@@ -12940,7 +12940,7 @@ function dt(n) {
|
|
|
12940
12940
|
let c = t.to;
|
|
12941
12941
|
if (l) {
|
|
12942
12942
|
const d = a.search(/\S/), u = t.from + a.indexOf(l), f = u + l.length;
|
|
12943
|
-
if (
|
|
12943
|
+
if (pl(t.from, t.to, e.doc).filter((p) => p.mark.type.excluded.find((g) => g === n.type && g !== p.mark.type)).filter((p) => p.to > u).length)
|
|
12944
12944
|
return null;
|
|
12945
12945
|
f < t.to && o.delete(f, t.to), u > t.from && o.delete(t.from + d, u), c = t.from + d + l.length, o.addMark(t.from + d, c, n.type.create(s || {})), o.removeStoredMark(n.type);
|
|
12946
12946
|
}
|
|
@@ -13066,7 +13066,7 @@ const Rf = /^\s*>\s$/, Pf = re.create({
|
|
|
13066
13066
|
})
|
|
13067
13067
|
];
|
|
13068
13068
|
}
|
|
13069
|
-
}), Vf = "listItem",
|
|
13069
|
+
}), Vf = "listItem", Ss = "textStyle", ws = /^\s*([-+*])\s$/, Hf = re.create({
|
|
13070
13070
|
name: "bulletList",
|
|
13071
13071
|
addOptions() {
|
|
13072
13072
|
return {
|
|
@@ -13090,7 +13090,7 @@ const Rf = /^\s*>\s$/, Pf = re.create({
|
|
|
13090
13090
|
},
|
|
13091
13091
|
addCommands() {
|
|
13092
13092
|
return {
|
|
13093
|
-
toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Vf, this.editor.getAttributes(
|
|
13093
|
+
toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Vf, this.editor.getAttributes(Ss)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
13094
13094
|
};
|
|
13095
13095
|
},
|
|
13096
13096
|
addKeyboardShortcuts() {
|
|
@@ -13100,15 +13100,15 @@ const Rf = /^\s*>\s$/, Pf = re.create({
|
|
|
13100
13100
|
},
|
|
13101
13101
|
addInputRules() {
|
|
13102
13102
|
let n = Ut({
|
|
13103
|
-
find:
|
|
13103
|
+
find: ws,
|
|
13104
13104
|
type: this.type
|
|
13105
13105
|
});
|
|
13106
13106
|
return (this.options.keepMarks || this.options.keepAttributes) && (n = Ut({
|
|
13107
|
-
find:
|
|
13107
|
+
find: ws,
|
|
13108
13108
|
type: this.type,
|
|
13109
13109
|
keepMarks: this.options.keepMarks,
|
|
13110
13110
|
keepAttributes: this.options.keepAttributes,
|
|
13111
|
-
getAttributes: () => this.editor.getAttributes(
|
|
13111
|
+
getAttributes: () => this.editor.getAttributes(Ss),
|
|
13112
13112
|
editor: this.editor
|
|
13113
13113
|
})), [
|
|
13114
13114
|
n
|
|
@@ -13357,7 +13357,7 @@ class Xf {
|
|
|
13357
13357
|
if (t && !s) {
|
|
13358
13358
|
let o = t.pos;
|
|
13359
13359
|
if (this.editorView.dragging && this.editorView.dragging.slice) {
|
|
13360
|
-
let l =
|
|
13360
|
+
let l = no(this.editorView.state.doc, o, this.editorView.dragging.slice);
|
|
13361
13361
|
l != null && (o = l);
|
|
13362
13362
|
}
|
|
13363
13363
|
this.setCursor(o), this.scheduleRemoval(5e3);
|
|
@@ -13488,7 +13488,7 @@ class di {
|
|
|
13488
13488
|
return P.valid(t) ? new P(t) : v.near(t);
|
|
13489
13489
|
}
|
|
13490
13490
|
}
|
|
13491
|
-
function
|
|
13491
|
+
function gl(n) {
|
|
13492
13492
|
return n.isAtom || n.spec.isolating || n.spec.createGapCursor;
|
|
13493
13493
|
}
|
|
13494
13494
|
function Zf(n) {
|
|
@@ -13500,7 +13500,7 @@ function Zf(n) {
|
|
|
13500
13500
|
continue;
|
|
13501
13501
|
}
|
|
13502
13502
|
for (let i = r.child(t - 1); ; i = i.lastChild) {
|
|
13503
|
-
if (i.childCount == 0 && !i.inlineContent ||
|
|
13503
|
+
if (i.childCount == 0 && !i.inlineContent || gl(i.type))
|
|
13504
13504
|
return !0;
|
|
13505
13505
|
if (i.inlineContent)
|
|
13506
13506
|
return !1;
|
|
@@ -13517,7 +13517,7 @@ function Qf(n) {
|
|
|
13517
13517
|
continue;
|
|
13518
13518
|
}
|
|
13519
13519
|
for (let i = r.child(t); ; i = i.firstChild) {
|
|
13520
|
-
if (i.childCount == 0 && !i.inlineContent ||
|
|
13520
|
+
if (i.childCount == 0 && !i.inlineContent || gl(i.type))
|
|
13521
13521
|
return !0;
|
|
13522
13522
|
if (i.inlineContent)
|
|
13523
13523
|
return !1;
|
|
@@ -13538,7 +13538,7 @@ function eh() {
|
|
|
13538
13538
|
}
|
|
13539
13539
|
});
|
|
13540
13540
|
}
|
|
13541
|
-
const th =
|
|
13541
|
+
const th = Ko({
|
|
13542
13542
|
ArrowLeft: fn("horiz", -1),
|
|
13543
13543
|
ArrowRight: fn("horiz", 1),
|
|
13544
13544
|
ArrowUp: fn("vert", -1),
|
|
@@ -13731,9 +13731,9 @@ H.prototype.map = function(e, t, r) {
|
|
|
13731
13731
|
}, t, r), i;
|
|
13732
13732
|
};
|
|
13733
13733
|
H.from = function(e) {
|
|
13734
|
-
return e instanceof H ? e : e && e.length ? new
|
|
13734
|
+
return e instanceof H ? e : e && e.length ? new yl(e) : H.empty;
|
|
13735
13735
|
};
|
|
13736
|
-
var
|
|
13736
|
+
var yl = /* @__PURE__ */ function(n) {
|
|
13737
13737
|
function e(r) {
|
|
13738
13738
|
n.call(this), this.values = r;
|
|
13739
13739
|
}
|
|
@@ -13765,7 +13765,7 @@ var gl = /* @__PURE__ */ function(n) {
|
|
|
13765
13765
|
return 0;
|
|
13766
13766
|
}, Object.defineProperties(e.prototype, t), e;
|
|
13767
13767
|
}(H);
|
|
13768
|
-
H.empty = new
|
|
13768
|
+
H.empty = new yl([]);
|
|
13769
13769
|
var ah = /* @__PURE__ */ function(n) {
|
|
13770
13770
|
function e(t, r) {
|
|
13771
13771
|
n.call(this), this.left = t, this.right = r, this.length = t.length + r.length, this.depth = Math.max(t.depth, r.depth) + 1;
|
|
@@ -13947,9 +13947,9 @@ function fh(n, e, t, r) {
|
|
|
13947
13947
|
if (t.steps.length == 0)
|
|
13948
13948
|
return n;
|
|
13949
13949
|
if (o && o.getMeta(it))
|
|
13950
|
-
return o.getMeta(it).redo ? new Pe(n.done.addTransform(t, void 0, r, gn(e)), n.undone,
|
|
13950
|
+
return o.getMeta(it).redo ? new Pe(n.done.addTransform(t, void 0, r, gn(e)), n.undone, Ms(t.mapping.maps), n.prevTime, n.prevComposition) : new Pe(n.done, n.undone.addTransform(t, void 0, r, gn(e)), null, n.prevTime, n.prevComposition);
|
|
13951
13951
|
if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
13952
|
-
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !hh(t, n.prevRanges)), c = o ? hr(n.prevRanges, t.mapping) :
|
|
13952
|
+
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !hh(t, n.prevRanges)), c = o ? hr(n.prevRanges, t.mapping) : Ms(t.mapping.maps);
|
|
13953
13953
|
return new Pe(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, gn(e)), ge.empty, c, t.time, l ?? n.prevComposition);
|
|
13954
13954
|
} else return (s = t.getMeta("rebased")) ? new Pe(n.done.rebased(t, s), n.undone.rebased(t, s), hr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new Pe(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), hr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
|
|
13955
13955
|
}
|
|
@@ -13964,7 +13964,7 @@ function hh(n, e) {
|
|
|
13964
13964
|
r <= e[s + 1] && i >= e[s] && (t = !0);
|
|
13965
13965
|
}), t;
|
|
13966
13966
|
}
|
|
13967
|
-
function
|
|
13967
|
+
function Ms(n) {
|
|
13968
13968
|
let e = [];
|
|
13969
13969
|
for (let t = n.length - 1; t >= 0 && e.length == 0; t--)
|
|
13970
13970
|
n[t].forEach((r, i, s, o) => e.push(s, o));
|
|
@@ -13987,11 +13987,11 @@ function ph(n, e, t) {
|
|
|
13987
13987
|
let o = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), i, r), a = new Pe(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
|
|
13988
13988
|
return s.transform.setSelection(o).setMeta(it, { redo: t, historyState: a });
|
|
13989
13989
|
}
|
|
13990
|
-
let pr = !1,
|
|
13990
|
+
let pr = !1, Cs = null;
|
|
13991
13991
|
function gn(n) {
|
|
13992
13992
|
let e = n.plugins;
|
|
13993
|
-
if (
|
|
13994
|
-
pr = !1,
|
|
13993
|
+
if (Cs != e) {
|
|
13994
|
+
pr = !1, Cs = e;
|
|
13995
13995
|
for (let t = 0; t < e.length; t++)
|
|
13996
13996
|
if (e[t].spec.historyPreserveItems) {
|
|
13997
13997
|
pr = !0;
|
|
@@ -14019,14 +14019,14 @@ function gh(n = {}) {
|
|
|
14019
14019
|
props: {
|
|
14020
14020
|
handleDOMEvents: {
|
|
14021
14021
|
beforeinput(e, t) {
|
|
14022
|
-
let r = t.inputType, i = r == "historyUndo" ?
|
|
14022
|
+
let r = t.inputType, i = r == "historyUndo" ? kl : r == "historyRedo" ? xl : null;
|
|
14023
14023
|
return !i || !e.editable ? !1 : (t.preventDefault(), i(e.state, e.dispatch));
|
|
14024
14024
|
}
|
|
14025
14025
|
}
|
|
14026
14026
|
}
|
|
14027
14027
|
});
|
|
14028
14028
|
}
|
|
14029
|
-
function
|
|
14029
|
+
function bl(n, e) {
|
|
14030
14030
|
return (t, r) => {
|
|
14031
14031
|
let i = it.getState(t);
|
|
14032
14032
|
if (!i || (n ? i.undone : i.done).eventCount == 0)
|
|
@@ -14038,7 +14038,7 @@ function yl(n, e) {
|
|
|
14038
14038
|
return !0;
|
|
14039
14039
|
};
|
|
14040
14040
|
}
|
|
14041
|
-
const
|
|
14041
|
+
const kl = bl(!1, !0), xl = bl(!0, !0), yh = G.create({
|
|
14042
14042
|
name: "history",
|
|
14043
14043
|
addOptions() {
|
|
14044
14044
|
return {
|
|
@@ -14048,8 +14048,8 @@ const bl = yl(!1, !0), kl = yl(!0, !0), yh = G.create({
|
|
|
14048
14048
|
},
|
|
14049
14049
|
addCommands() {
|
|
14050
14050
|
return {
|
|
14051
|
-
undo: () => ({ state: n, dispatch: e }) =>
|
|
14052
|
-
redo: () => ({ state: n, dispatch: e }) =>
|
|
14051
|
+
undo: () => ({ state: n, dispatch: e }) => kl(n, e),
|
|
14052
|
+
redo: () => ({ state: n, dispatch: e }) => xl(n, e)
|
|
14053
14053
|
};
|
|
14054
14054
|
},
|
|
14055
14055
|
addProseMirrorPlugins() {
|
|
@@ -14113,7 +14113,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), yh = G.create({
|
|
|
14113
14113
|
},
|
|
14114
14114
|
addInputRules() {
|
|
14115
14115
|
return [
|
|
14116
|
-
|
|
14116
|
+
ml({
|
|
14117
14117
|
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
|
14118
14118
|
type: this.type
|
|
14119
14119
|
})
|
|
@@ -14212,7 +14212,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), yh = G.create({
|
|
|
14212
14212
|
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
|
|
14213
14213
|
};
|
|
14214
14214
|
}
|
|
14215
|
-
}), Th = "listItem",
|
|
14215
|
+
}), Th = "listItem", Ts = "textStyle", Os = /^(\d+)\.\s$/, Oh = re.create({
|
|
14216
14216
|
name: "orderedList",
|
|
14217
14217
|
addOptions() {
|
|
14218
14218
|
return {
|
|
@@ -14251,7 +14251,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), yh = G.create({
|
|
|
14251
14251
|
},
|
|
14252
14252
|
addCommands() {
|
|
14253
14253
|
return {
|
|
14254
|
-
toggleOrderedList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Th, this.editor.getAttributes(
|
|
14254
|
+
toggleOrderedList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Th, this.editor.getAttributes(Ts)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
14255
14255
|
};
|
|
14256
14256
|
},
|
|
14257
14257
|
addKeyboardShortcuts() {
|
|
@@ -14261,17 +14261,17 @@ const bl = yl(!1, !0), kl = yl(!0, !0), yh = G.create({
|
|
|
14261
14261
|
},
|
|
14262
14262
|
addInputRules() {
|
|
14263
14263
|
let n = Ut({
|
|
14264
|
-
find:
|
|
14264
|
+
find: Os,
|
|
14265
14265
|
type: this.type,
|
|
14266
14266
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
14267
14267
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1]
|
|
14268
14268
|
});
|
|
14269
14269
|
return (this.options.keepMarks || this.options.keepAttributes) && (n = Ut({
|
|
14270
|
-
find:
|
|
14270
|
+
find: Os,
|
|
14271
14271
|
type: this.type,
|
|
14272
14272
|
keepMarks: this.options.keepMarks,
|
|
14273
14273
|
keepAttributes: this.options.keepAttributes,
|
|
14274
|
-
getAttributes: (e) => ({ start: +e[1], ...this.editor.getAttributes(
|
|
14274
|
+
getAttributes: (e) => ({ start: +e[1], ...this.editor.getAttributes(Ts) }),
|
|
14275
14275
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1],
|
|
14276
14276
|
editor: this.editor
|
|
14277
14277
|
})), [
|
|
@@ -14592,7 +14592,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), yh = G.create({
|
|
|
14592
14592
|
},
|
|
14593
14593
|
addInputRules() {
|
|
14594
14594
|
return [
|
|
14595
|
-
|
|
14595
|
+
ml({
|
|
14596
14596
|
find: Vh,
|
|
14597
14597
|
type: this.type,
|
|
14598
14598
|
getAttributes: (n) => {
|
|
@@ -14603,7 +14603,7 @@ const bl = yl(!1, !0), kl = yl(!0, !0), yh = G.create({
|
|
|
14603
14603
|
];
|
|
14604
14604
|
}
|
|
14605
14605
|
});
|
|
14606
|
-
var ie, Qt, en, de, Fr,
|
|
14606
|
+
var ie, Qt, en, de, Fr, Sl, wl, Ml, Cl;
|
|
14607
14607
|
class Wh extends Pl {
|
|
14608
14608
|
constructor() {
|
|
14609
14609
|
super();
|
|
@@ -14613,7 +14613,7 @@ class Wh extends Pl {
|
|
|
14613
14613
|
B(this, en, null);
|
|
14614
14614
|
}
|
|
14615
14615
|
connectedCallback() {
|
|
14616
|
-
super.connectedCallback() && (R(this, de,
|
|
14616
|
+
super.connectedCallback() && (R(this, de, Sl).call(this), R(this, de, wl).call(this), R(this, de, Fr).call(this));
|
|
14617
14617
|
}
|
|
14618
14618
|
get value() {
|
|
14619
14619
|
return O(this, ie).getHTML();
|
|
@@ -14654,11 +14654,11 @@ Fr = function() {
|
|
|
14654
14654
|
const r = this.shadowRoot.querySelector(".menu-bar");
|
|
14655
14655
|
r && (r.style.display = t ? "none" : "flex");
|
|
14656
14656
|
}
|
|
14657
|
-
},
|
|
14657
|
+
}, Sl = function() {
|
|
14658
14658
|
const t = zt.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
|
|
14659
14659
|
this.shadowRoot.innerHTML = `
|
|
14660
14660
|
<style>
|
|
14661
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
14661
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.115/dist/css/nineEditor.css";
|
|
14662
14662
|
${r}
|
|
14663
14663
|
</style>
|
|
14664
14664
|
|
|
@@ -14697,7 +14697,7 @@ Fr = function() {
|
|
|
14697
14697
|
const s = i.target.value;
|
|
14698
14698
|
console.log(i.target, s), O(this, ie).chain().focus().setMark("textStyle", { fontSize: s }).run();
|
|
14699
14699
|
};
|
|
14700
|
-
},
|
|
14700
|
+
}, wl = function() {
|
|
14701
14701
|
Y(this, ie, new Df({
|
|
14702
14702
|
element: O(this, Qt),
|
|
14703
14703
|
editable: !this.readonly,
|
|
@@ -14730,10 +14730,10 @@ Fr = function() {
|
|
|
14730
14730
|
this.dispatchEvent(new CustomEvent("change", { detail: t.getHTML() }));
|
|
14731
14731
|
},
|
|
14732
14732
|
onSelectionUpdate: ({ editor: t }) => {
|
|
14733
|
-
this.readonly || R(this, de,
|
|
14733
|
+
this.readonly || R(this, de, Ml).call(this, t);
|
|
14734
14734
|
}
|
|
14735
|
-
})), R(this, de,
|
|
14736
|
-
},
|
|
14735
|
+
})), R(this, de, Cl).call(this);
|
|
14736
|
+
}, Ml = function(t) {
|
|
14737
14737
|
this.shadowRoot.querySelectorAll("[data-cmd]").forEach((o) => {
|
|
14738
14738
|
t.isActive(o.dataset.cmd) ? o.classList.add("is-active") : o.classList.remove("is-active");
|
|
14739
14739
|
}), this.shadowRoot.querySelectorAll("[data-align]").forEach((o) => {
|
|
@@ -14743,7 +14743,7 @@ Fr = function() {
|
|
|
14743
14743
|
i && (i.value = r.fontSize || "14px");
|
|
14744
14744
|
const s = this.shadowRoot.querySelector("#color-picker");
|
|
14745
14745
|
s && (s.value = r.color || "#000000");
|
|
14746
|
-
},
|
|
14746
|
+
}, Cl = function() {
|
|
14747
14747
|
const t = O(this, ie);
|
|
14748
14748
|
this.shadowRoot.querySelectorAll("[data-cmd]").forEach((r) => {
|
|
14749
14749
|
r.onclick = () => {
|
|
@@ -14759,21 +14759,21 @@ Fr = function() {
|
|
|
14759
14759
|
r && t.chain().focus().setImage({ src: r }).run();
|
|
14760
14760
|
};
|
|
14761
14761
|
};
|
|
14762
|
-
const ve = typeof window < "u" && window.nine ? window.nine :
|
|
14762
|
+
const ve = typeof window < "u" && window.nine ? window.nine : As, vs = {
|
|
14763
14763
|
alert: window.alert,
|
|
14764
14764
|
confirm: window.confirm
|
|
14765
|
-
},
|
|
14765
|
+
}, Es = () => {
|
|
14766
14766
|
var t;
|
|
14767
14767
|
console.log(ve, window.nine);
|
|
14768
14768
|
const { nativeOverride: n } = ((t = ve == null ? void 0 : ve.config) == null ? void 0 : t.ux) || {}, e = Array.isArray(n) ? n : n === !0 ? ["alert", "confirm"] : [];
|
|
14769
|
-
console.log(ve, e), window.alert = e.includes("alert") ? (r) => zt.alert(r) :
|
|
14769
|
+
console.log(ve, e), window.alert = e.includes("alert") ? (r) => zt.alert(r) : vs.alert, window.confirm = e.includes("confirm") ? async (r) => await zt.confirm(r) : vs.confirm, ve.config.debug && e.length > 0 && console.log(`[nine-ux] Native API Overridden: ${e.join(", ")}`);
|
|
14770
14770
|
}, qh = () => {
|
|
14771
|
-
|
|
14772
|
-
(n === "ux" || n === "config") &&
|
|
14771
|
+
Es(), ve == null || ve.subscribeConfig((n) => {
|
|
14772
|
+
(n === "ux" || n === "config") && Es();
|
|
14773
14773
|
});
|
|
14774
14774
|
};
|
|
14775
14775
|
qh();
|
|
14776
|
-
var xt, St, ye,
|
|
14776
|
+
var xt, St, ye, Tl, It, Ol;
|
|
14777
14777
|
class jh extends HTMLElement {
|
|
14778
14778
|
constructor() {
|
|
14779
14779
|
super();
|
|
@@ -14792,7 +14792,7 @@ class jh extends HTMLElement {
|
|
|
14792
14792
|
R(this, ye, It).call(this);
|
|
14793
14793
|
}
|
|
14794
14794
|
}
|
|
14795
|
-
xt = new WeakMap(), St = new WeakMap(), ye = new WeakSet(),
|
|
14795
|
+
xt = new WeakMap(), St = new WeakMap(), ye = new WeakSet(), Tl = async function() {
|
|
14796
14796
|
const t = this.getAttribute("code") || "";
|
|
14797
14797
|
try {
|
|
14798
14798
|
await navigator.clipboard.writeText(t), Y(this, xt, !0), R(this, ye, It).call(this), setTimeout(() => {
|
|
@@ -14805,7 +14805,7 @@ xt = new WeakMap(), St = new WeakMap(), ye = new WeakSet(), Cl = async function(
|
|
|
14805
14805
|
const t = this.getAttribute("lang") || "Bash", r = this.getAttribute("code") || this.textContent.trim() || "", i = this.getAttribute("css-path");
|
|
14806
14806
|
O(this, St).innerHTML = `
|
|
14807
14807
|
<style>
|
|
14808
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
14808
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.115/dist/css/nine-code-block.css";
|
|
14809
14809
|
${i ? `@import "${i}";` : ""}
|
|
14810
14810
|
</style>
|
|
14811
14811
|
|
|
@@ -14820,11 +14820,11 @@ xt = new WeakMap(), St = new WeakMap(), ye = new WeakSet(), Cl = async function(
|
|
|
14820
14820
|
<button class="copy-btn ${O(this, xt) ? "copied" : ""}" aria-label="Copy Code"></button>
|
|
14821
14821
|
</div>
|
|
14822
14822
|
<div class="content">
|
|
14823
|
-
<pre><code>${R(this, ye,
|
|
14823
|
+
<pre><code>${R(this, ye, Ol).call(this, r)}</code></pre>
|
|
14824
14824
|
</div>
|
|
14825
14825
|
</div>
|
|
14826
|
-
`, O(this, St).querySelector(".copy-btn").onclick = () => R(this, ye,
|
|
14827
|
-
},
|
|
14826
|
+
`, O(this, St).querySelector(".copy-btn").onclick = () => R(this, ye, Tl).call(this);
|
|
14827
|
+
}, Ol = function(t) {
|
|
14828
14828
|
const r = document.createElement("div");
|
|
14829
14829
|
return r.textContent = t, r.innerHTML;
|
|
14830
14830
|
};
|