@vonage/vivid 5.14.0 → 5.15.0
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/bundled/base-color-picker.js +2 -2
- package/bundled/definition2.cjs +1 -1
- package/bundled/definition2.js +1 -1
- package/bundled/localized.js +1 -0
- package/bundled/slottable-request.js +1 -0
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/custom-elements.json +477 -203
- package/icon/definition.cjs +1 -1
- package/icon/definition.js +1 -1
- package/index.cjs +1 -0
- package/index.js +1 -1
- package/lib/rich-text-editor/rte/exports.d.ts +1 -0
- package/lib/rich-text-editor/rte/features/keyboard-shortcuts.d.ts +16 -0
- package/lib/rich-text-editor/rte/instance.d.ts +2 -1
- package/package.json +4 -4
- package/rich-text-editor/definition.cjs +49 -20
- package/rich-text-editor/definition.js +49 -21
- package/rich-text-editor/index.cjs +7 -7
- package/rich-text-editor/index.js +444 -424
- package/styles/core/all.css +2 -2
- package/styles/core/theme.css +2 -2
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/unbundled/base-color-picker.cjs +2 -2
- package/unbundled/base-color-picker.js +2 -2
- package/unbundled/localized.cjs +1 -0
- package/unbundled/localized.js +1 -0
- package/unbundled/slottable-request.cjs +1 -0
- package/unbundled/slottable-request.js +1 -0
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/vivid.api.json +32 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { w as ea, V as us, o as
|
|
2
|
-
import { S as C, F as T, M as Dn, a as ra, R as ia, N as oa, D as on, b as ti, i as A, g as Xi, s as
|
|
1
|
+
import { w as ea, V as us, o as mt, h as ds, d as fs, v as ta, c as na } from "../bundled/vivid-element.js";
|
|
2
|
+
import { S as C, F as T, M as Dn, a as ra, R as ia, N as oa, D as on, b as ti, i as A, g as Xi, s as at, c as hs, d as P, e as Qe, f as L, h as sa, j as Nn, r as ps } from "../bundled/slottable-request.js";
|
|
3
3
|
import { W as la } from "../bundled/localized.js";
|
|
4
4
|
import { r as Zi } from "../bundled/ref.js";
|
|
5
5
|
import { p as aa, P as ca, a as Qi } from "../bundled/definition9.js";
|
|
@@ -14,7 +14,7 @@ import { P as Ca, p as Ma } from "../bundled/definition16.js";
|
|
|
14
14
|
import { B as xa, b as Oa } from "../bundled/definition3.js";
|
|
15
15
|
import { D as Ea } from "../bundled/divider.js";
|
|
16
16
|
import { g as wa } from "../bundled/mixins.js";
|
|
17
|
-
const Da = ":host{display:
|
|
17
|
+
const Da = ":host{display:flex;flex-direction:column}.rte{display:flex;flex-direction:column;block-size:100%;min-block-size:0}.editor{display:contents}.editor-viewport{position:relative;display:flex;overflow:hidden;flex:1;flex-direction:column;contain:layout;min-block-size:0}.editor-scroll-area{--editor-padding-inline: var( --rich-text-editor-padding-inline, 16px );--editor-padding-block: var( --rich-text-editor-padding-block, 8px );display:flex;flex:1;flex-direction:column;background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base);min-block-size:0;overflow-y:auto;--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.editor-scroll-area{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.editor-scroll-area ::-webkit-scrollbar{width:4px}.editor-scroll-area ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.editor-scroll-area ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.popovers--disabled>*{display:none!important}", gs = 65535, bs = Math.pow(2, 16);
|
|
18
18
|
function Na(r, e) {
|
|
19
19
|
return r + e * bs;
|
|
20
20
|
}
|
|
@@ -452,7 +452,7 @@ class Ge extends se {
|
|
|
452
452
|
return new Ge(this.pos, this.mark);
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
return new
|
|
455
|
+
return new ft(this.pos, this.mark);
|
|
456
456
|
}
|
|
457
457
|
map(e) {
|
|
458
458
|
let t = e.mapResult(this.pos, 1);
|
|
@@ -471,7 +471,7 @@ class Ge extends se {
|
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
se.jsonID("addNodeMark", Ge);
|
|
474
|
-
class
|
|
474
|
+
class ft extends se {
|
|
475
475
|
/**
|
|
476
476
|
Create a mark-removing step.
|
|
477
477
|
*/
|
|
@@ -491,7 +491,7 @@ class dt extends se {
|
|
|
491
491
|
}
|
|
492
492
|
map(e) {
|
|
493
493
|
let t = e.mapResult(this.pos, 1);
|
|
494
|
-
return t.deletedAfter ? null : new
|
|
494
|
+
return t.deletedAfter ? null : new ft(t.pos, this.mark);
|
|
495
495
|
}
|
|
496
496
|
toJSON() {
|
|
497
497
|
return { stepType: "removeNodeMark", pos: this.pos, mark: this.mark.toJSON() };
|
|
@@ -502,11 +502,11 @@ class dt extends se {
|
|
|
502
502
|
static fromJSON(e, t) {
|
|
503
503
|
if (typeof t.pos != "number")
|
|
504
504
|
throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");
|
|
505
|
-
return new
|
|
505
|
+
return new ft(t.pos, e.markFromJSON(t.mark));
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
|
-
se.jsonID("removeNodeMark",
|
|
509
|
-
class
|
|
508
|
+
se.jsonID("removeNodeMark", ft);
|
|
509
|
+
class re extends se {
|
|
510
510
|
/**
|
|
511
511
|
The given `slice` should fit the 'gap' between `from` and
|
|
512
512
|
`to`—the depths must line up, and the surrounding nodes must be
|
|
@@ -526,21 +526,21 @@ class ne extends se {
|
|
|
526
526
|
return new be([this.from, this.to - this.from, this.slice.size]);
|
|
527
527
|
}
|
|
528
528
|
invert(e) {
|
|
529
|
-
return new
|
|
529
|
+
return new re(this.from, this.from + this.slice.size, e.slice(this.from, this.to));
|
|
530
530
|
}
|
|
531
531
|
map(e) {
|
|
532
532
|
let t = e.mapResult(this.from, 1), n = e.mapResult(this.to, -1);
|
|
533
|
-
return t.deletedAcross && n.deletedAcross ? null : new
|
|
533
|
+
return t.deletedAcross && n.deletedAcross ? null : new re(t.pos, Math.max(t.pos, n.pos), this.slice, this.structure);
|
|
534
534
|
}
|
|
535
535
|
merge(e) {
|
|
536
|
-
if (!(e instanceof
|
|
536
|
+
if (!(e instanceof re) || e.structure || this.structure)
|
|
537
537
|
return null;
|
|
538
538
|
if (this.from + this.slice.size == e.from && !this.slice.openEnd && !e.slice.openStart) {
|
|
539
539
|
let t = this.slice.size + e.slice.size == 0 ? C.empty : new C(this.slice.content.append(e.slice.content), this.slice.openStart, e.slice.openEnd);
|
|
540
|
-
return new
|
|
540
|
+
return new re(this.from, this.to + (e.to - e.from), t, this.structure);
|
|
541
541
|
} else if (e.to == this.from && !this.slice.openStart && !e.slice.openEnd) {
|
|
542
542
|
let t = this.slice.size + e.slice.size == 0 ? C.empty : new C(e.slice.content.append(this.slice.content), e.slice.openStart, this.slice.openEnd);
|
|
543
|
-
return new
|
|
543
|
+
return new re(e.from, this.to, t, this.structure);
|
|
544
544
|
} else
|
|
545
545
|
return null;
|
|
546
546
|
}
|
|
@@ -554,11 +554,11 @@ class ne extends se {
|
|
|
554
554
|
static fromJSON(e, t) {
|
|
555
555
|
if (typeof t.from != "number" || typeof t.to != "number")
|
|
556
556
|
throw new RangeError("Invalid input for ReplaceStep.fromJSON");
|
|
557
|
-
return new
|
|
557
|
+
return new re(t.from, t.to, C.fromJSON(e, t.slice), !!t.structure);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
|
-
se.jsonID("replace",
|
|
561
|
-
class
|
|
560
|
+
se.jsonID("replace", re);
|
|
561
|
+
class oe extends se {
|
|
562
562
|
/**
|
|
563
563
|
Create a replace-around step with the given range and gap.
|
|
564
564
|
`insert` should be the point in the slice into which the content
|
|
@@ -589,11 +589,11 @@ class ie extends se {
|
|
|
589
589
|
}
|
|
590
590
|
invert(e) {
|
|
591
591
|
let t = this.gapTo - this.gapFrom;
|
|
592
|
-
return new
|
|
592
|
+
return new oe(this.from, this.from + this.slice.size + t, this.from + this.insert, this.from + this.insert + t, e.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
|
|
593
593
|
}
|
|
594
594
|
map(e) {
|
|
595
595
|
let t = e.mapResult(this.from, 1), n = e.mapResult(this.to, -1), i = this.from == this.gapFrom ? t.pos : e.map(this.gapFrom, -1), o = this.to == this.gapTo ? n.pos : e.map(this.gapTo, 1);
|
|
596
|
-
return t.deletedAcross && n.deletedAcross || i < t.pos || o > n.pos ? null : new
|
|
596
|
+
return t.deletedAcross && n.deletedAcross || i < t.pos || o > n.pos ? null : new oe(t.pos, n.pos, i, o, this.slice, this.insert, this.structure);
|
|
597
597
|
}
|
|
598
598
|
toJSON() {
|
|
599
599
|
let e = {
|
|
@@ -612,10 +612,10 @@ class ie extends se {
|
|
|
612
612
|
static fromJSON(e, t) {
|
|
613
613
|
if (typeof t.from != "number" || typeof t.to != "number" || typeof t.gapFrom != "number" || typeof t.gapTo != "number" || typeof t.insert != "number")
|
|
614
614
|
throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
|
|
615
|
-
return new
|
|
615
|
+
return new oe(t.from, t.to, t.gapFrom, t.gapTo, C.fromJSON(e, t.slice), t.insert, !!t.structure);
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
se.jsonID("replaceAround",
|
|
618
|
+
se.jsonID("replaceAround", oe);
|
|
619
619
|
function Lr(r, e, t) {
|
|
620
620
|
let n = r.resolve(e), i = t - e, o = n.depth;
|
|
621
621
|
for (; i > 0 && o > 0 && n.indexAfter(o) == n.node(o).childCount; )
|
|
@@ -674,7 +674,7 @@ function ri(r, e, t, n = t.contentMatch, i = !0) {
|
|
|
674
674
|
for (let a = 0; a < o.childCount; a++) {
|
|
675
675
|
let c = o.child(a), u = l + c.nodeSize, d = n.matchType(c.type);
|
|
676
676
|
if (!d)
|
|
677
|
-
s.push(new
|
|
677
|
+
s.push(new re(l, u, C.empty));
|
|
678
678
|
else {
|
|
679
679
|
n = d;
|
|
680
680
|
for (let f = 0; f < c.marks.length; f++)
|
|
@@ -682,7 +682,7 @@ function ri(r, e, t, n = t.contentMatch, i = !0) {
|
|
|
682
682
|
if (i && c.isText && t.whitespace != "pre") {
|
|
683
683
|
let f, h = /\r?\n|\r/g, p;
|
|
684
684
|
for (; f = h.exec(c.text); )
|
|
685
|
-
p || (p = new C(T.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), s.push(new
|
|
685
|
+
p || (p = new C(T.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), s.push(new re(l + f.index, l + f.index + f[0].length, p));
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
l = u;
|
|
@@ -716,7 +716,7 @@ function Pa(r, e, t) {
|
|
|
716
716
|
let f = T.empty, h = 0;
|
|
717
717
|
for (let p = o, g = !1; p > t; p--)
|
|
718
718
|
g || i.after(p + 1) < i.end(p) ? (g = !0, f = T.from(i.node(p).copy(f)), h++) : c++;
|
|
719
|
-
r.step(new
|
|
719
|
+
r.step(new oe(a, c, s, l, new C(u.append(f), d, h), u.size - d, !0));
|
|
720
720
|
}
|
|
721
721
|
function Fa(r, e, t) {
|
|
722
722
|
let n = T.empty;
|
|
@@ -729,7 +729,7 @@ function Fa(r, e, t) {
|
|
|
729
729
|
n = T.from(t[s].type.create(t[s].attrs, n));
|
|
730
730
|
}
|
|
731
731
|
let i = e.start, o = e.end;
|
|
732
|
-
r.step(new
|
|
732
|
+
r.step(new oe(i, o, i, o, new C(n, 0, 0), t.length, !0));
|
|
733
733
|
}
|
|
734
734
|
function La(r, e, t, n, i) {
|
|
735
735
|
if (!n.isTextblock)
|
|
@@ -745,7 +745,7 @@ function La(r, e, t, n, i) {
|
|
|
745
745
|
}
|
|
746
746
|
c === !1 && Cs(r, s, l, o), ri(r, r.mapping.slice(o).map(l, 1), n, void 0, c === null);
|
|
747
747
|
let u = r.mapping.slice(o), d = u.map(l, 1), f = u.map(l + s.nodeSize, 1);
|
|
748
|
-
return r.step(new
|
|
748
|
+
return r.step(new oe(d, f, d + 1, f - 1, new C(T.from(n.create(a, null, s.marks)), 0, 0), 1, !0)), c === !0 && Ts(r, s, l, o), !1;
|
|
749
749
|
}
|
|
750
750
|
});
|
|
751
751
|
}
|
|
@@ -783,7 +783,7 @@ function Ba(r, e, t, n, i) {
|
|
|
783
783
|
return r.replaceWith(e, e + o.nodeSize, s);
|
|
784
784
|
if (!t.validContent(o.content))
|
|
785
785
|
throw new RangeError("Invalid content for node type " + t.name);
|
|
786
|
-
r.step(new
|
|
786
|
+
r.step(new oe(e, e + o.nodeSize, e + 1, e + o.nodeSize - 1, new C(T.from(s), 0, 0), 1, !0));
|
|
787
787
|
}
|
|
788
788
|
function xn(r, e, t = 1, n) {
|
|
789
789
|
let i = r.resolve(e), o = i.depth - t, s = n && n[n.length - 1] || i.parent;
|
|
@@ -809,7 +809,7 @@ function _a(r, e, t = 1, n) {
|
|
|
809
809
|
let u = n && n[c];
|
|
810
810
|
s = T.from(u ? u.type.create(u.attrs, s) : i.node(l).copy(s));
|
|
811
811
|
}
|
|
812
|
-
r.step(new
|
|
812
|
+
r.step(new re(e, e, new C(o.append(s), t, t), !0));
|
|
813
813
|
}
|
|
814
814
|
function oi(r, e) {
|
|
815
815
|
let t = r.resolve(e), n = t.index();
|
|
@@ -841,7 +841,7 @@ function Wa(r, e, t) {
|
|
|
841
841
|
}
|
|
842
842
|
s.inlineContent && ri(r, e + t - 1, s, o.node().contentMatchAt(o.index()), n == null);
|
|
843
843
|
let a = r.mapping.slice(l), c = a.map(e - t);
|
|
844
|
-
if (r.step(new
|
|
844
|
+
if (r.step(new re(c, a.map(e + t, -1), C.empty, !0)), n === !0) {
|
|
845
845
|
let u = r.doc.resolve(c);
|
|
846
846
|
Ts(r, u.node(), u.before(), r.steps.length);
|
|
847
847
|
}
|
|
@@ -894,7 +894,7 @@ function li(r, e, t = e, n = C.empty) {
|
|
|
894
894
|
if (e == t && !n.size)
|
|
895
895
|
return null;
|
|
896
896
|
let i = r.resolve(e), o = r.resolve(t);
|
|
897
|
-
return Ms(i, o, n) ? new
|
|
897
|
+
return Ms(i, o, n) ? new re(e, t, n) : new $a(i, o, n).fit();
|
|
898
898
|
}
|
|
899
899
|
function Ms(r, e, t) {
|
|
900
900
|
return !t.openStart && !t.openEnd && r.start() == e.start() && r.parent.canReplace(r.index(), e.index(), t.content);
|
|
@@ -927,7 +927,7 @@ class $a {
|
|
|
927
927
|
for (; s && l && o.childCount == 1; )
|
|
928
928
|
o = o.firstChild.content, s--, l--;
|
|
929
929
|
let a = new C(o, s, l);
|
|
930
|
-
return e > -1 ? new
|
|
930
|
+
return e > -1 ? new oe(n.pos, e, this.$to.pos, this.$to.end(), a, t) : a.size || n.pos != this.$to.pos ? new re(n.pos, i.pos, a) : null;
|
|
931
931
|
}
|
|
932
932
|
// Find a position on the start spine of `this.unplaced` that has
|
|
933
933
|
// content that can be moved somewhere on the frontier. Returns two
|
|
@@ -1084,7 +1084,7 @@ function Ja(r, e, t, n) {
|
|
|
1084
1084
|
return r.deleteRange(e, t);
|
|
1085
1085
|
let i = r.doc.resolve(e), o = r.doc.resolve(t);
|
|
1086
1086
|
if (Ms(i, o, n))
|
|
1087
|
-
return r.step(new
|
|
1087
|
+
return r.step(new re(e, t, n));
|
|
1088
1088
|
let s = Es(i, o);
|
|
1089
1089
|
s[s.length - 1] == 0 && s.pop();
|
|
1090
1090
|
let l = -(i.depth + 1);
|
|
@@ -1168,7 +1168,7 @@ function Es(r, e) {
|
|
|
1168
1168
|
}
|
|
1169
1169
|
return t;
|
|
1170
1170
|
}
|
|
1171
|
-
class
|
|
1171
|
+
class At extends se {
|
|
1172
1172
|
/**
|
|
1173
1173
|
Construct an attribute step.
|
|
1174
1174
|
*/
|
|
@@ -1190,11 +1190,11 @@ class Nt extends se {
|
|
|
1190
1190
|
return be.empty;
|
|
1191
1191
|
}
|
|
1192
1192
|
invert(e) {
|
|
1193
|
-
return new
|
|
1193
|
+
return new At(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);
|
|
1194
1194
|
}
|
|
1195
1195
|
map(e) {
|
|
1196
1196
|
let t = e.mapResult(this.pos, 1);
|
|
1197
|
-
return t.deletedAfter ? null : new
|
|
1197
|
+
return t.deletedAfter ? null : new At(t.pos, this.attr, this.value);
|
|
1198
1198
|
}
|
|
1199
1199
|
toJSON() {
|
|
1200
1200
|
return { stepType: "attr", pos: this.pos, attr: this.attr, value: this.value };
|
|
@@ -1202,10 +1202,10 @@ class Nt extends se {
|
|
|
1202
1202
|
static fromJSON(e, t) {
|
|
1203
1203
|
if (typeof t.pos != "number" || typeof t.attr != "string")
|
|
1204
1204
|
throw new RangeError("Invalid input for AttrStep.fromJSON");
|
|
1205
|
-
return new
|
|
1205
|
+
return new At(t.pos, t.attr, t.value);
|
|
1206
1206
|
}
|
|
1207
1207
|
}
|
|
1208
|
-
se.jsonID("attr",
|
|
1208
|
+
se.jsonID("attr", At);
|
|
1209
1209
|
class en extends se {
|
|
1210
1210
|
/**
|
|
1211
1211
|
Construct an attribute step.
|
|
@@ -1406,7 +1406,7 @@ class Ya {
|
|
|
1406
1406
|
to set attributes on the document itself.
|
|
1407
1407
|
*/
|
|
1408
1408
|
setNodeAttribute(e, t, n) {
|
|
1409
|
-
return this.step(new
|
|
1409
|
+
return this.step(new At(e, t, n)), this;
|
|
1410
1410
|
}
|
|
1411
1411
|
/**
|
|
1412
1412
|
Set a single attribute on the document to a new value.
|
|
@@ -1429,11 +1429,11 @@ class Ya {
|
|
|
1429
1429
|
if (!n)
|
|
1430
1430
|
throw new RangeError("No node at position " + e);
|
|
1431
1431
|
if (t instanceof Dn)
|
|
1432
|
-
t.isInSet(n.marks) && this.step(new
|
|
1432
|
+
t.isInSet(n.marks) && this.step(new ft(e, t));
|
|
1433
1433
|
else {
|
|
1434
1434
|
let i = n.marks, o, s = [];
|
|
1435
1435
|
for (; o = t.isInSet(i); )
|
|
1436
|
-
s.push(new
|
|
1436
|
+
s.push(new ft(e, o)), i = o.removeFromSet(i);
|
|
1437
1437
|
for (let l = s.length - 1; l >= 0; l--)
|
|
1438
1438
|
this.step(s[l]);
|
|
1439
1439
|
}
|
|
@@ -1569,11 +1569,11 @@ class D {
|
|
|
1569
1569
|
found.
|
|
1570
1570
|
*/
|
|
1571
1571
|
static findFrom(e, t, n = !1) {
|
|
1572
|
-
let i = e.parent.inlineContent ? new E(e) :
|
|
1572
|
+
let i = e.parent.inlineContent ? new E(e) : wt(e.node(0), e.parent, e.pos, e.index(), t, n);
|
|
1573
1573
|
if (i)
|
|
1574
1574
|
return i;
|
|
1575
1575
|
for (let o = e.depth - 1; o >= 0; o--) {
|
|
1576
|
-
let s = t < 0 ?
|
|
1576
|
+
let s = t < 0 ? wt(e.node(0), e.node(o), e.before(o + 1), e.index(o), t, n) : wt(e.node(0), e.node(o), e.after(o + 1), e.index(o) + 1, t, n);
|
|
1577
1577
|
if (s)
|
|
1578
1578
|
return s;
|
|
1579
1579
|
}
|
|
@@ -1594,14 +1594,14 @@ class D {
|
|
|
1594
1594
|
exists.
|
|
1595
1595
|
*/
|
|
1596
1596
|
static atStart(e) {
|
|
1597
|
-
return
|
|
1597
|
+
return wt(e, e, 0, 0, 1) || new Z(e);
|
|
1598
1598
|
}
|
|
1599
1599
|
/**
|
|
1600
1600
|
Find the cursor or leaf node selection closest to the end of the
|
|
1601
1601
|
given document.
|
|
1602
1602
|
*/
|
|
1603
1603
|
static atEnd(e) {
|
|
1604
|
-
return
|
|
1604
|
+
return wt(e, e, e.content.size, e.childCount, -1) || new Z(e);
|
|
1605
1605
|
}
|
|
1606
1606
|
/**
|
|
1607
1607
|
Deserialize the JSON representation of a selection. Must be
|
|
@@ -1840,7 +1840,7 @@ const Za = {
|
|
|
1840
1840
|
return new Z(r);
|
|
1841
1841
|
}
|
|
1842
1842
|
};
|
|
1843
|
-
function
|
|
1843
|
+
function wt(r, e, t, n, i, o = !1) {
|
|
1844
1844
|
if (e.inlineContent)
|
|
1845
1845
|
return E.create(r, t);
|
|
1846
1846
|
for (let s = n - (i > 0 ? 0 : 1); i > 0 ? s < e.childCount : s >= 0; s += i) {
|
|
@@ -1849,7 +1849,7 @@ function Et(r, e, t, n, i, o = !1) {
|
|
|
1849
1849
|
if (!o && x.isSelectable(l))
|
|
1850
1850
|
return x.create(r, t - (i < 0 ? l.nodeSize : 0));
|
|
1851
1851
|
} else {
|
|
1852
|
-
let a =
|
|
1852
|
+
let a = wt(r, l, t + i, i < 0 ? l.childCount : 0, i, o);
|
|
1853
1853
|
if (a)
|
|
1854
1854
|
return a;
|
|
1855
1855
|
}
|
|
@@ -1862,7 +1862,7 @@ function ro(r, e, t) {
|
|
|
1862
1862
|
if (n < e)
|
|
1863
1863
|
return;
|
|
1864
1864
|
let i = r.steps[n];
|
|
1865
|
-
if (!(i instanceof
|
|
1865
|
+
if (!(i instanceof re || i instanceof oe))
|
|
1866
1866
|
return;
|
|
1867
1867
|
let o = r.mapping.maps[n], s;
|
|
1868
1868
|
o.forEach((l, a, c, u) => {
|
|
@@ -2072,7 +2072,7 @@ class dr {
|
|
|
2072
2072
|
});
|
|
2073
2073
|
}
|
|
2074
2074
|
}
|
|
2075
|
-
class
|
|
2075
|
+
class Nt {
|
|
2076
2076
|
/**
|
|
2077
2077
|
@internal
|
|
2078
2078
|
*/
|
|
@@ -2147,7 +2147,7 @@ class Dt {
|
|
|
2147
2147
|
applyInner(e) {
|
|
2148
2148
|
if (!e.before.eq(this.doc))
|
|
2149
2149
|
throw new RangeError("Applying a mismatched transaction");
|
|
2150
|
-
let t = new
|
|
2150
|
+
let t = new Nt(this.config), n = this.config.fields;
|
|
2151
2151
|
for (let i = 0; i < n.length; i++) {
|
|
2152
2152
|
let o = n[i];
|
|
2153
2153
|
t[o.name] = o.apply(e, this[o.name], this, t);
|
|
@@ -2164,7 +2164,7 @@ class Dt {
|
|
|
2164
2164
|
Create a new state.
|
|
2165
2165
|
*/
|
|
2166
2166
|
static create(e) {
|
|
2167
|
-
let t = new dr(e.doc ? e.doc.type.schema : e.schema, e.plugins), n = new
|
|
2167
|
+
let t = new dr(e.doc ? e.doc.type.schema : e.schema, e.plugins), n = new Nt(t);
|
|
2168
2168
|
for (let i = 0; i < t.fields.length; i++)
|
|
2169
2169
|
n[t.fields[i].name] = t.fields[i].init(e, n);
|
|
2170
2170
|
return n;
|
|
@@ -2178,7 +2178,7 @@ class Dt {
|
|
|
2178
2178
|
configuration object..
|
|
2179
2179
|
*/
|
|
2180
2180
|
reconfigure(e) {
|
|
2181
|
-
let t = new dr(this.schema, e.plugins), n = t.fields, i = new
|
|
2181
|
+
let t = new dr(this.schema, e.plugins), n = t.fields, i = new Nt(t);
|
|
2182
2182
|
for (let o = 0; o < n.length; o++) {
|
|
2183
2183
|
let s = n[o].name;
|
|
2184
2184
|
i[s] = this.hasOwnProperty(s) ? this[s] : n[o].init(e, i);
|
|
@@ -2215,7 +2215,7 @@ class Dt {
|
|
|
2215
2215
|
throw new RangeError("Invalid input for EditorState.fromJSON");
|
|
2216
2216
|
if (!e.schema)
|
|
2217
2217
|
throw new RangeError("Required config field 'schema' missing");
|
|
2218
|
-
let i = new dr(e.schema, e.plugins), o = new
|
|
2218
|
+
let i = new dr(e.schema, e.plugins), o = new Nt(i);
|
|
2219
2219
|
return i.fields.forEach((s) => {
|
|
2220
2220
|
if (s.name == "doc")
|
|
2221
2221
|
o.doc = oa.fromJSON(e.schema, t.doc);
|
|
@@ -2297,7 +2297,7 @@ const ze = function(r, e, t) {
|
|
|
2297
2297
|
return n.setEnd(r, t ?? r.nodeValue.length), n.setStart(r, e || 0), n;
|
|
2298
2298
|
}, tc = function() {
|
|
2299
2299
|
zr = null;
|
|
2300
|
-
},
|
|
2300
|
+
}, ht = function(r, e, t, n) {
|
|
2301
2301
|
return t && (lo(r, e, t, n, -1) || lo(r, e, t, n, 1));
|
|
2302
2302
|
}, nc = /^(img|br|input|textarea|hr)$/i;
|
|
2303
2303
|
function lo(r, e, t, n, i) {
|
|
@@ -2370,9 +2370,9 @@ function sn(r) {
|
|
|
2370
2370
|
return e && e.node && e.node.isBlock && (e.dom == r || e.contentDOM == r);
|
|
2371
2371
|
}
|
|
2372
2372
|
const _n = function(r) {
|
|
2373
|
-
return r.focusNode &&
|
|
2373
|
+
return r.focusNode && ht(r.focusNode, r.focusOffset, r.anchorNode, r.anchorOffset);
|
|
2374
2374
|
};
|
|
2375
|
-
function
|
|
2375
|
+
function ot(r, e) {
|
|
2376
2376
|
let t = document.createEvent("Event");
|
|
2377
2377
|
return t.initEvent("keydown", !0, !0), t.keyCode = r, t.key = t.code = e, t;
|
|
2378
2378
|
}
|
|
@@ -2396,9 +2396,9 @@ function lc(r, e, t) {
|
|
|
2396
2396
|
return { node: n.startContainer, offset: Math.min(ke(n.startContainer), n.startOffset) };
|
|
2397
2397
|
}
|
|
2398
2398
|
}
|
|
2399
|
-
const Ae = typeof navigator < "u" ? navigator : null, ao = typeof document < "u" ? document : null,
|
|
2400
|
-
Te && +(/Firefox\/(\d+)/.exec(
|
|
2401
|
-
const Vr = !me && /Chrome\/(\d+)/.exec(
|
|
2399
|
+
const Ae = typeof navigator < "u" ? navigator : null, ao = typeof document < "u" ? document : null, tt = Ae && Ae.userAgent || "", Br = /Edge\/(\d+)/.exec(tt), Ns = /MSIE \d/.exec(tt), _r = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(tt), me = !!(Ns || _r || Br), Ye = Ns ? document.documentMode : _r ? +_r[1] : Br ? +Br[1] : 0, Te = !me && /gecko\/(\d+)/i.test(tt);
|
|
2400
|
+
Te && +(/Firefox\/(\d+)/.exec(tt) || [0, 0])[1];
|
|
2401
|
+
const Vr = !me && /Chrome\/(\d+)/.exec(tt), ie = !!Vr, As = Vr ? +Vr[1] : 0, ce = !me && !!Ae && /Apple Computer/.test(Ae.vendor), Pt = ce && (/Mobile\/\w+/.test(tt) || !!Ae && Ae.maxTouchPoints > 2), ye = Pt || (Ae ? /Mac/.test(Ae.platform) : !1), ac = Ae ? /Win/.test(Ae.platform) : !1, _e = /Android \d/.test(tt), ln = !!ao && "webkitFontSmoothing" in ao.documentElement.style, cc = ln ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
2402
2402
|
function uc(r) {
|
|
2403
2403
|
let e = r.defaultView && r.defaultView.visualViewport;
|
|
2404
2404
|
return e ? {
|
|
@@ -2478,18 +2478,18 @@ function Is(r, e) {
|
|
|
2478
2478
|
n.scrollTop != i + e && (n.scrollTop = i + e), n.scrollLeft != o && (n.scrollLeft = o);
|
|
2479
2479
|
}
|
|
2480
2480
|
}
|
|
2481
|
-
let
|
|
2481
|
+
let Ot = null;
|
|
2482
2482
|
function pc(r) {
|
|
2483
2483
|
if (r.setActive)
|
|
2484
2484
|
return r.setActive();
|
|
2485
|
-
if (
|
|
2486
|
-
return r.focus(
|
|
2485
|
+
if (Ot)
|
|
2486
|
+
return r.focus(Ot);
|
|
2487
2487
|
let e = vs(r);
|
|
2488
|
-
r.focus(
|
|
2488
|
+
r.focus(Ot == null ? {
|
|
2489
2489
|
get preventScroll() {
|
|
2490
|
-
return
|
|
2490
|
+
return Ot = { preventScroll: !0 }, !0;
|
|
2491
2491
|
}
|
|
2492
|
-
} : void 0),
|
|
2492
|
+
} : void 0), Ot || (Ot = !1, Is(e, 0));
|
|
2493
2493
|
}
|
|
2494
2494
|
function Rs(r, e) {
|
|
2495
2495
|
let t, n = 2e8, i, o = 0, s = e.top, l = e.top, a, c;
|
|
@@ -2732,7 +2732,7 @@ let fo = null, ho = null, po = !1;
|
|
|
2732
2732
|
function xc(r, e, t) {
|
|
2733
2733
|
return fo == e && ho == t ? po : (fo = e, ho = t, po = t == "up" || t == "down" ? Tc(r, e, t) : Mc(r, e, t));
|
|
2734
2734
|
}
|
|
2735
|
-
const Ce = 0, mo = 1,
|
|
2735
|
+
const Ce = 0, mo = 1, st = 2, ve = 3;
|
|
2736
2736
|
class an {
|
|
2737
2737
|
constructor(e, t, n, i) {
|
|
2738
2738
|
this.parent = e, this.children = t, this.dom = n, this.contentDOM = i, this.dirty = Ce, n.pmViewDesc = this;
|
|
@@ -3015,7 +3015,7 @@ class an {
|
|
|
3015
3015
|
let h = u.focusNode.childNodes[u.focusOffset];
|
|
3016
3016
|
h && h.contentEditable == "false" && (i = !0);
|
|
3017
3017
|
}
|
|
3018
|
-
if (!(i || d && ce) &&
|
|
3018
|
+
if (!(i || d && ce) && ht(l.node, l.offset, u.anchorNode, u.anchorOffset) && ht(a.node, a.offset, u.focusNode, u.focusOffset))
|
|
3019
3019
|
return;
|
|
3020
3020
|
let f = !1;
|
|
3021
3021
|
if ((c.extend || e == t) && !(d && Te)) {
|
|
@@ -3048,19 +3048,19 @@ class an {
|
|
|
3048
3048
|
if (n == s ? e <= s && t >= n : e < s && t > n) {
|
|
3049
3049
|
let l = n + o.border, a = s - o.border;
|
|
3050
3050
|
if (e >= l && t <= a) {
|
|
3051
|
-
this.dirty = e == n || t == s ?
|
|
3051
|
+
this.dirty = e == n || t == s ? st : mo, e == l && t == a && (o.contentLost || o.dom.parentNode != this.contentDOM) ? o.dirty = ve : o.markDirty(e - l, t - l);
|
|
3052
3052
|
return;
|
|
3053
3053
|
} else
|
|
3054
|
-
o.dirty = o.dom == o.contentDOM && o.dom.parentNode == this.contentDOM && !o.children.length ?
|
|
3054
|
+
o.dirty = o.dom == o.contentDOM && o.dom.parentNode == this.contentDOM && !o.children.length ? st : ve;
|
|
3055
3055
|
}
|
|
3056
3056
|
n = s;
|
|
3057
3057
|
}
|
|
3058
|
-
this.dirty =
|
|
3058
|
+
this.dirty = st;
|
|
3059
3059
|
}
|
|
3060
3060
|
markParentsDirty() {
|
|
3061
3061
|
let e = 1;
|
|
3062
3062
|
for (let t = this.parent; t; t = t.parent, e++) {
|
|
3063
|
-
let n = e == 1 ?
|
|
3063
|
+
let n = e == 1 ? st : mo;
|
|
3064
3064
|
t.dirty < n && (t.dirty = n);
|
|
3065
3065
|
}
|
|
3066
3066
|
}
|
|
@@ -3137,13 +3137,13 @@ class Oc extends an {
|
|
|
3137
3137
|
return e.type === "characterData" && e.target.nodeValue == e.oldValue;
|
|
3138
3138
|
}
|
|
3139
3139
|
}
|
|
3140
|
-
class
|
|
3140
|
+
class pt extends an {
|
|
3141
3141
|
constructor(e, t, n, i, o) {
|
|
3142
3142
|
super(e, [], n, i), this.mark = t, this.spec = o;
|
|
3143
3143
|
}
|
|
3144
3144
|
static create(e, t, n, i) {
|
|
3145
3145
|
let o = i.nodeViews[t.type.name], s = o && o(t, i, n);
|
|
3146
|
-
return (!s || !s.dom) && (s = on.renderSpec(document, t.type.spec.toDOM(t, n), null, t.attrs)), new
|
|
3146
|
+
return (!s || !s.dom) && (s = on.renderSpec(document, t.type.spec.toDOM(t, n), null, t.attrs)), new pt(e, t, s.dom, s.contentDOM || s.dom, s);
|
|
3147
3147
|
}
|
|
3148
3148
|
parseRule() {
|
|
3149
3149
|
return this.dirty & ve || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
|
|
@@ -3160,7 +3160,7 @@ class ht extends an {
|
|
|
3160
3160
|
}
|
|
3161
3161
|
}
|
|
3162
3162
|
slice(e, t, n) {
|
|
3163
|
-
let i =
|
|
3163
|
+
let i = pt.create(this.parent, this.mark, !0, n), o = this.children, s = this.size;
|
|
3164
3164
|
t < s && (o = Wr(o, t, s, n)), e > 0 && (o = Wr(o, 0, e, n));
|
|
3165
3165
|
for (let l = 0; l < o.length; l++)
|
|
3166
3166
|
o[l].parent = i;
|
|
@@ -3244,7 +3244,7 @@ class Xe extends an {
|
|
|
3244
3244
|
a.syncToMarks(c.marks, n, e);
|
|
3245
3245
|
let h;
|
|
3246
3246
|
a.findNodeMatch(c, u, d, f) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (h = a.findIndexWithChild(o.node)) > -1 && a.updateNodeAt(c, u, d, h, e) || a.updateNextNode(c, u, d, e, f, i) || a.addNode(c, u, d, e, i), i += c.nodeSize;
|
|
3247
|
-
}), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty ==
|
|
3247
|
+
}), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == st) && (s && this.protectLocalComposition(e, s), _s(this.contentDOM, this.children, e), Pt && Ic(this.dom));
|
|
3248
3248
|
}
|
|
3249
3249
|
localCompositionInfo(e, t) {
|
|
3250
3250
|
let { from: n, to: i } = e.state.selection;
|
|
@@ -3405,7 +3405,7 @@ function _s(r, e, t) {
|
|
|
3405
3405
|
n = n.nextSibling;
|
|
3406
3406
|
} else
|
|
3407
3407
|
i = !0, r.insertBefore(l, n);
|
|
3408
|
-
if (s instanceof
|
|
3408
|
+
if (s instanceof pt) {
|
|
3409
3409
|
let a = n ? n.previousSibling : r.lastChild;
|
|
3410
3410
|
_s(s.contentDOM, s.children, t), n = a ? a.nextSibling : r.firstChild;
|
|
3411
3411
|
}
|
|
@@ -3418,11 +3418,11 @@ const Yt = function(r) {
|
|
|
3418
3418
|
r && (this.nodeName = r);
|
|
3419
3419
|
};
|
|
3420
3420
|
Yt.prototype = /* @__PURE__ */ Object.create(null);
|
|
3421
|
-
const
|
|
3421
|
+
const lt = [new Yt()];
|
|
3422
3422
|
function Hr(r, e, t) {
|
|
3423
3423
|
if (r.length == 0)
|
|
3424
|
-
return
|
|
3425
|
-
let n = t ?
|
|
3424
|
+
return lt;
|
|
3425
|
+
let n = t ? lt[0] : new Yt(), i = [n];
|
|
3426
3426
|
for (let o = 0; o < r.length; o++) {
|
|
3427
3427
|
let s = r[o].type.attrs;
|
|
3428
3428
|
if (s) {
|
|
@@ -3436,16 +3436,16 @@ function Hr(r, e, t) {
|
|
|
3436
3436
|
return i;
|
|
3437
3437
|
}
|
|
3438
3438
|
function Vs(r, e, t, n) {
|
|
3439
|
-
if (t ==
|
|
3439
|
+
if (t == lt && n == lt)
|
|
3440
3440
|
return e;
|
|
3441
3441
|
let i = e;
|
|
3442
3442
|
for (let o = 0; o < n.length; o++) {
|
|
3443
3443
|
let s = n[o], l = t[o];
|
|
3444
3444
|
if (o) {
|
|
3445
3445
|
let a;
|
|
3446
|
-
l && l.nodeName == s.nodeName && i != r && (a = i.parentNode) && a.nodeName.toLowerCase() == s.nodeName || (a = document.createElement(s.nodeName), a.pmIsDeco = !0, a.appendChild(i), l =
|
|
3446
|
+
l && l.nodeName == s.nodeName && i != r && (a = i.parentNode) && a.nodeName.toLowerCase() == s.nodeName || (a = document.createElement(s.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = lt[0]), i = a;
|
|
3447
3447
|
}
|
|
3448
|
-
wc(i, l ||
|
|
3448
|
+
wc(i, l || lt[0], s);
|
|
3449
3449
|
}
|
|
3450
3450
|
return i;
|
|
3451
3451
|
}
|
|
@@ -3472,7 +3472,7 @@ function wc(r, e, t) {
|
|
|
3472
3472
|
}
|
|
3473
3473
|
}
|
|
3474
3474
|
function Hs(r, e, t) {
|
|
3475
|
-
return Vs(r, r,
|
|
3475
|
+
return Vs(r, r, lt, Hr(e, t, r.nodeType != 1));
|
|
3476
3476
|
}
|
|
3477
3477
|
function An(r, e) {
|
|
3478
3478
|
if (r.length != e.length)
|
|
@@ -3524,7 +3524,7 @@ class Dc {
|
|
|
3524
3524
|
if (l > -1)
|
|
3525
3525
|
l > this.index && (this.changed = !0, this.destroyBetween(this.index, l)), this.top = this.top.children[this.index];
|
|
3526
3526
|
else {
|
|
3527
|
-
let a =
|
|
3527
|
+
let a = pt.create(this.top, e[o], t, n);
|
|
3528
3528
|
this.top.children.splice(this.index, 0, a), this.top = a, this.changed = !0;
|
|
3529
3529
|
}
|
|
3530
3530
|
this.index = 0, o++;
|
|
@@ -3548,7 +3548,7 @@ class Dc {
|
|
|
3548
3548
|
}
|
|
3549
3549
|
updateNodeAt(e, t, n, i, o) {
|
|
3550
3550
|
let s = this.top.children[i];
|
|
3551
|
-
return s.dirty == ve && s.dom == s.contentDOM && (s.dirty =
|
|
3551
|
+
return s.dirty == ve && s.dom == s.contentDOM && (s.dirty = st), s.update(e, t, n, o) ? (this.destroyBetween(this.index, i), this.index++, !0) : !1;
|
|
3552
3552
|
}
|
|
3553
3553
|
findIndexWithChild(e) {
|
|
3554
3554
|
for (; ; ) {
|
|
@@ -3580,7 +3580,7 @@ class Dc {
|
|
|
3580
3580
|
if (!f && a.update(e, t, n, i))
|
|
3581
3581
|
return this.destroyBetween(this.index, l), a.dom != u && (this.changed = !0), this.index++, !0;
|
|
3582
3582
|
if (!f && (d = this.recreateWrapper(a, e, t, n, i, s)))
|
|
3583
|
-
return this.destroyBetween(this.index, l), this.top.children[this.index] = d, d.contentDOM && (d.dirty =
|
|
3583
|
+
return this.destroyBetween(this.index, l), this.top.children[this.index] = d, d.contentDOM && (d.dirty = st, d.updateChildren(i, s + 1), d.dirty = Ce), this.changed = !0, this.index++, !0;
|
|
3584
3584
|
break;
|
|
3585
3585
|
}
|
|
3586
3586
|
}
|
|
@@ -3617,10 +3617,10 @@ class Dc {
|
|
|
3617
3617
|
// contentEditable.
|
|
3618
3618
|
addTextblockHacks() {
|
|
3619
3619
|
let e = this.top.children[this.index - 1], t = this.top;
|
|
3620
|
-
for (; e instanceof
|
|
3620
|
+
for (; e instanceof pt; )
|
|
3621
3621
|
t = e, e = t.children[t.children.length - 1];
|
|
3622
3622
|
(!e || // Empty textblock
|
|
3623
|
-
!(e instanceof Vn) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((ce ||
|
|
3623
|
+
!(e instanceof Vn) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((ce || ie) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
|
|
3624
3624
|
}
|
|
3625
3625
|
addHackNode(e, t) {
|
|
3626
3626
|
if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))
|
|
@@ -3643,7 +3643,7 @@ function Nc(r, e) {
|
|
|
3643
3643
|
for (; ; )
|
|
3644
3644
|
if (n) {
|
|
3645
3645
|
let c = t.children[n - 1];
|
|
3646
|
-
if (c instanceof
|
|
3646
|
+
if (c instanceof pt)
|
|
3647
3647
|
t = c, n = c.children.length;
|
|
3648
3648
|
else {
|
|
3649
3649
|
l = c, n--;
|
|
@@ -3796,9 +3796,9 @@ function Ws(r) {
|
|
|
3796
3796
|
function Ve(r, e = !1) {
|
|
3797
3797
|
let t = r.state.selection;
|
|
3798
3798
|
if (Us(r, t), !!Ws(r)) {
|
|
3799
|
-
if (!e && r.input.mouseDown && r.input.mouseDown.allowDefault &&
|
|
3799
|
+
if (!e && r.input.mouseDown && r.input.mouseDown.allowDefault && ie) {
|
|
3800
3800
|
let n = r.domSelectionRange(), i = r.domObserver.currentSelection;
|
|
3801
|
-
if (n.anchorNode && i.anchorNode &&
|
|
3801
|
+
if (n.anchorNode && i.anchorNode && ht(n.anchorNode, n.anchorOffset, i.anchorNode, i.anchorOffset)) {
|
|
3802
3802
|
r.input.mouseDown.delayedSelectionSync = !0, r.domObserver.setCurSelection();
|
|
3803
3803
|
return;
|
|
3804
3804
|
}
|
|
@@ -3812,7 +3812,7 @@ function Ve(r, e = !1) {
|
|
|
3812
3812
|
r.domObserver.setCurSelection(), r.domObserver.connectSelection();
|
|
3813
3813
|
}
|
|
3814
3814
|
}
|
|
3815
|
-
const yo = ce ||
|
|
3815
|
+
const yo = ce || ie && As < 63;
|
|
3816
3816
|
function ko(r, e) {
|
|
3817
3817
|
let { node: t, offset: n } = r.docView.domFromPos(e, 0), i = n < t.childNodes.length ? t.childNodes[n] : null, o = n ? t.childNodes[n - 1] : null;
|
|
3818
3818
|
if (ce && i && i.contentEditable == "false")
|
|
@@ -3875,7 +3875,7 @@ function $s(r) {
|
|
|
3875
3875
|
}
|
|
3876
3876
|
function Lc(r) {
|
|
3877
3877
|
let e = r.docView.domFromPos(r.state.selection.anchor, 0), t = r.domSelectionRange();
|
|
3878
|
-
return
|
|
3878
|
+
return ht(e.node, e.offset, t.anchorNode, t.anchorOffset);
|
|
3879
3879
|
}
|
|
3880
3880
|
function Ur(r, e) {
|
|
3881
3881
|
let { $anchor: t, $head: n } = r.selection, i = e > 0 ? t.max(n) : t.min(n), o = i.parent.inlineContent ? i.depth ? r.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
|
|
@@ -3921,7 +3921,7 @@ function Xt(r, e) {
|
|
|
3921
3921
|
let t = r.pmViewDesc;
|
|
3922
3922
|
return t && t.size == 0 && (e < 0 || r.nextSibling || r.nodeName != "BR");
|
|
3923
3923
|
}
|
|
3924
|
-
function
|
|
3924
|
+
function Et(r, e) {
|
|
3925
3925
|
return e < 0 ? zc(r) : Bc(r);
|
|
3926
3926
|
}
|
|
3927
3927
|
function zc(r) {
|
|
@@ -4040,7 +4040,7 @@ function $r(r, e, t) {
|
|
|
4040
4040
|
}
|
|
4041
4041
|
function xo(r, e) {
|
|
4042
4042
|
let t = r.state.doc.resolve(e);
|
|
4043
|
-
if (!(
|
|
4043
|
+
if (!(ie || ac) && t.parent.inlineContent) {
|
|
4044
4044
|
let i = r.coordsAtPos(e);
|
|
4045
4045
|
if (e > t.start()) {
|
|
4046
4046
|
let o = r.coordsAtPos(e - 1), s = (o.top + o.bottom) / 2;
|
|
@@ -4108,22 +4108,22 @@ function Wc(r) {
|
|
|
4108
4108
|
function Uc(r, e) {
|
|
4109
4109
|
let t = e.keyCode, n = Wc(e);
|
|
4110
4110
|
if (t == 8 || ye && t == 72 && n == "c")
|
|
4111
|
-
return Eo(r, -1) ||
|
|
4111
|
+
return Eo(r, -1) || Et(r, -1);
|
|
4112
4112
|
if (t == 46 && !e.shiftKey || ye && t == 68 && n == "c")
|
|
4113
|
-
return Eo(r, 1) ||
|
|
4113
|
+
return Eo(r, 1) || Et(r, 1);
|
|
4114
4114
|
if (t == 13 || t == 27)
|
|
4115
4115
|
return !0;
|
|
4116
4116
|
if (t == 37 || ye && t == 66 && n == "c") {
|
|
4117
4117
|
let i = t == 37 ? xo(r, r.state.selection.from) == "ltr" ? -1 : 1 : -1;
|
|
4118
|
-
return Mo(r, i, n) ||
|
|
4118
|
+
return Mo(r, i, n) || Et(r, i);
|
|
4119
4119
|
} else if (t == 39 || ye && t == 70 && n == "c") {
|
|
4120
4120
|
let i = t == 39 ? xo(r, r.state.selection.from) == "ltr" ? 1 : -1 : 1;
|
|
4121
|
-
return Mo(r, i, n) ||
|
|
4121
|
+
return Mo(r, i, n) || Et(r, i);
|
|
4122
4122
|
} else {
|
|
4123
4123
|
if (t == 38 || ye && t == 80 && n == "c")
|
|
4124
|
-
return Oo(r, -1, n) ||
|
|
4124
|
+
return Oo(r, -1, n) || Et(r, -1);
|
|
4125
4125
|
if (t == 40 || ye && t == 78 && n == "c")
|
|
4126
|
-
return Hc(r) || Oo(r, 1, n) ||
|
|
4126
|
+
return Hc(r) || Oo(r, 1, n) || Et(r, 1);
|
|
4127
4127
|
if (n == (ye ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
4128
4128
|
return !0;
|
|
4129
4129
|
}
|
|
@@ -4295,7 +4295,7 @@ function Jc(r) {
|
|
|
4295
4295
|
return t;
|
|
4296
4296
|
}
|
|
4297
4297
|
function Gc(r) {
|
|
4298
|
-
let e = r.querySelectorAll(
|
|
4298
|
+
let e = r.querySelectorAll(ie ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
4299
4299
|
for (let t = 0; t < e.length; t++) {
|
|
4300
4300
|
let n = e[t];
|
|
4301
4301
|
n.childNodes.length == 1 && n.textContent == " " && n.parentNode && n.parentNode.replaceChild(r.ownerDocument.createTextNode(" "), n);
|
|
@@ -4370,11 +4370,11 @@ function tu(r, e) {
|
|
|
4370
4370
|
}
|
|
4371
4371
|
de.keydown = (r, e) => {
|
|
4372
4372
|
let t = e;
|
|
4373
|
-
if (r.input.shiftKey = t.keyCode == 16 || t.shiftKey, !Qs(r, t) && (r.input.lastKeyCode = t.keyCode, r.input.lastKeyCodeTime = Date.now(), !(_e &&
|
|
4373
|
+
if (r.input.shiftKey = t.keyCode == 16 || t.shiftKey, !Qs(r, t) && (r.input.lastKeyCode = t.keyCode, r.input.lastKeyCodeTime = Date.now(), !(_e && ie && t.keyCode == 13)))
|
|
4374
4374
|
if (t.keyCode != 229 && r.domObserver.forceFlush(), Pt && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
4375
4375
|
let n = Date.now();
|
|
4376
4376
|
r.input.lastIOSEnter = n, r.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
4377
|
-
r.input.lastIOSEnter == n && (r.someProp("handleKeyDown", (i) => i(r,
|
|
4377
|
+
r.input.lastIOSEnter == n && (r.someProp("handleKeyDown", (i) => i(r, ot(13, "Enter"))), r.input.lastIOSEnter = 0);
|
|
4378
4378
|
}, 200);
|
|
4379
4379
|
} else r.someProp("handleKeyDown", (n) => n(r, t)) || Uc(r, t) ? t.preventDefault() : je(r, "key");
|
|
4380
4380
|
};
|
|
@@ -4411,7 +4411,7 @@ function mi(r, e, t, n, i) {
|
|
|
4411
4411
|
return !0;
|
|
4412
4412
|
return !1;
|
|
4413
4413
|
}
|
|
4414
|
-
function
|
|
4414
|
+
function vt(r, e, t) {
|
|
4415
4415
|
if (r.focused || r.focus(), r.state.selection.eq(e))
|
|
4416
4416
|
return;
|
|
4417
4417
|
let n = r.state.tr.setSelection(e);
|
|
@@ -4421,7 +4421,7 @@ function ru(r, e) {
|
|
|
4421
4421
|
if (e == -1)
|
|
4422
4422
|
return !1;
|
|
4423
4423
|
let t = r.state.doc.resolve(e), n = t.nodeAfter;
|
|
4424
|
-
return n && n.isAtom && x.isSelectable(n) ? (
|
|
4424
|
+
return n && n.isAtom && x.isSelectable(n) ? (vt(r, new x(t)), !0) : !1;
|
|
4425
4425
|
}
|
|
4426
4426
|
function iu(r, e) {
|
|
4427
4427
|
if (e == -1)
|
|
@@ -4436,7 +4436,7 @@ function iu(r, e) {
|
|
|
4436
4436
|
break;
|
|
4437
4437
|
}
|
|
4438
4438
|
}
|
|
4439
|
-
return i != null ? (
|
|
4439
|
+
return i != null ? (vt(r, x.create(r.state.doc, i)), !0) : !1;
|
|
4440
4440
|
}
|
|
4441
4441
|
function ou(r, e, t, n, i) {
|
|
4442
4442
|
return mi(r, "handleClickOn", e, t, n) || r.someProp("handleClick", (o) => o(r, e, n)) || (i ? iu(r, t) : ru(r, t));
|
|
@@ -4452,14 +4452,14 @@ function au(r, e, t) {
|
|
|
4452
4452
|
return !1;
|
|
4453
4453
|
let n = r.state.doc;
|
|
4454
4454
|
if (e == -1)
|
|
4455
|
-
return n.inlineContent ? (
|
|
4455
|
+
return n.inlineContent ? (vt(r, E.create(n, 0, n.content.size)), !0) : !1;
|
|
4456
4456
|
let i = n.resolve(e);
|
|
4457
4457
|
for (let o = i.depth + 1; o > 0; o--) {
|
|
4458
4458
|
let s = o > i.depth ? i.nodeAfter : i.node(o), l = i.before(o);
|
|
4459
4459
|
if (s.inlineContent)
|
|
4460
|
-
|
|
4460
|
+
vt(r, E.create(n, l + 1, l + 1 + s.content.size));
|
|
4461
4461
|
else if (x.isSelectable(s))
|
|
4462
|
-
|
|
4462
|
+
vt(r, x.create(n, l));
|
|
4463
4463
|
else
|
|
4464
4464
|
continue;
|
|
4465
4465
|
return !0;
|
|
@@ -4514,7 +4514,7 @@ class cu {
|
|
|
4514
4514
|
// (hidden) cursor is doesn't change the selection, and
|
|
4515
4515
|
// thus doesn't get a reaction from ProseMirror. This
|
|
4516
4516
|
// works around that.
|
|
4517
|
-
|
|
4517
|
+
ie && !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) ? (vt(this.view, D.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : je(this.view, "pointer");
|
|
4518
4518
|
}
|
|
4519
4519
|
move(e) {
|
|
4520
4520
|
this.updateAllowDefault(e), je(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
@@ -4678,7 +4678,7 @@ ue.dragstart = (r, e) => {
|
|
|
4678
4678
|
}
|
|
4679
4679
|
}
|
|
4680
4680
|
let l = (s || r.state.selection).content(), { dom: a, text: c, slice: u } = hi(r, l);
|
|
4681
|
-
(!t.dataTransfer.files.length || !
|
|
4681
|
+
(!t.dataTransfer.files.length || !ie || As > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(tn ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", tn || t.dataTransfer.setData("text/plain", c), r.dragging = new rl(u, il(r, t), s);
|
|
4682
4682
|
};
|
|
4683
4683
|
ue.dragend = (r) => {
|
|
4684
4684
|
let e = r.dragging;
|
|
@@ -4735,11 +4735,11 @@ ue.blur = (r, e) => {
|
|
|
4735
4735
|
r.focused && (r.domObserver.stop(), r.dom.classList.remove("ProseMirror-focused"), r.domObserver.start(), t.relatedTarget && r.dom.contains(t.relatedTarget) && r.domObserver.currentSelection.clear(), r.focused = !1);
|
|
4736
4736
|
};
|
|
4737
4737
|
ue.beforeinput = (r, e) => {
|
|
4738
|
-
if (
|
|
4738
|
+
if (ie && _e && e.inputType == "deleteContentBackward") {
|
|
4739
4739
|
r.domObserver.flushSoon();
|
|
4740
4740
|
let { domChangeCount: n } = r.input;
|
|
4741
4741
|
setTimeout(() => {
|
|
4742
|
-
if (r.input.domChangeCount != n || (r.dom.blur(), r.focus(), r.someProp("handleKeyDown", (o) => o(r,
|
|
4742
|
+
if (r.input.domChangeCount != n || (r.dom.blur(), r.focus(), r.someProp("handleKeyDown", (o) => o(r, ot(8, "Backspace")))))
|
|
4743
4743
|
return;
|
|
4744
4744
|
let { $cursor: i } = r.state.selection;
|
|
4745
4745
|
i && i.pos > 0 && r.dispatch(r.state.tr.delete(i.pos - 1, i.pos).scrollIntoView());
|
|
@@ -4761,7 +4761,7 @@ function rn(r, e) {
|
|
|
4761
4761
|
}
|
|
4762
4762
|
class Rn {
|
|
4763
4763
|
constructor(e, t) {
|
|
4764
|
-
this.toDOM = e, this.spec = t ||
|
|
4764
|
+
this.toDOM = e, this.spec = t || ct, this.side = this.spec.side || 0;
|
|
4765
4765
|
}
|
|
4766
4766
|
map(e, t, n, i) {
|
|
4767
4767
|
let { pos: o, deleted: s } = e.mapResult(t.from + i, this.side < 0 ? -1 : 1);
|
|
@@ -4779,7 +4779,7 @@ class Rn {
|
|
|
4779
4779
|
}
|
|
4780
4780
|
class Ze {
|
|
4781
4781
|
constructor(e, t) {
|
|
4782
|
-
this.attrs = e, this.spec = t ||
|
|
4782
|
+
this.attrs = e, this.spec = t || ct;
|
|
4783
4783
|
}
|
|
4784
4784
|
map(e, t, n, i) {
|
|
4785
4785
|
let o = e.map(t.from + i, this.spec.inclusiveStart ? -1 : 1) - n, s = e.map(t.to + i, this.spec.inclusiveEnd ? 1 : -1) - n;
|
|
@@ -4799,7 +4799,7 @@ class Ze {
|
|
|
4799
4799
|
}
|
|
4800
4800
|
class bi {
|
|
4801
4801
|
constructor(e, t) {
|
|
4802
|
-
this.attrs = e, this.spec = t ||
|
|
4802
|
+
this.attrs = e, this.spec = t || ct;
|
|
4803
4803
|
}
|
|
4804
4804
|
map(e, t, n, i) {
|
|
4805
4805
|
let o = e.mapResult(t.from + i, 1);
|
|
@@ -4889,13 +4889,13 @@ class q {
|
|
|
4889
4889
|
return this.type instanceof Rn;
|
|
4890
4890
|
}
|
|
4891
4891
|
}
|
|
4892
|
-
const
|
|
4892
|
+
const Dt = [], ct = {};
|
|
4893
4893
|
class I {
|
|
4894
4894
|
/**
|
|
4895
4895
|
@internal
|
|
4896
4896
|
*/
|
|
4897
4897
|
constructor(e, t) {
|
|
4898
|
-
this.local = e.length ? e :
|
|
4898
|
+
this.local = e.length ? e : Dt, this.children = t.length ? t : Dt;
|
|
4899
4899
|
}
|
|
4900
4900
|
/**
|
|
4901
4901
|
Create a set of decorations, using the structure of the given
|
|
@@ -4903,7 +4903,7 @@ class I {
|
|
|
4903
4903
|
you must make a copy if you want need to preserve that.
|
|
4904
4904
|
*/
|
|
4905
4905
|
static create(e, t) {
|
|
4906
|
-
return t.length ? Pn(t, e, 0,
|
|
4906
|
+
return t.length ? Pn(t, e, 0, ct) : ne;
|
|
4907
4907
|
}
|
|
4908
4908
|
/**
|
|
4909
4909
|
Find all decorations in this set which touch the given range
|
|
@@ -4933,7 +4933,7 @@ class I {
|
|
|
4933
4933
|
document.
|
|
4934
4934
|
*/
|
|
4935
4935
|
map(e, t, n) {
|
|
4936
|
-
return this ==
|
|
4936
|
+
return this == ne || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, n || ct);
|
|
4937
4937
|
}
|
|
4938
4938
|
/**
|
|
4939
4939
|
@internal
|
|
@@ -4944,7 +4944,7 @@ class I {
|
|
|
4944
4944
|
let a = this.local[l].map(e, n, i);
|
|
4945
4945
|
a && a.type.valid(t, a) ? (s || (s = [])).push(a) : o.onRemove && o.onRemove(this.local[l].spec);
|
|
4946
4946
|
}
|
|
4947
|
-
return this.children.length ? bu(this.children, s || [], e, t, n, i, o) : s ? new I(s.sort(
|
|
4947
|
+
return this.children.length ? bu(this.children, s || [], e, t, n, i, o) : s ? new I(s.sort(ut), Dt) : ne;
|
|
4948
4948
|
}
|
|
4949
4949
|
/**
|
|
4950
4950
|
Add the given array of decorations to the ones in the set,
|
|
@@ -4953,7 +4953,7 @@ class I {
|
|
|
4953
4953
|
structure.
|
|
4954
4954
|
*/
|
|
4955
4955
|
add(e, t) {
|
|
4956
|
-
return t.length ? this ==
|
|
4956
|
+
return t.length ? this == ne ? I.create(e, t) : this.addInner(e, t, 0) : this;
|
|
4957
4957
|
}
|
|
4958
4958
|
addInner(e, t, n) {
|
|
4959
4959
|
let i, o = 0;
|
|
@@ -4962,20 +4962,20 @@ class I {
|
|
|
4962
4962
|
if (u = sl(t, l, c)) {
|
|
4963
4963
|
for (i || (i = this.children.slice()); o < i.length && i[o] < a; )
|
|
4964
4964
|
o += 3;
|
|
4965
|
-
i[o] == a ? i[o + 2] = i[o + 2].addInner(l, u, c + 1) : i.splice(o, 0, a, a + l.nodeSize, Pn(u, l, c + 1,
|
|
4965
|
+
i[o] == a ? i[o + 2] = i[o + 2].addInner(l, u, c + 1) : i.splice(o, 0, a, a + l.nodeSize, Pn(u, l, c + 1, ct)), o += 3;
|
|
4966
4966
|
}
|
|
4967
4967
|
});
|
|
4968
4968
|
let s = ol(o ? ll(t) : t, -n);
|
|
4969
4969
|
for (let l = 0; l < s.length; l++)
|
|
4970
4970
|
s[l].type.valid(e, s[l]) || s.splice(l--, 1);
|
|
4971
|
-
return new I(s.length ? this.local.concat(s).sort(
|
|
4971
|
+
return new I(s.length ? this.local.concat(s).sort(ut) : this.local, i || this.children);
|
|
4972
4972
|
}
|
|
4973
4973
|
/**
|
|
4974
4974
|
Create a new set that contains the decorations in this set, minus
|
|
4975
4975
|
the ones in the given array.
|
|
4976
4976
|
*/
|
|
4977
4977
|
remove(e) {
|
|
4978
|
-
return e.length == 0 || this ==
|
|
4978
|
+
return e.length == 0 || this == ne ? this : this.removeInner(e, 0);
|
|
4979
4979
|
}
|
|
4980
4980
|
removeInner(e, t) {
|
|
4981
4981
|
let n = this.children, i = this.local;
|
|
@@ -4987,7 +4987,7 @@ class I {
|
|
|
4987
4987
|
continue;
|
|
4988
4988
|
n == this.children && (n = this.children.slice());
|
|
4989
4989
|
let c = n[o + 2].removeInner(s, l + 1);
|
|
4990
|
-
c !=
|
|
4990
|
+
c != ne ? n[o + 2] = c : (n.splice(o, 3), o -= 3);
|
|
4991
4991
|
}
|
|
4992
4992
|
if (i.length) {
|
|
4993
4993
|
for (let o = 0, s; o < e.length; o++)
|
|
@@ -4995,10 +4995,10 @@ class I {
|
|
|
4995
4995
|
for (let l = 0; l < i.length; l++)
|
|
4996
4996
|
i[l].eq(s, t) && (i == this.local && (i = this.local.slice()), i.splice(l--, 1));
|
|
4997
4997
|
}
|
|
4998
|
-
return n == this.children && i == this.local ? this : i.length || n.length ? new I(i, n) :
|
|
4998
|
+
return n == this.children && i == this.local ? this : i.length || n.length ? new I(i, n) : ne;
|
|
4999
4999
|
}
|
|
5000
5000
|
forChild(e, t) {
|
|
5001
|
-
if (this ==
|
|
5001
|
+
if (this == ne)
|
|
5002
5002
|
return this;
|
|
5003
5003
|
if (t.isLeaf)
|
|
5004
5004
|
return I.empty;
|
|
@@ -5017,10 +5017,10 @@ class I {
|
|
|
5017
5017
|
}
|
|
5018
5018
|
}
|
|
5019
5019
|
if (i) {
|
|
5020
|
-
let l = new I(i.sort(
|
|
5020
|
+
let l = new I(i.sort(ut), Dt);
|
|
5021
5021
|
return n ? new qe([l, n]) : l;
|
|
5022
5022
|
}
|
|
5023
|
-
return n ||
|
|
5023
|
+
return n || ne;
|
|
5024
5024
|
}
|
|
5025
5025
|
/**
|
|
5026
5026
|
@internal
|
|
@@ -5048,8 +5048,8 @@ class I {
|
|
|
5048
5048
|
@internal
|
|
5049
5049
|
*/
|
|
5050
5050
|
localsInner(e) {
|
|
5051
|
-
if (this ==
|
|
5052
|
-
return
|
|
5051
|
+
if (this == ne)
|
|
5052
|
+
return Dt;
|
|
5053
5053
|
if (e.inlineContent || !this.local.some(Ze.is))
|
|
5054
5054
|
return this.local;
|
|
5055
5055
|
let t = [];
|
|
@@ -5063,13 +5063,13 @@ class I {
|
|
|
5063
5063
|
}
|
|
5064
5064
|
I.empty = new I([], []);
|
|
5065
5065
|
I.removeOverlap = yi;
|
|
5066
|
-
const
|
|
5066
|
+
const ne = I.empty;
|
|
5067
5067
|
class qe {
|
|
5068
5068
|
constructor(e) {
|
|
5069
5069
|
this.members = e;
|
|
5070
5070
|
}
|
|
5071
5071
|
map(e, t) {
|
|
5072
|
-
const n = this.members.map((i) => i.map(e, t,
|
|
5072
|
+
const n = this.members.map((i) => i.map(e, t, ct));
|
|
5073
5073
|
return qe.from(n);
|
|
5074
5074
|
}
|
|
5075
5075
|
forChild(e, t) {
|
|
@@ -5078,7 +5078,7 @@ class qe {
|
|
|
5078
5078
|
let n = [];
|
|
5079
5079
|
for (let i = 0; i < this.members.length; i++) {
|
|
5080
5080
|
let o = this.members[i].forChild(e, t);
|
|
5081
|
-
o !=
|
|
5081
|
+
o != ne && (o instanceof qe ? n = n.concat(o.members) : n.push(o));
|
|
5082
5082
|
}
|
|
5083
5083
|
return qe.from(n);
|
|
5084
5084
|
}
|
|
@@ -5103,14 +5103,14 @@ class qe {
|
|
|
5103
5103
|
t.push(o[s]);
|
|
5104
5104
|
}
|
|
5105
5105
|
}
|
|
5106
|
-
return t ? yi(n ? t : t.sort(
|
|
5106
|
+
return t ? yi(n ? t : t.sort(ut)) : Dt;
|
|
5107
5107
|
}
|
|
5108
5108
|
// Create a group for the given array of decoration sets, or return
|
|
5109
5109
|
// a single set when possible.
|
|
5110
5110
|
static from(e) {
|
|
5111
5111
|
switch (e.length) {
|
|
5112
5112
|
case 0:
|
|
5113
|
-
return
|
|
5113
|
+
return ne;
|
|
5114
5114
|
case 1:
|
|
5115
5115
|
return e[0];
|
|
5116
5116
|
default:
|
|
@@ -5153,7 +5153,7 @@ function bu(r, e, t, n, i, o, s) {
|
|
|
5153
5153
|
let f = t.map(r[c + 1] + o, -1), h = f - i, { index: p, offset: g } = n.content.findIndex(d), b = n.maybeChild(p);
|
|
5154
5154
|
if (b && g == d && g + b.nodeSize == h) {
|
|
5155
5155
|
let S = l[c + 2].mapInner(t, b, u + 1, r[c] + o + 1, s);
|
|
5156
|
-
S !=
|
|
5156
|
+
S != ne ? (l[c] = d, l[c + 1] = h, l[c + 2] = S) : (l[c + 1] = -2, a = !0);
|
|
5157
5157
|
} else
|
|
5158
5158
|
a = !0;
|
|
5159
5159
|
}
|
|
@@ -5169,7 +5169,7 @@ function bu(r, e, t, n, i, o, s) {
|
|
|
5169
5169
|
l.splice(f, 0, u.children[d], u.children[d + 1], u.children[d + 2]);
|
|
5170
5170
|
}
|
|
5171
5171
|
}
|
|
5172
|
-
return new I(e.sort(
|
|
5172
|
+
return new I(e.sort(ut), l);
|
|
5173
5173
|
}
|
|
5174
5174
|
function ol(r, e) {
|
|
5175
5175
|
if (!e || !r.length)
|
|
@@ -5215,15 +5215,15 @@ function Pn(r, e, t, n) {
|
|
|
5215
5215
|
if (c) {
|
|
5216
5216
|
o = !0;
|
|
5217
5217
|
let u = Pn(c, l, t + a + 1, n);
|
|
5218
|
-
u !=
|
|
5218
|
+
u != ne && i.push(a, a + l.nodeSize, u);
|
|
5219
5219
|
}
|
|
5220
5220
|
});
|
|
5221
|
-
let s = ol(o ? ll(r) : r, -t).sort(
|
|
5221
|
+
let s = ol(o ? ll(r) : r, -t).sort(ut);
|
|
5222
5222
|
for (let l = 0; l < s.length; l++)
|
|
5223
5223
|
s[l].type.valid(e, s[l]) || (n.onRemove && n.onRemove(s[l].spec), s.splice(l--, 1));
|
|
5224
|
-
return s.length || i.length ? new I(s, i) :
|
|
5224
|
+
return s.length || i.length ? new I(s, i) : ne;
|
|
5225
5225
|
}
|
|
5226
|
-
function
|
|
5226
|
+
function ut(r, e) {
|
|
5227
5227
|
return r.from - e.from || r.to - e.to;
|
|
5228
5228
|
}
|
|
5229
5229
|
function yi(r) {
|
|
@@ -5245,7 +5245,7 @@ function yi(r) {
|
|
|
5245
5245
|
return e;
|
|
5246
5246
|
}
|
|
5247
5247
|
function Ao(r, e, t) {
|
|
5248
|
-
for (; e < r.length &&
|
|
5248
|
+
for (; e < r.length && ut(t, r[e]) > 0; )
|
|
5249
5249
|
e++;
|
|
5250
5250
|
r.splice(e, 0, t);
|
|
5251
5251
|
}
|
|
@@ -5253,7 +5253,7 @@ function gr(r) {
|
|
|
5253
5253
|
let e = [];
|
|
5254
5254
|
return r.someProp("decorations", (t) => {
|
|
5255
5255
|
let n = t(r.state);
|
|
5256
|
-
n && n !=
|
|
5256
|
+
n && n != ne && e.push(n);
|
|
5257
5257
|
}), r.cursorWrapper && e.push(I.create(r.state.doc, [r.cursorWrapper.deco])), qe.from(e);
|
|
5258
5258
|
}
|
|
5259
5259
|
const ku = {
|
|
@@ -5326,7 +5326,7 @@ class Cu {
|
|
|
5326
5326
|
return Ve(this.view);
|
|
5327
5327
|
if (me && Ye <= 11 && !this.view.state.selection.empty) {
|
|
5328
5328
|
let e = this.view.domSelectionRange();
|
|
5329
|
-
if (e.focusNode &&
|
|
5329
|
+
if (e.focusNode && ht(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
|
|
5330
5330
|
return this.flushSoon();
|
|
5331
5331
|
}
|
|
5332
5332
|
this.flush();
|
|
@@ -5430,7 +5430,7 @@ function Mu(r) {
|
|
|
5430
5430
|
}
|
|
5431
5431
|
function Ro(r, e) {
|
|
5432
5432
|
let t = e.startContainer, n = e.startOffset, i = e.endContainer, o = e.endOffset, s = r.domAtPos(r.state.selection.anchor);
|
|
5433
|
-
return
|
|
5433
|
+
return ht(s.node, s.offset, i, o) && ([t, n, i, o] = [i, o, t, n]), { anchorNode: t, anchorOffset: n, focusNode: i, focusOffset: o };
|
|
5434
5434
|
}
|
|
5435
5435
|
function xu(r, e) {
|
|
5436
5436
|
if (e.getComposedRanges) {
|
|
@@ -5454,7 +5454,7 @@ function Ou(r, e) {
|
|
|
5454
5454
|
}
|
|
5455
5455
|
function Eu(r, e, t) {
|
|
5456
5456
|
let { node: n, fromOffset: i, toOffset: o, from: s, to: l } = r.docView.parseRange(e, t), a = r.domSelectionRange(), c, u = a.anchorNode;
|
|
5457
|
-
if (u && r.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: a.anchorOffset }], _n(a) || c.push({ node: a.focusNode, offset: a.focusOffset })),
|
|
5457
|
+
if (u && r.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: a.anchorOffset }], _n(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), ie && r.input.lastKeyCode === 8)
|
|
5458
5458
|
for (let b = o; b > i; b--) {
|
|
5459
5459
|
let S = n.childNodes[b - 1], R = S.pmViewDesc;
|
|
5460
5460
|
if (S.nodeName == "BR" && !R) {
|
|
@@ -5501,10 +5501,10 @@ function Nu(r, e, t, n, i) {
|
|
|
5501
5501
|
if (r.input.compositionPendingChanges = 0, e < 0) {
|
|
5502
5502
|
let w = r.input.lastSelectionTime > Date.now() - 50 ? r.input.lastSelectionOrigin : null, _ = di(r, w);
|
|
5503
5503
|
if (_ && !r.state.selection.eq(_)) {
|
|
5504
|
-
if (
|
|
5504
|
+
if (ie && _e && r.input.lastKeyCode === 13 && Date.now() - 100 < r.input.lastKeyCodeTime && r.someProp("handleKeyDown", (qn) => qn(r, ot(13, "Enter"))))
|
|
5505
5505
|
return;
|
|
5506
|
-
let
|
|
5507
|
-
w == "pointer" ?
|
|
5506
|
+
let ee = r.state.tr.setSelection(_);
|
|
5507
|
+
w == "pointer" ? ee.setMeta("pointer", !0) : w == "key" && ee.scrollIntoView(), o && ee.setMeta("composition", o), r.dispatch(ee);
|
|
5508
5508
|
}
|
|
5509
5509
|
return;
|
|
5510
5510
|
}
|
|
@@ -5513,7 +5513,7 @@ function Nu(r, e, t, n, i) {
|
|
|
5513
5513
|
let a = r.state.selection, c = Eu(r, e, t), u = r.state.doc, d = u.slice(c.from, c.to), f, h;
|
|
5514
5514
|
r.input.lastKeyCode === 8 && Date.now() - 100 < r.input.lastKeyCodeTime ? (f = r.state.selection.to, h = "end") : (f = r.state.selection.from, h = "start"), r.input.lastKeyCode = null;
|
|
5515
5515
|
let p = Iu(d.content, c.doc.content, c.from, f, h);
|
|
5516
|
-
if (p && r.input.domChangeCount++, (Pt && r.input.lastIOSEnter > Date.now() - 225 || _e) && i.some((w) => w.nodeType == 1 && !Du.test(w.nodeName)) && (!p || p.endA >= p.endB) && r.someProp("handleKeyDown", (w) => w(r,
|
|
5516
|
+
if (p && r.input.domChangeCount++, (Pt && r.input.lastIOSEnter > Date.now() - 225 || _e) && i.some((w) => w.nodeType == 1 && !Du.test(w.nodeName)) && (!p || p.endA >= p.endB) && r.someProp("handleKeyDown", (w) => w(r, ot(13, "Enter")))) {
|
|
5517
5517
|
r.input.lastIOSEnter = 0;
|
|
5518
5518
|
return;
|
|
5519
5519
|
}
|
|
@@ -5532,24 +5532,24 @@ function Nu(r, e, t, n, i) {
|
|
|
5532
5532
|
}
|
|
5533
5533
|
r.state.selection.from < r.state.selection.to && p.start == p.endB && r.state.selection instanceof E && (p.start > r.state.selection.from && p.start <= r.state.selection.from + 2 && r.state.selection.from >= c.from ? p.start = r.state.selection.from : p.endA < r.state.selection.to && p.endA >= r.state.selection.to - 2 && r.state.selection.to <= c.to && (p.endB += r.state.selection.to - p.endA, p.endA = r.state.selection.to)), me && Ye <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == " " && (p.start--, p.endA--, p.endB--);
|
|
5534
5534
|
let g = c.doc.resolveNoCache(p.start - c.from), b = c.doc.resolveNoCache(p.endB - c.from), S = u.resolve(p.start), R = g.sameParent(b) && g.parent.inlineContent && S.end() >= p.endA;
|
|
5535
|
-
if ((Pt && r.input.lastIOSEnter > Date.now() - 225 && (!R || i.some((w) => w.nodeName == "DIV" || w.nodeName == "P")) || !R && g.pos < c.doc.content.size && (!g.sameParent(b) || !g.parent.inlineContent) && g.pos < b.pos && !/\S/.test(c.doc.textBetween(g.pos, b.pos, "", ""))) && r.someProp("handleKeyDown", (w) => w(r,
|
|
5535
|
+
if ((Pt && r.input.lastIOSEnter > Date.now() - 225 && (!R || i.some((w) => w.nodeName == "DIV" || w.nodeName == "P")) || !R && g.pos < c.doc.content.size && (!g.sameParent(b) || !g.parent.inlineContent) && g.pos < b.pos && !/\S/.test(c.doc.textBetween(g.pos, b.pos, "", ""))) && r.someProp("handleKeyDown", (w) => w(r, ot(13, "Enter")))) {
|
|
5536
5536
|
r.input.lastIOSEnter = 0;
|
|
5537
5537
|
return;
|
|
5538
5538
|
}
|
|
5539
|
-
if (r.state.selection.anchor > p.start && vu(u, p.start, p.endA, g, b) && r.someProp("handleKeyDown", (w) => w(r,
|
|
5540
|
-
_e &&
|
|
5539
|
+
if (r.state.selection.anchor > p.start && vu(u, p.start, p.endA, g, b) && r.someProp("handleKeyDown", (w) => w(r, ot(8, "Backspace")))) {
|
|
5540
|
+
_e && ie && r.domObserver.suppressSelectionUpdates();
|
|
5541
5541
|
return;
|
|
5542
5542
|
}
|
|
5543
|
-
|
|
5543
|
+
ie && p.endB == p.start && (r.input.lastChromeDelete = Date.now()), _e && !R && g.start() != b.start() && b.parentOffset == 0 && g.depth == b.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, b = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
|
|
5544
5544
|
r.someProp("handleKeyDown", function(w) {
|
|
5545
|
-
return w(r,
|
|
5545
|
+
return w(r, ot(13, "Enter"));
|
|
5546
5546
|
});
|
|
5547
5547
|
}, 20));
|
|
5548
5548
|
let N = p.start, v = p.endA, Oe = (w) => {
|
|
5549
5549
|
let _ = w || r.state.tr.replace(N, v, c.doc.slice(p.start - c.from, p.endB - c.from));
|
|
5550
5550
|
if (c.sel) {
|
|
5551
|
-
let
|
|
5552
|
-
|
|
5551
|
+
let ee = Po(r, _.doc, c.sel);
|
|
5552
|
+
ee && !(ie && r.composing && ee.empty && (p.start != p.endB || r.input.lastChromeDelete < Date.now() - 100) && (ee.head == N || ee.head == _.mapping.map(v) - 1) || me && ee.empty && ee.head == N) && _.setSelection(ee);
|
|
5553
5553
|
}
|
|
5554
5554
|
return o && _.setMeta("composition", o), _.scrollIntoView();
|
|
5555
5555
|
}, We;
|
|
@@ -5566,7 +5566,7 @@ function Nu(r, e, t, n, i) {
|
|
|
5566
5566
|
We.type == "add" ? w.addMark(N, v, We.mark) : w.removeMark(N, v, We.mark), r.dispatch(w);
|
|
5567
5567
|
} else if (g.parent.child(g.index()).isText && g.index() == b.index() - (b.textOffset ? 0 : 1)) {
|
|
5568
5568
|
let w = g.parent.textBetween(g.parentOffset, b.parentOffset), _ = () => Oe(r.state.tr.insertText(w, N, v));
|
|
5569
|
-
r.someProp("handleTextInput", (
|
|
5569
|
+
r.someProp("handleTextInput", (ee) => ee(r, N, v, w, _)) || r.dispatch(_());
|
|
5570
5570
|
} else
|
|
5571
5571
|
r.dispatch(Oe());
|
|
5572
5572
|
else
|
|
@@ -5722,9 +5722,9 @@ class al {
|
|
|
5722
5722
|
let f = u == "preserve" && s && this.dom.style.overflowAnchor == null && fc(this);
|
|
5723
5723
|
if (s) {
|
|
5724
5724
|
this.domObserver.stop();
|
|
5725
|
-
let h = d && (me ||
|
|
5725
|
+
let h = d && (me || ie) && !this.composing && !i.selection.empty && !e.selection.empty && Ru(i.selection, e.selection);
|
|
5726
5726
|
if (d) {
|
|
5727
|
-
let p =
|
|
5727
|
+
let p = ie ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
5728
5728
|
this.composing && (this.input.compositionNode = du(this)), (o || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = go(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (h = !0);
|
|
5729
5729
|
}
|
|
5730
5730
|
h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Lc(this)) ? Ve(this, h) : (Us(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
@@ -6120,7 +6120,7 @@ const zu = (r, e) => {
|
|
|
6120
6120
|
[A]: e
|
|
6121
6121
|
};
|
|
6122
6122
|
};
|
|
6123
|
-
class
|
|
6123
|
+
class ep {
|
|
6124
6124
|
constructor(e) {
|
|
6125
6125
|
this[A] = new Bu(e);
|
|
6126
6126
|
}
|
|
@@ -6154,11 +6154,11 @@ class Bu {
|
|
|
6154
6154
|
if (this.featureMap.has("RteLinkFeature") && !this.featureMap.has("RteToolbarFeature"))
|
|
6155
6155
|
throw new Error("RteToolbarFeature is required for RteLinkFeature");
|
|
6156
6156
|
this.textblockAttrs = new Fu(
|
|
6157
|
-
|
|
6157
|
+
at(this.features.flatMap((o) => o.getTextblockAttrs()))
|
|
6158
6158
|
), this.textblockMarks = new Lu(
|
|
6159
|
-
|
|
6159
|
+
at(this.features.flatMap((o) => o.getTextblockMarks()))
|
|
6160
6160
|
);
|
|
6161
|
-
const n =
|
|
6161
|
+
const n = at(
|
|
6162
6162
|
this.features.flatMap(
|
|
6163
6163
|
(o) => o.getSchema(this.textblockAttrs, this.textblockMarks)
|
|
6164
6164
|
)
|
|
@@ -6174,7 +6174,7 @@ class Bu {
|
|
|
6174
6174
|
this.schema = new hs(i);
|
|
6175
6175
|
}
|
|
6176
6176
|
}
|
|
6177
|
-
var
|
|
6177
|
+
var et = {
|
|
6178
6178
|
8: "Backspace",
|
|
6179
6179
|
9: "Tab",
|
|
6180
6180
|
10: "Enter",
|
|
@@ -6253,13 +6253,13 @@ var Qe = {
|
|
|
6253
6253
|
221: "}",
|
|
6254
6254
|
222: '"'
|
|
6255
6255
|
}, _u = typeof navigator < "u" && /Mac/.test(navigator.platform), Vu = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
6256
|
-
for (var X = 0; X < 10; X++)
|
|
6257
|
-
for (var X = 1; X <= 24; X++)
|
|
6256
|
+
for (var X = 0; X < 10; X++) et[48 + X] = et[96 + X] = String(X);
|
|
6257
|
+
for (var X = 1; X <= 24; X++) et[X + 111] = "F" + X;
|
|
6258
6258
|
for (var X = 65; X <= 90; X++)
|
|
6259
|
-
|
|
6260
|
-
for (var yr in
|
|
6259
|
+
et[X] = String.fromCharCode(X + 32), Fn[X] = String.fromCharCode(X);
|
|
6260
|
+
for (var yr in et) Fn.hasOwnProperty(yr) || (Fn[yr] = et[yr]);
|
|
6261
6261
|
function Hu(r) {
|
|
6262
|
-
var e = _u && r.metaKey && r.shiftKey && !r.ctrlKey && !r.altKey || Vu && r.shiftKey && r.key && r.key.length == 1 || r.key == "Unidentified", t = !e && r.key || (r.shiftKey ? Fn :
|
|
6262
|
+
var e = _u && r.metaKey && r.shiftKey && !r.ctrlKey && !r.altKey || Vu && r.shiftKey && r.key && r.key.length == 1 || r.key == "Unidentified", t = !e && r.key || (r.shiftKey ? Fn : et)[r.keyCode] || r.key || "Unidentified";
|
|
6263
6263
|
return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
|
|
6264
6264
|
}
|
|
6265
6265
|
const Wu = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), Uu = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
@@ -6293,7 +6293,7 @@ function Ku(r) {
|
|
|
6293
6293
|
function kr(r, e, t = !0) {
|
|
6294
6294
|
return e.altKey && (r = "Alt-" + r), e.ctrlKey && (r = "Ctrl-" + r), e.metaKey && (r = "Meta-" + r), t && e.shiftKey && (r = "Shift-" + r), r;
|
|
6295
6295
|
}
|
|
6296
|
-
function
|
|
6296
|
+
function Q(r) {
|
|
6297
6297
|
return new W({ props: { handleKeyDown: cl(r) } });
|
|
6298
6298
|
}
|
|
6299
6299
|
function cl(r) {
|
|
@@ -6309,7 +6309,7 @@ function cl(r) {
|
|
|
6309
6309
|
return !0;
|
|
6310
6310
|
}
|
|
6311
6311
|
if ((n.altKey || n.metaKey || n.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
|
|
6312
|
-
!(Uu && n.ctrlKey && n.altKey) && (o =
|
|
6312
|
+
!(Uu && n.ctrlKey && n.altKey) && (o = et[n.keyCode]) && o != i) {
|
|
6313
6313
|
let l = e[kr(o, n)];
|
|
6314
6314
|
if (l && l(t.state, t.dispatch, t))
|
|
6315
6315
|
return !0;
|
|
@@ -6525,7 +6525,7 @@ function bl(r, e, t, n) {
|
|
|
6525
6525
|
for (let S = s.length - 1; S >= 0; S--)
|
|
6526
6526
|
p = T.from(s[S].create(null, p));
|
|
6527
6527
|
p = T.from(i.copy(p));
|
|
6528
|
-
let g = r.tr.step(new
|
|
6528
|
+
let g = r.tr.step(new oe(e.pos - 1, h, e.pos, h, new C(p, 1, 0), s.length, !0)), b = g.doc.resolve(h + 2 * s.length);
|
|
6529
6529
|
b.nodeAfter && b.nodeAfter.type == i.type && oi(g.doc, b.pos) && g.join(b.pos), t(g.scrollIntoView());
|
|
6530
6530
|
}
|
|
6531
6531
|
return !0;
|
|
@@ -6545,7 +6545,7 @@ function bl(r, e, t, n) {
|
|
|
6545
6545
|
let S = T.empty;
|
|
6546
6546
|
for (let N = p.length - 1; N >= 0; N--)
|
|
6547
6547
|
S = T.from(p[N].copy(S));
|
|
6548
|
-
let R = r.tr.step(new
|
|
6548
|
+
let R = r.tr.step(new oe(e.pos - p.length, e.pos + o.nodeSize, e.pos + b, e.pos + o.nodeSize - b, new C(S, p.length, 0), 0, !0));
|
|
6549
6549
|
t(R.scrollIntoView());
|
|
6550
6550
|
}
|
|
6551
6551
|
return !0;
|
|
@@ -6749,7 +6749,7 @@ class dd {
|
|
|
6749
6749
|
this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
|
|
6750
6750
|
}
|
|
6751
6751
|
}
|
|
6752
|
-
class
|
|
6752
|
+
class z extends D {
|
|
6753
6753
|
/**
|
|
6754
6754
|
Create a gap cursor.
|
|
6755
6755
|
*/
|
|
@@ -6758,13 +6758,13 @@ class L extends D {
|
|
|
6758
6758
|
}
|
|
6759
6759
|
map(e, t) {
|
|
6760
6760
|
let n = e.resolve(t.map(this.head));
|
|
6761
|
-
return
|
|
6761
|
+
return z.valid(n) ? new z(n) : D.near(n);
|
|
6762
6762
|
}
|
|
6763
6763
|
content() {
|
|
6764
6764
|
return C.empty;
|
|
6765
6765
|
}
|
|
6766
6766
|
eq(e) {
|
|
6767
|
-
return e instanceof
|
|
6767
|
+
return e instanceof z && e.head == this.head;
|
|
6768
6768
|
}
|
|
6769
6769
|
toJSON() {
|
|
6770
6770
|
return { type: "gapcursor", pos: this.head };
|
|
@@ -6775,7 +6775,7 @@ class L extends D {
|
|
|
6775
6775
|
static fromJSON(e, t) {
|
|
6776
6776
|
if (typeof t.pos != "number")
|
|
6777
6777
|
throw new RangeError("Invalid input for GapCursor.fromJSON");
|
|
6778
|
-
return new
|
|
6778
|
+
return new z(e.resolve(t.pos));
|
|
6779
6779
|
}
|
|
6780
6780
|
/**
|
|
6781
6781
|
@internal
|
|
@@ -6801,7 +6801,7 @@ class L extends D {
|
|
|
6801
6801
|
*/
|
|
6802
6802
|
static findGapCursorFrom(e, t, n = !1) {
|
|
6803
6803
|
e: for (; ; ) {
|
|
6804
|
-
if (!n &&
|
|
6804
|
+
if (!n && z.valid(e))
|
|
6805
6805
|
return e;
|
|
6806
6806
|
let i = e.pos, o = null;
|
|
6807
6807
|
for (let s = e.depth; ; s--) {
|
|
@@ -6813,7 +6813,7 @@ class L extends D {
|
|
|
6813
6813
|
return null;
|
|
6814
6814
|
i += t;
|
|
6815
6815
|
let a = e.doc.resolve(i);
|
|
6816
|
-
if (
|
|
6816
|
+
if (z.valid(a))
|
|
6817
6817
|
return a;
|
|
6818
6818
|
}
|
|
6819
6819
|
for (; ; ) {
|
|
@@ -6827,16 +6827,16 @@ class L extends D {
|
|
|
6827
6827
|
}
|
|
6828
6828
|
o = s, i += t;
|
|
6829
6829
|
let l = e.doc.resolve(i);
|
|
6830
|
-
if (
|
|
6830
|
+
if (z.valid(l))
|
|
6831
6831
|
return l;
|
|
6832
6832
|
}
|
|
6833
6833
|
return null;
|
|
6834
6834
|
}
|
|
6835
6835
|
}
|
|
6836
6836
|
}
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
D.jsonID("gapcursor",
|
|
6837
|
+
z.prototype.visible = !1;
|
|
6838
|
+
z.findFrom = z.findGapCursorFrom;
|
|
6839
|
+
D.jsonID("gapcursor", z);
|
|
6840
6840
|
class Si {
|
|
6841
6841
|
constructor(e) {
|
|
6842
6842
|
this.pos = e;
|
|
@@ -6846,7 +6846,7 @@ class Si {
|
|
|
6846
6846
|
}
|
|
6847
6847
|
resolve(e) {
|
|
6848
6848
|
let t = e.resolve(this.pos);
|
|
6849
|
-
return
|
|
6849
|
+
return z.valid(t) ? new z(t) : D.near(t);
|
|
6850
6850
|
}
|
|
6851
6851
|
}
|
|
6852
6852
|
function Sl(r) {
|
|
@@ -6891,7 +6891,7 @@ function pd() {
|
|
|
6891
6891
|
props: {
|
|
6892
6892
|
decorations: yd,
|
|
6893
6893
|
createSelectionBetween(r, e, t) {
|
|
6894
|
-
return e.pos == t.pos &&
|
|
6894
|
+
return e.pos == t.pos && z.valid(t) ? new z(t) : null;
|
|
6895
6895
|
},
|
|
6896
6896
|
handleClick: gd,
|
|
6897
6897
|
handleKeyDown: md,
|
|
@@ -6914,21 +6914,21 @@ function kn(r, e) {
|
|
|
6914
6914
|
return !1;
|
|
6915
6915
|
a = !1, l = n.doc.resolve(e > 0 ? l.after() : l.before());
|
|
6916
6916
|
}
|
|
6917
|
-
let c =
|
|
6918
|
-
return c ? (i && i(n.tr.setSelection(new
|
|
6917
|
+
let c = z.findGapCursorFrom(l, e, a);
|
|
6918
|
+
return c ? (i && i(n.tr.setSelection(new z(c))), !0) : !1;
|
|
6919
6919
|
};
|
|
6920
6920
|
}
|
|
6921
6921
|
function gd(r, e, t) {
|
|
6922
6922
|
if (!r || !r.editable)
|
|
6923
6923
|
return !1;
|
|
6924
6924
|
let n = r.state.doc.resolve(e);
|
|
6925
|
-
if (!
|
|
6925
|
+
if (!z.valid(n))
|
|
6926
6926
|
return !1;
|
|
6927
6927
|
let i = r.posAtCoords({ left: t.clientX, top: t.clientY });
|
|
6928
|
-
return i && i.inside > -1 && x.isSelectable(r.state.doc.nodeAt(i.inside)) ? !1 : (r.dispatch(r.state.tr.setSelection(new
|
|
6928
|
+
return i && i.inside > -1 && x.isSelectable(r.state.doc.nodeAt(i.inside)) ? !1 : (r.dispatch(r.state.tr.setSelection(new z(n))), !0);
|
|
6929
6929
|
}
|
|
6930
6930
|
function bd(r, e) {
|
|
6931
|
-
if (e.inputType != "insertCompositionText" || !(r.state.selection instanceof
|
|
6931
|
+
if (e.inputType != "insertCompositionText" || !(r.state.selection instanceof z))
|
|
6932
6932
|
return !1;
|
|
6933
6933
|
let { $from: t } = r.state.selection, n = t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);
|
|
6934
6934
|
if (!n)
|
|
@@ -6940,7 +6940,7 @@ function bd(r, e) {
|
|
|
6940
6940
|
return o.setSelection(E.near(o.doc.resolve(t.pos + 1))), r.dispatch(o), !1;
|
|
6941
6941
|
}
|
|
6942
6942
|
function yd(r) {
|
|
6943
|
-
if (!(r.selection instanceof
|
|
6943
|
+
if (!(r.selection instanceof z))
|
|
6944
6944
|
return null;
|
|
6945
6945
|
let e = document.createElement("div");
|
|
6946
6946
|
return e.className = "ProseMirror-gapcursor", I.create(r.doc, [q.widget(r.selection.head, e, { key: "gapcursor" })]);
|
|
@@ -7212,15 +7212,15 @@ class Ke {
|
|
|
7212
7212
|
}
|
|
7213
7213
|
const xd = 20;
|
|
7214
7214
|
function Od(r, e, t, n) {
|
|
7215
|
-
let i = t.getMeta(
|
|
7215
|
+
let i = t.getMeta(dt), o;
|
|
7216
7216
|
if (i)
|
|
7217
7217
|
return i.historyState;
|
|
7218
7218
|
t.getMeta(xl) && (r = new Ke(r.done, r.undone, null, 0, -1));
|
|
7219
7219
|
let s = t.getMeta("appendedTransaction");
|
|
7220
7220
|
if (t.steps.length == 0)
|
|
7221
7221
|
return r;
|
|
7222
|
-
if (s && s.getMeta(
|
|
7223
|
-
return s.getMeta(
|
|
7222
|
+
if (s && s.getMeta(dt))
|
|
7223
|
+
return s.getMeta(dt).redo ? new Ke(r.done.addTransform(t, void 0, n, On(e)), r.undone, Wo(t.mapping.maps), r.prevTime, r.prevComposition) : new Ke(r.done, r.undone.addTransform(t, void 0, n, On(e)), null, r.prevTime, r.prevComposition);
|
|
7224
7224
|
if (t.getMeta("addToHistory") !== !1 && !(s && s.getMeta("addToHistory") === !1)) {
|
|
7225
7225
|
let l = t.getMeta("composition"), a = r.prevTime == 0 || !s && r.prevComposition != l && (r.prevTime < (t.time || 0) - n.newGroupDelay || !Ed(t, r.prevRanges)), c = s ? Tr(r.prevRanges, t.mapping) : Wo(t.mapping.maps);
|
|
7226
7226
|
return new Ke(r.done.addTransform(t, a ? e.selection.getBookmark() : void 0, n, On(e)), we.empty, c, t.time, l ?? r.prevComposition);
|
|
@@ -7254,11 +7254,11 @@ function Tr(r, e) {
|
|
|
7254
7254
|
return t;
|
|
7255
7255
|
}
|
|
7256
7256
|
function wd(r, e, t) {
|
|
7257
|
-
let n = On(e), i =
|
|
7257
|
+
let n = On(e), i = dt.get(e).spec.config, o = (t ? r.undone : r.done).popEvent(e, n);
|
|
7258
7258
|
if (!o)
|
|
7259
7259
|
return null;
|
|
7260
7260
|
let s = o.selection.resolve(o.transform.doc), l = (t ? r.done : r.undone).addTransform(o.transform, e.selection.getBookmark(), i, n), a = new Ke(t ? l : o.remaining, t ? o.remaining : l, null, 0, -1);
|
|
7261
|
-
return o.transform.setSelection(s).setMeta(
|
|
7261
|
+
return o.transform.setSelection(s).setMeta(dt, { redo: t, historyState: a });
|
|
7262
7262
|
}
|
|
7263
7263
|
let Cr = !1, Uo = null;
|
|
7264
7264
|
function On(r) {
|
|
@@ -7276,13 +7276,13 @@ function On(r) {
|
|
|
7276
7276
|
function Dd(r) {
|
|
7277
7277
|
return r.setMeta(xl, !0);
|
|
7278
7278
|
}
|
|
7279
|
-
const
|
|
7279
|
+
const dt = new ci("history"), xl = new ci("closeHistory");
|
|
7280
7280
|
function Nd(r = {}) {
|
|
7281
7281
|
return r = {
|
|
7282
7282
|
depth: r.depth || 100,
|
|
7283
7283
|
newGroupDelay: r.newGroupDelay || 500
|
|
7284
7284
|
}, new W({
|
|
7285
|
-
key:
|
|
7285
|
+
key: dt,
|
|
7286
7286
|
state: {
|
|
7287
7287
|
init() {
|
|
7288
7288
|
return new Ke(we.empty, we.empty, null, 0, -1);
|
|
@@ -7304,7 +7304,7 @@ function Nd(r = {}) {
|
|
|
7304
7304
|
}
|
|
7305
7305
|
function Ol(r, e) {
|
|
7306
7306
|
return (t, n) => {
|
|
7307
|
-
let i =
|
|
7307
|
+
let i = dt.getState(t);
|
|
7308
7308
|
if (!i || (r ? i.undone : i.done).eventCount == 0)
|
|
7309
7309
|
return !1;
|
|
7310
7310
|
if (n) {
|
|
@@ -7558,7 +7558,7 @@ const cn = (r, e) => U(r, {
|
|
|
7558
7558
|
};
|
|
7559
7559
|
return t.addEventListener("slotchange", l), queueMicrotask(l), t;
|
|
7560
7560
|
};
|
|
7561
|
-
class zd extends
|
|
7561
|
+
class zd extends P {
|
|
7562
7562
|
constructor() {
|
|
7563
7563
|
super(...arguments), this.name = "RteHistoryFeature";
|
|
7564
7564
|
}
|
|
@@ -7566,7 +7566,7 @@ class zd extends F {
|
|
|
7566
7566
|
return [
|
|
7567
7567
|
this.contribution(Nd()),
|
|
7568
7568
|
this.contribution(
|
|
7569
|
-
|
|
7569
|
+
Q({
|
|
7570
7570
|
"Mod-z": En,
|
|
7571
7571
|
"Ctrl-y": jt,
|
|
7572
7572
|
"Cmd-Z": jt
|
|
@@ -7609,7 +7609,7 @@ class zd extends F {
|
|
|
7609
7609
|
];
|
|
7610
7610
|
}
|
|
7611
7611
|
}
|
|
7612
|
-
class Bd extends
|
|
7612
|
+
class Bd extends P {
|
|
7613
7613
|
constructor() {
|
|
7614
7614
|
super(...arguments), this.name = "RteForeignHtmlFeature";
|
|
7615
7615
|
}
|
|
@@ -7634,7 +7634,7 @@ const _d = (r) => {
|
|
|
7634
7634
|
const t = r.nodeBefore;
|
|
7635
7635
|
return t && t.isInline && t.isAtom && !t.isText ? {} : null;
|
|
7636
7636
|
};
|
|
7637
|
-
class Vd extends
|
|
7637
|
+
class Vd extends P {
|
|
7638
7638
|
constructor() {
|
|
7639
7639
|
super(...arguments), this.name = "RteCursorFix";
|
|
7640
7640
|
}
|
|
@@ -7689,7 +7689,7 @@ const Zt = new W({
|
|
|
7689
7689
|
}
|
|
7690
7690
|
}
|
|
7691
7691
|
});
|
|
7692
|
-
class Hd extends
|
|
7692
|
+
class Hd extends P {
|
|
7693
7693
|
constructor() {
|
|
7694
7694
|
super(...arguments), this.name = "RteCore", this.disabled = new Cl(!1);
|
|
7695
7695
|
}
|
|
@@ -7701,6 +7701,17 @@ class Hd extends F {
|
|
|
7701
7701
|
];
|
|
7702
7702
|
}
|
|
7703
7703
|
getPlugins(e) {
|
|
7704
|
+
const t = Wn(
|
|
7705
|
+
hl,
|
|
7706
|
+
pl,
|
|
7707
|
+
ml,
|
|
7708
|
+
gl((n, i, o) => i ? {
|
|
7709
|
+
type: Tl(
|
|
7710
|
+
o.node(o.depth - 1).contentMatchAt(o.indexAfter(o.depth - 1))
|
|
7711
|
+
),
|
|
7712
|
+
attrs: e.textblockAttrs.extractFromNode(n)
|
|
7713
|
+
} : { type: n.type, attrs: n.attrs })
|
|
7714
|
+
);
|
|
7704
7715
|
return [
|
|
7705
7716
|
this.contribution(this.disabled.plugin),
|
|
7706
7717
|
this.contribution(
|
|
@@ -7708,38 +7719,29 @@ class Hd extends F {
|
|
|
7708
7719
|
props: {
|
|
7709
7720
|
editable: () => !this.disabled.getValue(e),
|
|
7710
7721
|
handleDOMEvents: {
|
|
7711
|
-
click: (
|
|
7722
|
+
click: (n, i) => this.disabled.getValue(e) ? (i.preventDefault(), !0) : !1
|
|
7712
7723
|
}
|
|
7713
7724
|
},
|
|
7714
|
-
view: (
|
|
7715
|
-
const
|
|
7716
|
-
|
|
7725
|
+
view: (n) => {
|
|
7726
|
+
const i = n.dom.getRootNode().querySelector(".popovers"), o = () => {
|
|
7727
|
+
i.classList.toggle(
|
|
7717
7728
|
"popovers--disabled",
|
|
7718
7729
|
this.disabled.getValue(e)
|
|
7719
7730
|
);
|
|
7720
7731
|
};
|
|
7721
|
-
return
|
|
7732
|
+
return o(), {
|
|
7722
7733
|
update: () => {
|
|
7723
|
-
|
|
7734
|
+
o();
|
|
7724
7735
|
}
|
|
7725
7736
|
};
|
|
7726
7737
|
}
|
|
7727
7738
|
})
|
|
7728
7739
|
),
|
|
7729
7740
|
this.contribution(
|
|
7730
|
-
|
|
7741
|
+
Q({
|
|
7731
7742
|
...ad,
|
|
7732
|
-
Enter:
|
|
7733
|
-
|
|
7734
|
-
pl,
|
|
7735
|
-
ml,
|
|
7736
|
-
gl((t, n, i) => n ? {
|
|
7737
|
-
type: Tl(
|
|
7738
|
-
i.node(i.depth - 1).contentMatchAt(i.indexAfter(i.depth - 1))
|
|
7739
|
-
),
|
|
7740
|
-
attrs: e.textblockAttrs.extractFromNode(t)
|
|
7741
|
-
} : { type: t.type, attrs: t.attrs })
|
|
7742
|
-
)
|
|
7743
|
+
Enter: t,
|
|
7744
|
+
"Shift-Enter": t
|
|
7743
7745
|
})
|
|
7744
7746
|
),
|
|
7745
7747
|
this.contribution(ud()),
|
|
@@ -7934,7 +7936,7 @@ function vl() {
|
|
|
7934
7936
|
implementation: We,
|
|
7935
7937
|
createNodeIterator: w,
|
|
7936
7938
|
createDocumentFragment: _,
|
|
7937
|
-
getElementsByTagName:
|
|
7939
|
+
getElementsByTagName: ee
|
|
7938
7940
|
} = t, {
|
|
7939
7941
|
importNode: qn
|
|
7940
7942
|
} = n;
|
|
@@ -7976,7 +7978,7 @@ function vl() {
|
|
|
7976
7978
|
value: !1
|
|
7977
7979
|
}
|
|
7978
7980
|
})), zt = null, Yn = null;
|
|
7979
|
-
const
|
|
7981
|
+
const bt = Object.seal(Gr(null, {
|
|
7980
7982
|
tagCheck: {
|
|
7981
7983
|
writable: !0,
|
|
7982
7984
|
configurable: !1,
|
|
@@ -7990,28 +7992,28 @@ function vl() {
|
|
|
7990
7992
|
value: null
|
|
7991
7993
|
}
|
|
7992
7994
|
}));
|
|
7993
|
-
let Ai = !0, Xn = !0, vi = !1, Ii = !0,
|
|
7995
|
+
let Ai = !0, Xn = !0, vi = !1, Ii = !0, yt = !1, dn = !0, rt = !1, Zn = !1, Qn = !1, kt = !1, fn = !1, hn = !1, Ri = !0, Pi = !1;
|
|
7994
7996
|
const ql = "user-content-";
|
|
7995
|
-
let er = !0, Bt = !1,
|
|
7997
|
+
let er = !0, Bt = !1, St = {}, Tt = null;
|
|
7996
7998
|
const Fi = O({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
7997
7999
|
let Li = null;
|
|
7998
8000
|
const zi = O({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
7999
8001
|
let tr = null;
|
|
8000
8002
|
const Bi = O({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), pn = "http://www.w3.org/1998/Math/MathML", mn = "http://www.w3.org/2000/svg", Ie = "http://www.w3.org/1999/xhtml";
|
|
8001
|
-
let
|
|
8003
|
+
let Ct = Ie, nr = !1, rr = null;
|
|
8002
8004
|
const Jl = O({}, [pn, mn, Ie], Mr);
|
|
8003
8005
|
let gn = O({}, ["mi", "mo", "mn", "ms", "mtext"]), bn = O({}, ["annotation-xml"]);
|
|
8004
8006
|
const Gl = O({}, ["title", "style", "font", "a", "script"]);
|
|
8005
8007
|
let _t = null;
|
|
8006
8008
|
const jl = ["application/xhtml+xml", "text/html"], Yl = "text/html";
|
|
8007
|
-
let K = null,
|
|
8009
|
+
let K = null, Mt = null;
|
|
8008
8010
|
const Xl = t.createElement("form"), _i = function(m) {
|
|
8009
8011
|
return m instanceof RegExp || m instanceof Function;
|
|
8010
8012
|
}, ir = function() {
|
|
8011
8013
|
let m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
8012
|
-
if (!(
|
|
8014
|
+
if (!(Mt && Mt === m)) {
|
|
8013
8015
|
if ((!m || typeof m != "object") && (m = {}), m = Le(m), _t = // eslint-disable-next-line unicorn/prefer-includes
|
|
8014
|
-
jl.indexOf(m.PARSER_MEDIA_TYPE) === -1 ? Yl : m.PARSER_MEDIA_TYPE, K = _t === "application/xhtml+xml" ? Mr : wn, $ = Ee(m, "ALLOWED_TAGS") ? O({}, m.ALLOWED_TAGS, K) : Di, G = Ee(m, "ALLOWED_ATTR") ? O({}, m.ALLOWED_ATTR, K) : Ni, rr = Ee(m, "ALLOWED_NAMESPACES") ? O({}, m.ALLOWED_NAMESPACES, Mr) : Jl, tr = Ee(m, "ADD_URI_SAFE_ATTR") ? O(Le(Bi), m.ADD_URI_SAFE_ATTR, K) : Bi, Li = Ee(m, "ADD_DATA_URI_TAGS") ? O(Le(zi), m.ADD_DATA_URI_TAGS, K) : zi,
|
|
8016
|
+
jl.indexOf(m.PARSER_MEDIA_TYPE) === -1 ? Yl : m.PARSER_MEDIA_TYPE, K = _t === "application/xhtml+xml" ? Mr : wn, $ = Ee(m, "ALLOWED_TAGS") ? O({}, m.ALLOWED_TAGS, K) : Di, G = Ee(m, "ALLOWED_ATTR") ? O({}, m.ALLOWED_ATTR, K) : Ni, rr = Ee(m, "ALLOWED_NAMESPACES") ? O({}, m.ALLOWED_NAMESPACES, Mr) : Jl, tr = Ee(m, "ADD_URI_SAFE_ATTR") ? O(Le(Bi), m.ADD_URI_SAFE_ATTR, K) : Bi, Li = Ee(m, "ADD_DATA_URI_TAGS") ? O(Le(zi), m.ADD_DATA_URI_TAGS, K) : zi, Tt = Ee(m, "FORBID_CONTENTS") ? O({}, m.FORBID_CONTENTS, K) : Fi, zt = Ee(m, "FORBID_TAGS") ? O({}, m.FORBID_TAGS, K) : Le({}), Yn = Ee(m, "FORBID_ATTR") ? O({}, m.FORBID_ATTR, K) : Le({}), St = Ee(m, "USE_PROFILES") ? m.USE_PROFILES : !1, Ai = m.ALLOW_ARIA_ATTR !== !1, Xn = m.ALLOW_DATA_ATTR !== !1, vi = m.ALLOW_UNKNOWN_PROTOCOLS || !1, Ii = m.ALLOW_SELF_CLOSE_IN_ATTR !== !1, yt = m.SAFE_FOR_TEMPLATES || !1, dn = m.SAFE_FOR_XML !== !1, rt = m.WHOLE_DOCUMENT || !1, kt = m.RETURN_DOM || !1, fn = m.RETURN_DOM_FRAGMENT || !1, hn = m.RETURN_TRUSTED_TYPE || !1, Qn = m.FORCE_BODY || !1, Ri = m.SANITIZE_DOM !== !1, Pi = m.SANITIZE_NAMED_PROPS || !1, er = m.KEEP_CONTENT !== !1, Bt = m.IN_PLACE || !1, wi = m.ALLOWED_URI_REGEXP || Nl, Ct = m.NAMESPACE || Ie, gn = m.MATHML_TEXT_INTEGRATION_POINTS || gn, bn = m.HTML_INTEGRATION_POINTS || bn, B = m.CUSTOM_ELEMENT_HANDLING || {}, m.CUSTOM_ELEMENT_HANDLING && _i(m.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (B.tagNameCheck = m.CUSTOM_ELEMENT_HANDLING.tagNameCheck), m.CUSTOM_ELEMENT_HANDLING && _i(m.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (B.attributeNameCheck = m.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), m.CUSTOM_ELEMENT_HANDLING && typeof m.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = m.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), yt && (Xn = !1), fn && (kt = !0), St && ($ = O({}, Yo), G = [], St.html === !0 && (O($, jo), O(G, Xo)), St.svg === !0 && (O($, Or), O(G, Dr), O(G, Tn)), St.svgFilters === !0 && (O($, Er), O(G, Dr), O(G, Tn)), St.mathMl === !0 && (O($, wr), O(G, Zo), O(G, Tn))), m.ADD_TAGS && (typeof m.ADD_TAGS == "function" ? bt.tagCheck = m.ADD_TAGS : ($ === Di && ($ = Le($)), O($, m.ADD_TAGS, K))), m.ADD_ATTR && (typeof m.ADD_ATTR == "function" ? bt.attributeCheck = m.ADD_ATTR : (G === Ni && (G = Le(G)), O(G, m.ADD_ATTR, K))), m.ADD_URI_SAFE_ATTR && O(tr, m.ADD_URI_SAFE_ATTR, K), m.FORBID_CONTENTS && (Tt === Fi && (Tt = Le(Tt)), O(Tt, m.FORBID_CONTENTS, K)), er && ($["#text"] = !0), rt && O($, ["html", "head", "body"]), $.table && (O($, ["tbody"]), delete zt.tbody), m.TRUSTED_TYPES_POLICY) {
|
|
8015
8017
|
if (typeof m.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
8016
8018
|
throw Ut('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
8017
8019
|
if (typeof m.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -8019,16 +8021,16 @@ function vl() {
|
|
|
8019
8021
|
v = m.TRUSTED_TYPES_POLICY, Oe = v.createHTML("");
|
|
8020
8022
|
} else
|
|
8021
8023
|
v === void 0 && (v = cf(h, i)), v !== null && typeof Oe == "string" && (Oe = v.createHTML(""));
|
|
8022
|
-
fe && fe(m),
|
|
8024
|
+
fe && fe(m), Mt = m;
|
|
8023
8025
|
}
|
|
8024
8026
|
}, Vi = O({}, [...Or, ...Er, ...Xd]), Hi = O({}, [...wr, ...Zd]), Zl = function(m) {
|
|
8025
8027
|
let y = N(m);
|
|
8026
8028
|
(!y || !y.tagName) && (y = {
|
|
8027
|
-
namespaceURI:
|
|
8029
|
+
namespaceURI: Ct,
|
|
8028
8030
|
tagName: "template"
|
|
8029
8031
|
});
|
|
8030
|
-
const k = wn(m.tagName),
|
|
8031
|
-
return rr[m.namespaceURI] ? m.namespaceURI === mn ? y.namespaceURI === Ie ? k === "svg" : y.namespaceURI === pn ? k === "svg" && (
|
|
8032
|
+
const k = wn(m.tagName), F = wn(y.tagName);
|
|
8033
|
+
return rr[m.namespaceURI] ? m.namespaceURI === mn ? y.namespaceURI === Ie ? k === "svg" : y.namespaceURI === pn ? k === "svg" && (F === "annotation-xml" || gn[F]) : !!Vi[k] : m.namespaceURI === pn ? y.namespaceURI === Ie ? k === "math" : y.namespaceURI === mn ? k === "math" && bn[F] : !!Hi[k] : m.namespaceURI === Ie ? y.namespaceURI === mn && !bn[F] || y.namespaceURI === pn && !gn[F] ? !1 : !Hi[k] && (Gl[k] || !Vi[k]) : !!(_t === "application/xhtml+xml" && rr[m.namespaceURI]) : !1;
|
|
8032
8034
|
}, De = function(m) {
|
|
8033
8035
|
Ht(e.removed, {
|
|
8034
8036
|
element: m
|
|
@@ -8038,7 +8040,7 @@ function vl() {
|
|
|
8038
8040
|
} catch {
|
|
8039
8041
|
b(m);
|
|
8040
8042
|
}
|
|
8041
|
-
},
|
|
8043
|
+
}, it = function(m, y) {
|
|
8042
8044
|
try {
|
|
8043
8045
|
Ht(e.removed, {
|
|
8044
8046
|
attribute: y.getAttributeNode(m),
|
|
@@ -8051,7 +8053,7 @@ function vl() {
|
|
|
8051
8053
|
});
|
|
8052
8054
|
}
|
|
8053
8055
|
if (y.removeAttribute(m), m === "is")
|
|
8054
|
-
if (
|
|
8056
|
+
if (kt || fn)
|
|
8055
8057
|
try {
|
|
8056
8058
|
De(y);
|
|
8057
8059
|
} catch {
|
|
@@ -8069,22 +8071,22 @@ function vl() {
|
|
|
8069
8071
|
const V = xr(m, /^[\r\n\t ]+/);
|
|
8070
8072
|
k = V && V[0];
|
|
8071
8073
|
}
|
|
8072
|
-
_t === "application/xhtml+xml" &&
|
|
8073
|
-
const
|
|
8074
|
-
if (
|
|
8074
|
+
_t === "application/xhtml+xml" && Ct === Ie && (m = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + m + "</body></html>");
|
|
8075
|
+
const F = v ? v.createHTML(m) : m;
|
|
8076
|
+
if (Ct === Ie)
|
|
8075
8077
|
try {
|
|
8076
|
-
y = new f().parseFromString(
|
|
8078
|
+
y = new f().parseFromString(F, _t);
|
|
8077
8079
|
} catch {
|
|
8078
8080
|
}
|
|
8079
8081
|
if (!y || !y.documentElement) {
|
|
8080
|
-
y = We.createDocument(
|
|
8082
|
+
y = We.createDocument(Ct, "template", null);
|
|
8081
8083
|
try {
|
|
8082
|
-
y.documentElement.innerHTML = nr ? Oe :
|
|
8084
|
+
y.documentElement.innerHTML = nr ? Oe : F;
|
|
8083
8085
|
} catch {
|
|
8084
8086
|
}
|
|
8085
8087
|
}
|
|
8086
|
-
const
|
|
8087
|
-
return m && k &&
|
|
8088
|
+
const te = y.body || y.documentElement;
|
|
8089
|
+
return m && k && te.insertBefore(t.createTextNode(k), te.childNodes[0] || null), Ct === Ie ? ee.call(y, rt ? "html" : "body")[0] : rt ? y.documentElement : te;
|
|
8088
8090
|
}, Ui = function(m) {
|
|
8089
8091
|
return w.call(
|
|
8090
8092
|
m.ownerDocument || m,
|
|
@@ -8100,7 +8102,7 @@ function vl() {
|
|
|
8100
8102
|
};
|
|
8101
8103
|
function Re(M, m, y) {
|
|
8102
8104
|
Sn(M, (k) => {
|
|
8103
|
-
k.call(e, m, y,
|
|
8105
|
+
k.call(e, m, y, Mt);
|
|
8104
8106
|
});
|
|
8105
8107
|
}
|
|
8106
8108
|
const Ki = function(m) {
|
|
@@ -8113,23 +8115,23 @@ function vl() {
|
|
|
8113
8115
|
allowedTags: $
|
|
8114
8116
|
}), dn && m.hasChildNodes() && !$i(m.firstElementChild) && ae(/<[/\w!]/g, m.innerHTML) && ae(/<[/\w!]/g, m.textContent) || m.nodeType === Kt.progressingInstruction || dn && m.nodeType === Kt.comment && ae(/<[/\w]/g, m.data))
|
|
8115
8117
|
return De(m), !0;
|
|
8116
|
-
if (!(
|
|
8118
|
+
if (!(bt.tagCheck instanceof Function && bt.tagCheck(k)) && (!$[k] || zt[k])) {
|
|
8117
8119
|
if (!zt[k] && Ji(k) && (B.tagNameCheck instanceof RegExp && ae(B.tagNameCheck, k) || B.tagNameCheck instanceof Function && B.tagNameCheck(k)))
|
|
8118
8120
|
return !1;
|
|
8119
|
-
if (er && !
|
|
8120
|
-
const
|
|
8121
|
-
if (
|
|
8122
|
-
const V =
|
|
8121
|
+
if (er && !Tt[k]) {
|
|
8122
|
+
const F = N(m) || m.parentNode, te = R(m) || m.childNodes;
|
|
8123
|
+
if (te && F) {
|
|
8124
|
+
const V = te.length;
|
|
8123
8125
|
for (let pe = V - 1; pe >= 0; --pe) {
|
|
8124
|
-
const Pe = g(
|
|
8125
|
-
Pe.__removalCount = (m.__removalCount || 0) + 1,
|
|
8126
|
+
const Pe = g(te[pe], !0);
|
|
8127
|
+
Pe.__removalCount = (m.__removalCount || 0) + 1, F.insertBefore(Pe, S(m));
|
|
8126
8128
|
}
|
|
8127
8129
|
}
|
|
8128
8130
|
}
|
|
8129
8131
|
return De(m), !0;
|
|
8130
8132
|
}
|
|
8131
|
-
return m instanceof a && !Zl(m) || (k === "noscript" || k === "noembed" || k === "noframes") && ae(/<\/no(script|embed|frames)/i, m.innerHTML) ? (De(m), !0) : (
|
|
8132
|
-
y = Wt(y,
|
|
8133
|
+
return m instanceof a && !Zl(m) || (k === "noscript" || k === "noembed" || k === "noframes") && ae(/<\/no(script|embed|frames)/i, m.innerHTML) ? (De(m), !0) : (yt && m.nodeType === Kt.text && (y = m.textContent, Sn([Jn, Gn, jn], (F) => {
|
|
8134
|
+
y = Wt(y, F, " ");
|
|
8133
8135
|
}), m.textContent !== y && (Ht(e.removed, {
|
|
8134
8136
|
element: m.cloneNode()
|
|
8135
8137
|
}), m.textContent = y)), Re(le.afterSanitizeElements, m, null), !1);
|
|
@@ -8138,7 +8140,7 @@ function vl() {
|
|
|
8138
8140
|
return !1;
|
|
8139
8141
|
if (!(Xn && !Yn[y] && ae(Wl, y))) {
|
|
8140
8142
|
if (!(Ai && ae(Ul, y))) {
|
|
8141
|
-
if (!(
|
|
8143
|
+
if (!(bt.attributeCheck instanceof Function && bt.attributeCheck(y, m))) {
|
|
8142
8144
|
if (!G[y] || Yn[y]) {
|
|
8143
8145
|
if (
|
|
8144
8146
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
@@ -8178,42 +8180,42 @@ function vl() {
|
|
|
8178
8180
|
allowedAttributes: G,
|
|
8179
8181
|
forceKeepAttr: void 0
|
|
8180
8182
|
};
|
|
8181
|
-
let
|
|
8182
|
-
for (;
|
|
8183
|
-
const
|
|
8183
|
+
let F = y.length;
|
|
8184
|
+
for (; F--; ) {
|
|
8185
|
+
const te = y[F], {
|
|
8184
8186
|
name: V,
|
|
8185
8187
|
namespaceURI: pe,
|
|
8186
8188
|
value: Pe
|
|
8187
|
-
} =
|
|
8189
|
+
} = te, xt = K(V), sr = Pe;
|
|
8188
8190
|
let j = V === "value" ? sr : Gd(sr);
|
|
8189
|
-
if (k.attrName =
|
|
8190
|
-
|
|
8191
|
+
if (k.attrName = xt, k.attrValue = j, k.keepAttr = !0, k.forceKeepAttr = void 0, Re(le.uponSanitizeAttribute, m, k), j = k.attrValue, Pi && (xt === "id" || xt === "name") && (it(V, m), j = ql + j), dn && ae(/((--!?|])>)|<\/(style|title|textarea)/i, j)) {
|
|
8192
|
+
it(V, m);
|
|
8191
8193
|
continue;
|
|
8192
8194
|
}
|
|
8193
|
-
if (
|
|
8194
|
-
|
|
8195
|
+
if (xt === "attributename" && xr(j, "href")) {
|
|
8196
|
+
it(V, m);
|
|
8195
8197
|
continue;
|
|
8196
8198
|
}
|
|
8197
8199
|
if (k.forceKeepAttr)
|
|
8198
8200
|
continue;
|
|
8199
8201
|
if (!k.keepAttr) {
|
|
8200
|
-
|
|
8202
|
+
it(V, m);
|
|
8201
8203
|
continue;
|
|
8202
8204
|
}
|
|
8203
8205
|
if (!Ii && ae(/\/>/i, j)) {
|
|
8204
|
-
|
|
8206
|
+
it(V, m);
|
|
8205
8207
|
continue;
|
|
8206
8208
|
}
|
|
8207
|
-
|
|
8209
|
+
yt && Sn([Jn, Gn, jn], (Yi) => {
|
|
8208
8210
|
j = Wt(j, Yi, " ");
|
|
8209
8211
|
});
|
|
8210
8212
|
const ji = K(m.nodeName);
|
|
8211
|
-
if (!qi(ji,
|
|
8212
|
-
|
|
8213
|
+
if (!qi(ji, xt, j)) {
|
|
8214
|
+
it(V, m);
|
|
8213
8215
|
continue;
|
|
8214
8216
|
}
|
|
8215
8217
|
if (v && typeof h == "object" && typeof h.getAttributeType == "function" && !pe)
|
|
8216
|
-
switch (h.getAttributeType(ji,
|
|
8218
|
+
switch (h.getAttributeType(ji, xt)) {
|
|
8217
8219
|
case "TrustedHTML": {
|
|
8218
8220
|
j = v.createHTML(j);
|
|
8219
8221
|
break;
|
|
@@ -8227,7 +8229,7 @@ function vl() {
|
|
|
8227
8229
|
try {
|
|
8228
8230
|
pe ? m.setAttributeNS(pe, V, j) : m.setAttribute(V, j), or(m) ? De(m) : Go(e.removed);
|
|
8229
8231
|
} catch {
|
|
8230
|
-
|
|
8232
|
+
it(V, m);
|
|
8231
8233
|
}
|
|
8232
8234
|
}
|
|
8233
8235
|
Re(le.afterSanitizeAttributes, m, null);
|
|
@@ -8239,7 +8241,7 @@ function vl() {
|
|
|
8239
8241
|
Re(le.afterSanitizeShadowDOM, m, null);
|
|
8240
8242
|
};
|
|
8241
8243
|
return e.sanitize = function(M) {
|
|
8242
|
-
let m = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, y = null, k = null,
|
|
8244
|
+
let m = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, y = null, k = null, F = null, te = null;
|
|
8243
8245
|
if (nr = !M, nr && (M = "<!-->"), typeof M != "string" && !$i(M))
|
|
8244
8246
|
if (typeof M.toString == "function") {
|
|
8245
8247
|
if (M = M.toString(), typeof M != "string")
|
|
@@ -8257,40 +8259,40 @@ function vl() {
|
|
|
8257
8259
|
} else if (M instanceof l)
|
|
8258
8260
|
y = Wi("<!---->"), k = y.ownerDocument.importNode(M, !0), k.nodeType === Kt.element && k.nodeName === "BODY" || k.nodeName === "HTML" ? y = k : y.appendChild(k);
|
|
8259
8261
|
else {
|
|
8260
|
-
if (!
|
|
8262
|
+
if (!kt && !yt && !rt && // eslint-disable-next-line unicorn/prefer-includes
|
|
8261
8263
|
M.indexOf("<") === -1)
|
|
8262
8264
|
return v && hn ? v.createHTML(M) : M;
|
|
8263
8265
|
if (y = Wi(M), !y)
|
|
8264
|
-
return
|
|
8266
|
+
return kt ? null : hn ? Oe : "";
|
|
8265
8267
|
}
|
|
8266
8268
|
y && Qn && De(y.firstChild);
|
|
8267
8269
|
const V = Ui(Bt ? M : y);
|
|
8268
|
-
for (;
|
|
8269
|
-
Ki(
|
|
8270
|
+
for (; F = V.nextNode(); )
|
|
8271
|
+
Ki(F), Gi(F), F.content instanceof o && Ql(F.content);
|
|
8270
8272
|
if (Bt)
|
|
8271
8273
|
return M;
|
|
8272
|
-
if (
|
|
8274
|
+
if (kt) {
|
|
8273
8275
|
if (fn)
|
|
8274
|
-
for (
|
|
8275
|
-
|
|
8276
|
+
for (te = _.call(y.ownerDocument); y.firstChild; )
|
|
8277
|
+
te.appendChild(y.firstChild);
|
|
8276
8278
|
else
|
|
8277
|
-
|
|
8278
|
-
return (G.shadowroot || G.shadowrootmode) && (
|
|
8279
|
+
te = y;
|
|
8280
|
+
return (G.shadowroot || G.shadowrootmode) && (te = qn.call(n, te, !0)), te;
|
|
8279
8281
|
}
|
|
8280
|
-
let pe =
|
|
8281
|
-
return
|
|
8282
|
-
` + pe),
|
|
8282
|
+
let pe = rt ? y.outerHTML : y.innerHTML;
|
|
8283
|
+
return rt && $["!doctype"] && y.ownerDocument && y.ownerDocument.doctype && y.ownerDocument.doctype.name && ae(Al, y.ownerDocument.doctype.name) && (pe = "<!DOCTYPE " + y.ownerDocument.doctype.name + `>
|
|
8284
|
+
` + pe), yt && Sn([Jn, Gn, jn], (Pe) => {
|
|
8283
8285
|
pe = Wt(pe, Pe, " ");
|
|
8284
8286
|
}), v && hn ? v.createHTML(pe) : pe;
|
|
8285
8287
|
}, e.setConfig = function() {
|
|
8286
8288
|
let M = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
8287
8289
|
ir(M), Zn = !0;
|
|
8288
8290
|
}, e.clearConfig = function() {
|
|
8289
|
-
|
|
8291
|
+
Mt = null, Zn = !1;
|
|
8290
8292
|
}, e.isValidAttribute = function(M, m, y) {
|
|
8291
|
-
|
|
8292
|
-
const k = K(M),
|
|
8293
|
-
return qi(k,
|
|
8293
|
+
Mt || ir({});
|
|
8294
|
+
const k = K(M), F = K(m);
|
|
8295
|
+
return qi(k, F, y);
|
|
8294
8296
|
}, e.addHook = function(M, m) {
|
|
8295
8297
|
typeof m == "function" && Ht(le[M], m);
|
|
8296
8298
|
}, e.removeHook = function(M, m) {
|
|
@@ -8457,7 +8459,7 @@ const Rl = (r, e) => {
|
|
|
8457
8459
|
};
|
|
8458
8460
|
class kf {
|
|
8459
8461
|
constructor(e, t) {
|
|
8460
|
-
this.options = t, this.feature = (n, i) => this[A].getPublicInterface(n, i), this[A] = new Sf(e, t);
|
|
8462
|
+
this.options = t, this.feature = (n, i) => this[A].getPublicInterface(n, i), this[A] = new Sf(this, e, t);
|
|
8461
8463
|
}
|
|
8462
8464
|
/**
|
|
8463
8465
|
* Returns the current document state.
|
|
@@ -8497,15 +8499,15 @@ class kf {
|
|
|
8497
8499
|
}
|
|
8498
8500
|
}
|
|
8499
8501
|
class Sf {
|
|
8500
|
-
constructor(e, t) {
|
|
8501
|
-
this.options =
|
|
8502
|
-
const
|
|
8503
|
-
return this.state = this.state.apply(
|
|
8504
|
-
};
|
|
8505
|
-
const
|
|
8506
|
-
this.config =
|
|
8507
|
-
|
|
8508
|
-
), this.initState(
|
|
8502
|
+
constructor(e, t, n) {
|
|
8503
|
+
this.options = n, this.view = null, this.dispatchTransaction = (o) => {
|
|
8504
|
+
const s = this.state;
|
|
8505
|
+
return this.state = this.state.apply(o), this.view?.updateState(this.state), s.doc !== this.state.doc && this.options?.onChange?.(), this.state;
|
|
8506
|
+
}, this.facade = e;
|
|
8507
|
+
const i = t[A];
|
|
8508
|
+
this.config = i, this.schema = i.schema, this.textblockAttrs = i.textblockAttrs, this.features = i.features, this.foreignHtmlParser = n?.foreignHtmlParser ?? new mf(t), this.foreignHtmlSerializer = n?.foreignHtmlSerializer ?? new yf(t), this.styles = new ea(
|
|
8509
|
+
at(i.features.flatMap((o) => o.getStyles()))
|
|
8510
|
+
), this.initState(n?.initialDocument);
|
|
8509
8511
|
}
|
|
8510
8512
|
getFeature(e) {
|
|
8511
8513
|
const t = this.config.featureMap.get(e);
|
|
@@ -8530,10 +8532,10 @@ class Sf {
|
|
|
8530
8532
|
return n[0].getPublicInterface(this);
|
|
8531
8533
|
}
|
|
8532
8534
|
initState(e) {
|
|
8533
|
-
this.state =
|
|
8535
|
+
this.state = Nt.create({
|
|
8534
8536
|
doc: Rl(this.schema, e),
|
|
8535
8537
|
schema: this.config.schema,
|
|
8536
|
-
plugins:
|
|
8538
|
+
plugins: at(
|
|
8537
8539
|
this.config.features.flatMap((t) => t.getPlugins(this))
|
|
8538
8540
|
)
|
|
8539
8541
|
});
|
|
@@ -8614,7 +8616,7 @@ class Pl extends la(us) {
|
|
|
8614
8616
|
}
|
|
8615
8617
|
}
|
|
8616
8618
|
Cf([
|
|
8617
|
-
|
|
8619
|
+
mt
|
|
8618
8620
|
], Pl.prototype, "instance");
|
|
8619
8621
|
const Mf = (r) => ds`<template :_ctx="${() => r}">
|
|
8620
8622
|
<div class="rte">
|
|
@@ -8630,7 +8632,7 @@ const Mf = (r) => ds`<template :_ctx="${() => r}">
|
|
|
8630
8632
|
<div class="toolbar"></div>
|
|
8631
8633
|
</div>
|
|
8632
8634
|
</template>`;
|
|
8633
|
-
var xf = Object.defineProperty, Of = Object.getOwnPropertyDescriptor,
|
|
8635
|
+
var xf = Object.defineProperty, Of = Object.getOwnPropertyDescriptor, gt = (r, e, t, n) => {
|
|
8634
8636
|
for (var i = n > 1 ? void 0 : n ? Of(e, t) : e, o = r.length - 1, s; o >= 0; o--)
|
|
8635
8637
|
(s = r[o]) && (i = (n ? s(e, t, i) : s(i)) || i);
|
|
8636
8638
|
return n && i && xf(e, t, i), i;
|
|
@@ -8712,25 +8714,25 @@ class xe extends us {
|
|
|
8712
8714
|
super.disconnectedCallback(), this.#e.disconnect();
|
|
8713
8715
|
}
|
|
8714
8716
|
}
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
+
gt([
|
|
8718
|
+
mt
|
|
8717
8719
|
], xe.prototype, "kind", 2);
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
+
gt([
|
|
8721
|
+
mt
|
|
8720
8722
|
], xe.prototype, "offset", 2);
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
+
gt([
|
|
8724
|
+
mt
|
|
8723
8725
|
], xe.prototype, "anchorBlocksPopover", 2);
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
+
gt([
|
|
8727
|
+
mt
|
|
8726
8728
|
], xe.prototype, "anchorEl", 2);
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
+
gt([
|
|
8730
|
+
mt
|
|
8729
8731
|
], xe.prototype, "anchorId", 2);
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
+
gt([
|
|
8733
|
+
mt
|
|
8732
8734
|
], xe.prototype, "requestedOpenState", 2);
|
|
8733
|
-
|
|
8735
|
+
gt([
|
|
8734
8736
|
ta
|
|
8735
8737
|
], xe.prototype, "open", 1);
|
|
8736
8738
|
const wf = fs(
|
|
@@ -8740,7 +8742,7 @@ const wf = fs(
|
|
|
8740
8742
|
[aa],
|
|
8741
8743
|
{}
|
|
8742
8744
|
), Df = "h1,h2,h3,p{all:unset;display:block}h1:first-child,h2:first-child,h3:first-child,p:first-child{margin-block-start:0}h1:last-child,h2:last-child,h3:last-child,p:last-child{margin-block-end:0}p{font:var(--vvd-typography-base);font-variant-ligatures:unset;font-feature-settings:unset;line-height:20px;margin-block:16px}.heading-step-1{font:var(--vvd-typography-heading-4);font-variant-ligatures:unset;font-feature-settings:unset;line-height:28px;margin-block:24px 12px}.heading-step-2{font:var(--vvd-typography-heading-3);font-variant-ligatures:unset;font-feature-settings:unset;line-height:36px;margin-block:24px 12px}.heading-step-3{font:var(--vvd-typography-heading-2);font-variant-ligatures:unset;font-feature-settings:unset;line-height:42px;margin-block:32px 16px}";
|
|
8743
|
-
class Nf extends
|
|
8745
|
+
class Nf extends P {
|
|
8744
8746
|
constructor(e) {
|
|
8745
8747
|
super(), this.enabledBlocks = e, this.name = "RteBasicTextBlocks";
|
|
8746
8748
|
}
|
|
@@ -8818,7 +8820,7 @@ class Nf extends F {
|
|
|
8818
8820
|
const i = `heading${n}`;
|
|
8819
8821
|
this.enabledBlocks[i] && (t[`Mod-Alt-${n}`] = this.setBlockType(e, i));
|
|
8820
8822
|
}
|
|
8821
|
-
return [this.contribution(
|
|
8823
|
+
return [this.contribution(Q(t))];
|
|
8822
8824
|
}
|
|
8823
8825
|
getCurrentBlockType(e) {
|
|
8824
8826
|
const { $from: t, $to: n } = e.selection, i = t.depth === 0 ? e.doc.childAfter(t.pos).node : t.node(1), o = n.depth === 0 ? e.doc.childBefore(n.pos).node : n.node(1);
|
|
@@ -8837,7 +8839,7 @@ class Nf extends F {
|
|
|
8837
8839
|
};
|
|
8838
8840
|
}
|
|
8839
8841
|
}
|
|
8840
|
-
class
|
|
8842
|
+
class nt {
|
|
8841
8843
|
/**
|
|
8842
8844
|
Create an input rule. The rule applies when the user typed
|
|
8843
8845
|
something and the text directly in front of the cursor matches
|
|
@@ -8950,12 +8952,12 @@ const Rf = (r, e) => {
|
|
|
8950
8952
|
}
|
|
8951
8953
|
return !1;
|
|
8952
8954
|
};
|
|
8953
|
-
new
|
|
8954
|
-
new
|
|
8955
|
-
new
|
|
8956
|
-
new
|
|
8957
|
-
new
|
|
8958
|
-
new
|
|
8955
|
+
new nt(/--$/, "—", { inCodeMark: !1 });
|
|
8956
|
+
new nt(/\.\.\.$/, "…", { inCodeMark: !1 });
|
|
8957
|
+
new nt(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/, "“", { inCodeMark: !1 });
|
|
8958
|
+
new nt(/"$/, "”", { inCodeMark: !1 });
|
|
8959
|
+
new nt(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/, "‘", { inCodeMark: !1 });
|
|
8960
|
+
new nt(/'$/, "’", { inCodeMark: !1 });
|
|
8959
8961
|
const Fl = (r) => r.parent.textBetween(
|
|
8960
8962
|
0,
|
|
8961
8963
|
r.parentOffset,
|
|
@@ -8963,12 +8965,12 @@ const Fl = (r) => r.parent.textBetween(
|
|
|
8963
8965
|
""
|
|
8964
8966
|
// object replacement char, to avoid matching across non-text nodes
|
|
8965
8967
|
);
|
|
8966
|
-
class Pf extends
|
|
8968
|
+
class Pf extends P {
|
|
8967
8969
|
constructor() {
|
|
8968
8970
|
super(...arguments), this.name = "RteInputRulesFeature";
|
|
8969
8971
|
}
|
|
8970
8972
|
getPlugins(e) {
|
|
8971
|
-
const t =
|
|
8973
|
+
const t = at(
|
|
8972
8974
|
e.config.features.flatMap((s) => s.getInputRules(e))
|
|
8973
8975
|
);
|
|
8974
8976
|
if (t.length === 0)
|
|
@@ -8976,17 +8978,17 @@ class Pf extends F {
|
|
|
8976
8978
|
const n = [], i = t.map((s) => s.rule);
|
|
8977
8979
|
n.push(this.contribution(If({ rules: i }))), n.push(
|
|
8978
8980
|
this.contribution(
|
|
8979
|
-
|
|
8981
|
+
Q({
|
|
8980
8982
|
Backspace: Rf
|
|
8981
8983
|
}),
|
|
8982
8984
|
// Run before other Backspace handlers
|
|
8983
|
-
|
|
8985
|
+
Qe.high
|
|
8984
8986
|
)
|
|
8985
8987
|
);
|
|
8986
8988
|
const o = t.filter((s) => s.enterHandler).map((s) => s.enterHandler);
|
|
8987
8989
|
return o.length > 0 && n.push(
|
|
8988
8990
|
this.contribution(
|
|
8989
|
-
|
|
8991
|
+
Q({
|
|
8990
8992
|
Enter: (s, l) => {
|
|
8991
8993
|
const { $cursor: a } = s.selection;
|
|
8992
8994
|
if (!a) return !1;
|
|
@@ -9002,12 +9004,12 @@ class Pf extends F {
|
|
|
9002
9004
|
}
|
|
9003
9005
|
}),
|
|
9004
9006
|
// Run before other Enter handlers so rules are applied first
|
|
9005
|
-
|
|
9007
|
+
Qe.highest
|
|
9006
9008
|
)
|
|
9007
9009
|
), n;
|
|
9008
9010
|
}
|
|
9009
9011
|
}
|
|
9010
|
-
class Ff extends
|
|
9012
|
+
class Ff extends P {
|
|
9011
9013
|
constructor(e) {
|
|
9012
9014
|
super(), this.config = e, this.name = "RteBase";
|
|
9013
9015
|
}
|
|
@@ -9050,8 +9052,8 @@ class Ff extends F {
|
|
|
9050
9052
|
};
|
|
9051
9053
|
}
|
|
9052
9054
|
}
|
|
9053
|
-
const
|
|
9054
|
-
class Lf extends
|
|
9055
|
+
const tp = L(Ff);
|
|
9056
|
+
class Lf extends P {
|
|
9055
9057
|
constructor(e) {
|
|
9056
9058
|
super(), this.config = e, this.name = "RteTextBlockPickerFeature";
|
|
9057
9059
|
}
|
|
@@ -9082,10 +9084,10 @@ class Lf extends F {
|
|
|
9082
9084
|
];
|
|
9083
9085
|
}
|
|
9084
9086
|
}
|
|
9085
|
-
const
|
|
9087
|
+
const np = L(
|
|
9086
9088
|
Lf
|
|
9087
9089
|
), zf = ".toolbar{display:flex;flex-wrap:wrap;align-items:center;padding:4px;background-color:var(--vvd-color-neutral-50);gap:8px}.toolbar--hidden{display:none}";
|
|
9088
|
-
class Bf extends
|
|
9090
|
+
class Bf extends P {
|
|
9089
9091
|
constructor(e) {
|
|
9090
9092
|
super(), this.config = e, this.name = "RteToolbarFeature", this.hidden = new Cl(!1);
|
|
9091
9093
|
}
|
|
@@ -9102,7 +9104,7 @@ class Bf extends F {
|
|
|
9102
9104
|
], n = new Map(
|
|
9103
9105
|
t.map((o) => [o, []])
|
|
9104
9106
|
);
|
|
9105
|
-
for (const o of
|
|
9107
|
+
for (const o of at(
|
|
9106
9108
|
e.features.flatMap((s) => s.getToolbarItems(e))
|
|
9107
9109
|
))
|
|
9108
9110
|
n.get(o.section).push(o);
|
|
@@ -9155,8 +9157,8 @@ class Bf extends F {
|
|
|
9155
9157
|
};
|
|
9156
9158
|
}
|
|
9157
9159
|
}
|
|
9158
|
-
const
|
|
9159
|
-
class Vf extends
|
|
9160
|
+
const rp = L(Bf), _f = ".placeholder{display:contents}.placeholder:before{position:absolute;color:var(--vvd-color-neutral-600);content:attr(data-placeholder);font-size:var(--placeholder-font-size, inherit);inset-inline:var(--editor-padding-inline);line-height:inherit;pointer-events:none}";
|
|
9161
|
+
class Vf extends P {
|
|
9160
9162
|
constructor(e) {
|
|
9161
9163
|
super(), this.config = e, this.name = "RtePlaceholderFeature";
|
|
9162
9164
|
}
|
|
@@ -9186,8 +9188,8 @@ class Vf extends F {
|
|
|
9186
9188
|
return [this.contribution(e)];
|
|
9187
9189
|
}
|
|
9188
9190
|
}
|
|
9189
|
-
const
|
|
9190
|
-
class Hf extends
|
|
9191
|
+
const ip = L(Vf);
|
|
9192
|
+
class Hf extends P {
|
|
9191
9193
|
constructor() {
|
|
9192
9194
|
super(...arguments), this.name = "RteHardBreakFeature";
|
|
9193
9195
|
}
|
|
@@ -9214,11 +9216,11 @@ class Hf extends F {
|
|
|
9214
9216
|
i.tr.replaceSelectionWith(i.schema.nodes.hardBreak.create(), !0).scrollIntoView()
|
|
9215
9217
|
), !0)
|
|
9216
9218
|
};
|
|
9217
|
-
return [this.contribution(
|
|
9219
|
+
return [this.contribution(Q(n), Qe.high)];
|
|
9218
9220
|
}
|
|
9219
9221
|
}
|
|
9220
|
-
const
|
|
9221
|
-
class Wf extends
|
|
9222
|
+
const op = L(Hf), Ar = Symbol("mixedFontSize");
|
|
9223
|
+
class Wf extends P {
|
|
9222
9224
|
constructor(e) {
|
|
9223
9225
|
if (super(), this.config = e, this.name = "RteFontSizePickerFeature", this.fontSizes = e.options, e.onBlocks) {
|
|
9224
9226
|
this.defaultFontSizeForNode = {};
|
|
@@ -9283,7 +9285,7 @@ class Wf extends F {
|
|
|
9283
9285
|
getPlugins() {
|
|
9284
9286
|
return [
|
|
9285
9287
|
this.contribution(
|
|
9286
|
-
|
|
9288
|
+
Q({
|
|
9287
9289
|
"Mod-Shift-.": this.adjustFontSize(-1),
|
|
9288
9290
|
"Mod-Shift-,": this.adjustFontSize(1)
|
|
9289
9291
|
})
|
|
@@ -9372,7 +9374,7 @@ class Wf extends F {
|
|
|
9372
9374
|
};
|
|
9373
9375
|
}
|
|
9374
9376
|
}
|
|
9375
|
-
const
|
|
9377
|
+
const sp = L(
|
|
9376
9378
|
Wf
|
|
9377
9379
|
), Uf = ["p", 0], $f = ["blockquote", 0], Kf = ["hr"], qf = ["pre", ["code", 0]], Jf = ["br"], Gf = {
|
|
9378
9380
|
/**
|
|
@@ -9562,7 +9564,7 @@ const ip = z(
|
|
|
9562
9564
|
}
|
|
9563
9565
|
};
|
|
9564
9566
|
new hs({ nodes: Gf, marks: Oi });
|
|
9565
|
-
class un extends
|
|
9567
|
+
class un extends P {
|
|
9566
9568
|
constructor(e) {
|
|
9567
9569
|
super(), this.config = e;
|
|
9568
9570
|
}
|
|
@@ -9595,7 +9597,7 @@ class Zf extends un {
|
|
|
9595
9597
|
getPlugins(e) {
|
|
9596
9598
|
return [
|
|
9597
9599
|
this.contribution(
|
|
9598
|
-
|
|
9600
|
+
Q({
|
|
9599
9601
|
"Mod-b": He(e.schema.marks.bold)
|
|
9600
9602
|
})
|
|
9601
9603
|
)
|
|
@@ -9617,7 +9619,7 @@ class Zf extends un {
|
|
|
9617
9619
|
];
|
|
9618
9620
|
}
|
|
9619
9621
|
}
|
|
9620
|
-
const
|
|
9622
|
+
const lp = L(Zf);
|
|
9621
9623
|
class Qf extends un {
|
|
9622
9624
|
constructor() {
|
|
9623
9625
|
super(...arguments), this.name = "RteItalicFeature", this.markName = "italic";
|
|
@@ -9634,7 +9636,7 @@ class Qf extends un {
|
|
|
9634
9636
|
getPlugins(e) {
|
|
9635
9637
|
return [
|
|
9636
9638
|
this.contribution(
|
|
9637
|
-
|
|
9639
|
+
Q({
|
|
9638
9640
|
"Mod-i": He(e.schema.marks.italic)
|
|
9639
9641
|
})
|
|
9640
9642
|
)
|
|
@@ -9656,7 +9658,7 @@ class Qf extends un {
|
|
|
9656
9658
|
];
|
|
9657
9659
|
}
|
|
9658
9660
|
}
|
|
9659
|
-
const
|
|
9661
|
+
const ap = L(Qf);
|
|
9660
9662
|
class eh extends un {
|
|
9661
9663
|
constructor() {
|
|
9662
9664
|
super(...arguments), this.name = "RteUnderlineFeature", this.markName = "underline";
|
|
@@ -9678,7 +9680,7 @@ class eh extends un {
|
|
|
9678
9680
|
getPlugins(e) {
|
|
9679
9681
|
return [
|
|
9680
9682
|
this.contribution(
|
|
9681
|
-
|
|
9683
|
+
Q({
|
|
9682
9684
|
"Mod-u": He(e.schema.marks.underline)
|
|
9683
9685
|
})
|
|
9684
9686
|
)
|
|
@@ -9700,7 +9702,7 @@ class eh extends un {
|
|
|
9700
9702
|
];
|
|
9701
9703
|
}
|
|
9702
9704
|
}
|
|
9703
|
-
const
|
|
9705
|
+
const cp = L(eh);
|
|
9704
9706
|
class th extends un {
|
|
9705
9707
|
constructor() {
|
|
9706
9708
|
super(...arguments), this.name = "RteStrikethroughFeature", this.markName = "strikethrough";
|
|
@@ -9722,7 +9724,7 @@ class th extends un {
|
|
|
9722
9724
|
getPlugins(e) {
|
|
9723
9725
|
return [
|
|
9724
9726
|
this.contribution(
|
|
9725
|
-
|
|
9727
|
+
Q({
|
|
9726
9728
|
"Alt-Shift-5": He(e.schema.marks.strikethrough),
|
|
9727
9729
|
"Cmd-Shift-X": He(e.schema.marks.strikethrough)
|
|
9728
9730
|
})
|
|
@@ -9745,7 +9747,7 @@ class th extends un {
|
|
|
9745
9747
|
];
|
|
9746
9748
|
}
|
|
9747
9749
|
}
|
|
9748
|
-
const
|
|
9750
|
+
const up = L(
|
|
9749
9751
|
th
|
|
9750
9752
|
), nh = "tt{font:var(--vvd-typography-base-code);font-variant-ligatures:unset;font-feature-settings:unset;font-size:unset;font-weight:unset;line-height:unset}";
|
|
9751
9753
|
class rh extends un {
|
|
@@ -9772,7 +9774,7 @@ class rh extends un {
|
|
|
9772
9774
|
getPlugins(e) {
|
|
9773
9775
|
return [
|
|
9774
9776
|
this.contribution(
|
|
9775
|
-
|
|
9777
|
+
Q({
|
|
9776
9778
|
// There is no common shortcut for monospace
|
|
9777
9779
|
// Using Mod + Shift + m to avoid common existing keybindings on Mod + m
|
|
9778
9780
|
"Mod-M": He(e.schema.marks.monospace)
|
|
@@ -9796,7 +9798,7 @@ class rh extends un {
|
|
|
9796
9798
|
];
|
|
9797
9799
|
}
|
|
9798
9800
|
}
|
|
9799
|
-
const
|
|
9801
|
+
const dp = L(rh);
|
|
9800
9802
|
function ih(r, e, t) {
|
|
9801
9803
|
for (let n = 0; n < e.length; n++) {
|
|
9802
9804
|
const { $from: i, $to: o } = e[n];
|
|
@@ -9806,7 +9808,7 @@ function ih(r, e, t) {
|
|
|
9806
9808
|
return !1;
|
|
9807
9809
|
}
|
|
9808
9810
|
const vr = Symbol("mixedColor");
|
|
9809
|
-
class oh extends
|
|
9811
|
+
class oh extends P {
|
|
9810
9812
|
constructor(e) {
|
|
9811
9813
|
if (super(), this.config = e, this.name = "RteTextColorPicker", e?.onBlocks) {
|
|
9812
9814
|
this.defaultColorForNode = {};
|
|
@@ -9931,7 +9933,7 @@ class oh extends F {
|
|
|
9931
9933
|
};
|
|
9932
9934
|
}
|
|
9933
9935
|
}
|
|
9934
|
-
const
|
|
9936
|
+
const fp = L(
|
|
9935
9937
|
oh
|
|
9936
9938
|
), sh = ".rich-text ul,.rich-text ol{padding-inline-start:1.5em}.rich-text li{list-style-position:inside}", Ir = (r) => r.parentOffset === 0, lh = (r) => r.nodeSize === 2, Lt = (r) => r.depth - 1, Xr = (r) => r.depth - 2, Ll = (r) => r.parent, Zr = (r) => r.node(Lt(r)), zl = (r) => r.depth > 2, Bl = (r, e) => r.index(e) === 0, ah = (r, e) => r.index(e) === r.node(e).childCount - 1, _l = (r, e) => {
|
|
9937
9939
|
const t = r.node(e), n = r.index(e);
|
|
@@ -9968,7 +9970,7 @@ const up = z(
|
|
|
9968
9970
|
e.node(Xr(e)).contentMatchAt(i + 1)
|
|
9969
9971
|
), s = Bl(e, Lt(e)), l = ah(e, Lt(e));
|
|
9970
9972
|
t.step(
|
|
9971
|
-
new
|
|
9973
|
+
new oe(
|
|
9972
9974
|
// Replace li
|
|
9973
9975
|
e.before() - (s ? 1 : 0),
|
|
9974
9976
|
e.after() + (l ? 1 : 0),
|
|
@@ -9997,7 +9999,7 @@ const up = z(
|
|
|
9997
9999
|
}, Hl = (r, e, t) => {
|
|
9998
10000
|
const n = _l(e, Lt(e))?.type === r, i = ch(e, Lt(e))?.type === r, o = n ? 1 : 0, s = i ? 1 : 0;
|
|
9999
10001
|
t.step(
|
|
10000
|
-
new
|
|
10002
|
+
new oe(
|
|
10001
10003
|
// Include open/close tag of adjacent lists for joining
|
|
10002
10004
|
e.before() - (n ? 1 : 0),
|
|
10003
10005
|
e.after() + (i ? 1 : 0),
|
|
@@ -10012,7 +10014,7 @@ const up = z(
|
|
|
10012
10014
|
);
|
|
10013
10015
|
}, fh = (r, e, t, n) => {
|
|
10014
10016
|
n.step(
|
|
10015
|
-
new
|
|
10017
|
+
new oe(
|
|
10016
10018
|
// Replace block
|
|
10017
10019
|
t.before(),
|
|
10018
10020
|
t.after(),
|
|
@@ -10035,7 +10037,7 @@ const up = z(
|
|
|
10035
10037
|
)
|
|
10036
10038
|
);
|
|
10037
10039
|
};
|
|
10038
|
-
class hh extends
|
|
10040
|
+
class hh extends P {
|
|
10039
10041
|
constructor(e) {
|
|
10040
10042
|
if (super(), this.config = e, this.name = "RteListFeature", !e.bulletList && !e.numberedList)
|
|
10041
10043
|
throw new Error(
|
|
@@ -10122,7 +10124,7 @@ class hh extends F {
|
|
|
10122
10124
|
};
|
|
10123
10125
|
return [
|
|
10124
10126
|
this.contribution(
|
|
10125
|
-
|
|
10127
|
+
Q({
|
|
10126
10128
|
Enter: i,
|
|
10127
10129
|
Backspace: o,
|
|
10128
10130
|
Tab: t,
|
|
@@ -10134,7 +10136,7 @@ class hh extends F {
|
|
|
10134
10136
|
"Mod-Shift-7": this.toggleList(e.schema.nodes.numberedList)
|
|
10135
10137
|
} : {}
|
|
10136
10138
|
}),
|
|
10137
|
-
|
|
10139
|
+
Qe.high
|
|
10138
10140
|
// Must apply before default handling of core
|
|
10139
10141
|
)
|
|
10140
10142
|
];
|
|
@@ -10221,7 +10223,7 @@ class hh extends F {
|
|
|
10221
10223
|
return rs(n, i).type.isInGroup("list") ? is(t, n, i, e) : !1;
|
|
10222
10224
|
}
|
|
10223
10225
|
}
|
|
10224
|
-
const
|
|
10226
|
+
const hp = L(hh), Qr = [
|
|
10225
10227
|
{
|
|
10226
10228
|
value: "left",
|
|
10227
10229
|
icon: "align-left-line",
|
|
@@ -10238,7 +10240,7 @@ const dp = z(hh), Qr = [
|
|
|
10238
10240
|
label: "right"
|
|
10239
10241
|
}
|
|
10240
10242
|
], ss = (r) => Qr.find((e) => e.value === r)?.value ?? "left";
|
|
10241
|
-
class ph extends
|
|
10243
|
+
class ph extends P {
|
|
10242
10244
|
constructor() {
|
|
10243
10245
|
super(...arguments), this.name = "RteAlignmentFeature";
|
|
10244
10246
|
}
|
|
@@ -10259,7 +10261,7 @@ class ph extends F {
|
|
|
10259
10261
|
getPlugins() {
|
|
10260
10262
|
return [
|
|
10261
10263
|
this.contribution(
|
|
10262
|
-
|
|
10264
|
+
Q({
|
|
10263
10265
|
"Mod-L": this.setAlignment("left"),
|
|
10264
10266
|
"Mod-E": this.setAlignment("center"),
|
|
10265
10267
|
"Mod-R": this.setAlignment("right")
|
|
@@ -10329,14 +10331,14 @@ class ph extends F {
|
|
|
10329
10331
|
};
|
|
10330
10332
|
}
|
|
10331
10333
|
}
|
|
10332
|
-
const
|
|
10334
|
+
const pp = L(ph), mh = ".link-popover{display:flex;flex-direction:column;padding:16px;gap:8px;inline-size:450px}.link-popover-header{display:flex;align-items:center;justify-content:space-between}.link-popover-label{color:var(--vvd-color-neutral-600);font:var(--vvd-typography-base-condensed)}.link-popover-content{display:flex;flex-direction:column;gap:16px}.link,.rich-text a[href],.link:visited,.rich-text a[href]:visited{color:var(--vvd-color-cta-600)}.link:hover,.rich-text a[href]:hover{color:var(--vvd-color-cta-500)}.link:active,.rich-text a[href]:active{color:var(--vvd-color-cta-400)}.link-action-bar{display:flex;justify-content:end;gap:8px}.link-toolbar-menu{display:flex;flex-direction:column;padding:8px;gap:16px;inline-size:368px}", ls = "(?:https?://|www\\.)[^\\s<]+";
|
|
10333
10335
|
function as(r, e, t, n) {
|
|
10334
10336
|
if (r.doc.rangeHasMark(t, t + 1, r.schema.marks.link))
|
|
10335
10337
|
return null;
|
|
10336
10338
|
const i = e.replace(/[.,;:!?) ]+$/, ""), o = i.startsWith("www.") ? `https://${i}` : i, s = r.schema.marks.link.create({ href: o }), l = t + i.length, a = e.slice(i.length), c = r.tr.addMark(t, l, s);
|
|
10337
10339
|
return a && c.replaceWith(l, n, r.schema.text(a)), c;
|
|
10338
10340
|
}
|
|
10339
|
-
class gh extends
|
|
10341
|
+
class gh extends P {
|
|
10340
10342
|
constructor() {
|
|
10341
10343
|
super(...arguments), this.name = "RteLinkFeature", this.removeLink = (e, t) => {
|
|
10342
10344
|
const n = e.tr, i = this.getCurrentLink(e);
|
|
@@ -10379,7 +10381,7 @@ class gh extends F {
|
|
|
10379
10381
|
},
|
|
10380
10382
|
// A higher priority will ensure links are serialized to a single <a> element over other marks
|
|
10381
10383
|
// E.g. <a>my <b>bold</b> link</a> instead of <a>my </a><b><a>bold</a></b><a> link</a>
|
|
10382
|
-
|
|
10384
|
+
Qe.high
|
|
10383
10385
|
)
|
|
10384
10386
|
];
|
|
10385
10387
|
}
|
|
@@ -10390,7 +10392,7 @@ class gh extends F {
|
|
|
10390
10392
|
const e = new RegExp(`${ls}$`);
|
|
10391
10393
|
return [
|
|
10392
10394
|
this.contribution({
|
|
10393
|
-
rule: new
|
|
10395
|
+
rule: new nt(
|
|
10394
10396
|
new RegExp(`${ls} $`),
|
|
10395
10397
|
(t, n, i, o) => as(t, n[0], i, o)
|
|
10396
10398
|
),
|
|
@@ -10503,7 +10505,7 @@ class gh extends F {
|
|
|
10503
10505
|
})
|
|
10504
10506
|
),
|
|
10505
10507
|
this.contribution(
|
|
10506
|
-
|
|
10508
|
+
Q({
|
|
10507
10509
|
"Mod-k": t
|
|
10508
10510
|
})
|
|
10509
10511
|
)
|
|
@@ -10633,7 +10635,7 @@ class gh extends F {
|
|
|
10633
10635
|
};
|
|
10634
10636
|
}
|
|
10635
10637
|
}
|
|
10636
|
-
const
|
|
10638
|
+
const mp = L(gh), bh = ".inline-image-wrapper{display:inline-block;vertical-align:text-bottom}.inline-image{display:block;block-size:auto}.inline-image-popover{display:flex;align-items:center;padding:8px;gap:4px}.inline-image-placeholder{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base);font-feature-settings:normal;font-variant-ligatures:normal;overflow-wrap:normal;pointer-events:none;white-space:normal}", cs = (r) => r !== null && !!r.next;
|
|
10637
10639
|
let yh = 1;
|
|
10638
10640
|
const kh = () => yh++;
|
|
10639
10641
|
class Sh {
|
|
@@ -10699,7 +10701,7 @@ class Sh {
|
|
|
10699
10701
|
this.setContent(null);
|
|
10700
10702
|
}
|
|
10701
10703
|
}
|
|
10702
|
-
class Th extends
|
|
10704
|
+
class Th extends P {
|
|
10703
10705
|
constructor(e = {}) {
|
|
10704
10706
|
super(), this.config = e, this.name = "RteInlineImageFeature";
|
|
10705
10707
|
}
|
|
@@ -10862,14 +10864,14 @@ class Th extends F {
|
|
|
10862
10864
|
return i !== null && n === this.calculateSmallWidth(i) ? "small" : n === "100%" ? "fit" : n === null ? "original" : null;
|
|
10863
10865
|
}
|
|
10864
10866
|
}
|
|
10865
|
-
const
|
|
10867
|
+
const gp = L(Th), Ch = async (r) => {
|
|
10866
10868
|
try {
|
|
10867
10869
|
return { type: "ok", result: await r };
|
|
10868
10870
|
} catch (e) {
|
|
10869
10871
|
return { type: "error", error: e };
|
|
10870
10872
|
}
|
|
10871
10873
|
};
|
|
10872
|
-
class Mh extends
|
|
10874
|
+
class Mh extends P {
|
|
10873
10875
|
constructor(e) {
|
|
10874
10876
|
super(), this.config = e, this.name = "RteFileHandlerFeature";
|
|
10875
10877
|
}
|
|
@@ -10977,8 +10979,8 @@ class Mh extends F {
|
|
|
10977
10979
|
];
|
|
10978
10980
|
}
|
|
10979
10981
|
}
|
|
10980
|
-
const
|
|
10981
|
-
class xh extends
|
|
10982
|
+
const bp = L(Mh);
|
|
10983
|
+
class xh extends P {
|
|
10982
10984
|
constructor(e) {
|
|
10983
10985
|
super(), this.config = e, this.name = "RteDebugFeature";
|
|
10984
10986
|
}
|
|
@@ -11023,14 +11025,14 @@ class xh extends F {
|
|
|
11023
11025
|
}
|
|
11024
11026
|
}
|
|
11025
11027
|
}),
|
|
11026
|
-
|
|
11028
|
+
Qe.high
|
|
11027
11029
|
// Needs to run before dropcursor
|
|
11028
11030
|
)
|
|
11029
11031
|
];
|
|
11030
11032
|
}
|
|
11031
11033
|
}
|
|
11032
|
-
const
|
|
11033
|
-
class Oh extends
|
|
11034
|
+
const yp = L(xh);
|
|
11035
|
+
class Oh extends P {
|
|
11034
11036
|
constructor(e, t) {
|
|
11035
11037
|
super(), this.featureId = e, this.options = t, this.name = `RteToolbarButtonFeature[${e}]`;
|
|
11036
11038
|
}
|
|
@@ -11062,7 +11064,7 @@ class Oh extends F {
|
|
|
11062
11064
|
}
|
|
11063
11065
|
}
|
|
11064
11066
|
}
|
|
11065
|
-
const
|
|
11067
|
+
const kp = L(
|
|
11066
11068
|
Oh
|
|
11067
11069
|
), Eh = (r) => r !== null && typeof r == "object" && "next" in r;
|
|
11068
11070
|
class wh {
|
|
@@ -11079,7 +11081,7 @@ class wh {
|
|
|
11079
11081
|
while (!n.done);
|
|
11080
11082
|
}
|
|
11081
11083
|
}
|
|
11082
|
-
class Dh extends
|
|
11084
|
+
class Dh extends P {
|
|
11083
11085
|
constructor(e, t = {}) {
|
|
11084
11086
|
super(), this.atomName = e, this.config = t, this.name = `RteAtomFeature[${e}]`;
|
|
11085
11087
|
}
|
|
@@ -11139,8 +11141,8 @@ class Dh extends F {
|
|
|
11139
11141
|
];
|
|
11140
11142
|
}
|
|
11141
11143
|
}
|
|
11142
|
-
const
|
|
11143
|
-
class Nh extends
|
|
11144
|
+
const Sp = L(Dh);
|
|
11145
|
+
class Nh extends P {
|
|
11144
11146
|
constructor(e, t) {
|
|
11145
11147
|
super(), this.featureId = e, this.options = t, this.name = `RteInputRuleFeature[${e}]`;
|
|
11146
11148
|
}
|
|
@@ -11153,7 +11155,7 @@ class Nh extends F {
|
|
|
11153
11155
|
T.fromJSON(e.schema, d)
|
|
11154
11156
|
) : null;
|
|
11155
11157
|
}, i = this.options.matchAfterWhitespace ? new RegExp(`${t} $`) : new RegExp(`${t}$`), s = {
|
|
11156
|
-
rule: new
|
|
11158
|
+
rule: new nt(i, n)
|
|
11157
11159
|
};
|
|
11158
11160
|
return this.options.matchAfterWhitespace && (s.enterHandler = {
|
|
11159
11161
|
regex: new RegExp(`${t}$`),
|
|
@@ -11161,8 +11163,25 @@ class Nh extends F {
|
|
|
11161
11163
|
}), [this.contribution(s)];
|
|
11162
11164
|
}
|
|
11163
11165
|
}
|
|
11164
|
-
const
|
|
11165
|
-
function
|
|
11166
|
+
const Tp = L(Nh);
|
|
11167
|
+
function Ah(r, e) {
|
|
11168
|
+
return r.length === 0 ? (t, n) => r() : (t, n) => r(e);
|
|
11169
|
+
}
|
|
11170
|
+
class vh extends P {
|
|
11171
|
+
constructor(e, t) {
|
|
11172
|
+
super(), this.featureId = e, this.options = t, this.name = `RteKeyboardShortcutsFeature[${e}]`;
|
|
11173
|
+
}
|
|
11174
|
+
getPlugins(e) {
|
|
11175
|
+
const t = {};
|
|
11176
|
+
for (const [n, i] of Object.entries(this.options.shortcuts))
|
|
11177
|
+
t[n] = Ah(i, e.facade);
|
|
11178
|
+
return [this.contribution(Q(t), Qe.high)];
|
|
11179
|
+
}
|
|
11180
|
+
}
|
|
11181
|
+
const Cp = L(
|
|
11182
|
+
vh
|
|
11183
|
+
), Ih = ".suggest-popover{display:flex;flex-direction:column;padding:4px;gap:2px;max-block-size:408px;max-inline-size:248px;min-inline-size:128px}.suggest-loading-widget{display:inline-flex;align-items:center;margin-inline-start:2px;vertical-align:middle;white-space:normal}.suggest-empty-message{display:flex;align-items:center;justify-content:center;color:var(--vvd-color-neutral-300);font:var(--vvd-typography-base);min-block-size:40px;text-align:center}.suggest-item--visible-focus{box-shadow:0 0 0 4px color-mix(in srgb,var(--focus-stroke-color, var(--vvd-color-cta-500)),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent}", ei = (r) => !!(r?.suggestions && !r.dismissed), Pr = (r) => ei(r) && r.suggestions.items.length > 0;
|
|
11184
|
+
function Rh(r, e) {
|
|
11166
11185
|
const { $cursor: t } = r.selection;
|
|
11167
11186
|
if (!t) return null;
|
|
11168
11187
|
const n = Fl(t), i = e.exec(n);
|
|
@@ -11175,7 +11194,7 @@ function vh(r, e) {
|
|
|
11175
11194
|
end: o + i.index + i[0].length
|
|
11176
11195
|
};
|
|
11177
11196
|
}
|
|
11178
|
-
const
|
|
11197
|
+
const Ph = (r, e, t) => {
|
|
11179
11198
|
const { state: n } = r;
|
|
11180
11199
|
r.dispatch(Dd(n.tr));
|
|
11181
11200
|
const i = r.state.tr;
|
|
@@ -11187,13 +11206,13 @@ const Ih = (r, e, t) => {
|
|
|
11187
11206
|
const o = i.mapping.map(e.end);
|
|
11188
11207
|
i.setSelection(E.create(i.doc, o)), r.dispatch(i.scrollIntoView());
|
|
11189
11208
|
};
|
|
11190
|
-
class
|
|
11209
|
+
class Fh extends P {
|
|
11191
11210
|
constructor(e, t) {
|
|
11192
11211
|
super(), this.featureId = e, this.options = t, this.pluginKey = new ci("suggest"), this.loadGeneration = 0, this.name = `RteSuggestFeature[${e}]`;
|
|
11193
11212
|
}
|
|
11194
11213
|
selectSuggestion(e, t, n) {
|
|
11195
11214
|
const i = this.options.select(n);
|
|
11196
|
-
|
|
11215
|
+
Ph(e, t.match, i), e.focus();
|
|
11197
11216
|
}
|
|
11198
11217
|
async startLoadingSuggestions(e, t) {
|
|
11199
11218
|
const n = ++this.loadGeneration, i = await this.options.load(e);
|
|
@@ -11204,7 +11223,7 @@ class Rh extends F {
|
|
|
11204
11223
|
});
|
|
11205
11224
|
}
|
|
11206
11225
|
getStyles() {
|
|
11207
|
-
return [this.contribution(
|
|
11226
|
+
return [this.contribution(Ih)];
|
|
11208
11227
|
}
|
|
11209
11228
|
getPlugins(e) {
|
|
11210
11229
|
const t = (o) => e.state.tr.setMeta(this.pluginKey, o), n = (o) => e.dispatchTransaction(t(o)), i = new W({
|
|
@@ -11212,7 +11231,7 @@ class Rh extends F {
|
|
|
11212
11231
|
state: {
|
|
11213
11232
|
init: () => null,
|
|
11214
11233
|
apply: (o, s, l, a) => {
|
|
11215
|
-
const c =
|
|
11234
|
+
const c = Rh(a, this.options.pattern);
|
|
11216
11235
|
if (!c || !s && !o.docChanged)
|
|
11217
11236
|
return null;
|
|
11218
11237
|
if (s?.dismissed)
|
|
@@ -11367,7 +11386,7 @@ class Rh extends F {
|
|
|
11367
11386
|
return [
|
|
11368
11387
|
this.contribution(i),
|
|
11369
11388
|
this.contribution(
|
|
11370
|
-
|
|
11389
|
+
Q({
|
|
11371
11390
|
ArrowUp: (o, s) => {
|
|
11372
11391
|
const l = this.pluginKey.getState(o);
|
|
11373
11392
|
return Pr(l) ? (s?.(
|
|
@@ -11404,12 +11423,12 @@ class Rh extends F {
|
|
|
11404
11423
|
}
|
|
11405
11424
|
}),
|
|
11406
11425
|
// Higher priority to intercept before default handlers
|
|
11407
|
-
|
|
11426
|
+
Qe.high
|
|
11408
11427
|
)
|
|
11409
11428
|
];
|
|
11410
11429
|
}
|
|
11411
11430
|
}
|
|
11412
|
-
const
|
|
11431
|
+
const Mp = L(Fh), Lh = fs(
|
|
11413
11432
|
"rich-text-editor",
|
|
11414
11433
|
Pl,
|
|
11415
11434
|
Mf,
|
|
@@ -11431,34 +11450,35 @@ const Sp = z(Rh), Ph = fs(
|
|
|
11431
11450
|
delegatesFocus: !0
|
|
11432
11451
|
}
|
|
11433
11452
|
}
|
|
11434
|
-
),
|
|
11435
|
-
|
|
11453
|
+
), zh = na(
|
|
11454
|
+
Lh
|
|
11436
11455
|
);
|
|
11437
|
-
|
|
11456
|
+
zh();
|
|
11438
11457
|
export {
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11447
|
-
|
|
11458
|
+
pp as RteAlignmentFeature,
|
|
11459
|
+
Sp as RteAtomFeature,
|
|
11460
|
+
tp as RteBase,
|
|
11461
|
+
lp as RteBoldFeature,
|
|
11462
|
+
ep as RteConfig,
|
|
11463
|
+
yp as RteDropHandlerFeature,
|
|
11464
|
+
bp as RteFileHandlerFeature,
|
|
11465
|
+
sp as RteFontSizePickerFeature,
|
|
11466
|
+
op as RteHardBreakFeature,
|
|
11448
11467
|
mf as RteHtmlParser,
|
|
11449
11468
|
yf as RteHtmlSerializer,
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11469
|
+
gp as RteInlineImageFeature,
|
|
11470
|
+
Tp as RteInputRuleFeature,
|
|
11471
|
+
ap as RteItalicFeature,
|
|
11472
|
+
Cp as RteKeyboardShortcutsFeature,
|
|
11473
|
+
mp as RteLinkFeature,
|
|
11474
|
+
hp as RteListFeature,
|
|
11475
|
+
dp as RteMonospaceFeature,
|
|
11476
|
+
ip as RtePlaceholderFeature,
|
|
11477
|
+
up as RteStrikethroughFeature,
|
|
11478
|
+
Mp as RteSuggestFeature,
|
|
11479
|
+
np as RteTextBlockPickerFeature,
|
|
11480
|
+
fp as RteTextColorPickerFeature,
|
|
11481
|
+
kp as RteToolbarButtonFeature,
|
|
11482
|
+
rp as RteToolbarFeature,
|
|
11483
|
+
cp as RteUnderlineFeature
|
|
11464
11484
|
};
|