@blocknote/core 0.15.0 → 0.15.3
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/README.md +1 -1
- package/dist/blocknote.js +596 -574
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +6 -6
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -4
- package/src/api/parsers/html/util/__snapshots__/nestedLists.test.ts.snap +7 -7
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +37 -0
- package/src/extensions/SideMenu/SideMenuPlugin.ts +13 -2
- package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +23 -11
- package/src/i18n/locales/en.ts +1 -1
- package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +1 -0
- package/types/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.d.ts +1 -1
package/dist/blocknote.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var Bt = Object.defineProperty;
|
|
2
2
|
var Lt = (e, t, o) => t in e ? Bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
3
|
-
var c = (e, t, o) =>
|
|
4
|
-
import { Slice as
|
|
3
|
+
var c = (e, t, o) => Lt(e, typeof t != "symbol" ? t + "" : t, o);
|
|
4
|
+
import { Slice as j, Fragment as L, DOMSerializer as xe, DOMParser as It, Node as At } from "prosemirror-model";
|
|
5
5
|
import Je from "rehype-parse";
|
|
6
6
|
import Ye from "rehype-stringify";
|
|
7
|
-
import { unified as
|
|
8
|
-
import { Extension as M, combineTransactionSteps as Nt, getChangedRanges as Pt, findChildrenInRange as Ht, Node as $, Mark as
|
|
9
|
-
import { Plugin as y, PluginKey as S, Selection as
|
|
7
|
+
import { unified as Ee } from "unified";
|
|
8
|
+
import { Extension as M, combineTransactionSteps as Nt, getChangedRanges as Pt, findChildrenInRange as Ht, Node as $, Mark as Ce, InputRule as ee, callOrReturn as Ut, getExtensionField as jt, mergeAttributes as Dt, selectionToInsertionEnd as Vt, isTextSelection as Rt, isNodeSelection as Ot, posToDOMRect as ye, getMarkRange as je, findParentNode as zt, findChildren as De, extensions as J, Editor as Ft, createDocument as Gt, getSchema as Kt } from "@tiptap/core";
|
|
9
|
+
import { Plugin as y, PluginKey as S, Selection as me, NodeSelection as re, TextSelection as Y, EditorState as Wt } from "prosemirror-state";
|
|
10
10
|
import { v4 as $t } from "uuid";
|
|
11
|
-
import { fromDom as
|
|
11
|
+
import { fromDom as we } from "hast-util-from-dom";
|
|
12
12
|
import qt from "@tiptap/extension-bold";
|
|
13
13
|
import Xt from "@tiptap/extension-code";
|
|
14
14
|
import Zt from "@tiptap/extension-italic";
|
|
@@ -32,9 +32,7 @@ import { HardBreak as fo } from "@tiptap/extension-hard-break";
|
|
|
32
32
|
import { History as go } from "@tiptap/extension-history";
|
|
33
33
|
import { Link as bo } from "@tiptap/extension-link";
|
|
34
34
|
import { Text as ko } from "@tiptap/extension-text";
|
|
35
|
-
|
|
36
|
-
import { init as yo, SearchIndex as wo } from "emoji-mart";
|
|
37
|
-
const vo = {
|
|
35
|
+
const _o = {
|
|
38
36
|
slash_menu: {
|
|
39
37
|
heading: {
|
|
40
38
|
title: "عنوان 1",
|
|
@@ -510,7 +508,7 @@ const vo = {
|
|
|
510
508
|
},
|
|
511
509
|
strike: {
|
|
512
510
|
tooltip: "Strike",
|
|
513
|
-
secondary_tooltip: "Mod+Shift+
|
|
511
|
+
secondary_tooltip: "Mod+Shift+S"
|
|
514
512
|
},
|
|
515
513
|
code: {
|
|
516
514
|
tooltip: "Code",
|
|
@@ -630,7 +628,7 @@ const vo = {
|
|
|
630
628
|
generic: {
|
|
631
629
|
ctrl_shortcut: "Ctrl"
|
|
632
630
|
}
|
|
633
|
-
},
|
|
631
|
+
}, yo = {
|
|
634
632
|
slash_menu: {
|
|
635
633
|
heading: {
|
|
636
634
|
title: "Titre 1",
|
|
@@ -935,7 +933,7 @@ const vo = {
|
|
|
935
933
|
generic: {
|
|
936
934
|
ctrl_shortcut: "Ctrl"
|
|
937
935
|
}
|
|
938
|
-
},
|
|
936
|
+
}, wo = {
|
|
939
937
|
slash_menu: {
|
|
940
938
|
heading: {
|
|
941
939
|
title: "Fyrirsögn 1",
|
|
@@ -1232,7 +1230,7 @@ const vo = {
|
|
|
1232
1230
|
generic: {
|
|
1233
1231
|
ctrl_shortcut: "Ctrl"
|
|
1234
1232
|
}
|
|
1235
|
-
},
|
|
1233
|
+
}, vo = {
|
|
1236
1234
|
slash_menu: {
|
|
1237
1235
|
heading: {
|
|
1238
1236
|
title: "見出し1",
|
|
@@ -1557,7 +1555,7 @@ const vo = {
|
|
|
1557
1555
|
generic: {
|
|
1558
1556
|
ctrl_shortcut: "Ctrl"
|
|
1559
1557
|
}
|
|
1560
|
-
},
|
|
1558
|
+
}, xo = {
|
|
1561
1559
|
slash_menu: {
|
|
1562
1560
|
heading: {
|
|
1563
1561
|
title: "제목1",
|
|
@@ -1875,7 +1873,7 @@ const vo = {
|
|
|
1875
1873
|
generic: {
|
|
1876
1874
|
ctrl_shortcut: "Ctrl"
|
|
1877
1875
|
}
|
|
1878
|
-
},
|
|
1876
|
+
}, Eo = {
|
|
1879
1877
|
slash_menu: {
|
|
1880
1878
|
heading: {
|
|
1881
1879
|
title: "Kop 1",
|
|
@@ -2180,7 +2178,7 @@ const vo = {
|
|
|
2180
2178
|
generic: {
|
|
2181
2179
|
ctrl_shortcut: "Ctrl"
|
|
2182
2180
|
}
|
|
2183
|
-
},
|
|
2181
|
+
}, Co = {
|
|
2184
2182
|
slash_menu: {
|
|
2185
2183
|
heading: {
|
|
2186
2184
|
title: "Nagłówek 1",
|
|
@@ -2469,7 +2467,7 @@ const vo = {
|
|
|
2469
2467
|
generic: {
|
|
2470
2468
|
ctrl_shortcut: "Ctrl"
|
|
2471
2469
|
}
|
|
2472
|
-
},
|
|
2470
|
+
}, So = {
|
|
2473
2471
|
slash_menu: {
|
|
2474
2472
|
heading: {
|
|
2475
2473
|
title: "Título",
|
|
@@ -2766,7 +2764,7 @@ const vo = {
|
|
|
2766
2764
|
generic: {
|
|
2767
2765
|
ctrl_shortcut: "Ctrl"
|
|
2768
2766
|
}
|
|
2769
|
-
},
|
|
2767
|
+
}, Mo = {
|
|
2770
2768
|
slash_menu: {
|
|
2771
2769
|
heading: {
|
|
2772
2770
|
title: "Tiêu đề H1",
|
|
@@ -3070,7 +3068,7 @@ const vo = {
|
|
|
3070
3068
|
generic: {
|
|
3071
3069
|
ctrl_shortcut: "Ctrl"
|
|
3072
3070
|
}
|
|
3073
|
-
},
|
|
3071
|
+
}, To = {
|
|
3074
3072
|
slash_menu: {
|
|
3075
3073
|
heading: {
|
|
3076
3074
|
title: "一级标题",
|
|
@@ -3408,7 +3406,7 @@ const vo = {
|
|
|
3408
3406
|
generic: {
|
|
3409
3407
|
ctrl_shortcut: "Ctrl"
|
|
3410
3408
|
}
|
|
3411
|
-
},
|
|
3409
|
+
}, Bo = {
|
|
3412
3410
|
slash_menu: {
|
|
3413
3411
|
heading: {
|
|
3414
3412
|
title: "Заголовок 1 уровня",
|
|
@@ -3740,33 +3738,33 @@ const vo = {
|
|
|
3740
3738
|
generic: {
|
|
3741
3739
|
ctrl_shortcut: "Ctrl"
|
|
3742
3740
|
}
|
|
3743
|
-
},
|
|
3741
|
+
}, jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3744
3742
|
__proto__: null,
|
|
3745
|
-
ar:
|
|
3743
|
+
ar: _o,
|
|
3746
3744
|
en: et,
|
|
3747
|
-
fr:
|
|
3748
|
-
is:
|
|
3749
|
-
ja:
|
|
3750
|
-
ko:
|
|
3751
|
-
nl:
|
|
3752
|
-
pl:
|
|
3753
|
-
pt:
|
|
3754
|
-
ru:
|
|
3755
|
-
vi:
|
|
3756
|
-
zh:
|
|
3745
|
+
fr: yo,
|
|
3746
|
+
is: wo,
|
|
3747
|
+
ja: vo,
|
|
3748
|
+
ko: xo,
|
|
3749
|
+
nl: Eo,
|
|
3750
|
+
pl: Co,
|
|
3751
|
+
pt: So,
|
|
3752
|
+
ru: Bo,
|
|
3753
|
+
vi: Mo,
|
|
3754
|
+
zh: To
|
|
3757
3755
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3758
|
-
function
|
|
3756
|
+
function Lo(e, t = JSON.stringify) {
|
|
3759
3757
|
const o = {};
|
|
3760
3758
|
return e.filter((i) => {
|
|
3761
3759
|
const n = t(i);
|
|
3762
3760
|
return Object.prototype.hasOwnProperty.call(o, n) ? !1 : o[n] = !0;
|
|
3763
3761
|
});
|
|
3764
3762
|
}
|
|
3765
|
-
function
|
|
3763
|
+
function Io(e) {
|
|
3766
3764
|
const t = e.filter(
|
|
3767
3765
|
(i, n) => e.indexOf(i) !== n
|
|
3768
3766
|
);
|
|
3769
|
-
return
|
|
3767
|
+
return Lo(t);
|
|
3770
3768
|
}
|
|
3771
3769
|
const oe = M.create({
|
|
3772
3770
|
name: "uniqueID",
|
|
@@ -3854,17 +3852,17 @@ const oe = M.create({
|
|
|
3854
3852
|
n.doc,
|
|
3855
3853
|
m,
|
|
3856
3854
|
(T) => l.includes(T.type.name)
|
|
3857
|
-
), b = g.map(({ node: T }) => T.attrs[d]).filter((T) => T !== null), A =
|
|
3855
|
+
), b = g.map(({ node: T }) => T.attrs[d]).filter((T) => T !== null), A = Io(b);
|
|
3858
3856
|
g.forEach(({ node: T, pos: N }) => {
|
|
3859
3857
|
let Z;
|
|
3860
|
-
const
|
|
3861
|
-
if (
|
|
3862
|
-
const
|
|
3863
|
-
if (i.doc.content.findDiffStart(
|
|
3864
|
-
const
|
|
3858
|
+
const Pe = (Z = s.doc.nodeAt(N)) === null || Z === void 0 ? void 0 : Z.attrs[d];
|
|
3859
|
+
if (Pe === null) {
|
|
3860
|
+
const He = i.doc.type.createAndFill().content;
|
|
3861
|
+
if (i.doc.content.findDiffStart(He) === null) {
|
|
3862
|
+
const Ue = JSON.parse(
|
|
3865
3863
|
JSON.stringify(n.doc.toJSON())
|
|
3866
3864
|
);
|
|
3867
|
-
if (
|
|
3865
|
+
if (Ue.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(Ue.content) === JSON.stringify(He.toJSON())) {
|
|
3868
3866
|
s.setNodeMarkup(N, void 0, {
|
|
3869
3867
|
...T.attrs,
|
|
3870
3868
|
[d]: "initialBlockId"
|
|
@@ -3879,7 +3877,7 @@ const oe = M.create({
|
|
|
3879
3877
|
return;
|
|
3880
3878
|
}
|
|
3881
3879
|
const { deleted: Tt } = h.invert().mapResult(N);
|
|
3882
|
-
Tt && A.includes(
|
|
3880
|
+
Tt && A.includes(Pe) && s.setNodeMarkup(N, void 0, {
|
|
3883
3881
|
...T.attrs,
|
|
3884
3882
|
[d]: u()
|
|
3885
3883
|
});
|
|
@@ -3939,7 +3937,7 @@ const oe = M.create({
|
|
|
3939
3937
|
s.push(d);
|
|
3940
3938
|
}), L.from(s);
|
|
3941
3939
|
};
|
|
3942
|
-
return t = !1, new
|
|
3940
|
+
return t = !1, new j(
|
|
3943
3941
|
r(o.content),
|
|
3944
3942
|
o.openStart,
|
|
3945
3943
|
o.openEnd
|
|
@@ -3963,7 +3961,7 @@ function tt(e) {
|
|
|
3963
3961
|
function k(e, t) {
|
|
3964
3962
|
const i = e.nodeSize - 2;
|
|
3965
3963
|
if (t <= 1)
|
|
3966
|
-
for (t =
|
|
3964
|
+
for (t = 2; e.resolve(t).parent.type.name !== "blockContainer" && t < i; )
|
|
3967
3965
|
t++;
|
|
3968
3966
|
else if (t >= i)
|
|
3969
3967
|
for (t = i - 1; e.resolve(t).parent.type.name !== "blockContainer" && t > 1; )
|
|
@@ -3992,7 +3990,7 @@ function k(e, t) {
|
|
|
3992
3990
|
depth: s
|
|
3993
3991
|
};
|
|
3994
3992
|
}
|
|
3995
|
-
function
|
|
3993
|
+
function Ve(e) {
|
|
3996
3994
|
return e.type === "link";
|
|
3997
3995
|
}
|
|
3998
3996
|
function ot(e) {
|
|
@@ -4006,12 +4004,12 @@ class I extends Error {
|
|
|
4006
4004
|
super(`Unreachable case: ${t}`);
|
|
4007
4005
|
}
|
|
4008
4006
|
}
|
|
4009
|
-
function
|
|
4007
|
+
function Dr(e, t = !0) {
|
|
4010
4008
|
const { "data-test": o, ...i } = e;
|
|
4011
4009
|
if (Object.keys(i).length > 0 && t)
|
|
4012
4010
|
throw new Error("Object must be empty " + JSON.stringify(e));
|
|
4013
4011
|
}
|
|
4014
|
-
function
|
|
4012
|
+
function Re(e, t, o) {
|
|
4015
4013
|
const i = [];
|
|
4016
4014
|
for (const [n, r] of Object.entries(e.styles)) {
|
|
4017
4015
|
const a = o[n];
|
|
@@ -4027,11 +4025,11 @@ function je(e, t, o) {
|
|
|
4027
4025
|
return e.text.split(/(\n)/g).filter((n) => n.length > 0).map((n) => n === `
|
|
4028
4026
|
` ? t.nodes.hardBreak.create() : t.text(n, i));
|
|
4029
4027
|
}
|
|
4030
|
-
function
|
|
4028
|
+
function Ao(e, t, o) {
|
|
4031
4029
|
const i = t.marks.link.create({
|
|
4032
4030
|
href: e.href
|
|
4033
4031
|
});
|
|
4034
|
-
return
|
|
4032
|
+
return ve(e.content, t, o).map(
|
|
4035
4033
|
(n) => {
|
|
4036
4034
|
if (n.type.name === "text")
|
|
4037
4035
|
return n.mark([...n.marks, i]);
|
|
@@ -4041,24 +4039,24 @@ function Ho(e, t, o) {
|
|
|
4041
4039
|
}
|
|
4042
4040
|
);
|
|
4043
4041
|
}
|
|
4044
|
-
function
|
|
4042
|
+
function ve(e, t, o) {
|
|
4045
4043
|
const i = [];
|
|
4046
4044
|
if (typeof e == "string")
|
|
4047
4045
|
return i.push(
|
|
4048
|
-
...
|
|
4046
|
+
...Re(
|
|
4049
4047
|
{ type: "text", text: e, styles: {} },
|
|
4050
4048
|
t,
|
|
4051
4049
|
o
|
|
4052
4050
|
)
|
|
4053
4051
|
), i;
|
|
4054
4052
|
for (const n of e)
|
|
4055
|
-
i.push(...
|
|
4053
|
+
i.push(...Re(n, t, o));
|
|
4056
4054
|
return i;
|
|
4057
4055
|
}
|
|
4058
4056
|
function W(e, t, o) {
|
|
4059
4057
|
const i = [];
|
|
4060
4058
|
for (const n of e)
|
|
4061
|
-
typeof n == "string" ? i.push(...
|
|
4059
|
+
typeof n == "string" ? i.push(...ve(n, t, o)) : ot(n) ? i.push(...Ao(n, t, o)) : te(n) ? i.push(...ve([n], t, o)) : i.push(
|
|
4062
4060
|
nt(n, t, o)
|
|
4063
4061
|
);
|
|
4064
4062
|
return i;
|
|
@@ -4124,7 +4122,7 @@ function P(e, t, o) {
|
|
|
4124
4122
|
r.length > 0 ? [n, a] : n
|
|
4125
4123
|
);
|
|
4126
4124
|
}
|
|
4127
|
-
function
|
|
4125
|
+
function No(e, t, o) {
|
|
4128
4126
|
const i = {
|
|
4129
4127
|
type: "tableContent",
|
|
4130
4128
|
rows: []
|
|
@@ -4135,7 +4133,7 @@ function Uo(e, t, o) {
|
|
|
4135
4133
|
};
|
|
4136
4134
|
n.content.forEach((a) => {
|
|
4137
4135
|
r.cells.push(
|
|
4138
|
-
|
|
4136
|
+
Se(
|
|
4139
4137
|
a.firstChild,
|
|
4140
4138
|
t,
|
|
4141
4139
|
o
|
|
@@ -4144,7 +4142,7 @@ function Uo(e, t, o) {
|
|
|
4144
4142
|
}), i.rows.push(r);
|
|
4145
4143
|
}), i;
|
|
4146
4144
|
}
|
|
4147
|
-
function
|
|
4145
|
+
function Se(e, t, o) {
|
|
4148
4146
|
const i = [];
|
|
4149
4147
|
let n;
|
|
4150
4148
|
return e.content.forEach((r) => {
|
|
@@ -4153,7 +4151,7 @@ function Ee(e, t, o) {
|
|
|
4153
4151
|
if (te(n))
|
|
4154
4152
|
n.text += `
|
|
4155
4153
|
`;
|
|
4156
|
-
else if (
|
|
4154
|
+
else if (Ve(n))
|
|
4157
4155
|
n.content[n.content.length - 1].text += `
|
|
4158
4156
|
`;
|
|
4159
4157
|
else
|
|
@@ -4203,7 +4201,7 @@ function Ee(e, t, o) {
|
|
|
4203
4201
|
type: "text",
|
|
4204
4202
|
text: r.textContent,
|
|
4205
4203
|
styles: a
|
|
4206
|
-
}) :
|
|
4204
|
+
}) : Ve(n) && (s ? n.href === s.attrs.href ? JSON.stringify(
|
|
4207
4205
|
n.content[n.content.length - 1].styles
|
|
4208
4206
|
) === JSON.stringify(a) ? n.content[n.content.length - 1].text += r.textContent : n.content.push({
|
|
4209
4207
|
type: "text",
|
|
@@ -4251,7 +4249,7 @@ function rt(e, t, o) {
|
|
|
4251
4249
|
s in d && (i[s] = l);
|
|
4252
4250
|
}
|
|
4253
4251
|
let r;
|
|
4254
|
-
return n.content === "styled" ? r =
|
|
4252
|
+
return n.content === "styled" ? r = Se(
|
|
4255
4253
|
e,
|
|
4256
4254
|
t,
|
|
4257
4255
|
o
|
|
@@ -4298,13 +4296,13 @@ function v(e, t, o, i, n) {
|
|
|
4298
4296
|
);
|
|
4299
4297
|
let p;
|
|
4300
4298
|
if (d.content === "inline")
|
|
4301
|
-
p =
|
|
4299
|
+
p = Se(
|
|
4302
4300
|
a.contentNode,
|
|
4303
4301
|
o,
|
|
4304
4302
|
i
|
|
4305
4303
|
);
|
|
4306
4304
|
else if (d.content === "table")
|
|
4307
|
-
p =
|
|
4305
|
+
p = No(
|
|
4308
4306
|
a.contentNode,
|
|
4309
4307
|
o,
|
|
4310
4308
|
i
|
|
@@ -4322,14 +4320,14 @@ function v(e, t, o, i, n) {
|
|
|
4322
4320
|
};
|
|
4323
4321
|
return n == null || n.set(e, h), h;
|
|
4324
4322
|
}
|
|
4325
|
-
function
|
|
4323
|
+
function Po(e) {
|
|
4326
4324
|
return e.document || window.document;
|
|
4327
4325
|
}
|
|
4328
4326
|
const at = (e, t, o, i, n) => {
|
|
4329
4327
|
if (!o.nodes[e.type.name])
|
|
4330
4328
|
throw new Error("Serializer is missing a node type: " + e.type.name);
|
|
4331
|
-
const { dom: r, contentDOM: a } =
|
|
4332
|
-
|
|
4329
|
+
const { dom: r, contentDOM: a } = xe.renderSpec(
|
|
4330
|
+
Po(t),
|
|
4333
4331
|
o.nodes[e.type.name](e)
|
|
4334
4332
|
);
|
|
4335
4333
|
if (a) {
|
|
@@ -4372,7 +4370,7 @@ const at = (e, t, o, i, n) => {
|
|
|
4372
4370
|
const i = t.serializeFragment(e, o), n = document.createElement("div");
|
|
4373
4371
|
return n.appendChild(i), n.innerHTML;
|
|
4374
4372
|
};
|
|
4375
|
-
function
|
|
4373
|
+
function Ho(e) {
|
|
4376
4374
|
const t = /* @__PURE__ */ new Set([
|
|
4377
4375
|
...e.orderedListItemBlockTypes,
|
|
4378
4376
|
...e.unorderedListItemBlockTypes
|
|
@@ -4410,10 +4408,10 @@ function jo(e) {
|
|
|
4410
4408
|
s -= m, n -= m, r = void 0;
|
|
4411
4409
|
}
|
|
4412
4410
|
if (h) {
|
|
4413
|
-
r || (r =
|
|
4411
|
+
r || (r = we(
|
|
4414
4412
|
document.createElement(f)
|
|
4415
4413
|
));
|
|
4416
|
-
const m =
|
|
4414
|
+
const m = we(
|
|
4417
4415
|
document.createElement("li")
|
|
4418
4416
|
);
|
|
4419
4417
|
m.children.push(...u.children), p && m.children.push(...p.children), r.children.push(m);
|
|
@@ -4432,9 +4430,9 @@ function jo(e) {
|
|
|
4432
4430
|
};
|
|
4433
4431
|
return o;
|
|
4434
4432
|
}
|
|
4435
|
-
const
|
|
4436
|
-
const o =
|
|
4437
|
-
return o.serializeNodeInner = (i, n) => at(i, n, o, t, !0), o.exportProseMirrorFragment = (i, n) =>
|
|
4433
|
+
const se = (e, t) => {
|
|
4434
|
+
const o = xe.fromSchema(e);
|
|
4435
|
+
return o.serializeNodeInner = (i, n) => at(i, n, o, t, !0), o.exportProseMirrorFragment = (i, n) => Ee().use(Je, { fragment: !0 }).use(Ho, {
|
|
4438
4436
|
orderedListItemBlockTypes: /* @__PURE__ */ new Set(["numberedListItem"]),
|
|
4439
4437
|
unorderedListItemBlockTypes: /* @__PURE__ */ new Set([
|
|
4440
4438
|
"bulletListItem",
|
|
@@ -4449,8 +4447,8 @@ const ae = (e, t) => {
|
|
|
4449
4447
|
n
|
|
4450
4448
|
);
|
|
4451
4449
|
}, o;
|
|
4452
|
-
},
|
|
4453
|
-
const o =
|
|
4450
|
+
}, Me = (e, t) => {
|
|
4451
|
+
const o = xe.fromSchema(e);
|
|
4454
4452
|
return o.serializeNodeInner = (i, n) => at(i, n, o, t, !1), o.serializeProseMirrorFragment = (i, n) => st(i, o, n), o.serializeBlocks = (i, n) => {
|
|
4455
4453
|
const r = i.map(
|
|
4456
4454
|
(s) => P(s, e, t.schema.styleSchema)
|
|
@@ -4460,24 +4458,24 @@ const ae = (e, t) => {
|
|
|
4460
4458
|
n
|
|
4461
4459
|
);
|
|
4462
4460
|
}, o;
|
|
4463
|
-
},
|
|
4461
|
+
}, Uo = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
|
|
4464
4462
|
function H(e, t = "Ctrl") {
|
|
4465
|
-
return
|
|
4463
|
+
return Uo() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
|
|
4466
4464
|
}
|
|
4467
|
-
function
|
|
4465
|
+
function D(...e) {
|
|
4468
4466
|
return e.filter((t) => t).join(" ");
|
|
4469
4467
|
}
|
|
4470
|
-
const
|
|
4471
|
-
function
|
|
4468
|
+
const Vr = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
4469
|
+
function V(e, t, o, i) {
|
|
4472
4470
|
const n = document.createElement("div");
|
|
4473
|
-
n.className =
|
|
4471
|
+
n.className = D(
|
|
4474
4472
|
"bn-block-content",
|
|
4475
4473
|
o.class
|
|
4476
4474
|
), n.setAttribute("data-content-type", e);
|
|
4477
4475
|
for (const [a, s] of Object.entries(o))
|
|
4478
4476
|
a !== "class" && n.setAttribute(a, s);
|
|
4479
4477
|
const r = document.createElement(t);
|
|
4480
|
-
r.className =
|
|
4478
|
+
r.className = D(
|
|
4481
4479
|
"bn-inline-content",
|
|
4482
4480
|
i.class
|
|
4483
4481
|
);
|
|
@@ -4490,7 +4488,7 @@ function R(e, t, o, i) {
|
|
|
4490
4488
|
contentDOM: r
|
|
4491
4489
|
};
|
|
4492
4490
|
}
|
|
4493
|
-
const
|
|
4491
|
+
const Oe = (e, t) => {
|
|
4494
4492
|
const o = P(e, t.pmSchema, t.schema.styleSchema).firstChild, i = t.pmSchema.nodes[o.type.name].spec.toDOM;
|
|
4495
4493
|
if (i === void 0)
|
|
4496
4494
|
throw new Error(
|
|
@@ -4514,10 +4512,10 @@ const Re = (e, t) => {
|
|
|
4514
4512
|
values: ["left", "center", "right", "justify"]
|
|
4515
4513
|
}
|
|
4516
4514
|
}, lt = ["backgroundColor", "textColor"];
|
|
4517
|
-
function
|
|
4515
|
+
function ae(e) {
|
|
4518
4516
|
return "data-" + e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
4519
4517
|
}
|
|
4520
|
-
function
|
|
4518
|
+
function Rr(e) {
|
|
4521
4519
|
const t = e.split("/");
|
|
4522
4520
|
return !t.length || // invalid?
|
|
4523
4521
|
t[t.length - 1] === "" ? e : t[t.length - 1];
|
|
@@ -4532,7 +4530,7 @@ function dt(e) {
|
|
|
4532
4530
|
// value is the same as its default, we don't display an HTML
|
|
4533
4531
|
// attribute for it.
|
|
4534
4532
|
parseHTML: (n) => {
|
|
4535
|
-
const r = n.getAttribute(
|
|
4533
|
+
const r = n.getAttribute(ae(o));
|
|
4536
4534
|
if (r === null)
|
|
4537
4535
|
return null;
|
|
4538
4536
|
if (typeof i.default == "boolean")
|
|
@@ -4544,12 +4542,12 @@ function dt(e) {
|
|
|
4544
4542
|
return r;
|
|
4545
4543
|
},
|
|
4546
4544
|
renderHTML: (n) => n[o] !== i.default ? {
|
|
4547
|
-
[
|
|
4545
|
+
[ae(o)]: n[o]
|
|
4548
4546
|
} : {}
|
|
4549
4547
|
};
|
|
4550
4548
|
}), t;
|
|
4551
4549
|
}
|
|
4552
|
-
function
|
|
4550
|
+
function jo(e, t, o, i) {
|
|
4553
4551
|
if (typeof e == "boolean")
|
|
4554
4552
|
throw new Error(
|
|
4555
4553
|
"Cannot find node position as getPos is a boolean, not a function."
|
|
@@ -4562,18 +4560,18 @@ function Vo(e, t, o, i) {
|
|
|
4562
4560
|
throw new Error("Block type does not match");
|
|
4563
4561
|
return s;
|
|
4564
4562
|
}
|
|
4565
|
-
function
|
|
4563
|
+
function fe(e, t, o, i, n = !1, r) {
|
|
4566
4564
|
const a = document.createElement("div");
|
|
4567
4565
|
if (r !== void 0)
|
|
4568
4566
|
for (const [s, l] of Object.entries(r))
|
|
4569
4567
|
s !== "class" && a.setAttribute(s, l);
|
|
4570
|
-
a.className =
|
|
4568
|
+
a.className = D(
|
|
4571
4569
|
"bn-block-content",
|
|
4572
4570
|
(r == null ? void 0 : r.class) || ""
|
|
4573
4571
|
), a.setAttribute("data-content-type", t);
|
|
4574
4572
|
for (const [s, l] of Object.entries(o))
|
|
4575
|
-
!lt.includes(s) && l !== i[s].default && a.setAttribute(
|
|
4576
|
-
return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className =
|
|
4573
|
+
!lt.includes(s) && l !== i[s].default && a.setAttribute(ae(s), l);
|
|
4574
|
+
return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = D(
|
|
4577
4575
|
"bn-inline-content",
|
|
4578
4576
|
e.contentDOM.className
|
|
4579
4577
|
), e.contentDOM.setAttribute("data-editable", "")), {
|
|
@@ -4600,8 +4598,8 @@ function q(e, t, o) {
|
|
|
4600
4598
|
{
|
|
4601
4599
|
node: e,
|
|
4602
4600
|
requiredExtensions: o,
|
|
4603
|
-
toInternalHTML:
|
|
4604
|
-
toExternalHTML:
|
|
4601
|
+
toInternalHTML: Oe,
|
|
4602
|
+
toExternalHTML: Oe
|
|
4605
4603
|
// parse: () => undefined, // parse rules are in node already
|
|
4606
4604
|
}
|
|
4607
4605
|
);
|
|
@@ -4611,7 +4609,7 @@ function ut(e) {
|
|
|
4611
4609
|
Object.entries(e).map(([t, o]) => [t, o.config])
|
|
4612
4610
|
);
|
|
4613
4611
|
}
|
|
4614
|
-
function
|
|
4612
|
+
function Do(e, t) {
|
|
4615
4613
|
const o = [
|
|
4616
4614
|
{
|
|
4617
4615
|
tag: "[data-content-type=" + e.type + "]",
|
|
@@ -4628,7 +4626,7 @@ function Oo(e, t) {
|
|
|
4628
4626
|
}
|
|
4629
4627
|
}), o;
|
|
4630
4628
|
}
|
|
4631
|
-
function
|
|
4629
|
+
function le(e, t) {
|
|
4632
4630
|
const o = O({
|
|
4633
4631
|
name: e.type,
|
|
4634
4632
|
content: e.content === "inline" ? "inline*" : "",
|
|
@@ -4638,7 +4636,7 @@ function se(e, t) {
|
|
|
4638
4636
|
return dt(e.propSchema);
|
|
4639
4637
|
},
|
|
4640
4638
|
parseHTML() {
|
|
4641
|
-
return
|
|
4639
|
+
return Do(e, t.parse);
|
|
4642
4640
|
},
|
|
4643
4641
|
renderHTML() {
|
|
4644
4642
|
const i = document.createElement("div");
|
|
@@ -4649,13 +4647,13 @@ function se(e, t) {
|
|
|
4649
4647
|
addNodeView() {
|
|
4650
4648
|
return ({ getPos: i }) => {
|
|
4651
4649
|
var l;
|
|
4652
|
-
const n = this.options.editor, r =
|
|
4650
|
+
const n = this.options.editor, r = jo(
|
|
4653
4651
|
i,
|
|
4654
4652
|
n,
|
|
4655
4653
|
this.editor,
|
|
4656
4654
|
e.type
|
|
4657
4655
|
), a = ((l = this.options.domAttributes) == null ? void 0 : l.blockContent) || {}, s = t.render(r, n);
|
|
4658
|
-
return
|
|
4656
|
+
return fe(
|
|
4659
4657
|
s,
|
|
4660
4658
|
r.type,
|
|
4661
4659
|
r.props,
|
|
@@ -4674,7 +4672,7 @@ function se(e, t) {
|
|
|
4674
4672
|
toInternalHTML: (i, n) => {
|
|
4675
4673
|
var s;
|
|
4676
4674
|
const r = ((s = o.options.domAttributes) == null ? void 0 : s.blockContent) || {}, a = t.render(i, n);
|
|
4677
|
-
return
|
|
4675
|
+
return fe(
|
|
4678
4676
|
a,
|
|
4679
4677
|
i.type,
|
|
4680
4678
|
i.props,
|
|
@@ -4691,7 +4689,7 @@ function se(e, t) {
|
|
|
4691
4689
|
i,
|
|
4692
4690
|
n
|
|
4693
4691
|
);
|
|
4694
|
-
return a === void 0 && (a = t.render(i, n)),
|
|
4692
|
+
return a === void 0 && (a = t.render(i, n)), fe(
|
|
4695
4693
|
a,
|
|
4696
4694
|
i.type,
|
|
4697
4695
|
i.props,
|
|
@@ -4701,10 +4699,10 @@ function se(e, t) {
|
|
|
4701
4699
|
}
|
|
4702
4700
|
});
|
|
4703
4701
|
}
|
|
4704
|
-
function
|
|
4705
|
-
return e.dom.setAttribute("data-inline-content-type", t), Object.entries(o).filter(([n, r]) => r !== i[n].default).map(([n, r]) => [
|
|
4702
|
+
function Vo(e, t, o, i) {
|
|
4703
|
+
return e.dom.setAttribute("data-inline-content-type", t), Object.entries(o).filter(([n, r]) => r !== i[n].default).map(([n, r]) => [ae(n), r]).forEach(([n, r]) => e.dom.setAttribute(n, r)), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
|
|
4706
4704
|
}
|
|
4707
|
-
function
|
|
4705
|
+
function Ro(e) {
|
|
4708
4706
|
return {
|
|
4709
4707
|
Backspace: ({ editor: t }) => {
|
|
4710
4708
|
const o = t.state.selection.$from;
|
|
@@ -4712,14 +4710,14 @@ function Fo(e) {
|
|
|
4712
4710
|
}
|
|
4713
4711
|
};
|
|
4714
4712
|
}
|
|
4715
|
-
function
|
|
4713
|
+
function Oo(e, t) {
|
|
4716
4714
|
return {
|
|
4717
4715
|
config: e,
|
|
4718
4716
|
implementation: t
|
|
4719
4717
|
};
|
|
4720
4718
|
}
|
|
4721
|
-
function
|
|
4722
|
-
return
|
|
4719
|
+
function zo(e, t) {
|
|
4720
|
+
return Oo(
|
|
4723
4721
|
{
|
|
4724
4722
|
type: e.name,
|
|
4725
4723
|
propSchema: t,
|
|
@@ -4735,7 +4733,7 @@ function pt(e) {
|
|
|
4735
4733
|
Object.entries(e).map(([t, o]) => [t, o.config])
|
|
4736
4734
|
);
|
|
4737
4735
|
}
|
|
4738
|
-
function
|
|
4736
|
+
function Fo(e) {
|
|
4739
4737
|
return [
|
|
4740
4738
|
{
|
|
4741
4739
|
tag: `[data-inline-content-type="${e.type}"]`,
|
|
@@ -4746,7 +4744,7 @@ function Wo(e) {
|
|
|
4746
4744
|
}
|
|
4747
4745
|
];
|
|
4748
4746
|
}
|
|
4749
|
-
function
|
|
4747
|
+
function Or(e, t) {
|
|
4750
4748
|
const o = $.create({
|
|
4751
4749
|
name: e.type,
|
|
4752
4750
|
inline: !0,
|
|
@@ -4758,10 +4756,10 @@ function Wr(e, t) {
|
|
|
4758
4756
|
return dt(e.propSchema);
|
|
4759
4757
|
},
|
|
4760
4758
|
addKeyboardShortcuts() {
|
|
4761
|
-
return
|
|
4759
|
+
return Ro(e);
|
|
4762
4760
|
},
|
|
4763
4761
|
parseHTML() {
|
|
4764
|
-
return
|
|
4762
|
+
return Fo(e);
|
|
4765
4763
|
},
|
|
4766
4764
|
renderHTML({ node: i }) {
|
|
4767
4765
|
const n = this.options.editor, r = t.render(
|
|
@@ -4772,7 +4770,7 @@ function Wr(e, t) {
|
|
|
4772
4770
|
)
|
|
4773
4771
|
// TODO: fix cast
|
|
4774
4772
|
);
|
|
4775
|
-
return
|
|
4773
|
+
return Vo(
|
|
4776
4774
|
r,
|
|
4777
4775
|
e.type,
|
|
4778
4776
|
i.attrs,
|
|
@@ -4780,12 +4778,12 @@ function Wr(e, t) {
|
|
|
4780
4778
|
);
|
|
4781
4779
|
}
|
|
4782
4780
|
});
|
|
4783
|
-
return
|
|
4781
|
+
return zo(
|
|
4784
4782
|
o,
|
|
4785
4783
|
e.propSchema
|
|
4786
4784
|
);
|
|
4787
4785
|
}
|
|
4788
|
-
function
|
|
4786
|
+
function Go(e) {
|
|
4789
4787
|
return e === "boolean" ? {} : {
|
|
4790
4788
|
stringValue: {
|
|
4791
4789
|
default: void 0,
|
|
@@ -4797,7 +4795,7 @@ function $o(e) {
|
|
|
4797
4795
|
}
|
|
4798
4796
|
};
|
|
4799
4797
|
}
|
|
4800
|
-
function
|
|
4798
|
+
function Ko(e, t, o, i) {
|
|
4801
4799
|
return e.dom.setAttribute("data-style-type", t), i === "string" && e.dom.setAttribute("data-value", o), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
|
|
4802
4800
|
}
|
|
4803
4801
|
function ht(e, t) {
|
|
@@ -4822,7 +4820,7 @@ function mt(e) {
|
|
|
4822
4820
|
Object.entries(e).map(([t, o]) => [t, o.config])
|
|
4823
4821
|
);
|
|
4824
4822
|
}
|
|
4825
|
-
function
|
|
4823
|
+
function Wo(e) {
|
|
4826
4824
|
return [
|
|
4827
4825
|
{
|
|
4828
4826
|
tag: `[data-style-type="${e.type}"]`,
|
|
@@ -4833,14 +4831,14 @@ function Xo(e) {
|
|
|
4833
4831
|
}
|
|
4834
4832
|
];
|
|
4835
4833
|
}
|
|
4836
|
-
function
|
|
4837
|
-
const o =
|
|
4834
|
+
function zr(e, t) {
|
|
4835
|
+
const o = Ce.create({
|
|
4838
4836
|
name: e.type,
|
|
4839
4837
|
addAttributes() {
|
|
4840
|
-
return
|
|
4838
|
+
return Go(e.propSchema);
|
|
4841
4839
|
},
|
|
4842
4840
|
parseHTML() {
|
|
4843
|
-
return
|
|
4841
|
+
return Wo(e);
|
|
4844
4842
|
},
|
|
4845
4843
|
renderHTML({ mark: i }) {
|
|
4846
4844
|
let n;
|
|
@@ -4850,7 +4848,7 @@ function $r(e, t) {
|
|
|
4850
4848
|
n = t.render(i.attrs.stringValue);
|
|
4851
4849
|
else
|
|
4852
4850
|
throw new I(e.propSchema);
|
|
4853
|
-
return
|
|
4851
|
+
return Ko(
|
|
4854
4852
|
n,
|
|
4855
4853
|
e.type,
|
|
4856
4854
|
i.attrs.stringValue,
|
|
@@ -4862,7 +4860,7 @@ function $r(e, t) {
|
|
|
4862
4860
|
mark: o
|
|
4863
4861
|
});
|
|
4864
4862
|
}
|
|
4865
|
-
const
|
|
4863
|
+
const de = (e) => {
|
|
4866
4864
|
const t = document.createElement("div");
|
|
4867
4865
|
t.className = "bn-file-default-preview";
|
|
4868
4866
|
const o = document.createElement("div");
|
|
@@ -4871,14 +4869,14 @@ const le = (e) => {
|
|
|
4871
4869
|
return i.className = "bn-file-default-preview-name", i.textContent = e.props.name || "", t.appendChild(o), t.appendChild(i), {
|
|
4872
4870
|
dom: t
|
|
4873
4871
|
};
|
|
4874
|
-
},
|
|
4872
|
+
}, R = (e, t) => {
|
|
4875
4873
|
const o = document.createElement("div");
|
|
4876
4874
|
o.className = "bn-file-and-caption-wrapper";
|
|
4877
4875
|
const i = document.createElement("p");
|
|
4878
4876
|
return i.className = "bn-file-caption", i.textContent = e.props.caption, o.appendChild(t), o.appendChild(i), {
|
|
4879
4877
|
dom: o
|
|
4880
4878
|
};
|
|
4881
|
-
},
|
|
4879
|
+
}, ce = (e, t, o, i) => {
|
|
4882
4880
|
const n = document.createElement("div");
|
|
4883
4881
|
n.className = "bn-add-file-button";
|
|
4884
4882
|
const r = document.createElement("div");
|
|
@@ -4912,7 +4910,7 @@ const le = (e) => {
|
|
|
4912
4910
|
);
|
|
4913
4911
|
}
|
|
4914
4912
|
};
|
|
4915
|
-
},
|
|
4913
|
+
}, ze = (e) => ({ url: e.src || void 0 }), ue = (e, t) => {
|
|
4916
4914
|
const o = e.querySelector(
|
|
4917
4915
|
t
|
|
4918
4916
|
);
|
|
@@ -4920,12 +4918,12 @@ const le = (e) => {
|
|
|
4920
4918
|
return;
|
|
4921
4919
|
const i = e.querySelector("figcaption"), n = (i == null ? void 0 : i.textContent) ?? void 0;
|
|
4922
4920
|
return { targetElement: o, caption: n };
|
|
4923
|
-
},
|
|
4921
|
+
}, pe = (e, t) => {
|
|
4924
4922
|
const o = document.createElement("div"), i = document.createElement("p");
|
|
4925
4923
|
return i.textContent = t, o.appendChild(e), o.appendChild(i), {
|
|
4926
4924
|
dom: o
|
|
4927
4925
|
};
|
|
4928
|
-
},
|
|
4926
|
+
}, Te = (e, t) => {
|
|
4929
4927
|
const o = document.createElement("figure"), i = document.createElement("figcaption");
|
|
4930
4928
|
return i.textContent = t, o.appendChild(e), o.appendChild(i), { dom: o };
|
|
4931
4929
|
}, ft = (e, t, o, i, n) => {
|
|
@@ -4988,7 +4986,7 @@ const le = (e) => {
|
|
|
4988
4986
|
);
|
|
4989
4987
|
}
|
|
4990
4988
|
};
|
|
4991
|
-
},
|
|
4989
|
+
}, Fe = (e) => ({ url: e.src || void 0 }), $o = {
|
|
4992
4990
|
backgroundColor: _.backgroundColor,
|
|
4993
4991
|
// File name.
|
|
4994
4992
|
name: {
|
|
@@ -5005,18 +5003,18 @@ const le = (e) => {
|
|
|
5005
5003
|
showPreview: {
|
|
5006
5004
|
default: !0
|
|
5007
5005
|
}
|
|
5008
|
-
},
|
|
5006
|
+
}, qo = {
|
|
5009
5007
|
type: "audio",
|
|
5010
|
-
propSchema:
|
|
5008
|
+
propSchema: $o,
|
|
5011
5009
|
content: "none",
|
|
5012
5010
|
isFileBlock: !0,
|
|
5013
5011
|
fileBlockAcceptMimeTypes: ["audio/*"]
|
|
5014
|
-
},
|
|
5012
|
+
}, Xo = (e, t) => {
|
|
5015
5013
|
const o = document.createElement("div");
|
|
5016
5014
|
if (o.className = "bn-file-block-content-wrapper", e.props.url === "") {
|
|
5017
5015
|
const i = document.createElement("div");
|
|
5018
5016
|
i.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>';
|
|
5019
|
-
const n =
|
|
5017
|
+
const n = ce(
|
|
5020
5018
|
e,
|
|
5021
5019
|
t,
|
|
5022
5020
|
t.dictionary.file_blocks.audio.add_button_text,
|
|
@@ -5034,30 +5032,30 @@ const le = (e) => {
|
|
|
5034
5032
|
i.className = "bn-audio", t.resolveFileUrl(e.props.url).then((r) => {
|
|
5035
5033
|
i.src = r;
|
|
5036
5034
|
}), i.controls = !0, i.contentEditable = "false", i.draggable = !1;
|
|
5037
|
-
const n =
|
|
5035
|
+
const n = R(e, i);
|
|
5038
5036
|
return o.appendChild(n.dom), {
|
|
5039
5037
|
dom: o
|
|
5040
5038
|
};
|
|
5041
5039
|
} else {
|
|
5042
|
-
const i =
|
|
5040
|
+
const i = de(e).dom;
|
|
5043
5041
|
return {
|
|
5044
|
-
dom:
|
|
5042
|
+
dom: R(e, i).dom
|
|
5045
5043
|
};
|
|
5046
5044
|
}
|
|
5047
|
-
},
|
|
5045
|
+
}, Zo = (e) => {
|
|
5048
5046
|
if (e.tagName === "AUDIO")
|
|
5049
|
-
return
|
|
5047
|
+
return Fe(e);
|
|
5050
5048
|
if (e.tagName === "FIGURE") {
|
|
5051
|
-
const t =
|
|
5049
|
+
const t = ue(e, "audio");
|
|
5052
5050
|
if (!t)
|
|
5053
5051
|
return;
|
|
5054
5052
|
const { targetElement: o, caption: i } = t;
|
|
5055
5053
|
return {
|
|
5056
|
-
...
|
|
5054
|
+
...Fe(o),
|
|
5057
5055
|
caption: i
|
|
5058
5056
|
};
|
|
5059
5057
|
}
|
|
5060
|
-
},
|
|
5058
|
+
}, Jo = (e) => {
|
|
5061
5059
|
if (!e.props.url) {
|
|
5062
5060
|
const o = document.createElement("p");
|
|
5063
5061
|
return o.textContent = "Add audio", {
|
|
@@ -5065,14 +5063,14 @@ const le = (e) => {
|
|
|
5065
5063
|
};
|
|
5066
5064
|
}
|
|
5067
5065
|
let t;
|
|
5068
|
-
return e.props.showPreview ? (t = document.createElement("audio"), t.src = e.props.url) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ?
|
|
5066
|
+
return e.props.showPreview ? (t = document.createElement("audio"), t.src = e.props.url) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Te(t, e.props.caption) : pe(t, e.props.caption) : {
|
|
5069
5067
|
dom: t
|
|
5070
5068
|
};
|
|
5071
|
-
},
|
|
5072
|
-
render:
|
|
5073
|
-
parse:
|
|
5074
|
-
toExternalHTML:
|
|
5075
|
-
}),
|
|
5069
|
+
}, Yo = le(qo, {
|
|
5070
|
+
render: Xo,
|
|
5071
|
+
parse: Zo,
|
|
5072
|
+
toExternalHTML: Jo
|
|
5073
|
+
}), Qo = {
|
|
5076
5074
|
backgroundColor: _.backgroundColor,
|
|
5077
5075
|
// File name.
|
|
5078
5076
|
name: {
|
|
@@ -5086,39 +5084,39 @@ const le = (e) => {
|
|
|
5086
5084
|
caption: {
|
|
5087
5085
|
default: ""
|
|
5088
5086
|
}
|
|
5089
|
-
},
|
|
5087
|
+
}, ei = {
|
|
5090
5088
|
type: "file",
|
|
5091
|
-
propSchema:
|
|
5089
|
+
propSchema: Qo,
|
|
5092
5090
|
content: "none",
|
|
5093
5091
|
isFileBlock: !0
|
|
5094
|
-
},
|
|
5092
|
+
}, ti = (e, t) => {
|
|
5095
5093
|
const o = document.createElement("div");
|
|
5096
5094
|
if (o.className = "bn-file-block-content-wrapper", e.props.url === "") {
|
|
5097
|
-
const i =
|
|
5095
|
+
const i = ce(e, t);
|
|
5098
5096
|
return o.appendChild(i.dom), {
|
|
5099
5097
|
dom: o,
|
|
5100
5098
|
destroy: i.destroy
|
|
5101
5099
|
};
|
|
5102
5100
|
} else {
|
|
5103
|
-
const i =
|
|
5101
|
+
const i = de(e).dom, n = R(e, i);
|
|
5104
5102
|
return o.appendChild(n.dom), {
|
|
5105
5103
|
dom: o
|
|
5106
5104
|
};
|
|
5107
5105
|
}
|
|
5108
|
-
},
|
|
5106
|
+
}, oi = (e) => {
|
|
5109
5107
|
if (e.tagName === "EMBED")
|
|
5110
|
-
return
|
|
5108
|
+
return ze(e);
|
|
5111
5109
|
if (e.tagName === "FIGURE") {
|
|
5112
|
-
const t =
|
|
5110
|
+
const t = ue(e, "embed");
|
|
5113
5111
|
if (!t)
|
|
5114
5112
|
return;
|
|
5115
5113
|
const { targetElement: o, caption: i } = t;
|
|
5116
5114
|
return {
|
|
5117
|
-
...
|
|
5115
|
+
...ze(o),
|
|
5118
5116
|
caption: i
|
|
5119
5117
|
};
|
|
5120
5118
|
}
|
|
5121
|
-
},
|
|
5119
|
+
}, ii = (e) => {
|
|
5122
5120
|
if (!e.props.url) {
|
|
5123
5121
|
const o = document.createElement("p");
|
|
5124
5122
|
return o.textContent = "Add file", {
|
|
@@ -5126,17 +5124,17 @@ const le = (e) => {
|
|
|
5126
5124
|
};
|
|
5127
5125
|
}
|
|
5128
5126
|
const t = document.createElement("a");
|
|
5129
|
-
return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ?
|
|
5127
|
+
return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? pe(t, e.props.caption) : {
|
|
5130
5128
|
dom: t
|
|
5131
5129
|
};
|
|
5132
|
-
},
|
|
5133
|
-
render:
|
|
5134
|
-
parse:
|
|
5135
|
-
toExternalHTML:
|
|
5136
|
-
}),
|
|
5130
|
+
}, ni = le(ei, {
|
|
5131
|
+
render: ti,
|
|
5132
|
+
parse: oi,
|
|
5133
|
+
toExternalHTML: ii
|
|
5134
|
+
}), Ge = (e) => {
|
|
5137
5135
|
const t = e.src || void 0, o = e.width || void 0;
|
|
5138
5136
|
return { url: t, previewWidth: o };
|
|
5139
|
-
},
|
|
5137
|
+
}, ri = {
|
|
5140
5138
|
textAlignment: _.textAlignment,
|
|
5141
5139
|
backgroundColor: _.backgroundColor,
|
|
5142
5140
|
// File name.
|
|
@@ -5158,18 +5156,18 @@ const le = (e) => {
|
|
|
5158
5156
|
previewWidth: {
|
|
5159
5157
|
default: 512
|
|
5160
5158
|
}
|
|
5161
|
-
},
|
|
5159
|
+
}, ai = {
|
|
5162
5160
|
type: "image",
|
|
5163
|
-
propSchema:
|
|
5161
|
+
propSchema: ri,
|
|
5164
5162
|
content: "none",
|
|
5165
5163
|
isFileBlock: !0,
|
|
5166
5164
|
fileBlockAcceptMimeTypes: ["image/*"]
|
|
5167
|
-
},
|
|
5165
|
+
}, si = (e, t) => {
|
|
5168
5166
|
const o = document.createElement("div");
|
|
5169
5167
|
if (o.className = "bn-file-block-content-wrapper", e.props.url === "") {
|
|
5170
5168
|
const i = document.createElement("div");
|
|
5171
5169
|
i.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>';
|
|
5172
|
-
const n =
|
|
5170
|
+
const n = ce(
|
|
5173
5171
|
e,
|
|
5174
5172
|
t,
|
|
5175
5173
|
t.dictionary.file_blocks.image.add_button_text,
|
|
@@ -5196,31 +5194,31 @@ const le = (e) => {
|
|
|
5196
5194
|
i,
|
|
5197
5195
|
() => i.width,
|
|
5198
5196
|
(a) => i.width = a
|
|
5199
|
-
), r =
|
|
5197
|
+
), r = R(e, n.dom);
|
|
5200
5198
|
return o.appendChild(r.dom), {
|
|
5201
5199
|
dom: o,
|
|
5202
5200
|
destroy: n.destroy
|
|
5203
5201
|
};
|
|
5204
5202
|
} else {
|
|
5205
|
-
const i =
|
|
5203
|
+
const i = de(e).dom;
|
|
5206
5204
|
return {
|
|
5207
|
-
dom:
|
|
5205
|
+
dom: R(e, i).dom
|
|
5208
5206
|
};
|
|
5209
5207
|
}
|
|
5210
|
-
},
|
|
5208
|
+
}, li = (e) => {
|
|
5211
5209
|
if (e.tagName === "IMG")
|
|
5212
|
-
return
|
|
5210
|
+
return Ge(e);
|
|
5213
5211
|
if (e.tagName === "FIGURE") {
|
|
5214
|
-
const t =
|
|
5212
|
+
const t = ue(e, "img");
|
|
5215
5213
|
if (!t)
|
|
5216
5214
|
return;
|
|
5217
5215
|
const { targetElement: o, caption: i } = t;
|
|
5218
5216
|
return {
|
|
5219
|
-
...
|
|
5217
|
+
...Ge(o),
|
|
5220
5218
|
caption: i
|
|
5221
5219
|
};
|
|
5222
5220
|
}
|
|
5223
|
-
},
|
|
5221
|
+
}, di = (e) => {
|
|
5224
5222
|
if (!e.props.url) {
|
|
5225
5223
|
const o = document.createElement("p");
|
|
5226
5224
|
return o.textContent = "Add image", {
|
|
@@ -5228,17 +5226,17 @@ const le = (e) => {
|
|
|
5228
5226
|
};
|
|
5229
5227
|
}
|
|
5230
5228
|
let t;
|
|
5231
|
-
return e.props.showPreview ? (t = document.createElement("img"), t.src = e.props.url, t.alt = e.props.name || e.props.caption || "BlockNote image", t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ?
|
|
5229
|
+
return e.props.showPreview ? (t = document.createElement("img"), t.src = e.props.url, t.alt = e.props.name || e.props.caption || "BlockNote image", t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Te(t, e.props.caption) : pe(t, e.props.caption) : {
|
|
5232
5230
|
dom: t
|
|
5233
5231
|
};
|
|
5234
|
-
},
|
|
5235
|
-
render:
|
|
5236
|
-
parse:
|
|
5237
|
-
toExternalHTML:
|
|
5238
|
-
}),
|
|
5232
|
+
}, ci = le(ai, {
|
|
5233
|
+
render: si,
|
|
5234
|
+
parse: li,
|
|
5235
|
+
toExternalHTML: di
|
|
5236
|
+
}), Ke = (e) => {
|
|
5239
5237
|
const t = e.src || void 0, o = e.width || void 0;
|
|
5240
5238
|
return { url: t, previewWidth: o };
|
|
5241
|
-
},
|
|
5239
|
+
}, ui = {
|
|
5242
5240
|
textAlignment: _.textAlignment,
|
|
5243
5241
|
backgroundColor: _.backgroundColor,
|
|
5244
5242
|
// File name.
|
|
@@ -5260,18 +5258,18 @@ const le = (e) => {
|
|
|
5260
5258
|
previewWidth: {
|
|
5261
5259
|
default: 512
|
|
5262
5260
|
}
|
|
5263
|
-
},
|
|
5261
|
+
}, pi = {
|
|
5264
5262
|
type: "video",
|
|
5265
|
-
propSchema:
|
|
5263
|
+
propSchema: ui,
|
|
5266
5264
|
content: "none",
|
|
5267
5265
|
isFileBlock: !0,
|
|
5268
5266
|
fileBlockAcceptMimeTypes: ["video/*"]
|
|
5269
|
-
},
|
|
5267
|
+
}, hi = (e, t) => {
|
|
5270
5268
|
const o = document.createElement("div");
|
|
5271
5269
|
if (o.className = "bn-file-block-content-wrapper", e.props.url === "") {
|
|
5272
5270
|
const i = document.createElement("div");
|
|
5273
5271
|
i.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>';
|
|
5274
|
-
const n =
|
|
5272
|
+
const n = ce(
|
|
5275
5273
|
e,
|
|
5276
5274
|
t,
|
|
5277
5275
|
t.dictionary.file_blocks.video.add_button_text,
|
|
@@ -5296,31 +5294,31 @@ const le = (e) => {
|
|
|
5296
5294
|
i,
|
|
5297
5295
|
() => i.width,
|
|
5298
5296
|
(a) => i.width = a
|
|
5299
|
-
), r =
|
|
5297
|
+
), r = R(e, n.dom);
|
|
5300
5298
|
return o.appendChild(r.dom), {
|
|
5301
5299
|
dom: o,
|
|
5302
5300
|
destroy: n.destroy
|
|
5303
5301
|
};
|
|
5304
5302
|
} else {
|
|
5305
|
-
const i =
|
|
5303
|
+
const i = de(e).dom;
|
|
5306
5304
|
return {
|
|
5307
|
-
dom:
|
|
5305
|
+
dom: R(e, i).dom
|
|
5308
5306
|
};
|
|
5309
5307
|
}
|
|
5310
|
-
},
|
|
5308
|
+
}, mi = (e) => {
|
|
5311
5309
|
if (e.tagName === "VIDEO")
|
|
5312
|
-
return
|
|
5310
|
+
return Ke(e);
|
|
5313
5311
|
if (e.tagName === "FIGURE") {
|
|
5314
|
-
const t =
|
|
5312
|
+
const t = ue(e, "video");
|
|
5315
5313
|
if (!t)
|
|
5316
5314
|
return;
|
|
5317
5315
|
const { targetElement: o, caption: i } = t;
|
|
5318
5316
|
return {
|
|
5319
|
-
...
|
|
5317
|
+
...Ke(o),
|
|
5320
5318
|
caption: i
|
|
5321
5319
|
};
|
|
5322
5320
|
}
|
|
5323
|
-
},
|
|
5321
|
+
}, fi = (e) => {
|
|
5324
5322
|
if (!e.props.url) {
|
|
5325
5323
|
const o = document.createElement("p");
|
|
5326
5324
|
return o.textContent = "Add video", {
|
|
@@ -5328,14 +5326,14 @@ const le = (e) => {
|
|
|
5328
5326
|
};
|
|
5329
5327
|
}
|
|
5330
5328
|
let t;
|
|
5331
|
-
return e.props.showPreview ? (t = document.createElement("video"), t.src = e.props.url, t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ?
|
|
5329
|
+
return e.props.showPreview ? (t = document.createElement("video"), t.src = e.props.url, t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Te(t, e.props.caption) : pe(t, e.props.caption) : {
|
|
5332
5330
|
dom: t
|
|
5333
5331
|
};
|
|
5334
|
-
},
|
|
5335
|
-
render:
|
|
5336
|
-
parse:
|
|
5337
|
-
toExternalHTML:
|
|
5338
|
-
}),
|
|
5332
|
+
}, gi = le(pi, {
|
|
5333
|
+
render: hi,
|
|
5334
|
+
parse: mi,
|
|
5335
|
+
toExternalHTML: fi
|
|
5336
|
+
}), Fr = async (e) => {
|
|
5339
5337
|
const t = new FormData();
|
|
5340
5338
|
return t.append("file", e), (await (await fetch("https://tmpfiles.org/api/v1/upload", {
|
|
5341
5339
|
method: "POST",
|
|
@@ -5344,7 +5342,7 @@ const le = (e) => {
|
|
|
5344
5342
|
"tmpfiles.org/",
|
|
5345
5343
|
"tmpfiles.org/dl/"
|
|
5346
5344
|
);
|
|
5347
|
-
},
|
|
5345
|
+
}, bi = Ce.create({
|
|
5348
5346
|
name: "backgroundColor",
|
|
5349
5347
|
addAttributes() {
|
|
5350
5348
|
return {
|
|
@@ -5370,10 +5368,10 @@ const le = (e) => {
|
|
|
5370
5368
|
renderHTML({ HTMLAttributes: e }) {
|
|
5371
5369
|
return ["span", e, 0];
|
|
5372
5370
|
}
|
|
5373
|
-
}),
|
|
5374
|
-
|
|
5371
|
+
}), ki = U(
|
|
5372
|
+
bi,
|
|
5375
5373
|
"string"
|
|
5376
|
-
),
|
|
5374
|
+
), _i = Ce.create({
|
|
5377
5375
|
name: "textColor",
|
|
5378
5376
|
addAttributes() {
|
|
5379
5377
|
return {
|
|
@@ -5397,16 +5395,16 @@ const le = (e) => {
|
|
|
5397
5395
|
renderHTML({ HTMLAttributes: e }) {
|
|
5398
5396
|
return ["span", e, 0];
|
|
5399
5397
|
}
|
|
5400
|
-
}),
|
|
5398
|
+
}), yi = U(_i, "string"), C = (e) => {
|
|
5401
5399
|
const { contentType: t } = k(
|
|
5402
5400
|
e.state.doc,
|
|
5403
5401
|
e.state.selection.from
|
|
5404
5402
|
);
|
|
5405
5403
|
return t.spec.content;
|
|
5406
|
-
},
|
|
5404
|
+
}, wi = {
|
|
5407
5405
|
..._,
|
|
5408
5406
|
level: { default: 1, values: [1, 2, 3] }
|
|
5409
|
-
},
|
|
5407
|
+
}, vi = O({
|
|
5410
5408
|
name: "heading",
|
|
5411
5409
|
content: "inline*",
|
|
5412
5410
|
group: "blockContent",
|
|
@@ -5499,7 +5497,7 @@ const le = (e) => {
|
|
|
5499
5497
|
},
|
|
5500
5498
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
5501
5499
|
var o, i;
|
|
5502
|
-
return
|
|
5500
|
+
return V(
|
|
5503
5501
|
this.name,
|
|
5504
5502
|
`h${e.attrs.level}`,
|
|
5505
5503
|
{
|
|
@@ -5509,10 +5507,10 @@ const le = (e) => {
|
|
|
5509
5507
|
((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
|
|
5510
5508
|
);
|
|
5511
5509
|
}
|
|
5512
|
-
}),
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
),
|
|
5510
|
+
}), xi = q(
|
|
5511
|
+
vi,
|
|
5512
|
+
wi
|
|
5513
|
+
), Be = (e) => {
|
|
5516
5514
|
const { contentNode: t, contentType: o } = k(
|
|
5517
5515
|
e.state.doc,
|
|
5518
5516
|
e.state.selection.from
|
|
@@ -5531,9 +5529,9 @@ const le = (e) => {
|
|
|
5531
5529
|
a.command(() => t.childCount > 0 ? (r().deleteSelection().BNSplitBlock(n.selection.from, !0).run(), !0) : !1)
|
|
5532
5530
|
)
|
|
5533
5531
|
]);
|
|
5534
|
-
},
|
|
5532
|
+
}, Ei = {
|
|
5535
5533
|
..._
|
|
5536
|
-
},
|
|
5534
|
+
}, Ci = O({
|
|
5537
5535
|
name: "bulletListItem",
|
|
5538
5536
|
content: "inline*",
|
|
5539
5537
|
group: "blockContent",
|
|
@@ -5556,7 +5554,7 @@ const le = (e) => {
|
|
|
5556
5554
|
},
|
|
5557
5555
|
addKeyboardShortcuts() {
|
|
5558
5556
|
return {
|
|
5559
|
-
Enter: () =>
|
|
5557
|
+
Enter: () => Be(this.editor),
|
|
5560
5558
|
"Mod-Shift-8": () => C(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
|
|
5561
5559
|
this.editor.state.selection.anchor,
|
|
5562
5560
|
{
|
|
@@ -5599,7 +5597,7 @@ const le = (e) => {
|
|
|
5599
5597
|
},
|
|
5600
5598
|
renderHTML({ HTMLAttributes: e }) {
|
|
5601
5599
|
var t, o;
|
|
5602
|
-
return
|
|
5600
|
+
return V(
|
|
5603
5601
|
this.name,
|
|
5604
5602
|
// We use a <p> tag, because for <li> tags we'd need a <ul> element to put
|
|
5605
5603
|
// them in to be semantically correct, which we can't have due to the
|
|
@@ -5612,11 +5610,11 @@ const le = (e) => {
|
|
|
5612
5610
|
((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
|
|
5613
5611
|
);
|
|
5614
5612
|
}
|
|
5615
|
-
}),
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
),
|
|
5619
|
-
key:
|
|
5613
|
+
}), Si = q(
|
|
5614
|
+
Ci,
|
|
5615
|
+
Ei
|
|
5616
|
+
), Mi = new S("numbered-list-indexing"), Ti = () => new y({
|
|
5617
|
+
key: Mi,
|
|
5620
5618
|
appendTransaction: (e, t, o) => {
|
|
5621
5619
|
const i = o.tr;
|
|
5622
5620
|
i.setMeta("numberedListIndexing", !0);
|
|
@@ -5645,9 +5643,9 @@ const le = (e) => {
|
|
|
5645
5643
|
}
|
|
5646
5644
|
}), n ? i : null;
|
|
5647
5645
|
}
|
|
5648
|
-
}),
|
|
5646
|
+
}), Bi = {
|
|
5649
5647
|
..._
|
|
5650
|
-
},
|
|
5648
|
+
}, Li = O({
|
|
5651
5649
|
name: "numberedListItem",
|
|
5652
5650
|
content: "inline*",
|
|
5653
5651
|
group: "blockContent",
|
|
@@ -5679,7 +5677,7 @@ const le = (e) => {
|
|
|
5679
5677
|
},
|
|
5680
5678
|
addKeyboardShortcuts() {
|
|
5681
5679
|
return {
|
|
5682
|
-
Enter: () =>
|
|
5680
|
+
Enter: () => Be(this.editor),
|
|
5683
5681
|
"Mod-Shift-7": () => C(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
|
|
5684
5682
|
this.editor.state.selection.anchor,
|
|
5685
5683
|
{
|
|
@@ -5690,7 +5688,7 @@ const le = (e) => {
|
|
|
5690
5688
|
};
|
|
5691
5689
|
},
|
|
5692
5690
|
addProseMirrorPlugins() {
|
|
5693
|
-
return [
|
|
5691
|
+
return [Ti()];
|
|
5694
5692
|
},
|
|
5695
5693
|
parseHTML() {
|
|
5696
5694
|
return [
|
|
@@ -5727,7 +5725,7 @@ const le = (e) => {
|
|
|
5727
5725
|
},
|
|
5728
5726
|
renderHTML({ HTMLAttributes: e }) {
|
|
5729
5727
|
var t, o;
|
|
5730
|
-
return
|
|
5728
|
+
return V(
|
|
5731
5729
|
this.name,
|
|
5732
5730
|
// We use a <p> tag, because for <li> tags we'd need an <ol> element to
|
|
5733
5731
|
// put them in to be semantically correct, which we can't have due to the
|
|
@@ -5740,15 +5738,15 @@ const le = (e) => {
|
|
|
5740
5738
|
((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
|
|
5741
5739
|
);
|
|
5742
5740
|
}
|
|
5743
|
-
}),
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
),
|
|
5741
|
+
}), Ii = q(
|
|
5742
|
+
Li,
|
|
5743
|
+
Bi
|
|
5744
|
+
), Ai = {
|
|
5747
5745
|
..._,
|
|
5748
5746
|
checked: {
|
|
5749
5747
|
default: !1
|
|
5750
5748
|
}
|
|
5751
|
-
},
|
|
5749
|
+
}, Ni = O({
|
|
5752
5750
|
name: "checkListItem",
|
|
5753
5751
|
content: "inline*",
|
|
5754
5752
|
group: "blockContent",
|
|
@@ -5793,7 +5791,7 @@ const le = (e) => {
|
|
|
5793
5791
|
},
|
|
5794
5792
|
addKeyboardShortcuts() {
|
|
5795
5793
|
return {
|
|
5796
|
-
Enter: () =>
|
|
5794
|
+
Enter: () => Be(this.editor),
|
|
5797
5795
|
"Mod-Shift-9": () => C(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
|
|
5798
5796
|
this.editor.state.selection.anchor,
|
|
5799
5797
|
{
|
|
@@ -5845,7 +5843,7 @@ const le = (e) => {
|
|
|
5845
5843
|
var r, a;
|
|
5846
5844
|
const o = document.createElement("input");
|
|
5847
5845
|
o.type = "checkbox", o.checked = e.attrs.checked, e.attrs.checked && o.setAttribute("checked", "");
|
|
5848
|
-
const { dom: i, contentDOM: n } =
|
|
5846
|
+
const { dom: i, contentDOM: n } = V(
|
|
5849
5847
|
this.name,
|
|
5850
5848
|
"p",
|
|
5851
5849
|
{
|
|
@@ -5878,7 +5876,7 @@ const le = (e) => {
|
|
|
5878
5876
|
});
|
|
5879
5877
|
};
|
|
5880
5878
|
a.addEventListener("change", s);
|
|
5881
|
-
const { dom: l, contentDOM: d } =
|
|
5879
|
+
const { dom: l, contentDOM: d } = V(
|
|
5882
5880
|
this.name,
|
|
5883
5881
|
"p",
|
|
5884
5882
|
{
|
|
@@ -5900,12 +5898,12 @@ const le = (e) => {
|
|
|
5900
5898
|
};
|
|
5901
5899
|
};
|
|
5902
5900
|
}
|
|
5903
|
-
}),
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
),
|
|
5901
|
+
}), Pi = q(
|
|
5902
|
+
Ni,
|
|
5903
|
+
Ai
|
|
5904
|
+
), Hi = {
|
|
5907
5905
|
..._
|
|
5908
|
-
},
|
|
5906
|
+
}, Ui = O({
|
|
5909
5907
|
name: "paragraph",
|
|
5910
5908
|
content: "inline*",
|
|
5911
5909
|
group: "blockContent",
|
|
@@ -5936,7 +5934,7 @@ const le = (e) => {
|
|
|
5936
5934
|
},
|
|
5937
5935
|
renderHTML({ HTMLAttributes: e }) {
|
|
5938
5936
|
var t, o;
|
|
5939
|
-
return
|
|
5937
|
+
return V(
|
|
5940
5938
|
this.name,
|
|
5941
5939
|
"p",
|
|
5942
5940
|
{
|
|
@@ -5946,10 +5944,10 @@ const le = (e) => {
|
|
|
5946
5944
|
((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
|
|
5947
5945
|
);
|
|
5948
5946
|
}
|
|
5949
|
-
}),
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
),
|
|
5947
|
+
}), ji = q(
|
|
5948
|
+
Ui,
|
|
5949
|
+
Hi
|
|
5950
|
+
), Di = M.create({
|
|
5953
5951
|
name: "BlockNoteTableExtension",
|
|
5954
5952
|
addProseMirrorPlugins: () => [
|
|
5955
5953
|
oo({
|
|
@@ -5977,13 +5975,13 @@ const le = (e) => {
|
|
|
5977
5975
|
};
|
|
5978
5976
|
return {
|
|
5979
5977
|
tableRole: Ut(
|
|
5980
|
-
|
|
5978
|
+
jt(e, "tableRole", t)
|
|
5981
5979
|
)
|
|
5982
5980
|
};
|
|
5983
5981
|
}
|
|
5984
|
-
}),
|
|
5982
|
+
}), Vi = {
|
|
5985
5983
|
..._
|
|
5986
|
-
},
|
|
5984
|
+
}, Ri = O({
|
|
5987
5985
|
name: "table",
|
|
5988
5986
|
content: "tableRow+",
|
|
5989
5987
|
group: "blockContent",
|
|
@@ -5994,7 +5992,7 @@ const le = (e) => {
|
|
|
5994
5992
|
},
|
|
5995
5993
|
renderHTML({ HTMLAttributes: e }) {
|
|
5996
5994
|
var t, o;
|
|
5997
|
-
return
|
|
5995
|
+
return V(
|
|
5998
5996
|
this.name,
|
|
5999
5997
|
"table",
|
|
6000
5998
|
{
|
|
@@ -6004,7 +6002,7 @@ const le = (e) => {
|
|
|
6004
6002
|
((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
|
|
6005
6003
|
);
|
|
6006
6004
|
}
|
|
6007
|
-
}),
|
|
6005
|
+
}), Oi = $.create({
|
|
6008
6006
|
name: "tableParagraph",
|
|
6009
6007
|
group: "tableContent",
|
|
6010
6008
|
content: "inline*",
|
|
@@ -6025,16 +6023,16 @@ const le = (e) => {
|
|
|
6025
6023
|
renderHTML({ HTMLAttributes: e }) {
|
|
6026
6024
|
return [
|
|
6027
6025
|
"p",
|
|
6028
|
-
|
|
6026
|
+
Dt(this.options.HTMLAttributes, e),
|
|
6029
6027
|
0
|
|
6030
6028
|
];
|
|
6031
6029
|
}
|
|
6032
|
-
}),
|
|
6033
|
-
|
|
6034
|
-
|
|
6030
|
+
}), zi = q(
|
|
6031
|
+
Ri,
|
|
6032
|
+
Vi,
|
|
6035
6033
|
[
|
|
6034
|
+
Di,
|
|
6036
6035
|
Oi,
|
|
6037
|
-
Gi,
|
|
6038
6036
|
eo.extend({
|
|
6039
6037
|
content: "tableContent"
|
|
6040
6038
|
}),
|
|
@@ -6044,55 +6042,55 @@ const le = (e) => {
|
|
|
6044
6042
|
to
|
|
6045
6043
|
]
|
|
6046
6044
|
), gt = {
|
|
6047
|
-
paragraph:
|
|
6048
|
-
heading:
|
|
6049
|
-
bulletListItem:
|
|
6050
|
-
numberedListItem:
|
|
6051
|
-
checkListItem:
|
|
6052
|
-
table:
|
|
6053
|
-
file:
|
|
6054
|
-
image:
|
|
6055
|
-
video:
|
|
6056
|
-
audio:
|
|
6057
|
-
},
|
|
6045
|
+
paragraph: ji,
|
|
6046
|
+
heading: xi,
|
|
6047
|
+
bulletListItem: Si,
|
|
6048
|
+
numberedListItem: Ii,
|
|
6049
|
+
checkListItem: Pi,
|
|
6050
|
+
table: zi,
|
|
6051
|
+
file: ni,
|
|
6052
|
+
image: ci,
|
|
6053
|
+
video: gi,
|
|
6054
|
+
audio: Yo
|
|
6055
|
+
}, Fi = ut(gt), bt = {
|
|
6058
6056
|
bold: U(qt, "boolean"),
|
|
6059
6057
|
italic: U(Zt, "boolean"),
|
|
6060
6058
|
underline: U(Yt, "boolean"),
|
|
6061
6059
|
strike: U(Jt, "boolean"),
|
|
6062
6060
|
code: U(Xt, "boolean"),
|
|
6063
|
-
textColor:
|
|
6064
|
-
backgroundColor:
|
|
6065
|
-
},
|
|
6061
|
+
textColor: yi,
|
|
6062
|
+
backgroundColor: ki
|
|
6063
|
+
}, Gr = mt(bt), kt = {
|
|
6066
6064
|
text: { config: "text", implementation: {} },
|
|
6067
6065
|
link: { config: "link", implementation: {} }
|
|
6068
|
-
},
|
|
6066
|
+
}, Gi = pt(
|
|
6069
6067
|
kt
|
|
6070
6068
|
);
|
|
6071
6069
|
function E(e, t) {
|
|
6072
|
-
return e in t.schema.blockSchema && t.schema.blockSchema[e] ===
|
|
6070
|
+
return e in t.schema.blockSchema && t.schema.blockSchema[e] === Fi[e];
|
|
6073
6071
|
}
|
|
6074
|
-
function
|
|
6075
|
-
return e in t.schema.inlineContentSchema && t.schema.inlineContentSchema[e] ===
|
|
6072
|
+
function Ki(e, t) {
|
|
6073
|
+
return e in t.schema.inlineContentSchema && t.schema.inlineContentSchema[e] === Gi[e];
|
|
6076
6074
|
}
|
|
6077
|
-
function
|
|
6075
|
+
function Wi(e, t, o) {
|
|
6078
6076
|
return t.type === e && t.type in o.schema.blockSchema && E(t.type, o);
|
|
6079
6077
|
}
|
|
6080
|
-
function
|
|
6078
|
+
function Kr(e, t) {
|
|
6081
6079
|
return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock || !1;
|
|
6082
6080
|
}
|
|
6083
|
-
function
|
|
6081
|
+
function Wr(e, t) {
|
|
6084
6082
|
return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock && "showPreview" in t.schema.blockSchema[e.type].propSchema || !1;
|
|
6085
6083
|
}
|
|
6086
|
-
function
|
|
6084
|
+
function $r(e, t) {
|
|
6087
6085
|
return t.schema.blockSchema[e.type].isFileBlock && !e.props.url;
|
|
6088
6086
|
}
|
|
6089
|
-
function
|
|
6087
|
+
function $i(e, t, o) {
|
|
6090
6088
|
return t in o.schema.blockSchema && e in o.schema.blockSchema[t].propSchema && o.schema.blockSchema[t].propSchema[e] === _[e];
|
|
6091
6089
|
}
|
|
6092
|
-
function
|
|
6093
|
-
return
|
|
6090
|
+
function qr(e, t, o) {
|
|
6091
|
+
return $i(e, t.type, o);
|
|
6094
6092
|
}
|
|
6095
|
-
function
|
|
6093
|
+
function Le(e, t) {
|
|
6096
6094
|
let o, i;
|
|
6097
6095
|
if (t.firstChild.descendants((n, r) => o ? !1 : n.type.name !== "blockContainer" || n.attrs.id !== e ? !0 : (o = n, i = r + 1, !1)), o === void 0 || i === void 0)
|
|
6098
6096
|
throw Error("Could not find block in the editor with matching ID.");
|
|
@@ -6101,13 +6099,13 @@ function Te(e, t) {
|
|
|
6101
6099
|
posBeforeNode: i
|
|
6102
6100
|
};
|
|
6103
6101
|
}
|
|
6104
|
-
function
|
|
6102
|
+
function qi(e, t, o = "before", i) {
|
|
6105
6103
|
const n = typeof t == "string" ? t : t.id, r = [];
|
|
6106
6104
|
for (const d of e)
|
|
6107
6105
|
r.push(
|
|
6108
6106
|
P(d, i.pmSchema, i.schema.styleSchema)
|
|
6109
6107
|
);
|
|
6110
|
-
const { node: a, posBeforeNode: s } =
|
|
6108
|
+
const { node: a, posBeforeNode: s } = Le(
|
|
6111
6109
|
n,
|
|
6112
6110
|
i._tiptapEditor.state.doc
|
|
6113
6111
|
);
|
|
@@ -6140,8 +6138,8 @@ function Ji(e, t, o = "before", i) {
|
|
|
6140
6138
|
);
|
|
6141
6139
|
return l;
|
|
6142
6140
|
}
|
|
6143
|
-
function
|
|
6144
|
-
const i = o._tiptapEditor, n = typeof e == "string" ? e : e.id, { posBeforeNode: r } =
|
|
6141
|
+
function Xi(e, t, o) {
|
|
6142
|
+
const i = o._tiptapEditor, n = typeof e == "string" ? e : e.id, { posBeforeNode: r } = Le(n, i.state.doc);
|
|
6145
6143
|
i.commands.BNUpdateBlock(r + 1, t);
|
|
6146
6144
|
const a = i.state.doc.resolve(r + 1).node();
|
|
6147
6145
|
return v(
|
|
@@ -6186,10 +6184,10 @@ function _t(e, t, o) {
|
|
|
6186
6184
|
}
|
|
6187
6185
|
return t.dispatch(n), a;
|
|
6188
6186
|
}
|
|
6189
|
-
function
|
|
6187
|
+
function Zi(e, t) {
|
|
6190
6188
|
return _t(e, t);
|
|
6191
6189
|
}
|
|
6192
|
-
function
|
|
6190
|
+
function Ji(e, t, o) {
|
|
6193
6191
|
const i = [];
|
|
6194
6192
|
for (const s of t)
|
|
6195
6193
|
i.push(
|
|
@@ -6220,7 +6218,7 @@ function en(e, t, o) {
|
|
|
6220
6218
|
);
|
|
6221
6219
|
return { insertedBlocks: a, removedBlocks: r };
|
|
6222
6220
|
}
|
|
6223
|
-
function
|
|
6221
|
+
function Yi(e, t, o, i = { updateSelection: !0 }) {
|
|
6224
6222
|
const n = o._tiptapEditor.state.tr;
|
|
6225
6223
|
let { from: r, to: a } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, s = !0, l = !0, d = "";
|
|
6226
6224
|
if (t.forEach((u) => {
|
|
@@ -6229,9 +6227,9 @@ function tn(e, t, o, i = { updateSelection: !0 }) {
|
|
|
6229
6227
|
const { parent: u } = n.doc.resolve(r);
|
|
6230
6228
|
u.isTextblock && !u.type.spec.code && !u.childCount && (r -= 1, a += 1);
|
|
6231
6229
|
}
|
|
6232
|
-
return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), i.updateSelection &&
|
|
6230
|
+
return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), i.updateSelection && Vt(n, n.steps.length - 1, -1), o.dispatch(n), !0;
|
|
6233
6231
|
}
|
|
6234
|
-
function
|
|
6232
|
+
function Qi() {
|
|
6235
6233
|
const e = (t) => {
|
|
6236
6234
|
let o = t.children.length;
|
|
6237
6235
|
for (let i = 0; i < o; i++) {
|
|
@@ -6247,7 +6245,7 @@ function on() {
|
|
|
6247
6245
|
};
|
|
6248
6246
|
return e;
|
|
6249
6247
|
}
|
|
6250
|
-
function
|
|
6248
|
+
function en() {
|
|
6251
6249
|
const e = (t) => {
|
|
6252
6250
|
var o;
|
|
6253
6251
|
if (t.children && "length" in t.children && t.children.length)
|
|
@@ -6256,41 +6254,41 @@ function nn() {
|
|
|
6256
6254
|
n.type === "element" && n.tagName === "input" && ((o = n.properties) == null ? void 0 : o.type) === "checkbox" && (r == null ? void 0 : r.type) === "element" && r.tagName === "p" ? (r.tagName = "span", r.children.splice(
|
|
6257
6255
|
0,
|
|
6258
6256
|
0,
|
|
6259
|
-
|
|
6257
|
+
we(document.createTextNode(" "))
|
|
6260
6258
|
)) : e(n);
|
|
6261
6259
|
}
|
|
6262
6260
|
};
|
|
6263
6261
|
return e;
|
|
6264
6262
|
}
|
|
6265
|
-
function
|
|
6266
|
-
return
|
|
6263
|
+
function Ie(e) {
|
|
6264
|
+
return Ee().use(Je, { fragment: !0 }).use(Qi).use(en).use(no).use(Qe).use(ro, { handlers: { text: (o) => o.value } }).processSync(e).value;
|
|
6267
6265
|
}
|
|
6268
|
-
function
|
|
6269
|
-
const r =
|
|
6270
|
-
return
|
|
6266
|
+
function tn(e, t, o, i) {
|
|
6267
|
+
const r = se(t, o).exportBlocks(e, i);
|
|
6268
|
+
return Ie(r);
|
|
6271
6269
|
}
|
|
6272
|
-
function
|
|
6270
|
+
function on(e) {
|
|
6273
6271
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
6274
6272
|
}
|
|
6275
|
-
function
|
|
6273
|
+
function nn(e) {
|
|
6276
6274
|
return e.nodeType === 3 && !/\S/.test(e.nodeValue || "");
|
|
6277
6275
|
}
|
|
6278
|
-
function
|
|
6276
|
+
function rn(e) {
|
|
6279
6277
|
e.querySelectorAll("li > ul, li > ol").forEach((t) => {
|
|
6280
|
-
const o =
|
|
6278
|
+
const o = on(t), i = t.parentElement, n = Array.from(i.childNodes).slice(
|
|
6281
6279
|
o + 1
|
|
6282
6280
|
);
|
|
6283
6281
|
t.remove(), n.forEach((r) => {
|
|
6284
6282
|
r.remove();
|
|
6285
6283
|
}), i.insertAdjacentElement("afterend", t), n.reverse().forEach((r) => {
|
|
6286
|
-
if (
|
|
6284
|
+
if (nn(r))
|
|
6287
6285
|
return;
|
|
6288
6286
|
const a = document.createElement("li");
|
|
6289
6287
|
a.append(r), t.insertAdjacentElement("afterend", a);
|
|
6290
6288
|
}), i.childNodes.length === 0 && i.remove();
|
|
6291
6289
|
});
|
|
6292
6290
|
}
|
|
6293
|
-
function
|
|
6291
|
+
function an(e) {
|
|
6294
6292
|
e.querySelectorAll("li + ul, li + ol").forEach((t) => {
|
|
6295
6293
|
var r, a;
|
|
6296
6294
|
const o = t.previousElementSibling, i = document.createElement("div");
|
|
@@ -6300,16 +6298,16 @@ function dn(e) {
|
|
|
6300
6298
|
n.append(i.nextElementSibling);
|
|
6301
6299
|
});
|
|
6302
6300
|
}
|
|
6303
|
-
let
|
|
6304
|
-
function
|
|
6305
|
-
return
|
|
6301
|
+
let We = null;
|
|
6302
|
+
function sn() {
|
|
6303
|
+
return We || (We = document.implementation.createHTMLDocument("title"));
|
|
6306
6304
|
}
|
|
6307
6305
|
function yt(e) {
|
|
6308
6306
|
if (typeof e == "string") {
|
|
6309
|
-
const t =
|
|
6307
|
+
const t = sn().createElement("div");
|
|
6310
6308
|
t.innerHTML = e, e = t;
|
|
6311
6309
|
}
|
|
6312
|
-
return
|
|
6310
|
+
return rn(e), an(e), e;
|
|
6313
6311
|
}
|
|
6314
6312
|
async function wt(e, t, o, i, n) {
|
|
6315
6313
|
const r = yt(e), s = It.fromSchema(n).parse(r, {
|
|
@@ -6321,7 +6319,7 @@ async function wt(e, t, o, i, n) {
|
|
|
6321
6319
|
);
|
|
6322
6320
|
return l;
|
|
6323
6321
|
}
|
|
6324
|
-
function
|
|
6322
|
+
function ln(e, t) {
|
|
6325
6323
|
const o = t.value ? t.value + `
|
|
6326
6324
|
` : "", i = {};
|
|
6327
6325
|
t.lang && (i["data-language"] = t.lang);
|
|
@@ -6338,11 +6336,11 @@ function un(e, t) {
|
|
|
6338
6336
|
children: [n]
|
|
6339
6337
|
}, e.patch(t, n), n;
|
|
6340
6338
|
}
|
|
6341
|
-
function
|
|
6342
|
-
const r =
|
|
6339
|
+
function dn(e, t, o, i, n) {
|
|
6340
|
+
const r = Ee().use(ao).use(Qe).use(so, {
|
|
6343
6341
|
handlers: {
|
|
6344
6342
|
...lo,
|
|
6345
|
-
code:
|
|
6343
|
+
code: ln
|
|
6346
6344
|
}
|
|
6347
6345
|
}).use(Ye).processSync(e);
|
|
6348
6346
|
return wt(
|
|
@@ -6373,7 +6371,7 @@ class X {
|
|
|
6373
6371
|
this.callbacks = {};
|
|
6374
6372
|
}
|
|
6375
6373
|
}
|
|
6376
|
-
class
|
|
6374
|
+
class cn {
|
|
6377
6375
|
constructor(t, o, i, n) {
|
|
6378
6376
|
c(this, "state");
|
|
6379
6377
|
c(this, "emitUpdate");
|
|
@@ -6425,18 +6423,18 @@ class hn {
|
|
|
6425
6423
|
this.pmView.dom.removeEventListener("mousedown", this.mouseDownHandler), this.pmView.dom.removeEventListener("dragstart", this.dragstartHandler), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
|
|
6426
6424
|
}
|
|
6427
6425
|
}
|
|
6428
|
-
const
|
|
6429
|
-
class
|
|
6426
|
+
const ge = new S("FilePanelPlugin");
|
|
6427
|
+
class un extends X {
|
|
6430
6428
|
constructor(o) {
|
|
6431
6429
|
super();
|
|
6432
6430
|
c(this, "view");
|
|
6433
6431
|
c(this, "plugin");
|
|
6434
6432
|
c(this, "closeMenu", () => this.view.closeMenu());
|
|
6435
6433
|
this.plugin = new y({
|
|
6436
|
-
key:
|
|
6437
|
-
view: (i) => (this.view = new
|
|
6434
|
+
key: ge,
|
|
6435
|
+
view: (i) => (this.view = new cn(
|
|
6438
6436
|
o,
|
|
6439
|
-
|
|
6437
|
+
ge,
|
|
6440
6438
|
i,
|
|
6441
6439
|
(n) => {
|
|
6442
6440
|
this.emit("update", n);
|
|
@@ -6452,7 +6450,7 @@ class mn extends X {
|
|
|
6452
6450
|
apply: (i) => {
|
|
6453
6451
|
var r;
|
|
6454
6452
|
return {
|
|
6455
|
-
block: (r = i.getMeta(
|
|
6453
|
+
block: (r = i.getMeta(ge)) == null ? void 0 : r.block
|
|
6456
6454
|
};
|
|
6457
6455
|
}
|
|
6458
6456
|
}
|
|
@@ -6466,16 +6464,29 @@ class mn extends X {
|
|
|
6466
6464
|
return this.on("update", o);
|
|
6467
6465
|
}
|
|
6468
6466
|
}
|
|
6469
|
-
class
|
|
6467
|
+
class pn {
|
|
6470
6468
|
constructor(t, o, i) {
|
|
6471
6469
|
c(this, "state");
|
|
6472
6470
|
c(this, "emitUpdate");
|
|
6473
6471
|
c(this, "preventHide", !1);
|
|
6474
6472
|
c(this, "preventShow", !1);
|
|
6475
6473
|
c(this, "shouldShow", ({ state: t, from: o, to: i, view: n }) => {
|
|
6476
|
-
const { doc: r, selection: a } = t, { empty: s } = a, l = !r.textBetween(o, i).length &&
|
|
6474
|
+
const { doc: r, selection: a } = t, { empty: s } = a, l = !r.textBetween(o, i).length && Rt(t.selection);
|
|
6477
6475
|
return !(!n.hasFocus() || s || l);
|
|
6478
6476
|
});
|
|
6477
|
+
c(this, "blurHandler", (t) => {
|
|
6478
|
+
var i;
|
|
6479
|
+
if (this.preventHide) {
|
|
6480
|
+
this.preventHide = !1;
|
|
6481
|
+
return;
|
|
6482
|
+
}
|
|
6483
|
+
const o = this.pmView.dom.parentElement;
|
|
6484
|
+
// An element is clicked.
|
|
6485
|
+
t && t.relatedTarget && // Element is inside the editor.
|
|
6486
|
+
(o === t.relatedTarget || o.contains(t.relatedTarget) || t.relatedTarget.matches(
|
|
6487
|
+
".bn-ui-container, .bn-ui-container *"
|
|
6488
|
+
)) || (i = this.state) != null && i.show && (this.state.show = !1, this.emitUpdate());
|
|
6489
|
+
});
|
|
6479
6490
|
c(this, "viewMousedownHandler", () => {
|
|
6480
6491
|
this.preventShow = !0;
|
|
6481
6492
|
});
|
|
@@ -6501,7 +6512,7 @@ class fn {
|
|
|
6501
6512
|
"Attempting to update uninitialized formatting toolbar"
|
|
6502
6513
|
);
|
|
6503
6514
|
i(this.state);
|
|
6504
|
-
}, o.dom.addEventListener("mousedown", this.viewMousedownHandler), o.dom.addEventListener("mouseup", this.viewMouseupHandler), o.dom.addEventListener("dragstart", this.dragHandler), o.dom.addEventListener("dragover", this.dragHandler), o.root.addEventListener("scroll", this.scrollHandler, !0);
|
|
6515
|
+
}, o.dom.addEventListener("mousedown", this.viewMousedownHandler), o.dom.addEventListener("mouseup", this.viewMouseupHandler), o.dom.addEventListener("dragstart", this.dragHandler), o.dom.addEventListener("dragover", this.dragHandler), o.dom.addEventListener("blur", this.blurHandler), o.root.addEventListener("scroll", this.scrollHandler, !0);
|
|
6505
6516
|
}
|
|
6506
6517
|
update(t, o) {
|
|
6507
6518
|
var h, f;
|
|
@@ -6527,7 +6538,7 @@ class fn {
|
|
|
6527
6538
|
}
|
|
6528
6539
|
}
|
|
6529
6540
|
destroy() {
|
|
6530
|
-
this.pmView.dom.removeEventListener("mousedown", this.viewMousedownHandler), this.pmView.dom.removeEventListener("mouseup", this.viewMouseupHandler), this.pmView.dom.removeEventListener("dragstart", this.dragHandler), this.pmView.dom.removeEventListener("dragover", this.dragHandler), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
|
|
6541
|
+
this.pmView.dom.removeEventListener("mousedown", this.viewMousedownHandler), this.pmView.dom.removeEventListener("mouseup", this.viewMouseupHandler), this.pmView.dom.removeEventListener("dragstart", this.dragHandler), this.pmView.dom.removeEventListener("dragover", this.dragHandler), this.pmView.dom.removeEventListener("blur", this.blurHandler), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
|
|
6531
6542
|
}
|
|
6532
6543
|
getSelectionBoundingBox() {
|
|
6533
6544
|
const { state: t } = this.pmView, { selection: o } = t, { ranges: i } = o, n = Math.min(...i.map((a) => a.$from.pos)), r = Math.max(...i.map((a) => a.$to.pos));
|
|
@@ -6536,21 +6547,21 @@ class fn {
|
|
|
6536
6547
|
if (a)
|
|
6537
6548
|
return a.getBoundingClientRect();
|
|
6538
6549
|
}
|
|
6539
|
-
return
|
|
6550
|
+
return ye(this.pmView, n, r);
|
|
6540
6551
|
}
|
|
6541
6552
|
}
|
|
6542
|
-
const
|
|
6553
|
+
const hn = new S(
|
|
6543
6554
|
"FormattingToolbarPlugin"
|
|
6544
6555
|
);
|
|
6545
|
-
class
|
|
6556
|
+
class mn extends X {
|
|
6546
6557
|
constructor(o) {
|
|
6547
6558
|
super();
|
|
6548
6559
|
c(this, "view");
|
|
6549
6560
|
c(this, "plugin");
|
|
6550
6561
|
c(this, "closeMenu", () => this.view.closeMenu());
|
|
6551
6562
|
this.plugin = new y({
|
|
6552
|
-
key:
|
|
6553
|
-
view: (i) => (this.view = new
|
|
6563
|
+
key: hn,
|
|
6564
|
+
view: (i) => (this.view = new pn(o, i, (n) => {
|
|
6554
6565
|
this.emit("update", n);
|
|
6555
6566
|
}), this.view),
|
|
6556
6567
|
props: {
|
|
@@ -6566,7 +6577,7 @@ class bn extends X {
|
|
|
6566
6577
|
return this.on("update", o);
|
|
6567
6578
|
}
|
|
6568
6579
|
}
|
|
6569
|
-
class
|
|
6580
|
+
class fn {
|
|
6570
6581
|
constructor(t, o, i) {
|
|
6571
6582
|
c(this, "state");
|
|
6572
6583
|
c(this, "emitUpdate");
|
|
@@ -6584,7 +6595,7 @@ class kn {
|
|
|
6584
6595
|
const o = t.target, i = this.pmView.posAtDOM(o, 0) + 1, n = this.pmView.state.doc.resolve(i), r = n.marks();
|
|
6585
6596
|
for (const a of r)
|
|
6586
6597
|
if (a.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
6587
|
-
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange =
|
|
6598
|
+
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = je(n, a.type, a.attrs) || void 0;
|
|
6588
6599
|
break;
|
|
6589
6600
|
}
|
|
6590
6601
|
}
|
|
@@ -6600,7 +6611,7 @@ class kn {
|
|
|
6600
6611
|
});
|
|
6601
6612
|
c(this, "scrollHandler", () => {
|
|
6602
6613
|
var t;
|
|
6603
|
-
this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos =
|
|
6614
|
+
this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos = ye(
|
|
6604
6615
|
this.pmView,
|
|
6605
6616
|
this.linkMarkRange.from,
|
|
6606
6617
|
this.linkMarkRange.to
|
|
@@ -6656,7 +6667,7 @@ class kn {
|
|
|
6656
6667
|
const i = this.pmView.state.selection.$from.marks();
|
|
6657
6668
|
for (const n of i)
|
|
6658
6669
|
if (n.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
6659
|
-
this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange =
|
|
6670
|
+
this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange = je(
|
|
6660
6671
|
this.pmView.state.selection.$from,
|
|
6661
6672
|
n.type,
|
|
6662
6673
|
n.attrs
|
|
@@ -6667,7 +6678,7 @@ class kn {
|
|
|
6667
6678
|
if (this.mouseHoveredLinkMark && (this.linkMark = this.mouseHoveredLinkMark, this.linkMarkRange = this.mouseHoveredLinkMarkRange), this.keyboardHoveredLinkMark && (this.linkMark = this.keyboardHoveredLinkMark, this.linkMarkRange = this.keyboardHoveredLinkMarkRange), this.linkMark && this.editor.isEditable) {
|
|
6668
6679
|
this.state = {
|
|
6669
6680
|
show: !0,
|
|
6670
|
-
referencePos:
|
|
6681
|
+
referencePos: ye(
|
|
6671
6682
|
this.pmView,
|
|
6672
6683
|
this.linkMarkRange.from,
|
|
6673
6684
|
this.linkMarkRange.to
|
|
@@ -6693,8 +6704,8 @@ class kn {
|
|
|
6693
6704
|
);
|
|
6694
6705
|
}
|
|
6695
6706
|
}
|
|
6696
|
-
const
|
|
6697
|
-
class
|
|
6707
|
+
const gn = new S("LinkToolbarPlugin");
|
|
6708
|
+
class bn extends X {
|
|
6698
6709
|
constructor(o) {
|
|
6699
6710
|
super();
|
|
6700
6711
|
c(this, "view");
|
|
@@ -6733,8 +6744,8 @@ class yn extends X {
|
|
|
6733
6744
|
});
|
|
6734
6745
|
c(this, "closeMenu", () => this.view.closeMenu());
|
|
6735
6746
|
this.plugin = new y({
|
|
6736
|
-
key:
|
|
6737
|
-
view: (i) => (this.view = new
|
|
6747
|
+
key: gn,
|
|
6748
|
+
view: (i) => (this.view = new fn(o, i, (n) => {
|
|
6738
6749
|
this.emit("update", n);
|
|
6739
6750
|
}), this.view),
|
|
6740
6751
|
props: {
|
|
@@ -6750,7 +6761,7 @@ class yn extends X {
|
|
|
6750
6761
|
return ((i = (o = this.view) == null ? void 0 : o.state) == null ? void 0 : i.show) || !1;
|
|
6751
6762
|
}
|
|
6752
6763
|
}
|
|
6753
|
-
class z extends
|
|
6764
|
+
class z extends me {
|
|
6754
6765
|
constructor(o, i) {
|
|
6755
6766
|
super(o, i);
|
|
6756
6767
|
c(this, "nodes");
|
|
@@ -6764,7 +6775,7 @@ class z extends he {
|
|
|
6764
6775
|
return new z(o.resolve(i), o.resolve(n));
|
|
6765
6776
|
}
|
|
6766
6777
|
content() {
|
|
6767
|
-
return new
|
|
6778
|
+
return new j(L.from(this.nodes), 0, 0);
|
|
6768
6779
|
}
|
|
6769
6780
|
eq(o) {
|
|
6770
6781
|
if (!(o instanceof z) || this.nodes.length !== o.nodes.length || this.from !== o.from || this.to !== o.to)
|
|
@@ -6776,7 +6787,7 @@ class z extends he {
|
|
|
6776
6787
|
}
|
|
6777
6788
|
map(o, i) {
|
|
6778
6789
|
const n = i.mapResult(this.from), r = i.mapResult(this.to);
|
|
6779
|
-
return r.deleted ?
|
|
6790
|
+
return r.deleted ? me.near(o.resolve(n.pos)) : n.deleted ? me.near(o.resolve(r.pos)) : new z(
|
|
6780
6791
|
o.resolve(n.pos),
|
|
6781
6792
|
o.resolve(r.pos)
|
|
6782
6793
|
);
|
|
@@ -6786,22 +6797,22 @@ class z extends he {
|
|
|
6786
6797
|
}
|
|
6787
6798
|
}
|
|
6788
6799
|
let B;
|
|
6789
|
-
function
|
|
6800
|
+
function he(e, t) {
|
|
6790
6801
|
var o;
|
|
6791
6802
|
for (; e && e.parentElement && e.parentElement !== t.dom && !((o = e.hasAttribute) != null && o.call(e, "data-id")); )
|
|
6792
6803
|
e = e.parentElement;
|
|
6793
6804
|
if (e.hasAttribute("data-id"))
|
|
6794
6805
|
return { node: e, id: e.getAttribute("data-id") };
|
|
6795
6806
|
}
|
|
6796
|
-
function
|
|
6797
|
-
const o =
|
|
6807
|
+
function kn(e, t) {
|
|
6808
|
+
const o = he(e, t);
|
|
6798
6809
|
if (o && o.node.nodeType === 1) {
|
|
6799
6810
|
const i = t.docView, n = i.nearestDesc(o.node, !0);
|
|
6800
6811
|
return !n || n === i ? null : n.posBefore;
|
|
6801
6812
|
}
|
|
6802
6813
|
return null;
|
|
6803
6814
|
}
|
|
6804
|
-
function
|
|
6815
|
+
function _n(e, t) {
|
|
6805
6816
|
let o, i;
|
|
6806
6817
|
const n = t.resolve(e.from).node().type.spec.group === "blockContent", r = t.resolve(e.to).node().type.spec.group === "blockContent", a = Math.min(e.$anchor.depth, e.$head.depth);
|
|
6807
6818
|
if (n && r) {
|
|
@@ -6811,7 +6822,7 @@ function vn(e, t) {
|
|
|
6811
6822
|
o = e.from, i = e.to;
|
|
6812
6823
|
return { from: o, to: i };
|
|
6813
6824
|
}
|
|
6814
|
-
function
|
|
6825
|
+
function $e(e, t, o = t) {
|
|
6815
6826
|
t === o && (o += e.state.doc.resolve(t + 1).node().nodeSize);
|
|
6816
6827
|
const i = e.domAtPos(t).node.cloneNode(!0), n = e.domAtPos(t).node, r = (u, p) => Array.prototype.indexOf.call(u.children, p), a = r(
|
|
6817
6828
|
n,
|
|
@@ -6833,7 +6844,7 @@ function Ke(e, t, o = t) {
|
|
|
6833
6844
|
function vt(e) {
|
|
6834
6845
|
B !== void 0 && (e instanceof ShadowRoot ? e.removeChild(B) : e.body.removeChild(B), B = void 0);
|
|
6835
6846
|
}
|
|
6836
|
-
function
|
|
6847
|
+
function yn(e, t) {
|
|
6837
6848
|
if (!e.dataTransfer)
|
|
6838
6849
|
return;
|
|
6839
6850
|
const o = t.prosemirrorView, i = o.dom.getBoundingClientRect(), n = {
|
|
@@ -6844,30 +6855,30 @@ function xn(e, t) {
|
|
|
6844
6855
|
let a;
|
|
6845
6856
|
for (const l of r)
|
|
6846
6857
|
if (o.dom.contains(l)) {
|
|
6847
|
-
a =
|
|
6858
|
+
a = he(l, o);
|
|
6848
6859
|
break;
|
|
6849
6860
|
}
|
|
6850
6861
|
if (!a)
|
|
6851
6862
|
return;
|
|
6852
|
-
const s =
|
|
6863
|
+
const s = kn(a.node, o);
|
|
6853
6864
|
if (s != null) {
|
|
6854
|
-
const l = o.state.selection, d = o.state.doc, { from: u, to: p } =
|
|
6865
|
+
const l = o.state.selection, d = o.state.doc, { from: u, to: p } = _n(l, d), h = u <= s && s < p, f = l.$anchor.node() !== l.$head.node() || l instanceof z;
|
|
6855
6866
|
h && f ? (o.dispatch(
|
|
6856
6867
|
o.state.tr.setSelection(z.create(d, u, p))
|
|
6857
|
-
),
|
|
6858
|
-
o.state.tr.setSelection(
|
|
6859
|
-
),
|
|
6860
|
-
const m = o.state.selection.content(), g = t.pmSchema, A =
|
|
6868
|
+
), $e(o, u, p)) : (o.dispatch(
|
|
6869
|
+
o.state.tr.setSelection(re.create(o.state.doc, s))
|
|
6870
|
+
), $e(o, s));
|
|
6871
|
+
const m = o.state.selection.content(), g = t.pmSchema, A = Me(g, t).serializeProseMirrorFragment(
|
|
6861
6872
|
m.content,
|
|
6862
6873
|
{}
|
|
6863
|
-
), N =
|
|
6874
|
+
), N = se(g, t).exportProseMirrorFragment(
|
|
6864
6875
|
m.content,
|
|
6865
6876
|
{}
|
|
6866
|
-
), Z =
|
|
6877
|
+
), Z = Ie(N);
|
|
6867
6878
|
e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", A), e.dataTransfer.setData("text/html", N), e.dataTransfer.setData("text/plain", Z), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(B, 0, 0), o.dragging = { slice: m, move: !0 };
|
|
6868
6879
|
}
|
|
6869
6880
|
}
|
|
6870
|
-
class
|
|
6881
|
+
class wn {
|
|
6871
6882
|
constructor(t, o, i) {
|
|
6872
6883
|
c(this, "state");
|
|
6873
6884
|
c(this, "emitUpdate");
|
|
@@ -6899,7 +6910,7 @@ class En {
|
|
|
6899
6910
|
let n;
|
|
6900
6911
|
for (const u of i)
|
|
6901
6912
|
if (this.pmView.dom.contains(u)) {
|
|
6902
|
-
n =
|
|
6913
|
+
n = he(u, this.pmView);
|
|
6903
6914
|
break;
|
|
6904
6915
|
}
|
|
6905
6916
|
if (!n || !this.editor.isEditable) {
|
|
@@ -6946,7 +6957,10 @@ class En {
|
|
|
6946
6957
|
});
|
|
6947
6958
|
if (this.isDragging = !1, !o || o.inside === -1) {
|
|
6948
6959
|
const i = new Event("drop", t), n = this.pmView.dom.firstChild.getBoundingClientRect();
|
|
6949
|
-
i.clientX =
|
|
6960
|
+
i.clientX = t.clientX < n.left || t.clientX > n.left + n.width ? n.left + n.width / 2 : t.clientX, i.clientY = Math.min(
|
|
6961
|
+
Math.max(t.clientY, n.top),
|
|
6962
|
+
n.top + n.height
|
|
6963
|
+
), i.dataTransfer = t.dataTransfer, i.preventDefault = () => t.preventDefault(), i.synthetic = !0, this.pmView.dom.dispatchEvent(i);
|
|
6950
6964
|
}
|
|
6951
6965
|
});
|
|
6952
6966
|
/**
|
|
@@ -6975,6 +6989,8 @@ class En {
|
|
|
6975
6989
|
});
|
|
6976
6990
|
c(this, "onMouseMove", (t) => {
|
|
6977
6991
|
var r;
|
|
6992
|
+
if (this.menuFrozen)
|
|
6993
|
+
return;
|
|
6978
6994
|
this.mousePos = { x: t.clientX, y: t.clientY };
|
|
6979
6995
|
const o = this.pmView.dom.getBoundingClientRect(), i = this.mousePos.x > o.left && this.mousePos.x < o.right && this.mousePos.y > o.top && this.mousePos.y < o.bottom, n = this.pmView.dom.parentElement;
|
|
6980
6996
|
if (
|
|
@@ -7076,8 +7092,8 @@ class En {
|
|
|
7076
7092
|
this.editor.openSelectionMenu("/");
|
|
7077
7093
|
}
|
|
7078
7094
|
}
|
|
7079
|
-
const
|
|
7080
|
-
class
|
|
7095
|
+
const vn = new S("SideMenuPlugin");
|
|
7096
|
+
class xn extends X {
|
|
7081
7097
|
constructor(o) {
|
|
7082
7098
|
super();
|
|
7083
7099
|
c(this, "view");
|
|
@@ -7091,7 +7107,7 @@ class Sn extends X {
|
|
|
7091
7107
|
* Handles drag & drop events for blocks.
|
|
7092
7108
|
*/
|
|
7093
7109
|
c(this, "blockDragStart", (o) => {
|
|
7094
|
-
this.view.isDragging = !0,
|
|
7110
|
+
this.view.isDragging = !0, yn(o, this.editor);
|
|
7095
7111
|
});
|
|
7096
7112
|
/**
|
|
7097
7113
|
* Handles drag & drop events for blocks.
|
|
@@ -7112,8 +7128,8 @@ class Sn extends X {
|
|
|
7112
7128
|
this.view.menuFrozen = !1, this.view.state.show = !1, this.view.emitUpdate(this.view.state);
|
|
7113
7129
|
});
|
|
7114
7130
|
this.editor = o, this.plugin = new y({
|
|
7115
|
-
key:
|
|
7116
|
-
view: (i) => (this.view = new
|
|
7131
|
+
key: vn,
|
|
7132
|
+
view: (i) => (this.view = new wn(o, i, (n) => {
|
|
7117
7133
|
this.emit("update", n);
|
|
7118
7134
|
}), this.view)
|
|
7119
7135
|
});
|
|
@@ -7122,8 +7138,8 @@ class Sn extends X {
|
|
|
7122
7138
|
return this.on("update", o);
|
|
7123
7139
|
}
|
|
7124
7140
|
}
|
|
7125
|
-
const
|
|
7126
|
-
class
|
|
7141
|
+
const En = zt((e) => e.type.name === "blockContainer");
|
|
7142
|
+
class Cn {
|
|
7127
7143
|
constructor(t, o) {
|
|
7128
7144
|
c(this, "state");
|
|
7129
7145
|
c(this, "emitUpdate");
|
|
@@ -7184,7 +7200,7 @@ class Tn {
|
|
|
7184
7200
|
}
|
|
7185
7201
|
}
|
|
7186
7202
|
const F = new S("SuggestionMenuPlugin");
|
|
7187
|
-
class
|
|
7203
|
+
class Sn extends X {
|
|
7188
7204
|
constructor(o) {
|
|
7189
7205
|
super();
|
|
7190
7206
|
c(this, "view");
|
|
@@ -7204,7 +7220,7 @@ class Bn extends X {
|
|
|
7204
7220
|
const i = this.triggerCharacters;
|
|
7205
7221
|
this.plugin = new y({
|
|
7206
7222
|
key: F,
|
|
7207
|
-
view: () => (this.view = new
|
|
7223
|
+
view: () => (this.view = new Cn(
|
|
7208
7224
|
o,
|
|
7209
7225
|
(n, r) => {
|
|
7210
7226
|
this.emit(`update ${n}`, r);
|
|
@@ -7260,7 +7276,7 @@ class Bn extends X {
|
|
|
7260
7276
|
if (r === void 0)
|
|
7261
7277
|
return null;
|
|
7262
7278
|
if (!r.fromUserInput) {
|
|
7263
|
-
const a =
|
|
7279
|
+
const a = En(n.selection);
|
|
7264
7280
|
if (a)
|
|
7265
7281
|
return G.create(n.doc, [
|
|
7266
7282
|
K.node(
|
|
@@ -7297,32 +7313,32 @@ class Bn extends X {
|
|
|
7297
7313
|
return ((i = (o = this.view) == null ? void 0 : o.state) == null ? void 0 : i.show) || !1;
|
|
7298
7314
|
}
|
|
7299
7315
|
}
|
|
7300
|
-
function
|
|
7316
|
+
function Xr(e, t) {
|
|
7301
7317
|
e.suggestionMenus.addTriggerCharacter(t);
|
|
7302
7318
|
}
|
|
7303
7319
|
let w;
|
|
7304
|
-
function
|
|
7320
|
+
function qe(e) {
|
|
7305
7321
|
w || (w = document.createElement("div"), w.innerHTML = "_", w.style.opacity = "0", w.style.height = "1px", w.style.width = "1px", e instanceof Document ? e.body.appendChild(w) : e.appendChild(w));
|
|
7306
7322
|
}
|
|
7307
|
-
function
|
|
7323
|
+
function Mn(e) {
|
|
7308
7324
|
w && (e instanceof Document ? e.body.removeChild(w) : e.removeChild(w), w = void 0);
|
|
7309
7325
|
}
|
|
7310
7326
|
function ie(e) {
|
|
7311
7327
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
7312
7328
|
}
|
|
7313
|
-
function
|
|
7329
|
+
function Tn(e) {
|
|
7314
7330
|
for (; e && e.nodeName !== "TD" && e.nodeName !== "TH"; )
|
|
7315
7331
|
e = e.classList && e.classList.contains("ProseMirror") ? null : e.parentNode;
|
|
7316
7332
|
return e;
|
|
7317
7333
|
}
|
|
7318
|
-
function
|
|
7334
|
+
function Bn(e, t) {
|
|
7319
7335
|
e.forEach((o) => {
|
|
7320
7336
|
const i = t.querySelectorAll(o);
|
|
7321
7337
|
for (let n = 0; n < i.length; n++)
|
|
7322
7338
|
i[n].style.visibility = "hidden";
|
|
7323
7339
|
});
|
|
7324
7340
|
}
|
|
7325
|
-
class
|
|
7341
|
+
class Ln {
|
|
7326
7342
|
constructor(t, o, i) {
|
|
7327
7343
|
c(this, "state");
|
|
7328
7344
|
c(this, "emitUpdate");
|
|
@@ -7334,12 +7350,12 @@ class Nn {
|
|
|
7334
7350
|
var d;
|
|
7335
7351
|
if (this.menuFrozen)
|
|
7336
7352
|
return;
|
|
7337
|
-
const o =
|
|
7353
|
+
const o = Tn(t.target);
|
|
7338
7354
|
if (!o || !this.editor.isEditable) {
|
|
7339
7355
|
(d = this.state) != null && d.show && (this.state.show = !1, this.emitUpdate());
|
|
7340
7356
|
return;
|
|
7341
7357
|
}
|
|
7342
|
-
const i = ie(o), n = ie(o.parentElement), r = o.getBoundingClientRect(), a = o.parentElement.parentElement.getBoundingClientRect(), s =
|
|
7358
|
+
const i = ie(o), n = ie(o.parentElement), r = o.getBoundingClientRect(), a = o.parentElement.parentElement.getBoundingClientRect(), s = he(o, this.pmView);
|
|
7343
7359
|
if (!s)
|
|
7344
7360
|
return;
|
|
7345
7361
|
let l;
|
|
@@ -7355,7 +7371,7 @@ class Nn {
|
|
|
7355
7371
|
this.editor.schema.styleSchema,
|
|
7356
7372
|
this.editor.blockCache
|
|
7357
7373
|
);
|
|
7358
|
-
return
|
|
7374
|
+
return Wi("table", h, this.editor) && (this.tablePos = p + 1, l = h), !1;
|
|
7359
7375
|
}), !!l && (this.tableId = s.id, !(this.state !== void 0 && this.state.show && this.tableId === s.id && this.state.rowIndex === n && this.state.colIndex === i)))
|
|
7360
7376
|
return this.state = {
|
|
7361
7377
|
show: !0,
|
|
@@ -7371,7 +7387,7 @@ class Nn {
|
|
|
7371
7387
|
var h;
|
|
7372
7388
|
if (((h = this.state) == null ? void 0 : h.draggingState) === void 0)
|
|
7373
7389
|
return;
|
|
7374
|
-
t.preventDefault(), t.dataTransfer.dropEffect = "move",
|
|
7390
|
+
t.preventDefault(), t.dataTransfer.dropEffect = "move", Bn(
|
|
7375
7391
|
[
|
|
7376
7392
|
"column-resize-handle",
|
|
7377
7393
|
"prosemirror-dropcursor-block",
|
|
@@ -7459,7 +7475,7 @@ class Nn {
|
|
|
7459
7475
|
}
|
|
7460
7476
|
}
|
|
7461
7477
|
const Q = new S("TableHandlesPlugin");
|
|
7462
|
-
class
|
|
7478
|
+
class In extends X {
|
|
7463
7479
|
constructor(o) {
|
|
7464
7480
|
super();
|
|
7465
7481
|
c(this, "view");
|
|
@@ -7484,7 +7500,7 @@ class Pn extends X {
|
|
|
7484
7500
|
newIndex: this.view.state.colIndex,
|
|
7485
7501
|
tablePos: this.view.tablePos
|
|
7486
7502
|
})
|
|
7487
|
-
),
|
|
7503
|
+
), qe(this.editor._tiptapEditor.view.root), o.dataTransfer.setDragImage(w, 0, 0), o.dataTransfer.effectAllowed = "move";
|
|
7488
7504
|
});
|
|
7489
7505
|
/**
|
|
7490
7506
|
* Callback that should be set on the `dragStart` event for whichever element
|
|
@@ -7506,7 +7522,7 @@ class Pn extends X {
|
|
|
7506
7522
|
newIndex: this.view.state.rowIndex,
|
|
7507
7523
|
tablePos: this.view.tablePos
|
|
7508
7524
|
})
|
|
7509
|
-
),
|
|
7525
|
+
), qe(this.editor._tiptapEditor.view.root), o.dataTransfer.setDragImage(w, 0, 0), o.dataTransfer.effectAllowed = "copyMove";
|
|
7510
7526
|
});
|
|
7511
7527
|
/**
|
|
7512
7528
|
* Callback that should be set on the `dragEnd` event for both the element
|
|
@@ -7519,7 +7535,7 @@ class Pn extends X {
|
|
|
7519
7535
|
);
|
|
7520
7536
|
this.view.state.draggingState = void 0, this.view.emitUpdate(), this.editor.dispatch(
|
|
7521
7537
|
this.editor._tiptapEditor.state.tr.setMeta(Q, null)
|
|
7522
|
-
),
|
|
7538
|
+
), Mn(this.editor._tiptapEditor.view.root);
|
|
7523
7539
|
});
|
|
7524
7540
|
/**
|
|
7525
7541
|
* Freezes the drag handles. When frozen, they will stay attached to the same
|
|
@@ -7537,7 +7553,7 @@ class Pn extends X {
|
|
|
7537
7553
|
});
|
|
7538
7554
|
this.editor = o, this.plugin = new y({
|
|
7539
7555
|
key: Q,
|
|
7540
|
-
view: (i) => (this.view = new
|
|
7556
|
+
view: (i) => (this.view = new Ln(o, i, (n) => {
|
|
7541
7557
|
this.emit("update", n);
|
|
7542
7558
|
}), this.view),
|
|
7543
7559
|
// We use decorations to render the drop cursor when dragging a table row
|
|
@@ -7590,23 +7606,23 @@ class Pn extends X {
|
|
|
7590
7606
|
return this.on("update", o);
|
|
7591
7607
|
}
|
|
7592
7608
|
}
|
|
7593
|
-
function
|
|
7594
|
-
const o = e.state.selection.content().content, n =
|
|
7609
|
+
function Xe(e, t) {
|
|
7610
|
+
const o = e.state.selection.content().content, n = Me(
|
|
7595
7611
|
e.state.schema,
|
|
7596
7612
|
t
|
|
7597
7613
|
).serializeProseMirrorFragment(
|
|
7598
7614
|
o,
|
|
7599
7615
|
{}
|
|
7600
|
-
), a =
|
|
7616
|
+
), a = se(
|
|
7601
7617
|
e.state.schema,
|
|
7602
7618
|
t
|
|
7603
7619
|
).exportProseMirrorFragment(
|
|
7604
7620
|
o,
|
|
7605
7621
|
{}
|
|
7606
|
-
), s =
|
|
7622
|
+
), s = Ie(a);
|
|
7607
7623
|
return { internalHTML: n, externalHTML: a, plainText: s };
|
|
7608
7624
|
}
|
|
7609
|
-
const
|
|
7625
|
+
const An = (e) => M.create({
|
|
7610
7626
|
name: "copyToClipboard",
|
|
7611
7627
|
addProseMirrorPlugins() {
|
|
7612
7628
|
return [
|
|
@@ -7616,12 +7632,12 @@ const Hn = (e) => M.create({
|
|
|
7616
7632
|
copy(t, o) {
|
|
7617
7633
|
o.preventDefault(), o.clipboardData.clearData(), "node" in t.state.selection && t.state.selection.node.type.spec.group === "blockContent" && e.dispatch(
|
|
7618
7634
|
e._tiptapEditor.state.tr.setSelection(
|
|
7619
|
-
new
|
|
7635
|
+
new re(
|
|
7620
7636
|
t.state.doc.resolve(t.state.selection.from - 1)
|
|
7621
7637
|
)
|
|
7622
7638
|
)
|
|
7623
7639
|
);
|
|
7624
|
-
const { internalHTML: i, externalHTML: n, plainText: r } =
|
|
7640
|
+
const { internalHTML: i, externalHTML: n, plainText: r } = Xe(t, e);
|
|
7625
7641
|
return o.clipboardData.setData("blocknote/html", i), o.clipboardData.setData("text/html", n), o.clipboardData.setData("text/plain", r), !0;
|
|
7626
7642
|
},
|
|
7627
7643
|
// This is for the use-case in which only a block without content
|
|
@@ -7632,12 +7648,12 @@ const Hn = (e) => M.create({
|
|
|
7632
7648
|
return;
|
|
7633
7649
|
e.dispatch(
|
|
7634
7650
|
e._tiptapEditor.state.tr.setSelection(
|
|
7635
|
-
new
|
|
7651
|
+
new re(
|
|
7636
7652
|
t.state.doc.resolve(t.state.selection.from - 1)
|
|
7637
7653
|
)
|
|
7638
7654
|
)
|
|
7639
7655
|
), o.preventDefault(), o.dataTransfer.clearData();
|
|
7640
|
-
const { internalHTML: i, externalHTML: n, plainText: r } =
|
|
7656
|
+
const { internalHTML: i, externalHTML: n, plainText: r } = Xe(t, e);
|
|
7641
7657
|
return o.dataTransfer.setData("blocknote/html", i), o.dataTransfer.setData("text/html", n), o.dataTransfer.setData("text/plain", r), !0;
|
|
7642
7658
|
}
|
|
7643
7659
|
}
|
|
@@ -7646,7 +7662,7 @@ const Hn = (e) => M.create({
|
|
|
7646
7662
|
];
|
|
7647
7663
|
}
|
|
7648
7664
|
});
|
|
7649
|
-
function
|
|
7665
|
+
function Nn(e) {
|
|
7650
7666
|
let t = e.getTextCursorPosition().block, o = e.schema.blockSchema[t.type].content;
|
|
7651
7667
|
for (; o === "none"; )
|
|
7652
7668
|
t = e.getTextCursorPosition().nextBlock, o = e.schema.blockSchema[t.type].content, e.setTextCursorPosition(t, "end");
|
|
@@ -7660,9 +7676,9 @@ function x(e, t) {
|
|
|
7660
7676
|
"end"
|
|
7661
7677
|
));
|
|
7662
7678
|
const i = e.getTextCursorPosition().block;
|
|
7663
|
-
return
|
|
7679
|
+
return Nn(e), i;
|
|
7664
7680
|
}
|
|
7665
|
-
function
|
|
7681
|
+
function Zr(e) {
|
|
7666
7682
|
const t = [];
|
|
7667
7683
|
return E("heading", e) && t.push(
|
|
7668
7684
|
{
|
|
@@ -7812,20 +7828,20 @@ function ta(e) {
|
|
|
7812
7828
|
...e.dictionary.slash_menu.emoji
|
|
7813
7829
|
}), t;
|
|
7814
7830
|
}
|
|
7815
|
-
function
|
|
7831
|
+
function Jr(e, t) {
|
|
7816
7832
|
return e.filter(
|
|
7817
7833
|
({ title: o, aliases: i }) => o.toLowerCase().includes(t.toLowerCase()) || i && i.filter(
|
|
7818
7834
|
(n) => n.toLowerCase().includes(t.toLowerCase())
|
|
7819
7835
|
).length !== 0
|
|
7820
7836
|
);
|
|
7821
7837
|
}
|
|
7822
|
-
const
|
|
7838
|
+
const Ae = [
|
|
7823
7839
|
"blocknote/html",
|
|
7824
7840
|
"Files",
|
|
7825
7841
|
"text/html",
|
|
7826
7842
|
"text/plain"
|
|
7827
7843
|
];
|
|
7828
|
-
function
|
|
7844
|
+
function Pn(e, t) {
|
|
7829
7845
|
const o = e.split("/"), i = t.split("/");
|
|
7830
7846
|
if (o.length !== 2)
|
|
7831
7847
|
throw new Error(`The string ${e} is not a valid MIME type.`);
|
|
@@ -7840,7 +7856,7 @@ async function xt(e, t) {
|
|
|
7840
7856
|
if (o === null)
|
|
7841
7857
|
return;
|
|
7842
7858
|
let i = null;
|
|
7843
|
-
for (const a of
|
|
7859
|
+
for (const a of Ae)
|
|
7844
7860
|
if (o.types.includes(a)) {
|
|
7845
7861
|
i = a;
|
|
7846
7862
|
break;
|
|
@@ -7858,7 +7874,7 @@ async function xt(e, t) {
|
|
|
7858
7874
|
let s = "file";
|
|
7859
7875
|
for (const d of r)
|
|
7860
7876
|
for (const u of d.fileBlockAcceptMimeTypes || [])
|
|
7861
|
-
if (
|
|
7877
|
+
if (Pn(n[a].type, u)) {
|
|
7862
7878
|
s = d.type;
|
|
7863
7879
|
break;
|
|
7864
7880
|
}
|
|
@@ -7878,7 +7894,7 @@ async function xt(e, t) {
|
|
|
7878
7894
|
}
|
|
7879
7895
|
}
|
|
7880
7896
|
}
|
|
7881
|
-
const
|
|
7897
|
+
const Hn = (e) => M.create({
|
|
7882
7898
|
name: "pasteFromClipboard",
|
|
7883
7899
|
addProseMirrorPlugins() {
|
|
7884
7900
|
return [
|
|
@@ -7889,7 +7905,7 @@ const jn = (e) => M.create({
|
|
|
7889
7905
|
if (o.preventDefault(), !e.isEditable)
|
|
7890
7906
|
return;
|
|
7891
7907
|
let i = null;
|
|
7892
|
-
for (const r of
|
|
7908
|
+
for (const r of Ae)
|
|
7893
7909
|
if (o.clipboardData.types.includes(r)) {
|
|
7894
7910
|
i = r;
|
|
7895
7911
|
break;
|
|
@@ -7906,7 +7922,7 @@ const jn = (e) => M.create({
|
|
|
7906
7922
|
})
|
|
7907
7923
|
];
|
|
7908
7924
|
}
|
|
7909
|
-
}),
|
|
7925
|
+
}), Un = (e) => M.create({
|
|
7910
7926
|
name: "dropFile",
|
|
7911
7927
|
addProseMirrorPlugins() {
|
|
7912
7928
|
return [
|
|
@@ -7917,7 +7933,7 @@ const jn = (e) => M.create({
|
|
|
7917
7933
|
if (!e.isEditable)
|
|
7918
7934
|
return;
|
|
7919
7935
|
let i = null;
|
|
7920
|
-
for (const n of
|
|
7936
|
+
for (const n of Ae)
|
|
7921
7937
|
if (o.dataTransfer.types.includes(n)) {
|
|
7922
7938
|
i = n;
|
|
7923
7939
|
break;
|
|
@@ -7929,7 +7945,7 @@ const jn = (e) => M.create({
|
|
|
7929
7945
|
})
|
|
7930
7946
|
];
|
|
7931
7947
|
}
|
|
7932
|
-
}),
|
|
7948
|
+
}), jn = M.create({
|
|
7933
7949
|
name: "blockBackgroundColor",
|
|
7934
7950
|
addGlobalAttributes() {
|
|
7935
7951
|
return [
|
|
@@ -7947,7 +7963,7 @@ const jn = (e) => M.create({
|
|
|
7947
7963
|
}
|
|
7948
7964
|
];
|
|
7949
7965
|
}
|
|
7950
|
-
}),
|
|
7966
|
+
}), Dn = M.create({
|
|
7951
7967
|
name: "textAlignment",
|
|
7952
7968
|
addGlobalAttributes() {
|
|
7953
7969
|
return [
|
|
@@ -7973,7 +7989,7 @@ const jn = (e) => M.create({
|
|
|
7973
7989
|
}
|
|
7974
7990
|
];
|
|
7975
7991
|
}
|
|
7976
|
-
}),
|
|
7992
|
+
}), Vn = M.create({
|
|
7977
7993
|
name: "blockTextColor",
|
|
7978
7994
|
addGlobalAttributes() {
|
|
7979
7995
|
return [
|
|
@@ -7991,7 +8007,7 @@ const jn = (e) => M.create({
|
|
|
7991
8007
|
}
|
|
7992
8008
|
];
|
|
7993
8009
|
}
|
|
7994
|
-
}),
|
|
8010
|
+
}), Rn = M.create({
|
|
7995
8011
|
name: "trailingNode",
|
|
7996
8012
|
addProseMirrorPlugins() {
|
|
7997
8013
|
const e = new S(this.name);
|
|
@@ -8026,8 +8042,8 @@ const jn = (e) => M.create({
|
|
|
8026
8042
|
})
|
|
8027
8043
|
];
|
|
8028
8044
|
}
|
|
8029
|
-
}),
|
|
8030
|
-
key:
|
|
8045
|
+
}), On = new S("non-editable-block"), zn = () => new y({
|
|
8046
|
+
key: On,
|
|
8031
8047
|
props: {
|
|
8032
8048
|
handleKeyDown: (e, t) => {
|
|
8033
8049
|
if ("node" in e.state.selection) {
|
|
@@ -8052,7 +8068,7 @@ const jn = (e) => M.create({
|
|
|
8052
8068
|
return !1;
|
|
8053
8069
|
}
|
|
8054
8070
|
}
|
|
8055
|
-
}),
|
|
8071
|
+
}), Ze = new S("previous-blocks"), Fn = {
|
|
8056
8072
|
// Numbered List Items
|
|
8057
8073
|
index: "index",
|
|
8058
8074
|
// Headings
|
|
@@ -8061,17 +8077,17 @@ const jn = (e) => M.create({
|
|
|
8061
8077
|
type: "type",
|
|
8062
8078
|
depth: "depth",
|
|
8063
8079
|
"depth-change": "depth-change"
|
|
8064
|
-
},
|
|
8080
|
+
}, Gn = () => {
|
|
8065
8081
|
let e;
|
|
8066
8082
|
return new y({
|
|
8067
|
-
key:
|
|
8083
|
+
key: Ze,
|
|
8068
8084
|
view(t) {
|
|
8069
8085
|
return {
|
|
8070
8086
|
update: async (o, i) => {
|
|
8071
8087
|
var n;
|
|
8072
8088
|
((n = this.key) == null ? void 0 : n.getState(o.state).updatedBlocks.size) > 0 && (e = setTimeout(() => {
|
|
8073
8089
|
o.dispatch(
|
|
8074
|
-
o.state.tr.setMeta(
|
|
8090
|
+
o.state.tr.setMeta(Ze, { clearUpdate: !0 })
|
|
8075
8091
|
);
|
|
8076
8092
|
}, 0));
|
|
8077
8093
|
},
|
|
@@ -8094,9 +8110,9 @@ const jn = (e) => M.create({
|
|
|
8094
8110
|
apply(t, o, i, n) {
|
|
8095
8111
|
if (o.currentTransactionOldBlockAttrs = {}, o.updatedBlocks.clear(), !t.docChanged || i.doc.eq(n.doc))
|
|
8096
8112
|
return o;
|
|
8097
|
-
const r = {}, a =
|
|
8113
|
+
const r = {}, a = De(i.doc, (d) => d.attrs.id), s = new Map(
|
|
8098
8114
|
a.map((d) => [d.node.attrs.id, d])
|
|
8099
|
-
), l =
|
|
8115
|
+
), l = De(n.doc, (d) => d.attrs.id);
|
|
8100
8116
|
for (const d of l) {
|
|
8101
8117
|
const u = s.get(d.node.attrs.id), p = u == null ? void 0 : u.node.firstChild, h = d.node.firstChild;
|
|
8102
8118
|
if (u && p && h) {
|
|
@@ -8129,7 +8145,7 @@ const jn = (e) => M.create({
|
|
|
8129
8145
|
return;
|
|
8130
8146
|
const a = o.currentTransactionOldBlockAttrs[n.attrs.id], s = {};
|
|
8131
8147
|
for (const [d, u] of Object.entries(a))
|
|
8132
|
-
s["data-prev-" +
|
|
8148
|
+
s["data-prev-" + Fn[d]] = u || "none";
|
|
8133
8149
|
const l = K.node(r, r + n.nodeSize, {
|
|
8134
8150
|
...s
|
|
8135
8151
|
});
|
|
@@ -8138,13 +8154,13 @@ const jn = (e) => M.create({
|
|
|
8138
8154
|
}
|
|
8139
8155
|
}
|
|
8140
8156
|
});
|
|
8141
|
-
},
|
|
8157
|
+
}, Kn = {
|
|
8142
8158
|
blockColor: "data-block-color",
|
|
8143
8159
|
blockStyle: "data-block-style",
|
|
8144
8160
|
id: "data-id",
|
|
8145
8161
|
depth: "data-depth",
|
|
8146
8162
|
depthChange: "data-depth-change"
|
|
8147
|
-
},
|
|
8163
|
+
}, Wn = $.create({
|
|
8148
8164
|
name: "blockContainer",
|
|
8149
8165
|
group: "blockContainer",
|
|
8150
8166
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -8160,7 +8176,7 @@ const jn = (e) => M.create({
|
|
|
8160
8176
|
if (typeof e == "string")
|
|
8161
8177
|
return !1;
|
|
8162
8178
|
const t = {};
|
|
8163
|
-
for (const [o, i] of Object.entries(
|
|
8179
|
+
for (const [o, i] of Object.entries(Kn))
|
|
8164
8180
|
e.getAttribute(i) && (t[o] = e.getAttribute(i));
|
|
8165
8181
|
return e.getAttribute("data-node-type") === "blockContainer" ? t : !1;
|
|
8166
8182
|
}
|
|
@@ -8177,7 +8193,7 @@ const jn = (e) => M.create({
|
|
|
8177
8193
|
...((n = this.options.domAttributes) == null ? void 0 : n.block) || {},
|
|
8178
8194
|
...e
|
|
8179
8195
|
}, i = document.createElement("div");
|
|
8180
|
-
i.className =
|
|
8196
|
+
i.className = D("bn-block", o.class), i.setAttribute("data-node-type", this.name);
|
|
8181
8197
|
for (const [r, a] of Object.entries(o))
|
|
8182
8198
|
r !== "class" && i.setAttribute(r, a);
|
|
8183
8199
|
return t.appendChild(i), {
|
|
@@ -8220,7 +8236,7 @@ const jn = (e) => M.create({
|
|
|
8220
8236
|
s.childCount === 2 ? o.tr.replace(
|
|
8221
8237
|
r + l.nodeSize + 1,
|
|
8222
8238
|
a - 1,
|
|
8223
|
-
new
|
|
8239
|
+
new j(L.from(h), 0, 0)
|
|
8224
8240
|
) : o.tr.insert(
|
|
8225
8241
|
r + l.nodeSize,
|
|
8226
8242
|
o.schema.nodes.blockGroup.create({}, h)
|
|
@@ -8271,7 +8287,7 @@ const jn = (e) => M.create({
|
|
|
8271
8287
|
p
|
|
8272
8288
|
)
|
|
8273
8289
|
).setSelection(
|
|
8274
|
-
o.schema.nodes[u].spec.content === "" ? new
|
|
8290
|
+
o.schema.nodes[u].spec.content === "" ? new re(o.tr.doc.resolve(r)) : o.schema.nodes[u].spec.content === "inline*" ? new Y(o.tr.doc.resolve(r)) : (
|
|
8275
8291
|
// Need to offset the position as we have to get through the
|
|
8276
8292
|
// `tableRow` and `tableCell` nodes to get to the
|
|
8277
8293
|
// `tableParagraph` node we want to set the selection in.
|
|
@@ -8323,7 +8339,7 @@ const jn = (e) => M.create({
|
|
|
8323
8339
|
t.tr.deleteRange(l, l + s.nodeSize).replace(
|
|
8324
8340
|
p - 1,
|
|
8325
8341
|
l,
|
|
8326
|
-
new
|
|
8342
|
+
new j(s.content, 0, 0)
|
|
8327
8343
|
).scrollIntoView()
|
|
8328
8344
|
), t.tr.setSelection(
|
|
8329
8345
|
new Y(t.doc.resolve(p - 1))
|
|
@@ -8343,7 +8359,7 @@ const jn = (e) => M.create({
|
|
|
8343
8359
|
return n && (i.tr.insert(m, f), i.tr.replace(
|
|
8344
8360
|
g,
|
|
8345
8361
|
g + 1,
|
|
8346
|
-
h.content.size > 0 ? new
|
|
8362
|
+
h.content.size > 0 ? new j(
|
|
8347
8363
|
L.from(h),
|
|
8348
8364
|
u + 2,
|
|
8349
8365
|
u + 2
|
|
@@ -8358,7 +8374,7 @@ const jn = (e) => M.create({
|
|
|
8358
8374
|
), i.tr.replace(
|
|
8359
8375
|
l + 1,
|
|
8360
8376
|
d - 1,
|
|
8361
|
-
p.content.size > 0 ? new
|
|
8377
|
+
p.content.size > 0 ? new j(
|
|
8362
8378
|
L.from(p),
|
|
8363
8379
|
u + 2,
|
|
8364
8380
|
u + 2
|
|
@@ -8368,7 +8384,7 @@ const jn = (e) => M.create({
|
|
|
8368
8384
|
};
|
|
8369
8385
|
},
|
|
8370
8386
|
addProseMirrorPlugins() {
|
|
8371
|
-
return [
|
|
8387
|
+
return [Gn(), zn()];
|
|
8372
8388
|
},
|
|
8373
8389
|
addKeyboardShortcuts() {
|
|
8374
8390
|
return {
|
|
@@ -8475,7 +8491,7 @@ const jn = (e) => M.create({
|
|
|
8475
8491
|
}
|
|
8476
8492
|
};
|
|
8477
8493
|
}
|
|
8478
|
-
}),
|
|
8494
|
+
}), $n = $.create({
|
|
8479
8495
|
name: "blockGroup",
|
|
8480
8496
|
group: "blockGroup",
|
|
8481
8497
|
content: "blockContainer+",
|
|
@@ -8493,7 +8509,7 @@ const jn = (e) => M.create({
|
|
|
8493
8509
|
...((i = this.options.domAttributes) == null ? void 0 : i.blockGroup) || {},
|
|
8494
8510
|
...e
|
|
8495
8511
|
}, o = document.createElement("div");
|
|
8496
|
-
o.className =
|
|
8512
|
+
o.className = D(
|
|
8497
8513
|
"bn-block-group",
|
|
8498
8514
|
t.class
|
|
8499
8515
|
), o.setAttribute("data-node-type", "blockGroup");
|
|
@@ -8504,11 +8520,11 @@ const jn = (e) => M.create({
|
|
|
8504
8520
|
contentDOM: o
|
|
8505
8521
|
};
|
|
8506
8522
|
}
|
|
8507
|
-
}),
|
|
8523
|
+
}), qn = $.create({
|
|
8508
8524
|
name: "doc",
|
|
8509
8525
|
topNode: !0,
|
|
8510
8526
|
content: "blockGroup"
|
|
8511
|
-
}),
|
|
8527
|
+
}), Xn = (e) => {
|
|
8512
8528
|
var i;
|
|
8513
8529
|
const t = [
|
|
8514
8530
|
J.ClipboardTextSerializer,
|
|
@@ -8535,9 +8551,9 @@ const jn = (e) => M.create({
|
|
|
8535
8551
|
}
|
|
8536
8552
|
}),
|
|
8537
8553
|
...Object.values(e.styleSpecs).map((n) => n.implementation.mark),
|
|
8538
|
-
zn,
|
|
8539
8554
|
Vn,
|
|
8540
|
-
|
|
8555
|
+
jn,
|
|
8556
|
+
Dn,
|
|
8541
8557
|
// make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
|
|
8542
8558
|
M.create({
|
|
8543
8559
|
name: "OverrideEscape",
|
|
@@ -8548,12 +8564,12 @@ const jn = (e) => M.create({
|
|
|
8548
8564
|
}
|
|
8549
8565
|
}),
|
|
8550
8566
|
// nodes
|
|
8551
|
-
|
|
8552
|
-
|
|
8567
|
+
qn,
|
|
8568
|
+
Wn.configure({
|
|
8553
8569
|
editor: e.editor,
|
|
8554
8570
|
domAttributes: e.domAttributes
|
|
8555
8571
|
}),
|
|
8556
|
-
|
|
8572
|
+
$n.configure({
|
|
8557
8573
|
domAttributes: e.domAttributes
|
|
8558
8574
|
}),
|
|
8559
8575
|
...Object.values(e.inlineContentSpecs).filter((n) => n.config !== "link" && n.config !== "text").map((n) => n.implementation.node.configure({
|
|
@@ -8573,13 +8589,13 @@ const jn = (e) => M.create({
|
|
|
8573
8589
|
domAttributes: e.domAttributes
|
|
8574
8590
|
})
|
|
8575
8591
|
]),
|
|
8592
|
+
An(e.editor),
|
|
8576
8593
|
Hn(e.editor),
|
|
8577
|
-
|
|
8578
|
-
Rn(e.editor),
|
|
8594
|
+
Un(e.editor),
|
|
8579
8595
|
ho.configure({ width: 5, color: "#ddeeff" }),
|
|
8580
8596
|
// This needs to be at the bottom of this list, because Key events (such as enter, when selecting a /command),
|
|
8581
8597
|
// should be handled before Enter handlers in other components like splitListItem
|
|
8582
|
-
...e.trailingBlock === void 0 || e.trailingBlock ? [
|
|
8598
|
+
...e.trailingBlock === void 0 || e.trailingBlock ? [Rn] : []
|
|
8583
8599
|
];
|
|
8584
8600
|
if (e.collaboration) {
|
|
8585
8601
|
if (t.push(
|
|
@@ -8608,20 +8624,20 @@ const jn = (e) => M.create({
|
|
|
8608
8624
|
const o = e.disableExtensions || [];
|
|
8609
8625
|
return t.filter((n) => !o.includes(n.name));
|
|
8610
8626
|
};
|
|
8611
|
-
function
|
|
8627
|
+
function Zn(e, t) {
|
|
8612
8628
|
const o = [];
|
|
8613
8629
|
return e.forEach((i, n, r) => {
|
|
8614
8630
|
r !== t && o.push(i);
|
|
8615
8631
|
}), L.from(o);
|
|
8616
8632
|
}
|
|
8617
|
-
function
|
|
8633
|
+
function Jn(e, t) {
|
|
8618
8634
|
let o = L.from(e.content);
|
|
8619
8635
|
for (let i = 0; i < o.childCount; i++)
|
|
8620
8636
|
if (o.child(i).type.spec.group === "blockContent") {
|
|
8621
8637
|
const n = [o.child(i)];
|
|
8622
8638
|
if (i + 1 < o.childCount && o.child(i + 1).type.spec.group === "blockGroup") {
|
|
8623
8639
|
const a = o.child(i + 1).child(0).child(0);
|
|
8624
|
-
(a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(o.child(i + 1)), o =
|
|
8640
|
+
(a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(o.child(i + 1)), o = Zn(o, i + 1));
|
|
8625
8641
|
}
|
|
8626
8642
|
const r = t.state.schema.nodes.blockContainer.create(
|
|
8627
8643
|
void 0,
|
|
@@ -8629,14 +8645,14 @@ function er(e, t) {
|
|
|
8629
8645
|
);
|
|
8630
8646
|
o = o.replaceChild(i, r);
|
|
8631
8647
|
}
|
|
8632
|
-
return new
|
|
8648
|
+
return new j(o, e.openStart, e.openEnd);
|
|
8633
8649
|
}
|
|
8634
|
-
function
|
|
8650
|
+
function be(e) {
|
|
8635
8651
|
return e && Object.fromEntries(
|
|
8636
8652
|
Object.entries(e).filter(([, t]) => t !== void 0)
|
|
8637
8653
|
);
|
|
8638
8654
|
}
|
|
8639
|
-
class
|
|
8655
|
+
class Ne {
|
|
8640
8656
|
constructor(t) {
|
|
8641
8657
|
c(this, "blockSpecs");
|
|
8642
8658
|
c(this, "inlineContentSpecs");
|
|
@@ -8648,12 +8664,12 @@ class Ie {
|
|
|
8648
8664
|
c(this, "BlockNoteEditor", "only for types");
|
|
8649
8665
|
c(this, "Block", "only for types");
|
|
8650
8666
|
c(this, "PartialBlock", "only for types");
|
|
8651
|
-
this.blockSpecs =
|
|
8667
|
+
this.blockSpecs = be(t == null ? void 0 : t.blockSpecs) || gt, this.inlineContentSpecs = be(t == null ? void 0 : t.inlineContentSpecs) || kt, this.styleSpecs = be(t == null ? void 0 : t.styleSpecs) || bt, this.blockSchema = ut(this.blockSpecs), this.inlineContentSchema = pt(
|
|
8652
8668
|
this.inlineContentSpecs
|
|
8653
8669
|
), this.styleSchema = mt(this.styleSpecs);
|
|
8654
8670
|
}
|
|
8655
8671
|
static create(t) {
|
|
8656
|
-
return new
|
|
8672
|
+
return new Ne(t);
|
|
8657
8673
|
}
|
|
8658
8674
|
}
|
|
8659
8675
|
class Et extends Ft {
|
|
@@ -8739,8 +8755,8 @@ class Et extends Ft {
|
|
|
8739
8755
|
}
|
|
8740
8756
|
Et.prototype.createView = () => {
|
|
8741
8757
|
};
|
|
8742
|
-
const
|
|
8743
|
-
key:
|
|
8758
|
+
const Yn = new S("blocknote-placeholder"), Qn = (e, t) => new y({
|
|
8759
|
+
key: Yn,
|
|
8744
8760
|
view: () => {
|
|
8745
8761
|
const o = document.createElement("style"), i = e._tiptapEditor.options.injectNonce;
|
|
8746
8762
|
i && o.setAttribute("nonce", i), e._tiptapEditor.view.root instanceof ShadowRoot ? e._tiptapEditor.view.root.append(o) : e._tiptapEditor.view.root.head.appendChild(o);
|
|
@@ -8784,8 +8800,7 @@ const tr = new S("blocknote-placeholder"), or = (e, t) => new y({
|
|
|
8784
8800
|
return G.create(i, [l]);
|
|
8785
8801
|
}
|
|
8786
8802
|
}
|
|
8787
|
-
})
|
|
8788
|
-
const ir = {
|
|
8803
|
+
}), er = {
|
|
8789
8804
|
enableInputRules: !0,
|
|
8790
8805
|
enablePasteRules: !0,
|
|
8791
8806
|
enableCoreExtensions: !1
|
|
@@ -8872,7 +8887,7 @@ class Ct {
|
|
|
8872
8887
|
this.dictionary = t.dictionary || et;
|
|
8873
8888
|
const i = {
|
|
8874
8889
|
defaultStyles: !0,
|
|
8875
|
-
schema: t.schema ||
|
|
8890
|
+
schema: t.schema || Ne.create(),
|
|
8876
8891
|
_headless: !1,
|
|
8877
8892
|
...t,
|
|
8878
8893
|
placeholders: {
|
|
@@ -8880,8 +8895,8 @@ class Ct {
|
|
|
8880
8895
|
...t.placeholders
|
|
8881
8896
|
}
|
|
8882
8897
|
};
|
|
8883
|
-
this.schema = i.schema, this.blockImplementations = i.schema.blockSpecs, this.inlineContentImplementations = i.schema.inlineContentSpecs, this.styleImplementations = i.schema.styleSpecs, this.formattingToolbar = new
|
|
8884
|
-
const n =
|
|
8898
|
+
this.schema = i.schema, this.blockImplementations = i.schema.blockSpecs, this.inlineContentImplementations = i.schema.inlineContentSpecs, this.styleImplementations = i.schema.styleSpecs, this.formattingToolbar = new mn(this), this.linkToolbar = new bn(this), this.sideMenu = new xn(this), this.suggestionMenus = new Sn(this), this.filePanel = new un(this), E("table", this) && (this.tableHandles = new In(this));
|
|
8899
|
+
const n = Xn({
|
|
8885
8900
|
editor: this,
|
|
8886
8901
|
domAttributes: i.domAttributes || {},
|
|
8887
8902
|
blockSpecs: this.schema.blockSpecs,
|
|
@@ -8899,7 +8914,7 @@ class Ct {
|
|
|
8899
8914
|
this.suggestionMenus.plugin,
|
|
8900
8915
|
...this.filePanel ? [this.filePanel.plugin] : [],
|
|
8901
8916
|
...this.tableHandles ? [this.tableHandles.plugin] : [],
|
|
8902
|
-
|
|
8917
|
+
Qn(this, i.placeholders)
|
|
8903
8918
|
]
|
|
8904
8919
|
});
|
|
8905
8920
|
n.push(r), this.uploadFile = i.uploadFile, this.resolveFileUrl = i.resolveFileUrl || (async (g) => g), this.headless = i._headless, i.collaboration && i.initialContent && console.warn(
|
|
@@ -8921,7 +8936,7 @@ class Ct {
|
|
|
8921
8936
|
"initialContent must be a non-empty array of blocks, received: " + a
|
|
8922
8937
|
);
|
|
8923
8938
|
const s = {
|
|
8924
|
-
...
|
|
8939
|
+
...er,
|
|
8925
8940
|
...i._tiptapOptions,
|
|
8926
8941
|
content: a,
|
|
8927
8942
|
extensions: [
|
|
@@ -8933,13 +8948,13 @@ class Ct {
|
|
|
8933
8948
|
attributes: {
|
|
8934
8949
|
...(p = (u = i._tiptapOptions) == null ? void 0 : u.editorProps) == null ? void 0 : p.attributes,
|
|
8935
8950
|
...(h = i.domAttributes) == null ? void 0 : h.editor,
|
|
8936
|
-
class:
|
|
8951
|
+
class: D(
|
|
8937
8952
|
"bn-editor",
|
|
8938
8953
|
i.defaultStyles ? "bn-default-styles" : "",
|
|
8939
8954
|
((m = (f = i.domAttributes) == null ? void 0 : f.editor) == null ? void 0 : m.class) || ""
|
|
8940
8955
|
)
|
|
8941
8956
|
},
|
|
8942
|
-
transformPasted:
|
|
8957
|
+
transformPasted: Jn
|
|
8943
8958
|
}
|
|
8944
8959
|
};
|
|
8945
8960
|
this.headless ? this._pmSchema = Kt(s.extensions) : (this._tiptapEditor = new Et(
|
|
@@ -9083,7 +9098,7 @@ class Ct {
|
|
|
9083
9098
|
* @param placement Whether the text cursor should be placed at the start or end of the block.
|
|
9084
9099
|
*/
|
|
9085
9100
|
setTextCursorPosition(t, o = "start") {
|
|
9086
|
-
const i = typeof t == "string" ? t : t.id, { posBeforeNode: n } =
|
|
9101
|
+
const i = typeof t == "string" ? t : t.id, { posBeforeNode: n } = Le(i, this._tiptapEditor.state.doc), { startPos: r, contentNode: a } = k(
|
|
9087
9102
|
this._tiptapEditor.state.doc,
|
|
9088
9103
|
n + 2
|
|
9089
9104
|
), s = this.schema.blockSchema[a.type.name].content;
|
|
@@ -9152,7 +9167,7 @@ class Ct {
|
|
|
9152
9167
|
* `referenceBlock`. Inserts the blocks at the start of the existing block's children if "nested" is used.
|
|
9153
9168
|
*/
|
|
9154
9169
|
insertBlocks(t, o, i = "before") {
|
|
9155
|
-
return
|
|
9170
|
+
return qi(t, o, i, this);
|
|
9156
9171
|
}
|
|
9157
9172
|
/**
|
|
9158
9173
|
* Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
|
|
@@ -9162,14 +9177,14 @@ class Ct {
|
|
|
9162
9177
|
* @param update A partial block which defines how the existing block should be changed.
|
|
9163
9178
|
*/
|
|
9164
9179
|
updateBlock(t, o) {
|
|
9165
|
-
return
|
|
9180
|
+
return Xi(t, o, this);
|
|
9166
9181
|
}
|
|
9167
9182
|
/**
|
|
9168
9183
|
* Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
|
|
9169
9184
|
* @param blocksToRemove An array of identifiers for existing blocks that should be removed.
|
|
9170
9185
|
*/
|
|
9171
9186
|
removeBlocks(t) {
|
|
9172
|
-
return
|
|
9187
|
+
return Zi(t, this);
|
|
9173
9188
|
}
|
|
9174
9189
|
/**
|
|
9175
9190
|
* Replaces existing blocks in the editor with new blocks. If the blocks that should be removed are not adjacent or
|
|
@@ -9179,7 +9194,7 @@ class Ct {
|
|
|
9179
9194
|
* @param blocksToInsert An array of partial blocks to replace the old ones with.
|
|
9180
9195
|
*/
|
|
9181
9196
|
replaceBlocks(t, o) {
|
|
9182
|
-
return
|
|
9197
|
+
return Ji(t, o, this);
|
|
9183
9198
|
}
|
|
9184
9199
|
/**
|
|
9185
9200
|
* Insert a piece of content at the current cursor position.
|
|
@@ -9192,7 +9207,7 @@ class Ct {
|
|
|
9192
9207
|
this.pmSchema,
|
|
9193
9208
|
this.schema.styleSchema
|
|
9194
9209
|
);
|
|
9195
|
-
|
|
9210
|
+
Yi(
|
|
9196
9211
|
{
|
|
9197
9212
|
from: this._tiptapEditor.state.selection.from,
|
|
9198
9213
|
to: this._tiptapEditor.state.selection.to
|
|
@@ -9328,7 +9343,7 @@ class Ct {
|
|
|
9328
9343
|
* @returns The blocks, serialized as an HTML string.
|
|
9329
9344
|
*/
|
|
9330
9345
|
async blocksToHTMLLossy(t = this.document) {
|
|
9331
|
-
return
|
|
9346
|
+
return se(this.pmSchema, this).exportBlocks(t, {});
|
|
9332
9347
|
}
|
|
9333
9348
|
/**
|
|
9334
9349
|
* Serializes blocks into an HTML string in the format that would normally be rendered by the editor.
|
|
@@ -9340,7 +9355,7 @@ class Ct {
|
|
|
9340
9355
|
* @returns The blocks, serialized as an HTML string.
|
|
9341
9356
|
*/
|
|
9342
9357
|
async blocksToFullHTML(t) {
|
|
9343
|
-
return
|
|
9358
|
+
return Me(this.pmSchema, this).serializeBlocks(t, {});
|
|
9344
9359
|
}
|
|
9345
9360
|
/**
|
|
9346
9361
|
* Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
|
|
@@ -9365,7 +9380,7 @@ class Ct {
|
|
|
9365
9380
|
* @returns The blocks, serialized as a Markdown string.
|
|
9366
9381
|
*/
|
|
9367
9382
|
async blocksToMarkdownLossy(t = this.document) {
|
|
9368
|
-
return
|
|
9383
|
+
return tn(t, this.pmSchema, this, {});
|
|
9369
9384
|
}
|
|
9370
9385
|
/**
|
|
9371
9386
|
* Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
|
|
@@ -9375,7 +9390,7 @@ class Ct {
|
|
|
9375
9390
|
* @returns The blocks parsed from the Markdown string.
|
|
9376
9391
|
*/
|
|
9377
9392
|
async tryParseMarkdownToBlocks(t) {
|
|
9378
|
-
return
|
|
9393
|
+
return dn(
|
|
9379
9394
|
t,
|
|
9380
9395
|
this.schema.blockSchema,
|
|
9381
9396
|
this.schema.inlineContentSchema,
|
|
@@ -9434,15 +9449,22 @@ class Ct {
|
|
|
9434
9449
|
);
|
|
9435
9450
|
}
|
|
9436
9451
|
}
|
|
9437
|
-
let
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9452
|
+
let ne, ke;
|
|
9453
|
+
async function Yr(e, t) {
|
|
9454
|
+
if (!Ki("text", e))
|
|
9455
|
+
return [];
|
|
9456
|
+
if (!ne) {
|
|
9457
|
+
ne = import("@emoji-mart/data"), ke = await import("emoji-mart");
|
|
9458
|
+
const n = (await ne).default;
|
|
9459
|
+
await ke.init({ data: n });
|
|
9460
|
+
}
|
|
9461
|
+
const o = (await ne).default;
|
|
9462
|
+
return (t.trim() === "" ? Object.values(o.emojis) : await ke.SearchIndex.search(t)).map((n) => ({
|
|
9463
|
+
id: n.skins[0].native,
|
|
9464
|
+
onItemClick: () => e.insertInlineContent(n.skins[0].native + " ")
|
|
9465
|
+
}));
|
|
9444
9466
|
}
|
|
9445
|
-
function
|
|
9467
|
+
function _e(e = "") {
|
|
9446
9468
|
return typeof e == "string" ? [
|
|
9447
9469
|
{
|
|
9448
9470
|
type: "text",
|
|
@@ -9452,16 +9474,16 @@ function be(e = "") {
|
|
|
9452
9474
|
] : e;
|
|
9453
9475
|
}
|
|
9454
9476
|
function St(e) {
|
|
9455
|
-
return typeof e == "string" ?
|
|
9477
|
+
return typeof e == "string" ? _e(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? _e(t) : ot(t) ? {
|
|
9456
9478
|
...t,
|
|
9457
|
-
content:
|
|
9479
|
+
content: _e(t.content)
|
|
9458
9480
|
} : te(t) ? t : {
|
|
9459
9481
|
props: {},
|
|
9460
9482
|
...t,
|
|
9461
9483
|
content: St(t.content)
|
|
9462
9484
|
}) : e;
|
|
9463
9485
|
}
|
|
9464
|
-
function
|
|
9486
|
+
function Qr(e, t) {
|
|
9465
9487
|
return t.map(
|
|
9466
9488
|
(o) => Mt(e, o)
|
|
9467
9489
|
);
|
|
@@ -9485,138 +9507,138 @@ function Mt(e, t) {
|
|
|
9485
9507
|
children: o.children.map((i) => Mt(e, i))
|
|
9486
9508
|
};
|
|
9487
9509
|
}
|
|
9488
|
-
function
|
|
9489
|
-
e.id || (e.id = oe.options.generateID()), e.children &&
|
|
9510
|
+
function tr(e) {
|
|
9511
|
+
e.id || (e.id = oe.options.generateID()), e.children && or(e.children);
|
|
9490
9512
|
}
|
|
9491
|
-
function
|
|
9513
|
+
function or(e) {
|
|
9492
9514
|
for (const t of e)
|
|
9493
|
-
|
|
9515
|
+
tr(t);
|
|
9494
9516
|
}
|
|
9495
9517
|
export {
|
|
9496
|
-
|
|
9518
|
+
Yo as AudioBlock,
|
|
9497
9519
|
Ct as BlockNoteEditor,
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9520
|
+
Ne as BlockNoteSchema,
|
|
9521
|
+
ni as FileBlock,
|
|
9522
|
+
un as FilePanelProsemirrorPlugin,
|
|
9523
|
+
cn as FilePanelView,
|
|
9524
|
+
mn as FormattingToolbarProsemirrorPlugin,
|
|
9525
|
+
pn as FormattingToolbarView,
|
|
9504
9526
|
wt as HTMLToBlocks,
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9527
|
+
ci as ImageBlock,
|
|
9528
|
+
bn as LinkToolbarProsemirrorPlugin,
|
|
9529
|
+
xn as SideMenuProsemirrorPlugin,
|
|
9530
|
+
wn as SideMenuView,
|
|
9531
|
+
Sn as SuggestionMenuProseMirrorPlugin,
|
|
9532
|
+
In as TableHandlesProsemirrorPlugin,
|
|
9533
|
+
Ln as TableHandlesView,
|
|
9512
9534
|
oe as UniqueID,
|
|
9513
9535
|
I as UnreachableCaseError,
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9536
|
+
gi as VideoBlock,
|
|
9537
|
+
tr as addIdsToBlock,
|
|
9538
|
+
or as addIdsToBlocks,
|
|
9539
|
+
Vo as addInlineContentAttributes,
|
|
9540
|
+
Ro as addInlineContentKeyboardShortcuts,
|
|
9541
|
+
Ko as addStyleAttributes,
|
|
9542
|
+
Dr as assertEmpty,
|
|
9543
|
+
qo as audioBlockConfig,
|
|
9544
|
+
Zo as audioParse,
|
|
9545
|
+
$o as audioPropSchema,
|
|
9546
|
+
Xo as audioRender,
|
|
9547
|
+
Jo as audioToExternalHTML,
|
|
9526
9548
|
P as blockToNode,
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9549
|
+
tn as blocksToMarkdown,
|
|
9550
|
+
ae as camelToDataKebab,
|
|
9551
|
+
qr as checkBlockHasDefaultProp,
|
|
9552
|
+
Wi as checkBlockIsDefaultType,
|
|
9553
|
+
Kr as checkBlockIsFileBlock,
|
|
9554
|
+
$r as checkBlockIsFileBlockWithPlaceholder,
|
|
9555
|
+
Wr as checkBlockIsFileBlockWithPreview,
|
|
9556
|
+
$i as checkBlockTypeHasDefaultProp,
|
|
9535
9557
|
E as checkDefaultBlockTypeInSchema,
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9558
|
+
Ki as checkDefaultInlineContentTypeInSchema,
|
|
9559
|
+
Ie as cleanHTMLToMarkdown,
|
|
9560
|
+
Se as contentNodeToInlineContent,
|
|
9561
|
+
ce as createAddFileButton,
|
|
9562
|
+
le as createBlockSpec,
|
|
9541
9563
|
q as createBlockSpecFromStronglyTypedTiptapNode,
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9564
|
+
de as createDefaultFilePreview,
|
|
9565
|
+
se as createExternalHTMLExporter,
|
|
9566
|
+
Te as createFigureWithCaption,
|
|
9567
|
+
R as createFileAndCaptionWrapper,
|
|
9568
|
+
Or as createInlineContentSpec,
|
|
9569
|
+
zo as createInlineContentSpecFromTipTapNode,
|
|
9548
9570
|
ct as createInternalBlockSpec,
|
|
9549
|
-
|
|
9550
|
-
|
|
9571
|
+
Me as createInternalHTMLSerializer,
|
|
9572
|
+
Oo as createInternalInlineContentSpec,
|
|
9551
9573
|
ht as createInternalStyleSpec,
|
|
9552
|
-
|
|
9574
|
+
pe as createLinkWithCaption,
|
|
9553
9575
|
ft as createResizeHandlesWrapper,
|
|
9554
9576
|
O as createStronglyTypedTiptapNode,
|
|
9555
|
-
|
|
9577
|
+
zr as createStyleSpec,
|
|
9556
9578
|
U as createStyleSpecFromTipTapMark,
|
|
9557
|
-
|
|
9558
|
-
|
|
9579
|
+
Xr as createSuggestionMenu,
|
|
9580
|
+
Fi as defaultBlockSchema,
|
|
9559
9581
|
gt as defaultBlockSpecs,
|
|
9560
|
-
|
|
9582
|
+
Gi as defaultInlineContentSchema,
|
|
9561
9583
|
kt as defaultInlineContentSpecs,
|
|
9562
9584
|
_ as defaultProps,
|
|
9563
|
-
|
|
9585
|
+
Gr as defaultStyleSchema,
|
|
9564
9586
|
bt as defaultStyleSpecs,
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
|
|
9571
|
-
|
|
9587
|
+
ei as fileBlockConfig,
|
|
9588
|
+
oi as fileParse,
|
|
9589
|
+
Qo as filePropSchema,
|
|
9590
|
+
ti as fileRender,
|
|
9591
|
+
ii as fileToExternalHTML,
|
|
9592
|
+
Rr as filenameFromURL,
|
|
9593
|
+
Jr as filterSuggestionItems,
|
|
9572
9594
|
H as formatKeyboardShortcut,
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9595
|
+
hn as formattingToolbarPluginKey,
|
|
9596
|
+
jo as getBlockFromPos,
|
|
9597
|
+
Xn as getBlockNoteExtensions,
|
|
9576
9598
|
ut as getBlockSchemaFromSpecs,
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9599
|
+
Yr as getDefaultEmojiPickerItems,
|
|
9600
|
+
Zr as getDefaultSlashMenuItems,
|
|
9601
|
+
he as getDraggableBlockFromElement,
|
|
9602
|
+
Fo as getInlineContentParseRules,
|
|
9581
9603
|
pt as getInlineContentSchemaFromSpecs,
|
|
9582
|
-
|
|
9583
|
-
|
|
9604
|
+
Do as getParseRules,
|
|
9605
|
+
Wo as getStyleParseRules,
|
|
9584
9606
|
mt as getStyleSchemaFromSpecs,
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9607
|
+
ai as imageBlockConfig,
|
|
9608
|
+
li as imageParse,
|
|
9609
|
+
ri as imagePropSchema,
|
|
9610
|
+
si as imageRender,
|
|
9611
|
+
di as imageToExternalHTML,
|
|
9590
9612
|
lt as inheritedProps,
|
|
9591
9613
|
W as inlineContentToNodes,
|
|
9592
9614
|
x as insertOrUpdateBlock,
|
|
9593
|
-
|
|
9594
|
-
|
|
9615
|
+
Uo as isAppleOS,
|
|
9616
|
+
Ve as isLinkInlineContent,
|
|
9595
9617
|
ot as isPartialLinkInlineContent,
|
|
9596
|
-
|
|
9618
|
+
Vr as isSafari,
|
|
9597
9619
|
te as isStyledTextInlineContent,
|
|
9598
|
-
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
|
|
9620
|
+
gn as linkToolbarPluginKey,
|
|
9621
|
+
jr as locales,
|
|
9622
|
+
dn as markdownToBlocks,
|
|
9623
|
+
D as mergeCSSClasses,
|
|
9602
9624
|
v as nodeToBlock,
|
|
9603
9625
|
rt as nodeToCustomInlineContent,
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9626
|
+
ze as parseEmbedElement,
|
|
9627
|
+
ue as parseFigureElement,
|
|
9628
|
+
Ge as parseImageElement,
|
|
9607
9629
|
Mt as partialBlockToBlockForTesting,
|
|
9608
|
-
|
|
9630
|
+
Qr as partialBlocksToBlocksForTesting,
|
|
9609
9631
|
dt as propsToAttributes,
|
|
9610
|
-
|
|
9611
|
-
|
|
9632
|
+
vn as sideMenuPluginKey,
|
|
9633
|
+
Go as stylePropsToAttributes,
|
|
9612
9634
|
it as tableContentToNodes,
|
|
9613
9635
|
Q as tableHandlesPluginKey,
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9636
|
+
Fr as uploadToTmpFilesDotOrg_DEV_ONLY,
|
|
9637
|
+
pi as videoBlockConfig,
|
|
9638
|
+
mi as videoParse,
|
|
9639
|
+
ui as videoPropSchema,
|
|
9640
|
+
hi as videoRender,
|
|
9641
|
+
fi as videoToExternalHTML,
|
|
9642
|
+
fe as wrapInBlockStructure
|
|
9621
9643
|
};
|
|
9622
9644
|
//# sourceMappingURL=blocknote.js.map
|