@blocknote/core 0.25.0 → 0.25.1
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.cjs +7 -7
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +884 -885
- package/dist/blocknote.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -4
- package/src/editor/editor.css +6 -4
- package/src/extensions/Collaboration/createCollaborationExtensions.ts +8 -17
- package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +34 -17
package/dist/blocknote.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var p = (e, o, t) =>
|
|
4
|
-
import { Slice as ee, Fragment as U, DOMSerializer as
|
|
5
|
-
import { ReplaceStep as
|
|
6
|
-
import { Extension as j, combineTransactionSteps as
|
|
7
|
-
import { Plugin as T, PluginKey as A, TextSelection as V, NodeSelection as be, Selection as De, EditorState as
|
|
8
|
-
import { v4 as
|
|
9
|
-
import { createHighlightPlugin as
|
|
10
|
-
import { createParser as
|
|
11
|
-
import { bundledLanguagesInfo as
|
|
12
|
-
import { columnResizing as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { TableCell as
|
|
19
|
-
import { TableHeader as
|
|
20
|
-
import { TableRow as
|
|
21
|
-
import { Gapcursor as
|
|
22
|
-
import { HardBreak as
|
|
23
|
-
import { History as
|
|
24
|
-
import { Link as
|
|
25
|
-
import { Text as
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import { DecorationSet as N, Decoration as F, EditorView as
|
|
29
|
-
import { ySyncPluginKey as
|
|
30
|
-
import { dropCursor as
|
|
31
|
-
const
|
|
1
|
+
var Uo = Object.defineProperty;
|
|
2
|
+
var Ho = (e, o, t) => o in e ? Uo(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
|
+
var p = (e, o, t) => Ho(e, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { Slice as ee, Fragment as U, DOMSerializer as Ut, DOMParser as Ht, Node as Oo } from "prosemirror-model";
|
|
5
|
+
import { ReplaceStep as Vo, ReplaceAroundStep as ze } from "prosemirror-transform";
|
|
6
|
+
import { Extension as j, combineTransactionSteps as zo, getChangedRanges as Fo, findChildrenInRange as $o, Node as de, Mark as ge, InputRule as le, isTextSelection as Ot, callOrReturn as Go, getExtensionField as Wo, selectionToInsertionEnd as Ko, mergeAttributes as qo, isNodeSelection as Fe, posToDOMRect as Te, getMarkRange as pt, findChildren as mt, findParentNode as Xo, extensions as ce, Editor as Zo, createDocument as Jo, getSchema as Yo } from "@tiptap/core";
|
|
7
|
+
import { Plugin as T, PluginKey as A, TextSelection as V, NodeSelection as be, Selection as De, EditorState as Qo } from "prosemirror-state";
|
|
8
|
+
import { v4 as Vt } from "uuid";
|
|
9
|
+
import { createHighlightPlugin as ei } from "prosemirror-highlight";
|
|
10
|
+
import { createParser as ti } from "prosemirror-highlight/shiki";
|
|
11
|
+
import { bundledLanguagesInfo as zt, createHighlighter as oi } from "shiki";
|
|
12
|
+
import { columnResizing as ii, tableEditing as ni, goToNextCell as ht, TableView as ri, CellSelection as ke, TableMap as ft, addRowBefore as ai, addRowAfter as si, addColumnBefore as li, addColumnAfter as di, deleteRow as ci, deleteColumn as ui, mergeCells as pi, splitCell as mi } from "prosemirror-tables";
|
|
13
|
+
import hi from "@tiptap/extension-bold";
|
|
14
|
+
import fi from "@tiptap/extension-code";
|
|
15
|
+
import gi from "@tiptap/extension-italic";
|
|
16
|
+
import bi from "@tiptap/extension-strike";
|
|
17
|
+
import ki from "@tiptap/extension-underline";
|
|
18
|
+
import { TableCell as _i } from "@tiptap/extension-table-cell";
|
|
19
|
+
import { TableHeader as wi } from "@tiptap/extension-table-header";
|
|
20
|
+
import { TableRow as yi } from "@tiptap/extension-table-row";
|
|
21
|
+
import { Gapcursor as vi } from "@tiptap/extension-gapcursor";
|
|
22
|
+
import { HardBreak as Ci } from "@tiptap/extension-hard-break";
|
|
23
|
+
import { History as xi } from "@tiptap/extension-history";
|
|
24
|
+
import { Link as Si } from "@tiptap/extension-link";
|
|
25
|
+
import { Text as Ei } from "@tiptap/extension-text";
|
|
26
|
+
import Bi from "@tiptap/extension-collaboration";
|
|
27
|
+
import Ti from "@tiptap/extension-collaboration-cursor";
|
|
28
|
+
import { DecorationSet as N, Decoration as F, EditorView as Mi } from "prosemirror-view";
|
|
29
|
+
import { ySyncPluginKey as Ft, getRelativeSelection as Li } from "y-prosemirror";
|
|
30
|
+
import { dropCursor as Ii } from "prosemirror-dropcursor";
|
|
31
|
+
const Ai = {
|
|
32
32
|
slash_menu: {
|
|
33
33
|
heading: {
|
|
34
34
|
title: "عنوان 1",
|
|
@@ -356,7 +356,7 @@ const Pi = {
|
|
|
356
356
|
generic: {
|
|
357
357
|
ctrl_shortcut: "Ctrl"
|
|
358
358
|
}
|
|
359
|
-
},
|
|
359
|
+
}, Pi = {
|
|
360
360
|
slash_menu: {
|
|
361
361
|
heading: {
|
|
362
362
|
title: "Überschrift 1",
|
|
@@ -691,7 +691,7 @@ const Pi = {
|
|
|
691
691
|
generic: {
|
|
692
692
|
ctrl_shortcut: "Strg"
|
|
693
693
|
}
|
|
694
|
-
},
|
|
694
|
+
}, $t = {
|
|
695
695
|
slash_menu: {
|
|
696
696
|
heading: {
|
|
697
697
|
title: "Heading 1",
|
|
@@ -1036,7 +1036,7 @@ const Pi = {
|
|
|
1036
1036
|
generic: {
|
|
1037
1037
|
ctrl_shortcut: "Ctrl"
|
|
1038
1038
|
}
|
|
1039
|
-
},
|
|
1039
|
+
}, Ni = {
|
|
1040
1040
|
slash_menu: {
|
|
1041
1041
|
heading: {
|
|
1042
1042
|
title: "Encabezado 1",
|
|
@@ -1370,7 +1370,7 @@ const Pi = {
|
|
|
1370
1370
|
generic: {
|
|
1371
1371
|
ctrl_shortcut: "Ctrl"
|
|
1372
1372
|
}
|
|
1373
|
-
},
|
|
1373
|
+
}, ji = {
|
|
1374
1374
|
slash_menu: {
|
|
1375
1375
|
heading: {
|
|
1376
1376
|
title: "Titre 1",
|
|
@@ -1735,7 +1735,7 @@ const Pi = {
|
|
|
1735
1735
|
generic: {
|
|
1736
1736
|
ctrl_shortcut: "Ctrl"
|
|
1737
1737
|
}
|
|
1738
|
-
},
|
|
1738
|
+
}, Ri = {
|
|
1739
1739
|
slash_menu: {
|
|
1740
1740
|
heading: {
|
|
1741
1741
|
title: "Naslov 1",
|
|
@@ -2080,7 +2080,7 @@ const Pi = {
|
|
|
2080
2080
|
generic: {
|
|
2081
2081
|
ctrl_shortcut: "Ctrl"
|
|
2082
2082
|
}
|
|
2083
|
-
},
|
|
2083
|
+
}, Di = {
|
|
2084
2084
|
slash_menu: {
|
|
2085
2085
|
heading: {
|
|
2086
2086
|
title: "Fyrirsögn 1",
|
|
@@ -2415,7 +2415,7 @@ const Pi = {
|
|
|
2415
2415
|
generic: {
|
|
2416
2416
|
ctrl_shortcut: "Ctrl"
|
|
2417
2417
|
}
|
|
2418
|
-
},
|
|
2418
|
+
}, Ui = {
|
|
2419
2419
|
slash_menu: {
|
|
2420
2420
|
heading: {
|
|
2421
2421
|
title: "Intestazione 1",
|
|
@@ -2751,7 +2751,7 @@ const Pi = {
|
|
|
2751
2751
|
generic: {
|
|
2752
2752
|
ctrl_shortcut: "Ctrl"
|
|
2753
2753
|
}
|
|
2754
|
-
},
|
|
2754
|
+
}, Hi = {
|
|
2755
2755
|
slash_menu: {
|
|
2756
2756
|
heading: {
|
|
2757
2757
|
title: "見出し1",
|
|
@@ -3114,7 +3114,7 @@ const Pi = {
|
|
|
3114
3114
|
generic: {
|
|
3115
3115
|
ctrl_shortcut: "Ctrl"
|
|
3116
3116
|
}
|
|
3117
|
-
},
|
|
3117
|
+
}, Oi = {
|
|
3118
3118
|
slash_menu: {
|
|
3119
3119
|
heading: {
|
|
3120
3120
|
title: "제목1",
|
|
@@ -3470,7 +3470,7 @@ const Pi = {
|
|
|
3470
3470
|
generic: {
|
|
3471
3471
|
ctrl_shortcut: "Ctrl"
|
|
3472
3472
|
}
|
|
3473
|
-
},
|
|
3473
|
+
}, Vi = {
|
|
3474
3474
|
slash_menu: {
|
|
3475
3475
|
heading: {
|
|
3476
3476
|
title: "Kop 1",
|
|
@@ -3813,7 +3813,7 @@ const Pi = {
|
|
|
3813
3813
|
generic: {
|
|
3814
3814
|
ctrl_shortcut: "Ctrl"
|
|
3815
3815
|
}
|
|
3816
|
-
},
|
|
3816
|
+
}, zi = {
|
|
3817
3817
|
slash_menu: {
|
|
3818
3818
|
heading: {
|
|
3819
3819
|
title: "Overskrift 1",
|
|
@@ -4156,7 +4156,7 @@ const Pi = {
|
|
|
4156
4156
|
generic: {
|
|
4157
4157
|
ctrl_shortcut: "Ctrl"
|
|
4158
4158
|
}
|
|
4159
|
-
},
|
|
4159
|
+
}, Fi = {
|
|
4160
4160
|
slash_menu: {
|
|
4161
4161
|
heading: {
|
|
4162
4162
|
title: "Nagłówek 1",
|
|
@@ -4483,7 +4483,7 @@ const Pi = {
|
|
|
4483
4483
|
generic: {
|
|
4484
4484
|
ctrl_shortcut: "Ctrl"
|
|
4485
4485
|
}
|
|
4486
|
-
},
|
|
4486
|
+
}, $i = {
|
|
4487
4487
|
slash_menu: {
|
|
4488
4488
|
heading: {
|
|
4489
4489
|
title: "Título",
|
|
@@ -4818,7 +4818,7 @@ const Pi = {
|
|
|
4818
4818
|
generic: {
|
|
4819
4819
|
ctrl_shortcut: "Ctrl"
|
|
4820
4820
|
}
|
|
4821
|
-
},
|
|
4821
|
+
}, Gi = {
|
|
4822
4822
|
slash_menu: {
|
|
4823
4823
|
heading: {
|
|
4824
4824
|
title: "Заголовок 1 уровня",
|
|
@@ -5188,7 +5188,7 @@ const Pi = {
|
|
|
5188
5188
|
generic: {
|
|
5189
5189
|
ctrl_shortcut: "Ctrl"
|
|
5190
5190
|
}
|
|
5191
|
-
},
|
|
5191
|
+
}, Wi = {
|
|
5192
5192
|
slash_menu: {
|
|
5193
5193
|
heading: {
|
|
5194
5194
|
title: "Заголовок 1",
|
|
@@ -5556,7 +5556,7 @@ const Pi = {
|
|
|
5556
5556
|
generic: {
|
|
5557
5557
|
ctrl_shortcut: "Ctrl"
|
|
5558
5558
|
}
|
|
5559
|
-
},
|
|
5559
|
+
}, Ki = {
|
|
5560
5560
|
slash_menu: {
|
|
5561
5561
|
heading: {
|
|
5562
5562
|
title: "Tiêu đề H1",
|
|
@@ -5898,7 +5898,7 @@ const Pi = {
|
|
|
5898
5898
|
generic: {
|
|
5899
5899
|
ctrl_shortcut: "Ctrl"
|
|
5900
5900
|
}
|
|
5901
|
-
},
|
|
5901
|
+
}, qi = {
|
|
5902
5902
|
slash_menu: {
|
|
5903
5903
|
heading: {
|
|
5904
5904
|
title: "一级标题",
|
|
@@ -6276,24 +6276,24 @@ const Pi = {
|
|
|
6276
6276
|
}
|
|
6277
6277
|
}, Xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6278
6278
|
__proto__: null,
|
|
6279
|
-
ar:
|
|
6280
|
-
de:
|
|
6281
|
-
en:
|
|
6282
|
-
es:
|
|
6283
|
-
fr:
|
|
6284
|
-
hr:
|
|
6285
|
-
is:
|
|
6286
|
-
it:
|
|
6287
|
-
ja:
|
|
6288
|
-
ko:
|
|
6289
|
-
nl:
|
|
6290
|
-
no:
|
|
6291
|
-
pl:
|
|
6292
|
-
pt:
|
|
6293
|
-
ru:
|
|
6294
|
-
uk:
|
|
6295
|
-
vi:
|
|
6296
|
-
zh:
|
|
6279
|
+
ar: Ai,
|
|
6280
|
+
de: Pi,
|
|
6281
|
+
en: $t,
|
|
6282
|
+
es: Ni,
|
|
6283
|
+
fr: ji,
|
|
6284
|
+
hr: Ri,
|
|
6285
|
+
is: Di,
|
|
6286
|
+
it: Ui,
|
|
6287
|
+
ja: Hi,
|
|
6288
|
+
ko: Oi,
|
|
6289
|
+
nl: Vi,
|
|
6290
|
+
no: zi,
|
|
6291
|
+
pl: Fi,
|
|
6292
|
+
pt: $i,
|
|
6293
|
+
ru: Gi,
|
|
6294
|
+
uk: Wi,
|
|
6295
|
+
vi: Ki,
|
|
6296
|
+
zh: qi
|
|
6297
6297
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6298
6298
|
class H extends Error {
|
|
6299
6299
|
constructor(o) {
|
|
@@ -6333,7 +6333,7 @@ function q(e, o) {
|
|
|
6333
6333
|
node: a.nodeAfter
|
|
6334
6334
|
};
|
|
6335
6335
|
}
|
|
6336
|
-
function
|
|
6336
|
+
function tt(e, o) {
|
|
6337
6337
|
if (!e.type.isInGroup("bnBlock"))
|
|
6338
6338
|
throw new Error(
|
|
6339
6339
|
`Attempted to get bnBlock node at position but found node of different type ${e.type}`
|
|
@@ -6386,31 +6386,31 @@ function ot(e, o) {
|
|
|
6386
6386
|
}
|
|
6387
6387
|
}
|
|
6388
6388
|
function te(e) {
|
|
6389
|
-
return
|
|
6389
|
+
return tt(e.node, e.posBeforeNode);
|
|
6390
6390
|
}
|
|
6391
6391
|
function _e(e) {
|
|
6392
6392
|
if (!e.nodeAfter)
|
|
6393
6393
|
throw new Error(
|
|
6394
6394
|
`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`
|
|
6395
6395
|
);
|
|
6396
|
-
return
|
|
6396
|
+
return tt(e.nodeAfter, e.pos);
|
|
6397
6397
|
}
|
|
6398
6398
|
function y(e) {
|
|
6399
6399
|
const o = q(e.doc, e.selection.anchor);
|
|
6400
6400
|
return te(o);
|
|
6401
6401
|
}
|
|
6402
|
-
function
|
|
6402
|
+
function Xi(e, o = JSON.stringify) {
|
|
6403
6403
|
const t = {};
|
|
6404
6404
|
return e.filter((i) => {
|
|
6405
6405
|
const n = o(i);
|
|
6406
6406
|
return Object.prototype.hasOwnProperty.call(t, n) ? !1 : t[n] = !0;
|
|
6407
6407
|
});
|
|
6408
6408
|
}
|
|
6409
|
-
function
|
|
6409
|
+
function Zi(e) {
|
|
6410
6410
|
const o = e.filter(
|
|
6411
6411
|
(i, n) => e.indexOf(i) !== n
|
|
6412
6412
|
);
|
|
6413
|
-
return
|
|
6413
|
+
return Xi(o);
|
|
6414
6414
|
}
|
|
6415
6415
|
const we = j.create({
|
|
6416
6416
|
name: "uniqueID",
|
|
@@ -6427,7 +6427,7 @@ const we = j.create({
|
|
|
6427
6427
|
const e = window.__TEST_OPTIONS;
|
|
6428
6428
|
return e.mockID === void 0 ? e.mockID = 0 : e.mockID++, e.mockID.toString();
|
|
6429
6429
|
}
|
|
6430
|
-
return
|
|
6430
|
+
return Vt();
|
|
6431
6431
|
},
|
|
6432
6432
|
filterTransaction: null
|
|
6433
6433
|
};
|
|
@@ -6496,26 +6496,26 @@ const we = j.create({
|
|
|
6496
6496
|
});
|
|
6497
6497
|
if (!r || a)
|
|
6498
6498
|
return;
|
|
6499
|
-
const { tr: s } = n, { types: l, attributeName: d, generateID: c } = this.options, u =
|
|
6499
|
+
const { tr: s } = n, { types: l, attributeName: d, generateID: c } = this.options, u = zo(
|
|
6500
6500
|
i.doc,
|
|
6501
6501
|
t
|
|
6502
6502
|
), { mapping: m } = u;
|
|
6503
|
-
if (
|
|
6504
|
-
const f =
|
|
6503
|
+
if (Fo(u).forEach(({ newRange: g }) => {
|
|
6504
|
+
const f = $o(
|
|
6505
6505
|
n.doc,
|
|
6506
6506
|
g,
|
|
6507
6507
|
(_) => l.includes(_.type.name)
|
|
6508
|
-
), b = f.map(({ node: _ }) => _.attrs[d]).filter((_) => _ !== null), k =
|
|
6508
|
+
), b = f.map(({ node: _ }) => _.attrs[d]).filter((_) => _ !== null), k = Zi(b);
|
|
6509
6509
|
f.forEach(({ node: _, pos: w }) => {
|
|
6510
6510
|
let v;
|
|
6511
6511
|
const C = (v = s.doc.nodeAt(w)) === null || v === void 0 ? void 0 : v.attrs[d];
|
|
6512
6512
|
if (C === null) {
|
|
6513
6513
|
const E = i.doc.type.createAndFill().content;
|
|
6514
6514
|
if (i.doc.content.findDiffStart(E) === null) {
|
|
6515
|
-
const
|
|
6515
|
+
const ut = JSON.parse(
|
|
6516
6516
|
JSON.stringify(n.doc.toJSON())
|
|
6517
6517
|
);
|
|
6518
|
-
if (
|
|
6518
|
+
if (ut.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(ut.content) === JSON.stringify(E.toJSON())) {
|
|
6519
6519
|
s.setNodeMarkup(w, void 0, {
|
|
6520
6520
|
..._.attrs,
|
|
6521
6521
|
[d]: "initialBlockId"
|
|
@@ -6602,18 +6602,18 @@ const we = j.create({
|
|
|
6602
6602
|
];
|
|
6603
6603
|
}
|
|
6604
6604
|
});
|
|
6605
|
-
function
|
|
6605
|
+
function gt(e) {
|
|
6606
6606
|
return e.type === "link";
|
|
6607
6607
|
}
|
|
6608
|
-
function
|
|
6608
|
+
function ot(e) {
|
|
6609
6609
|
return typeof e != "string" && e.type === "link";
|
|
6610
6610
|
}
|
|
6611
6611
|
function X(e) {
|
|
6612
6612
|
return typeof e != "string" && e.type === "text";
|
|
6613
6613
|
}
|
|
6614
|
-
function
|
|
6614
|
+
function $e(e) {
|
|
6615
6615
|
var o, t, i, n, r;
|
|
6616
|
-
return
|
|
6616
|
+
return it(e) ? { ...e } : me(e) ? {
|
|
6617
6617
|
type: "tableCell",
|
|
6618
6618
|
content: [].concat(e.content),
|
|
6619
6619
|
props: {
|
|
@@ -6638,18 +6638,18 @@ function Ge(e) {
|
|
|
6638
6638
|
function me(e) {
|
|
6639
6639
|
return e != null && typeof e != "string" && !Array.isArray(e) && e.type === "tableCell";
|
|
6640
6640
|
}
|
|
6641
|
-
function
|
|
6641
|
+
function it(e) {
|
|
6642
6642
|
return me(e) && e.props !== void 0 && e.content !== void 0;
|
|
6643
6643
|
}
|
|
6644
6644
|
function he(e) {
|
|
6645
|
-
return
|
|
6645
|
+
return it(e) ? e.props.colspan ?? 1 : 1;
|
|
6646
6646
|
}
|
|
6647
|
-
function
|
|
6648
|
-
return
|
|
6647
|
+
function Ge(e) {
|
|
6648
|
+
return it(e) ? e.props.rowspan ?? 1 : 1;
|
|
6649
6649
|
}
|
|
6650
|
-
const
|
|
6650
|
+
const Ji = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
|
|
6651
6651
|
function K(e, o = "Ctrl") {
|
|
6652
|
-
return
|
|
6652
|
+
return Ji() ? e.replace("Mod", "⌘") : e.replace("Mod", o);
|
|
6653
6653
|
}
|
|
6654
6654
|
function Z(...e) {
|
|
6655
6655
|
return e.filter((o) => o).join(" ");
|
|
@@ -6677,7 +6677,7 @@ function $(e, o, t, i) {
|
|
|
6677
6677
|
contentDOM: r
|
|
6678
6678
|
};
|
|
6679
6679
|
}
|
|
6680
|
-
const
|
|
6680
|
+
const bt = (e, o) => {
|
|
6681
6681
|
let t = ie(e, o.pmSchema, o.schema.styleSchema);
|
|
6682
6682
|
t.type.name === "blockContainer" && (t = t.firstChild);
|
|
6683
6683
|
const i = o.pmSchema.nodes[t.type.name].spec.toDOM;
|
|
@@ -6702,7 +6702,7 @@ const kt = (e, o) => {
|
|
|
6702
6702
|
default: "left",
|
|
6703
6703
|
values: ["left", "center", "right", "justify"]
|
|
6704
6704
|
}
|
|
6705
|
-
},
|
|
6705
|
+
}, Gt = ["backgroundColor", "textColor"];
|
|
6706
6706
|
function Me(e) {
|
|
6707
6707
|
return "data-" + e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
6708
6708
|
}
|
|
@@ -6713,7 +6713,7 @@ function Ys(e) {
|
|
|
6713
6713
|
}
|
|
6714
6714
|
function ye(e) {
|
|
6715
6715
|
const o = {};
|
|
6716
|
-
return Object.entries(e).filter(([t, i]) => !
|
|
6716
|
+
return Object.entries(e).filter(([t, i]) => !Gt.includes(t)).forEach(([t, i]) => {
|
|
6717
6717
|
o[t] = {
|
|
6718
6718
|
default: i.default,
|
|
6719
6719
|
keepOnSplit: !0,
|
|
@@ -6738,7 +6738,7 @@ function ye(e) {
|
|
|
6738
6738
|
};
|
|
6739
6739
|
}), o;
|
|
6740
6740
|
}
|
|
6741
|
-
function
|
|
6741
|
+
function Yi(e, o, t, i) {
|
|
6742
6742
|
if (typeof e == "boolean")
|
|
6743
6743
|
throw new Error(
|
|
6744
6744
|
"Cannot find node position as getPos is a boolean, not a function."
|
|
@@ -6762,7 +6762,7 @@ function xe(e, o, t, i, n = !1, r) {
|
|
|
6762
6762
|
), a.setAttribute("data-content-type", o);
|
|
6763
6763
|
for (const [s, l] of Object.entries(t)) {
|
|
6764
6764
|
const c = i[s].default;
|
|
6765
|
-
!
|
|
6765
|
+
!Gt.includes(s) && l !== c && a.setAttribute(Me(s), l);
|
|
6766
6766
|
}
|
|
6767
6767
|
return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = Z(
|
|
6768
6768
|
"bn-inline-content",
|
|
@@ -6775,14 +6775,14 @@ function xe(e, o, t, i, n = !1, r) {
|
|
|
6775
6775
|
function G(e) {
|
|
6776
6776
|
return de.create(e);
|
|
6777
6777
|
}
|
|
6778
|
-
function
|
|
6778
|
+
function Wt(e, o) {
|
|
6779
6779
|
return {
|
|
6780
6780
|
config: e,
|
|
6781
6781
|
implementation: o
|
|
6782
6782
|
};
|
|
6783
6783
|
}
|
|
6784
6784
|
function J(e, o, t) {
|
|
6785
|
-
return
|
|
6785
|
+
return Wt(
|
|
6786
6786
|
{
|
|
6787
6787
|
type: e.name,
|
|
6788
6788
|
content: e.config.content === "inline*" ? "inline" : e.config.content === "tableRow+" ? "table" : "none",
|
|
@@ -6791,23 +6791,23 @@ function J(e, o, t) {
|
|
|
6791
6791
|
{
|
|
6792
6792
|
node: e,
|
|
6793
6793
|
requiredExtensions: t,
|
|
6794
|
-
toInternalHTML:
|
|
6795
|
-
toExternalHTML:
|
|
6794
|
+
toInternalHTML: bt,
|
|
6795
|
+
toExternalHTML: bt
|
|
6796
6796
|
// parse: () => undefined, // parse rules are in node already
|
|
6797
6797
|
}
|
|
6798
6798
|
);
|
|
6799
6799
|
}
|
|
6800
|
-
function
|
|
6800
|
+
function Kt(e) {
|
|
6801
6801
|
return Object.fromEntries(
|
|
6802
6802
|
Object.entries(e).map(([o, t]) => [o, t.config])
|
|
6803
6803
|
);
|
|
6804
6804
|
}
|
|
6805
|
-
function
|
|
6805
|
+
function Qi(e, o) {
|
|
6806
6806
|
e.stopEvent = (t) => (t.type === "mousedown" && setTimeout(() => {
|
|
6807
6807
|
o.view.dom.blur();
|
|
6808
6808
|
}, 10), !0);
|
|
6809
6809
|
}
|
|
6810
|
-
function
|
|
6810
|
+
function en(e, o) {
|
|
6811
6811
|
const t = [
|
|
6812
6812
|
{
|
|
6813
6813
|
tag: "[data-content-type=" + e.type + "]",
|
|
@@ -6835,7 +6835,7 @@ function ve(e, o) {
|
|
|
6835
6835
|
return ye(e.propSchema);
|
|
6836
6836
|
},
|
|
6837
6837
|
parseHTML() {
|
|
6838
|
-
return
|
|
6838
|
+
return en(e, o.parse);
|
|
6839
6839
|
},
|
|
6840
6840
|
renderHTML({ HTMLAttributes: i }) {
|
|
6841
6841
|
const n = document.createElement("div");
|
|
@@ -6854,7 +6854,7 @@ function ve(e, o) {
|
|
|
6854
6854
|
addNodeView() {
|
|
6855
6855
|
return ({ getPos: i }) => {
|
|
6856
6856
|
var d;
|
|
6857
|
-
const n = this.options.editor, r =
|
|
6857
|
+
const n = this.options.editor, r = Yi(
|
|
6858
6858
|
i,
|
|
6859
6859
|
n,
|
|
6860
6860
|
this.editor,
|
|
@@ -6866,7 +6866,7 @@ function ve(e, o) {
|
|
|
6866
6866
|
e.propSchema,
|
|
6867
6867
|
a
|
|
6868
6868
|
);
|
|
6869
|
-
return e.isSelectable === !1 &&
|
|
6869
|
+
return e.isSelectable === !1 && Qi(l, this.editor), l;
|
|
6870
6870
|
};
|
|
6871
6871
|
}
|
|
6872
6872
|
});
|
|
@@ -6874,7 +6874,7 @@ function ve(e, o) {
|
|
|
6874
6874
|
throw new Error(
|
|
6875
6875
|
"Node name does not match block type. This is a bug in BlockNote."
|
|
6876
6876
|
);
|
|
6877
|
-
return
|
|
6877
|
+
return Wt(e, {
|
|
6878
6878
|
node: t,
|
|
6879
6879
|
toInternalHTML: (i, n) => {
|
|
6880
6880
|
var s;
|
|
@@ -6908,7 +6908,7 @@ function ve(e, o) {
|
|
|
6908
6908
|
}
|
|
6909
6909
|
});
|
|
6910
6910
|
}
|
|
6911
|
-
function
|
|
6911
|
+
function qt(e, o, t) {
|
|
6912
6912
|
var r;
|
|
6913
6913
|
const i = {
|
|
6914
6914
|
type: "tableContent",
|
|
@@ -6959,7 +6959,7 @@ function Ae(e, o, t) {
|
|
|
6959
6959
|
if (X(n))
|
|
6960
6960
|
n.text += `
|
|
6961
6961
|
`;
|
|
6962
|
-
else if (
|
|
6962
|
+
else if (gt(n))
|
|
6963
6963
|
n.content[n.content.length - 1].text += `
|
|
6964
6964
|
`;
|
|
6965
6965
|
else
|
|
@@ -6979,7 +6979,7 @@ function Ae(e, o, t) {
|
|
|
6979
6979
|
return;
|
|
6980
6980
|
}
|
|
6981
6981
|
n && (i.push(n), n = void 0), i.push(
|
|
6982
|
-
|
|
6982
|
+
We(r, o, t)
|
|
6983
6983
|
);
|
|
6984
6984
|
return;
|
|
6985
6985
|
}
|
|
@@ -7016,7 +7016,7 @@ function Ae(e, o, t) {
|
|
|
7016
7016
|
type: "text",
|
|
7017
7017
|
text: r.textContent,
|
|
7018
7018
|
styles: a
|
|
7019
|
-
}) :
|
|
7019
|
+
}) : gt(n) && (s ? n.href === s.attrs.href ? JSON.stringify(
|
|
7020
7020
|
n.content[n.content.length - 1].styles
|
|
7021
7021
|
) === JSON.stringify(a) ? n.content[n.content.length - 1].text += r.textContent : n.content.push({
|
|
7022
7022
|
type: "text",
|
|
@@ -7053,7 +7053,7 @@ function Ae(e, o, t) {
|
|
|
7053
7053
|
};
|
|
7054
7054
|
}), n && i.push(n), i;
|
|
7055
7055
|
}
|
|
7056
|
-
function
|
|
7056
|
+
function We(e, o, t) {
|
|
7057
7057
|
if (e.type.name === "text" || e.type.name === "link")
|
|
7058
7058
|
throw new Error("unexpected");
|
|
7059
7059
|
const i = {}, n = o[e.type.name];
|
|
@@ -7083,7 +7083,7 @@ function x(e, o, t, i, n) {
|
|
|
7083
7083
|
const r = n == null ? void 0 : n.get(e);
|
|
7084
7084
|
if (r)
|
|
7085
7085
|
return r;
|
|
7086
|
-
const a =
|
|
7086
|
+
const a = tt(e, 0);
|
|
7087
7087
|
let s = a.bnBlock.node.attrs.id;
|
|
7088
7088
|
s === null && (s = we.options.generateID());
|
|
7089
7089
|
const l = o[a.blockNoteType];
|
|
@@ -7121,7 +7121,7 @@ function x(e, o, t, i, n) {
|
|
|
7121
7121
|
} else if (c.content === "table") {
|
|
7122
7122
|
if (!a.isBlockContainer)
|
|
7123
7123
|
throw new Error("impossible");
|
|
7124
|
-
m =
|
|
7124
|
+
m = qt(
|
|
7125
7125
|
a.blockContent.node,
|
|
7126
7126
|
t,
|
|
7127
7127
|
i
|
|
@@ -7139,13 +7139,13 @@ function x(e, o, t, i, n) {
|
|
|
7139
7139
|
};
|
|
7140
7140
|
return n == null || n.set(e, h), h;
|
|
7141
7141
|
}
|
|
7142
|
-
function
|
|
7142
|
+
function kt(e, o, t, i) {
|
|
7143
7143
|
return e.dom.setAttribute("data-inline-content-type", o), Object.entries(t).filter(([n, r]) => {
|
|
7144
7144
|
const a = i[n];
|
|
7145
7145
|
return r !== a.default;
|
|
7146
7146
|
}).map(([n, r]) => [Me(n), r]).forEach(([n, r]) => e.dom.setAttribute(n, r)), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
|
|
7147
7147
|
}
|
|
7148
|
-
function
|
|
7148
|
+
function tn(e) {
|
|
7149
7149
|
return {
|
|
7150
7150
|
Backspace: ({ editor: o }) => {
|
|
7151
7151
|
const t = o.state.selection.$from;
|
|
@@ -7153,14 +7153,14 @@ function on(e) {
|
|
|
7153
7153
|
}
|
|
7154
7154
|
};
|
|
7155
7155
|
}
|
|
7156
|
-
function
|
|
7156
|
+
function on(e, o) {
|
|
7157
7157
|
return {
|
|
7158
7158
|
config: e,
|
|
7159
7159
|
implementation: o
|
|
7160
7160
|
};
|
|
7161
7161
|
}
|
|
7162
|
-
function
|
|
7163
|
-
return
|
|
7162
|
+
function nn(e, o) {
|
|
7163
|
+
return on(
|
|
7164
7164
|
{
|
|
7165
7165
|
type: e.name,
|
|
7166
7166
|
propSchema: o,
|
|
@@ -7171,12 +7171,12 @@ function rn(e, o) {
|
|
|
7171
7171
|
}
|
|
7172
7172
|
);
|
|
7173
7173
|
}
|
|
7174
|
-
function
|
|
7174
|
+
function Xt(e) {
|
|
7175
7175
|
return Object.fromEntries(
|
|
7176
7176
|
Object.entries(e).map(([o, t]) => [o, t.config])
|
|
7177
7177
|
);
|
|
7178
7178
|
}
|
|
7179
|
-
function
|
|
7179
|
+
function rn(e) {
|
|
7180
7180
|
return [
|
|
7181
7181
|
{
|
|
7182
7182
|
tag: `[data-inline-content-type="${e.type}"]`,
|
|
@@ -7199,14 +7199,14 @@ function Qs(e, o) {
|
|
|
7199
7199
|
return ye(e.propSchema);
|
|
7200
7200
|
},
|
|
7201
7201
|
addKeyboardShortcuts() {
|
|
7202
|
-
return
|
|
7202
|
+
return tn(e);
|
|
7203
7203
|
},
|
|
7204
7204
|
parseHTML() {
|
|
7205
|
-
return
|
|
7205
|
+
return rn(e);
|
|
7206
7206
|
},
|
|
7207
7207
|
renderHTML({ node: i }) {
|
|
7208
7208
|
const n = this.options.editor, r = o.render(
|
|
7209
|
-
|
|
7209
|
+
We(
|
|
7210
7210
|
i,
|
|
7211
7211
|
n.schema.inlineContentSchema,
|
|
7212
7212
|
n.schema.styleSchema
|
|
@@ -7216,7 +7216,7 @@ function Qs(e, o) {
|
|
|
7216
7216
|
},
|
|
7217
7217
|
n
|
|
7218
7218
|
);
|
|
7219
|
-
return
|
|
7219
|
+
return kt(
|
|
7220
7220
|
r,
|
|
7221
7221
|
e.type,
|
|
7222
7222
|
i.attrs,
|
|
@@ -7226,7 +7226,7 @@ function Qs(e, o) {
|
|
|
7226
7226
|
addNodeView() {
|
|
7227
7227
|
return ({ node: i, getPos: n }) => {
|
|
7228
7228
|
const r = this.options.editor, a = o.render(
|
|
7229
|
-
|
|
7229
|
+
We(
|
|
7230
7230
|
i,
|
|
7231
7231
|
r.schema.inlineContentSchema,
|
|
7232
7232
|
r.schema.styleSchema
|
|
@@ -7250,7 +7250,7 @@ function Qs(e, o) {
|
|
|
7250
7250
|
},
|
|
7251
7251
|
r
|
|
7252
7252
|
);
|
|
7253
|
-
return
|
|
7253
|
+
return kt(
|
|
7254
7254
|
a,
|
|
7255
7255
|
e.type,
|
|
7256
7256
|
i.attrs,
|
|
@@ -7259,12 +7259,12 @@ function Qs(e, o) {
|
|
|
7259
7259
|
};
|
|
7260
7260
|
}
|
|
7261
7261
|
});
|
|
7262
|
-
return
|
|
7262
|
+
return nn(
|
|
7263
7263
|
t,
|
|
7264
7264
|
e.propSchema
|
|
7265
7265
|
);
|
|
7266
7266
|
}
|
|
7267
|
-
function
|
|
7267
|
+
function an(e) {
|
|
7268
7268
|
return e === "boolean" ? {} : {
|
|
7269
7269
|
stringValue: {
|
|
7270
7270
|
default: void 0,
|
|
@@ -7276,17 +7276,17 @@ function sn(e) {
|
|
|
7276
7276
|
}
|
|
7277
7277
|
};
|
|
7278
7278
|
}
|
|
7279
|
-
function
|
|
7279
|
+
function sn(e, o, t, i) {
|
|
7280
7280
|
return e.dom.setAttribute("data-style-type", o), i === "string" && e.dom.setAttribute("data-value", t), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
|
|
7281
7281
|
}
|
|
7282
|
-
function
|
|
7282
|
+
function Zt(e, o) {
|
|
7283
7283
|
return {
|
|
7284
7284
|
config: e,
|
|
7285
7285
|
implementation: o
|
|
7286
7286
|
};
|
|
7287
7287
|
}
|
|
7288
7288
|
function Q(e, o) {
|
|
7289
|
-
return
|
|
7289
|
+
return Zt(
|
|
7290
7290
|
{
|
|
7291
7291
|
type: e.name,
|
|
7292
7292
|
propSchema: o
|
|
@@ -7296,12 +7296,12 @@ function Q(e, o) {
|
|
|
7296
7296
|
}
|
|
7297
7297
|
);
|
|
7298
7298
|
}
|
|
7299
|
-
function
|
|
7299
|
+
function Jt(e) {
|
|
7300
7300
|
return Object.fromEntries(
|
|
7301
7301
|
Object.entries(e).map(([o, t]) => [o, t.config])
|
|
7302
7302
|
);
|
|
7303
7303
|
}
|
|
7304
|
-
function
|
|
7304
|
+
function ln(e) {
|
|
7305
7305
|
return [
|
|
7306
7306
|
{
|
|
7307
7307
|
tag: `[data-style-type="${e.type}"]`,
|
|
@@ -7316,10 +7316,10 @@ function el(e, o) {
|
|
|
7316
7316
|
const t = ge.create({
|
|
7317
7317
|
name: e.type,
|
|
7318
7318
|
addAttributes() {
|
|
7319
|
-
return
|
|
7319
|
+
return an(e.propSchema);
|
|
7320
7320
|
},
|
|
7321
7321
|
parseHTML() {
|
|
7322
|
-
return
|
|
7322
|
+
return ln(e);
|
|
7323
7323
|
},
|
|
7324
7324
|
renderHTML({ mark: i }) {
|
|
7325
7325
|
let n;
|
|
@@ -7329,7 +7329,7 @@ function el(e, o) {
|
|
|
7329
7329
|
n = o.render(i.attrs.stringValue);
|
|
7330
7330
|
else
|
|
7331
7331
|
throw new H(e.propSchema);
|
|
7332
|
-
return
|
|
7332
|
+
return sn(
|
|
7333
7333
|
n,
|
|
7334
7334
|
e.type,
|
|
7335
7335
|
i.attrs.stringValue,
|
|
@@ -7337,12 +7337,12 @@ function el(e, o) {
|
|
|
7337
7337
|
);
|
|
7338
7338
|
}
|
|
7339
7339
|
});
|
|
7340
|
-
return
|
|
7340
|
+
return Zt(e, {
|
|
7341
7341
|
mark: t
|
|
7342
7342
|
});
|
|
7343
7343
|
}
|
|
7344
7344
|
function Y(e) {
|
|
7345
|
-
const { height: o, width: t } =
|
|
7345
|
+
const { height: o, width: t } = nt(e), i = new Array(o).fill(!1).map(() => new Array(t).fill(null)), n = (r, a) => {
|
|
7346
7346
|
for (let s = r; s < o; s++)
|
|
7347
7347
|
for (let l = a; l < t; l++)
|
|
7348
7348
|
if (!i[s][l])
|
|
@@ -7353,7 +7353,7 @@ function Y(e) {
|
|
|
7353
7353
|
};
|
|
7354
7354
|
for (let r = 0; r < e.content.rows.length; r++)
|
|
7355
7355
|
for (let a = 0; a < e.content.rows[r].cells.length; a++) {
|
|
7356
|
-
const s =
|
|
7356
|
+
const s = $e(e.content.rows[r].cells[a]), l = Ge(s), d = he(s), { row: c, col: u } = n(r, a);
|
|
7357
7357
|
for (let m = c; m < c + l; m++)
|
|
7358
7358
|
for (let h = u; h < u + d; h++) {
|
|
7359
7359
|
if (i[m][h])
|
|
@@ -7388,7 +7388,7 @@ function oe(e, o, t = Y(o)) {
|
|
|
7388
7388
|
`Unable to resolve relative table cell indices for table, cell at ${e.row},${e.col} is not occupied`
|
|
7389
7389
|
);
|
|
7390
7390
|
}
|
|
7391
|
-
function
|
|
7391
|
+
function nt(e) {
|
|
7392
7392
|
const o = e.content.rows.length;
|
|
7393
7393
|
let t = 0;
|
|
7394
7394
|
return e.content.rows.forEach((i) => {
|
|
@@ -7398,7 +7398,7 @@ function rt(e) {
|
|
|
7398
7398
|
}), t = Math.max(t, n);
|
|
7399
7399
|
}), { height: o, width: t };
|
|
7400
7400
|
}
|
|
7401
|
-
function
|
|
7401
|
+
function Yt(e, o, t = Y(o)) {
|
|
7402
7402
|
var n;
|
|
7403
7403
|
const i = (n = t[e.row]) == null ? void 0 : n[e.col];
|
|
7404
7404
|
if (i)
|
|
@@ -7408,7 +7408,7 @@ function Qt(e, o, t = Y(o)) {
|
|
|
7408
7408
|
cell: i.cell
|
|
7409
7409
|
};
|
|
7410
7410
|
}
|
|
7411
|
-
function
|
|
7411
|
+
function Ke(e, o) {
|
|
7412
7412
|
var r;
|
|
7413
7413
|
const t = Y(e);
|
|
7414
7414
|
if (o < 0 || o >= t.length)
|
|
@@ -7420,7 +7420,7 @@ function qe(e, o) {
|
|
|
7420
7420
|
return [];
|
|
7421
7421
|
i += s.rowspan;
|
|
7422
7422
|
}
|
|
7423
|
-
const n = new Array(t[0].length).fill(!1).map((a, s) =>
|
|
7423
|
+
const n = new Array(t[0].length).fill(!1).map((a, s) => Yt(
|
|
7424
7424
|
{ row: i, col: s },
|
|
7425
7425
|
e,
|
|
7426
7426
|
t
|
|
@@ -7429,7 +7429,7 @@ function qe(e, o) {
|
|
|
7429
7429
|
);
|
|
7430
7430
|
return n.filter((a, s) => n.findIndex((l) => l.row === a.row && l.col === a.col) === s);
|
|
7431
7431
|
}
|
|
7432
|
-
function
|
|
7432
|
+
function qe(e, o) {
|
|
7433
7433
|
var r;
|
|
7434
7434
|
const t = Y(e);
|
|
7435
7435
|
if (o < 0 || o >= t[0].length)
|
|
@@ -7441,7 +7441,7 @@ function Xe(e, o) {
|
|
|
7441
7441
|
return [];
|
|
7442
7442
|
i += s.colspan;
|
|
7443
7443
|
}
|
|
7444
|
-
const n = new Array(t.length).fill(!1).map((a, s) =>
|
|
7444
|
+
const n = new Array(t.length).fill(!1).map((a, s) => Yt(
|
|
7445
7445
|
{ row: s, col: i },
|
|
7446
7446
|
e,
|
|
7447
7447
|
t
|
|
@@ -7450,7 +7450,7 @@ function Xe(e, o) {
|
|
|
7450
7450
|
);
|
|
7451
7451
|
return n.filter((a, s) => n.findIndex((l) => l.row === a.row && l.col === a.col) === s);
|
|
7452
7452
|
}
|
|
7453
|
-
function
|
|
7453
|
+
function dn(e, o, t, i = Y(e)) {
|
|
7454
7454
|
const { col: n } = oe(
|
|
7455
7455
|
{
|
|
7456
7456
|
row: 0,
|
|
@@ -7471,7 +7471,7 @@ function cn(e, o, t, i = Y(e)) {
|
|
|
7471
7471
|
a.splice(r, 0, s);
|
|
7472
7472
|
}), fe(i);
|
|
7473
7473
|
}
|
|
7474
|
-
function
|
|
7474
|
+
function cn(e, o, t, i = Y(e)) {
|
|
7475
7475
|
const { row: n } = oe(
|
|
7476
7476
|
{
|
|
7477
7477
|
row: o,
|
|
@@ -7489,16 +7489,16 @@ function un(e, o, t, i = Y(e)) {
|
|
|
7489
7489
|
), [a] = i.splice(n, 1);
|
|
7490
7490
|
return i.splice(r, 0, a), fe(i);
|
|
7491
7491
|
}
|
|
7492
|
-
function
|
|
7493
|
-
return e ? me(e) ?
|
|
7494
|
-
(o) => typeof o == "string" ? o.length === 0 : X(o) ? o.text.length === 0 :
|
|
7492
|
+
function Xe(e) {
|
|
7493
|
+
return e ? me(e) ? Xe(e.content) : typeof e == "string" ? e.length === 0 : Array.isArray(e) ? e.every(
|
|
7494
|
+
(o) => typeof o == "string" ? o.length === 0 : X(o) ? o.text.length === 0 : ot(o) ? typeof o.content == "string" ? o.content.length === 0 : o.content.every((t) => t.text.length === 0) : !1
|
|
7495
7495
|
) : !1 : !0;
|
|
7496
7496
|
}
|
|
7497
|
-
function
|
|
7497
|
+
function un(e, o, t = Y(e)) {
|
|
7498
7498
|
if (o === "columns") {
|
|
7499
7499
|
let r = 0;
|
|
7500
7500
|
for (let a = t[0].length - 1; a >= 0 && t.every(
|
|
7501
|
-
(l) =>
|
|
7501
|
+
(l) => Xe(l[a].cell) && l[a].colspan === 1
|
|
7502
7502
|
); a--)
|
|
7503
7503
|
r++;
|
|
7504
7504
|
for (let a = t.length - 1; a >= 0; a--) {
|
|
@@ -7512,14 +7512,14 @@ function pn(e, o, t = Y(e)) {
|
|
|
7512
7512
|
}
|
|
7513
7513
|
let i = 0;
|
|
7514
7514
|
for (let r = t.length - 1; r >= 0 && t[r].every(
|
|
7515
|
-
(s) =>
|
|
7515
|
+
(s) => Xe(s.cell) && s.rowspan === 1
|
|
7516
7516
|
); r--)
|
|
7517
7517
|
i++;
|
|
7518
7518
|
const n = Math.min(i, t.length - 1);
|
|
7519
7519
|
return t.splice(t.length - n, n), fe(t);
|
|
7520
7520
|
}
|
|
7521
|
-
function
|
|
7522
|
-
const { width: n, height: r } =
|
|
7521
|
+
function pn(e, o, t, i = Y(e)) {
|
|
7522
|
+
const { width: n, height: r } = nt(e);
|
|
7523
7523
|
if (o === "columns")
|
|
7524
7524
|
i.forEach((a, s) => {
|
|
7525
7525
|
if (t >= 0)
|
|
@@ -7529,7 +7529,7 @@ function mn(e, o, t, i = Y(e)) {
|
|
|
7529
7529
|
col: Math.max(...a.map((d) => d.col)) + 1,
|
|
7530
7530
|
rowspan: 1,
|
|
7531
7531
|
colspan: 1,
|
|
7532
|
-
cell:
|
|
7532
|
+
cell: $e("")
|
|
7533
7533
|
});
|
|
7534
7534
|
else
|
|
7535
7535
|
a.splice(n + t, -1 * t);
|
|
@@ -7541,25 +7541,25 @@ function mn(e, o, t, i = Y(e)) {
|
|
|
7541
7541
|
col: d,
|
|
7542
7542
|
rowspan: 1,
|
|
7543
7543
|
colspan: 1,
|
|
7544
|
-
cell:
|
|
7544
|
+
cell: $e("")
|
|
7545
7545
|
}));
|
|
7546
7546
|
i.push(s);
|
|
7547
7547
|
}
|
|
7548
7548
|
else t < 0 && i.splice(r + t, -1 * t);
|
|
7549
7549
|
return fe(i);
|
|
7550
7550
|
}
|
|
7551
|
-
function
|
|
7552
|
-
const i =
|
|
7553
|
-
if (!i.some((l) =>
|
|
7551
|
+
function Qt(e, o, t) {
|
|
7552
|
+
const i = Ke(e, t);
|
|
7553
|
+
if (!i.some((l) => Ge(l.cell) > 1))
|
|
7554
7554
|
return !0;
|
|
7555
7555
|
let r = t, a = t;
|
|
7556
7556
|
return i.forEach((l) => {
|
|
7557
|
-
const d =
|
|
7557
|
+
const d = Ge(l.cell);
|
|
7558
7558
|
r = Math.max(r, l.row + d - 1), a = Math.min(a, l.row);
|
|
7559
7559
|
}), o < t ? t === r : t === a;
|
|
7560
7560
|
}
|
|
7561
|
-
function
|
|
7562
|
-
const i =
|
|
7561
|
+
function eo(e, o, t) {
|
|
7562
|
+
const i = qe(e, t);
|
|
7563
7563
|
if (!i.some((l) => he(l.cell) > 1))
|
|
7564
7564
|
return !0;
|
|
7565
7565
|
let r = t, a = t;
|
|
@@ -7568,11 +7568,11 @@ function to(e, o, t) {
|
|
|
7568
7568
|
r = Math.max(r, l.col + d - 1), a = Math.min(a, l.col);
|
|
7569
7569
|
}), o < t ? t === r : t === a;
|
|
7570
7570
|
}
|
|
7571
|
-
function
|
|
7571
|
+
function mn(e, o, t) {
|
|
7572
7572
|
const i = oe(e, t), n = oe(o, t);
|
|
7573
7573
|
return i.col === n.col;
|
|
7574
7574
|
}
|
|
7575
|
-
function
|
|
7575
|
+
function _t(e, o, t, i) {
|
|
7576
7576
|
const n = [];
|
|
7577
7577
|
for (const [a, s] of Object.entries(e.styles)) {
|
|
7578
7578
|
const l = t[a];
|
|
@@ -7588,11 +7588,11 @@ function wt(e, o, t, i) {
|
|
|
7588
7588
|
return !i || !o.nodes[i].spec.code ? e.text.split(/(\n)/g).filter((a) => a.length > 0).map((a) => a === `
|
|
7589
7589
|
` ? o.nodes.hardBreak.createChecked() : o.text(a, n)) : [o.text(e.text, n)];
|
|
7590
7590
|
}
|
|
7591
|
-
function
|
|
7591
|
+
function hn(e, o, t) {
|
|
7592
7592
|
const i = o.marks.link.create({
|
|
7593
7593
|
href: e.href
|
|
7594
7594
|
});
|
|
7595
|
-
return
|
|
7595
|
+
return Ze(e.content, o, t).map(
|
|
7596
7596
|
(n) => {
|
|
7597
7597
|
if (n.type.name === "text")
|
|
7598
7598
|
return n.mark([...n.marks, i]);
|
|
@@ -7602,11 +7602,11 @@ function fn(e, o, t) {
|
|
|
7602
7602
|
}
|
|
7603
7603
|
);
|
|
7604
7604
|
}
|
|
7605
|
-
function
|
|
7605
|
+
function Ze(e, o, t, i) {
|
|
7606
7606
|
const n = [];
|
|
7607
7607
|
if (typeof e == "string")
|
|
7608
7608
|
return n.push(
|
|
7609
|
-
...
|
|
7609
|
+
..._t(
|
|
7610
7610
|
{ type: "text", text: e, styles: {} },
|
|
7611
7611
|
o,
|
|
7612
7612
|
t,
|
|
@@ -7615,7 +7615,7 @@ function Je(e, o, t, i) {
|
|
|
7615
7615
|
), n;
|
|
7616
7616
|
for (const r of e)
|
|
7617
7617
|
n.push(
|
|
7618
|
-
...
|
|
7618
|
+
..._t(r, o, t, i)
|
|
7619
7619
|
);
|
|
7620
7620
|
return n;
|
|
7621
7621
|
}
|
|
@@ -7623,11 +7623,11 @@ function D(e, o, t, i) {
|
|
|
7623
7623
|
const n = [];
|
|
7624
7624
|
for (const r of e)
|
|
7625
7625
|
typeof r == "string" ? n.push(
|
|
7626
|
-
...
|
|
7627
|
-
) :
|
|
7628
|
-
...
|
|
7626
|
+
...Ze(r, o, t, i)
|
|
7627
|
+
) : ot(r) ? n.push(...hn(r, o, t)) : X(r) ? n.push(
|
|
7628
|
+
...Ze([r], o, t, i)
|
|
7629
7629
|
) : n.push(
|
|
7630
|
-
|
|
7630
|
+
to(r, o, t)
|
|
7631
7631
|
);
|
|
7632
7632
|
return n;
|
|
7633
7633
|
}
|
|
@@ -7668,7 +7668,7 @@ function Pe(e, o, t) {
|
|
|
7668
7668
|
}
|
|
7669
7669
|
return i;
|
|
7670
7670
|
}
|
|
7671
|
-
function
|
|
7671
|
+
function to(e, o, t) {
|
|
7672
7672
|
let i, n = e.type;
|
|
7673
7673
|
if (n === void 0 && (n = "paragraph"), !o.nodes[n])
|
|
7674
7674
|
throw new Error(`node type ${n} not found in schema`);
|
|
@@ -7706,7 +7706,7 @@ function ie(e, o, t) {
|
|
|
7706
7706
|
n.push(ie(a, o, t));
|
|
7707
7707
|
if (!e.type || // can happen if block.type is not defined (this should create the default node)
|
|
7708
7708
|
o.nodes[e.type].isInGroup("blockContent")) {
|
|
7709
|
-
const a =
|
|
7709
|
+
const a = to(
|
|
7710
7710
|
e,
|
|
7711
7711
|
o,
|
|
7712
7712
|
t
|
|
@@ -7750,7 +7750,7 @@ const M = (e, o, t) => ({
|
|
|
7750
7750
|
if (n) {
|
|
7751
7751
|
const a = i.schema.nodes[r.blockNoteType], s = i.schema.nodes[t.type || r.blockNoteType], l = s.isInGroup("bnBlock") ? s : i.schema.nodes.blockContainer;
|
|
7752
7752
|
if (r.isBlockContainer && s.isInGroup("blockContent"))
|
|
7753
|
-
|
|
7753
|
+
wt(t, i, e, r), fn(
|
|
7754
7754
|
t,
|
|
7755
7755
|
i,
|
|
7756
7756
|
e,
|
|
@@ -7759,7 +7759,7 @@ const M = (e, o, t) => ({
|
|
|
7759
7759
|
r
|
|
7760
7760
|
);
|
|
7761
7761
|
else if (!r.isBlockContainer && s.isInGroup("bnBlock"))
|
|
7762
|
-
|
|
7762
|
+
wt(t, i, e, r);
|
|
7763
7763
|
else {
|
|
7764
7764
|
const d = x(
|
|
7765
7765
|
r.bnBlock.node,
|
|
@@ -7789,7 +7789,7 @@ const M = (e, o, t) => ({
|
|
|
7789
7789
|
}
|
|
7790
7790
|
return !0;
|
|
7791
7791
|
};
|
|
7792
|
-
function
|
|
7792
|
+
function fn(e, o, t, i, n, r) {
|
|
7793
7793
|
let a = "keep";
|
|
7794
7794
|
if (e.content)
|
|
7795
7795
|
if (typeof e.content == "string")
|
|
@@ -7835,12 +7835,12 @@ function gn(e, o, t, i, n, r) {
|
|
|
7835
7835
|
)
|
|
7836
7836
|
);
|
|
7837
7837
|
}
|
|
7838
|
-
function
|
|
7838
|
+
function wt(e, o, t, i) {
|
|
7839
7839
|
if (e.children !== void 0 && e.children.length > 0) {
|
|
7840
7840
|
const n = e.children.map((r) => ie(r, o.schema, t.schema.styleSchema));
|
|
7841
7841
|
if (i.childContainer)
|
|
7842
7842
|
o.tr.step(
|
|
7843
|
-
new
|
|
7843
|
+
new Vo(
|
|
7844
7844
|
i.childContainer.beforePos + 1,
|
|
7845
7845
|
i.childContainer.afterPos - 1,
|
|
7846
7846
|
new ee(U.from(n), 0, 0)
|
|
@@ -7856,7 +7856,7 @@ function yt(e, o, t, i) {
|
|
|
7856
7856
|
}
|
|
7857
7857
|
}
|
|
7858
7858
|
}
|
|
7859
|
-
function
|
|
7859
|
+
function gn(e, o, t) {
|
|
7860
7860
|
const i = e._tiptapEditor, n = typeof o == "string" ? o : o.id, r = R(n, i.state.doc);
|
|
7861
7861
|
if (!r)
|
|
7862
7862
|
throw new Error(`Block with ID ${n} not found`);
|
|
@@ -7874,13 +7874,13 @@ function bn(e, o, t) {
|
|
|
7874
7874
|
e.blockCache
|
|
7875
7875
|
);
|
|
7876
7876
|
}
|
|
7877
|
-
function
|
|
7877
|
+
function oo(e) {
|
|
7878
7878
|
const o = [...e.classList].filter(
|
|
7879
7879
|
(t) => !t.startsWith("bn-")
|
|
7880
7880
|
) || [];
|
|
7881
7881
|
o.length > 0 ? e.className = o.join(" ") : e.removeAttribute("class");
|
|
7882
7882
|
}
|
|
7883
|
-
function
|
|
7883
|
+
function io(e, o, t, i) {
|
|
7884
7884
|
let n;
|
|
7885
7885
|
if (o)
|
|
7886
7886
|
if (typeof o == "string")
|
|
@@ -7905,9 +7905,9 @@ function no(e, o, t, i) {
|
|
|
7905
7905
|
throw new H(o.type);
|
|
7906
7906
|
else throw new Error("blockContent is required");
|
|
7907
7907
|
const r = t.serializeFragment(U.from(n), i);
|
|
7908
|
-
return r.nodeType === 1 &&
|
|
7908
|
+
return r.nodeType === 1 && oo(r), r;
|
|
7909
7909
|
}
|
|
7910
|
-
function
|
|
7910
|
+
function bn(e, o, t, i, n, r, a) {
|
|
7911
7911
|
var f, b, k, _, w, v, C, O;
|
|
7912
7912
|
const s = (a == null ? void 0 : a.document) ?? document, l = o.pmSchema.nodes.blockContainer;
|
|
7913
7913
|
let d = t.props;
|
|
@@ -7931,11 +7931,11 @@ function kn(e, o, t, i, n, r, a) {
|
|
|
7931
7931
|
);
|
|
7932
7932
|
for (const E of S)
|
|
7933
7933
|
m.dom.firstChild.setAttribute(E.name, E.value);
|
|
7934
|
-
|
|
7934
|
+
oo(m.dom.firstChild), h.append(...m.dom.childNodes);
|
|
7935
7935
|
} else
|
|
7936
7936
|
h.append(m.dom);
|
|
7937
7937
|
if (m.contentDOM && t.content) {
|
|
7938
|
-
const S =
|
|
7938
|
+
const S = io(
|
|
7939
7939
|
o,
|
|
7940
7940
|
t.content,
|
|
7941
7941
|
// TODO
|
|
@@ -7956,7 +7956,7 @@ function kn(e, o, t, i, n, r, a) {
|
|
|
7956
7956
|
e.append(h);
|
|
7957
7957
|
if (t.children && t.children.length > 0) {
|
|
7958
7958
|
const S = s.createDocumentFragment();
|
|
7959
|
-
if (
|
|
7959
|
+
if (no(
|
|
7960
7960
|
S,
|
|
7961
7961
|
o,
|
|
7962
7962
|
t.children,
|
|
@@ -7970,9 +7970,9 @@ function kn(e, o, t, i, n, r, a) {
|
|
|
7970
7970
|
o.pmSchema.nodes[t.type].isInGroup("blockContent") ? e.append(S) : (O = m.contentDOM) == null || O.append(S);
|
|
7971
7971
|
}
|
|
7972
7972
|
}
|
|
7973
|
-
const
|
|
7973
|
+
const no = (e, o, t, i, n, r, a) => {
|
|
7974
7974
|
for (const s of t)
|
|
7975
|
-
|
|
7975
|
+
bn(
|
|
7976
7976
|
e,
|
|
7977
7977
|
o,
|
|
7978
7978
|
s,
|
|
@@ -7981,9 +7981,9 @@ const ro = (e, o, t, i, n, r, a) => {
|
|
|
7981
7981
|
r,
|
|
7982
7982
|
a
|
|
7983
7983
|
);
|
|
7984
|
-
},
|
|
7984
|
+
}, kn = (e, o, t, i, n, r) => {
|
|
7985
7985
|
const s = ((r == null ? void 0 : r.document) ?? document).createDocumentFragment();
|
|
7986
|
-
return
|
|
7986
|
+
return no(
|
|
7987
7987
|
s,
|
|
7988
7988
|
e,
|
|
7989
7989
|
o,
|
|
@@ -7993,10 +7993,10 @@ const ro = (e, o, t, i, n, r, a) => {
|
|
|
7993
7993
|
r
|
|
7994
7994
|
), s;
|
|
7995
7995
|
}, Ne = (e, o) => {
|
|
7996
|
-
const t =
|
|
7996
|
+
const t = Ut.fromSchema(e);
|
|
7997
7997
|
return {
|
|
7998
7998
|
exportBlocks: (i, n) => {
|
|
7999
|
-
const r =
|
|
7999
|
+
const r = kn(
|
|
8000
8000
|
o,
|
|
8001
8001
|
i,
|
|
8002
8002
|
t,
|
|
@@ -8007,7 +8007,7 @@ const ro = (e, o, t, i, n, r, a) => {
|
|
|
8007
8007
|
return a.append(r), a.innerHTML;
|
|
8008
8008
|
},
|
|
8009
8009
|
exportInlineContent: (i, n) => {
|
|
8010
|
-
const r =
|
|
8010
|
+
const r = io(
|
|
8011
8011
|
o,
|
|
8012
8012
|
i,
|
|
8013
8013
|
t,
|
|
@@ -8017,7 +8017,7 @@ const ro = (e, o, t, i, n, r, a) => {
|
|
|
8017
8017
|
}
|
|
8018
8018
|
};
|
|
8019
8019
|
};
|
|
8020
|
-
function
|
|
8020
|
+
function _n(e, o, t, i, n) {
|
|
8021
8021
|
let r;
|
|
8022
8022
|
if (o)
|
|
8023
8023
|
if (typeof o == "string")
|
|
@@ -8045,7 +8045,7 @@ function wn(e, o, t, i, n) {
|
|
|
8045
8045
|
else throw new Error("blockContent is required");
|
|
8046
8046
|
return t.serializeFragment(U.from(r), n);
|
|
8047
8047
|
}
|
|
8048
|
-
function
|
|
8048
|
+
function wn(e, o, t, i, n) {
|
|
8049
8049
|
var u, m, h, g, f;
|
|
8050
8050
|
const r = e.pmSchema.nodes.blockContainer;
|
|
8051
8051
|
let a = o.props;
|
|
@@ -8058,7 +8058,7 @@ function yn(e, o, t, i, n) {
|
|
|
8058
8058
|
}
|
|
8059
8059
|
const l = e.blockImplementations[o.type].implementation.toInternalHTML({ ...o, props: a }, e);
|
|
8060
8060
|
if (o.type === "numberedListItem" && l.dom.setAttribute("data-index", i.toString()), l.contentDOM && o.content) {
|
|
8061
|
-
const b =
|
|
8061
|
+
const b = _n(
|
|
8062
8062
|
e,
|
|
8063
8063
|
o.content,
|
|
8064
8064
|
// TODO
|
|
@@ -8070,7 +8070,7 @@ function yn(e, o, t, i, n) {
|
|
|
8070
8070
|
}
|
|
8071
8071
|
if (e.pmSchema.nodes[o.type].isInGroup("bnBlock")) {
|
|
8072
8072
|
if (o.children && o.children.length > 0) {
|
|
8073
|
-
const b =
|
|
8073
|
+
const b = ro(
|
|
8074
8074
|
e,
|
|
8075
8075
|
o.children,
|
|
8076
8076
|
t,
|
|
@@ -8088,15 +8088,15 @@ function yn(e, o, t, i, n) {
|
|
|
8088
8088
|
})
|
|
8089
8089
|
);
|
|
8090
8090
|
return (g = c.contentDOM) == null || g.appendChild(l.dom), o.children && o.children.length > 0 && ((f = c.contentDOM) == null || f.appendChild(
|
|
8091
|
-
|
|
8091
|
+
ao(e, o.children, t, n)
|
|
8092
8092
|
)), c.dom;
|
|
8093
8093
|
}
|
|
8094
|
-
function
|
|
8094
|
+
function ro(e, o, t, i) {
|
|
8095
8095
|
const r = ((i == null ? void 0 : i.document) ?? document).createDocumentFragment();
|
|
8096
8096
|
let a = 0;
|
|
8097
8097
|
for (const s of o) {
|
|
8098
8098
|
s.type === "numberedListItem" ? a++ : a = 0;
|
|
8099
|
-
const l =
|
|
8099
|
+
const l = wn(
|
|
8100
8100
|
e,
|
|
8101
8101
|
s,
|
|
8102
8102
|
t,
|
|
@@ -8107,14 +8107,14 @@ function ao(e, o, t, i) {
|
|
|
8107
8107
|
}
|
|
8108
8108
|
return r;
|
|
8109
8109
|
}
|
|
8110
|
-
const
|
|
8110
|
+
const ao = (e, o, t, i) => {
|
|
8111
8111
|
var s;
|
|
8112
|
-
const n = e.pmSchema.nodes.blockGroup, r = n.spec.toDOM(n.create({})), a =
|
|
8112
|
+
const n = e.pmSchema.nodes.blockGroup, r = n.spec.toDOM(n.create({})), a = ro(e, o, t, i);
|
|
8113
8113
|
return (s = r.contentDOM) == null || s.appendChild(a), r.dom;
|
|
8114
|
-
},
|
|
8115
|
-
const t =
|
|
8114
|
+
}, yn = (e, o) => {
|
|
8115
|
+
const t = Ut.fromSchema(e);
|
|
8116
8116
|
return {
|
|
8117
|
-
serializeBlocks: (i, n) =>
|
|
8117
|
+
serializeBlocks: (i, n) => ao(o, i, t, n).outerHTML
|
|
8118
8118
|
};
|
|
8119
8119
|
}, je = (e, o) => {
|
|
8120
8120
|
const t = e.querySelector(
|
|
@@ -8124,7 +8124,7 @@ const so = (e, o, t, i) => {
|
|
|
8124
8124
|
return;
|
|
8125
8125
|
const i = e.querySelector("figcaption"), n = (i == null ? void 0 : i.textContent) ?? void 0;
|
|
8126
8126
|
return { targetElement: t, caption: n };
|
|
8127
|
-
},
|
|
8127
|
+
}, vn = (e, o, t, i) => {
|
|
8128
8128
|
const n = document.createElement("div");
|
|
8129
8129
|
n.className = "bn-add-file-button";
|
|
8130
8130
|
const r = document.createElement("div");
|
|
@@ -8158,19 +8158,19 @@ const so = (e, o, t, i) => {
|
|
|
8158
8158
|
);
|
|
8159
8159
|
}
|
|
8160
8160
|
};
|
|
8161
|
-
},
|
|
8161
|
+
}, Cn = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>', xn = (e) => {
|
|
8162
8162
|
const o = document.createElement("div");
|
|
8163
8163
|
o.className = "bn-file-name-with-icon";
|
|
8164
8164
|
const t = document.createElement("div");
|
|
8165
|
-
t.className = "bn-file-icon", t.innerHTML =
|
|
8165
|
+
t.className = "bn-file-icon", t.innerHTML = Cn, o.appendChild(t);
|
|
8166
8166
|
const i = document.createElement("p");
|
|
8167
8167
|
return i.className = "bn-file-name", i.textContent = e.props.name, o.appendChild(i), {
|
|
8168
8168
|
dom: o
|
|
8169
8169
|
};
|
|
8170
|
-
},
|
|
8170
|
+
}, rt = (e, o, t, i, n) => {
|
|
8171
8171
|
const r = document.createElement("div");
|
|
8172
8172
|
if (r.className = "bn-file-block-content-wrapper", e.props.url === "") {
|
|
8173
|
-
const s =
|
|
8173
|
+
const s = vn(
|
|
8174
8174
|
e,
|
|
8175
8175
|
o,
|
|
8176
8176
|
i,
|
|
@@ -8193,7 +8193,7 @@ const so = (e, o, t, i) => {
|
|
|
8193
8193
|
}
|
|
8194
8194
|
const a = { dom: r };
|
|
8195
8195
|
if (e.props.showPreview === !1 || !t) {
|
|
8196
|
-
const s =
|
|
8196
|
+
const s = xn(e);
|
|
8197
8197
|
r.appendChild(s.dom), a.destroy = () => {
|
|
8198
8198
|
var l;
|
|
8199
8199
|
(l = s.destroy) == null || l.call(s);
|
|
@@ -8205,7 +8205,7 @@ const so = (e, o, t, i) => {
|
|
|
8205
8205
|
s.className = "bn-file-caption", s.textContent = e.props.caption, r.appendChild(s);
|
|
8206
8206
|
}
|
|
8207
8207
|
return a;
|
|
8208
|
-
},
|
|
8208
|
+
}, at = (e, o) => {
|
|
8209
8209
|
const t = document.createElement("figure"), i = document.createElement("figcaption");
|
|
8210
8210
|
return i.textContent = o, t.appendChild(e), t.appendChild(i), { dom: t };
|
|
8211
8211
|
}, Re = (e, o) => {
|
|
@@ -8213,7 +8213,7 @@ const so = (e, o, t, i) => {
|
|
|
8213
8213
|
return i.textContent = o, t.appendChild(e), t.appendChild(i), {
|
|
8214
8214
|
dom: t
|
|
8215
8215
|
};
|
|
8216
|
-
},
|
|
8216
|
+
}, yt = (e) => ({ url: e.src || void 0 }), Sn = '<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>', En = {
|
|
8217
8217
|
backgroundColor: B.backgroundColor,
|
|
8218
8218
|
// File name.
|
|
8219
8219
|
name: {
|
|
@@ -8230,35 +8230,35 @@ const so = (e, o, t, i) => {
|
|
|
8230
8230
|
showPreview: {
|
|
8231
8231
|
default: !0
|
|
8232
8232
|
}
|
|
8233
|
-
},
|
|
8233
|
+
}, Bn = {
|
|
8234
8234
|
type: "audio",
|
|
8235
|
-
propSchema:
|
|
8235
|
+
propSchema: En,
|
|
8236
8236
|
content: "none",
|
|
8237
8237
|
isFileBlock: !0,
|
|
8238
8238
|
fileBlockAccept: ["audio/*"]
|
|
8239
|
-
},
|
|
8239
|
+
}, Tn = (e, o) => {
|
|
8240
8240
|
const t = document.createElement("div");
|
|
8241
|
-
t.innerHTML =
|
|
8241
|
+
t.innerHTML = Sn;
|
|
8242
8242
|
const i = document.createElement("audio");
|
|
8243
8243
|
return i.className = "bn-audio", o.resolveFileUrl ? o.resolveFileUrl(e.props.url).then((n) => {
|
|
8244
8244
|
i.src = n;
|
|
8245
|
-
}) : i.src = e.props.url, i.controls = !0, i.contentEditable = "false", i.draggable = !1,
|
|
8245
|
+
}) : i.src = e.props.url, i.controls = !0, i.contentEditable = "false", i.draggable = !1, rt(
|
|
8246
8246
|
e,
|
|
8247
8247
|
o,
|
|
8248
8248
|
{ dom: i },
|
|
8249
8249
|
o.dictionary.file_blocks.audio.add_button_text,
|
|
8250
8250
|
t.firstElementChild
|
|
8251
8251
|
);
|
|
8252
|
-
},
|
|
8252
|
+
}, Mn = (e) => {
|
|
8253
8253
|
if (e.tagName === "AUDIO")
|
|
8254
|
-
return
|
|
8254
|
+
return yt(e);
|
|
8255
8255
|
if (e.tagName === "FIGURE") {
|
|
8256
8256
|
const o = je(e, "audio");
|
|
8257
8257
|
if (!o)
|
|
8258
8258
|
return;
|
|
8259
8259
|
const { targetElement: t, caption: i } = o;
|
|
8260
8260
|
return {
|
|
8261
|
-
...
|
|
8261
|
+
...yt(t),
|
|
8262
8262
|
caption: i
|
|
8263
8263
|
};
|
|
8264
8264
|
}
|
|
@@ -8270,20 +8270,20 @@ const so = (e, o, t, i) => {
|
|
|
8270
8270
|
};
|
|
8271
8271
|
}
|
|
8272
8272
|
let o;
|
|
8273
|
-
return e.props.showPreview ? (o = document.createElement("audio"), o.src = e.props.url) : (o = document.createElement("a"), o.href = e.props.url, o.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ?
|
|
8273
|
+
return e.props.showPreview ? (o = document.createElement("audio"), o.src = e.props.url) : (o = document.createElement("a"), o.href = e.props.url, o.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? at(o, e.props.caption) : Re(o, e.props.caption) : {
|
|
8274
8274
|
dom: o
|
|
8275
8275
|
};
|
|
8276
|
-
},
|
|
8277
|
-
render:
|
|
8278
|
-
parse:
|
|
8276
|
+
}, In = ve(Bn, {
|
|
8277
|
+
render: Tn,
|
|
8278
|
+
parse: Mn,
|
|
8279
8279
|
toExternalHTML: Ln
|
|
8280
|
-
}),
|
|
8280
|
+
}), so = [
|
|
8281
8281
|
{
|
|
8282
8282
|
id: "text",
|
|
8283
8283
|
name: "Plain Text",
|
|
8284
8284
|
match: ["text", "txt", "plain"]
|
|
8285
8285
|
},
|
|
8286
|
-
...
|
|
8286
|
+
...zt.filter((e) => [
|
|
8287
8287
|
"c",
|
|
8288
8288
|
"cpp",
|
|
8289
8289
|
"css",
|
|
@@ -8380,14 +8380,14 @@ const so = (e, o, t, i) => {
|
|
|
8380
8380
|
name: "Objective C",
|
|
8381
8381
|
match: ["objective-c", "objc"]
|
|
8382
8382
|
}
|
|
8383
|
-
],
|
|
8383
|
+
], vt = Symbol.for("blocknote.shikiParser"), Ue = Symbol.for(
|
|
8384
8384
|
"blocknote.shikiHighlighterPromise"
|
|
8385
|
-
),
|
|
8385
|
+
), Je = {
|
|
8386
8386
|
language: {
|
|
8387
8387
|
default: "javascript",
|
|
8388
|
-
values: [...
|
|
8388
|
+
values: [...so.map((e) => e.id)]
|
|
8389
8389
|
}
|
|
8390
|
-
},
|
|
8390
|
+
}, lo = G({
|
|
8391
8391
|
name: "codeBlock",
|
|
8392
8392
|
content: "inline*",
|
|
8393
8393
|
group: "blockContent",
|
|
@@ -8398,7 +8398,7 @@ const so = (e, o, t, i) => {
|
|
|
8398
8398
|
return {
|
|
8399
8399
|
defaultLanguage: "javascript",
|
|
8400
8400
|
indentLineWithTab: !0,
|
|
8401
|
-
supportedLanguages:
|
|
8401
|
+
supportedLanguages: so
|
|
8402
8402
|
};
|
|
8403
8403
|
},
|
|
8404
8404
|
addAttributes() {
|
|
@@ -8486,10 +8486,10 @@ const so = (e, o, t, i) => {
|
|
|
8486
8486
|
addProseMirrorPlugins() {
|
|
8487
8487
|
const e = this.options.supportedLanguages, o = globalThis;
|
|
8488
8488
|
let t, i;
|
|
8489
|
-
return [
|
|
8489
|
+
return [ei({
|
|
8490
8490
|
parser: (a) => {
|
|
8491
8491
|
if (!t)
|
|
8492
|
-
return o[Ue] = o[Ue] ||
|
|
8492
|
+
return o[Ue] = o[Ue] || oi({
|
|
8493
8493
|
themes: ["github-dark"],
|
|
8494
8494
|
langs: []
|
|
8495
8495
|
}), o[Ue].then(
|
|
@@ -8498,7 +8498,7 @@ const so = (e, o, t, i) => {
|
|
|
8498
8498
|
}
|
|
8499
8499
|
);
|
|
8500
8500
|
const s = a.language;
|
|
8501
|
-
return s && s !== "text" && !t.getLoadedLanguages().includes(s) && e.find(({ id: l }) => l === s) &&
|
|
8501
|
+
return s && s !== "text" && !t.getLoadedLanguages().includes(s) && e.find(({ id: l }) => l === s) && zt.find(({ id: l }) => l === s) ? t.loadLanguage(s) : (i || (i = o[vt] || ti(t), o[vt] = i), i(a));
|
|
8502
8502
|
},
|
|
8503
8503
|
languageExtractor: (a) => a.attrs.language,
|
|
8504
8504
|
nodeTypes: [this.name]
|
|
@@ -8529,7 +8529,7 @@ const so = (e, o, t, i) => {
|
|
|
8529
8529
|
return {
|
|
8530
8530
|
Delete: ({ editor: e }) => {
|
|
8531
8531
|
const { selection: o } = e.state, { $from: t } = o;
|
|
8532
|
-
if (e.isActive(this.name) && !t.parent.textContent &&
|
|
8532
|
+
if (e.isActive(this.name) && !t.parent.textContent && Ot(o)) {
|
|
8533
8533
|
const i = t.pos - t.parentOffset - 2;
|
|
8534
8534
|
return e.chain().setNodeSelection(i).deleteSelection().run(), !0;
|
|
8535
8535
|
}
|
|
@@ -8557,23 +8557,23 @@ const so = (e, o, t, i) => {
|
|
|
8557
8557
|
}
|
|
8558
8558
|
};
|
|
8559
8559
|
}
|
|
8560
|
-
}),
|
|
8561
|
-
|
|
8562
|
-
|
|
8560
|
+
}), An = J(
|
|
8561
|
+
lo,
|
|
8562
|
+
Je
|
|
8563
8563
|
);
|
|
8564
8564
|
function tl(e) {
|
|
8565
8565
|
var o;
|
|
8566
8566
|
return J(
|
|
8567
|
-
|
|
8567
|
+
lo.configure(e),
|
|
8568
8568
|
{
|
|
8569
8569
|
language: {
|
|
8570
|
-
default: e.defaultLanguage ||
|
|
8571
|
-
values: ((o = e.supportedLanguages) == null ? void 0 : o.map((t) => t.id)) ||
|
|
8570
|
+
default: e.defaultLanguage || Je.language.default,
|
|
8571
|
+
values: ((o = e.supportedLanguages) == null ? void 0 : o.map((t) => t.id)) || Je.language.values
|
|
8572
8572
|
}
|
|
8573
8573
|
}
|
|
8574
8574
|
);
|
|
8575
8575
|
}
|
|
8576
|
-
const
|
|
8576
|
+
const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
8577
8577
|
backgroundColor: B.backgroundColor,
|
|
8578
8578
|
// File name.
|
|
8579
8579
|
name: {
|
|
@@ -8587,25 +8587,25 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
8587
8587
|
caption: {
|
|
8588
8588
|
default: ""
|
|
8589
8589
|
}
|
|
8590
|
-
},
|
|
8590
|
+
}, Nn = {
|
|
8591
8591
|
type: "file",
|
|
8592
|
-
propSchema:
|
|
8592
|
+
propSchema: Pn,
|
|
8593
8593
|
content: "none",
|
|
8594
8594
|
isFileBlock: !0
|
|
8595
|
-
},
|
|
8595
|
+
}, jn = (e, o) => rt(e, o), Rn = (e) => {
|
|
8596
8596
|
if (e.tagName === "EMBED")
|
|
8597
|
-
return
|
|
8597
|
+
return Ct(e);
|
|
8598
8598
|
if (e.tagName === "FIGURE") {
|
|
8599
8599
|
const o = je(e, "embed");
|
|
8600
8600
|
if (!o)
|
|
8601
8601
|
return;
|
|
8602
8602
|
const { targetElement: t, caption: i } = o;
|
|
8603
8603
|
return {
|
|
8604
|
-
...
|
|
8604
|
+
...Ct(t),
|
|
8605
8605
|
caption: i
|
|
8606
8606
|
};
|
|
8607
8607
|
}
|
|
8608
|
-
},
|
|
8608
|
+
}, Dn = (e) => {
|
|
8609
8609
|
if (!e.props.url) {
|
|
8610
8610
|
const t = document.createElement("p");
|
|
8611
8611
|
return t.textContent = "Add file", {
|
|
@@ -8616,12 +8616,12 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
8616
8616
|
return o.href = e.props.url, o.textContent = e.props.name || e.props.url, e.props.caption ? Re(o, e.props.caption) : {
|
|
8617
8617
|
dom: o
|
|
8618
8618
|
};
|
|
8619
|
-
},
|
|
8620
|
-
render:
|
|
8621
|
-
parse:
|
|
8622
|
-
toExternalHTML:
|
|
8623
|
-
}),
|
|
8624
|
-
const { dom: a, destroy: s } =
|
|
8619
|
+
}, Un = ve(Nn, {
|
|
8620
|
+
render: jn,
|
|
8621
|
+
parse: Rn,
|
|
8622
|
+
toExternalHTML: Dn
|
|
8623
|
+
}), co = (e, o, t, i, n, r) => {
|
|
8624
|
+
const { dom: a, destroy: s } = rt(
|
|
8625
8625
|
e,
|
|
8626
8626
|
o,
|
|
8627
8627
|
t,
|
|
@@ -8691,10 +8691,10 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
8691
8691
|
"tmpfiles.org/",
|
|
8692
8692
|
"tmpfiles.org/dl/"
|
|
8693
8693
|
);
|
|
8694
|
-
},
|
|
8694
|
+
}, xt = (e) => {
|
|
8695
8695
|
const o = e.src || void 0, t = e.width || void 0;
|
|
8696
8696
|
return { url: o, previewWidth: t };
|
|
8697
|
-
},
|
|
8697
|
+
}, Hn = '<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>', On = {
|
|
8698
8698
|
textAlignment: B.textAlignment,
|
|
8699
8699
|
backgroundColor: B.backgroundColor,
|
|
8700
8700
|
// File name.
|
|
@@ -8716,21 +8716,21 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
8716
8716
|
previewWidth: {
|
|
8717
8717
|
default: 512
|
|
8718
8718
|
}
|
|
8719
|
-
},
|
|
8719
|
+
}, Vn = {
|
|
8720
8720
|
type: "image",
|
|
8721
|
-
propSchema:
|
|
8721
|
+
propSchema: On,
|
|
8722
8722
|
content: "none",
|
|
8723
8723
|
isFileBlock: !0,
|
|
8724
8724
|
fileBlockAccept: ["image/*"]
|
|
8725
|
-
},
|
|
8725
|
+
}, zn = (e, o) => {
|
|
8726
8726
|
const t = document.createElement("div");
|
|
8727
|
-
t.innerHTML =
|
|
8727
|
+
t.innerHTML = Hn;
|
|
8728
8728
|
const i = document.createElement("div");
|
|
8729
8729
|
i.className = "bn-visual-media-wrapper";
|
|
8730
8730
|
const n = document.createElement("img");
|
|
8731
8731
|
return n.className = "bn-visual-media", o.resolveFileUrl ? o.resolveFileUrl(e.props.url).then((r) => {
|
|
8732
8732
|
n.src = r;
|
|
8733
|
-
}) : n.src = e.props.url, n.alt = e.props.name || e.props.caption || "BlockNote image", n.contentEditable = "false", n.draggable = !1, i.appendChild(n),
|
|
8733
|
+
}) : n.src = e.props.url, n.alt = e.props.name || e.props.caption || "BlockNote image", n.contentEditable = "false", n.draggable = !1, i.appendChild(n), co(
|
|
8734
8734
|
e,
|
|
8735
8735
|
o,
|
|
8736
8736
|
{ dom: i },
|
|
@@ -8738,20 +8738,20 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
8738
8738
|
o.dictionary.file_blocks.image.add_button_text,
|
|
8739
8739
|
t.firstElementChild
|
|
8740
8740
|
);
|
|
8741
|
-
},
|
|
8741
|
+
}, Fn = (e) => {
|
|
8742
8742
|
if (e.tagName === "IMG")
|
|
8743
|
-
return
|
|
8743
|
+
return xt(e);
|
|
8744
8744
|
if (e.tagName === "FIGURE") {
|
|
8745
8745
|
const o = je(e, "img");
|
|
8746
8746
|
if (!o)
|
|
8747
8747
|
return;
|
|
8748
8748
|
const { targetElement: t, caption: i } = o;
|
|
8749
8749
|
return {
|
|
8750
|
-
...
|
|
8750
|
+
...xt(t),
|
|
8751
8751
|
caption: i
|
|
8752
8752
|
};
|
|
8753
8753
|
}
|
|
8754
|
-
},
|
|
8754
|
+
}, $n = (e) => {
|
|
8755
8755
|
if (!e.props.url) {
|
|
8756
8756
|
const t = document.createElement("p");
|
|
8757
8757
|
return t.textContent = "Add image", {
|
|
@@ -8759,39 +8759,39 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
8759
8759
|
};
|
|
8760
8760
|
}
|
|
8761
8761
|
let o;
|
|
8762
|
-
return e.props.showPreview ? (o = document.createElement("img"), o.src = e.props.url, o.alt = e.props.name || e.props.caption || "BlockNote image", o.width = e.props.previewWidth) : (o = document.createElement("a"), o.href = e.props.url, o.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ?
|
|
8762
|
+
return e.props.showPreview ? (o = document.createElement("img"), o.src = e.props.url, o.alt = e.props.name || e.props.caption || "BlockNote image", o.width = e.props.previewWidth) : (o = document.createElement("a"), o.href = e.props.url, o.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? at(o, e.props.caption) : Re(o, e.props.caption) : {
|
|
8763
8763
|
dom: o
|
|
8764
8764
|
};
|
|
8765
|
-
},
|
|
8766
|
-
render:
|
|
8767
|
-
parse:
|
|
8768
|
-
toExternalHTML:
|
|
8769
|
-
}),
|
|
8765
|
+
}, Gn = ve(Vn, {
|
|
8766
|
+
render: zn,
|
|
8767
|
+
parse: Fn,
|
|
8768
|
+
toExternalHTML: $n
|
|
8769
|
+
}), Wn = {
|
|
8770
8770
|
type: "pageBreak",
|
|
8771
8771
|
propSchema: {},
|
|
8772
8772
|
content: "none",
|
|
8773
8773
|
isFileBlock: !1,
|
|
8774
8774
|
isSelectable: !1
|
|
8775
|
-
},
|
|
8775
|
+
}, Kn = () => {
|
|
8776
8776
|
const e = document.createElement("div");
|
|
8777
8777
|
return e.className = "bn-page-break", e.setAttribute("data-page-break", ""), {
|
|
8778
8778
|
dom: e
|
|
8779
8779
|
};
|
|
8780
|
-
},
|
|
8780
|
+
}, qn = (e) => {
|
|
8781
8781
|
if (e.tagName === "DIV" && e.hasAttribute("data-page-break"))
|
|
8782
8782
|
return {
|
|
8783
8783
|
type: "pageBreak"
|
|
8784
8784
|
};
|
|
8785
|
-
},
|
|
8785
|
+
}, Xn = () => {
|
|
8786
8786
|
const e = document.createElement("div");
|
|
8787
8787
|
return e.setAttribute("data-page-break", ""), {
|
|
8788
8788
|
dom: e
|
|
8789
8789
|
};
|
|
8790
|
-
},
|
|
8791
|
-
render:
|
|
8792
|
-
parse:
|
|
8793
|
-
toExternalHTML:
|
|
8794
|
-
}),
|
|
8790
|
+
}, Zn = ve(Wn, {
|
|
8791
|
+
render: Kn,
|
|
8792
|
+
parse: qn,
|
|
8793
|
+
toExternalHTML: Xn
|
|
8794
|
+
}), Jn = ge.create({
|
|
8795
8795
|
name: "backgroundColor",
|
|
8796
8796
|
addAttributes() {
|
|
8797
8797
|
return {
|
|
@@ -8817,10 +8817,10 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
8817
8817
|
renderHTML({ HTMLAttributes: e }) {
|
|
8818
8818
|
return ["span", e, 0];
|
|
8819
8819
|
}
|
|
8820
|
-
}),
|
|
8821
|
-
|
|
8820
|
+
}), Yn = Q(
|
|
8821
|
+
Jn,
|
|
8822
8822
|
"string"
|
|
8823
|
-
),
|
|
8823
|
+
), Qn = ge.create({
|
|
8824
8824
|
name: "textColor",
|
|
8825
8825
|
addAttributes() {
|
|
8826
8826
|
return {
|
|
@@ -8844,15 +8844,15 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
8844
8844
|
renderHTML({ HTMLAttributes: e }) {
|
|
8845
8845
|
return ["span", e, 0];
|
|
8846
8846
|
}
|
|
8847
|
-
}),
|
|
8847
|
+
}), er = Q(Qn, "string"), uo = {
|
|
8848
8848
|
...B,
|
|
8849
8849
|
level: { default: 1, values: [1, 2, 3] }
|
|
8850
|
-
},
|
|
8850
|
+
}, tr = G({
|
|
8851
8851
|
name: "heading",
|
|
8852
8852
|
content: "inline*",
|
|
8853
8853
|
group: "blockContent",
|
|
8854
8854
|
addAttributes() {
|
|
8855
|
-
return ye(
|
|
8855
|
+
return ye(uo);
|
|
8856
8856
|
},
|
|
8857
8857
|
addInputRules() {
|
|
8858
8858
|
return [
|
|
@@ -8947,10 +8947,10 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
8947
8947
|
((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
|
|
8948
8948
|
);
|
|
8949
8949
|
}
|
|
8950
|
-
}),
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
),
|
|
8950
|
+
}), or = J(
|
|
8951
|
+
tr,
|
|
8952
|
+
uo
|
|
8953
|
+
), po = (e, o, t) => ({
|
|
8954
8954
|
state: i,
|
|
8955
8955
|
dispatch: n
|
|
8956
8956
|
}) => {
|
|
@@ -8971,7 +8971,7 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
8971
8971
|
}
|
|
8972
8972
|
];
|
|
8973
8973
|
return n && i.tr.split(e, 2, s), !0;
|
|
8974
|
-
},
|
|
8974
|
+
}, st = (e) => {
|
|
8975
8975
|
const o = e._tiptapEditor, t = y(o.state);
|
|
8976
8976
|
if (!t.isBlockContainer)
|
|
8977
8977
|
return !1;
|
|
@@ -8989,12 +8989,12 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
8989
8989
|
() => (
|
|
8990
8990
|
// Splits the current block, moving content inside that's after the cursor
|
|
8991
8991
|
// to a new block of the same type below.
|
|
8992
|
-
l.command(() => n.node.childCount > 0 ? (s().deleteSelection().command(
|
|
8992
|
+
l.command(() => n.node.childCount > 0 ? (s().deleteSelection().command(po(a.selection.from, !0)).run(), !0) : !1)
|
|
8993
8993
|
)
|
|
8994
8994
|
]);
|
|
8995
|
-
},
|
|
8995
|
+
}, ir = {
|
|
8996
8996
|
...B
|
|
8997
|
-
},
|
|
8997
|
+
}, nr = G({
|
|
8998
8998
|
name: "bulletListItem",
|
|
8999
8999
|
content: "inline*",
|
|
9000
9000
|
group: "blockContent",
|
|
@@ -9024,7 +9024,7 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9024
9024
|
},
|
|
9025
9025
|
addKeyboardShortcuts() {
|
|
9026
9026
|
return {
|
|
9027
|
-
Enter: () =>
|
|
9027
|
+
Enter: () => st(this.options.editor),
|
|
9028
9028
|
"Mod-Shift-8": () => {
|
|
9029
9029
|
const e = y(this.editor.state);
|
|
9030
9030
|
return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
|
|
@@ -9081,20 +9081,20 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9081
9081
|
((t = this.options.domAttributes) == null ? void 0 : t.inlineContent) || {}
|
|
9082
9082
|
);
|
|
9083
9083
|
}
|
|
9084
|
-
}),
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
),
|
|
9084
|
+
}), rr = J(
|
|
9085
|
+
nr,
|
|
9086
|
+
ir
|
|
9087
|
+
), mo = {
|
|
9088
9088
|
...B,
|
|
9089
9089
|
checked: {
|
|
9090
9090
|
default: !1
|
|
9091
9091
|
}
|
|
9092
|
-
},
|
|
9092
|
+
}, ar = G({
|
|
9093
9093
|
name: "checkListItem",
|
|
9094
9094
|
content: "inline*",
|
|
9095
9095
|
group: "blockContent",
|
|
9096
9096
|
addAttributes() {
|
|
9097
|
-
return ye(
|
|
9097
|
+
return ye(mo);
|
|
9098
9098
|
},
|
|
9099
9099
|
addInputRules() {
|
|
9100
9100
|
return [
|
|
@@ -9139,7 +9139,7 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9139
9139
|
},
|
|
9140
9140
|
addKeyboardShortcuts() {
|
|
9141
9141
|
return {
|
|
9142
|
-
Enter: () =>
|
|
9142
|
+
Enter: () => st(this.options.editor),
|
|
9143
9143
|
"Mod-Shift-9": () => {
|
|
9144
9144
|
const e = y(this.editor.state);
|
|
9145
9145
|
return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
|
|
@@ -9263,11 +9263,11 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9263
9263
|
};
|
|
9264
9264
|
};
|
|
9265
9265
|
}
|
|
9266
|
-
}),
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
),
|
|
9270
|
-
key:
|
|
9266
|
+
}), sr = J(
|
|
9267
|
+
ar,
|
|
9268
|
+
mo
|
|
9269
|
+
), lr = new A("numbered-list-indexing"), dr = () => new T({
|
|
9270
|
+
key: lr,
|
|
9271
9271
|
appendTransaction: (e, o, t) => {
|
|
9272
9272
|
const i = t.tr;
|
|
9273
9273
|
i.setMeta("numberedListIndexing", !0);
|
|
@@ -9312,17 +9312,17 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9312
9312
|
}
|
|
9313
9313
|
}), n ? i : null;
|
|
9314
9314
|
}
|
|
9315
|
-
}),
|
|
9315
|
+
}), ho = {
|
|
9316
9316
|
...B,
|
|
9317
9317
|
start: { default: void 0, type: "number" }
|
|
9318
|
-
},
|
|
9318
|
+
}, cr = G({
|
|
9319
9319
|
name: "numberedListItem",
|
|
9320
9320
|
content: "inline*",
|
|
9321
9321
|
group: "blockContent",
|
|
9322
9322
|
priority: 90,
|
|
9323
9323
|
addAttributes() {
|
|
9324
9324
|
return {
|
|
9325
|
-
...ye(
|
|
9325
|
+
...ye(ho),
|
|
9326
9326
|
// the index attribute is only used internally (it's not part of the blocknote schema)
|
|
9327
9327
|
// that's why it's defined explicitly here, and not part of the prop schema
|
|
9328
9328
|
index: {
|
|
@@ -9362,7 +9362,7 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9362
9362
|
},
|
|
9363
9363
|
addKeyboardShortcuts() {
|
|
9364
9364
|
return {
|
|
9365
|
-
Enter: () =>
|
|
9365
|
+
Enter: () => st(this.options.editor),
|
|
9366
9366
|
"Mod-Shift-7": () => {
|
|
9367
9367
|
const e = y(this.editor.state);
|
|
9368
9368
|
return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
|
|
@@ -9375,7 +9375,7 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9375
9375
|
};
|
|
9376
9376
|
},
|
|
9377
9377
|
addProseMirrorPlugins() {
|
|
9378
|
-
return [
|
|
9378
|
+
return [dr()];
|
|
9379
9379
|
},
|
|
9380
9380
|
parseHTML() {
|
|
9381
9381
|
return [
|
|
@@ -9432,12 +9432,12 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9432
9432
|
((t = this.options.domAttributes) == null ? void 0 : t.inlineContent) || {}
|
|
9433
9433
|
);
|
|
9434
9434
|
}
|
|
9435
|
-
}),
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
),
|
|
9435
|
+
}), ur = J(
|
|
9436
|
+
cr,
|
|
9437
|
+
ho
|
|
9438
|
+
), pr = {
|
|
9439
9439
|
...B
|
|
9440
|
-
},
|
|
9440
|
+
}, mr = G({
|
|
9441
9441
|
name: "paragraph",
|
|
9442
9442
|
content: "inline*",
|
|
9443
9443
|
group: "blockContent",
|
|
@@ -9480,21 +9480,21 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9480
9480
|
((t = this.options.domAttributes) == null ? void 0 : t.inlineContent) || {}
|
|
9481
9481
|
);
|
|
9482
9482
|
}
|
|
9483
|
-
}),
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
),
|
|
9483
|
+
}), hr = J(
|
|
9484
|
+
mr,
|
|
9485
|
+
pr
|
|
9486
|
+
), fr = 35, fo = 120, il = 31, gr = j.create({
|
|
9487
9487
|
name: "BlockNoteTableExtension",
|
|
9488
9488
|
addProseMirrorPlugins: () => [
|
|
9489
|
-
|
|
9490
|
-
cellMinWidth:
|
|
9491
|
-
defaultCellMinWidth:
|
|
9489
|
+
ii({
|
|
9490
|
+
cellMinWidth: fr,
|
|
9491
|
+
defaultCellMinWidth: fo,
|
|
9492
9492
|
// We set this to null as we implement our own node view in the table
|
|
9493
9493
|
// block content. This node view is the same as what's used by default,
|
|
9494
9494
|
// but is wrapped in a `blockContent` HTML element.
|
|
9495
9495
|
View: null
|
|
9496
9496
|
}),
|
|
9497
|
-
|
|
9497
|
+
ni()
|
|
9498
9498
|
],
|
|
9499
9499
|
addKeyboardShortcuts() {
|
|
9500
9500
|
return {
|
|
@@ -9508,10 +9508,10 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9508
9508
|
},
|
|
9509
9509
|
// Enables navigating cells using the tab key.
|
|
9510
9510
|
Tab: () => this.editor.commands.command(
|
|
9511
|
-
({ state: e, dispatch: o, view: t }) =>
|
|
9511
|
+
({ state: e, dispatch: o, view: t }) => ht(1)(e, o, t)
|
|
9512
9512
|
),
|
|
9513
9513
|
"Shift-Tab": () => this.editor.commands.command(
|
|
9514
|
-
({ state: e, dispatch: o, view: t }) =>
|
|
9514
|
+
({ state: e, dispatch: o, view: t }) => ht(-1)(e, o, t)
|
|
9515
9515
|
)
|
|
9516
9516
|
};
|
|
9517
9517
|
},
|
|
@@ -9522,14 +9522,14 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9522
9522
|
storage: e.storage
|
|
9523
9523
|
};
|
|
9524
9524
|
return {
|
|
9525
|
-
tableRole:
|
|
9526
|
-
|
|
9525
|
+
tableRole: Go(
|
|
9526
|
+
Wo(e, "tableRole", o)
|
|
9527
9527
|
)
|
|
9528
9528
|
};
|
|
9529
9529
|
}
|
|
9530
|
-
}),
|
|
9530
|
+
}), br = {
|
|
9531
9531
|
textColor: B.textColor
|
|
9532
|
-
},
|
|
9532
|
+
}, kr = G({
|
|
9533
9533
|
name: "table",
|
|
9534
9534
|
content: "tableRow+",
|
|
9535
9535
|
group: "blockContent",
|
|
@@ -9560,7 +9560,7 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9560
9560
|
addNodeView() {
|
|
9561
9561
|
return ({ node: e, HTMLAttributes: o }) => {
|
|
9562
9562
|
var i;
|
|
9563
|
-
class t extends
|
|
9563
|
+
class t extends ri {
|
|
9564
9564
|
constructor(r, a, s) {
|
|
9565
9565
|
super(r, a), this.node = r, this.cellMinWidth = a, this.blockContentHTMLAttributes = s;
|
|
9566
9566
|
const l = document.createElement("div");
|
|
@@ -9581,13 +9581,13 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9581
9581
|
return !r.target.closest(".tableWrapper-inner") || super.ignoreMutation(r);
|
|
9582
9582
|
}
|
|
9583
9583
|
}
|
|
9584
|
-
return new t(e,
|
|
9584
|
+
return new t(e, fo, {
|
|
9585
9585
|
...((i = this.options.domAttributes) == null ? void 0 : i.blockContent) || {},
|
|
9586
9586
|
...o
|
|
9587
9587
|
});
|
|
9588
9588
|
};
|
|
9589
9589
|
}
|
|
9590
|
-
}),
|
|
9590
|
+
}), _r = G({
|
|
9591
9591
|
name: "tableParagraph",
|
|
9592
9592
|
group: "tableContent",
|
|
9593
9593
|
content: "inline*",
|
|
@@ -9616,13 +9616,13 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9616
9616
|
renderHTML({ HTMLAttributes: e }) {
|
|
9617
9617
|
return ["p", e, 0];
|
|
9618
9618
|
}
|
|
9619
|
-
}),
|
|
9620
|
-
_r,
|
|
9619
|
+
}), wr = J(
|
|
9621
9620
|
kr,
|
|
9621
|
+
br,
|
|
9622
9622
|
[
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9623
|
+
gr,
|
|
9624
|
+
_r,
|
|
9625
|
+
wi.extend({
|
|
9626
9626
|
/**
|
|
9627
9627
|
* We allow table headers and cells to have multiple tableContent nodes because
|
|
9628
9628
|
* when merging cells, prosemirror-tables will concat the contents of the cells naively.
|
|
@@ -9632,15 +9632,15 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9632
9632
|
*/
|
|
9633
9633
|
content: "tableContent+"
|
|
9634
9634
|
}),
|
|
9635
|
-
|
|
9635
|
+
_i.extend({
|
|
9636
9636
|
content: "tableContent+"
|
|
9637
9637
|
}),
|
|
9638
|
-
|
|
9638
|
+
yi
|
|
9639
9639
|
]
|
|
9640
|
-
),
|
|
9640
|
+
), St = (e) => {
|
|
9641
9641
|
const o = e.src || void 0, t = e.width || void 0;
|
|
9642
9642
|
return { url: o, previewWidth: t };
|
|
9643
|
-
},
|
|
9643
|
+
}, yr = '<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>', vr = {
|
|
9644
9644
|
textAlignment: B.textAlignment,
|
|
9645
9645
|
backgroundColor: B.backgroundColor,
|
|
9646
9646
|
// File name.
|
|
@@ -9662,21 +9662,21 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9662
9662
|
previewWidth: {
|
|
9663
9663
|
default: 512
|
|
9664
9664
|
}
|
|
9665
|
-
},
|
|
9665
|
+
}, Cr = {
|
|
9666
9666
|
type: "video",
|
|
9667
|
-
propSchema:
|
|
9667
|
+
propSchema: vr,
|
|
9668
9668
|
content: "none",
|
|
9669
9669
|
isFileBlock: !0,
|
|
9670
9670
|
fileBlockAccept: ["video/*"]
|
|
9671
|
-
},
|
|
9671
|
+
}, xr = (e, o) => {
|
|
9672
9672
|
const t = document.createElement("div");
|
|
9673
|
-
t.innerHTML =
|
|
9673
|
+
t.innerHTML = yr;
|
|
9674
9674
|
const i = document.createElement("div");
|
|
9675
9675
|
i.className = "bn-visual-media-wrapper";
|
|
9676
9676
|
const n = document.createElement("video");
|
|
9677
9677
|
return n.className = "bn-visual-media", o.resolveFileUrl ? o.resolveFileUrl(e.props.url).then((r) => {
|
|
9678
9678
|
n.src = r;
|
|
9679
|
-
}) : n.src = e.props.url, n.controls = !0, n.contentEditable = "false", n.draggable = !1, n.width = e.props.previewWidth, i.appendChild(n),
|
|
9679
|
+
}) : n.src = e.props.url, n.controls = !0, n.contentEditable = "false", n.draggable = !1, n.width = e.props.previewWidth, i.appendChild(n), co(
|
|
9680
9680
|
e,
|
|
9681
9681
|
o,
|
|
9682
9682
|
{ dom: i },
|
|
@@ -9684,20 +9684,20 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9684
9684
|
o.dictionary.file_blocks.video.add_button_text,
|
|
9685
9685
|
t.firstElementChild
|
|
9686
9686
|
);
|
|
9687
|
-
},
|
|
9687
|
+
}, Sr = (e) => {
|
|
9688
9688
|
if (e.tagName === "VIDEO")
|
|
9689
|
-
return
|
|
9689
|
+
return St(e);
|
|
9690
9690
|
if (e.tagName === "FIGURE") {
|
|
9691
9691
|
const o = je(e, "video");
|
|
9692
9692
|
if (!o)
|
|
9693
9693
|
return;
|
|
9694
9694
|
const { targetElement: t, caption: i } = o;
|
|
9695
9695
|
return {
|
|
9696
|
-
...
|
|
9696
|
+
...St(t),
|
|
9697
9697
|
caption: i
|
|
9698
9698
|
};
|
|
9699
9699
|
}
|
|
9700
|
-
},
|
|
9700
|
+
}, Er = (e) => {
|
|
9701
9701
|
if (!e.props.url) {
|
|
9702
9702
|
const t = document.createElement("p");
|
|
9703
9703
|
return t.textContent = "Add video", {
|
|
@@ -9705,46 +9705,46 @@ const xt = (e) => ({ url: e.src || void 0 }), Nn = {
|
|
|
9705
9705
|
};
|
|
9706
9706
|
}
|
|
9707
9707
|
let o;
|
|
9708
|
-
return e.props.showPreview ? (o = document.createElement("video"), o.src = e.props.url, o.width = e.props.previewWidth) : (o = document.createElement("a"), o.href = e.props.url, o.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ?
|
|
9708
|
+
return e.props.showPreview ? (o = document.createElement("video"), o.src = e.props.url, o.width = e.props.previewWidth) : (o = document.createElement("a"), o.href = e.props.url, o.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? at(o, e.props.caption) : Re(o, e.props.caption) : {
|
|
9709
9709
|
dom: o
|
|
9710
9710
|
};
|
|
9711
|
-
},
|
|
9712
|
-
render:
|
|
9713
|
-
parse:
|
|
9714
|
-
toExternalHTML:
|
|
9715
|
-
}),
|
|
9716
|
-
paragraph:
|
|
9717
|
-
heading:
|
|
9718
|
-
codeBlock:
|
|
9719
|
-
bulletListItem:
|
|
9720
|
-
numberedListItem:
|
|
9721
|
-
checkListItem:
|
|
9722
|
-
table:
|
|
9723
|
-
file:
|
|
9724
|
-
image:
|
|
9725
|
-
video:
|
|
9726
|
-
audio:
|
|
9727
|
-
},
|
|
9728
|
-
bold: Q(
|
|
9729
|
-
italic: Q(
|
|
9730
|
-
underline: Q(
|
|
9731
|
-
strike: Q(
|
|
9732
|
-
code: Q(
|
|
9733
|
-
textColor:
|
|
9734
|
-
backgroundColor:
|
|
9735
|
-
}, nl =
|
|
9711
|
+
}, Br = ve(Cr, {
|
|
9712
|
+
render: xr,
|
|
9713
|
+
parse: Sr,
|
|
9714
|
+
toExternalHTML: Er
|
|
9715
|
+
}), go = {
|
|
9716
|
+
paragraph: hr,
|
|
9717
|
+
heading: or,
|
|
9718
|
+
codeBlock: An,
|
|
9719
|
+
bulletListItem: rr,
|
|
9720
|
+
numberedListItem: ur,
|
|
9721
|
+
checkListItem: sr,
|
|
9722
|
+
table: wr,
|
|
9723
|
+
file: Un,
|
|
9724
|
+
image: Gn,
|
|
9725
|
+
video: Br,
|
|
9726
|
+
audio: In
|
|
9727
|
+
}, Tr = Kt(go), bo = {
|
|
9728
|
+
bold: Q(hi, "boolean"),
|
|
9729
|
+
italic: Q(gi, "boolean"),
|
|
9730
|
+
underline: Q(ki, "boolean"),
|
|
9731
|
+
strike: Q(bi, "boolean"),
|
|
9732
|
+
code: Q(fi, "boolean"),
|
|
9733
|
+
textColor: er,
|
|
9734
|
+
backgroundColor: Yn
|
|
9735
|
+
}, nl = Jt(bo), ko = {
|
|
9736
9736
|
text: { config: "text", implementation: {} },
|
|
9737
9737
|
link: { config: "link", implementation: {} }
|
|
9738
|
-
},
|
|
9739
|
-
|
|
9738
|
+
}, Mr = Xt(
|
|
9739
|
+
ko
|
|
9740
9740
|
);
|
|
9741
9741
|
function P(e, o) {
|
|
9742
|
-
return e in o.schema.blockSchema && o.schema.blockSchema[e] ===
|
|
9742
|
+
return e in o.schema.blockSchema && o.schema.blockSchema[e] === Tr[e];
|
|
9743
9743
|
}
|
|
9744
9744
|
function Lr(e, o) {
|
|
9745
|
-
return e in o.schema.inlineContentSchema && o.schema.inlineContentSchema[e] ===
|
|
9745
|
+
return e in o.schema.inlineContentSchema && o.schema.inlineContentSchema[e] === Mr[e];
|
|
9746
9746
|
}
|
|
9747
|
-
function
|
|
9747
|
+
function Ir(e, o, t) {
|
|
9748
9748
|
return o.type === e && o.type in t.schema.blockSchema && P(o.type, t);
|
|
9749
9749
|
}
|
|
9750
9750
|
function rl(e, o) {
|
|
@@ -9756,33 +9756,33 @@ function al(e, o) {
|
|
|
9756
9756
|
function sl(e, o) {
|
|
9757
9757
|
return o.schema.blockSchema[e.type].isFileBlock && !e.props.url;
|
|
9758
9758
|
}
|
|
9759
|
-
function
|
|
9759
|
+
function Ar(e, o, t) {
|
|
9760
9760
|
return o in t.schema.blockSchema && e in t.schema.blockSchema[o].propSchema && t.schema.blockSchema[o].propSchema[e] === B[e];
|
|
9761
9761
|
}
|
|
9762
9762
|
function ll(e, o, t) {
|
|
9763
|
-
return
|
|
9763
|
+
return Ar(e, o.type, t);
|
|
9764
9764
|
}
|
|
9765
|
-
function
|
|
9765
|
+
function Et(e) {
|
|
9766
9766
|
return e instanceof ke;
|
|
9767
9767
|
}
|
|
9768
|
-
function
|
|
9768
|
+
function Pr(e) {
|
|
9769
9769
|
let o = e.getTextCursorPosition().block, t = e.schema.blockSchema[o.type].content;
|
|
9770
9770
|
for (; t === "none"; )
|
|
9771
9771
|
o = e.getTextCursorPosition().nextBlock, t = e.schema.blockSchema[o.type].content, e.setTextCursorPosition(o, "end");
|
|
9772
9772
|
}
|
|
9773
|
-
function
|
|
9773
|
+
function L(e, o) {
|
|
9774
9774
|
const t = e.getTextCursorPosition().block;
|
|
9775
9775
|
if (t.content === void 0)
|
|
9776
9776
|
throw new Error("Slash Menu open in a block that doesn't contain content.");
|
|
9777
9777
|
let i;
|
|
9778
|
-
return Array.isArray(t.content) && (t.content.length === 1 && X(t.content[0]) && t.content[0].type === "text" && t.content[0].text === "/" || t.content.length === 0) ? (i = e.updateBlock(t, o), e.setTextCursorPosition(i)) : (i = e.insertBlocks([o], t, "after")[0], e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),
|
|
9778
|
+
return Array.isArray(t.content) && (t.content.length === 1 && X(t.content[0]) && t.content[0].type === "text" && t.content[0].text === "/" || t.content.length === 0) ? (i = e.updateBlock(t, o), e.setTextCursorPosition(i)) : (i = e.insertBlocks([o], t, "after")[0], e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)), Pr(e), i;
|
|
9779
9779
|
}
|
|
9780
9780
|
function dl(e) {
|
|
9781
9781
|
const o = [];
|
|
9782
9782
|
return P("heading", e) && o.push(
|
|
9783
9783
|
{
|
|
9784
9784
|
onItemClick: () => {
|
|
9785
|
-
|
|
9785
|
+
L(e, {
|
|
9786
9786
|
type: "heading",
|
|
9787
9787
|
props: { level: 1 }
|
|
9788
9788
|
});
|
|
@@ -9793,7 +9793,7 @@ function dl(e) {
|
|
|
9793
9793
|
},
|
|
9794
9794
|
{
|
|
9795
9795
|
onItemClick: () => {
|
|
9796
|
-
|
|
9796
|
+
L(e, {
|
|
9797
9797
|
type: "heading",
|
|
9798
9798
|
props: { level: 2 }
|
|
9799
9799
|
});
|
|
@@ -9804,7 +9804,7 @@ function dl(e) {
|
|
|
9804
9804
|
},
|
|
9805
9805
|
{
|
|
9806
9806
|
onItemClick: () => {
|
|
9807
|
-
|
|
9807
|
+
L(e, {
|
|
9808
9808
|
type: "heading",
|
|
9809
9809
|
props: { level: 3 }
|
|
9810
9810
|
});
|
|
@@ -9815,7 +9815,7 @@ function dl(e) {
|
|
|
9815
9815
|
}
|
|
9816
9816
|
), P("numberedListItem", e) && o.push({
|
|
9817
9817
|
onItemClick: () => {
|
|
9818
|
-
|
|
9818
|
+
L(e, {
|
|
9819
9819
|
type: "numberedListItem"
|
|
9820
9820
|
});
|
|
9821
9821
|
},
|
|
@@ -9824,7 +9824,7 @@ function dl(e) {
|
|
|
9824
9824
|
...e.dictionary.slash_menu.numbered_list
|
|
9825
9825
|
}), P("bulletListItem", e) && o.push({
|
|
9826
9826
|
onItemClick: () => {
|
|
9827
|
-
|
|
9827
|
+
L(e, {
|
|
9828
9828
|
type: "bulletListItem"
|
|
9829
9829
|
});
|
|
9830
9830
|
},
|
|
@@ -9833,7 +9833,7 @@ function dl(e) {
|
|
|
9833
9833
|
...e.dictionary.slash_menu.bullet_list
|
|
9834
9834
|
}), P("checkListItem", e) && o.push({
|
|
9835
9835
|
onItemClick: () => {
|
|
9836
|
-
|
|
9836
|
+
L(e, {
|
|
9837
9837
|
type: "checkListItem"
|
|
9838
9838
|
});
|
|
9839
9839
|
},
|
|
@@ -9842,7 +9842,7 @@ function dl(e) {
|
|
|
9842
9842
|
...e.dictionary.slash_menu.check_list
|
|
9843
9843
|
}), P("paragraph", e) && o.push({
|
|
9844
9844
|
onItemClick: () => {
|
|
9845
|
-
|
|
9845
|
+
L(e, {
|
|
9846
9846
|
type: "paragraph"
|
|
9847
9847
|
});
|
|
9848
9848
|
},
|
|
@@ -9851,7 +9851,7 @@ function dl(e) {
|
|
|
9851
9851
|
...e.dictionary.slash_menu.paragraph
|
|
9852
9852
|
}), P("codeBlock", e) && o.push({
|
|
9853
9853
|
onItemClick: () => {
|
|
9854
|
-
|
|
9854
|
+
L(e, {
|
|
9855
9855
|
type: "codeBlock"
|
|
9856
9856
|
});
|
|
9857
9857
|
},
|
|
@@ -9860,7 +9860,7 @@ function dl(e) {
|
|
|
9860
9860
|
...e.dictionary.slash_menu.code_block
|
|
9861
9861
|
}), P("table", e) && o.push({
|
|
9862
9862
|
onItemClick: () => {
|
|
9863
|
-
|
|
9863
|
+
L(e, {
|
|
9864
9864
|
type: "table",
|
|
9865
9865
|
content: {
|
|
9866
9866
|
type: "tableContent",
|
|
@@ -9880,7 +9880,7 @@ function dl(e) {
|
|
|
9880
9880
|
...e.dictionary.slash_menu.table
|
|
9881
9881
|
}), P("image", e) && o.push({
|
|
9882
9882
|
onItemClick: () => {
|
|
9883
|
-
const t =
|
|
9883
|
+
const t = L(e, {
|
|
9884
9884
|
type: "image"
|
|
9885
9885
|
});
|
|
9886
9886
|
e.dispatch(
|
|
@@ -9893,7 +9893,7 @@ function dl(e) {
|
|
|
9893
9893
|
...e.dictionary.slash_menu.image
|
|
9894
9894
|
}), P("video", e) && o.push({
|
|
9895
9895
|
onItemClick: () => {
|
|
9896
|
-
const t =
|
|
9896
|
+
const t = L(e, {
|
|
9897
9897
|
type: "video"
|
|
9898
9898
|
});
|
|
9899
9899
|
e.dispatch(
|
|
@@ -9906,7 +9906,7 @@ function dl(e) {
|
|
|
9906
9906
|
...e.dictionary.slash_menu.video
|
|
9907
9907
|
}), P("audio", e) && o.push({
|
|
9908
9908
|
onItemClick: () => {
|
|
9909
|
-
const t =
|
|
9909
|
+
const t = L(e, {
|
|
9910
9910
|
type: "audio"
|
|
9911
9911
|
});
|
|
9912
9912
|
e.dispatch(
|
|
@@ -9919,7 +9919,7 @@ function dl(e) {
|
|
|
9919
9919
|
...e.dictionary.slash_menu.audio
|
|
9920
9920
|
}), P("file", e) && o.push({
|
|
9921
9921
|
onItemClick: () => {
|
|
9922
|
-
const t =
|
|
9922
|
+
const t = L(e, {
|
|
9923
9923
|
type: "file"
|
|
9924
9924
|
});
|
|
9925
9925
|
e.dispatch(
|
|
@@ -9965,42 +9965,42 @@ class Ce {
|
|
|
9965
9965
|
p(this, "BlockNoteEditor", "only for types");
|
|
9966
9966
|
p(this, "Block", "only for types");
|
|
9967
9967
|
p(this, "PartialBlock", "only for types");
|
|
9968
|
-
this.blockSpecs = He(o == null ? void 0 : o.blockSpecs) ||
|
|
9968
|
+
this.blockSpecs = He(o == null ? void 0 : o.blockSpecs) || go, this.inlineContentSpecs = He(o == null ? void 0 : o.inlineContentSpecs) || ko, this.styleSpecs = He(o == null ? void 0 : o.styleSpecs) || bo, this.blockSchema = Kt(this.blockSpecs), this.inlineContentSchema = Xt(
|
|
9969
9969
|
this.inlineContentSpecs
|
|
9970
|
-
), this.styleSchema =
|
|
9970
|
+
), this.styleSchema = Jt(this.styleSpecs);
|
|
9971
9971
|
}
|
|
9972
9972
|
static create(o) {
|
|
9973
9973
|
return new Ce(o);
|
|
9974
9974
|
}
|
|
9975
9975
|
}
|
|
9976
|
-
const
|
|
9976
|
+
const _o = Ce.create({
|
|
9977
9977
|
blockSpecs: {
|
|
9978
|
-
pageBreak:
|
|
9978
|
+
pageBreak: Zn
|
|
9979
9979
|
}
|
|
9980
9980
|
}), ul = (e) => Ce.create({
|
|
9981
9981
|
blockSpecs: {
|
|
9982
9982
|
...e.blockSpecs,
|
|
9983
|
-
...
|
|
9983
|
+
..._o.blockSpecs
|
|
9984
9984
|
},
|
|
9985
9985
|
inlineContentSpecs: e.inlineContentSpecs,
|
|
9986
9986
|
styleSpecs: e.styleSpecs
|
|
9987
9987
|
});
|
|
9988
|
-
function
|
|
9989
|
-
return "pageBreak" in e.schema.blockSchema && e.schema.blockSchema.pageBreak ===
|
|
9988
|
+
function Nr(e) {
|
|
9989
|
+
return "pageBreak" in e.schema.blockSchema && e.schema.blockSchema.pageBreak === _o.blockSchema.pageBreak;
|
|
9990
9990
|
}
|
|
9991
9991
|
function pl(e) {
|
|
9992
9992
|
const o = [];
|
|
9993
|
-
return
|
|
9993
|
+
return Nr(e) && o.push({
|
|
9994
9994
|
...e.dictionary.slash_menu.page_break,
|
|
9995
9995
|
onItemClick: () => {
|
|
9996
|
-
|
|
9996
|
+
L(e, {
|
|
9997
9997
|
type: "pageBreak"
|
|
9998
9998
|
});
|
|
9999
9999
|
},
|
|
10000
10000
|
key: "page_break"
|
|
10001
10001
|
}), o;
|
|
10002
10002
|
}
|
|
10003
|
-
function
|
|
10003
|
+
function jr(e, o, t, i = "before") {
|
|
10004
10004
|
const n = typeof t == "string" ? t : t.id, r = [];
|
|
10005
10005
|
for (const l of o)
|
|
10006
10006
|
r.push(
|
|
@@ -10030,7 +10030,7 @@ function Rr(e, o, t, i = "before") {
|
|
|
10030
10030
|
);
|
|
10031
10031
|
return s;
|
|
10032
10032
|
}
|
|
10033
|
-
function
|
|
10033
|
+
function Rr(e) {
|
|
10034
10034
|
const o = e._tiptapEditor.state, t = o.selection, i = q(o.doc, t.anchor);
|
|
10035
10035
|
if (t instanceof ke)
|
|
10036
10036
|
return {
|
|
@@ -10055,7 +10055,7 @@ function Dr(e) {
|
|
|
10055
10055
|
};
|
|
10056
10056
|
}
|
|
10057
10057
|
}
|
|
10058
|
-
function
|
|
10058
|
+
function Dr(e, o) {
|
|
10059
10059
|
var n, r;
|
|
10060
10060
|
const t = (n = R(
|
|
10061
10061
|
o.anchorBlockId,
|
|
@@ -10094,69 +10094,69 @@ function Ur(e, o) {
|
|
|
10094
10094
|
}
|
|
10095
10095
|
e.dispatch(e._tiptapEditor.state.tr.setSelection(i));
|
|
10096
10096
|
}
|
|
10097
|
-
function
|
|
10098
|
-
return e.map((o) => o.type === "columnList" ? o.children.map((t) =>
|
|
10097
|
+
function Ye(e) {
|
|
10098
|
+
return e.map((o) => o.type === "columnList" ? o.children.map((t) => Ye(t.children)).flat() : {
|
|
10099
10099
|
...o,
|
|
10100
|
-
children:
|
|
10100
|
+
children: Ye(o.children)
|
|
10101
10101
|
}).flat();
|
|
10102
10102
|
}
|
|
10103
|
-
function
|
|
10103
|
+
function wo(e, o, t) {
|
|
10104
10104
|
var r;
|
|
10105
10105
|
const i = ((r = e.getSelection()) == null ? void 0 : r.blocks) || [
|
|
10106
10106
|
e.getTextCursorPosition().block
|
|
10107
|
-
], n =
|
|
10108
|
-
e.removeBlocks(i), e.insertBlocks(
|
|
10107
|
+
], n = Rr(e);
|
|
10108
|
+
e.removeBlocks(i), e.insertBlocks(Ye(i), o, t), Dr(e, n);
|
|
10109
10109
|
}
|
|
10110
|
-
function
|
|
10110
|
+
function yo(e) {
|
|
10111
10111
|
return !e || e.type !== "columnList";
|
|
10112
10112
|
}
|
|
10113
|
-
function
|
|
10113
|
+
function vo(e, o, t) {
|
|
10114
10114
|
let i, n;
|
|
10115
10115
|
if (o ? o.children.length > 0 ? (i = o.children[o.children.length - 1], n = "after") : (i = o, n = "before") : t && (i = t, n = "before"), !i || !n)
|
|
10116
10116
|
return;
|
|
10117
10117
|
const r = e.getParentBlock(i);
|
|
10118
|
-
return
|
|
10118
|
+
return yo(r) ? { referenceBlock: i, placement: n } : vo(
|
|
10119
10119
|
e,
|
|
10120
10120
|
n === "after" ? i : e.getPrevBlock(i),
|
|
10121
10121
|
r
|
|
10122
10122
|
);
|
|
10123
10123
|
}
|
|
10124
|
-
function
|
|
10124
|
+
function Co(e, o, t) {
|
|
10125
10125
|
let i, n;
|
|
10126
10126
|
if (o ? o.children.length > 0 ? (i = o.children[0], n = "before") : (i = o, n = "after") : t && (i = t, n = "after"), !i || !n)
|
|
10127
10127
|
return;
|
|
10128
10128
|
const r = e.getParentBlock(i);
|
|
10129
|
-
return
|
|
10129
|
+
return yo(r) ? { referenceBlock: i, placement: n } : Co(
|
|
10130
10130
|
e,
|
|
10131
10131
|
n === "before" ? i : e.getNextBlock(i),
|
|
10132
10132
|
r
|
|
10133
10133
|
);
|
|
10134
10134
|
}
|
|
10135
|
-
function
|
|
10136
|
-
const o = e.getSelection(), t = (o == null ? void 0 : o.blocks[0]) || e.getTextCursorPosition().block, i =
|
|
10135
|
+
function Ur(e) {
|
|
10136
|
+
const o = e.getSelection(), t = (o == null ? void 0 : o.blocks[0]) || e.getTextCursorPosition().block, i = vo(
|
|
10137
10137
|
e,
|
|
10138
10138
|
e.getPrevBlock(t),
|
|
10139
10139
|
e.getParentBlock(t)
|
|
10140
10140
|
);
|
|
10141
|
-
i &&
|
|
10141
|
+
i && wo(
|
|
10142
10142
|
e,
|
|
10143
10143
|
i.referenceBlock,
|
|
10144
10144
|
i.placement
|
|
10145
10145
|
);
|
|
10146
10146
|
}
|
|
10147
|
-
function
|
|
10148
|
-
const o = e.getSelection(), t = (o == null ? void 0 : o.blocks[(o == null ? void 0 : o.blocks.length) - 1]) || e.getTextCursorPosition().block, i =
|
|
10147
|
+
function Hr(e) {
|
|
10148
|
+
const o = e.getSelection(), t = (o == null ? void 0 : o.blocks[(o == null ? void 0 : o.blocks.length) - 1]) || e.getTextCursorPosition().block, i = Co(
|
|
10149
10149
|
e,
|
|
10150
10150
|
e.getNextBlock(t),
|
|
10151
10151
|
e.getParentBlock(t)
|
|
10152
10152
|
);
|
|
10153
|
-
i &&
|
|
10153
|
+
i && wo(
|
|
10154
10154
|
e,
|
|
10155
10155
|
i.referenceBlock,
|
|
10156
10156
|
i.placement
|
|
10157
10157
|
);
|
|
10158
10158
|
}
|
|
10159
|
-
function
|
|
10159
|
+
function Or(e, o) {
|
|
10160
10160
|
return function({ state: t, dispatch: i }) {
|
|
10161
10161
|
const { $from: n, $to: r } = t.selection, a = n.blockRange(
|
|
10162
10162
|
r,
|
|
@@ -10182,7 +10182,7 @@ function Vr(e, o) {
|
|
|
10182
10182
|
), h = a.start, g = a.end;
|
|
10183
10183
|
i(
|
|
10184
10184
|
t.tr.step(
|
|
10185
|
-
new
|
|
10185
|
+
new ze(
|
|
10186
10186
|
h - (c ? 3 : 1),
|
|
10187
10187
|
g,
|
|
10188
10188
|
h,
|
|
@@ -10197,30 +10197,30 @@ function Vr(e, o) {
|
|
|
10197
10197
|
return !0;
|
|
10198
10198
|
};
|
|
10199
10199
|
}
|
|
10200
|
-
function
|
|
10200
|
+
function xo(e) {
|
|
10201
10201
|
return e._tiptapEditor.commands.command(
|
|
10202
|
-
|
|
10202
|
+
Or(
|
|
10203
10203
|
e._tiptapEditor.schema.nodes.blockContainer,
|
|
10204
10204
|
e._tiptapEditor.schema.nodes.blockGroup
|
|
10205
10205
|
)
|
|
10206
10206
|
);
|
|
10207
10207
|
}
|
|
10208
|
-
function
|
|
10208
|
+
function Vr(e) {
|
|
10209
10209
|
e._tiptapEditor.commands.liftListItem("blockContainer");
|
|
10210
10210
|
}
|
|
10211
|
-
function
|
|
10211
|
+
function zr(e) {
|
|
10212
10212
|
const { bnBlock: o } = y(
|
|
10213
10213
|
e._tiptapEditor.state
|
|
10214
10214
|
);
|
|
10215
10215
|
return e._tiptapEditor.state.doc.resolve(o.beforePos).nodeBefore !== null;
|
|
10216
10216
|
}
|
|
10217
|
-
function
|
|
10217
|
+
function Fr(e) {
|
|
10218
10218
|
const { bnBlock: o } = y(
|
|
10219
10219
|
e._tiptapEditor.state
|
|
10220
10220
|
);
|
|
10221
10221
|
return e._tiptapEditor.state.doc.resolve(o.beforePos).depth > 1;
|
|
10222
10222
|
}
|
|
10223
|
-
function
|
|
10223
|
+
function So(e, o, t) {
|
|
10224
10224
|
const i = e._tiptapEditor;
|
|
10225
10225
|
let n = i.state.tr;
|
|
10226
10226
|
const r = [];
|
|
@@ -10278,13 +10278,13 @@ function Eo(e, o, t) {
|
|
|
10278
10278
|
);
|
|
10279
10279
|
return { insertedBlocks: c, removedBlocks: s };
|
|
10280
10280
|
}
|
|
10281
|
-
function
|
|
10282
|
-
return
|
|
10281
|
+
function $r(e, o, t) {
|
|
10282
|
+
return So(e, o, t);
|
|
10283
10283
|
}
|
|
10284
|
-
function
|
|
10285
|
-
return
|
|
10284
|
+
function Gr(e, o) {
|
|
10285
|
+
return So(e, o, []).removedBlocks;
|
|
10286
10286
|
}
|
|
10287
|
-
function
|
|
10287
|
+
function Wr(e, o) {
|
|
10288
10288
|
const t = typeof o == "string" ? o : o.id, i = R(t, e._tiptapEditor.state.doc);
|
|
10289
10289
|
if (i)
|
|
10290
10290
|
return x(
|
|
@@ -10295,7 +10295,7 @@ function Kr(e, o) {
|
|
|
10295
10295
|
e.blockCache
|
|
10296
10296
|
);
|
|
10297
10297
|
}
|
|
10298
|
-
function
|
|
10298
|
+
function Kr(e, o) {
|
|
10299
10299
|
const t = typeof o == "string" ? o : o.id, i = R(t, e._tiptapEditor.state.doc);
|
|
10300
10300
|
if (!i)
|
|
10301
10301
|
return;
|
|
@@ -10311,7 +10311,7 @@ function qr(e, o) {
|
|
|
10311
10311
|
e.blockCache
|
|
10312
10312
|
);
|
|
10313
10313
|
}
|
|
10314
|
-
function
|
|
10314
|
+
function qr(e, o) {
|
|
10315
10315
|
const t = typeof o == "string" ? o : o.id, i = R(t, e._tiptapEditor.state.doc);
|
|
10316
10316
|
if (!i)
|
|
10317
10317
|
return;
|
|
@@ -10327,7 +10327,7 @@ function Xr(e, o) {
|
|
|
10327
10327
|
e.blockCache
|
|
10328
10328
|
);
|
|
10329
10329
|
}
|
|
10330
|
-
function
|
|
10330
|
+
function Xr(e, o) {
|
|
10331
10331
|
const t = typeof o == "string" ? o : o.id, i = R(t, e._tiptapEditor.state.doc);
|
|
10332
10332
|
if (!i)
|
|
10333
10333
|
return;
|
|
@@ -10343,7 +10343,7 @@ function Zr(e, o) {
|
|
|
10343
10343
|
e.blockCache
|
|
10344
10344
|
);
|
|
10345
10345
|
}
|
|
10346
|
-
function
|
|
10346
|
+
function Zr(e, o, t, i = { updateSelection: !0 }) {
|
|
10347
10347
|
const n = t._tiptapEditor.state.tr;
|
|
10348
10348
|
let { from: r, to: a } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, s = !0, l = !0, d = "";
|
|
10349
10349
|
if (o.forEach((c) => {
|
|
@@ -10352,9 +10352,9 @@ function Jr(e, o, t, i = { updateSelection: !0 }) {
|
|
|
10352
10352
|
const { parent: c } = n.doc.resolve(r);
|
|
10353
10353
|
c.isTextblock && !c.type.spec.code && !c.childCount && (r -= 1, a += 1);
|
|
10354
10354
|
}
|
|
10355
|
-
return s ? n.insertText(d, r, a) : n.replaceWith(r, a, o), i.updateSelection &&
|
|
10355
|
+
return s ? n.insertText(d, r, a) : n.replaceWith(r, a, o), i.updateSelection && Ko(n, n.steps.length - 1, -1), t.dispatch(n), !0;
|
|
10356
10356
|
}
|
|
10357
|
-
function
|
|
10357
|
+
function Jr(e) {
|
|
10358
10358
|
const o = e._tiptapEditor.state;
|
|
10359
10359
|
if (o.selection.empty || "node" in o.selection)
|
|
10360
10360
|
return;
|
|
@@ -10404,7 +10404,7 @@ function Yr(e) {
|
|
|
10404
10404
|
blocks: r
|
|
10405
10405
|
};
|
|
10406
10406
|
}
|
|
10407
|
-
function
|
|
10407
|
+
function Yr(e, o, t) {
|
|
10408
10408
|
const i = typeof o == "string" ? o : o.id, n = typeof t == "string" ? t : t.id;
|
|
10409
10409
|
if (i === n)
|
|
10410
10410
|
throw new Error(
|
|
@@ -10427,12 +10427,12 @@ function Qr(e, o, t) {
|
|
|
10427
10427
|
);
|
|
10428
10428
|
let m, h;
|
|
10429
10429
|
if (c.content === "table") {
|
|
10430
|
-
const g =
|
|
10430
|
+
const g = ft.get(l.blockContent.node);
|
|
10431
10431
|
m = l.blockContent.beforePos + g.positionAt(0, 0, l.blockContent.node) + 1 + 2;
|
|
10432
10432
|
} else
|
|
10433
10433
|
m = l.blockContent.beforePos + 1;
|
|
10434
10434
|
if (u.content === "table") {
|
|
10435
|
-
const g =
|
|
10435
|
+
const g = ft.get(d.blockContent.node), f = d.blockContent.beforePos + g.positionAt(
|
|
10436
10436
|
g.height - 1,
|
|
10437
10437
|
g.width - 1,
|
|
10438
10438
|
d.blockContent.node
|
|
@@ -10446,7 +10446,7 @@ function Qr(e, o, t) {
|
|
|
10446
10446
|
)
|
|
10447
10447
|
);
|
|
10448
10448
|
}
|
|
10449
|
-
function
|
|
10449
|
+
function Qr(e) {
|
|
10450
10450
|
const { bnBlock: o } = y(e._tiptapEditor.state), t = e._tiptapEditor.state.doc.resolve(o.beforePos), i = t.nodeBefore, n = e._tiptapEditor.state.doc.resolve(
|
|
10451
10451
|
o.afterPos
|
|
10452
10452
|
).nodeAfter;
|
|
@@ -10482,7 +10482,7 @@ function ea(e) {
|
|
|
10482
10482
|
)
|
|
10483
10483
|
};
|
|
10484
10484
|
}
|
|
10485
|
-
function
|
|
10485
|
+
function Eo(e, o, t = "start") {
|
|
10486
10486
|
const i = typeof o == "string" ? o : o.id, n = R(i, e._tiptapEditor.state.doc);
|
|
10487
10487
|
if (!n)
|
|
10488
10488
|
throw new Error(`Block with ID ${i} not found`);
|
|
@@ -10509,11 +10509,11 @@ function Bo(e, o, t = "start") {
|
|
|
10509
10509
|
throw new H(a);
|
|
10510
10510
|
} else {
|
|
10511
10511
|
const s = t === "start" ? r.childContainer.node.firstChild : r.childContainer.node.lastChild;
|
|
10512
|
-
|
|
10512
|
+
Eo(e, s.attrs.id, t);
|
|
10513
10513
|
}
|
|
10514
10514
|
}
|
|
10515
10515
|
let ne;
|
|
10516
|
-
async function
|
|
10516
|
+
async function lt() {
|
|
10517
10517
|
if (ne)
|
|
10518
10518
|
return ne;
|
|
10519
10519
|
const e = await Promise.all([
|
|
@@ -10541,7 +10541,7 @@ async function dt() {
|
|
|
10541
10541
|
rehypeFormat: e[9]
|
|
10542
10542
|
}, ne;
|
|
10543
10543
|
}
|
|
10544
|
-
function
|
|
10544
|
+
function ea() {
|
|
10545
10545
|
const e = (o) => {
|
|
10546
10546
|
let t = o.children.length;
|
|
10547
10547
|
for (let i = 0; i < t; i++) {
|
|
@@ -10557,7 +10557,7 @@ function ta() {
|
|
|
10557
10557
|
};
|
|
10558
10558
|
return e;
|
|
10559
10559
|
}
|
|
10560
|
-
function
|
|
10560
|
+
function ta() {
|
|
10561
10561
|
const e = ne;
|
|
10562
10562
|
if (!e)
|
|
10563
10563
|
throw new Error(
|
|
@@ -10579,43 +10579,43 @@ function oa() {
|
|
|
10579
10579
|
};
|
|
10580
10580
|
return o;
|
|
10581
10581
|
}
|
|
10582
|
-
function
|
|
10582
|
+
function dt(e) {
|
|
10583
10583
|
const o = ne;
|
|
10584
10584
|
if (!o)
|
|
10585
10585
|
throw new Error(
|
|
10586
10586
|
"cleanHTMLToMarkdown requires ESM dependencies to be initialized"
|
|
10587
10587
|
);
|
|
10588
|
-
return o.unified.unified().use(o.rehypeParse.default, { fragment: !0 }).use(
|
|
10588
|
+
return o.unified.unified().use(o.rehypeParse.default, { fragment: !0 }).use(ea).use(ta).use(o.rehypeRemark.default).use(o.remarkGfm.default).use(o.remarkStringify.default, {
|
|
10589
10589
|
handlers: { text: (i) => i.value }
|
|
10590
10590
|
}).processSync(e).value;
|
|
10591
10591
|
}
|
|
10592
|
-
async function
|
|
10593
|
-
await
|
|
10592
|
+
async function oa(e, o, t, i) {
|
|
10593
|
+
await lt();
|
|
10594
10594
|
const r = Ne(o, t).exportBlocks(e, i);
|
|
10595
|
-
return
|
|
10595
|
+
return dt(r);
|
|
10596
10596
|
}
|
|
10597
|
-
function
|
|
10597
|
+
function ia(e) {
|
|
10598
10598
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
10599
10599
|
}
|
|
10600
|
-
function
|
|
10600
|
+
function na(e) {
|
|
10601
10601
|
return e.nodeType === 3 && !/\S/.test(e.nodeValue || "");
|
|
10602
10602
|
}
|
|
10603
|
-
function
|
|
10603
|
+
function ra(e) {
|
|
10604
10604
|
e.querySelectorAll("li > ul, li > ol").forEach((o) => {
|
|
10605
|
-
const t =
|
|
10605
|
+
const t = ia(o), i = o.parentElement, n = Array.from(i.childNodes).slice(
|
|
10606
10606
|
t + 1
|
|
10607
10607
|
);
|
|
10608
10608
|
o.remove(), n.forEach((r) => {
|
|
10609
10609
|
r.remove();
|
|
10610
10610
|
}), i.insertAdjacentElement("afterend", o), n.reverse().forEach((r) => {
|
|
10611
|
-
if (
|
|
10611
|
+
if (na(r))
|
|
10612
10612
|
return;
|
|
10613
10613
|
const a = document.createElement("li");
|
|
10614
10614
|
a.append(r), o.insertAdjacentElement("afterend", a);
|
|
10615
10615
|
}), i.childNodes.length === 0 && i.remove();
|
|
10616
10616
|
});
|
|
10617
10617
|
}
|
|
10618
|
-
function
|
|
10618
|
+
function aa(e) {
|
|
10619
10619
|
e.querySelectorAll("li + ul, li + ol").forEach((o) => {
|
|
10620
10620
|
var r, a;
|
|
10621
10621
|
const t = o.previousElementSibling, i = document.createElement("div");
|
|
@@ -10625,19 +10625,19 @@ function sa(e) {
|
|
|
10625
10625
|
n.append(i.nextElementSibling);
|
|
10626
10626
|
});
|
|
10627
10627
|
}
|
|
10628
|
-
let
|
|
10629
|
-
function
|
|
10630
|
-
return
|
|
10628
|
+
let Bt = null;
|
|
10629
|
+
function sa() {
|
|
10630
|
+
return Bt || (Bt = document.implementation.createHTMLDocument("title"));
|
|
10631
10631
|
}
|
|
10632
|
-
function
|
|
10632
|
+
function Bo(e) {
|
|
10633
10633
|
if (typeof e == "string") {
|
|
10634
|
-
const o =
|
|
10634
|
+
const o = sa().createElement("div");
|
|
10635
10635
|
o.innerHTML = e, e = o;
|
|
10636
10636
|
}
|
|
10637
|
-
return
|
|
10637
|
+
return ra(e), aa(e), e;
|
|
10638
10638
|
}
|
|
10639
|
-
async function
|
|
10640
|
-
const r =
|
|
10639
|
+
async function To(e, o, t, i, n) {
|
|
10640
|
+
const r = Bo(e), s = Ht.fromSchema(n).parse(r, {
|
|
10641
10641
|
topNode: n.nodes.blockGroup.create()
|
|
10642
10642
|
}), l = [];
|
|
10643
10643
|
for (let d = 0; d < s.childCount; d++)
|
|
@@ -10646,7 +10646,7 @@ async function Mo(e, o, t, i, n) {
|
|
|
10646
10646
|
);
|
|
10647
10647
|
return l;
|
|
10648
10648
|
}
|
|
10649
|
-
function
|
|
10649
|
+
function la(e, o) {
|
|
10650
10650
|
const t = o.value ? o.value : "", i = {};
|
|
10651
10651
|
o.lang && (i["data-language"] = o.lang);
|
|
10652
10652
|
let n = {
|
|
@@ -10662,14 +10662,14 @@ function da(e, o) {
|
|
|
10662
10662
|
children: [n]
|
|
10663
10663
|
}, e.patch(o, n), n;
|
|
10664
10664
|
}
|
|
10665
|
-
async function
|
|
10666
|
-
const r = await
|
|
10665
|
+
async function da(e, o, t, i, n) {
|
|
10666
|
+
const r = await lt(), a = r.unified.unified().use(r.remarkParse.default).use(r.remarkGfm.default).use(r.remarkRehype.default, {
|
|
10667
10667
|
handlers: {
|
|
10668
10668
|
...r.remarkRehype.defaultHandlers,
|
|
10669
|
-
code:
|
|
10669
|
+
code: la
|
|
10670
10670
|
}
|
|
10671
10671
|
}).use(r.rehypeStringify.default).processSync(e);
|
|
10672
|
-
return
|
|
10672
|
+
return To(
|
|
10673
10673
|
a.value,
|
|
10674
10674
|
o,
|
|
10675
10675
|
t,
|
|
@@ -10677,19 +10677,19 @@ async function ca(e, o, t, i, n) {
|
|
|
10677
10677
|
n
|
|
10678
10678
|
);
|
|
10679
10679
|
}
|
|
10680
|
-
const
|
|
10680
|
+
const ct = [
|
|
10681
10681
|
"vscode-editor-data",
|
|
10682
10682
|
"blocknote/html",
|
|
10683
10683
|
"text/html",
|
|
10684
10684
|
"text/plain",
|
|
10685
10685
|
"Files"
|
|
10686
10686
|
];
|
|
10687
|
-
function
|
|
10687
|
+
function ca(e, o) {
|
|
10688
10688
|
if (!e.startsWith(".") || !o.startsWith("."))
|
|
10689
10689
|
throw new Error("The strings provided are not valid file extensions.");
|
|
10690
10690
|
return e === o;
|
|
10691
10691
|
}
|
|
10692
|
-
function
|
|
10692
|
+
function ua(e, o) {
|
|
10693
10693
|
const t = e.split("/"), i = o.split("/");
|
|
10694
10694
|
if (t.length !== 2)
|
|
10695
10695
|
throw new Error(`The string ${e} is not a valid MIME type.`);
|
|
@@ -10697,7 +10697,7 @@ function pa(e, o) {
|
|
|
10697
10697
|
throw new Error(`The string ${o} is not a valid MIME type.`);
|
|
10698
10698
|
return t[1] === "*" || i[1] === "*" ? t[0] === i[0] : (t[0] === "*" || i[0] === "*" || t[0] === i[0]) && t[1] === i[1];
|
|
10699
10699
|
}
|
|
10700
|
-
function
|
|
10700
|
+
function Tt(e, o, t) {
|
|
10701
10701
|
let i;
|
|
10702
10702
|
return Array.isArray(o.content) && o.content.length === 0 ? i = e.updateBlock(o, t).id : i = e.insertBlocks(
|
|
10703
10703
|
[t],
|
|
@@ -10705,7 +10705,7 @@ function Mt(e, o, t) {
|
|
|
10705
10705
|
"after"
|
|
10706
10706
|
)[0].id, i;
|
|
10707
10707
|
}
|
|
10708
|
-
async function
|
|
10708
|
+
async function Mo(e, o) {
|
|
10709
10709
|
var a;
|
|
10710
10710
|
if (!o.uploadFile) {
|
|
10711
10711
|
console.warn(
|
|
@@ -10717,7 +10717,7 @@ async function Io(e, o) {
|
|
|
10717
10717
|
if (t === null)
|
|
10718
10718
|
return;
|
|
10719
10719
|
let i = null;
|
|
10720
|
-
for (const s of
|
|
10720
|
+
for (const s of ct)
|
|
10721
10721
|
if (t.types.includes(s)) {
|
|
10722
10722
|
i = s;
|
|
10723
10723
|
break;
|
|
@@ -10736,7 +10736,7 @@ async function Io(e, o) {
|
|
|
10736
10736
|
for (const c of r)
|
|
10737
10737
|
for (const u of c.fileBlockAccept || []) {
|
|
10738
10738
|
const m = u.startsWith("."), h = n[s].getAsFile();
|
|
10739
|
-
if (h && (!m && h.type &&
|
|
10739
|
+
if (h && (!m && h.type && ua(n[s].type, u) || m && ca(
|
|
10740
10740
|
"." + h.name.split(".").pop(),
|
|
10741
10741
|
u
|
|
10742
10742
|
))) {
|
|
@@ -10755,7 +10755,7 @@ async function Io(e, o) {
|
|
|
10755
10755
|
let u;
|
|
10756
10756
|
if (e.type === "paste") {
|
|
10757
10757
|
const g = o.getTextCursorPosition().block;
|
|
10758
|
-
u =
|
|
10758
|
+
u = Tt(o, g, c);
|
|
10759
10759
|
} else if (e.type === "drop") {
|
|
10760
10760
|
const g = {
|
|
10761
10761
|
left: e.clientX,
|
|
@@ -10767,7 +10767,7 @@ async function Io(e, o) {
|
|
|
10767
10767
|
o._tiptapEditor.state.doc,
|
|
10768
10768
|
f.pos
|
|
10769
10769
|
);
|
|
10770
|
-
u =
|
|
10770
|
+
u = Tt(
|
|
10771
10771
|
o,
|
|
10772
10772
|
o.getBlock(b.node.attrs.id),
|
|
10773
10773
|
c
|
|
@@ -10783,7 +10783,7 @@ async function Io(e, o) {
|
|
|
10783
10783
|
}
|
|
10784
10784
|
}
|
|
10785
10785
|
}
|
|
10786
|
-
const
|
|
10786
|
+
const pa = (e) => j.create({
|
|
10787
10787
|
name: "dropFile",
|
|
10788
10788
|
addProseMirrorPlugins() {
|
|
10789
10789
|
return [
|
|
@@ -10794,12 +10794,12 @@ const ma = (e) => j.create({
|
|
|
10794
10794
|
if (!e.isEditable)
|
|
10795
10795
|
return;
|
|
10796
10796
|
let i = null;
|
|
10797
|
-
for (const n of
|
|
10797
|
+
for (const n of ct)
|
|
10798
10798
|
if (t.dataTransfer.types.includes(n)) {
|
|
10799
10799
|
i = n;
|
|
10800
10800
|
break;
|
|
10801
10801
|
}
|
|
10802
|
-
return i === null ? !0 : i === "Files" ? (
|
|
10802
|
+
return i === null ? !0 : i === "Files" ? (Mo(t, e), !0) : !1;
|
|
10803
10803
|
}
|
|
10804
10804
|
}
|
|
10805
10805
|
}
|
|
@@ -10807,7 +10807,7 @@ const ma = (e) => j.create({
|
|
|
10807
10807
|
];
|
|
10808
10808
|
}
|
|
10809
10809
|
});
|
|
10810
|
-
async function
|
|
10810
|
+
async function ma(e, o) {
|
|
10811
10811
|
const { schema: t } = o.state;
|
|
10812
10812
|
if (!e.clipboardData)
|
|
10813
10813
|
return !1;
|
|
@@ -10825,7 +10825,7 @@ async function ha(e, o) {
|
|
|
10825
10825
|
)}</code></pre>`
|
|
10826
10826
|
), !0) : !1;
|
|
10827
10827
|
}
|
|
10828
|
-
const
|
|
10828
|
+
const ha = (e) => j.create({
|
|
10829
10829
|
name: "pasteFromClipboard",
|
|
10830
10830
|
addProseMirrorPlugins() {
|
|
10831
10831
|
return [
|
|
@@ -10836,7 +10836,7 @@ const fa = (e) => j.create({
|
|
|
10836
10836
|
if (t.preventDefault(), !e.isEditable)
|
|
10837
10837
|
return;
|
|
10838
10838
|
let i;
|
|
10839
|
-
for (const r of
|
|
10839
|
+
for (const r of ct)
|
|
10840
10840
|
if (t.clipboardData.types.includes(r)) {
|
|
10841
10841
|
i = r;
|
|
10842
10842
|
break;
|
|
@@ -10844,11 +10844,11 @@ const fa = (e) => j.create({
|
|
|
10844
10844
|
if (!i)
|
|
10845
10845
|
return !0;
|
|
10846
10846
|
if (i === "vscode-editor-data")
|
|
10847
|
-
return
|
|
10847
|
+
return ma(t, o), !0;
|
|
10848
10848
|
if (i === "Files")
|
|
10849
|
-
return
|
|
10849
|
+
return Mo(t, e), !0;
|
|
10850
10850
|
let n = t.clipboardData.getData(i);
|
|
10851
|
-
return i === "blocknote/html" ? (o.pasteHTML(n), !0) : i === "text/html" ? (n =
|
|
10851
|
+
return i === "blocknote/html" ? (o.pasteHTML(n), !0) : i === "text/html" ? (n = Bo(n.trim()).innerHTML, o.pasteHTML(n), !0) : (o.pasteText(n), !0);
|
|
10852
10852
|
}
|
|
10853
10853
|
}
|
|
10854
10854
|
}
|
|
@@ -10879,7 +10879,7 @@ function Lo(e, o) {
|
|
|
10879
10879
|
), !1) : !0;
|
|
10880
10880
|
}), t;
|
|
10881
10881
|
}
|
|
10882
|
-
function
|
|
10882
|
+
function fa(e, o, t) {
|
|
10883
10883
|
var s;
|
|
10884
10884
|
let i = !1;
|
|
10885
10885
|
const n = e.state.selection instanceof ke;
|
|
@@ -10902,7 +10902,7 @@ function ga(e, o, t) {
|
|
|
10902
10902
|
);
|
|
10903
10903
|
if (n) {
|
|
10904
10904
|
((s = o.firstChild) == null ? void 0 : s.type.name) === "table" && (o = o.firstChild.content);
|
|
10905
|
-
const l =
|
|
10905
|
+
const l = qt(
|
|
10906
10906
|
o,
|
|
10907
10907
|
t.schema.inlineContentSchema,
|
|
10908
10908
|
t.schema.styleSchema
|
|
@@ -10924,7 +10924,7 @@ function ga(e, o, t) {
|
|
|
10924
10924
|
}
|
|
10925
10925
|
return r;
|
|
10926
10926
|
}
|
|
10927
|
-
function
|
|
10927
|
+
function Io(e, o) {
|
|
10928
10928
|
"node" in e.state.selection && e.state.selection.node.type.spec.group === "blockContent" && o.dispatch(
|
|
10929
10929
|
o._tiptapEditor.state.tr.setSelection(
|
|
10930
10930
|
new be(e.state.doc.resolve(e.state.selection.from - 1))
|
|
@@ -10932,14 +10932,14 @@ function Ao(e, o) {
|
|
|
10932
10932
|
);
|
|
10933
10933
|
const t = e.serializeForClipboard(
|
|
10934
10934
|
e.state.selection.content()
|
|
10935
|
-
).dom.innerHTML, i = e.state.selection.content().content, n =
|
|
10935
|
+
).dom.innerHTML, i = e.state.selection.content().content, n = fa(
|
|
10936
10936
|
e,
|
|
10937
10937
|
i,
|
|
10938
10938
|
o
|
|
10939
|
-
), r =
|
|
10939
|
+
), r = dt(n);
|
|
10940
10940
|
return { clipboardHTML: t, externalHTML: n, markdown: r };
|
|
10941
10941
|
}
|
|
10942
|
-
const
|
|
10942
|
+
const Mt = () => {
|
|
10943
10943
|
const e = window.getSelection();
|
|
10944
10944
|
if (!e || e.isCollapsed)
|
|
10945
10945
|
return !0;
|
|
@@ -10952,12 +10952,12 @@ const It = () => {
|
|
|
10952
10952
|
return !1;
|
|
10953
10953
|
}, Lt = (e, o, t) => {
|
|
10954
10954
|
t.preventDefault(), t.clipboardData.clearData();
|
|
10955
|
-
const { clipboardHTML: i, externalHTML: n, markdown: r } =
|
|
10955
|
+
const { clipboardHTML: i, externalHTML: n, markdown: r } = Io(
|
|
10956
10956
|
o,
|
|
10957
10957
|
e
|
|
10958
10958
|
);
|
|
10959
10959
|
t.clipboardData.setData("blocknote/html", i), t.clipboardData.setData("text/html", n), t.clipboardData.setData("text/plain", r);
|
|
10960
|
-
},
|
|
10960
|
+
}, ga = (e) => j.create({
|
|
10961
10961
|
name: "copyToClipboard",
|
|
10962
10962
|
addProseMirrorPlugins() {
|
|
10963
10963
|
return [
|
|
@@ -10965,10 +10965,10 @@ const It = () => {
|
|
|
10965
10965
|
props: {
|
|
10966
10966
|
handleDOMEvents: {
|
|
10967
10967
|
copy(o, t) {
|
|
10968
|
-
return
|
|
10968
|
+
return Mt() || Lt(e, o, t), !0;
|
|
10969
10969
|
},
|
|
10970
10970
|
cut(o, t) {
|
|
10971
|
-
return
|
|
10971
|
+
return Mt() || (Lt(e, o, t), o.editable && o.dispatch(o.state.tr.deleteSelection())), !0;
|
|
10972
10972
|
},
|
|
10973
10973
|
// This is for the use-case in which only a block without content
|
|
10974
10974
|
// is selected, e.g. an image block, and dragged (not using the
|
|
@@ -10983,7 +10983,7 @@ const It = () => {
|
|
|
10983
10983
|
)
|
|
10984
10984
|
)
|
|
10985
10985
|
), t.preventDefault(), t.dataTransfer.clearData();
|
|
10986
|
-
const { clipboardHTML: i, externalHTML: n, markdown: r } =
|
|
10986
|
+
const { clipboardHTML: i, externalHTML: n, markdown: r } = Io(o, e);
|
|
10987
10987
|
return t.dataTransfer.setData("blocknote/html", i), t.dataTransfer.setData("text/html", n), t.dataTransfer.setData("text/plain", r), !0;
|
|
10988
10988
|
}
|
|
10989
10989
|
}
|
|
@@ -10991,7 +10991,7 @@ const It = () => {
|
|
|
10991
10991
|
})
|
|
10992
10992
|
];
|
|
10993
10993
|
}
|
|
10994
|
-
}),
|
|
10994
|
+
}), ba = j.create({
|
|
10995
10995
|
name: "blockBackgroundColor",
|
|
10996
10996
|
addGlobalAttributes() {
|
|
10997
10997
|
return [
|
|
@@ -11009,11 +11009,11 @@ const It = () => {
|
|
|
11009
11009
|
}
|
|
11010
11010
|
];
|
|
11011
11011
|
}
|
|
11012
|
-
}),
|
|
11012
|
+
}), ka = (e) => {
|
|
11013
11013
|
var i;
|
|
11014
11014
|
const o = [];
|
|
11015
11015
|
o.push(
|
|
11016
|
-
|
|
11016
|
+
Bi.configure({
|
|
11017
11017
|
fragment: e.fragment
|
|
11018
11018
|
})
|
|
11019
11019
|
);
|
|
@@ -11038,55 +11038,48 @@ const It = () => {
|
|
|
11038
11038
|
);
|
|
11039
11039
|
const r = (s) => {
|
|
11040
11040
|
const l = document.createElement("span");
|
|
11041
|
-
l.classList.add("collaboration-cursor__base");
|
|
11041
|
+
l.classList.add("bn-collaboration-cursor__base");
|
|
11042
11042
|
const d = document.createElement("span");
|
|
11043
|
-
d.setAttribute("contentedEditable", "false"), d.classList.add("collaboration-cursor__caret"), d.setAttribute("style", `background-color: ${s.color}`);
|
|
11043
|
+
d.setAttribute("contentedEditable", "false"), d.classList.add("bn-collaboration-cursor__caret"), d.setAttribute("style", `background-color: ${s.color}`);
|
|
11044
11044
|
const c = document.createElement("span");
|
|
11045
|
-
return c.classList.add("collaboration-cursor__label"), c.setAttribute("style", `background-color: ${s.color}`), c.insertBefore(document.createTextNode(s.name), null), d.insertBefore(c, null), l.insertBefore(document.createTextNode(""), null), l.insertBefore(d, null), l.insertBefore(document.createTextNode(""), null), l;
|
|
11046
|
-
}, a = (s) => {
|
|
11047
|
-
var
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
"
|
|
11054
|
-
|
|
11055
|
-
const d = l[0];
|
|
11056
|
-
let c = n.get(d);
|
|
11057
|
-
if (!c) {
|
|
11058
|
-
const m = ((u = e == null ? void 0 : e.renderCursor) == null ? void 0 : u.call(e, s)) || r(s);
|
|
11059
|
-
(e == null ? void 0 : e.showCursorLabels) !== "always" && (m.addEventListener("mouseenter", () => {
|
|
11060
|
-
const h = n.get(d);
|
|
11061
|
-
h.element.setAttribute("data-active", ""), h.hideTimeout && (clearTimeout(h.hideTimeout), n.set(d, {
|
|
11062
|
-
element: h.element,
|
|
11045
|
+
return c.classList.add("bn-collaboration-cursor__label"), c.setAttribute("style", `background-color: ${s.color}`), c.insertBefore(document.createTextNode(s.name), null), d.insertBefore(c, null), l.insertBefore(document.createTextNode(""), null), l.insertBefore(d, null), l.insertBefore(document.createTextNode(""), null), l;
|
|
11046
|
+
}, a = (s, l) => {
|
|
11047
|
+
var c;
|
|
11048
|
+
let d = n.get(l);
|
|
11049
|
+
if (!d) {
|
|
11050
|
+
const u = ((c = e == null ? void 0 : e.renderCursor) == null ? void 0 : c.call(e, s)) || r(s);
|
|
11051
|
+
(e == null ? void 0 : e.showCursorLabels) !== "always" && (u.addEventListener("mouseenter", () => {
|
|
11052
|
+
const m = n.get(l);
|
|
11053
|
+
m.element.setAttribute("data-active", ""), m.hideTimeout && (clearTimeout(m.hideTimeout), n.set(l, {
|
|
11054
|
+
element: m.element,
|
|
11063
11055
|
hideTimeout: void 0
|
|
11064
11056
|
}));
|
|
11065
|
-
}),
|
|
11066
|
-
const
|
|
11067
|
-
n.set(
|
|
11068
|
-
element:
|
|
11057
|
+
}), u.addEventListener("mouseleave", () => {
|
|
11058
|
+
const m = n.get(l);
|
|
11059
|
+
n.set(l, {
|
|
11060
|
+
element: m.element,
|
|
11069
11061
|
hideTimeout: setTimeout(() => {
|
|
11070
|
-
|
|
11062
|
+
m.element.removeAttribute("data-active");
|
|
11071
11063
|
}, 2e3)
|
|
11072
11064
|
});
|
|
11073
|
-
})),
|
|
11074
|
-
element:
|
|
11065
|
+
})), d = {
|
|
11066
|
+
element: u,
|
|
11075
11067
|
hideTimeout: void 0
|
|
11076
|
-
}, n.set(
|
|
11068
|
+
}, n.set(l, d);
|
|
11077
11069
|
}
|
|
11078
|
-
return
|
|
11070
|
+
return d.element;
|
|
11079
11071
|
};
|
|
11080
11072
|
o.push(
|
|
11081
|
-
|
|
11073
|
+
Ti.configure({
|
|
11082
11074
|
user: e.user,
|
|
11083
11075
|
render: a,
|
|
11076
|
+
// tiptap type not compatible with latest y-prosemirror
|
|
11084
11077
|
provider: e.provider
|
|
11085
11078
|
})
|
|
11086
11079
|
);
|
|
11087
11080
|
}
|
|
11088
11081
|
return o;
|
|
11089
|
-
},
|
|
11082
|
+
}, Ao = ge.create({
|
|
11090
11083
|
name: "comment",
|
|
11091
11084
|
excludes: "",
|
|
11092
11085
|
inclusive: !1,
|
|
@@ -11118,7 +11111,7 @@ const It = () => {
|
|
|
11118
11111
|
renderHTML({ HTMLAttributes: e }) {
|
|
11119
11112
|
return [
|
|
11120
11113
|
"span",
|
|
11121
|
-
|
|
11114
|
+
qo(e, {
|
|
11122
11115
|
class: "bn-thread-mark"
|
|
11123
11116
|
})
|
|
11124
11117
|
];
|
|
@@ -11152,7 +11145,7 @@ class W {
|
|
|
11152
11145
|
this.callbacks = {};
|
|
11153
11146
|
}
|
|
11154
11147
|
}
|
|
11155
|
-
class
|
|
11148
|
+
class _a extends W {
|
|
11156
11149
|
constructor(t) {
|
|
11157
11150
|
super();
|
|
11158
11151
|
p(this, "userCache", /* @__PURE__ */ new Map());
|
|
@@ -11199,8 +11192,8 @@ class wa extends W {
|
|
|
11199
11192
|
return this.on("update", t);
|
|
11200
11193
|
}
|
|
11201
11194
|
}
|
|
11202
|
-
const Se = new A("blocknote-comments"),
|
|
11203
|
-
function
|
|
11195
|
+
const Se = new A("blocknote-comments"), wa = "SET_SELECTED_THREAD_ID";
|
|
11196
|
+
function ya(e, o, t) {
|
|
11204
11197
|
const i = /* @__PURE__ */ new Map(), n = [];
|
|
11205
11198
|
return e.descendants((r, a) => {
|
|
11206
11199
|
r.marks.forEach((s) => {
|
|
@@ -11227,7 +11220,7 @@ function va(e, o, t) {
|
|
|
11227
11220
|
threadPositions: i
|
|
11228
11221
|
};
|
|
11229
11222
|
}
|
|
11230
|
-
class
|
|
11223
|
+
class va extends W {
|
|
11231
11224
|
constructor(t, i, n) {
|
|
11232
11225
|
super();
|
|
11233
11226
|
p(this, "plugin");
|
|
@@ -11263,7 +11256,7 @@ class Ca extends W {
|
|
|
11263
11256
|
});
|
|
11264
11257
|
if (this.editor = t, this.threadStore = i, this.markType = n, !t.resolveUsers)
|
|
11265
11258
|
throw new Error("resolveUsers is required for comments");
|
|
11266
|
-
this.userStore = new
|
|
11259
|
+
this.userStore = new _a(t.resolveUsers), this.threadStore.subscribe(this.updateMarksFromThreads), t.onCreate(() => {
|
|
11267
11260
|
this.updateMarksFromThreads(this.threadStore.getThreads()), t.onSelectionChange(() => {
|
|
11268
11261
|
this.pendingComment && (this.pendingComment = !1, this.emitStateUpdate());
|
|
11269
11262
|
});
|
|
@@ -11280,7 +11273,7 @@ class Ca extends W {
|
|
|
11280
11273
|
},
|
|
11281
11274
|
apply(a, s) {
|
|
11282
11275
|
const l = a.getMeta(Se);
|
|
11283
|
-
return !a.docChanged && !l ? s :
|
|
11276
|
+
return !a.docChanged && !l ? s : ya(a.doc, r.selectedThreadId, n);
|
|
11284
11277
|
}
|
|
11285
11278
|
},
|
|
11286
11279
|
props: {
|
|
@@ -11325,7 +11318,7 @@ class Ca extends W {
|
|
|
11325
11318
|
selectThread(t) {
|
|
11326
11319
|
this.selectedThreadId !== t && (this.selectedThreadId = t, this.emitStateUpdate(), this.editor.dispatch(
|
|
11327
11320
|
this.editor.prosemirrorView.state.tr.setMeta(Se, {
|
|
11328
|
-
name:
|
|
11321
|
+
name: wa
|
|
11329
11322
|
})
|
|
11330
11323
|
));
|
|
11331
11324
|
}
|
|
@@ -11347,7 +11340,7 @@ class Ca extends W {
|
|
|
11347
11340
|
async createThread(t) {
|
|
11348
11341
|
const i = await this.threadStore.createThread(t);
|
|
11349
11342
|
if (this.threadStore.addThreadToDocument) {
|
|
11350
|
-
const n = this.editor.prosemirrorView, r = n.state.selection, a =
|
|
11343
|
+
const n = this.editor.prosemirrorView, r = n.state.selection, a = Ft.getState(n.state), s = {
|
|
11351
11344
|
prosemirror: {
|
|
11352
11345
|
head: r.head,
|
|
11353
11346
|
anchor: r.anchor
|
|
@@ -11365,7 +11358,7 @@ class Ca extends W {
|
|
|
11365
11358
|
});
|
|
11366
11359
|
}
|
|
11367
11360
|
}
|
|
11368
|
-
class
|
|
11361
|
+
class Ca {
|
|
11369
11362
|
constructor(o, t, i, n) {
|
|
11370
11363
|
p(this, "state");
|
|
11371
11364
|
p(this, "emitUpdate");
|
|
@@ -11422,7 +11415,7 @@ class xa {
|
|
|
11422
11415
|
}
|
|
11423
11416
|
}
|
|
11424
11417
|
const Oe = new A("FilePanelPlugin");
|
|
11425
|
-
class
|
|
11418
|
+
class xa extends W {
|
|
11426
11419
|
constructor(t) {
|
|
11427
11420
|
super();
|
|
11428
11421
|
p(this, "view");
|
|
@@ -11433,7 +11426,7 @@ class Sa extends W {
|
|
|
11433
11426
|
});
|
|
11434
11427
|
this.plugin = new T({
|
|
11435
11428
|
key: Oe,
|
|
11436
|
-
view: (i) => (this.view = new
|
|
11429
|
+
view: (i) => (this.view = new Ca(
|
|
11437
11430
|
t,
|
|
11438
11431
|
Oe,
|
|
11439
11432
|
i,
|
|
@@ -11468,15 +11461,15 @@ class Sa extends W {
|
|
|
11468
11461
|
return this.on("update", t);
|
|
11469
11462
|
}
|
|
11470
11463
|
}
|
|
11471
|
-
class
|
|
11464
|
+
class Sa {
|
|
11472
11465
|
constructor(o, t, i) {
|
|
11473
11466
|
p(this, "state");
|
|
11474
11467
|
p(this, "emitUpdate");
|
|
11475
11468
|
p(this, "preventHide", !1);
|
|
11476
11469
|
p(this, "preventShow", !1);
|
|
11477
11470
|
p(this, "shouldShow", ({ state: o, from: t, to: i }) => {
|
|
11478
|
-
const { doc: n, selection: r } = o, { empty: a } = r, s = !n.textBetween(t, i).length &&
|
|
11479
|
-
return r.$from.parent.type.spec.code ||
|
|
11471
|
+
const { doc: n, selection: r } = o, { empty: a } = r, s = !n.textBetween(t, i).length && Ot(o.selection);
|
|
11472
|
+
return r.$from.parent.type.spec.code || Fe(r) && r.node.type.spec.code ? !1 : !(a || s);
|
|
11480
11473
|
});
|
|
11481
11474
|
p(this, "blurHandler", (o) => {
|
|
11482
11475
|
var i;
|
|
@@ -11546,7 +11539,7 @@ class Ea {
|
|
|
11546
11539
|
}
|
|
11547
11540
|
getSelectionBoundingBox() {
|
|
11548
11541
|
const { state: o } = this.pmView, { selection: t } = o, { ranges: i } = t, n = Math.min(...i.map((a) => a.$from.pos)), r = Math.max(...i.map((a) => a.$to.pos));
|
|
11549
|
-
if (
|
|
11542
|
+
if (Fe(t)) {
|
|
11550
11543
|
const a = this.pmView.nodeDOM(n);
|
|
11551
11544
|
if (a)
|
|
11552
11545
|
return a.getBoundingClientRect();
|
|
@@ -11554,18 +11547,18 @@ class Ea {
|
|
|
11554
11547
|
return Te(this.pmView, n, r);
|
|
11555
11548
|
}
|
|
11556
11549
|
}
|
|
11557
|
-
const
|
|
11550
|
+
const Ea = new A(
|
|
11558
11551
|
"FormattingToolbarPlugin"
|
|
11559
11552
|
);
|
|
11560
|
-
class
|
|
11553
|
+
class Ba extends W {
|
|
11561
11554
|
constructor(t) {
|
|
11562
11555
|
super();
|
|
11563
11556
|
p(this, "view");
|
|
11564
11557
|
p(this, "plugin");
|
|
11565
11558
|
p(this, "closeMenu", () => this.view.closeMenu());
|
|
11566
11559
|
this.plugin = new T({
|
|
11567
|
-
key:
|
|
11568
|
-
view: (i) => (this.view = new
|
|
11560
|
+
key: Ea,
|
|
11561
|
+
view: (i) => (this.view = new Sa(t, i, (n) => {
|
|
11569
11562
|
this.emit("update", n);
|
|
11570
11563
|
}), this.view),
|
|
11571
11564
|
props: {
|
|
@@ -11581,7 +11574,7 @@ class Ta extends W {
|
|
|
11581
11574
|
return this.on("update", t);
|
|
11582
11575
|
}
|
|
11583
11576
|
}
|
|
11584
|
-
const
|
|
11577
|
+
const It = (e, o) => {
|
|
11585
11578
|
const t = e.resolve(o);
|
|
11586
11579
|
if (t.depth <= 1)
|
|
11587
11580
|
return;
|
|
@@ -11592,7 +11585,7 @@ const At = (e, o) => {
|
|
|
11592
11585
|
return _e(
|
|
11593
11586
|
e.resolve(i)
|
|
11594
11587
|
);
|
|
11595
|
-
},
|
|
11588
|
+
}, Qe = (e, o) => {
|
|
11596
11589
|
const t = e.resolve(o), i = t.index();
|
|
11597
11590
|
if (i === 0)
|
|
11598
11591
|
return;
|
|
@@ -11600,13 +11593,13 @@ const At = (e, o) => {
|
|
|
11600
11593
|
return _e(
|
|
11601
11594
|
e.resolve(n)
|
|
11602
11595
|
);
|
|
11603
|
-
},
|
|
11596
|
+
}, Po = (e, o) => {
|
|
11604
11597
|
for (; o.childContainer; ) {
|
|
11605
11598
|
const t = o.childContainer.node, i = e.resolve(o.childContainer.beforePos + 1).posAtIndex(t.childCount - 1);
|
|
11606
11599
|
o = _e(e.resolve(i));
|
|
11607
11600
|
}
|
|
11608
11601
|
return o;
|
|
11609
|
-
},
|
|
11602
|
+
}, Ta = (e, o) => e.isBlockContainer && e.blockContent.node.type.spec.content === "inline*" && e.blockContent.node.childCount > 0 && o.isBlockContainer && o.blockContent.node.type.spec.content === "inline*", Ma = (e, o, t, i) => {
|
|
11610
11603
|
if (!i.isBlockContainer)
|
|
11611
11604
|
throw new Error(
|
|
11612
11605
|
`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${t.bnBlock.beforePos}, but next block is not a block container`
|
|
@@ -11635,21 +11628,21 @@ const At = (e, o) => {
|
|
|
11635
11628
|
);
|
|
11636
11629
|
}
|
|
11637
11630
|
return !0;
|
|
11638
|
-
},
|
|
11631
|
+
}, At = (e) => ({
|
|
11639
11632
|
state: o,
|
|
11640
11633
|
dispatch: t
|
|
11641
11634
|
}) => {
|
|
11642
|
-
const i = o.doc.resolve(e), n = _e(i), r =
|
|
11635
|
+
const i = o.doc.resolve(e), n = _e(i), r = Qe(
|
|
11643
11636
|
o.doc,
|
|
11644
11637
|
n.bnBlock.beforePos
|
|
11645
11638
|
);
|
|
11646
11639
|
if (!r)
|
|
11647
11640
|
return !1;
|
|
11648
|
-
const a =
|
|
11641
|
+
const a = Po(
|
|
11649
11642
|
o.doc,
|
|
11650
11643
|
r
|
|
11651
11644
|
);
|
|
11652
|
-
return
|
|
11645
|
+
return Ta(a, n) ? Ma(o, t, a, n) : !1;
|
|
11653
11646
|
}, La = j.create({
|
|
11654
11647
|
priority: 50,
|
|
11655
11648
|
// TODO: The shortcuts need a refactor. Do we want to use a command priority
|
|
@@ -11693,22 +11686,22 @@ const At = (e, o) => {
|
|
|
11693
11686
|
if (!a.isBlockContainer)
|
|
11694
11687
|
return !1;
|
|
11695
11688
|
const { bnBlock: s, blockContent: l } = a, d = r.selection.from === l.beforePos + 1, c = r.selection.empty, u = s.beforePos;
|
|
11696
|
-
return d && c ? i().command(
|
|
11689
|
+
return d && c ? i().command(At(u)).scrollIntoView().run() : !1;
|
|
11697
11690
|
}),
|
|
11698
11691
|
() => n.command(({ state: r, dispatch: a }) => {
|
|
11699
11692
|
const s = y(r);
|
|
11700
|
-
if (!s.isBlockContainer || !(r.selection.from === s.blockContent.beforePos + 1) ||
|
|
11693
|
+
if (!s.isBlockContainer || !(r.selection.from === s.blockContent.beforePos + 1) || Qe(
|
|
11701
11694
|
r.doc,
|
|
11702
11695
|
s.bnBlock.beforePos
|
|
11703
11696
|
))
|
|
11704
11697
|
return !1;
|
|
11705
|
-
const c =
|
|
11698
|
+
const c = It(
|
|
11706
11699
|
r.doc,
|
|
11707
11700
|
s.bnBlock.beforePos
|
|
11708
11701
|
);
|
|
11709
11702
|
if ((c == null ? void 0 : c.blockNoteType) !== "column")
|
|
11710
11703
|
return !1;
|
|
11711
|
-
const u = c, m =
|
|
11704
|
+
const u = c, m = It(
|
|
11712
11705
|
r.doc,
|
|
11713
11706
|
u.bnBlock.beforePos
|
|
11714
11707
|
);
|
|
@@ -11724,7 +11717,7 @@ const At = (e, o) => {
|
|
|
11724
11717
|
if (g)
|
|
11725
11718
|
if (f) {
|
|
11726
11719
|
r.tr.step(
|
|
11727
|
-
new
|
|
11720
|
+
new ze(
|
|
11728
11721
|
// replace entire column list
|
|
11729
11722
|
m.bnBlock.beforePos,
|
|
11730
11723
|
m.bnBlock.afterPos,
|
|
@@ -11741,7 +11734,7 @@ const At = (e, o) => {
|
|
|
11741
11734
|
r.tr.setSelection(V.between(k, k));
|
|
11742
11735
|
} else {
|
|
11743
11736
|
r.tr.step(
|
|
11744
|
-
new
|
|
11737
|
+
new ze(
|
|
11745
11738
|
// replace entire column list
|
|
11746
11739
|
m.bnBlock.beforePos,
|
|
11747
11740
|
m.bnBlock.afterPos,
|
|
@@ -11801,12 +11794,12 @@ const At = (e, o) => {
|
|
|
11801
11794
|
const a = y(r);
|
|
11802
11795
|
if (!a.isBlockContainer)
|
|
11803
11796
|
throw new Error("todo");
|
|
11804
|
-
const s = r.selection.from === a.blockContent.beforePos + 1, l = r.selection.empty, d =
|
|
11797
|
+
const s = r.selection.from === a.blockContent.beforePos + 1, l = r.selection.empty, d = Qe(
|
|
11805
11798
|
r.doc,
|
|
11806
11799
|
a.bnBlock.beforePos
|
|
11807
11800
|
);
|
|
11808
11801
|
if (d && s && l) {
|
|
11809
|
-
const c =
|
|
11802
|
+
const c = Po(
|
|
11810
11803
|
r.doc,
|
|
11811
11804
|
d
|
|
11812
11805
|
);
|
|
@@ -11846,7 +11839,7 @@ const At = (e, o) => {
|
|
|
11846
11839
|
let g = d, f = a.afterPos + 1, b = n.doc.resolve(f).depth;
|
|
11847
11840
|
for (; b < g; )
|
|
11848
11841
|
g = b, f += 2, b = n.doc.resolve(f).depth;
|
|
11849
|
-
return i.command(
|
|
11842
|
+
return i.command(At(f - 1));
|
|
11850
11843
|
}
|
|
11851
11844
|
return !1;
|
|
11852
11845
|
})
|
|
@@ -11888,7 +11881,7 @@ const At = (e, o) => {
|
|
|
11888
11881
|
return !1;
|
|
11889
11882
|
const { blockContent: s } = a, l = n.selection.$anchor.parentOffset === 0;
|
|
11890
11883
|
return s.node.childCount === 0 ? !1 : (r().deleteSelection().command(
|
|
11891
|
-
|
|
11884
|
+
po(
|
|
11892
11885
|
n.selection.from,
|
|
11893
11886
|
l,
|
|
11894
11887
|
l
|
|
@@ -11900,7 +11893,7 @@ const At = (e, o) => {
|
|
|
11900
11893
|
// editor since the browser will try to use tab for keyboard navigation.
|
|
11901
11894
|
Tab: () => {
|
|
11902
11895
|
var i, n, r;
|
|
11903
|
-
return this.options.tabBehavior !== "prefer-indent" && ((i = this.options.editor.formattingToolbar) != null && i.shown || (n = this.options.editor.linkToolbar) != null && n.shown || (r = this.options.editor.filePanel) != null && r.shown) ? !1 :
|
|
11896
|
+
return this.options.tabBehavior !== "prefer-indent" && ((i = this.options.editor.formattingToolbar) != null && i.shown || (n = this.options.editor.linkToolbar) != null && n.shown || (r = this.options.editor.filePanel) != null && r.shown) ? !1 : xo(this.options.editor);
|
|
11904
11897
|
},
|
|
11905
11898
|
"Shift-Tab": () => {
|
|
11906
11899
|
var i, n, r;
|
|
@@ -11911,7 +11904,7 @@ const At = (e, o) => {
|
|
|
11911
11904
|
};
|
|
11912
11905
|
}
|
|
11913
11906
|
});
|
|
11914
|
-
class
|
|
11907
|
+
class Ia {
|
|
11915
11908
|
constructor(o, t, i) {
|
|
11916
11909
|
p(this, "state");
|
|
11917
11910
|
p(this, "emitUpdate");
|
|
@@ -11929,7 +11922,7 @@ class Aa {
|
|
|
11929
11922
|
const t = o.target, i = this.pmView.posAtDOM(t, 0) + 1, n = this.pmView.state.doc.resolve(i), r = n.marks();
|
|
11930
11923
|
for (const a of r)
|
|
11931
11924
|
if (a.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
11932
|
-
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange =
|
|
11925
|
+
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = pt(n, a.type, a.attrs) || void 0;
|
|
11933
11926
|
break;
|
|
11934
11927
|
}
|
|
11935
11928
|
}
|
|
@@ -12002,7 +11995,7 @@ class Aa {
|
|
|
12002
11995
|
const l = this.pmView.state.selection.$from.marks();
|
|
12003
11996
|
for (const d of l)
|
|
12004
11997
|
if (d.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
12005
|
-
this.keyboardHoveredLinkMark = d, this.keyboardHoveredLinkMarkRange =
|
|
11998
|
+
this.keyboardHoveredLinkMark = d, this.keyboardHoveredLinkMarkRange = pt(
|
|
12006
11999
|
this.pmView.state.selection.$from,
|
|
12007
12000
|
d.type,
|
|
12008
12001
|
d.attrs
|
|
@@ -12039,8 +12032,8 @@ class Aa {
|
|
|
12039
12032
|
);
|
|
12040
12033
|
}
|
|
12041
12034
|
}
|
|
12042
|
-
const
|
|
12043
|
-
class
|
|
12035
|
+
const Aa = new A("LinkToolbarPlugin");
|
|
12036
|
+
class Pa extends W {
|
|
12044
12037
|
constructor(t) {
|
|
12045
12038
|
super();
|
|
12046
12039
|
p(this, "view");
|
|
@@ -12079,8 +12072,8 @@ class Na extends W {
|
|
|
12079
12072
|
});
|
|
12080
12073
|
p(this, "closeMenu", () => this.view.closeMenu());
|
|
12081
12074
|
this.plugin = new T({
|
|
12082
|
-
key:
|
|
12083
|
-
view: (i) => (this.view = new
|
|
12075
|
+
key: Aa,
|
|
12076
|
+
view: (i) => (this.view = new Ia(t, i, (n) => {
|
|
12084
12077
|
this.emit("update", n);
|
|
12085
12078
|
}), this.view),
|
|
12086
12079
|
props: {
|
|
@@ -12096,7 +12089,7 @@ class Na extends W {
|
|
|
12096
12089
|
return ((i = (t = this.view) == null ? void 0 : t.state) == null ? void 0 : i.show) || !1;
|
|
12097
12090
|
}
|
|
12098
12091
|
}
|
|
12099
|
-
const
|
|
12092
|
+
const Na = [
|
|
12100
12093
|
"http",
|
|
12101
12094
|
"https",
|
|
12102
12095
|
"ftp",
|
|
@@ -12107,12 +12100,12 @@ const ja = [
|
|
|
12107
12100
|
"sms",
|
|
12108
12101
|
"cid",
|
|
12109
12102
|
"xmpp"
|
|
12110
|
-
],
|
|
12111
|
-
class
|
|
12103
|
+
], ja = "https", Ra = new A("node-selection-keyboard");
|
|
12104
|
+
class Da {
|
|
12112
12105
|
constructor() {
|
|
12113
12106
|
p(this, "plugin");
|
|
12114
12107
|
this.plugin = new T({
|
|
12115
|
-
key:
|
|
12108
|
+
key: Ra,
|
|
12116
12109
|
props: {
|
|
12117
12110
|
handleKeyDown: (o, t) => {
|
|
12118
12111
|
if ("node" in o.state.selection) {
|
|
@@ -12140,15 +12133,15 @@ class Ua {
|
|
|
12140
12133
|
});
|
|
12141
12134
|
}
|
|
12142
12135
|
}
|
|
12143
|
-
const
|
|
12144
|
-
class
|
|
12136
|
+
const Ua = new A("blocknote-placeholder");
|
|
12137
|
+
class Ha {
|
|
12145
12138
|
constructor(o, t) {
|
|
12146
12139
|
p(this, "plugin");
|
|
12147
12140
|
this.plugin = new T({
|
|
12148
|
-
key:
|
|
12141
|
+
key: Ua,
|
|
12149
12142
|
view: (i) => {
|
|
12150
12143
|
var d, c;
|
|
12151
|
-
const n = `placeholder-selector-${
|
|
12144
|
+
const n = `placeholder-selector-${Vt()}`;
|
|
12152
12145
|
i.dom.classList.add(n);
|
|
12153
12146
|
const r = document.createElement("style"), a = o._tiptapEditor.options.injectNonce;
|
|
12154
12147
|
a && r.setAttribute("nonce", a), ((d = o.prosemirrorView) == null ? void 0 : d.root) instanceof ShadowRoot ? o.prosemirrorView.root.append(r) : (c = o.prosemirrorView) == null || c.root.head.appendChild(r);
|
|
@@ -12216,7 +12209,7 @@ class Oa {
|
|
|
12216
12209
|
});
|
|
12217
12210
|
}
|
|
12218
12211
|
}
|
|
12219
|
-
const
|
|
12212
|
+
const Pt = new A("previous-blocks"), Oa = {
|
|
12220
12213
|
// Numbered List Items
|
|
12221
12214
|
index: "index",
|
|
12222
12215
|
// Headings
|
|
@@ -12226,19 +12219,19 @@ const Nt = new A("previous-blocks"), Va = {
|
|
|
12226
12219
|
depth: "depth",
|
|
12227
12220
|
"depth-change": "depth-change"
|
|
12228
12221
|
};
|
|
12229
|
-
class
|
|
12222
|
+
class Va {
|
|
12230
12223
|
constructor() {
|
|
12231
12224
|
p(this, "plugin");
|
|
12232
12225
|
let o;
|
|
12233
12226
|
this.plugin = new T({
|
|
12234
|
-
key:
|
|
12227
|
+
key: Pt,
|
|
12235
12228
|
view(t) {
|
|
12236
12229
|
return {
|
|
12237
12230
|
update: async (i, n) => {
|
|
12238
12231
|
var r;
|
|
12239
12232
|
((r = this.key) == null ? void 0 : r.getState(i.state).updatedBlocks.size) > 0 && (o = setTimeout(() => {
|
|
12240
12233
|
i.dispatch(
|
|
12241
|
-
i.state.tr.setMeta(
|
|
12234
|
+
i.state.tr.setMeta(Pt, { clearUpdate: !0 })
|
|
12242
12235
|
);
|
|
12243
12236
|
}, 0));
|
|
12244
12237
|
},
|
|
@@ -12261,9 +12254,9 @@ class za {
|
|
|
12261
12254
|
apply(t, i, n, r) {
|
|
12262
12255
|
if (i.currentTransactionOldBlockAttrs = {}, i.updatedBlocks.clear(), !t.docChanged || n.doc.eq(r.doc))
|
|
12263
12256
|
return i;
|
|
12264
|
-
const a = {}, s =
|
|
12257
|
+
const a = {}, s = mt(n.doc, (c) => c.attrs.id), l = new Map(
|
|
12265
12258
|
s.map((c) => [c.node.attrs.id, c])
|
|
12266
|
-
), d =
|
|
12259
|
+
), d = mt(r.doc, (c) => c.attrs.id);
|
|
12267
12260
|
for (const c of d) {
|
|
12268
12261
|
const u = l.get(c.node.attrs.id), m = u == null ? void 0 : u.node.firstChild, h = c.node.firstChild;
|
|
12269
12262
|
if (u && m && h) {
|
|
@@ -12296,7 +12289,7 @@ class za {
|
|
|
12296
12289
|
return;
|
|
12297
12290
|
const s = i.currentTransactionOldBlockAttrs[r.attrs.id], l = {};
|
|
12298
12291
|
for (const [c, u] of Object.entries(s))
|
|
12299
|
-
l["data-prev-" +
|
|
12292
|
+
l["data-prev-" + Oa[c]] = u || "none";
|
|
12300
12293
|
const d = F.node(a, a + r.nodeSize, {
|
|
12301
12294
|
...l
|
|
12302
12295
|
});
|
|
@@ -12307,13 +12300,13 @@ class za {
|
|
|
12307
12300
|
});
|
|
12308
12301
|
}
|
|
12309
12302
|
}
|
|
12310
|
-
const
|
|
12311
|
-
class
|
|
12303
|
+
const Nt = new A("blocknote-show-selection");
|
|
12304
|
+
class za {
|
|
12312
12305
|
constructor(o) {
|
|
12313
12306
|
p(this, "plugin");
|
|
12314
12307
|
p(this, "enabled", !1);
|
|
12315
12308
|
this.editor = o, this.plugin = new T({
|
|
12316
|
-
key:
|
|
12309
|
+
key: Nt,
|
|
12317
12310
|
props: {
|
|
12318
12311
|
decorations: (t) => {
|
|
12319
12312
|
const { doc: i, selection: n } = t;
|
|
@@ -12330,14 +12323,14 @@ class Fa {
|
|
|
12330
12323
|
setEnabled(o) {
|
|
12331
12324
|
var t, i;
|
|
12332
12325
|
this.enabled !== o && (this.enabled = o, (i = this.editor.prosemirrorView) == null || i.dispatch(
|
|
12333
|
-
(t = this.editor.prosemirrorView) == null ? void 0 : t.state.tr.setMeta(
|
|
12326
|
+
(t = this.editor.prosemirrorView) == null ? void 0 : t.state.tr.setMeta(Nt, {})
|
|
12334
12327
|
));
|
|
12335
12328
|
}
|
|
12336
12329
|
getEnabled() {
|
|
12337
12330
|
return this.enabled;
|
|
12338
12331
|
}
|
|
12339
12332
|
}
|
|
12340
|
-
function
|
|
12333
|
+
function No(e, o) {
|
|
12341
12334
|
var t, i;
|
|
12342
12335
|
for (; e && e.parentElement && e.parentElement !== o.dom && ((t = e.getAttribute) == null ? void 0 : t.call(e, "data-node-type")) !== "blockContainer"; )
|
|
12343
12336
|
e = e.parentElement;
|
|
@@ -12380,7 +12373,7 @@ class re extends De {
|
|
|
12380
12373
|
}
|
|
12381
12374
|
}
|
|
12382
12375
|
let z;
|
|
12383
|
-
function
|
|
12376
|
+
function Fa(e, o) {
|
|
12384
12377
|
let t, i;
|
|
12385
12378
|
const n = o.resolve(e.from).node().type.spec.group === "blockContent", r = o.resolve(e.to).node().type.spec.group === "blockContent", a = Math.min(e.$anchor.depth, e.$head.depth);
|
|
12386
12379
|
if (n && r) {
|
|
@@ -12390,7 +12383,7 @@ function $a(e, o) {
|
|
|
12390
12383
|
t = e.from, i = e.to;
|
|
12391
12384
|
return { from: t, to: i };
|
|
12392
12385
|
}
|
|
12393
|
-
function
|
|
12386
|
+
function jt(e, o, t = o) {
|
|
12394
12387
|
o === t && (t += e.state.doc.resolve(o + 1).node().nodeSize);
|
|
12395
12388
|
const i = e.domAtPos(o).node.cloneNode(!0), n = e.domAtPos(o).node, r = (c, u) => Array.prototype.indexOf.call(c.children, u), a = r(
|
|
12396
12389
|
n,
|
|
@@ -12403,16 +12396,16 @@ function Rt(e, o, t = o) {
|
|
|
12403
12396
|
);
|
|
12404
12397
|
for (let c = n.childElementCount - 1; c >= 0; c--)
|
|
12405
12398
|
(c > s || c < a) && i.removeChild(i.children[c]);
|
|
12406
|
-
|
|
12399
|
+
jo(e.root), z = i;
|
|
12407
12400
|
const d = e.dom.className.split(" ").filter(
|
|
12408
12401
|
(c) => c !== "ProseMirror" && c !== "bn-root" && c !== "bn-editor"
|
|
12409
12402
|
).join(" ");
|
|
12410
12403
|
z.className = z.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(z) : e.root.body.appendChild(z);
|
|
12411
12404
|
}
|
|
12412
|
-
function
|
|
12405
|
+
function jo(e) {
|
|
12413
12406
|
z !== void 0 && (e instanceof ShadowRoot ? e.removeChild(z) : e.body.removeChild(z), z = void 0);
|
|
12414
12407
|
}
|
|
12415
|
-
function
|
|
12408
|
+
function $a(e, o, t) {
|
|
12416
12409
|
if (!e.dataTransfer)
|
|
12417
12410
|
return;
|
|
12418
12411
|
const i = t.prosemirrorView;
|
|
@@ -12423,18 +12416,18 @@ function Ga(e, o, t) {
|
|
|
12423
12416
|
throw new Error(`Block with ID ${o.id} not found`);
|
|
12424
12417
|
const r = n.posBeforeNode;
|
|
12425
12418
|
if (r != null) {
|
|
12426
|
-
const a = i.state.selection, s = i.state.doc, { from: l, to: d } =
|
|
12419
|
+
const a = i.state.selection, s = i.state.doc, { from: l, to: d } = Fa(a, s), c = l <= r && r < d, u = a.$anchor.node() !== a.$head.node() || a instanceof re;
|
|
12427
12420
|
c && u ? (i.dispatch(
|
|
12428
12421
|
i.state.tr.setSelection(re.create(s, l, d))
|
|
12429
|
-
),
|
|
12422
|
+
), jt(i, l, d)) : (i.dispatch(
|
|
12430
12423
|
i.state.tr.setSelection(be.create(i.state.doc, r))
|
|
12431
|
-
),
|
|
12432
|
-
const m = i.state.selection.content(), h = t.pmSchema, g = i.serializeForClipboard(m).dom.innerHTML, f = Ne(h, t), b = Lo(m.content, t.schema), k = f.exportBlocks(b, {}), _ =
|
|
12424
|
+
), jt(i, r));
|
|
12425
|
+
const m = i.state.selection.content(), h = t.pmSchema, g = i.serializeForClipboard(m).dom.innerHTML, f = Ne(h, t), b = Lo(m.content, t.schema), k = f.exportBlocks(b, {}), _ = dt(k);
|
|
12433
12426
|
e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", g), e.dataTransfer.setData("text/html", k), e.dataTransfer.setData("text/plain", _), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(z, 0, 0);
|
|
12434
12427
|
}
|
|
12435
12428
|
}
|
|
12436
12429
|
const ue = 0.1;
|
|
12437
|
-
function
|
|
12430
|
+
function et(e, o, t, i = !0) {
|
|
12438
12431
|
const n = e.root.elementsFromPoint(
|
|
12439
12432
|
// bit hacky - offset x position to right to account for the width of sidemenu itself
|
|
12440
12433
|
o.left + (t === "editor" ? 50 : 0),
|
|
@@ -12442,7 +12435,7 @@ function tt(e, o, t, i = !0) {
|
|
|
12442
12435
|
);
|
|
12443
12436
|
for (const r of n)
|
|
12444
12437
|
if (e.dom.contains(r))
|
|
12445
|
-
return i && r.closest("[data-node-type=columnList]") ?
|
|
12438
|
+
return i && r.closest("[data-node-type=columnList]") ? et(
|
|
12446
12439
|
e,
|
|
12447
12440
|
{
|
|
12448
12441
|
left: o.left + 50,
|
|
@@ -12451,9 +12444,9 @@ function tt(e, o, t, i = !0) {
|
|
|
12451
12444
|
},
|
|
12452
12445
|
t,
|
|
12453
12446
|
!1
|
|
12454
|
-
) :
|
|
12447
|
+
) : No(r, e);
|
|
12455
12448
|
}
|
|
12456
|
-
function
|
|
12449
|
+
function Ga(e, o, t) {
|
|
12457
12450
|
if (!o.dom.firstChild)
|
|
12458
12451
|
return;
|
|
12459
12452
|
const i = o.dom.firstChild.getBoundingClientRect(), n = {
|
|
@@ -12461,14 +12454,14 @@ function Wa(e, o, t) {
|
|
|
12461
12454
|
top: e.y
|
|
12462
12455
|
}, r = n.left < i.left, a = n.left > i.right;
|
|
12463
12456
|
t === "viewport" && (r && (n.left = i.left + 10), a && (n.left = i.right - 10));
|
|
12464
|
-
let s =
|
|
12457
|
+
let s = et(o, n, t);
|
|
12465
12458
|
if (!a && s) {
|
|
12466
12459
|
const l = s.node.getBoundingClientRect();
|
|
12467
|
-
n.left = l.right - 10, s =
|
|
12460
|
+
n.left = l.right - 10, s = et(o, n, "viewport", !1);
|
|
12468
12461
|
}
|
|
12469
12462
|
return s;
|
|
12470
12463
|
}
|
|
12471
|
-
class
|
|
12464
|
+
class Wa {
|
|
12472
12465
|
constructor(o, t, i, n) {
|
|
12473
12466
|
p(this, "state");
|
|
12474
12467
|
p(this, "emitUpdate");
|
|
@@ -12483,7 +12476,7 @@ class Ka {
|
|
|
12483
12476
|
var i, n, r, a;
|
|
12484
12477
|
if (this.menuFrozen || !this.mousePos)
|
|
12485
12478
|
return;
|
|
12486
|
-
const o =
|
|
12479
|
+
const o = Ga(
|
|
12487
12480
|
this.mousePos,
|
|
12488
12481
|
this.pmView,
|
|
12489
12482
|
this.sideMenuDetection
|
|
@@ -12575,7 +12568,7 @@ class Ka {
|
|
|
12575
12568
|
throw new Error("New drag was started while an existing drag is ongoing");
|
|
12576
12569
|
const i = document.createElement("div");
|
|
12577
12570
|
i.innerHTML = t;
|
|
12578
|
-
const r =
|
|
12571
|
+
const r = Ht.fromSchema(this.pmView.state.schema).parse(i, {
|
|
12579
12572
|
topNode: this.pmView.state.schema.nodes.blockGroup.create()
|
|
12580
12573
|
});
|
|
12581
12574
|
this.pmView.dragging = {
|
|
@@ -12644,7 +12637,7 @@ class Ka {
|
|
|
12644
12637
|
"dragend",
|
|
12645
12638
|
this.onDragEnd,
|
|
12646
12639
|
!0
|
|
12647
|
-
),
|
|
12640
|
+
), lt(), this.pmView.root.addEventListener(
|
|
12648
12641
|
"mousemove",
|
|
12649
12642
|
this.onMouseMove,
|
|
12650
12643
|
!0
|
|
@@ -12699,8 +12692,8 @@ class Ka {
|
|
|
12699
12692
|
), this.pmView.root.removeEventListener("scroll", this.onScroll, !0);
|
|
12700
12693
|
}
|
|
12701
12694
|
}
|
|
12702
|
-
const
|
|
12703
|
-
class
|
|
12695
|
+
const Ka = new A("SideMenuPlugin");
|
|
12696
|
+
class qa extends W {
|
|
12704
12697
|
constructor(t, i) {
|
|
12705
12698
|
super();
|
|
12706
12699
|
p(this, "view");
|
|
@@ -12709,13 +12702,13 @@ class Xa extends W {
|
|
|
12709
12702
|
* Handles drag & drop events for blocks.
|
|
12710
12703
|
*/
|
|
12711
12704
|
p(this, "blockDragStart", (t, i) => {
|
|
12712
|
-
this.view && (this.view.isDragOrigin = !0),
|
|
12705
|
+
this.view && (this.view.isDragOrigin = !0), $a(t, i, this.editor);
|
|
12713
12706
|
});
|
|
12714
12707
|
/**
|
|
12715
12708
|
* Handles drag & drop events for blocks.
|
|
12716
12709
|
*/
|
|
12717
12710
|
p(this, "blockDragEnd", () => {
|
|
12718
|
-
this.editor.prosemirrorView &&
|
|
12711
|
+
this.editor.prosemirrorView && jo(this.editor.prosemirrorView.root), this.view && (this.view.isDragOrigin = !1);
|
|
12719
12712
|
});
|
|
12720
12713
|
/**
|
|
12721
12714
|
* Freezes the side menu. When frozen, the side menu will stay
|
|
@@ -12734,8 +12727,8 @@ class Xa extends W {
|
|
|
12734
12727
|
this.view.menuFrozen = !1, this.view.state.show = !1, this.view.emitUpdate(this.view.state);
|
|
12735
12728
|
});
|
|
12736
12729
|
this.editor = t, this.plugin = new T({
|
|
12737
|
-
key:
|
|
12738
|
-
view: (n) => (this.view = new
|
|
12730
|
+
key: Ka,
|
|
12731
|
+
view: (n) => (this.view = new Wa(
|
|
12739
12732
|
t,
|
|
12740
12733
|
i,
|
|
12741
12734
|
n,
|
|
@@ -12749,8 +12742,8 @@ class Xa extends W {
|
|
|
12749
12742
|
return this.on("update", t);
|
|
12750
12743
|
}
|
|
12751
12744
|
}
|
|
12752
|
-
const
|
|
12753
|
-
class
|
|
12745
|
+
const Xa = Xo((e) => e.type.name === "blockContainer");
|
|
12746
|
+
class Za {
|
|
12754
12747
|
constructor(o, t) {
|
|
12755
12748
|
p(this, "state");
|
|
12756
12749
|
p(this, "emitUpdate");
|
|
@@ -12815,7 +12808,7 @@ class Ja {
|
|
|
12815
12808
|
}
|
|
12816
12809
|
}
|
|
12817
12810
|
const ae = new A("SuggestionMenuPlugin");
|
|
12818
|
-
class
|
|
12811
|
+
class Ja extends W {
|
|
12819
12812
|
constructor(t) {
|
|
12820
12813
|
super();
|
|
12821
12814
|
p(this, "view");
|
|
@@ -12835,7 +12828,7 @@ class Ya extends W {
|
|
|
12835
12828
|
const i = this.triggerCharacters;
|
|
12836
12829
|
this.plugin = new T({
|
|
12837
12830
|
key: ae,
|
|
12838
|
-
view: () => (this.view = new
|
|
12831
|
+
view: () => (this.view = new Za(
|
|
12839
12832
|
t,
|
|
12840
12833
|
(n, r) => {
|
|
12841
12834
|
this.emit(`update ${n}`, r);
|
|
@@ -12892,7 +12885,7 @@ class Ya extends W {
|
|
|
12892
12885
|
if (r === void 0)
|
|
12893
12886
|
return null;
|
|
12894
12887
|
if (!r.deleteTriggerCharacter) {
|
|
12895
|
-
const a =
|
|
12888
|
+
const a = Xa(n.selection);
|
|
12896
12889
|
if (a)
|
|
12897
12890
|
return N.create(n.doc, [
|
|
12898
12891
|
F.node(
|
|
@@ -12932,17 +12925,17 @@ class Ya extends W {
|
|
|
12932
12925
|
function ml(e, o) {
|
|
12933
12926
|
e.suggestionMenus.addTriggerCharacter(o);
|
|
12934
12927
|
}
|
|
12935
|
-
let
|
|
12936
|
-
function
|
|
12937
|
-
|
|
12928
|
+
let I;
|
|
12929
|
+
function Rt(e) {
|
|
12930
|
+
I || (I = document.createElement("div"), I.innerHTML = "_", I.style.opacity = "0", I.style.height = "1px", I.style.width = "1px", e instanceof Document ? e.body.appendChild(I) : e.appendChild(I));
|
|
12938
12931
|
}
|
|
12939
|
-
function
|
|
12940
|
-
|
|
12932
|
+
function Ya(e) {
|
|
12933
|
+
I && (e instanceof Document ? e.body.removeChild(I) : e.removeChild(I), I = void 0);
|
|
12941
12934
|
}
|
|
12942
12935
|
function Ee(e) {
|
|
12943
12936
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
12944
12937
|
}
|
|
12945
|
-
function
|
|
12938
|
+
function Qa(e) {
|
|
12946
12939
|
let o = e;
|
|
12947
12940
|
for (; o && o.nodeName !== "TD" && o.nodeName !== "TH" && !o.classList.contains("tableWrapper"); ) {
|
|
12948
12941
|
if (o.classList.contains("ProseMirror"))
|
|
@@ -12962,12 +12955,12 @@ function es(e) {
|
|
|
12962
12955
|
tbodyNode: o.querySelector("tbody")
|
|
12963
12956
|
};
|
|
12964
12957
|
}
|
|
12965
|
-
function
|
|
12958
|
+
function es(e, o) {
|
|
12966
12959
|
const t = o.querySelectorAll(e);
|
|
12967
12960
|
for (let i = 0; i < t.length; i++)
|
|
12968
12961
|
t[i].style.visibility = "hidden";
|
|
12969
12962
|
}
|
|
12970
|
-
class
|
|
12963
|
+
class ts {
|
|
12971
12964
|
constructor(o, t, i) {
|
|
12972
12965
|
p(this, "state");
|
|
12973
12966
|
p(this, "emitUpdate");
|
|
@@ -12987,7 +12980,7 @@ class os {
|
|
|
12987
12980
|
var d, c, u, m, h, g, f;
|
|
12988
12981
|
if (this.menuFrozen || this.mouseState === "selecting" || !(o.target instanceof Element) || !this.pmView.dom.contains(o.target))
|
|
12989
12982
|
return;
|
|
12990
|
-
const t =
|
|
12983
|
+
const t = Qa(o.target);
|
|
12991
12984
|
if ((t == null ? void 0 : t.type) === "cell" && this.mouseState === "down" && !((d = this.state) != null && d.draggingState)) {
|
|
12992
12985
|
this.mouseState = "selecting", (c = this.state) != null && c.show && (this.state.show = !1, this.state.showAddOrRemoveRowsButton = !1, this.state.showAddOrRemoveColumnsButton = !1, this.emitUpdate());
|
|
12993
12986
|
return;
|
|
@@ -12998,7 +12991,7 @@ class os {
|
|
|
12998
12991
|
}
|
|
12999
12992
|
if (!t.tbodyNode)
|
|
13000
12993
|
return;
|
|
13001
|
-
const i = t.tbodyNode.getBoundingClientRect(), n =
|
|
12994
|
+
const i = t.tbodyNode.getBoundingClientRect(), n = No(t.domNode, this.pmView);
|
|
13002
12995
|
if (!n)
|
|
13003
12996
|
return;
|
|
13004
12997
|
this.tableElement = n.node;
|
|
@@ -13016,7 +13009,7 @@ class os {
|
|
|
13016
13009
|
this.editor.schema.styleSchema,
|
|
13017
13010
|
this.editor.blockCache
|
|
13018
13011
|
);
|
|
13019
|
-
if (
|
|
13012
|
+
if (Ir("table", s, this.editor) && (this.tablePos = a.posBeforeNode + 1, r = s), !r)
|
|
13020
13013
|
return;
|
|
13021
13014
|
this.tableId = n.id;
|
|
13022
13015
|
const l = (m = t.domNode.closest(".tableWrapper")) == null ? void 0 : m.querySelector(".table-widgets-container");
|
|
@@ -13058,7 +13051,7 @@ class os {
|
|
|
13058
13051
|
var m;
|
|
13059
13052
|
if (((m = this.state) == null ? void 0 : m.draggingState) === void 0)
|
|
13060
13053
|
return;
|
|
13061
|
-
o.preventDefault(), o.dataTransfer.dropEffect = "move",
|
|
13054
|
+
o.preventDefault(), o.dataTransfer.dropEffect = "move", es(
|
|
13062
13055
|
".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline",
|
|
13063
13056
|
this.pmView.root
|
|
13064
13057
|
);
|
|
@@ -13097,13 +13090,13 @@ class os {
|
|
|
13097
13090
|
o.preventDefault();
|
|
13098
13091
|
const { draggingState: t, colIndex: i, rowIndex: n } = this.state, r = this.state.block.content.columnWidths;
|
|
13099
13092
|
if (t.draggedCellOrientation === "row") {
|
|
13100
|
-
if (!
|
|
13093
|
+
if (!Qt(
|
|
13101
13094
|
this.state.block,
|
|
13102
13095
|
t.originalIndex,
|
|
13103
13096
|
n
|
|
13104
13097
|
))
|
|
13105
13098
|
return !1;
|
|
13106
|
-
const a =
|
|
13099
|
+
const a = cn(
|
|
13107
13100
|
this.state.block,
|
|
13108
13101
|
t.originalIndex,
|
|
13109
13102
|
n
|
|
@@ -13116,13 +13109,13 @@ class os {
|
|
|
13116
13109
|
}
|
|
13117
13110
|
});
|
|
13118
13111
|
} else {
|
|
13119
|
-
if (!
|
|
13112
|
+
if (!eo(
|
|
13120
13113
|
this.state.block,
|
|
13121
13114
|
t.originalIndex,
|
|
13122
13115
|
i
|
|
13123
13116
|
))
|
|
13124
13117
|
return !1;
|
|
13125
|
-
const a =
|
|
13118
|
+
const a = dn(
|
|
13126
13119
|
this.state.block,
|
|
13127
13120
|
t.originalIndex,
|
|
13128
13121
|
i
|
|
@@ -13158,7 +13151,7 @@ class os {
|
|
|
13158
13151
|
this.state.show = !1, this.state.showAddOrRemoveRowsButton = !1, this.state.showAddOrRemoveColumnsButton = !1, this.emitUpdate();
|
|
13159
13152
|
return;
|
|
13160
13153
|
}
|
|
13161
|
-
const { height: o, width: t } =
|
|
13154
|
+
const { height: o, width: t } = nt(
|
|
13162
13155
|
this.state.block
|
|
13163
13156
|
);
|
|
13164
13157
|
this.state.rowIndex !== void 0 && this.state.colIndex !== void 0 && (this.state.rowIndex >= o && (this.state.rowIndex = o - 1), this.state.colIndex >= t && (this.state.colIndex = t - 1));
|
|
@@ -13184,7 +13177,7 @@ class os {
|
|
|
13184
13177
|
}
|
|
13185
13178
|
}
|
|
13186
13179
|
const pe = new A("TableHandlesPlugin");
|
|
13187
|
-
class
|
|
13180
|
+
class os extends W {
|
|
13188
13181
|
constructor(t) {
|
|
13189
13182
|
super();
|
|
13190
13183
|
p(this, "view");
|
|
@@ -13211,7 +13204,7 @@ class is extends W {
|
|
|
13211
13204
|
})
|
|
13212
13205
|
), !this.editor.prosemirrorView)
|
|
13213
13206
|
throw new Error("Editor view not initialized.");
|
|
13214
|
-
|
|
13207
|
+
Rt(this.editor.prosemirrorView.root), t.dataTransfer.setDragImage(I, 0, 0), t.dataTransfer.effectAllowed = "move";
|
|
13215
13208
|
});
|
|
13216
13209
|
/**
|
|
13217
13210
|
* Callback that should be set on the `dragStart` event for whichever element
|
|
@@ -13235,7 +13228,7 @@ class is extends W {
|
|
|
13235
13228
|
})
|
|
13236
13229
|
), !this.editor.prosemirrorView)
|
|
13237
13230
|
throw new Error("Editor view not initialized.");
|
|
13238
|
-
|
|
13231
|
+
Rt(this.editor.prosemirrorView.root), t.dataTransfer.setDragImage(I, 0, 0), t.dataTransfer.effectAllowed = "copyMove";
|
|
13239
13232
|
});
|
|
13240
13233
|
/**
|
|
13241
13234
|
* Callback that should be set on the `dragEnd` event for both the element
|
|
@@ -13250,7 +13243,7 @@ class is extends W {
|
|
|
13250
13243
|
this.editor._tiptapEditor.state.tr.setMeta(pe, null)
|
|
13251
13244
|
), !this.editor.prosemirrorView)
|
|
13252
13245
|
throw new Error("Editor view not initialized.");
|
|
13253
|
-
|
|
13246
|
+
Ya(this.editor.prosemirrorView.root);
|
|
13254
13247
|
});
|
|
13255
13248
|
/**
|
|
13256
13249
|
* Freezes the drag handles. When frozen, they will stay attached to the same
|
|
@@ -13266,11 +13259,11 @@ class is extends W {
|
|
|
13266
13259
|
p(this, "unfreezeHandles", () => {
|
|
13267
13260
|
this.view.menuFrozen = !1;
|
|
13268
13261
|
});
|
|
13269
|
-
p(this, "getCellsAtRowHandle", (t, i) =>
|
|
13262
|
+
p(this, "getCellsAtRowHandle", (t, i) => Ke(t, i));
|
|
13270
13263
|
/**
|
|
13271
13264
|
* Get all the cells in a column of the table block.
|
|
13272
13265
|
*/
|
|
13273
|
-
p(this, "getCellsAtColumnHandle", (t, i) =>
|
|
13266
|
+
p(this, "getCellsAtColumnHandle", (t, i) => qe(t, i));
|
|
13274
13267
|
/**
|
|
13275
13268
|
* Sets the selection to the given cell or a range of cells.
|
|
13276
13269
|
* @returns The new state after the selection has been set.
|
|
@@ -13301,7 +13294,7 @@ class is extends W {
|
|
|
13301
13294
|
const n = this.setCellSelection(
|
|
13302
13295
|
i.orientation === "row" ? { row: t, col: 0 } : { row: 0, col: t }
|
|
13303
13296
|
);
|
|
13304
|
-
return i.orientation === "row" ? i.side === "above" ?
|
|
13297
|
+
return i.orientation === "row" ? i.side === "above" ? ai(n, this.editor.dispatch) : si(n, this.editor.dispatch) : i.side === "left" ? li(n, this.editor.dispatch) : di(n, this.editor.dispatch);
|
|
13305
13298
|
});
|
|
13306
13299
|
/**
|
|
13307
13300
|
* Removes a row or column from the table using prosemirror-table commands
|
|
@@ -13310,7 +13303,7 @@ class is extends W {
|
|
|
13310
13303
|
const n = this.setCellSelection(
|
|
13311
13304
|
i === "row" ? { row: t, col: 0 } : { row: 0, col: t }
|
|
13312
13305
|
);
|
|
13313
|
-
return i === "row" ?
|
|
13306
|
+
return i === "row" ? ci(n, this.editor.dispatch) : ui(n, this.editor.dispatch);
|
|
13314
13307
|
});
|
|
13315
13308
|
/**
|
|
13316
13309
|
* Merges the cells in the table block.
|
|
@@ -13320,7 +13313,7 @@ class is extends W {
|
|
|
13320
13313
|
t.relativeStartCell,
|
|
13321
13314
|
t.relativeEndCell
|
|
13322
13315
|
) : this.editor.prosemirrorState;
|
|
13323
|
-
return
|
|
13316
|
+
return pi(i, this.editor.dispatch);
|
|
13324
13317
|
});
|
|
13325
13318
|
/**
|
|
13326
13319
|
* Splits the cell in the table block.
|
|
@@ -13328,7 +13321,7 @@ class is extends W {
|
|
|
13328
13321
|
*/
|
|
13329
13322
|
p(this, "splitCell", (t) => {
|
|
13330
13323
|
const i = t ? this.setCellSelection(t) : this.editor.prosemirrorState;
|
|
13331
|
-
return
|
|
13324
|
+
return mi(i, this.editor.dispatch);
|
|
13332
13325
|
});
|
|
13333
13326
|
/**
|
|
13334
13327
|
* Gets the start and end cells of the current cell selection.
|
|
@@ -13337,7 +13330,7 @@ class is extends W {
|
|
|
13337
13330
|
p(this, "getCellSelection", () => {
|
|
13338
13331
|
const t = this.editor.prosemirrorState, i = t.selection;
|
|
13339
13332
|
let n = i.$from, r = i.$to;
|
|
13340
|
-
if (
|
|
13333
|
+
if (Et(i)) {
|
|
13341
13334
|
const { ranges: g } = i;
|
|
13342
13335
|
g.forEach((f) => {
|
|
13343
13336
|
n = f.$from.min(n ?? f.$from), r = f.$to.max(r ?? f.$to);
|
|
@@ -13372,7 +13365,7 @@ class is extends W {
|
|
|
13372
13365
|
* Returns undefined when there is no cell selection, or the selection is not within a table.
|
|
13373
13366
|
*/
|
|
13374
13367
|
p(this, "getMergeDirection", (t) => {
|
|
13375
|
-
const i =
|
|
13368
|
+
const i = Et(
|
|
13376
13369
|
this.editor.prosemirrorState.selection
|
|
13377
13370
|
) ? this.editor.prosemirrorState.selection : void 0;
|
|
13378
13371
|
if (!i || !t || // Only offer the merge button if there is more than one cell selected.
|
|
@@ -13380,13 +13373,13 @@ class is extends W {
|
|
|
13380
13373
|
return;
|
|
13381
13374
|
const n = this.getCellSelection();
|
|
13382
13375
|
if (n)
|
|
13383
|
-
return
|
|
13376
|
+
return mn(n.from, n.to, t) ? "vertical" : "horizontal";
|
|
13384
13377
|
});
|
|
13385
|
-
p(this, "cropEmptyRowsOrColumns", (t, i) =>
|
|
13386
|
-
p(this, "addRowsOrColumns", (t, i, n) =>
|
|
13378
|
+
p(this, "cropEmptyRowsOrColumns", (t, i) => un(t, i));
|
|
13379
|
+
p(this, "addRowsOrColumns", (t, i, n) => pn(t, i, n));
|
|
13387
13380
|
this.editor = t, this.plugin = new T({
|
|
13388
13381
|
key: pe,
|
|
13389
|
-
view: (i) => (this.view = new
|
|
13382
|
+
view: (i) => (this.view = new ts(t, i, (n) => {
|
|
13390
13383
|
this.emit("update", n);
|
|
13391
13384
|
}), this.view),
|
|
13392
13385
|
// We use decorations to render the drop cursor when dragging a table row
|
|
@@ -13401,20 +13394,20 @@ class is extends W {
|
|
|
13401
13394
|
const r = [];
|
|
13402
13395
|
if (n === this.view.state.draggingState.originalIndex)
|
|
13403
13396
|
return N.create(i.doc, r);
|
|
13404
|
-
if (this.view.state.draggingState.draggedCellOrientation === "row" && !
|
|
13397
|
+
if (this.view.state.draggingState.draggedCellOrientation === "row" && !Qt(
|
|
13405
13398
|
this.view.state.block,
|
|
13406
13399
|
this.view.state.draggingState.originalIndex,
|
|
13407
13400
|
n
|
|
13408
13401
|
))
|
|
13409
13402
|
return N.create(i.doc, r);
|
|
13410
|
-
if (this.view.state.draggingState.draggedCellOrientation === "col" && !
|
|
13403
|
+
if (this.view.state.draggingState.draggedCellOrientation === "col" && !eo(
|
|
13411
13404
|
this.view.state.block,
|
|
13412
13405
|
this.view.state.draggingState.originalIndex,
|
|
13413
13406
|
n
|
|
13414
13407
|
))
|
|
13415
13408
|
return N.create(i.doc, r);
|
|
13416
13409
|
const a = i.doc.resolve(this.view.tablePos + 1), s = this.view.state.draggingState.originalIndex;
|
|
13417
|
-
return this.view.state.draggingState.draggedCellOrientation === "row" ?
|
|
13410
|
+
return this.view.state.draggingState.draggedCellOrientation === "row" ? Ke(
|
|
13418
13411
|
this.view.state.block,
|
|
13419
13412
|
n
|
|
13420
13413
|
).forEach(({ row: d, col: c }) => {
|
|
@@ -13430,7 +13423,7 @@ class is extends W {
|
|
|
13430
13423
|
return f.className = "bn-table-drop-cursor", f.style.left = "0", f.style.right = "0", n > s ? f.style.bottom = "-2px" : f.style.top = "-3px", f.style.height = "4px", f;
|
|
13431
13424
|
})
|
|
13432
13425
|
);
|
|
13433
|
-
}) :
|
|
13426
|
+
}) : qe(
|
|
13434
13427
|
this.view.state.block,
|
|
13435
13428
|
n
|
|
13436
13429
|
).forEach(({ row: d, col: c }) => {
|
|
@@ -13455,7 +13448,7 @@ class is extends W {
|
|
|
13455
13448
|
return this.on("update", t);
|
|
13456
13449
|
}
|
|
13457
13450
|
}
|
|
13458
|
-
const
|
|
13451
|
+
const is = j.create({
|
|
13459
13452
|
name: "textAlignment",
|
|
13460
13453
|
addGlobalAttributes() {
|
|
13461
13454
|
return [
|
|
@@ -13483,7 +13476,7 @@ const ns = j.create({
|
|
|
13483
13476
|
}
|
|
13484
13477
|
];
|
|
13485
13478
|
}
|
|
13486
|
-
}),
|
|
13479
|
+
}), ns = j.create({
|
|
13487
13480
|
name: "blockTextColor",
|
|
13488
13481
|
addGlobalAttributes() {
|
|
13489
13482
|
return [
|
|
@@ -13501,7 +13494,7 @@ const ns = j.create({
|
|
|
13501
13494
|
}
|
|
13502
13495
|
];
|
|
13503
13496
|
}
|
|
13504
|
-
}),
|
|
13497
|
+
}), rs = j.create({
|
|
13505
13498
|
name: "trailingNode",
|
|
13506
13499
|
addProseMirrorPlugins() {
|
|
13507
13500
|
const e = new A(this.name);
|
|
@@ -13536,13 +13529,13 @@ const ns = j.create({
|
|
|
13536
13529
|
})
|
|
13537
13530
|
];
|
|
13538
13531
|
}
|
|
13539
|
-
}),
|
|
13532
|
+
}), as = {
|
|
13540
13533
|
blockColor: "data-block-color",
|
|
13541
13534
|
blockStyle: "data-block-style",
|
|
13542
13535
|
id: "data-id",
|
|
13543
13536
|
depth: "data-depth",
|
|
13544
13537
|
depthChange: "data-depth-change"
|
|
13545
|
-
},
|
|
13538
|
+
}, ss = de.create({
|
|
13546
13539
|
name: "blockContainer",
|
|
13547
13540
|
group: "blockGroupChild bnBlock",
|
|
13548
13541
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -13558,7 +13551,7 @@ const ns = j.create({
|
|
|
13558
13551
|
if (typeof e == "string")
|
|
13559
13552
|
return !1;
|
|
13560
13553
|
const o = {};
|
|
13561
|
-
for (const [t, i] of Object.entries(
|
|
13554
|
+
for (const [t, i] of Object.entries(as))
|
|
13562
13555
|
e.getAttribute(i) && (o[t] = e.getAttribute(i));
|
|
13563
13556
|
return e.getAttribute("data-node-type") === "blockContainer" ? o : !1;
|
|
13564
13557
|
}
|
|
@@ -13583,7 +13576,7 @@ const ns = j.create({
|
|
|
13583
13576
|
contentDOM: i
|
|
13584
13577
|
};
|
|
13585
13578
|
}
|
|
13586
|
-
}),
|
|
13579
|
+
}), ls = de.create({
|
|
13587
13580
|
name: "blockGroup",
|
|
13588
13581
|
group: "childContainer",
|
|
13589
13582
|
content: "blockGroupChild+",
|
|
@@ -13612,37 +13605,37 @@ const ns = j.create({
|
|
|
13612
13605
|
contentDOM: t
|
|
13613
13606
|
};
|
|
13614
13607
|
}
|
|
13615
|
-
}),
|
|
13608
|
+
}), ds = de.create({
|
|
13616
13609
|
name: "doc",
|
|
13617
13610
|
topNode: !0,
|
|
13618
13611
|
content: "blockGroup"
|
|
13619
|
-
}),
|
|
13620
|
-
const o = {}, t =
|
|
13612
|
+
}), cs = (e) => {
|
|
13613
|
+
const o = {}, t = us(e);
|
|
13621
13614
|
for (const n of t)
|
|
13622
13615
|
o[n.name] = n;
|
|
13623
|
-
o.formattingToolbar = new
|
|
13616
|
+
o.formattingToolbar = new Ba(
|
|
13624
13617
|
e.editor
|
|
13625
|
-
), o.linkToolbar = new
|
|
13618
|
+
), o.linkToolbar = new Pa(e.editor), o.sideMenu = new qa(
|
|
13626
13619
|
e.editor,
|
|
13627
13620
|
e.sideMenuDetection
|
|
13628
|
-
), o.suggestionMenus = new
|
|
13621
|
+
), o.suggestionMenus = new Ja(e.editor), o.filePanel = new xa(e.editor), o.placeholder = new Ha(e.editor, e.placeholders), (e.animations ?? !0) && (o.animations = new Va()), e.tableHandles && (o.tableHandles = new os(e.editor)), o.dropCursor = {
|
|
13629
13622
|
plugin: e.dropCursor({
|
|
13630
13623
|
width: 5,
|
|
13631
13624
|
color: "#ddeeff",
|
|
13632
13625
|
editor: e.editor
|
|
13633
13626
|
})
|
|
13634
|
-
}, o.nodeSelectionKeyboard = new
|
|
13627
|
+
}, o.nodeSelectionKeyboard = new Da(), o.showSelection = new za(e.editor), e.comments && (o.comments = new va(
|
|
13635
13628
|
e.editor,
|
|
13636
13629
|
e.comments.threadStore,
|
|
13637
|
-
|
|
13630
|
+
Ao.name
|
|
13638
13631
|
));
|
|
13639
13632
|
const i = e.disableExtensions || [];
|
|
13640
13633
|
for (const n of i)
|
|
13641
13634
|
delete o[n];
|
|
13642
13635
|
return o;
|
|
13643
13636
|
};
|
|
13644
|
-
let
|
|
13645
|
-
const
|
|
13637
|
+
let Dt = !1;
|
|
13638
|
+
const us = (e) => {
|
|
13646
13639
|
const o = [
|
|
13647
13640
|
ce.ClipboardTextSerializer,
|
|
13648
13641
|
ce.Commands,
|
|
@@ -13650,31 +13643,31 @@ const ps = (e) => {
|
|
|
13650
13643
|
ce.FocusEvents,
|
|
13651
13644
|
ce.Tabindex,
|
|
13652
13645
|
// DevTools,
|
|
13653
|
-
|
|
13646
|
+
vi,
|
|
13654
13647
|
// DropCursor,
|
|
13655
13648
|
we.configure({
|
|
13656
13649
|
// everything from bnBlock group (nodes that represent a BlockNote block should have an id)
|
|
13657
13650
|
types: ["blockContainer", "columnList", "column"],
|
|
13658
13651
|
setIdAttribute: e.setIdAttribute
|
|
13659
13652
|
}),
|
|
13660
|
-
|
|
13653
|
+
Ci.extend({ priority: 10 }),
|
|
13661
13654
|
// Comments,
|
|
13662
13655
|
// basics:
|
|
13663
|
-
|
|
13656
|
+
Ei,
|
|
13664
13657
|
// marks:
|
|
13665
|
-
|
|
13658
|
+
Si.extend({
|
|
13666
13659
|
inclusive: !1
|
|
13667
13660
|
}).configure({
|
|
13668
|
-
defaultProtocol:
|
|
13661
|
+
defaultProtocol: ja,
|
|
13669
13662
|
// only call this once if we have multiple editors installed. Or fix https://github.com/ueberdosis/tiptap/issues/5450
|
|
13670
|
-
protocols:
|
|
13663
|
+
protocols: Dt ? [] : Na
|
|
13671
13664
|
}),
|
|
13672
13665
|
...Object.values(e.styleSpecs).map((t) => t.implementation.mark.configure({
|
|
13673
13666
|
editor: e.editor
|
|
13674
13667
|
})),
|
|
13675
|
-
rs,
|
|
13676
|
-
ka,
|
|
13677
13668
|
ns,
|
|
13669
|
+
ba,
|
|
13670
|
+
is,
|
|
13678
13671
|
// make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
|
|
13679
13672
|
j.create({
|
|
13680
13673
|
name: "OverrideEscape",
|
|
@@ -13685,8 +13678,8 @@ const ps = (e) => {
|
|
|
13685
13678
|
}
|
|
13686
13679
|
}),
|
|
13687
13680
|
// nodes
|
|
13688
|
-
|
|
13689
|
-
|
|
13681
|
+
ds,
|
|
13682
|
+
ss.configure({
|
|
13690
13683
|
editor: e.editor,
|
|
13691
13684
|
domAttributes: e.domAttributes
|
|
13692
13685
|
}),
|
|
@@ -13694,7 +13687,7 @@ const ps = (e) => {
|
|
|
13694
13687
|
editor: e.editor,
|
|
13695
13688
|
tabBehavior: e.tabBehavior
|
|
13696
13689
|
}),
|
|
13697
|
-
|
|
13690
|
+
ls.configure({
|
|
13698
13691
|
domAttributes: e.domAttributes
|
|
13699
13692
|
}),
|
|
13700
13693
|
...Object.values(e.inlineContentSpecs).filter((t) => t.config !== "link" && t.config !== "text").map((t) => t.implementation.node.configure({
|
|
@@ -13714,23 +13707,23 @@ const ps = (e) => {
|
|
|
13714
13707
|
domAttributes: e.domAttributes
|
|
13715
13708
|
})
|
|
13716
13709
|
]),
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
|
|
13710
|
+
ga(e.editor),
|
|
13711
|
+
ha(e.editor),
|
|
13712
|
+
pa(e.editor),
|
|
13720
13713
|
// This needs to be at the bottom of this list, because Key events (such as enter, when selecting a /command),
|
|
13721
13714
|
// should be handled before Enter handlers in other components like splitListItem
|
|
13722
|
-
...e.trailingBlock === void 0 || e.trailingBlock ? [
|
|
13723
|
-
...e.comments ? [
|
|
13715
|
+
...e.trailingBlock === void 0 || e.trailingBlock ? [rs] : [],
|
|
13716
|
+
...e.comments ? [Ao] : []
|
|
13724
13717
|
];
|
|
13725
|
-
return
|
|
13718
|
+
return Dt = !0, e.collaboration ? o.push(...ka(e.collaboration)) : o.push(xi), o;
|
|
13726
13719
|
};
|
|
13727
|
-
function
|
|
13720
|
+
function ps(e, o) {
|
|
13728
13721
|
const t = [];
|
|
13729
13722
|
return e.forEach((i, n, r) => {
|
|
13730
13723
|
r !== o && t.push(i);
|
|
13731
13724
|
}), U.from(t);
|
|
13732
13725
|
}
|
|
13733
|
-
function
|
|
13726
|
+
function ms(e, o) {
|
|
13734
13727
|
const t = [];
|
|
13735
13728
|
for (let i = 0; i < e.childCount; i++)
|
|
13736
13729
|
if (e.child(i).type.name === "tableRow")
|
|
@@ -13748,16 +13741,16 @@ function hs(e, o) {
|
|
|
13748
13741
|
t.push(e.child(i));
|
|
13749
13742
|
return e = U.from(t), e;
|
|
13750
13743
|
}
|
|
13751
|
-
function
|
|
13744
|
+
function hs(e, o) {
|
|
13752
13745
|
let t = U.from(e.content);
|
|
13753
|
-
if (t =
|
|
13746
|
+
if (t = ms(t, o.state.schema), !fs(t, o))
|
|
13754
13747
|
return new ee(t, e.openStart, e.openEnd);
|
|
13755
13748
|
for (let i = 0; i < t.childCount; i++)
|
|
13756
13749
|
if (t.child(i).type.spec.group === "blockContent") {
|
|
13757
13750
|
const n = [t.child(i)];
|
|
13758
13751
|
if (i + 1 < t.childCount && t.child(i + 1).type.name === "blockGroup") {
|
|
13759
13752
|
const a = t.child(i + 1).child(0).child(0);
|
|
13760
|
-
(a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(t.child(i + 1)), t =
|
|
13753
|
+
(a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(t.child(i + 1)), t = ps(t, i + 1));
|
|
13761
13754
|
}
|
|
13762
13755
|
const r = o.state.schema.nodes.blockContainer.createChecked(
|
|
13763
13756
|
void 0,
|
|
@@ -13767,7 +13760,7 @@ function fs(e, o) {
|
|
|
13767
13760
|
}
|
|
13768
13761
|
return new ee(t, e.openStart, e.openEnd);
|
|
13769
13762
|
}
|
|
13770
|
-
function
|
|
13763
|
+
function fs(e, o) {
|
|
13771
13764
|
var r, a;
|
|
13772
13765
|
const t = e.childCount === 1, i = ((r = e.firstChild) == null ? void 0 : r.type.spec.content) === "inline*", n = ((a = e.firstChild) == null ? void 0 : a.type.spec.content) === "tableRow+";
|
|
13773
13766
|
if (t) {
|
|
@@ -13781,7 +13774,7 @@ function gs(e, o) {
|
|
|
13781
13774
|
}
|
|
13782
13775
|
return !0;
|
|
13783
13776
|
}
|
|
13784
|
-
const
|
|
13777
|
+
const Ie = class Ie extends Zo {
|
|
13785
13778
|
constructor(t, i) {
|
|
13786
13779
|
super({ ...t, content: void 0 });
|
|
13787
13780
|
p(this, "_state");
|
|
@@ -13800,14 +13793,14 @@ const Le = class Le extends Jo {
|
|
|
13800
13793
|
if (r)
|
|
13801
13794
|
return r;
|
|
13802
13795
|
const d = a.apply(n.nodes.doc, l), c = JSON.parse(JSON.stringify(d.toJSON()));
|
|
13803
|
-
return c.content[0].content[0].attrs.id = "initialBlockId", r =
|
|
13796
|
+
return c.content[0].content[0].attrs.id = "initialBlockId", r = Oo.fromJSON(n, c), r;
|
|
13804
13797
|
};
|
|
13805
13798
|
let s;
|
|
13806
13799
|
try {
|
|
13807
13800
|
const l = t == null ? void 0 : t.content.map(
|
|
13808
13801
|
(d) => ie(d, this.schema, i).toJSON()
|
|
13809
13802
|
);
|
|
13810
|
-
s =
|
|
13803
|
+
s = Jo(
|
|
13811
13804
|
{
|
|
13812
13805
|
type: "doc",
|
|
13813
13806
|
content: [
|
|
@@ -13828,7 +13821,7 @@ const Le = class Le extends Jo {
|
|
|
13828
13821
|
"Error creating document from blocks passed as `initialContent`:\n" + +JSON.stringify(t.content)
|
|
13829
13822
|
);
|
|
13830
13823
|
}
|
|
13831
|
-
this._state =
|
|
13824
|
+
this._state = Qo.create({
|
|
13832
13825
|
doc: s,
|
|
13833
13826
|
schema: this.schema
|
|
13834
13827
|
// selection: selection || undefined,
|
|
@@ -13848,7 +13841,7 @@ const Le = class Le extends Jo {
|
|
|
13848
13841
|
const i = {};
|
|
13849
13842
|
this.extensionManager.extensions.forEach((r) => {
|
|
13850
13843
|
r.type === "mark" && r.config.addMarkView && (i[r.name] = r.config.addMarkView);
|
|
13851
|
-
}), this.view = new
|
|
13844
|
+
}), this.view = new Mi(
|
|
13852
13845
|
{ mount: this.options.element },
|
|
13853
13846
|
// use mount option so that we reuse the existing element instead of creating a new one
|
|
13854
13847
|
{
|
|
@@ -13868,26 +13861,26 @@ const Le = class Le extends Jo {
|
|
|
13868
13861
|
), this.emit("create", { editor: this }), this.isInitialized = !0;
|
|
13869
13862
|
}
|
|
13870
13863
|
};
|
|
13871
|
-
p(
|
|
13864
|
+
p(Ie, "create", (t, i) => {
|
|
13872
13865
|
var r, a;
|
|
13873
13866
|
const n = (r = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : r.setTimeout;
|
|
13874
13867
|
typeof ((a = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : a.setTimeout) < "u" && (globalThis.window.setTimeout = () => 0);
|
|
13875
13868
|
try {
|
|
13876
|
-
return new
|
|
13869
|
+
return new Ie(t, i);
|
|
13877
13870
|
} finally {
|
|
13878
13871
|
n && (globalThis.window.setTimeout = n);
|
|
13879
13872
|
}
|
|
13880
13873
|
});
|
|
13881
|
-
let
|
|
13882
|
-
|
|
13874
|
+
let Le = Ie;
|
|
13875
|
+
Le.prototype.createView = function() {
|
|
13883
13876
|
this.options.onPaste = this.options.onDrop = void 0;
|
|
13884
13877
|
};
|
|
13885
|
-
const
|
|
13878
|
+
const gs = {
|
|
13886
13879
|
enableInputRules: !0,
|
|
13887
13880
|
enablePasteRules: !0,
|
|
13888
13881
|
enableCoreExtensions: !1
|
|
13889
13882
|
};
|
|
13890
|
-
class
|
|
13883
|
+
class Ro extends W {
|
|
13891
13884
|
constructor(t) {
|
|
13892
13885
|
var d, c, u, m, h, g, f, b, k, _, w;
|
|
13893
13886
|
super();
|
|
@@ -13986,7 +13979,7 @@ class Do extends W {
|
|
|
13986
13979
|
throw new Error(
|
|
13987
13980
|
"editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false"
|
|
13988
13981
|
);
|
|
13989
|
-
this.dictionary = t.dictionary ||
|
|
13982
|
+
this.dictionary = t.dictionary || $t, this.settings = {
|
|
13990
13983
|
tables: {
|
|
13991
13984
|
splitCells: ((d = t == null ? void 0 : t.tables) == null ? void 0 : d.splitCells) ?? !1,
|
|
13992
13985
|
cellBackgroundColor: ((c = t == null ? void 0 : t.tables) == null ? void 0 : c.cellBackgroundColor) ?? !1,
|
|
@@ -14006,7 +13999,7 @@ class Do extends W {
|
|
|
14006
13999
|
};
|
|
14007
14000
|
if (n.comments && !n.resolveUsers)
|
|
14008
14001
|
throw new Error("resolveUsers is required when using comments");
|
|
14009
|
-
if (this.resolveUsers = n.resolveUsers, this.schema = n.schema, this.blockImplementations = n.schema.blockSpecs, this.inlineContentImplementations = n.schema.inlineContentSpecs, this.styleImplementations = n.schema.styleSpecs, this.extensions =
|
|
14002
|
+
if (this.resolveUsers = n.resolveUsers, this.schema = n.schema, this.blockImplementations = n.schema.blockSpecs, this.inlineContentImplementations = n.schema.inlineContentSpecs, this.styleImplementations = n.schema.styleSpecs, this.extensions = cs({
|
|
14010
14003
|
editor: this,
|
|
14011
14004
|
domAttributes: n.domAttributes || {},
|
|
14012
14005
|
blockSpecs: this.schema.blockSpecs,
|
|
@@ -14018,7 +14011,7 @@ class Do extends W {
|
|
|
14018
14011
|
setIdAttribute: n.setIdAttribute,
|
|
14019
14012
|
animations: n.animations ?? !0,
|
|
14020
14013
|
tableHandles: P("table", this),
|
|
14021
|
-
dropCursor: this.options.dropCursor ??
|
|
14014
|
+
dropCursor: this.options.dropCursor ?? Ii,
|
|
14022
14015
|
placeholders: n.placeholders,
|
|
14023
14016
|
tabBehavior: n.tabBehavior,
|
|
14024
14017
|
sideMenuDetection: n.sideMenuDetection || "viewport",
|
|
@@ -14079,7 +14072,7 @@ class Do extends W {
|
|
|
14079
14072
|
});
|
|
14080
14073
|
})
|
|
14081
14074
|
], l = {
|
|
14082
|
-
...
|
|
14075
|
+
...gs,
|
|
14083
14076
|
...n._tiptapOptions,
|
|
14084
14077
|
content: a,
|
|
14085
14078
|
extensions: s,
|
|
@@ -14098,16 +14091,16 @@ class Do extends W {
|
|
|
14098
14091
|
((w = (_ = n.domAttributes) == null ? void 0 : _.editor) == null ? void 0 : w.class) || ""
|
|
14099
14092
|
)
|
|
14100
14093
|
},
|
|
14101
|
-
transformPasted:
|
|
14094
|
+
transformPasted: hs
|
|
14102
14095
|
}
|
|
14103
14096
|
};
|
|
14104
|
-
this.headless ? this.pmSchema =
|
|
14097
|
+
this.headless ? this.pmSchema = Yo(l.extensions) : (this._tiptapEditor = Le.create(
|
|
14105
14098
|
l,
|
|
14106
14099
|
this.schema.styleSchema
|
|
14107
14100
|
), this.pmSchema = this._tiptapEditor.schema), this.emit("create");
|
|
14108
14101
|
}
|
|
14109
14102
|
static create(t = {}) {
|
|
14110
|
-
return new
|
|
14103
|
+
return new Ro(t);
|
|
14111
14104
|
}
|
|
14112
14105
|
/**
|
|
14113
14106
|
* Get the underlying prosemirror view
|
|
@@ -14175,7 +14168,7 @@ class Do extends W {
|
|
|
14175
14168
|
* matching block was found.
|
|
14176
14169
|
*/
|
|
14177
14170
|
getBlock(t) {
|
|
14178
|
-
return
|
|
14171
|
+
return Wr(this, t);
|
|
14179
14172
|
}
|
|
14180
14173
|
/**
|
|
14181
14174
|
* Gets a snapshot of the previous sibling of an existing block from the
|
|
@@ -14187,7 +14180,7 @@ class Do extends W {
|
|
|
14187
14180
|
* in the document.
|
|
14188
14181
|
*/
|
|
14189
14182
|
getPrevBlock(t) {
|
|
14190
|
-
return
|
|
14183
|
+
return Kr(this, t);
|
|
14191
14184
|
}
|
|
14192
14185
|
/**
|
|
14193
14186
|
* Gets a snapshot of the next sibling of an existing block from the editor.
|
|
@@ -14198,7 +14191,7 @@ class Do extends W {
|
|
|
14198
14191
|
* the document.
|
|
14199
14192
|
*/
|
|
14200
14193
|
getNextBlock(t) {
|
|
14201
|
-
return
|
|
14194
|
+
return qr(this, t);
|
|
14202
14195
|
}
|
|
14203
14196
|
/**
|
|
14204
14197
|
* Gets a snapshot of the parent of an existing block from the editor.
|
|
@@ -14208,7 +14201,7 @@ class Do extends W {
|
|
|
14208
14201
|
* if no matching block was found, or the block isn't nested.
|
|
14209
14202
|
*/
|
|
14210
14203
|
getParentBlock(t) {
|
|
14211
|
-
return
|
|
14204
|
+
return Xr(this, t);
|
|
14212
14205
|
}
|
|
14213
14206
|
/**
|
|
14214
14207
|
* Traverses all blocks in the editor depth-first, and executes a callback for each.
|
|
@@ -14253,7 +14246,7 @@ class Do extends W {
|
|
|
14253
14246
|
* @returns A snapshot of the current text cursor position.
|
|
14254
14247
|
*/
|
|
14255
14248
|
getTextCursorPosition() {
|
|
14256
|
-
return
|
|
14249
|
+
return Qr(this);
|
|
14257
14250
|
}
|
|
14258
14251
|
/**
|
|
14259
14252
|
* Sets the text cursor position to the start or end of an existing block. Throws an error if the target block could
|
|
@@ -14262,16 +14255,16 @@ class Do extends W {
|
|
|
14262
14255
|
* @param placement Whether the text cursor should be placed at the start or end of the block.
|
|
14263
14256
|
*/
|
|
14264
14257
|
setTextCursorPosition(t, i = "start") {
|
|
14265
|
-
|
|
14258
|
+
Eo(this, t, i);
|
|
14266
14259
|
}
|
|
14267
14260
|
/**
|
|
14268
14261
|
* Gets a snapshot of the current selection.
|
|
14269
14262
|
*/
|
|
14270
14263
|
getSelection() {
|
|
14271
|
-
return
|
|
14264
|
+
return Jr(this);
|
|
14272
14265
|
}
|
|
14273
14266
|
setSelection(t, i) {
|
|
14274
|
-
|
|
14267
|
+
Yr(this, t, i);
|
|
14275
14268
|
}
|
|
14276
14269
|
/**
|
|
14277
14270
|
* Checks if the editor is currently editable, or if it's locked.
|
|
@@ -14306,7 +14299,7 @@ class Do extends W {
|
|
|
14306
14299
|
* `referenceBlock`.
|
|
14307
14300
|
*/
|
|
14308
14301
|
insertBlocks(t, i, n = "before") {
|
|
14309
|
-
return
|
|
14302
|
+
return jr(this, t, i, n);
|
|
14310
14303
|
}
|
|
14311
14304
|
/**
|
|
14312
14305
|
* Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
|
|
@@ -14316,14 +14309,14 @@ class Do extends W {
|
|
|
14316
14309
|
* @param update A partial block which defines how the existing block should be changed.
|
|
14317
14310
|
*/
|
|
14318
14311
|
updateBlock(t, i) {
|
|
14319
|
-
return
|
|
14312
|
+
return gn(this, t, i);
|
|
14320
14313
|
}
|
|
14321
14314
|
/**
|
|
14322
14315
|
* Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
|
|
14323
14316
|
* @param blocksToRemove An array of identifiers for existing blocks that should be removed.
|
|
14324
14317
|
*/
|
|
14325
14318
|
removeBlocks(t) {
|
|
14326
|
-
return
|
|
14319
|
+
return Gr(this, t);
|
|
14327
14320
|
}
|
|
14328
14321
|
/**
|
|
14329
14322
|
* Replaces existing blocks in the editor with new blocks. If the blocks that should be removed are not adjacent or
|
|
@@ -14333,7 +14326,7 @@ class Do extends W {
|
|
|
14333
14326
|
* @param blocksToInsert An array of partial blocks to replace the old ones with.
|
|
14334
14327
|
*/
|
|
14335
14328
|
replaceBlocks(t, i) {
|
|
14336
|
-
return
|
|
14329
|
+
return $r(this, t, i);
|
|
14337
14330
|
}
|
|
14338
14331
|
/**
|
|
14339
14332
|
* Insert a piece of content at the current cursor position.
|
|
@@ -14346,7 +14339,7 @@ class Do extends W {
|
|
|
14346
14339
|
this.pmSchema,
|
|
14347
14340
|
this.schema.styleSchema
|
|
14348
14341
|
);
|
|
14349
|
-
|
|
14342
|
+
Zr(
|
|
14350
14343
|
{
|
|
14351
14344
|
from: this._tiptapEditor.state.selection.from,
|
|
14352
14345
|
to: this._tiptapEditor.state.selection.to
|
|
@@ -14448,25 +14441,25 @@ class Do extends W {
|
|
|
14448
14441
|
* Checks if the block containing the text cursor can be nested.
|
|
14449
14442
|
*/
|
|
14450
14443
|
canNestBlock() {
|
|
14451
|
-
return
|
|
14444
|
+
return zr(this);
|
|
14452
14445
|
}
|
|
14453
14446
|
/**
|
|
14454
14447
|
* Nests the block containing the text cursor into the block above it.
|
|
14455
14448
|
*/
|
|
14456
14449
|
nestBlock() {
|
|
14457
|
-
|
|
14450
|
+
xo(this);
|
|
14458
14451
|
}
|
|
14459
14452
|
/**
|
|
14460
14453
|
* Checks if the block containing the text cursor is nested.
|
|
14461
14454
|
*/
|
|
14462
14455
|
canUnnestBlock() {
|
|
14463
|
-
return
|
|
14456
|
+
return Fr(this);
|
|
14464
14457
|
}
|
|
14465
14458
|
/**
|
|
14466
14459
|
* Lifts the block containing the text cursor out of its parent.
|
|
14467
14460
|
*/
|
|
14468
14461
|
unnestBlock() {
|
|
14469
|
-
|
|
14462
|
+
Vr(this);
|
|
14470
14463
|
}
|
|
14471
14464
|
/**
|
|
14472
14465
|
* Moves the selected blocks up. If the previous block has children, moves
|
|
@@ -14474,7 +14467,7 @@ class Do extends W {
|
|
|
14474
14467
|
* current blocks share a common parent, moves them out of & before it.
|
|
14475
14468
|
*/
|
|
14476
14469
|
moveBlocksUp() {
|
|
14477
|
-
|
|
14470
|
+
Ur(this);
|
|
14478
14471
|
}
|
|
14479
14472
|
/**
|
|
14480
14473
|
* Moves the selected blocks down. If the next block has children, moves
|
|
@@ -14482,7 +14475,7 @@ class Do extends W {
|
|
|
14482
14475
|
* current blocks share a common parent, moves them out of & after it.
|
|
14483
14476
|
*/
|
|
14484
14477
|
moveBlocksDown() {
|
|
14485
|
-
|
|
14478
|
+
Hr(this);
|
|
14486
14479
|
}
|
|
14487
14480
|
/**
|
|
14488
14481
|
* Exports blocks into a simplified HTML string. To better conform to HTML standards, children of blocks which aren't list
|
|
@@ -14504,7 +14497,7 @@ class Do extends W {
|
|
|
14504
14497
|
* @returns The blocks, serialized as an HTML string.
|
|
14505
14498
|
*/
|
|
14506
14499
|
async blocksToFullHTML(t) {
|
|
14507
|
-
return
|
|
14500
|
+
return yn(this.pmSchema, this).serializeBlocks(t, {});
|
|
14508
14501
|
}
|
|
14509
14502
|
/**
|
|
14510
14503
|
* Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
|
|
@@ -14514,7 +14507,7 @@ class Do extends W {
|
|
|
14514
14507
|
* @returns The blocks parsed from the HTML string.
|
|
14515
14508
|
*/
|
|
14516
14509
|
async tryParseHTMLToBlocks(t) {
|
|
14517
|
-
return
|
|
14510
|
+
return To(
|
|
14518
14511
|
t,
|
|
14519
14512
|
this.schema.blockSchema,
|
|
14520
14513
|
this.schema.inlineContentSchema,
|
|
@@ -14529,7 +14522,7 @@ class Do extends W {
|
|
|
14529
14522
|
* @returns The blocks, serialized as a Markdown string.
|
|
14530
14523
|
*/
|
|
14531
14524
|
async blocksToMarkdownLossy(t = this.document) {
|
|
14532
|
-
return
|
|
14525
|
+
return oa(t, this.pmSchema, this, {});
|
|
14533
14526
|
}
|
|
14534
14527
|
/**
|
|
14535
14528
|
* Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
|
|
@@ -14539,7 +14532,7 @@ class Do extends W {
|
|
|
14539
14532
|
* @returns The blocks parsed from the Markdown string.
|
|
14540
14533
|
*/
|
|
14541
14534
|
async tryParseMarkdownToBlocks(t) {
|
|
14542
|
-
return
|
|
14535
|
+
return da(
|
|
14543
14536
|
t,
|
|
14544
14537
|
this.schema.blockSchema,
|
|
14545
14538
|
this.schema.inlineContentSchema,
|
|
@@ -14583,7 +14576,7 @@ class Do extends W {
|
|
|
14583
14576
|
if (this.headless)
|
|
14584
14577
|
return;
|
|
14585
14578
|
const n = (r) => {
|
|
14586
|
-
r.transaction.getMeta(
|
|
14579
|
+
r.transaction.getMeta(Ft) && !i || t(this);
|
|
14587
14580
|
};
|
|
14588
14581
|
return this._tiptapEditor.on("selectionUpdate", n), () => {
|
|
14589
14582
|
this._tiptapEditor.off("selectionUpdate", n);
|
|
@@ -14604,7 +14597,7 @@ class Do extends W {
|
|
|
14604
14597
|
if (!this.prosemirrorView)
|
|
14605
14598
|
return;
|
|
14606
14599
|
const t = (s = this.prosemirrorView) == null ? void 0 : s.state, { selection: i } = t, { ranges: n } = i, r = Math.min(...n.map((l) => l.$from.pos)), a = Math.max(...n.map((l) => l.$to.pos));
|
|
14607
|
-
if (
|
|
14600
|
+
if (Fe(i)) {
|
|
14608
14601
|
const l = this.prosemirrorView.nodeDOM(r);
|
|
14609
14602
|
if (l)
|
|
14610
14603
|
return l.getBoundingClientRect();
|
|
@@ -14755,19 +14748,25 @@ function bl(e) {
|
|
|
14755
14748
|
createStyleMapping: (o) => o
|
|
14756
14749
|
};
|
|
14757
14750
|
}
|
|
14758
|
-
let Be
|
|
14751
|
+
let Be;
|
|
14752
|
+
async function bs() {
|
|
14753
|
+
return Be || (Be = (async () => {
|
|
14754
|
+
const [e, o] = await Promise.all([
|
|
14755
|
+
import("emoji-mart"),
|
|
14756
|
+
// use a dynamic import to encourage bundle-splitting
|
|
14757
|
+
// and a smaller initial client bundle size
|
|
14758
|
+
import("@emoji-mart/data")
|
|
14759
|
+
]), t = "default" in e ? e.default : e, i = "default" in o ? o.default : o;
|
|
14760
|
+
return await t.init({ data: i }), { emojiMart: t, emojiData: i };
|
|
14761
|
+
})(), Be);
|
|
14762
|
+
}
|
|
14759
14763
|
async function kl(e, o) {
|
|
14760
14764
|
if (!Lr("text", e))
|
|
14761
14765
|
return [];
|
|
14762
|
-
|
|
14763
|
-
|
|
14764
|
-
|
|
14765
|
-
|
|
14766
|
-
}
|
|
14767
|
-
const t = (await Be).default;
|
|
14768
|
-
return (o.trim() === "" ? Object.values(t.emojis) : await Ve.SearchIndex.search(o)).map((n) => ({
|
|
14769
|
-
id: n.skins[0].native,
|
|
14770
|
-
onItemClick: () => e.insertInlineContent(n.skins[0].native + " ")
|
|
14766
|
+
const { emojiData: t, emojiMart: i } = await bs();
|
|
14767
|
+
return (o.trim() === "" ? Object.values(t.emojis) : await i.SearchIndex.search(o)).map((r) => ({
|
|
14768
|
+
id: r.skins[0].native,
|
|
14769
|
+
onItemClick: () => e.insertInlineContent(r.skins[0].native + " ")
|
|
14771
14770
|
}));
|
|
14772
14771
|
}
|
|
14773
14772
|
function _l(e, ...o) {
|
|
@@ -14781,7 +14780,7 @@ function _l(e, ...o) {
|
|
|
14781
14780
|
}
|
|
14782
14781
|
return t;
|
|
14783
14782
|
}
|
|
14784
|
-
function
|
|
14783
|
+
function Ve(e = "") {
|
|
14785
14784
|
return typeof e == "string" ? [
|
|
14786
14785
|
{
|
|
14787
14786
|
type: "text",
|
|
@@ -14792,9 +14791,9 @@ function ze(e = "") {
|
|
|
14792
14791
|
}
|
|
14793
14792
|
function se(e) {
|
|
14794
14793
|
var o, t, i, n, r;
|
|
14795
|
-
return typeof e == "string" ?
|
|
14794
|
+
return typeof e == "string" ? Ve(e) : Array.isArray(e) ? e.flatMap((a) => typeof a == "string" ? Ve(a) : ot(a) ? {
|
|
14796
14795
|
...a,
|
|
14797
|
-
content:
|
|
14796
|
+
content: Ve(a.content)
|
|
14798
14797
|
} : X(a) ? a : {
|
|
14799
14798
|
props: {},
|
|
14800
14799
|
...a,
|
|
@@ -14824,10 +14823,10 @@ function se(e) {
|
|
|
14824
14823
|
}
|
|
14825
14824
|
function wl(e, o) {
|
|
14826
14825
|
return o.map(
|
|
14827
|
-
(t) =>
|
|
14826
|
+
(t) => Do(e.blockSchema, t)
|
|
14828
14827
|
);
|
|
14829
14828
|
}
|
|
14830
|
-
function
|
|
14829
|
+
function Do(e, o) {
|
|
14831
14830
|
var n;
|
|
14832
14831
|
const t = e[o.type].content, i = {
|
|
14833
14832
|
id: "",
|
|
@@ -14866,7 +14865,7 @@ function Uo(e, o) {
|
|
|
14866
14865
|
return {
|
|
14867
14866
|
...i,
|
|
14868
14867
|
content: se(i.content),
|
|
14869
|
-
children: i.children.map((r) =>
|
|
14868
|
+
children: i.children.map((r) => Do(e, r))
|
|
14870
14869
|
};
|
|
14871
14870
|
}
|
|
14872
14871
|
function ks(e) {
|
|
@@ -14877,174 +14876,174 @@ function _s(e) {
|
|
|
14877
14876
|
ks(o);
|
|
14878
14877
|
}
|
|
14879
14878
|
export {
|
|
14880
|
-
|
|
14881
|
-
|
|
14879
|
+
In as AudioBlock,
|
|
14880
|
+
Ro as BlockNoteEditor,
|
|
14882
14881
|
Ce as BlockNoteSchema,
|
|
14883
14882
|
fl as COLORS_DARK_MODE_DEFAULT,
|
|
14884
14883
|
hl as COLORS_DEFAULT,
|
|
14885
|
-
|
|
14886
|
-
|
|
14884
|
+
An as CodeBlock,
|
|
14885
|
+
ja as DEFAULT_LINK_PROTOCOL,
|
|
14887
14886
|
il as EMPTY_CELL_HEIGHT,
|
|
14888
|
-
|
|
14887
|
+
fo as EMPTY_CELL_WIDTH,
|
|
14889
14888
|
gl as Exporter,
|
|
14890
|
-
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
|
|
14894
|
-
|
|
14895
|
-
|
|
14896
|
-
|
|
14897
|
-
|
|
14898
|
-
|
|
14899
|
-
|
|
14900
|
-
|
|
14901
|
-
|
|
14902
|
-
|
|
14903
|
-
|
|
14904
|
-
|
|
14905
|
-
|
|
14906
|
-
|
|
14907
|
-
|
|
14889
|
+
Sn as FILE_AUDIO_ICON_SVG,
|
|
14890
|
+
Cn as FILE_ICON_SVG,
|
|
14891
|
+
Hn as FILE_IMAGE_ICON_SVG,
|
|
14892
|
+
yr as FILE_VIDEO_ICON_SVG,
|
|
14893
|
+
Un as FileBlock,
|
|
14894
|
+
xa as FilePanelProsemirrorPlugin,
|
|
14895
|
+
Ca as FilePanelView,
|
|
14896
|
+
Ba as FormattingToolbarProsemirrorPlugin,
|
|
14897
|
+
Sa as FormattingToolbarView,
|
|
14898
|
+
To as HTMLToBlocks,
|
|
14899
|
+
Gn as ImageBlock,
|
|
14900
|
+
Pa as LinkToolbarProsemirrorPlugin,
|
|
14901
|
+
Zn as PageBreak,
|
|
14902
|
+
qa as SideMenuProsemirrorPlugin,
|
|
14903
|
+
Wa as SideMenuView,
|
|
14904
|
+
Ja as SuggestionMenuProseMirrorPlugin,
|
|
14905
|
+
os as TableHandlesProsemirrorPlugin,
|
|
14906
|
+
ts as TableHandlesView,
|
|
14908
14907
|
we as UniqueID,
|
|
14909
14908
|
H as UnreachableCaseError,
|
|
14910
|
-
|
|
14911
|
-
|
|
14909
|
+
Na as VALID_LINK_PROTOCOLS,
|
|
14910
|
+
Br as VideoBlock,
|
|
14912
14911
|
ks as addIdsToBlock,
|
|
14913
14912
|
_s as addIdsToBlocks,
|
|
14914
|
-
|
|
14915
|
-
|
|
14916
|
-
|
|
14917
|
-
|
|
14913
|
+
kt as addInlineContentAttributes,
|
|
14914
|
+
tn as addInlineContentKeyboardShortcuts,
|
|
14915
|
+
sn as addStyleAttributes,
|
|
14916
|
+
Qi as applyNonSelectableBlockFix,
|
|
14918
14917
|
Zs as assertEmpty,
|
|
14919
|
-
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14918
|
+
Bn as audioBlockConfig,
|
|
14919
|
+
Mn as audioParse,
|
|
14920
|
+
En as audioPropSchema,
|
|
14921
|
+
Tn as audioRender,
|
|
14923
14922
|
Ln as audioToExternalHTML,
|
|
14924
14923
|
ie as blockToNode,
|
|
14925
|
-
|
|
14924
|
+
oa as blocksToMarkdown,
|
|
14926
14925
|
Me as camelToDataKebab,
|
|
14927
14926
|
ll as checkBlockHasDefaultProp,
|
|
14928
|
-
|
|
14927
|
+
Ir as checkBlockIsDefaultType,
|
|
14929
14928
|
rl as checkBlockIsFileBlock,
|
|
14930
14929
|
sl as checkBlockIsFileBlockWithPlaceholder,
|
|
14931
14930
|
al as checkBlockIsFileBlockWithPreview,
|
|
14932
|
-
|
|
14931
|
+
Ar as checkBlockTypeHasDefaultProp,
|
|
14933
14932
|
P as checkDefaultBlockTypeInSchema,
|
|
14934
14933
|
Lr as checkDefaultInlineContentTypeInSchema,
|
|
14935
|
-
|
|
14936
|
-
|
|
14934
|
+
Nr as checkPageBreakBlocksInSchema,
|
|
14935
|
+
dt as cleanHTMLToMarkdown,
|
|
14937
14936
|
_l as combineByGroup,
|
|
14938
14937
|
Ae as contentNodeToInlineContent,
|
|
14939
|
-
|
|
14940
|
-
|
|
14938
|
+
qt as contentNodeToTableContent,
|
|
14939
|
+
vn as createAddFileButton,
|
|
14941
14940
|
ve as createBlockSpec,
|
|
14942
14941
|
J as createBlockSpecFromStronglyTypedTiptapNode,
|
|
14943
14942
|
$ as createDefaultBlockDOMOutputSpec,
|
|
14944
14943
|
Ne as createExternalHTMLExporter,
|
|
14945
|
-
|
|
14946
|
-
|
|
14947
|
-
|
|
14944
|
+
at as createFigureWithCaption,
|
|
14945
|
+
rt as createFileBlockWrapper,
|
|
14946
|
+
xn as createFileNameWithIcon,
|
|
14948
14947
|
Qs as createInlineContentSpec,
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
|
|
14948
|
+
nn as createInlineContentSpecFromTipTapNode,
|
|
14949
|
+
Wt as createInternalBlockSpec,
|
|
14950
|
+
yn as createInternalHTMLSerializer,
|
|
14951
|
+
on as createInternalInlineContentSpec,
|
|
14952
|
+
Zt as createInternalStyleSpec,
|
|
14954
14953
|
Re as createLinkWithCaption,
|
|
14955
|
-
|
|
14954
|
+
co as createResizableFileBlockWrapper,
|
|
14956
14955
|
G as createStronglyTypedTiptapNode,
|
|
14957
14956
|
el as createStyleSpec,
|
|
14958
14957
|
Q as createStyleSpecFromTipTapMark,
|
|
14959
14958
|
ml as createSuggestionMenu,
|
|
14960
14959
|
tl as customizeCodeBlock,
|
|
14961
|
-
|
|
14962
|
-
|
|
14963
|
-
|
|
14964
|
-
|
|
14965
|
-
|
|
14966
|
-
|
|
14960
|
+
Tr as defaultBlockSchema,
|
|
14961
|
+
go as defaultBlockSpecs,
|
|
14962
|
+
bt as defaultBlockToHTML,
|
|
14963
|
+
Je as defaultCodeBlockPropSchema,
|
|
14964
|
+
Mr as defaultInlineContentSchema,
|
|
14965
|
+
ko as defaultInlineContentSpecs,
|
|
14967
14966
|
B as defaultProps,
|
|
14968
14967
|
nl as defaultStyleSchema,
|
|
14969
|
-
|
|
14968
|
+
bo as defaultStyleSpecs,
|
|
14970
14969
|
ne as esmDependencies,
|
|
14971
|
-
|
|
14972
|
-
|
|
14973
|
-
|
|
14974
|
-
|
|
14975
|
-
|
|
14970
|
+
Nn as fileBlockConfig,
|
|
14971
|
+
Rn as fileParse,
|
|
14972
|
+
Pn as filePropSchema,
|
|
14973
|
+
jn as fileRender,
|
|
14974
|
+
Dn as fileToExternalHTML,
|
|
14976
14975
|
Ys as filenameFromURL,
|
|
14977
14976
|
cl as filterSuggestionItems,
|
|
14978
14977
|
K as formatKeyboardShortcut,
|
|
14979
|
-
|
|
14980
|
-
|
|
14978
|
+
Ea as formattingToolbarPluginKey,
|
|
14979
|
+
Yi as getBlockFromPos,
|
|
14981
14980
|
te as getBlockInfo,
|
|
14982
14981
|
_e as getBlockInfoFromResolvedPos,
|
|
14983
14982
|
y as getBlockInfoFromSelection,
|
|
14984
|
-
|
|
14985
|
-
|
|
14986
|
-
|
|
14983
|
+
tt as getBlockInfoWithManualOffset,
|
|
14984
|
+
cs as getBlockNoteExtensions,
|
|
14985
|
+
Kt as getBlockSchemaFromSpecs,
|
|
14987
14986
|
he as getColspan,
|
|
14988
14987
|
kl as getDefaultEmojiPickerItems,
|
|
14989
14988
|
dl as getDefaultSlashMenuItems,
|
|
14990
|
-
|
|
14991
|
-
|
|
14989
|
+
rn as getInlineContentParseRules,
|
|
14990
|
+
Xt as getInlineContentSchemaFromSpecs,
|
|
14992
14991
|
q as getNearestBlockPos,
|
|
14993
14992
|
R as getNodeById,
|
|
14994
14993
|
pl as getPageBreakSlashMenuItems,
|
|
14995
|
-
|
|
14996
|
-
|
|
14997
|
-
|
|
14998
|
-
|
|
14999
|
-
|
|
15000
|
-
|
|
15001
|
-
|
|
15002
|
-
|
|
15003
|
-
|
|
15004
|
-
|
|
15005
|
-
|
|
14994
|
+
en as getParseRules,
|
|
14995
|
+
Ge as getRowspan,
|
|
14996
|
+
ln as getStyleParseRules,
|
|
14997
|
+
Jt as getStyleSchemaFromSpecs,
|
|
14998
|
+
Vn as imageBlockConfig,
|
|
14999
|
+
Fn as imageParse,
|
|
15000
|
+
On as imagePropSchema,
|
|
15001
|
+
zn as imageRender,
|
|
15002
|
+
$n as imageToExternalHTML,
|
|
15003
|
+
Gt as inheritedProps,
|
|
15004
|
+
lt as initializeESMDependencies,
|
|
15006
15005
|
D as inlineContentToNodes,
|
|
15007
|
-
|
|
15008
|
-
|
|
15009
|
-
|
|
15010
|
-
|
|
15006
|
+
L as insertOrUpdateBlock,
|
|
15007
|
+
Ji as isAppleOS,
|
|
15008
|
+
gt as isLinkInlineContent,
|
|
15009
|
+
ot as isPartialLinkInlineContent,
|
|
15011
15010
|
me as isPartialTableCell,
|
|
15012
15011
|
Js as isSafari,
|
|
15013
15012
|
X as isStyledTextInlineContent,
|
|
15014
|
-
|
|
15015
|
-
|
|
15016
|
-
|
|
15013
|
+
it as isTableCell,
|
|
15014
|
+
Et as isTableCellSelection,
|
|
15015
|
+
Aa as linkToolbarPluginKey,
|
|
15017
15016
|
Xs as locales,
|
|
15018
|
-
|
|
15017
|
+
$e as mapTableCell,
|
|
15019
15018
|
bl as mappingFactory,
|
|
15020
|
-
|
|
15019
|
+
da as markdownToBlocks,
|
|
15021
15020
|
Z as mergeCSSClasses,
|
|
15022
15021
|
x as nodeToBlock,
|
|
15023
|
-
|
|
15024
|
-
|
|
15025
|
-
|
|
15026
|
-
|
|
15027
|
-
|
|
15028
|
-
|
|
15029
|
-
|
|
15022
|
+
We as nodeToCustomInlineContent,
|
|
15023
|
+
Wn as pageBreakConfig,
|
|
15024
|
+
qn as pageBreakParse,
|
|
15025
|
+
Kn as pageBreakRender,
|
|
15026
|
+
_o as pageBreakSchema,
|
|
15027
|
+
Xn as pageBreakToExternalHTML,
|
|
15028
|
+
Ct as parseEmbedElement,
|
|
15030
15029
|
je as parseFigureElement,
|
|
15031
|
-
|
|
15030
|
+
Do as partialBlockToBlockForTesting,
|
|
15032
15031
|
wl as partialBlocksToBlocksForTesting,
|
|
15033
15032
|
ye as propsToAttributes,
|
|
15034
15033
|
Ue as shikiHighlighterPromiseSymbol,
|
|
15035
|
-
|
|
15036
|
-
|
|
15037
|
-
|
|
15034
|
+
vt as shikiParserSymbol,
|
|
15035
|
+
Ka as sideMenuPluginKey,
|
|
15036
|
+
an as stylePropsToAttributes,
|
|
15038
15037
|
Pe as tableContentToNodes,
|
|
15039
15038
|
pe as tableHandlesPluginKey,
|
|
15040
|
-
|
|
15039
|
+
gn as updateBlock,
|
|
15041
15040
|
M as updateBlockCommand,
|
|
15042
15041
|
ol as uploadToTmpFilesDotOrg_DEV_ONLY,
|
|
15043
|
-
|
|
15044
|
-
|
|
15045
|
-
|
|
15046
|
-
|
|
15047
|
-
|
|
15042
|
+
Cr as videoBlockConfig,
|
|
15043
|
+
Sr as videoParse,
|
|
15044
|
+
vr as videoPropSchema,
|
|
15045
|
+
xr as videoRender,
|
|
15046
|
+
Er as videoToExternalHTML,
|
|
15048
15047
|
ul as withPageBreak,
|
|
15049
15048
|
xe as wrapInBlockStructure
|
|
15050
15049
|
};
|