@blocknote/core 0.25.0 → 0.25.2
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 +8 -8
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +914 -921
- package/dist/blocknote.js.map +1 -1
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.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/api/nodeConversions/nodeToBlock.ts +2 -2
- package/src/comments/threadstore/ThreadStore.ts +1 -1
- package/src/editor/BlockNoteEditor.ts +0 -6
- package/src/editor/editor.css +6 -4
- package/src/extensions/Collaboration/createCollaborationExtensions.ts +8 -17
- package/src/extensions/Comments/CommentMark.ts +0 -1
- package/src/extensions/Comments/CommentsPlugin.ts +3 -1
- package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +34 -17
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +1 -3
- package/types/src/blocks/CodeBlockContent/shiki.bundle.d.ts +82 -0
- package/types/src/comments/threadstore/ThreadStore.d.ts +1 -1
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,8 +6908,8 @@ function ve(e, o) {
|
|
|
6908
6908
|
}
|
|
6909
6909
|
});
|
|
6910
6910
|
}
|
|
6911
|
-
function
|
|
6912
|
-
var r;
|
|
6911
|
+
function qt(e, o, t) {
|
|
6912
|
+
var r, a;
|
|
6913
6913
|
const i = {
|
|
6914
6914
|
type: "tableContent",
|
|
6915
6915
|
columnWidths: [],
|
|
@@ -6917,37 +6917,37 @@ function Xt(e, o, t) {
|
|
|
6917
6917
|
headerCols: void 0,
|
|
6918
6918
|
rows: []
|
|
6919
6919
|
}, n = [];
|
|
6920
|
-
e.content.forEach((
|
|
6921
|
-
const
|
|
6920
|
+
e.content.forEach((s, l, d) => {
|
|
6921
|
+
const c = {
|
|
6922
6922
|
cells: []
|
|
6923
6923
|
};
|
|
6924
|
-
|
|
6925
|
-
let
|
|
6926
|
-
|
|
6927
|
-
}),
|
|
6924
|
+
d === 0 && s.content.forEach((u) => {
|
|
6925
|
+
let m = u.attrs.colwidth;
|
|
6926
|
+
m == null && (m = new Array(u.attrs.colspan ?? 1).fill(void 0)), i.columnWidths.push(...m);
|
|
6927
|
+
}), c.cells = s.content.content.map((u, m) => (n[d] || (n[d] = []), n[d][m] = u.type.name === "tableHeader", {
|
|
6928
6928
|
type: "tableCell",
|
|
6929
|
-
content:
|
|
6930
|
-
(
|
|
6931
|
-
).reduce((
|
|
6932
|
-
if (!
|
|
6933
|
-
return
|
|
6934
|
-
const
|
|
6935
|
-
return X(
|
|
6936
|
-
` +
|
|
6929
|
+
content: u.content.content.map(
|
|
6930
|
+
(g) => Ae(g, o, t)
|
|
6931
|
+
).reduce((g, f) => {
|
|
6932
|
+
if (!g.length)
|
|
6933
|
+
return f;
|
|
6934
|
+
const b = g[g.length - 1], k = f[0];
|
|
6935
|
+
return X(b) && X(k) && JSON.stringify(b.styles) === JSON.stringify(k.styles) ? (b.text += `
|
|
6936
|
+
` + k.text, g.push(...f.slice(1)), g) : (g.push(...f), g);
|
|
6937
6937
|
}, []),
|
|
6938
6938
|
props: {
|
|
6939
|
-
colspan:
|
|
6940
|
-
rowspan:
|
|
6941
|
-
backgroundColor:
|
|
6942
|
-
textColor:
|
|
6943
|
-
textAlignment:
|
|
6939
|
+
colspan: u.attrs.colspan,
|
|
6940
|
+
rowspan: u.attrs.rowspan,
|
|
6941
|
+
backgroundColor: u.attrs.backgroundColor,
|
|
6942
|
+
textColor: u.attrs.textColor,
|
|
6943
|
+
textAlignment: u.attrs.textAlignment
|
|
6944
6944
|
}
|
|
6945
|
-
})), i.rows.push(
|
|
6945
|
+
})), i.rows.push(c);
|
|
6946
6946
|
});
|
|
6947
|
-
for (let
|
|
6948
|
-
n[
|
|
6949
|
-
for (let
|
|
6950
|
-
n.every((
|
|
6947
|
+
for (let s = 0; s < n.length; s++)
|
|
6948
|
+
(r = n[s]) != null && r.every((l) => l) && (i.headerRows = (i.headerRows ?? 0) + 1);
|
|
6949
|
+
for (let s = 0; s < ((a = n[0]) == null ? void 0 : a.length); s++)
|
|
6950
|
+
n != null && n.every((l) => l[s]) && (i.headerCols = (i.headerCols ?? 0) + 1);
|
|
6951
6951
|
return i;
|
|
6952
6952
|
}
|
|
6953
6953
|
function Ae(e, o, t) {
|
|
@@ -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,61 +11038,52 @@ 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,
|
|
11093
11086
|
keepOnSplit: !0,
|
|
11094
|
-
group: "blocknoteIgnore",
|
|
11095
|
-
// ignore in blocknote json
|
|
11096
11087
|
addAttributes() {
|
|
11097
11088
|
return {
|
|
11098
11089
|
// orphans are marks that currently don't have an active thread. It could be
|
|
@@ -11118,7 +11109,7 @@ const It = () => {
|
|
|
11118
11109
|
renderHTML({ HTMLAttributes: e }) {
|
|
11119
11110
|
return [
|
|
11120
11111
|
"span",
|
|
11121
|
-
|
|
11112
|
+
qo(e, {
|
|
11122
11113
|
class: "bn-thread-mark"
|
|
11123
11114
|
})
|
|
11124
11115
|
];
|
|
@@ -11152,7 +11143,7 @@ class W {
|
|
|
11152
11143
|
this.callbacks = {};
|
|
11153
11144
|
}
|
|
11154
11145
|
}
|
|
11155
|
-
class
|
|
11146
|
+
class _a extends W {
|
|
11156
11147
|
constructor(t) {
|
|
11157
11148
|
super();
|
|
11158
11149
|
p(this, "userCache", /* @__PURE__ */ new Map());
|
|
@@ -11199,8 +11190,8 @@ class wa extends W {
|
|
|
11199
11190
|
return this.on("update", t);
|
|
11200
11191
|
}
|
|
11201
11192
|
}
|
|
11202
|
-
const Se = new A("blocknote-comments"),
|
|
11203
|
-
function
|
|
11193
|
+
const Se = new A("blocknote-comments"), wa = "SET_SELECTED_THREAD_ID";
|
|
11194
|
+
function ya(e, o, t) {
|
|
11204
11195
|
const i = /* @__PURE__ */ new Map(), n = [];
|
|
11205
11196
|
return e.descendants((r, a) => {
|
|
11206
11197
|
r.marks.forEach((s) => {
|
|
@@ -11227,7 +11218,7 @@ function va(e, o, t) {
|
|
|
11227
11218
|
threadPositions: i
|
|
11228
11219
|
};
|
|
11229
11220
|
}
|
|
11230
|
-
class
|
|
11221
|
+
class va extends W {
|
|
11231
11222
|
constructor(t, i, n) {
|
|
11232
11223
|
super();
|
|
11233
11224
|
p(this, "plugin");
|
|
@@ -11263,7 +11254,7 @@ class Ca extends W {
|
|
|
11263
11254
|
});
|
|
11264
11255
|
if (this.editor = t, this.threadStore = i, this.markType = n, !t.resolveUsers)
|
|
11265
11256
|
throw new Error("resolveUsers is required for comments");
|
|
11266
|
-
this.userStore = new
|
|
11257
|
+
this.userStore = new _a(t.resolveUsers), this.threadStore.subscribe(this.updateMarksFromThreads), t.onCreate(() => {
|
|
11267
11258
|
this.updateMarksFromThreads(this.threadStore.getThreads()), t.onSelectionChange(() => {
|
|
11268
11259
|
this.pendingComment && (this.pendingComment = !1, this.emitStateUpdate());
|
|
11269
11260
|
});
|
|
@@ -11280,7 +11271,7 @@ class Ca extends W {
|
|
|
11280
11271
|
},
|
|
11281
11272
|
apply(a, s) {
|
|
11282
11273
|
const l = a.getMeta(Se);
|
|
11283
|
-
return !a.docChanged && !l ? s :
|
|
11274
|
+
return !a.docChanged && !l ? s : ya(a.doc, r.selectedThreadId, n);
|
|
11284
11275
|
}
|
|
11285
11276
|
},
|
|
11286
11277
|
props: {
|
|
@@ -11325,7 +11316,7 @@ class Ca extends W {
|
|
|
11325
11316
|
selectThread(t) {
|
|
11326
11317
|
this.selectedThreadId !== t && (this.selectedThreadId = t, this.emitStateUpdate(), this.editor.dispatch(
|
|
11327
11318
|
this.editor.prosemirrorView.state.tr.setMeta(Se, {
|
|
11328
|
-
name:
|
|
11319
|
+
name: wa
|
|
11329
11320
|
})
|
|
11330
11321
|
));
|
|
11331
11322
|
}
|
|
@@ -11347,12 +11338,13 @@ class Ca extends W {
|
|
|
11347
11338
|
async createThread(t) {
|
|
11348
11339
|
const i = await this.threadStore.createThread(t);
|
|
11349
11340
|
if (this.threadStore.addThreadToDocument) {
|
|
11350
|
-
const n = this.editor.prosemirrorView, r = n.state.selection, a =
|
|
11341
|
+
const n = this.editor.prosemirrorView, r = n.state.selection, a = Ft.getState(n.state), s = {
|
|
11351
11342
|
prosemirror: {
|
|
11352
11343
|
head: r.head,
|
|
11353
11344
|
anchor: r.anchor
|
|
11354
11345
|
},
|
|
11355
|
-
yjs: Li(a.binding, n.state)
|
|
11346
|
+
yjs: a ? Li(a.binding, n.state) : void 0
|
|
11347
|
+
// if we're not using yjs
|
|
11356
11348
|
};
|
|
11357
11349
|
await this.threadStore.addThreadToDocument({
|
|
11358
11350
|
threadId: i.id,
|
|
@@ -11365,7 +11357,7 @@ class Ca extends W {
|
|
|
11365
11357
|
});
|
|
11366
11358
|
}
|
|
11367
11359
|
}
|
|
11368
|
-
class
|
|
11360
|
+
class Ca {
|
|
11369
11361
|
constructor(o, t, i, n) {
|
|
11370
11362
|
p(this, "state");
|
|
11371
11363
|
p(this, "emitUpdate");
|
|
@@ -11422,7 +11414,7 @@ class xa {
|
|
|
11422
11414
|
}
|
|
11423
11415
|
}
|
|
11424
11416
|
const Oe = new A("FilePanelPlugin");
|
|
11425
|
-
class
|
|
11417
|
+
class xa extends W {
|
|
11426
11418
|
constructor(t) {
|
|
11427
11419
|
super();
|
|
11428
11420
|
p(this, "view");
|
|
@@ -11433,7 +11425,7 @@ class Sa extends W {
|
|
|
11433
11425
|
});
|
|
11434
11426
|
this.plugin = new T({
|
|
11435
11427
|
key: Oe,
|
|
11436
|
-
view: (i) => (this.view = new
|
|
11428
|
+
view: (i) => (this.view = new Ca(
|
|
11437
11429
|
t,
|
|
11438
11430
|
Oe,
|
|
11439
11431
|
i,
|
|
@@ -11468,15 +11460,15 @@ class Sa extends W {
|
|
|
11468
11460
|
return this.on("update", t);
|
|
11469
11461
|
}
|
|
11470
11462
|
}
|
|
11471
|
-
class
|
|
11463
|
+
class Sa {
|
|
11472
11464
|
constructor(o, t, i) {
|
|
11473
11465
|
p(this, "state");
|
|
11474
11466
|
p(this, "emitUpdate");
|
|
11475
11467
|
p(this, "preventHide", !1);
|
|
11476
11468
|
p(this, "preventShow", !1);
|
|
11477
11469
|
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 ||
|
|
11470
|
+
const { doc: n, selection: r } = o, { empty: a } = r, s = !n.textBetween(t, i).length && Ot(o.selection);
|
|
11471
|
+
return r.$from.parent.type.spec.code || Fe(r) && r.node.type.spec.code ? !1 : !(a || s);
|
|
11480
11472
|
});
|
|
11481
11473
|
p(this, "blurHandler", (o) => {
|
|
11482
11474
|
var i;
|
|
@@ -11546,7 +11538,7 @@ class Ea {
|
|
|
11546
11538
|
}
|
|
11547
11539
|
getSelectionBoundingBox() {
|
|
11548
11540
|
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 (
|
|
11541
|
+
if (Fe(t)) {
|
|
11550
11542
|
const a = this.pmView.nodeDOM(n);
|
|
11551
11543
|
if (a)
|
|
11552
11544
|
return a.getBoundingClientRect();
|
|
@@ -11554,18 +11546,18 @@ class Ea {
|
|
|
11554
11546
|
return Te(this.pmView, n, r);
|
|
11555
11547
|
}
|
|
11556
11548
|
}
|
|
11557
|
-
const
|
|
11549
|
+
const Ea = new A(
|
|
11558
11550
|
"FormattingToolbarPlugin"
|
|
11559
11551
|
);
|
|
11560
|
-
class
|
|
11552
|
+
class Ba extends W {
|
|
11561
11553
|
constructor(t) {
|
|
11562
11554
|
super();
|
|
11563
11555
|
p(this, "view");
|
|
11564
11556
|
p(this, "plugin");
|
|
11565
11557
|
p(this, "closeMenu", () => this.view.closeMenu());
|
|
11566
11558
|
this.plugin = new T({
|
|
11567
|
-
key:
|
|
11568
|
-
view: (i) => (this.view = new
|
|
11559
|
+
key: Ea,
|
|
11560
|
+
view: (i) => (this.view = new Sa(t, i, (n) => {
|
|
11569
11561
|
this.emit("update", n);
|
|
11570
11562
|
}), this.view),
|
|
11571
11563
|
props: {
|
|
@@ -11581,7 +11573,7 @@ class Ta extends W {
|
|
|
11581
11573
|
return this.on("update", t);
|
|
11582
11574
|
}
|
|
11583
11575
|
}
|
|
11584
|
-
const
|
|
11576
|
+
const It = (e, o) => {
|
|
11585
11577
|
const t = e.resolve(o);
|
|
11586
11578
|
if (t.depth <= 1)
|
|
11587
11579
|
return;
|
|
@@ -11592,7 +11584,7 @@ const At = (e, o) => {
|
|
|
11592
11584
|
return _e(
|
|
11593
11585
|
e.resolve(i)
|
|
11594
11586
|
);
|
|
11595
|
-
},
|
|
11587
|
+
}, Qe = (e, o) => {
|
|
11596
11588
|
const t = e.resolve(o), i = t.index();
|
|
11597
11589
|
if (i === 0)
|
|
11598
11590
|
return;
|
|
@@ -11600,13 +11592,13 @@ const At = (e, o) => {
|
|
|
11600
11592
|
return _e(
|
|
11601
11593
|
e.resolve(n)
|
|
11602
11594
|
);
|
|
11603
|
-
},
|
|
11595
|
+
}, Po = (e, o) => {
|
|
11604
11596
|
for (; o.childContainer; ) {
|
|
11605
11597
|
const t = o.childContainer.node, i = e.resolve(o.childContainer.beforePos + 1).posAtIndex(t.childCount - 1);
|
|
11606
11598
|
o = _e(e.resolve(i));
|
|
11607
11599
|
}
|
|
11608
11600
|
return o;
|
|
11609
|
-
},
|
|
11601
|
+
}, 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
11602
|
if (!i.isBlockContainer)
|
|
11611
11603
|
throw new Error(
|
|
11612
11604
|
`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 +11627,21 @@ const At = (e, o) => {
|
|
|
11635
11627
|
);
|
|
11636
11628
|
}
|
|
11637
11629
|
return !0;
|
|
11638
|
-
},
|
|
11630
|
+
}, At = (e) => ({
|
|
11639
11631
|
state: o,
|
|
11640
11632
|
dispatch: t
|
|
11641
11633
|
}) => {
|
|
11642
|
-
const i = o.doc.resolve(e), n = _e(i), r =
|
|
11634
|
+
const i = o.doc.resolve(e), n = _e(i), r = Qe(
|
|
11643
11635
|
o.doc,
|
|
11644
11636
|
n.bnBlock.beforePos
|
|
11645
11637
|
);
|
|
11646
11638
|
if (!r)
|
|
11647
11639
|
return !1;
|
|
11648
|
-
const a =
|
|
11640
|
+
const a = Po(
|
|
11649
11641
|
o.doc,
|
|
11650
11642
|
r
|
|
11651
11643
|
);
|
|
11652
|
-
return
|
|
11644
|
+
return Ta(a, n) ? Ma(o, t, a, n) : !1;
|
|
11653
11645
|
}, La = j.create({
|
|
11654
11646
|
priority: 50,
|
|
11655
11647
|
// TODO: The shortcuts need a refactor. Do we want to use a command priority
|
|
@@ -11693,22 +11685,22 @@ const At = (e, o) => {
|
|
|
11693
11685
|
if (!a.isBlockContainer)
|
|
11694
11686
|
return !1;
|
|
11695
11687
|
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(
|
|
11688
|
+
return d && c ? i().command(At(u)).scrollIntoView().run() : !1;
|
|
11697
11689
|
}),
|
|
11698
11690
|
() => n.command(({ state: r, dispatch: a }) => {
|
|
11699
11691
|
const s = y(r);
|
|
11700
|
-
if (!s.isBlockContainer || !(r.selection.from === s.blockContent.beforePos + 1) ||
|
|
11692
|
+
if (!s.isBlockContainer || !(r.selection.from === s.blockContent.beforePos + 1) || Qe(
|
|
11701
11693
|
r.doc,
|
|
11702
11694
|
s.bnBlock.beforePos
|
|
11703
11695
|
))
|
|
11704
11696
|
return !1;
|
|
11705
|
-
const c =
|
|
11697
|
+
const c = It(
|
|
11706
11698
|
r.doc,
|
|
11707
11699
|
s.bnBlock.beforePos
|
|
11708
11700
|
);
|
|
11709
11701
|
if ((c == null ? void 0 : c.blockNoteType) !== "column")
|
|
11710
11702
|
return !1;
|
|
11711
|
-
const u = c, m =
|
|
11703
|
+
const u = c, m = It(
|
|
11712
11704
|
r.doc,
|
|
11713
11705
|
u.bnBlock.beforePos
|
|
11714
11706
|
);
|
|
@@ -11724,7 +11716,7 @@ const At = (e, o) => {
|
|
|
11724
11716
|
if (g)
|
|
11725
11717
|
if (f) {
|
|
11726
11718
|
r.tr.step(
|
|
11727
|
-
new
|
|
11719
|
+
new ze(
|
|
11728
11720
|
// replace entire column list
|
|
11729
11721
|
m.bnBlock.beforePos,
|
|
11730
11722
|
m.bnBlock.afterPos,
|
|
@@ -11741,7 +11733,7 @@ const At = (e, o) => {
|
|
|
11741
11733
|
r.tr.setSelection(V.between(k, k));
|
|
11742
11734
|
} else {
|
|
11743
11735
|
r.tr.step(
|
|
11744
|
-
new
|
|
11736
|
+
new ze(
|
|
11745
11737
|
// replace entire column list
|
|
11746
11738
|
m.bnBlock.beforePos,
|
|
11747
11739
|
m.bnBlock.afterPos,
|
|
@@ -11801,12 +11793,12 @@ const At = (e, o) => {
|
|
|
11801
11793
|
const a = y(r);
|
|
11802
11794
|
if (!a.isBlockContainer)
|
|
11803
11795
|
throw new Error("todo");
|
|
11804
|
-
const s = r.selection.from === a.blockContent.beforePos + 1, l = r.selection.empty, d =
|
|
11796
|
+
const s = r.selection.from === a.blockContent.beforePos + 1, l = r.selection.empty, d = Qe(
|
|
11805
11797
|
r.doc,
|
|
11806
11798
|
a.bnBlock.beforePos
|
|
11807
11799
|
);
|
|
11808
11800
|
if (d && s && l) {
|
|
11809
|
-
const c =
|
|
11801
|
+
const c = Po(
|
|
11810
11802
|
r.doc,
|
|
11811
11803
|
d
|
|
11812
11804
|
);
|
|
@@ -11846,7 +11838,7 @@ const At = (e, o) => {
|
|
|
11846
11838
|
let g = d, f = a.afterPos + 1, b = n.doc.resolve(f).depth;
|
|
11847
11839
|
for (; b < g; )
|
|
11848
11840
|
g = b, f += 2, b = n.doc.resolve(f).depth;
|
|
11849
|
-
return i.command(
|
|
11841
|
+
return i.command(At(f - 1));
|
|
11850
11842
|
}
|
|
11851
11843
|
return !1;
|
|
11852
11844
|
})
|
|
@@ -11888,7 +11880,7 @@ const At = (e, o) => {
|
|
|
11888
11880
|
return !1;
|
|
11889
11881
|
const { blockContent: s } = a, l = n.selection.$anchor.parentOffset === 0;
|
|
11890
11882
|
return s.node.childCount === 0 ? !1 : (r().deleteSelection().command(
|
|
11891
|
-
|
|
11883
|
+
po(
|
|
11892
11884
|
n.selection.from,
|
|
11893
11885
|
l,
|
|
11894
11886
|
l
|
|
@@ -11900,7 +11892,7 @@ const At = (e, o) => {
|
|
|
11900
11892
|
// editor since the browser will try to use tab for keyboard navigation.
|
|
11901
11893
|
Tab: () => {
|
|
11902
11894
|
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 :
|
|
11895
|
+
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
11896
|
},
|
|
11905
11897
|
"Shift-Tab": () => {
|
|
11906
11898
|
var i, n, r;
|
|
@@ -11911,7 +11903,7 @@ const At = (e, o) => {
|
|
|
11911
11903
|
};
|
|
11912
11904
|
}
|
|
11913
11905
|
});
|
|
11914
|
-
class
|
|
11906
|
+
class Ia {
|
|
11915
11907
|
constructor(o, t, i) {
|
|
11916
11908
|
p(this, "state");
|
|
11917
11909
|
p(this, "emitUpdate");
|
|
@@ -11929,7 +11921,7 @@ class Aa {
|
|
|
11929
11921
|
const t = o.target, i = this.pmView.posAtDOM(t, 0) + 1, n = this.pmView.state.doc.resolve(i), r = n.marks();
|
|
11930
11922
|
for (const a of r)
|
|
11931
11923
|
if (a.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
11932
|
-
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange =
|
|
11924
|
+
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = pt(n, a.type, a.attrs) || void 0;
|
|
11933
11925
|
break;
|
|
11934
11926
|
}
|
|
11935
11927
|
}
|
|
@@ -12002,7 +11994,7 @@ class Aa {
|
|
|
12002
11994
|
const l = this.pmView.state.selection.$from.marks();
|
|
12003
11995
|
for (const d of l)
|
|
12004
11996
|
if (d.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
12005
|
-
this.keyboardHoveredLinkMark = d, this.keyboardHoveredLinkMarkRange =
|
|
11997
|
+
this.keyboardHoveredLinkMark = d, this.keyboardHoveredLinkMarkRange = pt(
|
|
12006
11998
|
this.pmView.state.selection.$from,
|
|
12007
11999
|
d.type,
|
|
12008
12000
|
d.attrs
|
|
@@ -12039,8 +12031,8 @@ class Aa {
|
|
|
12039
12031
|
);
|
|
12040
12032
|
}
|
|
12041
12033
|
}
|
|
12042
|
-
const
|
|
12043
|
-
class
|
|
12034
|
+
const Aa = new A("LinkToolbarPlugin");
|
|
12035
|
+
class Pa extends W {
|
|
12044
12036
|
constructor(t) {
|
|
12045
12037
|
super();
|
|
12046
12038
|
p(this, "view");
|
|
@@ -12079,8 +12071,8 @@ class Na extends W {
|
|
|
12079
12071
|
});
|
|
12080
12072
|
p(this, "closeMenu", () => this.view.closeMenu());
|
|
12081
12073
|
this.plugin = new T({
|
|
12082
|
-
key:
|
|
12083
|
-
view: (i) => (this.view = new
|
|
12074
|
+
key: Aa,
|
|
12075
|
+
view: (i) => (this.view = new Ia(t, i, (n) => {
|
|
12084
12076
|
this.emit("update", n);
|
|
12085
12077
|
}), this.view),
|
|
12086
12078
|
props: {
|
|
@@ -12096,7 +12088,7 @@ class Na extends W {
|
|
|
12096
12088
|
return ((i = (t = this.view) == null ? void 0 : t.state) == null ? void 0 : i.show) || !1;
|
|
12097
12089
|
}
|
|
12098
12090
|
}
|
|
12099
|
-
const
|
|
12091
|
+
const Na = [
|
|
12100
12092
|
"http",
|
|
12101
12093
|
"https",
|
|
12102
12094
|
"ftp",
|
|
@@ -12107,12 +12099,12 @@ const ja = [
|
|
|
12107
12099
|
"sms",
|
|
12108
12100
|
"cid",
|
|
12109
12101
|
"xmpp"
|
|
12110
|
-
],
|
|
12111
|
-
class
|
|
12102
|
+
], ja = "https", Ra = new A("node-selection-keyboard");
|
|
12103
|
+
class Da {
|
|
12112
12104
|
constructor() {
|
|
12113
12105
|
p(this, "plugin");
|
|
12114
12106
|
this.plugin = new T({
|
|
12115
|
-
key:
|
|
12107
|
+
key: Ra,
|
|
12116
12108
|
props: {
|
|
12117
12109
|
handleKeyDown: (o, t) => {
|
|
12118
12110
|
if ("node" in o.state.selection) {
|
|
@@ -12140,15 +12132,15 @@ class Ua {
|
|
|
12140
12132
|
});
|
|
12141
12133
|
}
|
|
12142
12134
|
}
|
|
12143
|
-
const
|
|
12144
|
-
class
|
|
12135
|
+
const Ua = new A("blocknote-placeholder");
|
|
12136
|
+
class Ha {
|
|
12145
12137
|
constructor(o, t) {
|
|
12146
12138
|
p(this, "plugin");
|
|
12147
12139
|
this.plugin = new T({
|
|
12148
|
-
key:
|
|
12140
|
+
key: Ua,
|
|
12149
12141
|
view: (i) => {
|
|
12150
12142
|
var d, c;
|
|
12151
|
-
const n = `placeholder-selector-${
|
|
12143
|
+
const n = `placeholder-selector-${Vt()}`;
|
|
12152
12144
|
i.dom.classList.add(n);
|
|
12153
12145
|
const r = document.createElement("style"), a = o._tiptapEditor.options.injectNonce;
|
|
12154
12146
|
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 +12208,7 @@ class Oa {
|
|
|
12216
12208
|
});
|
|
12217
12209
|
}
|
|
12218
12210
|
}
|
|
12219
|
-
const
|
|
12211
|
+
const Pt = new A("previous-blocks"), Oa = {
|
|
12220
12212
|
// Numbered List Items
|
|
12221
12213
|
index: "index",
|
|
12222
12214
|
// Headings
|
|
@@ -12226,19 +12218,19 @@ const Nt = new A("previous-blocks"), Va = {
|
|
|
12226
12218
|
depth: "depth",
|
|
12227
12219
|
"depth-change": "depth-change"
|
|
12228
12220
|
};
|
|
12229
|
-
class
|
|
12221
|
+
class Va {
|
|
12230
12222
|
constructor() {
|
|
12231
12223
|
p(this, "plugin");
|
|
12232
12224
|
let o;
|
|
12233
12225
|
this.plugin = new T({
|
|
12234
|
-
key:
|
|
12226
|
+
key: Pt,
|
|
12235
12227
|
view(t) {
|
|
12236
12228
|
return {
|
|
12237
12229
|
update: async (i, n) => {
|
|
12238
12230
|
var r;
|
|
12239
12231
|
((r = this.key) == null ? void 0 : r.getState(i.state).updatedBlocks.size) > 0 && (o = setTimeout(() => {
|
|
12240
12232
|
i.dispatch(
|
|
12241
|
-
i.state.tr.setMeta(
|
|
12233
|
+
i.state.tr.setMeta(Pt, { clearUpdate: !0 })
|
|
12242
12234
|
);
|
|
12243
12235
|
}, 0));
|
|
12244
12236
|
},
|
|
@@ -12261,9 +12253,9 @@ class za {
|
|
|
12261
12253
|
apply(t, i, n, r) {
|
|
12262
12254
|
if (i.currentTransactionOldBlockAttrs = {}, i.updatedBlocks.clear(), !t.docChanged || n.doc.eq(r.doc))
|
|
12263
12255
|
return i;
|
|
12264
|
-
const a = {}, s =
|
|
12256
|
+
const a = {}, s = mt(n.doc, (c) => c.attrs.id), l = new Map(
|
|
12265
12257
|
s.map((c) => [c.node.attrs.id, c])
|
|
12266
|
-
), d =
|
|
12258
|
+
), d = mt(r.doc, (c) => c.attrs.id);
|
|
12267
12259
|
for (const c of d) {
|
|
12268
12260
|
const u = l.get(c.node.attrs.id), m = u == null ? void 0 : u.node.firstChild, h = c.node.firstChild;
|
|
12269
12261
|
if (u && m && h) {
|
|
@@ -12296,7 +12288,7 @@ class za {
|
|
|
12296
12288
|
return;
|
|
12297
12289
|
const s = i.currentTransactionOldBlockAttrs[r.attrs.id], l = {};
|
|
12298
12290
|
for (const [c, u] of Object.entries(s))
|
|
12299
|
-
l["data-prev-" +
|
|
12291
|
+
l["data-prev-" + Oa[c]] = u || "none";
|
|
12300
12292
|
const d = F.node(a, a + r.nodeSize, {
|
|
12301
12293
|
...l
|
|
12302
12294
|
});
|
|
@@ -12307,13 +12299,13 @@ class za {
|
|
|
12307
12299
|
});
|
|
12308
12300
|
}
|
|
12309
12301
|
}
|
|
12310
|
-
const
|
|
12311
|
-
class
|
|
12302
|
+
const Nt = new A("blocknote-show-selection");
|
|
12303
|
+
class za {
|
|
12312
12304
|
constructor(o) {
|
|
12313
12305
|
p(this, "plugin");
|
|
12314
12306
|
p(this, "enabled", !1);
|
|
12315
12307
|
this.editor = o, this.plugin = new T({
|
|
12316
|
-
key:
|
|
12308
|
+
key: Nt,
|
|
12317
12309
|
props: {
|
|
12318
12310
|
decorations: (t) => {
|
|
12319
12311
|
const { doc: i, selection: n } = t;
|
|
@@ -12330,14 +12322,14 @@ class Fa {
|
|
|
12330
12322
|
setEnabled(o) {
|
|
12331
12323
|
var t, i;
|
|
12332
12324
|
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(
|
|
12325
|
+
(t = this.editor.prosemirrorView) == null ? void 0 : t.state.tr.setMeta(Nt, {})
|
|
12334
12326
|
));
|
|
12335
12327
|
}
|
|
12336
12328
|
getEnabled() {
|
|
12337
12329
|
return this.enabled;
|
|
12338
12330
|
}
|
|
12339
12331
|
}
|
|
12340
|
-
function
|
|
12332
|
+
function No(e, o) {
|
|
12341
12333
|
var t, i;
|
|
12342
12334
|
for (; e && e.parentElement && e.parentElement !== o.dom && ((t = e.getAttribute) == null ? void 0 : t.call(e, "data-node-type")) !== "blockContainer"; )
|
|
12343
12335
|
e = e.parentElement;
|
|
@@ -12380,7 +12372,7 @@ class re extends De {
|
|
|
12380
12372
|
}
|
|
12381
12373
|
}
|
|
12382
12374
|
let z;
|
|
12383
|
-
function
|
|
12375
|
+
function Fa(e, o) {
|
|
12384
12376
|
let t, i;
|
|
12385
12377
|
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
12378
|
if (n && r) {
|
|
@@ -12390,7 +12382,7 @@ function $a(e, o) {
|
|
|
12390
12382
|
t = e.from, i = e.to;
|
|
12391
12383
|
return { from: t, to: i };
|
|
12392
12384
|
}
|
|
12393
|
-
function
|
|
12385
|
+
function jt(e, o, t = o) {
|
|
12394
12386
|
o === t && (t += e.state.doc.resolve(o + 1).node().nodeSize);
|
|
12395
12387
|
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
12388
|
n,
|
|
@@ -12403,16 +12395,16 @@ function Rt(e, o, t = o) {
|
|
|
12403
12395
|
);
|
|
12404
12396
|
for (let c = n.childElementCount - 1; c >= 0; c--)
|
|
12405
12397
|
(c > s || c < a) && i.removeChild(i.children[c]);
|
|
12406
|
-
|
|
12398
|
+
jo(e.root), z = i;
|
|
12407
12399
|
const d = e.dom.className.split(" ").filter(
|
|
12408
12400
|
(c) => c !== "ProseMirror" && c !== "bn-root" && c !== "bn-editor"
|
|
12409
12401
|
).join(" ");
|
|
12410
12402
|
z.className = z.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(z) : e.root.body.appendChild(z);
|
|
12411
12403
|
}
|
|
12412
|
-
function
|
|
12404
|
+
function jo(e) {
|
|
12413
12405
|
z !== void 0 && (e instanceof ShadowRoot ? e.removeChild(z) : e.body.removeChild(z), z = void 0);
|
|
12414
12406
|
}
|
|
12415
|
-
function
|
|
12407
|
+
function $a(e, o, t) {
|
|
12416
12408
|
if (!e.dataTransfer)
|
|
12417
12409
|
return;
|
|
12418
12410
|
const i = t.prosemirrorView;
|
|
@@ -12423,18 +12415,18 @@ function Ga(e, o, t) {
|
|
|
12423
12415
|
throw new Error(`Block with ID ${o.id} not found`);
|
|
12424
12416
|
const r = n.posBeforeNode;
|
|
12425
12417
|
if (r != null) {
|
|
12426
|
-
const a = i.state.selection, s = i.state.doc, { from: l, to: d } =
|
|
12418
|
+
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
12419
|
c && u ? (i.dispatch(
|
|
12428
12420
|
i.state.tr.setSelection(re.create(s, l, d))
|
|
12429
|
-
),
|
|
12421
|
+
), jt(i, l, d)) : (i.dispatch(
|
|
12430
12422
|
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, {}), _ =
|
|
12423
|
+
), jt(i, r));
|
|
12424
|
+
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
12425
|
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
12426
|
}
|
|
12435
12427
|
}
|
|
12436
12428
|
const ue = 0.1;
|
|
12437
|
-
function
|
|
12429
|
+
function et(e, o, t, i = !0) {
|
|
12438
12430
|
const n = e.root.elementsFromPoint(
|
|
12439
12431
|
// bit hacky - offset x position to right to account for the width of sidemenu itself
|
|
12440
12432
|
o.left + (t === "editor" ? 50 : 0),
|
|
@@ -12442,7 +12434,7 @@ function tt(e, o, t, i = !0) {
|
|
|
12442
12434
|
);
|
|
12443
12435
|
for (const r of n)
|
|
12444
12436
|
if (e.dom.contains(r))
|
|
12445
|
-
return i && r.closest("[data-node-type=columnList]") ?
|
|
12437
|
+
return i && r.closest("[data-node-type=columnList]") ? et(
|
|
12446
12438
|
e,
|
|
12447
12439
|
{
|
|
12448
12440
|
left: o.left + 50,
|
|
@@ -12451,9 +12443,9 @@ function tt(e, o, t, i = !0) {
|
|
|
12451
12443
|
},
|
|
12452
12444
|
t,
|
|
12453
12445
|
!1
|
|
12454
|
-
) :
|
|
12446
|
+
) : No(r, e);
|
|
12455
12447
|
}
|
|
12456
|
-
function
|
|
12448
|
+
function Ga(e, o, t) {
|
|
12457
12449
|
if (!o.dom.firstChild)
|
|
12458
12450
|
return;
|
|
12459
12451
|
const i = o.dom.firstChild.getBoundingClientRect(), n = {
|
|
@@ -12461,14 +12453,14 @@ function Wa(e, o, t) {
|
|
|
12461
12453
|
top: e.y
|
|
12462
12454
|
}, r = n.left < i.left, a = n.left > i.right;
|
|
12463
12455
|
t === "viewport" && (r && (n.left = i.left + 10), a && (n.left = i.right - 10));
|
|
12464
|
-
let s =
|
|
12456
|
+
let s = et(o, n, t);
|
|
12465
12457
|
if (!a && s) {
|
|
12466
12458
|
const l = s.node.getBoundingClientRect();
|
|
12467
|
-
n.left = l.right - 10, s =
|
|
12459
|
+
n.left = l.right - 10, s = et(o, n, "viewport", !1);
|
|
12468
12460
|
}
|
|
12469
12461
|
return s;
|
|
12470
12462
|
}
|
|
12471
|
-
class
|
|
12463
|
+
class Wa {
|
|
12472
12464
|
constructor(o, t, i, n) {
|
|
12473
12465
|
p(this, "state");
|
|
12474
12466
|
p(this, "emitUpdate");
|
|
@@ -12483,7 +12475,7 @@ class Ka {
|
|
|
12483
12475
|
var i, n, r, a;
|
|
12484
12476
|
if (this.menuFrozen || !this.mousePos)
|
|
12485
12477
|
return;
|
|
12486
|
-
const o =
|
|
12478
|
+
const o = Ga(
|
|
12487
12479
|
this.mousePos,
|
|
12488
12480
|
this.pmView,
|
|
12489
12481
|
this.sideMenuDetection
|
|
@@ -12575,7 +12567,7 @@ class Ka {
|
|
|
12575
12567
|
throw new Error("New drag was started while an existing drag is ongoing");
|
|
12576
12568
|
const i = document.createElement("div");
|
|
12577
12569
|
i.innerHTML = t;
|
|
12578
|
-
const r =
|
|
12570
|
+
const r = Ht.fromSchema(this.pmView.state.schema).parse(i, {
|
|
12579
12571
|
topNode: this.pmView.state.schema.nodes.blockGroup.create()
|
|
12580
12572
|
});
|
|
12581
12573
|
this.pmView.dragging = {
|
|
@@ -12644,7 +12636,7 @@ class Ka {
|
|
|
12644
12636
|
"dragend",
|
|
12645
12637
|
this.onDragEnd,
|
|
12646
12638
|
!0
|
|
12647
|
-
),
|
|
12639
|
+
), lt(), this.pmView.root.addEventListener(
|
|
12648
12640
|
"mousemove",
|
|
12649
12641
|
this.onMouseMove,
|
|
12650
12642
|
!0
|
|
@@ -12699,8 +12691,8 @@ class Ka {
|
|
|
12699
12691
|
), this.pmView.root.removeEventListener("scroll", this.onScroll, !0);
|
|
12700
12692
|
}
|
|
12701
12693
|
}
|
|
12702
|
-
const
|
|
12703
|
-
class
|
|
12694
|
+
const Ka = new A("SideMenuPlugin");
|
|
12695
|
+
class qa extends W {
|
|
12704
12696
|
constructor(t, i) {
|
|
12705
12697
|
super();
|
|
12706
12698
|
p(this, "view");
|
|
@@ -12709,13 +12701,13 @@ class Xa extends W {
|
|
|
12709
12701
|
* Handles drag & drop events for blocks.
|
|
12710
12702
|
*/
|
|
12711
12703
|
p(this, "blockDragStart", (t, i) => {
|
|
12712
|
-
this.view && (this.view.isDragOrigin = !0),
|
|
12704
|
+
this.view && (this.view.isDragOrigin = !0), $a(t, i, this.editor);
|
|
12713
12705
|
});
|
|
12714
12706
|
/**
|
|
12715
12707
|
* Handles drag & drop events for blocks.
|
|
12716
12708
|
*/
|
|
12717
12709
|
p(this, "blockDragEnd", () => {
|
|
12718
|
-
this.editor.prosemirrorView &&
|
|
12710
|
+
this.editor.prosemirrorView && jo(this.editor.prosemirrorView.root), this.view && (this.view.isDragOrigin = !1);
|
|
12719
12711
|
});
|
|
12720
12712
|
/**
|
|
12721
12713
|
* Freezes the side menu. When frozen, the side menu will stay
|
|
@@ -12734,8 +12726,8 @@ class Xa extends W {
|
|
|
12734
12726
|
this.view.menuFrozen = !1, this.view.state.show = !1, this.view.emitUpdate(this.view.state);
|
|
12735
12727
|
});
|
|
12736
12728
|
this.editor = t, this.plugin = new T({
|
|
12737
|
-
key:
|
|
12738
|
-
view: (n) => (this.view = new
|
|
12729
|
+
key: Ka,
|
|
12730
|
+
view: (n) => (this.view = new Wa(
|
|
12739
12731
|
t,
|
|
12740
12732
|
i,
|
|
12741
12733
|
n,
|
|
@@ -12749,8 +12741,8 @@ class Xa extends W {
|
|
|
12749
12741
|
return this.on("update", t);
|
|
12750
12742
|
}
|
|
12751
12743
|
}
|
|
12752
|
-
const
|
|
12753
|
-
class
|
|
12744
|
+
const Xa = Xo((e) => e.type.name === "blockContainer");
|
|
12745
|
+
class Za {
|
|
12754
12746
|
constructor(o, t) {
|
|
12755
12747
|
p(this, "state");
|
|
12756
12748
|
p(this, "emitUpdate");
|
|
@@ -12815,7 +12807,7 @@ class Ja {
|
|
|
12815
12807
|
}
|
|
12816
12808
|
}
|
|
12817
12809
|
const ae = new A("SuggestionMenuPlugin");
|
|
12818
|
-
class
|
|
12810
|
+
class Ja extends W {
|
|
12819
12811
|
constructor(t) {
|
|
12820
12812
|
super();
|
|
12821
12813
|
p(this, "view");
|
|
@@ -12835,7 +12827,7 @@ class Ya extends W {
|
|
|
12835
12827
|
const i = this.triggerCharacters;
|
|
12836
12828
|
this.plugin = new T({
|
|
12837
12829
|
key: ae,
|
|
12838
|
-
view: () => (this.view = new
|
|
12830
|
+
view: () => (this.view = new Za(
|
|
12839
12831
|
t,
|
|
12840
12832
|
(n, r) => {
|
|
12841
12833
|
this.emit(`update ${n}`, r);
|
|
@@ -12892,7 +12884,7 @@ class Ya extends W {
|
|
|
12892
12884
|
if (r === void 0)
|
|
12893
12885
|
return null;
|
|
12894
12886
|
if (!r.deleteTriggerCharacter) {
|
|
12895
|
-
const a =
|
|
12887
|
+
const a = Xa(n.selection);
|
|
12896
12888
|
if (a)
|
|
12897
12889
|
return N.create(n.doc, [
|
|
12898
12890
|
F.node(
|
|
@@ -12932,17 +12924,17 @@ class Ya extends W {
|
|
|
12932
12924
|
function ml(e, o) {
|
|
12933
12925
|
e.suggestionMenus.addTriggerCharacter(o);
|
|
12934
12926
|
}
|
|
12935
|
-
let
|
|
12936
|
-
function
|
|
12937
|
-
|
|
12927
|
+
let I;
|
|
12928
|
+
function Rt(e) {
|
|
12929
|
+
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
12930
|
}
|
|
12939
|
-
function
|
|
12940
|
-
|
|
12931
|
+
function Ya(e) {
|
|
12932
|
+
I && (e instanceof Document ? e.body.removeChild(I) : e.removeChild(I), I = void 0);
|
|
12941
12933
|
}
|
|
12942
12934
|
function Ee(e) {
|
|
12943
12935
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
12944
12936
|
}
|
|
12945
|
-
function
|
|
12937
|
+
function Qa(e) {
|
|
12946
12938
|
let o = e;
|
|
12947
12939
|
for (; o && o.nodeName !== "TD" && o.nodeName !== "TH" && !o.classList.contains("tableWrapper"); ) {
|
|
12948
12940
|
if (o.classList.contains("ProseMirror"))
|
|
@@ -12962,12 +12954,12 @@ function es(e) {
|
|
|
12962
12954
|
tbodyNode: o.querySelector("tbody")
|
|
12963
12955
|
};
|
|
12964
12956
|
}
|
|
12965
|
-
function
|
|
12957
|
+
function es(e, o) {
|
|
12966
12958
|
const t = o.querySelectorAll(e);
|
|
12967
12959
|
for (let i = 0; i < t.length; i++)
|
|
12968
12960
|
t[i].style.visibility = "hidden";
|
|
12969
12961
|
}
|
|
12970
|
-
class
|
|
12962
|
+
class ts {
|
|
12971
12963
|
constructor(o, t, i) {
|
|
12972
12964
|
p(this, "state");
|
|
12973
12965
|
p(this, "emitUpdate");
|
|
@@ -12987,7 +12979,7 @@ class os {
|
|
|
12987
12979
|
var d, c, u, m, h, g, f;
|
|
12988
12980
|
if (this.menuFrozen || this.mouseState === "selecting" || !(o.target instanceof Element) || !this.pmView.dom.contains(o.target))
|
|
12989
12981
|
return;
|
|
12990
|
-
const t =
|
|
12982
|
+
const t = Qa(o.target);
|
|
12991
12983
|
if ((t == null ? void 0 : t.type) === "cell" && this.mouseState === "down" && !((d = this.state) != null && d.draggingState)) {
|
|
12992
12984
|
this.mouseState = "selecting", (c = this.state) != null && c.show && (this.state.show = !1, this.state.showAddOrRemoveRowsButton = !1, this.state.showAddOrRemoveColumnsButton = !1, this.emitUpdate());
|
|
12993
12985
|
return;
|
|
@@ -12998,7 +12990,7 @@ class os {
|
|
|
12998
12990
|
}
|
|
12999
12991
|
if (!t.tbodyNode)
|
|
13000
12992
|
return;
|
|
13001
|
-
const i = t.tbodyNode.getBoundingClientRect(), n =
|
|
12993
|
+
const i = t.tbodyNode.getBoundingClientRect(), n = No(t.domNode, this.pmView);
|
|
13002
12994
|
if (!n)
|
|
13003
12995
|
return;
|
|
13004
12996
|
this.tableElement = n.node;
|
|
@@ -13016,7 +13008,7 @@ class os {
|
|
|
13016
13008
|
this.editor.schema.styleSchema,
|
|
13017
13009
|
this.editor.blockCache
|
|
13018
13010
|
);
|
|
13019
|
-
if (
|
|
13011
|
+
if (Ir("table", s, this.editor) && (this.tablePos = a.posBeforeNode + 1, r = s), !r)
|
|
13020
13012
|
return;
|
|
13021
13013
|
this.tableId = n.id;
|
|
13022
13014
|
const l = (m = t.domNode.closest(".tableWrapper")) == null ? void 0 : m.querySelector(".table-widgets-container");
|
|
@@ -13058,7 +13050,7 @@ class os {
|
|
|
13058
13050
|
var m;
|
|
13059
13051
|
if (((m = this.state) == null ? void 0 : m.draggingState) === void 0)
|
|
13060
13052
|
return;
|
|
13061
|
-
o.preventDefault(), o.dataTransfer.dropEffect = "move",
|
|
13053
|
+
o.preventDefault(), o.dataTransfer.dropEffect = "move", es(
|
|
13062
13054
|
".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline",
|
|
13063
13055
|
this.pmView.root
|
|
13064
13056
|
);
|
|
@@ -13075,9 +13067,7 @@ class os {
|
|
|
13075
13067
|
(h) => h.tagName === "TD" || h.tagName === "TH"
|
|
13076
13068
|
);
|
|
13077
13069
|
if (i.length === 0)
|
|
13078
|
-
|
|
13079
|
-
"Could not find table cell element that the mouse cursor is hovering over."
|
|
13080
|
-
);
|
|
13070
|
+
return;
|
|
13081
13071
|
const n = i[0];
|
|
13082
13072
|
let r = !1;
|
|
13083
13073
|
const a = Ee(n.parentElement), s = Ee(n), l = this.state.draggingState.draggedCellOrientation === "row" ? this.state.rowIndex : this.state.colIndex, c = (this.state.draggingState.draggedCellOrientation === "row" ? a : s) !== l;
|
|
@@ -13097,13 +13087,13 @@ class os {
|
|
|
13097
13087
|
o.preventDefault();
|
|
13098
13088
|
const { draggingState: t, colIndex: i, rowIndex: n } = this.state, r = this.state.block.content.columnWidths;
|
|
13099
13089
|
if (t.draggedCellOrientation === "row") {
|
|
13100
|
-
if (!
|
|
13090
|
+
if (!Qt(
|
|
13101
13091
|
this.state.block,
|
|
13102
13092
|
t.originalIndex,
|
|
13103
13093
|
n
|
|
13104
13094
|
))
|
|
13105
13095
|
return !1;
|
|
13106
|
-
const a =
|
|
13096
|
+
const a = cn(
|
|
13107
13097
|
this.state.block,
|
|
13108
13098
|
t.originalIndex,
|
|
13109
13099
|
n
|
|
@@ -13116,13 +13106,13 @@ class os {
|
|
|
13116
13106
|
}
|
|
13117
13107
|
});
|
|
13118
13108
|
} else {
|
|
13119
|
-
if (!
|
|
13109
|
+
if (!eo(
|
|
13120
13110
|
this.state.block,
|
|
13121
13111
|
t.originalIndex,
|
|
13122
13112
|
i
|
|
13123
13113
|
))
|
|
13124
13114
|
return !1;
|
|
13125
|
-
const a =
|
|
13115
|
+
const a = dn(
|
|
13126
13116
|
this.state.block,
|
|
13127
13117
|
t.originalIndex,
|
|
13128
13118
|
i
|
|
@@ -13158,7 +13148,7 @@ class os {
|
|
|
13158
13148
|
this.state.show = !1, this.state.showAddOrRemoveRowsButton = !1, this.state.showAddOrRemoveColumnsButton = !1, this.emitUpdate();
|
|
13159
13149
|
return;
|
|
13160
13150
|
}
|
|
13161
|
-
const { height: o, width: t } =
|
|
13151
|
+
const { height: o, width: t } = nt(
|
|
13162
13152
|
this.state.block
|
|
13163
13153
|
);
|
|
13164
13154
|
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 +13174,7 @@ class os {
|
|
|
13184
13174
|
}
|
|
13185
13175
|
}
|
|
13186
13176
|
const pe = new A("TableHandlesPlugin");
|
|
13187
|
-
class
|
|
13177
|
+
class os extends W {
|
|
13188
13178
|
constructor(t) {
|
|
13189
13179
|
super();
|
|
13190
13180
|
p(this, "view");
|
|
@@ -13211,7 +13201,7 @@ class is extends W {
|
|
|
13211
13201
|
})
|
|
13212
13202
|
), !this.editor.prosemirrorView)
|
|
13213
13203
|
throw new Error("Editor view not initialized.");
|
|
13214
|
-
|
|
13204
|
+
Rt(this.editor.prosemirrorView.root), t.dataTransfer.setDragImage(I, 0, 0), t.dataTransfer.effectAllowed = "move";
|
|
13215
13205
|
});
|
|
13216
13206
|
/**
|
|
13217
13207
|
* Callback that should be set on the `dragStart` event for whichever element
|
|
@@ -13235,7 +13225,7 @@ class is extends W {
|
|
|
13235
13225
|
})
|
|
13236
13226
|
), !this.editor.prosemirrorView)
|
|
13237
13227
|
throw new Error("Editor view not initialized.");
|
|
13238
|
-
|
|
13228
|
+
Rt(this.editor.prosemirrorView.root), t.dataTransfer.setDragImage(I, 0, 0), t.dataTransfer.effectAllowed = "copyMove";
|
|
13239
13229
|
});
|
|
13240
13230
|
/**
|
|
13241
13231
|
* Callback that should be set on the `dragEnd` event for both the element
|
|
@@ -13250,7 +13240,7 @@ class is extends W {
|
|
|
13250
13240
|
this.editor._tiptapEditor.state.tr.setMeta(pe, null)
|
|
13251
13241
|
), !this.editor.prosemirrorView)
|
|
13252
13242
|
throw new Error("Editor view not initialized.");
|
|
13253
|
-
|
|
13243
|
+
Ya(this.editor.prosemirrorView.root);
|
|
13254
13244
|
});
|
|
13255
13245
|
/**
|
|
13256
13246
|
* Freezes the drag handles. When frozen, they will stay attached to the same
|
|
@@ -13266,11 +13256,11 @@ class is extends W {
|
|
|
13266
13256
|
p(this, "unfreezeHandles", () => {
|
|
13267
13257
|
this.view.menuFrozen = !1;
|
|
13268
13258
|
});
|
|
13269
|
-
p(this, "getCellsAtRowHandle", (t, i) =>
|
|
13259
|
+
p(this, "getCellsAtRowHandle", (t, i) => Ke(t, i));
|
|
13270
13260
|
/**
|
|
13271
13261
|
* Get all the cells in a column of the table block.
|
|
13272
13262
|
*/
|
|
13273
|
-
p(this, "getCellsAtColumnHandle", (t, i) =>
|
|
13263
|
+
p(this, "getCellsAtColumnHandle", (t, i) => qe(t, i));
|
|
13274
13264
|
/**
|
|
13275
13265
|
* Sets the selection to the given cell or a range of cells.
|
|
13276
13266
|
* @returns The new state after the selection has been set.
|
|
@@ -13301,7 +13291,7 @@ class is extends W {
|
|
|
13301
13291
|
const n = this.setCellSelection(
|
|
13302
13292
|
i.orientation === "row" ? { row: t, col: 0 } : { row: 0, col: t }
|
|
13303
13293
|
);
|
|
13304
|
-
return i.orientation === "row" ? i.side === "above" ?
|
|
13294
|
+
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
13295
|
});
|
|
13306
13296
|
/**
|
|
13307
13297
|
* Removes a row or column from the table using prosemirror-table commands
|
|
@@ -13310,7 +13300,7 @@ class is extends W {
|
|
|
13310
13300
|
const n = this.setCellSelection(
|
|
13311
13301
|
i === "row" ? { row: t, col: 0 } : { row: 0, col: t }
|
|
13312
13302
|
);
|
|
13313
|
-
return i === "row" ?
|
|
13303
|
+
return i === "row" ? ci(n, this.editor.dispatch) : ui(n, this.editor.dispatch);
|
|
13314
13304
|
});
|
|
13315
13305
|
/**
|
|
13316
13306
|
* Merges the cells in the table block.
|
|
@@ -13320,7 +13310,7 @@ class is extends W {
|
|
|
13320
13310
|
t.relativeStartCell,
|
|
13321
13311
|
t.relativeEndCell
|
|
13322
13312
|
) : this.editor.prosemirrorState;
|
|
13323
|
-
return
|
|
13313
|
+
return pi(i, this.editor.dispatch);
|
|
13324
13314
|
});
|
|
13325
13315
|
/**
|
|
13326
13316
|
* Splits the cell in the table block.
|
|
@@ -13328,7 +13318,7 @@ class is extends W {
|
|
|
13328
13318
|
*/
|
|
13329
13319
|
p(this, "splitCell", (t) => {
|
|
13330
13320
|
const i = t ? this.setCellSelection(t) : this.editor.prosemirrorState;
|
|
13331
|
-
return
|
|
13321
|
+
return mi(i, this.editor.dispatch);
|
|
13332
13322
|
});
|
|
13333
13323
|
/**
|
|
13334
13324
|
* Gets the start and end cells of the current cell selection.
|
|
@@ -13337,7 +13327,7 @@ class is extends W {
|
|
|
13337
13327
|
p(this, "getCellSelection", () => {
|
|
13338
13328
|
const t = this.editor.prosemirrorState, i = t.selection;
|
|
13339
13329
|
let n = i.$from, r = i.$to;
|
|
13340
|
-
if (
|
|
13330
|
+
if (Et(i)) {
|
|
13341
13331
|
const { ranges: g } = i;
|
|
13342
13332
|
g.forEach((f) => {
|
|
13343
13333
|
n = f.$from.min(n ?? f.$from), r = f.$to.max(r ?? f.$to);
|
|
@@ -13372,7 +13362,7 @@ class is extends W {
|
|
|
13372
13362
|
* Returns undefined when there is no cell selection, or the selection is not within a table.
|
|
13373
13363
|
*/
|
|
13374
13364
|
p(this, "getMergeDirection", (t) => {
|
|
13375
|
-
const i =
|
|
13365
|
+
const i = Et(
|
|
13376
13366
|
this.editor.prosemirrorState.selection
|
|
13377
13367
|
) ? this.editor.prosemirrorState.selection : void 0;
|
|
13378
13368
|
if (!i || !t || // Only offer the merge button if there is more than one cell selected.
|
|
@@ -13380,13 +13370,13 @@ class is extends W {
|
|
|
13380
13370
|
return;
|
|
13381
13371
|
const n = this.getCellSelection();
|
|
13382
13372
|
if (n)
|
|
13383
|
-
return
|
|
13373
|
+
return mn(n.from, n.to, t) ? "vertical" : "horizontal";
|
|
13384
13374
|
});
|
|
13385
|
-
p(this, "cropEmptyRowsOrColumns", (t, i) =>
|
|
13386
|
-
p(this, "addRowsOrColumns", (t, i, n) =>
|
|
13375
|
+
p(this, "cropEmptyRowsOrColumns", (t, i) => un(t, i));
|
|
13376
|
+
p(this, "addRowsOrColumns", (t, i, n) => pn(t, i, n));
|
|
13387
13377
|
this.editor = t, this.plugin = new T({
|
|
13388
13378
|
key: pe,
|
|
13389
|
-
view: (i) => (this.view = new
|
|
13379
|
+
view: (i) => (this.view = new ts(t, i, (n) => {
|
|
13390
13380
|
this.emit("update", n);
|
|
13391
13381
|
}), this.view),
|
|
13392
13382
|
// We use decorations to render the drop cursor when dragging a table row
|
|
@@ -13401,20 +13391,20 @@ class is extends W {
|
|
|
13401
13391
|
const r = [];
|
|
13402
13392
|
if (n === this.view.state.draggingState.originalIndex)
|
|
13403
13393
|
return N.create(i.doc, r);
|
|
13404
|
-
if (this.view.state.draggingState.draggedCellOrientation === "row" && !
|
|
13394
|
+
if (this.view.state.draggingState.draggedCellOrientation === "row" && !Qt(
|
|
13405
13395
|
this.view.state.block,
|
|
13406
13396
|
this.view.state.draggingState.originalIndex,
|
|
13407
13397
|
n
|
|
13408
13398
|
))
|
|
13409
13399
|
return N.create(i.doc, r);
|
|
13410
|
-
if (this.view.state.draggingState.draggedCellOrientation === "col" && !
|
|
13400
|
+
if (this.view.state.draggingState.draggedCellOrientation === "col" && !eo(
|
|
13411
13401
|
this.view.state.block,
|
|
13412
13402
|
this.view.state.draggingState.originalIndex,
|
|
13413
13403
|
n
|
|
13414
13404
|
))
|
|
13415
13405
|
return N.create(i.doc, r);
|
|
13416
13406
|
const a = i.doc.resolve(this.view.tablePos + 1), s = this.view.state.draggingState.originalIndex;
|
|
13417
|
-
return this.view.state.draggingState.draggedCellOrientation === "row" ?
|
|
13407
|
+
return this.view.state.draggingState.draggedCellOrientation === "row" ? Ke(
|
|
13418
13408
|
this.view.state.block,
|
|
13419
13409
|
n
|
|
13420
13410
|
).forEach(({ row: d, col: c }) => {
|
|
@@ -13430,7 +13420,7 @@ class is extends W {
|
|
|
13430
13420
|
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
13421
|
})
|
|
13432
13422
|
);
|
|
13433
|
-
}) :
|
|
13423
|
+
}) : qe(
|
|
13434
13424
|
this.view.state.block,
|
|
13435
13425
|
n
|
|
13436
13426
|
).forEach(({ row: d, col: c }) => {
|
|
@@ -13455,7 +13445,7 @@ class is extends W {
|
|
|
13455
13445
|
return this.on("update", t);
|
|
13456
13446
|
}
|
|
13457
13447
|
}
|
|
13458
|
-
const
|
|
13448
|
+
const is = j.create({
|
|
13459
13449
|
name: "textAlignment",
|
|
13460
13450
|
addGlobalAttributes() {
|
|
13461
13451
|
return [
|
|
@@ -13483,7 +13473,7 @@ const ns = j.create({
|
|
|
13483
13473
|
}
|
|
13484
13474
|
];
|
|
13485
13475
|
}
|
|
13486
|
-
}),
|
|
13476
|
+
}), ns = j.create({
|
|
13487
13477
|
name: "blockTextColor",
|
|
13488
13478
|
addGlobalAttributes() {
|
|
13489
13479
|
return [
|
|
@@ -13501,7 +13491,7 @@ const ns = j.create({
|
|
|
13501
13491
|
}
|
|
13502
13492
|
];
|
|
13503
13493
|
}
|
|
13504
|
-
}),
|
|
13494
|
+
}), rs = j.create({
|
|
13505
13495
|
name: "trailingNode",
|
|
13506
13496
|
addProseMirrorPlugins() {
|
|
13507
13497
|
const e = new A(this.name);
|
|
@@ -13536,13 +13526,13 @@ const ns = j.create({
|
|
|
13536
13526
|
})
|
|
13537
13527
|
];
|
|
13538
13528
|
}
|
|
13539
|
-
}),
|
|
13529
|
+
}), as = {
|
|
13540
13530
|
blockColor: "data-block-color",
|
|
13541
13531
|
blockStyle: "data-block-style",
|
|
13542
13532
|
id: "data-id",
|
|
13543
13533
|
depth: "data-depth",
|
|
13544
13534
|
depthChange: "data-depth-change"
|
|
13545
|
-
},
|
|
13535
|
+
}, ss = de.create({
|
|
13546
13536
|
name: "blockContainer",
|
|
13547
13537
|
group: "blockGroupChild bnBlock",
|
|
13548
13538
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -13558,7 +13548,7 @@ const ns = j.create({
|
|
|
13558
13548
|
if (typeof e == "string")
|
|
13559
13549
|
return !1;
|
|
13560
13550
|
const o = {};
|
|
13561
|
-
for (const [t, i] of Object.entries(
|
|
13551
|
+
for (const [t, i] of Object.entries(as))
|
|
13562
13552
|
e.getAttribute(i) && (o[t] = e.getAttribute(i));
|
|
13563
13553
|
return e.getAttribute("data-node-type") === "blockContainer" ? o : !1;
|
|
13564
13554
|
}
|
|
@@ -13583,7 +13573,7 @@ const ns = j.create({
|
|
|
13583
13573
|
contentDOM: i
|
|
13584
13574
|
};
|
|
13585
13575
|
}
|
|
13586
|
-
}),
|
|
13576
|
+
}), ls = de.create({
|
|
13587
13577
|
name: "blockGroup",
|
|
13588
13578
|
group: "childContainer",
|
|
13589
13579
|
content: "blockGroupChild+",
|
|
@@ -13612,37 +13602,37 @@ const ns = j.create({
|
|
|
13612
13602
|
contentDOM: t
|
|
13613
13603
|
};
|
|
13614
13604
|
}
|
|
13615
|
-
}),
|
|
13605
|
+
}), ds = de.create({
|
|
13616
13606
|
name: "doc",
|
|
13617
13607
|
topNode: !0,
|
|
13618
13608
|
content: "blockGroup"
|
|
13619
|
-
}),
|
|
13620
|
-
const o = {}, t =
|
|
13609
|
+
}), cs = (e) => {
|
|
13610
|
+
const o = {}, t = us(e);
|
|
13621
13611
|
for (const n of t)
|
|
13622
13612
|
o[n.name] = n;
|
|
13623
|
-
o.formattingToolbar = new
|
|
13613
|
+
o.formattingToolbar = new Ba(
|
|
13624
13614
|
e.editor
|
|
13625
|
-
), o.linkToolbar = new
|
|
13615
|
+
), o.linkToolbar = new Pa(e.editor), o.sideMenu = new qa(
|
|
13626
13616
|
e.editor,
|
|
13627
13617
|
e.sideMenuDetection
|
|
13628
|
-
), o.suggestionMenus = new
|
|
13618
|
+
), 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
13619
|
plugin: e.dropCursor({
|
|
13630
13620
|
width: 5,
|
|
13631
13621
|
color: "#ddeeff",
|
|
13632
13622
|
editor: e.editor
|
|
13633
13623
|
})
|
|
13634
|
-
}, o.nodeSelectionKeyboard = new
|
|
13624
|
+
}, o.nodeSelectionKeyboard = new Da(), o.showSelection = new za(e.editor), e.comments && (o.comments = new va(
|
|
13635
13625
|
e.editor,
|
|
13636
13626
|
e.comments.threadStore,
|
|
13637
|
-
|
|
13627
|
+
Ao.name
|
|
13638
13628
|
));
|
|
13639
13629
|
const i = e.disableExtensions || [];
|
|
13640
13630
|
for (const n of i)
|
|
13641
13631
|
delete o[n];
|
|
13642
13632
|
return o;
|
|
13643
13633
|
};
|
|
13644
|
-
let
|
|
13645
|
-
const
|
|
13634
|
+
let Dt = !1;
|
|
13635
|
+
const us = (e) => {
|
|
13646
13636
|
const o = [
|
|
13647
13637
|
ce.ClipboardTextSerializer,
|
|
13648
13638
|
ce.Commands,
|
|
@@ -13650,31 +13640,31 @@ const ps = (e) => {
|
|
|
13650
13640
|
ce.FocusEvents,
|
|
13651
13641
|
ce.Tabindex,
|
|
13652
13642
|
// DevTools,
|
|
13653
|
-
|
|
13643
|
+
vi,
|
|
13654
13644
|
// DropCursor,
|
|
13655
13645
|
we.configure({
|
|
13656
13646
|
// everything from bnBlock group (nodes that represent a BlockNote block should have an id)
|
|
13657
13647
|
types: ["blockContainer", "columnList", "column"],
|
|
13658
13648
|
setIdAttribute: e.setIdAttribute
|
|
13659
13649
|
}),
|
|
13660
|
-
|
|
13650
|
+
Ci.extend({ priority: 10 }),
|
|
13661
13651
|
// Comments,
|
|
13662
13652
|
// basics:
|
|
13663
|
-
|
|
13653
|
+
Ei,
|
|
13664
13654
|
// marks:
|
|
13665
|
-
|
|
13655
|
+
Si.extend({
|
|
13666
13656
|
inclusive: !1
|
|
13667
13657
|
}).configure({
|
|
13668
|
-
defaultProtocol:
|
|
13658
|
+
defaultProtocol: ja,
|
|
13669
13659
|
// only call this once if we have multiple editors installed. Or fix https://github.com/ueberdosis/tiptap/issues/5450
|
|
13670
|
-
protocols:
|
|
13660
|
+
protocols: Dt ? [] : Na
|
|
13671
13661
|
}),
|
|
13672
13662
|
...Object.values(e.styleSpecs).map((t) => t.implementation.mark.configure({
|
|
13673
13663
|
editor: e.editor
|
|
13674
13664
|
})),
|
|
13675
|
-
rs,
|
|
13676
|
-
ka,
|
|
13677
13665
|
ns,
|
|
13666
|
+
ba,
|
|
13667
|
+
is,
|
|
13678
13668
|
// make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
|
|
13679
13669
|
j.create({
|
|
13680
13670
|
name: "OverrideEscape",
|
|
@@ -13685,8 +13675,8 @@ const ps = (e) => {
|
|
|
13685
13675
|
}
|
|
13686
13676
|
}),
|
|
13687
13677
|
// nodes
|
|
13688
|
-
|
|
13689
|
-
|
|
13678
|
+
ds,
|
|
13679
|
+
ss.configure({
|
|
13690
13680
|
editor: e.editor,
|
|
13691
13681
|
domAttributes: e.domAttributes
|
|
13692
13682
|
}),
|
|
@@ -13694,7 +13684,7 @@ const ps = (e) => {
|
|
|
13694
13684
|
editor: e.editor,
|
|
13695
13685
|
tabBehavior: e.tabBehavior
|
|
13696
13686
|
}),
|
|
13697
|
-
|
|
13687
|
+
ls.configure({
|
|
13698
13688
|
domAttributes: e.domAttributes
|
|
13699
13689
|
}),
|
|
13700
13690
|
...Object.values(e.inlineContentSpecs).filter((t) => t.config !== "link" && t.config !== "text").map((t) => t.implementation.node.configure({
|
|
@@ -13714,23 +13704,23 @@ const ps = (e) => {
|
|
|
13714
13704
|
domAttributes: e.domAttributes
|
|
13715
13705
|
})
|
|
13716
13706
|
]),
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
|
|
13707
|
+
ga(e.editor),
|
|
13708
|
+
ha(e.editor),
|
|
13709
|
+
pa(e.editor),
|
|
13720
13710
|
// This needs to be at the bottom of this list, because Key events (such as enter, when selecting a /command),
|
|
13721
13711
|
// should be handled before Enter handlers in other components like splitListItem
|
|
13722
|
-
...e.trailingBlock === void 0 || e.trailingBlock ? [
|
|
13723
|
-
...e.comments ? [
|
|
13712
|
+
...e.trailingBlock === void 0 || e.trailingBlock ? [rs] : [],
|
|
13713
|
+
...e.comments ? [Ao] : []
|
|
13724
13714
|
];
|
|
13725
|
-
return
|
|
13715
|
+
return Dt = !0, e.collaboration ? o.push(...ka(e.collaboration)) : o.push(xi), o;
|
|
13726
13716
|
};
|
|
13727
|
-
function
|
|
13717
|
+
function ps(e, o) {
|
|
13728
13718
|
const t = [];
|
|
13729
13719
|
return e.forEach((i, n, r) => {
|
|
13730
13720
|
r !== o && t.push(i);
|
|
13731
13721
|
}), U.from(t);
|
|
13732
13722
|
}
|
|
13733
|
-
function
|
|
13723
|
+
function ms(e, o) {
|
|
13734
13724
|
const t = [];
|
|
13735
13725
|
for (let i = 0; i < e.childCount; i++)
|
|
13736
13726
|
if (e.child(i).type.name === "tableRow")
|
|
@@ -13748,16 +13738,16 @@ function hs(e, o) {
|
|
|
13748
13738
|
t.push(e.child(i));
|
|
13749
13739
|
return e = U.from(t), e;
|
|
13750
13740
|
}
|
|
13751
|
-
function
|
|
13741
|
+
function hs(e, o) {
|
|
13752
13742
|
let t = U.from(e.content);
|
|
13753
|
-
if (t =
|
|
13743
|
+
if (t = ms(t, o.state.schema), !fs(t, o))
|
|
13754
13744
|
return new ee(t, e.openStart, e.openEnd);
|
|
13755
13745
|
for (let i = 0; i < t.childCount; i++)
|
|
13756
13746
|
if (t.child(i).type.spec.group === "blockContent") {
|
|
13757
13747
|
const n = [t.child(i)];
|
|
13758
13748
|
if (i + 1 < t.childCount && t.child(i + 1).type.name === "blockGroup") {
|
|
13759
13749
|
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 =
|
|
13750
|
+
(a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(t.child(i + 1)), t = ps(t, i + 1));
|
|
13761
13751
|
}
|
|
13762
13752
|
const r = o.state.schema.nodes.blockContainer.createChecked(
|
|
13763
13753
|
void 0,
|
|
@@ -13767,7 +13757,7 @@ function fs(e, o) {
|
|
|
13767
13757
|
}
|
|
13768
13758
|
return new ee(t, e.openStart, e.openEnd);
|
|
13769
13759
|
}
|
|
13770
|
-
function
|
|
13760
|
+
function fs(e, o) {
|
|
13771
13761
|
var r, a;
|
|
13772
13762
|
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
13763
|
if (t) {
|
|
@@ -13781,7 +13771,7 @@ function gs(e, o) {
|
|
|
13781
13771
|
}
|
|
13782
13772
|
return !0;
|
|
13783
13773
|
}
|
|
13784
|
-
const
|
|
13774
|
+
const Ie = class Ie extends Zo {
|
|
13785
13775
|
constructor(t, i) {
|
|
13786
13776
|
super({ ...t, content: void 0 });
|
|
13787
13777
|
p(this, "_state");
|
|
@@ -13800,14 +13790,14 @@ const Le = class Le extends Jo {
|
|
|
13800
13790
|
if (r)
|
|
13801
13791
|
return r;
|
|
13802
13792
|
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 =
|
|
13793
|
+
return c.content[0].content[0].attrs.id = "initialBlockId", r = Oo.fromJSON(n, c), r;
|
|
13804
13794
|
};
|
|
13805
13795
|
let s;
|
|
13806
13796
|
try {
|
|
13807
13797
|
const l = t == null ? void 0 : t.content.map(
|
|
13808
13798
|
(d) => ie(d, this.schema, i).toJSON()
|
|
13809
13799
|
);
|
|
13810
|
-
s =
|
|
13800
|
+
s = Jo(
|
|
13811
13801
|
{
|
|
13812
13802
|
type: "doc",
|
|
13813
13803
|
content: [
|
|
@@ -13828,7 +13818,7 @@ const Le = class Le extends Jo {
|
|
|
13828
13818
|
"Error creating document from blocks passed as `initialContent`:\n" + +JSON.stringify(t.content)
|
|
13829
13819
|
);
|
|
13830
13820
|
}
|
|
13831
|
-
this._state =
|
|
13821
|
+
this._state = Qo.create({
|
|
13832
13822
|
doc: s,
|
|
13833
13823
|
schema: this.schema
|
|
13834
13824
|
// selection: selection || undefined,
|
|
@@ -13848,7 +13838,7 @@ const Le = class Le extends Jo {
|
|
|
13848
13838
|
const i = {};
|
|
13849
13839
|
this.extensionManager.extensions.forEach((r) => {
|
|
13850
13840
|
r.type === "mark" && r.config.addMarkView && (i[r.name] = r.config.addMarkView);
|
|
13851
|
-
}), this.view = new
|
|
13841
|
+
}), this.view = new Mi(
|
|
13852
13842
|
{ mount: this.options.element },
|
|
13853
13843
|
// use mount option so that we reuse the existing element instead of creating a new one
|
|
13854
13844
|
{
|
|
@@ -13868,26 +13858,26 @@ const Le = class Le extends Jo {
|
|
|
13868
13858
|
), this.emit("create", { editor: this }), this.isInitialized = !0;
|
|
13869
13859
|
}
|
|
13870
13860
|
};
|
|
13871
|
-
p(
|
|
13861
|
+
p(Ie, "create", (t, i) => {
|
|
13872
13862
|
var r, a;
|
|
13873
13863
|
const n = (r = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : r.setTimeout;
|
|
13874
13864
|
typeof ((a = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : a.setTimeout) < "u" && (globalThis.window.setTimeout = () => 0);
|
|
13875
13865
|
try {
|
|
13876
|
-
return new
|
|
13866
|
+
return new Ie(t, i);
|
|
13877
13867
|
} finally {
|
|
13878
13868
|
n && (globalThis.window.setTimeout = n);
|
|
13879
13869
|
}
|
|
13880
13870
|
});
|
|
13881
|
-
let
|
|
13882
|
-
|
|
13871
|
+
let Le = Ie;
|
|
13872
|
+
Le.prototype.createView = function() {
|
|
13883
13873
|
this.options.onPaste = this.options.onDrop = void 0;
|
|
13884
13874
|
};
|
|
13885
|
-
const
|
|
13875
|
+
const gs = {
|
|
13886
13876
|
enableInputRules: !0,
|
|
13887
13877
|
enablePasteRules: !0,
|
|
13888
13878
|
enableCoreExtensions: !1
|
|
13889
13879
|
};
|
|
13890
|
-
class
|
|
13880
|
+
class Ro extends W {
|
|
13891
13881
|
constructor(t) {
|
|
13892
13882
|
var d, c, u, m, h, g, f, b, k, _, w;
|
|
13893
13883
|
super();
|
|
@@ -13986,7 +13976,7 @@ class Do extends W {
|
|
|
13986
13976
|
throw new Error(
|
|
13987
13977
|
"editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false"
|
|
13988
13978
|
);
|
|
13989
|
-
this.dictionary = t.dictionary ||
|
|
13979
|
+
this.dictionary = t.dictionary || $t, this.settings = {
|
|
13990
13980
|
tables: {
|
|
13991
13981
|
splitCells: ((d = t == null ? void 0 : t.tables) == null ? void 0 : d.splitCells) ?? !1,
|
|
13992
13982
|
cellBackgroundColor: ((c = t == null ? void 0 : t.tables) == null ? void 0 : c.cellBackgroundColor) ?? !1,
|
|
@@ -14006,7 +13996,7 @@ class Do extends W {
|
|
|
14006
13996
|
};
|
|
14007
13997
|
if (n.comments && !n.resolveUsers)
|
|
14008
13998
|
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 =
|
|
13999
|
+
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
14000
|
editor: this,
|
|
14011
14001
|
domAttributes: n.domAttributes || {},
|
|
14012
14002
|
blockSpecs: this.schema.blockSpecs,
|
|
@@ -14018,7 +14008,7 @@ class Do extends W {
|
|
|
14018
14008
|
setIdAttribute: n.setIdAttribute,
|
|
14019
14009
|
animations: n.animations ?? !0,
|
|
14020
14010
|
tableHandles: P("table", this),
|
|
14021
|
-
dropCursor: this.options.dropCursor ??
|
|
14011
|
+
dropCursor: this.options.dropCursor ?? Ii,
|
|
14022
14012
|
placeholders: n.placeholders,
|
|
14023
14013
|
tabBehavior: n.tabBehavior,
|
|
14024
14014
|
sideMenuDetection: n.sideMenuDetection || "viewport",
|
|
@@ -14044,12 +14034,9 @@ class Do extends W {
|
|
|
14044
14034
|
}
|
|
14045
14035
|
this.resolveFileUrl = n.resolveFileUrl, this.headless = n._headless;
|
|
14046
14036
|
const r = "collaboration" in this.extensions || "liveblocksExtension" in this.extensions;
|
|
14047
|
-
|
|
14037
|
+
r && n.initialContent && console.warn(
|
|
14048
14038
|
"When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider"
|
|
14049
|
-
)
|
|
14050
|
-
throw new Error(
|
|
14051
|
-
"Comments are only supported when collaboration is enabled, please set the collaboration option"
|
|
14052
|
-
);
|
|
14039
|
+
);
|
|
14053
14040
|
const a = n.initialContent || (r ? [
|
|
14054
14041
|
{
|
|
14055
14042
|
type: "paragraph",
|
|
@@ -14079,7 +14066,7 @@ class Do extends W {
|
|
|
14079
14066
|
});
|
|
14080
14067
|
})
|
|
14081
14068
|
], l = {
|
|
14082
|
-
...
|
|
14069
|
+
...gs,
|
|
14083
14070
|
...n._tiptapOptions,
|
|
14084
14071
|
content: a,
|
|
14085
14072
|
extensions: s,
|
|
@@ -14098,16 +14085,16 @@ class Do extends W {
|
|
|
14098
14085
|
((w = (_ = n.domAttributes) == null ? void 0 : _.editor) == null ? void 0 : w.class) || ""
|
|
14099
14086
|
)
|
|
14100
14087
|
},
|
|
14101
|
-
transformPasted:
|
|
14088
|
+
transformPasted: hs
|
|
14102
14089
|
}
|
|
14103
14090
|
};
|
|
14104
|
-
this.headless ? this.pmSchema =
|
|
14091
|
+
this.headless ? this.pmSchema = Yo(l.extensions) : (this._tiptapEditor = Le.create(
|
|
14105
14092
|
l,
|
|
14106
14093
|
this.schema.styleSchema
|
|
14107
14094
|
), this.pmSchema = this._tiptapEditor.schema), this.emit("create");
|
|
14108
14095
|
}
|
|
14109
14096
|
static create(t = {}) {
|
|
14110
|
-
return new
|
|
14097
|
+
return new Ro(t);
|
|
14111
14098
|
}
|
|
14112
14099
|
/**
|
|
14113
14100
|
* Get the underlying prosemirror view
|
|
@@ -14175,7 +14162,7 @@ class Do extends W {
|
|
|
14175
14162
|
* matching block was found.
|
|
14176
14163
|
*/
|
|
14177
14164
|
getBlock(t) {
|
|
14178
|
-
return
|
|
14165
|
+
return Wr(this, t);
|
|
14179
14166
|
}
|
|
14180
14167
|
/**
|
|
14181
14168
|
* Gets a snapshot of the previous sibling of an existing block from the
|
|
@@ -14187,7 +14174,7 @@ class Do extends W {
|
|
|
14187
14174
|
* in the document.
|
|
14188
14175
|
*/
|
|
14189
14176
|
getPrevBlock(t) {
|
|
14190
|
-
return
|
|
14177
|
+
return Kr(this, t);
|
|
14191
14178
|
}
|
|
14192
14179
|
/**
|
|
14193
14180
|
* Gets a snapshot of the next sibling of an existing block from the editor.
|
|
@@ -14198,7 +14185,7 @@ class Do extends W {
|
|
|
14198
14185
|
* the document.
|
|
14199
14186
|
*/
|
|
14200
14187
|
getNextBlock(t) {
|
|
14201
|
-
return
|
|
14188
|
+
return qr(this, t);
|
|
14202
14189
|
}
|
|
14203
14190
|
/**
|
|
14204
14191
|
* Gets a snapshot of the parent of an existing block from the editor.
|
|
@@ -14208,7 +14195,7 @@ class Do extends W {
|
|
|
14208
14195
|
* if no matching block was found, or the block isn't nested.
|
|
14209
14196
|
*/
|
|
14210
14197
|
getParentBlock(t) {
|
|
14211
|
-
return
|
|
14198
|
+
return Xr(this, t);
|
|
14212
14199
|
}
|
|
14213
14200
|
/**
|
|
14214
14201
|
* Traverses all blocks in the editor depth-first, and executes a callback for each.
|
|
@@ -14253,7 +14240,7 @@ class Do extends W {
|
|
|
14253
14240
|
* @returns A snapshot of the current text cursor position.
|
|
14254
14241
|
*/
|
|
14255
14242
|
getTextCursorPosition() {
|
|
14256
|
-
return
|
|
14243
|
+
return Qr(this);
|
|
14257
14244
|
}
|
|
14258
14245
|
/**
|
|
14259
14246
|
* Sets the text cursor position to the start or end of an existing block. Throws an error if the target block could
|
|
@@ -14262,16 +14249,16 @@ class Do extends W {
|
|
|
14262
14249
|
* @param placement Whether the text cursor should be placed at the start or end of the block.
|
|
14263
14250
|
*/
|
|
14264
14251
|
setTextCursorPosition(t, i = "start") {
|
|
14265
|
-
|
|
14252
|
+
Eo(this, t, i);
|
|
14266
14253
|
}
|
|
14267
14254
|
/**
|
|
14268
14255
|
* Gets a snapshot of the current selection.
|
|
14269
14256
|
*/
|
|
14270
14257
|
getSelection() {
|
|
14271
|
-
return
|
|
14258
|
+
return Jr(this);
|
|
14272
14259
|
}
|
|
14273
14260
|
setSelection(t, i) {
|
|
14274
|
-
|
|
14261
|
+
Yr(this, t, i);
|
|
14275
14262
|
}
|
|
14276
14263
|
/**
|
|
14277
14264
|
* Checks if the editor is currently editable, or if it's locked.
|
|
@@ -14306,7 +14293,7 @@ class Do extends W {
|
|
|
14306
14293
|
* `referenceBlock`.
|
|
14307
14294
|
*/
|
|
14308
14295
|
insertBlocks(t, i, n = "before") {
|
|
14309
|
-
return
|
|
14296
|
+
return jr(this, t, i, n);
|
|
14310
14297
|
}
|
|
14311
14298
|
/**
|
|
14312
14299
|
* Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
|
|
@@ -14316,14 +14303,14 @@ class Do extends W {
|
|
|
14316
14303
|
* @param update A partial block which defines how the existing block should be changed.
|
|
14317
14304
|
*/
|
|
14318
14305
|
updateBlock(t, i) {
|
|
14319
|
-
return
|
|
14306
|
+
return gn(this, t, i);
|
|
14320
14307
|
}
|
|
14321
14308
|
/**
|
|
14322
14309
|
* Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
|
|
14323
14310
|
* @param blocksToRemove An array of identifiers for existing blocks that should be removed.
|
|
14324
14311
|
*/
|
|
14325
14312
|
removeBlocks(t) {
|
|
14326
|
-
return
|
|
14313
|
+
return Gr(this, t);
|
|
14327
14314
|
}
|
|
14328
14315
|
/**
|
|
14329
14316
|
* Replaces existing blocks in the editor with new blocks. If the blocks that should be removed are not adjacent or
|
|
@@ -14333,7 +14320,7 @@ class Do extends W {
|
|
|
14333
14320
|
* @param blocksToInsert An array of partial blocks to replace the old ones with.
|
|
14334
14321
|
*/
|
|
14335
14322
|
replaceBlocks(t, i) {
|
|
14336
|
-
return
|
|
14323
|
+
return $r(this, t, i);
|
|
14337
14324
|
}
|
|
14338
14325
|
/**
|
|
14339
14326
|
* Insert a piece of content at the current cursor position.
|
|
@@ -14346,7 +14333,7 @@ class Do extends W {
|
|
|
14346
14333
|
this.pmSchema,
|
|
14347
14334
|
this.schema.styleSchema
|
|
14348
14335
|
);
|
|
14349
|
-
|
|
14336
|
+
Zr(
|
|
14350
14337
|
{
|
|
14351
14338
|
from: this._tiptapEditor.state.selection.from,
|
|
14352
14339
|
to: this._tiptapEditor.state.selection.to
|
|
@@ -14448,25 +14435,25 @@ class Do extends W {
|
|
|
14448
14435
|
* Checks if the block containing the text cursor can be nested.
|
|
14449
14436
|
*/
|
|
14450
14437
|
canNestBlock() {
|
|
14451
|
-
return
|
|
14438
|
+
return zr(this);
|
|
14452
14439
|
}
|
|
14453
14440
|
/**
|
|
14454
14441
|
* Nests the block containing the text cursor into the block above it.
|
|
14455
14442
|
*/
|
|
14456
14443
|
nestBlock() {
|
|
14457
|
-
|
|
14444
|
+
xo(this);
|
|
14458
14445
|
}
|
|
14459
14446
|
/**
|
|
14460
14447
|
* Checks if the block containing the text cursor is nested.
|
|
14461
14448
|
*/
|
|
14462
14449
|
canUnnestBlock() {
|
|
14463
|
-
return
|
|
14450
|
+
return Fr(this);
|
|
14464
14451
|
}
|
|
14465
14452
|
/**
|
|
14466
14453
|
* Lifts the block containing the text cursor out of its parent.
|
|
14467
14454
|
*/
|
|
14468
14455
|
unnestBlock() {
|
|
14469
|
-
|
|
14456
|
+
Vr(this);
|
|
14470
14457
|
}
|
|
14471
14458
|
/**
|
|
14472
14459
|
* Moves the selected blocks up. If the previous block has children, moves
|
|
@@ -14474,7 +14461,7 @@ class Do extends W {
|
|
|
14474
14461
|
* current blocks share a common parent, moves them out of & before it.
|
|
14475
14462
|
*/
|
|
14476
14463
|
moveBlocksUp() {
|
|
14477
|
-
|
|
14464
|
+
Ur(this);
|
|
14478
14465
|
}
|
|
14479
14466
|
/**
|
|
14480
14467
|
* Moves the selected blocks down. If the next block has children, moves
|
|
@@ -14482,7 +14469,7 @@ class Do extends W {
|
|
|
14482
14469
|
* current blocks share a common parent, moves them out of & after it.
|
|
14483
14470
|
*/
|
|
14484
14471
|
moveBlocksDown() {
|
|
14485
|
-
|
|
14472
|
+
Hr(this);
|
|
14486
14473
|
}
|
|
14487
14474
|
/**
|
|
14488
14475
|
* Exports blocks into a simplified HTML string. To better conform to HTML standards, children of blocks which aren't list
|
|
@@ -14504,7 +14491,7 @@ class Do extends W {
|
|
|
14504
14491
|
* @returns The blocks, serialized as an HTML string.
|
|
14505
14492
|
*/
|
|
14506
14493
|
async blocksToFullHTML(t) {
|
|
14507
|
-
return
|
|
14494
|
+
return yn(this.pmSchema, this).serializeBlocks(t, {});
|
|
14508
14495
|
}
|
|
14509
14496
|
/**
|
|
14510
14497
|
* Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
|
|
@@ -14514,7 +14501,7 @@ class Do extends W {
|
|
|
14514
14501
|
* @returns The blocks parsed from the HTML string.
|
|
14515
14502
|
*/
|
|
14516
14503
|
async tryParseHTMLToBlocks(t) {
|
|
14517
|
-
return
|
|
14504
|
+
return To(
|
|
14518
14505
|
t,
|
|
14519
14506
|
this.schema.blockSchema,
|
|
14520
14507
|
this.schema.inlineContentSchema,
|
|
@@ -14529,7 +14516,7 @@ class Do extends W {
|
|
|
14529
14516
|
* @returns The blocks, serialized as a Markdown string.
|
|
14530
14517
|
*/
|
|
14531
14518
|
async blocksToMarkdownLossy(t = this.document) {
|
|
14532
|
-
return
|
|
14519
|
+
return oa(t, this.pmSchema, this, {});
|
|
14533
14520
|
}
|
|
14534
14521
|
/**
|
|
14535
14522
|
* Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
|
|
@@ -14539,7 +14526,7 @@ class Do extends W {
|
|
|
14539
14526
|
* @returns The blocks parsed from the Markdown string.
|
|
14540
14527
|
*/
|
|
14541
14528
|
async tryParseMarkdownToBlocks(t) {
|
|
14542
|
-
return
|
|
14529
|
+
return da(
|
|
14543
14530
|
t,
|
|
14544
14531
|
this.schema.blockSchema,
|
|
14545
14532
|
this.schema.inlineContentSchema,
|
|
@@ -14583,7 +14570,7 @@ class Do extends W {
|
|
|
14583
14570
|
if (this.headless)
|
|
14584
14571
|
return;
|
|
14585
14572
|
const n = (r) => {
|
|
14586
|
-
r.transaction.getMeta(
|
|
14573
|
+
r.transaction.getMeta(Ft) && !i || t(this);
|
|
14587
14574
|
};
|
|
14588
14575
|
return this._tiptapEditor.on("selectionUpdate", n), () => {
|
|
14589
14576
|
this._tiptapEditor.off("selectionUpdate", n);
|
|
@@ -14604,7 +14591,7 @@ class Do extends W {
|
|
|
14604
14591
|
if (!this.prosemirrorView)
|
|
14605
14592
|
return;
|
|
14606
14593
|
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 (
|
|
14594
|
+
if (Fe(i)) {
|
|
14608
14595
|
const l = this.prosemirrorView.nodeDOM(r);
|
|
14609
14596
|
if (l)
|
|
14610
14597
|
return l.getBoundingClientRect();
|
|
@@ -14755,19 +14742,25 @@ function bl(e) {
|
|
|
14755
14742
|
createStyleMapping: (o) => o
|
|
14756
14743
|
};
|
|
14757
14744
|
}
|
|
14758
|
-
let Be
|
|
14745
|
+
let Be;
|
|
14746
|
+
async function bs() {
|
|
14747
|
+
return Be || (Be = (async () => {
|
|
14748
|
+
const [e, o] = await Promise.all([
|
|
14749
|
+
import("emoji-mart"),
|
|
14750
|
+
// use a dynamic import to encourage bundle-splitting
|
|
14751
|
+
// and a smaller initial client bundle size
|
|
14752
|
+
import("@emoji-mart/data")
|
|
14753
|
+
]), t = "default" in e ? e.default : e, i = "default" in o ? o.default : o;
|
|
14754
|
+
return await t.init({ data: i }), { emojiMart: t, emojiData: i };
|
|
14755
|
+
})(), Be);
|
|
14756
|
+
}
|
|
14759
14757
|
async function kl(e, o) {
|
|
14760
14758
|
if (!Lr("text", e))
|
|
14761
14759
|
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 + " ")
|
|
14760
|
+
const { emojiData: t, emojiMart: i } = await bs();
|
|
14761
|
+
return (o.trim() === "" ? Object.values(t.emojis) : await i.SearchIndex.search(o)).map((r) => ({
|
|
14762
|
+
id: r.skins[0].native,
|
|
14763
|
+
onItemClick: () => e.insertInlineContent(r.skins[0].native + " ")
|
|
14771
14764
|
}));
|
|
14772
14765
|
}
|
|
14773
14766
|
function _l(e, ...o) {
|
|
@@ -14781,7 +14774,7 @@ function _l(e, ...o) {
|
|
|
14781
14774
|
}
|
|
14782
14775
|
return t;
|
|
14783
14776
|
}
|
|
14784
|
-
function
|
|
14777
|
+
function Ve(e = "") {
|
|
14785
14778
|
return typeof e == "string" ? [
|
|
14786
14779
|
{
|
|
14787
14780
|
type: "text",
|
|
@@ -14792,9 +14785,9 @@ function ze(e = "") {
|
|
|
14792
14785
|
}
|
|
14793
14786
|
function se(e) {
|
|
14794
14787
|
var o, t, i, n, r;
|
|
14795
|
-
return typeof e == "string" ?
|
|
14788
|
+
return typeof e == "string" ? Ve(e) : Array.isArray(e) ? e.flatMap((a) => typeof a == "string" ? Ve(a) : ot(a) ? {
|
|
14796
14789
|
...a,
|
|
14797
|
-
content:
|
|
14790
|
+
content: Ve(a.content)
|
|
14798
14791
|
} : X(a) ? a : {
|
|
14799
14792
|
props: {},
|
|
14800
14793
|
...a,
|
|
@@ -14824,10 +14817,10 @@ function se(e) {
|
|
|
14824
14817
|
}
|
|
14825
14818
|
function wl(e, o) {
|
|
14826
14819
|
return o.map(
|
|
14827
|
-
(t) =>
|
|
14820
|
+
(t) => Do(e.blockSchema, t)
|
|
14828
14821
|
);
|
|
14829
14822
|
}
|
|
14830
|
-
function
|
|
14823
|
+
function Do(e, o) {
|
|
14831
14824
|
var n;
|
|
14832
14825
|
const t = e[o.type].content, i = {
|
|
14833
14826
|
id: "",
|
|
@@ -14866,7 +14859,7 @@ function Uo(e, o) {
|
|
|
14866
14859
|
return {
|
|
14867
14860
|
...i,
|
|
14868
14861
|
content: se(i.content),
|
|
14869
|
-
children: i.children.map((r) =>
|
|
14862
|
+
children: i.children.map((r) => Do(e, r))
|
|
14870
14863
|
};
|
|
14871
14864
|
}
|
|
14872
14865
|
function ks(e) {
|
|
@@ -14877,174 +14870,174 @@ function _s(e) {
|
|
|
14877
14870
|
ks(o);
|
|
14878
14871
|
}
|
|
14879
14872
|
export {
|
|
14880
|
-
|
|
14881
|
-
|
|
14873
|
+
In as AudioBlock,
|
|
14874
|
+
Ro as BlockNoteEditor,
|
|
14882
14875
|
Ce as BlockNoteSchema,
|
|
14883
14876
|
fl as COLORS_DARK_MODE_DEFAULT,
|
|
14884
14877
|
hl as COLORS_DEFAULT,
|
|
14885
|
-
|
|
14886
|
-
|
|
14878
|
+
An as CodeBlock,
|
|
14879
|
+
ja as DEFAULT_LINK_PROTOCOL,
|
|
14887
14880
|
il as EMPTY_CELL_HEIGHT,
|
|
14888
|
-
|
|
14881
|
+
fo as EMPTY_CELL_WIDTH,
|
|
14889
14882
|
gl as Exporter,
|
|
14890
|
-
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
|
|
14894
|
-
|
|
14895
|
-
|
|
14896
|
-
|
|
14897
|
-
|
|
14898
|
-
|
|
14899
|
-
|
|
14900
|
-
|
|
14901
|
-
|
|
14902
|
-
|
|
14903
|
-
|
|
14904
|
-
|
|
14905
|
-
|
|
14906
|
-
|
|
14907
|
-
|
|
14883
|
+
Sn as FILE_AUDIO_ICON_SVG,
|
|
14884
|
+
Cn as FILE_ICON_SVG,
|
|
14885
|
+
Hn as FILE_IMAGE_ICON_SVG,
|
|
14886
|
+
yr as FILE_VIDEO_ICON_SVG,
|
|
14887
|
+
Un as FileBlock,
|
|
14888
|
+
xa as FilePanelProsemirrorPlugin,
|
|
14889
|
+
Ca as FilePanelView,
|
|
14890
|
+
Ba as FormattingToolbarProsemirrorPlugin,
|
|
14891
|
+
Sa as FormattingToolbarView,
|
|
14892
|
+
To as HTMLToBlocks,
|
|
14893
|
+
Gn as ImageBlock,
|
|
14894
|
+
Pa as LinkToolbarProsemirrorPlugin,
|
|
14895
|
+
Zn as PageBreak,
|
|
14896
|
+
qa as SideMenuProsemirrorPlugin,
|
|
14897
|
+
Wa as SideMenuView,
|
|
14898
|
+
Ja as SuggestionMenuProseMirrorPlugin,
|
|
14899
|
+
os as TableHandlesProsemirrorPlugin,
|
|
14900
|
+
ts as TableHandlesView,
|
|
14908
14901
|
we as UniqueID,
|
|
14909
14902
|
H as UnreachableCaseError,
|
|
14910
|
-
|
|
14911
|
-
|
|
14903
|
+
Na as VALID_LINK_PROTOCOLS,
|
|
14904
|
+
Br as VideoBlock,
|
|
14912
14905
|
ks as addIdsToBlock,
|
|
14913
14906
|
_s as addIdsToBlocks,
|
|
14914
|
-
|
|
14915
|
-
|
|
14916
|
-
|
|
14917
|
-
|
|
14907
|
+
kt as addInlineContentAttributes,
|
|
14908
|
+
tn as addInlineContentKeyboardShortcuts,
|
|
14909
|
+
sn as addStyleAttributes,
|
|
14910
|
+
Qi as applyNonSelectableBlockFix,
|
|
14918
14911
|
Zs as assertEmpty,
|
|
14919
|
-
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14912
|
+
Bn as audioBlockConfig,
|
|
14913
|
+
Mn as audioParse,
|
|
14914
|
+
En as audioPropSchema,
|
|
14915
|
+
Tn as audioRender,
|
|
14923
14916
|
Ln as audioToExternalHTML,
|
|
14924
14917
|
ie as blockToNode,
|
|
14925
|
-
|
|
14918
|
+
oa as blocksToMarkdown,
|
|
14926
14919
|
Me as camelToDataKebab,
|
|
14927
14920
|
ll as checkBlockHasDefaultProp,
|
|
14928
|
-
|
|
14921
|
+
Ir as checkBlockIsDefaultType,
|
|
14929
14922
|
rl as checkBlockIsFileBlock,
|
|
14930
14923
|
sl as checkBlockIsFileBlockWithPlaceholder,
|
|
14931
14924
|
al as checkBlockIsFileBlockWithPreview,
|
|
14932
|
-
|
|
14925
|
+
Ar as checkBlockTypeHasDefaultProp,
|
|
14933
14926
|
P as checkDefaultBlockTypeInSchema,
|
|
14934
14927
|
Lr as checkDefaultInlineContentTypeInSchema,
|
|
14935
|
-
|
|
14936
|
-
|
|
14928
|
+
Nr as checkPageBreakBlocksInSchema,
|
|
14929
|
+
dt as cleanHTMLToMarkdown,
|
|
14937
14930
|
_l as combineByGroup,
|
|
14938
14931
|
Ae as contentNodeToInlineContent,
|
|
14939
|
-
|
|
14940
|
-
|
|
14932
|
+
qt as contentNodeToTableContent,
|
|
14933
|
+
vn as createAddFileButton,
|
|
14941
14934
|
ve as createBlockSpec,
|
|
14942
14935
|
J as createBlockSpecFromStronglyTypedTiptapNode,
|
|
14943
14936
|
$ as createDefaultBlockDOMOutputSpec,
|
|
14944
14937
|
Ne as createExternalHTMLExporter,
|
|
14945
|
-
|
|
14946
|
-
|
|
14947
|
-
|
|
14938
|
+
at as createFigureWithCaption,
|
|
14939
|
+
rt as createFileBlockWrapper,
|
|
14940
|
+
xn as createFileNameWithIcon,
|
|
14948
14941
|
Qs as createInlineContentSpec,
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
|
|
14942
|
+
nn as createInlineContentSpecFromTipTapNode,
|
|
14943
|
+
Wt as createInternalBlockSpec,
|
|
14944
|
+
yn as createInternalHTMLSerializer,
|
|
14945
|
+
on as createInternalInlineContentSpec,
|
|
14946
|
+
Zt as createInternalStyleSpec,
|
|
14954
14947
|
Re as createLinkWithCaption,
|
|
14955
|
-
|
|
14948
|
+
co as createResizableFileBlockWrapper,
|
|
14956
14949
|
G as createStronglyTypedTiptapNode,
|
|
14957
14950
|
el as createStyleSpec,
|
|
14958
14951
|
Q as createStyleSpecFromTipTapMark,
|
|
14959
14952
|
ml as createSuggestionMenu,
|
|
14960
14953
|
tl as customizeCodeBlock,
|
|
14961
|
-
|
|
14962
|
-
|
|
14963
|
-
|
|
14964
|
-
|
|
14965
|
-
|
|
14966
|
-
|
|
14954
|
+
Tr as defaultBlockSchema,
|
|
14955
|
+
go as defaultBlockSpecs,
|
|
14956
|
+
bt as defaultBlockToHTML,
|
|
14957
|
+
Je as defaultCodeBlockPropSchema,
|
|
14958
|
+
Mr as defaultInlineContentSchema,
|
|
14959
|
+
ko as defaultInlineContentSpecs,
|
|
14967
14960
|
B as defaultProps,
|
|
14968
14961
|
nl as defaultStyleSchema,
|
|
14969
|
-
|
|
14962
|
+
bo as defaultStyleSpecs,
|
|
14970
14963
|
ne as esmDependencies,
|
|
14971
|
-
|
|
14972
|
-
|
|
14973
|
-
|
|
14974
|
-
|
|
14975
|
-
|
|
14964
|
+
Nn as fileBlockConfig,
|
|
14965
|
+
Rn as fileParse,
|
|
14966
|
+
Pn as filePropSchema,
|
|
14967
|
+
jn as fileRender,
|
|
14968
|
+
Dn as fileToExternalHTML,
|
|
14976
14969
|
Ys as filenameFromURL,
|
|
14977
14970
|
cl as filterSuggestionItems,
|
|
14978
14971
|
K as formatKeyboardShortcut,
|
|
14979
|
-
|
|
14980
|
-
|
|
14972
|
+
Ea as formattingToolbarPluginKey,
|
|
14973
|
+
Yi as getBlockFromPos,
|
|
14981
14974
|
te as getBlockInfo,
|
|
14982
14975
|
_e as getBlockInfoFromResolvedPos,
|
|
14983
14976
|
y as getBlockInfoFromSelection,
|
|
14984
|
-
|
|
14985
|
-
|
|
14986
|
-
|
|
14977
|
+
tt as getBlockInfoWithManualOffset,
|
|
14978
|
+
cs as getBlockNoteExtensions,
|
|
14979
|
+
Kt as getBlockSchemaFromSpecs,
|
|
14987
14980
|
he as getColspan,
|
|
14988
14981
|
kl as getDefaultEmojiPickerItems,
|
|
14989
14982
|
dl as getDefaultSlashMenuItems,
|
|
14990
|
-
|
|
14991
|
-
|
|
14983
|
+
rn as getInlineContentParseRules,
|
|
14984
|
+
Xt as getInlineContentSchemaFromSpecs,
|
|
14992
14985
|
q as getNearestBlockPos,
|
|
14993
14986
|
R as getNodeById,
|
|
14994
14987
|
pl as getPageBreakSlashMenuItems,
|
|
14995
|
-
|
|
14996
|
-
|
|
14997
|
-
|
|
14998
|
-
|
|
14999
|
-
|
|
15000
|
-
|
|
15001
|
-
|
|
15002
|
-
|
|
15003
|
-
|
|
15004
|
-
|
|
15005
|
-
|
|
14988
|
+
en as getParseRules,
|
|
14989
|
+
Ge as getRowspan,
|
|
14990
|
+
ln as getStyleParseRules,
|
|
14991
|
+
Jt as getStyleSchemaFromSpecs,
|
|
14992
|
+
Vn as imageBlockConfig,
|
|
14993
|
+
Fn as imageParse,
|
|
14994
|
+
On as imagePropSchema,
|
|
14995
|
+
zn as imageRender,
|
|
14996
|
+
$n as imageToExternalHTML,
|
|
14997
|
+
Gt as inheritedProps,
|
|
14998
|
+
lt as initializeESMDependencies,
|
|
15006
14999
|
D as inlineContentToNodes,
|
|
15007
|
-
|
|
15008
|
-
|
|
15009
|
-
|
|
15010
|
-
|
|
15000
|
+
L as insertOrUpdateBlock,
|
|
15001
|
+
Ji as isAppleOS,
|
|
15002
|
+
gt as isLinkInlineContent,
|
|
15003
|
+
ot as isPartialLinkInlineContent,
|
|
15011
15004
|
me as isPartialTableCell,
|
|
15012
15005
|
Js as isSafari,
|
|
15013
15006
|
X as isStyledTextInlineContent,
|
|
15014
|
-
|
|
15015
|
-
|
|
15016
|
-
|
|
15007
|
+
it as isTableCell,
|
|
15008
|
+
Et as isTableCellSelection,
|
|
15009
|
+
Aa as linkToolbarPluginKey,
|
|
15017
15010
|
Xs as locales,
|
|
15018
|
-
|
|
15011
|
+
$e as mapTableCell,
|
|
15019
15012
|
bl as mappingFactory,
|
|
15020
|
-
|
|
15013
|
+
da as markdownToBlocks,
|
|
15021
15014
|
Z as mergeCSSClasses,
|
|
15022
15015
|
x as nodeToBlock,
|
|
15023
|
-
|
|
15024
|
-
|
|
15025
|
-
|
|
15026
|
-
|
|
15027
|
-
|
|
15028
|
-
|
|
15029
|
-
|
|
15016
|
+
We as nodeToCustomInlineContent,
|
|
15017
|
+
Wn as pageBreakConfig,
|
|
15018
|
+
qn as pageBreakParse,
|
|
15019
|
+
Kn as pageBreakRender,
|
|
15020
|
+
_o as pageBreakSchema,
|
|
15021
|
+
Xn as pageBreakToExternalHTML,
|
|
15022
|
+
Ct as parseEmbedElement,
|
|
15030
15023
|
je as parseFigureElement,
|
|
15031
|
-
|
|
15024
|
+
Do as partialBlockToBlockForTesting,
|
|
15032
15025
|
wl as partialBlocksToBlocksForTesting,
|
|
15033
15026
|
ye as propsToAttributes,
|
|
15034
15027
|
Ue as shikiHighlighterPromiseSymbol,
|
|
15035
|
-
|
|
15036
|
-
|
|
15037
|
-
|
|
15028
|
+
vt as shikiParserSymbol,
|
|
15029
|
+
Ka as sideMenuPluginKey,
|
|
15030
|
+
an as stylePropsToAttributes,
|
|
15038
15031
|
Pe as tableContentToNodes,
|
|
15039
15032
|
pe as tableHandlesPluginKey,
|
|
15040
|
-
|
|
15033
|
+
gn as updateBlock,
|
|
15041
15034
|
M as updateBlockCommand,
|
|
15042
15035
|
ol as uploadToTmpFilesDotOrg_DEV_ONLY,
|
|
15043
|
-
|
|
15044
|
-
|
|
15045
|
-
|
|
15046
|
-
|
|
15047
|
-
|
|
15036
|
+
Cr as videoBlockConfig,
|
|
15037
|
+
Sr as videoParse,
|
|
15038
|
+
vr as videoPropSchema,
|
|
15039
|
+
xr as videoRender,
|
|
15040
|
+
Er as videoToExternalHTML,
|
|
15048
15041
|
ul as withPageBreak,
|
|
15049
15042
|
xe as wrapInBlockStructure
|
|
15050
15043
|
};
|