@nine-lab/nine-ux 0.1.58 → 0.1.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nine-ux.es.js +326 -298
- package/dist/nine-ux.es.js.map +1 -1
- package/dist/nine-ux.umd.js +72 -51
- package/dist/nine-ux.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-ux.es.js
CHANGED
|
@@ -320,55 +320,76 @@ const wl = `
|
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
|
|
323
|
-
/*
|
|
323
|
+
/* --- Animation Core --- */
|
|
324
324
|
:host {
|
|
325
|
-
--
|
|
325
|
+
--nx-duration: 0.4s;
|
|
326
|
+
--nx-timing: cubic-bezier(0.34, 1.56, 0.64, 1); /* 탄력 있는 효과 */
|
|
326
327
|
}
|
|
327
328
|
|
|
328
329
|
dialog {
|
|
329
|
-
|
|
330
|
-
transform var(--animation-duration) cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
330
|
+
opacity: 0;
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
/*
|
|
334
|
-
:host(.fade-in)
|
|
335
|
-
|
|
336
|
-
}
|
|
333
|
+
/* 1. Fade (서서히 나타남) */
|
|
334
|
+
:host(.fade) dialog { animation: nx-fade-in var(--nx-duration) forwards; }
|
|
335
|
+
@keyframes nx-fade-in { from { opacity: 0; } to { opacity: 1; } }
|
|
337
336
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
337
|
+
/* 2. Zoom (커지며 나타남) */
|
|
338
|
+
:host(.zoom) dialog { animation: nx-zoom-in var(--nx-duration) var(--nx-timing) forwards; }
|
|
339
|
+
@keyframes nx-zoom-in { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }
|
|
340
|
+
|
|
341
|
+
/* 3. Slide (상하좌우) */
|
|
342
|
+
:host(.moveUp) dialog { animation: nx-move-up var(--nx-duration) var(--nx-timing) forwards; }
|
|
343
|
+
:host(.moveDown) dialog { animation: nx-move-down var(--nx-duration) var(--nx-timing) forwards; }
|
|
344
|
+
:host(.moveLeft) dialog { animation: nx-move-left var(--nx-duration) var(--nx-timing) forwards; }
|
|
345
|
+
:host(.moveRight) dialog { animation: nx-move-right var(--nx-duration) var(--nx-timing) forwards; }
|
|
346
|
+
|
|
347
|
+
@keyframes nx-move-up { from { opacity: 0; transform: translateY(100px); } to { opacity: 1; transform: translateY(0); } }
|
|
348
|
+
@keyframes nx-move-down { from { opacity: 0; transform: translateY(-100px); } to { opacity: 1; transform: translateY(0); } }
|
|
349
|
+
@keyframes nx-move-left { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
|
|
350
|
+
@keyframes nx-move-right { from { opacity: 0; transform: translateX(-100px); } to { opacity: 1; transform: translateY(0); } }
|
|
342
351
|
|
|
343
|
-
/*
|
|
344
|
-
:host(.
|
|
345
|
-
animation:
|
|
352
|
+
/* 4. Shake (상하좌우 격렬한 진동 - 에러 인지용) */
|
|
353
|
+
:host(.shake) dialog {
|
|
354
|
+
animation: nx-heavy-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
|
|
355
|
+
opacity: 1;
|
|
346
356
|
}
|
|
347
357
|
|
|
348
|
-
@keyframes
|
|
349
|
-
|
|
350
|
-
|
|
358
|
+
@keyframes nx-heavy-shake {
|
|
359
|
+
10%, 90% { transform: translate3d(-1px, -2px, 0); }
|
|
360
|
+
20%, 80% { transform: translate3d(2px, 4px, 0); }
|
|
361
|
+
30%, 50%, 70% { transform: translate3d(-6px, -6px, 0); }
|
|
362
|
+
40%, 60% { transform: translate3d(6px, 6px, 0); }
|
|
351
363
|
}
|
|
352
364
|
|
|
353
|
-
/*
|
|
354
|
-
|
|
355
|
-
animation:
|
|
356
|
-
pointer-events: none;
|
|
365
|
+
/* 5. Road Runner (등장: 왼쪽에서 탄력 있게 / 퇴장: 움츠렸다가 광속 탈출) */
|
|
366
|
+
:host(.roadRunner) dialog {
|
|
367
|
+
animation: roadRunnerIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
|
|
357
368
|
}
|
|
358
369
|
|
|
359
|
-
@keyframes
|
|
360
|
-
|
|
361
|
-
|
|
370
|
+
@keyframes roadRunnerIn {
|
|
371
|
+
0% { transform: translateX(-1500px) skewX(30deg); opacity: 1; }
|
|
372
|
+
70% { transform: translateX(30px) skewX(-10deg); opacity: 1; }
|
|
373
|
+
100% { transform: translateX(0) skewX(0deg); opacity: 1; }
|
|
362
374
|
}
|
|
363
375
|
|
|
364
|
-
/*
|
|
365
|
-
dialog
|
|
366
|
-
|
|
376
|
+
/* --- Out Animations (닫힐 때) --- */
|
|
377
|
+
dialog.out { pointer-events: none; }
|
|
378
|
+
|
|
379
|
+
/* Road Runner 퇴장: 슥 움츠렸다가(Anticipation) 쌩~! */
|
|
380
|
+
:host(.roadRunner) dialog.out {
|
|
381
|
+
animation: roadRunnerOut 0.5s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
|
|
367
382
|
}
|
|
368
383
|
|
|
369
|
-
|
|
370
|
-
|
|
384
|
+
@keyframes roadRunnerOut {
|
|
385
|
+
0% { transform: translateX(0) scale(1) skewX(0deg); opacity: 1; }
|
|
386
|
+
30% { transform: translateX(50px) scaleX(1.2) scaleY(0.8) skewX(-20deg); opacity: 1; } /* 뒤로 힘 모으기 */
|
|
387
|
+
100% { transform: translateX(1500px) scaleX(2) scaleY(0.5) skewX(40deg); opacity: 0; } /* 광속 탈출 */
|
|
371
388
|
}
|
|
389
|
+
|
|
390
|
+
/* 일반 퇴장 (기본) */
|
|
391
|
+
dialog.out { animation: nx-fade-out 0.3s forwards; }
|
|
392
|
+
@keyframes nx-fade-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.9); } }
|
|
372
393
|
`;
|
|
373
394
|
var Oe, j, Nn, An, Dn;
|
|
374
395
|
class Cl extends HTMLElement {
|
|
@@ -575,11 +596,18 @@ jt = new WeakMap(), Kt = new WeakSet(), hr = function(e, t, r, i) {
|
|
|
575
596
|
const s = { class: i, animation: "fade-in" }, o = e === "alert" ? pn : hn;
|
|
576
597
|
let l = !1;
|
|
577
598
|
const a = {
|
|
599
|
+
// 테마
|
|
578
600
|
rgb: () => (s.class = "rgb", a),
|
|
579
601
|
classic: () => (s.class = "classic", a),
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
602
|
+
// 애니메이션 메서드들
|
|
603
|
+
fade: () => (s.animation = "fade", a),
|
|
604
|
+
zoom: () => (s.animation = "zoom", a),
|
|
605
|
+
up: () => (s.animation = "moveUp", a),
|
|
606
|
+
down: () => (s.animation = "moveDown", a),
|
|
607
|
+
left: () => (s.animation = "moveLeft", a),
|
|
608
|
+
right: () => (s.animation = "moveRight", a),
|
|
609
|
+
shake: () => (s.animation = "shake", a),
|
|
610
|
+
run: () => (s.animation = "roadRunner", a),
|
|
583
611
|
then: (c, d) => (l = !0, o[e](t, r, s).then(c, d))
|
|
584
612
|
};
|
|
585
613
|
return Promise.resolve().then(() => {
|
|
@@ -1249,7 +1277,7 @@ class k {
|
|
|
1249
1277
|
@internal
|
|
1250
1278
|
*/
|
|
1251
1279
|
insertAt(e, t) {
|
|
1252
|
-
let r =
|
|
1280
|
+
let r = vs(this.content, e + this.openStart, t);
|
|
1253
1281
|
return r && new k(r, this.openStart, this.openEnd);
|
|
1254
1282
|
}
|
|
1255
1283
|
/**
|
|
@@ -1315,31 +1343,31 @@ function Os(n, e, t) {
|
|
|
1315
1343
|
throw new RangeError("Removing non-flat range");
|
|
1316
1344
|
return n.replaceChild(r, s.copy(Os(s.content, e - i - 1, t - i - 1)));
|
|
1317
1345
|
}
|
|
1318
|
-
function
|
|
1346
|
+
function vs(n, e, t, r) {
|
|
1319
1347
|
let { index: i, offset: s } = n.findIndex(e), o = n.maybeChild(i);
|
|
1320
1348
|
if (s == e || o.isText)
|
|
1321
1349
|
return r && !r.canReplace(i, i, t) ? null : n.cut(0, e).append(t).append(n.cut(e));
|
|
1322
|
-
let l =
|
|
1350
|
+
let l = vs(o.content, e - s - 1, t, o);
|
|
1323
1351
|
return l && n.replaceChild(i, o.copy(l));
|
|
1324
1352
|
}
|
|
1325
|
-
function
|
|
1353
|
+
function vl(n, e, t) {
|
|
1326
1354
|
if (t.openStart > n.depth)
|
|
1327
1355
|
throw new gn("Inserted content deeper than insertion position");
|
|
1328
1356
|
if (n.depth - t.openStart != e.depth - t.openEnd)
|
|
1329
1357
|
throw new gn("Inconsistent open depths");
|
|
1330
|
-
return
|
|
1358
|
+
return Es(n, e, t, 0);
|
|
1331
1359
|
}
|
|
1332
|
-
function
|
|
1360
|
+
function Es(n, e, t, r) {
|
|
1333
1361
|
let i = n.index(r), s = n.node(r);
|
|
1334
1362
|
if (i == e.index(r) && r < n.depth - t.openStart) {
|
|
1335
|
-
let o =
|
|
1363
|
+
let o = Es(n, e, t, r + 1);
|
|
1336
1364
|
return s.copy(s.content.replaceChild(i, o));
|
|
1337
1365
|
} else if (t.content.size)
|
|
1338
1366
|
if (!t.openStart && !t.openEnd && n.depth == r && e.depth == r) {
|
|
1339
1367
|
let o = n.parent, l = o.content;
|
|
1340
1368
|
return et(o, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
|
|
1341
1369
|
} else {
|
|
1342
|
-
let { start: o, end: l } =
|
|
1370
|
+
let { start: o, end: l } = El(t, n);
|
|
1343
1371
|
return et(s, As(n, o, l, e, r));
|
|
1344
1372
|
}
|
|
1345
1373
|
else return et(s, yn(n, e, r));
|
|
@@ -1378,7 +1406,7 @@ function yn(n, e, t) {
|
|
|
1378
1406
|
}
|
|
1379
1407
|
return Nt(e, null, t, r), new b(r);
|
|
1380
1408
|
}
|
|
1381
|
-
function
|
|
1409
|
+
function El(n, e) {
|
|
1382
1410
|
let t = e.depth - n.openStart, i = e.node(t).copy(n.content);
|
|
1383
1411
|
for (let s = t - 1; s >= 0; s--)
|
|
1384
1412
|
i = e.node(s).copy(b.from(i));
|
|
@@ -1842,7 +1870,7 @@ let Fe = class br {
|
|
|
1842
1870
|
[`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
|
|
1843
1871
|
*/
|
|
1844
1872
|
replace(e, t, r) {
|
|
1845
|
-
return
|
|
1873
|
+
return vl(this.resolve(e), this.resolve(t), r);
|
|
1846
1874
|
}
|
|
1847
1875
|
/**
|
|
1848
1876
|
Find the node directly after the given position.
|
|
@@ -3503,13 +3531,13 @@ function cn(n, e, t, r) {
|
|
|
3503
3531
|
return { dom: a, contentDOM: l };
|
|
3504
3532
|
}
|
|
3505
3533
|
const Ws = 65535, qs = Math.pow(2, 16);
|
|
3506
|
-
function
|
|
3534
|
+
function Xl(n, e) {
|
|
3507
3535
|
return n + e * qs;
|
|
3508
3536
|
}
|
|
3509
3537
|
function ki(n) {
|
|
3510
3538
|
return n & Ws;
|
|
3511
3539
|
}
|
|
3512
|
-
function
|
|
3540
|
+
function Yl(n) {
|
|
3513
3541
|
return (n - (n & Ws)) / qs;
|
|
3514
3542
|
}
|
|
3515
3543
|
const js = 1, Ks = 2, dn = 4, Js = 8;
|
|
@@ -3567,7 +3595,7 @@ class le {
|
|
|
3567
3595
|
if (!this.inverted)
|
|
3568
3596
|
for (let i = 0; i < r; i++)
|
|
3569
3597
|
t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
|
|
3570
|
-
return this.ranges[r * 3] + t +
|
|
3598
|
+
return this.ranges[r * 3] + t + Yl(e);
|
|
3571
3599
|
}
|
|
3572
3600
|
mapResult(e, t = 1) {
|
|
3573
3601
|
return this._map(e, t, !1);
|
|
@@ -3589,7 +3617,7 @@ class le {
|
|
|
3589
3617
|
let f = c ? e == a ? -1 : e == u ? 1 : t : t, h = a + i + (f < 0 ? 0 : d);
|
|
3590
3618
|
if (r)
|
|
3591
3619
|
return h;
|
|
3592
|
-
let p = e == (t < 0 ? a : u) ? null :
|
|
3620
|
+
let p = e == (t < 0 ? a : u) ? null : Xl(l / 3, e - a), m = e == a ? Ks : e == u ? js : dn;
|
|
3593
3621
|
return (t < 0 ? e != a : e != u) && (m |= Js), new xr(h, m, p);
|
|
3594
3622
|
}
|
|
3595
3623
|
i += d - c;
|
|
@@ -4297,7 +4325,7 @@ function la(n, e, t, r, i) {
|
|
|
4297
4325
|
throw new RangeError("Invalid content for node type " + t.name);
|
|
4298
4326
|
n.step(new $(e, e + s.nodeSize, e + 1, e + s.nodeSize - 1, new k(b.from(o), 0, 0), 1, !0));
|
|
4299
4327
|
}
|
|
4300
|
-
function
|
|
4328
|
+
function Ee(n, e, t = 1, r) {
|
|
4301
4329
|
let i = n.resolve(e), s = i.depth - t, o = r && r[r.length - 1] || i.parent;
|
|
4302
4330
|
if (s < 0 || i.parent.type.spec.isolating || !i.parent.canReplace(i.index(), i.parent.childCount) || !o.type.validContent(i.parent.content.cutByIndex(i.index(), i.parent.childCount)))
|
|
4303
4331
|
return !1;
|
|
@@ -4392,7 +4420,7 @@ function ua(n, e, t) {
|
|
|
4392
4420
|
}
|
|
4393
4421
|
return null;
|
|
4394
4422
|
}
|
|
4395
|
-
function
|
|
4423
|
+
function Xs(n, e, t) {
|
|
4396
4424
|
let r = n.resolve(e);
|
|
4397
4425
|
if (!t.content.size)
|
|
4398
4426
|
return e;
|
|
@@ -4417,9 +4445,9 @@ function Bn(n, e, t = e, r = k.empty) {
|
|
|
4417
4445
|
if (e == t && !r.size)
|
|
4418
4446
|
return null;
|
|
4419
4447
|
let i = n.resolve(e), s = n.resolve(t);
|
|
4420
|
-
return
|
|
4448
|
+
return Ys(i, s, r) ? new P(e, t, r) : new fa(i, s, r).fit();
|
|
4421
4449
|
}
|
|
4422
|
-
function
|
|
4450
|
+
function Ys(n, e, t) {
|
|
4423
4451
|
return !t.openStart && !t.openEnd && n.start() == e.start() && n.parent.canReplace(n.index(), e.index(), t.content);
|
|
4424
4452
|
}
|
|
4425
4453
|
class fa {
|
|
@@ -4468,7 +4496,7 @@ class fa {
|
|
|
4468
4496
|
for (let t = 1; t <= 2; t++)
|
|
4469
4497
|
for (let r = t == 1 ? e : this.unplaced.openStart; r >= 0; r--) {
|
|
4470
4498
|
let i, s = null;
|
|
4471
|
-
r ? (s =
|
|
4499
|
+
r ? (s = Xn(this.unplaced.content, r - 1).firstChild, i = s.content) : i = this.unplaced.content;
|
|
4472
4500
|
let o = i.firstChild;
|
|
4473
4501
|
for (let l = this.depth; l >= 0; l--) {
|
|
4474
4502
|
let { type: a, match: c } = this.frontier[l], d, u = null;
|
|
@@ -4482,11 +4510,11 @@ class fa {
|
|
|
4482
4510
|
}
|
|
4483
4511
|
}
|
|
4484
4512
|
openMore() {
|
|
4485
|
-
let { content: e, openStart: t, openEnd: r } = this.unplaced, i =
|
|
4513
|
+
let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Xn(e, t);
|
|
4486
4514
|
return !i.childCount || i.firstChild.isLeaf ? !1 : (this.unplaced = new k(e, t + 1, Math.max(r, i.size + t >= e.size - r ? t + 1 : 0)), !0);
|
|
4487
4515
|
}
|
|
4488
4516
|
dropNode() {
|
|
4489
|
-
let { content: e, openStart: t, openEnd: r } = this.unplaced, i =
|
|
4517
|
+
let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Xn(e, t);
|
|
4490
4518
|
if (i.childCount <= 1 && t > 0) {
|
|
4491
4519
|
let s = e.size - t <= t + i.size;
|
|
4492
4520
|
this.unplaced = new k(Ot(e, t - 1, 1), t - 1, s ? t - 1 : r);
|
|
@@ -4516,7 +4544,7 @@ class fa {
|
|
|
4516
4544
|
c++, (c > 1 || a == 0 || m.content.size) && (u = g, d.push(Zs(m.mark(f.allowedMarks(m.marks)), c == 1 ? a : 0, c == l.childCount ? h : -1)));
|
|
4517
4545
|
}
|
|
4518
4546
|
let p = c == l.childCount;
|
|
4519
|
-
p || (h = -1), this.placed =
|
|
4547
|
+
p || (h = -1), this.placed = vt(this.placed, t, b.from(d)), this.frontier[t].match = u, p && h < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
|
|
4520
4548
|
for (let m = 0, g = l; m < h; m++) {
|
|
4521
4549
|
let y = g.lastChild;
|
|
4522
4550
|
this.frontier.push({ type: y.type, match: y.contentMatchAt(y.childCount) }), g = y.content;
|
|
@@ -4527,7 +4555,7 @@ class fa {
|
|
|
4527
4555
|
if (!this.$to.parent.isTextblock)
|
|
4528
4556
|
return -1;
|
|
4529
4557
|
let e = this.frontier[this.depth], t;
|
|
4530
|
-
if (!e.type.isTextblock || !
|
|
4558
|
+
if (!e.type.isTextblock || !Yn(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
|
|
4531
4559
|
return -1;
|
|
4532
4560
|
let { depth: r } = this.$to, i = this.$to.after(r);
|
|
4533
4561
|
for (; r > 1 && i == this.$to.end(--r); )
|
|
@@ -4536,10 +4564,10 @@ class fa {
|
|
|
4536
4564
|
}
|
|
4537
4565
|
findCloseLevel(e) {
|
|
4538
4566
|
e: for (let t = Math.min(this.depth, e.depth); t >= 0; t--) {
|
|
4539
|
-
let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o =
|
|
4567
|
+
let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = Yn(e, t, i, r, s);
|
|
4540
4568
|
if (o) {
|
|
4541
4569
|
for (let l = t - 1; l >= 0; l--) {
|
|
4542
|
-
let { match: a, type: c } = this.frontier[l], d =
|
|
4570
|
+
let { match: a, type: c } = this.frontier[l], d = Yn(e, l, c, a, !0);
|
|
4543
4571
|
if (!d || d.childCount)
|
|
4544
4572
|
continue e;
|
|
4545
4573
|
}
|
|
@@ -4553,7 +4581,7 @@ class fa {
|
|
|
4553
4581
|
return null;
|
|
4554
4582
|
for (; this.depth > t.depth; )
|
|
4555
4583
|
this.closeFrontierNode();
|
|
4556
|
-
t.fit.childCount && (this.placed =
|
|
4584
|
+
t.fit.childCount && (this.placed = vt(this.placed, t.depth, t.fit)), e = t.move;
|
|
4557
4585
|
for (let r = t.depth + 1; r <= e.depth; r++) {
|
|
4558
4586
|
let i = e.node(r), s = i.type.contentMatch.fillBefore(i.content, !0, e.index(r));
|
|
4559
4587
|
this.openFrontierNode(i.type, i.attrs, s);
|
|
@@ -4562,20 +4590,20 @@ class fa {
|
|
|
4562
4590
|
}
|
|
4563
4591
|
openFrontierNode(e, t = null, r) {
|
|
4564
4592
|
let i = this.frontier[this.depth];
|
|
4565
|
-
i.match = i.match.matchType(e), this.placed =
|
|
4593
|
+
i.match = i.match.matchType(e), this.placed = vt(this.placed, this.depth, b.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
|
|
4566
4594
|
}
|
|
4567
4595
|
closeFrontierNode() {
|
|
4568
4596
|
let t = this.frontier.pop().match.fillBefore(b.empty, !0);
|
|
4569
|
-
t.childCount && (this.placed =
|
|
4597
|
+
t.childCount && (this.placed = vt(this.placed, this.frontier.length, t));
|
|
4570
4598
|
}
|
|
4571
4599
|
}
|
|
4572
4600
|
function Ot(n, e, t) {
|
|
4573
4601
|
return e == 0 ? n.cutByIndex(t, n.childCount) : n.replaceChild(0, n.firstChild.copy(Ot(n.firstChild.content, e - 1, t)));
|
|
4574
4602
|
}
|
|
4575
|
-
function
|
|
4576
|
-
return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(
|
|
4603
|
+
function vt(n, e, t) {
|
|
4604
|
+
return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(vt(n.lastChild.content, e - 1, t)));
|
|
4577
4605
|
}
|
|
4578
|
-
function
|
|
4606
|
+
function Xn(n, e) {
|
|
4579
4607
|
for (let t = 0; t < e; t++)
|
|
4580
4608
|
n = n.firstChild.content;
|
|
4581
4609
|
return n;
|
|
@@ -4586,7 +4614,7 @@ function Zs(n, e, t) {
|
|
|
4586
4614
|
let r = n.content;
|
|
4587
4615
|
return e > 1 && (r = r.replaceChild(0, Zs(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(b.empty, !0)))), n.copy(r);
|
|
4588
4616
|
}
|
|
4589
|
-
function
|
|
4617
|
+
function Yn(n, e, t, r, i) {
|
|
4590
4618
|
let s = n.node(e), o = i ? n.indexAfter(e) : n.index(e);
|
|
4591
4619
|
if (o == s.childCount && !t.compatibleContent(s.type))
|
|
4592
4620
|
return null;
|
|
@@ -4606,7 +4634,7 @@ function ma(n, e, t, r) {
|
|
|
4606
4634
|
if (!r.size)
|
|
4607
4635
|
return n.deleteRange(e, t);
|
|
4608
4636
|
let i = n.doc.resolve(e), s = n.doc.resolve(t);
|
|
4609
|
-
if (
|
|
4637
|
+
if (Ys(i, s, r))
|
|
4610
4638
|
return n.step(new P(e, t, r));
|
|
4611
4639
|
let o = eo(i, s);
|
|
4612
4640
|
o[o.length - 1] == 0 && o.pop();
|
|
@@ -5029,7 +5057,7 @@ class ba {
|
|
|
5029
5057
|
}
|
|
5030
5058
|
}
|
|
5031
5059
|
const Zn = /* @__PURE__ */ Object.create(null);
|
|
5032
|
-
class
|
|
5060
|
+
class v {
|
|
5033
5061
|
/**
|
|
5034
5062
|
Initialize a selection with the head and anchor and ranges. If no
|
|
5035
5063
|
ranges are given, constructs a single range across `$anchor` and
|
|
@@ -5193,7 +5221,7 @@ class E {
|
|
|
5193
5221
|
return M.between(this.$anchor, this.$head).getBookmark();
|
|
5194
5222
|
}
|
|
5195
5223
|
}
|
|
5196
|
-
|
|
5224
|
+
v.prototype.visible = !0;
|
|
5197
5225
|
class ka {
|
|
5198
5226
|
/**
|
|
5199
5227
|
Create a range.
|
|
@@ -5206,7 +5234,7 @@ let Si = !1;
|
|
|
5206
5234
|
function Mi(n) {
|
|
5207
5235
|
!Si && !n.parent.inlineContent && (Si = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
|
|
5208
5236
|
}
|
|
5209
|
-
class M extends
|
|
5237
|
+
class M extends v {
|
|
5210
5238
|
/**
|
|
5211
5239
|
Construct a text selection between the given points.
|
|
5212
5240
|
*/
|
|
@@ -5223,7 +5251,7 @@ class M extends E {
|
|
|
5223
5251
|
map(e, t) {
|
|
5224
5252
|
let r = e.resolve(t.map(this.head));
|
|
5225
5253
|
if (!r.parent.inlineContent)
|
|
5226
|
-
return
|
|
5254
|
+
return v.near(r);
|
|
5227
5255
|
let i = e.resolve(t.map(this.anchor));
|
|
5228
5256
|
return new M(i.parent.inlineContent ? i : r, r);
|
|
5229
5257
|
}
|
|
@@ -5268,16 +5296,16 @@ class M extends E {
|
|
|
5268
5296
|
static between(e, t, r) {
|
|
5269
5297
|
let i = e.pos - t.pos;
|
|
5270
5298
|
if ((!r || i) && (r = i >= 0 ? 1 : -1), !t.parent.inlineContent) {
|
|
5271
|
-
let s =
|
|
5299
|
+
let s = v.findFrom(t, r, !0) || v.findFrom(t, -r, !0);
|
|
5272
5300
|
if (s)
|
|
5273
5301
|
t = s.$head;
|
|
5274
5302
|
else
|
|
5275
|
-
return
|
|
5303
|
+
return v.near(t, r);
|
|
5276
5304
|
}
|
|
5277
|
-
return e.parent.inlineContent || (i == 0 ? e = t : (e = (
|
|
5305
|
+
return e.parent.inlineContent || (i == 0 ? e = t : (e = (v.findFrom(e, -r, !0) || v.findFrom(e, r, !0)).$anchor, e.pos < t.pos != i < 0 && (e = t))), new M(e, t);
|
|
5278
5306
|
}
|
|
5279
5307
|
}
|
|
5280
|
-
|
|
5308
|
+
v.jsonID("text", M);
|
|
5281
5309
|
class Ln {
|
|
5282
5310
|
constructor(e, t) {
|
|
5283
5311
|
this.anchor = e, this.head = t;
|
|
@@ -5289,7 +5317,7 @@ class Ln {
|
|
|
5289
5317
|
return M.between(e.resolve(this.anchor), e.resolve(this.head));
|
|
5290
5318
|
}
|
|
5291
5319
|
}
|
|
5292
|
-
class S extends
|
|
5320
|
+
class S extends v {
|
|
5293
5321
|
/**
|
|
5294
5322
|
Create a node selection. Does not verify the validity of its
|
|
5295
5323
|
argument.
|
|
@@ -5300,7 +5328,7 @@ class S extends E {
|
|
|
5300
5328
|
}
|
|
5301
5329
|
map(e, t) {
|
|
5302
5330
|
let { deleted: r, pos: i } = t.mapResult(this.anchor), s = e.resolve(i);
|
|
5303
|
-
return r ?
|
|
5331
|
+
return r ? v.near(s) : new S(s);
|
|
5304
5332
|
}
|
|
5305
5333
|
content() {
|
|
5306
5334
|
return new k(b.from(this.node), 0, 0);
|
|
@@ -5337,7 +5365,7 @@ class S extends E {
|
|
|
5337
5365
|
}
|
|
5338
5366
|
}
|
|
5339
5367
|
S.prototype.visible = !1;
|
|
5340
|
-
|
|
5368
|
+
v.jsonID("node", S);
|
|
5341
5369
|
class Vr {
|
|
5342
5370
|
constructor(e) {
|
|
5343
5371
|
this.anchor = e;
|
|
@@ -5348,10 +5376,10 @@ class Vr {
|
|
|
5348
5376
|
}
|
|
5349
5377
|
resolve(e) {
|
|
5350
5378
|
let t = e.resolve(this.anchor), r = t.nodeAfter;
|
|
5351
|
-
return r && S.isSelectable(r) ? new S(t) :
|
|
5379
|
+
return r && S.isSelectable(r) ? new S(t) : v.near(t);
|
|
5352
5380
|
}
|
|
5353
5381
|
}
|
|
5354
|
-
class ce extends
|
|
5382
|
+
class ce extends v {
|
|
5355
5383
|
/**
|
|
5356
5384
|
Create an all-selection over the given document.
|
|
5357
5385
|
*/
|
|
@@ -5361,7 +5389,7 @@ class ce extends E {
|
|
|
5361
5389
|
replace(e, t = k.empty) {
|
|
5362
5390
|
if (t == k.empty) {
|
|
5363
5391
|
e.delete(0, e.doc.content.size);
|
|
5364
|
-
let r =
|
|
5392
|
+
let r = v.atStart(e.doc);
|
|
5365
5393
|
r.eq(e.selection) || e.setSelection(r);
|
|
5366
5394
|
} else
|
|
5367
5395
|
super.replace(e, t);
|
|
@@ -5385,7 +5413,7 @@ class ce extends E {
|
|
|
5385
5413
|
return xa;
|
|
5386
5414
|
}
|
|
5387
5415
|
}
|
|
5388
|
-
|
|
5416
|
+
v.jsonID("all", ce);
|
|
5389
5417
|
const xa = {
|
|
5390
5418
|
map() {
|
|
5391
5419
|
return this;
|
|
@@ -5421,7 +5449,7 @@ function wi(n, e, t) {
|
|
|
5421
5449
|
let s = n.mapping.maps[r], o;
|
|
5422
5450
|
s.forEach((l, a, c, d) => {
|
|
5423
5451
|
o == null && (o = d);
|
|
5424
|
-
}), n.setSelection(
|
|
5452
|
+
}), n.setSelection(v.near(n.doc.resolve(o), t));
|
|
5425
5453
|
}
|
|
5426
5454
|
const Ci = 1, nn = 2, Ti = 4;
|
|
5427
5455
|
class Sa extends ba {
|
|
@@ -5536,7 +5564,7 @@ class Sa extends ba {
|
|
|
5536
5564
|
let o = this.doc.resolve(t);
|
|
5537
5565
|
s = r == t ? o.marks() : o.marksAcross(this.doc.resolve(r));
|
|
5538
5566
|
}
|
|
5539
|
-
return this.replaceRangeWith(t, r, i.text(e, s)), !this.selection.empty && this.selection.to == t + e.length && this.setSelection(
|
|
5567
|
+
return this.replaceRangeWith(t, r, i.text(e, s)), !this.selection.empty && this.selection.to == t + e.length && this.setSelection(v.near(this.selection.$to)), this;
|
|
5540
5568
|
}
|
|
5541
5569
|
}
|
|
5542
5570
|
/**
|
|
@@ -5578,13 +5606,13 @@ class Sa extends ba {
|
|
|
5578
5606
|
function Oi(n, e) {
|
|
5579
5607
|
return !e || !n ? n : n.bind(e);
|
|
5580
5608
|
}
|
|
5581
|
-
class
|
|
5609
|
+
class Et {
|
|
5582
5610
|
constructor(e, t, r) {
|
|
5583
5611
|
this.name = e, this.init = Oi(t.init, r), this.apply = Oi(t.apply, r);
|
|
5584
5612
|
}
|
|
5585
5613
|
}
|
|
5586
5614
|
const Ma = [
|
|
5587
|
-
new
|
|
5615
|
+
new Et("doc", {
|
|
5588
5616
|
init(n) {
|
|
5589
5617
|
return n.doc || n.schema.topNodeType.createAndFill();
|
|
5590
5618
|
},
|
|
@@ -5592,15 +5620,15 @@ const Ma = [
|
|
|
5592
5620
|
return n.doc;
|
|
5593
5621
|
}
|
|
5594
5622
|
}),
|
|
5595
|
-
new
|
|
5623
|
+
new Et("selection", {
|
|
5596
5624
|
init(n, e) {
|
|
5597
|
-
return n.selection ||
|
|
5625
|
+
return n.selection || v.atStart(e.doc);
|
|
5598
5626
|
},
|
|
5599
5627
|
apply(n) {
|
|
5600
5628
|
return n.selection;
|
|
5601
5629
|
}
|
|
5602
5630
|
}),
|
|
5603
|
-
new
|
|
5631
|
+
new Et("storedMarks", {
|
|
5604
5632
|
init(n) {
|
|
5605
5633
|
return n.storedMarks || null;
|
|
5606
5634
|
},
|
|
@@ -5608,7 +5636,7 @@ const Ma = [
|
|
|
5608
5636
|
return r.selection.$cursor ? n.storedMarks : null;
|
|
5609
5637
|
}
|
|
5610
5638
|
}),
|
|
5611
|
-
new
|
|
5639
|
+
new Et("scrollToSelection", {
|
|
5612
5640
|
init() {
|
|
5613
5641
|
return 0;
|
|
5614
5642
|
},
|
|
@@ -5622,7 +5650,7 @@ class Qn {
|
|
|
5622
5650
|
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Ma.slice(), t && t.forEach((r) => {
|
|
5623
5651
|
if (this.pluginsByKey[r.key])
|
|
5624
5652
|
throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
|
|
5625
|
-
this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new
|
|
5653
|
+
this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new Et(r.key, r.spec.state, r));
|
|
5626
5654
|
});
|
|
5627
5655
|
}
|
|
5628
5656
|
}
|
|
@@ -5774,7 +5802,7 @@ class mt {
|
|
|
5774
5802
|
if (o.name == "doc")
|
|
5775
5803
|
s.doc = Fe.fromJSON(e.schema, t.doc);
|
|
5776
5804
|
else if (o.name == "selection")
|
|
5777
|
-
s.selection =
|
|
5805
|
+
s.selection = v.fromJSON(s.doc, t.selection);
|
|
5778
5806
|
else if (o.name == "storedMarks")
|
|
5779
5807
|
t.storedMarks && (s.storedMarks = t.storedMarks.map(e.schema.markFromJSON));
|
|
5780
5808
|
else {
|
|
@@ -5852,15 +5880,15 @@ const Te = function(n, e, t) {
|
|
|
5852
5880
|
}, wa = function() {
|
|
5853
5881
|
Mr = null;
|
|
5854
5882
|
}, ot = function(n, e, t, r) {
|
|
5855
|
-
return t && (
|
|
5883
|
+
return t && (vi(n, e, t, r, -1) || vi(n, e, t, r, 1));
|
|
5856
5884
|
}, Ca = /^(img|br|input|textarea|hr)$/i;
|
|
5857
|
-
function
|
|
5885
|
+
function vi(n, e, t, r, i) {
|
|
5858
5886
|
for (var s; ; ) {
|
|
5859
5887
|
if (n == t && e == r)
|
|
5860
5888
|
return !0;
|
|
5861
5889
|
if (e == (i < 0 ? 0 : fe(n))) {
|
|
5862
5890
|
let o = n.parentNode;
|
|
5863
|
-
if (!o || o.nodeType != 1 ||
|
|
5891
|
+
if (!o || o.nodeType != 1 || Yt(n) || Ca.test(n.nodeName) || n.contentEditable == "false")
|
|
5864
5892
|
return !1;
|
|
5865
5893
|
e = J(n) + (i < 0 ? 0 : 1), n = o;
|
|
5866
5894
|
} else if (n.nodeType == 1) {
|
|
@@ -5887,7 +5915,7 @@ function Ta(n, e) {
|
|
|
5887
5915
|
if (n.contentEditable == "false")
|
|
5888
5916
|
return null;
|
|
5889
5917
|
n = n.childNodes[e - 1], e = fe(n);
|
|
5890
|
-
} else if (n.parentNode && !
|
|
5918
|
+
} else if (n.parentNode && !Yt(n))
|
|
5891
5919
|
e = J(n), n = n.parentNode;
|
|
5892
5920
|
else
|
|
5893
5921
|
return null;
|
|
@@ -5901,13 +5929,13 @@ function Oa(n, e) {
|
|
|
5901
5929
|
if (n.contentEditable == "false")
|
|
5902
5930
|
return null;
|
|
5903
5931
|
n = n.childNodes[e], e = 0;
|
|
5904
|
-
} else if (n.parentNode && !
|
|
5932
|
+
} else if (n.parentNode && !Yt(n))
|
|
5905
5933
|
e = J(n) + 1, n = n.parentNode;
|
|
5906
5934
|
else
|
|
5907
5935
|
return null;
|
|
5908
5936
|
}
|
|
5909
5937
|
}
|
|
5910
|
-
function
|
|
5938
|
+
function va(n, e, t) {
|
|
5911
5939
|
for (let r = e == 0, i = e == fe(n); r || i; ) {
|
|
5912
5940
|
if (n == t)
|
|
5913
5941
|
return !0;
|
|
@@ -5917,7 +5945,7 @@ function Ea(n, e, t) {
|
|
|
5917
5945
|
r = r && s == 0, i = i && s == fe(n);
|
|
5918
5946
|
}
|
|
5919
5947
|
}
|
|
5920
|
-
function
|
|
5948
|
+
function Yt(n) {
|
|
5921
5949
|
let e;
|
|
5922
5950
|
for (let t = n; t && !(e = t.pmViewDesc); t = t.parentNode)
|
|
5923
5951
|
;
|
|
@@ -5930,7 +5958,7 @@ function Ue(n, e) {
|
|
|
5930
5958
|
let t = document.createEvent("Event");
|
|
5931
5959
|
return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
|
|
5932
5960
|
}
|
|
5933
|
-
function
|
|
5961
|
+
function Ea(n) {
|
|
5934
5962
|
let e = n.activeElement;
|
|
5935
5963
|
for (; e && e.shadowRoot; )
|
|
5936
5964
|
e = e.shadowRoot.activeElement;
|
|
@@ -5950,9 +5978,9 @@ function Na(n, e, t) {
|
|
|
5950
5978
|
return { node: r.startContainer, offset: Math.min(fe(r.startContainer), r.startOffset) };
|
|
5951
5979
|
}
|
|
5952
5980
|
}
|
|
5953
|
-
const xe = typeof navigator < "u" ? navigator : null,
|
|
5981
|
+
const xe = typeof navigator < "u" ? navigator : null, Ei = typeof document < "u" ? document : null, Ke = xe && xe.userAgent || "", wr = /Edge\/(\d+)/.exec(Ke), ro = /MSIE \d/.exec(Ke), Cr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ke), ie = !!(ro || Cr || wr), Ve = ro ? document.documentMode : Cr ? +Cr[1] : wr ? +wr[1] : 0, pe = !ie && /gecko\/(\d+)/i.test(Ke);
|
|
5954
5982
|
pe && +(/Firefox\/(\d+)/.exec(Ke) || [0, 0])[1];
|
|
5955
|
-
const Tr = !ie && /Chrome\/(\d+)/.exec(Ke), _ = !!Tr, io = Tr ? +Tr[1] : 0, Z = !ie && !!xe && /Apple Computer/.test(xe.vendor), St = Z && (/Mobile\/\w+/.test(Ke) || !!xe && xe.maxTouchPoints > 2), ue = St || (xe ? /Mac/.test(xe.platform) : !1), so = xe ? /Win/.test(xe.platform) : !1,
|
|
5983
|
+
const Tr = !ie && /Chrome\/(\d+)/.exec(Ke), _ = !!Tr, io = Tr ? +Tr[1] : 0, Z = !ie && !!xe && /Apple Computer/.test(xe.vendor), St = Z && (/Mobile\/\w+/.test(Ke) || !!xe && xe.maxTouchPoints > 2), ue = St || (xe ? /Mac/.test(xe.platform) : !1), so = xe ? /Win/.test(xe.platform) : !1, ve = /Android \d/.test(Ke), Zt = !!Ei && "webkitFontSmoothing" in Ei.documentElement.style, Aa = Zt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
5956
5984
|
function Da(n) {
|
|
5957
5985
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
5958
5986
|
return e ? {
|
|
@@ -6717,7 +6745,7 @@ class lt extends Qt {
|
|
|
6717
6745
|
}
|
|
6718
6746
|
slice(e, t, r) {
|
|
6719
6747
|
let i = lt.create(this.parent, this.mark, !0, r), s = this.children, o = this.size;
|
|
6720
|
-
t < o && (s =
|
|
6748
|
+
t < o && (s = vr(s, t, o, r)), e > 0 && (s = vr(s, 0, e, r));
|
|
6721
6749
|
for (let l = 0; l < s.length; l++)
|
|
6722
6750
|
s[l].parent = i;
|
|
6723
6751
|
return i.children = s, i;
|
|
@@ -6827,7 +6855,7 @@ class He extends Qt {
|
|
|
6827
6855
|
s.pmViewDesc && (s.pmViewDesc = void 0);
|
|
6828
6856
|
}
|
|
6829
6857
|
let o = new Ja(this, s, t, i);
|
|
6830
|
-
e.input.compositionNodes.push(o), this.children =
|
|
6858
|
+
e.input.compositionNodes.push(o), this.children = vr(this.children, r, r + i.length, e, o);
|
|
6831
6859
|
}
|
|
6832
6860
|
// If this desc must be updated to match the given node decoration,
|
|
6833
6861
|
// do so and return true.
|
|
@@ -6974,11 +7002,11 @@ const Dt = function(n) {
|
|
|
6974
7002
|
n && (this.nodeName = n);
|
|
6975
7003
|
};
|
|
6976
7004
|
Dt.prototype = /* @__PURE__ */ Object.create(null);
|
|
6977
|
-
const
|
|
7005
|
+
const Xe = [new Dt()];
|
|
6978
7006
|
function Or(n, e, t) {
|
|
6979
7007
|
if (n.length == 0)
|
|
6980
|
-
return
|
|
6981
|
-
let r = t ?
|
|
7008
|
+
return Xe;
|
|
7009
|
+
let r = t ? Xe[0] : new Dt(), i = [r];
|
|
6982
7010
|
for (let s = 0; s < n.length; s++) {
|
|
6983
7011
|
let o = n[s].type.attrs;
|
|
6984
7012
|
if (o) {
|
|
@@ -6992,16 +7020,16 @@ function Or(n, e, t) {
|
|
|
6992
7020
|
return i;
|
|
6993
7021
|
}
|
|
6994
7022
|
function go(n, e, t, r) {
|
|
6995
|
-
if (t ==
|
|
7023
|
+
if (t == Xe && r == Xe)
|
|
6996
7024
|
return e;
|
|
6997
7025
|
let i = e;
|
|
6998
7026
|
for (let s = 0; s < r.length; s++) {
|
|
6999
7027
|
let o = r[s], l = t[s];
|
|
7000
7028
|
if (s) {
|
|
7001
7029
|
let a;
|
|
7002
|
-
l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l =
|
|
7030
|
+
l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = Xe[0]), i = a;
|
|
7003
7031
|
}
|
|
7004
|
-
_a(i, l ||
|
|
7032
|
+
_a(i, l || Xe[0], o);
|
|
7005
7033
|
}
|
|
7006
7034
|
return i;
|
|
7007
7035
|
}
|
|
@@ -7028,7 +7056,7 @@ function _a(n, e, t) {
|
|
|
7028
7056
|
}
|
|
7029
7057
|
}
|
|
7030
7058
|
function yo(n, e, t) {
|
|
7031
|
-
return go(n, n,
|
|
7059
|
+
return go(n, n, Xe, Or(e, t, n.nodeType != 1));
|
|
7032
7060
|
}
|
|
7033
7061
|
function xn(n, e) {
|
|
7034
7062
|
if (n.length != e.length)
|
|
@@ -7044,7 +7072,7 @@ function Li(n) {
|
|
|
7044
7072
|
}
|
|
7045
7073
|
class Ga {
|
|
7046
7074
|
constructor(e, t, r) {
|
|
7047
|
-
this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch =
|
|
7075
|
+
this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = Xa(e.node.content, e);
|
|
7048
7076
|
}
|
|
7049
7077
|
// Destroy and remove the children between the given indices in
|
|
7050
7078
|
// `this.top`.
|
|
@@ -7193,7 +7221,7 @@ class Ga {
|
|
|
7193
7221
|
return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
|
|
7194
7222
|
}
|
|
7195
7223
|
}
|
|
7196
|
-
function
|
|
7224
|
+
function Xa(n, e) {
|
|
7197
7225
|
let t = e, r = t.children.length, i = n.childCount, s = /* @__PURE__ */ new Map(), o = [];
|
|
7198
7226
|
e: for (; i > 0; ) {
|
|
7199
7227
|
let l;
|
|
@@ -7220,7 +7248,7 @@ function Ya(n, e) {
|
|
|
7220
7248
|
}
|
|
7221
7249
|
return { index: i, matched: s, matches: o.reverse() };
|
|
7222
7250
|
}
|
|
7223
|
-
function
|
|
7251
|
+
function Ya(n, e) {
|
|
7224
7252
|
return n.type.side - e.type.side;
|
|
7225
7253
|
}
|
|
7226
7254
|
function Za(n, e, t, r) {
|
|
@@ -7241,7 +7269,7 @@ function Za(n, e, t, r) {
|
|
|
7241
7269
|
}
|
|
7242
7270
|
if (d)
|
|
7243
7271
|
if (u) {
|
|
7244
|
-
u.sort(
|
|
7272
|
+
u.sort(Ya);
|
|
7245
7273
|
for (let g = 0; g < u.length; g++)
|
|
7246
7274
|
t(u[g], c, !!a);
|
|
7247
7275
|
} else
|
|
@@ -7301,7 +7329,7 @@ function ec(n, e, t, r) {
|
|
|
7301
7329
|
}
|
|
7302
7330
|
return -1;
|
|
7303
7331
|
}
|
|
7304
|
-
function
|
|
7332
|
+
function vr(n, e, t, r, i) {
|
|
7305
7333
|
let s = [];
|
|
7306
7334
|
for (let o = 0, l = 0; o < n.length; o++) {
|
|
7307
7335
|
let a = n[o], c = l, d = l += a.size;
|
|
@@ -7321,7 +7349,7 @@ function Wr(n, e = null) {
|
|
|
7321
7349
|
for (a = o; i && !i.node; )
|
|
7322
7350
|
i = i.parent;
|
|
7323
7351
|
let u = i.node;
|
|
7324
|
-
if (i && u.isAtom && S.isSelectable(u) && i.parent && !(u.isInline &&
|
|
7352
|
+
if (i && u.isAtom && S.isSelectable(u) && i.parent && !(u.isInline && va(t.focusNode, t.focusOffset, i.dom))) {
|
|
7325
7353
|
let f = i.posBefore;
|
|
7326
7354
|
c = new S(o == f ? l : r.resolve(f));
|
|
7327
7355
|
}
|
|
@@ -7434,9 +7462,9 @@ function rc(n) {
|
|
|
7434
7462
|
let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
|
|
7435
7463
|
return ot(e.node, e.offset, t.anchorNode, t.anchorOffset);
|
|
7436
7464
|
}
|
|
7437
|
-
function
|
|
7465
|
+
function Er(n, e) {
|
|
7438
7466
|
let { $anchor: t, $head: r } = n.selection, i = e > 0 ? t.max(r) : t.min(r), s = i.parent.inlineContent ? i.depth ? n.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
|
|
7439
|
-
return s &&
|
|
7467
|
+
return s && v.findFrom(s, e);
|
|
7440
7468
|
}
|
|
7441
7469
|
function Ie(n, e) {
|
|
7442
7470
|
return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()), !0;
|
|
@@ -7452,7 +7480,7 @@ function Wi(n, e, t) {
|
|
|
7452
7480
|
return Ie(n, new M(r.$anchor, o));
|
|
7453
7481
|
} else if (r.empty) {
|
|
7454
7482
|
if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
|
|
7455
|
-
let i =
|
|
7483
|
+
let i = Er(n.state, e);
|
|
7456
7484
|
return i && i instanceof S ? Ie(n, i) : !1;
|
|
7457
7485
|
} else if (!(ue && t.indexOf("m") > -1)) {
|
|
7458
7486
|
let i = r.$head, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, o;
|
|
@@ -7466,7 +7494,7 @@ function Wi(n, e, t) {
|
|
|
7466
7494
|
if (r instanceof S && r.node.isInline)
|
|
7467
7495
|
return Ie(n, new M(e > 0 ? r.$to : r.$from));
|
|
7468
7496
|
{
|
|
7469
|
-
let i =
|
|
7497
|
+
let i = Er(n.state, e);
|
|
7470
7498
|
return i ? Ie(n, i) : !1;
|
|
7471
7499
|
}
|
|
7472
7500
|
}
|
|
@@ -7554,7 +7582,7 @@ function So(n) {
|
|
|
7554
7582
|
return e && e.node && e.node.isBlock;
|
|
7555
7583
|
}
|
|
7556
7584
|
function oc(n, e) {
|
|
7557
|
-
for (; n && e == n.childNodes.length && !
|
|
7585
|
+
for (; n && e == n.childNodes.length && !Yt(n); )
|
|
7558
7586
|
e = J(n) + 1, n = n.parentNode;
|
|
7559
7587
|
for (; n && e < n.childNodes.length; ) {
|
|
7560
7588
|
let t = n.childNodes[e];
|
|
@@ -7566,7 +7594,7 @@ function oc(n, e) {
|
|
|
7566
7594
|
}
|
|
7567
7595
|
}
|
|
7568
7596
|
function lc(n, e) {
|
|
7569
|
-
for (; n && !e && !
|
|
7597
|
+
for (; n && !e && !Yt(n); )
|
|
7570
7598
|
e = J(n), n = n.parentNode;
|
|
7571
7599
|
for (; n && e; ) {
|
|
7572
7600
|
let t = n.childNodes[e - 1];
|
|
@@ -7618,12 +7646,12 @@ function ji(n, e, t) {
|
|
|
7618
7646
|
return !1;
|
|
7619
7647
|
let { $from: i, $to: s } = r;
|
|
7620
7648
|
if (!i.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
|
|
7621
|
-
let o =
|
|
7649
|
+
let o = Er(n.state, e);
|
|
7622
7650
|
if (o && o instanceof S)
|
|
7623
7651
|
return Ie(n, o);
|
|
7624
7652
|
}
|
|
7625
7653
|
if (!i.parent.inlineContent) {
|
|
7626
|
-
let o = e < 0 ? i : s, l = r instanceof ce ?
|
|
7654
|
+
let o = e < 0 ? i : s, l = r instanceof ce ? v.near(o, e) : v.findFrom(o, e);
|
|
7627
7655
|
return l ? Ie(n, l) : !1;
|
|
7628
7656
|
}
|
|
7629
7657
|
return !1;
|
|
@@ -7696,7 +7724,7 @@ function jr(n, e) {
|
|
|
7696
7724
|
let h = r.firstChild;
|
|
7697
7725
|
t.push(h.type.name, h.attrs != h.type.defaultAttrs ? h.attrs : null), r = h.content;
|
|
7698
7726
|
}
|
|
7699
|
-
let o = n.someProp("clipboardSerializer") || dt.fromSchema(n.state.schema), l =
|
|
7727
|
+
let o = n.someProp("clipboardSerializer") || dt.fromSchema(n.state.schema), l = vo(), a = l.createElement("div");
|
|
7700
7728
|
a.appendChild(o.serializeFragment(r, { document: l }));
|
|
7701
7729
|
let c = a.firstChild, d, u = 0;
|
|
7702
7730
|
for (; c && c.nodeType == 1 && (d = Oo[c.nodeName.toLowerCase()]); ) {
|
|
@@ -7834,7 +7862,7 @@ const Oo = {
|
|
|
7834
7862
|
th: ["table", "tbody", "tr"]
|
|
7835
7863
|
};
|
|
7836
7864
|
let _i = null;
|
|
7837
|
-
function
|
|
7865
|
+
function vo() {
|
|
7838
7866
|
return _i || (_i = document.implementation.createHTMLDocument("title"));
|
|
7839
7867
|
}
|
|
7840
7868
|
let rr = null;
|
|
@@ -7845,7 +7873,7 @@ function hc(n) {
|
|
|
7845
7873
|
function pc(n) {
|
|
7846
7874
|
let e = /^(\s*<meta [^>]*>)*/.exec(n);
|
|
7847
7875
|
e && (n = n.slice(e[0].length));
|
|
7848
|
-
let t =
|
|
7876
|
+
let t = vo().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), i;
|
|
7849
7877
|
if ((i = r && Oo[r[1].toLowerCase()]) && (n = i.map((s) => "<" + s + ">").join("") + n + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = hc(n), i)
|
|
7850
7878
|
for (let s = 0; s < i.length; s++)
|
|
7851
7879
|
t = t.querySelector(i[s]) || t;
|
|
@@ -7927,7 +7955,7 @@ function Mc(n, e) {
|
|
|
7927
7955
|
}
|
|
7928
7956
|
te.keydown = (n, e) => {
|
|
7929
7957
|
let t = e;
|
|
7930
|
-
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !No(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(
|
|
7958
|
+
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !No(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(ve && _ && t.keyCode == 13)))
|
|
7931
7959
|
if (t.keyCode != 229 && n.domObserver.forceFlush(), St && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
7932
7960
|
let r = Date.now();
|
|
7933
7961
|
n.input.lastIOSEnter = r, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
@@ -7998,10 +8026,10 @@ function Tc(n, e) {
|
|
|
7998
8026
|
function Oc(n, e, t, r, i) {
|
|
7999
8027
|
return Jr(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? Tc(n, t) : Cc(n, t));
|
|
8000
8028
|
}
|
|
8001
|
-
function
|
|
8029
|
+
function vc(n, e, t, r) {
|
|
8002
8030
|
return Jr(n, "handleDoubleClickOn", e, t, r) || n.someProp("handleDoubleClick", (i) => i(n, e, r));
|
|
8003
8031
|
}
|
|
8004
|
-
function
|
|
8032
|
+
function Ec(n, e, t, r) {
|
|
8005
8033
|
return Jr(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) || Nc(n, t, r);
|
|
8006
8034
|
}
|
|
8007
8035
|
function Nc(n, e, t) {
|
|
@@ -8025,18 +8053,18 @@ function Nc(n, e, t) {
|
|
|
8025
8053
|
function Ur(n) {
|
|
8026
8054
|
return Mn(n);
|
|
8027
8055
|
}
|
|
8028
|
-
const
|
|
8056
|
+
const Eo = ue ? "metaKey" : "ctrlKey";
|
|
8029
8057
|
ee.mousedown = (n, e) => {
|
|
8030
8058
|
let t = e;
|
|
8031
8059
|
n.input.shiftKey = t.shiftKey;
|
|
8032
8060
|
let r = Ur(n), i = Date.now(), s = "singleClick";
|
|
8033
|
-
i - n.input.lastClick.time < 500 && wc(t, n.input.lastClick) && !t[
|
|
8061
|
+
i - n.input.lastClick.time < 500 && wc(t, n.input.lastClick) && !t[Eo] && 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 };
|
|
8034
8062
|
let o = n.posAtCoords($n(t));
|
|
8035
|
-
o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Ac(n, o, t, !!r)) : (s == "doubleClick" ?
|
|
8063
|
+
o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Ac(n, o, t, !!r)) : (s == "doubleClick" ? vc : Ec)(n, o.pos, o.inside, t) ? t.preventDefault() : ze(n, "pointer"));
|
|
8036
8064
|
};
|
|
8037
8065
|
class Ac {
|
|
8038
8066
|
constructor(e, t, r, i) {
|
|
8039
|
-
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[
|
|
8067
|
+
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[Eo], this.allowDefault = r.shiftKey;
|
|
8040
8068
|
let s, o;
|
|
8041
8069
|
if (t.inside > -1)
|
|
8042
8070
|
s = e.state.doc.nodeAt(t.inside), o = t.inside;
|
|
@@ -8071,7 +8099,7 @@ class Ac {
|
|
|
8071
8099
|
// (hidden) cursor is doesn't change the selection, and
|
|
8072
8100
|
// thus doesn't get a reaction from ProseMirror. This
|
|
8073
8101
|
// works around that.
|
|
8074
|
-
_ && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (bt(this.view,
|
|
8102
|
+
_ && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (bt(this.view, v.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : ze(this.view, "pointer");
|
|
8075
8103
|
}
|
|
8076
8104
|
move(e) {
|
|
8077
8105
|
this.updateAllowDefault(e), ze(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
@@ -8090,7 +8118,7 @@ ee.contextmenu = (n) => Ur(n);
|
|
|
8090
8118
|
function No(n, e) {
|
|
8091
8119
|
return n.composing ? !0 : Z && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
|
|
8092
8120
|
}
|
|
8093
|
-
const Dc =
|
|
8121
|
+
const Dc = ve ? 5e3 : -1;
|
|
8094
8122
|
te.compositionstart = te.compositionupdate = (n) => {
|
|
8095
8123
|
if (!n.composing) {
|
|
8096
8124
|
n.domObserver.flush();
|
|
@@ -8156,7 +8184,7 @@ function Pc() {
|
|
|
8156
8184
|
return n.initEvent("event", !0, !0), n.timeStamp;
|
|
8157
8185
|
}
|
|
8158
8186
|
function Mn(n, e = !1) {
|
|
8159
|
-
if (!(
|
|
8187
|
+
if (!(ve && n.domObserver.flushingSoon >= 0)) {
|
|
8160
8188
|
if (n.domObserver.forceFlush(), Do(n), e || n.docView && n.docView.dirty) {
|
|
8161
8189
|
let t = Wr(n), r = n.state.selection;
|
|
8162
8190
|
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;
|
|
@@ -8213,7 +8241,7 @@ function Io(n) {
|
|
|
8213
8241
|
}
|
|
8214
8242
|
te.paste = (n, e) => {
|
|
8215
8243
|
let t = e;
|
|
8216
|
-
if (n.composing && !
|
|
8244
|
+
if (n.composing && !ve)
|
|
8217
8245
|
return;
|
|
8218
8246
|
let r = Ft ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
|
|
8219
8247
|
r && $t(n, Io(r), r.getData("text/html"), i, t) ? t.preventDefault() : zc(n, t);
|
|
@@ -8278,7 +8306,7 @@ function $c(n, e, t) {
|
|
|
8278
8306
|
if (!s)
|
|
8279
8307
|
return;
|
|
8280
8308
|
e.preventDefault();
|
|
8281
|
-
let l = s ?
|
|
8309
|
+
let l = s ? Xs(n.state.doc, i.pos, s) : i.pos;
|
|
8282
8310
|
l == null && (l = i.pos);
|
|
8283
8311
|
let a = n.state.tr;
|
|
8284
8312
|
if (o) {
|
|
@@ -8307,7 +8335,7 @@ ee.blur = (n, e) => {
|
|
|
8307
8335
|
n.focused && (n.domObserver.stop(), n.dom.classList.remove("ProseMirror-focused"), n.domObserver.start(), t.relatedTarget && n.dom.contains(t.relatedTarget) && n.domObserver.currentSelection.clear(), n.focused = !1);
|
|
8308
8336
|
};
|
|
8309
8337
|
ee.beforeinput = (n, e) => {
|
|
8310
|
-
if (_ &&
|
|
8338
|
+
if (_ && ve && e.inputType == "deleteContentBackward") {
|
|
8311
8339
|
n.domObserver.flushSoon();
|
|
8312
8340
|
let { domChangeCount: r } = n.input;
|
|
8313
8341
|
setTimeout(() => {
|
|
@@ -8475,7 +8503,7 @@ class z {
|
|
|
8475
8503
|
you must make a copy if you want need to preserve that.
|
|
8476
8504
|
*/
|
|
8477
8505
|
static create(e, t) {
|
|
8478
|
-
return t.length ? Cn(t, e, 0, tt) :
|
|
8506
|
+
return t.length ? Cn(t, e, 0, tt) : Y;
|
|
8479
8507
|
}
|
|
8480
8508
|
/**
|
|
8481
8509
|
Find all decorations in this set which touch the given range
|
|
@@ -8505,7 +8533,7 @@ class z {
|
|
|
8505
8533
|
document.
|
|
8506
8534
|
*/
|
|
8507
8535
|
map(e, t, r) {
|
|
8508
|
-
return this ==
|
|
8536
|
+
return this == Y || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, r || tt);
|
|
8509
8537
|
}
|
|
8510
8538
|
/**
|
|
8511
8539
|
@internal
|
|
@@ -8516,7 +8544,7 @@ class z {
|
|
|
8516
8544
|
let a = this.local[l].map(e, r, i);
|
|
8517
8545
|
a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
|
|
8518
8546
|
}
|
|
8519
|
-
return this.children.length ? Vc(this.children, o || [], e, t, r, i, s) : o ? new z(o.sort(nt), pt) :
|
|
8547
|
+
return this.children.length ? Vc(this.children, o || [], e, t, r, i, s) : o ? new z(o.sort(nt), pt) : Y;
|
|
8520
8548
|
}
|
|
8521
8549
|
/**
|
|
8522
8550
|
Add the given array of decorations to the ones in the set,
|
|
@@ -8525,7 +8553,7 @@ class z {
|
|
|
8525
8553
|
structure.
|
|
8526
8554
|
*/
|
|
8527
8555
|
add(e, t) {
|
|
8528
|
-
return t.length ? this ==
|
|
8556
|
+
return t.length ? this == Y ? z.create(e, t) : this.addInner(e, t, 0) : this;
|
|
8529
8557
|
}
|
|
8530
8558
|
addInner(e, t, r) {
|
|
8531
8559
|
let i, s = 0;
|
|
@@ -8547,7 +8575,7 @@ class z {
|
|
|
8547
8575
|
the ones in the given array.
|
|
8548
8576
|
*/
|
|
8549
8577
|
remove(e) {
|
|
8550
|
-
return e.length == 0 || this ==
|
|
8578
|
+
return e.length == 0 || this == Y ? this : this.removeInner(e, 0);
|
|
8551
8579
|
}
|
|
8552
8580
|
removeInner(e, t) {
|
|
8553
8581
|
let r = this.children, i = this.local;
|
|
@@ -8559,7 +8587,7 @@ class z {
|
|
|
8559
8587
|
continue;
|
|
8560
8588
|
r == this.children && (r = this.children.slice());
|
|
8561
8589
|
let c = r[s + 2].removeInner(o, l + 1);
|
|
8562
|
-
c !=
|
|
8590
|
+
c != Y ? r[s + 2] = c : (r.splice(s, 3), s -= 3);
|
|
8563
8591
|
}
|
|
8564
8592
|
if (i.length) {
|
|
8565
8593
|
for (let s = 0, o; s < e.length; s++)
|
|
@@ -8567,10 +8595,10 @@ class z {
|
|
|
8567
8595
|
for (let l = 0; l < i.length; l++)
|
|
8568
8596
|
i[l].eq(o, t) && (i == this.local && (i = this.local.slice()), i.splice(l--, 1));
|
|
8569
8597
|
}
|
|
8570
|
-
return r == this.children && i == this.local ? this : i.length || r.length ? new z(i, r) :
|
|
8598
|
+
return r == this.children && i == this.local ? this : i.length || r.length ? new z(i, r) : Y;
|
|
8571
8599
|
}
|
|
8572
8600
|
forChild(e, t) {
|
|
8573
|
-
if (this ==
|
|
8601
|
+
if (this == Y)
|
|
8574
8602
|
return this;
|
|
8575
8603
|
if (t.isLeaf)
|
|
8576
8604
|
return z.empty;
|
|
@@ -8592,7 +8620,7 @@ class z {
|
|
|
8592
8620
|
let l = new z(i.sort(nt), pt);
|
|
8593
8621
|
return r ? new Pe([l, r]) : l;
|
|
8594
8622
|
}
|
|
8595
|
-
return r ||
|
|
8623
|
+
return r || Y;
|
|
8596
8624
|
}
|
|
8597
8625
|
/**
|
|
8598
8626
|
@internal
|
|
@@ -8620,7 +8648,7 @@ class z {
|
|
|
8620
8648
|
@internal
|
|
8621
8649
|
*/
|
|
8622
8650
|
localsInner(e) {
|
|
8623
|
-
if (this ==
|
|
8651
|
+
if (this == Y)
|
|
8624
8652
|
return pt;
|
|
8625
8653
|
if (e.inlineContent || !this.local.some(We.is))
|
|
8626
8654
|
return this.local;
|
|
@@ -8635,7 +8663,7 @@ class z {
|
|
|
8635
8663
|
}
|
|
8636
8664
|
z.empty = new z([], []);
|
|
8637
8665
|
z.removeOverlap = Gr;
|
|
8638
|
-
const
|
|
8666
|
+
const Y = z.empty;
|
|
8639
8667
|
class Pe {
|
|
8640
8668
|
constructor(e) {
|
|
8641
8669
|
this.members = e;
|
|
@@ -8650,7 +8678,7 @@ class Pe {
|
|
|
8650
8678
|
let r = [];
|
|
8651
8679
|
for (let i = 0; i < this.members.length; i++) {
|
|
8652
8680
|
let s = this.members[i].forChild(e, t);
|
|
8653
|
-
s !=
|
|
8681
|
+
s != Y && (s instanceof Pe ? r = r.concat(s.members) : r.push(s));
|
|
8654
8682
|
}
|
|
8655
8683
|
return Pe.from(r);
|
|
8656
8684
|
}
|
|
@@ -8682,7 +8710,7 @@ class Pe {
|
|
|
8682
8710
|
static from(e) {
|
|
8683
8711
|
switch (e.length) {
|
|
8684
8712
|
case 0:
|
|
8685
|
-
return
|
|
8713
|
+
return Y;
|
|
8686
8714
|
case 1:
|
|
8687
8715
|
return e[0];
|
|
8688
8716
|
default:
|
|
@@ -8725,7 +8753,7 @@ function Vc(n, e, t, r, i, s, o) {
|
|
|
8725
8753
|
let f = t.map(n[c + 1] + s, -1), h = f - i, { index: p, offset: m } = r.content.findIndex(u), g = r.maybeChild(p);
|
|
8726
8754
|
if (g && m == u && m + g.nodeSize == h) {
|
|
8727
8755
|
let y = l[c + 2].mapInner(t, g, d + 1, n[c] + s + 1, o);
|
|
8728
|
-
y !=
|
|
8756
|
+
y != Y ? (l[c] = u, l[c + 1] = h, l[c + 2] = y) : (l[c + 1] = -2, a = !0);
|
|
8729
8757
|
} else
|
|
8730
8758
|
a = !0;
|
|
8731
8759
|
}
|
|
@@ -8787,13 +8815,13 @@ function Cn(n, e, t, r) {
|
|
|
8787
8815
|
if (c) {
|
|
8788
8816
|
s = !0;
|
|
8789
8817
|
let d = Cn(c, l, t + a + 1, r);
|
|
8790
|
-
d !=
|
|
8818
|
+
d != Y && i.push(a, a + l.nodeSize, d);
|
|
8791
8819
|
}
|
|
8792
8820
|
});
|
|
8793
8821
|
let o = Bo(s ? zo(n) : n, -t).sort(nt);
|
|
8794
8822
|
for (let l = 0; l < o.length; l++)
|
|
8795
8823
|
o[l].type.valid(e, o[l]) || (r.onRemove && r.onRemove(o[l].spec), o.splice(l--, 1));
|
|
8796
|
-
return o.length || i.length ? new z(o, i) :
|
|
8824
|
+
return o.length || i.length ? new z(o, i) : Y;
|
|
8797
8825
|
}
|
|
8798
8826
|
function nt(n, e) {
|
|
8799
8827
|
return n.from - e.from || n.to - e.to;
|
|
@@ -8825,7 +8853,7 @@ function ir(n) {
|
|
|
8825
8853
|
let e = [];
|
|
8826
8854
|
return n.someProp("decorations", (t) => {
|
|
8827
8855
|
let r = t(n.state);
|
|
8828
|
-
r && r !=
|
|
8856
|
+
r && r != Y && e.push(r);
|
|
8829
8857
|
}), n.cursorWrapper && e.push(z.create(n.state.doc, [n.cursorWrapper.deco])), Pe.from(e);
|
|
8830
8858
|
}
|
|
8831
8859
|
const Wc = {
|
|
@@ -8969,7 +8997,7 @@ class Kc {
|
|
|
8969
8997
|
}
|
|
8970
8998
|
}
|
|
8971
8999
|
let c = null;
|
|
8972
|
-
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && zn(r) && (c = Wr(e)) && c.eq(
|
|
9000
|
+
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && zn(r) && (c = Wr(e)) && c.eq(v.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Ne(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Jc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, Gc(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || Ne(e), this.currentSelection.set(r));
|
|
8973
9001
|
}
|
|
8974
9002
|
registerMutation(e, t) {
|
|
8975
9003
|
if (t.indexOf(e.target) > -1)
|
|
@@ -9004,12 +9032,12 @@ class Kc {
|
|
|
9004
9032
|
});
|
|
9005
9033
|
}
|
|
9006
9034
|
}
|
|
9007
|
-
let
|
|
9035
|
+
let Xi = /* @__PURE__ */ new WeakMap(), Yi = !1;
|
|
9008
9036
|
function Jc(n) {
|
|
9009
|
-
if (!
|
|
9010
|
-
if (n.requiresGeckoHackNode = pe,
|
|
9037
|
+
if (!Xi.has(n) && (Xi.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
|
|
9038
|
+
if (n.requiresGeckoHackNode = pe, Yi)
|
|
9011
9039
|
return;
|
|
9012
|
-
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."),
|
|
9040
|
+
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."), Yi = !0;
|
|
9013
9041
|
}
|
|
9014
9042
|
}
|
|
9015
9043
|
function Zi(n, e) {
|
|
@@ -9057,7 +9085,7 @@ function Gc(n, e) {
|
|
|
9057
9085
|
s.parentNode.removeChild(s);
|
|
9058
9086
|
}
|
|
9059
9087
|
}
|
|
9060
|
-
function
|
|
9088
|
+
function Xc(n, e, t) {
|
|
9061
9089
|
let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
|
|
9062
9090
|
if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], zn(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), _ && n.input.lastKeyCode === 8)
|
|
9063
9091
|
for (let g = s; g > i; g--) {
|
|
@@ -9077,7 +9105,7 @@ function Yc(n, e, t) {
|
|
|
9077
9105
|
to: s,
|
|
9078
9106
|
preserveWhitespace: h.parent.type.whitespace == "pre" ? "full" : !0,
|
|
9079
9107
|
findPositions: c,
|
|
9080
|
-
ruleFromNode:
|
|
9108
|
+
ruleFromNode: Yc,
|
|
9081
9109
|
context: h
|
|
9082
9110
|
});
|
|
9083
9111
|
if (c && c[0].pos != null) {
|
|
@@ -9086,7 +9114,7 @@ function Yc(n, e, t) {
|
|
|
9086
9114
|
}
|
|
9087
9115
|
return { doc: m, sel: p, from: o, to: l };
|
|
9088
9116
|
}
|
|
9089
|
-
function
|
|
9117
|
+
function Yc(n) {
|
|
9090
9118
|
let e = n.pmViewDesc;
|
|
9091
9119
|
if (e)
|
|
9092
9120
|
return e.parseRule();
|
|
@@ -9106,19 +9134,19 @@ function Qc(n, e, t, r, i) {
|
|
|
9106
9134
|
if (n.input.compositionPendingChanges = 0, e < 0) {
|
|
9107
9135
|
let C = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, N = Wr(n, C);
|
|
9108
9136
|
if (N && !n.state.selection.eq(N)) {
|
|
9109
|
-
if (_ &&
|
|
9137
|
+
if (_ && ve && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (kl) => kl(n, Ue(13, "Enter"))))
|
|
9110
9138
|
return;
|
|
9111
|
-
let
|
|
9112
|
-
C == "pointer" ?
|
|
9139
|
+
let X = n.state.tr.setSelection(N);
|
|
9140
|
+
C == "pointer" ? X.setMeta("pointer", !0) : C == "key" && X.scrollIntoView(), s && X.setMeta("composition", s), n.dispatch(X);
|
|
9113
9141
|
}
|
|
9114
9142
|
return;
|
|
9115
9143
|
}
|
|
9116
9144
|
let o = n.state.doc.resolve(e), l = o.sharedDepth(t);
|
|
9117
9145
|
e = o.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
|
|
9118
|
-
let a = n.state.selection, c =
|
|
9146
|
+
let a = n.state.selection, c = Xc(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, h;
|
|
9119
9147
|
n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (f = n.state.selection.to, h = "end") : (f = n.state.selection.from, h = "start"), n.input.lastKeyCode = null;
|
|
9120
9148
|
let p = nd(u.content, c.doc.content, c.from, f, h);
|
|
9121
|
-
if (p && n.input.domChangeCount++, (St && n.input.lastIOSEnter > Date.now() - 225 ||
|
|
9149
|
+
if (p && n.input.domChangeCount++, (St && n.input.lastIOSEnter > Date.now() - 225 || ve) && i.some((C) => C.nodeType == 1 && !Zc.test(C.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (C) => C(n, Ue(13, "Enter")))) {
|
|
9122
9150
|
n.input.lastIOSEnter = 0;
|
|
9123
9151
|
return;
|
|
9124
9152
|
}
|
|
@@ -9142,10 +9170,10 @@ function Qc(n, e, t, r, i) {
|
|
|
9142
9170
|
return;
|
|
9143
9171
|
}
|
|
9144
9172
|
if (n.state.selection.anchor > p.start && td(d, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (C) => C(n, Ue(8, "Backspace")))) {
|
|
9145
|
-
|
|
9173
|
+
ve && _ && n.domObserver.suppressSelectionUpdates();
|
|
9146
9174
|
return;
|
|
9147
9175
|
}
|
|
9148
|
-
_ && p.endB == p.start && (n.input.lastChromeDelete = Date.now()),
|
|
9176
|
+
_ && p.endB == p.start && (n.input.lastChromeDelete = Date.now()), ve && !T && m.start() != g.start() && g.parentOffset == 0 && m.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, g = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
|
|
9149
9177
|
n.someProp("handleKeyDown", function(C) {
|
|
9150
9178
|
return C(n, Ue(13, "Enter"));
|
|
9151
9179
|
});
|
|
@@ -9153,8 +9181,8 @@ function Qc(n, e, t, r, i) {
|
|
|
9153
9181
|
let w = p.start, I = p.endA, D = (C) => {
|
|
9154
9182
|
let N = C || n.state.tr.replace(w, I, c.doc.slice(p.start - c.from, p.endB - c.from));
|
|
9155
9183
|
if (c.sel) {
|
|
9156
|
-
let
|
|
9157
|
-
|
|
9184
|
+
let X = Qi(n, N.doc, c.sel);
|
|
9185
|
+
X && !(_ && n.composing && X.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (X.head == w || X.head == N.mapping.map(I) - 1) || ie && X.empty && X.head == w) && N.setSelection(X);
|
|
9158
9186
|
}
|
|
9159
9187
|
return s && N.setMeta("composition", s), N.scrollIntoView();
|
|
9160
9188
|
}, L;
|
|
@@ -9171,7 +9199,7 @@ function Qc(n, e, t, r, i) {
|
|
|
9171
9199
|
L.type == "add" ? C.addMark(w, I, L.mark) : C.removeMark(w, I, L.mark), n.dispatch(C);
|
|
9172
9200
|
} else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
|
|
9173
9201
|
let C = m.parent.textBetween(m.parentOffset, g.parentOffset), N = () => D(n.state.tr.insertText(C, w, I));
|
|
9174
|
-
n.someProp("handleTextInput", (
|
|
9202
|
+
n.someProp("handleTextInput", (X) => X(n, w, I, C, N)) || n.dispatch(N());
|
|
9175
9203
|
} else
|
|
9176
9204
|
n.dispatch(D());
|
|
9177
9205
|
else
|
|
@@ -9573,7 +9601,7 @@ class Fo {
|
|
|
9573
9601
|
*/
|
|
9574
9602
|
domSelectionRange() {
|
|
9575
9603
|
let e = this.domSelection();
|
|
9576
|
-
return e ? Z && this.root.nodeType === 11 &&
|
|
9604
|
+
return e ? Z && this.root.nodeType === 11 && Ea(this.dom.ownerDocument) == this.dom && Uc(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
|
|
9577
9605
|
}
|
|
9578
9606
|
/**
|
|
9579
9607
|
@internal
|
|
@@ -9775,7 +9803,7 @@ function $o(n) {
|
|
|
9775
9803
|
return !1;
|
|
9776
9804
|
};
|
|
9777
9805
|
}
|
|
9778
|
-
const
|
|
9806
|
+
const Xr = (n, e) => n.selection.empty ? !1 : (e && e(n.tr.deleteSelection().scrollIntoView()), !0);
|
|
9779
9807
|
function Vo(n, e) {
|
|
9780
9808
|
let { $cursor: t } = n.selection;
|
|
9781
9809
|
return !t || (e ? !e.endOfTextblock("backward", n) : t.parentOffset > 0) ? null : t;
|
|
@@ -9784,13 +9812,13 @@ const Ho = (n, e, t) => {
|
|
|
9784
9812
|
let r = Vo(n, t);
|
|
9785
9813
|
if (!r)
|
|
9786
9814
|
return !1;
|
|
9787
|
-
let i =
|
|
9815
|
+
let i = Yr(r);
|
|
9788
9816
|
if (!i) {
|
|
9789
9817
|
let o = r.blockRange(), l = o && wt(o);
|
|
9790
9818
|
return l == null ? !1 : (e && e(n.tr.lift(o, l).scrollIntoView()), !0);
|
|
9791
9819
|
}
|
|
9792
9820
|
let s = i.nodeBefore;
|
|
9793
|
-
if (
|
|
9821
|
+
if (Xo(n, i, e, -1))
|
|
9794
9822
|
return !0;
|
|
9795
9823
|
if (r.parent.content.size == 0 && (Mt(s, "end") || S.isSelectable(s)))
|
|
9796
9824
|
for (let o = r.depth; ; o--) {
|
|
@@ -9798,7 +9826,7 @@ const Ho = (n, e, t) => {
|
|
|
9798
9826
|
if (l && l.slice.size < l.to - l.from) {
|
|
9799
9827
|
if (e) {
|
|
9800
9828
|
let a = n.tr.step(l);
|
|
9801
|
-
a.setSelection(Mt(s, "end") ?
|
|
9829
|
+
a.setSelection(Mt(s, "end") ? v.findFrom(a.doc.resolve(a.mapping.map(i.pos, -1)), -1) : S.create(a.doc, i.pos - s.nodeSize)), e(a.scrollIntoView());
|
|
9802
9830
|
}
|
|
9803
9831
|
return !0;
|
|
9804
9832
|
}
|
|
@@ -9810,7 +9838,7 @@ const Ho = (n, e, t) => {
|
|
|
9810
9838
|
let r = Vo(n, t);
|
|
9811
9839
|
if (!r)
|
|
9812
9840
|
return !1;
|
|
9813
|
-
let i =
|
|
9841
|
+
let i = Yr(r);
|
|
9814
9842
|
return i ? Wo(n, i, e) : !1;
|
|
9815
9843
|
}, pd = (n, e, t) => {
|
|
9816
9844
|
let r = jo(n, t);
|
|
@@ -9863,12 +9891,12 @@ const qo = (n, e, t) => {
|
|
|
9863
9891
|
if (r.parent.isTextblock) {
|
|
9864
9892
|
if (t ? !t.endOfTextblock("backward", n) : r.parentOffset > 0)
|
|
9865
9893
|
return !1;
|
|
9866
|
-
s =
|
|
9894
|
+
s = Yr(r);
|
|
9867
9895
|
}
|
|
9868
9896
|
let o = s && s.nodeBefore;
|
|
9869
9897
|
return !o || !S.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(S.create(n.doc, s.pos - o.nodeSize)).scrollIntoView()), !0);
|
|
9870
9898
|
};
|
|
9871
|
-
function
|
|
9899
|
+
function Yr(n) {
|
|
9872
9900
|
if (!n.parent.type.spec.isolating)
|
|
9873
9901
|
for (let e = n.depth - 1; e >= 0; e--) {
|
|
9874
9902
|
if (n.index(e) > 0)
|
|
@@ -9890,14 +9918,14 @@ const Ko = (n, e, t) => {
|
|
|
9890
9918
|
if (!i)
|
|
9891
9919
|
return !1;
|
|
9892
9920
|
let s = i.nodeAfter;
|
|
9893
|
-
if (
|
|
9921
|
+
if (Xo(n, i, e, 1))
|
|
9894
9922
|
return !0;
|
|
9895
9923
|
if (r.parent.content.size == 0 && (Mt(s, "start") || S.isSelectable(s))) {
|
|
9896
9924
|
let o = Bn(n.doc, r.before(), r.after(), k.empty);
|
|
9897
9925
|
if (o && o.slice.size < o.to - o.from) {
|
|
9898
9926
|
if (e) {
|
|
9899
9927
|
let l = n.tr.step(o);
|
|
9900
|
-
l.setSelection(Mt(s, "start") ?
|
|
9928
|
+
l.setSelection(Mt(s, "start") ? v.findFrom(l.doc.resolve(l.mapping.map(i.pos)), 1) : S.create(l.doc, l.mapping.map(i.pos))), e(l.scrollIntoView());
|
|
9901
9929
|
}
|
|
9902
9930
|
return !0;
|
|
9903
9931
|
}
|
|
@@ -9973,7 +10001,7 @@ const bd = (n, e) => {
|
|
|
9973
10001
|
return !1;
|
|
9974
10002
|
if (e) {
|
|
9975
10003
|
let l = t.after(), a = n.tr.replaceWith(l, l, o.createAndFill());
|
|
9976
|
-
a.setSelection(
|
|
10004
|
+
a.setSelection(v.near(a.doc.resolve(l), 1)), e(a.scrollIntoView());
|
|
9977
10005
|
}
|
|
9978
10006
|
return !0;
|
|
9979
10007
|
}, _o = (n, e) => {
|
|
@@ -9994,7 +10022,7 @@ const bd = (n, e) => {
|
|
|
9994
10022
|
return !1;
|
|
9995
10023
|
if (t.depth > 1 && t.after() != t.end(-1)) {
|
|
9996
10024
|
let s = t.before();
|
|
9997
|
-
if (
|
|
10025
|
+
if (Ee(n.doc, s))
|
|
9998
10026
|
return e && e(n.tr.split(s).scrollIntoView()), !0;
|
|
9999
10027
|
}
|
|
10000
10028
|
let r = t.blockRange(), i = r && wt(r);
|
|
@@ -10004,7 +10032,7 @@ function kd(n) {
|
|
|
10004
10032
|
return (e, t) => {
|
|
10005
10033
|
let { $from: r, $to: i } = e.selection;
|
|
10006
10034
|
if (e.selection instanceof S && e.selection.node.isBlock)
|
|
10007
|
-
return !r.parentOffset || !
|
|
10035
|
+
return !r.parentOffset || !Ee(e.doc, r.pos) ? !1 : (t && t(e.tr.split(r.pos).scrollIntoView()), !0);
|
|
10008
10036
|
if (!r.depth)
|
|
10009
10037
|
return !1;
|
|
10010
10038
|
let s = [], o, l, a = !1, c = !1;
|
|
@@ -10019,8 +10047,8 @@ function kd(n) {
|
|
|
10019
10047
|
}
|
|
10020
10048
|
let d = e.tr;
|
|
10021
10049
|
(e.selection instanceof M || e.selection instanceof ce) && d.deleteSelection();
|
|
10022
|
-
let u = d.mapping.map(r.pos), f =
|
|
10023
|
-
if (f || (s[0] = l ? { type: l } : null, f =
|
|
10050
|
+
let u = d.mapping.map(r.pos), f = Ee(d.doc, u, s.length, s);
|
|
10051
|
+
if (f || (s[0] = l ? { type: l } : null, f = Ee(d.doc, u, s.length, s)), !f)
|
|
10024
10052
|
return !1;
|
|
10025
10053
|
if (d.split(u, s.length, s), !a && c && r.node(o).type != l) {
|
|
10026
10054
|
let h = d.mapping.map(r.before(o)), p = d.doc.resolve(h);
|
|
@@ -10037,7 +10065,7 @@ function Md(n, e, t) {
|
|
|
10037
10065
|
let r = e.nodeBefore, i = e.nodeAfter, s = e.index();
|
|
10038
10066
|
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 || je(n.doc, e.pos)) ? !1 : (t && t(n.tr.join(e.pos).scrollIntoView()), !0);
|
|
10039
10067
|
}
|
|
10040
|
-
function
|
|
10068
|
+
function Xo(n, e, t, r) {
|
|
10041
10069
|
let i = e.nodeBefore, s = e.nodeAfter, o, l, a = i.type.spec.isolating || s.type.spec.isolating;
|
|
10042
10070
|
if (!a && Md(n, e, t))
|
|
10043
10071
|
return !0;
|
|
@@ -10053,7 +10081,7 @@ function Yo(n, e, t, r) {
|
|
|
10053
10081
|
}
|
|
10054
10082
|
return !0;
|
|
10055
10083
|
}
|
|
10056
|
-
let d = s.type.spec.isolating || r > 0 && a ? null :
|
|
10084
|
+
let d = s.type.spec.isolating || r > 0 && a ? null : v.findFrom(e, 1), u = d && d.$from.blockRange(d.$to), f = u && wt(u);
|
|
10057
10085
|
if (f != null && f >= e.depth)
|
|
10058
10086
|
return t && t(n.tr.lift(u, f).scrollIntoView()), !0;
|
|
10059
10087
|
if (c && Mt(s, "start", !0) && Mt(i, "end")) {
|
|
@@ -10076,7 +10104,7 @@ function Yo(n, e, t, r) {
|
|
|
10076
10104
|
}
|
|
10077
10105
|
return !1;
|
|
10078
10106
|
}
|
|
10079
|
-
function
|
|
10107
|
+
function Yo(n) {
|
|
10080
10108
|
return function(e, t) {
|
|
10081
10109
|
let r = e.selection, i = n < 0 ? r.$from : r.$to, s = i.depth;
|
|
10082
10110
|
for (; i.node(s).isInline; ) {
|
|
@@ -10087,7 +10115,7 @@ function Xo(n) {
|
|
|
10087
10115
|
return i.node(s).isTextblock ? (t && t(e.tr.setSelection(M.create(e.doc, n < 0 ? i.start(s) : i.end(s)))), !0) : !1;
|
|
10088
10116
|
};
|
|
10089
10117
|
}
|
|
10090
|
-
const wd =
|
|
10118
|
+
const wd = Yo(-1), Cd = Yo(1);
|
|
10091
10119
|
function Td(n, e = null) {
|
|
10092
10120
|
return function(t, r) {
|
|
10093
10121
|
let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = o && $r(o, n, e);
|
|
@@ -10132,8 +10160,8 @@ function ei(...n) {
|
|
|
10132
10160
|
return !1;
|
|
10133
10161
|
};
|
|
10134
10162
|
}
|
|
10135
|
-
ei(
|
|
10136
|
-
ei(
|
|
10163
|
+
ei(Xr, Ho, qo);
|
|
10164
|
+
ei(Xr, Ko, Jo);
|
|
10137
10165
|
ei(Uo, _o, Go, xd);
|
|
10138
10166
|
typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
|
|
10139
10167
|
function Od(n, e = null) {
|
|
@@ -10142,10 +10170,10 @@ function Od(n, e = null) {
|
|
|
10142
10170
|
if (!o)
|
|
10143
10171
|
return !1;
|
|
10144
10172
|
let l = r ? t.tr : null;
|
|
10145
|
-
return
|
|
10173
|
+
return vd(l, o, n, e) ? (r && r(l.scrollIntoView()), !0) : !1;
|
|
10146
10174
|
};
|
|
10147
10175
|
}
|
|
10148
|
-
function
|
|
10176
|
+
function vd(n, e, t, r = null) {
|
|
10149
10177
|
let i = !1, s = e, o = e.$from.doc;
|
|
10150
10178
|
if (e.depth >= 2 && e.$from.node(e.depth - 1).type.compatibleContent(t) && e.startIndex == 0) {
|
|
10151
10179
|
if (e.$from.index(e.depth - 1) == 0)
|
|
@@ -10154,9 +10182,9 @@ function Ed(n, e, t, r = null) {
|
|
|
10154
10182
|
s = new bn(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new bn(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), i = !0;
|
|
10155
10183
|
}
|
|
10156
10184
|
let l = $r(s, t, r, e);
|
|
10157
|
-
return l ? (n &&
|
|
10185
|
+
return l ? (n && Ed(n, e, l, i, t), !0) : !1;
|
|
10158
10186
|
}
|
|
10159
|
-
function
|
|
10187
|
+
function Ed(n, e, t, r, i) {
|
|
10160
10188
|
let s = b.empty;
|
|
10161
10189
|
for (let d = t.length - 1; d >= 0; d--)
|
|
10162
10190
|
s = b.from(t[d].type.create(t[d].attrs, s));
|
|
@@ -10166,7 +10194,7 @@ function vd(n, e, t, r, i) {
|
|
|
10166
10194
|
t[d].type == i && (o = d + 1);
|
|
10167
10195
|
let l = t.length - o, a = e.start + t.length - (r ? 2 : 0), c = e.parent;
|
|
10168
10196
|
for (let d = e.startIndex, u = e.endIndex, f = !0; d < u; d++, f = !1)
|
|
10169
|
-
!f &&
|
|
10197
|
+
!f && Ee(n.doc, a, l) && (n.split(a, l), a += 2 * l), a += c.child(d).nodeSize;
|
|
10170
10198
|
return n;
|
|
10171
10199
|
}
|
|
10172
10200
|
function Nd(n) {
|
|
@@ -10435,7 +10463,7 @@ function Ir(n, e) {
|
|
|
10435
10463
|
function Qo(n) {
|
|
10436
10464
|
return typeof n == "function";
|
|
10437
10465
|
}
|
|
10438
|
-
function
|
|
10466
|
+
function E(n, e = void 0, ...t) {
|
|
10439
10467
|
return Qo(n) ? e ? n.bind(e)(...t) : n(...t) : n;
|
|
10440
10468
|
}
|
|
10441
10469
|
function Pd(n = {}) {
|
|
@@ -10484,23 +10512,23 @@ function Ld(n, e) {
|
|
|
10484
10512
|
};
|
|
10485
10513
|
}, {}), h = cs({
|
|
10486
10514
|
...f,
|
|
10487
|
-
content:
|
|
10488
|
-
marks:
|
|
10489
|
-
group:
|
|
10490
|
-
inline:
|
|
10491
|
-
atom:
|
|
10492
|
-
selectable:
|
|
10493
|
-
draggable:
|
|
10494
|
-
code:
|
|
10495
|
-
whitespace:
|
|
10496
|
-
linebreakReplacement:
|
|
10497
|
-
defining:
|
|
10498
|
-
isolating:
|
|
10515
|
+
content: E(x(c, "content", u)),
|
|
10516
|
+
marks: E(x(c, "marks", u)),
|
|
10517
|
+
group: E(x(c, "group", u)),
|
|
10518
|
+
inline: E(x(c, "inline", u)),
|
|
10519
|
+
atom: E(x(c, "atom", u)),
|
|
10520
|
+
selectable: E(x(c, "selectable", u)),
|
|
10521
|
+
draggable: E(x(c, "draggable", u)),
|
|
10522
|
+
code: E(x(c, "code", u)),
|
|
10523
|
+
whitespace: E(x(c, "whitespace", u)),
|
|
10524
|
+
linebreakReplacement: E(x(c, "linebreakReplacement", u)),
|
|
10525
|
+
defining: E(x(c, "defining", u)),
|
|
10526
|
+
isolating: E(x(c, "isolating", u)),
|
|
10499
10527
|
attrs: Object.fromEntries(d.map((y) => {
|
|
10500
10528
|
var T;
|
|
10501
10529
|
return [y.name, { default: (T = y == null ? void 0 : y.attribute) === null || T === void 0 ? void 0 : T.default }];
|
|
10502
10530
|
}))
|
|
10503
|
-
}), p =
|
|
10531
|
+
}), p = E(x(c, "parseHTML", u));
|
|
10504
10532
|
p && (h.parseDOM = p.map((y) => as(y, d)));
|
|
10505
10533
|
const m = x(c, "renderHTML", u);
|
|
10506
10534
|
m && (h.toDOM = (y) => m({
|
|
@@ -10523,16 +10551,16 @@ function Ld(n, e) {
|
|
|
10523
10551
|
};
|
|
10524
10552
|
}, {}), h = cs({
|
|
10525
10553
|
...f,
|
|
10526
|
-
inclusive:
|
|
10527
|
-
excludes:
|
|
10528
|
-
group:
|
|
10529
|
-
spanning:
|
|
10530
|
-
code:
|
|
10554
|
+
inclusive: E(x(c, "inclusive", u)),
|
|
10555
|
+
excludes: E(x(c, "excludes", u)),
|
|
10556
|
+
group: E(x(c, "group", u)),
|
|
10557
|
+
spanning: E(x(c, "spanning", u)),
|
|
10558
|
+
code: E(x(c, "code", u)),
|
|
10531
10559
|
attrs: Object.fromEntries(d.map((g) => {
|
|
10532
10560
|
var y;
|
|
10533
10561
|
return [g.name, { default: (y = g == null ? void 0 : g.attribute) === null || y === void 0 ? void 0 : y.default }];
|
|
10534
10562
|
}))
|
|
10535
|
-
}), p =
|
|
10563
|
+
}), p = E(x(c, "parseHTML", u));
|
|
10536
10564
|
p && (h.parseDOM = p.map((g) => as(g, d)));
|
|
10537
10565
|
const m = x(c, "renderHTML", u);
|
|
10538
10566
|
return m && (h.toDOM = (g) => m({
|
|
@@ -10723,9 +10751,9 @@ class Me {
|
|
|
10723
10751
|
}, this.config = {
|
|
10724
10752
|
...this.config,
|
|
10725
10753
|
...e
|
|
10726
|
-
}, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options =
|
|
10754
|
+
}, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = E(x(this, "addOptions", {
|
|
10727
10755
|
name: this.name
|
|
10728
|
-
}))), this.storage =
|
|
10756
|
+
}))), this.storage = E(x(this, "addStorage", {
|
|
10729
10757
|
name: this.name,
|
|
10730
10758
|
options: this.options
|
|
10731
10759
|
})) || {};
|
|
@@ -10742,9 +10770,9 @@ class Me {
|
|
|
10742
10770
|
}
|
|
10743
10771
|
extend(e = {}) {
|
|
10744
10772
|
const t = new Me(e);
|
|
10745
|
-
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options =
|
|
10773
|
+
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = E(x(t, "addOptions", {
|
|
10746
10774
|
name: t.name
|
|
10747
|
-
})), t.storage =
|
|
10775
|
+
})), t.storage = E(x(t, "addStorage", {
|
|
10748
10776
|
name: t.name,
|
|
10749
10777
|
options: t.options
|
|
10750
10778
|
})), t;
|
|
@@ -11069,7 +11097,7 @@ class gt {
|
|
|
11069
11097
|
editor: this.editor,
|
|
11070
11098
|
type: ar(e.name, this.schema)
|
|
11071
11099
|
};
|
|
11072
|
-
e.type === "mark" && (!((t =
|
|
11100
|
+
e.type === "mark" && (!((t = E(x(e, "keepOnSplit", r))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
|
|
11073
11101
|
const i = x(e, "onBeforeCreate", r), s = x(e, "onCreate", r), o = x(e, "onUpdate", r), l = x(e, "onSelectionUpdate", r), a = x(e, "onTransaction", r), c = x(e, "onFocus", r), d = x(e, "onBlur", r), u = x(e, "onDestroy", r);
|
|
11074
11102
|
i && this.editor.on("beforeCreate", i), s && this.editor.on("create", s), o && this.editor.on("update", o), l && this.editor.on("selectionUpdate", l), a && this.editor.on("transaction", a), c && this.editor.on("focus", c), d && this.editor.on("blur", d), u && this.editor.on("destroy", u);
|
|
11075
11103
|
});
|
|
@@ -11083,9 +11111,9 @@ class G {
|
|
|
11083
11111
|
}, this.config = {
|
|
11084
11112
|
...this.config,
|
|
11085
11113
|
...e
|
|
11086
|
-
}, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options =
|
|
11114
|
+
}, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = E(x(this, "addOptions", {
|
|
11087
11115
|
name: this.name
|
|
11088
|
-
}))), this.storage =
|
|
11116
|
+
}))), this.storage = E(x(this, "addStorage", {
|
|
11089
11117
|
name: this.name,
|
|
11090
11118
|
options: this.options
|
|
11091
11119
|
})) || {};
|
|
@@ -11102,9 +11130,9 @@ class G {
|
|
|
11102
11130
|
}
|
|
11103
11131
|
extend(e = {}) {
|
|
11104
11132
|
const t = new G({ ...this.config, ...e });
|
|
11105
|
-
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options =
|
|
11133
|
+
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = E(x(t, "addOptions", {
|
|
11106
11134
|
name: t.name
|
|
11107
|
-
})), t.storage =
|
|
11135
|
+
})), t.storage = E(x(t, "addStorage", {
|
|
11108
11136
|
name: t.name,
|
|
11109
11137
|
options: t.options
|
|
11110
11138
|
})), t;
|
|
@@ -11159,7 +11187,7 @@ const _d = G.create({
|
|
|
11159
11187
|
}), Gd = () => ({ editor: n, view: e }) => (requestAnimationFrame(() => {
|
|
11160
11188
|
var t;
|
|
11161
11189
|
n.isDestroyed || (e.dom.blur(), (t = window == null ? void 0 : window.getSelection()) === null || t === void 0 || t.removeAllRanges());
|
|
11162
|
-
}), !0),
|
|
11190
|
+
}), !0), Xd = (n = !1) => ({ commands: e }) => e.setContent("", n), Yd = () => ({ state: n, tr: e, dispatch: t }) => {
|
|
11163
11191
|
const { selection: r } = e, { ranges: i } = r;
|
|
11164
11192
|
return t && i.forEach(({ $from: s, $to: o }) => {
|
|
11165
11193
|
n.doc.nodesBetween(s.pos, o.pos, (l, a) => {
|
|
@@ -11209,7 +11237,7 @@ const _d = G.create({
|
|
|
11209
11237
|
}, ru = (n) => ({ tr: e, dispatch: t }) => {
|
|
11210
11238
|
const { from: r, to: i } = n;
|
|
11211
11239
|
return t && e.delete(r, i), !0;
|
|
11212
|
-
}, iu = () => ({ state: n, dispatch: e }) =>
|
|
11240
|
+
}, iu = () => ({ state: n, dispatch: e }) => Xr(n, e), su = () => ({ commands: n }) => n.keyboardShortcut("Enter"), ou = () => ({ state: n, dispatch: e }) => bd(n, e);
|
|
11213
11241
|
function On(n, e, t = { strict: !0 }) {
|
|
11214
11242
|
const r = Object.keys(e);
|
|
11215
11243
|
return r.length ? r.every((i) => t.strict ? e[i] === n[i] : ni(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
|
|
@@ -11269,24 +11297,24 @@ const lu = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11269
11297
|
function rl(n) {
|
|
11270
11298
|
return n instanceof M;
|
|
11271
11299
|
}
|
|
11272
|
-
function
|
|
11300
|
+
function Ye(n = 0, e = 0, t = 0) {
|
|
11273
11301
|
return Math.min(Math.max(n, e), t);
|
|
11274
11302
|
}
|
|
11275
11303
|
function il(n, e = null) {
|
|
11276
11304
|
if (!e)
|
|
11277
11305
|
return null;
|
|
11278
|
-
const t =
|
|
11306
|
+
const t = v.atStart(n), r = v.atEnd(n);
|
|
11279
11307
|
if (e === "start" || e === !0)
|
|
11280
11308
|
return t;
|
|
11281
11309
|
if (e === "end")
|
|
11282
11310
|
return r;
|
|
11283
11311
|
const i = t.from, s = r.to;
|
|
11284
|
-
return e === "all" ? M.create(n,
|
|
11312
|
+
return e === "all" ? M.create(n, Ye(0, i, s), Ye(n.content.size, i, s)) : M.create(n, Ye(e, i, s), Ye(e, i, s));
|
|
11285
11313
|
}
|
|
11286
11314
|
function fs() {
|
|
11287
11315
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
11288
11316
|
}
|
|
11289
|
-
function
|
|
11317
|
+
function vn() {
|
|
11290
11318
|
return [
|
|
11291
11319
|
"iPad Simulator",
|
|
11292
11320
|
"iPhone Simulator",
|
|
@@ -11305,8 +11333,8 @@ const du = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
|
|
|
11305
11333
|
...e
|
|
11306
11334
|
};
|
|
11307
11335
|
const o = () => {
|
|
11308
|
-
(
|
|
11309
|
-
t.isDestroyed || (r.focus(), cu() && !
|
|
11336
|
+
(vn() || fs()) && r.dom.focus(), requestAnimationFrame(() => {
|
|
11337
|
+
t.isDestroyed || (r.focus(), cu() && !vn() && !fs() && r.dom.focus({ preventScroll: !0 }));
|
|
11310
11338
|
});
|
|
11311
11339
|
};
|
|
11312
11340
|
if (r.hasFocus() && n === null || n === !1)
|
|
@@ -11387,7 +11415,7 @@ function hu(n, e, t) {
|
|
|
11387
11415
|
let o = 0;
|
|
11388
11416
|
s.forEach((l, a, c, d) => {
|
|
11389
11417
|
o === 0 && (o = d);
|
|
11390
|
-
}), n.setSelection(
|
|
11418
|
+
}), n.setSelection(v.near(n.doc.resolve(o), t));
|
|
11391
11419
|
}
|
|
11392
11420
|
const pu = (n) => !("type" in n), mu = (n, e, t) => ({ tr: r, dispatch: i, editor: s }) => {
|
|
11393
11421
|
var o;
|
|
@@ -11486,7 +11514,7 @@ function Cu(n) {
|
|
|
11486
11514
|
else if (/^s(hift)?$/i.test(a))
|
|
11487
11515
|
s = !0;
|
|
11488
11516
|
else if (/^mod$/i.test(a))
|
|
11489
|
-
|
|
11517
|
+
vn() || ol() ? o = !0 : i = !0;
|
|
11490
11518
|
else
|
|
11491
11519
|
throw new Error(`Unrecognized modifier name: ${a}`);
|
|
11492
11520
|
}
|
|
@@ -11527,7 +11555,7 @@ function Wt(n, e, t = {}) {
|
|
|
11527
11555
|
const Ou = (n, e = {}) => ({ state: t, dispatch: r }) => {
|
|
11528
11556
|
const i = H(n, t.schema);
|
|
11529
11557
|
return Wt(t, i, e) ? yd(t, r) : !1;
|
|
11530
|
-
},
|
|
11558
|
+
}, vu = () => ({ state: n, dispatch: e }) => Go(n, e), Eu = (n) => ({ state: e, dispatch: t }) => {
|
|
11531
11559
|
const r = H(n, e.schema);
|
|
11532
11560
|
return Nd(r)(e, t);
|
|
11533
11561
|
}, Nu = () => ({ state: n, dispatch: e }) => Uo(n, e);
|
|
@@ -11685,7 +11713,7 @@ function ps(n, e) {
|
|
|
11685
11713
|
name: r.name,
|
|
11686
11714
|
options: r.options,
|
|
11687
11715
|
storage: r.storage
|
|
11688
|
-
}, s =
|
|
11716
|
+
}, s = E(x(r, "group", i));
|
|
11689
11717
|
return typeof s != "string" ? !1 : s.split(" ").includes("list");
|
|
11690
11718
|
}
|
|
11691
11719
|
function si(n, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
|
|
@@ -11762,15 +11790,15 @@ const Uu = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11762
11790
|
const s = H(n, t.schema);
|
|
11763
11791
|
let o;
|
|
11764
11792
|
return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) => ls(s, { ...o, ...e })(t) ? !0 : l.clearNodes()).command(({ state: l }) => ls(s, { ...o, ...e })(l, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
|
|
11765
|
-
},
|
|
11793
|
+
}, Xu = (n) => ({ tr: e, dispatch: t }) => {
|
|
11766
11794
|
if (t) {
|
|
11767
|
-
const { doc: r } = e, i =
|
|
11795
|
+
const { doc: r } = e, i = Ye(n, 0, r.content.size), s = S.create(r, i);
|
|
11768
11796
|
e.setSelection(s);
|
|
11769
11797
|
}
|
|
11770
11798
|
return !0;
|
|
11771
|
-
},
|
|
11799
|
+
}, Yu = (n) => ({ tr: e, dispatch: t }) => {
|
|
11772
11800
|
if (t) {
|
|
11773
|
-
const { doc: r } = e, { from: i, to: s } = typeof n == "number" ? { from: n, to: n } : n, o = M.atStart(r).from, l = M.atEnd(r).to, a =
|
|
11801
|
+
const { doc: r } = e, { from: i, to: s } = typeof n == "number" ? { from: n, to: n } : n, o = M.atStart(r).from, l = M.atEnd(r).to, a = Ye(i, o, l), c = Ye(s, o, l), d = M.create(r, a, c);
|
|
11774
11802
|
e.setSelection(d);
|
|
11775
11803
|
}
|
|
11776
11804
|
return !0;
|
|
@@ -11788,7 +11816,7 @@ function ms(n, e) {
|
|
|
11788
11816
|
const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
|
|
11789
11817
|
const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, d = un(c, l.node().type.name, l.node().attrs);
|
|
11790
11818
|
if (s instanceof S && s.node.isBlock)
|
|
11791
|
-
return !l.parentOffset || !
|
|
11819
|
+
return !l.parentOffset || !Ee(o, l.pos) ? !1 : (r && (n && ms(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
|
|
11792
11820
|
if (!l.parent.isBlock)
|
|
11793
11821
|
return !1;
|
|
11794
11822
|
const u = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : $u(l.node(-1).contentMatchAt(l.indexAfter(-1)));
|
|
@@ -11797,8 +11825,8 @@ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11797
11825
|
type: f,
|
|
11798
11826
|
attrs: d
|
|
11799
11827
|
}
|
|
11800
|
-
] : void 0, p =
|
|
11801
|
-
if (!h && !p &&
|
|
11828
|
+
] : void 0, p = Ee(e.doc, e.mapping.map(l.pos), 1, h);
|
|
11829
|
+
if (!h && !p && Ee(e.doc, e.mapping.map(l.pos), 1, f ? [{ type: f }] : void 0) && (p = !0, h = f ? [
|
|
11802
11830
|
{
|
|
11803
11831
|
type: f,
|
|
11804
11832
|
attrs: d
|
|
@@ -11836,10 +11864,10 @@ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11836
11864
|
const L = a.before(a.depth - (T - 1));
|
|
11837
11865
|
t.replace(L, a.after(-w), new k(y, 4 - T, 0));
|
|
11838
11866
|
let C = -1;
|
|
11839
|
-
t.doc.nodesBetween(L, t.doc.content.size, (N,
|
|
11867
|
+
t.doc.nodesBetween(L, t.doc.content.size, (N, X) => {
|
|
11840
11868
|
if (C > -1)
|
|
11841
11869
|
return !1;
|
|
11842
|
-
N.isTextblock && N.content.size === 0 && (C =
|
|
11870
|
+
N.isTextblock && N.content.size === 0 && (C = X + 1);
|
|
11843
11871
|
}), C > -1 && t.setSelection(M.near(t.doc.resolve(C))), t.scrollIntoView();
|
|
11844
11872
|
}
|
|
11845
11873
|
return !0;
|
|
@@ -11856,7 +11884,7 @@ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11856
11884
|
{ type: l, attrs: p },
|
|
11857
11885
|
{ type: h, attrs: m }
|
|
11858
11886
|
] : [{ type: l, attrs: p }];
|
|
11859
|
-
if (!
|
|
11887
|
+
if (!Ee(t.doc, a.pos, 2))
|
|
11860
11888
|
return !1;
|
|
11861
11889
|
if (i) {
|
|
11862
11890
|
const { selection: y, storedMarks: T } = r, { splittableMarks: w } = s.extensionManager, I = T || y.$to.parentOffset && y.$from.marks();
|
|
@@ -11989,8 +12017,8 @@ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
11989
12017
|
var ff = /* @__PURE__ */ Object.freeze({
|
|
11990
12018
|
__proto__: null,
|
|
11991
12019
|
blur: Gd,
|
|
11992
|
-
clearContent:
|
|
11993
|
-
clearNodes:
|
|
12020
|
+
clearContent: Xd,
|
|
12021
|
+
clearNodes: Yd,
|
|
11994
12022
|
command: Zd,
|
|
11995
12023
|
createParagraphNear: Qd,
|
|
11996
12024
|
cut: eu,
|
|
@@ -12016,8 +12044,8 @@ var ff = /* @__PURE__ */ Object.freeze({
|
|
|
12016
12044
|
joinUp: gu,
|
|
12017
12045
|
keyboardShortcut: Tu,
|
|
12018
12046
|
lift: Ou,
|
|
12019
|
-
liftEmptyBlock:
|
|
12020
|
-
liftListItem:
|
|
12047
|
+
liftEmptyBlock: vu,
|
|
12048
|
+
liftListItem: Eu,
|
|
12021
12049
|
newlineInCode: Nu,
|
|
12022
12050
|
resetAttributes: Au,
|
|
12023
12051
|
scrollIntoView: Du,
|
|
@@ -12031,8 +12059,8 @@ var ff = /* @__PURE__ */ Object.freeze({
|
|
|
12031
12059
|
setMark: Uu,
|
|
12032
12060
|
setMeta: _u,
|
|
12033
12061
|
setNode: Gu,
|
|
12034
|
-
setNodeSelection:
|
|
12035
|
-
setTextSelection:
|
|
12062
|
+
setNodeSelection: Xu,
|
|
12063
|
+
setTextSelection: Yu,
|
|
12036
12064
|
sinkListItem: Zu,
|
|
12037
12065
|
splitBlock: Qu,
|
|
12038
12066
|
splitListItem: ef,
|
|
@@ -12116,7 +12144,7 @@ const hf = G.create({
|
|
|
12116
12144
|
() => o.undoInputRule(),
|
|
12117
12145
|
// maybe convert first text block node to default node
|
|
12118
12146
|
() => o.command(({ tr: l }) => {
|
|
12119
|
-
const { selection: a, doc: c } = l, { empty: d, $anchor: u } = a, { pos: f, parent: h } = u, p = u.parent.isTextblock && f > 0 ? l.doc.resolve(f - 1) : u, m = p.parent.type.spec.isolating, g = u.pos - u.parentOffset, y = m && p.parent.childCount === 1 ? g === u.pos :
|
|
12147
|
+
const { selection: a, doc: c } = l, { empty: d, $anchor: u } = a, { pos: f, parent: h } = u, p = u.parent.isTextblock && f > 0 ? l.doc.resolve(f - 1) : u, m = p.parent.type.spec.isolating, g = u.pos - u.parentOffset, y = m && p.parent.childCount === 1 ? g === u.pos : v.atStart(c).from === f;
|
|
12120
12148
|
return !d || !h.type.isTextblock || h.textContent.length || !y || y && u.parent.type.name === "paragraph" ? !1 : o.clearNodes();
|
|
12121
12149
|
}),
|
|
12122
12150
|
() => o.deleteSelection(),
|
|
@@ -12154,7 +12182,7 @@ const hf = G.create({
|
|
|
12154
12182
|
"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
|
|
12155
12183
|
"Ctrl-e": () => this.editor.commands.selectTextblockEnd()
|
|
12156
12184
|
};
|
|
12157
|
-
return
|
|
12185
|
+
return vn() || ol() ? s : i;
|
|
12158
12186
|
},
|
|
12159
12187
|
addProseMirrorPlugins() {
|
|
12160
12188
|
return [
|
|
@@ -12171,7 +12199,7 @@ const hf = G.create({
|
|
|
12171
12199
|
const r = n.some((m) => m.docChanged) && !e.doc.eq(t.doc), i = n.some((m) => m.getMeta("preventClearDocument"));
|
|
12172
12200
|
if (!r || i)
|
|
12173
12201
|
return;
|
|
12174
|
-
const { empty: s, from: o, to: l } = e.selection, a =
|
|
12202
|
+
const { empty: s, from: o, to: l } = e.selection, a = v.atStart(e.doc).from, c = v.atEnd(e.doc).to;
|
|
12175
12203
|
if (s || !(o === a && l === c) || !si(t.doc))
|
|
12176
12204
|
return;
|
|
12177
12205
|
const f = t.tr, h = Vn({
|
|
@@ -12777,7 +12805,7 @@ function at(n) {
|
|
|
12777
12805
|
return new qn({
|
|
12778
12806
|
find: n.find,
|
|
12779
12807
|
handler: ({ state: e, range: t, match: r }) => {
|
|
12780
|
-
const i =
|
|
12808
|
+
const i = E(n.getAttributes, void 0, r);
|
|
12781
12809
|
if (i === !1 || i === null)
|
|
12782
12810
|
return null;
|
|
12783
12811
|
const { tr: s } = e, o = r[r.length - 1], l = r[0];
|
|
@@ -12796,7 +12824,7 @@ function cl(n) {
|
|
|
12796
12824
|
return new qn({
|
|
12797
12825
|
find: n.find,
|
|
12798
12826
|
handler: ({ state: e, range: t, match: r }) => {
|
|
12799
|
-
const i =
|
|
12827
|
+
const i = E(n.getAttributes, void 0, r) || {}, { tr: s } = e, o = t.from;
|
|
12800
12828
|
let l = t.to;
|
|
12801
12829
|
const a = n.type.create(i);
|
|
12802
12830
|
if (r[1]) {
|
|
@@ -12817,7 +12845,7 @@ function Br(n) {
|
|
|
12817
12845
|
return new qn({
|
|
12818
12846
|
find: n.find,
|
|
12819
12847
|
handler: ({ state: e, range: t, match: r }) => {
|
|
12820
|
-
const i = e.doc.resolve(t.from), s =
|
|
12848
|
+
const i = e.doc.resolve(t.from), s = E(n.getAttributes, void 0, r) || {};
|
|
12821
12849
|
if (!i.node(-1).canReplaceWith(i.index(-1), i.indexAfter(-1), n.type))
|
|
12822
12850
|
return null;
|
|
12823
12851
|
e.tr.delete(t.from, t.to).setBlockType(t.from, t.from, n.type, s);
|
|
@@ -12828,7 +12856,7 @@ function qt(n) {
|
|
|
12828
12856
|
return new qn({
|
|
12829
12857
|
find: n.find,
|
|
12830
12858
|
handler: ({ state: e, range: t, match: r, chain: i }) => {
|
|
12831
|
-
const s =
|
|
12859
|
+
const s = E(n.getAttributes, void 0, r) || {}, o = e.tr.delete(t.from, t.to), a = o.doc.resolve(t.from).blockRange(), c = a && $r(a, n.type, s);
|
|
12832
12860
|
if (!c)
|
|
12833
12861
|
return null;
|
|
12834
12862
|
if (o.wrap(a, c), n.keepMarks && n.editor) {
|
|
@@ -12855,9 +12883,9 @@ class ne {
|
|
|
12855
12883
|
}, this.config = {
|
|
12856
12884
|
...this.config,
|
|
12857
12885
|
...e
|
|
12858
|
-
}, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options =
|
|
12886
|
+
}, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = E(x(this, "addOptions", {
|
|
12859
12887
|
name: this.name
|
|
12860
|
-
}))), this.storage =
|
|
12888
|
+
}))), this.storage = E(x(this, "addStorage", {
|
|
12861
12889
|
name: this.name,
|
|
12862
12890
|
options: this.options
|
|
12863
12891
|
})) || {};
|
|
@@ -12874,9 +12902,9 @@ class ne {
|
|
|
12874
12902
|
}
|
|
12875
12903
|
extend(e = {}) {
|
|
12876
12904
|
const t = new ne(e);
|
|
12877
|
-
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options =
|
|
12905
|
+
return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = E(x(t, "addOptions", {
|
|
12878
12906
|
name: t.name
|
|
12879
|
-
})), t.storage =
|
|
12907
|
+
})), t.storage = E(x(t, "addStorage", {
|
|
12880
12908
|
name: t.name,
|
|
12881
12909
|
options: t.options
|
|
12882
12910
|
})), t;
|
|
@@ -12886,7 +12914,7 @@ function ct(n) {
|
|
|
12886
12914
|
return new Wd({
|
|
12887
12915
|
find: n.find,
|
|
12888
12916
|
handler: ({ state: e, range: t, match: r, pasteEvent: i }) => {
|
|
12889
|
-
const s =
|
|
12917
|
+
const s = E(n.getAttributes, void 0, r, i);
|
|
12890
12918
|
if (s === !1 || s === null)
|
|
12891
12919
|
return null;
|
|
12892
12920
|
const { tr: o } = e, l = r[r.length - 1], a = r[0];
|
|
@@ -12953,7 +12981,7 @@ const Tf = /^\s*>\s$/, Of = ne.create({
|
|
|
12953
12981
|
})
|
|
12954
12982
|
];
|
|
12955
12983
|
}
|
|
12956
|
-
}),
|
|
12984
|
+
}), vf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Ef = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, Nf = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, Af = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, Df = Me.create({
|
|
12957
12985
|
name: "bold",
|
|
12958
12986
|
addOptions() {
|
|
12959
12987
|
return {
|
|
@@ -12998,7 +13026,7 @@ const Tf = /^\s*>\s$/, Of = ne.create({
|
|
|
12998
13026
|
addInputRules() {
|
|
12999
13027
|
return [
|
|
13000
13028
|
at({
|
|
13001
|
-
find:
|
|
13029
|
+
find: vf,
|
|
13002
13030
|
type: this.type
|
|
13003
13031
|
}),
|
|
13004
13032
|
at({
|
|
@@ -13010,7 +13038,7 @@ const Tf = /^\s*>\s$/, Of = ne.create({
|
|
|
13010
13038
|
addPasteRules() {
|
|
13011
13039
|
return [
|
|
13012
13040
|
ct({
|
|
13013
|
-
find:
|
|
13041
|
+
find: Ef,
|
|
13014
13042
|
type: this.type
|
|
13015
13043
|
}),
|
|
13016
13044
|
ct({
|
|
@@ -13197,7 +13225,7 @@ const Tf = /^\s*>\s$/, Of = ne.create({
|
|
|
13197
13225
|
if (!s || i.parent.type !== this.type || !(i.parentOffset === i.parent.nodeSize - 2))
|
|
13198
13226
|
return !1;
|
|
13199
13227
|
const l = i.after();
|
|
13200
|
-
return l === void 0 ? !1 : r.nodeAt(l) ? n.commands.command(({ tr: c }) => (c.setSelection(
|
|
13228
|
+
return l === void 0 ? !1 : r.nodeAt(l) ? n.commands.command(({ tr: c }) => (c.setSelection(v.near(r.resolve(l))), !0)) : n.commands.exitCode();
|
|
13201
13229
|
}
|
|
13202
13230
|
};
|
|
13203
13231
|
},
|
|
@@ -13310,7 +13338,7 @@ class Wf {
|
|
|
13310
13338
|
if (t && !s) {
|
|
13311
13339
|
let o = t.pos;
|
|
13312
13340
|
if (this.editorView.dragging && this.editorView.dragging.slice) {
|
|
13313
|
-
let l =
|
|
13341
|
+
let l = Xs(this.editorView.state.doc, o, this.editorView.dragging.slice);
|
|
13314
13342
|
l != null && (o = l);
|
|
13315
13343
|
}
|
|
13316
13344
|
this.setCursor(o), this.scheduleRemoval(5e3);
|
|
@@ -13341,7 +13369,7 @@ const qf = G.create({
|
|
|
13341
13369
|
];
|
|
13342
13370
|
}
|
|
13343
13371
|
});
|
|
13344
|
-
class R extends
|
|
13372
|
+
class R extends v {
|
|
13345
13373
|
/**
|
|
13346
13374
|
Create a gap cursor.
|
|
13347
13375
|
*/
|
|
@@ -13350,7 +13378,7 @@ class R extends E {
|
|
|
13350
13378
|
}
|
|
13351
13379
|
map(e, t) {
|
|
13352
13380
|
let r = e.resolve(t.map(this.head));
|
|
13353
|
-
return R.valid(r) ? new R(r) :
|
|
13381
|
+
return R.valid(r) ? new R(r) : v.near(r);
|
|
13354
13382
|
}
|
|
13355
13383
|
content() {
|
|
13356
13384
|
return k.empty;
|
|
@@ -13428,7 +13456,7 @@ class R extends E {
|
|
|
13428
13456
|
}
|
|
13429
13457
|
R.prototype.visible = !1;
|
|
13430
13458
|
R.findFrom = R.findGapCursorFrom;
|
|
13431
|
-
|
|
13459
|
+
v.jsonID("gapcursor", R);
|
|
13432
13460
|
class oi {
|
|
13433
13461
|
constructor(e) {
|
|
13434
13462
|
this.pos = e;
|
|
@@ -13438,7 +13466,7 @@ class oi {
|
|
|
13438
13466
|
}
|
|
13439
13467
|
resolve(e) {
|
|
13440
13468
|
let t = e.resolve(this.pos);
|
|
13441
|
-
return R.valid(t) ? new R(t) :
|
|
13469
|
+
return R.valid(t) ? new R(t) : v.near(t);
|
|
13442
13470
|
}
|
|
13443
13471
|
}
|
|
13444
13472
|
function dl(n) {
|
|
@@ -13481,7 +13509,7 @@ function Kf(n) {
|
|
|
13481
13509
|
function Jf() {
|
|
13482
13510
|
return new se({
|
|
13483
13511
|
props: {
|
|
13484
|
-
decorations:
|
|
13512
|
+
decorations: Xf,
|
|
13485
13513
|
createSelectionBetween(n, e, t) {
|
|
13486
13514
|
return e.pos == t.pos && R.valid(t) ? new R(t) : null;
|
|
13487
13515
|
},
|
|
@@ -13531,13 +13559,13 @@ function Gf(n, e) {
|
|
|
13531
13559
|
let s = n.state.tr.replace(t.pos, t.pos, new k(i, 0, 0));
|
|
13532
13560
|
return s.setSelection(M.near(s.doc.resolve(t.pos + 1))), n.dispatch(s), !1;
|
|
13533
13561
|
}
|
|
13534
|
-
function
|
|
13562
|
+
function Xf(n) {
|
|
13535
13563
|
if (!(n.selection instanceof R))
|
|
13536
13564
|
return null;
|
|
13537
13565
|
let e = document.createElement("div");
|
|
13538
13566
|
return e.className = "ProseMirror-gapcursor", z.create(n.doc, [he.widget(n.selection.head, e, { key: "gapcursor" })]);
|
|
13539
13567
|
}
|
|
13540
|
-
const
|
|
13568
|
+
const Yf = G.create({
|
|
13541
13569
|
name: "gapCursor",
|
|
13542
13570
|
addProseMirrorPlugins() {
|
|
13543
13571
|
return [
|
|
@@ -13552,7 +13580,7 @@ const Xf = G.create({
|
|
|
13552
13580
|
storage: n.storage
|
|
13553
13581
|
};
|
|
13554
13582
|
return {
|
|
13555
|
-
allowGapCursor: (e =
|
|
13583
|
+
allowGapCursor: (e = E(x(n, "allowGapCursor", t))) !== null && e !== void 0 ? e : null
|
|
13556
13584
|
};
|
|
13557
13585
|
}
|
|
13558
13586
|
}), Zf = ne.create({
|
|
@@ -13655,10 +13683,10 @@ const Xf = G.create({
|
|
|
13655
13683
|
}));
|
|
13656
13684
|
}
|
|
13657
13685
|
});
|
|
13658
|
-
var
|
|
13686
|
+
var En = 200, V = function() {
|
|
13659
13687
|
};
|
|
13660
13688
|
V.prototype.append = function(e) {
|
|
13661
|
-
return e.length ? (e = V.from(e), !this.length && e || e.length <
|
|
13689
|
+
return e.length ? (e = V.from(e), !this.length && e || e.length < En && this.leafAppend(e) || this.length < En && e.leafPrepend(this) || this.appendInner(e)) : this;
|
|
13662
13690
|
};
|
|
13663
13691
|
V.prototype.prepend = function(e) {
|
|
13664
13692
|
return e.length ? V.from(e).append(this) : this;
|
|
@@ -13707,10 +13735,10 @@ var ul = /* @__PURE__ */ function(n) {
|
|
|
13707
13735
|
if (i(this.values[a], l + a) === !1)
|
|
13708
13736
|
return !1;
|
|
13709
13737
|
}, e.prototype.leafAppend = function(i) {
|
|
13710
|
-
if (this.length + i.length <=
|
|
13738
|
+
if (this.length + i.length <= En)
|
|
13711
13739
|
return new e(this.values.concat(i.flatten()));
|
|
13712
13740
|
}, e.prototype.leafPrepend = function(i) {
|
|
13713
|
-
if (this.length + i.length <=
|
|
13741
|
+
if (this.length + i.length <= En)
|
|
13714
13742
|
return new e(i.flatten().concat(this.values));
|
|
13715
13743
|
}, t.length.get = function() {
|
|
13716
13744
|
return this.values.length;
|
|
@@ -14322,7 +14350,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), ch = G.create({
|
|
|
14322
14350
|
name: "starterKit",
|
|
14323
14351
|
addExtensions() {
|
|
14324
14352
|
const n = [];
|
|
14325
|
-
return this.options.bold !== !1 && n.push(Df.configure(this.options.bold)), this.options.blockquote !== !1 && n.push(Of.configure(this.options.blockquote)), this.options.bulletList !== !1 && n.push(Rf.configure(this.options.bulletList)), this.options.code !== !1 && n.push(Lf.configure(this.options.code)), this.options.codeBlock !== !1 && n.push($f.configure(this.options.codeBlock)), this.options.document !== !1 && n.push(Vf.configure(this.options.document)), this.options.dropcursor !== !1 && n.push(qf.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && n.push(
|
|
14353
|
+
return this.options.bold !== !1 && n.push(Df.configure(this.options.bold)), this.options.blockquote !== !1 && n.push(Of.configure(this.options.blockquote)), this.options.bulletList !== !1 && n.push(Rf.configure(this.options.bulletList)), this.options.code !== !1 && n.push(Lf.configure(this.options.code)), this.options.codeBlock !== !1 && n.push($f.configure(this.options.codeBlock)), this.options.document !== !1 && n.push(Vf.configure(this.options.document)), this.options.dropcursor !== !1 && n.push(qf.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && n.push(Yf.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && n.push(Zf.configure(this.options.hardBreak)), this.options.heading !== !1 && n.push(Qf.configure(this.options.heading)), this.options.history !== !1 && n.push(ch.configure(this.options.history)), this.options.horizontalRule !== !1 && n.push(dh.configure(this.options.horizontalRule)), this.options.italic !== !1 && n.push(mh.configure(this.options.italic)), this.options.listItem !== !1 && n.push(gh.configure(this.options.listItem)), this.options.orderedList !== !1 && n.push(bh.configure(this.options.orderedList)), this.options.paragraph !== !1 && n.push(kh.configure(this.options.paragraph)), this.options.strike !== !1 && n.push(Mh.configure(this.options.strike)), this.options.text !== !1 && n.push(wh.configure(this.options.text)), n;
|
|
14326
14354
|
}
|
|
14327
14355
|
}), Th = (n) => {
|
|
14328
14356
|
if (!n.children.length)
|
|
@@ -14365,7 +14393,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), ch = G.create({
|
|
|
14365
14393
|
}
|
|
14366
14394
|
};
|
|
14367
14395
|
}
|
|
14368
|
-
}),
|
|
14396
|
+
}), vh = G.create({
|
|
14369
14397
|
name: "color",
|
|
14370
14398
|
addOptions() {
|
|
14371
14399
|
return {
|
|
@@ -14397,7 +14425,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), ch = G.create({
|
|
|
14397
14425
|
unsetColor: () => ({ chain: n }) => n().setMark("textStyle", { color: null }).removeEmptyTextStyle().run()
|
|
14398
14426
|
};
|
|
14399
14427
|
}
|
|
14400
|
-
}),
|
|
14428
|
+
}), Eh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, Nh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, Ah = Me.create({
|
|
14401
14429
|
name: "highlight",
|
|
14402
14430
|
addOptions() {
|
|
14403
14431
|
return {
|
|
@@ -14442,7 +14470,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), ch = G.create({
|
|
|
14442
14470
|
addInputRules() {
|
|
14443
14471
|
return [
|
|
14444
14472
|
at({
|
|
14445
|
-
find:
|
|
14473
|
+
find: Eh,
|
|
14446
14474
|
type: this.type
|
|
14447
14475
|
})
|
|
14448
14476
|
];
|
|
@@ -14556,14 +14584,14 @@ const hl = fl(!1, !0), pl = fl(!0, !0), ch = G.create({
|
|
|
14556
14584
|
];
|
|
14557
14585
|
}
|
|
14558
14586
|
});
|
|
14559
|
-
var re, Gt,
|
|
14587
|
+
var re, Gt, Xt, de, Lr, ml, gl, yl, bl;
|
|
14560
14588
|
class Ph extends Ol {
|
|
14561
14589
|
constructor() {
|
|
14562
14590
|
super();
|
|
14563
14591
|
F(this, de);
|
|
14564
14592
|
F(this, re, null);
|
|
14565
14593
|
F(this, Gt, null);
|
|
14566
|
-
F(this,
|
|
14594
|
+
F(this, Xt, null);
|
|
14567
14595
|
}
|
|
14568
14596
|
connectedCallback() {
|
|
14569
14597
|
super.connectedCallback() && (q(this, de, ml).call(this), q(this, de, gl).call(this), q(this, de, Lr).call(this));
|
|
@@ -14574,7 +14602,7 @@ class Ph extends Ol {
|
|
|
14574
14602
|
set value(t) {
|
|
14575
14603
|
let r = t || "";
|
|
14576
14604
|
r && !/<\/?[a-z][^>]*>/i.test(r) && (r = r.split(`
|
|
14577
|
-
`).map((i) => `<p>${i}</p>`).join("")), O(this, re) ? O(this, re).commands.setContent(r, !1) : oe(this,
|
|
14605
|
+
`).map((i) => `<p>${i}</p>`).join("")), O(this, re) ? O(this, re).commands.setContent(r, !1) : oe(this, Xt, r);
|
|
14578
14606
|
}
|
|
14579
14607
|
get id() {
|
|
14580
14608
|
return this.getAttribute("id");
|
|
@@ -14599,7 +14627,7 @@ class Ph extends Ol {
|
|
|
14599
14627
|
O(this, re) && (O(this, re).destroy(), oe(this, re, null));
|
|
14600
14628
|
}
|
|
14601
14629
|
}
|
|
14602
|
-
re = new WeakMap(), Gt = new WeakMap(),
|
|
14630
|
+
re = new WeakMap(), Gt = new WeakMap(), Xt = new WeakMap(), de = new WeakSet(), // 2. 에디터 상태 업데이트 로직 분리
|
|
14603
14631
|
Lr = function() {
|
|
14604
14632
|
if (O(this, re)) {
|
|
14605
14633
|
const t = this.readonly;
|
|
@@ -14611,7 +14639,7 @@ Lr = function() {
|
|
|
14611
14639
|
const t = Ae.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
|
|
14612
14640
|
this.shadowRoot.innerHTML = `
|
|
14613
14641
|
<style>
|
|
14614
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.
|
|
14642
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.60/dist/css/nineEditor.css";
|
|
14615
14643
|
${r}
|
|
14616
14644
|
</style>
|
|
14617
14645
|
|
|
@@ -14659,7 +14687,7 @@ Lr = function() {
|
|
|
14659
14687
|
Ch,
|
|
14660
14688
|
// 기본 셋 (Bold, Italic, Strike 등 포함)
|
|
14661
14689
|
//Underline, // StarterKit에 없으므로 유지
|
|
14662
|
-
|
|
14690
|
+
vh,
|
|
14663
14691
|
// StarterKit에 없으므로 유지
|
|
14664
14692
|
Ah.configure({ multicolor: !0 }),
|
|
14665
14693
|
Dh.configure({ types: ["heading", "paragraph"] }),
|
|
@@ -14678,7 +14706,7 @@ Lr = function() {
|
|
|
14678
14706
|
}
|
|
14679
14707
|
})
|
|
14680
14708
|
],
|
|
14681
|
-
content: O(this,
|
|
14709
|
+
content: O(this, Xt) || this.originContents || "",
|
|
14682
14710
|
onUpdate: ({ editor: t }) => {
|
|
14683
14711
|
this.dispatchEvent(new CustomEvent("change", { detail: t.getHTML() }));
|
|
14684
14712
|
},
|