@blocknote/core 0.15.10 → 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 +713 -695
- 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 +4 -8
- 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/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",
|
|
@@ -2747,7 +2747,7 @@ const hi = {
|
|
|
2747
2747
|
generic: {
|
|
2748
2748
|
ctrl_shortcut: "Ctrl"
|
|
2749
2749
|
}
|
|
2750
|
-
},
|
|
2750
|
+
}, vi = {
|
|
2751
2751
|
slash_menu: {
|
|
2752
2752
|
heading: {
|
|
2753
2753
|
title: "Nagłówek 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:
|
|
4321
|
-
pl:
|
|
4322
|
-
pt:
|
|
4323
|
-
ru:
|
|
4324
|
-
vi:
|
|
4325
|
-
zh:
|
|
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
|
+
pl: vi,
|
|
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), v =
|
|
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 Ve(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
|
-
function
|
|
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 = [];
|
|
@@ -4679,7 +4679,7 @@ function it(e, t, i) {
|
|
|
4679
4679
|
else if (typeof s == "string")
|
|
4680
4680
|
l = t.nodes.tableParagraph.create({}, t.text(s));
|
|
4681
4681
|
else {
|
|
4682
|
-
const u =
|
|
4682
|
+
const u = R(s, t, i);
|
|
4683
4683
|
l = t.nodes.tableParagraph.create({}, u);
|
|
4684
4684
|
}
|
|
4685
4685
|
const d = t.nodes.tableCell.create({}, l);
|
|
@@ -4690,20 +4690,20 @@ 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`);
|
|
4697
4697
|
if (!e.content)
|
|
4698
4698
|
o = t.nodes[n].create(e.props);
|
|
4699
4699
|
else if (typeof e.content == "string") {
|
|
4700
|
-
const r =
|
|
4700
|
+
const r = R([e.content], t, i);
|
|
4701
4701
|
o = t.nodes[n].create(e.props, r);
|
|
4702
4702
|
} else if (Array.isArray(e.content)) {
|
|
4703
|
-
const r =
|
|
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 Re(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(
|
|
@@ -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,24 +5107,24 @@ 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
|
-
function
|
|
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
|
-
n.className =
|
|
5120
|
+
n.className = V(
|
|
5121
5121
|
"bn-block-content",
|
|
5122
5122
|
i.class
|
|
5123
5123
|
), n.setAttribute("data-content-type", e);
|
|
5124
5124
|
for (const [a, s] of Object.entries(i))
|
|
5125
5125
|
a !== "class" && n.setAttribute(a, s);
|
|
5126
5126
|
const r = document.createElement(t);
|
|
5127
|
-
r.className =
|
|
5127
|
+
r.className = V(
|
|
5128
5128
|
"bn-inline-content",
|
|
5129
5129
|
o.class
|
|
5130
5130
|
);
|
|
@@ -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(
|
|
@@ -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,18 +5209,18 @@ 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))
|
|
5216
5216
|
s !== "class" && a.setAttribute(s, l);
|
|
5217
|
-
a.className =
|
|
5217
|
+
a.className = V(
|
|
5218
5218
|
"bn-block-content",
|
|
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
|
-
!
|
|
5223
|
-
return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className =
|
|
5222
|
+
!lt.includes(s) && l !== o[s].default && a.setAttribute(se(s), l);
|
|
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
|
|
5226
5226
|
), e.contentDOM.setAttribute("data-editable", "")), {
|
|
@@ -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,23 +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
|
|
5262
|
-
e.stopEvent = (i) => i.type === "
|
|
5261
|
+
function Hi(e, t) {
|
|
5262
|
+
e.stopEvent = (i) => (i.type === "mousedown" && setTimeout(() => {
|
|
5263
5263
|
t.view.dom.blur();
|
|
5264
|
-
}, 10), !0)
|
|
5264
|
+
}, 10), !0);
|
|
5265
5265
|
}
|
|
5266
|
-
function
|
|
5266
|
+
function Ui(e, t) {
|
|
5267
5267
|
const i = [
|
|
5268
5268
|
{
|
|
5269
5269
|
tag: "[data-content-type=" + e.type + "]",
|
|
@@ -5280,17 +5280,17 @@ function Hi(e, t) {
|
|
|
5280
5280
|
}
|
|
5281
5281
|
}), i;
|
|
5282
5282
|
}
|
|
5283
|
-
function
|
|
5283
|
+
function pe(e, t) {
|
|
5284
5284
|
const i = F({
|
|
5285
5285
|
name: e.type,
|
|
5286
5286
|
content: e.content === "inline" ? "inline*" : "",
|
|
5287
5287
|
group: "blockContent",
|
|
5288
5288
|
selectable: e.isSelectable ?? !0,
|
|
5289
5289
|
addAttributes() {
|
|
5290
|
-
return
|
|
5290
|
+
return dt(e.propSchema);
|
|
5291
5291
|
},
|
|
5292
5292
|
parseHTML() {
|
|
5293
|
-
return
|
|
5293
|
+
return Ui(e, t.parse);
|
|
5294
5294
|
},
|
|
5295
5295
|
renderHTML() {
|
|
5296
5296
|
const o = document.createElement("div");
|
|
@@ -5301,19 +5301,19 @@ function ce(e, t) {
|
|
|
5301
5301
|
addNodeView() {
|
|
5302
5302
|
return ({ getPos: o }) => {
|
|
5303
5303
|
var d;
|
|
5304
|
-
const n = this.options.editor, r =
|
|
5304
|
+
const n = this.options.editor, r = Pi(
|
|
5305
5305
|
o,
|
|
5306
5306
|
n,
|
|
5307
5307
|
this.editor,
|
|
5308
5308
|
e.type
|
|
5309
|
-
), a = ((d = this.options.domAttributes) == null ? void 0 : d.blockContent) || {}, s = t.render(r, n), l =
|
|
5309
|
+
), a = ((d = this.options.domAttributes) == null ? void 0 : d.blockContent) || {}, s = t.render(r, n), l = _e(
|
|
5310
5310
|
s,
|
|
5311
5311
|
r.type,
|
|
5312
5312
|
r.props,
|
|
5313
5313
|
e.propSchema,
|
|
5314
5314
|
a
|
|
5315
5315
|
);
|
|
5316
|
-
return e.isSelectable === !1 &&
|
|
5316
|
+
return e.isSelectable === !1 && Hi(l, this.editor), l;
|
|
5317
5317
|
};
|
|
5318
5318
|
}
|
|
5319
5319
|
});
|
|
@@ -5321,12 +5321,12 @@ function ce(e, t) {
|
|
|
5321
5321
|
throw new Error(
|
|
5322
5322
|
"Node name does not match block type. This is a bug in BlockNote."
|
|
5323
5323
|
);
|
|
5324
|
-
return
|
|
5324
|
+
return ct(e, {
|
|
5325
5325
|
node: i,
|
|
5326
5326
|
toInternalHTML: (o, n) => {
|
|
5327
5327
|
var s;
|
|
5328
5328
|
const r = ((s = i.options.domAttributes) == null ? void 0 : s.blockContent) || {}, a = t.render(o, n);
|
|
5329
|
-
return
|
|
5329
|
+
return _e(
|
|
5330
5330
|
a,
|
|
5331
5331
|
o.type,
|
|
5332
5332
|
o.props,
|
|
@@ -5343,7 +5343,7 @@ function ce(e, t) {
|
|
|
5343
5343
|
o,
|
|
5344
5344
|
n
|
|
5345
5345
|
);
|
|
5346
|
-
return a === void 0 && (a = t.render(o, n)),
|
|
5346
|
+
return a === void 0 && (a = t.render(o, n)), _e(
|
|
5347
5347
|
a,
|
|
5348
5348
|
o.type,
|
|
5349
5349
|
o.props,
|
|
@@ -5353,10 +5353,10 @@ function ce(e, t) {
|
|
|
5353
5353
|
}
|
|
5354
5354
|
});
|
|
5355
5355
|
}
|
|
5356
|
-
function
|
|
5356
|
+
function We(e, t, i, o) {
|
|
5357
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;
|
|
5358
5358
|
}
|
|
5359
|
-
function
|
|
5359
|
+
function Di(e) {
|
|
5360
5360
|
return {
|
|
5361
5361
|
Backspace: ({ editor: t }) => {
|
|
5362
5362
|
const i = t.state.selection.$from;
|
|
@@ -5364,14 +5364,14 @@ function Ui(e) {
|
|
|
5364
5364
|
}
|
|
5365
5365
|
};
|
|
5366
5366
|
}
|
|
5367
|
-
function
|
|
5367
|
+
function ji(e, t) {
|
|
5368
5368
|
return {
|
|
5369
5369
|
config: e,
|
|
5370
5370
|
implementation: t
|
|
5371
5371
|
};
|
|
5372
5372
|
}
|
|
5373
|
-
function
|
|
5374
|
-
return
|
|
5373
|
+
function zi(e, t) {
|
|
5374
|
+
return ji(
|
|
5375
5375
|
{
|
|
5376
5376
|
type: e.name,
|
|
5377
5377
|
propSchema: t,
|
|
@@ -5382,12 +5382,12 @@ function ji(e, t) {
|
|
|
5382
5382
|
}
|
|
5383
5383
|
);
|
|
5384
5384
|
}
|
|
5385
|
-
function
|
|
5385
|
+
function pt(e) {
|
|
5386
5386
|
return Object.fromEntries(
|
|
5387
5387
|
Object.entries(e).map(([t, i]) => [t, i.config])
|
|
5388
5388
|
);
|
|
5389
5389
|
}
|
|
5390
|
-
function
|
|
5390
|
+
function Ri(e) {
|
|
5391
5391
|
return [
|
|
5392
5392
|
{
|
|
5393
5393
|
tag: `[data-inline-content-type="${e.type}"]`,
|
|
@@ -5398,7 +5398,7 @@ function zi(e) {
|
|
|
5398
5398
|
}
|
|
5399
5399
|
];
|
|
5400
5400
|
}
|
|
5401
|
-
function
|
|
5401
|
+
function Ar(e, t) {
|
|
5402
5402
|
const i = q.create({
|
|
5403
5403
|
name: e.type,
|
|
5404
5404
|
inline: !0,
|
|
@@ -5407,17 +5407,17 @@ function Ir(e, t) {
|
|
|
5407
5407
|
atom: e.content === "none",
|
|
5408
5408
|
content: e.content === "styled" ? "inline*" : "",
|
|
5409
5409
|
addAttributes() {
|
|
5410
|
-
return
|
|
5410
|
+
return dt(e.propSchema);
|
|
5411
5411
|
},
|
|
5412
5412
|
addKeyboardShortcuts() {
|
|
5413
|
-
return
|
|
5413
|
+
return Di(e);
|
|
5414
5414
|
},
|
|
5415
5415
|
parseHTML() {
|
|
5416
|
-
return
|
|
5416
|
+
return Ri(e);
|
|
5417
5417
|
},
|
|
5418
5418
|
renderHTML({ node: o }) {
|
|
5419
5419
|
const n = this.options.editor, r = t.render(
|
|
5420
|
-
|
|
5420
|
+
Ce(
|
|
5421
5421
|
o,
|
|
5422
5422
|
n.schema.inlineContentSchema,
|
|
5423
5423
|
n.schema.styleSchema
|
|
@@ -5427,7 +5427,7 @@ function Ir(e, t) {
|
|
|
5427
5427
|
},
|
|
5428
5428
|
n
|
|
5429
5429
|
);
|
|
5430
|
-
return
|
|
5430
|
+
return We(
|
|
5431
5431
|
r,
|
|
5432
5432
|
e.type,
|
|
5433
5433
|
o.attrs,
|
|
@@ -5437,7 +5437,7 @@ function Ir(e, t) {
|
|
|
5437
5437
|
addNodeView() {
|
|
5438
5438
|
return ({ node: o, getPos: n }) => {
|
|
5439
5439
|
const r = this.options.editor, a = t.render(
|
|
5440
|
-
|
|
5440
|
+
Ce(
|
|
5441
5441
|
o,
|
|
5442
5442
|
r.schema.inlineContentSchema,
|
|
5443
5443
|
r.schema.styleSchema
|
|
@@ -5446,7 +5446,7 @@ function Ir(e, t) {
|
|
|
5446
5446
|
(s) => {
|
|
5447
5447
|
if (typeof n == "boolean")
|
|
5448
5448
|
return;
|
|
5449
|
-
const l =
|
|
5449
|
+
const l = R(
|
|
5450
5450
|
[s],
|
|
5451
5451
|
r._tiptapEditor.schema,
|
|
5452
5452
|
r.schema.styleSchema
|
|
@@ -5461,7 +5461,7 @@ function Ir(e, t) {
|
|
|
5461
5461
|
},
|
|
5462
5462
|
r
|
|
5463
5463
|
);
|
|
5464
|
-
return
|
|
5464
|
+
return We(
|
|
5465
5465
|
a,
|
|
5466
5466
|
e.type,
|
|
5467
5467
|
o.attrs,
|
|
@@ -5470,7 +5470,7 @@ function Ir(e, t) {
|
|
|
5470
5470
|
};
|
|
5471
5471
|
}
|
|
5472
5472
|
});
|
|
5473
|
-
return
|
|
5473
|
+
return zi(
|
|
5474
5474
|
i,
|
|
5475
5475
|
e.propSchema
|
|
5476
5476
|
);
|
|
@@ -5487,17 +5487,17 @@ function Vi(e) {
|
|
|
5487
5487
|
}
|
|
5488
5488
|
};
|
|
5489
5489
|
}
|
|
5490
|
-
function
|
|
5490
|
+
function Oi(e, t, i, o) {
|
|
5491
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;
|
|
5492
5492
|
}
|
|
5493
|
-
function
|
|
5493
|
+
function ht(e, t) {
|
|
5494
5494
|
return {
|
|
5495
5495
|
config: e,
|
|
5496
5496
|
implementation: t
|
|
5497
5497
|
};
|
|
5498
5498
|
}
|
|
5499
5499
|
function j(e, t) {
|
|
5500
|
-
return
|
|
5500
|
+
return ht(
|
|
5501
5501
|
{
|
|
5502
5502
|
type: e.name,
|
|
5503
5503
|
propSchema: t
|
|
@@ -5507,12 +5507,12 @@ function j(e, t) {
|
|
|
5507
5507
|
}
|
|
5508
5508
|
);
|
|
5509
5509
|
}
|
|
5510
|
-
function
|
|
5510
|
+
function mt(e) {
|
|
5511
5511
|
return Object.fromEntries(
|
|
5512
5512
|
Object.entries(e).map(([t, i]) => [t, i.config])
|
|
5513
5513
|
);
|
|
5514
5514
|
}
|
|
5515
|
-
function
|
|
5515
|
+
function Fi(e) {
|
|
5516
5516
|
return [
|
|
5517
5517
|
{
|
|
5518
5518
|
tag: `[data-style-type="${e.type}"]`,
|
|
@@ -5523,14 +5523,14 @@ function Oi(e) {
|
|
|
5523
5523
|
}
|
|
5524
5524
|
];
|
|
5525
5525
|
}
|
|
5526
|
-
function
|
|
5527
|
-
const i =
|
|
5526
|
+
function Nr(e, t) {
|
|
5527
|
+
const i = Me.create({
|
|
5528
5528
|
name: e.type,
|
|
5529
5529
|
addAttributes() {
|
|
5530
5530
|
return Vi(e.propSchema);
|
|
5531
5531
|
},
|
|
5532
5532
|
parseHTML() {
|
|
5533
|
-
return
|
|
5533
|
+
return Fi(e);
|
|
5534
5534
|
},
|
|
5535
5535
|
renderHTML({ mark: o }) {
|
|
5536
5536
|
let n;
|
|
@@ -5540,7 +5540,7 @@ function Ar(e, t) {
|
|
|
5540
5540
|
n = t.render(o.attrs.stringValue);
|
|
5541
5541
|
else
|
|
5542
5542
|
throw new P(e.propSchema);
|
|
5543
|
-
return
|
|
5543
|
+
return Oi(
|
|
5544
5544
|
n,
|
|
5545
5545
|
e.type,
|
|
5546
5546
|
o.attrs.stringValue,
|
|
@@ -5548,14 +5548,14 @@ function Ar(e, t) {
|
|
|
5548
5548
|
);
|
|
5549
5549
|
}
|
|
5550
5550
|
});
|
|
5551
|
-
return
|
|
5551
|
+
return ht(e, {
|
|
5552
5552
|
mark: i
|
|
5553
5553
|
});
|
|
5554
5554
|
}
|
|
5555
|
-
const
|
|
5555
|
+
const he = (e, t, i, o, n) => {
|
|
5556
5556
|
const r = document.createElement("div");
|
|
5557
5557
|
if (r.className = "bn-file-block-content-wrapper", e.props.url === "") {
|
|
5558
|
-
const a =
|
|
5558
|
+
const a = Gi(
|
|
5559
5559
|
e,
|
|
5560
5560
|
t,
|
|
5561
5561
|
o,
|
|
@@ -5577,7 +5577,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
5577
5577
|
}
|
|
5578
5578
|
};
|
|
5579
5579
|
} else if (e.props.showPreview === !1) {
|
|
5580
|
-
const a =
|
|
5580
|
+
const a = ft(e).dom;
|
|
5581
5581
|
return {
|
|
5582
5582
|
dom: ne(e, a).dom
|
|
5583
5583
|
};
|
|
@@ -5586,7 +5586,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
5586
5586
|
dom: r,
|
|
5587
5587
|
destroy: i.destroy
|
|
5588
5588
|
};
|
|
5589
|
-
},
|
|
5589
|
+
}, ft = (e) => {
|
|
5590
5590
|
const t = document.createElement("div");
|
|
5591
5591
|
t.className = "bn-file-default-preview";
|
|
5592
5592
|
const i = document.createElement("div");
|
|
@@ -5602,7 +5602,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
5602
5602
|
return o.className = "bn-file-caption", o.textContent = e.props.caption, i.appendChild(t), i.appendChild(o), {
|
|
5603
5603
|
dom: i
|
|
5604
5604
|
};
|
|
5605
|
-
},
|
|
5605
|
+
}, Gi = (e, t, i, o) => {
|
|
5606
5606
|
const n = document.createElement("div");
|
|
5607
5607
|
n.className = "bn-add-file-button";
|
|
5608
5608
|
const r = document.createElement("div");
|
|
@@ -5636,7 +5636,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
5636
5636
|
);
|
|
5637
5637
|
}
|
|
5638
5638
|
};
|
|
5639
|
-
},
|
|
5639
|
+
}, Ke = (e) => ({ url: e.src || void 0 }), me = (e, t) => {
|
|
5640
5640
|
const i = e.querySelector(
|
|
5641
5641
|
t
|
|
5642
5642
|
);
|
|
@@ -5644,15 +5644,15 @@ const ue = (e, t, i, o, n) => {
|
|
|
5644
5644
|
return;
|
|
5645
5645
|
const o = e.querySelector("figcaption"), n = (o == null ? void 0 : o.textContent) ?? void 0;
|
|
5646
5646
|
return { targetElement: i, caption: n };
|
|
5647
|
-
},
|
|
5647
|
+
}, fe = (e, t) => {
|
|
5648
5648
|
const i = document.createElement("div"), o = document.createElement("p");
|
|
5649
5649
|
return o.textContent = t, i.appendChild(e), i.appendChild(o), {
|
|
5650
5650
|
dom: i
|
|
5651
5651
|
};
|
|
5652
|
-
},
|
|
5652
|
+
}, Le = (e, t) => {
|
|
5653
5653
|
const i = document.createElement("figure"), o = document.createElement("figcaption");
|
|
5654
5654
|
return o.textContent = t, i.appendChild(e), i.appendChild(o), { dom: i };
|
|
5655
|
-
},
|
|
5655
|
+
}, gt = (e, t, i, o, n) => {
|
|
5656
5656
|
if (!e.props.previewWidth)
|
|
5657
5657
|
throw new Error("Block must have a `previewWidth` prop.");
|
|
5658
5658
|
const r = document.createElement("div");
|
|
@@ -5712,7 +5712,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
5712
5712
|
);
|
|
5713
5713
|
}
|
|
5714
5714
|
};
|
|
5715
|
-
},
|
|
5715
|
+
}, $e = (e) => ({ url: e.src || void 0 }), Wi = {
|
|
5716
5716
|
backgroundColor: w.backgroundColor,
|
|
5717
5717
|
// File name.
|
|
5718
5718
|
name: {
|
|
@@ -5729,13 +5729,13 @@ const ue = (e, t, i, o, n) => {
|
|
|
5729
5729
|
showPreview: {
|
|
5730
5730
|
default: !0
|
|
5731
5731
|
}
|
|
5732
|
-
},
|
|
5732
|
+
}, Ki = {
|
|
5733
5733
|
type: "audio",
|
|
5734
|
-
propSchema:
|
|
5734
|
+
propSchema: Wi,
|
|
5735
5735
|
content: "none",
|
|
5736
5736
|
isFileBlock: !0,
|
|
5737
5737
|
fileBlockAccept: ["audio/*"]
|
|
5738
|
-
},
|
|
5738
|
+
}, $i = (e, t) => {
|
|
5739
5739
|
const i = document.createElement("div");
|
|
5740
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>';
|
|
5741
5741
|
const o = document.createElement("audio");
|
|
@@ -5743,27 +5743,27 @@ const ue = (e, t, i, o, n) => {
|
|
|
5743
5743
|
o.src = r;
|
|
5744
5744
|
}), o.controls = !0, o.contentEditable = "false", o.draggable = !1;
|
|
5745
5745
|
const n = ne(e, o);
|
|
5746
|
-
return
|
|
5746
|
+
return he(
|
|
5747
5747
|
e,
|
|
5748
5748
|
t,
|
|
5749
5749
|
n,
|
|
5750
5750
|
t.dictionary.file_blocks.audio.add_button_text,
|
|
5751
5751
|
i.firstElementChild
|
|
5752
5752
|
);
|
|
5753
|
-
},
|
|
5753
|
+
}, qi = (e) => {
|
|
5754
5754
|
if (e.tagName === "AUDIO")
|
|
5755
|
-
return
|
|
5755
|
+
return $e(e);
|
|
5756
5756
|
if (e.tagName === "FIGURE") {
|
|
5757
|
-
const t =
|
|
5757
|
+
const t = me(e, "audio");
|
|
5758
5758
|
if (!t)
|
|
5759
5759
|
return;
|
|
5760
5760
|
const { targetElement: i, caption: o } = t;
|
|
5761
5761
|
return {
|
|
5762
|
-
|
|
5762
|
+
...$e(i),
|
|
5763
5763
|
caption: o
|
|
5764
5764
|
};
|
|
5765
5765
|
}
|
|
5766
|
-
},
|
|
5766
|
+
}, Xi = (e) => {
|
|
5767
5767
|
if (!e.props.url) {
|
|
5768
5768
|
const i = document.createElement("p");
|
|
5769
5769
|
return i.textContent = "Add audio", {
|
|
@@ -5771,14 +5771,14 @@ const ue = (e, t, i, o, n) => {
|
|
|
5771
5771
|
};
|
|
5772
5772
|
}
|
|
5773
5773
|
let t;
|
|
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 ?
|
|
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) : {
|
|
5775
5775
|
dom: t
|
|
5776
5776
|
};
|
|
5777
|
-
},
|
|
5778
|
-
render:
|
|
5779
|
-
parse:
|
|
5780
|
-
toExternalHTML:
|
|
5781
|
-
}),
|
|
5777
|
+
}, Zi = pe(Ki, {
|
|
5778
|
+
render: $i,
|
|
5779
|
+
parse: qi,
|
|
5780
|
+
toExternalHTML: Xi
|
|
5781
|
+
}), Ji = {
|
|
5782
5782
|
backgroundColor: w.backgroundColor,
|
|
5783
5783
|
// File name.
|
|
5784
5784
|
name: {
|
|
@@ -5792,28 +5792,28 @@ const ue = (e, t, i, o, n) => {
|
|
|
5792
5792
|
caption: {
|
|
5793
5793
|
default: ""
|
|
5794
5794
|
}
|
|
5795
|
-
},
|
|
5795
|
+
}, Yi = {
|
|
5796
5796
|
type: "file",
|
|
5797
|
-
propSchema:
|
|
5797
|
+
propSchema: Ji,
|
|
5798
5798
|
content: "none",
|
|
5799
5799
|
isFileBlock: !0
|
|
5800
|
-
},
|
|
5801
|
-
const i =
|
|
5802
|
-
return
|
|
5803
|
-
},
|
|
5800
|
+
}, Qi = (e, t) => {
|
|
5801
|
+
const i = ft(e).dom, o = ne(e, i);
|
|
5802
|
+
return he(e, t, o);
|
|
5803
|
+
}, eo = (e) => {
|
|
5804
5804
|
if (e.tagName === "EMBED")
|
|
5805
|
-
return
|
|
5805
|
+
return Ke(e);
|
|
5806
5806
|
if (e.tagName === "FIGURE") {
|
|
5807
|
-
const t =
|
|
5807
|
+
const t = me(e, "embed");
|
|
5808
5808
|
if (!t)
|
|
5809
5809
|
return;
|
|
5810
5810
|
const { targetElement: i, caption: o } = t;
|
|
5811
5811
|
return {
|
|
5812
|
-
...
|
|
5812
|
+
...Ke(i),
|
|
5813
5813
|
caption: o
|
|
5814
5814
|
};
|
|
5815
5815
|
}
|
|
5816
|
-
},
|
|
5816
|
+
}, to = (e) => {
|
|
5817
5817
|
if (!e.props.url) {
|
|
5818
5818
|
const i = document.createElement("p");
|
|
5819
5819
|
return i.textContent = "Add file", {
|
|
@@ -5821,14 +5821,14 @@ const ue = (e, t, i, o, n) => {
|
|
|
5821
5821
|
};
|
|
5822
5822
|
}
|
|
5823
5823
|
const t = document.createElement("a");
|
|
5824
|
-
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) : {
|
|
5825
5825
|
dom: t
|
|
5826
5826
|
};
|
|
5827
|
-
},
|
|
5828
|
-
render:
|
|
5829
|
-
parse:
|
|
5830
|
-
toExternalHTML:
|
|
5831
|
-
}),
|
|
5827
|
+
}, io = pe(Yi, {
|
|
5828
|
+
render: Qi,
|
|
5829
|
+
parse: eo,
|
|
5830
|
+
toExternalHTML: to
|
|
5831
|
+
}), Pr = async (e) => {
|
|
5832
5832
|
const t = new FormData();
|
|
5833
5833
|
return t.append("file", e), (await (await fetch("https://tmpfiles.org/api/v1/upload", {
|
|
5834
5834
|
method: "POST",
|
|
@@ -5837,10 +5837,10 @@ const ue = (e, t, i, o, n) => {
|
|
|
5837
5837
|
"tmpfiles.org/",
|
|
5838
5838
|
"tmpfiles.org/dl/"
|
|
5839
5839
|
);
|
|
5840
|
-
},
|
|
5840
|
+
}, qe = (e) => {
|
|
5841
5841
|
const t = e.src || void 0, i = e.width || void 0;
|
|
5842
5842
|
return { url: t, previewWidth: i };
|
|
5843
|
-
},
|
|
5843
|
+
}, oo = {
|
|
5844
5844
|
textAlignment: w.textAlignment,
|
|
5845
5845
|
backgroundColor: w.backgroundColor,
|
|
5846
5846
|
// File name.
|
|
@@ -5862,13 +5862,13 @@ const ue = (e, t, i, o, n) => {
|
|
|
5862
5862
|
previewWidth: {
|
|
5863
5863
|
default: 512
|
|
5864
5864
|
}
|
|
5865
|
-
},
|
|
5865
|
+
}, no = {
|
|
5866
5866
|
type: "image",
|
|
5867
|
-
propSchema:
|
|
5867
|
+
propSchema: oo,
|
|
5868
5868
|
content: "none",
|
|
5869
5869
|
isFileBlock: !0,
|
|
5870
5870
|
fileBlockAccept: ["image/*"]
|
|
5871
|
-
},
|
|
5871
|
+
}, ro = (e, t) => {
|
|
5872
5872
|
const i = document.createElement("div");
|
|
5873
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>';
|
|
5874
5874
|
const o = document.createElement("img");
|
|
@@ -5878,34 +5878,34 @@ const ue = (e, t, i, o, n) => {
|
|
|
5878
5878
|
e.props.previewWidth,
|
|
5879
5879
|
t.domElement.firstElementChild.clientWidth
|
|
5880
5880
|
);
|
|
5881
|
-
const n =
|
|
5881
|
+
const n = gt(
|
|
5882
5882
|
e,
|
|
5883
5883
|
t,
|
|
5884
5884
|
o,
|
|
5885
5885
|
() => o.width,
|
|
5886
5886
|
(a) => o.width = a
|
|
5887
5887
|
), r = ne(e, n.dom);
|
|
5888
|
-
return
|
|
5888
|
+
return he(
|
|
5889
5889
|
e,
|
|
5890
5890
|
t,
|
|
5891
5891
|
r,
|
|
5892
5892
|
t.dictionary.file_blocks.image.add_button_text,
|
|
5893
5893
|
i.firstElementChild
|
|
5894
5894
|
);
|
|
5895
|
-
},
|
|
5895
|
+
}, ao = (e) => {
|
|
5896
5896
|
if (e.tagName === "IMG")
|
|
5897
|
-
return
|
|
5897
|
+
return qe(e);
|
|
5898
5898
|
if (e.tagName === "FIGURE") {
|
|
5899
|
-
const t =
|
|
5899
|
+
const t = me(e, "img");
|
|
5900
5900
|
if (!t)
|
|
5901
5901
|
return;
|
|
5902
5902
|
const { targetElement: i, caption: o } = t;
|
|
5903
5903
|
return {
|
|
5904
|
-
...
|
|
5904
|
+
...qe(i),
|
|
5905
5905
|
caption: o
|
|
5906
5906
|
};
|
|
5907
5907
|
}
|
|
5908
|
-
},
|
|
5908
|
+
}, so = (e) => {
|
|
5909
5909
|
if (!e.props.url) {
|
|
5910
5910
|
const i = document.createElement("p");
|
|
5911
5911
|
return i.textContent = "Add image", {
|
|
@@ -5913,17 +5913,17 @@ const ue = (e, t, i, o, n) => {
|
|
|
5913
5913
|
};
|
|
5914
5914
|
}
|
|
5915
5915
|
let t;
|
|
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 ?
|
|
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) : {
|
|
5917
5917
|
dom: t
|
|
5918
5918
|
};
|
|
5919
|
-
},
|
|
5920
|
-
render:
|
|
5921
|
-
parse:
|
|
5922
|
-
toExternalHTML:
|
|
5923
|
-
}),
|
|
5919
|
+
}, lo = pe(no, {
|
|
5920
|
+
render: ro,
|
|
5921
|
+
parse: ao,
|
|
5922
|
+
toExternalHTML: so
|
|
5923
|
+
}), Xe = (e) => {
|
|
5924
5924
|
const t = e.src || void 0, i = e.width || void 0;
|
|
5925
5925
|
return { url: t, previewWidth: i };
|
|
5926
|
-
},
|
|
5926
|
+
}, co = {
|
|
5927
5927
|
textAlignment: w.textAlignment,
|
|
5928
5928
|
backgroundColor: w.backgroundColor,
|
|
5929
5929
|
// File name.
|
|
@@ -5945,13 +5945,13 @@ const ue = (e, t, i, o, n) => {
|
|
|
5945
5945
|
previewWidth: {
|
|
5946
5946
|
default: 512
|
|
5947
5947
|
}
|
|
5948
|
-
},
|
|
5948
|
+
}, uo = {
|
|
5949
5949
|
type: "video",
|
|
5950
|
-
propSchema:
|
|
5950
|
+
propSchema: co,
|
|
5951
5951
|
content: "none",
|
|
5952
5952
|
isFileBlock: !0,
|
|
5953
5953
|
fileBlockAccept: ["video/*"]
|
|
5954
|
-
},
|
|
5954
|
+
}, po = (e, t) => {
|
|
5955
5955
|
const i = document.createElement("div");
|
|
5956
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>';
|
|
5957
5957
|
const o = document.createElement("video");
|
|
@@ -5959,34 +5959,34 @@ const ue = (e, t, i, o, n) => {
|
|
|
5959
5959
|
e.props.previewWidth,
|
|
5960
5960
|
t.domElement.firstElementChild.clientWidth
|
|
5961
5961
|
);
|
|
5962
|
-
const n =
|
|
5962
|
+
const n = gt(
|
|
5963
5963
|
e,
|
|
5964
5964
|
t,
|
|
5965
5965
|
o,
|
|
5966
5966
|
() => o.width,
|
|
5967
5967
|
(a) => o.width = a
|
|
5968
5968
|
), r = ne(e, n.dom);
|
|
5969
|
-
return
|
|
5969
|
+
return he(
|
|
5970
5970
|
e,
|
|
5971
5971
|
t,
|
|
5972
5972
|
r,
|
|
5973
5973
|
t.dictionary.file_blocks.video.add_button_text,
|
|
5974
5974
|
i.firstElementChild
|
|
5975
5975
|
);
|
|
5976
|
-
},
|
|
5976
|
+
}, ho = (e) => {
|
|
5977
5977
|
if (e.tagName === "VIDEO")
|
|
5978
|
-
return
|
|
5978
|
+
return Xe(e);
|
|
5979
5979
|
if (e.tagName === "FIGURE") {
|
|
5980
|
-
const t =
|
|
5980
|
+
const t = me(e, "video");
|
|
5981
5981
|
if (!t)
|
|
5982
5982
|
return;
|
|
5983
5983
|
const { targetElement: i, caption: o } = t;
|
|
5984
5984
|
return {
|
|
5985
|
-
|
|
5985
|
+
...Xe(i),
|
|
5986
5986
|
caption: o
|
|
5987
5987
|
};
|
|
5988
5988
|
}
|
|
5989
|
-
},
|
|
5989
|
+
}, mo = (e) => {
|
|
5990
5990
|
if (!e.props.url) {
|
|
5991
5991
|
const i = document.createElement("p");
|
|
5992
5992
|
return i.textContent = "Add video", {
|
|
@@ -5994,14 +5994,14 @@ const ue = (e, t, i, o, n) => {
|
|
|
5994
5994
|
};
|
|
5995
5995
|
}
|
|
5996
5996
|
let t;
|
|
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 ?
|
|
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) : {
|
|
5998
5998
|
dom: t
|
|
5999
5999
|
};
|
|
6000
|
-
},
|
|
6001
|
-
render:
|
|
6002
|
-
parse:
|
|
6003
|
-
toExternalHTML:
|
|
6004
|
-
}),
|
|
6000
|
+
}, fo = pe(uo, {
|
|
6001
|
+
render: po,
|
|
6002
|
+
parse: ho,
|
|
6003
|
+
toExternalHTML: mo
|
|
6004
|
+
}), go = Me.create({
|
|
6005
6005
|
name: "backgroundColor",
|
|
6006
6006
|
addAttributes() {
|
|
6007
6007
|
return {
|
|
@@ -6027,10 +6027,10 @@ const ue = (e, t, i, o, n) => {
|
|
|
6027
6027
|
renderHTML({ HTMLAttributes: e }) {
|
|
6028
6028
|
return ["span", e, 0];
|
|
6029
6029
|
}
|
|
6030
|
-
}),
|
|
6031
|
-
|
|
6030
|
+
}), bo = j(
|
|
6031
|
+
go,
|
|
6032
6032
|
"string"
|
|
6033
|
-
),
|
|
6033
|
+
), _o = Me.create({
|
|
6034
6034
|
name: "textColor",
|
|
6035
6035
|
addAttributes() {
|
|
6036
6036
|
return {
|
|
@@ -6054,10 +6054,10 @@ const ue = (e, t, i, o, n) => {
|
|
|
6054
6054
|
renderHTML({ HTMLAttributes: e }) {
|
|
6055
6055
|
return ["span", e, 0];
|
|
6056
6056
|
}
|
|
6057
|
-
}),
|
|
6057
|
+
}), ko = j(_o, "string"), yo = {
|
|
6058
6058
|
...w,
|
|
6059
6059
|
level: { default: 1, values: [1, 2, 3] }
|
|
6060
|
-
},
|
|
6060
|
+
}, wo = F({
|
|
6061
6061
|
name: "heading",
|
|
6062
6062
|
content: "inline*",
|
|
6063
6063
|
group: "blockContent",
|
|
@@ -6160,10 +6160,10 @@ const ue = (e, t, i, o, n) => {
|
|
|
6160
6160
|
((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
|
|
6161
6161
|
);
|
|
6162
6162
|
}
|
|
6163
|
-
}),
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
),
|
|
6163
|
+
}), vo = X(
|
|
6164
|
+
wo,
|
|
6165
|
+
yo
|
|
6166
|
+
), Ie = (e) => {
|
|
6167
6167
|
const { contentNode: t, contentType: i } = _(
|
|
6168
6168
|
e.state.doc,
|
|
6169
6169
|
e.state.selection.from
|
|
@@ -6182,9 +6182,9 @@ const ue = (e, t, i, o, n) => {
|
|
|
6182
6182
|
a.command(() => t.childCount > 0 ? (r().deleteSelection().BNSplitBlock(n.selection.from, !0).run(), !0) : !1)
|
|
6183
6183
|
)
|
|
6184
6184
|
]);
|
|
6185
|
-
},
|
|
6185
|
+
}, xo = {
|
|
6186
6186
|
...w
|
|
6187
|
-
},
|
|
6187
|
+
}, Eo = F({
|
|
6188
6188
|
name: "bulletListItem",
|
|
6189
6189
|
content: "inline*",
|
|
6190
6190
|
group: "blockContent",
|
|
@@ -6207,7 +6207,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
6207
6207
|
},
|
|
6208
6208
|
addKeyboardShortcuts() {
|
|
6209
6209
|
return {
|
|
6210
|
-
Enter: () =>
|
|
6210
|
+
Enter: () => Ie(this.editor),
|
|
6211
6211
|
"Mod-Shift-8": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
|
|
6212
6212
|
this.editor.state.selection.anchor,
|
|
6213
6213
|
{
|
|
@@ -6263,11 +6263,11 @@ const ue = (e, t, i, o, n) => {
|
|
|
6263
6263
|
((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
|
|
6264
6264
|
);
|
|
6265
6265
|
}
|
|
6266
|
-
}),
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
),
|
|
6270
|
-
key:
|
|
6266
|
+
}), Co = X(
|
|
6267
|
+
Eo,
|
|
6268
|
+
xo
|
|
6269
|
+
), So = new L("numbered-list-indexing"), Mo = () => new x({
|
|
6270
|
+
key: So,
|
|
6271
6271
|
appendTransaction: (e, t, i) => {
|
|
6272
6272
|
const o = i.tr;
|
|
6273
6273
|
o.setMeta("numberedListIndexing", !0);
|
|
@@ -6296,9 +6296,9 @@ const ue = (e, t, i, o, n) => {
|
|
|
6296
6296
|
}
|
|
6297
6297
|
}), n ? o : null;
|
|
6298
6298
|
}
|
|
6299
|
-
}),
|
|
6299
|
+
}), To = {
|
|
6300
6300
|
...w
|
|
6301
|
-
},
|
|
6301
|
+
}, Bo = F({
|
|
6302
6302
|
name: "numberedListItem",
|
|
6303
6303
|
content: "inline*",
|
|
6304
6304
|
group: "blockContent",
|
|
@@ -6330,7 +6330,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
6330
6330
|
},
|
|
6331
6331
|
addKeyboardShortcuts() {
|
|
6332
6332
|
return {
|
|
6333
|
-
Enter: () =>
|
|
6333
|
+
Enter: () => Ie(this.editor),
|
|
6334
6334
|
"Mod-Shift-7": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
|
|
6335
6335
|
this.editor.state.selection.anchor,
|
|
6336
6336
|
{
|
|
@@ -6341,7 +6341,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
6341
6341
|
};
|
|
6342
6342
|
},
|
|
6343
6343
|
addProseMirrorPlugins() {
|
|
6344
|
-
return [
|
|
6344
|
+
return [Mo()];
|
|
6345
6345
|
},
|
|
6346
6346
|
parseHTML() {
|
|
6347
6347
|
return [
|
|
@@ -6391,15 +6391,15 @@ const ue = (e, t, i, o, n) => {
|
|
|
6391
6391
|
((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
|
|
6392
6392
|
);
|
|
6393
6393
|
}
|
|
6394
|
-
}),
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
),
|
|
6394
|
+
}), Lo = X(
|
|
6395
|
+
Bo,
|
|
6396
|
+
To
|
|
6397
|
+
), Io = {
|
|
6398
6398
|
...w,
|
|
6399
6399
|
checked: {
|
|
6400
6400
|
default: !1
|
|
6401
6401
|
}
|
|
6402
|
-
},
|
|
6402
|
+
}, Ao = F({
|
|
6403
6403
|
name: "checkListItem",
|
|
6404
6404
|
content: "inline*",
|
|
6405
6405
|
group: "blockContent",
|
|
@@ -6444,7 +6444,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
6444
6444
|
},
|
|
6445
6445
|
addKeyboardShortcuts() {
|
|
6446
6446
|
return {
|
|
6447
|
-
Enter: () =>
|
|
6447
|
+
Enter: () => Ie(this.editor),
|
|
6448
6448
|
"Mod-Shift-9": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
|
|
6449
6449
|
this.editor.state.selection.anchor,
|
|
6450
6450
|
{
|
|
@@ -6551,12 +6551,12 @@ const ue = (e, t, i, o, n) => {
|
|
|
6551
6551
|
};
|
|
6552
6552
|
};
|
|
6553
6553
|
}
|
|
6554
|
-
}),
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
),
|
|
6554
|
+
}), No = X(
|
|
6555
|
+
Ao,
|
|
6556
|
+
Io
|
|
6557
|
+
), Po = {
|
|
6558
6558
|
...w
|
|
6559
|
-
},
|
|
6559
|
+
}, Ho = F({
|
|
6560
6560
|
name: "paragraph",
|
|
6561
6561
|
content: "inline*",
|
|
6562
6562
|
group: "blockContent",
|
|
@@ -6597,16 +6597,16 @@ const ue = (e, t, i, o, n) => {
|
|
|
6597
6597
|
((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
|
|
6598
6598
|
);
|
|
6599
6599
|
}
|
|
6600
|
-
}),
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
),
|
|
6600
|
+
}), Uo = X(
|
|
6601
|
+
Ho,
|
|
6602
|
+
Po
|
|
6603
|
+
), Do = I.create({
|
|
6604
6604
|
name: "BlockNoteTableExtension",
|
|
6605
6605
|
addProseMirrorPlugins: () => [
|
|
6606
|
-
|
|
6606
|
+
oi({
|
|
6607
6607
|
cellMinWidth: 100
|
|
6608
6608
|
}),
|
|
6609
|
-
|
|
6609
|
+
ni()
|
|
6610
6610
|
],
|
|
6611
6611
|
addKeyboardShortcuts() {
|
|
6612
6612
|
return {
|
|
@@ -6627,14 +6627,14 @@ const ue = (e, t, i, o, n) => {
|
|
|
6627
6627
|
storage: e.storage
|
|
6628
6628
|
};
|
|
6629
6629
|
return {
|
|
6630
|
-
tableRole:
|
|
6631
|
-
|
|
6630
|
+
tableRole: Dt(
|
|
6631
|
+
jt(e, "tableRole", t)
|
|
6632
6632
|
)
|
|
6633
6633
|
};
|
|
6634
6634
|
}
|
|
6635
|
-
}),
|
|
6635
|
+
}), jo = {
|
|
6636
6636
|
...w
|
|
6637
|
-
},
|
|
6637
|
+
}, zo = F({
|
|
6638
6638
|
name: "table",
|
|
6639
6639
|
content: "tableRow+",
|
|
6640
6640
|
group: "blockContent",
|
|
@@ -6655,7 +6655,7 @@ const ue = (e, t, i, o, n) => {
|
|
|
6655
6655
|
((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
|
|
6656
6656
|
);
|
|
6657
6657
|
}
|
|
6658
|
-
}),
|
|
6658
|
+
}), Ro = q.create({
|
|
6659
6659
|
name: "tableParagraph",
|
|
6660
6660
|
group: "tableContent",
|
|
6661
6661
|
content: "inline*",
|
|
@@ -6676,74 +6676,74 @@ const ue = (e, t, i, o, n) => {
|
|
|
6676
6676
|
renderHTML({ HTMLAttributes: e }) {
|
|
6677
6677
|
return [
|
|
6678
6678
|
"p",
|
|
6679
|
-
|
|
6679
|
+
zt(this.options.HTMLAttributes, e),
|
|
6680
6680
|
0
|
|
6681
6681
|
];
|
|
6682
6682
|
}
|
|
6683
6683
|
}), Vo = X(
|
|
6684
|
+
zo,
|
|
6684
6685
|
jo,
|
|
6685
|
-
Do,
|
|
6686
6686
|
[
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6687
|
+
Do,
|
|
6688
|
+
Ro,
|
|
6689
|
+
ti.extend({
|
|
6690
6690
|
content: "tableContent"
|
|
6691
6691
|
}),
|
|
6692
|
-
|
|
6692
|
+
ei.extend({
|
|
6693
6693
|
content: "tableContent"
|
|
6694
6694
|
}),
|
|
6695
|
-
|
|
6695
|
+
ii
|
|
6696
6696
|
]
|
|
6697
|
-
),
|
|
6698
|
-
paragraph:
|
|
6699
|
-
heading:
|
|
6700
|
-
bulletListItem:
|
|
6701
|
-
numberedListItem:
|
|
6702
|
-
checkListItem:
|
|
6697
|
+
), bt = {
|
|
6698
|
+
paragraph: Uo,
|
|
6699
|
+
heading: vo,
|
|
6700
|
+
bulletListItem: Co,
|
|
6701
|
+
numberedListItem: Lo,
|
|
6702
|
+
checkListItem: No,
|
|
6703
6703
|
table: Vo,
|
|
6704
|
-
file:
|
|
6705
|
-
image:
|
|
6706
|
-
video:
|
|
6707
|
-
audio:
|
|
6708
|
-
},
|
|
6709
|
-
bold: j(
|
|
6710
|
-
italic: j(
|
|
6711
|
-
underline: j(
|
|
6712
|
-
strike: j(
|
|
6713
|
-
code: j(
|
|
6714
|
-
textColor:
|
|
6715
|
-
backgroundColor:
|
|
6716
|
-
},
|
|
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 = {
|
|
6717
6717
|
text: { config: "text", implementation: {} },
|
|
6718
6718
|
link: { config: "link", implementation: {} }
|
|
6719
|
-
},
|
|
6720
|
-
|
|
6719
|
+
}, Fo = pt(
|
|
6720
|
+
kt
|
|
6721
6721
|
);
|
|
6722
6722
|
function T(e, t) {
|
|
6723
|
-
return e in t.schema.blockSchema && t.schema.blockSchema[e] ===
|
|
6723
|
+
return e in t.schema.blockSchema && t.schema.blockSchema[e] === Oo[e];
|
|
6724
6724
|
}
|
|
6725
|
-
function
|
|
6726
|
-
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];
|
|
6727
6727
|
}
|
|
6728
|
-
function
|
|
6728
|
+
function Wo(e, t, i) {
|
|
6729
6729
|
return t.type === e && t.type in i.schema.blockSchema && T(t.type, i);
|
|
6730
6730
|
}
|
|
6731
|
-
function
|
|
6731
|
+
function Ur(e, t) {
|
|
6732
6732
|
return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock || !1;
|
|
6733
6733
|
}
|
|
6734
|
-
function
|
|
6734
|
+
function Dr(e, t) {
|
|
6735
6735
|
return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock && "showPreview" in t.schema.blockSchema[e.type].propSchema || !1;
|
|
6736
6736
|
}
|
|
6737
|
-
function
|
|
6737
|
+
function jr(e, t) {
|
|
6738
6738
|
return t.schema.blockSchema[e.type].isFileBlock && !e.props.url;
|
|
6739
6739
|
}
|
|
6740
|
-
function
|
|
6740
|
+
function Ko(e, t, i) {
|
|
6741
6741
|
return t in i.schema.blockSchema && e in i.schema.blockSchema[t].propSchema && i.schema.blockSchema[t].propSchema[e] === w[e];
|
|
6742
6742
|
}
|
|
6743
|
-
function
|
|
6744
|
-
return
|
|
6743
|
+
function zr(e, t, i) {
|
|
6744
|
+
return Ko(e, t.type, i);
|
|
6745
6745
|
}
|
|
6746
|
-
function
|
|
6746
|
+
function Ae(e, t) {
|
|
6747
6747
|
let i, o;
|
|
6748
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)
|
|
6749
6749
|
throw Error("Could not find block in the editor with matching ID.");
|
|
@@ -6752,13 +6752,13 @@ function Le(e, t) {
|
|
|
6752
6752
|
posBeforeNode: o
|
|
6753
6753
|
};
|
|
6754
6754
|
}
|
|
6755
|
-
function
|
|
6755
|
+
function $o(e, t, i = "before", o) {
|
|
6756
6756
|
const n = typeof t == "string" ? t : t.id, r = [];
|
|
6757
6757
|
for (const d of e)
|
|
6758
6758
|
r.push(
|
|
6759
6759
|
U(d, o.pmSchema, o.schema.styleSchema)
|
|
6760
6760
|
);
|
|
6761
|
-
const { node: a, posBeforeNode: s } =
|
|
6761
|
+
const { node: a, posBeforeNode: s } = Ae(
|
|
6762
6762
|
n,
|
|
6763
6763
|
o._tiptapEditor.state.doc
|
|
6764
6764
|
);
|
|
@@ -6791,8 +6791,8 @@ function Ko(e, t, i = "before", o) {
|
|
|
6791
6791
|
);
|
|
6792
6792
|
return l;
|
|
6793
6793
|
}
|
|
6794
|
-
function
|
|
6795
|
-
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);
|
|
6796
6796
|
o.commands.BNUpdateBlock(r + 1, t);
|
|
6797
6797
|
const a = o.state.doc.resolve(r + 1).node();
|
|
6798
6798
|
return C(
|
|
@@ -6803,7 +6803,7 @@ function $o(e, t, i) {
|
|
|
6803
6803
|
i.blockCache
|
|
6804
6804
|
);
|
|
6805
6805
|
}
|
|
6806
|
-
function
|
|
6806
|
+
function yt(e, t, i) {
|
|
6807
6807
|
const o = t._tiptapEditor, n = o.state.tr, r = new Set(
|
|
6808
6808
|
e.map(
|
|
6809
6809
|
(l) => typeof l == "string" ? l : l.id
|
|
@@ -6837,16 +6837,16 @@ function _t(e, t, i) {
|
|
|
6837
6837
|
}
|
|
6838
6838
|
return t.dispatch(n), a;
|
|
6839
6839
|
}
|
|
6840
|
-
function
|
|
6841
|
-
return
|
|
6840
|
+
function Xo(e, t) {
|
|
6841
|
+
return yt(e, t);
|
|
6842
6842
|
}
|
|
6843
|
-
function
|
|
6843
|
+
function Zo(e, t, i) {
|
|
6844
6844
|
const o = [];
|
|
6845
6845
|
for (const s of t)
|
|
6846
6846
|
o.push(
|
|
6847
6847
|
U(s, i.pmSchema, i.schema.styleSchema)
|
|
6848
6848
|
);
|
|
6849
|
-
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(
|
|
6850
6850
|
e,
|
|
6851
6851
|
i,
|
|
6852
6852
|
(s, l, d, u) => {
|
|
@@ -6871,7 +6871,7 @@ function Xo(e, t, i) {
|
|
|
6871
6871
|
);
|
|
6872
6872
|
return { insertedBlocks: a, removedBlocks: r };
|
|
6873
6873
|
}
|
|
6874
|
-
function
|
|
6874
|
+
function Jo(e, t, i, o = { updateSelection: !0 }) {
|
|
6875
6875
|
const n = i._tiptapEditor.state.tr;
|
|
6876
6876
|
let { from: r, to: a } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, s = !0, l = !0, d = "";
|
|
6877
6877
|
if (t.forEach((u) => {
|
|
@@ -6880,9 +6880,9 @@ function Zo(e, t, i, o = { updateSelection: !0 }) {
|
|
|
6880
6880
|
const { parent: u } = n.doc.resolve(r);
|
|
6881
6881
|
u.isTextblock && !u.type.spec.code && !u.childCount && (r -= 1, a += 1);
|
|
6882
6882
|
}
|
|
6883
|
-
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;
|
|
6884
6884
|
}
|
|
6885
|
-
function
|
|
6885
|
+
function Yo() {
|
|
6886
6886
|
const e = (t) => {
|
|
6887
6887
|
let i = t.children.length;
|
|
6888
6888
|
for (let o = 0; o < i; o++) {
|
|
@@ -6898,7 +6898,7 @@ function Jo() {
|
|
|
6898
6898
|
};
|
|
6899
6899
|
return e;
|
|
6900
6900
|
}
|
|
6901
|
-
function
|
|
6901
|
+
function Qo() {
|
|
6902
6902
|
const e = H;
|
|
6903
6903
|
if (!e)
|
|
6904
6904
|
throw new Error(
|
|
@@ -6920,43 +6920,43 @@ function Yo() {
|
|
|
6920
6920
|
};
|
|
6921
6921
|
return t;
|
|
6922
6922
|
}
|
|
6923
|
-
function
|
|
6923
|
+
function Ne(e) {
|
|
6924
6924
|
const t = H;
|
|
6925
6925
|
if (!t)
|
|
6926
6926
|
throw new Error(
|
|
6927
6927
|
"cleanHTMLToMarkdown requires ESM dependencies to be initialized"
|
|
6928
6928
|
);
|
|
6929
|
-
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, {
|
|
6930
6930
|
handlers: { text: (o) => o.value }
|
|
6931
6931
|
}).processSync(e).value;
|
|
6932
6932
|
}
|
|
6933
|
-
async function
|
|
6933
|
+
async function en(e, t, i, o) {
|
|
6934
6934
|
await ie();
|
|
6935
|
-
const r =
|
|
6936
|
-
return
|
|
6935
|
+
const r = ue(t, i).exportBlocks(e, o);
|
|
6936
|
+
return Ne(r);
|
|
6937
6937
|
}
|
|
6938
|
-
function
|
|
6938
|
+
function tn(e) {
|
|
6939
6939
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
6940
6940
|
}
|
|
6941
|
-
function
|
|
6941
|
+
function on(e) {
|
|
6942
6942
|
return e.nodeType === 3 && !/\S/.test(e.nodeValue || "");
|
|
6943
6943
|
}
|
|
6944
|
-
function
|
|
6944
|
+
function nn(e) {
|
|
6945
6945
|
e.querySelectorAll("li > ul, li > ol").forEach((t) => {
|
|
6946
|
-
const i =
|
|
6946
|
+
const i = tn(t), o = t.parentElement, n = Array.from(o.childNodes).slice(
|
|
6947
6947
|
i + 1
|
|
6948
6948
|
);
|
|
6949
6949
|
t.remove(), n.forEach((r) => {
|
|
6950
6950
|
r.remove();
|
|
6951
6951
|
}), o.insertAdjacentElement("afterend", t), n.reverse().forEach((r) => {
|
|
6952
|
-
if (
|
|
6952
|
+
if (on(r))
|
|
6953
6953
|
return;
|
|
6954
6954
|
const a = document.createElement("li");
|
|
6955
6955
|
a.append(r), t.insertAdjacentElement("afterend", a);
|
|
6956
6956
|
}), o.childNodes.length === 0 && o.remove();
|
|
6957
6957
|
});
|
|
6958
6958
|
}
|
|
6959
|
-
function
|
|
6959
|
+
function rn(e) {
|
|
6960
6960
|
e.querySelectorAll("li + ul, li + ol").forEach((t) => {
|
|
6961
6961
|
var r, a;
|
|
6962
6962
|
const i = t.previousElementSibling, o = document.createElement("div");
|
|
@@ -6966,19 +6966,19 @@ function nn(e) {
|
|
|
6966
6966
|
n.append(o.nextElementSibling);
|
|
6967
6967
|
});
|
|
6968
6968
|
}
|
|
6969
|
-
let
|
|
6970
|
-
function
|
|
6971
|
-
return
|
|
6969
|
+
let Ze = null;
|
|
6970
|
+
function an() {
|
|
6971
|
+
return Ze || (Ze = document.implementation.createHTMLDocument("title"));
|
|
6972
6972
|
}
|
|
6973
|
-
function
|
|
6973
|
+
function wt(e) {
|
|
6974
6974
|
if (typeof e == "string") {
|
|
6975
|
-
const t =
|
|
6975
|
+
const t = an().createElement("div");
|
|
6976
6976
|
t.innerHTML = e, e = t;
|
|
6977
6977
|
}
|
|
6978
|
-
return
|
|
6978
|
+
return nn(e), rn(e), e;
|
|
6979
6979
|
}
|
|
6980
|
-
async function
|
|
6981
|
-
const r =
|
|
6980
|
+
async function vt(e, t, i, o, n) {
|
|
6981
|
+
const r = wt(e), s = At.fromSchema(n).parse(r, {
|
|
6982
6982
|
topNode: n.nodes.blockGroup.create()
|
|
6983
6983
|
}), l = [];
|
|
6984
6984
|
for (let d = 0; d < s.childCount; d++)
|
|
@@ -6987,7 +6987,7 @@ async function yt(e, t, i, o, n) {
|
|
|
6987
6987
|
);
|
|
6988
6988
|
return l;
|
|
6989
6989
|
}
|
|
6990
|
-
function
|
|
6990
|
+
function sn(e, t) {
|
|
6991
6991
|
const i = t.value ? t.value + `
|
|
6992
6992
|
` : "", o = {};
|
|
6993
6993
|
t.lang && (o["data-language"] = t.lang);
|
|
@@ -7004,14 +7004,14 @@ function an(e, t) {
|
|
|
7004
7004
|
children: [n]
|
|
7005
7005
|
}, e.patch(t, n), n;
|
|
7006
7006
|
}
|
|
7007
|
-
async function
|
|
7007
|
+
async function ln(e, t, i, o, n) {
|
|
7008
7008
|
const r = await ie(), a = r.unified.unified().use(r.remarkParse.default).use(r.remarkGfm.default).use(r.remarkRehype.default, {
|
|
7009
7009
|
handlers: {
|
|
7010
7010
|
...r.remarkRehype.defaultHandlers,
|
|
7011
|
-
code:
|
|
7011
|
+
code: sn
|
|
7012
7012
|
}
|
|
7013
7013
|
}).use(r.rehypeStringify.default).processSync(e);
|
|
7014
|
-
return
|
|
7014
|
+
return vt(
|
|
7015
7015
|
a.value,
|
|
7016
7016
|
t,
|
|
7017
7017
|
i,
|
|
@@ -7039,7 +7039,7 @@ class Z {
|
|
|
7039
7039
|
this.callbacks = {};
|
|
7040
7040
|
}
|
|
7041
7041
|
}
|
|
7042
|
-
class
|
|
7042
|
+
class dn {
|
|
7043
7043
|
constructor(t, i, o, n) {
|
|
7044
7044
|
c(this, "state");
|
|
7045
7045
|
c(this, "emitUpdate");
|
|
@@ -7095,8 +7095,8 @@ class ln {
|
|
|
7095
7095
|
this.pmView.dom.removeEventListener("mousedown", this.mouseDownHandler), this.pmView.dom.removeEventListener("dragstart", this.dragstartHandler), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
|
|
7096
7096
|
}
|
|
7097
7097
|
}
|
|
7098
|
-
const
|
|
7099
|
-
class
|
|
7098
|
+
const ke = new L("FilePanelPlugin");
|
|
7099
|
+
class cn extends Z {
|
|
7100
7100
|
constructor(i) {
|
|
7101
7101
|
super();
|
|
7102
7102
|
c(this, "view");
|
|
@@ -7106,10 +7106,10 @@ class dn extends Z {
|
|
|
7106
7106
|
return (i = this.view) == null ? void 0 : i.closeMenu();
|
|
7107
7107
|
});
|
|
7108
7108
|
this.plugin = new x({
|
|
7109
|
-
key:
|
|
7110
|
-
view: (o) => (this.view = new
|
|
7109
|
+
key: ke,
|
|
7110
|
+
view: (o) => (this.view = new dn(
|
|
7111
7111
|
i,
|
|
7112
|
-
|
|
7112
|
+
ke,
|
|
7113
7113
|
o,
|
|
7114
7114
|
(n) => {
|
|
7115
7115
|
this.emit("update", n);
|
|
@@ -7128,7 +7128,7 @@ class dn extends Z {
|
|
|
7128
7128
|
apply: (o) => {
|
|
7129
7129
|
var r;
|
|
7130
7130
|
return {
|
|
7131
|
-
block: (r = o.getMeta(
|
|
7131
|
+
block: (r = o.getMeta(ke)) == null ? void 0 : r.block
|
|
7132
7132
|
};
|
|
7133
7133
|
}
|
|
7134
7134
|
}
|
|
@@ -7142,7 +7142,7 @@ class dn extends Z {
|
|
|
7142
7142
|
return this.on("update", i);
|
|
7143
7143
|
}
|
|
7144
7144
|
}
|
|
7145
|
-
class
|
|
7145
|
+
class un {
|
|
7146
7146
|
constructor(t, i, o) {
|
|
7147
7147
|
c(this, "state");
|
|
7148
7148
|
c(this, "emitUpdate");
|
|
@@ -7220,26 +7220,26 @@ class cn {
|
|
|
7220
7220
|
}
|
|
7221
7221
|
getSelectionBoundingBox() {
|
|
7222
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));
|
|
7223
|
-
if (
|
|
7223
|
+
if (Ot(i)) {
|
|
7224
7224
|
const a = this.pmView.nodeDOM(n);
|
|
7225
7225
|
if (a)
|
|
7226
7226
|
return a.getBoundingClientRect();
|
|
7227
7227
|
}
|
|
7228
|
-
return
|
|
7228
|
+
return xe(this.pmView, n, r);
|
|
7229
7229
|
}
|
|
7230
7230
|
}
|
|
7231
|
-
const
|
|
7231
|
+
const pn = new L(
|
|
7232
7232
|
"FormattingToolbarPlugin"
|
|
7233
7233
|
);
|
|
7234
|
-
class
|
|
7234
|
+
class hn extends Z {
|
|
7235
7235
|
constructor(i) {
|
|
7236
7236
|
super();
|
|
7237
7237
|
c(this, "view");
|
|
7238
7238
|
c(this, "plugin");
|
|
7239
7239
|
c(this, "closeMenu", () => this.view.closeMenu());
|
|
7240
7240
|
this.plugin = new x({
|
|
7241
|
-
key:
|
|
7242
|
-
view: (o) => (this.view = new
|
|
7241
|
+
key: pn,
|
|
7242
|
+
view: (o) => (this.view = new un(i, o, (n) => {
|
|
7243
7243
|
this.emit("update", n);
|
|
7244
7244
|
}), this.view),
|
|
7245
7245
|
props: {
|
|
@@ -7255,7 +7255,7 @@ class pn extends Z {
|
|
|
7255
7255
|
return this.on("update", i);
|
|
7256
7256
|
}
|
|
7257
7257
|
}
|
|
7258
|
-
class
|
|
7258
|
+
class mn {
|
|
7259
7259
|
constructor(t, i, o) {
|
|
7260
7260
|
c(this, "state");
|
|
7261
7261
|
c(this, "emitUpdate");
|
|
@@ -7273,7 +7273,7 @@ class hn {
|
|
|
7273
7273
|
const i = t.target, o = this.pmView.posAtDOM(i, 0) + 1, n = this.pmView.state.doc.resolve(o), r = n.marks();
|
|
7274
7274
|
for (const a of r)
|
|
7275
7275
|
if (a.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
7276
|
-
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange =
|
|
7276
|
+
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = ze(n, a.type, a.attrs) || void 0;
|
|
7277
7277
|
break;
|
|
7278
7278
|
}
|
|
7279
7279
|
}
|
|
@@ -7289,7 +7289,7 @@ class hn {
|
|
|
7289
7289
|
});
|
|
7290
7290
|
c(this, "scrollHandler", () => {
|
|
7291
7291
|
var t;
|
|
7292
|
-
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(
|
|
7293
7293
|
this.pmView,
|
|
7294
7294
|
this.linkMarkRange.from,
|
|
7295
7295
|
this.linkMarkRange.to
|
|
@@ -7345,7 +7345,7 @@ class hn {
|
|
|
7345
7345
|
const o = this.pmView.state.selection.$from.marks();
|
|
7346
7346
|
for (const n of o)
|
|
7347
7347
|
if (n.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
7348
|
-
this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange =
|
|
7348
|
+
this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange = ze(
|
|
7349
7349
|
this.pmView.state.selection.$from,
|
|
7350
7350
|
n.type,
|
|
7351
7351
|
n.attrs
|
|
@@ -7356,7 +7356,7 @@ class hn {
|
|
|
7356
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) {
|
|
7357
7357
|
this.state = {
|
|
7358
7358
|
show: !0,
|
|
7359
|
-
referencePos:
|
|
7359
|
+
referencePos: xe(
|
|
7360
7360
|
this.pmView,
|
|
7361
7361
|
this.linkMarkRange.from,
|
|
7362
7362
|
this.linkMarkRange.to
|
|
@@ -7382,8 +7382,8 @@ class hn {
|
|
|
7382
7382
|
);
|
|
7383
7383
|
}
|
|
7384
7384
|
}
|
|
7385
|
-
const
|
|
7386
|
-
class
|
|
7385
|
+
const fn = new L("LinkToolbarPlugin");
|
|
7386
|
+
class gn extends Z {
|
|
7387
7387
|
constructor(i) {
|
|
7388
7388
|
super();
|
|
7389
7389
|
c(this, "view");
|
|
@@ -7422,8 +7422,8 @@ class fn extends Z {
|
|
|
7422
7422
|
});
|
|
7423
7423
|
c(this, "closeMenu", () => this.view.closeMenu());
|
|
7424
7424
|
this.plugin = new x({
|
|
7425
|
-
key:
|
|
7426
|
-
view: (o) => (this.view = new
|
|
7425
|
+
key: fn,
|
|
7426
|
+
view: (o) => (this.view = new mn(i, o, (n) => {
|
|
7427
7427
|
this.emit("update", n);
|
|
7428
7428
|
}), this.view),
|
|
7429
7429
|
props: {
|
|
@@ -7439,7 +7439,7 @@ class fn extends Z {
|
|
|
7439
7439
|
return ((o = (i = this.view) == null ? void 0 : i.state) == null ? void 0 : o.show) || !1;
|
|
7440
7440
|
}
|
|
7441
7441
|
}
|
|
7442
|
-
class G extends
|
|
7442
|
+
class G extends be {
|
|
7443
7443
|
constructor(i, o) {
|
|
7444
7444
|
super(i, o);
|
|
7445
7445
|
c(this, "nodes");
|
|
@@ -7465,7 +7465,7 @@ class G extends fe {
|
|
|
7465
7465
|
}
|
|
7466
7466
|
map(i, o) {
|
|
7467
7467
|
const n = o.mapResult(this.from), r = o.mapResult(this.to);
|
|
7468
|
-
return r.deleted ?
|
|
7468
|
+
return r.deleted ? be.near(i.resolve(n.pos)) : n.deleted ? be.near(i.resolve(r.pos)) : new G(
|
|
7469
7469
|
i.resolve(n.pos),
|
|
7470
7470
|
i.resolve(r.pos)
|
|
7471
7471
|
);
|
|
@@ -7475,22 +7475,22 @@ class G extends fe {
|
|
|
7475
7475
|
}
|
|
7476
7476
|
}
|
|
7477
7477
|
let A;
|
|
7478
|
-
function
|
|
7478
|
+
function ge(e, t) {
|
|
7479
7479
|
var i, o;
|
|
7480
7480
|
for (; e && e.parentElement && e.parentElement !== t.dom && ((i = e.getAttribute) == null ? void 0 : i.call(e, "data-node-type")) !== "blockContainer"; )
|
|
7481
7481
|
e = e.parentElement;
|
|
7482
7482
|
if (((o = e.getAttribute) == null ? void 0 : o.call(e, "data-node-type")) === "blockContainer")
|
|
7483
7483
|
return { node: e, id: e.getAttribute("data-id") };
|
|
7484
7484
|
}
|
|
7485
|
-
function
|
|
7486
|
-
const i =
|
|
7485
|
+
function bn(e, t) {
|
|
7486
|
+
const i = ge(e, t);
|
|
7487
7487
|
if (i && i.node.nodeType === 1) {
|
|
7488
7488
|
const o = t.docView, n = o.nearestDesc(i.node, !0);
|
|
7489
7489
|
return !n || n === o ? null : n.posBefore;
|
|
7490
7490
|
}
|
|
7491
7491
|
return null;
|
|
7492
7492
|
}
|
|
7493
|
-
function
|
|
7493
|
+
function _n(e, t) {
|
|
7494
7494
|
let i, o;
|
|
7495
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);
|
|
7496
7496
|
if (n && r) {
|
|
@@ -7500,7 +7500,7 @@ function bn(e, t) {
|
|
|
7500
7500
|
i = e.from, o = e.to;
|
|
7501
7501
|
return { from: i, to: o };
|
|
7502
7502
|
}
|
|
7503
|
-
function
|
|
7503
|
+
function Je(e, t, i = t) {
|
|
7504
7504
|
t === i && (i += e.state.doc.resolve(t + 1).node().nodeSize);
|
|
7505
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(
|
|
7506
7506
|
n,
|
|
@@ -7513,16 +7513,16 @@ function Xe(e, t, i = t) {
|
|
|
7513
7513
|
);
|
|
7514
7514
|
for (let u = n.childElementCount - 1; u >= 0; u--)
|
|
7515
7515
|
(u > s || u < a) && o.removeChild(o.children[u]);
|
|
7516
|
-
|
|
7516
|
+
xt(e.root), A = o;
|
|
7517
7517
|
const d = e.dom.className.split(" ").filter(
|
|
7518
7518
|
(u) => u !== "ProseMirror" && u !== "bn-root" && u !== "bn-editor"
|
|
7519
7519
|
).join(" ");
|
|
7520
7520
|
A.className = A.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(A) : e.root.body.appendChild(A);
|
|
7521
7521
|
}
|
|
7522
|
-
function
|
|
7522
|
+
function xt(e) {
|
|
7523
7523
|
A !== void 0 && (e instanceof ShadowRoot ? e.removeChild(A) : e.body.removeChild(A), A = void 0);
|
|
7524
7524
|
}
|
|
7525
|
-
function
|
|
7525
|
+
function kn(e, t) {
|
|
7526
7526
|
if (!e.dataTransfer)
|
|
7527
7527
|
return;
|
|
7528
7528
|
const i = t.prosemirrorView, o = i.dom.getBoundingClientRect(), n = {
|
|
@@ -7533,30 +7533,30 @@ function _n(e, t) {
|
|
|
7533
7533
|
let a;
|
|
7534
7534
|
for (const l of r)
|
|
7535
7535
|
if (i.dom.contains(l)) {
|
|
7536
|
-
a =
|
|
7536
|
+
a = ge(l, i);
|
|
7537
7537
|
break;
|
|
7538
7538
|
}
|
|
7539
7539
|
if (!a)
|
|
7540
7540
|
return;
|
|
7541
|
-
const s =
|
|
7541
|
+
const s = bn(a.node, i);
|
|
7542
7542
|
if (s != null) {
|
|
7543
|
-
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;
|
|
7544
7544
|
h && m ? (i.dispatch(
|
|
7545
7545
|
i.state.tr.setSelection(G.create(d, u, p))
|
|
7546
|
-
),
|
|
7547
|
-
i.state.tr.setSelection(
|
|
7548
|
-
),
|
|
7549
|
-
const f = i.state.selection.content(), g = t.pmSchema, v =
|
|
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(
|
|
7550
7550
|
f.content,
|
|
7551
7551
|
{}
|
|
7552
|
-
), y =
|
|
7552
|
+
), y = ue(g, t).exportProseMirrorFragment(
|
|
7553
7553
|
f.content,
|
|
7554
7554
|
{}
|
|
7555
|
-
), S =
|
|
7555
|
+
), S = Ne(y);
|
|
7556
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 };
|
|
7557
7557
|
}
|
|
7558
7558
|
}
|
|
7559
|
-
class
|
|
7559
|
+
class yn {
|
|
7560
7560
|
constructor(t, i, o) {
|
|
7561
7561
|
c(this, "state");
|
|
7562
7562
|
c(this, "emitUpdate");
|
|
@@ -7588,7 +7588,7 @@ class kn {
|
|
|
7588
7588
|
let n;
|
|
7589
7589
|
for (const u of o)
|
|
7590
7590
|
if (this.pmView.dom.contains(u)) {
|
|
7591
|
-
n =
|
|
7591
|
+
n = ge(u, this.pmView);
|
|
7592
7592
|
break;
|
|
7593
7593
|
}
|
|
7594
7594
|
if (!n || !this.editor.isEditable) {
|
|
@@ -7771,8 +7771,8 @@ class kn {
|
|
|
7771
7771
|
this.editor.openSuggestionMenu("/");
|
|
7772
7772
|
}
|
|
7773
7773
|
}
|
|
7774
|
-
const
|
|
7775
|
-
class
|
|
7774
|
+
const wn = new L("SideMenuPlugin");
|
|
7775
|
+
class vn extends Z {
|
|
7776
7776
|
constructor(i) {
|
|
7777
7777
|
super();
|
|
7778
7778
|
c(this, "view");
|
|
@@ -7786,12 +7786,12 @@ class wn extends Z {
|
|
|
7786
7786
|
* Handles drag & drop events for blocks.
|
|
7787
7787
|
*/
|
|
7788
7788
|
c(this, "blockDragStart", (i) => {
|
|
7789
|
-
this.view.isDragging = !0,
|
|
7789
|
+
this.view.isDragging = !0, kn(i, this.editor);
|
|
7790
7790
|
});
|
|
7791
7791
|
/**
|
|
7792
7792
|
* Handles drag & drop events for blocks.
|
|
7793
7793
|
*/
|
|
7794
|
-
c(this, "blockDragEnd", () =>
|
|
7794
|
+
c(this, "blockDragEnd", () => xt(this.editor.prosemirrorView.root));
|
|
7795
7795
|
/**
|
|
7796
7796
|
* Freezes the side menu. When frozen, the side menu will stay
|
|
7797
7797
|
* attached to the same block regardless of which block is hovered by the
|
|
@@ -7807,8 +7807,8 @@ class wn extends Z {
|
|
|
7807
7807
|
this.view.menuFrozen = !1, this.view.state.show = !1, this.view.emitUpdate(this.view.state);
|
|
7808
7808
|
});
|
|
7809
7809
|
this.editor = i, this.plugin = new x({
|
|
7810
|
-
key:
|
|
7811
|
-
view: (o) => (this.view = new
|
|
7810
|
+
key: wn,
|
|
7811
|
+
view: (o) => (this.view = new yn(i, o, (n) => {
|
|
7812
7812
|
this.emit("update", n);
|
|
7813
7813
|
}), this.view)
|
|
7814
7814
|
});
|
|
@@ -7817,8 +7817,8 @@ class wn extends Z {
|
|
|
7817
7817
|
return this.on("update", i);
|
|
7818
7818
|
}
|
|
7819
7819
|
}
|
|
7820
|
-
const
|
|
7821
|
-
class
|
|
7820
|
+
const xn = Ft((e) => e.type.name === "blockContainer");
|
|
7821
|
+
class En {
|
|
7822
7822
|
constructor(t, i) {
|
|
7823
7823
|
c(this, "state");
|
|
7824
7824
|
c(this, "emitUpdate");
|
|
@@ -7885,7 +7885,7 @@ class xn {
|
|
|
7885
7885
|
}
|
|
7886
7886
|
}
|
|
7887
7887
|
const W = new L("SuggestionMenuPlugin");
|
|
7888
|
-
class
|
|
7888
|
+
class Cn extends Z {
|
|
7889
7889
|
constructor(i) {
|
|
7890
7890
|
super();
|
|
7891
7891
|
c(this, "view");
|
|
@@ -7905,7 +7905,7 @@ class En extends Z {
|
|
|
7905
7905
|
const o = this.triggerCharacters;
|
|
7906
7906
|
this.plugin = new x({
|
|
7907
7907
|
key: W,
|
|
7908
|
-
view: () => (this.view = new
|
|
7908
|
+
view: () => (this.view = new En(
|
|
7909
7909
|
i,
|
|
7910
7910
|
(n, r) => {
|
|
7911
7911
|
this.emit(`update ${n}`, r);
|
|
@@ -7962,7 +7962,7 @@ class En extends Z {
|
|
|
7962
7962
|
if (r === void 0)
|
|
7963
7963
|
return null;
|
|
7964
7964
|
if (!r.deleteTriggerCharacter) {
|
|
7965
|
-
const a =
|
|
7965
|
+
const a = xn(n.selection);
|
|
7966
7966
|
if (a)
|
|
7967
7967
|
return K.create(n.doc, [
|
|
7968
7968
|
$.node(
|
|
@@ -7999,68 +7999,75 @@ class En extends Z {
|
|
|
7999
7999
|
return ((o = (i = this.view) == null ? void 0 : i.state) == null ? void 0 : o.show) || !1;
|
|
8000
8000
|
}
|
|
8001
8001
|
}
|
|
8002
|
-
function
|
|
8002
|
+
function Rr(e, t) {
|
|
8003
8003
|
e.suggestionMenus.addTriggerCharacter(t);
|
|
8004
8004
|
}
|
|
8005
8005
|
let E;
|
|
8006
|
-
function
|
|
8006
|
+
function Ye(e) {
|
|
8007
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));
|
|
8008
8008
|
}
|
|
8009
|
-
function
|
|
8009
|
+
function Sn(e) {
|
|
8010
8010
|
E && (e instanceof Document ? e.body.removeChild(E) : e.removeChild(E), E = void 0);
|
|
8011
8011
|
}
|
|
8012
8012
|
function re(e) {
|
|
8013
8013
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
8014
8014
|
}
|
|
8015
|
-
function
|
|
8015
|
+
function Mn(e) {
|
|
8016
8016
|
for (; e && e.nodeName !== "TD" && e.nodeName !== "TH"; )
|
|
8017
8017
|
e = e.classList && e.classList.contains("ProseMirror") ? null : e.parentNode;
|
|
8018
8018
|
return e;
|
|
8019
8019
|
}
|
|
8020
|
-
function
|
|
8020
|
+
function Tn(e, t) {
|
|
8021
8021
|
e.forEach((i) => {
|
|
8022
8022
|
const o = t.querySelectorAll(i);
|
|
8023
8023
|
for (let n = 0; n < o.length; n++)
|
|
8024
8024
|
o[n].style.visibility = "hidden";
|
|
8025
8025
|
});
|
|
8026
8026
|
}
|
|
8027
|
-
class
|
|
8027
|
+
class Bn {
|
|
8028
8028
|
constructor(t, i, o) {
|
|
8029
8029
|
c(this, "state");
|
|
8030
8030
|
c(this, "emitUpdate");
|
|
8031
8031
|
c(this, "tableId");
|
|
8032
8032
|
c(this, "tablePos");
|
|
8033
8033
|
c(this, "menuFrozen", !1);
|
|
8034
|
+
c(this, "mouseState", "up");
|
|
8034
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
|
+
});
|
|
8035
8042
|
c(this, "mouseMoveHandler", (t) => {
|
|
8036
|
-
var d, u, p;
|
|
8037
|
-
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"))
|
|
8038
8045
|
return;
|
|
8039
|
-
const i =
|
|
8046
|
+
const i = Mn(t.target);
|
|
8040
8047
|
if (!i || !this.editor.isEditable) {
|
|
8041
|
-
(
|
|
8048
|
+
(u = this.state) != null && u.show && (this.state.show = !1, this.emitUpdate());
|
|
8042
8049
|
return;
|
|
8043
8050
|
}
|
|
8044
|
-
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();
|
|
8045
8052
|
if (!a)
|
|
8046
8053
|
return;
|
|
8047
|
-
const s =
|
|
8054
|
+
const s = ge(i, this.pmView);
|
|
8048
8055
|
if (!s)
|
|
8049
8056
|
return;
|
|
8050
8057
|
let l;
|
|
8051
|
-
if (this.editor._tiptapEditor.state.doc.descendants((
|
|
8058
|
+
if (this.editor._tiptapEditor.state.doc.descendants((m, f) => {
|
|
8052
8059
|
if (typeof l < "u")
|
|
8053
8060
|
return !1;
|
|
8054
|
-
if (
|
|
8061
|
+
if (m.type.name !== "blockContainer" || m.attrs.id !== s.id)
|
|
8055
8062
|
return !0;
|
|
8056
|
-
const
|
|
8057
|
-
|
|
8063
|
+
const g = C(
|
|
8064
|
+
m,
|
|
8058
8065
|
this.editor.schema.blockSchema,
|
|
8059
8066
|
this.editor.schema.inlineContentSchema,
|
|
8060
8067
|
this.editor.schema.styleSchema,
|
|
8061
8068
|
this.editor.blockCache
|
|
8062
8069
|
);
|
|
8063
|
-
return
|
|
8070
|
+
return Wo("table", g, this.editor) && (this.tablePos = f + 1, l = g), !1;
|
|
8064
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)))
|
|
8065
8072
|
return this.state = {
|
|
8066
8073
|
show: !0,
|
|
@@ -8076,7 +8083,7 @@ class Tn {
|
|
|
8076
8083
|
var h;
|
|
8077
8084
|
if (((h = this.state) == null ? void 0 : h.draggingState) === void 0)
|
|
8078
8085
|
return;
|
|
8079
|
-
t.preventDefault(), t.dataTransfer.dropEffect = "move",
|
|
8086
|
+
t.preventDefault(), t.dataTransfer.dropEffect = "move", Tn(
|
|
8080
8087
|
[
|
|
8081
8088
|
"column-resize-handle",
|
|
8082
8089
|
"prosemirror-dropcursor-block",
|
|
@@ -8148,7 +8155,7 @@ class Tn {
|
|
|
8148
8155
|
if (!this.state)
|
|
8149
8156
|
throw new Error("Attempting to update uninitialized image toolbar");
|
|
8150
8157
|
o(this.state);
|
|
8151
|
-
}, 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(
|
|
8152
8159
|
"dragover",
|
|
8153
8160
|
this.dragOverHandler
|
|
8154
8161
|
), i.root.addEventListener("drop", this.dropHandler), i.root.addEventListener("scroll", this.scrollHandler, !0);
|
|
@@ -8164,7 +8171,7 @@ class Tn {
|
|
|
8164
8171
|
}
|
|
8165
8172
|
}
|
|
8166
8173
|
const Q = new L("TableHandlesPlugin");
|
|
8167
|
-
class
|
|
8174
|
+
class Ln extends Z {
|
|
8168
8175
|
constructor(i) {
|
|
8169
8176
|
super();
|
|
8170
8177
|
c(this, "view");
|
|
@@ -8189,7 +8196,7 @@ class Bn extends Z {
|
|
|
8189
8196
|
newIndex: this.view.state.colIndex,
|
|
8190
8197
|
tablePos: this.view.tablePos
|
|
8191
8198
|
})
|
|
8192
|
-
),
|
|
8199
|
+
), Ye(this.editor._tiptapEditor.view.root), i.dataTransfer.setDragImage(E, 0, 0), i.dataTransfer.effectAllowed = "move";
|
|
8193
8200
|
});
|
|
8194
8201
|
/**
|
|
8195
8202
|
* Callback that should be set on the `dragStart` event for whichever element
|
|
@@ -8211,7 +8218,7 @@ class Bn extends Z {
|
|
|
8211
8218
|
newIndex: this.view.state.rowIndex,
|
|
8212
8219
|
tablePos: this.view.tablePos
|
|
8213
8220
|
})
|
|
8214
|
-
),
|
|
8221
|
+
), Ye(this.editor._tiptapEditor.view.root), i.dataTransfer.setDragImage(E, 0, 0), i.dataTransfer.effectAllowed = "copyMove";
|
|
8215
8222
|
});
|
|
8216
8223
|
/**
|
|
8217
8224
|
* Callback that should be set on the `dragEnd` event for both the element
|
|
@@ -8224,7 +8231,7 @@ class Bn extends Z {
|
|
|
8224
8231
|
);
|
|
8225
8232
|
this.view.state.draggingState = void 0, this.view.emitUpdate(), this.editor.dispatch(
|
|
8226
8233
|
this.editor._tiptapEditor.state.tr.setMeta(Q, null)
|
|
8227
|
-
),
|
|
8234
|
+
), Sn(this.editor._tiptapEditor.view.root);
|
|
8228
8235
|
});
|
|
8229
8236
|
/**
|
|
8230
8237
|
* Freezes the drag handles. When frozen, they will stay attached to the same
|
|
@@ -8242,7 +8249,7 @@ class Bn extends Z {
|
|
|
8242
8249
|
});
|
|
8243
8250
|
this.editor = i, this.plugin = new x({
|
|
8244
8251
|
key: Q,
|
|
8245
|
-
view: (o) => (this.view = new
|
|
8252
|
+
view: (o) => (this.view = new Bn(i, o, (n) => {
|
|
8246
8253
|
this.emit("update", n);
|
|
8247
8254
|
}), this.view),
|
|
8248
8255
|
// We use decorations to render the drop cursor when dragging a table row
|
|
@@ -8295,8 +8302,8 @@ class Bn extends Z {
|
|
|
8295
8302
|
return this.on("update", i);
|
|
8296
8303
|
}
|
|
8297
8304
|
}
|
|
8298
|
-
async function
|
|
8299
|
-
const i = e.state.selection.content().content, n =
|
|
8305
|
+
async function Et(e, t) {
|
|
8306
|
+
const i = e.state.selection.content().content, n = Be(
|
|
8300
8307
|
e.state.schema,
|
|
8301
8308
|
t
|
|
8302
8309
|
).serializeProseMirrorFragment(
|
|
@@ -8304,25 +8311,25 @@ async function vt(e, t) {
|
|
|
8304
8311
|
{}
|
|
8305
8312
|
);
|
|
8306
8313
|
await ie();
|
|
8307
|
-
const a =
|
|
8314
|
+
const a = ue(
|
|
8308
8315
|
e.state.schema,
|
|
8309
8316
|
t
|
|
8310
8317
|
).exportProseMirrorFragment(
|
|
8311
8318
|
i,
|
|
8312
8319
|
{}
|
|
8313
|
-
), s = await
|
|
8320
|
+
), s = await Ne(a);
|
|
8314
8321
|
return { internalHTML: n, externalHTML: a, plainText: s };
|
|
8315
8322
|
}
|
|
8316
|
-
const
|
|
8323
|
+
const Qe = (e, t, i) => {
|
|
8317
8324
|
i.preventDefault(), i.clipboardData.clearData(), "node" in t.state.selection && t.state.selection.node.type.spec.group === "blockContent" && e.dispatch(
|
|
8318
8325
|
e._tiptapEditor.state.tr.setSelection(
|
|
8319
|
-
new
|
|
8326
|
+
new ce(t.state.doc.resolve(t.state.selection.from - 1))
|
|
8320
8327
|
)
|
|
8321
8328
|
), (async () => {
|
|
8322
|
-
const { internalHTML: o, externalHTML: n, plainText: r } = await
|
|
8329
|
+
const { internalHTML: o, externalHTML: n, plainText: r } = await Et(t, e);
|
|
8323
8330
|
i.clipboardData.setData("blocknote/html", o), i.clipboardData.setData("text/html", n), i.clipboardData.setData("text/plain", r);
|
|
8324
8331
|
})();
|
|
8325
|
-
},
|
|
8332
|
+
}, In = (e) => I.create({
|
|
8326
8333
|
name: "copyToClipboard",
|
|
8327
8334
|
addProseMirrorPlugins() {
|
|
8328
8335
|
return [
|
|
@@ -8330,10 +8337,10 @@ const Je = (e, t, i) => {
|
|
|
8330
8337
|
props: {
|
|
8331
8338
|
handleDOMEvents: {
|
|
8332
8339
|
copy(t, i) {
|
|
8333
|
-
return
|
|
8340
|
+
return Qe(e, t, i), !0;
|
|
8334
8341
|
},
|
|
8335
8342
|
cut(t, i) {
|
|
8336
|
-
return
|
|
8343
|
+
return Qe(e, t, i), t.dispatch(t.state.tr.deleteSelection()), !0;
|
|
8337
8344
|
},
|
|
8338
8345
|
// This is for the use-case in which only a block without content
|
|
8339
8346
|
// is selected, e.g. an image block, and dragged (not using the
|
|
@@ -8342,12 +8349,12 @@ const Je = (e, t, i) => {
|
|
|
8342
8349
|
if ("node" in t.state.selection && t.state.selection.node.type.spec.group === "blockContent")
|
|
8343
8350
|
return e.dispatch(
|
|
8344
8351
|
e._tiptapEditor.state.tr.setSelection(
|
|
8345
|
-
new
|
|
8352
|
+
new ce(
|
|
8346
8353
|
t.state.doc.resolve(t.state.selection.from - 1)
|
|
8347
8354
|
)
|
|
8348
8355
|
)
|
|
8349
8356
|
), i.preventDefault(), i.dataTransfer.clearData(), (async () => {
|
|
8350
|
-
const { internalHTML: o, externalHTML: n, plainText: r } = await
|
|
8357
|
+
const { internalHTML: o, externalHTML: n, plainText: r } = await Et(t, e);
|
|
8351
8358
|
i.dataTransfer.setData("blocknote/html", o), i.dataTransfer.setData("text/html", n), i.dataTransfer.setData("text/plain", r);
|
|
8352
8359
|
})(), !0;
|
|
8353
8360
|
}
|
|
@@ -8356,18 +8363,18 @@ const Je = (e, t, i) => {
|
|
|
8356
8363
|
})
|
|
8357
8364
|
];
|
|
8358
8365
|
}
|
|
8359
|
-
}),
|
|
8366
|
+
}), Pe = [
|
|
8360
8367
|
"blocknote/html",
|
|
8361
8368
|
"Files",
|
|
8362
8369
|
"text/html",
|
|
8363
8370
|
"text/plain"
|
|
8364
8371
|
];
|
|
8365
|
-
function
|
|
8372
|
+
function An(e, t) {
|
|
8366
8373
|
if (!e.startsWith(".") || !t.startsWith("."))
|
|
8367
8374
|
throw new Error("The strings provided are not valid file extensions.");
|
|
8368
8375
|
return e === t;
|
|
8369
8376
|
}
|
|
8370
|
-
function
|
|
8377
|
+
function Nn(e, t) {
|
|
8371
8378
|
const i = e.split("/"), o = t.split("/");
|
|
8372
8379
|
if (i.length !== 2)
|
|
8373
8380
|
throw new Error(`The string ${e} is not a valid MIME type.`);
|
|
@@ -8375,14 +8382,14 @@ function An(e, t) {
|
|
|
8375
8382
|
throw new Error(`The string ${t} is not a valid MIME type.`);
|
|
8376
8383
|
return i[1] === "*" || o[1] === "*" ? i[0] === o[0] : (i[0] === "*" || o[0] === "*" || i[0] === o[0]) && i[1] === o[1];
|
|
8377
8384
|
}
|
|
8378
|
-
async function
|
|
8385
|
+
async function Ct(e, t) {
|
|
8379
8386
|
if (!t.uploadFile)
|
|
8380
8387
|
return;
|
|
8381
8388
|
const i = "dataTransfer" in e ? e.dataTransfer : e.clipboardData;
|
|
8382
8389
|
if (i === null)
|
|
8383
8390
|
return;
|
|
8384
8391
|
let o = null;
|
|
8385
|
-
for (const a of
|
|
8392
|
+
for (const a of Pe)
|
|
8386
8393
|
if (i.types.includes(a)) {
|
|
8387
8394
|
o = a;
|
|
8388
8395
|
break;
|
|
@@ -8401,7 +8408,7 @@ async function xt(e, t) {
|
|
|
8401
8408
|
for (const d of r)
|
|
8402
8409
|
for (const u of d.fileBlockAccept || []) {
|
|
8403
8410
|
const p = u.startsWith("."), h = n[a].getAsFile();
|
|
8404
|
-
if (h && (!p && h.type &&
|
|
8411
|
+
if (h && (!p && h.type && Nn(n[a].type, u) || p && An(
|
|
8405
8412
|
"." + h.name.split(".").pop(),
|
|
8406
8413
|
u
|
|
8407
8414
|
))) {
|
|
@@ -8451,7 +8458,7 @@ async function xt(e, t) {
|
|
|
8451
8458
|
}
|
|
8452
8459
|
}
|
|
8453
8460
|
}
|
|
8454
|
-
const
|
|
8461
|
+
const Pn = (e) => I.create({
|
|
8455
8462
|
name: "dropFile",
|
|
8456
8463
|
addProseMirrorPlugins() {
|
|
8457
8464
|
return [
|
|
@@ -8462,19 +8469,19 @@ const Nn = (e) => I.create({
|
|
|
8462
8469
|
if (!e.isEditable)
|
|
8463
8470
|
return;
|
|
8464
8471
|
let o = null;
|
|
8465
|
-
for (const n of
|
|
8472
|
+
for (const n of Pe)
|
|
8466
8473
|
if (i.dataTransfer.types.includes(n)) {
|
|
8467
8474
|
o = n;
|
|
8468
8475
|
break;
|
|
8469
8476
|
}
|
|
8470
|
-
return o === null ? !0 : o === "Files" ? (
|
|
8477
|
+
return o === null ? !0 : o === "Files" ? (Ct(i, e), !0) : !1;
|
|
8471
8478
|
}
|
|
8472
8479
|
}
|
|
8473
8480
|
}
|
|
8474
8481
|
})
|
|
8475
8482
|
];
|
|
8476
8483
|
}
|
|
8477
|
-
}),
|
|
8484
|
+
}), Hn = (e) => I.create({
|
|
8478
8485
|
name: "pasteFromClipboard",
|
|
8479
8486
|
addProseMirrorPlugins() {
|
|
8480
8487
|
return [
|
|
@@ -8485,7 +8492,7 @@ const Nn = (e) => I.create({
|
|
|
8485
8492
|
if (i.preventDefault(), !e.isEditable)
|
|
8486
8493
|
return;
|
|
8487
8494
|
let o = null;
|
|
8488
|
-
for (const r of
|
|
8495
|
+
for (const r of Pe)
|
|
8489
8496
|
if (i.clipboardData.types.includes(r)) {
|
|
8490
8497
|
o = r;
|
|
8491
8498
|
break;
|
|
@@ -8493,16 +8500,16 @@ const Nn = (e) => I.create({
|
|
|
8493
8500
|
if (o === null)
|
|
8494
8501
|
return !0;
|
|
8495
8502
|
if (o === "Files")
|
|
8496
|
-
return
|
|
8503
|
+
return Ct(i, e), !0;
|
|
8497
8504
|
let n = i.clipboardData.getData(o);
|
|
8498
|
-
return o === "text/html" && (n =
|
|
8505
|
+
return o === "text/html" && (n = wt(n.trim()).innerHTML), e._tiptapEditor.view.pasteHTML(n), !0;
|
|
8499
8506
|
}
|
|
8500
8507
|
}
|
|
8501
8508
|
}
|
|
8502
8509
|
})
|
|
8503
8510
|
];
|
|
8504
8511
|
}
|
|
8505
|
-
}),
|
|
8512
|
+
}), Un = I.create({
|
|
8506
8513
|
name: "blockBackgroundColor",
|
|
8507
8514
|
addGlobalAttributes() {
|
|
8508
8515
|
return [
|
|
@@ -8520,7 +8527,7 @@ const Nn = (e) => I.create({
|
|
|
8520
8527
|
}
|
|
8521
8528
|
];
|
|
8522
8529
|
}
|
|
8523
|
-
}),
|
|
8530
|
+
}), Dn = I.create({
|
|
8524
8531
|
name: "textAlignment",
|
|
8525
8532
|
addGlobalAttributes() {
|
|
8526
8533
|
return [
|
|
@@ -8546,7 +8553,7 @@ const Nn = (e) => I.create({
|
|
|
8546
8553
|
}
|
|
8547
8554
|
];
|
|
8548
8555
|
}
|
|
8549
|
-
}),
|
|
8556
|
+
}), jn = I.create({
|
|
8550
8557
|
name: "blockTextColor",
|
|
8551
8558
|
addGlobalAttributes() {
|
|
8552
8559
|
return [
|
|
@@ -8564,7 +8571,7 @@ const Nn = (e) => I.create({
|
|
|
8564
8571
|
}
|
|
8565
8572
|
];
|
|
8566
8573
|
}
|
|
8567
|
-
}),
|
|
8574
|
+
}), zn = I.create({
|
|
8568
8575
|
name: "trailingNode",
|
|
8569
8576
|
addProseMirrorPlugins() {
|
|
8570
8577
|
const e = new L(this.name);
|
|
@@ -8599,8 +8606,8 @@ const Nn = (e) => I.create({
|
|
|
8599
8606
|
})
|
|
8600
8607
|
];
|
|
8601
8608
|
}
|
|
8602
|
-
}),
|
|
8603
|
-
key:
|
|
8609
|
+
}), Rn = new L("non-editable-block"), Vn = () => new x({
|
|
8610
|
+
key: Rn,
|
|
8604
8611
|
props: {
|
|
8605
8612
|
handleKeyDown: (e, t) => {
|
|
8606
8613
|
if ("node" in e.state.selection) {
|
|
@@ -8625,13 +8632,13 @@ const Nn = (e) => I.create({
|
|
|
8625
8632
|
return !1;
|
|
8626
8633
|
}
|
|
8627
8634
|
}
|
|
8628
|
-
}),
|
|
8635
|
+
}), On = {
|
|
8629
8636
|
blockColor: "data-block-color",
|
|
8630
8637
|
blockStyle: "data-block-style",
|
|
8631
8638
|
id: "data-id",
|
|
8632
8639
|
depth: "data-depth",
|
|
8633
8640
|
depthChange: "data-depth-change"
|
|
8634
|
-
},
|
|
8641
|
+
}, Fn = q.create({
|
|
8635
8642
|
name: "blockContainer",
|
|
8636
8643
|
group: "blockContainer",
|
|
8637
8644
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -8647,7 +8654,7 @@ const Nn = (e) => I.create({
|
|
|
8647
8654
|
if (typeof e == "string")
|
|
8648
8655
|
return !1;
|
|
8649
8656
|
const t = {};
|
|
8650
|
-
for (const [i, o] of Object.entries(
|
|
8657
|
+
for (const [i, o] of Object.entries(On))
|
|
8651
8658
|
e.getAttribute(o) && (t[i] = e.getAttribute(o));
|
|
8652
8659
|
return e.getAttribute("data-node-type") === "blockContainer" ? t : !1;
|
|
8653
8660
|
}
|
|
@@ -8664,7 +8671,7 @@ const Nn = (e) => I.create({
|
|
|
8664
8671
|
...((n = this.options.domAttributes) == null ? void 0 : n.block) || {},
|
|
8665
8672
|
...e
|
|
8666
8673
|
}, o = document.createElement("div");
|
|
8667
|
-
o.className =
|
|
8674
|
+
o.className = V("bn-block", i.class), o.setAttribute("data-node-type", this.name);
|
|
8668
8675
|
for (const [r, a] of Object.entries(i))
|
|
8669
8676
|
r !== "class" && o.setAttribute(r, a);
|
|
8670
8677
|
return t.appendChild(o), {
|
|
@@ -8717,19 +8724,19 @@ const Nn = (e) => I.create({
|
|
|
8717
8724
|
let p = "keep";
|
|
8718
8725
|
if (t.content)
|
|
8719
8726
|
if (typeof t.content == "string")
|
|
8720
|
-
p =
|
|
8727
|
+
p = R(
|
|
8721
8728
|
[t.content],
|
|
8722
8729
|
i.schema,
|
|
8723
8730
|
this.options.editor.schema.styleSchema
|
|
8724
8731
|
);
|
|
8725
8732
|
else if (Array.isArray(t.content))
|
|
8726
|
-
p =
|
|
8733
|
+
p = R(
|
|
8727
8734
|
t.content,
|
|
8728
8735
|
i.schema,
|
|
8729
8736
|
this.options.editor.schema.styleSchema
|
|
8730
8737
|
);
|
|
8731
8738
|
else if (t.content.type === "tableContent")
|
|
8732
|
-
p =
|
|
8739
|
+
p = nt(
|
|
8733
8740
|
t.content,
|
|
8734
8741
|
i.schema,
|
|
8735
8742
|
this.options.editor.schema.styleSchema
|
|
@@ -8758,7 +8765,7 @@ const Nn = (e) => I.create({
|
|
|
8758
8765
|
p
|
|
8759
8766
|
)
|
|
8760
8767
|
).setSelection(
|
|
8761
|
-
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)) : (
|
|
8762
8769
|
// Need to offset the position as we have to get through the
|
|
8763
8770
|
// `tableRow` and `tableCell` nodes to get to the
|
|
8764
8771
|
// `tableParagraph` node we want to set the selection in.
|
|
@@ -8962,7 +8969,7 @@ const Nn = (e) => I.create({
|
|
|
8962
8969
|
}
|
|
8963
8970
|
};
|
|
8964
8971
|
}
|
|
8965
|
-
}),
|
|
8972
|
+
}), Gn = q.create({
|
|
8966
8973
|
name: "blockGroup",
|
|
8967
8974
|
group: "blockGroup",
|
|
8968
8975
|
content: "blockContainer+",
|
|
@@ -8980,7 +8987,7 @@ const Nn = (e) => I.create({
|
|
|
8980
8987
|
...((o = this.options.domAttributes) == null ? void 0 : o.blockGroup) || {},
|
|
8981
8988
|
...e
|
|
8982
8989
|
}, i = document.createElement("div");
|
|
8983
|
-
i.className =
|
|
8990
|
+
i.className = V(
|
|
8984
8991
|
"bn-block-group",
|
|
8985
8992
|
t.class
|
|
8986
8993
|
), i.setAttribute("data-node-type", "blockGroup");
|
|
@@ -8991,11 +8998,11 @@ const Nn = (e) => I.create({
|
|
|
8991
8998
|
contentDOM: i
|
|
8992
8999
|
};
|
|
8993
9000
|
}
|
|
8994
|
-
}),
|
|
9001
|
+
}), Wn = q.create({
|
|
8995
9002
|
name: "doc",
|
|
8996
9003
|
topNode: !0,
|
|
8997
9004
|
content: "blockGroup"
|
|
8998
|
-
}),
|
|
9005
|
+
}), Kn = (e) => {
|
|
8999
9006
|
var o;
|
|
9000
9007
|
const t = [
|
|
9001
9008
|
J.ClipboardTextSerializer,
|
|
@@ -9004,18 +9011,18 @@ const Nn = (e) => I.create({
|
|
|
9004
9011
|
J.FocusEvents,
|
|
9005
9012
|
J.Tabindex,
|
|
9006
9013
|
// DevTools,
|
|
9007
|
-
|
|
9014
|
+
di,
|
|
9008
9015
|
// DropCursor,
|
|
9009
9016
|
oe.configure({
|
|
9010
9017
|
types: ["blockContainer"],
|
|
9011
9018
|
setIdAttribute: e.setIdAttribute
|
|
9012
9019
|
}),
|
|
9013
|
-
|
|
9020
|
+
ci.extend({ priority: 10 }),
|
|
9014
9021
|
// Comments,
|
|
9015
9022
|
// basics:
|
|
9016
|
-
|
|
9023
|
+
hi,
|
|
9017
9024
|
// marks:
|
|
9018
|
-
|
|
9025
|
+
pi.extend({
|
|
9019
9026
|
addKeyboardShortcuts() {
|
|
9020
9027
|
return {
|
|
9021
9028
|
"Mod-k": () => (this.editor.commands.toggleLink({ href: "" }), !0)
|
|
@@ -9023,9 +9030,9 @@ const Nn = (e) => I.create({
|
|
|
9023
9030
|
}
|
|
9024
9031
|
}),
|
|
9025
9032
|
...Object.values(e.styleSpecs).map((n) => n.implementation.mark),
|
|
9026
|
-
|
|
9027
|
-
Hn,
|
|
9033
|
+
jn,
|
|
9028
9034
|
Un,
|
|
9035
|
+
Dn,
|
|
9029
9036
|
// make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
|
|
9030
9037
|
I.create({
|
|
9031
9038
|
name: "OverrideEscape",
|
|
@@ -9036,12 +9043,12 @@ const Nn = (e) => I.create({
|
|
|
9036
9043
|
}
|
|
9037
9044
|
}),
|
|
9038
9045
|
// nodes
|
|
9039
|
-
|
|
9040
|
-
|
|
9046
|
+
Wn,
|
|
9047
|
+
Fn.configure({
|
|
9041
9048
|
editor: e.editor,
|
|
9042
9049
|
domAttributes: e.domAttributes
|
|
9043
9050
|
}),
|
|
9044
|
-
|
|
9051
|
+
Gn.configure({
|
|
9045
9052
|
domAttributes: e.domAttributes
|
|
9046
9053
|
}),
|
|
9047
9054
|
...Object.values(e.inlineContentSpecs).filter((n) => n.config !== "link" && n.config !== "text").map((n) => n.implementation.node.configure({
|
|
@@ -9061,17 +9068,17 @@ const Nn = (e) => I.create({
|
|
|
9061
9068
|
domAttributes: e.domAttributes
|
|
9062
9069
|
})
|
|
9063
9070
|
]),
|
|
9064
|
-
|
|
9071
|
+
In(e.editor),
|
|
9072
|
+
Hn(e.editor),
|
|
9065
9073
|
Pn(e.editor),
|
|
9066
|
-
|
|
9067
|
-
si.configure({ width: 5, color: "#ddeeff" }),
|
|
9074
|
+
li.configure({ width: 5, color: "#ddeeff" }),
|
|
9068
9075
|
// This needs to be at the bottom of this list, because Key events (such as enter, when selecting a /command),
|
|
9069
9076
|
// should be handled before Enter handlers in other components like splitListItem
|
|
9070
|
-
...e.trailingBlock === void 0 || e.trailingBlock ? [
|
|
9077
|
+
...e.trailingBlock === void 0 || e.trailingBlock ? [zn] : []
|
|
9071
9078
|
];
|
|
9072
9079
|
if (e.collaboration) {
|
|
9073
9080
|
if (t.push(
|
|
9074
|
-
|
|
9081
|
+
ai.configure({
|
|
9075
9082
|
fragment: e.collaboration.fragment
|
|
9076
9083
|
})
|
|
9077
9084
|
), (o = e.collaboration.provider) != null && o.awareness) {
|
|
@@ -9084,7 +9091,7 @@ const Nn = (e) => I.create({
|
|
|
9084
9091
|
return a.insertBefore(l, null), a.insertBefore(s, null), a.insertBefore(d, null), a;
|
|
9085
9092
|
};
|
|
9086
9093
|
t.push(
|
|
9087
|
-
|
|
9094
|
+
si.configure({
|
|
9088
9095
|
user: e.collaboration.user,
|
|
9089
9096
|
render: e.collaboration.renderCursor || n,
|
|
9090
9097
|
provider: e.collaboration.provider
|
|
@@ -9092,24 +9099,24 @@ const Nn = (e) => I.create({
|
|
|
9092
9099
|
);
|
|
9093
9100
|
}
|
|
9094
9101
|
} else
|
|
9095
|
-
t.push(
|
|
9102
|
+
t.push(ui);
|
|
9096
9103
|
const i = e.disableExtensions || [];
|
|
9097
9104
|
return t.filter((n) => !i.includes(n.name));
|
|
9098
9105
|
};
|
|
9099
|
-
function
|
|
9106
|
+
function $n(e, t) {
|
|
9100
9107
|
const i = [];
|
|
9101
9108
|
return e.forEach((o, n, r) => {
|
|
9102
9109
|
r !== t && i.push(o);
|
|
9103
9110
|
}), N.from(i);
|
|
9104
9111
|
}
|
|
9105
|
-
function
|
|
9112
|
+
function qn(e, t) {
|
|
9106
9113
|
let i = N.from(e.content);
|
|
9107
9114
|
for (let o = 0; o < i.childCount; o++)
|
|
9108
9115
|
if (i.child(o).type.spec.group === "blockContent") {
|
|
9109
9116
|
const n = [i.child(o)];
|
|
9110
9117
|
if (o + 1 < i.childCount && i.child(o + 1).type.spec.group === "blockGroup") {
|
|
9111
9118
|
const a = i.child(o + 1).child(0).child(0);
|
|
9112
|
-
(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));
|
|
9113
9120
|
}
|
|
9114
9121
|
const r = t.state.schema.nodes.blockContainer.create(
|
|
9115
9122
|
void 0,
|
|
@@ -9119,12 +9126,12 @@ function $n(e, t) {
|
|
|
9119
9126
|
}
|
|
9120
9127
|
return new z(i, e.openStart, e.openEnd);
|
|
9121
9128
|
}
|
|
9122
|
-
function
|
|
9129
|
+
function ye(e) {
|
|
9123
9130
|
return e && Object.fromEntries(
|
|
9124
9131
|
Object.entries(e).filter(([, t]) => t !== void 0)
|
|
9125
9132
|
);
|
|
9126
9133
|
}
|
|
9127
|
-
class
|
|
9134
|
+
class He {
|
|
9128
9135
|
constructor(t) {
|
|
9129
9136
|
c(this, "blockSpecs");
|
|
9130
9137
|
c(this, "inlineContentSpecs");
|
|
@@ -9136,15 +9143,15 @@ class Ne {
|
|
|
9136
9143
|
c(this, "BlockNoteEditor", "only for types");
|
|
9137
9144
|
c(this, "Block", "only for types");
|
|
9138
9145
|
c(this, "PartialBlock", "only for types");
|
|
9139
|
-
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(
|
|
9140
9147
|
this.inlineContentSpecs
|
|
9141
|
-
), this.styleSchema =
|
|
9148
|
+
), this.styleSchema = mt(this.styleSpecs);
|
|
9142
9149
|
}
|
|
9143
9150
|
static create(t) {
|
|
9144
|
-
return new
|
|
9151
|
+
return new He(t);
|
|
9145
9152
|
}
|
|
9146
9153
|
}
|
|
9147
|
-
class
|
|
9154
|
+
const de = class de extends Gt {
|
|
9148
9155
|
constructor(i, o) {
|
|
9149
9156
|
super({ ...i, content: void 0 });
|
|
9150
9157
|
c(this, "_state");
|
|
@@ -9163,14 +9170,14 @@ class Et extends Ft {
|
|
|
9163
9170
|
if (r)
|
|
9164
9171
|
return r;
|
|
9165
9172
|
const d = a.apply(n.nodes.doc, l), u = JSON.parse(JSON.stringify(d.toJSON()));
|
|
9166
|
-
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;
|
|
9167
9174
|
};
|
|
9168
9175
|
let s;
|
|
9169
9176
|
try {
|
|
9170
9177
|
const l = i == null ? void 0 : i.content.map(
|
|
9171
9178
|
(d) => U(d, this.schema, o).toJSON()
|
|
9172
9179
|
);
|
|
9173
|
-
s =
|
|
9180
|
+
s = Wt(
|
|
9174
9181
|
{
|
|
9175
9182
|
type: "doc",
|
|
9176
9183
|
content: [
|
|
@@ -9191,7 +9198,7 @@ class Et extends Ft {
|
|
|
9191
9198
|
"Error creating document from blocks passed as `initialContent`:\n" + +JSON.stringify(i.content)
|
|
9192
9199
|
);
|
|
9193
9200
|
}
|
|
9194
|
-
this._state =
|
|
9201
|
+
this._state = $t.create({
|
|
9195
9202
|
doc: s,
|
|
9196
9203
|
schema: this.schema
|
|
9197
9204
|
// selection: selection || undefined,
|
|
@@ -9208,7 +9215,7 @@ class Et extends Ft {
|
|
|
9208
9215
|
*/
|
|
9209
9216
|
createViewAlternative() {
|
|
9210
9217
|
queueMicrotask(() => {
|
|
9211
|
-
this.view = new
|
|
9218
|
+
this.view = new ri(
|
|
9212
9219
|
{ mount: this.options.element },
|
|
9213
9220
|
// use mount option so that we reuse the existing element instead of creating a new one
|
|
9214
9221
|
{
|
|
@@ -9221,15 +9228,26 @@ class Et extends Ft {
|
|
|
9221
9228
|
const i = this.state.reconfigure({
|
|
9222
9229
|
plugins: this.extensionManager.plugins
|
|
9223
9230
|
});
|
|
9224
|
-
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;
|
|
9225
9232
|
});
|
|
9226
9233
|
}
|
|
9227
|
-
}
|
|
9228
|
-
|
|
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() {
|
|
9229
9247
|
this.options.onPaste = this.options.onDrop = void 0;
|
|
9230
9248
|
};
|
|
9231
|
-
const
|
|
9232
|
-
key:
|
|
9249
|
+
const Xn = new L("blocknote-placeholder"), Zn = (e, t) => new x({
|
|
9250
|
+
key: Xn,
|
|
9233
9251
|
view: () => {
|
|
9234
9252
|
const i = document.createElement("style"), o = e._tiptapEditor.options.injectNonce;
|
|
9235
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);
|
|
@@ -9273,7 +9291,7 @@ const qn = new L("blocknote-placeholder"), Xn = (e, t) => new x({
|
|
|
9273
9291
|
return K.create(o, [l]);
|
|
9274
9292
|
}
|
|
9275
9293
|
}
|
|
9276
|
-
}),
|
|
9294
|
+
}), et = new L("previous-blocks"), Jn = {
|
|
9277
9295
|
// Numbered List Items
|
|
9278
9296
|
index: "index",
|
|
9279
9297
|
// Headings
|
|
@@ -9282,17 +9300,17 @@ const qn = new L("blocknote-placeholder"), Xn = (e, t) => new x({
|
|
|
9282
9300
|
type: "type",
|
|
9283
9301
|
depth: "depth",
|
|
9284
9302
|
"depth-change": "depth-change"
|
|
9285
|
-
},
|
|
9303
|
+
}, Yn = () => {
|
|
9286
9304
|
let e;
|
|
9287
9305
|
return new x({
|
|
9288
|
-
key:
|
|
9306
|
+
key: et,
|
|
9289
9307
|
view(t) {
|
|
9290
9308
|
return {
|
|
9291
9309
|
update: async (i, o) => {
|
|
9292
9310
|
var n;
|
|
9293
9311
|
((n = this.key) == null ? void 0 : n.getState(i.state).updatedBlocks.size) > 0 && (e = setTimeout(() => {
|
|
9294
9312
|
i.dispatch(
|
|
9295
|
-
i.state.tr.setMeta(
|
|
9313
|
+
i.state.tr.setMeta(et, { clearUpdate: !0 })
|
|
9296
9314
|
);
|
|
9297
9315
|
}, 0));
|
|
9298
9316
|
},
|
|
@@ -9315,9 +9333,9 @@ const qn = new L("blocknote-placeholder"), Xn = (e, t) => new x({
|
|
|
9315
9333
|
apply(t, i, o, n) {
|
|
9316
9334
|
if (i.currentTransactionOldBlockAttrs = {}, i.updatedBlocks.clear(), !t.docChanged || o.doc.eq(n.doc))
|
|
9317
9335
|
return i;
|
|
9318
|
-
const r = {}, a =
|
|
9336
|
+
const r = {}, a = Re(o.doc, (d) => d.attrs.id), s = new Map(
|
|
9319
9337
|
a.map((d) => [d.node.attrs.id, d])
|
|
9320
|
-
), l =
|
|
9338
|
+
), l = Re(n.doc, (d) => d.attrs.id);
|
|
9321
9339
|
for (const d of l) {
|
|
9322
9340
|
const u = s.get(d.node.attrs.id), p = u == null ? void 0 : u.node.firstChild, h = d.node.firstChild;
|
|
9323
9341
|
if (u && p && h) {
|
|
@@ -9350,7 +9368,7 @@ const qn = new L("blocknote-placeholder"), Xn = (e, t) => new x({
|
|
|
9350
9368
|
return;
|
|
9351
9369
|
const a = i.currentTransactionOldBlockAttrs[n.attrs.id], s = {};
|
|
9352
9370
|
for (const [d, u] of Object.entries(a))
|
|
9353
|
-
s["data-prev-" +
|
|
9371
|
+
s["data-prev-" + Jn[d]] = u || "none";
|
|
9354
9372
|
const l = $.node(r, r + n.nodeSize, {
|
|
9355
9373
|
...s
|
|
9356
9374
|
});
|
|
@@ -9359,12 +9377,12 @@ const qn = new L("blocknote-placeholder"), Xn = (e, t) => new x({
|
|
|
9359
9377
|
}
|
|
9360
9378
|
}
|
|
9361
9379
|
});
|
|
9362
|
-
},
|
|
9380
|
+
}, Qn = {
|
|
9363
9381
|
enableInputRules: !0,
|
|
9364
9382
|
enablePasteRules: !0,
|
|
9365
9383
|
enableCoreExtensions: !1
|
|
9366
9384
|
};
|
|
9367
|
-
class
|
|
9385
|
+
class St {
|
|
9368
9386
|
constructor(t) {
|
|
9369
9387
|
c(this, "_pmSchema");
|
|
9370
9388
|
/**
|
|
@@ -9445,10 +9463,10 @@ class Ct {
|
|
|
9445
9463
|
throw new Error(
|
|
9446
9464
|
"editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false"
|
|
9447
9465
|
);
|
|
9448
|
-
this.dictionary = t.dictionary ||
|
|
9466
|
+
this.dictionary = t.dictionary || tt;
|
|
9449
9467
|
const o = {
|
|
9450
9468
|
defaultStyles: !0,
|
|
9451
|
-
schema: t.schema ||
|
|
9469
|
+
schema: t.schema || He.create(),
|
|
9452
9470
|
_headless: !1,
|
|
9453
9471
|
...t,
|
|
9454
9472
|
placeholders: {
|
|
@@ -9456,8 +9474,8 @@ class Ct {
|
|
|
9456
9474
|
...t.placeholders
|
|
9457
9475
|
}
|
|
9458
9476
|
};
|
|
9459
|
-
this.schema = o.schema, this.blockImplementations = o.schema.blockSpecs, this.inlineContentImplementations = o.schema.inlineContentSpecs, this.styleImplementations = o.schema.styleSpecs, this.formattingToolbar = new
|
|
9460
|
-
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({
|
|
9461
9479
|
editor: this,
|
|
9462
9480
|
domAttributes: o.domAttributes || {},
|
|
9463
9481
|
blockSpecs: this.schema.blockSpecs,
|
|
@@ -9476,8 +9494,8 @@ class Ct {
|
|
|
9476
9494
|
this.suggestionMenus.plugin,
|
|
9477
9495
|
...this.filePanel ? [this.filePanel.plugin] : [],
|
|
9478
9496
|
...this.tableHandles ? [this.tableHandles.plugin] : [],
|
|
9479
|
-
|
|
9480
|
-
...this.options.animations ?? !0 ? [
|
|
9497
|
+
Zn(this, o.placeholders),
|
|
9498
|
+
...this.options.animations ?? !0 ? [Yn()] : []
|
|
9481
9499
|
]
|
|
9482
9500
|
});
|
|
9483
9501
|
if (n.push(r), o.uploadFile) {
|
|
@@ -9514,7 +9532,7 @@ class Ct {
|
|
|
9514
9532
|
"initialContent must be a non-empty array of blocks, received: " + a
|
|
9515
9533
|
);
|
|
9516
9534
|
const s = {
|
|
9517
|
-
...
|
|
9535
|
+
...Qn,
|
|
9518
9536
|
...o._tiptapOptions,
|
|
9519
9537
|
content: a,
|
|
9520
9538
|
extensions: [
|
|
@@ -9530,16 +9548,16 @@ class Ct {
|
|
|
9530
9548
|
tabIndex: "0",
|
|
9531
9549
|
...(p = (u = o._tiptapOptions) == null ? void 0 : u.editorProps) == null ? void 0 : p.attributes,
|
|
9532
9550
|
...(h = o.domAttributes) == null ? void 0 : h.editor,
|
|
9533
|
-
class:
|
|
9551
|
+
class: V(
|
|
9534
9552
|
"bn-editor",
|
|
9535
9553
|
o.defaultStyles ? "bn-default-styles" : "",
|
|
9536
9554
|
((f = (m = o.domAttributes) == null ? void 0 : m.editor) == null ? void 0 : f.class) || ""
|
|
9537
9555
|
)
|
|
9538
9556
|
},
|
|
9539
|
-
transformPasted:
|
|
9557
|
+
transformPasted: qn
|
|
9540
9558
|
}
|
|
9541
9559
|
};
|
|
9542
|
-
this.headless ? this._pmSchema =
|
|
9560
|
+
this.headless ? this._pmSchema = Kt(s.extensions) : (this._tiptapEditor = le.create(
|
|
9543
9561
|
s,
|
|
9544
9562
|
this.schema.styleSchema
|
|
9545
9563
|
), this._pmSchema = this._tiptapEditor.schema);
|
|
@@ -9548,7 +9566,7 @@ class Ct {
|
|
|
9548
9566
|
return this._pmSchema;
|
|
9549
9567
|
}
|
|
9550
9568
|
static create(t = {}) {
|
|
9551
|
-
return new
|
|
9569
|
+
return new St(t);
|
|
9552
9570
|
}
|
|
9553
9571
|
dispatch(t) {
|
|
9554
9572
|
this._tiptapEditor.dispatch(t);
|
|
@@ -9692,7 +9710,7 @@ class Ct {
|
|
|
9692
9710
|
* @param placement Whether the text cursor should be placed at the start or end of the block.
|
|
9693
9711
|
*/
|
|
9694
9712
|
setTextCursorPosition(t, i = "start") {
|
|
9695
|
-
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 } = _(
|
|
9696
9714
|
this._tiptapEditor.state.doc,
|
|
9697
9715
|
n + 2
|
|
9698
9716
|
), s = this.schema.blockSchema[a.type.name].content;
|
|
@@ -9766,7 +9784,7 @@ class Ct {
|
|
|
9766
9784
|
* `referenceBlock`. Inserts the blocks at the start of the existing block's children if "nested" is used.
|
|
9767
9785
|
*/
|
|
9768
9786
|
insertBlocks(t, i, o = "before") {
|
|
9769
|
-
return
|
|
9787
|
+
return $o(t, i, o, this);
|
|
9770
9788
|
}
|
|
9771
9789
|
/**
|
|
9772
9790
|
* Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
|
|
@@ -9776,14 +9794,14 @@ class Ct {
|
|
|
9776
9794
|
* @param update A partial block which defines how the existing block should be changed.
|
|
9777
9795
|
*/
|
|
9778
9796
|
updateBlock(t, i) {
|
|
9779
|
-
return
|
|
9797
|
+
return qo(t, i, this);
|
|
9780
9798
|
}
|
|
9781
9799
|
/**
|
|
9782
9800
|
* Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
|
|
9783
9801
|
* @param blocksToRemove An array of identifiers for existing blocks that should be removed.
|
|
9784
9802
|
*/
|
|
9785
9803
|
removeBlocks(t) {
|
|
9786
|
-
return
|
|
9804
|
+
return Xo(t, this);
|
|
9787
9805
|
}
|
|
9788
9806
|
/**
|
|
9789
9807
|
* Replaces existing blocks in the editor with new blocks. If the blocks that should be removed are not adjacent or
|
|
@@ -9793,7 +9811,7 @@ class Ct {
|
|
|
9793
9811
|
* @param blocksToInsert An array of partial blocks to replace the old ones with.
|
|
9794
9812
|
*/
|
|
9795
9813
|
replaceBlocks(t, i) {
|
|
9796
|
-
return
|
|
9814
|
+
return Zo(t, i, this);
|
|
9797
9815
|
}
|
|
9798
9816
|
/**
|
|
9799
9817
|
* Insert a piece of content at the current cursor position.
|
|
@@ -9801,12 +9819,12 @@ class Ct {
|
|
|
9801
9819
|
* @param content can be a string, or array of partial inline content elements
|
|
9802
9820
|
*/
|
|
9803
9821
|
insertInlineContent(t) {
|
|
9804
|
-
const i =
|
|
9822
|
+
const i = R(
|
|
9805
9823
|
t,
|
|
9806
9824
|
this.pmSchema,
|
|
9807
9825
|
this.schema.styleSchema
|
|
9808
9826
|
);
|
|
9809
|
-
|
|
9827
|
+
Jo(
|
|
9810
9828
|
{
|
|
9811
9829
|
from: this._tiptapEditor.state.selection.from,
|
|
9812
9830
|
to: this._tiptapEditor.state.selection.to
|
|
@@ -9942,7 +9960,7 @@ class Ct {
|
|
|
9942
9960
|
* @returns The blocks, serialized as an HTML string.
|
|
9943
9961
|
*/
|
|
9944
9962
|
async blocksToHTMLLossy(t = this.document) {
|
|
9945
|
-
return await ie(),
|
|
9963
|
+
return await ie(), ue(this.pmSchema, this).exportBlocks(t, {});
|
|
9946
9964
|
}
|
|
9947
9965
|
/**
|
|
9948
9966
|
* Serializes blocks into an HTML string in the format that would normally be rendered by the editor.
|
|
@@ -9954,7 +9972,7 @@ class Ct {
|
|
|
9954
9972
|
* @returns The blocks, serialized as an HTML string.
|
|
9955
9973
|
*/
|
|
9956
9974
|
async blocksToFullHTML(t) {
|
|
9957
|
-
return
|
|
9975
|
+
return Be(this.pmSchema, this).serializeBlocks(t, {});
|
|
9958
9976
|
}
|
|
9959
9977
|
/**
|
|
9960
9978
|
* Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
|
|
@@ -9964,7 +9982,7 @@ class Ct {
|
|
|
9964
9982
|
* @returns The blocks parsed from the HTML string.
|
|
9965
9983
|
*/
|
|
9966
9984
|
async tryParseHTMLToBlocks(t) {
|
|
9967
|
-
return
|
|
9985
|
+
return vt(
|
|
9968
9986
|
t,
|
|
9969
9987
|
this.schema.blockSchema,
|
|
9970
9988
|
this.schema.inlineContentSchema,
|
|
@@ -9979,7 +9997,7 @@ class Ct {
|
|
|
9979
9997
|
* @returns The blocks, serialized as a Markdown string.
|
|
9980
9998
|
*/
|
|
9981
9999
|
async blocksToMarkdownLossy(t = this.document) {
|
|
9982
|
-
return
|
|
10000
|
+
return en(t, this.pmSchema, this, {});
|
|
9983
10001
|
}
|
|
9984
10002
|
/**
|
|
9985
10003
|
* Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
|
|
@@ -9989,7 +10007,7 @@ class Ct {
|
|
|
9989
10007
|
* @returns The blocks parsed from the Markdown string.
|
|
9990
10008
|
*/
|
|
9991
10009
|
async tryParseMarkdownToBlocks(t) {
|
|
9992
|
-
return
|
|
10010
|
+
return ln(
|
|
9993
10011
|
t,
|
|
9994
10012
|
this.schema.blockSchema,
|
|
9995
10013
|
this.schema.inlineContentSchema,
|
|
@@ -10050,22 +10068,22 @@ class Ct {
|
|
|
10050
10068
|
);
|
|
10051
10069
|
}
|
|
10052
10070
|
}
|
|
10053
|
-
let ae,
|
|
10071
|
+
let ae, we;
|
|
10054
10072
|
async function Vr(e, t) {
|
|
10055
|
-
if (!
|
|
10073
|
+
if (!Go("text", e))
|
|
10056
10074
|
return [];
|
|
10057
10075
|
if (!ae) {
|
|
10058
|
-
ae = import("@emoji-mart/data"),
|
|
10076
|
+
ae = import("@emoji-mart/data"), we = await import("emoji-mart");
|
|
10059
10077
|
const n = (await ae).default;
|
|
10060
|
-
await
|
|
10078
|
+
await we.init({ data: n });
|
|
10061
10079
|
}
|
|
10062
10080
|
const i = (await ae).default;
|
|
10063
|
-
return (t.trim() === "" ? Object.values(i.emojis) : await
|
|
10081
|
+
return (t.trim() === "" ? Object.values(i.emojis) : await we.SearchIndex.search(t)).map((n) => ({
|
|
10064
10082
|
id: n.skins[0].native,
|
|
10065
10083
|
onItemClick: () => e.insertInlineContent(n.skins[0].native + " ")
|
|
10066
10084
|
}));
|
|
10067
10085
|
}
|
|
10068
|
-
function
|
|
10086
|
+
function er(e) {
|
|
10069
10087
|
let t = e.getTextCursorPosition().block, i = e.schema.blockSchema[t.type].content;
|
|
10070
10088
|
for (; i === "none"; )
|
|
10071
10089
|
t = e.getTextCursorPosition().nextBlock, i = e.schema.blockSchema[t.type].content, e.setTextCursorPosition(t, "end");
|
|
@@ -10079,9 +10097,9 @@ function M(e, t) {
|
|
|
10079
10097
|
"end"
|
|
10080
10098
|
));
|
|
10081
10099
|
const o = e.getTextCursorPosition().block;
|
|
10082
|
-
return
|
|
10100
|
+
return er(e), o;
|
|
10083
10101
|
}
|
|
10084
|
-
function
|
|
10102
|
+
function Or(e) {
|
|
10085
10103
|
const t = [];
|
|
10086
10104
|
return T("heading", e) && t.push(
|
|
10087
10105
|
{
|
|
@@ -10236,14 +10254,14 @@ function Rr(e) {
|
|
|
10236
10254
|
...e.dictionary.slash_menu.emoji
|
|
10237
10255
|
}), t;
|
|
10238
10256
|
}
|
|
10239
|
-
function
|
|
10257
|
+
function Fr(e, t) {
|
|
10240
10258
|
return e.filter(
|
|
10241
10259
|
({ title: i, aliases: o }) => i.toLowerCase().includes(t.toLowerCase()) || o && o.filter(
|
|
10242
10260
|
(n) => n.toLowerCase().includes(t.toLowerCase())
|
|
10243
10261
|
).length !== 0
|
|
10244
10262
|
);
|
|
10245
10263
|
}
|
|
10246
|
-
function
|
|
10264
|
+
function ve(e = "") {
|
|
10247
10265
|
return typeof e == "string" ? [
|
|
10248
10266
|
{
|
|
10249
10267
|
type: "text",
|
|
@@ -10252,22 +10270,22 @@ function ye(e = "") {
|
|
|
10252
10270
|
}
|
|
10253
10271
|
] : e;
|
|
10254
10272
|
}
|
|
10255
|
-
function
|
|
10256
|
-
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) ? {
|
|
10257
10275
|
...t,
|
|
10258
|
-
content:
|
|
10276
|
+
content: ve(t.content)
|
|
10259
10277
|
} : te(t) ? t : {
|
|
10260
10278
|
props: {},
|
|
10261
10279
|
...t,
|
|
10262
|
-
content:
|
|
10280
|
+
content: Mt(t.content)
|
|
10263
10281
|
}) : e;
|
|
10264
10282
|
}
|
|
10265
|
-
function
|
|
10283
|
+
function Gr(e, t) {
|
|
10266
10284
|
return t.map(
|
|
10267
|
-
(i) =>
|
|
10285
|
+
(i) => Tt(e, i)
|
|
10268
10286
|
);
|
|
10269
10287
|
}
|
|
10270
|
-
function
|
|
10288
|
+
function Tt(e, t) {
|
|
10271
10289
|
const i = {
|
|
10272
10290
|
id: "",
|
|
10273
10291
|
type: t.type,
|
|
@@ -10282,149 +10300,149 @@ function Mt(e, t) {
|
|
|
10282
10300
|
}
|
|
10283
10301
|
), {
|
|
10284
10302
|
...i,
|
|
10285
|
-
content:
|
|
10286
|
-
children: i.children.map((o) =>
|
|
10303
|
+
content: Mt(i.content),
|
|
10304
|
+
children: i.children.map((o) => Tt(e, o))
|
|
10287
10305
|
};
|
|
10288
10306
|
}
|
|
10289
|
-
function er(e) {
|
|
10290
|
-
e.id || (e.id = oe.options.generateID()), e.children && tr(e.children);
|
|
10291
|
-
}
|
|
10292
10307
|
function tr(e) {
|
|
10308
|
+
e.id || (e.id = oe.options.generateID()), e.children && ir(e.children);
|
|
10309
|
+
}
|
|
10310
|
+
function ir(e) {
|
|
10293
10311
|
for (const t of e)
|
|
10294
|
-
|
|
10312
|
+
tr(t);
|
|
10295
10313
|
}
|
|
10296
10314
|
export {
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
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,
|
|
10313
10331
|
oe as UniqueID,
|
|
10314
10332
|
P as UnreachableCaseError,
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
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,
|
|
10328
10346
|
U as blockToNode,
|
|
10329
|
-
|
|
10347
|
+
en as blocksToMarkdown,
|
|
10330
10348
|
se as camelToDataKebab,
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10349
|
+
zr as checkBlockHasDefaultProp,
|
|
10350
|
+
Wo as checkBlockIsDefaultType,
|
|
10351
|
+
Ur as checkBlockIsFileBlock,
|
|
10352
|
+
jr as checkBlockIsFileBlockWithPlaceholder,
|
|
10353
|
+
Dr as checkBlockIsFileBlockWithPreview,
|
|
10354
|
+
Ko as checkBlockTypeHasDefaultProp,
|
|
10337
10355
|
T as checkDefaultBlockTypeInSchema,
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10356
|
+
Go as checkDefaultInlineContentTypeInSchema,
|
|
10357
|
+
Ne as cleanHTMLToMarkdown,
|
|
10358
|
+
Te as contentNodeToInlineContent,
|
|
10359
|
+
Gi as createAddFileButton,
|
|
10360
|
+
pe as createBlockSpec,
|
|
10343
10361
|
X as createBlockSpecFromStronglyTypedTiptapNode,
|
|
10344
10362
|
O as createDefaultBlockDOMOutputSpec,
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10363
|
+
ft as createDefaultFilePreview,
|
|
10364
|
+
ue as createExternalHTMLExporter,
|
|
10365
|
+
Le as createFigureWithCaption,
|
|
10348
10366
|
ne as createFileAndCaptionWrapper,
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
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,
|
|
10358
10376
|
F as createStronglyTypedTiptapNode,
|
|
10359
|
-
|
|
10377
|
+
Nr as createStyleSpec,
|
|
10360
10378
|
j as createStyleSpecFromTipTapMark,
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10379
|
+
Rr as createSuggestionMenu,
|
|
10380
|
+
Oo as defaultBlockSchema,
|
|
10381
|
+
bt as defaultBlockSpecs,
|
|
10382
|
+
Ge as defaultBlockToHTML,
|
|
10383
|
+
Fo as defaultInlineContentSchema,
|
|
10384
|
+
kt as defaultInlineContentSpecs,
|
|
10367
10385
|
w as defaultProps,
|
|
10368
|
-
|
|
10369
|
-
|
|
10386
|
+
Hr as defaultStyleSchema,
|
|
10387
|
+
_t as defaultStyleSpecs,
|
|
10370
10388
|
H as esmDependencies,
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
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,
|
|
10378
10396
|
D as formatKeyboardShortcut,
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10397
|
+
pn as formattingToolbarPluginKey,
|
|
10398
|
+
Pi as getBlockFromPos,
|
|
10399
|
+
Kn as getBlockNoteExtensions,
|
|
10400
|
+
ut as getBlockSchemaFromSpecs,
|
|
10383
10401
|
B as getCurrentBlockContentType,
|
|
10384
10402
|
Vr as getDefaultEmojiPickerItems,
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
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,
|
|
10398
10416
|
ie as initializeESMDependencies,
|
|
10399
|
-
|
|
10417
|
+
R as inlineContentToNodes,
|
|
10400
10418
|
M as insertOrUpdateBlock,
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10419
|
+
Ni as isAppleOS,
|
|
10420
|
+
Ve as isLinkInlineContent,
|
|
10421
|
+
ot as isPartialLinkInlineContent,
|
|
10422
|
+
Lr as isSafari,
|
|
10405
10423
|
te as isStyledTextInlineContent,
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
|
|
10409
|
-
|
|
10424
|
+
fn as linkToolbarPluginKey,
|
|
10425
|
+
Tr as locales,
|
|
10426
|
+
ln as markdownToBlocks,
|
|
10427
|
+
V as mergeCSSClasses,
|
|
10410
10428
|
C as nodeToBlock,
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
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,
|
|
10419
10437
|
Vi as stylePropsToAttributes,
|
|
10420
|
-
|
|
10438
|
+
nt as tableContentToNodes,
|
|
10421
10439
|
Q as tableHandlesPluginKey,
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
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
|
|
10429
10447
|
};
|
|
10430
10448
|
//# sourceMappingURL=blocknote.js.map
|