reactjs-tiptap-editor 1.0.18 → 1.0.19
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-BOjCHFTA.js → ActionMenuButton-B1Nfn5Hm.js} +1 -1
- package/lib/{ActionMenuButton-Df077oOH.cjs → ActionMenuButton-D3b_bcin.cjs} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +23 -23
- package/lib/Blockquote.cjs +3 -3
- package/lib/Blockquote.js +33 -28
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +16 -10
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +2 -2
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +21 -22
- 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 +37 -37
- package/lib/CodeBlock.js +15 -16
- 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-DxOoRiGQ.js → Drawer-B1-7Y4HB.js} +3 -3
- package/lib/{Drawer-DwrlY_lY.cjs → Drawer-kEO7KzzC.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +12 -12
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +17 -17
- 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 +4 -4
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +4 -4
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +9 -9
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +3 -3
- package/lib/History.cjs +1 -1
- package/lib/History.js +5 -3
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +2 -2
- package/lib/{Iframe-C6pBw-AF.cjs → Iframe-Bk5OIlvy.cjs} +1 -1
- package/lib/{Iframe-AhNV5WH5.js → Iframe-XlAb03_r.js} +7 -7
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +6 -5
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +36 -36
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +13 -13
- package/lib/{Indent-Do-X0AsY.cjs → Indent-XaZNTsOk.cjs} +1 -1
- package/lib/{Indent-DZ5PcJA4.js → Indent-ruPuj5xn.js} +2 -2
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +24 -18
- package/lib/Katex-BFIYLrwm.cjs +4 -0
- package/lib/{Katex-bIgoenn_.js → Katex-DKspCn-p.js} +5 -6
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +3 -3
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +3 -3
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-D_cF9fnc.js → LinkEditBlock-BWm2Ypt2.js} +26 -26
- package/lib/{LinkEditBlock-B0ZaACZO.cjs → LinkEditBlock-DhesHreq.cjs} +1 -1
- 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 +41 -42
- 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 +6 -6
- package/lib/{SlashCommandNodeView-Ba03hlVZ.cjs → SlashCommandNodeView-CojfS61Q.cjs} +1 -1
- package/lib/{SlashCommandNodeView-cg0x3NRF.js → SlashCommandNodeView-Hf2DX4km.js} +6 -6
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +2 -2
- package/lib/{Table-KqLiT5wG.js → Table-BTkFUATL.js} +4 -4
- package/lib/{Table-ddU2LSc6.cjs → Table-C1_xLqV0.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-BIiR78Jh.cjs → Twitter-Cj-0yyQQ.cjs} +1 -1
- package/lib/{Twitter-C1Lzqc7u.js → Twitter-D5mUTILj.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 +4 -4
- package/lib/bubble.cjs +6 -6
- package/lib/bubble.js +1835 -1634
- package/lib/{clsx-BWE7vnna.cjs → clsx-BSBE1eoY.cjs} +1 -1
- package/lib/{clsx-eGVyq7ot.js → clsx-OumA9x-8.js} +1 -1
- package/lib/{dropdown-menu-CexIkt_V.js → dropdown-menu-Bragdu5m.js} +1 -1
- package/lib/{dropdown-menu-oSKIntXM.cjs → dropdown-menu-CUeq1boX.cjs} +1 -1
- package/lib/extensions/Image/Image.d.ts +1 -0
- package/lib/{index-D_8P0LE5.js → index-B-7eHzaO.js} +1 -1
- package/lib/{index-RIXs7STX.js → index-BKlbc8Qo.js} +1 -1
- package/lib/index-BLrMslr7.cjs +1 -0
- package/lib/{index-mfGK4pFo.js → index-BVRHx_ha.js} +94 -90
- package/lib/{index-DHUN85fV.js → index-CDFAs4RT.js} +1149 -1019
- package/lib/{index-CJ9pyCM4.cjs → index-CMLwKzI0.cjs} +1 -1
- package/lib/index-COCTP78Y.cjs +12 -0
- package/lib/{index-BnW6t8z6.js → index-CZ1_8JQQ.js} +1 -1
- package/lib/{index-D0lc95kr.cjs → index-CnePcUeF.cjs} +1 -1
- package/lib/{index-DUpSE1Gb.cjs → index-D7wfvzJg.cjs} +1 -1
- package/lib/{index-zig3Dj7A.cjs → index-DwSnESy-.cjs} +7 -5
- package/lib/{index-C6xmkxrQ.js → index-cPEuL4Zr.js} +140 -138
- package/lib/index.cjs +1 -1
- package/lib/index.js +12 -12
- package/lib/{popover-BYSZ3zBi.js → popover-C2BbhsXH.js} +1 -1
- package/lib/{popover-BcHDZqBt.cjs → popover-DCJpsZx0.cjs} +1 -1
- package/lib/{renderNodeView-BrM5kUj_.js → renderNodeView-CmnUEfby.js} +2 -2
- package/lib/{renderNodeView-D1zydtli.cjs → renderNodeView-DQjWzXDA.cjs} +1 -1
- package/lib/{separator-BmixLrnJ.cjs → separator-BuG1zwKa.cjs} +1 -1
- package/lib/{separator-CFKVxAea.js → separator-lkMWuUvf.js} +14 -14
- package/lib/{updatePosition-CfmY5Trk.cjs → updatePosition-D6AScA-1.cjs} +1 -1
- package/lib/{updatePosition-CBRjbQMH.js → updatePosition-DYuAiqx-.js} +2 -2
- package/package.json +1 -1
- package/lib/Katex-CIC9ygbL.cjs +0 -4
- package/lib/index-BUTn2LY6.cjs +0 -1
- package/lib/index-BtxvYLJ1.cjs +0 -12
- package/lib/select-C5SHDLFj.js +0 -120
- package/lib/select-DHjzKkcu.cjs +0 -1
- package/lib/textarea-CasDcv3u.cjs +0 -1
- package/lib/textarea-DNLrJoRl.js +0 -20
|
@@ -1318,10 +1318,10 @@ function kt(r) {
|
|
|
1318
1318
|
function Be(r) {
|
|
1319
1319
|
return r.document || window.document;
|
|
1320
1320
|
}
|
|
1321
|
-
const
|
|
1321
|
+
const vt = /* @__PURE__ */ new WeakMap();
|
|
1322
1322
|
function Xn(r) {
|
|
1323
|
-
let e =
|
|
1324
|
-
return e === void 0 &&
|
|
1323
|
+
let e = vt.get(r);
|
|
1324
|
+
return e === void 0 && vt.set(r, e = Yn(r)), e;
|
|
1325
1325
|
}
|
|
1326
1326
|
function Yn(r) {
|
|
1327
1327
|
let e = null;
|
|
@@ -1383,7 +1383,7 @@ const Wt = 65535, Jt = Math.pow(2, 16);
|
|
|
1383
1383
|
function Qn(r, e) {
|
|
1384
1384
|
return r + e * Jt;
|
|
1385
1385
|
}
|
|
1386
|
-
function
|
|
1386
|
+
function xt(r) {
|
|
1387
1387
|
return r & Wt;
|
|
1388
1388
|
}
|
|
1389
1389
|
function Zn(r) {
|
|
@@ -1440,7 +1440,7 @@ class $ {
|
|
|
1440
1440
|
@internal
|
|
1441
1441
|
*/
|
|
1442
1442
|
recover(e) {
|
|
1443
|
-
let t = 0, n =
|
|
1443
|
+
let t = 0, n = xt(e);
|
|
1444
1444
|
if (!this.inverted)
|
|
1445
1445
|
for (let i = 0; i < n; i++)
|
|
1446
1446
|
t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
|
|
@@ -1477,7 +1477,7 @@ class $ {
|
|
|
1477
1477
|
@internal
|
|
1478
1478
|
*/
|
|
1479
1479
|
touches(e, t) {
|
|
1480
|
-
let n = 0, i =
|
|
1480
|
+
let n = 0, i = xt(t), s = this.inverted ? 2 : 1, o = this.inverted ? 1 : 2;
|
|
1481
1481
|
for (let l = 0; l < this.ranges.length; l += 3) {
|
|
1482
1482
|
let a = this.ranges[l] - (this.inverted ? n : 0);
|
|
1483
1483
|
if (a > e)
|
|
@@ -2514,8 +2514,8 @@ function gr(r, e, t, n) {
|
|
|
2514
2514
|
for (let m = 0; m < o.length; m++) {
|
|
2515
2515
|
let g = o[(m + a) % o.length], y = !0;
|
|
2516
2516
|
g < 0 && (y = !1, g = -g);
|
|
2517
|
-
let
|
|
2518
|
-
if (
|
|
2517
|
+
let v = i.node(g - 1), x = i.index(g - 1);
|
|
2518
|
+
if (v.canReplaceWith(x, x, p.type, p.marks))
|
|
2519
2519
|
return r.replace(i.before(g), y ? s.after(g) : t, new k(Yt(n.content, 0, n.openStart, h), h, n.openEnd));
|
|
2520
2520
|
}
|
|
2521
2521
|
}
|
|
@@ -2897,7 +2897,7 @@ class E {
|
|
|
2897
2897
|
`$head`.
|
|
2898
2898
|
*/
|
|
2899
2899
|
constructor(e, t, n) {
|
|
2900
|
-
this.$anchor = e, this.$head = t, this.ranges = n || [new
|
|
2900
|
+
this.$anchor = e, this.$head = t, this.ranges = n || [new vr(e.min(t), e.max(t))];
|
|
2901
2901
|
}
|
|
2902
2902
|
/**
|
|
2903
2903
|
The selection's anchor, as an unresolved position.
|
|
@@ -3055,7 +3055,7 @@ class E {
|
|
|
3055
3055
|
}
|
|
3056
3056
|
}
|
|
3057
3057
|
E.prototype.visible = !0;
|
|
3058
|
-
class
|
|
3058
|
+
class vr {
|
|
3059
3059
|
/**
|
|
3060
3060
|
Create a range.
|
|
3061
3061
|
*/
|
|
@@ -3243,11 +3243,11 @@ class F extends E {
|
|
|
3243
3243
|
return e instanceof F;
|
|
3244
3244
|
}
|
|
3245
3245
|
getBookmark() {
|
|
3246
|
-
return
|
|
3246
|
+
return xr;
|
|
3247
3247
|
}
|
|
3248
3248
|
}
|
|
3249
3249
|
E.jsonID("all", F);
|
|
3250
|
-
const
|
|
3250
|
+
const xr = {
|
|
3251
3251
|
map() {
|
|
3252
3252
|
return this;
|
|
3253
3253
|
},
|
|
@@ -3287,33 +3287,33 @@ function Et(r, e, t) {
|
|
|
3287
3287
|
function Ct(r, e) {
|
|
3288
3288
|
return !e || !r ? r : r.bind(e);
|
|
3289
3289
|
}
|
|
3290
|
-
class
|
|
3290
|
+
class ve {
|
|
3291
3291
|
constructor(e, t, n) {
|
|
3292
3292
|
this.name = e, this.init = Ct(t.init, n), this.apply = Ct(t.apply, n);
|
|
3293
3293
|
}
|
|
3294
3294
|
}
|
|
3295
|
-
new
|
|
3295
|
+
new ve("doc", {
|
|
3296
3296
|
init(r) {
|
|
3297
3297
|
return r.doc || r.schema.topNodeType.createAndFill();
|
|
3298
3298
|
},
|
|
3299
3299
|
apply(r) {
|
|
3300
3300
|
return r.doc;
|
|
3301
3301
|
}
|
|
3302
|
-
}), new
|
|
3302
|
+
}), new ve("selection", {
|
|
3303
3303
|
init(r, e) {
|
|
3304
3304
|
return r.selection || E.atStart(e.doc);
|
|
3305
3305
|
},
|
|
3306
3306
|
apply(r) {
|
|
3307
3307
|
return r.selection;
|
|
3308
3308
|
}
|
|
3309
|
-
}), new
|
|
3309
|
+
}), new ve("storedMarks", {
|
|
3310
3310
|
init(r) {
|
|
3311
3311
|
return r.storedMarks || null;
|
|
3312
3312
|
},
|
|
3313
3313
|
apply(r, e, t, n) {
|
|
3314
3314
|
return n.selection.$cursor ? r.storedMarks : null;
|
|
3315
3315
|
}
|
|
3316
|
-
}), new
|
|
3316
|
+
}), new ve("scrollToSelection", {
|
|
3317
3317
|
init() {
|
|
3318
3318
|
return 0;
|
|
3319
3319
|
},
|
|
@@ -3658,10 +3658,10 @@ function un(r, e, t, n) {
|
|
|
3658
3658
|
if (h.canReplace(h.childCount, h.childCount, m.content)) {
|
|
3659
3659
|
if (t) {
|
|
3660
3660
|
let y = w.empty;
|
|
3661
|
-
for (let
|
|
3662
|
-
y = w.from(p[
|
|
3663
|
-
let
|
|
3664
|
-
t(
|
|
3661
|
+
for (let x = p.length - 1; x >= 0; x--)
|
|
3662
|
+
y = w.from(p[x].copy(y));
|
|
3663
|
+
let v = r.tr.step(new I(e.pos - p.length, e.pos + s.nodeSize, e.pos + g, e.pos + s.nodeSize - g, new k(y, p.length, 0), 0, !0));
|
|
3664
|
+
t(v.scrollIntoView());
|
|
3665
3665
|
}
|
|
3666
3666
|
return !0;
|
|
3667
3667
|
}
|
|
@@ -3930,7 +3930,7 @@ ct(pn, {
|
|
|
3930
3930
|
joinItemBackward: () => yi,
|
|
3931
3931
|
joinItemForward: () => wi,
|
|
3932
3932
|
joinTextblockBackward: () => ki,
|
|
3933
|
-
joinTextblockForward: () =>
|
|
3933
|
+
joinTextblockForward: () => vi,
|
|
3934
3934
|
joinUp: () => hi,
|
|
3935
3935
|
keyboardShortcut: () => bi,
|
|
3936
3936
|
lift: () => Si,
|
|
@@ -4144,7 +4144,7 @@ var li = (r = null, e = {}) => ({ editor: t, view: n, tr: i, dispatch: s }) => {
|
|
|
4144
4144
|
}
|
|
4145
4145
|
return r;
|
|
4146
4146
|
};
|
|
4147
|
-
function
|
|
4147
|
+
function xe(r) {
|
|
4148
4148
|
if (typeof window > "u")
|
|
4149
4149
|
throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");
|
|
4150
4150
|
const e = `<body>${r}</body>`, t = new window.DOMParser().parseFromString(e, "text/html").body;
|
|
@@ -4191,13 +4191,13 @@ function pe(r, e, t) {
|
|
|
4191
4191
|
}
|
|
4192
4192
|
})
|
|
4193
4193
|
});
|
|
4194
|
-
if (t.slice ? $e.fromSchema(a).parseSlice(
|
|
4194
|
+
if (t.slice ? $e.fromSchema(a).parseSlice(xe(r), t.parseOptions) : $e.fromSchema(a).parse(xe(r), t.parseOptions), t.errorOnInvalidContent && o)
|
|
4195
4195
|
throw new Error("[tiptap error]: Invalid HTML content", {
|
|
4196
4196
|
cause: new Error(`Invalid element found: ${l}`)
|
|
4197
4197
|
});
|
|
4198
4198
|
}
|
|
4199
4199
|
const s = $e.fromSchema(e);
|
|
4200
|
-
return t.slice ? s.parseSlice(
|
|
4200
|
+
return t.slice ? s.parseSlice(xe(r), t.parseOptions).content : s.parse(xe(r), t.parseOptions);
|
|
4201
4201
|
}
|
|
4202
4202
|
return pe("", e, t);
|
|
4203
4203
|
}
|
|
@@ -4274,8 +4274,8 @@ var ui = (r) => !("type" in r), di = (r, e, t) => ({ tr: n, dispatch: i, editor:
|
|
|
4274
4274
|
n.insertText(m, f, u);
|
|
4275
4275
|
} else {
|
|
4276
4276
|
m = l;
|
|
4277
|
-
const g = n.doc.resolve(f), y = g.node(),
|
|
4278
|
-
|
|
4277
|
+
const g = n.doc.resolve(f), y = g.node(), v = g.parentOffset === 0, x = y.isText || y.isTextblock, S = y.content.size > 0;
|
|
4278
|
+
v && x && S && (f = Math.max(0, f - 1)), n.replaceWith(f, u, m);
|
|
4279
4279
|
}
|
|
4280
4280
|
t.updateSelection && fi(n, n.steps.length - 1, -1), t.applyInputRules && n.setMeta("applyInputRules", { from: f, text: m }), t.applyPasteRules && n.setMeta("applyPasteRules", { from: f, text: m });
|
|
4281
4281
|
}
|
|
@@ -4294,11 +4294,11 @@ var ui = (r) => !("type" in r), di = (r, e, t) => ({ tr: n, dispatch: i, editor:
|
|
|
4294
4294
|
} catch {
|
|
4295
4295
|
return !1;
|
|
4296
4296
|
}
|
|
4297
|
-
}, ki = () => ({ state: r, dispatch: e }) => br(r, e),
|
|
4297
|
+
}, ki = () => ({ state: r, dispatch: e }) => br(r, e), vi = () => ({ state: r, dispatch: e }) => Sr(r, e);
|
|
4298
4298
|
function wn() {
|
|
4299
4299
|
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
|
|
4300
4300
|
}
|
|
4301
|
-
function
|
|
4301
|
+
function xi(r) {
|
|
4302
4302
|
const e = r.split(/-(?!$)/);
|
|
4303
4303
|
let t = e[e.length - 1];
|
|
4304
4304
|
t === "Space" && (t = " ");
|
|
@@ -4321,7 +4321,7 @@ function vi(r) {
|
|
|
4321
4321
|
return n && (t = `Alt-${t}`), i && (t = `Ctrl-${t}`), o && (t = `Meta-${t}`), s && (t = `Shift-${t}`), t;
|
|
4322
4322
|
}
|
|
4323
4323
|
var bi = (r) => ({ editor: e, view: t, tr: n, dispatch: i }) => {
|
|
4324
|
-
const s =
|
|
4324
|
+
const s = xi(r).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
|
|
4325
4325
|
key: o === "Space" ? " " : o,
|
|
4326
4326
|
altKey: s.includes("Alt"),
|
|
4327
4327
|
ctrlKey: s.includes("Ctrl"),
|
|
@@ -4470,7 +4470,7 @@ function Wi(r) {
|
|
|
4470
4470
|
function W(r, e = void 0, ...t) {
|
|
4471
4471
|
return Wi(r) ? e ? r.bind(e)(...t) : r(...t) : r;
|
|
4472
4472
|
}
|
|
4473
|
-
function
|
|
4473
|
+
function vn(r) {
|
|
4474
4474
|
const e = r.filter((i) => i.type === "extension"), t = r.filter((i) => i.type === "node"), n = r.filter((i) => i.type === "mark");
|
|
4475
4475
|
return {
|
|
4476
4476
|
baseExtensions: e,
|
|
@@ -4545,7 +4545,7 @@ function Vs(r, e) {
|
|
|
4545
4545
|
[t.name]: r.attrs[t.name]
|
|
4546
4546
|
}).reduce((t, n) => ji(t, n), {});
|
|
4547
4547
|
}
|
|
4548
|
-
function
|
|
4548
|
+
function xn(r, e, t) {
|
|
4549
4549
|
const { from: n, to: i } = e, { blockSeparator: s = `
|
|
4550
4550
|
|
|
4551
4551
|
`, textSerializers: o = {} } = t || {};
|
|
@@ -4570,7 +4570,7 @@ function qs(r, e) {
|
|
|
4570
4570
|
from: 0,
|
|
4571
4571
|
to: r.content.size
|
|
4572
4572
|
};
|
|
4573
|
-
return
|
|
4573
|
+
return xn(r, t, e);
|
|
4574
4574
|
}
|
|
4575
4575
|
function Hi(r) {
|
|
4576
4576
|
return Object.fromEntries(
|
|
@@ -4680,12 +4680,12 @@ function Ze(r, e, t = {}) {
|
|
|
4680
4680
|
return !1;
|
|
4681
4681
|
if (!m.isText && !m.marks.length)
|
|
4682
4682
|
return;
|
|
4683
|
-
const y = Math.max(h, g),
|
|
4684
|
-
o +=
|
|
4683
|
+
const y = Math.max(h, g), v = Math.min(p, g + m.nodeSize), x = v - y;
|
|
4684
|
+
o += x, l.push(
|
|
4685
4685
|
...m.marks.map((S) => ({
|
|
4686
4686
|
mark: S,
|
|
4687
4687
|
from: y,
|
|
4688
|
-
to:
|
|
4688
|
+
to: v
|
|
4689
4689
|
}))
|
|
4690
4690
|
);
|
|
4691
4691
|
});
|
|
@@ -4715,7 +4715,7 @@ var Ys = (r, e) => {
|
|
|
4715
4715
|
return !(e.parentOffset > 0 || e.pos !== t.pos);
|
|
4716
4716
|
};
|
|
4717
4717
|
function Nt(r, e) {
|
|
4718
|
-
const { nodeExtensions: t } =
|
|
4718
|
+
const { nodeExtensions: t } = vn(e), n = t.find((o) => o.name === r);
|
|
4719
4719
|
if (!n)
|
|
4720
4720
|
return !1;
|
|
4721
4721
|
const i = {
|
|
@@ -4734,7 +4734,7 @@ function Sn(r, {
|
|
|
4734
4734
|
if (r.type.name === "hardBreak")
|
|
4735
4735
|
return !0;
|
|
4736
4736
|
if (r.isText)
|
|
4737
|
-
return
|
|
4737
|
+
return !/\S/.test((n = r.text) != null ? n : "");
|
|
4738
4738
|
}
|
|
4739
4739
|
if (r.isText)
|
|
4740
4740
|
return !r.text;
|
|
@@ -4922,10 +4922,10 @@ var rs = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
|
|
|
4922
4922
|
return !1;
|
|
4923
4923
|
if (i) {
|
|
4924
4924
|
let y = ne.empty;
|
|
4925
|
-
const
|
|
4926
|
-
for (let P = a.depth -
|
|
4925
|
+
const v = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
|
|
4926
|
+
for (let P = a.depth - v; P >= a.depth - 3; P -= 1)
|
|
4927
4927
|
y = ne.from(a.node(P).copy(y));
|
|
4928
|
-
const
|
|
4928
|
+
const x = (
|
|
4929
4929
|
// eslint-disable-next-line no-nested-ternary
|
|
4930
4930
|
a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3
|
|
4931
4931
|
), S = {
|
|
@@ -4933,8 +4933,8 @@ var rs = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
|
|
|
4933
4933
|
...e
|
|
4934
4934
|
}, b = ((o = l.contentMatch.defaultType) == null ? void 0 : o.createAndFill(S)) || void 0;
|
|
4935
4935
|
y = y.append(ne.from(l.createAndFill(null, b) || void 0));
|
|
4936
|
-
const T = a.before(a.depth - (
|
|
4937
|
-
t.replace(T, a.after(-
|
|
4936
|
+
const T = a.before(a.depth - (v - 1));
|
|
4937
|
+
t.replace(T, a.after(-x), new $n(y, 4 - v, 0));
|
|
4938
4938
|
let N = -1;
|
|
4939
4939
|
t.doc.nodesBetween(T, t.doc.content.size, (P, V) => {
|
|
4940
4940
|
if (N > -1)
|
|
@@ -4959,10 +4959,10 @@ var rs = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
|
|
|
4959
4959
|
if (!_(t.doc, a.pos, 2))
|
|
4960
4960
|
return !1;
|
|
4961
4961
|
if (i) {
|
|
4962
|
-
const { selection: y, storedMarks:
|
|
4962
|
+
const { selection: y, storedMarks: v } = n, { splittableMarks: x } = s.extensionManager, S = v || y.$to.parentOffset && y.$from.marks();
|
|
4963
4963
|
if (t.split(a.pos, 2, g).scrollIntoView(), !S || !i)
|
|
4964
4964
|
return !0;
|
|
4965
|
-
const b = S.filter((T) =>
|
|
4965
|
+
const b = S.filter((T) => x.includes(T.type.name));
|
|
4966
4966
|
t.ensureMarks(b);
|
|
4967
4967
|
}
|
|
4968
4968
|
return !0;
|
|
@@ -4985,11 +4985,11 @@ var rs = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
|
|
|
4985
4985
|
const i = r.doc.nodeAt(n);
|
|
4986
4986
|
return t.node.type === (i == null ? void 0 : i.type) && Q(r.doc, n) && r.join(n), !0;
|
|
4987
4987
|
}, ss = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: f }) => {
|
|
4988
|
-
const { extensions: u, splittableMarks: d } = i.extensionManager, h = R(r, o.schema), p = R(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to:
|
|
4989
|
-
if (!
|
|
4988
|
+
const { extensions: u, splittableMarks: d } = i.extensionManager, h = R(r, o.schema), p = R(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();
|
|
4989
|
+
if (!x)
|
|
4990
4990
|
return !1;
|
|
4991
4991
|
const b = ze((T) => Nt(T.type.name, u))(m);
|
|
4992
|
-
if (
|
|
4992
|
+
if (x.depth >= 1 && b && x.depth - b.depth <= 1) {
|
|
4993
4993
|
if (b.node.type === h)
|
|
4994
4994
|
return c.liftListItem(p);
|
|
4995
4995
|
if (Nt(b.node.type.name, u) && h.validContent(b.node.content) && l)
|
|
@@ -5076,14 +5076,14 @@ var rs = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
|
|
|
5076
5076
|
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, {
|
|
5077
5077
|
...g.attrs,
|
|
5078
5078
|
...e
|
|
5079
|
-
})), o && g.marks.length && g.marks.forEach((
|
|
5080
|
-
if (o ===
|
|
5081
|
-
const
|
|
5079
|
+
})), o && g.marks.length && g.marks.forEach((v) => {
|
|
5080
|
+
if (o === v.type && (a = !0, i)) {
|
|
5081
|
+
const x = Math.max(y, f), S = Math.min(y + g.nodeSize, u);
|
|
5082
5082
|
t.addMark(
|
|
5083
|
-
|
|
5083
|
+
x,
|
|
5084
5084
|
S,
|
|
5085
5085
|
o.create({
|
|
5086
|
-
...
|
|
5086
|
+
...v.attrs,
|
|
5087
5087
|
...e
|
|
5088
5088
|
})
|
|
5089
5089
|
);
|
|
@@ -5207,8 +5207,8 @@ var Tn = class {
|
|
|
5207
5207
|
}, ws = {};
|
|
5208
5208
|
ct(ws, {
|
|
5209
5209
|
ClipboardTextSerializer: () => ks,
|
|
5210
|
-
Commands: () =>
|
|
5211
|
-
Delete: () =>
|
|
5210
|
+
Commands: () => vs,
|
|
5211
|
+
Delete: () => xs,
|
|
5212
5212
|
Drop: () => bs,
|
|
5213
5213
|
Editable: () => Ss,
|
|
5214
5214
|
FocusEvents: () => Ms,
|
|
@@ -5251,7 +5251,7 @@ var J = class An extends ut {
|
|
|
5251
5251
|
props: {
|
|
5252
5252
|
clipboardTextSerializer: () => {
|
|
5253
5253
|
const { editor: r } = this, { state: e, schema: t } = r, { doc: n, selection: i } = e, { ranges: s } = i, o = Math.min(...s.map((f) => f.$from.pos)), l = Math.max(...s.map((f) => f.$to.pos)), a = Hi(t);
|
|
5254
|
-
return
|
|
5254
|
+
return xn(n, { from: o, to: l }, {
|
|
5255
5255
|
...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
|
|
5256
5256
|
textSerializers: a
|
|
5257
5257
|
});
|
|
@@ -5260,14 +5260,14 @@ var J = class An extends ut {
|
|
|
5260
5260
|
})
|
|
5261
5261
|
];
|
|
5262
5262
|
}
|
|
5263
|
-
}),
|
|
5263
|
+
}), vs = J.create({
|
|
5264
5264
|
name: "commands",
|
|
5265
5265
|
addCommands() {
|
|
5266
5266
|
return {
|
|
5267
5267
|
...pn
|
|
5268
5268
|
};
|
|
5269
5269
|
}
|
|
5270
|
-
}),
|
|
5270
|
+
}), xs = J.create({
|
|
5271
5271
|
name: "delete",
|
|
5272
5272
|
onUpdate({ transaction: r, appendedTransactions: e }) {
|
|
5273
5273
|
var t, n, i;
|
|
@@ -5299,19 +5299,19 @@ var J = class An extends ut {
|
|
|
5299
5299
|
f.steps.forEach((h, p) => {
|
|
5300
5300
|
var m, g;
|
|
5301
5301
|
if (h instanceof D) {
|
|
5302
|
-
const y = d.slice(p).map(h.from, -1),
|
|
5302
|
+
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 = (m = f.doc.nodeAt(y - 1)) == null ? void 0 : m.marks.some((N) => N.eq(h.mark)), T = (g = f.doc.nodeAt(v)) == null ? void 0 : g.marks.some((N) => N.eq(h.mark));
|
|
5303
5303
|
this.editor.emit("delete", {
|
|
5304
5304
|
type: "mark",
|
|
5305
5305
|
mark: h.mark,
|
|
5306
5306
|
from: h.from,
|
|
5307
5307
|
to: h.to,
|
|
5308
5308
|
deletedRange: {
|
|
5309
|
-
from:
|
|
5309
|
+
from: x,
|
|
5310
5310
|
to: S
|
|
5311
5311
|
},
|
|
5312
5312
|
newRange: {
|
|
5313
5313
|
from: y,
|
|
5314
|
-
to:
|
|
5314
|
+
to: v
|
|
5315
5315
|
},
|
|
5316
5316
|
partial: !!(T || b),
|
|
5317
5317
|
editor: this.editor,
|
|
@@ -5496,7 +5496,7 @@ var J = class An extends ut {
|
|
|
5496
5496
|
addGlobalAttributes() {
|
|
5497
5497
|
if (!this.options.direction)
|
|
5498
5498
|
return [];
|
|
5499
|
-
const { nodeExtensions: r } =
|
|
5499
|
+
const { nodeExtensions: r } = vn(this.extensions);
|
|
5500
5500
|
return [
|
|
5501
5501
|
{
|
|
5502
5502
|
types: r.filter((e) => e.name !== "text").map((e) => e.name),
|
|
@@ -5972,7 +5972,7 @@ function Ns(r) {
|
|
|
5972
5972
|
if (!p)
|
|
5973
5973
|
return;
|
|
5974
5974
|
const m = p[1] || "", g = n(m);
|
|
5975
|
-
if (!o.find((
|
|
5975
|
+
if (!o.find((v) => !(v in g)))
|
|
5976
5976
|
return {
|
|
5977
5977
|
type: e,
|
|
5978
5978
|
raw: p[0],
|
|
@@ -6027,7 +6027,7 @@ function zs(r) {
|
|
|
6027
6027
|
const m = new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`), g = u.match(m);
|
|
6028
6028
|
if (!g)
|
|
6029
6029
|
return;
|
|
6030
|
-
const [y,
|
|
6030
|
+
const [y, v = ""] = g, x = i(v);
|
|
6031
6031
|
let S = 1;
|
|
6032
6032
|
const b = y.length;
|
|
6033
6033
|
let T = "";
|
|
@@ -6061,7 +6061,7 @@ function zs(r) {
|
|
|
6061
6061
|
return {
|
|
6062
6062
|
type: e,
|
|
6063
6063
|
raw: zn,
|
|
6064
|
-
attributes:
|
|
6064
|
+
attributes: x,
|
|
6065
6065
|
content: T,
|
|
6066
6066
|
tokens: q
|
|
6067
6067
|
};
|
|
@@ -6139,20 +6139,20 @@ function Ps(r) {
|
|
|
6139
6139
|
const m = l ? new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`) : new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`), g = d.match(m);
|
|
6140
6140
|
if (!g)
|
|
6141
6141
|
return;
|
|
6142
|
-
let y = "",
|
|
6142
|
+
let y = "", v = "";
|
|
6143
6143
|
if (l) {
|
|
6144
6144
|
const [, S] = g;
|
|
6145
|
-
|
|
6145
|
+
v = S;
|
|
6146
6146
|
} else {
|
|
6147
6147
|
const [, S, b] = g;
|
|
6148
|
-
|
|
6148
|
+
v = S, y = b || "";
|
|
6149
6149
|
}
|
|
6150
|
-
const
|
|
6150
|
+
const x = i(v.trim());
|
|
6151
6151
|
return {
|
|
6152
6152
|
type: e,
|
|
6153
6153
|
raw: g[0],
|
|
6154
6154
|
content: y.trim(),
|
|
6155
|
-
attributes:
|
|
6155
|
+
attributes: x
|
|
6156
6156
|
};
|
|
6157
6157
|
}
|
|
6158
6158
|
},
|
|
@@ -6205,14 +6205,14 @@ function Bs(r, e, t) {
|
|
|
6205
6205
|
else
|
|
6206
6206
|
break;
|
|
6207
6207
|
}
|
|
6208
|
-
let
|
|
6209
|
-
const
|
|
6210
|
-
if (
|
|
6211
|
-
const b =
|
|
6208
|
+
let v;
|
|
6209
|
+
const x = y.slice(1);
|
|
6210
|
+
if (x.length > 0) {
|
|
6211
|
+
const b = x.map((T) => T.slice(m + u)).join(`
|
|
6212
6212
|
`);
|
|
6213
|
-
b.trim() && (e.customNestedParser ?
|
|
6213
|
+
b.trim() && (e.customNestedParser ? v = e.customNestedParser(b) : v = t.blockTokens(b));
|
|
6214
6214
|
}
|
|
6215
|
-
const S = e.createToken(p,
|
|
6215
|
+
const S = e.createToken(p, v);
|
|
6216
6216
|
a.push(S);
|
|
6217
6217
|
}
|
|
6218
6218
|
if (a.length !== 0)
|
|
@@ -6224,17 +6224,21 @@ function Bs(r, e, t) {
|
|
|
6224
6224
|
function Ds(r, e, t, n) {
|
|
6225
6225
|
if (!r || !Array.isArray(r.content))
|
|
6226
6226
|
return "";
|
|
6227
|
-
const i = typeof t == "function" ? t(n) : t, [s, ...o] = r.content, l = e.renderChildren([s])
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6227
|
+
const i = typeof t == "function" ? t(n) : t, [s, ...o] = r.content, l = e.renderChildren([s]);
|
|
6228
|
+
let a = `${i}${l}`;
|
|
6229
|
+
return o && o.length > 0 && o.forEach((c, f) => {
|
|
6230
|
+
var u, d;
|
|
6231
|
+
const h = (d = (u = e.renderChild) == null ? void 0 : u.call(e, c, f + 1)) != null ? d : e.renderChildren([c]);
|
|
6232
|
+
if (h != null) {
|
|
6233
|
+
const p = h.split(`
|
|
6234
|
+
`).map((m) => m ? e.indent(m) : e.indent("")).join(`
|
|
6233
6235
|
`);
|
|
6234
|
-
a.
|
|
6236
|
+
a += c.type === "paragraph" ? `
|
|
6237
|
+
|
|
6238
|
+
${p}` : `
|
|
6239
|
+
${p}`;
|
|
6235
6240
|
}
|
|
6236
|
-
}), a
|
|
6237
|
-
`);
|
|
6241
|
+
}), a;
|
|
6238
6242
|
}
|
|
6239
6243
|
var uo = class Rn extends ut {
|
|
6240
6244
|
constructor() {
|
|
@@ -6278,13 +6282,13 @@ var uo = class Rn extends ut {
|
|
|
6278
6282
|
return;
|
|
6279
6283
|
let u = 0, d = 0;
|
|
6280
6284
|
if (this.dom !== f) {
|
|
6281
|
-
const
|
|
6282
|
-
u =
|
|
6285
|
+
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;
|
|
6286
|
+
u = x.x - v.x + S, d = x.y - v.y + b;
|
|
6283
6287
|
}
|
|
6284
6288
|
const h = this.dom.cloneNode(!0);
|
|
6285
6289
|
try {
|
|
6286
|
-
const
|
|
6287
|
-
h.style.width = `${Math.round(
|
|
6290
|
+
const v = this.dom.getBoundingClientRect();
|
|
6291
|
+
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";
|
|
6288
6292
|
} catch {
|
|
6289
6293
|
}
|
|
6290
6294
|
let p = null;
|
|
@@ -6427,7 +6431,7 @@ export {
|
|
|
6427
6431
|
E as S,
|
|
6428
6432
|
O as T,
|
|
6429
6433
|
Sn as U,
|
|
6430
|
-
|
|
6434
|
+
vr as V,
|
|
6431
6435
|
kr as W,
|
|
6432
6436
|
Li as X,
|
|
6433
6437
|
ho as Y,
|