reactjs-tiptap-editor 1.0.26 → 1.0.28
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/lib/{ActionMenuButton-B4KDkZ0z.js → ActionMenuButton-BhiGvRJ7.js} +1 -1
- package/lib/{ActionMenuButton-C3Cfeza9.cjs → ActionMenuButton-qUxkZlQg.cjs} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +27 -27
- package/lib/Blockquote.cjs +3 -3
- package/lib/Blockquote.js +251 -244
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +2 -2
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +2 -2
- package/lib/Callout-B9uXfbP3.js +340 -0
- package/lib/Callout-C_TXsss3.cjs +1 -0
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +8 -222
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +2 -2
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +2 -2
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.js +2 -2
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +2 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +3 -3
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +2 -2
- package/lib/{Drawer-D7E9kTca.cjs → Drawer-D3B4lQJF.cjs} +1 -1
- package/lib/{Drawer-DA0FLHs9.js → Drawer-h401Yy6Y.js} +20 -20
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +168 -135
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +5 -5
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +2 -2
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +2 -2
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +5 -5
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +5 -5
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.js +2 -2
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +10 -10
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +3 -3
- package/lib/History.cjs +2 -2
- package/lib/History.js +584 -531
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +2 -2
- package/lib/{Iframe-DZ3r3QzK.js → Iframe-Dhn40BXx.js} +3 -3
- package/lib/{Iframe-OMVd0xa_.cjs → Iframe-bvGuzYwC.cjs} +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +9 -6
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +19 -19
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +15 -15
- package/lib/{Indent-kI4G-clX.js → Indent-BK9DvCL7.js} +2 -2
- package/lib/{Indent-QgCoonRk.cjs → Indent-IOByomps.cjs} +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +2 -2
- package/lib/{Katex-BPbXjcZQ.js → Katex-C_Ah9G9w.js} +7 -6
- package/lib/Katex-oLGrtLTf.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +3 -3
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +4 -4
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-Z7RRurvx.cjs → LinkEditBlock-BojxdGTm.cjs} +2 -2
- package/lib/{LinkEditBlock-BYWwH2_x.js → LinkEditBlock-DRdKXffy.js} +39 -35
- package/lib/MarkdownPaste.cjs +1 -1
- package/lib/MarkdownPaste.js +1 -1
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +4 -4
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +62 -61
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +5 -5
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +2 -2
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +8 -8
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +7 -7
- package/lib/{SlashCommandNodeView-DPPmYEjC.cjs → SlashCommandNodeView-Dai-O3aD.cjs} +1 -1
- package/lib/{SlashCommandNodeView-C0l3Fb_3.js → SlashCommandNodeView-qwW9cuYt.js} +6 -6
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +2 -2
- package/lib/{Table-DwseaFSD.js → Table-BKM8SvVj.js} +20 -20
- package/lib/{Table-D5G3rfwb.cjs → Table-CWI7tKme.cjs} +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +2 -2
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +3 -3
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +3 -3
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +2 -2
- package/lib/{Twitter-q4ZGZL0i.cjs → Twitter-BfsPzA8_.cjs} +1 -1
- package/lib/{Twitter-DP26Lkn8.js → Twitter-CofLQ-zj.js} +9 -9
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +5 -5
- package/lib/bubble.cjs +6 -6
- package/lib/bubble.js +2258 -2552
- package/lib/{clsx-DRbkQ4T7.cjs → clsx-DJURdKPs.cjs} +2 -2
- package/lib/{clsx-_bq4MQQ7.js → clsx-b_2OwHLk.js} +19 -19
- package/lib/{dropdown-menu-CURWpB9o.cjs → dropdown-menu-CEMxzgnU.cjs} +1 -1
- package/lib/{dropdown-menu-BKSX4gvT.js → dropdown-menu-CKAKsyqu.js} +1 -1
- package/lib/extensions/Column/Column.d.ts +10 -2
- package/lib/extensions/Image/Image.d.ts +13 -1
- package/lib/index-BJQ1G8B1.js +311 -0
- package/lib/index-BO82_0q8.cjs +1 -0
- package/lib/{index-DQy9iBzV.js → index-Bn_WPziX.js} +1 -1
- package/lib/{index-BpLw6ebr.cjs → index-CwbGrQFa.cjs} +1 -1
- package/lib/{index-DtyAGMbq.js → index-DKruDABV.js} +1 -1
- package/lib/{index-SEMQrdk2.cjs → index-DN-IR-K0.cjs} +1 -1
- package/lib/{index-C52cuQ_Y.js → index-DRcwHivm.js} +1415 -1350
- package/lib/index-DUeBQoIA.cjs +1 -0
- package/lib/{index-Dbm_Mans.js → index-DeoYYWEA.js} +1 -1
- package/lib/{index-CHVV5iY-.cjs → index-Dgs2thVL.cjs} +1 -1
- package/lib/{index-BaR0Brts.js → index-DjB2kNdz.js} +171 -166
- package/lib/{index-CJMI7Fjf.js → index-DuWMq-Qs.js} +1 -1
- package/lib/{index-BGfIcDCQ.cjs → index-EoGU7W4e.cjs} +1 -1
- package/lib/{index-CDw4Eszh.cjs → index-MDz4NZcT.cjs} +9 -9
- package/lib/{index-Dx-Dh7KS.js → index-n4kM0Ll-.js} +110 -105
- package/lib/{index-BgNKVyMW.cjs → index-qZURFC5Q.cjs} +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.js +12 -12
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +1 -1
- package/lib/{popover-BB-ZDnqk.js → popover-Beieacfy.js} +1 -1
- package/lib/{popover-CrywEkBR.cjs → popover-Bl1kxRJX.cjs} +1 -1
- package/lib/{renderNodeView-5h3-p80E.cjs → renderNodeView-BIgT6Ghg.cjs} +1 -1
- package/lib/{renderNodeView-DoKZ4GYy.js → renderNodeView-Bi58v3DZ.js} +2 -2
- package/lib/{separator-BGO9AZp4.cjs → separator-DMLtkcoo.cjs} +1 -1
- package/lib/{separator-DuuOJRQd.js → separator-DfvK668q.js} +14 -14
- package/lib/style.css +1 -1
- package/lib/textarea-DV9Fw3y1.cjs +1 -0
- package/lib/textarea-GXaWJbm9.js +20 -0
- package/lib/theme.cjs +1 -1
- package/lib/theme.js +1 -1
- package/lib/{updatePosition-CFTYKYNJ.js → updatePosition-DY1jI7qb.js} +2 -2
- package/lib/{updatePosition-B1oRJE1x.cjs → updatePosition-D_D-TbEu.cjs} +1 -1
- package/package.json +62 -61
- package/lib/Katex-CUofhjB5.cjs +0 -4
- package/lib/index-BG0kQamI.js +0 -285
- package/lib/index-NsYff_Ni.cjs +0 -1
- package/lib/index-aujjnfSJ.cjs +0 -1
|
@@ -237,15 +237,15 @@ class w {
|
|
|
237
237
|
*/
|
|
238
238
|
findIndex(e) {
|
|
239
239
|
if (e == 0)
|
|
240
|
-
return
|
|
240
|
+
return ve(0, e);
|
|
241
241
|
if (e == this.size)
|
|
242
|
-
return
|
|
242
|
+
return ve(this.content.length, e);
|
|
243
243
|
if (e > this.size || e < 0)
|
|
244
244
|
throw new RangeError(`Position ${e} outside of fragment (${this})`);
|
|
245
245
|
for (let t = 0, n = 0; ; t++) {
|
|
246
246
|
let i = this.child(t), s = n + i.nodeSize;
|
|
247
247
|
if (s >= e)
|
|
248
|
-
return s == e ?
|
|
248
|
+
return s == e ? ve(t + 1, s) : ve(t, n);
|
|
249
249
|
n = s;
|
|
250
250
|
}
|
|
251
251
|
}
|
|
@@ -311,7 +311,7 @@ class w {
|
|
|
311
311
|
}
|
|
312
312
|
w.empty = new w([], 0);
|
|
313
313
|
const Le = { index: 0, offset: 0 };
|
|
314
|
-
function
|
|
314
|
+
function ve(r, e) {
|
|
315
315
|
return Le.index = r, Le.offset = e, Le;
|
|
316
316
|
}
|
|
317
317
|
function Ke(r, e) {
|
|
@@ -796,13 +796,13 @@ class Qe {
|
|
|
796
796
|
for (let i in e.marks) {
|
|
797
797
|
let s = e.marks[i].spec.parseDOM;
|
|
798
798
|
s && s.forEach((o) => {
|
|
799
|
-
n(o =
|
|
799
|
+
n(o = vt(o)), o.mark || o.ignore || o.clearMark || (o.mark = i);
|
|
800
800
|
});
|
|
801
801
|
}
|
|
802
802
|
for (let i in e.nodes) {
|
|
803
803
|
let s = e.nodes[i].spec.parseDOM;
|
|
804
804
|
s && s.forEach((o) => {
|
|
805
|
-
n(o =
|
|
805
|
+
n(o = vt(o)), o.node || o.ignore || o.mark || (o.node = i);
|
|
806
806
|
});
|
|
807
807
|
}
|
|
808
808
|
return t;
|
|
@@ -860,7 +860,7 @@ const Ht = {
|
|
|
860
860
|
function wt(r, e, t) {
|
|
861
861
|
return e != null ? (e ? pe : 0) | (e === "full" ? Ge : 0) : r && r.whitespace == "pre" ? pe | Ge : t & ~he;
|
|
862
862
|
}
|
|
863
|
-
class
|
|
863
|
+
class xe {
|
|
864
864
|
constructor(e, t, n, i, s, o) {
|
|
865
865
|
this.type = e, this.attrs = t, this.marks = n, this.solid = i, this.options = o, this.content = [], this.activeMarks = F.none, this.match = s || (o & he ? null : e.contentMatch);
|
|
866
866
|
}
|
|
@@ -897,7 +897,7 @@ class kt {
|
|
|
897
897
|
constructor(e, t, n) {
|
|
898
898
|
this.parser = e, this.options = t, this.isOpen = n, this.open = 0, this.localPreserveWS = !1;
|
|
899
899
|
let i = t.topNode, s, o = wt(null, t.preserveWhitespace, 0) | (n ? he : 0);
|
|
900
|
-
i ? s = new
|
|
900
|
+
i ? s = new xe(i.type, i.attrs, F.none, !0, t.topMatch || i.type.contentMatch, o) : n ? s = new xe(null, null, F.none, !0, null, o) : s = new xe(e.schema.topNodeType, null, F.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
|
|
901
901
|
}
|
|
902
902
|
get top() {
|
|
903
903
|
return this.nodes[this.open];
|
|
@@ -1062,7 +1062,7 @@ class kt {
|
|
|
1062
1062
|
s.match && (s.match = s.match.matchType(e.type));
|
|
1063
1063
|
let o = F.none;
|
|
1064
1064
|
for (let l of i.concat(e.marks))
|
|
1065
|
-
(s.type ? s.type.allowsMarkType(l.type) :
|
|
1065
|
+
(s.type ? s.type.allowsMarkType(l.type) : xt(l.type, e.type)) && (o = l.addToSet(o));
|
|
1066
1066
|
return s.content.push(e.mark(o)), !0;
|
|
1067
1067
|
}
|
|
1068
1068
|
return !1;
|
|
@@ -1081,7 +1081,7 @@ class kt {
|
|
|
1081
1081
|
let l = wt(e, s, o.options);
|
|
1082
1082
|
o.options & he && o.content.length == 0 && (l |= he);
|
|
1083
1083
|
let a = F.none;
|
|
1084
|
-
return n = n.filter((c) => (o.type ? o.type.allowsMarkType(c.type) :
|
|
1084
|
+
return n = n.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : xt(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new xe(e, t, a, i, null, l)), this.open++, n;
|
|
1085
1085
|
}
|
|
1086
1086
|
// Make sure all nodes above this.open are finished and added to
|
|
1087
1087
|
// their parents
|
|
@@ -1184,13 +1184,13 @@ function Gn(r) {
|
|
|
1184
1184
|
function Zn(r, e) {
|
|
1185
1185
|
return (r.matches || r.msMatchesSelector || r.webkitMatchesSelector || r.mozMatchesSelector).call(r, e);
|
|
1186
1186
|
}
|
|
1187
|
-
function
|
|
1187
|
+
function vt(r) {
|
|
1188
1188
|
let e = {};
|
|
1189
1189
|
for (let t in r)
|
|
1190
1190
|
e[t] = r[t];
|
|
1191
1191
|
return e;
|
|
1192
1192
|
}
|
|
1193
|
-
function
|
|
1193
|
+
function xt(r, e) {
|
|
1194
1194
|
let t = e.schema.nodes;
|
|
1195
1195
|
for (let n in t) {
|
|
1196
1196
|
let i = t[n];
|
|
@@ -2483,10 +2483,10 @@ function kr(r, e, t) {
|
|
|
2483
2483
|
return !0;
|
|
2484
2484
|
return !1;
|
|
2485
2485
|
}
|
|
2486
|
-
function
|
|
2486
|
+
function vr(r) {
|
|
2487
2487
|
return r.spec.defining || r.spec.definingForContent;
|
|
2488
2488
|
}
|
|
2489
|
-
function
|
|
2489
|
+
function xr(r, e, t, n) {
|
|
2490
2490
|
if (!n.size)
|
|
2491
2491
|
return r.deleteRange(e, t);
|
|
2492
2492
|
let i = r.doc.resolve(e), s = r.doc.resolve(t);
|
|
@@ -2510,7 +2510,7 @@ function vr(r, e, t, n) {
|
|
|
2510
2510
|
d = p.content;
|
|
2511
2511
|
}
|
|
2512
2512
|
for (let d = f - 1; d >= 0; d--) {
|
|
2513
|
-
let h = c[d], p =
|
|
2513
|
+
let h = c[d], p = vr(h.type);
|
|
2514
2514
|
if (p && !h.sameMarkup(i.node(Math.abs(l) - 1)))
|
|
2515
2515
|
f = d;
|
|
2516
2516
|
else if (p || !h.type.isTextblock)
|
|
@@ -2522,8 +2522,8 @@ function vr(r, e, t, n) {
|
|
|
2522
2522
|
for (let m = 0; m < o.length; m++) {
|
|
2523
2523
|
let g = o[(m + a) % o.length], y = !0;
|
|
2524
2524
|
g < 0 && (y = !1, g = -g);
|
|
2525
|
-
let
|
|
2526
|
-
if (
|
|
2525
|
+
let v = i.node(g - 1), x = i.index(g - 1);
|
|
2526
|
+
if (v.canReplaceWith(x, x, p.type, p.marks))
|
|
2527
2527
|
return r.replace(i.before(g), y ? s.after(g) : t, new k(nn(n.content, 0, n.openStart, h), h, n.openEnd));
|
|
2528
2528
|
}
|
|
2529
2529
|
}
|
|
@@ -2778,7 +2778,7 @@ class Mr {
|
|
|
2778
2778
|
control over what happens.
|
|
2779
2779
|
*/
|
|
2780
2780
|
replaceRange(e, t, n) {
|
|
2781
|
-
return
|
|
2781
|
+
return xr(this, e, t, n), this;
|
|
2782
2782
|
}
|
|
2783
2783
|
/**
|
|
2784
2784
|
Replace the given range with a node, but use `from` and `to` as
|
|
@@ -3681,10 +3681,10 @@ function wn(r, e, t, n) {
|
|
|
3681
3681
|
if (h.canReplace(h.childCount, h.childCount, m.content)) {
|
|
3682
3682
|
if (t) {
|
|
3683
3683
|
let y = w.empty;
|
|
3684
|
-
for (let
|
|
3685
|
-
y = w.from(p[
|
|
3686
|
-
let
|
|
3687
|
-
t(
|
|
3684
|
+
for (let x = p.length - 1; x >= 0; x--)
|
|
3685
|
+
y = w.from(p[x].copy(y));
|
|
3686
|
+
let v = r.tr.step(new A(e.pos - p.length, e.pos + s.nodeSize, e.pos + g, e.pos + s.nodeSize - g, new k(y, p.length, 0), 0, !0));
|
|
3687
|
+
t(v.scrollIntoView());
|
|
3688
3688
|
}
|
|
3689
3689
|
return !0;
|
|
3690
3690
|
}
|
|
@@ -3835,7 +3835,7 @@ var Ur = Object.defineProperty, dt = (r, e) => {
|
|
|
3835
3835
|
for (var t in e)
|
|
3836
3836
|
Ur(r, t, { get: e[t], enumerable: !0 });
|
|
3837
3837
|
};
|
|
3838
|
-
function
|
|
3838
|
+
function vn(r) {
|
|
3839
3839
|
const { state: e, transaction: t } = r;
|
|
3840
3840
|
let { selection: n } = t, { doc: i } = t, { storedMarks: s } = t;
|
|
3841
3841
|
return {
|
|
@@ -3911,7 +3911,7 @@ var Kr = class {
|
|
|
3911
3911
|
tr: r,
|
|
3912
3912
|
editor: n,
|
|
3913
3913
|
view: s,
|
|
3914
|
-
state:
|
|
3914
|
+
state: vn({
|
|
3915
3915
|
state: i,
|
|
3916
3916
|
transaction: r
|
|
3917
3917
|
}),
|
|
@@ -3927,8 +3927,8 @@ var Kr = class {
|
|
|
3927
3927
|
};
|
|
3928
3928
|
return o;
|
|
3929
3929
|
}
|
|
3930
|
-
},
|
|
3931
|
-
dt(
|
|
3930
|
+
}, xn = {};
|
|
3931
|
+
dt(xn, {
|
|
3932
3932
|
blur: () => Xr,
|
|
3933
3933
|
clearContent: () => Yr,
|
|
3934
3934
|
clearNodes: () => Qr,
|
|
@@ -3948,13 +3948,13 @@ dt(vn, {
|
|
|
3948
3948
|
insertContent: () => gi,
|
|
3949
3949
|
insertContentAt: () => ki,
|
|
3950
3950
|
joinBackward: () => bi,
|
|
3951
|
-
joinDown: () =>
|
|
3951
|
+
joinDown: () => xi,
|
|
3952
3952
|
joinForward: () => Si,
|
|
3953
3953
|
joinItemBackward: () => Mi,
|
|
3954
3954
|
joinItemForward: () => Ei,
|
|
3955
3955
|
joinTextblockBackward: () => Ci,
|
|
3956
3956
|
joinTextblockForward: () => Ti,
|
|
3957
|
-
joinUp: () =>
|
|
3957
|
+
joinUp: () => vi,
|
|
3958
3958
|
keyboardShortcut: () => Ii,
|
|
3959
3959
|
lift: () => Ri,
|
|
3960
3960
|
liftEmptyBlock: () => Ni,
|
|
@@ -3984,8 +3984,8 @@ dt(vn, {
|
|
|
3984
3984
|
toggleWrap: () => ys,
|
|
3985
3985
|
undoInputRule: () => ws,
|
|
3986
3986
|
unsetAllMarks: () => ks,
|
|
3987
|
-
unsetMark: () =>
|
|
3988
|
-
unsetTextDirection: () =>
|
|
3987
|
+
unsetMark: () => vs,
|
|
3988
|
+
unsetTextDirection: () => xs,
|
|
3989
3989
|
updateAttributes: () => bs,
|
|
3990
3990
|
wrapIn: () => Ss,
|
|
3991
3991
|
wrapInList: () => Ms
|
|
@@ -4063,11 +4063,16 @@ var ni = (r) => ({ tr: e, state: t, dispatch: n }) => {
|
|
|
4063
4063
|
const n = Nt(r, t, "left"), i = Nt(e, t, "right");
|
|
4064
4064
|
return { from: n, to: i };
|
|
4065
4065
|
}, oi = () => ({ state: r, dispatch: e }) => {
|
|
4066
|
-
const { $from: t, $to: n } = r.selection;
|
|
4067
4066
|
if (r.selection.empty)
|
|
4068
4067
|
return !1;
|
|
4069
|
-
|
|
4070
|
-
|
|
4068
|
+
if (e) {
|
|
4069
|
+
const t = r.tr, { ranges: n } = r.selection, i = t.steps.length;
|
|
4070
|
+
n.forEach((s) => {
|
|
4071
|
+
const o = t.mapping.slice(i), l = t.doc.resolve(o.map(s.$from.pos)), a = t.doc.resolve(o.map(s.$to.pos)), { from: c, to: f } = si(l, a, r.schema);
|
|
4072
|
+
t.deleteRange(c, f);
|
|
4073
|
+
}), t.scrollIntoView(), e(t);
|
|
4074
|
+
}
|
|
4075
|
+
return !0;
|
|
4071
4076
|
}, li = () => ({ commands: r }) => r.keyboardShortcut("Enter"), ai = () => ({ state: r, dispatch: e }) => zr(r, e);
|
|
4072
4077
|
function ci(r) {
|
|
4073
4078
|
return Object.prototype.toString.call(r) === "[object RegExp]";
|
|
@@ -4342,13 +4347,13 @@ var wi = (r) => !("type" in r), ki = (r, e, t) => ({ tr: n, dispatch: i, editor:
|
|
|
4342
4347
|
n.insertText(m, f, u);
|
|
4343
4348
|
} else {
|
|
4344
4349
|
m = l;
|
|
4345
|
-
const g = n.doc.resolve(f), y = g.node(),
|
|
4346
|
-
|
|
4350
|
+
const g = n.doc.resolve(f), y = g.node(), v = g.parentOffset === 0, x = y.isText || y.isTextblock, S = y.content.size > 0;
|
|
4351
|
+
v && x && S && h && (f = Math.max(0, f - 1)), n.replaceWith(f, u, m);
|
|
4347
4352
|
}
|
|
4348
4353
|
t.updateSelection && yi(n, n.steps.length - 1, -1), t.applyInputRules && n.setMeta("applyInputRules", { from: f, text: m }), t.applyPasteRules && n.setMeta("applyPasteRules", { from: f, text: m });
|
|
4349
4354
|
}
|
|
4350
4355
|
return !0;
|
|
4351
|
-
},
|
|
4356
|
+
}, vi = () => ({ state: r, dispatch: e }) => Ir(r, e), xi = () => ({ state: r, dispatch: e }) => Rr(r, e), bi = () => ({ state: r, dispatch: e }) => cn(r, e), Si = () => ({ state: r, dispatch: e }) => hn(r, e), Mi = () => ({ state: r, dispatch: e, tr: t }) => {
|
|
4352
4357
|
try {
|
|
4353
4358
|
const n = Ne(r.doc, r.selection.$from.pos, -1);
|
|
4354
4359
|
return n == null ? !1 : (t.join(n, 2), e && e(t), !0);
|
|
@@ -4768,12 +4773,12 @@ function nt(r, e, t = {}) {
|
|
|
4768
4773
|
return !1;
|
|
4769
4774
|
if (!m.isText && !m.marks.length)
|
|
4770
4775
|
return;
|
|
4771
|
-
const y = Math.max(h, g),
|
|
4772
|
-
o +=
|
|
4776
|
+
const y = Math.max(h, g), v = Math.min(p, g + m.nodeSize), x = v - y;
|
|
4777
|
+
o += x, l.push(
|
|
4773
4778
|
...m.marks.map((S) => ({
|
|
4774
4779
|
mark: S,
|
|
4775
4780
|
from: y,
|
|
4776
|
-
to:
|
|
4781
|
+
to: v
|
|
4777
4782
|
}))
|
|
4778
4783
|
);
|
|
4779
4784
|
});
|
|
@@ -5023,10 +5028,10 @@ var us = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
|
|
|
5023
5028
|
return !1;
|
|
5024
5029
|
if (i) {
|
|
5025
5030
|
let y = ie.empty;
|
|
5026
|
-
const
|
|
5027
|
-
for (let O = a.depth -
|
|
5031
|
+
const v = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
|
|
5032
|
+
for (let O = a.depth - v; O >= a.depth - 3; O -= 1)
|
|
5028
5033
|
y = ie.from(a.node(O).copy(y));
|
|
5029
|
-
const
|
|
5034
|
+
const x = (
|
|
5030
5035
|
// oxlint-disable-next-line no-nested-ternary
|
|
5031
5036
|
a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3
|
|
5032
5037
|
), S = {
|
|
@@ -5034,8 +5039,8 @@ var us = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
|
|
|
5034
5039
|
...e
|
|
5035
5040
|
}, b = ((o = l.contentMatch.defaultType) == null ? void 0 : o.createAndFill(S)) || void 0;
|
|
5036
5041
|
y = y.append(ie.from(l.createAndFill(null, b) || void 0));
|
|
5037
|
-
const I = a.before(a.depth - (
|
|
5038
|
-
t.replace(I, a.after(-
|
|
5042
|
+
const I = a.before(a.depth - (v - 1));
|
|
5043
|
+
t.replace(I, a.after(-x), new Ln(y, 4 - v, 0));
|
|
5039
5044
|
let R = -1;
|
|
5040
5045
|
t.doc.nodesBetween(I, t.doc.content.size, (O, L) => {
|
|
5041
5046
|
if (R > -1)
|
|
@@ -5060,10 +5065,10 @@ var us = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
|
|
|
5060
5065
|
if (!K(t.doc, a.pos, 2))
|
|
5061
5066
|
return !1;
|
|
5062
5067
|
if (i) {
|
|
5063
|
-
const { selection: y, storedMarks:
|
|
5068
|
+
const { selection: y, storedMarks: v } = n, { splittableMarks: x } = s.extensionManager, S = v || y.$to.parentOffset && y.$from.marks();
|
|
5064
5069
|
if (t.split(a.pos, 2, g).scrollIntoView(), !S || !i)
|
|
5065
5070
|
return !0;
|
|
5066
|
-
const b = S.filter((I) =>
|
|
5071
|
+
const b = S.filter((I) => x.includes(I.type.name));
|
|
5067
5072
|
t.ensureMarks(b);
|
|
5068
5073
|
}
|
|
5069
5074
|
return !0;
|
|
@@ -5101,13 +5106,13 @@ function hs(r) {
|
|
|
5101
5106
|
return J.between(n, i);
|
|
5102
5107
|
}
|
|
5103
5108
|
var ps = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: f }) => {
|
|
5104
|
-
const { extensions: u, splittableMarks: d } = i.extensionManager, h = N(r, o.schema), p = N(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to:
|
|
5105
|
-
if (!
|
|
5109
|
+
const { extensions: u, splittableMarks: d } = i.extensionManager, h = N(r, o.schema), p = N(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: v } = m, x = y.blockRange(v), S = g || m.$to.parentOffset && m.$from.marks();
|
|
5110
|
+
if (!x)
|
|
5106
5111
|
return !1;
|
|
5107
5112
|
const b = Pe((_) => Ve(_.type.name, u))(m), I = m.from === 0 && m.to === o.doc.content.size, R = o.doc.content.content, O = R.length === 1 ? R[0] : null, L = I && O && Ve(O.type.name, u) ? {
|
|
5108
5113
|
node: O,
|
|
5109
5114
|
pos: 0
|
|
5110
|
-
} : null, H = b ?? L, De = !!b &&
|
|
5115
|
+
} : null, H = b ?? L, De = !!b && x.depth >= 1 && x.depth - b.depth <= 1, fe = !!L;
|
|
5111
5116
|
if ((De || fe) && H) {
|
|
5112
5117
|
if (H.node.type === h)
|
|
5113
5118
|
return I && fe ? a().command(({ tr: _, dispatch: B }) => {
|
|
@@ -5166,7 +5171,7 @@ var ps = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain:
|
|
|
5166
5171
|
});
|
|
5167
5172
|
}
|
|
5168
5173
|
return !0;
|
|
5169
|
-
},
|
|
5174
|
+
}, vs = (r, e = {}) => ({ tr: t, state: n, dispatch: i }) => {
|
|
5170
5175
|
var s;
|
|
5171
5176
|
const { extendEmptyMarkRange: o = !1 } = e, { selection: l } = t, a = ee(r, n.schema), { $from: c, empty: f, ranges: u } = l;
|
|
5172
5177
|
if (!i)
|
|
@@ -5180,7 +5185,7 @@ var ps = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain:
|
|
|
5180
5185
|
t.removeMark(d.$from.pos, d.$to.pos, a);
|
|
5181
5186
|
});
|
|
5182
5187
|
return t.removeStoredMark(a), !0;
|
|
5183
|
-
},
|
|
5188
|
+
}, xs = (r) => ({ tr: e, state: t, dispatch: n }) => {
|
|
5184
5189
|
const { selection: i } = t;
|
|
5185
5190
|
let s, o;
|
|
5186
5191
|
return typeof r == "number" ? (s = r, o = r) : r && "from" in r && "to" in r ? (s = r.from, o = r.to) : (s = i.from, o = i.to), n && e.doc.nodesBetween(s, o, (l, a) => {
|
|
@@ -5208,14 +5213,14 @@ var ps = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain:
|
|
|
5208
5213
|
y < f && s && s === g.type && (a = !0, p = Math.max(y, f), m = Math.min(y + g.nodeSize, u), d = y, h = g), y >= f && y <= u && (s && s === g.type && (a = !0, i && t.setNodeMarkup(y, void 0, {
|
|
5209
5214
|
...g.attrs,
|
|
5210
5215
|
...e
|
|
5211
|
-
})), o && g.marks.length && g.marks.forEach((
|
|
5212
|
-
if (o ===
|
|
5213
|
-
const
|
|
5216
|
+
})), o && g.marks.length && g.marks.forEach((v) => {
|
|
5217
|
+
if (o === v.type && (a = !0, i)) {
|
|
5218
|
+
const x = Math.max(y, f), S = Math.min(y + g.nodeSize, u);
|
|
5214
5219
|
t.addMark(
|
|
5215
|
-
|
|
5220
|
+
x,
|
|
5216
5221
|
S,
|
|
5217
5222
|
o.create({
|
|
5218
|
-
...
|
|
5223
|
+
...v.attrs,
|
|
5219
5224
|
...e
|
|
5220
5225
|
})
|
|
5221
5226
|
);
|
|
@@ -5367,7 +5372,7 @@ function Ts(r) {
|
|
|
5367
5372
|
if (!p)
|
|
5368
5373
|
return;
|
|
5369
5374
|
const m = p[1] || "", g = n(m);
|
|
5370
|
-
if (!o.find((
|
|
5375
|
+
if (!o.find((v) => !(v in g)))
|
|
5371
5376
|
return {
|
|
5372
5377
|
type: e,
|
|
5373
5378
|
raw: p[0],
|
|
@@ -5422,7 +5427,7 @@ function As(r) {
|
|
|
5422
5427
|
const m = new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`), g = u.match(m);
|
|
5423
5428
|
if (!g)
|
|
5424
5429
|
return;
|
|
5425
|
-
const [y,
|
|
5430
|
+
const [y, v = ""] = g, x = i(v);
|
|
5426
5431
|
let S = 1;
|
|
5427
5432
|
const b = y.length;
|
|
5428
5433
|
let I = "";
|
|
@@ -5456,7 +5461,7 @@ function As(r) {
|
|
|
5456
5461
|
return {
|
|
5457
5462
|
type: e,
|
|
5458
5463
|
raw: _,
|
|
5459
|
-
attributes:
|
|
5464
|
+
attributes: x,
|
|
5460
5465
|
content: I,
|
|
5461
5466
|
tokens: B
|
|
5462
5467
|
};
|
|
@@ -5536,20 +5541,20 @@ function Ns(r) {
|
|
|
5536
5541
|
), g = d.match(m);
|
|
5537
5542
|
if (!g)
|
|
5538
5543
|
return;
|
|
5539
|
-
let y = "",
|
|
5544
|
+
let y = "", v = "";
|
|
5540
5545
|
if (l) {
|
|
5541
5546
|
const [, S] = g;
|
|
5542
|
-
|
|
5547
|
+
v = S;
|
|
5543
5548
|
} else {
|
|
5544
5549
|
const [, S, b] = g;
|
|
5545
|
-
|
|
5550
|
+
v = S, y = b || "";
|
|
5546
5551
|
}
|
|
5547
|
-
const
|
|
5552
|
+
const x = i(v.trim());
|
|
5548
5553
|
return {
|
|
5549
5554
|
type: e,
|
|
5550
5555
|
raw: g[0],
|
|
5551
5556
|
content: y.trim(),
|
|
5552
|
-
attributes:
|
|
5557
|
+
attributes: x
|
|
5553
5558
|
};
|
|
5554
5559
|
}
|
|
5555
5560
|
},
|
|
@@ -5602,14 +5607,14 @@ function zs(r, e, t) {
|
|
|
5602
5607
|
else
|
|
5603
5608
|
break;
|
|
5604
5609
|
}
|
|
5605
|
-
let
|
|
5606
|
-
const
|
|
5607
|
-
if (
|
|
5608
|
-
const b =
|
|
5610
|
+
let v;
|
|
5611
|
+
const x = y.slice(1);
|
|
5612
|
+
if (x.length > 0) {
|
|
5613
|
+
const b = x.map((I) => I.slice(m + u)).join(`
|
|
5609
5614
|
`);
|
|
5610
|
-
b.trim() && (e.customNestedParser ?
|
|
5615
|
+
b.trim() && (e.customNestedParser ? v = e.customNestedParser(b) : v = t.blockTokens(b));
|
|
5611
5616
|
}
|
|
5612
|
-
const S = e.createToken(p,
|
|
5617
|
+
const S = e.createToken(p, v);
|
|
5613
5618
|
a.push(S);
|
|
5614
5619
|
}
|
|
5615
5620
|
if (a.length !== 0)
|
|
@@ -5785,7 +5790,7 @@ var q = class Pn extends yt {
|
|
|
5785
5790
|
name: "commands",
|
|
5786
5791
|
addCommands() {
|
|
5787
5792
|
return {
|
|
5788
|
-
...
|
|
5793
|
+
...xn
|
|
5789
5794
|
};
|
|
5790
5795
|
}
|
|
5791
5796
|
}), Ds = q.create({
|
|
@@ -5827,19 +5832,19 @@ var q = class Pn extends yt {
|
|
|
5827
5832
|
f.steps.forEach((h, p) => {
|
|
5828
5833
|
var m, g;
|
|
5829
5834
|
if (h instanceof W) {
|
|
5830
|
-
const y = d.slice(p).map(h.from, -1),
|
|
5835
|
+
const y = d.slice(p).map(h.from, -1), v = d.slice(p).map(h.to), x = d.invert().map(y, -1), S = d.invert().map(v), b = y > 0 ? (m = f.doc.nodeAt(y - 1)) == null ? void 0 : m.marks.some((R) => R.eq(h.mark)) : !1, I = (g = f.doc.nodeAt(v)) == null ? void 0 : g.marks.some((R) => R.eq(h.mark));
|
|
5831
5836
|
this.editor.emit("delete", {
|
|
5832
5837
|
type: "mark",
|
|
5833
5838
|
mark: h.mark,
|
|
5834
5839
|
from: h.from,
|
|
5835
5840
|
to: h.to,
|
|
5836
5841
|
deletedRange: {
|
|
5837
|
-
from:
|
|
5842
|
+
from: x,
|
|
5838
5843
|
to: S
|
|
5839
5844
|
},
|
|
5840
5845
|
newRange: {
|
|
5841
5846
|
from: y,
|
|
5842
|
-
to:
|
|
5847
|
+
to: v
|
|
5843
5848
|
},
|
|
5844
5849
|
partial: !!(I || b),
|
|
5845
5850
|
editor: this.editor,
|
|
@@ -5973,7 +5978,7 @@ var q = class Pn extends yt {
|
|
|
5973
5978
|
const { empty: s, from: o, to: l } = e.selection, a = re.atStart(e.doc).from, c = re.atEnd(e.doc).to;
|
|
5974
5979
|
if (s || !(o === a && l === c) || !In(t.doc))
|
|
5975
5980
|
return;
|
|
5976
|
-
const d = t.tr, h =
|
|
5981
|
+
const d = t.tr, h = vn({
|
|
5977
5982
|
state: t,
|
|
5978
5983
|
transaction: d
|
|
5979
5984
|
}), { commands: p } = new Kr({
|
|
@@ -6089,7 +6094,7 @@ function ko(r) {
|
|
|
6089
6094
|
undoable: r.undoable
|
|
6090
6095
|
});
|
|
6091
6096
|
}
|
|
6092
|
-
function
|
|
6097
|
+
function vo(r) {
|
|
6093
6098
|
return new Be({
|
|
6094
6099
|
find: r.find,
|
|
6095
6100
|
handler: ({ state: e, range: t, match: n }) => {
|
|
@@ -6114,7 +6119,7 @@ function xo(r) {
|
|
|
6114
6119
|
undoable: r.undoable
|
|
6115
6120
|
});
|
|
6116
6121
|
}
|
|
6117
|
-
function
|
|
6122
|
+
function xo(r) {
|
|
6118
6123
|
return new Be({
|
|
6119
6124
|
find: r.find,
|
|
6120
6125
|
handler: ({ state: e, range: t, match: n }) => {
|
|
@@ -6467,13 +6472,13 @@ var Vs = (r) => "touches" in r, So = class {
|
|
|
6467
6472
|
return;
|
|
6468
6473
|
let u = 0, d = 0;
|
|
6469
6474
|
if (this.dom !== f) {
|
|
6470
|
-
const
|
|
6471
|
-
u =
|
|
6475
|
+
const v = this.dom.getBoundingClientRect(), x = f.getBoundingClientRect(), S = (i = r.offsetX) != null ? i : (n = r.nativeEvent) == null ? void 0 : n.offsetX, b = (o = r.offsetY) != null ? o : (s = r.nativeEvent) == null ? void 0 : s.offsetY;
|
|
6476
|
+
u = x.x - v.x + S, d = x.y - v.y + b;
|
|
6472
6477
|
}
|
|
6473
6478
|
const h = this.dom.cloneNode(!0);
|
|
6474
6479
|
try {
|
|
6475
|
-
const
|
|
6476
|
-
h.style.width = `${Math.round(
|
|
6480
|
+
const v = this.dom.getBoundingClientRect();
|
|
6481
|
+
h.style.width = `${Math.round(v.width)}px`, h.style.height = `${Math.round(v.height)}px`, h.style.boxSizing = "border-box", h.style.pointerEvents = "none";
|
|
6477
6482
|
} catch {
|
|
6478
6483
|
}
|
|
6479
6484
|
let p = null;
|
|
@@ -6597,7 +6602,7 @@ function To(r) {
|
|
|
6597
6602
|
});
|
|
6598
6603
|
}
|
|
6599
6604
|
export {
|
|
6600
|
-
|
|
6605
|
+
qi as $,
|
|
6601
6606
|
j as A,
|
|
6602
6607
|
_i as B,
|
|
6603
6608
|
es as C,
|
|
@@ -6609,33 +6614,33 @@ export {
|
|
|
6609
6614
|
no as I,
|
|
6610
6615
|
po as J,
|
|
6611
6616
|
Gs as K,
|
|
6612
|
-
|
|
6617
|
+
go as L,
|
|
6613
6618
|
wo as M,
|
|
6614
6619
|
Mo as N,
|
|
6615
|
-
|
|
6620
|
+
Be as O,
|
|
6616
6621
|
$n as P,
|
|
6617
|
-
|
|
6618
|
-
|
|
6622
|
+
Ys as Q,
|
|
6623
|
+
Qs as R,
|
|
6619
6624
|
E as S,
|
|
6620
6625
|
P as T,
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6626
|
+
Ie as U,
|
|
6627
|
+
V,
|
|
6628
|
+
ke as W,
|
|
6629
|
+
ho as X,
|
|
6630
|
+
In as Y,
|
|
6631
|
+
Er as Z,
|
|
6632
|
+
Mr as _,
|
|
6628
6633
|
eo as a,
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6634
|
+
Eo as a0,
|
|
6635
|
+
ao as a1,
|
|
6636
|
+
To as a2,
|
|
6637
|
+
pt as a3,
|
|
6638
|
+
to as a4,
|
|
6639
|
+
Yi as a5,
|
|
6640
|
+
ln as a6,
|
|
6641
|
+
io as a7,
|
|
6642
|
+
co as a8,
|
|
6643
|
+
ts as a9,
|
|
6639
6644
|
So as aa,
|
|
6640
6645
|
oo as b,
|
|
6641
6646
|
so as c,
|
|
@@ -6649,13 +6654,13 @@ export {
|
|
|
6649
6654
|
Pe as k,
|
|
6650
6655
|
uo as l,
|
|
6651
6656
|
Xi as m,
|
|
6652
|
-
|
|
6657
|
+
vo as n,
|
|
6653
6658
|
lo as o,
|
|
6654
6659
|
zs as p,
|
|
6655
6660
|
Ve as q,
|
|
6656
6661
|
Os as r,
|
|
6657
6662
|
yo as s,
|
|
6658
|
-
|
|
6663
|
+
xo as t,
|
|
6659
6664
|
M as u,
|
|
6660
6665
|
k as v,
|
|
6661
6666
|
bo as w,
|