@blocknote/core 0.15.9 → 0.15.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote.js +745 -719
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +6 -6
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +2 -2
- package/src/api/blockManipulation/blockManipulation.test.ts +7 -32
- package/src/editor/BlockNoteEditor.ts +2 -2
- package/src/editor/BlockNoteTipTapEditor.ts +34 -7
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +26 -0
- package/src/schema/blocks/createSpec.ts +27 -2
- package/src/schema/blocks/types.ts +2 -0
- package/src/schema/inlineContent/createSpec.ts +7 -4
- package/types/src/editor/BlockNoteEditor.d.ts +1 -1
- package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -1
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +3 -0
- package/types/src/schema/blocks/createSpec.d.ts +3 -0
- package/types/src/schema/blocks/types.d.ts +2 -0
- package/types/src/schema/inlineContent/createSpec.d.ts +3 -2
package/dist/blocknote.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var c = (e, t, i) =>
|
|
4
|
-
import { Slice as z, Fragment as N, DOMSerializer as
|
|
5
|
-
import { Extension as I, combineTransactionSteps as
|
|
6
|
-
import { Plugin as x, PluginKey as L, Selection as
|
|
7
|
-
import { v4 as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { TableCell as
|
|
14
|
-
import { TableHeader as
|
|
15
|
-
import { TableRow as
|
|
16
|
-
import { columnResizing as
|
|
17
|
-
import { DecorationSet as K, Decoration as $, EditorView as
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { Dropcursor as
|
|
21
|
-
import { Gapcursor as
|
|
22
|
-
import { HardBreak as
|
|
23
|
-
import { History as
|
|
24
|
-
import { Link as
|
|
25
|
-
import { Text as
|
|
26
|
-
const
|
|
1
|
+
var Lt = Object.defineProperty;
|
|
2
|
+
var It = (e, t, i) => t in e ? Lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
|
3
|
+
var c = (e, t, i) => It(e, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
+
import { Slice as z, Fragment as N, DOMSerializer as Se, DOMParser as At, Node as Nt } from "prosemirror-model";
|
|
5
|
+
import { Extension as I, combineTransactionSteps as Pt, getChangedRanges as Ht, findChildrenInRange as Ut, Node as q, Mark as Me, InputRule as ee, callOrReturn as Dt, getExtensionField as jt, mergeAttributes as zt, selectionToInsertionEnd as Rt, isTextSelection as Vt, isNodeSelection as Ot, posToDOMRect as xe, getMarkRange as ze, findParentNode as Ft, extensions as J, Editor as Gt, createDocument as Wt, findChildren as Re, getSchema as Kt } from "@tiptap/core";
|
|
6
|
+
import { Plugin as x, PluginKey as L, Selection as be, NodeSelection as ce, TextSelection as Y, EditorState as $t } from "prosemirror-state";
|
|
7
|
+
import { v4 as qt } from "uuid";
|
|
8
|
+
import Xt from "@tiptap/extension-bold";
|
|
9
|
+
import Zt from "@tiptap/extension-code";
|
|
10
|
+
import Jt from "@tiptap/extension-italic";
|
|
11
|
+
import Yt from "@tiptap/extension-strike";
|
|
12
|
+
import Qt from "@tiptap/extension-underline";
|
|
13
|
+
import { TableCell as ei } from "@tiptap/extension-table-cell";
|
|
14
|
+
import { TableHeader as ti } from "@tiptap/extension-table-header";
|
|
15
|
+
import { TableRow as ii } from "@tiptap/extension-table-row";
|
|
16
|
+
import { columnResizing as oi, tableEditing as ni } from "prosemirror-tables";
|
|
17
|
+
import { DecorationSet as K, Decoration as $, EditorView as ri } from "prosemirror-view";
|
|
18
|
+
import ai from "@tiptap/extension-collaboration";
|
|
19
|
+
import si from "@tiptap/extension-collaboration-cursor";
|
|
20
|
+
import { Dropcursor as li } from "@tiptap/extension-dropcursor";
|
|
21
|
+
import { Gapcursor as di } from "@tiptap/extension-gapcursor";
|
|
22
|
+
import { HardBreak as ci } from "@tiptap/extension-hard-break";
|
|
23
|
+
import { History as ui } from "@tiptap/extension-history";
|
|
24
|
+
import { Link as pi } from "@tiptap/extension-link";
|
|
25
|
+
import { Text as hi } from "@tiptap/extension-text";
|
|
26
|
+
const mi = {
|
|
27
27
|
slash_menu: {
|
|
28
28
|
heading: {
|
|
29
29
|
title: "عنوان 1",
|
|
@@ -313,7 +313,7 @@ const hi = {
|
|
|
313
313
|
generic: {
|
|
314
314
|
ctrl_shortcut: "Ctrl"
|
|
315
315
|
}
|
|
316
|
-
},
|
|
316
|
+
}, fi = {
|
|
317
317
|
slash_menu: {
|
|
318
318
|
heading: {
|
|
319
319
|
title: "Überschrift 1",
|
|
@@ -618,7 +618,7 @@ const hi = {
|
|
|
618
618
|
generic: {
|
|
619
619
|
ctrl_shortcut: "Strg"
|
|
620
620
|
}
|
|
621
|
-
},
|
|
621
|
+
}, tt = {
|
|
622
622
|
slash_menu: {
|
|
623
623
|
heading: {
|
|
624
624
|
title: "Heading 1",
|
|
@@ -924,7 +924,7 @@ const hi = {
|
|
|
924
924
|
generic: {
|
|
925
925
|
ctrl_shortcut: "Ctrl"
|
|
926
926
|
}
|
|
927
|
-
},
|
|
927
|
+
}, gi = {
|
|
928
928
|
slash_menu: {
|
|
929
929
|
heading: {
|
|
930
930
|
title: "Encabezado 1",
|
|
@@ -1197,7 +1197,7 @@ const hi = {
|
|
|
1197
1197
|
generic: {
|
|
1198
1198
|
ctrl_shortcut: "Ctrl"
|
|
1199
1199
|
}
|
|
1200
|
-
},
|
|
1200
|
+
}, bi = {
|
|
1201
1201
|
slash_menu: {
|
|
1202
1202
|
heading: {
|
|
1203
1203
|
title: "Titre 1",
|
|
@@ -1502,7 +1502,7 @@ const hi = {
|
|
|
1502
1502
|
generic: {
|
|
1503
1503
|
ctrl_shortcut: "Ctrl"
|
|
1504
1504
|
}
|
|
1505
|
-
},
|
|
1505
|
+
}, _i = {
|
|
1506
1506
|
slash_menu: {
|
|
1507
1507
|
heading: {
|
|
1508
1508
|
title: "Fyrirsögn 1",
|
|
@@ -1799,7 +1799,7 @@ const hi = {
|
|
|
1799
1799
|
generic: {
|
|
1800
1800
|
ctrl_shortcut: "Ctrl"
|
|
1801
1801
|
}
|
|
1802
|
-
},
|
|
1802
|
+
}, ki = {
|
|
1803
1803
|
slash_menu: {
|
|
1804
1804
|
heading: {
|
|
1805
1805
|
title: "見出し1",
|
|
@@ -2124,7 +2124,7 @@ const hi = {
|
|
|
2124
2124
|
generic: {
|
|
2125
2125
|
ctrl_shortcut: "Ctrl"
|
|
2126
2126
|
}
|
|
2127
|
-
},
|
|
2127
|
+
}, yi = {
|
|
2128
2128
|
slash_menu: {
|
|
2129
2129
|
heading: {
|
|
2130
2130
|
title: "제목1",
|
|
@@ -2442,7 +2442,7 @@ const hi = {
|
|
|
2442
2442
|
generic: {
|
|
2443
2443
|
ctrl_shortcut: "Ctrl"
|
|
2444
2444
|
}
|
|
2445
|
-
},
|
|
2445
|
+
}, wi = {
|
|
2446
2446
|
slash_menu: {
|
|
2447
2447
|
heading: {
|
|
2448
2448
|
title: "Kop 1",
|
|
@@ -3036,7 +3036,7 @@ const hi = {
|
|
|
3036
3036
|
generic: {
|
|
3037
3037
|
ctrl_shortcut: "Ctrl"
|
|
3038
3038
|
}
|
|
3039
|
-
},
|
|
3039
|
+
}, xi = {
|
|
3040
3040
|
slash_menu: {
|
|
3041
3041
|
heading: {
|
|
3042
3042
|
title: "Título",
|
|
@@ -3333,7 +3333,7 @@ const hi = {
|
|
|
3333
3333
|
generic: {
|
|
3334
3334
|
ctrl_shortcut: "Ctrl"
|
|
3335
3335
|
}
|
|
3336
|
-
},
|
|
3336
|
+
}, Ei = {
|
|
3337
3337
|
slash_menu: {
|
|
3338
3338
|
heading: {
|
|
3339
3339
|
title: "Заголовок 1 уровня",
|
|
@@ -3665,7 +3665,7 @@ const hi = {
|
|
|
3665
3665
|
generic: {
|
|
3666
3666
|
ctrl_shortcut: "Ctrl"
|
|
3667
3667
|
}
|
|
3668
|
-
},
|
|
3668
|
+
}, Ci = {
|
|
3669
3669
|
slash_menu: {
|
|
3670
3670
|
heading: {
|
|
3671
3671
|
title: "Tiêu đề H1",
|
|
@@ -3969,7 +3969,7 @@ const hi = {
|
|
|
3969
3969
|
generic: {
|
|
3970
3970
|
ctrl_shortcut: "Ctrl"
|
|
3971
3971
|
}
|
|
3972
|
-
},
|
|
3972
|
+
}, Si = {
|
|
3973
3973
|
slash_menu: {
|
|
3974
3974
|
heading: {
|
|
3975
3975
|
title: "一级标题",
|
|
@@ -4307,22 +4307,22 @@ const hi = {
|
|
|
4307
4307
|
generic: {
|
|
4308
4308
|
ctrl_shortcut: "Ctrl"
|
|
4309
4309
|
}
|
|
4310
|
-
},
|
|
4310
|
+
}, Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4311
4311
|
__proto__: null,
|
|
4312
|
-
ar:
|
|
4313
|
-
de:
|
|
4314
|
-
en:
|
|
4315
|
-
es:
|
|
4316
|
-
fr:
|
|
4317
|
-
is:
|
|
4318
|
-
ja:
|
|
4319
|
-
ko:
|
|
4320
|
-
nl:
|
|
4312
|
+
ar: mi,
|
|
4313
|
+
de: fi,
|
|
4314
|
+
en: tt,
|
|
4315
|
+
es: gi,
|
|
4316
|
+
fr: bi,
|
|
4317
|
+
is: _i,
|
|
4318
|
+
ja: ki,
|
|
4319
|
+
ko: yi,
|
|
4320
|
+
nl: wi,
|
|
4321
4321
|
pl: vi,
|
|
4322
|
-
pt:
|
|
4323
|
-
ru:
|
|
4324
|
-
vi:
|
|
4325
|
-
zh:
|
|
4322
|
+
pt: xi,
|
|
4323
|
+
ru: Ei,
|
|
4324
|
+
vi: Ci,
|
|
4325
|
+
zh: Si
|
|
4326
4326
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4327
4327
|
let H;
|
|
4328
4328
|
async function ie() {
|
|
@@ -4353,18 +4353,18 @@ async function ie() {
|
|
|
4353
4353
|
rehypeFormat: e[9]
|
|
4354
4354
|
}, H;
|
|
4355
4355
|
}
|
|
4356
|
-
function
|
|
4356
|
+
function Mi(e, t = JSON.stringify) {
|
|
4357
4357
|
const i = {};
|
|
4358
4358
|
return e.filter((o) => {
|
|
4359
4359
|
const n = t(o);
|
|
4360
4360
|
return Object.prototype.hasOwnProperty.call(i, n) ? !1 : i[n] = !0;
|
|
4361
4361
|
});
|
|
4362
4362
|
}
|
|
4363
|
-
function
|
|
4363
|
+
function Ti(e) {
|
|
4364
4364
|
const t = e.filter(
|
|
4365
4365
|
(o, n) => e.indexOf(o) !== n
|
|
4366
4366
|
);
|
|
4367
|
-
return
|
|
4367
|
+
return Mi(t);
|
|
4368
4368
|
}
|
|
4369
4369
|
const oe = I.create({
|
|
4370
4370
|
name: "uniqueID",
|
|
@@ -4381,7 +4381,7 @@ const oe = I.create({
|
|
|
4381
4381
|
const e = window.__TEST_OPTIONS;
|
|
4382
4382
|
return e.mockID === void 0 ? e.mockID = 0 : e.mockID++, e.mockID.toString();
|
|
4383
4383
|
}
|
|
4384
|
-
return
|
|
4384
|
+
return qt();
|
|
4385
4385
|
},
|
|
4386
4386
|
filterTransaction: null
|
|
4387
4387
|
};
|
|
@@ -4450,26 +4450,26 @@ const oe = I.create({
|
|
|
4450
4450
|
});
|
|
4451
4451
|
if (!r || a)
|
|
4452
4452
|
return;
|
|
4453
|
-
const { tr: s } = n, { types: l, attributeName: d, generateID: u } = this.options, p =
|
|
4453
|
+
const { tr: s } = n, { types: l, attributeName: d, generateID: u } = this.options, p = Pt(
|
|
4454
4454
|
o.doc,
|
|
4455
4455
|
i
|
|
4456
4456
|
), { mapping: h } = p;
|
|
4457
|
-
if (
|
|
4458
|
-
const g =
|
|
4457
|
+
if (Ht(p).forEach(({ newRange: f }) => {
|
|
4458
|
+
const g = Ut(
|
|
4459
4459
|
n.doc,
|
|
4460
4460
|
f,
|
|
4461
4461
|
(b) => l.includes(b.type.name)
|
|
4462
|
-
), k = g.map(({ node: b }) => b.attrs[d]).filter((b) => b !== null),
|
|
4462
|
+
), k = g.map(({ node: b }) => b.attrs[d]).filter((b) => b !== null), v = Ti(k);
|
|
4463
4463
|
g.forEach(({ node: b, pos: y }) => {
|
|
4464
4464
|
let S;
|
|
4465
|
-
const
|
|
4466
|
-
if (
|
|
4467
|
-
const
|
|
4468
|
-
if (o.doc.content.findDiffStart(
|
|
4469
|
-
const
|
|
4465
|
+
const Ue = (S = s.doc.nodeAt(y)) === null || S === void 0 ? void 0 : S.attrs[d];
|
|
4466
|
+
if (Ue === null) {
|
|
4467
|
+
const De = o.doc.type.createAndFill().content;
|
|
4468
|
+
if (o.doc.content.findDiffStart(De) === null) {
|
|
4469
|
+
const je = JSON.parse(
|
|
4470
4470
|
JSON.stringify(n.doc.toJSON())
|
|
4471
4471
|
);
|
|
4472
|
-
if (
|
|
4472
|
+
if (je.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(je.content) === JSON.stringify(De.toJSON())) {
|
|
4473
4473
|
s.setNodeMarkup(y, void 0, {
|
|
4474
4474
|
...b.attrs,
|
|
4475
4475
|
[d]: "initialBlockId"
|
|
@@ -4483,8 +4483,8 @@ const oe = I.create({
|
|
|
4483
4483
|
});
|
|
4484
4484
|
return;
|
|
4485
4485
|
}
|
|
4486
|
-
const { deleted:
|
|
4487
|
-
|
|
4486
|
+
const { deleted: Bt } = h.invert().mapResult(y);
|
|
4487
|
+
Bt && v.includes(Ue) && s.setNodeMarkup(y, void 0, {
|
|
4488
4488
|
...b.attrs,
|
|
4489
4489
|
[d]: u()
|
|
4490
4490
|
});
|
|
@@ -4555,7 +4555,7 @@ const oe = I.create({
|
|
|
4555
4555
|
];
|
|
4556
4556
|
}
|
|
4557
4557
|
});
|
|
4558
|
-
function
|
|
4558
|
+
function it(e) {
|
|
4559
4559
|
const t = e.attrs.id, i = e.firstChild, o = i.type, n = e.childCount === 2 ? e.lastChild.childCount : 0;
|
|
4560
4560
|
return {
|
|
4561
4561
|
id: t,
|
|
@@ -4585,7 +4585,7 @@ function _(e, t) {
|
|
|
4585
4585
|
break;
|
|
4586
4586
|
s -= 1, a = n.node(s);
|
|
4587
4587
|
}
|
|
4588
|
-
const { id: l, contentNode: d, contentType: u, numChildBlocks: p } =
|
|
4588
|
+
const { id: l, contentNode: d, contentType: u, numChildBlocks: p } = it(a), h = n.start(s), m = n.end(s);
|
|
4589
4589
|
return {
|
|
4590
4590
|
id: l,
|
|
4591
4591
|
node: a,
|
|
@@ -4597,10 +4597,10 @@ function _(e, t) {
|
|
|
4597
4597
|
depth: s
|
|
4598
4598
|
};
|
|
4599
4599
|
}
|
|
4600
|
-
function
|
|
4600
|
+
function Ve(e) {
|
|
4601
4601
|
return e.type === "link";
|
|
4602
4602
|
}
|
|
4603
|
-
function
|
|
4603
|
+
function ot(e) {
|
|
4604
4604
|
return typeof e != "string" && e.type === "link";
|
|
4605
4605
|
}
|
|
4606
4606
|
function te(e) {
|
|
@@ -4611,12 +4611,12 @@ class P extends Error {
|
|
|
4611
4611
|
super(`Unreachable case: ${t}`);
|
|
4612
4612
|
}
|
|
4613
4613
|
}
|
|
4614
|
-
function
|
|
4614
|
+
function Br(e, t = !0) {
|
|
4615
4615
|
const { "data-test": i, ...o } = e;
|
|
4616
4616
|
if (Object.keys(o).length > 0 && t)
|
|
4617
4617
|
throw new Error("Object must be empty " + JSON.stringify(e));
|
|
4618
4618
|
}
|
|
4619
|
-
function
|
|
4619
|
+
function Oe(e, t, i) {
|
|
4620
4620
|
const o = [];
|
|
4621
4621
|
for (const [n, r] of Object.entries(e.styles)) {
|
|
4622
4622
|
const a = i[n];
|
|
@@ -4632,11 +4632,11 @@ function Re(e, t, i) {
|
|
|
4632
4632
|
return e.text.split(/(\n)/g).filter((n) => n.length > 0).map((n) => n === `
|
|
4633
4633
|
` ? t.nodes.hardBreak.create() : t.text(n, o));
|
|
4634
4634
|
}
|
|
4635
|
-
function
|
|
4635
|
+
function Bi(e, t, i) {
|
|
4636
4636
|
const o = t.marks.link.create({
|
|
4637
4637
|
href: e.href
|
|
4638
4638
|
});
|
|
4639
|
-
return
|
|
4639
|
+
return Ee(e.content, t, i).map(
|
|
4640
4640
|
(n) => {
|
|
4641
4641
|
if (n.type.name === "text")
|
|
4642
4642
|
return n.mark([...n.marks, o]);
|
|
@@ -4646,29 +4646,29 @@ function Ti(e, t, i) {
|
|
|
4646
4646
|
}
|
|
4647
4647
|
);
|
|
4648
4648
|
}
|
|
4649
|
-
function
|
|
4649
|
+
function Ee(e, t, i) {
|
|
4650
4650
|
const o = [];
|
|
4651
4651
|
if (typeof e == "string")
|
|
4652
4652
|
return o.push(
|
|
4653
|
-
...
|
|
4653
|
+
...Oe(
|
|
4654
4654
|
{ type: "text", text: e, styles: {} },
|
|
4655
4655
|
t,
|
|
4656
4656
|
i
|
|
4657
4657
|
)
|
|
4658
4658
|
), o;
|
|
4659
4659
|
for (const n of e)
|
|
4660
|
-
o.push(...
|
|
4660
|
+
o.push(...Oe(n, t, i));
|
|
4661
4661
|
return o;
|
|
4662
4662
|
}
|
|
4663
4663
|
function R(e, t, i) {
|
|
4664
4664
|
const o = [];
|
|
4665
4665
|
for (const n of e)
|
|
4666
|
-
typeof n == "string" ? o.push(...
|
|
4667
|
-
|
|
4666
|
+
typeof n == "string" ? o.push(...Ee(n, t, i)) : ot(n) ? o.push(...Bi(n, t, i)) : te(n) ? o.push(...Ee([n], t, i)) : o.push(
|
|
4667
|
+
rt(n, t, i)
|
|
4668
4668
|
);
|
|
4669
4669
|
return o;
|
|
4670
4670
|
}
|
|
4671
|
-
function
|
|
4671
|
+
function nt(e, t, i) {
|
|
4672
4672
|
const o = [];
|
|
4673
4673
|
for (const n of e.rows) {
|
|
4674
4674
|
const r = [];
|
|
@@ -4690,7 +4690,7 @@ function it(e, t, i) {
|
|
|
4690
4690
|
}
|
|
4691
4691
|
return o;
|
|
4692
4692
|
}
|
|
4693
|
-
function
|
|
4693
|
+
function rt(e, t, i) {
|
|
4694
4694
|
let o, n = e.type;
|
|
4695
4695
|
if (n === void 0 && (n = "paragraph"), !t.nodes[n])
|
|
4696
4696
|
throw new Error(`node type ${n} not found in schema`);
|
|
@@ -4703,7 +4703,7 @@ function ot(e, t, i) {
|
|
|
4703
4703
|
const r = R(e.content, t, i);
|
|
4704
4704
|
o = t.nodes[n].create(e.props, r);
|
|
4705
4705
|
} else if (e.content.type === "tableContent") {
|
|
4706
|
-
const r =
|
|
4706
|
+
const r = nt(e.content, t, i);
|
|
4707
4707
|
o = t.nodes[n].create(e.props, r);
|
|
4708
4708
|
} else
|
|
4709
4709
|
throw new P(e.content.type);
|
|
@@ -4712,7 +4712,7 @@ function ot(e, t, i) {
|
|
|
4712
4712
|
function U(e, t, i) {
|
|
4713
4713
|
let o = e.id;
|
|
4714
4714
|
o === void 0 && (o = oe.options.generateID());
|
|
4715
|
-
const n =
|
|
4715
|
+
const n = rt(
|
|
4716
4716
|
e,
|
|
4717
4717
|
t,
|
|
4718
4718
|
i
|
|
@@ -4729,7 +4729,7 @@ function U(e, t, i) {
|
|
|
4729
4729
|
r.length > 0 ? [n, a] : n
|
|
4730
4730
|
);
|
|
4731
4731
|
}
|
|
4732
|
-
function
|
|
4732
|
+
function Li(e, t, i) {
|
|
4733
4733
|
const o = {
|
|
4734
4734
|
type: "tableContent",
|
|
4735
4735
|
rows: []
|
|
@@ -4740,7 +4740,7 @@ function Bi(e, t, i) {
|
|
|
4740
4740
|
};
|
|
4741
4741
|
n.content.forEach((a) => {
|
|
4742
4742
|
r.cells.push(
|
|
4743
|
-
|
|
4743
|
+
Te(
|
|
4744
4744
|
a.firstChild,
|
|
4745
4745
|
t,
|
|
4746
4746
|
i
|
|
@@ -4749,7 +4749,7 @@ function Bi(e, t, i) {
|
|
|
4749
4749
|
}), o.rows.push(r);
|
|
4750
4750
|
}), o;
|
|
4751
4751
|
}
|
|
4752
|
-
function
|
|
4752
|
+
function Te(e, t, i) {
|
|
4753
4753
|
const o = [];
|
|
4754
4754
|
let n;
|
|
4755
4755
|
return e.content.forEach((r) => {
|
|
@@ -4758,7 +4758,7 @@ function Se(e, t, i) {
|
|
|
4758
4758
|
if (te(n))
|
|
4759
4759
|
n.text += `
|
|
4760
4760
|
`;
|
|
4761
|
-
else if (
|
|
4761
|
+
else if (Ve(n))
|
|
4762
4762
|
n.content[n.content.length - 1].text += `
|
|
4763
4763
|
`;
|
|
4764
4764
|
else
|
|
@@ -4774,7 +4774,7 @@ function Se(e, t, i) {
|
|
|
4774
4774
|
}
|
|
4775
4775
|
if (r.type.name !== "link" && r.type.name !== "text" && t[r.type.name]) {
|
|
4776
4776
|
n && (o.push(n), n = void 0), o.push(
|
|
4777
|
-
|
|
4777
|
+
Ce(r, t, i)
|
|
4778
4778
|
);
|
|
4779
4779
|
return;
|
|
4780
4780
|
}
|
|
@@ -4808,7 +4808,7 @@ function Se(e, t, i) {
|
|
|
4808
4808
|
type: "text",
|
|
4809
4809
|
text: r.textContent,
|
|
4810
4810
|
styles: a
|
|
4811
|
-
}) :
|
|
4811
|
+
}) : Ve(n) && (s ? n.href === s.attrs.href ? JSON.stringify(
|
|
4812
4812
|
n.content[n.content.length - 1].styles
|
|
4813
4813
|
) === JSON.stringify(a) ? n.content[n.content.length - 1].text += r.textContent : n.content.push({
|
|
4814
4814
|
type: "text",
|
|
@@ -4845,7 +4845,7 @@ function Se(e, t, i) {
|
|
|
4845
4845
|
};
|
|
4846
4846
|
}), n && o.push(n), o;
|
|
4847
4847
|
}
|
|
4848
|
-
function
|
|
4848
|
+
function Ce(e, t, i) {
|
|
4849
4849
|
if (e.type.name === "text" || e.type.name === "link")
|
|
4850
4850
|
throw new Error("unexpected");
|
|
4851
4851
|
const o = {}, n = t[e.type.name];
|
|
@@ -4856,7 +4856,7 @@ function xe(e, t, i) {
|
|
|
4856
4856
|
s in d && (o[s] = l);
|
|
4857
4857
|
}
|
|
4858
4858
|
let r;
|
|
4859
|
-
return n.content === "styled" ? r =
|
|
4859
|
+
return n.content === "styled" ? r = Te(
|
|
4860
4860
|
e,
|
|
4861
4861
|
t,
|
|
4862
4862
|
i
|
|
@@ -4874,7 +4874,7 @@ function C(e, t, i, o, n) {
|
|
|
4874
4874
|
const r = n == null ? void 0 : n.get(e);
|
|
4875
4875
|
if (r)
|
|
4876
4876
|
return r;
|
|
4877
|
-
const a =
|
|
4877
|
+
const a = it(e);
|
|
4878
4878
|
let s = a.id;
|
|
4879
4879
|
s === null && (s = oe.options.generateID());
|
|
4880
4880
|
const l = {};
|
|
@@ -4903,13 +4903,13 @@ function C(e, t, i, o, n) {
|
|
|
4903
4903
|
);
|
|
4904
4904
|
let p;
|
|
4905
4905
|
if (d.content === "inline")
|
|
4906
|
-
p =
|
|
4906
|
+
p = Te(
|
|
4907
4907
|
a.contentNode,
|
|
4908
4908
|
i,
|
|
4909
4909
|
o
|
|
4910
4910
|
);
|
|
4911
4911
|
else if (d.content === "table")
|
|
4912
|
-
p =
|
|
4912
|
+
p = Li(
|
|
4913
4913
|
a.contentNode,
|
|
4914
4914
|
i,
|
|
4915
4915
|
o
|
|
@@ -4927,14 +4927,14 @@ function C(e, t, i, o, n) {
|
|
|
4927
4927
|
};
|
|
4928
4928
|
return n == null || n.set(e, h), h;
|
|
4929
4929
|
}
|
|
4930
|
-
function
|
|
4930
|
+
function Ii(e) {
|
|
4931
4931
|
return e.document || window.document;
|
|
4932
4932
|
}
|
|
4933
|
-
const
|
|
4933
|
+
const at = (e, t, i, o, n) => {
|
|
4934
4934
|
if (!i.nodes[e.type.name])
|
|
4935
4935
|
throw new Error("Serializer is missing a node type: " + e.type.name);
|
|
4936
|
-
const { dom: r, contentDOM: a } =
|
|
4937
|
-
|
|
4936
|
+
const { dom: r, contentDOM: a } = Se.renderSpec(
|
|
4937
|
+
Ii(t),
|
|
4938
4938
|
i.nodes[e.type.name](e)
|
|
4939
4939
|
);
|
|
4940
4940
|
if (a) {
|
|
@@ -4973,11 +4973,11 @@ const nt = (e, t, i, o, n) => {
|
|
|
4973
4973
|
i.serializeFragment(e.content, t, a);
|
|
4974
4974
|
}
|
|
4975
4975
|
return r;
|
|
4976
|
-
},
|
|
4976
|
+
}, st = (e, t, i) => {
|
|
4977
4977
|
const o = t.serializeFragment(e, i), n = document.createElement("div");
|
|
4978
4978
|
return n.appendChild(o), n.innerHTML;
|
|
4979
4979
|
};
|
|
4980
|
-
function
|
|
4980
|
+
function Fe(e, t) {
|
|
4981
4981
|
var o;
|
|
4982
4982
|
const i = (((o = e.properties) == null ? void 0 : o.className) || []).filter(
|
|
4983
4983
|
(n) => !n.startsWith("bn-")
|
|
@@ -4988,7 +4988,7 @@ function Ve(e, t) {
|
|
|
4988
4988
|
className: i.length > 0 ? i : void 0
|
|
4989
4989
|
};
|
|
4990
4990
|
}
|
|
4991
|
-
function
|
|
4991
|
+
function Ai(e) {
|
|
4992
4992
|
const t = H;
|
|
4993
4993
|
if (!t)
|
|
4994
4994
|
throw new Error(
|
|
@@ -5029,10 +5029,10 @@ function Ii(e) {
|
|
|
5029
5029
|
}
|
|
5030
5030
|
const k = i.has(
|
|
5031
5031
|
p.properties.dataContentType
|
|
5032
|
-
),
|
|
5032
|
+
), v = k ? e.orderedListItemBlockTypes.has(
|
|
5033
5033
|
p.properties.dataContentType
|
|
5034
5034
|
) ? "ol" : "ul" : null;
|
|
5035
|
-
if (h && o(h), a && a.tagName !==
|
|
5035
|
+
if (h && o(h), a && a.tagName !== v) {
|
|
5036
5036
|
n.children.splice(
|
|
5037
5037
|
l - a.children.length,
|
|
5038
5038
|
a.children.length,
|
|
@@ -5043,7 +5043,7 @@ function Ii(e) {
|
|
|
5043
5043
|
}
|
|
5044
5044
|
if (k) {
|
|
5045
5045
|
a || (a = t.hastUtilFromDom.fromDom(
|
|
5046
|
-
document.createElement(
|
|
5046
|
+
document.createElement(v)
|
|
5047
5047
|
));
|
|
5048
5048
|
const b = t.hastUtilFromDom.fromDom(
|
|
5049
5049
|
document.createElement("li")
|
|
@@ -5052,12 +5052,12 @@ function Ii(e) {
|
|
|
5052
5052
|
} else if (h) {
|
|
5053
5053
|
n.children.splice(l + 1, 0, ...h.children);
|
|
5054
5054
|
const b = p.children[0];
|
|
5055
|
-
|
|
5055
|
+
Fe(b, g), n.children[l] = b;
|
|
5056
5056
|
const y = h.children.length;
|
|
5057
5057
|
l += y, r += y;
|
|
5058
5058
|
} else {
|
|
5059
5059
|
const b = p.children[0];
|
|
5060
|
-
|
|
5060
|
+
Fe(b, g), n.children[l] = b;
|
|
5061
5061
|
}
|
|
5062
5062
|
}
|
|
5063
5063
|
a && n.children.splice(
|
|
@@ -5068,20 +5068,20 @@ function Ii(e) {
|
|
|
5068
5068
|
};
|
|
5069
5069
|
return o;
|
|
5070
5070
|
}
|
|
5071
|
-
const
|
|
5071
|
+
const ue = (e, t) => {
|
|
5072
5072
|
const i = H;
|
|
5073
5073
|
if (!i)
|
|
5074
5074
|
throw new Error(
|
|
5075
5075
|
"External HTML exporter requires ESM dependencies to be initialized"
|
|
5076
5076
|
);
|
|
5077
|
-
const o =
|
|
5078
|
-
return o.serializeNodeInner = (n, r) =>
|
|
5077
|
+
const o = Se.fromSchema(e);
|
|
5078
|
+
return o.serializeNodeInner = (n, r) => at(n, r, o, t, !0), o.exportProseMirrorFragment = (n, r) => i.unified.unified().use(i.rehypeParse.default, { fragment: !0 }).use(Ai, {
|
|
5079
5079
|
orderedListItemBlockTypes: /* @__PURE__ */ new Set(["numberedListItem"]),
|
|
5080
5080
|
unorderedListItemBlockTypes: /* @__PURE__ */ new Set([
|
|
5081
5081
|
"bulletListItem",
|
|
5082
5082
|
"checkListItem"
|
|
5083
5083
|
])
|
|
5084
|
-
}).use(i.rehypeStringify.default).processSync(
|
|
5084
|
+
}).use(i.rehypeStringify.default).processSync(st(n, o, r)).value, o.exportBlocks = (n, r) => {
|
|
5085
5085
|
const a = n.map(
|
|
5086
5086
|
(l) => U(l, e, t.schema.styleSchema)
|
|
5087
5087
|
), s = e.nodes.blockGroup.create(null, a);
|
|
@@ -5090,9 +5090,9 @@ const de = (e, t) => {
|
|
|
5090
5090
|
r
|
|
5091
5091
|
);
|
|
5092
5092
|
}, o;
|
|
5093
|
-
},
|
|
5094
|
-
const i =
|
|
5095
|
-
return i.serializeNodeInner = (o, n) =>
|
|
5093
|
+
}, Be = (e, t) => {
|
|
5094
|
+
const i = Se.fromSchema(e);
|
|
5095
|
+
return i.serializeNodeInner = (o, n) => at(o, n, i, t, !1), i.serializeProseMirrorFragment = (o, n) => st(o, i, n), i.serializeBlocks = (o, n) => {
|
|
5096
5096
|
const r = o.map(
|
|
5097
5097
|
(s) => U(s, e, t.schema.styleSchema)
|
|
5098
5098
|
), a = e.nodes.blockGroup.create(null, r);
|
|
@@ -5107,14 +5107,14 @@ const de = (e, t) => {
|
|
|
5107
5107
|
e.state.selection.from
|
|
5108
5108
|
);
|
|
5109
5109
|
return t.spec.content;
|
|
5110
|
-
},
|
|
5110
|
+
}, Ni = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
|
|
5111
5111
|
function D(e, t = "Ctrl") {
|
|
5112
|
-
return
|
|
5112
|
+
return Ni() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
|
|
5113
5113
|
}
|
|
5114
5114
|
function V(...e) {
|
|
5115
5115
|
return e.filter((t) => t).join(" ");
|
|
5116
5116
|
}
|
|
5117
|
-
const
|
|
5117
|
+
const Lr = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
5118
5118
|
function O(e, t, i, o) {
|
|
5119
5119
|
const n = document.createElement("div");
|
|
5120
5120
|
n.className = V(
|
|
@@ -5137,7 +5137,7 @@ function O(e, t, i, o) {
|
|
|
5137
5137
|
contentDOM: r
|
|
5138
5138
|
};
|
|
5139
5139
|
}
|
|
5140
|
-
const
|
|
5140
|
+
const Ge = (e, t) => {
|
|
5141
5141
|
const i = U(e, t.pmSchema, t.schema.styleSchema).firstChild, o = t.pmSchema.nodes[i.type.name].spec.toDOM;
|
|
5142
5142
|
if (o === void 0)
|
|
5143
5143
|
throw new Error(
|
|
@@ -5149,7 +5149,7 @@ const Oe = (e, t) => {
|
|
|
5149
5149
|
"Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property."
|
|
5150
5150
|
);
|
|
5151
5151
|
return n;
|
|
5152
|
-
},
|
|
5152
|
+
}, w = {
|
|
5153
5153
|
backgroundColor: {
|
|
5154
5154
|
default: "default"
|
|
5155
5155
|
},
|
|
@@ -5160,18 +5160,18 @@ const Oe = (e, t) => {
|
|
|
5160
5160
|
default: "left",
|
|
5161
5161
|
values: ["left", "center", "right", "justify"]
|
|
5162
5162
|
}
|
|
5163
|
-
},
|
|
5163
|
+
}, lt = ["backgroundColor", "textColor"];
|
|
5164
5164
|
function se(e) {
|
|
5165
5165
|
return "data-" + e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
5166
5166
|
}
|
|
5167
|
-
function
|
|
5167
|
+
function Ir(e) {
|
|
5168
5168
|
const t = e.split("/");
|
|
5169
5169
|
return !t.length || // invalid?
|
|
5170
5170
|
t[t.length - 1] === "" ? e : t[t.length - 1];
|
|
5171
5171
|
}
|
|
5172
|
-
function
|
|
5172
|
+
function dt(e) {
|
|
5173
5173
|
const t = {};
|
|
5174
|
-
return Object.entries(e).filter(([i, o]) => !
|
|
5174
|
+
return Object.entries(e).filter(([i, o]) => !lt.includes(i)).forEach(([i, o]) => {
|
|
5175
5175
|
t[i] = {
|
|
5176
5176
|
default: o.default,
|
|
5177
5177
|
keepOnSplit: !0,
|
|
@@ -5196,7 +5196,7 @@ function st(e) {
|
|
|
5196
5196
|
};
|
|
5197
5197
|
}), t;
|
|
5198
5198
|
}
|
|
5199
|
-
function
|
|
5199
|
+
function Pi(e, t, i, o) {
|
|
5200
5200
|
if (typeof e == "boolean")
|
|
5201
5201
|
throw new Error(
|
|
5202
5202
|
"Cannot find node position as getPos is a boolean, not a function."
|
|
@@ -5209,7 +5209,7 @@ function Ni(e, t, i, o) {
|
|
|
5209
5209
|
throw new Error("Block type does not match");
|
|
5210
5210
|
return s;
|
|
5211
5211
|
}
|
|
5212
|
-
function
|
|
5212
|
+
function _e(e, t, i, o, n = !1, r) {
|
|
5213
5213
|
const a = document.createElement("div");
|
|
5214
5214
|
if (r !== void 0)
|
|
5215
5215
|
for (const [s, l] of Object.entries(r))
|
|
@@ -5219,7 +5219,7 @@ function ge(e, t, i, o, n = !1, r) {
|
|
|
5219
5219
|
(r == null ? void 0 : r.class) || ""
|
|
5220
5220
|
), a.setAttribute("data-content-type", t);
|
|
5221
5221
|
for (const [s, l] of Object.entries(i))
|
|
5222
|
-
!
|
|
5222
|
+
!lt.includes(s) && l !== o[s].default && a.setAttribute(se(s), l);
|
|
5223
5223
|
return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = V(
|
|
5224
5224
|
"bn-inline-content",
|
|
5225
5225
|
e.contentDOM.className
|
|
@@ -5231,14 +5231,14 @@ function ge(e, t, i, o, n = !1, r) {
|
|
|
5231
5231
|
function F(e) {
|
|
5232
5232
|
return q.create(e);
|
|
5233
5233
|
}
|
|
5234
|
-
function
|
|
5234
|
+
function ct(e, t) {
|
|
5235
5235
|
return {
|
|
5236
5236
|
config: e,
|
|
5237
5237
|
implementation: t
|
|
5238
5238
|
};
|
|
5239
5239
|
}
|
|
5240
5240
|
function X(e, t, i) {
|
|
5241
|
-
return
|
|
5241
|
+
return ct(
|
|
5242
5242
|
{
|
|
5243
5243
|
type: e.name,
|
|
5244
5244
|
content: e.config.content === "inline*" ? "inline" : e.config.content === "tableRow+" ? "table" : "none",
|
|
@@ -5247,18 +5247,23 @@ function X(e, t, i) {
|
|
|
5247
5247
|
{
|
|
5248
5248
|
node: e,
|
|
5249
5249
|
requiredExtensions: i,
|
|
5250
|
-
toInternalHTML:
|
|
5251
|
-
toExternalHTML:
|
|
5250
|
+
toInternalHTML: Ge,
|
|
5251
|
+
toExternalHTML: Ge
|
|
5252
5252
|
// parse: () => undefined, // parse rules are in node already
|
|
5253
5253
|
}
|
|
5254
5254
|
);
|
|
5255
5255
|
}
|
|
5256
|
-
function
|
|
5256
|
+
function ut(e) {
|
|
5257
5257
|
return Object.fromEntries(
|
|
5258
5258
|
Object.entries(e).map(([t, i]) => [t, i.config])
|
|
5259
5259
|
);
|
|
5260
5260
|
}
|
|
5261
|
-
function
|
|
5261
|
+
function Hi(e, t) {
|
|
5262
|
+
e.stopEvent = (i) => (i.type === "mousedown" && setTimeout(() => {
|
|
5263
|
+
t.view.dom.blur();
|
|
5264
|
+
}, 10), !0);
|
|
5265
|
+
}
|
|
5266
|
+
function Ui(e, t) {
|
|
5262
5267
|
const i = [
|
|
5263
5268
|
{
|
|
5264
5269
|
tag: "[data-content-type=" + e.type + "]",
|
|
@@ -5275,17 +5280,17 @@ function Pi(e, t) {
|
|
|
5275
5280
|
}
|
|
5276
5281
|
}), i;
|
|
5277
5282
|
}
|
|
5278
|
-
function
|
|
5283
|
+
function pe(e, t) {
|
|
5279
5284
|
const i = F({
|
|
5280
5285
|
name: e.type,
|
|
5281
5286
|
content: e.content === "inline" ? "inline*" : "",
|
|
5282
5287
|
group: "blockContent",
|
|
5283
|
-
selectable: !0,
|
|
5288
|
+
selectable: e.isSelectable ?? !0,
|
|
5284
5289
|
addAttributes() {
|
|
5285
|
-
return
|
|
5290
|
+
return dt(e.propSchema);
|
|
5286
5291
|
},
|
|
5287
5292
|
parseHTML() {
|
|
5288
|
-
return
|
|
5293
|
+
return Ui(e, t.parse);
|
|
5289
5294
|
},
|
|
5290
5295
|
renderHTML() {
|
|
5291
5296
|
const o = document.createElement("div");
|
|
@@ -5295,20 +5300,20 @@ function ce(e, t) {
|
|
|
5295
5300
|
},
|
|
5296
5301
|
addNodeView() {
|
|
5297
5302
|
return ({ getPos: o }) => {
|
|
5298
|
-
var
|
|
5299
|
-
const n = this.options.editor, r =
|
|
5303
|
+
var d;
|
|
5304
|
+
const n = this.options.editor, r = Pi(
|
|
5300
5305
|
o,
|
|
5301
5306
|
n,
|
|
5302
5307
|
this.editor,
|
|
5303
5308
|
e.type
|
|
5304
|
-
), a = ((
|
|
5305
|
-
return ge(
|
|
5309
|
+
), a = ((d = this.options.domAttributes) == null ? void 0 : d.blockContent) || {}, s = t.render(r, n), l = _e(
|
|
5306
5310
|
s,
|
|
5307
5311
|
r.type,
|
|
5308
5312
|
r.props,
|
|
5309
5313
|
e.propSchema,
|
|
5310
5314
|
a
|
|
5311
5315
|
);
|
|
5316
|
+
return e.isSelectable === !1 && Hi(l, this.editor), l;
|
|
5312
5317
|
};
|
|
5313
5318
|
}
|
|
5314
5319
|
});
|
|
@@ -5316,12 +5321,12 @@ function ce(e, t) {
|
|
|
5316
5321
|
throw new Error(
|
|
5317
5322
|
"Node name does not match block type. This is a bug in BlockNote."
|
|
5318
5323
|
);
|
|
5319
|
-
return
|
|
5324
|
+
return ct(e, {
|
|
5320
5325
|
node: i,
|
|
5321
5326
|
toInternalHTML: (o, n) => {
|
|
5322
5327
|
var s;
|
|
5323
5328
|
const r = ((s = i.options.domAttributes) == null ? void 0 : s.blockContent) || {}, a = t.render(o, n);
|
|
5324
|
-
return
|
|
5329
|
+
return _e(
|
|
5325
5330
|
a,
|
|
5326
5331
|
o.type,
|
|
5327
5332
|
o.props,
|
|
@@ -5338,7 +5343,7 @@ function ce(e, t) {
|
|
|
5338
5343
|
o,
|
|
5339
5344
|
n
|
|
5340
5345
|
);
|
|
5341
|
-
return a === void 0 && (a = t.render(o, n)),
|
|
5346
|
+
return a === void 0 && (a = t.render(o, n)), _e(
|
|
5342
5347
|
a,
|
|
5343
5348
|
o.type,
|
|
5344
5349
|
o.props,
|
|
@@ -5348,10 +5353,10 @@ function ce(e, t) {
|
|
|
5348
5353
|
}
|
|
5349
5354
|
});
|
|
5350
5355
|
}
|
|
5351
|
-
function
|
|
5356
|
+
function We(e, t, i, o) {
|
|
5352
5357
|
return e.dom.setAttribute("data-inline-content-type", t), Object.entries(i).filter(([n, r]) => r !== o[n].default).map(([n, r]) => [se(n), r]).forEach(([n, r]) => e.dom.setAttribute(n, r)), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
|
|
5353
5358
|
}
|
|
5354
|
-
function
|
|
5359
|
+
function Di(e) {
|
|
5355
5360
|
return {
|
|
5356
5361
|
Backspace: ({ editor: t }) => {
|
|
5357
5362
|
const i = t.state.selection.$from;
|
|
@@ -5359,14 +5364,14 @@ function Hi(e) {
|
|
|
5359
5364
|
}
|
|
5360
5365
|
};
|
|
5361
5366
|
}
|
|
5362
|
-
function
|
|
5367
|
+
function ji(e, t) {
|
|
5363
5368
|
return {
|
|
5364
5369
|
config: e,
|
|
5365
5370
|
implementation: t
|
|
5366
5371
|
};
|
|
5367
5372
|
}
|
|
5368
|
-
function
|
|
5369
|
-
return
|
|
5373
|
+
function zi(e, t) {
|
|
5374
|
+
return ji(
|
|
5370
5375
|
{
|
|
5371
5376
|
type: e.name,
|
|
5372
5377
|
propSchema: t,
|
|
@@ -5377,12 +5382,12 @@ function Di(e, t) {
|
|
|
5377
5382
|
}
|
|
5378
5383
|
);
|
|
5379
5384
|
}
|
|
5380
|
-
function
|
|
5385
|
+
function pt(e) {
|
|
5381
5386
|
return Object.fromEntries(
|
|
5382
5387
|
Object.entries(e).map(([t, i]) => [t, i.config])
|
|
5383
5388
|
);
|
|
5384
5389
|
}
|
|
5385
|
-
function
|
|
5390
|
+
function Ri(e) {
|
|
5386
5391
|
return [
|
|
5387
5392
|
{
|
|
5388
5393
|
tag: `[data-inline-content-type="${e.type}"]`,
|
|
@@ -5393,7 +5398,7 @@ function ji(e) {
|
|
|
5393
5398
|
}
|
|
5394
5399
|
];
|
|
5395
5400
|
}
|
|
5396
|
-
function
|
|
5401
|
+
function Ar(e, t) {
|
|
5397
5402
|
const i = q.create({
|
|
5398
5403
|
name: e.type,
|
|
5399
5404
|
inline: !0,
|
|
@@ -5402,26 +5407,27 @@ function Lr(e, t) {
|
|
|
5402
5407
|
atom: e.content === "none",
|
|
5403
5408
|
content: e.content === "styled" ? "inline*" : "",
|
|
5404
5409
|
addAttributes() {
|
|
5405
|
-
return
|
|
5410
|
+
return dt(e.propSchema);
|
|
5406
5411
|
},
|
|
5407
5412
|
addKeyboardShortcuts() {
|
|
5408
|
-
return
|
|
5413
|
+
return Di(e);
|
|
5409
5414
|
},
|
|
5410
5415
|
parseHTML() {
|
|
5411
|
-
return
|
|
5416
|
+
return Ri(e);
|
|
5412
5417
|
},
|
|
5413
5418
|
renderHTML({ node: o }) {
|
|
5414
5419
|
const n = this.options.editor, r = t.render(
|
|
5415
|
-
|
|
5420
|
+
Ce(
|
|
5416
5421
|
o,
|
|
5417
5422
|
n.schema.inlineContentSchema,
|
|
5418
5423
|
n.schema.styleSchema
|
|
5419
5424
|
),
|
|
5420
5425
|
// TODO: fix cast
|
|
5421
5426
|
() => {
|
|
5422
|
-
}
|
|
5427
|
+
},
|
|
5428
|
+
n
|
|
5423
5429
|
);
|
|
5424
|
-
return
|
|
5430
|
+
return We(
|
|
5425
5431
|
r,
|
|
5426
5432
|
e.type,
|
|
5427
5433
|
o.attrs,
|
|
@@ -5431,7 +5437,7 @@ function Lr(e, t) {
|
|
|
5431
5437
|
addNodeView() {
|
|
5432
5438
|
return ({ node: o, getPos: n }) => {
|
|
5433
5439
|
const r = this.options.editor, a = t.render(
|
|
5434
|
-
|
|
5440
|
+
Ce(
|
|
5435
5441
|
o,
|
|
5436
5442
|
r.schema.inlineContentSchema,
|
|
5437
5443
|
r.schema.styleSchema
|
|
@@ -5452,9 +5458,10 @@ function Lr(e, t) {
|
|
|
5452
5458
|
l
|
|
5453
5459
|
)
|
|
5454
5460
|
);
|
|
5455
|
-
}
|
|
5461
|
+
},
|
|
5462
|
+
r
|
|
5456
5463
|
);
|
|
5457
|
-
return
|
|
5464
|
+
return We(
|
|
5458
5465
|
a,
|
|
5459
5466
|
e.type,
|
|
5460
5467
|
o.attrs,
|
|
@@ -5463,12 +5470,12 @@ function Lr(e, t) {
|
|
|
5463
5470
|
};
|
|
5464
5471
|
}
|
|
5465
5472
|
});
|
|
5466
|
-
return
|
|
5473
|
+
return zi(
|
|
5467
5474
|
i,
|
|
5468
5475
|
e.propSchema
|
|
5469
5476
|
);
|
|
5470
5477
|
}
|
|
5471
|
-
function
|
|
5478
|
+
function Vi(e) {
|
|
5472
5479
|
return e === "boolean" ? {} : {
|
|
5473
5480
|
stringValue: {
|
|
5474
5481
|
default: void 0,
|
|
@@ -5480,17 +5487,17 @@ function zi(e) {
|
|
|
5480
5487
|
}
|
|
5481
5488
|
};
|
|
5482
5489
|
}
|
|
5483
|
-
function
|
|
5490
|
+
function Oi(e, t, i, o) {
|
|
5484
5491
|
return e.dom.setAttribute("data-style-type", t), o === "string" && e.dom.setAttribute("data-value", i), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
|
|
5485
5492
|
}
|
|
5486
|
-
function
|
|
5493
|
+
function ht(e, t) {
|
|
5487
5494
|
return {
|
|
5488
5495
|
config: e,
|
|
5489
5496
|
implementation: t
|
|
5490
5497
|
};
|
|
5491
5498
|
}
|
|
5492
5499
|
function j(e, t) {
|
|
5493
|
-
return
|
|
5500
|
+
return ht(
|
|
5494
5501
|
{
|
|
5495
5502
|
type: e.name,
|
|
5496
5503
|
propSchema: t
|
|
@@ -5500,12 +5507,12 @@ function j(e, t) {
|
|
|
5500
5507
|
}
|
|
5501
5508
|
);
|
|
5502
5509
|
}
|
|
5503
|
-
function
|
|
5510
|
+
function mt(e) {
|
|
5504
5511
|
return Object.fromEntries(
|
|
5505
5512
|
Object.entries(e).map(([t, i]) => [t, i.config])
|
|
5506
5513
|
);
|
|
5507
5514
|
}
|
|
5508
|
-
function
|
|
5515
|
+
function Fi(e) {
|
|
5509
5516
|
return [
|
|
5510
5517
|
{
|
|
5511
5518
|
tag: `[data-style-type="${e.type}"]`,
|
|
@@ -5516,14 +5523,14 @@ function Vi(e) {
|
|
|
5516
5523
|
}
|
|
5517
5524
|
];
|
|
5518
5525
|
}
|
|
5519
|
-
function
|
|
5520
|
-
const i =
|
|
5526
|
+
function Nr(e, t) {
|
|
5527
|
+
const i = Me.create({
|
|
5521
5528
|
name: e.type,
|
|
5522
5529
|
addAttributes() {
|
|
5523
|
-
return
|
|
5530
|
+
return Vi(e.propSchema);
|
|
5524
5531
|
},
|
|
5525
5532
|
parseHTML() {
|
|
5526
|
-
return
|
|
5533
|
+
return Fi(e);
|
|
5527
5534
|
},
|
|
5528
5535
|
renderHTML({ mark: o }) {
|
|
5529
5536
|
let n;
|
|
@@ -5533,7 +5540,7 @@ function Ir(e, t) {
|
|
|
5533
5540
|
n = t.render(o.attrs.stringValue);
|
|
5534
5541
|
else
|
|
5535
5542
|
throw new P(e.propSchema);
|
|
5536
|
-
return
|
|
5543
|
+
return Oi(
|
|
5537
5544
|
n,
|
|
5538
5545
|
e.type,
|
|
5539
5546
|
o.attrs.stringValue,
|
|
@@ -5541,14 +5548,14 @@ function Ir(e, t) {
|
|
|
5541
5548
|
);
|
|
5542
5549
|
}
|
|
5543
5550
|
});
|
|
5544
|
-
return
|
|
5551
|
+
return ht(e, {
|
|
5545
5552
|
mark: i
|
|
5546
5553
|
});
|
|
5547
5554
|
}
|
|
5548
|
-
const
|
|
5555
|
+
const he = (e, t, i, o, n) => {
|
|
5549
5556
|
const r = document.createElement("div");
|
|
5550
5557
|
if (r.className = "bn-file-block-content-wrapper", e.props.url === "") {
|
|
5551
|
-
const a =
|
|
5558
|
+
const a = Gi(
|
|
5552
5559
|
e,
|
|
5553
5560
|
t,
|
|
5554
5561
|
o,
|
|
@@ -5570,7 +5577,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
5570
5577
|
}
|
|
5571
5578
|
};
|
|
5572
5579
|
} else if (e.props.showPreview === !1) {
|
|
5573
|
-
const a =
|
|
5580
|
+
const a = ft(e).dom;
|
|
5574
5581
|
return {
|
|
5575
5582
|
dom: ne(e, a).dom
|
|
5576
5583
|
};
|
|
@@ -5579,7 +5586,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
5579
5586
|
dom: r,
|
|
5580
5587
|
destroy: i.destroy
|
|
5581
5588
|
};
|
|
5582
|
-
},
|
|
5589
|
+
}, ft = (e) => {
|
|
5583
5590
|
const t = document.createElement("div");
|
|
5584
5591
|
t.className = "bn-file-default-preview";
|
|
5585
5592
|
const i = document.createElement("div");
|
|
@@ -5595,7 +5602,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
5595
5602
|
return o.className = "bn-file-caption", o.textContent = e.props.caption, i.appendChild(t), i.appendChild(o), {
|
|
5596
5603
|
dom: i
|
|
5597
5604
|
};
|
|
5598
|
-
},
|
|
5605
|
+
}, Gi = (e, t, i, o) => {
|
|
5599
5606
|
const n = document.createElement("div");
|
|
5600
5607
|
n.className = "bn-add-file-button";
|
|
5601
5608
|
const r = document.createElement("div");
|
|
@@ -5629,7 +5636,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
5629
5636
|
);
|
|
5630
5637
|
}
|
|
5631
5638
|
};
|
|
5632
|
-
},
|
|
5639
|
+
}, Ke = (e) => ({ url: e.src || void 0 }), me = (e, t) => {
|
|
5633
5640
|
const i = e.querySelector(
|
|
5634
5641
|
t
|
|
5635
5642
|
);
|
|
@@ -5637,15 +5644,15 @@ const ue = (e, t, i, o, n) => {
|
|
|
5637
5644
|
return;
|
|
5638
5645
|
const o = e.querySelector("figcaption"), n = (o == null ? void 0 : o.textContent) ?? void 0;
|
|
5639
5646
|
return { targetElement: i, caption: n };
|
|
5640
|
-
},
|
|
5647
|
+
}, fe = (e, t) => {
|
|
5641
5648
|
const i = document.createElement("div"), o = document.createElement("p");
|
|
5642
5649
|
return o.textContent = t, i.appendChild(e), i.appendChild(o), {
|
|
5643
5650
|
dom: i
|
|
5644
5651
|
};
|
|
5645
|
-
},
|
|
5652
|
+
}, Le = (e, t) => {
|
|
5646
5653
|
const i = document.createElement("figure"), o = document.createElement("figcaption");
|
|
5647
5654
|
return o.textContent = t, i.appendChild(e), i.appendChild(o), { dom: i };
|
|
5648
|
-
},
|
|
5655
|
+
}, gt = (e, t, i, o, n) => {
|
|
5649
5656
|
if (!e.props.previewWidth)
|
|
5650
5657
|
throw new Error("Block must have a `previewWidth` prop.");
|
|
5651
5658
|
const r = document.createElement("div");
|
|
@@ -5662,8 +5669,8 @@ const ue = (e, t, i, o, n) => {
|
|
|
5662
5669
|
}
|
|
5663
5670
|
let k;
|
|
5664
5671
|
e.props.textAlignment === "center" ? l.handleUsed === "left" ? k = l.initialWidth + (l.initialClientX - g.clientX) * 2 : k = l.initialWidth + (g.clientX - l.initialClientX) * 2 : l.handleUsed === "left" ? k = l.initialWidth + l.initialClientX - g.clientX : k = l.initialWidth + g.clientX - l.initialClientX;
|
|
5665
|
-
const
|
|
5666
|
-
k <
|
|
5672
|
+
const v = 64;
|
|
5673
|
+
k < v ? n(v) : k > t.domElement.firstElementChild.clientWidth ? n(t.domElement.firstElementChild.clientWidth) : n(k);
|
|
5667
5674
|
}, u = (g) => {
|
|
5668
5675
|
(!g.target || !r.contains(g.target) || !t.isEditable) && r.contains(a) && r.contains(s) && (r.removeChild(a), r.removeChild(s)), l && (l = void 0, t.updateBlock(e, {
|
|
5669
5676
|
props: {
|
|
@@ -5705,8 +5712,8 @@ const ue = (e, t, i, o, n) => {
|
|
|
5705
5712
|
);
|
|
5706
5713
|
}
|
|
5707
5714
|
};
|
|
5708
|
-
},
|
|
5709
|
-
backgroundColor:
|
|
5715
|
+
}, $e = (e) => ({ url: e.src || void 0 }), Wi = {
|
|
5716
|
+
backgroundColor: w.backgroundColor,
|
|
5710
5717
|
// File name.
|
|
5711
5718
|
name: {
|
|
5712
5719
|
default: ""
|
|
@@ -5722,13 +5729,13 @@ const ue = (e, t, i, o, n) => {
|
|
|
5722
5729
|
showPreview: {
|
|
5723
5730
|
default: !0
|
|
5724
5731
|
}
|
|
5725
|
-
},
|
|
5732
|
+
}, Ki = {
|
|
5726
5733
|
type: "audio",
|
|
5727
|
-
propSchema:
|
|
5734
|
+
propSchema: Wi,
|
|
5728
5735
|
content: "none",
|
|
5729
5736
|
isFileBlock: !0,
|
|
5730
5737
|
fileBlockAccept: ["audio/*"]
|
|
5731
|
-
},
|
|
5738
|
+
}, $i = (e, t) => {
|
|
5732
5739
|
const i = document.createElement("div");
|
|
5733
5740
|
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>';
|
|
5734
5741
|
const o = document.createElement("audio");
|
|
@@ -5736,27 +5743,27 @@ const ue = (e, t, i, o, n) => {
|
|
|
5736
5743
|
o.src = r;
|
|
5737
5744
|
}), o.controls = !0, o.contentEditable = "false", o.draggable = !1;
|
|
5738
5745
|
const n = ne(e, o);
|
|
5739
|
-
return
|
|
5746
|
+
return he(
|
|
5740
5747
|
e,
|
|
5741
5748
|
t,
|
|
5742
5749
|
n,
|
|
5743
5750
|
t.dictionary.file_blocks.audio.add_button_text,
|
|
5744
5751
|
i.firstElementChild
|
|
5745
5752
|
);
|
|
5746
|
-
},
|
|
5753
|
+
}, qi = (e) => {
|
|
5747
5754
|
if (e.tagName === "AUDIO")
|
|
5748
|
-
return
|
|
5755
|
+
return $e(e);
|
|
5749
5756
|
if (e.tagName === "FIGURE") {
|
|
5750
|
-
const t =
|
|
5757
|
+
const t = me(e, "audio");
|
|
5751
5758
|
if (!t)
|
|
5752
5759
|
return;
|
|
5753
5760
|
const { targetElement: i, caption: o } = t;
|
|
5754
5761
|
return {
|
|
5755
|
-
|
|
5762
|
+
...$e(i),
|
|
5756
5763
|
caption: o
|
|
5757
5764
|
};
|
|
5758
5765
|
}
|
|
5759
|
-
},
|
|
5766
|
+
}, Xi = (e) => {
|
|
5760
5767
|
if (!e.props.url) {
|
|
5761
5768
|
const i = document.createElement("p");
|
|
5762
5769
|
return i.textContent = "Add audio", {
|
|
@@ -5764,15 +5771,15 @@ const ue = (e, t, i, o, n) => {
|
|
|
5764
5771
|
};
|
|
5765
5772
|
}
|
|
5766
5773
|
let t;
|
|
5767
|
-
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 ?
|
|
5774
|
+
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 ? Le(t, e.props.caption) : fe(t, e.props.caption) : {
|
|
5768
5775
|
dom: t
|
|
5769
5776
|
};
|
|
5770
|
-
},
|
|
5771
|
-
render:
|
|
5772
|
-
parse:
|
|
5773
|
-
toExternalHTML:
|
|
5774
|
-
}),
|
|
5775
|
-
backgroundColor:
|
|
5777
|
+
}, Zi = pe(Ki, {
|
|
5778
|
+
render: $i,
|
|
5779
|
+
parse: qi,
|
|
5780
|
+
toExternalHTML: Xi
|
|
5781
|
+
}), Ji = {
|
|
5782
|
+
backgroundColor: w.backgroundColor,
|
|
5776
5783
|
// File name.
|
|
5777
5784
|
name: {
|
|
5778
5785
|
default: ""
|
|
@@ -5785,28 +5792,28 @@ const ue = (e, t, i, o, n) => {
|
|
|
5785
5792
|
caption: {
|
|
5786
5793
|
default: ""
|
|
5787
5794
|
}
|
|
5788
|
-
},
|
|
5795
|
+
}, Yi = {
|
|
5789
5796
|
type: "file",
|
|
5790
|
-
propSchema:
|
|
5797
|
+
propSchema: Ji,
|
|
5791
5798
|
content: "none",
|
|
5792
5799
|
isFileBlock: !0
|
|
5793
|
-
},
|
|
5794
|
-
const i =
|
|
5795
|
-
return
|
|
5796
|
-
},
|
|
5800
|
+
}, Qi = (e, t) => {
|
|
5801
|
+
const i = ft(e).dom, o = ne(e, i);
|
|
5802
|
+
return he(e, t, o);
|
|
5803
|
+
}, eo = (e) => {
|
|
5797
5804
|
if (e.tagName === "EMBED")
|
|
5798
|
-
return
|
|
5805
|
+
return Ke(e);
|
|
5799
5806
|
if (e.tagName === "FIGURE") {
|
|
5800
|
-
const t =
|
|
5807
|
+
const t = me(e, "embed");
|
|
5801
5808
|
if (!t)
|
|
5802
5809
|
return;
|
|
5803
5810
|
const { targetElement: i, caption: o } = t;
|
|
5804
5811
|
return {
|
|
5805
|
-
...
|
|
5812
|
+
...Ke(i),
|
|
5806
5813
|
caption: o
|
|
5807
5814
|
};
|
|
5808
5815
|
}
|
|
5809
|
-
},
|
|
5816
|
+
}, to = (e) => {
|
|
5810
5817
|
if (!e.props.url) {
|
|
5811
5818
|
const i = document.createElement("p");
|
|
5812
5819
|
return i.textContent = "Add file", {
|
|
@@ -5814,14 +5821,14 @@ const ue = (e, t, i, o, n) => {
|
|
|
5814
5821
|
};
|
|
5815
5822
|
}
|
|
5816
5823
|
const t = document.createElement("a");
|
|
5817
|
-
return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ?
|
|
5824
|
+
return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? fe(t, e.props.caption) : {
|
|
5818
5825
|
dom: t
|
|
5819
5826
|
};
|
|
5820
|
-
},
|
|
5821
|
-
render:
|
|
5822
|
-
parse:
|
|
5823
|
-
toExternalHTML:
|
|
5824
|
-
}),
|
|
5827
|
+
}, io = pe(Yi, {
|
|
5828
|
+
render: Qi,
|
|
5829
|
+
parse: eo,
|
|
5830
|
+
toExternalHTML: to
|
|
5831
|
+
}), Pr = async (e) => {
|
|
5825
5832
|
const t = new FormData();
|
|
5826
5833
|
return t.append("file", e), (await (await fetch("https://tmpfiles.org/api/v1/upload", {
|
|
5827
5834
|
method: "POST",
|
|
@@ -5830,12 +5837,12 @@ const ue = (e, t, i, o, n) => {
|
|
|
5830
5837
|
"tmpfiles.org/",
|
|
5831
5838
|
"tmpfiles.org/dl/"
|
|
5832
5839
|
);
|
|
5833
|
-
},
|
|
5840
|
+
}, qe = (e) => {
|
|
5834
5841
|
const t = e.src || void 0, i = e.width || void 0;
|
|
5835
5842
|
return { url: t, previewWidth: i };
|
|
5836
|
-
},
|
|
5837
|
-
textAlignment:
|
|
5838
|
-
backgroundColor:
|
|
5843
|
+
}, oo = {
|
|
5844
|
+
textAlignment: w.textAlignment,
|
|
5845
|
+
backgroundColor: w.backgroundColor,
|
|
5839
5846
|
// File name.
|
|
5840
5847
|
name: {
|
|
5841
5848
|
default: ""
|
|
@@ -5855,13 +5862,13 @@ const ue = (e, t, i, o, n) => {
|
|
|
5855
5862
|
previewWidth: {
|
|
5856
5863
|
default: 512
|
|
5857
5864
|
}
|
|
5858
|
-
},
|
|
5865
|
+
}, no = {
|
|
5859
5866
|
type: "image",
|
|
5860
|
-
propSchema:
|
|
5867
|
+
propSchema: oo,
|
|
5861
5868
|
content: "none",
|
|
5862
5869
|
isFileBlock: !0,
|
|
5863
5870
|
fileBlockAccept: ["image/*"]
|
|
5864
|
-
},
|
|
5871
|
+
}, ro = (e, t) => {
|
|
5865
5872
|
const i = document.createElement("div");
|
|
5866
5873
|
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>';
|
|
5867
5874
|
const o = document.createElement("img");
|
|
@@ -5871,34 +5878,34 @@ const ue = (e, t, i, o, n) => {
|
|
|
5871
5878
|
e.props.previewWidth,
|
|
5872
5879
|
t.domElement.firstElementChild.clientWidth
|
|
5873
5880
|
);
|
|
5874
|
-
const n =
|
|
5881
|
+
const n = gt(
|
|
5875
5882
|
e,
|
|
5876
5883
|
t,
|
|
5877
5884
|
o,
|
|
5878
5885
|
() => o.width,
|
|
5879
5886
|
(a) => o.width = a
|
|
5880
5887
|
), r = ne(e, n.dom);
|
|
5881
|
-
return
|
|
5888
|
+
return he(
|
|
5882
5889
|
e,
|
|
5883
5890
|
t,
|
|
5884
5891
|
r,
|
|
5885
5892
|
t.dictionary.file_blocks.image.add_button_text,
|
|
5886
5893
|
i.firstElementChild
|
|
5887
5894
|
);
|
|
5888
|
-
},
|
|
5895
|
+
}, ao = (e) => {
|
|
5889
5896
|
if (e.tagName === "IMG")
|
|
5890
|
-
return
|
|
5897
|
+
return qe(e);
|
|
5891
5898
|
if (e.tagName === "FIGURE") {
|
|
5892
|
-
const t =
|
|
5899
|
+
const t = me(e, "img");
|
|
5893
5900
|
if (!t)
|
|
5894
5901
|
return;
|
|
5895
5902
|
const { targetElement: i, caption: o } = t;
|
|
5896
5903
|
return {
|
|
5897
|
-
...
|
|
5904
|
+
...qe(i),
|
|
5898
5905
|
caption: o
|
|
5899
5906
|
};
|
|
5900
5907
|
}
|
|
5901
|
-
},
|
|
5908
|
+
}, so = (e) => {
|
|
5902
5909
|
if (!e.props.url) {
|
|
5903
5910
|
const i = document.createElement("p");
|
|
5904
5911
|
return i.textContent = "Add image", {
|
|
@@ -5906,19 +5913,19 @@ const ue = (e, t, i, o, n) => {
|
|
|
5906
5913
|
};
|
|
5907
5914
|
}
|
|
5908
5915
|
let t;
|
|
5909
|
-
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 ?
|
|
5916
|
+
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 ? Le(t, e.props.caption) : fe(t, e.props.caption) : {
|
|
5910
5917
|
dom: t
|
|
5911
5918
|
};
|
|
5912
|
-
},
|
|
5913
|
-
render:
|
|
5914
|
-
parse:
|
|
5915
|
-
toExternalHTML:
|
|
5916
|
-
}),
|
|
5919
|
+
}, lo = pe(no, {
|
|
5920
|
+
render: ro,
|
|
5921
|
+
parse: ao,
|
|
5922
|
+
toExternalHTML: so
|
|
5923
|
+
}), Xe = (e) => {
|
|
5917
5924
|
const t = e.src || void 0, i = e.width || void 0;
|
|
5918
5925
|
return { url: t, previewWidth: i };
|
|
5919
|
-
},
|
|
5920
|
-
textAlignment:
|
|
5921
|
-
backgroundColor:
|
|
5926
|
+
}, co = {
|
|
5927
|
+
textAlignment: w.textAlignment,
|
|
5928
|
+
backgroundColor: w.backgroundColor,
|
|
5922
5929
|
// File name.
|
|
5923
5930
|
name: {
|
|
5924
5931
|
default: ""
|
|
@@ -5938,13 +5945,13 @@ const ue = (e, t, i, o, n) => {
|
|
|
5938
5945
|
previewWidth: {
|
|
5939
5946
|
default: 512
|
|
5940
5947
|
}
|
|
5941
|
-
},
|
|
5948
|
+
}, uo = {
|
|
5942
5949
|
type: "video",
|
|
5943
|
-
propSchema:
|
|
5950
|
+
propSchema: co,
|
|
5944
5951
|
content: "none",
|
|
5945
5952
|
isFileBlock: !0,
|
|
5946
5953
|
fileBlockAccept: ["video/*"]
|
|
5947
|
-
},
|
|
5954
|
+
}, po = (e, t) => {
|
|
5948
5955
|
const i = document.createElement("div");
|
|
5949
5956
|
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>';
|
|
5950
5957
|
const o = document.createElement("video");
|
|
@@ -5952,34 +5959,34 @@ const ue = (e, t, i, o, n) => {
|
|
|
5952
5959
|
e.props.previewWidth,
|
|
5953
5960
|
t.domElement.firstElementChild.clientWidth
|
|
5954
5961
|
);
|
|
5955
|
-
const n =
|
|
5962
|
+
const n = gt(
|
|
5956
5963
|
e,
|
|
5957
5964
|
t,
|
|
5958
5965
|
o,
|
|
5959
5966
|
() => o.width,
|
|
5960
5967
|
(a) => o.width = a
|
|
5961
5968
|
), r = ne(e, n.dom);
|
|
5962
|
-
return
|
|
5969
|
+
return he(
|
|
5963
5970
|
e,
|
|
5964
5971
|
t,
|
|
5965
5972
|
r,
|
|
5966
5973
|
t.dictionary.file_blocks.video.add_button_text,
|
|
5967
5974
|
i.firstElementChild
|
|
5968
5975
|
);
|
|
5969
|
-
},
|
|
5976
|
+
}, ho = (e) => {
|
|
5970
5977
|
if (e.tagName === "VIDEO")
|
|
5971
|
-
return
|
|
5978
|
+
return Xe(e);
|
|
5972
5979
|
if (e.tagName === "FIGURE") {
|
|
5973
|
-
const t =
|
|
5980
|
+
const t = me(e, "video");
|
|
5974
5981
|
if (!t)
|
|
5975
5982
|
return;
|
|
5976
5983
|
const { targetElement: i, caption: o } = t;
|
|
5977
5984
|
return {
|
|
5978
|
-
|
|
5985
|
+
...Xe(i),
|
|
5979
5986
|
caption: o
|
|
5980
5987
|
};
|
|
5981
5988
|
}
|
|
5982
|
-
},
|
|
5989
|
+
}, mo = (e) => {
|
|
5983
5990
|
if (!e.props.url) {
|
|
5984
5991
|
const i = document.createElement("p");
|
|
5985
5992
|
return i.textContent = "Add video", {
|
|
@@ -5987,14 +5994,14 @@ const ue = (e, t, i, o, n) => {
|
|
|
5987
5994
|
};
|
|
5988
5995
|
}
|
|
5989
5996
|
let t;
|
|
5990
|
-
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 ?
|
|
5997
|
+
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 ? Le(t, e.props.caption) : fe(t, e.props.caption) : {
|
|
5991
5998
|
dom: t
|
|
5992
5999
|
};
|
|
5993
|
-
},
|
|
5994
|
-
render:
|
|
5995
|
-
parse:
|
|
5996
|
-
toExternalHTML:
|
|
5997
|
-
}),
|
|
6000
|
+
}, fo = pe(uo, {
|
|
6001
|
+
render: po,
|
|
6002
|
+
parse: ho,
|
|
6003
|
+
toExternalHTML: mo
|
|
6004
|
+
}), go = Me.create({
|
|
5998
6005
|
name: "backgroundColor",
|
|
5999
6006
|
addAttributes() {
|
|
6000
6007
|
return {
|
|
@@ -6020,10 +6027,10 @@ const ue = (e, t, i, o, n) => {
|
|
|
6020
6027
|
renderHTML({ HTMLAttributes: e }) {
|
|
6021
6028
|
return ["span", e, 0];
|
|
6022
6029
|
}
|
|
6023
|
-
}),
|
|
6024
|
-
|
|
6030
|
+
}), bo = j(
|
|
6031
|
+
go,
|
|
6025
6032
|
"string"
|
|
6026
|
-
),
|
|
6033
|
+
), _o = Me.create({
|
|
6027
6034
|
name: "textColor",
|
|
6028
6035
|
addAttributes() {
|
|
6029
6036
|
return {
|
|
@@ -6047,10 +6054,10 @@ const ue = (e, t, i, o, n) => {
|
|
|
6047
6054
|
renderHTML({ HTMLAttributes: e }) {
|
|
6048
6055
|
return ["span", e, 0];
|
|
6049
6056
|
}
|
|
6050
|
-
}),
|
|
6051
|
-
...
|
|
6057
|
+
}), ko = j(_o, "string"), yo = {
|
|
6058
|
+
...w,
|
|
6052
6059
|
level: { default: 1, values: [1, 2, 3] }
|
|
6053
|
-
},
|
|
6060
|
+
}, wo = F({
|
|
6054
6061
|
name: "heading",
|
|
6055
6062
|
content: "inline*",
|
|
6056
6063
|
group: "blockContent",
|
|
@@ -6153,10 +6160,10 @@ const ue = (e, t, i, o, n) => {
|
|
|
6153
6160
|
((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
|
|
6154
6161
|
);
|
|
6155
6162
|
}
|
|
6156
|
-
}),
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
),
|
|
6163
|
+
}), vo = X(
|
|
6164
|
+
wo,
|
|
6165
|
+
yo
|
|
6166
|
+
), Ie = (e) => {
|
|
6160
6167
|
const { contentNode: t, contentType: i } = _(
|
|
6161
6168
|
e.state.doc,
|
|
6162
6169
|
e.state.selection.from
|
|
@@ -6175,9 +6182,9 @@ const ue = (e, t, i, o, n) => {
|
|
|
6175
6182
|
a.command(() => t.childCount > 0 ? (r().deleteSelection().BNSplitBlock(n.selection.from, !0).run(), !0) : !1)
|
|
6176
6183
|
)
|
|
6177
6184
|
]);
|
|
6178
|
-
},
|
|
6179
|
-
...
|
|
6180
|
-
},
|
|
6185
|
+
}, xo = {
|
|
6186
|
+
...w
|
|
6187
|
+
}, Eo = F({
|
|
6181
6188
|
name: "bulletListItem",
|
|
6182
6189
|
content: "inline*",
|
|
6183
6190
|
group: "blockContent",
|
|
@@ -6200,7 +6207,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
6200
6207
|
},
|
|
6201
6208
|
addKeyboardShortcuts() {
|
|
6202
6209
|
return {
|
|
6203
|
-
Enter: () =>
|
|
6210
|
+
Enter: () => Ie(this.editor),
|
|
6204
6211
|
"Mod-Shift-8": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
|
|
6205
6212
|
this.editor.state.selection.anchor,
|
|
6206
6213
|
{
|
|
@@ -6256,11 +6263,11 @@ const ue = (e, t, i, o, n) => {
|
|
|
6256
6263
|
((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
|
|
6257
6264
|
);
|
|
6258
6265
|
}
|
|
6259
|
-
}),
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
),
|
|
6263
|
-
key:
|
|
6266
|
+
}), Co = X(
|
|
6267
|
+
Eo,
|
|
6268
|
+
xo
|
|
6269
|
+
), So = new L("numbered-list-indexing"), Mo = () => new x({
|
|
6270
|
+
key: So,
|
|
6264
6271
|
appendTransaction: (e, t, i) => {
|
|
6265
6272
|
const o = i.tr;
|
|
6266
6273
|
o.setMeta("numberedListIndexing", !0);
|
|
@@ -6278,8 +6285,8 @@ const ue = (e, t, i, o, n) => {
|
|
|
6278
6285
|
if (!(d.depth !== h.depth)) {
|
|
6279
6286
|
const f = h.contentNode;
|
|
6280
6287
|
if (h.contentType.name === "numberedListItem") {
|
|
6281
|
-
const
|
|
6282
|
-
s = (parseInt(
|
|
6288
|
+
const v = f.attrs.index;
|
|
6289
|
+
s = (parseInt(v) + 1).toString();
|
|
6283
6290
|
}
|
|
6284
6291
|
}
|
|
6285
6292
|
}
|
|
@@ -6289,9 +6296,9 @@ const ue = (e, t, i, o, n) => {
|
|
|
6289
6296
|
}
|
|
6290
6297
|
}), n ? o : null;
|
|
6291
6298
|
}
|
|
6292
|
-
}),
|
|
6293
|
-
...
|
|
6294
|
-
},
|
|
6299
|
+
}), To = {
|
|
6300
|
+
...w
|
|
6301
|
+
}, Bo = F({
|
|
6295
6302
|
name: "numberedListItem",
|
|
6296
6303
|
content: "inline*",
|
|
6297
6304
|
group: "blockContent",
|
|
@@ -6323,7 +6330,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
6323
6330
|
},
|
|
6324
6331
|
addKeyboardShortcuts() {
|
|
6325
6332
|
return {
|
|
6326
|
-
Enter: () =>
|
|
6333
|
+
Enter: () => Ie(this.editor),
|
|
6327
6334
|
"Mod-Shift-7": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
|
|
6328
6335
|
this.editor.state.selection.anchor,
|
|
6329
6336
|
{
|
|
@@ -6334,7 +6341,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
6334
6341
|
};
|
|
6335
6342
|
},
|
|
6336
6343
|
addProseMirrorPlugins() {
|
|
6337
|
-
return [
|
|
6344
|
+
return [Mo()];
|
|
6338
6345
|
},
|
|
6339
6346
|
parseHTML() {
|
|
6340
6347
|
return [
|
|
@@ -6384,15 +6391,15 @@ const ue = (e, t, i, o, n) => {
|
|
|
6384
6391
|
((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
|
|
6385
6392
|
);
|
|
6386
6393
|
}
|
|
6387
|
-
}),
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
),
|
|
6391
|
-
...
|
|
6394
|
+
}), Lo = X(
|
|
6395
|
+
Bo,
|
|
6396
|
+
To
|
|
6397
|
+
), Io = {
|
|
6398
|
+
...w,
|
|
6392
6399
|
checked: {
|
|
6393
6400
|
default: !1
|
|
6394
6401
|
}
|
|
6395
|
-
},
|
|
6402
|
+
}, Ao = F({
|
|
6396
6403
|
name: "checkListItem",
|
|
6397
6404
|
content: "inline*",
|
|
6398
6405
|
group: "blockContent",
|
|
@@ -6437,7 +6444,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
6437
6444
|
},
|
|
6438
6445
|
addKeyboardShortcuts() {
|
|
6439
6446
|
return {
|
|
6440
|
-
Enter: () =>
|
|
6447
|
+
Enter: () => Ie(this.editor),
|
|
6441
6448
|
"Mod-Shift-9": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
|
|
6442
6449
|
this.editor.state.selection.anchor,
|
|
6443
6450
|
{
|
|
@@ -6544,12 +6551,12 @@ const ue = (e, t, i, o, n) => {
|
|
|
6544
6551
|
};
|
|
6545
6552
|
};
|
|
6546
6553
|
}
|
|
6547
|
-
}),
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
),
|
|
6551
|
-
...
|
|
6552
|
-
},
|
|
6554
|
+
}), No = X(
|
|
6555
|
+
Ao,
|
|
6556
|
+
Io
|
|
6557
|
+
), Po = {
|
|
6558
|
+
...w
|
|
6559
|
+
}, Ho = F({
|
|
6553
6560
|
name: "paragraph",
|
|
6554
6561
|
content: "inline*",
|
|
6555
6562
|
group: "blockContent",
|
|
@@ -6590,16 +6597,16 @@ const ue = (e, t, i, o, n) => {
|
|
|
6590
6597
|
((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
|
|
6591
6598
|
);
|
|
6592
6599
|
}
|
|
6593
|
-
}),
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
),
|
|
6600
|
+
}), Uo = X(
|
|
6601
|
+
Ho,
|
|
6602
|
+
Po
|
|
6603
|
+
), Do = I.create({
|
|
6597
6604
|
name: "BlockNoteTableExtension",
|
|
6598
6605
|
addProseMirrorPlugins: () => [
|
|
6599
|
-
|
|
6606
|
+
oi({
|
|
6600
6607
|
cellMinWidth: 100
|
|
6601
6608
|
}),
|
|
6602
|
-
|
|
6609
|
+
ni()
|
|
6603
6610
|
],
|
|
6604
6611
|
addKeyboardShortcuts() {
|
|
6605
6612
|
return {
|
|
@@ -6620,14 +6627,14 @@ const ue = (e, t, i, o, n) => {
|
|
|
6620
6627
|
storage: e.storage
|
|
6621
6628
|
};
|
|
6622
6629
|
return {
|
|
6623
|
-
tableRole:
|
|
6624
|
-
|
|
6630
|
+
tableRole: Dt(
|
|
6631
|
+
jt(e, "tableRole", t)
|
|
6625
6632
|
)
|
|
6626
6633
|
};
|
|
6627
6634
|
}
|
|
6628
|
-
}),
|
|
6629
|
-
...
|
|
6630
|
-
},
|
|
6635
|
+
}), jo = {
|
|
6636
|
+
...w
|
|
6637
|
+
}, zo = F({
|
|
6631
6638
|
name: "table",
|
|
6632
6639
|
content: "tableRow+",
|
|
6633
6640
|
group: "blockContent",
|
|
@@ -6648,7 +6655,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
6648
6655
|
((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
|
|
6649
6656
|
);
|
|
6650
6657
|
}
|
|
6651
|
-
}),
|
|
6658
|
+
}), Ro = q.create({
|
|
6652
6659
|
name: "tableParagraph",
|
|
6653
6660
|
group: "tableContent",
|
|
6654
6661
|
content: "inline*",
|
|
@@ -6669,74 +6676,74 @@ const ue = (e, t, i, o, n) => {
|
|
|
6669
6676
|
renderHTML({ HTMLAttributes: e }) {
|
|
6670
6677
|
return [
|
|
6671
6678
|
"p",
|
|
6672
|
-
|
|
6679
|
+
zt(this.options.HTMLAttributes, e),
|
|
6673
6680
|
0
|
|
6674
6681
|
];
|
|
6675
6682
|
}
|
|
6676
|
-
}),
|
|
6677
|
-
|
|
6678
|
-
|
|
6683
|
+
}), Vo = X(
|
|
6684
|
+
zo,
|
|
6685
|
+
jo,
|
|
6679
6686
|
[
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6687
|
+
Do,
|
|
6688
|
+
Ro,
|
|
6689
|
+
ti.extend({
|
|
6683
6690
|
content: "tableContent"
|
|
6684
6691
|
}),
|
|
6685
|
-
|
|
6692
|
+
ei.extend({
|
|
6686
6693
|
content: "tableContent"
|
|
6687
6694
|
}),
|
|
6688
|
-
|
|
6695
|
+
ii
|
|
6689
6696
|
]
|
|
6690
|
-
),
|
|
6691
|
-
paragraph:
|
|
6692
|
-
heading:
|
|
6693
|
-
bulletListItem:
|
|
6694
|
-
numberedListItem:
|
|
6695
|
-
checkListItem:
|
|
6696
|
-
table:
|
|
6697
|
-
file:
|
|
6698
|
-
image:
|
|
6699
|
-
video:
|
|
6700
|
-
audio:
|
|
6701
|
-
},
|
|
6702
|
-
bold: j(
|
|
6703
|
-
italic: j(
|
|
6704
|
-
underline: j(
|
|
6705
|
-
strike: j(
|
|
6706
|
-
code: j(
|
|
6707
|
-
textColor:
|
|
6708
|
-
backgroundColor:
|
|
6709
|
-
},
|
|
6697
|
+
), bt = {
|
|
6698
|
+
paragraph: Uo,
|
|
6699
|
+
heading: vo,
|
|
6700
|
+
bulletListItem: Co,
|
|
6701
|
+
numberedListItem: Lo,
|
|
6702
|
+
checkListItem: No,
|
|
6703
|
+
table: Vo,
|
|
6704
|
+
file: io,
|
|
6705
|
+
image: lo,
|
|
6706
|
+
video: fo,
|
|
6707
|
+
audio: Zi
|
|
6708
|
+
}, Oo = ut(bt), _t = {
|
|
6709
|
+
bold: j(Xt, "boolean"),
|
|
6710
|
+
italic: j(Jt, "boolean"),
|
|
6711
|
+
underline: j(Qt, "boolean"),
|
|
6712
|
+
strike: j(Yt, "boolean"),
|
|
6713
|
+
code: j(Zt, "boolean"),
|
|
6714
|
+
textColor: ko,
|
|
6715
|
+
backgroundColor: bo
|
|
6716
|
+
}, Hr = mt(_t), kt = {
|
|
6710
6717
|
text: { config: "text", implementation: {} },
|
|
6711
6718
|
link: { config: "link", implementation: {} }
|
|
6712
|
-
},
|
|
6713
|
-
|
|
6719
|
+
}, Fo = pt(
|
|
6720
|
+
kt
|
|
6714
6721
|
);
|
|
6715
6722
|
function T(e, t) {
|
|
6716
|
-
return e in t.schema.blockSchema && t.schema.blockSchema[e] ===
|
|
6723
|
+
return e in t.schema.blockSchema && t.schema.blockSchema[e] === Oo[e];
|
|
6717
6724
|
}
|
|
6718
|
-
function
|
|
6719
|
-
return e in t.schema.inlineContentSchema && t.schema.inlineContentSchema[e] ===
|
|
6725
|
+
function Go(e, t) {
|
|
6726
|
+
return e in t.schema.inlineContentSchema && t.schema.inlineContentSchema[e] === Fo[e];
|
|
6720
6727
|
}
|
|
6721
|
-
function
|
|
6728
|
+
function Wo(e, t, i) {
|
|
6722
6729
|
return t.type === e && t.type in i.schema.blockSchema && T(t.type, i);
|
|
6723
6730
|
}
|
|
6724
|
-
function
|
|
6731
|
+
function Ur(e, t) {
|
|
6725
6732
|
return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock || !1;
|
|
6726
6733
|
}
|
|
6727
|
-
function
|
|
6734
|
+
function Dr(e, t) {
|
|
6728
6735
|
return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock && "showPreview" in t.schema.blockSchema[e.type].propSchema || !1;
|
|
6729
6736
|
}
|
|
6730
|
-
function
|
|
6737
|
+
function jr(e, t) {
|
|
6731
6738
|
return t.schema.blockSchema[e.type].isFileBlock && !e.props.url;
|
|
6732
6739
|
}
|
|
6733
|
-
function
|
|
6734
|
-
return t in i.schema.blockSchema && e in i.schema.blockSchema[t].propSchema && i.schema.blockSchema[t].propSchema[e] ===
|
|
6740
|
+
function Ko(e, t, i) {
|
|
6741
|
+
return t in i.schema.blockSchema && e in i.schema.blockSchema[t].propSchema && i.schema.blockSchema[t].propSchema[e] === w[e];
|
|
6735
6742
|
}
|
|
6736
|
-
function
|
|
6737
|
-
return
|
|
6743
|
+
function zr(e, t, i) {
|
|
6744
|
+
return Ko(e, t.type, i);
|
|
6738
6745
|
}
|
|
6739
|
-
function
|
|
6746
|
+
function Ae(e, t) {
|
|
6740
6747
|
let i, o;
|
|
6741
6748
|
if (t.firstChild.descendants((n, r) => i ? !1 : n.type.name !== "blockContainer" || n.attrs.id !== e ? !0 : (i = n, o = r + 1, !1)), i === void 0 || o === void 0)
|
|
6742
6749
|
throw Error("Could not find block in the editor with matching ID.");
|
|
@@ -6745,13 +6752,13 @@ function Le(e, t) {
|
|
|
6745
6752
|
posBeforeNode: o
|
|
6746
6753
|
};
|
|
6747
6754
|
}
|
|
6748
|
-
function
|
|
6755
|
+
function $o(e, t, i = "before", o) {
|
|
6749
6756
|
const n = typeof t == "string" ? t : t.id, r = [];
|
|
6750
6757
|
for (const d of e)
|
|
6751
6758
|
r.push(
|
|
6752
6759
|
U(d, o.pmSchema, o.schema.styleSchema)
|
|
6753
6760
|
);
|
|
6754
|
-
const { node: a, posBeforeNode: s } =
|
|
6761
|
+
const { node: a, posBeforeNode: s } = Ae(
|
|
6755
6762
|
n,
|
|
6756
6763
|
o._tiptapEditor.state.doc
|
|
6757
6764
|
);
|
|
@@ -6784,8 +6791,8 @@ function Wo(e, t, i = "before", o) {
|
|
|
6784
6791
|
);
|
|
6785
6792
|
return l;
|
|
6786
6793
|
}
|
|
6787
|
-
function
|
|
6788
|
-
const o = i._tiptapEditor, n = typeof e == "string" ? e : e.id, { posBeforeNode: r } =
|
|
6794
|
+
function qo(e, t, i) {
|
|
6795
|
+
const o = i._tiptapEditor, n = typeof e == "string" ? e : e.id, { posBeforeNode: r } = Ae(n, o.state.doc);
|
|
6789
6796
|
o.commands.BNUpdateBlock(r + 1, t);
|
|
6790
6797
|
const a = o.state.doc.resolve(r + 1).node();
|
|
6791
6798
|
return C(
|
|
@@ -6796,7 +6803,7 @@ function Ko(e, t, i) {
|
|
|
6796
6803
|
i.blockCache
|
|
6797
6804
|
);
|
|
6798
6805
|
}
|
|
6799
|
-
function
|
|
6806
|
+
function yt(e, t, i) {
|
|
6800
6807
|
const o = t._tiptapEditor, n = o.state.tr, r = new Set(
|
|
6801
6808
|
e.map(
|
|
6802
6809
|
(l) => typeof l == "string" ? l : l.id
|
|
@@ -6830,16 +6837,16 @@ function _t(e, t, i) {
|
|
|
6830
6837
|
}
|
|
6831
6838
|
return t.dispatch(n), a;
|
|
6832
6839
|
}
|
|
6833
|
-
function
|
|
6834
|
-
return
|
|
6840
|
+
function Xo(e, t) {
|
|
6841
|
+
return yt(e, t);
|
|
6835
6842
|
}
|
|
6836
|
-
function
|
|
6843
|
+
function Zo(e, t, i) {
|
|
6837
6844
|
const o = [];
|
|
6838
6845
|
for (const s of t)
|
|
6839
6846
|
o.push(
|
|
6840
6847
|
U(s, i.pmSchema, i.schema.styleSchema)
|
|
6841
6848
|
);
|
|
6842
|
-
const n = typeof e[0] == "string" ? e[0] : e[0].id, r =
|
|
6849
|
+
const n = typeof e[0] == "string" ? e[0] : e[0].id, r = yt(
|
|
6843
6850
|
e,
|
|
6844
6851
|
i,
|
|
6845
6852
|
(s, l, d, u) => {
|
|
@@ -6864,7 +6871,7 @@ function qo(e, t, i) {
|
|
|
6864
6871
|
);
|
|
6865
6872
|
return { insertedBlocks: a, removedBlocks: r };
|
|
6866
6873
|
}
|
|
6867
|
-
function
|
|
6874
|
+
function Jo(e, t, i, o = { updateSelection: !0 }) {
|
|
6868
6875
|
const n = i._tiptapEditor.state.tr;
|
|
6869
6876
|
let { from: r, to: a } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, s = !0, l = !0, d = "";
|
|
6870
6877
|
if (t.forEach((u) => {
|
|
@@ -6873,9 +6880,9 @@ function Xo(e, t, i, o = { updateSelection: !0 }) {
|
|
|
6873
6880
|
const { parent: u } = n.doc.resolve(r);
|
|
6874
6881
|
u.isTextblock && !u.type.spec.code && !u.childCount && (r -= 1, a += 1);
|
|
6875
6882
|
}
|
|
6876
|
-
return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), o.updateSelection &&
|
|
6883
|
+
return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), o.updateSelection && Rt(n, n.steps.length - 1, -1), i.dispatch(n), !0;
|
|
6877
6884
|
}
|
|
6878
|
-
function
|
|
6885
|
+
function Yo() {
|
|
6879
6886
|
const e = (t) => {
|
|
6880
6887
|
let i = t.children.length;
|
|
6881
6888
|
for (let o = 0; o < i; o++) {
|
|
@@ -6891,7 +6898,7 @@ function Zo() {
|
|
|
6891
6898
|
};
|
|
6892
6899
|
return e;
|
|
6893
6900
|
}
|
|
6894
|
-
function
|
|
6901
|
+
function Qo() {
|
|
6895
6902
|
const e = H;
|
|
6896
6903
|
if (!e)
|
|
6897
6904
|
throw new Error(
|
|
@@ -6913,43 +6920,43 @@ function Jo() {
|
|
|
6913
6920
|
};
|
|
6914
6921
|
return t;
|
|
6915
6922
|
}
|
|
6916
|
-
function
|
|
6923
|
+
function Ne(e) {
|
|
6917
6924
|
const t = H;
|
|
6918
6925
|
if (!t)
|
|
6919
6926
|
throw new Error(
|
|
6920
6927
|
"cleanHTMLToMarkdown requires ESM dependencies to be initialized"
|
|
6921
6928
|
);
|
|
6922
|
-
return t.unified.unified().use(t.rehypeParse.default, { fragment: !0 }).use(
|
|
6929
|
+
return t.unified.unified().use(t.rehypeParse.default, { fragment: !0 }).use(Yo).use(Qo).use(t.rehypeRemark.default).use(t.remarkGfm.default).use(t.remarkStringify.default, {
|
|
6923
6930
|
handlers: { text: (o) => o.value }
|
|
6924
6931
|
}).processSync(e).value;
|
|
6925
6932
|
}
|
|
6926
|
-
async function
|
|
6933
|
+
async function en(e, t, i, o) {
|
|
6927
6934
|
await ie();
|
|
6928
|
-
const r =
|
|
6929
|
-
return
|
|
6935
|
+
const r = ue(t, i).exportBlocks(e, o);
|
|
6936
|
+
return Ne(r);
|
|
6930
6937
|
}
|
|
6931
|
-
function
|
|
6938
|
+
function tn(e) {
|
|
6932
6939
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
6933
6940
|
}
|
|
6934
|
-
function
|
|
6941
|
+
function on(e) {
|
|
6935
6942
|
return e.nodeType === 3 && !/\S/.test(e.nodeValue || "");
|
|
6936
6943
|
}
|
|
6937
|
-
function
|
|
6944
|
+
function nn(e) {
|
|
6938
6945
|
e.querySelectorAll("li > ul, li > ol").forEach((t) => {
|
|
6939
|
-
const i =
|
|
6946
|
+
const i = tn(t), o = t.parentElement, n = Array.from(o.childNodes).slice(
|
|
6940
6947
|
i + 1
|
|
6941
6948
|
);
|
|
6942
6949
|
t.remove(), n.forEach((r) => {
|
|
6943
6950
|
r.remove();
|
|
6944
6951
|
}), o.insertAdjacentElement("afterend", t), n.reverse().forEach((r) => {
|
|
6945
|
-
if (
|
|
6952
|
+
if (on(r))
|
|
6946
6953
|
return;
|
|
6947
6954
|
const a = document.createElement("li");
|
|
6948
6955
|
a.append(r), t.insertAdjacentElement("afterend", a);
|
|
6949
6956
|
}), o.childNodes.length === 0 && o.remove();
|
|
6950
6957
|
});
|
|
6951
6958
|
}
|
|
6952
|
-
function
|
|
6959
|
+
function rn(e) {
|
|
6953
6960
|
e.querySelectorAll("li + ul, li + ol").forEach((t) => {
|
|
6954
6961
|
var r, a;
|
|
6955
6962
|
const i = t.previousElementSibling, o = document.createElement("div");
|
|
@@ -6959,19 +6966,19 @@ function on(e) {
|
|
|
6959
6966
|
n.append(o.nextElementSibling);
|
|
6960
6967
|
});
|
|
6961
6968
|
}
|
|
6962
|
-
let
|
|
6963
|
-
function
|
|
6964
|
-
return
|
|
6969
|
+
let Ze = null;
|
|
6970
|
+
function an() {
|
|
6971
|
+
return Ze || (Ze = document.implementation.createHTMLDocument("title"));
|
|
6965
6972
|
}
|
|
6966
|
-
function
|
|
6973
|
+
function wt(e) {
|
|
6967
6974
|
if (typeof e == "string") {
|
|
6968
|
-
const t =
|
|
6975
|
+
const t = an().createElement("div");
|
|
6969
6976
|
t.innerHTML = e, e = t;
|
|
6970
6977
|
}
|
|
6971
|
-
return
|
|
6978
|
+
return nn(e), rn(e), e;
|
|
6972
6979
|
}
|
|
6973
|
-
async function
|
|
6974
|
-
const r =
|
|
6980
|
+
async function vt(e, t, i, o, n) {
|
|
6981
|
+
const r = wt(e), s = At.fromSchema(n).parse(r, {
|
|
6975
6982
|
topNode: n.nodes.blockGroup.create()
|
|
6976
6983
|
}), l = [];
|
|
6977
6984
|
for (let d = 0; d < s.childCount; d++)
|
|
@@ -6980,7 +6987,7 @@ async function yt(e, t, i, o, n) {
|
|
|
6980
6987
|
);
|
|
6981
6988
|
return l;
|
|
6982
6989
|
}
|
|
6983
|
-
function
|
|
6990
|
+
function sn(e, t) {
|
|
6984
6991
|
const i = t.value ? t.value + `
|
|
6985
6992
|
` : "", o = {};
|
|
6986
6993
|
t.lang && (o["data-language"] = t.lang);
|
|
@@ -6997,14 +7004,14 @@ function rn(e, t) {
|
|
|
6997
7004
|
children: [n]
|
|
6998
7005
|
}, e.patch(t, n), n;
|
|
6999
7006
|
}
|
|
7000
|
-
async function
|
|
7007
|
+
async function ln(e, t, i, o, n) {
|
|
7001
7008
|
const r = await ie(), a = r.unified.unified().use(r.remarkParse.default).use(r.remarkGfm.default).use(r.remarkRehype.default, {
|
|
7002
7009
|
handlers: {
|
|
7003
7010
|
...r.remarkRehype.defaultHandlers,
|
|
7004
|
-
code:
|
|
7011
|
+
code: sn
|
|
7005
7012
|
}
|
|
7006
7013
|
}).use(r.rehypeStringify.default).processSync(e);
|
|
7007
|
-
return
|
|
7014
|
+
return vt(
|
|
7008
7015
|
a.value,
|
|
7009
7016
|
t,
|
|
7010
7017
|
i,
|
|
@@ -7032,7 +7039,7 @@ class Z {
|
|
|
7032
7039
|
this.callbacks = {};
|
|
7033
7040
|
}
|
|
7034
7041
|
}
|
|
7035
|
-
class
|
|
7042
|
+
class dn {
|
|
7036
7043
|
constructor(t, i, o, n) {
|
|
7037
7044
|
c(this, "state");
|
|
7038
7045
|
c(this, "emitUpdate");
|
|
@@ -7088,8 +7095,8 @@ class sn {
|
|
|
7088
7095
|
this.pmView.dom.removeEventListener("mousedown", this.mouseDownHandler), this.pmView.dom.removeEventListener("dragstart", this.dragstartHandler), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
|
|
7089
7096
|
}
|
|
7090
7097
|
}
|
|
7091
|
-
const
|
|
7092
|
-
class
|
|
7098
|
+
const ke = new L("FilePanelPlugin");
|
|
7099
|
+
class cn extends Z {
|
|
7093
7100
|
constructor(i) {
|
|
7094
7101
|
super();
|
|
7095
7102
|
c(this, "view");
|
|
@@ -7099,10 +7106,10 @@ class ln extends Z {
|
|
|
7099
7106
|
return (i = this.view) == null ? void 0 : i.closeMenu();
|
|
7100
7107
|
});
|
|
7101
7108
|
this.plugin = new x({
|
|
7102
|
-
key:
|
|
7103
|
-
view: (o) => (this.view = new
|
|
7109
|
+
key: ke,
|
|
7110
|
+
view: (o) => (this.view = new dn(
|
|
7104
7111
|
i,
|
|
7105
|
-
|
|
7112
|
+
ke,
|
|
7106
7113
|
o,
|
|
7107
7114
|
(n) => {
|
|
7108
7115
|
this.emit("update", n);
|
|
@@ -7121,7 +7128,7 @@ class ln extends Z {
|
|
|
7121
7128
|
apply: (o) => {
|
|
7122
7129
|
var r;
|
|
7123
7130
|
return {
|
|
7124
|
-
block: (r = o.getMeta(
|
|
7131
|
+
block: (r = o.getMeta(ke)) == null ? void 0 : r.block
|
|
7125
7132
|
};
|
|
7126
7133
|
}
|
|
7127
7134
|
}
|
|
@@ -7135,14 +7142,14 @@ class ln extends Z {
|
|
|
7135
7142
|
return this.on("update", i);
|
|
7136
7143
|
}
|
|
7137
7144
|
}
|
|
7138
|
-
class
|
|
7145
|
+
class un {
|
|
7139
7146
|
constructor(t, i, o) {
|
|
7140
7147
|
c(this, "state");
|
|
7141
7148
|
c(this, "emitUpdate");
|
|
7142
7149
|
c(this, "preventHide", !1);
|
|
7143
7150
|
c(this, "preventShow", !1);
|
|
7144
7151
|
c(this, "shouldShow", ({ state: t, from: i, to: o, view: n }) => {
|
|
7145
|
-
const { doc: r, selection: a } = t, { empty: s } = a, l = !r.textBetween(i, o).length &&
|
|
7152
|
+
const { doc: r, selection: a } = t, { empty: s } = a, l = !r.textBetween(i, o).length && Vt(t.selection);
|
|
7146
7153
|
return !(!n.hasFocus() || s || l);
|
|
7147
7154
|
});
|
|
7148
7155
|
c(this, "blurHandler", (t) => {
|
|
@@ -7213,26 +7220,26 @@ class dn {
|
|
|
7213
7220
|
}
|
|
7214
7221
|
getSelectionBoundingBox() {
|
|
7215
7222
|
const { state: t } = this.pmView, { selection: i } = t, { ranges: o } = i, n = Math.min(...o.map((a) => a.$from.pos)), r = Math.max(...o.map((a) => a.$to.pos));
|
|
7216
|
-
if (
|
|
7223
|
+
if (Ot(i)) {
|
|
7217
7224
|
const a = this.pmView.nodeDOM(n);
|
|
7218
7225
|
if (a)
|
|
7219
7226
|
return a.getBoundingClientRect();
|
|
7220
7227
|
}
|
|
7221
|
-
return
|
|
7228
|
+
return xe(this.pmView, n, r);
|
|
7222
7229
|
}
|
|
7223
7230
|
}
|
|
7224
|
-
const
|
|
7231
|
+
const pn = new L(
|
|
7225
7232
|
"FormattingToolbarPlugin"
|
|
7226
7233
|
);
|
|
7227
|
-
class
|
|
7234
|
+
class hn extends Z {
|
|
7228
7235
|
constructor(i) {
|
|
7229
7236
|
super();
|
|
7230
7237
|
c(this, "view");
|
|
7231
7238
|
c(this, "plugin");
|
|
7232
7239
|
c(this, "closeMenu", () => this.view.closeMenu());
|
|
7233
7240
|
this.plugin = new x({
|
|
7234
|
-
key:
|
|
7235
|
-
view: (o) => (this.view = new
|
|
7241
|
+
key: pn,
|
|
7242
|
+
view: (o) => (this.view = new un(i, o, (n) => {
|
|
7236
7243
|
this.emit("update", n);
|
|
7237
7244
|
}), this.view),
|
|
7238
7245
|
props: {
|
|
@@ -7248,7 +7255,7 @@ class un extends Z {
|
|
|
7248
7255
|
return this.on("update", i);
|
|
7249
7256
|
}
|
|
7250
7257
|
}
|
|
7251
|
-
class
|
|
7258
|
+
class mn {
|
|
7252
7259
|
constructor(t, i, o) {
|
|
7253
7260
|
c(this, "state");
|
|
7254
7261
|
c(this, "emitUpdate");
|
|
@@ -7266,7 +7273,7 @@ class pn {
|
|
|
7266
7273
|
const i = t.target, o = this.pmView.posAtDOM(i, 0) + 1, n = this.pmView.state.doc.resolve(o), r = n.marks();
|
|
7267
7274
|
for (const a of r)
|
|
7268
7275
|
if (a.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
7269
|
-
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange =
|
|
7276
|
+
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = ze(n, a.type, a.attrs) || void 0;
|
|
7270
7277
|
break;
|
|
7271
7278
|
}
|
|
7272
7279
|
}
|
|
@@ -7282,7 +7289,7 @@ class pn {
|
|
|
7282
7289
|
});
|
|
7283
7290
|
c(this, "scrollHandler", () => {
|
|
7284
7291
|
var t;
|
|
7285
|
-
this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos =
|
|
7292
|
+
this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos = xe(
|
|
7286
7293
|
this.pmView,
|
|
7287
7294
|
this.linkMarkRange.from,
|
|
7288
7295
|
this.linkMarkRange.to
|
|
@@ -7338,7 +7345,7 @@ class pn {
|
|
|
7338
7345
|
const o = this.pmView.state.selection.$from.marks();
|
|
7339
7346
|
for (const n of o)
|
|
7340
7347
|
if (n.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
7341
|
-
this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange =
|
|
7348
|
+
this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange = ze(
|
|
7342
7349
|
this.pmView.state.selection.$from,
|
|
7343
7350
|
n.type,
|
|
7344
7351
|
n.attrs
|
|
@@ -7349,7 +7356,7 @@ class pn {
|
|
|
7349
7356
|
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) {
|
|
7350
7357
|
this.state = {
|
|
7351
7358
|
show: !0,
|
|
7352
|
-
referencePos:
|
|
7359
|
+
referencePos: xe(
|
|
7353
7360
|
this.pmView,
|
|
7354
7361
|
this.linkMarkRange.from,
|
|
7355
7362
|
this.linkMarkRange.to
|
|
@@ -7375,8 +7382,8 @@ class pn {
|
|
|
7375
7382
|
);
|
|
7376
7383
|
}
|
|
7377
7384
|
}
|
|
7378
|
-
const
|
|
7379
|
-
class
|
|
7385
|
+
const fn = new L("LinkToolbarPlugin");
|
|
7386
|
+
class gn extends Z {
|
|
7380
7387
|
constructor(i) {
|
|
7381
7388
|
super();
|
|
7382
7389
|
c(this, "view");
|
|
@@ -7415,8 +7422,8 @@ class mn extends Z {
|
|
|
7415
7422
|
});
|
|
7416
7423
|
c(this, "closeMenu", () => this.view.closeMenu());
|
|
7417
7424
|
this.plugin = new x({
|
|
7418
|
-
key:
|
|
7419
|
-
view: (o) => (this.view = new
|
|
7425
|
+
key: fn,
|
|
7426
|
+
view: (o) => (this.view = new mn(i, o, (n) => {
|
|
7420
7427
|
this.emit("update", n);
|
|
7421
7428
|
}), this.view),
|
|
7422
7429
|
props: {
|
|
@@ -7432,7 +7439,7 @@ class mn extends Z {
|
|
|
7432
7439
|
return ((o = (i = this.view) == null ? void 0 : i.state) == null ? void 0 : o.show) || !1;
|
|
7433
7440
|
}
|
|
7434
7441
|
}
|
|
7435
|
-
class G extends
|
|
7442
|
+
class G extends be {
|
|
7436
7443
|
constructor(i, o) {
|
|
7437
7444
|
super(i, o);
|
|
7438
7445
|
c(this, "nodes");
|
|
@@ -7458,7 +7465,7 @@ class G extends fe {
|
|
|
7458
7465
|
}
|
|
7459
7466
|
map(i, o) {
|
|
7460
7467
|
const n = o.mapResult(this.from), r = o.mapResult(this.to);
|
|
7461
|
-
return r.deleted ?
|
|
7468
|
+
return r.deleted ? be.near(i.resolve(n.pos)) : n.deleted ? be.near(i.resolve(r.pos)) : new G(
|
|
7462
7469
|
i.resolve(n.pos),
|
|
7463
7470
|
i.resolve(r.pos)
|
|
7464
7471
|
);
|
|
@@ -7468,22 +7475,22 @@ class G extends fe {
|
|
|
7468
7475
|
}
|
|
7469
7476
|
}
|
|
7470
7477
|
let A;
|
|
7471
|
-
function
|
|
7478
|
+
function ge(e, t) {
|
|
7472
7479
|
var i, o;
|
|
7473
7480
|
for (; e && e.parentElement && e.parentElement !== t.dom && ((i = e.getAttribute) == null ? void 0 : i.call(e, "data-node-type")) !== "blockContainer"; )
|
|
7474
7481
|
e = e.parentElement;
|
|
7475
7482
|
if (((o = e.getAttribute) == null ? void 0 : o.call(e, "data-node-type")) === "blockContainer")
|
|
7476
7483
|
return { node: e, id: e.getAttribute("data-id") };
|
|
7477
7484
|
}
|
|
7478
|
-
function
|
|
7479
|
-
const i =
|
|
7485
|
+
function bn(e, t) {
|
|
7486
|
+
const i = ge(e, t);
|
|
7480
7487
|
if (i && i.node.nodeType === 1) {
|
|
7481
7488
|
const o = t.docView, n = o.nearestDesc(i.node, !0);
|
|
7482
7489
|
return !n || n === o ? null : n.posBefore;
|
|
7483
7490
|
}
|
|
7484
7491
|
return null;
|
|
7485
7492
|
}
|
|
7486
|
-
function
|
|
7493
|
+
function _n(e, t) {
|
|
7487
7494
|
let i, o;
|
|
7488
7495
|
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);
|
|
7489
7496
|
if (n && r) {
|
|
@@ -7493,7 +7500,7 @@ function gn(e, t) {
|
|
|
7493
7500
|
i = e.from, o = e.to;
|
|
7494
7501
|
return { from: i, to: o };
|
|
7495
7502
|
}
|
|
7496
|
-
function
|
|
7503
|
+
function Je(e, t, i = t) {
|
|
7497
7504
|
t === i && (i += e.state.doc.resolve(t + 1).node().nodeSize);
|
|
7498
7505
|
const o = e.domAtPos(t).node.cloneNode(!0), n = e.domAtPos(t).node, r = (u, p) => Array.prototype.indexOf.call(u.children, p), a = r(
|
|
7499
7506
|
n,
|
|
@@ -7506,16 +7513,16 @@ function Xe(e, t, i = t) {
|
|
|
7506
7513
|
);
|
|
7507
7514
|
for (let u = n.childElementCount - 1; u >= 0; u--)
|
|
7508
7515
|
(u > s || u < a) && o.removeChild(o.children[u]);
|
|
7509
|
-
|
|
7516
|
+
xt(e.root), A = o;
|
|
7510
7517
|
const d = e.dom.className.split(" ").filter(
|
|
7511
7518
|
(u) => u !== "ProseMirror" && u !== "bn-root" && u !== "bn-editor"
|
|
7512
7519
|
).join(" ");
|
|
7513
7520
|
A.className = A.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(A) : e.root.body.appendChild(A);
|
|
7514
7521
|
}
|
|
7515
|
-
function
|
|
7522
|
+
function xt(e) {
|
|
7516
7523
|
A !== void 0 && (e instanceof ShadowRoot ? e.removeChild(A) : e.body.removeChild(A), A = void 0);
|
|
7517
7524
|
}
|
|
7518
|
-
function
|
|
7525
|
+
function kn(e, t) {
|
|
7519
7526
|
if (!e.dataTransfer)
|
|
7520
7527
|
return;
|
|
7521
7528
|
const i = t.prosemirrorView, o = i.dom.getBoundingClientRect(), n = {
|
|
@@ -7526,30 +7533,30 @@ function bn(e, t) {
|
|
|
7526
7533
|
let a;
|
|
7527
7534
|
for (const l of r)
|
|
7528
7535
|
if (i.dom.contains(l)) {
|
|
7529
|
-
a =
|
|
7536
|
+
a = ge(l, i);
|
|
7530
7537
|
break;
|
|
7531
7538
|
}
|
|
7532
7539
|
if (!a)
|
|
7533
7540
|
return;
|
|
7534
|
-
const s =
|
|
7541
|
+
const s = bn(a.node, i);
|
|
7535
7542
|
if (s != null) {
|
|
7536
|
-
const l = i.state.selection, d = i.state.doc, { from: u, to: p } =
|
|
7543
|
+
const l = i.state.selection, d = i.state.doc, { from: u, to: p } = _n(l, d), h = u <= s && s < p, m = l.$anchor.node() !== l.$head.node() || l instanceof G;
|
|
7537
7544
|
h && m ? (i.dispatch(
|
|
7538
7545
|
i.state.tr.setSelection(G.create(d, u, p))
|
|
7539
|
-
),
|
|
7540
|
-
i.state.tr.setSelection(
|
|
7541
|
-
),
|
|
7542
|
-
const f = i.state.selection.content(), g = t.pmSchema,
|
|
7546
|
+
), Je(i, u, p)) : (i.dispatch(
|
|
7547
|
+
i.state.tr.setSelection(ce.create(i.state.doc, s))
|
|
7548
|
+
), Je(i, s));
|
|
7549
|
+
const f = i.state.selection.content(), g = t.pmSchema, v = Be(g, t).serializeProseMirrorFragment(
|
|
7543
7550
|
f.content,
|
|
7544
7551
|
{}
|
|
7545
|
-
), y =
|
|
7552
|
+
), y = ue(g, t).exportProseMirrorFragment(
|
|
7546
7553
|
f.content,
|
|
7547
7554
|
{}
|
|
7548
|
-
), S =
|
|
7549
|
-
e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html",
|
|
7555
|
+
), S = Ne(y);
|
|
7556
|
+
e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", v), e.dataTransfer.setData("text/html", y), e.dataTransfer.setData("text/plain", S), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(A, 0, 0), i.dragging = { slice: f, move: !0 };
|
|
7550
7557
|
}
|
|
7551
7558
|
}
|
|
7552
|
-
class
|
|
7559
|
+
class yn {
|
|
7553
7560
|
constructor(t, i, o) {
|
|
7554
7561
|
c(this, "state");
|
|
7555
7562
|
c(this, "emitUpdate");
|
|
@@ -7581,7 +7588,7 @@ class _n {
|
|
|
7581
7588
|
let n;
|
|
7582
7589
|
for (const u of o)
|
|
7583
7590
|
if (this.pmView.dom.contains(u)) {
|
|
7584
|
-
n =
|
|
7591
|
+
n = ge(u, this.pmView);
|
|
7585
7592
|
break;
|
|
7586
7593
|
}
|
|
7587
7594
|
if (!n || !this.editor.isEditable) {
|
|
@@ -7764,8 +7771,8 @@ class _n {
|
|
|
7764
7771
|
this.editor.openSuggestionMenu("/");
|
|
7765
7772
|
}
|
|
7766
7773
|
}
|
|
7767
|
-
const
|
|
7768
|
-
class
|
|
7774
|
+
const wn = new L("SideMenuPlugin");
|
|
7775
|
+
class vn extends Z {
|
|
7769
7776
|
constructor(i) {
|
|
7770
7777
|
super();
|
|
7771
7778
|
c(this, "view");
|
|
@@ -7779,12 +7786,12 @@ class yn extends Z {
|
|
|
7779
7786
|
* Handles drag & drop events for blocks.
|
|
7780
7787
|
*/
|
|
7781
7788
|
c(this, "blockDragStart", (i) => {
|
|
7782
|
-
this.view.isDragging = !0,
|
|
7789
|
+
this.view.isDragging = !0, kn(i, this.editor);
|
|
7783
7790
|
});
|
|
7784
7791
|
/**
|
|
7785
7792
|
* Handles drag & drop events for blocks.
|
|
7786
7793
|
*/
|
|
7787
|
-
c(this, "blockDragEnd", () =>
|
|
7794
|
+
c(this, "blockDragEnd", () => xt(this.editor.prosemirrorView.root));
|
|
7788
7795
|
/**
|
|
7789
7796
|
* Freezes the side menu. When frozen, the side menu will stay
|
|
7790
7797
|
* attached to the same block regardless of which block is hovered by the
|
|
@@ -7800,8 +7807,8 @@ class yn extends Z {
|
|
|
7800
7807
|
this.view.menuFrozen = !1, this.view.state.show = !1, this.view.emitUpdate(this.view.state);
|
|
7801
7808
|
});
|
|
7802
7809
|
this.editor = i, this.plugin = new x({
|
|
7803
|
-
key:
|
|
7804
|
-
view: (o) => (this.view = new
|
|
7810
|
+
key: wn,
|
|
7811
|
+
view: (o) => (this.view = new yn(i, o, (n) => {
|
|
7805
7812
|
this.emit("update", n);
|
|
7806
7813
|
}), this.view)
|
|
7807
7814
|
});
|
|
@@ -7810,8 +7817,8 @@ class yn extends Z {
|
|
|
7810
7817
|
return this.on("update", i);
|
|
7811
7818
|
}
|
|
7812
7819
|
}
|
|
7813
|
-
const
|
|
7814
|
-
class
|
|
7820
|
+
const xn = Ft((e) => e.type.name === "blockContainer");
|
|
7821
|
+
class En {
|
|
7815
7822
|
constructor(t, i) {
|
|
7816
7823
|
c(this, "state");
|
|
7817
7824
|
c(this, "emitUpdate");
|
|
@@ -7878,7 +7885,7 @@ class wn {
|
|
|
7878
7885
|
}
|
|
7879
7886
|
}
|
|
7880
7887
|
const W = new L("SuggestionMenuPlugin");
|
|
7881
|
-
class
|
|
7888
|
+
class Cn extends Z {
|
|
7882
7889
|
constructor(i) {
|
|
7883
7890
|
super();
|
|
7884
7891
|
c(this, "view");
|
|
@@ -7898,7 +7905,7 @@ class xn extends Z {
|
|
|
7898
7905
|
const o = this.triggerCharacters;
|
|
7899
7906
|
this.plugin = new x({
|
|
7900
7907
|
key: W,
|
|
7901
|
-
view: () => (this.view = new
|
|
7908
|
+
view: () => (this.view = new En(
|
|
7902
7909
|
i,
|
|
7903
7910
|
(n, r) => {
|
|
7904
7911
|
this.emit(`update ${n}`, r);
|
|
@@ -7955,7 +7962,7 @@ class xn extends Z {
|
|
|
7955
7962
|
if (r === void 0)
|
|
7956
7963
|
return null;
|
|
7957
7964
|
if (!r.deleteTriggerCharacter) {
|
|
7958
|
-
const a =
|
|
7965
|
+
const a = xn(n.selection);
|
|
7959
7966
|
if (a)
|
|
7960
7967
|
return K.create(n.doc, [
|
|
7961
7968
|
$.node(
|
|
@@ -7992,68 +7999,75 @@ class xn extends Z {
|
|
|
7992
7999
|
return ((o = (i = this.view) == null ? void 0 : i.state) == null ? void 0 : o.show) || !1;
|
|
7993
8000
|
}
|
|
7994
8001
|
}
|
|
7995
|
-
function
|
|
8002
|
+
function Rr(e, t) {
|
|
7996
8003
|
e.suggestionMenus.addTriggerCharacter(t);
|
|
7997
8004
|
}
|
|
7998
8005
|
let E;
|
|
7999
|
-
function
|
|
8006
|
+
function Ye(e) {
|
|
8000
8007
|
E || (E = document.createElement("div"), E.innerHTML = "_", E.style.opacity = "0", E.style.height = "1px", E.style.width = "1px", e instanceof Document ? e.body.appendChild(E) : e.appendChild(E));
|
|
8001
8008
|
}
|
|
8002
|
-
function
|
|
8009
|
+
function Sn(e) {
|
|
8003
8010
|
E && (e instanceof Document ? e.body.removeChild(E) : e.removeChild(E), E = void 0);
|
|
8004
8011
|
}
|
|
8005
8012
|
function re(e) {
|
|
8006
8013
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
8007
8014
|
}
|
|
8008
|
-
function
|
|
8015
|
+
function Mn(e) {
|
|
8009
8016
|
for (; e && e.nodeName !== "TD" && e.nodeName !== "TH"; )
|
|
8010
8017
|
e = e.classList && e.classList.contains("ProseMirror") ? null : e.parentNode;
|
|
8011
8018
|
return e;
|
|
8012
8019
|
}
|
|
8013
|
-
function
|
|
8020
|
+
function Tn(e, t) {
|
|
8014
8021
|
e.forEach((i) => {
|
|
8015
8022
|
const o = t.querySelectorAll(i);
|
|
8016
8023
|
for (let n = 0; n < o.length; n++)
|
|
8017
8024
|
o[n].style.visibility = "hidden";
|
|
8018
8025
|
});
|
|
8019
8026
|
}
|
|
8020
|
-
class
|
|
8027
|
+
class Bn {
|
|
8021
8028
|
constructor(t, i, o) {
|
|
8022
8029
|
c(this, "state");
|
|
8023
8030
|
c(this, "emitUpdate");
|
|
8024
8031
|
c(this, "tableId");
|
|
8025
8032
|
c(this, "tablePos");
|
|
8026
8033
|
c(this, "menuFrozen", !1);
|
|
8034
|
+
c(this, "mouseState", "up");
|
|
8027
8035
|
c(this, "prevWasEditable", null);
|
|
8036
|
+
c(this, "viewMousedownHandler", () => {
|
|
8037
|
+
this.mouseState = "down";
|
|
8038
|
+
});
|
|
8039
|
+
c(this, "viewMouseupHandler", (t) => {
|
|
8040
|
+
this.mouseState = "up", this.mouseMoveHandler(t);
|
|
8041
|
+
});
|
|
8028
8042
|
c(this, "mouseMoveHandler", (t) => {
|
|
8029
|
-
var d, u, p;
|
|
8030
|
-
if (this.menuFrozen)
|
|
8043
|
+
var d, u, p, h;
|
|
8044
|
+
if (this.menuFrozen || (this.mouseState === "down" && (this.mouseState = "selecting", (d = this.state) != null && d.show && (this.state.show = !1, this.emitUpdate())), this.mouseState === "selecting"))
|
|
8031
8045
|
return;
|
|
8032
|
-
const i =
|
|
8046
|
+
const i = Mn(t.target);
|
|
8033
8047
|
if (!i || !this.editor.isEditable) {
|
|
8034
|
-
(
|
|
8048
|
+
(u = this.state) != null && u.show && (this.state.show = !1, this.emitUpdate());
|
|
8035
8049
|
return;
|
|
8036
8050
|
}
|
|
8037
|
-
const o = re(i), n = re(i.parentElement), r = i.getBoundingClientRect(), a = (
|
|
8051
|
+
const o = re(i), n = re(i.parentElement), r = i.getBoundingClientRect(), a = (h = (p = i.parentElement) == null ? void 0 : p.parentElement) == null ? void 0 : h.getBoundingClientRect();
|
|
8038
8052
|
if (!a)
|
|
8039
8053
|
return;
|
|
8040
|
-
const s =
|
|
8054
|
+
const s = ge(i, this.pmView);
|
|
8041
8055
|
if (!s)
|
|
8042
8056
|
return;
|
|
8043
8057
|
let l;
|
|
8044
|
-
if (this.editor._tiptapEditor.state.doc.descendants((
|
|
8058
|
+
if (this.editor._tiptapEditor.state.doc.descendants((m, f) => {
|
|
8045
8059
|
if (typeof l < "u")
|
|
8046
8060
|
return !1;
|
|
8047
|
-
if (
|
|
8061
|
+
if (m.type.name !== "blockContainer" || m.attrs.id !== s.id)
|
|
8048
8062
|
return !0;
|
|
8049
|
-
const
|
|
8050
|
-
|
|
8063
|
+
const g = C(
|
|
8064
|
+
m,
|
|
8051
8065
|
this.editor.schema.blockSchema,
|
|
8052
8066
|
this.editor.schema.inlineContentSchema,
|
|
8053
8067
|
this.editor.schema.styleSchema,
|
|
8054
8068
|
this.editor.blockCache
|
|
8055
8069
|
);
|
|
8056
|
-
return
|
|
8070
|
+
return Wo("table", g, this.editor) && (this.tablePos = f + 1, l = g), !1;
|
|
8057
8071
|
}), !!l && (this.tableId = s.id, !(this.state !== void 0 && this.state.show && this.tableId === s.id && this.state.rowIndex === n && this.state.colIndex === o)))
|
|
8058
8072
|
return this.state = {
|
|
8059
8073
|
show: !0,
|
|
@@ -8069,7 +8083,7 @@ class Mn {
|
|
|
8069
8083
|
var h;
|
|
8070
8084
|
if (((h = this.state) == null ? void 0 : h.draggingState) === void 0)
|
|
8071
8085
|
return;
|
|
8072
|
-
t.preventDefault(), t.dataTransfer.dropEffect = "move",
|
|
8086
|
+
t.preventDefault(), t.dataTransfer.dropEffect = "move", Tn(
|
|
8073
8087
|
[
|
|
8074
8088
|
"column-resize-handle",
|
|
8075
8089
|
"prosemirror-dropcursor-block",
|
|
@@ -8141,7 +8155,7 @@ class Mn {
|
|
|
8141
8155
|
if (!this.state)
|
|
8142
8156
|
throw new Error("Attempting to update uninitialized image toolbar");
|
|
8143
8157
|
o(this.state);
|
|
8144
|
-
}, i.dom.addEventListener("mousemove", this.mouseMoveHandler), i.root.addEventListener(
|
|
8158
|
+
}, i.dom.addEventListener("mousemove", this.mouseMoveHandler), i.dom.addEventListener("mousedown", this.viewMousedownHandler), i.dom.addEventListener("mouseup", this.viewMouseupHandler), i.root.addEventListener(
|
|
8145
8159
|
"dragover",
|
|
8146
8160
|
this.dragOverHandler
|
|
8147
8161
|
), i.root.addEventListener("drop", this.dropHandler), i.root.addEventListener("scroll", this.scrollHandler, !0);
|
|
@@ -8157,7 +8171,7 @@ class Mn {
|
|
|
8157
8171
|
}
|
|
8158
8172
|
}
|
|
8159
8173
|
const Q = new L("TableHandlesPlugin");
|
|
8160
|
-
class
|
|
8174
|
+
class Ln extends Z {
|
|
8161
8175
|
constructor(i) {
|
|
8162
8176
|
super();
|
|
8163
8177
|
c(this, "view");
|
|
@@ -8182,7 +8196,7 @@ class Tn extends Z {
|
|
|
8182
8196
|
newIndex: this.view.state.colIndex,
|
|
8183
8197
|
tablePos: this.view.tablePos
|
|
8184
8198
|
})
|
|
8185
|
-
),
|
|
8199
|
+
), Ye(this.editor._tiptapEditor.view.root), i.dataTransfer.setDragImage(E, 0, 0), i.dataTransfer.effectAllowed = "move";
|
|
8186
8200
|
});
|
|
8187
8201
|
/**
|
|
8188
8202
|
* Callback that should be set on the `dragStart` event for whichever element
|
|
@@ -8204,7 +8218,7 @@ class Tn extends Z {
|
|
|
8204
8218
|
newIndex: this.view.state.rowIndex,
|
|
8205
8219
|
tablePos: this.view.tablePos
|
|
8206
8220
|
})
|
|
8207
|
-
),
|
|
8221
|
+
), Ye(this.editor._tiptapEditor.view.root), i.dataTransfer.setDragImage(E, 0, 0), i.dataTransfer.effectAllowed = "copyMove";
|
|
8208
8222
|
});
|
|
8209
8223
|
/**
|
|
8210
8224
|
* Callback that should be set on the `dragEnd` event for both the element
|
|
@@ -8217,7 +8231,7 @@ class Tn extends Z {
|
|
|
8217
8231
|
);
|
|
8218
8232
|
this.view.state.draggingState = void 0, this.view.emitUpdate(), this.editor.dispatch(
|
|
8219
8233
|
this.editor._tiptapEditor.state.tr.setMeta(Q, null)
|
|
8220
|
-
),
|
|
8234
|
+
), Sn(this.editor._tiptapEditor.view.root);
|
|
8221
8235
|
});
|
|
8222
8236
|
/**
|
|
8223
8237
|
* Freezes the drag handles. When frozen, they will stay attached to the same
|
|
@@ -8235,7 +8249,7 @@ class Tn extends Z {
|
|
|
8235
8249
|
});
|
|
8236
8250
|
this.editor = i, this.plugin = new x({
|
|
8237
8251
|
key: Q,
|
|
8238
|
-
view: (o) => (this.view = new
|
|
8252
|
+
view: (o) => (this.view = new Bn(i, o, (n) => {
|
|
8239
8253
|
this.emit("update", n);
|
|
8240
8254
|
}), this.view),
|
|
8241
8255
|
// We use decorations to render the drop cursor when dragging a table row
|
|
@@ -8288,8 +8302,8 @@ class Tn extends Z {
|
|
|
8288
8302
|
return this.on("update", i);
|
|
8289
8303
|
}
|
|
8290
8304
|
}
|
|
8291
|
-
async function
|
|
8292
|
-
const i = e.state.selection.content().content, n =
|
|
8305
|
+
async function Et(e, t) {
|
|
8306
|
+
const i = e.state.selection.content().content, n = Be(
|
|
8293
8307
|
e.state.schema,
|
|
8294
8308
|
t
|
|
8295
8309
|
).serializeProseMirrorFragment(
|
|
@@ -8297,25 +8311,25 @@ async function wt(e, t) {
|
|
|
8297
8311
|
{}
|
|
8298
8312
|
);
|
|
8299
8313
|
await ie();
|
|
8300
|
-
const a =
|
|
8314
|
+
const a = ue(
|
|
8301
8315
|
e.state.schema,
|
|
8302
8316
|
t
|
|
8303
8317
|
).exportProseMirrorFragment(
|
|
8304
8318
|
i,
|
|
8305
8319
|
{}
|
|
8306
|
-
), s = await
|
|
8320
|
+
), s = await Ne(a);
|
|
8307
8321
|
return { internalHTML: n, externalHTML: a, plainText: s };
|
|
8308
8322
|
}
|
|
8309
|
-
const
|
|
8323
|
+
const Qe = (e, t, i) => {
|
|
8310
8324
|
i.preventDefault(), i.clipboardData.clearData(), "node" in t.state.selection && t.state.selection.node.type.spec.group === "blockContent" && e.dispatch(
|
|
8311
8325
|
e._tiptapEditor.state.tr.setSelection(
|
|
8312
|
-
new
|
|
8326
|
+
new ce(t.state.doc.resolve(t.state.selection.from - 1))
|
|
8313
8327
|
)
|
|
8314
8328
|
), (async () => {
|
|
8315
|
-
const { internalHTML: o, externalHTML: n, plainText: r } = await
|
|
8329
|
+
const { internalHTML: o, externalHTML: n, plainText: r } = await Et(t, e);
|
|
8316
8330
|
i.clipboardData.setData("blocknote/html", o), i.clipboardData.setData("text/html", n), i.clipboardData.setData("text/plain", r);
|
|
8317
8331
|
})();
|
|
8318
|
-
},
|
|
8332
|
+
}, In = (e) => I.create({
|
|
8319
8333
|
name: "copyToClipboard",
|
|
8320
8334
|
addProseMirrorPlugins() {
|
|
8321
8335
|
return [
|
|
@@ -8323,10 +8337,10 @@ const Je = (e, t, i) => {
|
|
|
8323
8337
|
props: {
|
|
8324
8338
|
handleDOMEvents: {
|
|
8325
8339
|
copy(t, i) {
|
|
8326
|
-
return
|
|
8340
|
+
return Qe(e, t, i), !0;
|
|
8327
8341
|
},
|
|
8328
8342
|
cut(t, i) {
|
|
8329
|
-
return
|
|
8343
|
+
return Qe(e, t, i), t.dispatch(t.state.tr.deleteSelection()), !0;
|
|
8330
8344
|
},
|
|
8331
8345
|
// This is for the use-case in which only a block without content
|
|
8332
8346
|
// is selected, e.g. an image block, and dragged (not using the
|
|
@@ -8335,12 +8349,12 @@ const Je = (e, t, i) => {
|
|
|
8335
8349
|
if ("node" in t.state.selection && t.state.selection.node.type.spec.group === "blockContent")
|
|
8336
8350
|
return e.dispatch(
|
|
8337
8351
|
e._tiptapEditor.state.tr.setSelection(
|
|
8338
|
-
new
|
|
8352
|
+
new ce(
|
|
8339
8353
|
t.state.doc.resolve(t.state.selection.from - 1)
|
|
8340
8354
|
)
|
|
8341
8355
|
)
|
|
8342
8356
|
), i.preventDefault(), i.dataTransfer.clearData(), (async () => {
|
|
8343
|
-
const { internalHTML: o, externalHTML: n, plainText: r } = await
|
|
8357
|
+
const { internalHTML: o, externalHTML: n, plainText: r } = await Et(t, e);
|
|
8344
8358
|
i.dataTransfer.setData("blocknote/html", o), i.dataTransfer.setData("text/html", n), i.dataTransfer.setData("text/plain", r);
|
|
8345
8359
|
})(), !0;
|
|
8346
8360
|
}
|
|
@@ -8349,18 +8363,18 @@ const Je = (e, t, i) => {
|
|
|
8349
8363
|
})
|
|
8350
8364
|
];
|
|
8351
8365
|
}
|
|
8352
|
-
}),
|
|
8366
|
+
}), Pe = [
|
|
8353
8367
|
"blocknote/html",
|
|
8354
8368
|
"Files",
|
|
8355
8369
|
"text/html",
|
|
8356
8370
|
"text/plain"
|
|
8357
8371
|
];
|
|
8358
|
-
function
|
|
8372
|
+
function An(e, t) {
|
|
8359
8373
|
if (!e.startsWith(".") || !t.startsWith("."))
|
|
8360
8374
|
throw new Error("The strings provided are not valid file extensions.");
|
|
8361
8375
|
return e === t;
|
|
8362
8376
|
}
|
|
8363
|
-
function
|
|
8377
|
+
function Nn(e, t) {
|
|
8364
8378
|
const i = e.split("/"), o = t.split("/");
|
|
8365
8379
|
if (i.length !== 2)
|
|
8366
8380
|
throw new Error(`The string ${e} is not a valid MIME type.`);
|
|
@@ -8368,14 +8382,14 @@ function In(e, t) {
|
|
|
8368
8382
|
throw new Error(`The string ${t} is not a valid MIME type.`);
|
|
8369
8383
|
return i[1] === "*" || o[1] === "*" ? i[0] === o[0] : (i[0] === "*" || o[0] === "*" || i[0] === o[0]) && i[1] === o[1];
|
|
8370
8384
|
}
|
|
8371
|
-
async function
|
|
8385
|
+
async function Ct(e, t) {
|
|
8372
8386
|
if (!t.uploadFile)
|
|
8373
8387
|
return;
|
|
8374
8388
|
const i = "dataTransfer" in e ? e.dataTransfer : e.clipboardData;
|
|
8375
8389
|
if (i === null)
|
|
8376
8390
|
return;
|
|
8377
8391
|
let o = null;
|
|
8378
|
-
for (const a of
|
|
8392
|
+
for (const a of Pe)
|
|
8379
8393
|
if (i.types.includes(a)) {
|
|
8380
8394
|
o = a;
|
|
8381
8395
|
break;
|
|
@@ -8394,7 +8408,7 @@ async function xt(e, t) {
|
|
|
8394
8408
|
for (const d of r)
|
|
8395
8409
|
for (const u of d.fileBlockAccept || []) {
|
|
8396
8410
|
const p = u.startsWith("."), h = n[a].getAsFile();
|
|
8397
|
-
if (h && (!p && h.type &&
|
|
8411
|
+
if (h && (!p && h.type && Nn(n[a].type, u) || p && An(
|
|
8398
8412
|
"." + h.name.split(".").pop(),
|
|
8399
8413
|
u
|
|
8400
8414
|
))) {
|
|
@@ -8444,7 +8458,7 @@ async function xt(e, t) {
|
|
|
8444
8458
|
}
|
|
8445
8459
|
}
|
|
8446
8460
|
}
|
|
8447
|
-
const
|
|
8461
|
+
const Pn = (e) => I.create({
|
|
8448
8462
|
name: "dropFile",
|
|
8449
8463
|
addProseMirrorPlugins() {
|
|
8450
8464
|
return [
|
|
@@ -8455,19 +8469,19 @@ const An = (e) => I.create({
|
|
|
8455
8469
|
if (!e.isEditable)
|
|
8456
8470
|
return;
|
|
8457
8471
|
let o = null;
|
|
8458
|
-
for (const n of
|
|
8472
|
+
for (const n of Pe)
|
|
8459
8473
|
if (i.dataTransfer.types.includes(n)) {
|
|
8460
8474
|
o = n;
|
|
8461
8475
|
break;
|
|
8462
8476
|
}
|
|
8463
|
-
return o === null ? !0 : o === "Files" ? (
|
|
8477
|
+
return o === null ? !0 : o === "Files" ? (Ct(i, e), !0) : !1;
|
|
8464
8478
|
}
|
|
8465
8479
|
}
|
|
8466
8480
|
}
|
|
8467
8481
|
})
|
|
8468
8482
|
];
|
|
8469
8483
|
}
|
|
8470
|
-
}),
|
|
8484
|
+
}), Hn = (e) => I.create({
|
|
8471
8485
|
name: "pasteFromClipboard",
|
|
8472
8486
|
addProseMirrorPlugins() {
|
|
8473
8487
|
return [
|
|
@@ -8478,7 +8492,7 @@ const An = (e) => I.create({
|
|
|
8478
8492
|
if (i.preventDefault(), !e.isEditable)
|
|
8479
8493
|
return;
|
|
8480
8494
|
let o = null;
|
|
8481
|
-
for (const r of
|
|
8495
|
+
for (const r of Pe)
|
|
8482
8496
|
if (i.clipboardData.types.includes(r)) {
|
|
8483
8497
|
o = r;
|
|
8484
8498
|
break;
|
|
@@ -8486,16 +8500,16 @@ const An = (e) => I.create({
|
|
|
8486
8500
|
if (o === null)
|
|
8487
8501
|
return !0;
|
|
8488
8502
|
if (o === "Files")
|
|
8489
|
-
return
|
|
8503
|
+
return Ct(i, e), !0;
|
|
8490
8504
|
let n = i.clipboardData.getData(o);
|
|
8491
|
-
return o === "text/html" && (n =
|
|
8505
|
+
return o === "text/html" && (n = wt(n.trim()).innerHTML), e._tiptapEditor.view.pasteHTML(n), !0;
|
|
8492
8506
|
}
|
|
8493
8507
|
}
|
|
8494
8508
|
}
|
|
8495
8509
|
})
|
|
8496
8510
|
];
|
|
8497
8511
|
}
|
|
8498
|
-
}),
|
|
8512
|
+
}), Un = I.create({
|
|
8499
8513
|
name: "blockBackgroundColor",
|
|
8500
8514
|
addGlobalAttributes() {
|
|
8501
8515
|
return [
|
|
@@ -8503,9 +8517,9 @@ const An = (e) => I.create({
|
|
|
8503
8517
|
types: ["blockContainer"],
|
|
8504
8518
|
attributes: {
|
|
8505
8519
|
backgroundColor: {
|
|
8506
|
-
default:
|
|
8507
|
-
parseHTML: (e) => e.hasAttribute("data-background-color") ? e.getAttribute("data-background-color") :
|
|
8508
|
-
renderHTML: (e) => e.backgroundColor ===
|
|
8520
|
+
default: w.backgroundColor.default,
|
|
8521
|
+
parseHTML: (e) => e.hasAttribute("data-background-color") ? e.getAttribute("data-background-color") : w.backgroundColor.default,
|
|
8522
|
+
renderHTML: (e) => e.backgroundColor === w.backgroundColor.default ? {} : {
|
|
8509
8523
|
"data-background-color": e.backgroundColor
|
|
8510
8524
|
}
|
|
8511
8525
|
}
|
|
@@ -8513,7 +8527,7 @@ const An = (e) => I.create({
|
|
|
8513
8527
|
}
|
|
8514
8528
|
];
|
|
8515
8529
|
}
|
|
8516
|
-
}),
|
|
8530
|
+
}), Dn = I.create({
|
|
8517
8531
|
name: "textAlignment",
|
|
8518
8532
|
addGlobalAttributes() {
|
|
8519
8533
|
return [
|
|
@@ -8539,7 +8553,7 @@ const An = (e) => I.create({
|
|
|
8539
8553
|
}
|
|
8540
8554
|
];
|
|
8541
8555
|
}
|
|
8542
|
-
}),
|
|
8556
|
+
}), jn = I.create({
|
|
8543
8557
|
name: "blockTextColor",
|
|
8544
8558
|
addGlobalAttributes() {
|
|
8545
8559
|
return [
|
|
@@ -8547,9 +8561,9 @@ const An = (e) => I.create({
|
|
|
8547
8561
|
types: ["blockContainer"],
|
|
8548
8562
|
attributes: {
|
|
8549
8563
|
textColor: {
|
|
8550
|
-
default:
|
|
8551
|
-
parseHTML: (e) => e.hasAttribute("data-text-color") ? e.getAttribute("data-text-color") :
|
|
8552
|
-
renderHTML: (e) => e.textColor ===
|
|
8564
|
+
default: w.textColor.default,
|
|
8565
|
+
parseHTML: (e) => e.hasAttribute("data-text-color") ? e.getAttribute("data-text-color") : w.textColor.default,
|
|
8566
|
+
renderHTML: (e) => e.textColor === w.textColor.default ? {} : {
|
|
8553
8567
|
"data-text-color": e.textColor
|
|
8554
8568
|
}
|
|
8555
8569
|
}
|
|
@@ -8557,7 +8571,7 @@ const An = (e) => I.create({
|
|
|
8557
8571
|
}
|
|
8558
8572
|
];
|
|
8559
8573
|
}
|
|
8560
|
-
}),
|
|
8574
|
+
}), zn = I.create({
|
|
8561
8575
|
name: "trailingNode",
|
|
8562
8576
|
addProseMirrorPlugins() {
|
|
8563
8577
|
const e = new L(this.name);
|
|
@@ -8592,8 +8606,8 @@ const An = (e) => I.create({
|
|
|
8592
8606
|
})
|
|
8593
8607
|
];
|
|
8594
8608
|
}
|
|
8595
|
-
}),
|
|
8596
|
-
key:
|
|
8609
|
+
}), Rn = new L("non-editable-block"), Vn = () => new x({
|
|
8610
|
+
key: Rn,
|
|
8597
8611
|
props: {
|
|
8598
8612
|
handleKeyDown: (e, t) => {
|
|
8599
8613
|
if ("node" in e.state.selection) {
|
|
@@ -8618,13 +8632,13 @@ const An = (e) => I.create({
|
|
|
8618
8632
|
return !1;
|
|
8619
8633
|
}
|
|
8620
8634
|
}
|
|
8621
|
-
}),
|
|
8635
|
+
}), On = {
|
|
8622
8636
|
blockColor: "data-block-color",
|
|
8623
8637
|
blockStyle: "data-block-style",
|
|
8624
8638
|
id: "data-id",
|
|
8625
8639
|
depth: "data-depth",
|
|
8626
8640
|
depthChange: "data-depth-change"
|
|
8627
|
-
},
|
|
8641
|
+
}, Fn = q.create({
|
|
8628
8642
|
name: "blockContainer",
|
|
8629
8643
|
group: "blockContainer",
|
|
8630
8644
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -8640,7 +8654,7 @@ const An = (e) => I.create({
|
|
|
8640
8654
|
if (typeof e == "string")
|
|
8641
8655
|
return !1;
|
|
8642
8656
|
const t = {};
|
|
8643
|
-
for (const [i, o] of Object.entries(
|
|
8657
|
+
for (const [i, o] of Object.entries(On))
|
|
8644
8658
|
e.getAttribute(o) && (t[i] = e.getAttribute(o));
|
|
8645
8659
|
return e.getAttribute("data-node-type") === "blockContainer" ? t : !1;
|
|
8646
8660
|
}
|
|
@@ -8722,7 +8736,7 @@ const An = (e) => I.create({
|
|
|
8722
8736
|
this.options.editor.schema.styleSchema
|
|
8723
8737
|
);
|
|
8724
8738
|
else if (t.content.type === "tableContent")
|
|
8725
|
-
p =
|
|
8739
|
+
p = nt(
|
|
8726
8740
|
t.content,
|
|
8727
8741
|
i.schema,
|
|
8728
8742
|
this.options.editor.schema.styleSchema
|
|
@@ -8751,7 +8765,7 @@ const An = (e) => I.create({
|
|
|
8751
8765
|
p
|
|
8752
8766
|
)
|
|
8753
8767
|
).setSelection(
|
|
8754
|
-
i.schema.nodes[u].spec.content === "" ? new
|
|
8768
|
+
i.schema.nodes[u].spec.content === "" ? new ce(i.tr.doc.resolve(r)) : i.schema.nodes[u].spec.content === "inline*" ? new Y(i.tr.doc.resolve(r)) : (
|
|
8755
8769
|
// Need to offset the position as we have to get through the
|
|
8756
8770
|
// `tableRow` and `tableCell` nodes to get to the
|
|
8757
8771
|
// `tableParagraph` node we want to set the selection in.
|
|
@@ -8848,7 +8862,7 @@ const An = (e) => I.create({
|
|
|
8848
8862
|
};
|
|
8849
8863
|
},
|
|
8850
8864
|
addProseMirrorPlugins() {
|
|
8851
|
-
return [
|
|
8865
|
+
return [Vn()];
|
|
8852
8866
|
},
|
|
8853
8867
|
addKeyboardShortcuts() {
|
|
8854
8868
|
return {
|
|
@@ -8955,7 +8969,7 @@ const An = (e) => I.create({
|
|
|
8955
8969
|
}
|
|
8956
8970
|
};
|
|
8957
8971
|
}
|
|
8958
|
-
}),
|
|
8972
|
+
}), Gn = q.create({
|
|
8959
8973
|
name: "blockGroup",
|
|
8960
8974
|
group: "blockGroup",
|
|
8961
8975
|
content: "blockContainer+",
|
|
@@ -8984,11 +8998,11 @@ const An = (e) => I.create({
|
|
|
8984
8998
|
contentDOM: i
|
|
8985
8999
|
};
|
|
8986
9000
|
}
|
|
8987
|
-
}),
|
|
9001
|
+
}), Wn = q.create({
|
|
8988
9002
|
name: "doc",
|
|
8989
9003
|
topNode: !0,
|
|
8990
9004
|
content: "blockGroup"
|
|
8991
|
-
}),
|
|
9005
|
+
}), Kn = (e) => {
|
|
8992
9006
|
var o;
|
|
8993
9007
|
const t = [
|
|
8994
9008
|
J.ClipboardTextSerializer,
|
|
@@ -8997,18 +9011,18 @@ const An = (e) => I.create({
|
|
|
8997
9011
|
J.FocusEvents,
|
|
8998
9012
|
J.Tabindex,
|
|
8999
9013
|
// DevTools,
|
|
9000
|
-
|
|
9014
|
+
di,
|
|
9001
9015
|
// DropCursor,
|
|
9002
9016
|
oe.configure({
|
|
9003
9017
|
types: ["blockContainer"],
|
|
9004
9018
|
setIdAttribute: e.setIdAttribute
|
|
9005
9019
|
}),
|
|
9006
|
-
|
|
9020
|
+
ci.extend({ priority: 10 }),
|
|
9007
9021
|
// Comments,
|
|
9008
9022
|
// basics:
|
|
9009
|
-
|
|
9023
|
+
hi,
|
|
9010
9024
|
// marks:
|
|
9011
|
-
|
|
9025
|
+
pi.extend({
|
|
9012
9026
|
addKeyboardShortcuts() {
|
|
9013
9027
|
return {
|
|
9014
9028
|
"Mod-k": () => (this.editor.commands.toggleLink({ href: "" }), !0)
|
|
@@ -9016,9 +9030,9 @@ const An = (e) => I.create({
|
|
|
9016
9030
|
}
|
|
9017
9031
|
}),
|
|
9018
9032
|
...Object.values(e.styleSpecs).map((n) => n.implementation.mark),
|
|
9033
|
+
jn,
|
|
9019
9034
|
Un,
|
|
9020
|
-
|
|
9021
|
-
Hn,
|
|
9035
|
+
Dn,
|
|
9022
9036
|
// make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
|
|
9023
9037
|
I.create({
|
|
9024
9038
|
name: "OverrideEscape",
|
|
@@ -9029,12 +9043,12 @@ const An = (e) => I.create({
|
|
|
9029
9043
|
}
|
|
9030
9044
|
}),
|
|
9031
9045
|
// nodes
|
|
9032
|
-
|
|
9033
|
-
|
|
9046
|
+
Wn,
|
|
9047
|
+
Fn.configure({
|
|
9034
9048
|
editor: e.editor,
|
|
9035
9049
|
domAttributes: e.domAttributes
|
|
9036
9050
|
}),
|
|
9037
|
-
|
|
9051
|
+
Gn.configure({
|
|
9038
9052
|
domAttributes: e.domAttributes
|
|
9039
9053
|
}),
|
|
9040
9054
|
...Object.values(e.inlineContentSpecs).filter((n) => n.config !== "link" && n.config !== "text").map((n) => n.implementation.node.configure({
|
|
@@ -9054,17 +9068,17 @@ const An = (e) => I.create({
|
|
|
9054
9068
|
domAttributes: e.domAttributes
|
|
9055
9069
|
})
|
|
9056
9070
|
]),
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9071
|
+
In(e.editor),
|
|
9072
|
+
Hn(e.editor),
|
|
9073
|
+
Pn(e.editor),
|
|
9074
|
+
li.configure({ width: 5, color: "#ddeeff" }),
|
|
9061
9075
|
// This needs to be at the bottom of this list, because Key events (such as enter, when selecting a /command),
|
|
9062
9076
|
// should be handled before Enter handlers in other components like splitListItem
|
|
9063
|
-
...e.trailingBlock === void 0 || e.trailingBlock ? [
|
|
9077
|
+
...e.trailingBlock === void 0 || e.trailingBlock ? [zn] : []
|
|
9064
9078
|
];
|
|
9065
9079
|
if (e.collaboration) {
|
|
9066
9080
|
if (t.push(
|
|
9067
|
-
|
|
9081
|
+
ai.configure({
|
|
9068
9082
|
fragment: e.collaboration.fragment
|
|
9069
9083
|
})
|
|
9070
9084
|
), (o = e.collaboration.provider) != null && o.awareness) {
|
|
@@ -9077,7 +9091,7 @@ const An = (e) => I.create({
|
|
|
9077
9091
|
return a.insertBefore(l, null), a.insertBefore(s, null), a.insertBefore(d, null), a;
|
|
9078
9092
|
};
|
|
9079
9093
|
t.push(
|
|
9080
|
-
|
|
9094
|
+
si.configure({
|
|
9081
9095
|
user: e.collaboration.user,
|
|
9082
9096
|
render: e.collaboration.renderCursor || n,
|
|
9083
9097
|
provider: e.collaboration.provider
|
|
@@ -9085,24 +9099,24 @@ const An = (e) => I.create({
|
|
|
9085
9099
|
);
|
|
9086
9100
|
}
|
|
9087
9101
|
} else
|
|
9088
|
-
t.push(
|
|
9102
|
+
t.push(ui);
|
|
9089
9103
|
const i = e.disableExtensions || [];
|
|
9090
9104
|
return t.filter((n) => !i.includes(n.name));
|
|
9091
9105
|
};
|
|
9092
|
-
function
|
|
9106
|
+
function $n(e, t) {
|
|
9093
9107
|
const i = [];
|
|
9094
9108
|
return e.forEach((o, n, r) => {
|
|
9095
9109
|
r !== t && i.push(o);
|
|
9096
9110
|
}), N.from(i);
|
|
9097
9111
|
}
|
|
9098
|
-
function
|
|
9112
|
+
function qn(e, t) {
|
|
9099
9113
|
let i = N.from(e.content);
|
|
9100
9114
|
for (let o = 0; o < i.childCount; o++)
|
|
9101
9115
|
if (i.child(o).type.spec.group === "blockContent") {
|
|
9102
9116
|
const n = [i.child(o)];
|
|
9103
9117
|
if (o + 1 < i.childCount && i.child(o + 1).type.spec.group === "blockGroup") {
|
|
9104
9118
|
const a = i.child(o + 1).child(0).child(0);
|
|
9105
|
-
(a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(i.child(o + 1)), i =
|
|
9119
|
+
(a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(i.child(o + 1)), i = $n(i, o + 1));
|
|
9106
9120
|
}
|
|
9107
9121
|
const r = t.state.schema.nodes.blockContainer.create(
|
|
9108
9122
|
void 0,
|
|
@@ -9112,12 +9126,12 @@ function Kn(e, t) {
|
|
|
9112
9126
|
}
|
|
9113
9127
|
return new z(i, e.openStart, e.openEnd);
|
|
9114
9128
|
}
|
|
9115
|
-
function
|
|
9129
|
+
function ye(e) {
|
|
9116
9130
|
return e && Object.fromEntries(
|
|
9117
9131
|
Object.entries(e).filter(([, t]) => t !== void 0)
|
|
9118
9132
|
);
|
|
9119
9133
|
}
|
|
9120
|
-
class
|
|
9134
|
+
class He {
|
|
9121
9135
|
constructor(t) {
|
|
9122
9136
|
c(this, "blockSpecs");
|
|
9123
9137
|
c(this, "inlineContentSpecs");
|
|
@@ -9129,15 +9143,15 @@ class Ne {
|
|
|
9129
9143
|
c(this, "BlockNoteEditor", "only for types");
|
|
9130
9144
|
c(this, "Block", "only for types");
|
|
9131
9145
|
c(this, "PartialBlock", "only for types");
|
|
9132
|
-
this.blockSpecs =
|
|
9146
|
+
this.blockSpecs = ye(t == null ? void 0 : t.blockSpecs) || bt, this.inlineContentSpecs = ye(t == null ? void 0 : t.inlineContentSpecs) || kt, this.styleSpecs = ye(t == null ? void 0 : t.styleSpecs) || _t, this.blockSchema = ut(this.blockSpecs), this.inlineContentSchema = pt(
|
|
9133
9147
|
this.inlineContentSpecs
|
|
9134
|
-
), this.styleSchema =
|
|
9148
|
+
), this.styleSchema = mt(this.styleSpecs);
|
|
9135
9149
|
}
|
|
9136
9150
|
static create(t) {
|
|
9137
|
-
return new
|
|
9151
|
+
return new He(t);
|
|
9138
9152
|
}
|
|
9139
9153
|
}
|
|
9140
|
-
class
|
|
9154
|
+
const de = class de extends Gt {
|
|
9141
9155
|
constructor(i, o) {
|
|
9142
9156
|
super({ ...i, content: void 0 });
|
|
9143
9157
|
c(this, "_state");
|
|
@@ -9156,14 +9170,14 @@ class Et extends Ft {
|
|
|
9156
9170
|
if (r)
|
|
9157
9171
|
return r;
|
|
9158
9172
|
const d = a.apply(n.nodes.doc, l), u = JSON.parse(JSON.stringify(d.toJSON()));
|
|
9159
|
-
return u.content[0].content[0].attrs.id = "initialBlockId", r =
|
|
9173
|
+
return u.content[0].content[0].attrs.id = "initialBlockId", r = Nt.fromJSON(n, u), r;
|
|
9160
9174
|
};
|
|
9161
9175
|
let s;
|
|
9162
9176
|
try {
|
|
9163
9177
|
const l = i == null ? void 0 : i.content.map(
|
|
9164
9178
|
(d) => U(d, this.schema, o).toJSON()
|
|
9165
9179
|
);
|
|
9166
|
-
s =
|
|
9180
|
+
s = Wt(
|
|
9167
9181
|
{
|
|
9168
9182
|
type: "doc",
|
|
9169
9183
|
content: [
|
|
@@ -9184,7 +9198,7 @@ class Et extends Ft {
|
|
|
9184
9198
|
"Error creating document from blocks passed as `initialContent`:\n" + +JSON.stringify(i.content)
|
|
9185
9199
|
);
|
|
9186
9200
|
}
|
|
9187
|
-
this._state =
|
|
9201
|
+
this._state = $t.create({
|
|
9188
9202
|
doc: s,
|
|
9189
9203
|
schema: this.schema
|
|
9190
9204
|
// selection: selection || undefined,
|
|
@@ -9201,7 +9215,7 @@ class Et extends Ft {
|
|
|
9201
9215
|
*/
|
|
9202
9216
|
createViewAlternative() {
|
|
9203
9217
|
queueMicrotask(() => {
|
|
9204
|
-
this.view = new
|
|
9218
|
+
this.view = new ri(
|
|
9205
9219
|
{ mount: this.options.element },
|
|
9206
9220
|
// use mount option so that we reuse the existing element instead of creating a new one
|
|
9207
9221
|
{
|
|
@@ -9214,15 +9228,26 @@ class Et extends Ft {
|
|
|
9214
9228
|
const i = this.state.reconfigure({
|
|
9215
9229
|
plugins: this.extensionManager.plugins
|
|
9216
9230
|
});
|
|
9217
|
-
this.view.updateState(i), this.createNodeViews();
|
|
9231
|
+
this.view.updateState(i), this.createNodeViews(), this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }), this.isInitialized = !0;
|
|
9218
9232
|
});
|
|
9219
9233
|
}
|
|
9220
|
-
}
|
|
9221
|
-
|
|
9234
|
+
};
|
|
9235
|
+
c(de, "create", (i, o) => {
|
|
9236
|
+
var r, a;
|
|
9237
|
+
const n = (r = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : r.setTimeout;
|
|
9238
|
+
typeof ((a = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : a.setTimeout) < "u" && (globalThis.window.setTimeout = () => 0);
|
|
9239
|
+
try {
|
|
9240
|
+
return new de(i, o);
|
|
9241
|
+
} finally {
|
|
9242
|
+
n && (globalThis.window.setTimeout = n);
|
|
9243
|
+
}
|
|
9244
|
+
});
|
|
9245
|
+
let le = de;
|
|
9246
|
+
le.prototype.createView = function() {
|
|
9222
9247
|
this.options.onPaste = this.options.onDrop = void 0;
|
|
9223
9248
|
};
|
|
9224
|
-
const
|
|
9225
|
-
key:
|
|
9249
|
+
const Xn = new L("blocknote-placeholder"), Zn = (e, t) => new x({
|
|
9250
|
+
key: Xn,
|
|
9226
9251
|
view: () => {
|
|
9227
9252
|
const i = document.createElement("style"), o = e._tiptapEditor.options.injectNonce;
|
|
9228
9253
|
o && i.setAttribute("nonce", o), e._tiptapEditor.view.root instanceof ShadowRoot ? e._tiptapEditor.view.root.append(i) : e._tiptapEditor.view.root.head.appendChild(i);
|
|
@@ -9266,7 +9291,7 @@ const $n = new L("blocknote-placeholder"), qn = (e, t) => new x({
|
|
|
9266
9291
|
return K.create(o, [l]);
|
|
9267
9292
|
}
|
|
9268
9293
|
}
|
|
9269
|
-
}),
|
|
9294
|
+
}), et = new L("previous-blocks"), Jn = {
|
|
9270
9295
|
// Numbered List Items
|
|
9271
9296
|
index: "index",
|
|
9272
9297
|
// Headings
|
|
@@ -9275,17 +9300,17 @@ const $n = new L("blocknote-placeholder"), qn = (e, t) => new x({
|
|
|
9275
9300
|
type: "type",
|
|
9276
9301
|
depth: "depth",
|
|
9277
9302
|
"depth-change": "depth-change"
|
|
9278
|
-
},
|
|
9303
|
+
}, Yn = () => {
|
|
9279
9304
|
let e;
|
|
9280
9305
|
return new x({
|
|
9281
|
-
key:
|
|
9306
|
+
key: et,
|
|
9282
9307
|
view(t) {
|
|
9283
9308
|
return {
|
|
9284
9309
|
update: async (i, o) => {
|
|
9285
9310
|
var n;
|
|
9286
9311
|
((n = this.key) == null ? void 0 : n.getState(i.state).updatedBlocks.size) > 0 && (e = setTimeout(() => {
|
|
9287
9312
|
i.dispatch(
|
|
9288
|
-
i.state.tr.setMeta(
|
|
9313
|
+
i.state.tr.setMeta(et, { clearUpdate: !0 })
|
|
9289
9314
|
);
|
|
9290
9315
|
}, 0));
|
|
9291
9316
|
},
|
|
@@ -9308,9 +9333,9 @@ const $n = new L("blocknote-placeholder"), qn = (e, t) => new x({
|
|
|
9308
9333
|
apply(t, i, o, n) {
|
|
9309
9334
|
if (i.currentTransactionOldBlockAttrs = {}, i.updatedBlocks.clear(), !t.docChanged || o.doc.eq(n.doc))
|
|
9310
9335
|
return i;
|
|
9311
|
-
const r = {}, a =
|
|
9336
|
+
const r = {}, a = Re(o.doc, (d) => d.attrs.id), s = new Map(
|
|
9312
9337
|
a.map((d) => [d.node.attrs.id, d])
|
|
9313
|
-
), l =
|
|
9338
|
+
), l = Re(n.doc, (d) => d.attrs.id);
|
|
9314
9339
|
for (const d of l) {
|
|
9315
9340
|
const u = s.get(d.node.attrs.id), p = u == null ? void 0 : u.node.firstChild, h = d.node.firstChild;
|
|
9316
9341
|
if (u && p && h) {
|
|
@@ -9343,7 +9368,7 @@ const $n = new L("blocknote-placeholder"), qn = (e, t) => new x({
|
|
|
9343
9368
|
return;
|
|
9344
9369
|
const a = i.currentTransactionOldBlockAttrs[n.attrs.id], s = {};
|
|
9345
9370
|
for (const [d, u] of Object.entries(a))
|
|
9346
|
-
s["data-prev-" +
|
|
9371
|
+
s["data-prev-" + Jn[d]] = u || "none";
|
|
9347
9372
|
const l = $.node(r, r + n.nodeSize, {
|
|
9348
9373
|
...s
|
|
9349
9374
|
});
|
|
@@ -9352,12 +9377,12 @@ const $n = new L("blocknote-placeholder"), qn = (e, t) => new x({
|
|
|
9352
9377
|
}
|
|
9353
9378
|
}
|
|
9354
9379
|
});
|
|
9355
|
-
},
|
|
9380
|
+
}, Qn = {
|
|
9356
9381
|
enableInputRules: !0,
|
|
9357
9382
|
enablePasteRules: !0,
|
|
9358
9383
|
enableCoreExtensions: !1
|
|
9359
9384
|
};
|
|
9360
|
-
class
|
|
9385
|
+
class St {
|
|
9361
9386
|
constructor(t) {
|
|
9362
9387
|
c(this, "_pmSchema");
|
|
9363
9388
|
/**
|
|
@@ -9438,10 +9463,10 @@ class Ct {
|
|
|
9438
9463
|
throw new Error(
|
|
9439
9464
|
"editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false"
|
|
9440
9465
|
);
|
|
9441
|
-
this.dictionary = t.dictionary ||
|
|
9466
|
+
this.dictionary = t.dictionary || tt;
|
|
9442
9467
|
const o = {
|
|
9443
9468
|
defaultStyles: !0,
|
|
9444
|
-
schema: t.schema ||
|
|
9469
|
+
schema: t.schema || He.create(),
|
|
9445
9470
|
_headless: !1,
|
|
9446
9471
|
...t,
|
|
9447
9472
|
placeholders: {
|
|
@@ -9449,8 +9474,8 @@ class Ct {
|
|
|
9449
9474
|
...t.placeholders
|
|
9450
9475
|
}
|
|
9451
9476
|
};
|
|
9452
|
-
this.schema = o.schema, this.blockImplementations = o.schema.blockSpecs, this.inlineContentImplementations = o.schema.inlineContentSpecs, this.styleImplementations = o.schema.styleSpecs, this.formattingToolbar = new
|
|
9453
|
-
const n =
|
|
9477
|
+
this.schema = o.schema, this.blockImplementations = o.schema.blockSpecs, this.inlineContentImplementations = o.schema.inlineContentSpecs, this.styleImplementations = o.schema.styleSpecs, this.formattingToolbar = new hn(this), this.linkToolbar = new gn(this), this.sideMenu = new vn(this), this.suggestionMenus = new Cn(this), this.filePanel = new cn(this), T("table", this) && (this.tableHandles = new Ln(this));
|
|
9478
|
+
const n = Kn({
|
|
9454
9479
|
editor: this,
|
|
9455
9480
|
domAttributes: o.domAttributes || {},
|
|
9456
9481
|
blockSpecs: this.schema.blockSpecs,
|
|
@@ -9469,21 +9494,21 @@ class Ct {
|
|
|
9469
9494
|
this.suggestionMenus.plugin,
|
|
9470
9495
|
...this.filePanel ? [this.filePanel.plugin] : [],
|
|
9471
9496
|
...this.tableHandles ? [this.tableHandles.plugin] : [],
|
|
9472
|
-
|
|
9473
|
-
...this.options.animations ?? !0 ? [
|
|
9497
|
+
Zn(this, o.placeholders),
|
|
9498
|
+
...this.options.animations ?? !0 ? [Yn()] : []
|
|
9474
9499
|
]
|
|
9475
9500
|
});
|
|
9476
9501
|
if (n.push(r), o.uploadFile) {
|
|
9477
9502
|
const g = o.uploadFile;
|
|
9478
|
-
this.uploadFile = async (k,
|
|
9503
|
+
this.uploadFile = async (k, v) => {
|
|
9479
9504
|
this.onUploadStartCallbacks.forEach(
|
|
9480
|
-
(b) => b.apply(this, [
|
|
9505
|
+
(b) => b.apply(this, [v])
|
|
9481
9506
|
);
|
|
9482
9507
|
try {
|
|
9483
|
-
return await g(k,
|
|
9508
|
+
return await g(k, v);
|
|
9484
9509
|
} finally {
|
|
9485
9510
|
this.onUploadEndCallbacks.forEach(
|
|
9486
|
-
(b) => b.apply(this, [
|
|
9511
|
+
(b) => b.apply(this, [v])
|
|
9487
9512
|
);
|
|
9488
9513
|
}
|
|
9489
9514
|
};
|
|
@@ -9507,7 +9532,7 @@ class Ct {
|
|
|
9507
9532
|
"initialContent must be a non-empty array of blocks, received: " + a
|
|
9508
9533
|
);
|
|
9509
9534
|
const s = {
|
|
9510
|
-
...
|
|
9535
|
+
...Qn,
|
|
9511
9536
|
...o._tiptapOptions,
|
|
9512
9537
|
content: a,
|
|
9513
9538
|
extensions: [
|
|
@@ -9529,10 +9554,10 @@ class Ct {
|
|
|
9529
9554
|
((f = (m = o.domAttributes) == null ? void 0 : m.editor) == null ? void 0 : f.class) || ""
|
|
9530
9555
|
)
|
|
9531
9556
|
},
|
|
9532
|
-
transformPasted:
|
|
9557
|
+
transformPasted: qn
|
|
9533
9558
|
}
|
|
9534
9559
|
};
|
|
9535
|
-
this.headless ? this._pmSchema =
|
|
9560
|
+
this.headless ? this._pmSchema = Kt(s.extensions) : (this._tiptapEditor = le.create(
|
|
9536
9561
|
s,
|
|
9537
9562
|
this.schema.styleSchema
|
|
9538
9563
|
), this._pmSchema = this._tiptapEditor.schema);
|
|
@@ -9541,7 +9566,7 @@ class Ct {
|
|
|
9541
9566
|
return this._pmSchema;
|
|
9542
9567
|
}
|
|
9543
9568
|
static create(t = {}) {
|
|
9544
|
-
return new
|
|
9569
|
+
return new St(t);
|
|
9545
9570
|
}
|
|
9546
9571
|
dispatch(t) {
|
|
9547
9572
|
this._tiptapEditor.dispatch(t);
|
|
@@ -9685,7 +9710,7 @@ class Ct {
|
|
|
9685
9710
|
* @param placement Whether the text cursor should be placed at the start or end of the block.
|
|
9686
9711
|
*/
|
|
9687
9712
|
setTextCursorPosition(t, i = "start") {
|
|
9688
|
-
const o = typeof t == "string" ? t : t.id, { posBeforeNode: n } =
|
|
9713
|
+
const o = typeof t == "string" ? t : t.id, { posBeforeNode: n } = Ae(o, this._tiptapEditor.state.doc), { startPos: r, contentNode: a } = _(
|
|
9689
9714
|
this._tiptapEditor.state.doc,
|
|
9690
9715
|
n + 2
|
|
9691
9716
|
), s = this.schema.blockSchema[a.type.name].content;
|
|
@@ -9759,7 +9784,7 @@ class Ct {
|
|
|
9759
9784
|
* `referenceBlock`. Inserts the blocks at the start of the existing block's children if "nested" is used.
|
|
9760
9785
|
*/
|
|
9761
9786
|
insertBlocks(t, i, o = "before") {
|
|
9762
|
-
return
|
|
9787
|
+
return $o(t, i, o, this);
|
|
9763
9788
|
}
|
|
9764
9789
|
/**
|
|
9765
9790
|
* Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
|
|
@@ -9769,14 +9794,14 @@ class Ct {
|
|
|
9769
9794
|
* @param update A partial block which defines how the existing block should be changed.
|
|
9770
9795
|
*/
|
|
9771
9796
|
updateBlock(t, i) {
|
|
9772
|
-
return
|
|
9797
|
+
return qo(t, i, this);
|
|
9773
9798
|
}
|
|
9774
9799
|
/**
|
|
9775
9800
|
* Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
|
|
9776
9801
|
* @param blocksToRemove An array of identifiers for existing blocks that should be removed.
|
|
9777
9802
|
*/
|
|
9778
9803
|
removeBlocks(t) {
|
|
9779
|
-
return
|
|
9804
|
+
return Xo(t, this);
|
|
9780
9805
|
}
|
|
9781
9806
|
/**
|
|
9782
9807
|
* Replaces existing blocks in the editor with new blocks. If the blocks that should be removed are not adjacent or
|
|
@@ -9786,7 +9811,7 @@ class Ct {
|
|
|
9786
9811
|
* @param blocksToInsert An array of partial blocks to replace the old ones with.
|
|
9787
9812
|
*/
|
|
9788
9813
|
replaceBlocks(t, i) {
|
|
9789
|
-
return
|
|
9814
|
+
return Zo(t, i, this);
|
|
9790
9815
|
}
|
|
9791
9816
|
/**
|
|
9792
9817
|
* Insert a piece of content at the current cursor position.
|
|
@@ -9799,7 +9824,7 @@ class Ct {
|
|
|
9799
9824
|
this.pmSchema,
|
|
9800
9825
|
this.schema.styleSchema
|
|
9801
9826
|
);
|
|
9802
|
-
|
|
9827
|
+
Jo(
|
|
9803
9828
|
{
|
|
9804
9829
|
from: this._tiptapEditor.state.selection.from,
|
|
9805
9830
|
to: this._tiptapEditor.state.selection.to
|
|
@@ -9935,7 +9960,7 @@ class Ct {
|
|
|
9935
9960
|
* @returns The blocks, serialized as an HTML string.
|
|
9936
9961
|
*/
|
|
9937
9962
|
async blocksToHTMLLossy(t = this.document) {
|
|
9938
|
-
return await ie(),
|
|
9963
|
+
return await ie(), ue(this.pmSchema, this).exportBlocks(t, {});
|
|
9939
9964
|
}
|
|
9940
9965
|
/**
|
|
9941
9966
|
* Serializes blocks into an HTML string in the format that would normally be rendered by the editor.
|
|
@@ -9947,7 +9972,7 @@ class Ct {
|
|
|
9947
9972
|
* @returns The blocks, serialized as an HTML string.
|
|
9948
9973
|
*/
|
|
9949
9974
|
async blocksToFullHTML(t) {
|
|
9950
|
-
return
|
|
9975
|
+
return Be(this.pmSchema, this).serializeBlocks(t, {});
|
|
9951
9976
|
}
|
|
9952
9977
|
/**
|
|
9953
9978
|
* Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
|
|
@@ -9957,7 +9982,7 @@ class Ct {
|
|
|
9957
9982
|
* @returns The blocks parsed from the HTML string.
|
|
9958
9983
|
*/
|
|
9959
9984
|
async tryParseHTMLToBlocks(t) {
|
|
9960
|
-
return
|
|
9985
|
+
return vt(
|
|
9961
9986
|
t,
|
|
9962
9987
|
this.schema.blockSchema,
|
|
9963
9988
|
this.schema.inlineContentSchema,
|
|
@@ -9972,7 +9997,7 @@ class Ct {
|
|
|
9972
9997
|
* @returns The blocks, serialized as a Markdown string.
|
|
9973
9998
|
*/
|
|
9974
9999
|
async blocksToMarkdownLossy(t = this.document) {
|
|
9975
|
-
return
|
|
10000
|
+
return en(t, this.pmSchema, this, {});
|
|
9976
10001
|
}
|
|
9977
10002
|
/**
|
|
9978
10003
|
* Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
|
|
@@ -9982,7 +10007,7 @@ class Ct {
|
|
|
9982
10007
|
* @returns The blocks parsed from the Markdown string.
|
|
9983
10008
|
*/
|
|
9984
10009
|
async tryParseMarkdownToBlocks(t) {
|
|
9985
|
-
return
|
|
10010
|
+
return ln(
|
|
9986
10011
|
t,
|
|
9987
10012
|
this.schema.blockSchema,
|
|
9988
10013
|
this.schema.inlineContentSchema,
|
|
@@ -10043,22 +10068,22 @@ class Ct {
|
|
|
10043
10068
|
);
|
|
10044
10069
|
}
|
|
10045
10070
|
}
|
|
10046
|
-
let ae,
|
|
10047
|
-
async function
|
|
10048
|
-
if (!
|
|
10071
|
+
let ae, we;
|
|
10072
|
+
async function Vr(e, t) {
|
|
10073
|
+
if (!Go("text", e))
|
|
10049
10074
|
return [];
|
|
10050
10075
|
if (!ae) {
|
|
10051
|
-
ae = import("@emoji-mart/data"),
|
|
10076
|
+
ae = import("@emoji-mart/data"), we = await import("emoji-mart");
|
|
10052
10077
|
const n = (await ae).default;
|
|
10053
|
-
await
|
|
10078
|
+
await we.init({ data: n });
|
|
10054
10079
|
}
|
|
10055
10080
|
const i = (await ae).default;
|
|
10056
|
-
return (t.trim() === "" ? Object.values(i.emojis) : await
|
|
10081
|
+
return (t.trim() === "" ? Object.values(i.emojis) : await we.SearchIndex.search(t)).map((n) => ({
|
|
10057
10082
|
id: n.skins[0].native,
|
|
10058
10083
|
onItemClick: () => e.insertInlineContent(n.skins[0].native + " ")
|
|
10059
10084
|
}));
|
|
10060
10085
|
}
|
|
10061
|
-
function
|
|
10086
|
+
function er(e) {
|
|
10062
10087
|
let t = e.getTextCursorPosition().block, i = e.schema.blockSchema[t.type].content;
|
|
10063
10088
|
for (; i === "none"; )
|
|
10064
10089
|
t = e.getTextCursorPosition().nextBlock, i = e.schema.blockSchema[t.type].content, e.setTextCursorPosition(t, "end");
|
|
@@ -10072,9 +10097,9 @@ function M(e, t) {
|
|
|
10072
10097
|
"end"
|
|
10073
10098
|
));
|
|
10074
10099
|
const o = e.getTextCursorPosition().block;
|
|
10075
|
-
return
|
|
10100
|
+
return er(e), o;
|
|
10076
10101
|
}
|
|
10077
|
-
function
|
|
10102
|
+
function Or(e) {
|
|
10078
10103
|
const t = [];
|
|
10079
10104
|
return T("heading", e) && t.push(
|
|
10080
10105
|
{
|
|
@@ -10229,14 +10254,14 @@ function Rr(e) {
|
|
|
10229
10254
|
...e.dictionary.slash_menu.emoji
|
|
10230
10255
|
}), t;
|
|
10231
10256
|
}
|
|
10232
|
-
function
|
|
10257
|
+
function Fr(e, t) {
|
|
10233
10258
|
return e.filter(
|
|
10234
10259
|
({ title: i, aliases: o }) => i.toLowerCase().includes(t.toLowerCase()) || o && o.filter(
|
|
10235
10260
|
(n) => n.toLowerCase().includes(t.toLowerCase())
|
|
10236
10261
|
).length !== 0
|
|
10237
10262
|
);
|
|
10238
10263
|
}
|
|
10239
|
-
function
|
|
10264
|
+
function ve(e = "") {
|
|
10240
10265
|
return typeof e == "string" ? [
|
|
10241
10266
|
{
|
|
10242
10267
|
type: "text",
|
|
@@ -10245,22 +10270,22 @@ function ye(e = "") {
|
|
|
10245
10270
|
}
|
|
10246
10271
|
] : e;
|
|
10247
10272
|
}
|
|
10248
|
-
function
|
|
10249
|
-
return typeof e == "string" ?
|
|
10273
|
+
function Mt(e) {
|
|
10274
|
+
return typeof e == "string" ? ve(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? ve(t) : ot(t) ? {
|
|
10250
10275
|
...t,
|
|
10251
|
-
content:
|
|
10276
|
+
content: ve(t.content)
|
|
10252
10277
|
} : te(t) ? t : {
|
|
10253
10278
|
props: {},
|
|
10254
10279
|
...t,
|
|
10255
|
-
content:
|
|
10280
|
+
content: Mt(t.content)
|
|
10256
10281
|
}) : e;
|
|
10257
10282
|
}
|
|
10258
|
-
function
|
|
10283
|
+
function Gr(e, t) {
|
|
10259
10284
|
return t.map(
|
|
10260
|
-
(i) =>
|
|
10285
|
+
(i) => Tt(e, i)
|
|
10261
10286
|
);
|
|
10262
10287
|
}
|
|
10263
|
-
function
|
|
10288
|
+
function Tt(e, t) {
|
|
10264
10289
|
const i = {
|
|
10265
10290
|
id: "",
|
|
10266
10291
|
type: t.type,
|
|
@@ -10275,148 +10300,149 @@ function Mt(e, t) {
|
|
|
10275
10300
|
}
|
|
10276
10301
|
), {
|
|
10277
10302
|
...i,
|
|
10278
|
-
content:
|
|
10279
|
-
children: i.children.map((o) =>
|
|
10303
|
+
content: Mt(i.content),
|
|
10304
|
+
children: i.children.map((o) => Tt(e, o))
|
|
10280
10305
|
};
|
|
10281
10306
|
}
|
|
10282
|
-
function
|
|
10283
|
-
e.id || (e.id = oe.options.generateID()), e.children &&
|
|
10307
|
+
function tr(e) {
|
|
10308
|
+
e.id || (e.id = oe.options.generateID()), e.children && ir(e.children);
|
|
10284
10309
|
}
|
|
10285
|
-
function
|
|
10310
|
+
function ir(e) {
|
|
10286
10311
|
for (const t of e)
|
|
10287
|
-
|
|
10312
|
+
tr(t);
|
|
10288
10313
|
}
|
|
10289
10314
|
export {
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10315
|
+
Zi as AudioBlock,
|
|
10316
|
+
St as BlockNoteEditor,
|
|
10317
|
+
He as BlockNoteSchema,
|
|
10318
|
+
io as FileBlock,
|
|
10319
|
+
cn as FilePanelProsemirrorPlugin,
|
|
10320
|
+
dn as FilePanelView,
|
|
10321
|
+
hn as FormattingToolbarProsemirrorPlugin,
|
|
10322
|
+
un as FormattingToolbarView,
|
|
10323
|
+
vt as HTMLToBlocks,
|
|
10324
|
+
lo as ImageBlock,
|
|
10325
|
+
gn as LinkToolbarProsemirrorPlugin,
|
|
10326
|
+
vn as SideMenuProsemirrorPlugin,
|
|
10327
|
+
yn as SideMenuView,
|
|
10328
|
+
Cn as SuggestionMenuProseMirrorPlugin,
|
|
10329
|
+
Ln as TableHandlesProsemirrorPlugin,
|
|
10330
|
+
Bn as TableHandlesView,
|
|
10306
10331
|
oe as UniqueID,
|
|
10307
10332
|
P as UnreachableCaseError,
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
Ki as
|
|
10317
|
-
|
|
10318
|
-
Wi as
|
|
10319
|
-
$i as
|
|
10333
|
+
fo as VideoBlock,
|
|
10334
|
+
tr as addIdsToBlock,
|
|
10335
|
+
ir as addIdsToBlocks,
|
|
10336
|
+
We as addInlineContentAttributes,
|
|
10337
|
+
Di as addInlineContentKeyboardShortcuts,
|
|
10338
|
+
Oi as addStyleAttributes,
|
|
10339
|
+
Hi as applyNonSelectableBlockFix,
|
|
10340
|
+
Br as assertEmpty,
|
|
10341
|
+
Ki as audioBlockConfig,
|
|
10342
|
+
qi as audioParse,
|
|
10343
|
+
Wi as audioPropSchema,
|
|
10344
|
+
$i as audioRender,
|
|
10345
|
+
Xi as audioToExternalHTML,
|
|
10320
10346
|
U as blockToNode,
|
|
10321
|
-
|
|
10347
|
+
en as blocksToMarkdown,
|
|
10322
10348
|
se as camelToDataKebab,
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10349
|
+
zr as checkBlockHasDefaultProp,
|
|
10350
|
+
Wo as checkBlockIsDefaultType,
|
|
10351
|
+
Ur as checkBlockIsFileBlock,
|
|
10352
|
+
jr as checkBlockIsFileBlockWithPlaceholder,
|
|
10353
|
+
Dr as checkBlockIsFileBlockWithPreview,
|
|
10354
|
+
Ko as checkBlockTypeHasDefaultProp,
|
|
10329
10355
|
T as checkDefaultBlockTypeInSchema,
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10356
|
+
Go as checkDefaultInlineContentTypeInSchema,
|
|
10357
|
+
Ne as cleanHTMLToMarkdown,
|
|
10358
|
+
Te as contentNodeToInlineContent,
|
|
10359
|
+
Gi as createAddFileButton,
|
|
10360
|
+
pe as createBlockSpec,
|
|
10335
10361
|
X as createBlockSpecFromStronglyTypedTiptapNode,
|
|
10336
10362
|
O as createDefaultBlockDOMOutputSpec,
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10363
|
+
ft as createDefaultFilePreview,
|
|
10364
|
+
ue as createExternalHTMLExporter,
|
|
10365
|
+
Le as createFigureWithCaption,
|
|
10340
10366
|
ne as createFileAndCaptionWrapper,
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
|
|
10367
|
+
he as createFileBlockWrapper,
|
|
10368
|
+
Ar as createInlineContentSpec,
|
|
10369
|
+
zi as createInlineContentSpecFromTipTapNode,
|
|
10370
|
+
ct as createInternalBlockSpec,
|
|
10371
|
+
Be as createInternalHTMLSerializer,
|
|
10372
|
+
ji as createInternalInlineContentSpec,
|
|
10373
|
+
ht as createInternalStyleSpec,
|
|
10374
|
+
fe as createLinkWithCaption,
|
|
10375
|
+
gt as createResizeHandlesWrapper,
|
|
10350
10376
|
F as createStronglyTypedTiptapNode,
|
|
10351
|
-
|
|
10377
|
+
Nr as createStyleSpec,
|
|
10352
10378
|
j as createStyleSpecFromTipTapMark,
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10379
|
+
Rr as createSuggestionMenu,
|
|
10380
|
+
Oo as defaultBlockSchema,
|
|
10381
|
+
bt as defaultBlockSpecs,
|
|
10382
|
+
Ge as defaultBlockToHTML,
|
|
10383
|
+
Fo as defaultInlineContentSchema,
|
|
10384
|
+
kt as defaultInlineContentSpecs,
|
|
10385
|
+
w as defaultProps,
|
|
10386
|
+
Hr as defaultStyleSchema,
|
|
10387
|
+
_t as defaultStyleSpecs,
|
|
10362
10388
|
H as esmDependencies,
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
|
|
10389
|
+
Yi as fileBlockConfig,
|
|
10390
|
+
eo as fileParse,
|
|
10391
|
+
Ji as filePropSchema,
|
|
10392
|
+
Qi as fileRender,
|
|
10393
|
+
to as fileToExternalHTML,
|
|
10394
|
+
Ir as filenameFromURL,
|
|
10395
|
+
Fr as filterSuggestionItems,
|
|
10370
10396
|
D as formatKeyboardShortcut,
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10397
|
+
pn as formattingToolbarPluginKey,
|
|
10398
|
+
Pi as getBlockFromPos,
|
|
10399
|
+
Kn as getBlockNoteExtensions,
|
|
10400
|
+
ut as getBlockSchemaFromSpecs,
|
|
10375
10401
|
B as getCurrentBlockContentType,
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10402
|
+
Vr as getDefaultEmojiPickerItems,
|
|
10403
|
+
Or as getDefaultSlashMenuItems,
|
|
10404
|
+
ge as getDraggableBlockFromElement,
|
|
10405
|
+
Ri as getInlineContentParseRules,
|
|
10406
|
+
pt as getInlineContentSchemaFromSpecs,
|
|
10407
|
+
Ui as getParseRules,
|
|
10408
|
+
Fi as getStyleParseRules,
|
|
10409
|
+
mt as getStyleSchemaFromSpecs,
|
|
10410
|
+
no as imageBlockConfig,
|
|
10411
|
+
ao as imageParse,
|
|
10412
|
+
oo as imagePropSchema,
|
|
10413
|
+
ro as imageRender,
|
|
10414
|
+
so as imageToExternalHTML,
|
|
10415
|
+
lt as inheritedProps,
|
|
10390
10416
|
ie as initializeESMDependencies,
|
|
10391
10417
|
R as inlineContentToNodes,
|
|
10392
10418
|
M as insertOrUpdateBlock,
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10419
|
+
Ni as isAppleOS,
|
|
10420
|
+
Ve as isLinkInlineContent,
|
|
10421
|
+
ot as isPartialLinkInlineContent,
|
|
10422
|
+
Lr as isSafari,
|
|
10397
10423
|
te as isStyledTextInlineContent,
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10424
|
+
fn as linkToolbarPluginKey,
|
|
10425
|
+
Tr as locales,
|
|
10426
|
+
ln as markdownToBlocks,
|
|
10401
10427
|
V as mergeCSSClasses,
|
|
10402
10428
|
C as nodeToBlock,
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
|
|
10429
|
+
Ce as nodeToCustomInlineContent,
|
|
10430
|
+
Ke as parseEmbedElement,
|
|
10431
|
+
me as parseFigureElement,
|
|
10432
|
+
qe as parseImageElement,
|
|
10433
|
+
Tt as partialBlockToBlockForTesting,
|
|
10434
|
+
Gr as partialBlocksToBlocksForTesting,
|
|
10435
|
+
dt as propsToAttributes,
|
|
10436
|
+
wn as sideMenuPluginKey,
|
|
10437
|
+
Vi as stylePropsToAttributes,
|
|
10438
|
+
nt as tableContentToNodes,
|
|
10413
10439
|
Q as tableHandlesPluginKey,
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10440
|
+
Pr as uploadToTmpFilesDotOrg_DEV_ONLY,
|
|
10441
|
+
uo as videoBlockConfig,
|
|
10442
|
+
ho as videoParse,
|
|
10443
|
+
co as videoPropSchema,
|
|
10444
|
+
po as videoRender,
|
|
10445
|
+
mo as videoToExternalHTML,
|
|
10446
|
+
_e as wrapInBlockStructure
|
|
10421
10447
|
};
|
|
10422
10448
|
//# sourceMappingURL=blocknote.js.map
|