@blocknote/core 0.25.2 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote.cjs +7 -7
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +759 -618
- package/dist/blocknote.js.map +1 -1
- package/dist/comments.cjs +1 -1
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.js +45 -44
- 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 +2 -2
- package/src/api/nodeConversions/nodeToBlock.ts +1 -0
- package/src/api/parsers/html/__snapshots__/parse-2-tables.json +129 -0
- package/src/api/parsers/html/parseHTML.test.ts +35 -0
- package/src/comments/threadstore/yjs/YjsThreadStore.ts +1 -0
- package/src/comments/threadstore/yjs/yjsHelpers.ts +3 -1
- package/src/comments/types.ts +4 -0
- package/src/editor/Block.css +1 -1
- package/src/editor/BlockNoteEditor.ts +1 -1
- package/src/editor/BlockNoteTipTapEditor.ts +18 -7
- package/src/extensions/Comments/CommentsPlugin.ts +76 -29
- package/src/extensions/SideMenu/dragging.ts +13 -0
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +6 -2
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +24 -23
- package/src/i18n/locales/ar.ts +4 -0
- package/src/i18n/locales/de.ts +15 -1
- package/src/i18n/locales/en.ts +4 -0
- package/src/i18n/locales/es.ts +15 -1
- package/src/i18n/locales/fr.ts +4 -0
- package/src/i18n/locales/hr.ts +21 -4
- package/src/i18n/locales/is.ts +4 -0
- package/src/i18n/locales/it.ts +15 -1
- package/src/i18n/locales/ja.ts +4 -0
- package/src/i18n/locales/ko.ts +4 -0
- package/src/i18n/locales/nl.ts +4 -0
- package/src/i18n/locales/no.ts +4 -0
- package/src/i18n/locales/pl.ts +4 -0
- package/src/i18n/locales/pt.ts +4 -0
- package/src/i18n/locales/ru.ts +4 -0
- package/src/i18n/locales/uk.ts +4 -0
- package/src/i18n/locales/vi.ts +4 -0
- package/src/i18n/locales/zh.ts +4 -0
- package/types/src/comments/types.d.ts +4 -0
- package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -1
- package/types/src/extensions/Comments/CommentsPlugin.d.ts +16 -1
- package/types/src/extensions/Comments/threadstore/DefaultThreadStoreAuth.d.ts +47 -0
- package/types/src/extensions/Comments/threadstore/ThreadStore.d.ts +121 -0
- package/types/src/extensions/Comments/threadstore/ThreadStoreAuth.d.ts +12 -0
- package/types/src/extensions/Comments/threadstore/TipTapThreadStore.d.ts +97 -0
- package/types/src/extensions/Comments/threadstore/yjs/RESTYjsThreadStore.d.ts +83 -0
- package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.d.ts +79 -0
- package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.test.d.ts +1 -0
- package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStoreBase.d.ts +15 -0
- package/types/src/extensions/Comments/threadstore/yjs/yjsHelpers.d.ts +13 -0
- package/types/src/extensions/Comments/types.d.ts +109 -0
- package/types/src/i18n/locales/de.d.ts +2 -304
- package/types/src/i18n/locales/en.d.ts +4 -0
- package/types/src/i18n/locales/es.d.ts +2 -269
- package/types/src/i18n/locales/hr.d.ts +2 -266
- package/types/src/i18n/locales/it.d.ts +2 -269
- package/types/src/models/User.d.ts +5 -0
- package/types/src/blocks/CodeBlockContent/shiki.bundle.d.ts +0 -82
package/dist/blocknote.js
CHANGED
|
@@ -2,30 +2,30 @@ var Uo = Object.defineProperty;
|
|
|
2
2
|
var Ho = (e, o, t) => o in e ? Uo(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
3
|
var p = (e, o, t) => Ho(e, typeof o != "symbol" ? o + "" : o, t);
|
|
4
4
|
import { Slice as ee, Fragment as U, DOMSerializer as Ut, DOMParser as Ht, Node as Oo } from "prosemirror-model";
|
|
5
|
-
import { ReplaceStep as
|
|
6
|
-
import { Extension as j, combineTransactionSteps as
|
|
5
|
+
import { ReplaceStep as zo, ReplaceAroundStep as Ve } from "prosemirror-transform";
|
|
6
|
+
import { Extension as j, combineTransactionSteps as Vo, getChangedRanges as Fo, findChildrenInRange as $o, Node as de, Mark as ge, InputRule as le, isTextSelection as Ot, callOrReturn as Go, getExtensionField as Ko, selectionToInsertionEnd as Wo, mergeAttributes as qo, isNodeSelection as Fe, posToDOMRect as Te, getMarkRange as pt, findChildren as mt, findParentNode as Zo, extensions as ce, Editor as Xo, createDocument as Jo, getSchema as Yo } from "@tiptap/core";
|
|
7
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
|
|
8
|
+
import { v4 as zt } from "uuid";
|
|
9
9
|
import { createHighlightPlugin as ei } from "prosemirror-highlight";
|
|
10
10
|
import { createParser as ti } from "prosemirror-highlight/shiki";
|
|
11
|
-
import { bundledLanguagesInfo as
|
|
12
|
-
import { columnResizing as ii, tableEditing as ni, goToNextCell as ht, TableView as ri, CellSelection as
|
|
11
|
+
import { bundledLanguagesInfo as Vt, createHighlighter as oi } from "shiki";
|
|
12
|
+
import { columnResizing as ii, tableEditing as ni, goToNextCell as ht, TableView as ri, CellSelection as _e, 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
13
|
import hi from "@tiptap/extension-bold";
|
|
14
14
|
import fi from "@tiptap/extension-code";
|
|
15
15
|
import gi from "@tiptap/extension-italic";
|
|
16
16
|
import bi from "@tiptap/extension-strike";
|
|
17
|
-
import
|
|
18
|
-
import { TableCell as
|
|
17
|
+
import _i from "@tiptap/extension-underline";
|
|
18
|
+
import { TableCell as ki } from "@tiptap/extension-table-cell";
|
|
19
19
|
import { TableHeader as wi } from "@tiptap/extension-table-header";
|
|
20
|
-
import { TableRow as
|
|
21
|
-
import { Gapcursor as
|
|
20
|
+
import { TableRow as vi } from "@tiptap/extension-table-row";
|
|
21
|
+
import { Gapcursor as yi } from "@tiptap/extension-gapcursor";
|
|
22
22
|
import { HardBreak as Ci } from "@tiptap/extension-hard-break";
|
|
23
23
|
import { History as xi } from "@tiptap/extension-history";
|
|
24
24
|
import { Link as Si } from "@tiptap/extension-link";
|
|
25
25
|
import { Text as Ei } from "@tiptap/extension-text";
|
|
26
26
|
import Bi from "@tiptap/extension-collaboration";
|
|
27
27
|
import Ti from "@tiptap/extension-collaboration-cursor";
|
|
28
|
-
import { DecorationSet as
|
|
28
|
+
import { DecorationSet as H, Decoration as F, EditorView as Mi } from "prosemirror-view";
|
|
29
29
|
import { ySyncPluginKey as Ft, getRelativeSelection as Li } from "y-prosemirror";
|
|
30
30
|
import { dropCursor as Ii } from "prosemirror-dropcursor";
|
|
31
31
|
const Ai = {
|
|
@@ -351,6 +351,10 @@ const Ai = {
|
|
|
351
351
|
},
|
|
352
352
|
reactions: {
|
|
353
353
|
reacted_by: "تفاعل بواسطة"
|
|
354
|
+
},
|
|
355
|
+
sidebar: {
|
|
356
|
+
marked_as_resolved: "تم وضع علامة كتم الحل",
|
|
357
|
+
more_replies: (e) => `${e} ردود أخرى`
|
|
354
358
|
}
|
|
355
359
|
},
|
|
356
360
|
generic: {
|
|
@@ -511,7 +515,9 @@ const Ai = {
|
|
|
511
515
|
},
|
|
512
516
|
drag_handle: {
|
|
513
517
|
delete_menuitem: "Löschen",
|
|
514
|
-
colors_menuitem: "Farben"
|
|
518
|
+
colors_menuitem: "Farben",
|
|
519
|
+
header_row_menuitem: "Kopfzeile",
|
|
520
|
+
header_column_menuitem: "Kopfspalte"
|
|
515
521
|
},
|
|
516
522
|
table_handle: {
|
|
517
523
|
delete_column_menuitem: "Spalte löschen",
|
|
@@ -519,7 +525,10 @@ const Ai = {
|
|
|
519
525
|
add_left_menuitem: "Spalte links hinzufügen",
|
|
520
526
|
add_right_menuitem: "Spalte rechts hinzufügen",
|
|
521
527
|
add_above_menuitem: "Zeile oberhalb hinzufügen",
|
|
522
|
-
add_below_menuitem: "Zeile unterhalb hinzufügen"
|
|
528
|
+
add_below_menuitem: "Zeile unterhalb hinzufügen",
|
|
529
|
+
split_cell_menuitem: "Zelle teilen",
|
|
530
|
+
merge_cells_menuitem: "Zellen zusammenführen",
|
|
531
|
+
background_color_menuitem: "Hintergrundfarbe"
|
|
523
532
|
},
|
|
524
533
|
suggestion_menu: {
|
|
525
534
|
no_items_title: "Keine Elemente gefunden",
|
|
@@ -634,6 +643,9 @@ const Ai = {
|
|
|
634
643
|
align_justify: {
|
|
635
644
|
tooltip: "Text Blocksatz"
|
|
636
645
|
},
|
|
646
|
+
table_cell_merge: {
|
|
647
|
+
tooltip: "Zellen zusammenführen"
|
|
648
|
+
},
|
|
637
649
|
comment: {
|
|
638
650
|
tooltip: "Kommentar hinzufügen"
|
|
639
651
|
}
|
|
@@ -686,6 +698,10 @@ const Ai = {
|
|
|
686
698
|
},
|
|
687
699
|
reactions: {
|
|
688
700
|
reacted_by: "Reagiert von"
|
|
701
|
+
},
|
|
702
|
+
sidebar: {
|
|
703
|
+
marked_as_resolved: "Als gelöst markiert",
|
|
704
|
+
more_replies: (e) => `${e} weitere Antworten`
|
|
689
705
|
}
|
|
690
706
|
},
|
|
691
707
|
generic: {
|
|
@@ -1031,12 +1047,16 @@ const Ai = {
|
|
|
1031
1047
|
},
|
|
1032
1048
|
reactions: {
|
|
1033
1049
|
reacted_by: "Reacted by"
|
|
1050
|
+
},
|
|
1051
|
+
sidebar: {
|
|
1052
|
+
marked_as_resolved: "Marked as resolved",
|
|
1053
|
+
more_replies: (e) => `${e} more replies`
|
|
1034
1054
|
}
|
|
1035
1055
|
},
|
|
1036
1056
|
generic: {
|
|
1037
1057
|
ctrl_shortcut: "Ctrl"
|
|
1038
1058
|
}
|
|
1039
|
-
},
|
|
1059
|
+
}, ji = {
|
|
1040
1060
|
slash_menu: {
|
|
1041
1061
|
heading: {
|
|
1042
1062
|
title: "Encabezado 1",
|
|
@@ -1190,7 +1210,9 @@ const Ai = {
|
|
|
1190
1210
|
},
|
|
1191
1211
|
drag_handle: {
|
|
1192
1212
|
delete_menuitem: "Eliminar",
|
|
1193
|
-
colors_menuitem: "Colores"
|
|
1213
|
+
colors_menuitem: "Colores",
|
|
1214
|
+
header_row_menuitem: "Fila de encabezado",
|
|
1215
|
+
header_column_menuitem: "Columna de encabezado"
|
|
1194
1216
|
},
|
|
1195
1217
|
table_handle: {
|
|
1196
1218
|
delete_column_menuitem: "Eliminar columna",
|
|
@@ -1198,7 +1220,10 @@ const Ai = {
|
|
|
1198
1220
|
add_left_menuitem: "Agregar columna a la izquierda",
|
|
1199
1221
|
add_right_menuitem: "Agregar columna a la derecha",
|
|
1200
1222
|
add_above_menuitem: "Agregar fila arriba",
|
|
1201
|
-
add_below_menuitem: "Agregar fila abajo"
|
|
1223
|
+
add_below_menuitem: "Agregar fila abajo",
|
|
1224
|
+
split_cell_menuitem: "Dividir celda",
|
|
1225
|
+
merge_cells_menuitem: "Combinar celdas",
|
|
1226
|
+
background_color_menuitem: "Color de fondo"
|
|
1202
1227
|
},
|
|
1203
1228
|
suggestion_menu: {
|
|
1204
1229
|
no_items_title: "No se encontraron elementos",
|
|
@@ -1313,6 +1338,9 @@ const Ai = {
|
|
|
1313
1338
|
align_justify: {
|
|
1314
1339
|
tooltip: "Justificar texto"
|
|
1315
1340
|
},
|
|
1341
|
+
table_cell_merge: {
|
|
1342
|
+
tooltip: "Combinar celdas"
|
|
1343
|
+
},
|
|
1316
1344
|
comment: {
|
|
1317
1345
|
tooltip: "Añadir comentario"
|
|
1318
1346
|
}
|
|
@@ -1365,12 +1393,16 @@ const Ai = {
|
|
|
1365
1393
|
},
|
|
1366
1394
|
reactions: {
|
|
1367
1395
|
reacted_by: "Reaccionado por"
|
|
1396
|
+
},
|
|
1397
|
+
sidebar: {
|
|
1398
|
+
marked_as_resolved: "Marcado como resuelto",
|
|
1399
|
+
more_replies: (e) => `${e} respuestas más`
|
|
1368
1400
|
}
|
|
1369
1401
|
},
|
|
1370
1402
|
generic: {
|
|
1371
1403
|
ctrl_shortcut: "Ctrl"
|
|
1372
1404
|
}
|
|
1373
|
-
},
|
|
1405
|
+
}, Ni = {
|
|
1374
1406
|
slash_menu: {
|
|
1375
1407
|
heading: {
|
|
1376
1408
|
title: "Titre 1",
|
|
@@ -1730,6 +1762,10 @@ const Ai = {
|
|
|
1730
1762
|
},
|
|
1731
1763
|
reactions: {
|
|
1732
1764
|
reacted_by: "Réagi par"
|
|
1765
|
+
},
|
|
1766
|
+
sidebar: {
|
|
1767
|
+
marked_as_resolved: "Marqué comme résolu",
|
|
1768
|
+
more_replies: (e) => `${e} réponses de plus`
|
|
1733
1769
|
}
|
|
1734
1770
|
},
|
|
1735
1771
|
generic: {
|
|
@@ -1805,6 +1841,12 @@ const Ai = {
|
|
|
1805
1841
|
aliases: ["tablica"],
|
|
1806
1842
|
group: "Napredno"
|
|
1807
1843
|
},
|
|
1844
|
+
code_block: {
|
|
1845
|
+
title: "Blok koda",
|
|
1846
|
+
subtext: "Blok koda sa sintaksnim isticanjem",
|
|
1847
|
+
aliases: ["code", "pre"],
|
|
1848
|
+
group: "Osnovni blokovi"
|
|
1849
|
+
},
|
|
1808
1850
|
page_break: {
|
|
1809
1851
|
title: "Prijelom stranice",
|
|
1810
1852
|
subtext: "Razdjelnik stranice",
|
|
@@ -1864,9 +1906,6 @@ const Ai = {
|
|
|
1864
1906
|
subtext: "Pretraži i umetni emoji",
|
|
1865
1907
|
aliases: ["emoji", "emotikon", "emocija", "lice"],
|
|
1866
1908
|
group: "Ostalo"
|
|
1867
|
-
},
|
|
1868
|
-
comment: {
|
|
1869
|
-
tooltip: "Dodaj komentar"
|
|
1870
1909
|
}
|
|
1871
1910
|
},
|
|
1872
1911
|
placeholders: {
|
|
@@ -1900,7 +1939,9 @@ const Ai = {
|
|
|
1900
1939
|
},
|
|
1901
1940
|
drag_handle: {
|
|
1902
1941
|
delete_menuitem: "Ukloni",
|
|
1903
|
-
colors_menuitem: "Boje"
|
|
1942
|
+
colors_menuitem: "Boje",
|
|
1943
|
+
header_row_menuitem: "Zaglavni redak",
|
|
1944
|
+
header_column_menuitem: "Zaglavni stupac"
|
|
1904
1945
|
},
|
|
1905
1946
|
table_handle: {
|
|
1906
1947
|
delete_column_menuitem: "Ukloni stupac",
|
|
@@ -1908,7 +1949,10 @@ const Ai = {
|
|
|
1908
1949
|
add_left_menuitem: "Dodaj stupac lijevo",
|
|
1909
1950
|
add_right_menuitem: "Dodaj stupac desno",
|
|
1910
1951
|
add_above_menuitem: "Dodaj redak iznad",
|
|
1911
|
-
add_below_menuitem: "Dodaj redak ispod"
|
|
1952
|
+
add_below_menuitem: "Dodaj redak ispod",
|
|
1953
|
+
split_cell_menuitem: "Podijeli ćeliju",
|
|
1954
|
+
merge_cells_menuitem: "Spoji ćelije",
|
|
1955
|
+
background_color_menuitem: "Boja pozadine"
|
|
1912
1956
|
},
|
|
1913
1957
|
suggestion_menu: {
|
|
1914
1958
|
no_items_title: "Stavke nisu pronađene",
|
|
@@ -2023,6 +2067,9 @@ const Ai = {
|
|
|
2023
2067
|
align_justify: {
|
|
2024
2068
|
tooltip: "Poravnaj tekst obostrano"
|
|
2025
2069
|
},
|
|
2070
|
+
table_cell_merge: {
|
|
2071
|
+
tooltip: "Spoji ćelije"
|
|
2072
|
+
},
|
|
2026
2073
|
comment: {
|
|
2027
2074
|
tooltip: "Dodaj komentar"
|
|
2028
2075
|
}
|
|
@@ -2075,6 +2122,10 @@ const Ai = {
|
|
|
2075
2122
|
},
|
|
2076
2123
|
reactions: {
|
|
2077
2124
|
reacted_by: "Reagirao/la"
|
|
2125
|
+
},
|
|
2126
|
+
sidebar: {
|
|
2127
|
+
marked_as_resolved: "Označeno kao riješeno",
|
|
2128
|
+
more_replies: (e) => `${e} dodatnih odgovora`
|
|
2078
2129
|
}
|
|
2079
2130
|
},
|
|
2080
2131
|
generic: {
|
|
@@ -2410,6 +2461,10 @@ const Ai = {
|
|
|
2410
2461
|
},
|
|
2411
2462
|
reactions: {
|
|
2412
2463
|
reacted_by: "Brást við af"
|
|
2464
|
+
},
|
|
2465
|
+
sidebar: {
|
|
2466
|
+
marked_as_resolved: "Merkt sem leyst",
|
|
2467
|
+
more_replies: (e) => `${e} fleiri svör`
|
|
2413
2468
|
}
|
|
2414
2469
|
},
|
|
2415
2470
|
generic: {
|
|
@@ -2571,7 +2626,9 @@ const Ai = {
|
|
|
2571
2626
|
},
|
|
2572
2627
|
drag_handle: {
|
|
2573
2628
|
delete_menuitem: "Elimina",
|
|
2574
|
-
colors_menuitem: "Colori"
|
|
2629
|
+
colors_menuitem: "Colori",
|
|
2630
|
+
header_row_menuitem: "Riga intestazione",
|
|
2631
|
+
header_column_menuitem: "Colonna intestazione"
|
|
2575
2632
|
},
|
|
2576
2633
|
table_handle: {
|
|
2577
2634
|
delete_column_menuitem: "Elimina colonna",
|
|
@@ -2579,7 +2636,10 @@ const Ai = {
|
|
|
2579
2636
|
add_left_menuitem: "Aggiungi colonna a sinistra",
|
|
2580
2637
|
add_right_menuitem: "Aggiungi colonna a destra",
|
|
2581
2638
|
add_above_menuitem: "Aggiungi riga sopra",
|
|
2582
|
-
add_below_menuitem: "Aggiungi riga sotto"
|
|
2639
|
+
add_below_menuitem: "Aggiungi riga sotto",
|
|
2640
|
+
split_cell_menuitem: "Dividi cella",
|
|
2641
|
+
merge_cells_menuitem: "Unisci celle",
|
|
2642
|
+
background_color_menuitem: "Colore di sfondo"
|
|
2583
2643
|
},
|
|
2584
2644
|
suggestion_menu: {
|
|
2585
2645
|
no_items_title: "Nessun elemento trovato",
|
|
@@ -2694,6 +2754,9 @@ const Ai = {
|
|
|
2694
2754
|
align_justify: {
|
|
2695
2755
|
tooltip: "Giustifica testo"
|
|
2696
2756
|
},
|
|
2757
|
+
table_cell_merge: {
|
|
2758
|
+
tooltip: "Unisci celle"
|
|
2759
|
+
},
|
|
2697
2760
|
comment: {
|
|
2698
2761
|
tooltip: "Aggiungi commento"
|
|
2699
2762
|
}
|
|
@@ -2746,6 +2809,10 @@ const Ai = {
|
|
|
2746
2809
|
},
|
|
2747
2810
|
reactions: {
|
|
2748
2811
|
reacted_by: "Reagito da"
|
|
2812
|
+
},
|
|
2813
|
+
sidebar: {
|
|
2814
|
+
marked_as_resolved: "Contrassegnato come risolto",
|
|
2815
|
+
more_replies: (e) => `${e} altre risposte`
|
|
2749
2816
|
}
|
|
2750
2817
|
},
|
|
2751
2818
|
generic: {
|
|
@@ -3109,6 +3176,10 @@ const Ai = {
|
|
|
3109
3176
|
},
|
|
3110
3177
|
reactions: {
|
|
3111
3178
|
reacted_by: "リアクションした人"
|
|
3179
|
+
},
|
|
3180
|
+
sidebar: {
|
|
3181
|
+
marked_as_resolved: "解決済みとしてマーク",
|
|
3182
|
+
more_replies: (e) => `${e} 件の追加返信`
|
|
3112
3183
|
}
|
|
3113
3184
|
},
|
|
3114
3185
|
generic: {
|
|
@@ -3465,12 +3536,16 @@ const Ai = {
|
|
|
3465
3536
|
},
|
|
3466
3537
|
reactions: {
|
|
3467
3538
|
reacted_by: "반응한 사람"
|
|
3539
|
+
},
|
|
3540
|
+
sidebar: {
|
|
3541
|
+
marked_as_resolved: "해결됨으로 표시됨",
|
|
3542
|
+
more_replies: (e) => `${e}개의 추가 답글`
|
|
3468
3543
|
}
|
|
3469
3544
|
},
|
|
3470
3545
|
generic: {
|
|
3471
3546
|
ctrl_shortcut: "Ctrl"
|
|
3472
3547
|
}
|
|
3473
|
-
},
|
|
3548
|
+
}, zi = {
|
|
3474
3549
|
slash_menu: {
|
|
3475
3550
|
heading: {
|
|
3476
3551
|
title: "Kop 1",
|
|
@@ -3808,12 +3883,16 @@ const Ai = {
|
|
|
3808
3883
|
},
|
|
3809
3884
|
reactions: {
|
|
3810
3885
|
reacted_by: "Gereageerd door"
|
|
3886
|
+
},
|
|
3887
|
+
sidebar: {
|
|
3888
|
+
marked_as_resolved: "Gemarkeerd als opgelost",
|
|
3889
|
+
more_replies: (e) => `${e} extra reacties`
|
|
3811
3890
|
}
|
|
3812
3891
|
},
|
|
3813
3892
|
generic: {
|
|
3814
3893
|
ctrl_shortcut: "Ctrl"
|
|
3815
3894
|
}
|
|
3816
|
-
},
|
|
3895
|
+
}, Vi = {
|
|
3817
3896
|
slash_menu: {
|
|
3818
3897
|
heading: {
|
|
3819
3898
|
title: "Overskrift 1",
|
|
@@ -4151,6 +4230,10 @@ const Ai = {
|
|
|
4151
4230
|
},
|
|
4152
4231
|
reactions: {
|
|
4153
4232
|
reacted_by: "Reagert av"
|
|
4233
|
+
},
|
|
4234
|
+
sidebar: {
|
|
4235
|
+
marked_as_resolved: "Merket som løst",
|
|
4236
|
+
more_replies: (e) => `${e} flere svar`
|
|
4154
4237
|
}
|
|
4155
4238
|
},
|
|
4156
4239
|
generic: {
|
|
@@ -4478,6 +4561,10 @@ const Ai = {
|
|
|
4478
4561
|
},
|
|
4479
4562
|
reactions: {
|
|
4480
4563
|
reacted_by: "Zareagowali"
|
|
4564
|
+
},
|
|
4565
|
+
sidebar: {
|
|
4566
|
+
marked_as_resolved: "Oznaczone jako rozwiązane",
|
|
4567
|
+
more_replies: (e) => `${e} więcej odpowiedzi`
|
|
4481
4568
|
}
|
|
4482
4569
|
},
|
|
4483
4570
|
generic: {
|
|
@@ -4813,6 +4900,10 @@ const Ai = {
|
|
|
4813
4900
|
},
|
|
4814
4901
|
reactions: {
|
|
4815
4902
|
reacted_by: "Reagido por"
|
|
4903
|
+
},
|
|
4904
|
+
sidebar: {
|
|
4905
|
+
marked_as_resolved: "Marcado como resolvido",
|
|
4906
|
+
more_replies: (e) => `${e} respostas a mais`
|
|
4816
4907
|
}
|
|
4817
4908
|
},
|
|
4818
4909
|
generic: {
|
|
@@ -5183,12 +5274,16 @@ const Ai = {
|
|
|
5183
5274
|
},
|
|
5184
5275
|
reactions: {
|
|
5185
5276
|
reacted_by: "Отреагировал(а)"
|
|
5277
|
+
},
|
|
5278
|
+
sidebar: {
|
|
5279
|
+
marked_as_resolved: "Отмечено как решенное",
|
|
5280
|
+
more_replies: (e) => `${e} дополнительных ответов`
|
|
5186
5281
|
}
|
|
5187
5282
|
},
|
|
5188
5283
|
generic: {
|
|
5189
5284
|
ctrl_shortcut: "Ctrl"
|
|
5190
5285
|
}
|
|
5191
|
-
},
|
|
5286
|
+
}, Ki = {
|
|
5192
5287
|
slash_menu: {
|
|
5193
5288
|
heading: {
|
|
5194
5289
|
title: "Заголовок 1",
|
|
@@ -5551,12 +5646,16 @@ const Ai = {
|
|
|
5551
5646
|
},
|
|
5552
5647
|
reactions: {
|
|
5553
5648
|
reacted_by: "Відреагував(ла)"
|
|
5649
|
+
},
|
|
5650
|
+
sidebar: {
|
|
5651
|
+
marked_as_resolved: "Позначено як вирішене",
|
|
5652
|
+
more_replies: (e) => `${e} додаткових відповідей`
|
|
5554
5653
|
}
|
|
5555
5654
|
},
|
|
5556
5655
|
generic: {
|
|
5557
5656
|
ctrl_shortcut: "Ctrl"
|
|
5558
5657
|
}
|
|
5559
|
-
},
|
|
5658
|
+
}, Wi = {
|
|
5560
5659
|
slash_menu: {
|
|
5561
5660
|
heading: {
|
|
5562
5661
|
title: "Tiêu đề H1",
|
|
@@ -5893,6 +5992,10 @@ const Ai = {
|
|
|
5893
5992
|
},
|
|
5894
5993
|
reactions: {
|
|
5895
5994
|
reacted_by: "Phản ứng bởi"
|
|
5995
|
+
},
|
|
5996
|
+
sidebar: {
|
|
5997
|
+
marked_as_resolved: "Đã đánh dấu là đã giải quyết",
|
|
5998
|
+
more_replies: (e) => `${e} câu trả lời nữa`
|
|
5896
5999
|
}
|
|
5897
6000
|
},
|
|
5898
6001
|
generic: {
|
|
@@ -6269,38 +6372,42 @@ const Ai = {
|
|
|
6269
6372
|
},
|
|
6270
6373
|
reactions: {
|
|
6271
6374
|
reacted_by: "已回应"
|
|
6375
|
+
},
|
|
6376
|
+
sidebar: {
|
|
6377
|
+
marked_as_resolved: "标记为已解决",
|
|
6378
|
+
more_replies: (e) => `还有 ${e} 条回复`
|
|
6272
6379
|
}
|
|
6273
6380
|
},
|
|
6274
6381
|
generic: {
|
|
6275
6382
|
ctrl_shortcut: "Ctrl"
|
|
6276
6383
|
}
|
|
6277
|
-
},
|
|
6384
|
+
}, Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6278
6385
|
__proto__: null,
|
|
6279
6386
|
ar: Ai,
|
|
6280
6387
|
de: Pi,
|
|
6281
6388
|
en: $t,
|
|
6282
|
-
es:
|
|
6283
|
-
fr:
|
|
6389
|
+
es: ji,
|
|
6390
|
+
fr: Ni,
|
|
6284
6391
|
hr: Ri,
|
|
6285
6392
|
is: Di,
|
|
6286
6393
|
it: Ui,
|
|
6287
6394
|
ja: Hi,
|
|
6288
6395
|
ko: Oi,
|
|
6289
|
-
nl:
|
|
6290
|
-
no:
|
|
6396
|
+
nl: zi,
|
|
6397
|
+
no: Vi,
|
|
6291
6398
|
pl: Fi,
|
|
6292
6399
|
pt: $i,
|
|
6293
6400
|
ru: Gi,
|
|
6294
|
-
uk:
|
|
6295
|
-
vi:
|
|
6401
|
+
uk: Ki,
|
|
6402
|
+
vi: Wi,
|
|
6296
6403
|
zh: qi
|
|
6297
6404
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6298
|
-
class
|
|
6405
|
+
class O extends Error {
|
|
6299
6406
|
constructor(o) {
|
|
6300
6407
|
super(`Unreachable case: ${o}`);
|
|
6301
6408
|
}
|
|
6302
6409
|
}
|
|
6303
|
-
function
|
|
6410
|
+
function Xs(e, o = !0) {
|
|
6304
6411
|
const { "data-test": t, ...i } = e;
|
|
6305
6412
|
if (Object.keys(i).length > 0 && o)
|
|
6306
6413
|
throw new Error("Object must be empty " + JSON.stringify(e));
|
|
@@ -6388,29 +6495,29 @@ function tt(e, o) {
|
|
|
6388
6495
|
function te(e) {
|
|
6389
6496
|
return tt(e.node, e.posBeforeNode);
|
|
6390
6497
|
}
|
|
6391
|
-
function
|
|
6498
|
+
function ke(e) {
|
|
6392
6499
|
if (!e.nodeAfter)
|
|
6393
6500
|
throw new Error(
|
|
6394
6501
|
`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`
|
|
6395
6502
|
);
|
|
6396
6503
|
return tt(e.nodeAfter, e.pos);
|
|
6397
6504
|
}
|
|
6398
|
-
function
|
|
6505
|
+
function v(e) {
|
|
6399
6506
|
const o = q(e.doc, e.selection.anchor);
|
|
6400
6507
|
return te(o);
|
|
6401
6508
|
}
|
|
6402
|
-
function
|
|
6509
|
+
function Zi(e, o = JSON.stringify) {
|
|
6403
6510
|
const t = {};
|
|
6404
6511
|
return e.filter((i) => {
|
|
6405
6512
|
const n = o(i);
|
|
6406
6513
|
return Object.prototype.hasOwnProperty.call(t, n) ? !1 : t[n] = !0;
|
|
6407
6514
|
});
|
|
6408
6515
|
}
|
|
6409
|
-
function
|
|
6516
|
+
function Xi(e) {
|
|
6410
6517
|
const o = e.filter(
|
|
6411
6518
|
(i, n) => e.indexOf(i) !== n
|
|
6412
6519
|
);
|
|
6413
|
-
return
|
|
6520
|
+
return Zi(o);
|
|
6414
6521
|
}
|
|
6415
6522
|
const we = j.create({
|
|
6416
6523
|
name: "uniqueID",
|
|
@@ -6427,7 +6534,7 @@ const we = j.create({
|
|
|
6427
6534
|
const e = window.__TEST_OPTIONS;
|
|
6428
6535
|
return e.mockID === void 0 ? e.mockID = 0 : e.mockID++, e.mockID.toString();
|
|
6429
6536
|
}
|
|
6430
|
-
return
|
|
6537
|
+
return zt();
|
|
6431
6538
|
},
|
|
6432
6539
|
filterTransaction: null
|
|
6433
6540
|
};
|
|
@@ -6490,25 +6597,25 @@ const we = j.create({
|
|
|
6490
6597
|
new T({
|
|
6491
6598
|
key: new A("uniqueID"),
|
|
6492
6599
|
appendTransaction: (t, i, n) => {
|
|
6493
|
-
const r = t.some((
|
|
6494
|
-
let
|
|
6495
|
-
return !(!((b = (
|
|
6600
|
+
const r = t.some((f) => f.docChanged) && !i.doc.eq(n.doc), a = this.options.filterTransaction && t.some((f) => {
|
|
6601
|
+
let g, b;
|
|
6602
|
+
return !(!((b = (g = this.options).filterTransaction) === null || b === void 0) && b.call(g, f));
|
|
6496
6603
|
});
|
|
6497
6604
|
if (!r || a)
|
|
6498
6605
|
return;
|
|
6499
|
-
const { tr: s } = n, { types: l, attributeName: d, generateID: c } = this.options, u =
|
|
6606
|
+
const { tr: s } = n, { types: l, attributeName: d, generateID: c } = this.options, u = Vo(
|
|
6500
6607
|
i.doc,
|
|
6501
6608
|
t
|
|
6502
6609
|
), { mapping: m } = u;
|
|
6503
|
-
if (Fo(u).forEach(({ newRange:
|
|
6504
|
-
const
|
|
6610
|
+
if (Fo(u).forEach(({ newRange: f }) => {
|
|
6611
|
+
const g = $o(
|
|
6505
6612
|
n.doc,
|
|
6506
|
-
|
|
6507
|
-
(
|
|
6508
|
-
), b =
|
|
6509
|
-
|
|
6510
|
-
let
|
|
6511
|
-
const C = (
|
|
6613
|
+
f,
|
|
6614
|
+
(k) => l.includes(k.type.name)
|
|
6615
|
+
), b = g.map(({ node: k }) => k.attrs[d]).filter((k) => k !== null), _ = Xi(b);
|
|
6616
|
+
g.forEach(({ node: k, pos: w }) => {
|
|
6617
|
+
let y;
|
|
6618
|
+
const C = (y = s.doc.nodeAt(w)) === null || y === void 0 ? void 0 : y.attrs[d];
|
|
6512
6619
|
if (C === null) {
|
|
6513
6620
|
const E = i.doc.type.createAndFill().content;
|
|
6514
6621
|
if (i.doc.content.findDiffStart(E) === null) {
|
|
@@ -6517,21 +6624,21 @@ const we = j.create({
|
|
|
6517
6624
|
);
|
|
6518
6625
|
if (ut.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(ut.content) === JSON.stringify(E.toJSON())) {
|
|
6519
6626
|
s.setNodeMarkup(w, void 0, {
|
|
6520
|
-
...
|
|
6627
|
+
...k.attrs,
|
|
6521
6628
|
[d]: "initialBlockId"
|
|
6522
6629
|
});
|
|
6523
6630
|
return;
|
|
6524
6631
|
}
|
|
6525
6632
|
}
|
|
6526
6633
|
s.setNodeMarkup(w, void 0, {
|
|
6527
|
-
...
|
|
6634
|
+
...k.attrs,
|
|
6528
6635
|
[d]: c()
|
|
6529
6636
|
});
|
|
6530
6637
|
return;
|
|
6531
6638
|
}
|
|
6532
|
-
const { deleted:
|
|
6533
|
-
|
|
6534
|
-
...
|
|
6639
|
+
const { deleted: z } = m.invert().mapResult(w);
|
|
6640
|
+
z && _.includes(C) && s.setNodeMarkup(w, void 0, {
|
|
6641
|
+
...k.attrs,
|
|
6535
6642
|
[d]: c()
|
|
6536
6643
|
});
|
|
6537
6644
|
});
|
|
@@ -6608,7 +6715,7 @@ function gt(e) {
|
|
|
6608
6715
|
function ot(e) {
|
|
6609
6716
|
return typeof e != "string" && e.type === "link";
|
|
6610
6717
|
}
|
|
6611
|
-
function
|
|
6718
|
+
function Z(e) {
|
|
6612
6719
|
return typeof e != "string" && e.type === "text";
|
|
6613
6720
|
}
|
|
6614
6721
|
function $e(e) {
|
|
@@ -6648,23 +6755,23 @@ function Ge(e) {
|
|
|
6648
6755
|
return it(e) ? e.props.rowspan ?? 1 : 1;
|
|
6649
6756
|
}
|
|
6650
6757
|
const Ji = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
|
|
6651
|
-
function
|
|
6758
|
+
function W(e, o = "Ctrl") {
|
|
6652
6759
|
return Ji() ? e.replace("Mod", "⌘") : e.replace("Mod", o);
|
|
6653
6760
|
}
|
|
6654
|
-
function
|
|
6761
|
+
function X(...e) {
|
|
6655
6762
|
return e.filter((o) => o).join(" ");
|
|
6656
6763
|
}
|
|
6657
6764
|
const Js = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
6658
6765
|
function $(e, o, t, i) {
|
|
6659
6766
|
const n = document.createElement("div");
|
|
6660
|
-
n.className =
|
|
6767
|
+
n.className = X(
|
|
6661
6768
|
"bn-block-content",
|
|
6662
6769
|
t.class
|
|
6663
6770
|
), n.setAttribute("data-content-type", e);
|
|
6664
6771
|
for (const [a, s] of Object.entries(t))
|
|
6665
6772
|
a !== "class" && n.setAttribute(a, s);
|
|
6666
6773
|
const r = document.createElement(o);
|
|
6667
|
-
r.className =
|
|
6774
|
+
r.className = X(
|
|
6668
6775
|
"bn-inline-content",
|
|
6669
6776
|
i.class
|
|
6670
6777
|
);
|
|
@@ -6711,7 +6818,7 @@ function Ys(e) {
|
|
|
6711
6818
|
return !o.length || // invalid?
|
|
6712
6819
|
o[o.length - 1] === "" ? e : o[o.length - 1];
|
|
6713
6820
|
}
|
|
6714
|
-
function
|
|
6821
|
+
function ve(e) {
|
|
6715
6822
|
const o = {};
|
|
6716
6823
|
return Object.entries(e).filter(([t, i]) => !Gt.includes(t)).forEach(([t, i]) => {
|
|
6717
6824
|
o[t] = {
|
|
@@ -6756,7 +6863,7 @@ function xe(e, o, t, i, n = !1, r) {
|
|
|
6756
6863
|
if (r !== void 0)
|
|
6757
6864
|
for (const [s, l] of Object.entries(r))
|
|
6758
6865
|
s !== "class" && a.setAttribute(s, l);
|
|
6759
|
-
a.className =
|
|
6866
|
+
a.className = X(
|
|
6760
6867
|
"bn-block-content",
|
|
6761
6868
|
(r == null ? void 0 : r.class) || ""
|
|
6762
6869
|
), a.setAttribute("data-content-type", o);
|
|
@@ -6764,7 +6871,7 @@ function xe(e, o, t, i, n = !1, r) {
|
|
|
6764
6871
|
const c = i[s].default;
|
|
6765
6872
|
!Gt.includes(s) && l !== c && a.setAttribute(Me(s), l);
|
|
6766
6873
|
}
|
|
6767
|
-
return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className =
|
|
6874
|
+
return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = X(
|
|
6768
6875
|
"bn-inline-content",
|
|
6769
6876
|
e.contentDOM.className
|
|
6770
6877
|
), e.contentDOM.setAttribute("data-editable", "")), {
|
|
@@ -6775,14 +6882,14 @@ function xe(e, o, t, i, n = !1, r) {
|
|
|
6775
6882
|
function G(e) {
|
|
6776
6883
|
return de.create(e);
|
|
6777
6884
|
}
|
|
6778
|
-
function
|
|
6885
|
+
function Kt(e, o) {
|
|
6779
6886
|
return {
|
|
6780
6887
|
config: e,
|
|
6781
6888
|
implementation: o
|
|
6782
6889
|
};
|
|
6783
6890
|
}
|
|
6784
6891
|
function J(e, o, t) {
|
|
6785
|
-
return
|
|
6892
|
+
return Kt(
|
|
6786
6893
|
{
|
|
6787
6894
|
type: e.name,
|
|
6788
6895
|
content: e.config.content === "inline*" ? "inline" : e.config.content === "tableRow+" ? "table" : "none",
|
|
@@ -6797,7 +6904,7 @@ function J(e, o, t) {
|
|
|
6797
6904
|
}
|
|
6798
6905
|
);
|
|
6799
6906
|
}
|
|
6800
|
-
function
|
|
6907
|
+
function Wt(e) {
|
|
6801
6908
|
return Object.fromEntries(
|
|
6802
6909
|
Object.entries(e).map(([o, t]) => [o, t.config])
|
|
6803
6910
|
);
|
|
@@ -6824,7 +6931,7 @@ function en(e, o) {
|
|
|
6824
6931
|
}
|
|
6825
6932
|
}), t;
|
|
6826
6933
|
}
|
|
6827
|
-
function
|
|
6934
|
+
function ye(e, o) {
|
|
6828
6935
|
const t = G({
|
|
6829
6936
|
name: e.type,
|
|
6830
6937
|
content: e.content === "inline" ? "inline*" : "",
|
|
@@ -6832,7 +6939,7 @@ function ve(e, o) {
|
|
|
6832
6939
|
selectable: e.isSelectable ?? !0,
|
|
6833
6940
|
isolating: !0,
|
|
6834
6941
|
addAttributes() {
|
|
6835
|
-
return
|
|
6942
|
+
return ve(e.propSchema);
|
|
6836
6943
|
},
|
|
6837
6944
|
parseHTML() {
|
|
6838
6945
|
return en(e, o.parse);
|
|
@@ -6874,7 +6981,7 @@ function ve(e, o) {
|
|
|
6874
6981
|
throw new Error(
|
|
6875
6982
|
"Node name does not match block type. This is a bug in BlockNote."
|
|
6876
6983
|
);
|
|
6877
|
-
return
|
|
6984
|
+
return Kt(e, {
|
|
6878
6985
|
node: t,
|
|
6879
6986
|
toInternalHTML: (i, n) => {
|
|
6880
6987
|
var s;
|
|
@@ -6927,13 +7034,13 @@ function qt(e, o, t) {
|
|
|
6927
7034
|
}), c.cells = s.content.content.map((u, m) => (n[d] || (n[d] = []), n[d][m] = u.type.name === "tableHeader", {
|
|
6928
7035
|
type: "tableCell",
|
|
6929
7036
|
content: u.content.content.map(
|
|
6930
|
-
(
|
|
6931
|
-
).reduce((
|
|
6932
|
-
if (!
|
|
6933
|
-
return
|
|
6934
|
-
const b =
|
|
6935
|
-
return
|
|
6936
|
-
` +
|
|
7037
|
+
(f) => Ae(f, o, t)
|
|
7038
|
+
).reduce((f, g) => {
|
|
7039
|
+
if (!f.length)
|
|
7040
|
+
return g;
|
|
7041
|
+
const b = f[f.length - 1], _ = g[0];
|
|
7042
|
+
return _ && Z(b) && Z(_) && JSON.stringify(b.styles) === JSON.stringify(_.styles) ? (b.text += `
|
|
7043
|
+
` + _.text, f.push(...g.slice(1)), f) : (f.push(...g), f);
|
|
6937
7044
|
}, []),
|
|
6938
7045
|
props: {
|
|
6939
7046
|
colspan: u.attrs.colspan,
|
|
@@ -6956,7 +7063,7 @@ function Ae(e, o, t) {
|
|
|
6956
7063
|
return e.content.forEach((r) => {
|
|
6957
7064
|
if (r.type.name === "hardBreak") {
|
|
6958
7065
|
if (n)
|
|
6959
|
-
if (
|
|
7066
|
+
if (Z(n))
|
|
6960
7067
|
n.text += `
|
|
6961
7068
|
`;
|
|
6962
7069
|
else if (gt(n))
|
|
@@ -6979,7 +7086,7 @@ function Ae(e, o, t) {
|
|
|
6979
7086
|
return;
|
|
6980
7087
|
}
|
|
6981
7088
|
n && (i.push(n), n = void 0), i.push(
|
|
6982
|
-
|
|
7089
|
+
Ke(r, o, t)
|
|
6983
7090
|
);
|
|
6984
7091
|
return;
|
|
6985
7092
|
}
|
|
@@ -7000,9 +7107,9 @@ function Ae(e, o, t) {
|
|
|
7000
7107
|
else if (d.propSchema === "string")
|
|
7001
7108
|
a[d.type] = l.attrs.stringValue;
|
|
7002
7109
|
else
|
|
7003
|
-
throw new
|
|
7110
|
+
throw new O(d.propSchema);
|
|
7004
7111
|
}
|
|
7005
|
-
n ?
|
|
7112
|
+
n ? Z(n) ? s ? (i.push(n), n = {
|
|
7006
7113
|
type: "link",
|
|
7007
7114
|
href: s.attrs.href,
|
|
7008
7115
|
content: [
|
|
@@ -7053,7 +7160,7 @@ function Ae(e, o, t) {
|
|
|
7053
7160
|
};
|
|
7054
7161
|
}), n && i.push(n), i;
|
|
7055
7162
|
}
|
|
7056
|
-
function
|
|
7163
|
+
function Ke(e, o, t) {
|
|
7057
7164
|
if (e.type.name === "text" || e.type.name === "link")
|
|
7058
7165
|
throw new Error("unexpected");
|
|
7059
7166
|
const i = {}, n = o[e.type.name];
|
|
@@ -7075,7 +7182,7 @@ function We(e, o, t) {
|
|
|
7075
7182
|
};
|
|
7076
7183
|
}
|
|
7077
7184
|
function x(e, o, t, i, n) {
|
|
7078
|
-
var
|
|
7185
|
+
var f;
|
|
7079
7186
|
if (!e.type.isInGroup("bnBlock"))
|
|
7080
7187
|
throw Error(
|
|
7081
7188
|
"Node must be in bnBlock group, but is of type" + e.type.name
|
|
@@ -7090,18 +7197,18 @@ function x(e, o, t, i, n) {
|
|
|
7090
7197
|
if (!l)
|
|
7091
7198
|
throw Error("Block is of an unrecognized type: " + a.blockNoteType);
|
|
7092
7199
|
const d = {};
|
|
7093
|
-
for (const [
|
|
7200
|
+
for (const [g, b] of Object.entries({
|
|
7094
7201
|
...e.attrs,
|
|
7095
7202
|
...a.isBlockContainer ? a.blockContent.node.attrs : {}
|
|
7096
7203
|
})) {
|
|
7097
|
-
const
|
|
7098
|
-
|
|
7204
|
+
const _ = l.propSchema;
|
|
7205
|
+
g in _ && !(_[g].default === void 0 && b === void 0) && (d[g] = b);
|
|
7099
7206
|
}
|
|
7100
7207
|
const c = o[a.blockNoteType], u = [];
|
|
7101
|
-
(
|
|
7208
|
+
(f = a.childContainer) == null || f.node.forEach((g) => {
|
|
7102
7209
|
u.push(
|
|
7103
7210
|
x(
|
|
7104
|
-
|
|
7211
|
+
g,
|
|
7105
7212
|
o,
|
|
7106
7213
|
t,
|
|
7107
7214
|
i,
|
|
@@ -7129,7 +7236,7 @@ function x(e, o, t, i, n) {
|
|
|
7129
7236
|
} else if (c.content === "none")
|
|
7130
7237
|
m = void 0;
|
|
7131
7238
|
else
|
|
7132
|
-
throw new
|
|
7239
|
+
throw new O(c.content);
|
|
7133
7240
|
const h = {
|
|
7134
7241
|
id: s,
|
|
7135
7242
|
type: c.type,
|
|
@@ -7139,7 +7246,7 @@ function x(e, o, t, i, n) {
|
|
|
7139
7246
|
};
|
|
7140
7247
|
return n == null || n.set(e, h), h;
|
|
7141
7248
|
}
|
|
7142
|
-
function
|
|
7249
|
+
function _t(e, o, t, i) {
|
|
7143
7250
|
return e.dom.setAttribute("data-inline-content-type", o), Object.entries(t).filter(([n, r]) => {
|
|
7144
7251
|
const a = i[n];
|
|
7145
7252
|
return r !== a.default;
|
|
@@ -7171,7 +7278,7 @@ function nn(e, o) {
|
|
|
7171
7278
|
}
|
|
7172
7279
|
);
|
|
7173
7280
|
}
|
|
7174
|
-
function
|
|
7281
|
+
function Zt(e) {
|
|
7175
7282
|
return Object.fromEntries(
|
|
7176
7283
|
Object.entries(e).map(([o, t]) => [o, t.config])
|
|
7177
7284
|
);
|
|
@@ -7196,7 +7303,7 @@ function Qs(e, o) {
|
|
|
7196
7303
|
atom: e.content === "none",
|
|
7197
7304
|
content: e.content === "styled" ? "inline*" : "",
|
|
7198
7305
|
addAttributes() {
|
|
7199
|
-
return
|
|
7306
|
+
return ve(e.propSchema);
|
|
7200
7307
|
},
|
|
7201
7308
|
addKeyboardShortcuts() {
|
|
7202
7309
|
return tn(e);
|
|
@@ -7206,7 +7313,7 @@ function Qs(e, o) {
|
|
|
7206
7313
|
},
|
|
7207
7314
|
renderHTML({ node: i }) {
|
|
7208
7315
|
const n = this.options.editor, r = o.render(
|
|
7209
|
-
|
|
7316
|
+
Ke(
|
|
7210
7317
|
i,
|
|
7211
7318
|
n.schema.inlineContentSchema,
|
|
7212
7319
|
n.schema.styleSchema
|
|
@@ -7216,7 +7323,7 @@ function Qs(e, o) {
|
|
|
7216
7323
|
},
|
|
7217
7324
|
n
|
|
7218
7325
|
);
|
|
7219
|
-
return
|
|
7326
|
+
return _t(
|
|
7220
7327
|
r,
|
|
7221
7328
|
e.type,
|
|
7222
7329
|
i.attrs,
|
|
@@ -7226,7 +7333,7 @@ function Qs(e, o) {
|
|
|
7226
7333
|
addNodeView() {
|
|
7227
7334
|
return ({ node: i, getPos: n }) => {
|
|
7228
7335
|
const r = this.options.editor, a = o.render(
|
|
7229
|
-
|
|
7336
|
+
Ke(
|
|
7230
7337
|
i,
|
|
7231
7338
|
r.schema.inlineContentSchema,
|
|
7232
7339
|
r.schema.styleSchema
|
|
@@ -7235,7 +7342,7 @@ function Qs(e, o) {
|
|
|
7235
7342
|
(s) => {
|
|
7236
7343
|
if (typeof n == "boolean")
|
|
7237
7344
|
return;
|
|
7238
|
-
const l =
|
|
7345
|
+
const l = R(
|
|
7239
7346
|
[s],
|
|
7240
7347
|
r._tiptapEditor.schema,
|
|
7241
7348
|
r.schema.styleSchema
|
|
@@ -7250,7 +7357,7 @@ function Qs(e, o) {
|
|
|
7250
7357
|
},
|
|
7251
7358
|
r
|
|
7252
7359
|
);
|
|
7253
|
-
return
|
|
7360
|
+
return _t(
|
|
7254
7361
|
a,
|
|
7255
7362
|
e.type,
|
|
7256
7363
|
i.attrs,
|
|
@@ -7279,14 +7386,14 @@ function an(e) {
|
|
|
7279
7386
|
function sn(e, o, t, i) {
|
|
7280
7387
|
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
7388
|
}
|
|
7282
|
-
function
|
|
7389
|
+
function Xt(e, o) {
|
|
7283
7390
|
return {
|
|
7284
7391
|
config: e,
|
|
7285
7392
|
implementation: o
|
|
7286
7393
|
};
|
|
7287
7394
|
}
|
|
7288
7395
|
function Q(e, o) {
|
|
7289
|
-
return
|
|
7396
|
+
return Xt(
|
|
7290
7397
|
{
|
|
7291
7398
|
type: e.name,
|
|
7292
7399
|
propSchema: o
|
|
@@ -7328,7 +7435,7 @@ function el(e, o) {
|
|
|
7328
7435
|
else if (e.propSchema === "string")
|
|
7329
7436
|
n = o.render(i.attrs.stringValue);
|
|
7330
7437
|
else
|
|
7331
|
-
throw new
|
|
7438
|
+
throw new O(e.propSchema);
|
|
7332
7439
|
return sn(
|
|
7333
7440
|
n,
|
|
7334
7441
|
e.type,
|
|
@@ -7337,7 +7444,7 @@ function el(e, o) {
|
|
|
7337
7444
|
);
|
|
7338
7445
|
}
|
|
7339
7446
|
});
|
|
7340
|
-
return
|
|
7447
|
+
return Xt(e, {
|
|
7341
7448
|
mark: t
|
|
7342
7449
|
});
|
|
7343
7450
|
}
|
|
@@ -7408,7 +7515,7 @@ function Yt(e, o, t = Y(o)) {
|
|
|
7408
7515
|
cell: i.cell
|
|
7409
7516
|
};
|
|
7410
7517
|
}
|
|
7411
|
-
function
|
|
7518
|
+
function We(e, o) {
|
|
7412
7519
|
var r;
|
|
7413
7520
|
const t = Y(e);
|
|
7414
7521
|
if (o < 0 || o >= t.length)
|
|
@@ -7489,16 +7596,16 @@ function cn(e, o, t, i = Y(e)) {
|
|
|
7489
7596
|
), [a] = i.splice(n, 1);
|
|
7490
7597
|
return i.splice(r, 0, a), fe(i);
|
|
7491
7598
|
}
|
|
7492
|
-
function
|
|
7493
|
-
return e ? me(e) ?
|
|
7494
|
-
(o) => typeof o == "string" ? o.length === 0 :
|
|
7599
|
+
function Ze(e) {
|
|
7600
|
+
return e ? me(e) ? Ze(e.content) : typeof e == "string" ? e.length === 0 : Array.isArray(e) ? e.every(
|
|
7601
|
+
(o) => typeof o == "string" ? o.length === 0 : Z(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
7602
|
) : !1 : !0;
|
|
7496
7603
|
}
|
|
7497
7604
|
function un(e, o, t = Y(e)) {
|
|
7498
7605
|
if (o === "columns") {
|
|
7499
7606
|
let r = 0;
|
|
7500
7607
|
for (let a = t[0].length - 1; a >= 0 && t.every(
|
|
7501
|
-
(l) =>
|
|
7608
|
+
(l) => Ze(l[a].cell) && l[a].colspan === 1
|
|
7502
7609
|
); a--)
|
|
7503
7610
|
r++;
|
|
7504
7611
|
for (let a = t.length - 1; a >= 0; a--) {
|
|
@@ -7512,7 +7619,7 @@ function un(e, o, t = Y(e)) {
|
|
|
7512
7619
|
}
|
|
7513
7620
|
let i = 0;
|
|
7514
7621
|
for (let r = t.length - 1; r >= 0 && t[r].every(
|
|
7515
|
-
(s) =>
|
|
7622
|
+
(s) => Ze(s.cell) && s.rowspan === 1
|
|
7516
7623
|
); r--)
|
|
7517
7624
|
i++;
|
|
7518
7625
|
const n = Math.min(i, t.length - 1);
|
|
@@ -7549,7 +7656,7 @@ function pn(e, o, t, i = Y(e)) {
|
|
|
7549
7656
|
return fe(i);
|
|
7550
7657
|
}
|
|
7551
7658
|
function Qt(e, o, t) {
|
|
7552
|
-
const i =
|
|
7659
|
+
const i = We(e, t);
|
|
7553
7660
|
if (!i.some((l) => Ge(l.cell) > 1))
|
|
7554
7661
|
return !0;
|
|
7555
7662
|
let r = t, a = t;
|
|
@@ -7572,7 +7679,7 @@ function mn(e, o, t) {
|
|
|
7572
7679
|
const i = oe(e, t), n = oe(o, t);
|
|
7573
7680
|
return i.col === n.col;
|
|
7574
7681
|
}
|
|
7575
|
-
function
|
|
7682
|
+
function kt(e, o, t, i) {
|
|
7576
7683
|
const n = [];
|
|
7577
7684
|
for (const [a, s] of Object.entries(e.styles)) {
|
|
7578
7685
|
const l = t[a];
|
|
@@ -7583,7 +7690,7 @@ function _t(e, o, t, i) {
|
|
|
7583
7690
|
else if (l.propSchema === "string")
|
|
7584
7691
|
n.push(o.mark(a, { stringValue: s }));
|
|
7585
7692
|
else
|
|
7586
|
-
throw new
|
|
7693
|
+
throw new O(l.propSchema);
|
|
7587
7694
|
}
|
|
7588
7695
|
return !i || !o.nodes[i].spec.code ? e.text.split(/(\n)/g).filter((a) => a.length > 0).map((a) => a === `
|
|
7589
7696
|
` ? o.nodes.hardBreak.createChecked() : o.text(a, n)) : [o.text(e.text, n)];
|
|
@@ -7592,7 +7699,7 @@ function hn(e, o, t) {
|
|
|
7592
7699
|
const i = o.marks.link.create({
|
|
7593
7700
|
href: e.href
|
|
7594
7701
|
});
|
|
7595
|
-
return
|
|
7702
|
+
return Xe(e.content, o, t).map(
|
|
7596
7703
|
(n) => {
|
|
7597
7704
|
if (n.type.name === "text")
|
|
7598
7705
|
return n.mark([...n.marks, i]);
|
|
@@ -7602,11 +7709,11 @@ function hn(e, o, t) {
|
|
|
7602
7709
|
}
|
|
7603
7710
|
);
|
|
7604
7711
|
}
|
|
7605
|
-
function
|
|
7712
|
+
function Xe(e, o, t, i) {
|
|
7606
7713
|
const n = [];
|
|
7607
7714
|
if (typeof e == "string")
|
|
7608
7715
|
return n.push(
|
|
7609
|
-
...
|
|
7716
|
+
...kt(
|
|
7610
7717
|
{ type: "text", text: e, styles: {} },
|
|
7611
7718
|
o,
|
|
7612
7719
|
t,
|
|
@@ -7615,17 +7722,17 @@ function Ze(e, o, t, i) {
|
|
|
7615
7722
|
), n;
|
|
7616
7723
|
for (const r of e)
|
|
7617
7724
|
n.push(
|
|
7618
|
-
...
|
|
7725
|
+
...kt(r, o, t, i)
|
|
7619
7726
|
);
|
|
7620
7727
|
return n;
|
|
7621
7728
|
}
|
|
7622
|
-
function
|
|
7729
|
+
function R(e, o, t, i) {
|
|
7623
7730
|
const n = [];
|
|
7624
7731
|
for (const r of e)
|
|
7625
7732
|
typeof r == "string" ? n.push(
|
|
7626
|
-
...
|
|
7627
|
-
) : ot(r) ? n.push(...hn(r, o, t)) :
|
|
7628
|
-
...
|
|
7733
|
+
...Xe(r, o, t, i)
|
|
7734
|
+
) : ot(r) ? n.push(...hn(r, o, t)) : Z(r) ? n.push(
|
|
7735
|
+
...Xe([r], o, t, i)
|
|
7629
7736
|
) : n.push(
|
|
7630
7737
|
to(r, o, t)
|
|
7631
7738
|
);
|
|
@@ -7636,30 +7743,30 @@ function Pe(e, o, t) {
|
|
|
7636
7743
|
for (let s = 0; s < e.rows.length; s++) {
|
|
7637
7744
|
const l = e.rows[s], d = [], c = n[s];
|
|
7638
7745
|
for (let m = 0; m < l.cells.length; m++) {
|
|
7639
|
-
const h = l.cells[m],
|
|
7746
|
+
const h = l.cells[m], f = r[m], g = void 0;
|
|
7640
7747
|
let b = null;
|
|
7641
|
-
const
|
|
7748
|
+
const _ = oe(
|
|
7642
7749
|
{
|
|
7643
7750
|
row: s,
|
|
7644
7751
|
col: m
|
|
7645
7752
|
},
|
|
7646
7753
|
{ type: "table", content: e }
|
|
7647
7754
|
);
|
|
7648
|
-
let
|
|
7755
|
+
let k = a[_.col] ? [a[_.col]] : null;
|
|
7649
7756
|
if (h) if (typeof h == "string")
|
|
7650
7757
|
b = o.text(h);
|
|
7651
7758
|
else if (me(h)) {
|
|
7652
|
-
h.content && (b =
|
|
7653
|
-
const
|
|
7654
|
-
|
|
7759
|
+
h.content && (b = R(h.content, o, t));
|
|
7760
|
+
const y = he(h);
|
|
7761
|
+
y > 1 && (k = new Array(y).fill(!1).map((C, z) => a[_.col + z] ?? void 0));
|
|
7655
7762
|
} else
|
|
7656
|
-
b =
|
|
7657
|
-
const w = o.nodes[
|
|
7763
|
+
b = R(h, o, t);
|
|
7764
|
+
const w = o.nodes[f || c ? "tableHeader" : "tableCell"].createChecked(
|
|
7658
7765
|
{
|
|
7659
7766
|
...me(h) ? h.props : {},
|
|
7660
|
-
colwidth:
|
|
7767
|
+
colwidth: k
|
|
7661
7768
|
},
|
|
7662
|
-
o.nodes.tableParagraph.createChecked(
|
|
7769
|
+
o.nodes.tableParagraph.createChecked(g, b)
|
|
7663
7770
|
);
|
|
7664
7771
|
d.push(w);
|
|
7665
7772
|
}
|
|
@@ -7675,7 +7782,7 @@ function to(e, o, t) {
|
|
|
7675
7782
|
if (!e.content)
|
|
7676
7783
|
i = o.nodes[n].createChecked(e.props);
|
|
7677
7784
|
else if (typeof e.content == "string") {
|
|
7678
|
-
const r =
|
|
7785
|
+
const r = R(
|
|
7679
7786
|
[e.content],
|
|
7680
7787
|
o,
|
|
7681
7788
|
t,
|
|
@@ -7683,7 +7790,7 @@ function to(e, o, t) {
|
|
|
7683
7790
|
);
|
|
7684
7791
|
i = o.nodes[n].createChecked(e.props, r);
|
|
7685
7792
|
} else if (Array.isArray(e.content)) {
|
|
7686
|
-
const r =
|
|
7793
|
+
const r = R(
|
|
7687
7794
|
e.content,
|
|
7688
7795
|
o,
|
|
7689
7796
|
t,
|
|
@@ -7694,7 +7801,7 @@ function to(e, o, t) {
|
|
|
7694
7801
|
const r = Pe(e.content, o, t);
|
|
7695
7802
|
i = o.nodes[n].createChecked(e.props, r);
|
|
7696
7803
|
} else
|
|
7697
|
-
throw new
|
|
7804
|
+
throw new O(e.content.type);
|
|
7698
7805
|
return i;
|
|
7699
7806
|
}
|
|
7700
7807
|
function ie(e, o, t) {
|
|
@@ -7732,7 +7839,7 @@ function ie(e, o, t) {
|
|
|
7732
7839
|
);
|
|
7733
7840
|
}
|
|
7734
7841
|
}
|
|
7735
|
-
function
|
|
7842
|
+
function N(e, o) {
|
|
7736
7843
|
let t, i;
|
|
7737
7844
|
if (o.firstChild.descendants((n, r) => t ? !1 : !n.type.isInGroup("bnBlock") || n.attrs.id !== e ? !0 : (t = n, i = r + 1, !1)), !(t === void 0 || i === void 0))
|
|
7738
7845
|
return {
|
|
@@ -7744,7 +7851,7 @@ const M = (e, o, t) => ({
|
|
|
7744
7851
|
state: i,
|
|
7745
7852
|
dispatch: n
|
|
7746
7853
|
}) => {
|
|
7747
|
-
const r =
|
|
7854
|
+
const r = ke(
|
|
7748
7855
|
i.doc.resolve(o)
|
|
7749
7856
|
);
|
|
7750
7857
|
if (n) {
|
|
@@ -7793,14 +7900,14 @@ function fn(e, o, t, i, n, r) {
|
|
|
7793
7900
|
let a = "keep";
|
|
7794
7901
|
if (e.content)
|
|
7795
7902
|
if (typeof e.content == "string")
|
|
7796
|
-
a =
|
|
7903
|
+
a = R(
|
|
7797
7904
|
[e.content],
|
|
7798
7905
|
o.schema,
|
|
7799
7906
|
t.schema.styleSchema,
|
|
7800
7907
|
n.name
|
|
7801
7908
|
);
|
|
7802
7909
|
else if (Array.isArray(e.content))
|
|
7803
|
-
a =
|
|
7910
|
+
a = R(
|
|
7804
7911
|
e.content,
|
|
7805
7912
|
o.schema,
|
|
7806
7913
|
t.schema.styleSchema,
|
|
@@ -7813,7 +7920,7 @@ function fn(e, o, t, i, n, r) {
|
|
|
7813
7920
|
t.schema.styleSchema
|
|
7814
7921
|
);
|
|
7815
7922
|
else
|
|
7816
|
-
throw new
|
|
7923
|
+
throw new O(e.content.type);
|
|
7817
7924
|
else
|
|
7818
7925
|
i.spec.content === "" || n.spec.content !== i.spec.content && (a = []);
|
|
7819
7926
|
a === "keep" ? o.tr.setNodeMarkup(
|
|
@@ -7840,7 +7947,7 @@ function wt(e, o, t, i) {
|
|
|
7840
7947
|
const n = e.children.map((r) => ie(r, o.schema, t.schema.styleSchema));
|
|
7841
7948
|
if (i.childContainer)
|
|
7842
7949
|
o.tr.step(
|
|
7843
|
-
new
|
|
7950
|
+
new zo(
|
|
7844
7951
|
i.childContainer.beforePos + 1,
|
|
7845
7952
|
i.childContainer.afterPos - 1,
|
|
7846
7953
|
new ee(U.from(n), 0, 0)
|
|
@@ -7857,7 +7964,7 @@ function wt(e, o, t, i) {
|
|
|
7857
7964
|
}
|
|
7858
7965
|
}
|
|
7859
7966
|
function gn(e, o, t) {
|
|
7860
|
-
const i = e._tiptapEditor, n = typeof o == "string" ? o : o.id, r =
|
|
7967
|
+
const i = e._tiptapEditor, n = typeof o == "string" ? o : o.id, r = N(n, i.state.doc);
|
|
7861
7968
|
if (!r)
|
|
7862
7969
|
throw new Error(`Block with ID ${n} not found`);
|
|
7863
7970
|
i.commands.command(({ state: s, dispatch: l }) => (M(
|
|
@@ -7884,13 +7991,13 @@ function io(e, o, t, i) {
|
|
|
7884
7991
|
let n;
|
|
7885
7992
|
if (o)
|
|
7886
7993
|
if (typeof o == "string")
|
|
7887
|
-
n =
|
|
7994
|
+
n = R(
|
|
7888
7995
|
[o],
|
|
7889
7996
|
e.pmSchema,
|
|
7890
7997
|
e.schema.styleSchema
|
|
7891
7998
|
);
|
|
7892
7999
|
else if (Array.isArray(o))
|
|
7893
|
-
n =
|
|
8000
|
+
n = R(
|
|
7894
8001
|
o,
|
|
7895
8002
|
e.pmSchema,
|
|
7896
8003
|
e.schema.styleSchema
|
|
@@ -7902,13 +8009,13 @@ function io(e, o, t, i) {
|
|
|
7902
8009
|
e.schema.styleSchema
|
|
7903
8010
|
);
|
|
7904
8011
|
else
|
|
7905
|
-
throw new
|
|
8012
|
+
throw new O(o.type);
|
|
7906
8013
|
else throw new Error("blockContent is required");
|
|
7907
8014
|
const r = t.serializeFragment(U.from(n), i);
|
|
7908
8015
|
return r.nodeType === 1 && oo(r), r;
|
|
7909
8016
|
}
|
|
7910
8017
|
function bn(e, o, t, i, n, r, a) {
|
|
7911
|
-
var
|
|
8018
|
+
var g, b, _, k, w, y, C, z;
|
|
7912
8019
|
const s = (a == null ? void 0 : a.document) ?? document, l = o.pmSchema.nodes.blockContainer;
|
|
7913
8020
|
let d = t.props;
|
|
7914
8021
|
if (!t.props) {
|
|
@@ -7918,8 +8025,8 @@ function bn(e, o, t, i, n, r, a) {
|
|
|
7918
8025
|
))
|
|
7919
8026
|
E.default !== void 0 && (d[S] = E.default);
|
|
7920
8027
|
}
|
|
7921
|
-
const u = [...((b = (
|
|
7922
|
-
|
|
8028
|
+
const u = [...((b = (g = l.spec) == null ? void 0 : g.toDOM) == null ? void 0 : b.call(
|
|
8029
|
+
g,
|
|
7923
8030
|
l.create({
|
|
7924
8031
|
id: t.id,
|
|
7925
8032
|
...d
|
|
@@ -7944,11 +8051,11 @@ function bn(e, o, t, i, n, r, a) {
|
|
|
7944
8051
|
);
|
|
7945
8052
|
m.contentDOM.appendChild(S);
|
|
7946
8053
|
}
|
|
7947
|
-
let
|
|
7948
|
-
if (n.has(t.type) ?
|
|
7949
|
-
if (((
|
|
7950
|
-
const E = s.createElement(
|
|
7951
|
-
|
|
8054
|
+
let f;
|
|
8055
|
+
if (n.has(t.type) ? f = "OL" : r.has(t.type) && (f = "UL"), f) {
|
|
8056
|
+
if (((_ = e.lastChild) == null ? void 0 : _.nodeName) !== f) {
|
|
8057
|
+
const E = s.createElement(f);
|
|
8058
|
+
f === "OL" && (d != null && d.start) && (d == null ? void 0 : d.start) !== 1 && E.setAttribute("start", d.start + ""), e.append(E);
|
|
7952
8059
|
}
|
|
7953
8060
|
const S = s.createElement("li");
|
|
7954
8061
|
S.append(h), e.lastChild.appendChild(S);
|
|
@@ -7964,10 +8071,10 @@ function bn(e, o, t, i, n, r, a) {
|
|
|
7964
8071
|
n,
|
|
7965
8072
|
r,
|
|
7966
8073
|
a
|
|
7967
|
-
), ((
|
|
7968
|
-
for (; ((
|
|
8074
|
+
), ((k = e.lastChild) == null ? void 0 : k.nodeName) === "UL" || ((w = e.lastChild) == null ? void 0 : w.nodeName) === "OL")
|
|
8075
|
+
for (; ((y = S.firstChild) == null ? void 0 : y.nodeName) === "UL" || ((C = S.firstChild) == null ? void 0 : C.nodeName) === "OL"; )
|
|
7969
8076
|
e.lastChild.lastChild.appendChild(S.firstChild);
|
|
7970
|
-
o.pmSchema.nodes[t.type].isInGroup("blockContent") ? e.append(S) : (
|
|
8077
|
+
o.pmSchema.nodes[t.type].isInGroup("blockContent") ? e.append(S) : (z = m.contentDOM) == null || z.append(S);
|
|
7971
8078
|
}
|
|
7972
8079
|
}
|
|
7973
8080
|
const no = (e, o, t, i, n, r, a) => {
|
|
@@ -7981,7 +8088,7 @@ const no = (e, o, t, i, n, r, a) => {
|
|
|
7981
8088
|
r,
|
|
7982
8089
|
a
|
|
7983
8090
|
);
|
|
7984
|
-
},
|
|
8091
|
+
}, _n = (e, o, t, i, n, r) => {
|
|
7985
8092
|
const s = ((r == null ? void 0 : r.document) ?? document).createDocumentFragment();
|
|
7986
8093
|
return no(
|
|
7987
8094
|
s,
|
|
@@ -7992,11 +8099,11 @@ const no = (e, o, t, i, n, r, a) => {
|
|
|
7992
8099
|
n,
|
|
7993
8100
|
r
|
|
7994
8101
|
), s;
|
|
7995
|
-
},
|
|
8102
|
+
}, je = (e, o) => {
|
|
7996
8103
|
const t = Ut.fromSchema(e);
|
|
7997
8104
|
return {
|
|
7998
8105
|
exportBlocks: (i, n) => {
|
|
7999
|
-
const r =
|
|
8106
|
+
const r = _n(
|
|
8000
8107
|
o,
|
|
8001
8108
|
i,
|
|
8002
8109
|
t,
|
|
@@ -8017,18 +8124,18 @@ const no = (e, o, t, i, n, r, a) => {
|
|
|
8017
8124
|
}
|
|
8018
8125
|
};
|
|
8019
8126
|
};
|
|
8020
|
-
function
|
|
8127
|
+
function kn(e, o, t, i, n) {
|
|
8021
8128
|
let r;
|
|
8022
8129
|
if (o)
|
|
8023
8130
|
if (typeof o == "string")
|
|
8024
|
-
r =
|
|
8131
|
+
r = R(
|
|
8025
8132
|
[o],
|
|
8026
8133
|
e.pmSchema,
|
|
8027
8134
|
e.schema.styleSchema,
|
|
8028
8135
|
i
|
|
8029
8136
|
);
|
|
8030
8137
|
else if (Array.isArray(o))
|
|
8031
|
-
r =
|
|
8138
|
+
r = R(
|
|
8032
8139
|
o,
|
|
8033
8140
|
e.pmSchema,
|
|
8034
8141
|
e.schema.styleSchema,
|
|
@@ -8041,24 +8148,24 @@ function _n(e, o, t, i, n) {
|
|
|
8041
8148
|
e.schema.styleSchema
|
|
8042
8149
|
);
|
|
8043
8150
|
else
|
|
8044
|
-
throw new
|
|
8151
|
+
throw new O(o.type);
|
|
8045
8152
|
else throw new Error("blockContent is required");
|
|
8046
8153
|
return t.serializeFragment(U.from(r), n);
|
|
8047
8154
|
}
|
|
8048
8155
|
function wn(e, o, t, i, n) {
|
|
8049
|
-
var u, m, h,
|
|
8156
|
+
var u, m, h, f, g;
|
|
8050
8157
|
const r = e.pmSchema.nodes.blockContainer;
|
|
8051
8158
|
let a = o.props;
|
|
8052
8159
|
if (!o.props) {
|
|
8053
8160
|
a = {};
|
|
8054
|
-
for (const [b,
|
|
8161
|
+
for (const [b, _] of Object.entries(
|
|
8055
8162
|
e.schema.blockSchema[o.type].propSchema
|
|
8056
8163
|
))
|
|
8057
|
-
|
|
8164
|
+
_.default !== void 0 && (a[b] = _.default);
|
|
8058
8165
|
}
|
|
8059
8166
|
const l = e.blockImplementations[o.type].implementation.toInternalHTML({ ...o, props: a }, e);
|
|
8060
8167
|
if (o.type === "numberedListItem" && l.dom.setAttribute("data-index", i.toString()), l.contentDOM && o.content) {
|
|
8061
|
-
const b =
|
|
8168
|
+
const b = kn(
|
|
8062
8169
|
e,
|
|
8063
8170
|
o.content,
|
|
8064
8171
|
// TODO
|
|
@@ -8087,7 +8194,7 @@ function wn(e, o, t, i, n) {
|
|
|
8087
8194
|
...a
|
|
8088
8195
|
})
|
|
8089
8196
|
);
|
|
8090
|
-
return (
|
|
8197
|
+
return (f = c.contentDOM) == null || f.appendChild(l.dom), o.children && o.children.length > 0 && ((g = c.contentDOM) == null || g.appendChild(
|
|
8091
8198
|
ao(e, o.children, t, n)
|
|
8092
8199
|
)), c.dom;
|
|
8093
8200
|
}
|
|
@@ -8111,12 +8218,12 @@ const ao = (e, o, t, i) => {
|
|
|
8111
8218
|
var s;
|
|
8112
8219
|
const n = e.pmSchema.nodes.blockGroup, r = n.spec.toDOM(n.create({})), a = ro(e, o, t, i);
|
|
8113
8220
|
return (s = r.contentDOM) == null || s.appendChild(a), r.dom;
|
|
8114
|
-
},
|
|
8221
|
+
}, vn = (e, o) => {
|
|
8115
8222
|
const t = Ut.fromSchema(e);
|
|
8116
8223
|
return {
|
|
8117
8224
|
serializeBlocks: (i, n) => ao(o, i, t, n).outerHTML
|
|
8118
8225
|
};
|
|
8119
|
-
},
|
|
8226
|
+
}, Ne = (e, o) => {
|
|
8120
8227
|
const t = e.querySelector(
|
|
8121
8228
|
o
|
|
8122
8229
|
);
|
|
@@ -8124,7 +8231,7 @@ const ao = (e, o, t, i) => {
|
|
|
8124
8231
|
return;
|
|
8125
8232
|
const i = e.querySelector("figcaption"), n = (i == null ? void 0 : i.textContent) ?? void 0;
|
|
8126
8233
|
return { targetElement: t, caption: n };
|
|
8127
|
-
},
|
|
8234
|
+
}, yn = (e, o, t, i) => {
|
|
8128
8235
|
const n = document.createElement("div");
|
|
8129
8236
|
n.className = "bn-add-file-button";
|
|
8130
8237
|
const r = document.createElement("div");
|
|
@@ -8170,7 +8277,7 @@ const ao = (e, o, t, i) => {
|
|
|
8170
8277
|
}, rt = (e, o, t, i, n) => {
|
|
8171
8278
|
const r = document.createElement("div");
|
|
8172
8279
|
if (r.className = "bn-file-block-content-wrapper", e.props.url === "") {
|
|
8173
|
-
const s =
|
|
8280
|
+
const s = yn(
|
|
8174
8281
|
e,
|
|
8175
8282
|
o,
|
|
8176
8283
|
i,
|
|
@@ -8213,7 +8320,7 @@ const ao = (e, o, t, i) => {
|
|
|
8213
8320
|
return i.textContent = o, t.appendChild(e), t.appendChild(i), {
|
|
8214
8321
|
dom: t
|
|
8215
8322
|
};
|
|
8216
|
-
},
|
|
8323
|
+
}, vt = (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
8324
|
backgroundColor: B.backgroundColor,
|
|
8218
8325
|
// File name.
|
|
8219
8326
|
name: {
|
|
@@ -8251,14 +8358,14 @@ const ao = (e, o, t, i) => {
|
|
|
8251
8358
|
);
|
|
8252
8359
|
}, Mn = (e) => {
|
|
8253
8360
|
if (e.tagName === "AUDIO")
|
|
8254
|
-
return
|
|
8361
|
+
return vt(e);
|
|
8255
8362
|
if (e.tagName === "FIGURE") {
|
|
8256
|
-
const o =
|
|
8363
|
+
const o = Ne(e, "audio");
|
|
8257
8364
|
if (!o)
|
|
8258
8365
|
return;
|
|
8259
8366
|
const { targetElement: t, caption: i } = o;
|
|
8260
8367
|
return {
|
|
8261
|
-
...
|
|
8368
|
+
...vt(t),
|
|
8262
8369
|
caption: i
|
|
8263
8370
|
};
|
|
8264
8371
|
}
|
|
@@ -8273,7 +8380,7 @@ const ao = (e, o, t, i) => {
|
|
|
8273
8380
|
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
8381
|
dom: o
|
|
8275
8382
|
};
|
|
8276
|
-
}, In =
|
|
8383
|
+
}, In = ye(Bn, {
|
|
8277
8384
|
render: Tn,
|
|
8278
8385
|
parse: Mn,
|
|
8279
8386
|
toExternalHTML: Ln
|
|
@@ -8283,7 +8390,7 @@ const ao = (e, o, t, i) => {
|
|
|
8283
8390
|
name: "Plain Text",
|
|
8284
8391
|
match: ["text", "txt", "plain"]
|
|
8285
8392
|
},
|
|
8286
|
-
...
|
|
8393
|
+
...Vt.filter((e) => [
|
|
8287
8394
|
"c",
|
|
8288
8395
|
"cpp",
|
|
8289
8396
|
"css",
|
|
@@ -8380,7 +8487,7 @@ const ao = (e, o, t, i) => {
|
|
|
8380
8487
|
name: "Objective C",
|
|
8381
8488
|
match: ["objective-c", "objc"]
|
|
8382
8489
|
}
|
|
8383
|
-
],
|
|
8490
|
+
], yt = Symbol.for("blocknote.shikiParser"), Ue = Symbol.for(
|
|
8384
8491
|
"blocknote.shikiHighlighterPromise"
|
|
8385
8492
|
), Je = {
|
|
8386
8493
|
language: {
|
|
@@ -8467,12 +8574,12 @@ const ao = (e, o, t, i) => {
|
|
|
8467
8574
|
},
|
|
8468
8575
|
((m = this.options.domAttributes) == null ? void 0 : m.inlineContent) || {}
|
|
8469
8576
|
), c = (h) => {
|
|
8470
|
-
const
|
|
8471
|
-
o.commands.command(({ tr:
|
|
8577
|
+
const f = h.target.value;
|
|
8578
|
+
o.commands.command(({ tr: g }) => (g.setNodeAttribute(i(), "language", f), !0));
|
|
8472
8579
|
};
|
|
8473
|
-
return e.forEach(({ id: h, name:
|
|
8474
|
-
const
|
|
8475
|
-
|
|
8580
|
+
return e.forEach(({ id: h, name: f }) => {
|
|
8581
|
+
const g = document.createElement("option");
|
|
8582
|
+
g.value = h, g.text = f, a.appendChild(g);
|
|
8476
8583
|
}), s.contentEditable = "false", a.value = t.attrs.language || this.options.defaultLanguage, l.removeChild(d), l.appendChild(s), l.appendChild(r), r.appendChild(d), s.appendChild(a), a.addEventListener("change", c), {
|
|
8477
8584
|
dom: l,
|
|
8478
8585
|
contentDOM: d,
|
|
@@ -8498,7 +8605,7 @@ const ao = (e, o, t, i) => {
|
|
|
8498
8605
|
}
|
|
8499
8606
|
);
|
|
8500
8607
|
const s = a.language;
|
|
8501
|
-
return s && s !== "text" && !t.getLoadedLanguages().includes(s) && e.find(({ id: l }) => l === s) &&
|
|
8608
|
+
return s && s !== "text" && !t.getLoadedLanguages().includes(s) && e.find(({ id: l }) => l === s) && Vt.find(({ id: l }) => l === s) ? t.loadLanguage(s) : (i || (i = o[yt] || ti(t), o[yt] = i), i(a));
|
|
8502
8609
|
},
|
|
8503
8610
|
languageExtractor: (a) => a.attrs.language,
|
|
8504
8611
|
nodeTypes: [this.name]
|
|
@@ -8587,16 +8694,16 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
8587
8694
|
caption: {
|
|
8588
8695
|
default: ""
|
|
8589
8696
|
}
|
|
8590
|
-
},
|
|
8697
|
+
}, jn = {
|
|
8591
8698
|
type: "file",
|
|
8592
8699
|
propSchema: Pn,
|
|
8593
8700
|
content: "none",
|
|
8594
8701
|
isFileBlock: !0
|
|
8595
|
-
},
|
|
8702
|
+
}, Nn = (e, o) => rt(e, o), Rn = (e) => {
|
|
8596
8703
|
if (e.tagName === "EMBED")
|
|
8597
8704
|
return Ct(e);
|
|
8598
8705
|
if (e.tagName === "FIGURE") {
|
|
8599
|
-
const o =
|
|
8706
|
+
const o = Ne(e, "embed");
|
|
8600
8707
|
if (!o)
|
|
8601
8708
|
return;
|
|
8602
8709
|
const { targetElement: t, caption: i } = o;
|
|
@@ -8616,8 +8723,8 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
8616
8723
|
return o.href = e.props.url, o.textContent = e.props.name || e.props.url, e.props.caption ? Re(o, e.props.caption) : {
|
|
8617
8724
|
dom: o
|
|
8618
8725
|
};
|
|
8619
|
-
}, Un =
|
|
8620
|
-
render:
|
|
8726
|
+
}, Un = ye(jn, {
|
|
8727
|
+
render: Nn,
|
|
8621
8728
|
parse: Rn,
|
|
8622
8729
|
toExternalHTML: Dn
|
|
8623
8730
|
}), co = (e, o, t, i, n, r) => {
|
|
@@ -8639,46 +8746,46 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
8639
8746
|
!o.isEditable && i.contains(d) && i.contains(c) && (i.removeChild(d), i.removeChild(c));
|
|
8640
8747
|
return;
|
|
8641
8748
|
}
|
|
8642
|
-
let
|
|
8643
|
-
e.props.textAlignment === "center" ? u.handleUsed === "left" ?
|
|
8644
|
-
},
|
|
8749
|
+
let y;
|
|
8750
|
+
e.props.textAlignment === "center" ? u.handleUsed === "left" ? y = u.initialWidth + (u.initialClientX - w.clientX) * 2 : y = u.initialWidth + (w.clientX - u.initialClientX) * 2 : u.handleUsed === "left" ? y = u.initialWidth + u.initialClientX - w.clientX : y = u.initialWidth + w.clientX - u.initialClientX, m = Math.max(y, 64), l.style.width = `${m}px`;
|
|
8751
|
+
}, f = (w) => {
|
|
8645
8752
|
(!w.target || !l.contains(w.target) || !o.isEditable) && i.contains(d) && i.contains(c) && (i.removeChild(d), i.removeChild(c)), u && (u = void 0, o.updateBlock(e, {
|
|
8646
8753
|
props: {
|
|
8647
8754
|
previewWidth: m
|
|
8648
8755
|
}
|
|
8649
8756
|
}));
|
|
8650
|
-
},
|
|
8757
|
+
}, g = () => {
|
|
8651
8758
|
o.isEditable && (i.appendChild(d), i.appendChild(c));
|
|
8652
8759
|
}, b = (w) => {
|
|
8653
8760
|
w.relatedTarget === d || w.relatedTarget === c || u || o.isEditable && i.contains(d) && i.contains(c) && (i.removeChild(d), i.removeChild(c));
|
|
8654
|
-
},
|
|
8761
|
+
}, _ = (w) => {
|
|
8655
8762
|
w.preventDefault(), u = {
|
|
8656
8763
|
handleUsed: "left",
|
|
8657
8764
|
initialWidth: l.clientWidth,
|
|
8658
8765
|
initialClientX: w.clientX
|
|
8659
8766
|
};
|
|
8660
|
-
},
|
|
8767
|
+
}, k = (w) => {
|
|
8661
8768
|
w.preventDefault(), u = {
|
|
8662
8769
|
handleUsed: "right",
|
|
8663
8770
|
initialWidth: l.clientWidth,
|
|
8664
8771
|
initialClientX: w.clientX
|
|
8665
8772
|
};
|
|
8666
8773
|
};
|
|
8667
|
-
return window.addEventListener("mousemove", h), window.addEventListener("mouseup",
|
|
8774
|
+
return window.addEventListener("mousemove", h), window.addEventListener("mouseup", f), l.addEventListener("mouseenter", g), l.addEventListener("mouseleave", b), d.addEventListener(
|
|
8668
8775
|
"mousedown",
|
|
8669
|
-
|
|
8776
|
+
_
|
|
8670
8777
|
), c.addEventListener(
|
|
8671
8778
|
"mousedown",
|
|
8672
|
-
|
|
8779
|
+
k
|
|
8673
8780
|
), {
|
|
8674
8781
|
dom: l,
|
|
8675
8782
|
destroy: () => {
|
|
8676
|
-
s == null || s(), window.removeEventListener("mousemove", h), window.removeEventListener("mouseup",
|
|
8783
|
+
s == null || s(), window.removeEventListener("mousemove", h), window.removeEventListener("mouseup", f), l.removeEventListener("mouseenter", g), l.removeEventListener("mouseleave", b), d.removeEventListener(
|
|
8677
8784
|
"mousedown",
|
|
8678
|
-
|
|
8785
|
+
_
|
|
8679
8786
|
), c.removeEventListener(
|
|
8680
8787
|
"mousedown",
|
|
8681
|
-
|
|
8788
|
+
k
|
|
8682
8789
|
);
|
|
8683
8790
|
}
|
|
8684
8791
|
};
|
|
@@ -8716,13 +8823,13 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
8716
8823
|
previewWidth: {
|
|
8717
8824
|
default: 512
|
|
8718
8825
|
}
|
|
8719
|
-
},
|
|
8826
|
+
}, zn = {
|
|
8720
8827
|
type: "image",
|
|
8721
8828
|
propSchema: On,
|
|
8722
8829
|
content: "none",
|
|
8723
8830
|
isFileBlock: !0,
|
|
8724
8831
|
fileBlockAccept: ["image/*"]
|
|
8725
|
-
},
|
|
8832
|
+
}, Vn = (e, o) => {
|
|
8726
8833
|
const t = document.createElement("div");
|
|
8727
8834
|
t.innerHTML = Hn;
|
|
8728
8835
|
const i = document.createElement("div");
|
|
@@ -8742,7 +8849,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
8742
8849
|
if (e.tagName === "IMG")
|
|
8743
8850
|
return xt(e);
|
|
8744
8851
|
if (e.tagName === "FIGURE") {
|
|
8745
|
-
const o =
|
|
8852
|
+
const o = Ne(e, "img");
|
|
8746
8853
|
if (!o)
|
|
8747
8854
|
return;
|
|
8748
8855
|
const { targetElement: t, caption: i } = o;
|
|
@@ -8762,17 +8869,17 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
8762
8869
|
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
8870
|
dom: o
|
|
8764
8871
|
};
|
|
8765
|
-
}, Gn =
|
|
8766
|
-
render:
|
|
8872
|
+
}, Gn = ye(zn, {
|
|
8873
|
+
render: Vn,
|
|
8767
8874
|
parse: Fn,
|
|
8768
8875
|
toExternalHTML: $n
|
|
8769
|
-
}),
|
|
8876
|
+
}), Kn = {
|
|
8770
8877
|
type: "pageBreak",
|
|
8771
8878
|
propSchema: {},
|
|
8772
8879
|
content: "none",
|
|
8773
8880
|
isFileBlock: !1,
|
|
8774
8881
|
isSelectable: !1
|
|
8775
|
-
},
|
|
8882
|
+
}, Wn = () => {
|
|
8776
8883
|
const e = document.createElement("div");
|
|
8777
8884
|
return e.className = "bn-page-break", e.setAttribute("data-page-break", ""), {
|
|
8778
8885
|
dom: e
|
|
@@ -8782,15 +8889,15 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
8782
8889
|
return {
|
|
8783
8890
|
type: "pageBreak"
|
|
8784
8891
|
};
|
|
8785
|
-
},
|
|
8892
|
+
}, Zn = () => {
|
|
8786
8893
|
const e = document.createElement("div");
|
|
8787
8894
|
return e.setAttribute("data-page-break", ""), {
|
|
8788
8895
|
dom: e
|
|
8789
8896
|
};
|
|
8790
|
-
},
|
|
8791
|
-
render:
|
|
8897
|
+
}, Xn = ye(Kn, {
|
|
8898
|
+
render: Wn,
|
|
8792
8899
|
parse: qn,
|
|
8793
|
-
toExternalHTML:
|
|
8900
|
+
toExternalHTML: Zn
|
|
8794
8901
|
}), Jn = ge.create({
|
|
8795
8902
|
name: "backgroundColor",
|
|
8796
8903
|
addAttributes() {
|
|
@@ -8852,14 +8959,14 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
8852
8959
|
content: "inline*",
|
|
8853
8960
|
group: "blockContent",
|
|
8854
8961
|
addAttributes() {
|
|
8855
|
-
return
|
|
8962
|
+
return ve(uo);
|
|
8856
8963
|
},
|
|
8857
8964
|
addInputRules() {
|
|
8858
8965
|
return [
|
|
8859
8966
|
...[1, 2, 3].map((e) => new le({
|
|
8860
8967
|
find: new RegExp(`^(#{${e}})\\s$`),
|
|
8861
8968
|
handler: ({ state: o, chain: t, range: i }) => {
|
|
8862
|
-
const n =
|
|
8969
|
+
const n = v(o);
|
|
8863
8970
|
!n.isBlockContainer || n.blockContent.node.type.spec.content !== "inline*" || t().command(
|
|
8864
8971
|
M(
|
|
8865
8972
|
this.options.editor,
|
|
@@ -8879,7 +8986,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
8879
8986
|
addKeyboardShortcuts() {
|
|
8880
8987
|
return {
|
|
8881
8988
|
"Mod-Alt-1": () => {
|
|
8882
|
-
const e =
|
|
8989
|
+
const e = v(this.editor.state);
|
|
8883
8990
|
return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
|
|
8884
8991
|
M(this.options.editor, e.bnBlock.beforePos, {
|
|
8885
8992
|
type: "heading",
|
|
@@ -8890,7 +8997,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
8890
8997
|
);
|
|
8891
8998
|
},
|
|
8892
8999
|
"Mod-Alt-2": () => {
|
|
8893
|
-
const e =
|
|
9000
|
+
const e = v(this.editor.state);
|
|
8894
9001
|
return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
|
|
8895
9002
|
M(this.options.editor, e.bnBlock.beforePos, {
|
|
8896
9003
|
type: "heading",
|
|
@@ -8901,7 +9008,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
8901
9008
|
);
|
|
8902
9009
|
},
|
|
8903
9010
|
"Mod-Alt-3": () => {
|
|
8904
|
-
const e =
|
|
9011
|
+
const e = v(this.editor.state);
|
|
8905
9012
|
return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
|
|
8906
9013
|
M(this.options.editor, e.bnBlock.beforePos, {
|
|
8907
9014
|
type: "heading",
|
|
@@ -8972,7 +9079,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
8972
9079
|
];
|
|
8973
9080
|
return n && i.tr.split(e, 2, s), !0;
|
|
8974
9081
|
}, st = (e) => {
|
|
8975
|
-
const o = e._tiptapEditor, t =
|
|
9082
|
+
const o = e._tiptapEditor, t = v(o.state);
|
|
8976
9083
|
if (!t.isBlockContainer)
|
|
8977
9084
|
return !1;
|
|
8978
9085
|
const { bnBlock: i, blockContent: n } = t, r = o.state.selection.anchor === o.state.selection.head;
|
|
@@ -9007,7 +9114,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9007
9114
|
new le({
|
|
9008
9115
|
find: new RegExp("^[-+*]\\s$"),
|
|
9009
9116
|
handler: ({ state: e, chain: o, range: t }) => {
|
|
9010
|
-
const i =
|
|
9117
|
+
const i = v(e);
|
|
9011
9118
|
!i.isBlockContainer || i.blockContent.node.type.spec.content !== "inline*" || o().command(
|
|
9012
9119
|
M(
|
|
9013
9120
|
this.options.editor,
|
|
@@ -9026,7 +9133,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9026
9133
|
return {
|
|
9027
9134
|
Enter: () => st(this.options.editor),
|
|
9028
9135
|
"Mod-Shift-8": () => {
|
|
9029
|
-
const e =
|
|
9136
|
+
const e = v(this.editor.state);
|
|
9030
9137
|
return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
|
|
9031
9138
|
M(this.options.editor, e.bnBlock.beforePos, {
|
|
9032
9139
|
type: "bulletListItem",
|
|
@@ -9094,7 +9201,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9094
9201
|
content: "inline*",
|
|
9095
9202
|
group: "blockContent",
|
|
9096
9203
|
addAttributes() {
|
|
9097
|
-
return
|
|
9204
|
+
return ve(mo);
|
|
9098
9205
|
},
|
|
9099
9206
|
addInputRules() {
|
|
9100
9207
|
return [
|
|
@@ -9102,7 +9209,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9102
9209
|
new le({
|
|
9103
9210
|
find: new RegExp("\\[\\s*\\]\\s$"),
|
|
9104
9211
|
handler: ({ state: e, chain: o, range: t }) => {
|
|
9105
|
-
const i =
|
|
9212
|
+
const i = v(e);
|
|
9106
9213
|
!i.isBlockContainer || i.blockContent.node.type.spec.content !== "inline*" || o().command(
|
|
9107
9214
|
M(
|
|
9108
9215
|
this.options.editor,
|
|
@@ -9120,7 +9227,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9120
9227
|
new le({
|
|
9121
9228
|
find: new RegExp("\\[[Xx]\\]\\s$"),
|
|
9122
9229
|
handler: ({ state: e, chain: o, range: t }) => {
|
|
9123
|
-
const i =
|
|
9230
|
+
const i = v(e);
|
|
9124
9231
|
!i.isBlockContainer || i.blockContent.node.type.spec.content !== "inline*" || o().command(
|
|
9125
9232
|
M(
|
|
9126
9233
|
this.options.editor,
|
|
@@ -9141,7 +9248,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9141
9248
|
return {
|
|
9142
9249
|
Enter: () => st(this.options.editor),
|
|
9143
9250
|
"Mod-Shift-9": () => {
|
|
9144
|
-
const e =
|
|
9251
|
+
const e = v(this.editor.state);
|
|
9145
9252
|
return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
|
|
9146
9253
|
M(this.options.editor, e.bnBlock.beforePos, {
|
|
9147
9254
|
type: "checkListItem",
|
|
@@ -9286,26 +9393,26 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9286
9393
|
d.bnBlock.beforePos
|
|
9287
9394
|
).nodeBefore;
|
|
9288
9395
|
if (c) {
|
|
9289
|
-
const
|
|
9396
|
+
const f = te({
|
|
9290
9397
|
posBeforeNode: d.bnBlock.beforePos - c.nodeSize,
|
|
9291
9398
|
node: c
|
|
9292
9399
|
});
|
|
9293
|
-
if (
|
|
9294
|
-
if (!
|
|
9400
|
+
if (f.blockNoteType === "numberedListItem") {
|
|
9401
|
+
if (!f.isBlockContainer)
|
|
9295
9402
|
throw new Error("impossible");
|
|
9296
|
-
const b =
|
|
9403
|
+
const b = f.blockContent.node.attrs.index;
|
|
9297
9404
|
l = (parseInt(b) + 1).toString();
|
|
9298
9405
|
}
|
|
9299
9406
|
}
|
|
9300
9407
|
const u = d.blockContent.node, m = u.attrs.index, h = ((s = c == null ? void 0 : c.firstChild) == null ? void 0 : s.type.name) !== "numberedListItem";
|
|
9301
9408
|
if (m !== l || u.attrs.start && !h) {
|
|
9302
9409
|
n = !0;
|
|
9303
|
-
const { start:
|
|
9410
|
+
const { start: f, ...g } = u.attrs;
|
|
9304
9411
|
i.setNodeMarkup(d.blockContent.beforePos, void 0, {
|
|
9305
|
-
...
|
|
9412
|
+
...g,
|
|
9306
9413
|
index: l,
|
|
9307
|
-
...typeof
|
|
9308
|
-
start:
|
|
9414
|
+
...typeof f == "number" && h && {
|
|
9415
|
+
start: f
|
|
9309
9416
|
}
|
|
9310
9417
|
});
|
|
9311
9418
|
}
|
|
@@ -9322,7 +9429,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9322
9429
|
priority: 90,
|
|
9323
9430
|
addAttributes() {
|
|
9324
9431
|
return {
|
|
9325
|
-
...
|
|
9432
|
+
...ve(ho),
|
|
9326
9433
|
// the index attribute is only used internally (it's not part of the blocknote schema)
|
|
9327
9434
|
// that's why it's defined explicitly here, and not part of the prop schema
|
|
9328
9435
|
index: {
|
|
@@ -9340,7 +9447,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9340
9447
|
new le({
|
|
9341
9448
|
find: new RegExp("^(\\d+)\\.\\s$"),
|
|
9342
9449
|
handler: ({ state: e, chain: o, range: t, match: i }) => {
|
|
9343
|
-
const n =
|
|
9450
|
+
const n = v(e);
|
|
9344
9451
|
if (!n.isBlockContainer || n.blockContent.node.type.spec.content !== "inline*" || n.blockNoteType === "numberedListItem")
|
|
9345
9452
|
return;
|
|
9346
9453
|
const r = parseInt(i[1]);
|
|
@@ -9364,7 +9471,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9364
9471
|
return {
|
|
9365
9472
|
Enter: () => st(this.options.editor),
|
|
9366
9473
|
"Mod-Shift-7": () => {
|
|
9367
|
-
const e =
|
|
9474
|
+
const e = v(this.editor.state);
|
|
9368
9475
|
return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
|
|
9369
9476
|
M(this.options.editor, e.bnBlock.beforePos, {
|
|
9370
9477
|
type: "numberedListItem",
|
|
@@ -9444,7 +9551,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9444
9551
|
addKeyboardShortcuts() {
|
|
9445
9552
|
return {
|
|
9446
9553
|
"Mod-Alt-0": () => {
|
|
9447
|
-
const e =
|
|
9554
|
+
const e = v(this.editor.state);
|
|
9448
9555
|
return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
|
|
9449
9556
|
M(this.options.editor, e.bnBlock.beforePos, {
|
|
9450
9557
|
type: "paragraph",
|
|
@@ -9523,13 +9630,13 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9523
9630
|
};
|
|
9524
9631
|
return {
|
|
9525
9632
|
tableRole: Go(
|
|
9526
|
-
|
|
9633
|
+
Ko(e, "tableRole", o)
|
|
9527
9634
|
)
|
|
9528
9635
|
};
|
|
9529
9636
|
}
|
|
9530
9637
|
}), br = {
|
|
9531
9638
|
textColor: B.textColor
|
|
9532
|
-
},
|
|
9639
|
+
}, _r = G({
|
|
9533
9640
|
name: "table",
|
|
9534
9641
|
content: "tableRow+",
|
|
9535
9642
|
group: "blockContent",
|
|
@@ -9564,7 +9671,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9564
9671
|
constructor(r, a, s) {
|
|
9565
9672
|
super(r, a), this.node = r, this.cellMinWidth = a, this.blockContentHTMLAttributes = s;
|
|
9566
9673
|
const l = document.createElement("div");
|
|
9567
|
-
l.className =
|
|
9674
|
+
l.className = X(
|
|
9568
9675
|
"bn-block-content",
|
|
9569
9676
|
s.class
|
|
9570
9677
|
), l.setAttribute("data-content-type", "table");
|
|
@@ -9587,7 +9694,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9587
9694
|
});
|
|
9588
9695
|
};
|
|
9589
9696
|
}
|
|
9590
|
-
}),
|
|
9697
|
+
}), kr = G({
|
|
9591
9698
|
name: "tableParagraph",
|
|
9592
9699
|
group: "tableContent",
|
|
9593
9700
|
content: "inline*",
|
|
@@ -9617,11 +9724,11 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9617
9724
|
return ["p", e, 0];
|
|
9618
9725
|
}
|
|
9619
9726
|
}), wr = J(
|
|
9620
|
-
|
|
9727
|
+
_r,
|
|
9621
9728
|
br,
|
|
9622
9729
|
[
|
|
9623
9730
|
gr,
|
|
9624
|
-
|
|
9731
|
+
kr,
|
|
9625
9732
|
wi.extend({
|
|
9626
9733
|
/**
|
|
9627
9734
|
* We allow table headers and cells to have multiple tableContent nodes because
|
|
@@ -9632,15 +9739,15 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9632
9739
|
*/
|
|
9633
9740
|
content: "tableContent+"
|
|
9634
9741
|
}),
|
|
9635
|
-
|
|
9742
|
+
ki.extend({
|
|
9636
9743
|
content: "tableContent+"
|
|
9637
9744
|
}),
|
|
9638
|
-
|
|
9745
|
+
vi
|
|
9639
9746
|
]
|
|
9640
9747
|
), St = (e) => {
|
|
9641
9748
|
const o = e.src || void 0, t = e.width || void 0;
|
|
9642
9749
|
return { url: o, previewWidth: t };
|
|
9643
|
-
},
|
|
9750
|
+
}, vr = '<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>', yr = {
|
|
9644
9751
|
textAlignment: B.textAlignment,
|
|
9645
9752
|
backgroundColor: B.backgroundColor,
|
|
9646
9753
|
// File name.
|
|
@@ -9664,13 +9771,13 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9664
9771
|
}
|
|
9665
9772
|
}, Cr = {
|
|
9666
9773
|
type: "video",
|
|
9667
|
-
propSchema:
|
|
9774
|
+
propSchema: yr,
|
|
9668
9775
|
content: "none",
|
|
9669
9776
|
isFileBlock: !0,
|
|
9670
9777
|
fileBlockAccept: ["video/*"]
|
|
9671
9778
|
}, xr = (e, o) => {
|
|
9672
9779
|
const t = document.createElement("div");
|
|
9673
|
-
t.innerHTML =
|
|
9780
|
+
t.innerHTML = vr;
|
|
9674
9781
|
const i = document.createElement("div");
|
|
9675
9782
|
i.className = "bn-visual-media-wrapper";
|
|
9676
9783
|
const n = document.createElement("video");
|
|
@@ -9688,7 +9795,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9688
9795
|
if (e.tagName === "VIDEO")
|
|
9689
9796
|
return St(e);
|
|
9690
9797
|
if (e.tagName === "FIGURE") {
|
|
9691
|
-
const o =
|
|
9798
|
+
const o = Ne(e, "video");
|
|
9692
9799
|
if (!o)
|
|
9693
9800
|
return;
|
|
9694
9801
|
const { targetElement: t, caption: i } = o;
|
|
@@ -9708,7 +9815,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9708
9815
|
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
9816
|
dom: o
|
|
9710
9817
|
};
|
|
9711
|
-
}, Br =
|
|
9818
|
+
}, Br = ye(Cr, {
|
|
9712
9819
|
render: xr,
|
|
9713
9820
|
parse: Sr,
|
|
9714
9821
|
toExternalHTML: Er
|
|
@@ -9724,19 +9831,19 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
|
|
|
9724
9831
|
image: Gn,
|
|
9725
9832
|
video: Br,
|
|
9726
9833
|
audio: In
|
|
9727
|
-
}, Tr =
|
|
9834
|
+
}, Tr = Wt(go), bo = {
|
|
9728
9835
|
bold: Q(hi, "boolean"),
|
|
9729
9836
|
italic: Q(gi, "boolean"),
|
|
9730
|
-
underline: Q(
|
|
9837
|
+
underline: Q(_i, "boolean"),
|
|
9731
9838
|
strike: Q(bi, "boolean"),
|
|
9732
9839
|
code: Q(fi, "boolean"),
|
|
9733
9840
|
textColor: er,
|
|
9734
9841
|
backgroundColor: Yn
|
|
9735
|
-
}, nl = Jt(bo),
|
|
9842
|
+
}, nl = Jt(bo), _o = {
|
|
9736
9843
|
text: { config: "text", implementation: {} },
|
|
9737
9844
|
link: { config: "link", implementation: {} }
|
|
9738
|
-
}, Mr =
|
|
9739
|
-
|
|
9845
|
+
}, Mr = Zt(
|
|
9846
|
+
_o
|
|
9740
9847
|
);
|
|
9741
9848
|
function P(e, o) {
|
|
9742
9849
|
return e in o.schema.blockSchema && o.schema.blockSchema[e] === Tr[e];
|
|
@@ -9763,19 +9870,22 @@ function ll(e, o, t) {
|
|
|
9763
9870
|
return Ar(e, o.type, t);
|
|
9764
9871
|
}
|
|
9765
9872
|
function Et(e) {
|
|
9766
|
-
return e instanceof
|
|
9873
|
+
return e instanceof _e;
|
|
9767
9874
|
}
|
|
9768
9875
|
function Pr(e) {
|
|
9769
9876
|
let o = e.getTextCursorPosition().block, t = e.schema.blockSchema[o.type].content;
|
|
9770
|
-
for (; t === "none"; )
|
|
9771
|
-
o = e.getTextCursorPosition().nextBlock,
|
|
9877
|
+
for (; t === "none"; ) {
|
|
9878
|
+
if (o = e.getTextCursorPosition().nextBlock, o === void 0)
|
|
9879
|
+
return;
|
|
9880
|
+
t = e.schema.blockSchema[o.type].content, e.setTextCursorPosition(o, "end");
|
|
9881
|
+
}
|
|
9772
9882
|
}
|
|
9773
9883
|
function L(e, o) {
|
|
9774
9884
|
const t = e.getTextCursorPosition().block;
|
|
9775
9885
|
if (t.content === void 0)
|
|
9776
9886
|
throw new Error("Slash Menu open in a block that doesn't contain content.");
|
|
9777
9887
|
let i;
|
|
9778
|
-
return Array.isArray(t.content) && (t.content.length === 1 &&
|
|
9888
|
+
return Array.isArray(t.content) && (t.content.length === 1 && Z(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
9889
|
}
|
|
9780
9890
|
function dl(e) {
|
|
9781
9891
|
const o = [];
|
|
@@ -9787,7 +9897,7 @@ function dl(e) {
|
|
|
9787
9897
|
props: { level: 1 }
|
|
9788
9898
|
});
|
|
9789
9899
|
},
|
|
9790
|
-
badge:
|
|
9900
|
+
badge: W("Mod-Alt-1"),
|
|
9791
9901
|
key: "heading",
|
|
9792
9902
|
...e.dictionary.slash_menu.heading
|
|
9793
9903
|
},
|
|
@@ -9798,7 +9908,7 @@ function dl(e) {
|
|
|
9798
9908
|
props: { level: 2 }
|
|
9799
9909
|
});
|
|
9800
9910
|
},
|
|
9801
|
-
badge:
|
|
9911
|
+
badge: W("Mod-Alt-2"),
|
|
9802
9912
|
key: "heading_2",
|
|
9803
9913
|
...e.dictionary.slash_menu.heading_2
|
|
9804
9914
|
},
|
|
@@ -9809,7 +9919,7 @@ function dl(e) {
|
|
|
9809
9919
|
props: { level: 3 }
|
|
9810
9920
|
});
|
|
9811
9921
|
},
|
|
9812
|
-
badge:
|
|
9922
|
+
badge: W("Mod-Alt-3"),
|
|
9813
9923
|
key: "heading_3",
|
|
9814
9924
|
...e.dictionary.slash_menu.heading_3
|
|
9815
9925
|
}
|
|
@@ -9819,7 +9929,7 @@ function dl(e) {
|
|
|
9819
9929
|
type: "numberedListItem"
|
|
9820
9930
|
});
|
|
9821
9931
|
},
|
|
9822
|
-
badge:
|
|
9932
|
+
badge: W("Mod-Shift-7"),
|
|
9823
9933
|
key: "numbered_list",
|
|
9824
9934
|
...e.dictionary.slash_menu.numbered_list
|
|
9825
9935
|
}), P("bulletListItem", e) && o.push({
|
|
@@ -9828,7 +9938,7 @@ function dl(e) {
|
|
|
9828
9938
|
type: "bulletListItem"
|
|
9829
9939
|
});
|
|
9830
9940
|
},
|
|
9831
|
-
badge:
|
|
9941
|
+
badge: W("Mod-Shift-8"),
|
|
9832
9942
|
key: "bullet_list",
|
|
9833
9943
|
...e.dictionary.slash_menu.bullet_list
|
|
9834
9944
|
}), P("checkListItem", e) && o.push({
|
|
@@ -9837,7 +9947,7 @@ function dl(e) {
|
|
|
9837
9947
|
type: "checkListItem"
|
|
9838
9948
|
});
|
|
9839
9949
|
},
|
|
9840
|
-
badge:
|
|
9950
|
+
badge: W("Mod-Shift-9"),
|
|
9841
9951
|
key: "check_list",
|
|
9842
9952
|
...e.dictionary.slash_menu.check_list
|
|
9843
9953
|
}), P("paragraph", e) && o.push({
|
|
@@ -9846,7 +9956,7 @@ function dl(e) {
|
|
|
9846
9956
|
type: "paragraph"
|
|
9847
9957
|
});
|
|
9848
9958
|
},
|
|
9849
|
-
badge:
|
|
9959
|
+
badge: W("Mod-Alt-0"),
|
|
9850
9960
|
key: "paragraph",
|
|
9851
9961
|
...e.dictionary.slash_menu.paragraph
|
|
9852
9962
|
}), P("codeBlock", e) && o.push({
|
|
@@ -9855,7 +9965,7 @@ function dl(e) {
|
|
|
9855
9965
|
type: "codeBlock"
|
|
9856
9966
|
});
|
|
9857
9967
|
},
|
|
9858
|
-
badge:
|
|
9968
|
+
badge: W("Mod-Alt-c"),
|
|
9859
9969
|
key: "code_block",
|
|
9860
9970
|
...e.dictionary.slash_menu.code_block
|
|
9861
9971
|
}), P("table", e) && o.push({
|
|
@@ -9965,7 +10075,7 @@ class Ce {
|
|
|
9965
10075
|
p(this, "BlockNoteEditor", "only for types");
|
|
9966
10076
|
p(this, "Block", "only for types");
|
|
9967
10077
|
p(this, "PartialBlock", "only for types");
|
|
9968
|
-
this.blockSpecs = He(o == null ? void 0 : o.blockSpecs) || go, this.inlineContentSpecs = He(o == null ? void 0 : o.inlineContentSpecs) ||
|
|
10078
|
+
this.blockSpecs = He(o == null ? void 0 : o.blockSpecs) || go, this.inlineContentSpecs = He(o == null ? void 0 : o.inlineContentSpecs) || _o, this.styleSpecs = He(o == null ? void 0 : o.styleSpecs) || bo, this.blockSchema = Wt(this.blockSpecs), this.inlineContentSchema = Zt(
|
|
9969
10079
|
this.inlineContentSpecs
|
|
9970
10080
|
), this.styleSchema = Jt(this.styleSpecs);
|
|
9971
10081
|
}
|
|
@@ -9973,24 +10083,24 @@ class Ce {
|
|
|
9973
10083
|
return new Ce(o);
|
|
9974
10084
|
}
|
|
9975
10085
|
}
|
|
9976
|
-
const
|
|
10086
|
+
const ko = Ce.create({
|
|
9977
10087
|
blockSpecs: {
|
|
9978
|
-
pageBreak:
|
|
10088
|
+
pageBreak: Xn
|
|
9979
10089
|
}
|
|
9980
10090
|
}), ul = (e) => Ce.create({
|
|
9981
10091
|
blockSpecs: {
|
|
9982
10092
|
...e.blockSpecs,
|
|
9983
|
-
...
|
|
10093
|
+
...ko.blockSpecs
|
|
9984
10094
|
},
|
|
9985
10095
|
inlineContentSpecs: e.inlineContentSpecs,
|
|
9986
10096
|
styleSpecs: e.styleSpecs
|
|
9987
10097
|
});
|
|
9988
|
-
function
|
|
9989
|
-
return "pageBreak" in e.schema.blockSchema && e.schema.blockSchema.pageBreak ===
|
|
10098
|
+
function jr(e) {
|
|
10099
|
+
return "pageBreak" in e.schema.blockSchema && e.schema.blockSchema.pageBreak === ko.blockSchema.pageBreak;
|
|
9990
10100
|
}
|
|
9991
10101
|
function pl(e) {
|
|
9992
10102
|
const o = [];
|
|
9993
|
-
return
|
|
10103
|
+
return jr(e) && o.push({
|
|
9994
10104
|
...e.dictionary.slash_menu.page_break,
|
|
9995
10105
|
onItemClick: () => {
|
|
9996
10106
|
L(e, {
|
|
@@ -10000,13 +10110,13 @@ function pl(e) {
|
|
|
10000
10110
|
key: "page_break"
|
|
10001
10111
|
}), o;
|
|
10002
10112
|
}
|
|
10003
|
-
function
|
|
10113
|
+
function Nr(e, o, t, i = "before") {
|
|
10004
10114
|
const n = typeof t == "string" ? t : t.id, r = [];
|
|
10005
10115
|
for (const l of o)
|
|
10006
10116
|
r.push(
|
|
10007
10117
|
ie(l, e.pmSchema, e.schema.styleSchema)
|
|
10008
10118
|
);
|
|
10009
|
-
const a =
|
|
10119
|
+
const a = N(n, e._tiptapEditor.state.doc);
|
|
10010
10120
|
if (!a)
|
|
10011
10121
|
throw new Error(`Block with ID ${n} not found`);
|
|
10012
10122
|
i === "before" && e.dispatch(
|
|
@@ -10032,7 +10142,7 @@ function jr(e, o, t, i = "before") {
|
|
|
10032
10142
|
}
|
|
10033
10143
|
function Rr(e) {
|
|
10034
10144
|
const o = e._tiptapEditor.state, t = o.selection, i = q(o.doc, t.anchor);
|
|
10035
|
-
if (t instanceof
|
|
10145
|
+
if (t instanceof _e)
|
|
10036
10146
|
return {
|
|
10037
10147
|
type: "cell",
|
|
10038
10148
|
anchorBlockId: i.node.attrs.id,
|
|
@@ -10057,7 +10167,7 @@ function Rr(e) {
|
|
|
10057
10167
|
}
|
|
10058
10168
|
function Dr(e, o) {
|
|
10059
10169
|
var n, r;
|
|
10060
|
-
const t = (n =
|
|
10170
|
+
const t = (n = N(
|
|
10061
10171
|
o.anchorBlockId,
|
|
10062
10172
|
e._tiptapEditor.state.doc
|
|
10063
10173
|
)) == null ? void 0 : n.posBeforeNode;
|
|
@@ -10067,7 +10177,7 @@ function Dr(e, o) {
|
|
|
10067
10177
|
);
|
|
10068
10178
|
let i;
|
|
10069
10179
|
if (o.type === "cell")
|
|
10070
|
-
i =
|
|
10180
|
+
i = _e.create(
|
|
10071
10181
|
e._tiptapEditor.state.doc,
|
|
10072
10182
|
t + o.anchorCellOffset,
|
|
10073
10183
|
t + o.headCellOffset
|
|
@@ -10078,7 +10188,7 @@ function Dr(e, o) {
|
|
|
10078
10188
|
t + 1
|
|
10079
10189
|
);
|
|
10080
10190
|
else {
|
|
10081
|
-
const a = (r =
|
|
10191
|
+
const a = (r = N(
|
|
10082
10192
|
o.headBlockId,
|
|
10083
10193
|
e._tiptapEditor.state.doc
|
|
10084
10194
|
)) == null ? void 0 : r.posBeforeNode;
|
|
@@ -10107,15 +10217,15 @@ function wo(e, o, t) {
|
|
|
10107
10217
|
], n = Rr(e);
|
|
10108
10218
|
e.removeBlocks(i), e.insertBlocks(Ye(i), o, t), Dr(e, n);
|
|
10109
10219
|
}
|
|
10110
|
-
function
|
|
10220
|
+
function vo(e) {
|
|
10111
10221
|
return !e || e.type !== "columnList";
|
|
10112
10222
|
}
|
|
10113
|
-
function
|
|
10223
|
+
function yo(e, o, t) {
|
|
10114
10224
|
let i, n;
|
|
10115
10225
|
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
10226
|
return;
|
|
10117
10227
|
const r = e.getParentBlock(i);
|
|
10118
|
-
return
|
|
10228
|
+
return vo(r) ? { referenceBlock: i, placement: n } : yo(
|
|
10119
10229
|
e,
|
|
10120
10230
|
n === "after" ? i : e.getPrevBlock(i),
|
|
10121
10231
|
r
|
|
@@ -10126,14 +10236,14 @@ function Co(e, o, t) {
|
|
|
10126
10236
|
if (o ? o.children.length > 0 ? (i = o.children[0], n = "before") : (i = o, n = "after") : t && (i = t, n = "after"), !i || !n)
|
|
10127
10237
|
return;
|
|
10128
10238
|
const r = e.getParentBlock(i);
|
|
10129
|
-
return
|
|
10239
|
+
return vo(r) ? { referenceBlock: i, placement: n } : Co(
|
|
10130
10240
|
e,
|
|
10131
10241
|
n === "before" ? i : e.getNextBlock(i),
|
|
10132
10242
|
r
|
|
10133
10243
|
);
|
|
10134
10244
|
}
|
|
10135
10245
|
function Ur(e) {
|
|
10136
|
-
const o = e.getSelection(), t = (o == null ? void 0 : o.blocks[0]) || e.getTextCursorPosition().block, i =
|
|
10246
|
+
const o = e.getSelection(), t = (o == null ? void 0 : o.blocks[0]) || e.getTextCursorPosition().block, i = yo(
|
|
10137
10247
|
e,
|
|
10138
10248
|
e.getPrevBlock(t),
|
|
10139
10249
|
e.getParentBlock(t)
|
|
@@ -10179,14 +10289,14 @@ function Or(e, o) {
|
|
|
10179
10289
|
),
|
|
10180
10290
|
c ? 3 : 1,
|
|
10181
10291
|
0
|
|
10182
|
-
), h = a.start,
|
|
10292
|
+
), h = a.start, f = a.end;
|
|
10183
10293
|
i(
|
|
10184
10294
|
t.tr.step(
|
|
10185
|
-
new
|
|
10295
|
+
new Ve(
|
|
10186
10296
|
h - (c ? 3 : 1),
|
|
10187
|
-
|
|
10297
|
+
f,
|
|
10188
10298
|
h,
|
|
10189
|
-
|
|
10299
|
+
f,
|
|
10190
10300
|
m,
|
|
10191
10301
|
1,
|
|
10192
10302
|
!0
|
|
@@ -10205,17 +10315,17 @@ function xo(e) {
|
|
|
10205
10315
|
)
|
|
10206
10316
|
);
|
|
10207
10317
|
}
|
|
10208
|
-
function
|
|
10318
|
+
function zr(e) {
|
|
10209
10319
|
e._tiptapEditor.commands.liftListItem("blockContainer");
|
|
10210
10320
|
}
|
|
10211
|
-
function
|
|
10212
|
-
const { bnBlock: o } =
|
|
10321
|
+
function Vr(e) {
|
|
10322
|
+
const { bnBlock: o } = v(
|
|
10213
10323
|
e._tiptapEditor.state
|
|
10214
10324
|
);
|
|
10215
10325
|
return e._tiptapEditor.state.doc.resolve(o.beforePos).nodeBefore !== null;
|
|
10216
10326
|
}
|
|
10217
10327
|
function Fr(e) {
|
|
10218
|
-
const { bnBlock: o } =
|
|
10328
|
+
const { bnBlock: o } = v(
|
|
10219
10329
|
e._tiptapEditor.state
|
|
10220
10330
|
);
|
|
10221
10331
|
return e._tiptapEditor.state.doc.resolve(o.beforePos).depth > 1;
|
|
@@ -10250,13 +10360,13 @@ function So(e, o, t) {
|
|
|
10250
10360
|
), a.delete(u.attrs.id), t.length > 0 && u.attrs.id === l) {
|
|
10251
10361
|
const b = n.doc.nodeSize;
|
|
10252
10362
|
n = n.insert(m, r);
|
|
10253
|
-
const
|
|
10254
|
-
d += b -
|
|
10363
|
+
const _ = n.doc.nodeSize;
|
|
10364
|
+
d += b - _;
|
|
10255
10365
|
}
|
|
10256
|
-
const h = n.doc.nodeSize,
|
|
10257
|
-
|
|
10258
|
-
const
|
|
10259
|
-
return d += h -
|
|
10366
|
+
const h = n.doc.nodeSize, f = n.doc.resolve(m - d);
|
|
10367
|
+
f.node().type.name === "blockGroup" && f.node(f.depth - 1).type.name !== "doc" && f.node().childCount === 1 ? n = n.delete(f.before(), f.after()) : n = n.delete(m - d, m - d + u.nodeSize);
|
|
10368
|
+
const g = n.doc.nodeSize;
|
|
10369
|
+
return d += h - g, !1;
|
|
10260
10370
|
}), a.size > 0) {
|
|
10261
10371
|
const u = [...a].join(`
|
|
10262
10372
|
`);
|
|
@@ -10284,8 +10394,8 @@ function $r(e, o, t) {
|
|
|
10284
10394
|
function Gr(e, o) {
|
|
10285
10395
|
return So(e, o, []).removedBlocks;
|
|
10286
10396
|
}
|
|
10287
|
-
function
|
|
10288
|
-
const t = typeof o == "string" ? o : o.id, i =
|
|
10397
|
+
function Kr(e, o) {
|
|
10398
|
+
const t = typeof o == "string" ? o : o.id, i = N(t, e._tiptapEditor.state.doc);
|
|
10289
10399
|
if (i)
|
|
10290
10400
|
return x(
|
|
10291
10401
|
i.node,
|
|
@@ -10295,8 +10405,8 @@ function Wr(e, o) {
|
|
|
10295
10405
|
e.blockCache
|
|
10296
10406
|
);
|
|
10297
10407
|
}
|
|
10298
|
-
function
|
|
10299
|
-
const t = typeof o == "string" ? o : o.id, i =
|
|
10408
|
+
function Wr(e, o) {
|
|
10409
|
+
const t = typeof o == "string" ? o : o.id, i = N(t, e._tiptapEditor.state.doc);
|
|
10300
10410
|
if (!i)
|
|
10301
10411
|
return;
|
|
10302
10412
|
const r = e._tiptapEditor.state.doc.resolve(
|
|
@@ -10312,7 +10422,7 @@ function Kr(e, o) {
|
|
|
10312
10422
|
);
|
|
10313
10423
|
}
|
|
10314
10424
|
function qr(e, o) {
|
|
10315
|
-
const t = typeof o == "string" ? o : o.id, i =
|
|
10425
|
+
const t = typeof o == "string" ? o : o.id, i = N(t, e._tiptapEditor.state.doc);
|
|
10316
10426
|
if (!i)
|
|
10317
10427
|
return;
|
|
10318
10428
|
const r = e._tiptapEditor.state.doc.resolve(
|
|
@@ -10327,8 +10437,8 @@ function qr(e, o) {
|
|
|
10327
10437
|
e.blockCache
|
|
10328
10438
|
);
|
|
10329
10439
|
}
|
|
10330
|
-
function
|
|
10331
|
-
const t = typeof o == "string" ? o : o.id, i =
|
|
10440
|
+
function Zr(e, o) {
|
|
10441
|
+
const t = typeof o == "string" ? o : o.id, i = N(t, e._tiptapEditor.state.doc);
|
|
10332
10442
|
if (!i)
|
|
10333
10443
|
return;
|
|
10334
10444
|
const n = e._tiptapEditor.state.doc.resolve(
|
|
@@ -10343,7 +10453,7 @@ function Xr(e, o) {
|
|
|
10343
10453
|
e.blockCache
|
|
10344
10454
|
);
|
|
10345
10455
|
}
|
|
10346
|
-
function
|
|
10456
|
+
function Xr(e, o, t, i = { updateSelection: !0 }) {
|
|
10347
10457
|
const n = t._tiptapEditor.state.tr;
|
|
10348
10458
|
let { from: r, to: a } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, s = !0, l = !0, d = "";
|
|
10349
10459
|
if (o.forEach((c) => {
|
|
@@ -10352,7 +10462,7 @@ function Zr(e, o, t, i = { updateSelection: !0 }) {
|
|
|
10352
10462
|
const { parent: c } = n.doc.resolve(r);
|
|
10353
10463
|
c.isTextblock && !c.type.spec.code && !c.childCount && (r -= 1, a += 1);
|
|
10354
10464
|
}
|
|
10355
|
-
return s ? n.insertText(d, r, a) : n.replaceWith(r, a, o), i.updateSelection &&
|
|
10465
|
+
return s ? n.insertText(d, r, a) : n.replaceWith(r, a, o), i.updateSelection && Wo(n, n.steps.length - 1, -1), t.dispatch(n), !0;
|
|
10356
10466
|
}
|
|
10357
10467
|
function Jr(e) {
|
|
10358
10468
|
const o = e._tiptapEditor.state;
|
|
@@ -10410,10 +10520,10 @@ function Yr(e, o, t) {
|
|
|
10410
10520
|
throw new Error(
|
|
10411
10521
|
`Attempting to set selection with the same anchor and head blocks (id ${i})`
|
|
10412
10522
|
);
|
|
10413
|
-
const r = e._tiptapEditor.state.doc, a =
|
|
10523
|
+
const r = e._tiptapEditor.state.doc, a = N(i, r);
|
|
10414
10524
|
if (!a)
|
|
10415
10525
|
throw new Error(`Block with ID ${i} not found`);
|
|
10416
|
-
const s =
|
|
10526
|
+
const s = N(n, r);
|
|
10417
10527
|
if (!s)
|
|
10418
10528
|
throw new Error(`Block with ID ${n} not found`);
|
|
10419
10529
|
const l = te(a), d = te(s), c = e.schema.blockSchema[l.blockNoteType], u = e.schema.blockSchema[d.blockNoteType];
|
|
@@ -10427,17 +10537,17 @@ function Yr(e, o, t) {
|
|
|
10427
10537
|
);
|
|
10428
10538
|
let m, h;
|
|
10429
10539
|
if (c.content === "table") {
|
|
10430
|
-
const
|
|
10431
|
-
m = l.blockContent.beforePos +
|
|
10540
|
+
const f = ft.get(l.blockContent.node);
|
|
10541
|
+
m = l.blockContent.beforePos + f.positionAt(0, 0, l.blockContent.node) + 1 + 2;
|
|
10432
10542
|
} else
|
|
10433
10543
|
m = l.blockContent.beforePos + 1;
|
|
10434
10544
|
if (u.content === "table") {
|
|
10435
|
-
const
|
|
10436
|
-
|
|
10437
|
-
|
|
10545
|
+
const f = ft.get(d.blockContent.node), g = d.blockContent.beforePos + f.positionAt(
|
|
10546
|
+
f.height - 1,
|
|
10547
|
+
f.width - 1,
|
|
10438
10548
|
d.blockContent.node
|
|
10439
|
-
) + 1, b = r.resolve(
|
|
10440
|
-
h =
|
|
10549
|
+
) + 1, b = r.resolve(g).nodeAfter.nodeSize;
|
|
10550
|
+
h = g + b - 2;
|
|
10441
10551
|
} else
|
|
10442
10552
|
h = d.blockContent.afterPos - 1;
|
|
10443
10553
|
e._tiptapEditor.dispatch(
|
|
@@ -10447,7 +10557,7 @@ function Yr(e, o, t) {
|
|
|
10447
10557
|
);
|
|
10448
10558
|
}
|
|
10449
10559
|
function Qr(e) {
|
|
10450
|
-
const { bnBlock: o } =
|
|
10560
|
+
const { bnBlock: o } = v(e._tiptapEditor.state), t = e._tiptapEditor.state.doc.resolve(o.beforePos), i = t.nodeBefore, n = e._tiptapEditor.state.doc.resolve(
|
|
10451
10561
|
o.afterPos
|
|
10452
10562
|
).nodeAfter;
|
|
10453
10563
|
let r;
|
|
@@ -10483,7 +10593,7 @@ function Qr(e) {
|
|
|
10483
10593
|
};
|
|
10484
10594
|
}
|
|
10485
10595
|
function Eo(e, o, t = "start") {
|
|
10486
|
-
const i = typeof o == "string" ? o : o.id, n =
|
|
10596
|
+
const i = typeof o == "string" ? o : o.id, n = N(i, e._tiptapEditor.state.doc);
|
|
10487
10597
|
if (!n)
|
|
10488
10598
|
throw new Error(`Block with ID ${i} not found`);
|
|
10489
10599
|
const r = te(n), a = e.schema.blockSchema[r.blockNoteType].content;
|
|
@@ -10506,7 +10616,7 @@ function Eo(e, o, t = "start") {
|
|
|
10506
10616
|
s.afterPos - 4
|
|
10507
10617
|
);
|
|
10508
10618
|
else
|
|
10509
|
-
throw new
|
|
10619
|
+
throw new O(a);
|
|
10510
10620
|
} else {
|
|
10511
10621
|
const s = t === "start" ? r.childContainer.node.firstChild : r.childContainer.node.lastChild;
|
|
10512
10622
|
Eo(e, s.attrs.id, t);
|
|
@@ -10591,7 +10701,7 @@ function dt(e) {
|
|
|
10591
10701
|
}
|
|
10592
10702
|
async function oa(e, o, t, i) {
|
|
10593
10703
|
await lt();
|
|
10594
|
-
const r =
|
|
10704
|
+
const r = je(o, t).exportBlocks(e, i);
|
|
10595
10705
|
return dt(r);
|
|
10596
10706
|
}
|
|
10597
10707
|
function ia(e) {
|
|
@@ -10754,18 +10864,18 @@ async function Mo(e, o) {
|
|
|
10754
10864
|
};
|
|
10755
10865
|
let u;
|
|
10756
10866
|
if (e.type === "paste") {
|
|
10757
|
-
const
|
|
10758
|
-
u = Tt(o,
|
|
10867
|
+
const f = o.getTextCursorPosition().block;
|
|
10868
|
+
u = Tt(o, f, c);
|
|
10759
10869
|
} else if (e.type === "drop") {
|
|
10760
|
-
const
|
|
10870
|
+
const f = {
|
|
10761
10871
|
left: e.clientX,
|
|
10762
10872
|
top: e.clientY
|
|
10763
|
-
},
|
|
10764
|
-
if (!
|
|
10873
|
+
}, g = (a = o.prosemirrorView) == null ? void 0 : a.posAtCoords(f);
|
|
10874
|
+
if (!g)
|
|
10765
10875
|
return;
|
|
10766
10876
|
const b = q(
|
|
10767
10877
|
o._tiptapEditor.state.doc,
|
|
10768
|
-
|
|
10878
|
+
g.pos
|
|
10769
10879
|
);
|
|
10770
10880
|
u = Tt(
|
|
10771
10881
|
o,
|
|
@@ -10882,7 +10992,7 @@ function Lo(e, o) {
|
|
|
10882
10992
|
function fa(e, o, t) {
|
|
10883
10993
|
var s;
|
|
10884
10994
|
let i = !1;
|
|
10885
|
-
const n = e.state.selection instanceof
|
|
10995
|
+
const n = e.state.selection instanceof _e;
|
|
10886
10996
|
if (!n) {
|
|
10887
10997
|
const l = e.state.doc.slice(
|
|
10888
10998
|
e.state.selection.from,
|
|
@@ -10896,7 +11006,7 @@ function fa(e, o, t) {
|
|
|
10896
11006
|
) === void 0, i && (o = l);
|
|
10897
11007
|
}
|
|
10898
11008
|
let r;
|
|
10899
|
-
const a =
|
|
11009
|
+
const a = je(
|
|
10900
11010
|
e.state.schema,
|
|
10901
11011
|
t
|
|
10902
11012
|
);
|
|
@@ -11009,7 +11119,7 @@ const Mt = () => {
|
|
|
11009
11119
|
}
|
|
11010
11120
|
];
|
|
11011
11121
|
}
|
|
11012
|
-
}),
|
|
11122
|
+
}), _a = (e) => {
|
|
11013
11123
|
var i;
|
|
11014
11124
|
const o = [];
|
|
11015
11125
|
o.push(
|
|
@@ -11123,7 +11233,7 @@ const Mt = () => {
|
|
|
11123
11233
|
} : {};
|
|
11124
11234
|
}
|
|
11125
11235
|
});
|
|
11126
|
-
class
|
|
11236
|
+
class K {
|
|
11127
11237
|
constructor() {
|
|
11128
11238
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
11129
11239
|
p(this, "callbacks", {});
|
|
@@ -11143,7 +11253,7 @@ class W {
|
|
|
11143
11253
|
this.callbacks = {};
|
|
11144
11254
|
}
|
|
11145
11255
|
}
|
|
11146
|
-
class
|
|
11256
|
+
class ka extends K {
|
|
11147
11257
|
constructor(t) {
|
|
11148
11258
|
super();
|
|
11149
11259
|
p(this, "userCache", /* @__PURE__ */ new Map());
|
|
@@ -11191,40 +11301,44 @@ class _a extends W {
|
|
|
11191
11301
|
}
|
|
11192
11302
|
}
|
|
11193
11303
|
const Se = new A("blocknote-comments"), wa = "SET_SELECTED_THREAD_ID";
|
|
11194
|
-
function
|
|
11195
|
-
const
|
|
11196
|
-
return e.descendants((
|
|
11197
|
-
|
|
11198
|
-
if (
|
|
11199
|
-
const
|
|
11200
|
-
if (!
|
|
11304
|
+
function va(e, o) {
|
|
11305
|
+
const t = /* @__PURE__ */ new Map();
|
|
11306
|
+
return e.descendants((i, n) => {
|
|
11307
|
+
i.marks.forEach((r) => {
|
|
11308
|
+
if (r.type.name === o) {
|
|
11309
|
+
const a = r.attrs.threadId;
|
|
11310
|
+
if (!a)
|
|
11201
11311
|
return;
|
|
11202
|
-
const
|
|
11312
|
+
const s = n, l = s + i.nodeSize, d = t.get(a) ?? {
|
|
11203
11313
|
from: 1 / 0,
|
|
11204
11314
|
to: 0
|
|
11205
11315
|
};
|
|
11206
|
-
|
|
11207
|
-
from: Math.min(
|
|
11208
|
-
to: Math.max(
|
|
11209
|
-
})
|
|
11210
|
-
F.inline(d, c, {
|
|
11211
|
-
class: "bn-thread-mark-selected"
|
|
11212
|
-
})
|
|
11213
|
-
);
|
|
11316
|
+
t.set(a, {
|
|
11317
|
+
from: Math.min(s, d.from),
|
|
11318
|
+
to: Math.max(l, d.to)
|
|
11319
|
+
});
|
|
11214
11320
|
}
|
|
11215
11321
|
});
|
|
11216
|
-
}),
|
|
11217
|
-
decorations: N.create(e, n),
|
|
11218
|
-
threadPositions: i
|
|
11219
|
-
};
|
|
11322
|
+
}), t;
|
|
11220
11323
|
}
|
|
11221
|
-
class
|
|
11324
|
+
class ya extends K {
|
|
11222
11325
|
constructor(t, i, n) {
|
|
11223
11326
|
super();
|
|
11224
11327
|
p(this, "plugin");
|
|
11225
11328
|
p(this, "userStore");
|
|
11329
|
+
/**
|
|
11330
|
+
* Whether a comment is currently being composed
|
|
11331
|
+
*/
|
|
11226
11332
|
p(this, "pendingComment", !1);
|
|
11333
|
+
/**
|
|
11334
|
+
* The currently selected thread id
|
|
11335
|
+
*/
|
|
11227
11336
|
p(this, "selectedThreadId");
|
|
11337
|
+
/**
|
|
11338
|
+
* Store the positions of all threads in the document.
|
|
11339
|
+
* this can be used later to implement a floating sidebar
|
|
11340
|
+
*/
|
|
11341
|
+
p(this, "threadPositions", /* @__PURE__ */ new Map());
|
|
11228
11342
|
/**
|
|
11229
11343
|
* when a thread is resolved or deleted, we need to update the marks to reflect the new state
|
|
11230
11344
|
*/
|
|
@@ -11254,7 +11368,7 @@ class va extends W {
|
|
|
11254
11368
|
});
|
|
11255
11369
|
if (this.editor = t, this.threadStore = i, this.markType = n, !t.resolveUsers)
|
|
11256
11370
|
throw new Error("resolveUsers is required for comments");
|
|
11257
|
-
this.userStore = new
|
|
11371
|
+
this.userStore = new ka(t.resolveUsers), this.threadStore.subscribe(this.updateMarksFromThreads), t.onCreate(() => {
|
|
11258
11372
|
this.updateMarksFromThreads(this.threadStore.getThreads()), t.onSelectionChange(() => {
|
|
11259
11373
|
this.pendingComment && (this.pendingComment = !1, this.emitStateUpdate());
|
|
11260
11374
|
});
|
|
@@ -11265,19 +11379,39 @@ class va extends W {
|
|
|
11265
11379
|
state: {
|
|
11266
11380
|
init() {
|
|
11267
11381
|
return {
|
|
11268
|
-
|
|
11269
|
-
decorations: N.empty
|
|
11382
|
+
decorations: H.empty
|
|
11270
11383
|
};
|
|
11271
11384
|
},
|
|
11272
11385
|
apply(a, s) {
|
|
11273
11386
|
const l = a.getMeta(Se);
|
|
11274
|
-
|
|
11387
|
+
if (!a.docChanged && !l)
|
|
11388
|
+
return s;
|
|
11389
|
+
const d = a.docChanged ? va(a.doc, r.markType) : r.threadPositions;
|
|
11390
|
+
(d.size > 0 || r.threadPositions.size > 0) && (r.threadPositions = d, r.emitStateUpdate());
|
|
11391
|
+
const c = [];
|
|
11392
|
+
if (r.selectedThreadId) {
|
|
11393
|
+
const u = d.get(
|
|
11394
|
+
r.selectedThreadId
|
|
11395
|
+
);
|
|
11396
|
+
u && c.push(
|
|
11397
|
+
F.inline(
|
|
11398
|
+
u.from,
|
|
11399
|
+
u.to,
|
|
11400
|
+
{
|
|
11401
|
+
class: "bn-thread-mark-selected"
|
|
11402
|
+
}
|
|
11403
|
+
)
|
|
11404
|
+
);
|
|
11405
|
+
}
|
|
11406
|
+
return {
|
|
11407
|
+
decorations: H.create(a.doc, c)
|
|
11408
|
+
};
|
|
11275
11409
|
}
|
|
11276
11410
|
},
|
|
11277
11411
|
props: {
|
|
11278
11412
|
decorations(a) {
|
|
11279
11413
|
var s;
|
|
11280
|
-
return ((s = Se.getState(a)) == null ? void 0 : s.decorations) ??
|
|
11414
|
+
return ((s = Se.getState(a)) == null ? void 0 : s.decorations) ?? H.empty;
|
|
11281
11415
|
},
|
|
11282
11416
|
/**
|
|
11283
11417
|
* Handle click on a thread mark and mark it as selected
|
|
@@ -11293,7 +11427,7 @@ class va extends W {
|
|
|
11293
11427
|
const c = d.marks.find(
|
|
11294
11428
|
(m) => m.type.name === n && m.attrs.orphan !== !0
|
|
11295
11429
|
), u = c == null ? void 0 : c.attrs.threadId;
|
|
11296
|
-
r.selectThread(u);
|
|
11430
|
+
r.selectThread(u, !1);
|
|
11297
11431
|
}
|
|
11298
11432
|
}
|
|
11299
11433
|
});
|
|
@@ -11301,7 +11435,8 @@ class va extends W {
|
|
|
11301
11435
|
emitStateUpdate() {
|
|
11302
11436
|
this.emit("update", {
|
|
11303
11437
|
selectedThreadId: this.selectedThreadId,
|
|
11304
|
-
pendingComment: this.pendingComment
|
|
11438
|
+
pendingComment: this.pendingComment,
|
|
11439
|
+
threadPositions: this.threadPositions
|
|
11305
11440
|
});
|
|
11306
11441
|
}
|
|
11307
11442
|
/**
|
|
@@ -11313,12 +11448,21 @@ class va extends W {
|
|
|
11313
11448
|
/**
|
|
11314
11449
|
* Set the selected thread
|
|
11315
11450
|
*/
|
|
11316
|
-
selectThread(t) {
|
|
11317
|
-
|
|
11451
|
+
selectThread(t, i = !0) {
|
|
11452
|
+
var n, r;
|
|
11453
|
+
if (this.selectedThreadId !== t && (this.selectedThreadId = t, this.emitStateUpdate(), this.editor.dispatch(
|
|
11318
11454
|
this.editor.prosemirrorView.state.tr.setMeta(Se, {
|
|
11319
11455
|
name: wa
|
|
11320
11456
|
})
|
|
11321
|
-
))
|
|
11457
|
+
), t && i)) {
|
|
11458
|
+
const a = this.threadPositions.get(t);
|
|
11459
|
+
if (!a)
|
|
11460
|
+
return;
|
|
11461
|
+
(r = (n = this.editor.prosemirrorView) == null ? void 0 : n.domAtPos(a.from).node) == null || r.scrollIntoView({
|
|
11462
|
+
behavior: "smooth",
|
|
11463
|
+
block: "center"
|
|
11464
|
+
});
|
|
11465
|
+
}
|
|
11322
11466
|
}
|
|
11323
11467
|
/**
|
|
11324
11468
|
* Start a pending comment (e.g.: when clicking the "Add comment" button)
|
|
@@ -11414,7 +11558,7 @@ class Ca {
|
|
|
11414
11558
|
}
|
|
11415
11559
|
}
|
|
11416
11560
|
const Oe = new A("FilePanelPlugin");
|
|
11417
|
-
class xa extends
|
|
11561
|
+
class xa extends K {
|
|
11418
11562
|
constructor(t) {
|
|
11419
11563
|
super();
|
|
11420
11564
|
p(this, "view");
|
|
@@ -11549,7 +11693,7 @@ class Sa {
|
|
|
11549
11693
|
const Ea = new A(
|
|
11550
11694
|
"FormattingToolbarPlugin"
|
|
11551
11695
|
);
|
|
11552
|
-
class Ba extends
|
|
11696
|
+
class Ba extends K {
|
|
11553
11697
|
constructor(t) {
|
|
11554
11698
|
super();
|
|
11555
11699
|
p(this, "view");
|
|
@@ -11581,7 +11725,7 @@ const It = (e, o) => {
|
|
|
11581
11725
|
t.index(t.depth - 1),
|
|
11582
11726
|
t.depth - 1
|
|
11583
11727
|
);
|
|
11584
|
-
return
|
|
11728
|
+
return ke(
|
|
11585
11729
|
e.resolve(i)
|
|
11586
11730
|
);
|
|
11587
11731
|
}, Qe = (e, o) => {
|
|
@@ -11589,13 +11733,13 @@ const It = (e, o) => {
|
|
|
11589
11733
|
if (i === 0)
|
|
11590
11734
|
return;
|
|
11591
11735
|
const n = t.posAtIndex(i - 1);
|
|
11592
|
-
return
|
|
11736
|
+
return ke(
|
|
11593
11737
|
e.resolve(n)
|
|
11594
11738
|
);
|
|
11595
11739
|
}, Po = (e, o) => {
|
|
11596
11740
|
for (; o.childContainer; ) {
|
|
11597
11741
|
const t = o.childContainer.node, i = e.resolve(o.childContainer.beforePos + 1).posAtIndex(t.childCount - 1);
|
|
11598
|
-
o =
|
|
11742
|
+
o = ke(e.resolve(i));
|
|
11599
11743
|
}
|
|
11600
11744
|
return o;
|
|
11601
11745
|
}, 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) => {
|
|
@@ -11631,7 +11775,7 @@ const It = (e, o) => {
|
|
|
11631
11775
|
state: o,
|
|
11632
11776
|
dispatch: t
|
|
11633
11777
|
}) => {
|
|
11634
|
-
const i = o.doc.resolve(e), n =
|
|
11778
|
+
const i = o.doc.resolve(e), n = ke(i), r = Qe(
|
|
11635
11779
|
o.doc,
|
|
11636
11780
|
n.bnBlock.beforePos
|
|
11637
11781
|
);
|
|
@@ -11655,7 +11799,7 @@ const It = (e, o) => {
|
|
|
11655
11799
|
() => n.undoInputRule(),
|
|
11656
11800
|
// Reverts block content type to a paragraph if the selection is at the start of the block.
|
|
11657
11801
|
() => n.command(({ state: r }) => {
|
|
11658
|
-
const a =
|
|
11802
|
+
const a = v(r);
|
|
11659
11803
|
if (!a.isBlockContainer)
|
|
11660
11804
|
return !1;
|
|
11661
11805
|
const s = r.selection.from === a.blockContent.beforePos + 1, l = a.blockContent.node.type.name === "paragraph";
|
|
@@ -11672,7 +11816,7 @@ const It = (e, o) => {
|
|
|
11672
11816
|
}),
|
|
11673
11817
|
// Removes a level of nesting if the block is indented if the selection is at the start of the block.
|
|
11674
11818
|
() => n.command(({ state: r }) => {
|
|
11675
|
-
const a =
|
|
11819
|
+
const a = v(r);
|
|
11676
11820
|
if (!a.isBlockContainer)
|
|
11677
11821
|
return !1;
|
|
11678
11822
|
const { blockContent: s } = a;
|
|
@@ -11681,14 +11825,14 @@ const It = (e, o) => {
|
|
|
11681
11825
|
// Merges block with the previous one if it isn't indented, and the selection is at the start of the
|
|
11682
11826
|
// block. The target block for merging must contain inline content.
|
|
11683
11827
|
() => n.command(({ state: r }) => {
|
|
11684
|
-
const a =
|
|
11828
|
+
const a = v(r);
|
|
11685
11829
|
if (!a.isBlockContainer)
|
|
11686
11830
|
return !1;
|
|
11687
11831
|
const { bnBlock: s, blockContent: l } = a, d = r.selection.from === l.beforePos + 1, c = r.selection.empty, u = s.beforePos;
|
|
11688
11832
|
return d && c ? i().command(At(u)).scrollIntoView().run() : !1;
|
|
11689
11833
|
}),
|
|
11690
11834
|
() => n.command(({ state: r, dispatch: a }) => {
|
|
11691
|
-
const s =
|
|
11835
|
+
const s = v(r);
|
|
11692
11836
|
if (!s.isBlockContainer || !(r.selection.from === s.blockContent.beforePos + 1) || Qe(
|
|
11693
11837
|
r.doc,
|
|
11694
11838
|
s.bnBlock.beforePos
|
|
@@ -11706,17 +11850,17 @@ const It = (e, o) => {
|
|
|
11706
11850
|
);
|
|
11707
11851
|
if ((m == null ? void 0 : m.blockNoteType) !== "columnList")
|
|
11708
11852
|
throw new Error("parent of column is not a column list");
|
|
11709
|
-
const h = u.childContainer.node.childCount === 1,
|
|
11853
|
+
const h = u.childContainer.node.childCount === 1, f = h && m.childContainer.node.childCount === 2, g = m.childContainer.node.firstChild === u.bnBlock.node;
|
|
11710
11854
|
if (a) {
|
|
11711
11855
|
const b = r.doc.slice(
|
|
11712
11856
|
s.bnBlock.beforePos,
|
|
11713
11857
|
s.bnBlock.afterPos,
|
|
11714
11858
|
!1
|
|
11715
11859
|
);
|
|
11716
|
-
if (
|
|
11717
|
-
if (
|
|
11860
|
+
if (f)
|
|
11861
|
+
if (g) {
|
|
11718
11862
|
r.tr.step(
|
|
11719
|
-
new
|
|
11863
|
+
new Ve(
|
|
11720
11864
|
// replace entire column list
|
|
11721
11865
|
m.bnBlock.beforePos,
|
|
11722
11866
|
m.bnBlock.afterPos,
|
|
@@ -11729,11 +11873,11 @@ const It = (e, o) => {
|
|
|
11729
11873
|
!1
|
|
11730
11874
|
)
|
|
11731
11875
|
);
|
|
11732
|
-
const
|
|
11733
|
-
r.tr.setSelection(V.between(
|
|
11876
|
+
const _ = r.tr.doc.resolve(u.bnBlock.beforePos);
|
|
11877
|
+
r.tr.setSelection(V.between(_, _));
|
|
11734
11878
|
} else {
|
|
11735
11879
|
r.tr.step(
|
|
11736
|
-
new
|
|
11880
|
+
new Ve(
|
|
11737
11881
|
// replace entire column list
|
|
11738
11882
|
m.bnBlock.beforePos,
|
|
11739
11883
|
m.bnBlock.afterPos,
|
|
@@ -11746,13 +11890,13 @@ const It = (e, o) => {
|
|
|
11746
11890
|
!1
|
|
11747
11891
|
)
|
|
11748
11892
|
);
|
|
11749
|
-
const
|
|
11893
|
+
const _ = r.tr.doc.resolve(
|
|
11750
11894
|
r.tr.mapping.map(u.bnBlock.beforePos - 1)
|
|
11751
11895
|
);
|
|
11752
|
-
r.tr.setSelection(V.between(
|
|
11896
|
+
r.tr.setSelection(V.between(_, _));
|
|
11753
11897
|
}
|
|
11754
11898
|
else if (h)
|
|
11755
|
-
if (
|
|
11899
|
+
if (g) {
|
|
11756
11900
|
r.tr.delete(
|
|
11757
11901
|
u.bnBlock.beforePos,
|
|
11758
11902
|
u.bnBlock.afterPos
|
|
@@ -11760,10 +11904,10 @@ const It = (e, o) => {
|
|
|
11760
11904
|
m.bnBlock.beforePos,
|
|
11761
11905
|
b.content
|
|
11762
11906
|
);
|
|
11763
|
-
const
|
|
11907
|
+
const _ = r.tr.doc.resolve(
|
|
11764
11908
|
m.bnBlock.beforePos
|
|
11765
11909
|
);
|
|
11766
|
-
r.tr.setSelection(V.between(
|
|
11910
|
+
r.tr.setSelection(V.between(_, _));
|
|
11767
11911
|
} else
|
|
11768
11912
|
r.tr.delete(
|
|
11769
11913
|
u.bnBlock.beforePos - 1,
|
|
@@ -11773,15 +11917,15 @@ const It = (e, o) => {
|
|
|
11773
11917
|
r.tr.delete(
|
|
11774
11918
|
s.bnBlock.beforePos,
|
|
11775
11919
|
s.bnBlock.afterPos
|
|
11776
|
-
),
|
|
11920
|
+
), g ? r.tr.insert(
|
|
11777
11921
|
m.bnBlock.beforePos - 1,
|
|
11778
11922
|
b.content
|
|
11779
11923
|
) : r.tr.insert(
|
|
11780
11924
|
u.bnBlock.beforePos - 1,
|
|
11781
11925
|
b.content
|
|
11782
11926
|
);
|
|
11783
|
-
const
|
|
11784
|
-
r.tr.setSelection(V.between(
|
|
11927
|
+
const _ = r.tr.doc.resolve(u.bnBlock.beforePos - 1);
|
|
11928
|
+
r.tr.setSelection(V.between(_, _));
|
|
11785
11929
|
}
|
|
11786
11930
|
}
|
|
11787
11931
|
return !0;
|
|
@@ -11790,7 +11934,7 @@ const It = (e, o) => {
|
|
|
11790
11934
|
// when the selection is empty and at the start of the block. Moves the
|
|
11791
11935
|
// current block into the deleted block's place.
|
|
11792
11936
|
() => n.command(({ state: r }) => {
|
|
11793
|
-
const a =
|
|
11937
|
+
const a = v(r);
|
|
11794
11938
|
if (!a.isBlockContainer)
|
|
11795
11939
|
throw new Error("todo");
|
|
11796
11940
|
const s = r.selection.from === a.blockContent.beforePos + 1, l = r.selection.empty, d = Qe(
|
|
@@ -11826,7 +11970,7 @@ const It = (e, o) => {
|
|
|
11826
11970
|
// if one exists, the block has no children, and the selection is at the
|
|
11827
11971
|
// end of the block.
|
|
11828
11972
|
() => i.command(({ state: n }) => {
|
|
11829
|
-
const r =
|
|
11973
|
+
const r = v(n);
|
|
11830
11974
|
if (!r.isBlockContainer)
|
|
11831
11975
|
return !1;
|
|
11832
11976
|
const {
|
|
@@ -11835,10 +11979,10 @@ const It = (e, o) => {
|
|
|
11835
11979
|
childContainer: l
|
|
11836
11980
|
} = r, { depth: d } = n.doc.resolve(a.beforePos), c = a.afterPos === n.doc.nodeSize - 3, u = n.selection.from === s.afterPos - 1, m = n.selection.empty;
|
|
11837
11981
|
if (!c && u && m && !(l !== void 0)) {
|
|
11838
|
-
let
|
|
11839
|
-
for (; b <
|
|
11840
|
-
|
|
11841
|
-
return i.command(At(
|
|
11982
|
+
let f = d, g = a.afterPos + 1, b = n.doc.resolve(g).depth;
|
|
11983
|
+
for (; b < f; )
|
|
11984
|
+
f = b, g += 2, b = n.doc.resolve(g).depth;
|
|
11985
|
+
return i.command(At(g - 1));
|
|
11842
11986
|
}
|
|
11843
11987
|
return !1;
|
|
11844
11988
|
})
|
|
@@ -11847,7 +11991,7 @@ const It = (e, o) => {
|
|
|
11847
11991
|
// Removes a level of nesting if the block is empty & indented, while the selection is also empty & at the start
|
|
11848
11992
|
// of the block.
|
|
11849
11993
|
() => i.command(({ state: n }) => {
|
|
11850
|
-
const r =
|
|
11994
|
+
const r = v(n);
|
|
11851
11995
|
if (!r.isBlockContainer)
|
|
11852
11996
|
return !1;
|
|
11853
11997
|
const { bnBlock: a, blockContent: s } = r, { depth: l } = n.doc.resolve(a.beforePos), d = n.selection.$anchor.parentOffset === 0, c = n.selection.anchor === n.selection.head, u = s.node.childCount === 0, m = l > 1;
|
|
@@ -11856,15 +12000,15 @@ const It = (e, o) => {
|
|
|
11856
12000
|
// Creates a new block and moves the selection to it if the current one is empty, while the selection is also
|
|
11857
12001
|
// empty & at the start of the block.
|
|
11858
12002
|
() => i.command(({ state: n, dispatch: r }) => {
|
|
11859
|
-
const a =
|
|
12003
|
+
const a = v(n);
|
|
11860
12004
|
if (!a.isBlockContainer)
|
|
11861
12005
|
return !1;
|
|
11862
12006
|
const { bnBlock: s, blockContent: l } = a, d = n.selection.$anchor.parentOffset === 0, c = n.selection.anchor === n.selection.head, u = l.node.childCount === 0;
|
|
11863
12007
|
if (d && c && u) {
|
|
11864
12008
|
const m = s.afterPos, h = m + 2;
|
|
11865
12009
|
if (r) {
|
|
11866
|
-
const
|
|
11867
|
-
n.tr.insert(m,
|
|
12010
|
+
const f = n.schema.nodes.blockContainer.createAndFill();
|
|
12011
|
+
n.tr.insert(m, f).scrollIntoView(), n.tr.setSelection(
|
|
11868
12012
|
new V(n.doc.resolve(h))
|
|
11869
12013
|
);
|
|
11870
12014
|
}
|
|
@@ -11875,7 +12019,7 @@ const It = (e, o) => {
|
|
|
11875
12019
|
// Splits the current block, moving content inside that's after the cursor to a new text block below. Also
|
|
11876
12020
|
// deletes the selection beforehand, if it's not empty.
|
|
11877
12021
|
() => i.command(({ state: n, chain: r }) => {
|
|
11878
|
-
const a =
|
|
12022
|
+
const a = v(n);
|
|
11879
12023
|
if (!a.isBlockContainer)
|
|
11880
12024
|
return !1;
|
|
11881
12025
|
const { blockContent: s } = a, l = n.selection.$anchor.parentOffset === 0;
|
|
@@ -12032,7 +12176,7 @@ class Ia {
|
|
|
12032
12176
|
}
|
|
12033
12177
|
}
|
|
12034
12178
|
const Aa = new A("LinkToolbarPlugin");
|
|
12035
|
-
class Pa extends
|
|
12179
|
+
class Pa extends K {
|
|
12036
12180
|
constructor(t) {
|
|
12037
12181
|
super();
|
|
12038
12182
|
p(this, "view");
|
|
@@ -12088,7 +12232,7 @@ class Pa extends W {
|
|
|
12088
12232
|
return ((i = (t = this.view) == null ? void 0 : t.state) == null ? void 0 : i.show) || !1;
|
|
12089
12233
|
}
|
|
12090
12234
|
}
|
|
12091
|
-
const
|
|
12235
|
+
const ja = [
|
|
12092
12236
|
"http",
|
|
12093
12237
|
"https",
|
|
12094
12238
|
"ftp",
|
|
@@ -12099,7 +12243,7 @@ const Na = [
|
|
|
12099
12243
|
"sms",
|
|
12100
12244
|
"cid",
|
|
12101
12245
|
"xmpp"
|
|
12102
|
-
],
|
|
12246
|
+
], Na = "https", Ra = new A("node-selection-keyboard");
|
|
12103
12247
|
class Da {
|
|
12104
12248
|
constructor() {
|
|
12105
12249
|
p(this, "plugin");
|
|
@@ -12140,7 +12284,7 @@ class Ha {
|
|
|
12140
12284
|
key: Ua,
|
|
12141
12285
|
view: (i) => {
|
|
12142
12286
|
var d, c;
|
|
12143
|
-
const n = `placeholder-selector-${
|
|
12287
|
+
const n = `placeholder-selector-${zt()}`;
|
|
12144
12288
|
i.dom.classList.add(n);
|
|
12145
12289
|
const r = document.createElement("style"), a = o._tiptapEditor.options.injectNonce;
|
|
12146
12290
|
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);
|
|
@@ -12151,21 +12295,21 @@ class Ha {
|
|
|
12151
12295
|
emptyDocument: m,
|
|
12152
12296
|
...h
|
|
12153
12297
|
} = t;
|
|
12154
|
-
for (const [b,
|
|
12155
|
-
const
|
|
12298
|
+
for (const [b, _] of Object.entries(h)) {
|
|
12299
|
+
const k = `[data-content-type="${b}"]`;
|
|
12156
12300
|
s.insertRule(
|
|
12157
|
-
`${l(
|
|
12158
|
-
|
|
12301
|
+
`${l(k)} { content: ${JSON.stringify(
|
|
12302
|
+
_
|
|
12159
12303
|
)}; }`
|
|
12160
12304
|
);
|
|
12161
12305
|
}
|
|
12162
|
-
const
|
|
12306
|
+
const f = "[data-is-only-empty-block]", g = "[data-is-empty-and-focused]";
|
|
12163
12307
|
s.insertRule(
|
|
12164
|
-
`${l(
|
|
12308
|
+
`${l(f)} { content: ${JSON.stringify(
|
|
12165
12309
|
m
|
|
12166
12310
|
)}; }`
|
|
12167
12311
|
), s.insertRule(
|
|
12168
|
-
`${l(
|
|
12312
|
+
`${l(g)} { content: ${JSON.stringify(
|
|
12169
12313
|
u
|
|
12170
12314
|
)}; }`
|
|
12171
12315
|
);
|
|
@@ -12202,7 +12346,7 @@ class Ha {
|
|
|
12202
12346
|
})
|
|
12203
12347
|
);
|
|
12204
12348
|
}
|
|
12205
|
-
return
|
|
12349
|
+
return H.create(n, a);
|
|
12206
12350
|
}
|
|
12207
12351
|
}
|
|
12208
12352
|
});
|
|
@@ -12218,7 +12362,7 @@ const Pt = new A("previous-blocks"), Oa = {
|
|
|
12218
12362
|
depth: "depth",
|
|
12219
12363
|
"depth-change": "depth-change"
|
|
12220
12364
|
};
|
|
12221
|
-
class
|
|
12365
|
+
class za {
|
|
12222
12366
|
constructor() {
|
|
12223
12367
|
p(this, "plugin");
|
|
12224
12368
|
let o;
|
|
@@ -12259,19 +12403,19 @@ class Va {
|
|
|
12259
12403
|
for (const c of d) {
|
|
12260
12404
|
const u = l.get(c.node.attrs.id), m = u == null ? void 0 : u.node.firstChild, h = c.node.firstChild;
|
|
12261
12405
|
if (u && m && h) {
|
|
12262
|
-
const
|
|
12406
|
+
const f = {
|
|
12263
12407
|
index: h.attrs.index,
|
|
12264
12408
|
level: h.attrs.level,
|
|
12265
12409
|
type: h.type.name,
|
|
12266
12410
|
depth: r.doc.resolve(c.pos).depth
|
|
12267
12411
|
};
|
|
12268
|
-
let
|
|
12412
|
+
let g = {
|
|
12269
12413
|
index: m.attrs.index,
|
|
12270
12414
|
level: m.attrs.level,
|
|
12271
12415
|
type: m.type.name,
|
|
12272
12416
|
depth: n.doc.resolve(u.pos).depth
|
|
12273
12417
|
};
|
|
12274
|
-
a[c.node.attrs.id] =
|
|
12418
|
+
a[c.node.attrs.id] = g, t.getMeta("numberedListIndexing") && (c.node.attrs.id in i.prevTransactionOldBlockAttrs && (g = i.prevTransactionOldBlockAttrs[c.node.attrs.id]), f.type === "numberedListItem" && (g.index = f.index)), i.currentTransactionOldBlockAttrs[c.node.attrs.id] = g, JSON.stringify(g) !== JSON.stringify(f) && (g["depth-change"] = g.depth - f.depth, i.updatedBlocks.add(c.node.attrs.id));
|
|
12275
12419
|
}
|
|
12276
12420
|
}
|
|
12277
12421
|
return i.prevTransactionOldBlockAttrs = a, i;
|
|
@@ -12293,28 +12437,28 @@ class Va {
|
|
|
12293
12437
|
...l
|
|
12294
12438
|
});
|
|
12295
12439
|
n.push(d);
|
|
12296
|
-
}),
|
|
12440
|
+
}), H.create(t.doc, n);
|
|
12297
12441
|
}
|
|
12298
12442
|
}
|
|
12299
12443
|
});
|
|
12300
12444
|
}
|
|
12301
12445
|
}
|
|
12302
|
-
const
|
|
12303
|
-
class
|
|
12446
|
+
const jt = new A("blocknote-show-selection");
|
|
12447
|
+
class Va {
|
|
12304
12448
|
constructor(o) {
|
|
12305
12449
|
p(this, "plugin");
|
|
12306
12450
|
p(this, "enabled", !1);
|
|
12307
12451
|
this.editor = o, this.plugin = new T({
|
|
12308
|
-
key:
|
|
12452
|
+
key: jt,
|
|
12309
12453
|
props: {
|
|
12310
12454
|
decorations: (t) => {
|
|
12311
12455
|
const { doc: i, selection: n } = t;
|
|
12312
12456
|
if (!this.enabled)
|
|
12313
|
-
return
|
|
12457
|
+
return H.empty;
|
|
12314
12458
|
const r = F.inline(n.from, n.to, {
|
|
12315
12459
|
"data-show-selection": "true"
|
|
12316
12460
|
});
|
|
12317
|
-
return
|
|
12461
|
+
return H.create(i, [r]);
|
|
12318
12462
|
}
|
|
12319
12463
|
}
|
|
12320
12464
|
});
|
|
@@ -12322,14 +12466,14 @@ class za {
|
|
|
12322
12466
|
setEnabled(o) {
|
|
12323
12467
|
var t, i;
|
|
12324
12468
|
this.enabled !== o && (this.enabled = o, (i = this.editor.prosemirrorView) == null || i.dispatch(
|
|
12325
|
-
(t = this.editor.prosemirrorView) == null ? void 0 : t.state.tr.setMeta(
|
|
12469
|
+
(t = this.editor.prosemirrorView) == null ? void 0 : t.state.tr.setMeta(jt, {})
|
|
12326
12470
|
));
|
|
12327
12471
|
}
|
|
12328
12472
|
getEnabled() {
|
|
12329
12473
|
return this.enabled;
|
|
12330
12474
|
}
|
|
12331
12475
|
}
|
|
12332
|
-
function
|
|
12476
|
+
function jo(e, o) {
|
|
12333
12477
|
var t, i;
|
|
12334
12478
|
for (; e && e.parentElement && e.parentElement !== o.dom && ((t = e.getAttribute) == null ? void 0 : t.call(e, "data-node-type")) !== "blockContainer"; )
|
|
12335
12479
|
e = e.parentElement;
|
|
@@ -12371,7 +12515,7 @@ class re extends De {
|
|
|
12371
12515
|
return { type: "node", anchor: this.anchor, head: this.head };
|
|
12372
12516
|
}
|
|
12373
12517
|
}
|
|
12374
|
-
let
|
|
12518
|
+
let D;
|
|
12375
12519
|
function Fa(e, o) {
|
|
12376
12520
|
let t, i;
|
|
12377
12521
|
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);
|
|
@@ -12382,9 +12526,9 @@ function Fa(e, o) {
|
|
|
12382
12526
|
t = e.from, i = e.to;
|
|
12383
12527
|
return { from: t, to: i };
|
|
12384
12528
|
}
|
|
12385
|
-
function
|
|
12529
|
+
function Nt(e, o, t = o) {
|
|
12386
12530
|
o === t && (t += e.state.doc.resolve(o + 1).node().nodeSize);
|
|
12387
|
-
const i = e.domAtPos(o).node.cloneNode(!0), n = e.domAtPos(o).node, r = (
|
|
12531
|
+
const i = e.domAtPos(o).node.cloneNode(!0), n = e.domAtPos(o).node, r = (u, m) => Array.prototype.indexOf.call(u.children, m), a = r(
|
|
12388
12532
|
n,
|
|
12389
12533
|
// Expects from position to be just before the first selected block.
|
|
12390
12534
|
e.domAtPos(o + 1).node.parentElement
|
|
@@ -12393,16 +12537,21 @@ function jt(e, o, t = o) {
|
|
|
12393
12537
|
// Expects to position to be just after the last selected block.
|
|
12394
12538
|
e.domAtPos(t - 1).node.parentElement
|
|
12395
12539
|
);
|
|
12396
|
-
for (let
|
|
12397
|
-
(
|
|
12398
|
-
|
|
12399
|
-
const
|
|
12400
|
-
|
|
12540
|
+
for (let u = n.childElementCount - 1; u >= 0; u--)
|
|
12541
|
+
(u > s || u < a) && i.removeChild(i.children[u]);
|
|
12542
|
+
No(e.root), D = i;
|
|
12543
|
+
const l = D.getElementsByTagName("iframe");
|
|
12544
|
+
for (let u = 0; u < l.length; u++) {
|
|
12545
|
+
const m = l[u], h = m.parentElement;
|
|
12546
|
+
h && h.removeChild(m);
|
|
12547
|
+
}
|
|
12548
|
+
const c = e.dom.className.split(" ").filter(
|
|
12549
|
+
(u) => u !== "ProseMirror" && u !== "bn-root" && u !== "bn-editor"
|
|
12401
12550
|
).join(" ");
|
|
12402
|
-
|
|
12551
|
+
D.className = D.className + " bn-drag-preview " + c, e.root instanceof ShadowRoot ? e.root.appendChild(D) : e.root.body.appendChild(D);
|
|
12403
12552
|
}
|
|
12404
|
-
function
|
|
12405
|
-
|
|
12553
|
+
function No(e) {
|
|
12554
|
+
D !== void 0 && (e instanceof ShadowRoot ? e.removeChild(D) : e.body.removeChild(D), D = void 0);
|
|
12406
12555
|
}
|
|
12407
12556
|
function $a(e, o, t) {
|
|
12408
12557
|
if (!e.dataTransfer)
|
|
@@ -12410,7 +12559,7 @@ function $a(e, o, t) {
|
|
|
12410
12559
|
const i = t.prosemirrorView;
|
|
12411
12560
|
if (!i)
|
|
12412
12561
|
return;
|
|
12413
|
-
const n =
|
|
12562
|
+
const n = N(o.id, i.state.doc);
|
|
12414
12563
|
if (!n)
|
|
12415
12564
|
throw new Error(`Block with ID ${o.id} not found`);
|
|
12416
12565
|
const r = n.posBeforeNode;
|
|
@@ -12418,11 +12567,11 @@ function $a(e, o, t) {
|
|
|
12418
12567
|
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;
|
|
12419
12568
|
c && u ? (i.dispatch(
|
|
12420
12569
|
i.state.tr.setSelection(re.create(s, l, d))
|
|
12421
|
-
),
|
|
12570
|
+
), Nt(i, l, d)) : (i.dispatch(
|
|
12422
12571
|
i.state.tr.setSelection(be.create(i.state.doc, r))
|
|
12423
|
-
),
|
|
12424
|
-
const m = i.state.selection.content(), h = t.pmSchema,
|
|
12425
|
-
e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html",
|
|
12572
|
+
), Nt(i, r));
|
|
12573
|
+
const m = i.state.selection.content(), h = t.pmSchema, f = i.serializeForClipboard(m).dom.innerHTML, g = je(h, t), b = Lo(m.content, t.schema), _ = g.exportBlocks(b, {}), k = dt(_);
|
|
12574
|
+
e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", f), e.dataTransfer.setData("text/html", _), e.dataTransfer.setData("text/plain", k), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(D, 0, 0);
|
|
12426
12575
|
}
|
|
12427
12576
|
}
|
|
12428
12577
|
const ue = 0.1;
|
|
@@ -12443,7 +12592,7 @@ function et(e, o, t, i = !0) {
|
|
|
12443
12592
|
},
|
|
12444
12593
|
t,
|
|
12445
12594
|
!1
|
|
12446
|
-
) :
|
|
12595
|
+
) : jo(r, e);
|
|
12447
12596
|
}
|
|
12448
12597
|
function Ga(e, o, t) {
|
|
12449
12598
|
if (!o.dom.firstChild)
|
|
@@ -12460,7 +12609,7 @@ function Ga(e, o, t) {
|
|
|
12460
12609
|
}
|
|
12461
12610
|
return s;
|
|
12462
12611
|
}
|
|
12463
|
-
class
|
|
12612
|
+
class Ka {
|
|
12464
12613
|
constructor(o, t, i, n) {
|
|
12465
12614
|
p(this, "state");
|
|
12466
12615
|
p(this, "emitUpdate");
|
|
@@ -12691,8 +12840,8 @@ class Wa {
|
|
|
12691
12840
|
), this.pmView.root.removeEventListener("scroll", this.onScroll, !0);
|
|
12692
12841
|
}
|
|
12693
12842
|
}
|
|
12694
|
-
const
|
|
12695
|
-
class qa extends
|
|
12843
|
+
const Wa = new A("SideMenuPlugin");
|
|
12844
|
+
class qa extends K {
|
|
12696
12845
|
constructor(t, i) {
|
|
12697
12846
|
super();
|
|
12698
12847
|
p(this, "view");
|
|
@@ -12707,7 +12856,7 @@ class qa extends W {
|
|
|
12707
12856
|
* Handles drag & drop events for blocks.
|
|
12708
12857
|
*/
|
|
12709
12858
|
p(this, "blockDragEnd", () => {
|
|
12710
|
-
this.editor.prosemirrorView &&
|
|
12859
|
+
this.editor.prosemirrorView && No(this.editor.prosemirrorView.root), this.view && (this.view.isDragOrigin = !1);
|
|
12711
12860
|
});
|
|
12712
12861
|
/**
|
|
12713
12862
|
* Freezes the side menu. When frozen, the side menu will stay
|
|
@@ -12726,8 +12875,8 @@ class qa extends W {
|
|
|
12726
12875
|
this.view.menuFrozen = !1, this.view.state.show = !1, this.view.emitUpdate(this.view.state);
|
|
12727
12876
|
});
|
|
12728
12877
|
this.editor = t, this.plugin = new T({
|
|
12729
|
-
key:
|
|
12730
|
-
view: (n) => (this.view = new
|
|
12878
|
+
key: Wa,
|
|
12879
|
+
view: (n) => (this.view = new Ka(
|
|
12731
12880
|
t,
|
|
12732
12881
|
i,
|
|
12733
12882
|
n,
|
|
@@ -12741,8 +12890,8 @@ class qa extends W {
|
|
|
12741
12890
|
return this.on("update", t);
|
|
12742
12891
|
}
|
|
12743
12892
|
}
|
|
12744
|
-
const
|
|
12745
|
-
class
|
|
12893
|
+
const Za = Zo((e) => e.type.name === "blockContainer");
|
|
12894
|
+
class Xa {
|
|
12746
12895
|
constructor(o, t) {
|
|
12747
12896
|
p(this, "state");
|
|
12748
12897
|
p(this, "emitUpdate");
|
|
@@ -12807,7 +12956,7 @@ class Za {
|
|
|
12807
12956
|
}
|
|
12808
12957
|
}
|
|
12809
12958
|
const ae = new A("SuggestionMenuPlugin");
|
|
12810
|
-
class Ja extends
|
|
12959
|
+
class Ja extends K {
|
|
12811
12960
|
constructor(t) {
|
|
12812
12961
|
super();
|
|
12813
12962
|
p(this, "view");
|
|
@@ -12827,7 +12976,7 @@ class Ja extends W {
|
|
|
12827
12976
|
const i = this.triggerCharacters;
|
|
12828
12977
|
this.plugin = new T({
|
|
12829
12978
|
key: ae,
|
|
12830
|
-
view: () => (this.view = new
|
|
12979
|
+
view: () => (this.view = new Xa(
|
|
12831
12980
|
t,
|
|
12832
12981
|
(n, r) => {
|
|
12833
12982
|
this.emit(`update ${n}`, r);
|
|
@@ -12884,9 +13033,9 @@ class Ja extends W {
|
|
|
12884
13033
|
if (r === void 0)
|
|
12885
13034
|
return null;
|
|
12886
13035
|
if (!r.deleteTriggerCharacter) {
|
|
12887
|
-
const a =
|
|
13036
|
+
const a = Za(n.selection);
|
|
12888
13037
|
if (a)
|
|
12889
|
-
return
|
|
13038
|
+
return H.create(n.doc, [
|
|
12890
13039
|
F.node(
|
|
12891
13040
|
a.pos,
|
|
12892
13041
|
a.pos + a.node.nodeSize,
|
|
@@ -12898,7 +13047,7 @@ class Ja extends W {
|
|
|
12898
13047
|
)
|
|
12899
13048
|
]);
|
|
12900
13049
|
}
|
|
12901
|
-
return
|
|
13050
|
+
return H.create(n.doc, [
|
|
12902
13051
|
F.inline(
|
|
12903
13052
|
r.queryStartPos - r.triggerCharacter.length,
|
|
12904
13053
|
r.queryStartPos,
|
|
@@ -12976,7 +13125,7 @@ class ts {
|
|
|
12976
13125
|
this.mouseState = "up", this.mouseMoveHandler(o);
|
|
12977
13126
|
});
|
|
12978
13127
|
p(this, "mouseMoveHandler", (o) => {
|
|
12979
|
-
var d, c, u, m, h,
|
|
13128
|
+
var d, c, u, m, h, f, g;
|
|
12980
13129
|
if (this.menuFrozen || this.mouseState === "selecting" || !(o.target instanceof Element) || !this.pmView.dom.contains(o.target))
|
|
12981
13130
|
return;
|
|
12982
13131
|
const t = Qa(o.target);
|
|
@@ -12990,12 +13139,12 @@ class ts {
|
|
|
12990
13139
|
}
|
|
12991
13140
|
if (!t.tbodyNode)
|
|
12992
13141
|
return;
|
|
12993
|
-
const i = t.tbodyNode.getBoundingClientRect(), n =
|
|
13142
|
+
const i = t.tbodyNode.getBoundingClientRect(), n = jo(t.domNode, this.pmView);
|
|
12994
13143
|
if (!n)
|
|
12995
13144
|
return;
|
|
12996
13145
|
this.tableElement = n.node;
|
|
12997
13146
|
let r;
|
|
12998
|
-
const a =
|
|
13147
|
+
const a = N(
|
|
12999
13148
|
n.id,
|
|
13000
13149
|
this.editor._tiptapEditor.state.doc
|
|
13001
13150
|
);
|
|
@@ -13014,33 +13163,33 @@ class ts {
|
|
|
13014
13163
|
const l = (m = t.domNode.closest(".tableWrapper")) == null ? void 0 : m.querySelector(".table-widgets-container");
|
|
13015
13164
|
if ((t == null ? void 0 : t.type) === "wrapper") {
|
|
13016
13165
|
const b = o.clientY >= i.bottom - 1 && // -1 to account for fractions of pixels in "bottom"
|
|
13017
|
-
o.clientY < i.bottom + 20,
|
|
13166
|
+
o.clientY < i.bottom + 20, _ = o.clientX >= i.right - 1 && o.clientX < i.right + 20, k = o.clientX > i.right || o.clientY > i.bottom;
|
|
13018
13167
|
this.state = {
|
|
13019
13168
|
...this.state,
|
|
13020
13169
|
show: !0,
|
|
13021
13170
|
showAddOrRemoveRowsButton: b,
|
|
13022
|
-
showAddOrRemoveColumnsButton:
|
|
13171
|
+
showAddOrRemoveColumnsButton: _,
|
|
13023
13172
|
referencePosTable: i,
|
|
13024
13173
|
block: r,
|
|
13025
13174
|
widgetContainer: l,
|
|
13026
|
-
colIndex:
|
|
13027
|
-
rowIndex:
|
|
13028
|
-
referencePosCell:
|
|
13175
|
+
colIndex: k || (h = this.state) == null ? void 0 : h.colIndex,
|
|
13176
|
+
rowIndex: k || (f = this.state) == null ? void 0 : f.rowIndex,
|
|
13177
|
+
referencePosCell: k || (g = this.state) == null ? void 0 : g.referencePosCell
|
|
13029
13178
|
};
|
|
13030
13179
|
} else {
|
|
13031
|
-
const b = Ee(t.domNode),
|
|
13032
|
-
if (this.state !== void 0 && this.state.show && this.tableId === n.id && this.state.rowIndex ===
|
|
13180
|
+
const b = Ee(t.domNode), _ = Ee(t.domNode.parentElement), k = t.domNode.getBoundingClientRect();
|
|
13181
|
+
if (this.state !== void 0 && this.state.show && this.tableId === n.id && this.state.rowIndex === _ && this.state.colIndex === b)
|
|
13033
13182
|
return;
|
|
13034
13183
|
this.state = {
|
|
13035
13184
|
show: !0,
|
|
13036
13185
|
showAddOrRemoveColumnsButton: b === r.content.rows[0].cells.length - 1,
|
|
13037
|
-
showAddOrRemoveRowsButton:
|
|
13186
|
+
showAddOrRemoveRowsButton: _ === r.content.rows.length - 1,
|
|
13038
13187
|
referencePosTable: i,
|
|
13039
13188
|
block: r,
|
|
13040
13189
|
draggingState: void 0,
|
|
13041
|
-
referencePosCell:
|
|
13190
|
+
referencePosCell: k,
|
|
13042
13191
|
colIndex: b,
|
|
13043
|
-
rowIndex:
|
|
13192
|
+
rowIndex: _,
|
|
13044
13193
|
widgetContainer: l
|
|
13045
13194
|
};
|
|
13046
13195
|
}
|
|
@@ -13142,9 +13291,12 @@ class ts {
|
|
|
13142
13291
|
}
|
|
13143
13292
|
// Updates drag handles when the table is modified or removed.
|
|
13144
13293
|
update() {
|
|
13294
|
+
var n;
|
|
13145
13295
|
if (!this.state || !this.state.show)
|
|
13146
13296
|
return;
|
|
13147
|
-
if (this.state.block = this.editor.getBlock(this.state.block.id), !this.state.block
|
|
13297
|
+
if (this.state.block = this.editor.getBlock(this.state.block.id), !this.state.block || // when collaborating, the table element might be replaced and out of date
|
|
13298
|
+
// because yjs replaces the element when for example you change the color via the side menu
|
|
13299
|
+
!((n = this.tableElement) != null && n.isConnected)) {
|
|
13148
13300
|
this.state.show = !1, this.state.showAddOrRemoveRowsButton = !1, this.state.showAddOrRemoveColumnsButton = !1, this.emitUpdate();
|
|
13149
13301
|
return;
|
|
13150
13302
|
}
|
|
@@ -13158,8 +13310,8 @@ class ts {
|
|
|
13158
13310
|
"Table block does not contain a 'tbody' HTML element. This should never happen."
|
|
13159
13311
|
);
|
|
13160
13312
|
if (this.state.rowIndex !== void 0 && this.state.colIndex !== void 0) {
|
|
13161
|
-
const
|
|
13162
|
-
|
|
13313
|
+
const a = i.children[this.state.rowIndex].children[this.state.colIndex];
|
|
13314
|
+
a ? this.state.referencePosCell = a.getBoundingClientRect() : (this.state.rowIndex = void 0, this.state.colIndex = void 0);
|
|
13163
13315
|
}
|
|
13164
13316
|
this.state.referencePosTable = i.getBoundingClientRect(), this.emitUpdate();
|
|
13165
13317
|
}
|
|
@@ -13174,7 +13326,7 @@ class ts {
|
|
|
13174
13326
|
}
|
|
13175
13327
|
}
|
|
13176
13328
|
const pe = new A("TableHandlesPlugin");
|
|
13177
|
-
class os extends
|
|
13329
|
+
class os extends K {
|
|
13178
13330
|
constructor(t) {
|
|
13179
13331
|
super();
|
|
13180
13332
|
p(this, "view");
|
|
@@ -13256,7 +13408,7 @@ class os extends W {
|
|
|
13256
13408
|
p(this, "unfreezeHandles", () => {
|
|
13257
13409
|
this.view.menuFrozen = !1;
|
|
13258
13410
|
});
|
|
13259
|
-
p(this, "getCellsAtRowHandle", (t, i) =>
|
|
13411
|
+
p(this, "getCellsAtRowHandle", (t, i) => We(t, i));
|
|
13260
13412
|
/**
|
|
13261
13413
|
* Get all the cells in a column of the table block.
|
|
13262
13414
|
*/
|
|
@@ -13281,7 +13433,7 @@ class os extends W {
|
|
|
13281
13433
|
d.posAtIndex(i.col)
|
|
13282
13434
|
), u = r.tr;
|
|
13283
13435
|
return u.setSelection(
|
|
13284
|
-
new
|
|
13436
|
+
new _e(l, c)
|
|
13285
13437
|
), r.apply(u);
|
|
13286
13438
|
});
|
|
13287
13439
|
/**
|
|
@@ -13328,9 +13480,9 @@ class os extends W {
|
|
|
13328
13480
|
const t = this.editor.prosemirrorState, i = t.selection;
|
|
13329
13481
|
let n = i.$from, r = i.$to;
|
|
13330
13482
|
if (Et(i)) {
|
|
13331
|
-
const { ranges:
|
|
13332
|
-
|
|
13333
|
-
n =
|
|
13483
|
+
const { ranges: f } = i;
|
|
13484
|
+
f.forEach((g) => {
|
|
13485
|
+
n = g.$from.min(n ?? g.$from), r = g.$to.max(r ?? g.$to);
|
|
13334
13486
|
});
|
|
13335
13487
|
} else if (n = t.doc.resolve(
|
|
13336
13488
|
i.$from.pos - i.$from.parentOffset - 1
|
|
@@ -13341,9 +13493,9 @@ class os extends W {
|
|
|
13341
13493
|
const a = t.doc.resolve(
|
|
13342
13494
|
n.pos - n.parentOffset - 1
|
|
13343
13495
|
), s = t.doc.resolve(r.pos - r.parentOffset - 1), l = t.doc.resolve(a.pos - a.parentOffset - 1), d = n.index(a.depth), c = a.index(l.depth), u = r.index(s.depth), m = s.index(l.depth), h = [];
|
|
13344
|
-
for (let
|
|
13345
|
-
for (let
|
|
13346
|
-
h.push({ row:
|
|
13496
|
+
for (let f = c; f <= m; f++)
|
|
13497
|
+
for (let g = d; g <= u; g++)
|
|
13498
|
+
h.push({ row: f, col: g });
|
|
13347
13499
|
return {
|
|
13348
13500
|
from: {
|
|
13349
13501
|
row: c,
|
|
@@ -13388,55 +13540,43 @@ class os extends W {
|
|
|
13388
13540
|
const n = this.view.state.draggingState.draggedCellOrientation === "row" ? this.view.state.rowIndex : this.view.state.colIndex;
|
|
13389
13541
|
if (n === void 0)
|
|
13390
13542
|
return;
|
|
13391
|
-
const r = [];
|
|
13392
|
-
if (n ===
|
|
13393
|
-
return
|
|
13394
|
-
|
|
13543
|
+
const r = [], { block: a, draggingState: s } = this.view.state, { originalIndex: l, draggedCellOrientation: d } = s;
|
|
13544
|
+
if (n === l || !a || d === "row" && !Qt(a, l, n) || d === "col" && !eo(a, l, n))
|
|
13545
|
+
return H.create(i.doc, r);
|
|
13546
|
+
const c = i.doc.resolve(this.view.tablePos + 1);
|
|
13547
|
+
return this.view.state.draggingState.draggedCellOrientation === "row" ? We(
|
|
13395
13548
|
this.view.state.block,
|
|
13396
|
-
this.view.state.draggingState.originalIndex,
|
|
13397
13549
|
n
|
|
13398
|
-
))
|
|
13399
|
-
|
|
13400
|
-
|
|
13401
|
-
|
|
13402
|
-
|
|
13403
|
-
n
|
|
13404
|
-
))
|
|
13405
|
-
return N.create(i.doc, r);
|
|
13406
|
-
const a = i.doc.resolve(this.view.tablePos + 1), s = this.view.state.draggingState.originalIndex;
|
|
13407
|
-
return this.view.state.draggingState.draggedCellOrientation === "row" ? Ke(
|
|
13408
|
-
this.view.state.block,
|
|
13409
|
-
n
|
|
13410
|
-
).forEach(({ row: d, col: c }) => {
|
|
13411
|
-
const u = i.doc.resolve(
|
|
13412
|
-
a.posAtIndex(d) + 1
|
|
13413
|
-
), m = i.doc.resolve(
|
|
13414
|
-
u.posAtIndex(c) + 1
|
|
13415
|
-
), h = m.node(), g = m.pos + (n > s ? h.nodeSize - 2 : 0);
|
|
13550
|
+
).forEach(({ row: m, col: h }) => {
|
|
13551
|
+
const f = i.doc.resolve(
|
|
13552
|
+
c.posAtIndex(m) + 1
|
|
13553
|
+
), g = i.doc.resolve(
|
|
13554
|
+
f.posAtIndex(h) + 1
|
|
13555
|
+
), b = g.node(), _ = g.pos + (n > l ? b.nodeSize - 2 : 0);
|
|
13416
13556
|
r.push(
|
|
13417
13557
|
// The widget is a small bar which spans the width of the cell.
|
|
13418
|
-
F.widget(
|
|
13419
|
-
const
|
|
13420
|
-
return
|
|
13558
|
+
F.widget(_, () => {
|
|
13559
|
+
const k = document.createElement("div");
|
|
13560
|
+
return k.className = "bn-table-drop-cursor", k.style.left = "0", k.style.right = "0", n > l ? k.style.bottom = "-2px" : k.style.top = "-3px", k.style.height = "4px", k;
|
|
13421
13561
|
})
|
|
13422
13562
|
);
|
|
13423
13563
|
}) : qe(
|
|
13424
13564
|
this.view.state.block,
|
|
13425
13565
|
n
|
|
13426
|
-
).forEach(({ row:
|
|
13427
|
-
const
|
|
13428
|
-
|
|
13429
|
-
),
|
|
13430
|
-
|
|
13431
|
-
),
|
|
13566
|
+
).forEach(({ row: m, col: h }) => {
|
|
13567
|
+
const f = i.doc.resolve(
|
|
13568
|
+
c.posAtIndex(m) + 1
|
|
13569
|
+
), g = i.doc.resolve(
|
|
13570
|
+
f.posAtIndex(h) + 1
|
|
13571
|
+
), b = g.node(), _ = g.pos + (n > l ? b.nodeSize - 2 : 0);
|
|
13432
13572
|
r.push(
|
|
13433
13573
|
// The widget is a small bar which spans the height of the cell.
|
|
13434
|
-
F.widget(
|
|
13435
|
-
const
|
|
13436
|
-
return
|
|
13574
|
+
F.widget(_, () => {
|
|
13575
|
+
const k = document.createElement("div");
|
|
13576
|
+
return k.className = "bn-table-drop-cursor", k.style.top = "0", k.style.bottom = "0", n > l ? k.style.right = "-2px" : k.style.left = "-3px", k.style.width = "4px", k;
|
|
13437
13577
|
})
|
|
13438
13578
|
);
|
|
13439
|
-
}),
|
|
13579
|
+
}), H.create(i.doc, r);
|
|
13440
13580
|
}
|
|
13441
13581
|
}
|
|
13442
13582
|
});
|
|
@@ -13565,7 +13705,7 @@ const is = j.create({
|
|
|
13565
13705
|
...((n = this.options.domAttributes) == null ? void 0 : n.block) || {},
|
|
13566
13706
|
...e
|
|
13567
13707
|
}, i = document.createElement("div");
|
|
13568
|
-
i.className =
|
|
13708
|
+
i.className = X("bn-block", t.class), i.setAttribute("data-node-type", this.name);
|
|
13569
13709
|
for (const [r, a] of Object.entries(t))
|
|
13570
13710
|
r !== "class" && i.setAttribute(r, a);
|
|
13571
13711
|
return o.appendChild(i), {
|
|
@@ -13591,7 +13731,7 @@ const is = j.create({
|
|
|
13591
13731
|
...((i = this.options.domAttributes) == null ? void 0 : i.blockGroup) || {},
|
|
13592
13732
|
...e
|
|
13593
13733
|
}, t = document.createElement("div");
|
|
13594
|
-
t.className =
|
|
13734
|
+
t.className = X(
|
|
13595
13735
|
"bn-block-group",
|
|
13596
13736
|
o.class
|
|
13597
13737
|
), t.setAttribute("data-node-type", "blockGroup");
|
|
@@ -13615,13 +13755,13 @@ const is = j.create({
|
|
|
13615
13755
|
), o.linkToolbar = new Pa(e.editor), o.sideMenu = new qa(
|
|
13616
13756
|
e.editor,
|
|
13617
13757
|
e.sideMenuDetection
|
|
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
|
|
13758
|
+
), 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 za()), e.tableHandles && (o.tableHandles = new os(e.editor)), o.dropCursor = {
|
|
13619
13759
|
plugin: e.dropCursor({
|
|
13620
13760
|
width: 5,
|
|
13621
13761
|
color: "#ddeeff",
|
|
13622
13762
|
editor: e.editor
|
|
13623
13763
|
})
|
|
13624
|
-
}, o.nodeSelectionKeyboard = new Da(), o.showSelection = new
|
|
13764
|
+
}, o.nodeSelectionKeyboard = new Da(), o.showSelection = new Va(e.editor), e.comments && (o.comments = new ya(
|
|
13625
13765
|
e.editor,
|
|
13626
13766
|
e.comments.threadStore,
|
|
13627
13767
|
Ao.name
|
|
@@ -13640,7 +13780,7 @@ const us = (e) => {
|
|
|
13640
13780
|
ce.FocusEvents,
|
|
13641
13781
|
ce.Tabindex,
|
|
13642
13782
|
// DevTools,
|
|
13643
|
-
|
|
13783
|
+
yi,
|
|
13644
13784
|
// DropCursor,
|
|
13645
13785
|
we.configure({
|
|
13646
13786
|
// everything from bnBlock group (nodes that represent a BlockNote block should have an id)
|
|
@@ -13655,9 +13795,9 @@ const us = (e) => {
|
|
|
13655
13795
|
Si.extend({
|
|
13656
13796
|
inclusive: !1
|
|
13657
13797
|
}).configure({
|
|
13658
|
-
defaultProtocol:
|
|
13798
|
+
defaultProtocol: Na,
|
|
13659
13799
|
// only call this once if we have multiple editors installed. Or fix https://github.com/ueberdosis/tiptap/issues/5450
|
|
13660
|
-
protocols: Dt ? [] :
|
|
13800
|
+
protocols: Dt ? [] : ja
|
|
13661
13801
|
}),
|
|
13662
13802
|
...Object.values(e.styleSpecs).map((t) => t.implementation.mark.configure({
|
|
13663
13803
|
editor: e.editor
|
|
@@ -13712,7 +13852,7 @@ const us = (e) => {
|
|
|
13712
13852
|
...e.trailingBlock === void 0 || e.trailingBlock ? [rs] : [],
|
|
13713
13853
|
...e.comments ? [Ao] : []
|
|
13714
13854
|
];
|
|
13715
|
-
return Dt = !0, e.collaboration ? o.push(...
|
|
13855
|
+
return Dt = !0, e.collaboration ? o.push(..._a(e.collaboration)) : o.push(xi), o;
|
|
13716
13856
|
};
|
|
13717
13857
|
function ps(e, o) {
|
|
13718
13858
|
const t = [];
|
|
@@ -13764,14 +13904,14 @@ function fs(e, o) {
|
|
|
13764
13904
|
if (i)
|
|
13765
13905
|
return !1;
|
|
13766
13906
|
if (n) {
|
|
13767
|
-
const s =
|
|
13907
|
+
const s = v(o.state);
|
|
13768
13908
|
if (s.isBlockContainer)
|
|
13769
13909
|
return !(s.blockContent.node.type.spec.content === "tableRow+");
|
|
13770
13910
|
}
|
|
13771
13911
|
}
|
|
13772
13912
|
return !0;
|
|
13773
13913
|
}
|
|
13774
|
-
const Ie = class Ie extends
|
|
13914
|
+
const Ie = class Ie extends Xo {
|
|
13775
13915
|
constructor(t, i) {
|
|
13776
13916
|
super({ ...t, content: void 0 });
|
|
13777
13917
|
p(this, "_state");
|
|
@@ -13780,8 +13920,8 @@ const Ie = class Ie extends Zo {
|
|
|
13780
13920
|
*
|
|
13781
13921
|
* @param element DOM element to mount to, ur null / undefined to destroy
|
|
13782
13922
|
*/
|
|
13783
|
-
p(this, "mount", (t, i) => {
|
|
13784
|
-
|
|
13923
|
+
p(this, "mount", (t, i, n) => {
|
|
13924
|
+
i ? (this.options.element = i, this.createViewAlternative(t, n)) : this.destroy();
|
|
13785
13925
|
});
|
|
13786
13926
|
const n = this.schema;
|
|
13787
13927
|
let r;
|
|
@@ -13833,11 +13973,11 @@ const Ie = class Ie extends Zo {
|
|
|
13833
13973
|
/**
|
|
13834
13974
|
* Replace the default `createView` method with a custom one - which we call on mount
|
|
13835
13975
|
*/
|
|
13836
|
-
createViewAlternative(t) {
|
|
13837
|
-
this.contentComponent =
|
|
13838
|
-
const
|
|
13839
|
-
this.extensionManager.extensions.forEach((
|
|
13840
|
-
|
|
13976
|
+
createViewAlternative(t, i) {
|
|
13977
|
+
this.contentComponent = i;
|
|
13978
|
+
const n = {};
|
|
13979
|
+
this.extensionManager.extensions.forEach((a) => {
|
|
13980
|
+
a.type === "mark" && a.config.addMarkView && (n[a.name] = a.config.addMarkView(t));
|
|
13841
13981
|
}), this.view = new Mi(
|
|
13842
13982
|
{ mount: this.options.element },
|
|
13843
13983
|
// use mount option so that we reuse the existing element instead of creating a new one
|
|
@@ -13846,13 +13986,14 @@ const Ie = class Ie extends Zo {
|
|
|
13846
13986
|
// @ts-ignore
|
|
13847
13987
|
dispatchTransaction: this.dispatchTransaction.bind(this),
|
|
13848
13988
|
state: this.state,
|
|
13849
|
-
markViews:
|
|
13989
|
+
markViews: n,
|
|
13990
|
+
nodeViews: this.extensionManager.nodeViews
|
|
13850
13991
|
}
|
|
13851
13992
|
);
|
|
13852
|
-
const
|
|
13993
|
+
const r = this.state.reconfigure({
|
|
13853
13994
|
plugins: this.extensionManager.plugins
|
|
13854
13995
|
});
|
|
13855
|
-
this.view.updateState(
|
|
13996
|
+
this.view.updateState(r), this.commands.focus(
|
|
13856
13997
|
this.options.autofocus || this.options.element.getAttribute("data-bn-autofocus") === "true",
|
|
13857
13998
|
{ scrollIntoView: !1 }
|
|
13858
13999
|
), this.emit("create", { editor: this }), this.isInitialized = !0;
|
|
@@ -13877,9 +14018,9 @@ const gs = {
|
|
|
13877
14018
|
enablePasteRules: !0,
|
|
13878
14019
|
enableCoreExtensions: !1
|
|
13879
14020
|
};
|
|
13880
|
-
class Ro extends
|
|
14021
|
+
class Ro extends K {
|
|
13881
14022
|
constructor(t) {
|
|
13882
|
-
var d, c, u, m, h,
|
|
14023
|
+
var d, c, u, m, h, f, g, b, _, k, w;
|
|
13883
14024
|
super();
|
|
13884
14025
|
/**
|
|
13885
14026
|
* The underlying prosemirror schema
|
|
@@ -13956,7 +14097,7 @@ class Ro extends W {
|
|
|
13956
14097
|
* @warning Not needed to call manually when using React, use BlockNoteView to take care of mounting
|
|
13957
14098
|
*/
|
|
13958
14099
|
p(this, "mount", (t, i) => {
|
|
13959
|
-
this._tiptapEditor.mount(t, i);
|
|
14100
|
+
this._tiptapEditor.mount(this, t, i);
|
|
13960
14101
|
});
|
|
13961
14102
|
this.options = t;
|
|
13962
14103
|
const i = t;
|
|
@@ -14013,21 +14154,21 @@ class Ro extends W {
|
|
|
14013
14154
|
tabBehavior: n.tabBehavior,
|
|
14014
14155
|
sideMenuDetection: n.sideMenuDetection || "viewport",
|
|
14015
14156
|
comments: n.comments
|
|
14016
|
-
}), (((h = n._tiptapOptions) == null ? void 0 : h.extensions) || []).forEach((
|
|
14017
|
-
this.extensions[
|
|
14018
|
-
}), Object.entries(n._extensions || {}).forEach(([
|
|
14019
|
-
typeof C == "function" && (C = C(this)), this.extensions[
|
|
14157
|
+
}), (((h = n._tiptapOptions) == null ? void 0 : h.extensions) || []).forEach((y) => {
|
|
14158
|
+
this.extensions[y.name] = y;
|
|
14159
|
+
}), Object.entries(n._extensions || {}).forEach(([y, C]) => {
|
|
14160
|
+
typeof C == "function" && (C = C(this)), this.extensions[y] = C;
|
|
14020
14161
|
}), this.formattingToolbar = this.extensions.formattingToolbar, this.linkToolbar = this.extensions.linkToolbar, this.sideMenu = this.extensions.sideMenu, this.suggestionMenus = this.extensions.suggestionMenus, this.filePanel = this.extensions.filePanel, this.tableHandles = this.extensions.tableHandles, this.comments = this.extensions.comments, this.showSelectionPlugin = this.extensions.showSelection, n.uploadFile) {
|
|
14021
|
-
const
|
|
14022
|
-
this.uploadFile = async (C,
|
|
14162
|
+
const y = n.uploadFile;
|
|
14163
|
+
this.uploadFile = async (C, z) => {
|
|
14023
14164
|
this.onUploadStartCallbacks.forEach(
|
|
14024
|
-
(S) => S.apply(this, [
|
|
14165
|
+
(S) => S.apply(this, [z])
|
|
14025
14166
|
);
|
|
14026
14167
|
try {
|
|
14027
|
-
return await
|
|
14168
|
+
return await y(C, z);
|
|
14028
14169
|
} finally {
|
|
14029
14170
|
this.onUploadEndCallbacks.forEach(
|
|
14030
|
-
(S) => S.apply(this, [
|
|
14171
|
+
(S) => S.apply(this, [z])
|
|
14031
14172
|
);
|
|
14032
14173
|
}
|
|
14033
14174
|
};
|
|
@@ -14053,7 +14194,7 @@ class Ro extends W {
|
|
|
14053
14194
|
"initialContent must be a non-empty array of blocks, received: " + a
|
|
14054
14195
|
);
|
|
14055
14196
|
const s = [
|
|
14056
|
-
...Object.entries(this.extensions).map(([
|
|
14197
|
+
...Object.entries(this.extensions).map(([y, C]) => {
|
|
14057
14198
|
if (C instanceof j || C instanceof de || C instanceof ge)
|
|
14058
14199
|
return C;
|
|
14059
14200
|
if (!C.plugin)
|
|
@@ -14061,7 +14202,7 @@ class Ro extends W {
|
|
|
14061
14202
|
"Extension should either be a TipTap extension or a ProseMirror plugin in a plugin property"
|
|
14062
14203
|
);
|
|
14063
14204
|
return j.create({
|
|
14064
|
-
name:
|
|
14205
|
+
name: y,
|
|
14065
14206
|
addProseMirrorPlugins: () => [C.plugin]
|
|
14066
14207
|
});
|
|
14067
14208
|
})
|
|
@@ -14071,18 +14212,18 @@ class Ro extends W {
|
|
|
14071
14212
|
content: a,
|
|
14072
14213
|
extensions: s,
|
|
14073
14214
|
editorProps: {
|
|
14074
|
-
...(
|
|
14215
|
+
...(f = n._tiptapOptions) == null ? void 0 : f.editorProps,
|
|
14075
14216
|
attributes: {
|
|
14076
14217
|
// As of TipTap v2.5.0 the tabIndex is removed when the editor is not
|
|
14077
14218
|
// editable, so you can't focus it. We want to revert this as we have
|
|
14078
14219
|
// UI behaviour that relies on it.
|
|
14079
14220
|
tabIndex: "0",
|
|
14080
|
-
...(b = (
|
|
14081
|
-
...(
|
|
14082
|
-
class:
|
|
14221
|
+
...(b = (g = n._tiptapOptions) == null ? void 0 : g.editorProps) == null ? void 0 : b.attributes,
|
|
14222
|
+
...(_ = n.domAttributes) == null ? void 0 : _.editor,
|
|
14223
|
+
class: X(
|
|
14083
14224
|
"bn-editor",
|
|
14084
14225
|
n.defaultStyles ? "bn-default-styles" : "",
|
|
14085
|
-
((w = (
|
|
14226
|
+
((w = (k = n.domAttributes) == null ? void 0 : k.editor) == null ? void 0 : w.class) || ""
|
|
14086
14227
|
)
|
|
14087
14228
|
},
|
|
14088
14229
|
transformPasted: hs
|
|
@@ -14162,7 +14303,7 @@ class Ro extends W {
|
|
|
14162
14303
|
* matching block was found.
|
|
14163
14304
|
*/
|
|
14164
14305
|
getBlock(t) {
|
|
14165
|
-
return
|
|
14306
|
+
return Kr(this, t);
|
|
14166
14307
|
}
|
|
14167
14308
|
/**
|
|
14168
14309
|
* Gets a snapshot of the previous sibling of an existing block from the
|
|
@@ -14174,7 +14315,7 @@ class Ro extends W {
|
|
|
14174
14315
|
* in the document.
|
|
14175
14316
|
*/
|
|
14176
14317
|
getPrevBlock(t) {
|
|
14177
|
-
return
|
|
14318
|
+
return Wr(this, t);
|
|
14178
14319
|
}
|
|
14179
14320
|
/**
|
|
14180
14321
|
* Gets a snapshot of the next sibling of an existing block from the editor.
|
|
@@ -14195,7 +14336,7 @@ class Ro extends W {
|
|
|
14195
14336
|
* if no matching block was found, or the block isn't nested.
|
|
14196
14337
|
*/
|
|
14197
14338
|
getParentBlock(t) {
|
|
14198
|
-
return
|
|
14339
|
+
return Zr(this, t);
|
|
14199
14340
|
}
|
|
14200
14341
|
/**
|
|
14201
14342
|
* Traverses all blocks in the editor depth-first, and executes a callback for each.
|
|
@@ -14293,7 +14434,7 @@ class Ro extends W {
|
|
|
14293
14434
|
* `referenceBlock`.
|
|
14294
14435
|
*/
|
|
14295
14436
|
insertBlocks(t, i, n = "before") {
|
|
14296
|
-
return
|
|
14437
|
+
return Nr(this, t, i, n);
|
|
14297
14438
|
}
|
|
14298
14439
|
/**
|
|
14299
14440
|
* Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
|
|
@@ -14328,12 +14469,12 @@ class Ro extends W {
|
|
|
14328
14469
|
* @param content can be a string, or array of partial inline content elements
|
|
14329
14470
|
*/
|
|
14330
14471
|
insertInlineContent(t) {
|
|
14331
|
-
const i =
|
|
14472
|
+
const i = R(
|
|
14332
14473
|
t,
|
|
14333
14474
|
this.pmSchema,
|
|
14334
14475
|
this.schema.styleSchema
|
|
14335
14476
|
);
|
|
14336
|
-
|
|
14477
|
+
Xr(
|
|
14337
14478
|
{
|
|
14338
14479
|
from: this._tiptapEditor.state.selection.from,
|
|
14339
14480
|
to: this._tiptapEditor.state.selection.to
|
|
@@ -14373,7 +14514,7 @@ class Ro extends W {
|
|
|
14373
14514
|
else if (r.propSchema === "string")
|
|
14374
14515
|
this._tiptapEditor.commands.setMark(i, { stringValue: n });
|
|
14375
14516
|
else
|
|
14376
|
-
throw new
|
|
14517
|
+
throw new O(r.propSchema);
|
|
14377
14518
|
}
|
|
14378
14519
|
}
|
|
14379
14520
|
/**
|
|
@@ -14398,7 +14539,7 @@ class Ro extends W {
|
|
|
14398
14539
|
else if (r.propSchema === "string")
|
|
14399
14540
|
this._tiptapEditor.commands.toggleMark(i, { stringValue: n });
|
|
14400
14541
|
else
|
|
14401
|
-
throw new
|
|
14542
|
+
throw new O(r.propSchema);
|
|
14402
14543
|
}
|
|
14403
14544
|
}
|
|
14404
14545
|
/**
|
|
@@ -14435,7 +14576,7 @@ class Ro extends W {
|
|
|
14435
14576
|
* Checks if the block containing the text cursor can be nested.
|
|
14436
14577
|
*/
|
|
14437
14578
|
canNestBlock() {
|
|
14438
|
-
return
|
|
14579
|
+
return Vr(this);
|
|
14439
14580
|
}
|
|
14440
14581
|
/**
|
|
14441
14582
|
* Nests the block containing the text cursor into the block above it.
|
|
@@ -14453,7 +14594,7 @@ class Ro extends W {
|
|
|
14453
14594
|
* Lifts the block containing the text cursor out of its parent.
|
|
14454
14595
|
*/
|
|
14455
14596
|
unnestBlock() {
|
|
14456
|
-
|
|
14597
|
+
zr(this);
|
|
14457
14598
|
}
|
|
14458
14599
|
/**
|
|
14459
14600
|
* Moves the selected blocks up. If the previous block has children, moves
|
|
@@ -14479,7 +14620,7 @@ class Ro extends W {
|
|
|
14479
14620
|
* @returns The blocks, serialized as an HTML string.
|
|
14480
14621
|
*/
|
|
14481
14622
|
async blocksToHTMLLossy(t = this.document) {
|
|
14482
|
-
return
|
|
14623
|
+
return je(this.pmSchema, this).exportBlocks(t, {});
|
|
14483
14624
|
}
|
|
14484
14625
|
/**
|
|
14485
14626
|
* Serializes blocks into an HTML string in the format that would normally be rendered by the editor.
|
|
@@ -14491,7 +14632,7 @@ class Ro extends W {
|
|
|
14491
14632
|
* @returns The blocks, serialized as an HTML string.
|
|
14492
14633
|
*/
|
|
14493
14634
|
async blocksToFullHTML(t) {
|
|
14494
|
-
return
|
|
14635
|
+
return vn(this.pmSchema, this).serializeBlocks(t, {});
|
|
14495
14636
|
}
|
|
14496
14637
|
/**
|
|
14497
14638
|
* Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
|
|
@@ -14754,7 +14895,7 @@ async function bs() {
|
|
|
14754
14895
|
return await t.init({ data: i }), { emojiMart: t, emojiData: i };
|
|
14755
14896
|
})(), Be);
|
|
14756
14897
|
}
|
|
14757
|
-
async function
|
|
14898
|
+
async function _l(e, o) {
|
|
14758
14899
|
if (!Lr("text", e))
|
|
14759
14900
|
return [];
|
|
14760
14901
|
const { emojiData: t, emojiMart: i } = await bs();
|
|
@@ -14763,7 +14904,7 @@ async function kl(e, o) {
|
|
|
14763
14904
|
onItemClick: () => e.insertInlineContent(r.skins[0].native + " ")
|
|
14764
14905
|
}));
|
|
14765
14906
|
}
|
|
14766
|
-
function
|
|
14907
|
+
function kl(e, ...o) {
|
|
14767
14908
|
const t = [...e];
|
|
14768
14909
|
for (const i of o)
|
|
14769
14910
|
for (const n of i) {
|
|
@@ -14774,7 +14915,7 @@ function _l(e, ...o) {
|
|
|
14774
14915
|
}
|
|
14775
14916
|
return t;
|
|
14776
14917
|
}
|
|
14777
|
-
function
|
|
14918
|
+
function ze(e = "") {
|
|
14778
14919
|
return typeof e == "string" ? [
|
|
14779
14920
|
{
|
|
14780
14921
|
type: "text",
|
|
@@ -14785,10 +14926,10 @@ function Ve(e = "") {
|
|
|
14785
14926
|
}
|
|
14786
14927
|
function se(e) {
|
|
14787
14928
|
var o, t, i, n, r;
|
|
14788
|
-
return typeof e == "string" ?
|
|
14929
|
+
return typeof e == "string" ? ze(e) : Array.isArray(e) ? e.flatMap((a) => typeof a == "string" ? ze(a) : ot(a) ? {
|
|
14789
14930
|
...a,
|
|
14790
|
-
content:
|
|
14791
|
-
} :
|
|
14931
|
+
content: ze(a.content)
|
|
14932
|
+
} : Z(a) ? a : {
|
|
14792
14933
|
props: {},
|
|
14793
14934
|
...a,
|
|
14794
14935
|
content: se(a.content)
|
|
@@ -14862,12 +15003,12 @@ function Do(e, o) {
|
|
|
14862
15003
|
children: i.children.map((r) => Do(e, r))
|
|
14863
15004
|
};
|
|
14864
15005
|
}
|
|
14865
|
-
function ks(e) {
|
|
14866
|
-
e.id || (e.id = we.options.generateID()), e.children && _s(e.children);
|
|
14867
|
-
}
|
|
14868
15006
|
function _s(e) {
|
|
15007
|
+
e.id || (e.id = we.options.generateID()), e.children && ks(e.children);
|
|
15008
|
+
}
|
|
15009
|
+
function ks(e) {
|
|
14869
15010
|
for (const o of e)
|
|
14870
|
-
|
|
15011
|
+
_s(o);
|
|
14871
15012
|
}
|
|
14872
15013
|
export {
|
|
14873
15014
|
In as AudioBlock,
|
|
@@ -14876,14 +15017,14 @@ export {
|
|
|
14876
15017
|
fl as COLORS_DARK_MODE_DEFAULT,
|
|
14877
15018
|
hl as COLORS_DEFAULT,
|
|
14878
15019
|
An as CodeBlock,
|
|
14879
|
-
|
|
15020
|
+
Na as DEFAULT_LINK_PROTOCOL,
|
|
14880
15021
|
il as EMPTY_CELL_HEIGHT,
|
|
14881
15022
|
fo as EMPTY_CELL_WIDTH,
|
|
14882
15023
|
gl as Exporter,
|
|
14883
15024
|
Sn as FILE_AUDIO_ICON_SVG,
|
|
14884
15025
|
Cn as FILE_ICON_SVG,
|
|
14885
15026
|
Hn as FILE_IMAGE_ICON_SVG,
|
|
14886
|
-
|
|
15027
|
+
vr as FILE_VIDEO_ICON_SVG,
|
|
14887
15028
|
Un as FileBlock,
|
|
14888
15029
|
xa as FilePanelProsemirrorPlugin,
|
|
14889
15030
|
Ca as FilePanelView,
|
|
@@ -14892,23 +15033,23 @@ export {
|
|
|
14892
15033
|
To as HTMLToBlocks,
|
|
14893
15034
|
Gn as ImageBlock,
|
|
14894
15035
|
Pa as LinkToolbarProsemirrorPlugin,
|
|
14895
|
-
|
|
15036
|
+
Xn as PageBreak,
|
|
14896
15037
|
qa as SideMenuProsemirrorPlugin,
|
|
14897
|
-
|
|
15038
|
+
Ka as SideMenuView,
|
|
14898
15039
|
Ja as SuggestionMenuProseMirrorPlugin,
|
|
14899
15040
|
os as TableHandlesProsemirrorPlugin,
|
|
14900
15041
|
ts as TableHandlesView,
|
|
14901
15042
|
we as UniqueID,
|
|
14902
|
-
|
|
14903
|
-
|
|
15043
|
+
O as UnreachableCaseError,
|
|
15044
|
+
ja as VALID_LINK_PROTOCOLS,
|
|
14904
15045
|
Br as VideoBlock,
|
|
14905
|
-
|
|
14906
|
-
|
|
14907
|
-
|
|
15046
|
+
_s as addIdsToBlock,
|
|
15047
|
+
ks as addIdsToBlocks,
|
|
15048
|
+
_t as addInlineContentAttributes,
|
|
14908
15049
|
tn as addInlineContentKeyboardShortcuts,
|
|
14909
15050
|
sn as addStyleAttributes,
|
|
14910
15051
|
Qi as applyNonSelectableBlockFix,
|
|
14911
|
-
|
|
15052
|
+
Xs as assertEmpty,
|
|
14912
15053
|
Bn as audioBlockConfig,
|
|
14913
15054
|
Mn as audioParse,
|
|
14914
15055
|
En as audioPropSchema,
|
|
@@ -14925,25 +15066,25 @@ export {
|
|
|
14925
15066
|
Ar as checkBlockTypeHasDefaultProp,
|
|
14926
15067
|
P as checkDefaultBlockTypeInSchema,
|
|
14927
15068
|
Lr as checkDefaultInlineContentTypeInSchema,
|
|
14928
|
-
|
|
15069
|
+
jr as checkPageBreakBlocksInSchema,
|
|
14929
15070
|
dt as cleanHTMLToMarkdown,
|
|
14930
|
-
|
|
15071
|
+
kl as combineByGroup,
|
|
14931
15072
|
Ae as contentNodeToInlineContent,
|
|
14932
15073
|
qt as contentNodeToTableContent,
|
|
14933
|
-
|
|
14934
|
-
|
|
15074
|
+
yn as createAddFileButton,
|
|
15075
|
+
ye as createBlockSpec,
|
|
14935
15076
|
J as createBlockSpecFromStronglyTypedTiptapNode,
|
|
14936
15077
|
$ as createDefaultBlockDOMOutputSpec,
|
|
14937
|
-
|
|
15078
|
+
je as createExternalHTMLExporter,
|
|
14938
15079
|
at as createFigureWithCaption,
|
|
14939
15080
|
rt as createFileBlockWrapper,
|
|
14940
15081
|
xn as createFileNameWithIcon,
|
|
14941
15082
|
Qs as createInlineContentSpec,
|
|
14942
15083
|
nn as createInlineContentSpecFromTipTapNode,
|
|
14943
|
-
|
|
14944
|
-
|
|
15084
|
+
Kt as createInternalBlockSpec,
|
|
15085
|
+
vn as createInternalHTMLSerializer,
|
|
14945
15086
|
on as createInternalInlineContentSpec,
|
|
14946
|
-
|
|
15087
|
+
Xt as createInternalStyleSpec,
|
|
14947
15088
|
Re as createLinkWithCaption,
|
|
14948
15089
|
co as createResizableFileBlockWrapper,
|
|
14949
15090
|
G as createStronglyTypedTiptapNode,
|
|
@@ -14956,77 +15097,77 @@ export {
|
|
|
14956
15097
|
bt as defaultBlockToHTML,
|
|
14957
15098
|
Je as defaultCodeBlockPropSchema,
|
|
14958
15099
|
Mr as defaultInlineContentSchema,
|
|
14959
|
-
|
|
15100
|
+
_o as defaultInlineContentSpecs,
|
|
14960
15101
|
B as defaultProps,
|
|
14961
15102
|
nl as defaultStyleSchema,
|
|
14962
15103
|
bo as defaultStyleSpecs,
|
|
14963
15104
|
ne as esmDependencies,
|
|
14964
|
-
|
|
15105
|
+
jn as fileBlockConfig,
|
|
14965
15106
|
Rn as fileParse,
|
|
14966
15107
|
Pn as filePropSchema,
|
|
14967
|
-
|
|
15108
|
+
Nn as fileRender,
|
|
14968
15109
|
Dn as fileToExternalHTML,
|
|
14969
15110
|
Ys as filenameFromURL,
|
|
14970
15111
|
cl as filterSuggestionItems,
|
|
14971
|
-
|
|
15112
|
+
W as formatKeyboardShortcut,
|
|
14972
15113
|
Ea as formattingToolbarPluginKey,
|
|
14973
15114
|
Yi as getBlockFromPos,
|
|
14974
15115
|
te as getBlockInfo,
|
|
14975
|
-
|
|
14976
|
-
|
|
15116
|
+
ke as getBlockInfoFromResolvedPos,
|
|
15117
|
+
v as getBlockInfoFromSelection,
|
|
14977
15118
|
tt as getBlockInfoWithManualOffset,
|
|
14978
15119
|
cs as getBlockNoteExtensions,
|
|
14979
|
-
|
|
15120
|
+
Wt as getBlockSchemaFromSpecs,
|
|
14980
15121
|
he as getColspan,
|
|
14981
|
-
|
|
15122
|
+
_l as getDefaultEmojiPickerItems,
|
|
14982
15123
|
dl as getDefaultSlashMenuItems,
|
|
14983
15124
|
rn as getInlineContentParseRules,
|
|
14984
|
-
|
|
15125
|
+
Zt as getInlineContentSchemaFromSpecs,
|
|
14985
15126
|
q as getNearestBlockPos,
|
|
14986
|
-
|
|
15127
|
+
N as getNodeById,
|
|
14987
15128
|
pl as getPageBreakSlashMenuItems,
|
|
14988
15129
|
en as getParseRules,
|
|
14989
15130
|
Ge as getRowspan,
|
|
14990
15131
|
ln as getStyleParseRules,
|
|
14991
15132
|
Jt as getStyleSchemaFromSpecs,
|
|
14992
|
-
|
|
15133
|
+
zn as imageBlockConfig,
|
|
14993
15134
|
Fn as imageParse,
|
|
14994
15135
|
On as imagePropSchema,
|
|
14995
|
-
|
|
15136
|
+
Vn as imageRender,
|
|
14996
15137
|
$n as imageToExternalHTML,
|
|
14997
15138
|
Gt as inheritedProps,
|
|
14998
15139
|
lt as initializeESMDependencies,
|
|
14999
|
-
|
|
15140
|
+
R as inlineContentToNodes,
|
|
15000
15141
|
L as insertOrUpdateBlock,
|
|
15001
15142
|
Ji as isAppleOS,
|
|
15002
15143
|
gt as isLinkInlineContent,
|
|
15003
15144
|
ot as isPartialLinkInlineContent,
|
|
15004
15145
|
me as isPartialTableCell,
|
|
15005
15146
|
Js as isSafari,
|
|
15006
|
-
|
|
15147
|
+
Z as isStyledTextInlineContent,
|
|
15007
15148
|
it as isTableCell,
|
|
15008
15149
|
Et as isTableCellSelection,
|
|
15009
15150
|
Aa as linkToolbarPluginKey,
|
|
15010
|
-
|
|
15151
|
+
Zs as locales,
|
|
15011
15152
|
$e as mapTableCell,
|
|
15012
15153
|
bl as mappingFactory,
|
|
15013
15154
|
da as markdownToBlocks,
|
|
15014
|
-
|
|
15155
|
+
X as mergeCSSClasses,
|
|
15015
15156
|
x as nodeToBlock,
|
|
15016
|
-
|
|
15017
|
-
|
|
15157
|
+
Ke as nodeToCustomInlineContent,
|
|
15158
|
+
Kn as pageBreakConfig,
|
|
15018
15159
|
qn as pageBreakParse,
|
|
15019
|
-
|
|
15020
|
-
|
|
15021
|
-
|
|
15160
|
+
Wn as pageBreakRender,
|
|
15161
|
+
ko as pageBreakSchema,
|
|
15162
|
+
Zn as pageBreakToExternalHTML,
|
|
15022
15163
|
Ct as parseEmbedElement,
|
|
15023
|
-
|
|
15164
|
+
Ne as parseFigureElement,
|
|
15024
15165
|
Do as partialBlockToBlockForTesting,
|
|
15025
15166
|
wl as partialBlocksToBlocksForTesting,
|
|
15026
|
-
|
|
15167
|
+
ve as propsToAttributes,
|
|
15027
15168
|
Ue as shikiHighlighterPromiseSymbol,
|
|
15028
|
-
|
|
15029
|
-
|
|
15169
|
+
yt as shikiParserSymbol,
|
|
15170
|
+
Wa as sideMenuPluginKey,
|
|
15030
15171
|
an as stylePropsToAttributes,
|
|
15031
15172
|
Pe as tableContentToNodes,
|
|
15032
15173
|
pe as tableHandlesPluginKey,
|
|
@@ -15035,7 +15176,7 @@ export {
|
|
|
15035
15176
|
ol as uploadToTmpFilesDotOrg_DEV_ONLY,
|
|
15036
15177
|
Cr as videoBlockConfig,
|
|
15037
15178
|
Sr as videoParse,
|
|
15038
|
-
|
|
15179
|
+
yr as videoPropSchema,
|
|
15039
15180
|
xr as videoRender,
|
|
15040
15181
|
Er as videoToExternalHTML,
|
|
15041
15182
|
ul as withPageBreak,
|