@blocknote/core 0.15.2 → 0.15.4
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/README.md +1 -1
- package/dist/blocknote.js +667 -362
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +5 -5
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +2 -2
- package/src/editor/BlockNoteEditor.ts +3 -1
- package/src/editor/editor.css +13 -1
- package/src/extensions/SideMenu/SideMenuPlugin.ts +2 -2
- package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +8 -3
- package/src/i18n/locales/de.ts +307 -0
- package/src/i18n/locales/es.ts +275 -0
- package/src/i18n/locales/index.ts +2 -1
- package/types/src/api/blockManipulation/blockManipulation.d.ts +1 -1
- package/types/src/api/exporters/copyExtension.d.ts +2 -2
- package/types/src/api/exporters/html/externalHTMLExporter.d.ts +1 -1
- package/types/src/api/exporters/html/internalHTMLSerializer.d.ts +1 -1
- package/types/src/api/exporters/html/util/sharedHTMLConversion.d.ts +2 -2
- package/types/src/api/parsers/fileDropExtension.d.ts +2 -2
- package/types/src/api/parsers/pasteExtension.d.ts +2 -2
- package/types/src/blocks/defaultBlockHelpers.d.ts +2 -2
- package/types/src/editor/BlockNoteExtensions.d.ts +2 -2
- package/types/src/i18n/locales/de.d.ts +274 -0
- package/types/src/i18n/locales/es.d.ts +239 -0
- package/types/src/i18n/locales/index.d.ts +1 -0
- package/types/src/pm-nodes/BlockContainer.d.ts +8 -2
- package/types/src/pm-nodes/BlockGroup.d.ts +7 -2
- package/types/src/schema/inlineContent/internal.d.ts +1 -1
package/dist/blocknote.js
CHANGED
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var c = (e, t, o) =>
|
|
4
|
-
import { Slice as D, Fragment as L, DOMSerializer as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { unified as
|
|
8
|
-
import { Extension as M, combineTransactionSteps as
|
|
9
|
-
import { Plugin as y, PluginKey as S, Selection as me, NodeSelection as re, TextSelection as Y, EditorState as
|
|
10
|
-
import { v4 as
|
|
11
|
-
import { fromDom as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { TableCell as
|
|
18
|
-
import { TableHeader as
|
|
19
|
-
import { TableRow as
|
|
20
|
-
import { columnResizing as
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import { DecorationSet as G, Decoration as K, EditorView as
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import { Dropcursor as
|
|
30
|
-
import { Gapcursor as
|
|
31
|
-
import { HardBreak as
|
|
32
|
-
import { History as
|
|
33
|
-
import { Link as
|
|
34
|
-
import { Text as
|
|
35
|
-
|
|
36
|
-
const yo = {
|
|
1
|
+
var Bt = Object.defineProperty;
|
|
2
|
+
var Lt = (e, t, o) => t in e ? Bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
3
|
+
var c = (e, t, o) => Lt(e, typeof t != "symbol" ? t + "" : t, o);
|
|
4
|
+
import { Slice as D, Fragment as L, DOMSerializer as xe, DOMParser as It, Node as At } from "prosemirror-model";
|
|
5
|
+
import Je from "rehype-parse";
|
|
6
|
+
import Ye from "rehype-stringify";
|
|
7
|
+
import { unified as Ee } from "unified";
|
|
8
|
+
import { Extension as M, combineTransactionSteps as Nt, getChangedRanges as Pt, findChildrenInRange as Ht, Node as $, Mark as Ce, InputRule as ee, callOrReturn as Ut, getExtensionField as Dt, mergeAttributes as jt, selectionToInsertionEnd as Vt, isTextSelection as zt, isNodeSelection as Rt, posToDOMRect as ye, getMarkRange as De, findParentNode as Ot, findChildren as je, extensions as J, Editor as Ft, createDocument as Gt, getSchema as Kt } from "@tiptap/core";
|
|
9
|
+
import { Plugin as y, PluginKey as S, Selection as me, NodeSelection as re, TextSelection as Y, EditorState as Wt } from "prosemirror-state";
|
|
10
|
+
import { v4 as $t } from "uuid";
|
|
11
|
+
import { fromDom as we } from "hast-util-from-dom";
|
|
12
|
+
import qt from "@tiptap/extension-bold";
|
|
13
|
+
import Xt from "@tiptap/extension-code";
|
|
14
|
+
import Zt from "@tiptap/extension-italic";
|
|
15
|
+
import Jt from "@tiptap/extension-strike";
|
|
16
|
+
import Yt from "@tiptap/extension-underline";
|
|
17
|
+
import { TableCell as Qt } from "@tiptap/extension-table-cell";
|
|
18
|
+
import { TableHeader as eo } from "@tiptap/extension-table-header";
|
|
19
|
+
import { TableRow as to } from "@tiptap/extension-table-row";
|
|
20
|
+
import { columnResizing as oo, tableEditing as io } from "prosemirror-tables";
|
|
21
|
+
import no from "rehype-remark";
|
|
22
|
+
import Qe from "remark-gfm";
|
|
23
|
+
import ro from "remark-stringify";
|
|
24
|
+
import ao from "remark-parse";
|
|
25
|
+
import so, { defaultHandlers as lo } from "remark-rehype";
|
|
26
|
+
import { DecorationSet as G, Decoration as K, EditorView as co } from "prosemirror-view";
|
|
27
|
+
import uo from "@tiptap/extension-collaboration";
|
|
28
|
+
import po from "@tiptap/extension-collaboration-cursor";
|
|
29
|
+
import { Dropcursor as ho } from "@tiptap/extension-dropcursor";
|
|
30
|
+
import { Gapcursor as mo } from "@tiptap/extension-gapcursor";
|
|
31
|
+
import { HardBreak as fo } from "@tiptap/extension-hard-break";
|
|
32
|
+
import { History as go } from "@tiptap/extension-history";
|
|
33
|
+
import { Link as bo } from "@tiptap/extension-link";
|
|
34
|
+
import { Text as ko } from "@tiptap/extension-text";
|
|
35
|
+
const _o = {
|
|
37
36
|
slash_menu: {
|
|
38
37
|
heading: {
|
|
39
38
|
title: "عنوان 1",
|
|
@@ -323,7 +322,7 @@ const yo = {
|
|
|
323
322
|
generic: {
|
|
324
323
|
ctrl_shortcut: "Ctrl"
|
|
325
324
|
}
|
|
326
|
-
},
|
|
325
|
+
}, et = {
|
|
327
326
|
slash_menu: {
|
|
328
327
|
heading: {
|
|
329
328
|
title: "Heading 1",
|
|
@@ -629,7 +628,7 @@ const yo = {
|
|
|
629
628
|
generic: {
|
|
630
629
|
ctrl_shortcut: "Ctrl"
|
|
631
630
|
}
|
|
632
|
-
},
|
|
631
|
+
}, yo = {
|
|
633
632
|
slash_menu: {
|
|
634
633
|
heading: {
|
|
635
634
|
title: "Titre 1",
|
|
@@ -934,7 +933,7 @@ const yo = {
|
|
|
934
933
|
generic: {
|
|
935
934
|
ctrl_shortcut: "Ctrl"
|
|
936
935
|
}
|
|
937
|
-
},
|
|
936
|
+
}, wo = {
|
|
938
937
|
slash_menu: {
|
|
939
938
|
heading: {
|
|
940
939
|
title: "Fyrirsögn 1",
|
|
@@ -1231,7 +1230,7 @@ const yo = {
|
|
|
1231
1230
|
generic: {
|
|
1232
1231
|
ctrl_shortcut: "Ctrl"
|
|
1233
1232
|
}
|
|
1234
|
-
},
|
|
1233
|
+
}, vo = {
|
|
1235
1234
|
slash_menu: {
|
|
1236
1235
|
heading: {
|
|
1237
1236
|
title: "見出し1",
|
|
@@ -1556,7 +1555,7 @@ const yo = {
|
|
|
1556
1555
|
generic: {
|
|
1557
1556
|
ctrl_shortcut: "Ctrl"
|
|
1558
1557
|
}
|
|
1559
|
-
},
|
|
1558
|
+
}, xo = {
|
|
1560
1559
|
slash_menu: {
|
|
1561
1560
|
heading: {
|
|
1562
1561
|
title: "제목1",
|
|
@@ -1874,7 +1873,7 @@ const yo = {
|
|
|
1874
1873
|
generic: {
|
|
1875
1874
|
ctrl_shortcut: "Ctrl"
|
|
1876
1875
|
}
|
|
1877
|
-
},
|
|
1876
|
+
}, Eo = {
|
|
1878
1877
|
slash_menu: {
|
|
1879
1878
|
heading: {
|
|
1880
1879
|
title: "Kop 1",
|
|
@@ -2179,7 +2178,7 @@ const yo = {
|
|
|
2179
2178
|
generic: {
|
|
2180
2179
|
ctrl_shortcut: "Ctrl"
|
|
2181
2180
|
}
|
|
2182
|
-
},
|
|
2181
|
+
}, Co = {
|
|
2183
2182
|
slash_menu: {
|
|
2184
2183
|
heading: {
|
|
2185
2184
|
title: "Nagłówek 1",
|
|
@@ -2468,7 +2467,7 @@ const yo = {
|
|
|
2468
2467
|
generic: {
|
|
2469
2468
|
ctrl_shortcut: "Ctrl"
|
|
2470
2469
|
}
|
|
2471
|
-
},
|
|
2470
|
+
}, So = {
|
|
2472
2471
|
slash_menu: {
|
|
2473
2472
|
heading: {
|
|
2474
2473
|
title: "Título",
|
|
@@ -2765,7 +2764,7 @@ const yo = {
|
|
|
2765
2764
|
generic: {
|
|
2766
2765
|
ctrl_shortcut: "Ctrl"
|
|
2767
2766
|
}
|
|
2768
|
-
},
|
|
2767
|
+
}, Mo = {
|
|
2769
2768
|
slash_menu: {
|
|
2770
2769
|
heading: {
|
|
2771
2770
|
title: "Tiêu đề H1",
|
|
@@ -3069,7 +3068,7 @@ const yo = {
|
|
|
3069
3068
|
generic: {
|
|
3070
3069
|
ctrl_shortcut: "Ctrl"
|
|
3071
3070
|
}
|
|
3072
|
-
},
|
|
3071
|
+
}, To = {
|
|
3073
3072
|
slash_menu: {
|
|
3074
3073
|
heading: {
|
|
3075
3074
|
title: "一级标题",
|
|
@@ -3407,7 +3406,7 @@ const yo = {
|
|
|
3407
3406
|
generic: {
|
|
3408
3407
|
ctrl_shortcut: "Ctrl"
|
|
3409
3408
|
}
|
|
3410
|
-
},
|
|
3409
|
+
}, Bo = {
|
|
3411
3410
|
slash_menu: {
|
|
3412
3411
|
heading: {
|
|
3413
3412
|
title: "Заголовок 1 уровня",
|
|
@@ -3739,20 +3738,326 @@ const yo = {
|
|
|
3739
3738
|
generic: {
|
|
3740
3739
|
ctrl_shortcut: "Ctrl"
|
|
3741
3740
|
}
|
|
3742
|
-
},
|
|
3741
|
+
}, Lo = {
|
|
3742
|
+
slash_menu: {
|
|
3743
|
+
heading: {
|
|
3744
|
+
title: "Überschrift 1",
|
|
3745
|
+
subtext: "Hauptebene Überschrift",
|
|
3746
|
+
aliases: ["h", "überschrift1", "h1"],
|
|
3747
|
+
group: "Überschriften"
|
|
3748
|
+
},
|
|
3749
|
+
heading_2: {
|
|
3750
|
+
title: "Überschrift 2",
|
|
3751
|
+
subtext: "Wichtige Abschnittsüberschrift",
|
|
3752
|
+
aliases: ["h2", "überschrift2", "unterüberschrift"],
|
|
3753
|
+
group: "Überschriften"
|
|
3754
|
+
},
|
|
3755
|
+
heading_3: {
|
|
3756
|
+
title: "Überschrift 3",
|
|
3757
|
+
subtext: "Unterabschnitts- und Gruppenüberschrift",
|
|
3758
|
+
aliases: ["h3", "überschrift3", "unterüberschrift"],
|
|
3759
|
+
group: "Überschriften"
|
|
3760
|
+
},
|
|
3761
|
+
numbered_list: {
|
|
3762
|
+
title: "Nummerierte Liste",
|
|
3763
|
+
subtext: "Liste mit nummerierten Elementen",
|
|
3764
|
+
aliases: ["ol", "li", "liste", "nummerierteliste", "nummerierte liste"],
|
|
3765
|
+
group: "Grundlegende Blöcke"
|
|
3766
|
+
},
|
|
3767
|
+
bullet_list: {
|
|
3768
|
+
title: "Aufzählungsliste",
|
|
3769
|
+
subtext: "Liste mit unnummerierten Elementen",
|
|
3770
|
+
aliases: ["ul", "li", "liste", "aufzählungsliste", "aufzählung liste"],
|
|
3771
|
+
group: "Grundlegende Blöcke"
|
|
3772
|
+
},
|
|
3773
|
+
check_list: {
|
|
3774
|
+
title: "Checkliste",
|
|
3775
|
+
subtext: "Liste mit Kontrollkästchen",
|
|
3776
|
+
aliases: [
|
|
3777
|
+
"ul",
|
|
3778
|
+
"li",
|
|
3779
|
+
"liste",
|
|
3780
|
+
"checkliste",
|
|
3781
|
+
"check liste",
|
|
3782
|
+
"geprüfte liste",
|
|
3783
|
+
"kontrollkästchen"
|
|
3784
|
+
],
|
|
3785
|
+
group: "Grundlegende Blöcke"
|
|
3786
|
+
},
|
|
3787
|
+
paragraph: {
|
|
3788
|
+
title: "Absatz",
|
|
3789
|
+
subtext: "Der Hauptteil Ihres Dokuments",
|
|
3790
|
+
aliases: ["p", "absatz"],
|
|
3791
|
+
group: "Grundlegende Blöcke"
|
|
3792
|
+
},
|
|
3793
|
+
table: {
|
|
3794
|
+
title: "Tabelle",
|
|
3795
|
+
subtext: "Tabelle mit editierbaren Zellen",
|
|
3796
|
+
aliases: ["tabelle"],
|
|
3797
|
+
group: "Erweitert"
|
|
3798
|
+
},
|
|
3799
|
+
image: {
|
|
3800
|
+
title: "Bild",
|
|
3801
|
+
subtext: "Größenveränderbares Bild mit Beschriftung",
|
|
3802
|
+
aliases: [
|
|
3803
|
+
"bild",
|
|
3804
|
+
"bildhochladen",
|
|
3805
|
+
"hochladen",
|
|
3806
|
+
"img",
|
|
3807
|
+
"bild",
|
|
3808
|
+
"medien",
|
|
3809
|
+
"url"
|
|
3810
|
+
],
|
|
3811
|
+
group: "Medien"
|
|
3812
|
+
},
|
|
3813
|
+
video: {
|
|
3814
|
+
title: "Video",
|
|
3815
|
+
subtext: "Größenveränderbares Video mit Beschriftung",
|
|
3816
|
+
aliases: [
|
|
3817
|
+
"video",
|
|
3818
|
+
"videoupload",
|
|
3819
|
+
"hochladen",
|
|
3820
|
+
"mp4",
|
|
3821
|
+
"film",
|
|
3822
|
+
"medien",
|
|
3823
|
+
"url"
|
|
3824
|
+
],
|
|
3825
|
+
group: "Medien"
|
|
3826
|
+
},
|
|
3827
|
+
audio: {
|
|
3828
|
+
title: "Audio",
|
|
3829
|
+
subtext: "Eingebettetes Audio mit Beschriftung",
|
|
3830
|
+
aliases: [
|
|
3831
|
+
"audio",
|
|
3832
|
+
"audioupload",
|
|
3833
|
+
"hochladen",
|
|
3834
|
+
"mp3",
|
|
3835
|
+
"ton",
|
|
3836
|
+
"medien",
|
|
3837
|
+
"url"
|
|
3838
|
+
],
|
|
3839
|
+
group: "Medien"
|
|
3840
|
+
},
|
|
3841
|
+
file: {
|
|
3842
|
+
title: "Datei",
|
|
3843
|
+
subtext: "Eingebettete Datei",
|
|
3844
|
+
aliases: ["datei", "hochladen", "einbetten", "medien", "url"],
|
|
3845
|
+
group: "Medien"
|
|
3846
|
+
},
|
|
3847
|
+
emoji: {
|
|
3848
|
+
title: "Emoji",
|
|
3849
|
+
subtext: "Nach Emoji suchen und einfügen",
|
|
3850
|
+
aliases: ["emoji", "emote", "emotion", "gesicht"],
|
|
3851
|
+
group: "Andere"
|
|
3852
|
+
}
|
|
3853
|
+
},
|
|
3854
|
+
placeholders: {
|
|
3855
|
+
default: "Text eingeben oder '/' für Befehle tippen",
|
|
3856
|
+
heading: "Überschrift",
|
|
3857
|
+
bulletListItem: "Liste",
|
|
3858
|
+
numberedListItem: "Liste",
|
|
3859
|
+
checkListItem: "Liste"
|
|
3860
|
+
},
|
|
3861
|
+
file_blocks: {
|
|
3862
|
+
image: {
|
|
3863
|
+
add_button_text: "Bild hinzufügen"
|
|
3864
|
+
},
|
|
3865
|
+
video: {
|
|
3866
|
+
add_button_text: "Video hinzufügen"
|
|
3867
|
+
},
|
|
3868
|
+
audio: {
|
|
3869
|
+
add_button_text: "Audio hinzufügen"
|
|
3870
|
+
},
|
|
3871
|
+
file: {
|
|
3872
|
+
add_button_text: "Datei hinzufügen"
|
|
3873
|
+
}
|
|
3874
|
+
},
|
|
3875
|
+
side_menu: {
|
|
3876
|
+
add_block_label: "Block hinzufügen",
|
|
3877
|
+
drag_handle_label: "Blockmenü öffnen"
|
|
3878
|
+
},
|
|
3879
|
+
drag_handle: {
|
|
3880
|
+
delete_menuitem: "Löschen",
|
|
3881
|
+
colors_menuitem: "Farben"
|
|
3882
|
+
},
|
|
3883
|
+
table_handle: {
|
|
3884
|
+
delete_column_menuitem: "Spalte löschen",
|
|
3885
|
+
delete_row_menuitem: "Zeile löschen",
|
|
3886
|
+
add_left_menuitem: "Spalte links hinzufügen",
|
|
3887
|
+
add_right_menuitem: "Spalte rechts hinzufügen",
|
|
3888
|
+
add_above_menuitem: "Zeile oberhalb hinzufügen",
|
|
3889
|
+
add_below_menuitem: "Zeile unterhalb hinzufügen"
|
|
3890
|
+
},
|
|
3891
|
+
suggestion_menu: {
|
|
3892
|
+
no_items_title: "Keine Elemente gefunden",
|
|
3893
|
+
loading: "Laden…"
|
|
3894
|
+
},
|
|
3895
|
+
color_picker: {
|
|
3896
|
+
text_title: "Text",
|
|
3897
|
+
background_title: "Hintergrund",
|
|
3898
|
+
colors: {
|
|
3899
|
+
default: "Standard",
|
|
3900
|
+
gray: "Grau",
|
|
3901
|
+
brown: "Braun",
|
|
3902
|
+
red: "Rot",
|
|
3903
|
+
orange: "Orange",
|
|
3904
|
+
yellow: "Gelb",
|
|
3905
|
+
green: "Grün",
|
|
3906
|
+
blue: "Blau",
|
|
3907
|
+
purple: "Lila",
|
|
3908
|
+
pink: "Rosa"
|
|
3909
|
+
}
|
|
3910
|
+
},
|
|
3911
|
+
formatting_toolbar: {
|
|
3912
|
+
bold: {
|
|
3913
|
+
tooltip: "Fett",
|
|
3914
|
+
secondary_tooltip: "Mod+B"
|
|
3915
|
+
},
|
|
3916
|
+
italic: {
|
|
3917
|
+
tooltip: "Kursiv",
|
|
3918
|
+
secondary_tooltip: "Mod+I"
|
|
3919
|
+
},
|
|
3920
|
+
underline: {
|
|
3921
|
+
tooltip: "Unterstrichen",
|
|
3922
|
+
secondary_tooltip: "Mod+U"
|
|
3923
|
+
},
|
|
3924
|
+
strike: {
|
|
3925
|
+
tooltip: "Durchgestrichen",
|
|
3926
|
+
secondary_tooltip: "Mod+Shift+S"
|
|
3927
|
+
},
|
|
3928
|
+
code: {
|
|
3929
|
+
tooltip: "Code",
|
|
3930
|
+
secondary_tooltip: ""
|
|
3931
|
+
},
|
|
3932
|
+
colors: {
|
|
3933
|
+
tooltip: "Farben"
|
|
3934
|
+
},
|
|
3935
|
+
link: {
|
|
3936
|
+
tooltip: "Link erstellen",
|
|
3937
|
+
secondary_tooltip: "Mod+K"
|
|
3938
|
+
},
|
|
3939
|
+
file_caption: {
|
|
3940
|
+
tooltip: "Beschriftung bearbeiten",
|
|
3941
|
+
input_placeholder: "Beschriftung bearbeiten"
|
|
3942
|
+
},
|
|
3943
|
+
file_replace: {
|
|
3944
|
+
tooltip: {
|
|
3945
|
+
image: "Bild ersetzen",
|
|
3946
|
+
video: "Video ersetzen",
|
|
3947
|
+
audio: "Audio ersetzen",
|
|
3948
|
+
file: "Datei ersetzen"
|
|
3949
|
+
}
|
|
3950
|
+
},
|
|
3951
|
+
file_rename: {
|
|
3952
|
+
tooltip: {
|
|
3953
|
+
image: "Bild umbenennen",
|
|
3954
|
+
video: "Video umbenennen",
|
|
3955
|
+
audio: "Audio umbenennen",
|
|
3956
|
+
file: "Datei umbenennen"
|
|
3957
|
+
},
|
|
3958
|
+
input_placeholder: {
|
|
3959
|
+
image: "Bild umbenennen",
|
|
3960
|
+
video: "Video umbenennen",
|
|
3961
|
+
audio: "Audio umbenennen",
|
|
3962
|
+
file: "Datei umbenennen"
|
|
3963
|
+
}
|
|
3964
|
+
},
|
|
3965
|
+
file_download: {
|
|
3966
|
+
tooltip: {
|
|
3967
|
+
image: "Bild herunterladen",
|
|
3968
|
+
video: "Video herunterladen",
|
|
3969
|
+
audio: "Audio herunterladen",
|
|
3970
|
+
file: "Datei herunterladen"
|
|
3971
|
+
}
|
|
3972
|
+
},
|
|
3973
|
+
file_delete: {
|
|
3974
|
+
tooltip: {
|
|
3975
|
+
image: "Bild löschen",
|
|
3976
|
+
video: "Video löschen",
|
|
3977
|
+
audio: "Audio löschen",
|
|
3978
|
+
file: "Datei löschen"
|
|
3979
|
+
}
|
|
3980
|
+
},
|
|
3981
|
+
file_preview_toggle: {
|
|
3982
|
+
tooltip: "Vorschau umschalten"
|
|
3983
|
+
},
|
|
3984
|
+
nest: {
|
|
3985
|
+
tooltip: "Block verschachteln",
|
|
3986
|
+
secondary_tooltip: "Tab"
|
|
3987
|
+
},
|
|
3988
|
+
unnest: {
|
|
3989
|
+
tooltip: "Block entnesten",
|
|
3990
|
+
secondary_tooltip: "Shift+Tab"
|
|
3991
|
+
},
|
|
3992
|
+
align_left: {
|
|
3993
|
+
tooltip: "Text linksbündig"
|
|
3994
|
+
},
|
|
3995
|
+
align_center: {
|
|
3996
|
+
tooltip: "Text zentrieren"
|
|
3997
|
+
},
|
|
3998
|
+
align_right: {
|
|
3999
|
+
tooltip: "Text rechtsbündig"
|
|
4000
|
+
},
|
|
4001
|
+
align_justify: {
|
|
4002
|
+
tooltip: "Text Blocksatz"
|
|
4003
|
+
}
|
|
4004
|
+
},
|
|
4005
|
+
file_panel: {
|
|
4006
|
+
upload: {
|
|
4007
|
+
title: "Hochladen",
|
|
4008
|
+
file_placeholder: {
|
|
4009
|
+
image: "Bild hochladen",
|
|
4010
|
+
video: "Video hochladen",
|
|
4011
|
+
audio: "Audio hochladen",
|
|
4012
|
+
file: "Datei hochladen"
|
|
4013
|
+
},
|
|
4014
|
+
upload_error: "Fehler: Hochladen fehlgeschlagen"
|
|
4015
|
+
},
|
|
4016
|
+
embed: {
|
|
4017
|
+
title: "Einbetten",
|
|
4018
|
+
embed_button: {
|
|
4019
|
+
image: "Bild einbetten",
|
|
4020
|
+
video: "Video einbetten",
|
|
4021
|
+
audio: "Audio einbetten",
|
|
4022
|
+
file: "Datei einbetten"
|
|
4023
|
+
},
|
|
4024
|
+
url_placeholder: "URL eingeben"
|
|
4025
|
+
}
|
|
4026
|
+
},
|
|
4027
|
+
link_toolbar: {
|
|
4028
|
+
delete: {
|
|
4029
|
+
tooltip: "Link entfernen"
|
|
4030
|
+
},
|
|
4031
|
+
edit: {
|
|
4032
|
+
text: "Link bearbeiten",
|
|
4033
|
+
tooltip: "Bearbeiten"
|
|
4034
|
+
},
|
|
4035
|
+
open: {
|
|
4036
|
+
tooltip: "In neuem Tab öffnen"
|
|
4037
|
+
},
|
|
4038
|
+
form: {
|
|
4039
|
+
title_placeholder: "Titel bearbeiten",
|
|
4040
|
+
url_placeholder: "URL bearbeiten"
|
|
4041
|
+
}
|
|
4042
|
+
},
|
|
4043
|
+
generic: {
|
|
4044
|
+
ctrl_shortcut: "Strg"
|
|
4045
|
+
}
|
|
4046
|
+
}, jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3743
4047
|
__proto__: null,
|
|
3744
|
-
ar:
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
4048
|
+
ar: _o,
|
|
4049
|
+
de: Lo,
|
|
4050
|
+
en: et,
|
|
4051
|
+
fr: yo,
|
|
4052
|
+
is: wo,
|
|
4053
|
+
ja: vo,
|
|
4054
|
+
ko: xo,
|
|
4055
|
+
nl: Eo,
|
|
4056
|
+
pl: Co,
|
|
4057
|
+
pt: So,
|
|
4058
|
+
ru: Bo,
|
|
4059
|
+
vi: Mo,
|
|
4060
|
+
zh: To
|
|
3756
4061
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3757
4062
|
function Io(e, t = JSON.stringify) {
|
|
3758
4063
|
const o = {};
|
|
@@ -3781,7 +4086,7 @@ const oe = M.create({
|
|
|
3781
4086
|
const e = window.__TEST_OPTIONS;
|
|
3782
4087
|
return e.mockID === void 0 ? e.mockID = 0 : e.mockID++, e.mockID.toString();
|
|
3783
4088
|
}
|
|
3784
|
-
return
|
|
4089
|
+
return $t();
|
|
3785
4090
|
},
|
|
3786
4091
|
filterTransaction: null
|
|
3787
4092
|
};
|
|
@@ -3844,26 +4149,26 @@ const oe = M.create({
|
|
|
3844
4149
|
});
|
|
3845
4150
|
if (!r || a)
|
|
3846
4151
|
return;
|
|
3847
|
-
const { tr: s } = n, { types: l, attributeName: d, generateID: u } = this.options, p =
|
|
4152
|
+
const { tr: s } = n, { types: l, attributeName: d, generateID: u } = this.options, p = Nt(
|
|
3848
4153
|
i.doc,
|
|
3849
4154
|
o
|
|
3850
4155
|
), { mapping: h } = p;
|
|
3851
|
-
if (
|
|
3852
|
-
const g =
|
|
4156
|
+
if (Pt(p).forEach(({ newRange: m }) => {
|
|
4157
|
+
const g = Ht(
|
|
3853
4158
|
n.doc,
|
|
3854
4159
|
m,
|
|
3855
4160
|
(T) => l.includes(T.type.name)
|
|
3856
4161
|
), b = g.map(({ node: T }) => T.attrs[d]).filter((T) => T !== null), A = Ao(b);
|
|
3857
4162
|
g.forEach(({ node: T, pos: N }) => {
|
|
3858
4163
|
let Z;
|
|
3859
|
-
const
|
|
3860
|
-
if (
|
|
3861
|
-
const
|
|
3862
|
-
if (i.doc.content.findDiffStart(
|
|
3863
|
-
const
|
|
4164
|
+
const Pe = (Z = s.doc.nodeAt(N)) === null || Z === void 0 ? void 0 : Z.attrs[d];
|
|
4165
|
+
if (Pe === null) {
|
|
4166
|
+
const He = i.doc.type.createAndFill().content;
|
|
4167
|
+
if (i.doc.content.findDiffStart(He) === null) {
|
|
4168
|
+
const Ue = JSON.parse(
|
|
3864
4169
|
JSON.stringify(n.doc.toJSON())
|
|
3865
4170
|
);
|
|
3866
|
-
if (
|
|
4171
|
+
if (Ue.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(Ue.content) === JSON.stringify(He.toJSON())) {
|
|
3867
4172
|
s.setNodeMarkup(N, void 0, {
|
|
3868
4173
|
...T.attrs,
|
|
3869
4174
|
[d]: "initialBlockId"
|
|
@@ -3877,8 +4182,8 @@ const oe = M.create({
|
|
|
3877
4182
|
});
|
|
3878
4183
|
return;
|
|
3879
4184
|
}
|
|
3880
|
-
const { deleted:
|
|
3881
|
-
|
|
4185
|
+
const { deleted: Tt } = h.invert().mapResult(N);
|
|
4186
|
+
Tt && A.includes(Pe) && s.setNodeMarkup(N, void 0, {
|
|
3882
4187
|
...T.attrs,
|
|
3883
4188
|
[d]: u()
|
|
3884
4189
|
});
|
|
@@ -3949,7 +4254,7 @@ const oe = M.create({
|
|
|
3949
4254
|
];
|
|
3950
4255
|
}
|
|
3951
4256
|
});
|
|
3952
|
-
function
|
|
4257
|
+
function tt(e) {
|
|
3953
4258
|
const t = e.attrs.id, o = e.firstChild, i = o.type, n = e.childCount === 2 ? e.lastChild.childCount : 0;
|
|
3954
4259
|
return {
|
|
3955
4260
|
id: t,
|
|
@@ -3979,7 +4284,7 @@ function k(e, t) {
|
|
|
3979
4284
|
break;
|
|
3980
4285
|
s -= 1, a = n.node(s);
|
|
3981
4286
|
}
|
|
3982
|
-
const { id: l, contentNode: d, contentType: u, numChildBlocks: p } =
|
|
4287
|
+
const { id: l, contentNode: d, contentType: u, numChildBlocks: p } = tt(a), h = n.start(s), f = n.end(s);
|
|
3983
4288
|
return {
|
|
3984
4289
|
id: l,
|
|
3985
4290
|
node: a,
|
|
@@ -3991,10 +4296,10 @@ function k(e, t) {
|
|
|
3991
4296
|
depth: s
|
|
3992
4297
|
};
|
|
3993
4298
|
}
|
|
3994
|
-
function
|
|
4299
|
+
function Ve(e) {
|
|
3995
4300
|
return e.type === "link";
|
|
3996
4301
|
}
|
|
3997
|
-
function
|
|
4302
|
+
function ot(e) {
|
|
3998
4303
|
return typeof e != "string" && e.type === "link";
|
|
3999
4304
|
}
|
|
4000
4305
|
function te(e) {
|
|
@@ -4005,12 +4310,12 @@ class I extends Error {
|
|
|
4005
4310
|
super(`Unreachable case: ${t}`);
|
|
4006
4311
|
}
|
|
4007
4312
|
}
|
|
4008
|
-
function
|
|
4313
|
+
function Vr(e, t = !0) {
|
|
4009
4314
|
const { "data-test": o, ...i } = e;
|
|
4010
4315
|
if (Object.keys(i).length > 0 && t)
|
|
4011
4316
|
throw new Error("Object must be empty " + JSON.stringify(e));
|
|
4012
4317
|
}
|
|
4013
|
-
function
|
|
4318
|
+
function ze(e, t, o) {
|
|
4014
4319
|
const i = [];
|
|
4015
4320
|
for (const [n, r] of Object.entries(e.styles)) {
|
|
4016
4321
|
const a = o[n];
|
|
@@ -4030,7 +4335,7 @@ function No(e, t, o) {
|
|
|
4030
4335
|
const i = t.marks.link.create({
|
|
4031
4336
|
href: e.href
|
|
4032
4337
|
});
|
|
4033
|
-
return
|
|
4338
|
+
return ve(e.content, t, o).map(
|
|
4034
4339
|
(n) => {
|
|
4035
4340
|
if (n.type.name === "text")
|
|
4036
4341
|
return n.mark([...n.marks, i]);
|
|
@@ -4040,29 +4345,29 @@ function No(e, t, o) {
|
|
|
4040
4345
|
}
|
|
4041
4346
|
);
|
|
4042
4347
|
}
|
|
4043
|
-
function
|
|
4348
|
+
function ve(e, t, o) {
|
|
4044
4349
|
const i = [];
|
|
4045
4350
|
if (typeof e == "string")
|
|
4046
4351
|
return i.push(
|
|
4047
|
-
...
|
|
4352
|
+
...ze(
|
|
4048
4353
|
{ type: "text", text: e, styles: {} },
|
|
4049
4354
|
t,
|
|
4050
4355
|
o
|
|
4051
4356
|
)
|
|
4052
4357
|
), i;
|
|
4053
4358
|
for (const n of e)
|
|
4054
|
-
i.push(...
|
|
4359
|
+
i.push(...ze(n, t, o));
|
|
4055
4360
|
return i;
|
|
4056
4361
|
}
|
|
4057
4362
|
function W(e, t, o) {
|
|
4058
4363
|
const i = [];
|
|
4059
4364
|
for (const n of e)
|
|
4060
|
-
typeof n == "string" ? i.push(...
|
|
4061
|
-
|
|
4365
|
+
typeof n == "string" ? i.push(...ve(n, t, o)) : ot(n) ? i.push(...No(n, t, o)) : te(n) ? i.push(...ve([n], t, o)) : i.push(
|
|
4366
|
+
nt(n, t, o)
|
|
4062
4367
|
);
|
|
4063
4368
|
return i;
|
|
4064
4369
|
}
|
|
4065
|
-
function
|
|
4370
|
+
function it(e, t, o) {
|
|
4066
4371
|
const i = [];
|
|
4067
4372
|
for (const n of e.rows) {
|
|
4068
4373
|
const r = [];
|
|
@@ -4084,7 +4389,7 @@ function ot(e, t, o) {
|
|
|
4084
4389
|
}
|
|
4085
4390
|
return i;
|
|
4086
4391
|
}
|
|
4087
|
-
function
|
|
4392
|
+
function nt(e, t, o) {
|
|
4088
4393
|
let i, n = e.type;
|
|
4089
4394
|
if (n === void 0 && (n = "paragraph"), !t.nodes[n])
|
|
4090
4395
|
throw new Error(`node type ${n} not found in schema`);
|
|
@@ -4097,7 +4402,7 @@ function it(e, t, o) {
|
|
|
4097
4402
|
const r = W(e.content, t, o);
|
|
4098
4403
|
i = t.nodes[n].create(e.props, r);
|
|
4099
4404
|
} else if (e.content.type === "tableContent") {
|
|
4100
|
-
const r =
|
|
4405
|
+
const r = it(e.content, t, o);
|
|
4101
4406
|
i = t.nodes[n].create(e.props, r);
|
|
4102
4407
|
} else
|
|
4103
4408
|
throw new I(e.content.type);
|
|
@@ -4106,7 +4411,7 @@ function it(e, t, o) {
|
|
|
4106
4411
|
function P(e, t, o) {
|
|
4107
4412
|
let i = e.id;
|
|
4108
4413
|
i === void 0 && (i = oe.options.generateID());
|
|
4109
|
-
const n =
|
|
4414
|
+
const n = nt(
|
|
4110
4415
|
e,
|
|
4111
4416
|
t,
|
|
4112
4417
|
o
|
|
@@ -4134,7 +4439,7 @@ function Po(e, t, o) {
|
|
|
4134
4439
|
};
|
|
4135
4440
|
n.content.forEach((a) => {
|
|
4136
4441
|
r.cells.push(
|
|
4137
|
-
|
|
4442
|
+
Se(
|
|
4138
4443
|
a.firstChild,
|
|
4139
4444
|
t,
|
|
4140
4445
|
o
|
|
@@ -4143,7 +4448,7 @@ function Po(e, t, o) {
|
|
|
4143
4448
|
}), i.rows.push(r);
|
|
4144
4449
|
}), i;
|
|
4145
4450
|
}
|
|
4146
|
-
function
|
|
4451
|
+
function Se(e, t, o) {
|
|
4147
4452
|
const i = [];
|
|
4148
4453
|
let n;
|
|
4149
4454
|
return e.content.forEach((r) => {
|
|
@@ -4152,7 +4457,7 @@ function Ce(e, t, o) {
|
|
|
4152
4457
|
if (te(n))
|
|
4153
4458
|
n.text += `
|
|
4154
4459
|
`;
|
|
4155
|
-
else if (
|
|
4460
|
+
else if (Ve(n))
|
|
4156
4461
|
n.content[n.content.length - 1].text += `
|
|
4157
4462
|
`;
|
|
4158
4463
|
else
|
|
@@ -4168,7 +4473,7 @@ function Ce(e, t, o) {
|
|
|
4168
4473
|
}
|
|
4169
4474
|
if (r.type.name !== "link" && r.type.name !== "text" && t[r.type.name]) {
|
|
4170
4475
|
n && (i.push(n), n = void 0), i.push(
|
|
4171
|
-
|
|
4476
|
+
rt(r, t, o)
|
|
4172
4477
|
);
|
|
4173
4478
|
return;
|
|
4174
4479
|
}
|
|
@@ -4202,7 +4507,7 @@ function Ce(e, t, o) {
|
|
|
4202
4507
|
type: "text",
|
|
4203
4508
|
text: r.textContent,
|
|
4204
4509
|
styles: a
|
|
4205
|
-
}) :
|
|
4510
|
+
}) : Ve(n) && (s ? n.href === s.attrs.href ? JSON.stringify(
|
|
4206
4511
|
n.content[n.content.length - 1].styles
|
|
4207
4512
|
) === JSON.stringify(a) ? n.content[n.content.length - 1].text += r.textContent : n.content.push({
|
|
4208
4513
|
type: "text",
|
|
@@ -4239,7 +4544,7 @@ function Ce(e, t, o) {
|
|
|
4239
4544
|
};
|
|
4240
4545
|
}), n && i.push(n), i;
|
|
4241
4546
|
}
|
|
4242
|
-
function
|
|
4547
|
+
function rt(e, t, o) {
|
|
4243
4548
|
if (e.type.name === "text" || e.type.name === "link")
|
|
4244
4549
|
throw new Error("unexpected");
|
|
4245
4550
|
const i = {}, n = t[e.type.name];
|
|
@@ -4250,7 +4555,7 @@ function nt(e, t, o) {
|
|
|
4250
4555
|
s in d && (i[s] = l);
|
|
4251
4556
|
}
|
|
4252
4557
|
let r;
|
|
4253
|
-
return n.content === "styled" ? r =
|
|
4558
|
+
return n.content === "styled" ? r = Se(
|
|
4254
4559
|
e,
|
|
4255
4560
|
t,
|
|
4256
4561
|
o
|
|
@@ -4268,7 +4573,7 @@ function v(e, t, o, i, n) {
|
|
|
4268
4573
|
const r = n == null ? void 0 : n.get(e);
|
|
4269
4574
|
if (r)
|
|
4270
4575
|
return r;
|
|
4271
|
-
const a =
|
|
4576
|
+
const a = tt(e);
|
|
4272
4577
|
let s = a.id;
|
|
4273
4578
|
s === null && (s = oe.options.generateID());
|
|
4274
4579
|
const l = {};
|
|
@@ -4297,7 +4602,7 @@ function v(e, t, o, i, n) {
|
|
|
4297
4602
|
);
|
|
4298
4603
|
let p;
|
|
4299
4604
|
if (d.content === "inline")
|
|
4300
|
-
p =
|
|
4605
|
+
p = Se(
|
|
4301
4606
|
a.contentNode,
|
|
4302
4607
|
o,
|
|
4303
4608
|
i
|
|
@@ -4324,10 +4629,10 @@ function v(e, t, o, i, n) {
|
|
|
4324
4629
|
function Ho(e) {
|
|
4325
4630
|
return e.document || window.document;
|
|
4326
4631
|
}
|
|
4327
|
-
const
|
|
4632
|
+
const at = (e, t, o, i, n) => {
|
|
4328
4633
|
if (!o.nodes[e.type.name])
|
|
4329
4634
|
throw new Error("Serializer is missing a node type: " + e.type.name);
|
|
4330
|
-
const { dom: r, contentDOM: a } =
|
|
4635
|
+
const { dom: r, contentDOM: a } = xe.renderSpec(
|
|
4331
4636
|
Ho(t),
|
|
4332
4637
|
o.nodes[e.type.name](e)
|
|
4333
4638
|
);
|
|
@@ -4367,7 +4672,7 @@ const rt = (e, t, o, i, n) => {
|
|
|
4367
4672
|
o.serializeFragment(e.content, t, a);
|
|
4368
4673
|
}
|
|
4369
4674
|
return r;
|
|
4370
|
-
},
|
|
4675
|
+
}, st = (e, t, o) => {
|
|
4371
4676
|
const i = t.serializeFragment(e, o), n = document.createElement("div");
|
|
4372
4677
|
return n.appendChild(i), n.innerHTML;
|
|
4373
4678
|
};
|
|
@@ -4409,10 +4714,10 @@ function Uo(e) {
|
|
|
4409
4714
|
s -= m, n -= m, r = void 0;
|
|
4410
4715
|
}
|
|
4411
4716
|
if (h) {
|
|
4412
|
-
r || (r =
|
|
4717
|
+
r || (r = we(
|
|
4413
4718
|
document.createElement(f)
|
|
4414
4719
|
));
|
|
4415
|
-
const m =
|
|
4720
|
+
const m = we(
|
|
4416
4721
|
document.createElement("li")
|
|
4417
4722
|
);
|
|
4418
4723
|
m.children.push(...u.children), p && m.children.push(...p.children), r.children.push(m);
|
|
@@ -4432,14 +4737,14 @@ function Uo(e) {
|
|
|
4432
4737
|
return o;
|
|
4433
4738
|
}
|
|
4434
4739
|
const se = (e, t) => {
|
|
4435
|
-
const o =
|
|
4436
|
-
return o.serializeNodeInner = (i, n) =>
|
|
4740
|
+
const o = xe.fromSchema(e);
|
|
4741
|
+
return o.serializeNodeInner = (i, n) => at(i, n, o, t, !0), o.exportProseMirrorFragment = (i, n) => Ee().use(Je, { fragment: !0 }).use(Uo, {
|
|
4437
4742
|
orderedListItemBlockTypes: /* @__PURE__ */ new Set(["numberedListItem"]),
|
|
4438
4743
|
unorderedListItemBlockTypes: /* @__PURE__ */ new Set([
|
|
4439
4744
|
"bulletListItem",
|
|
4440
4745
|
"checkListItem"
|
|
4441
4746
|
])
|
|
4442
|
-
}).use(
|
|
4747
|
+
}).use(Ye).processSync(st(i, o, n)).value, o.exportBlocks = (i, n) => {
|
|
4443
4748
|
const r = i.map(
|
|
4444
4749
|
(s) => P(s, e, t.schema.styleSchema)
|
|
4445
4750
|
), a = e.nodes.blockGroup.create(null, r);
|
|
@@ -4448,9 +4753,9 @@ const se = (e, t) => {
|
|
|
4448
4753
|
n
|
|
4449
4754
|
);
|
|
4450
4755
|
}, o;
|
|
4451
|
-
},
|
|
4452
|
-
const o =
|
|
4453
|
-
return o.serializeNodeInner = (i, n) =>
|
|
4756
|
+
}, Me = (e, t) => {
|
|
4757
|
+
const o = xe.fromSchema(e);
|
|
4758
|
+
return o.serializeNodeInner = (i, n) => at(i, n, o, t, !1), o.serializeProseMirrorFragment = (i, n) => st(i, o, n), o.serializeBlocks = (i, n) => {
|
|
4454
4759
|
const r = i.map(
|
|
4455
4760
|
(s) => P(s, e, t.schema.styleSchema)
|
|
4456
4761
|
), a = e.nodes.blockGroup.create(null, r);
|
|
@@ -4466,7 +4771,7 @@ function H(e, t = "Ctrl") {
|
|
|
4466
4771
|
function j(...e) {
|
|
4467
4772
|
return e.filter((t) => t).join(" ");
|
|
4468
4773
|
}
|
|
4469
|
-
const
|
|
4774
|
+
const zr = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
4470
4775
|
function V(e, t, o, i) {
|
|
4471
4776
|
const n = document.createElement("div");
|
|
4472
4777
|
n.className = j(
|
|
@@ -4512,18 +4817,18 @@ const Re = (e, t) => {
|
|
|
4512
4817
|
default: "left",
|
|
4513
4818
|
values: ["left", "center", "right", "justify"]
|
|
4514
4819
|
}
|
|
4515
|
-
},
|
|
4820
|
+
}, lt = ["backgroundColor", "textColor"];
|
|
4516
4821
|
function ae(e) {
|
|
4517
4822
|
return "data-" + e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
4518
4823
|
}
|
|
4519
|
-
function
|
|
4824
|
+
function Rr(e) {
|
|
4520
4825
|
const t = e.split("/");
|
|
4521
4826
|
return !t.length || // invalid?
|
|
4522
4827
|
t[t.length - 1] === "" ? e : t[t.length - 1];
|
|
4523
4828
|
}
|
|
4524
|
-
function
|
|
4829
|
+
function dt(e) {
|
|
4525
4830
|
const t = {};
|
|
4526
|
-
return Object.entries(e).filter(([o, i]) => !
|
|
4831
|
+
return Object.entries(e).filter(([o, i]) => !lt.includes(o)).forEach(([o, i]) => {
|
|
4527
4832
|
t[o] = {
|
|
4528
4833
|
default: i.default,
|
|
4529
4834
|
keepOnSplit: !0,
|
|
@@ -4571,7 +4876,7 @@ function fe(e, t, o, i, n = !1, r) {
|
|
|
4571
4876
|
(r == null ? void 0 : r.class) || ""
|
|
4572
4877
|
), a.setAttribute("data-content-type", t);
|
|
4573
4878
|
for (const [s, l] of Object.entries(o))
|
|
4574
|
-
!
|
|
4879
|
+
!lt.includes(s) && l !== i[s].default && a.setAttribute(ae(s), l);
|
|
4575
4880
|
return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = j(
|
|
4576
4881
|
"bn-inline-content",
|
|
4577
4882
|
e.contentDOM.className
|
|
@@ -4580,17 +4885,17 @@ function fe(e, t, o, i, n = !1, r) {
|
|
|
4580
4885
|
dom: a
|
|
4581
4886
|
};
|
|
4582
4887
|
}
|
|
4583
|
-
function
|
|
4888
|
+
function R(e) {
|
|
4584
4889
|
return $.create(e);
|
|
4585
4890
|
}
|
|
4586
|
-
function
|
|
4891
|
+
function ct(e, t) {
|
|
4587
4892
|
return {
|
|
4588
4893
|
config: e,
|
|
4589
4894
|
implementation: t
|
|
4590
4895
|
};
|
|
4591
4896
|
}
|
|
4592
4897
|
function q(e, t, o) {
|
|
4593
|
-
return
|
|
4898
|
+
return ct(
|
|
4594
4899
|
{
|
|
4595
4900
|
type: e.name,
|
|
4596
4901
|
content: e.config.content === "inline*" ? "inline" : e.config.content === "tableRow+" ? "table" : "none",
|
|
@@ -4605,7 +4910,7 @@ function q(e, t, o) {
|
|
|
4605
4910
|
}
|
|
4606
4911
|
);
|
|
4607
4912
|
}
|
|
4608
|
-
function
|
|
4913
|
+
function ut(e) {
|
|
4609
4914
|
return Object.fromEntries(
|
|
4610
4915
|
Object.entries(e).map(([t, o]) => [t, o.config])
|
|
4611
4916
|
);
|
|
@@ -4628,13 +4933,13 @@ function Vo(e, t) {
|
|
|
4628
4933
|
}), o;
|
|
4629
4934
|
}
|
|
4630
4935
|
function le(e, t) {
|
|
4631
|
-
const o =
|
|
4936
|
+
const o = R({
|
|
4632
4937
|
name: e.type,
|
|
4633
4938
|
content: e.content === "inline" ? "inline*" : "",
|
|
4634
4939
|
group: "blockContent",
|
|
4635
4940
|
selectable: !0,
|
|
4636
4941
|
addAttributes() {
|
|
4637
|
-
return
|
|
4942
|
+
return dt(e.propSchema);
|
|
4638
4943
|
},
|
|
4639
4944
|
parseHTML() {
|
|
4640
4945
|
return Vo(e, t.parse);
|
|
@@ -4668,7 +4973,7 @@ function le(e, t) {
|
|
|
4668
4973
|
throw new Error(
|
|
4669
4974
|
"Node name does not match block type. This is a bug in BlockNote."
|
|
4670
4975
|
);
|
|
4671
|
-
return
|
|
4976
|
+
return ct(e, {
|
|
4672
4977
|
node: o,
|
|
4673
4978
|
toInternalHTML: (i, n) => {
|
|
4674
4979
|
var s;
|
|
@@ -4700,10 +5005,10 @@ function le(e, t) {
|
|
|
4700
5005
|
}
|
|
4701
5006
|
});
|
|
4702
5007
|
}
|
|
4703
|
-
function
|
|
5008
|
+
function zo(e, t, o, i) {
|
|
4704
5009
|
return e.dom.setAttribute("data-inline-content-type", t), Object.entries(o).filter(([n, r]) => r !== i[n].default).map(([n, r]) => [ae(n), r]).forEach(([n, r]) => e.dom.setAttribute(n, r)), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
|
|
4705
5010
|
}
|
|
4706
|
-
function
|
|
5011
|
+
function Ro(e) {
|
|
4707
5012
|
return {
|
|
4708
5013
|
Backspace: ({ editor: t }) => {
|
|
4709
5014
|
const o = t.state.selection.$from;
|
|
@@ -4711,14 +5016,14 @@ function Oo(e) {
|
|
|
4711
5016
|
}
|
|
4712
5017
|
};
|
|
4713
5018
|
}
|
|
4714
|
-
function
|
|
5019
|
+
function Oo(e, t) {
|
|
4715
5020
|
return {
|
|
4716
5021
|
config: e,
|
|
4717
5022
|
implementation: t
|
|
4718
5023
|
};
|
|
4719
5024
|
}
|
|
4720
5025
|
function Fo(e, t) {
|
|
4721
|
-
return
|
|
5026
|
+
return Oo(
|
|
4722
5027
|
{
|
|
4723
5028
|
type: e.name,
|
|
4724
5029
|
propSchema: t,
|
|
@@ -4729,7 +5034,7 @@ function Fo(e, t) {
|
|
|
4729
5034
|
}
|
|
4730
5035
|
);
|
|
4731
5036
|
}
|
|
4732
|
-
function
|
|
5037
|
+
function pt(e) {
|
|
4733
5038
|
return Object.fromEntries(
|
|
4734
5039
|
Object.entries(e).map(([t, o]) => [t, o.config])
|
|
4735
5040
|
);
|
|
@@ -4745,7 +5050,7 @@ function Go(e) {
|
|
|
4745
5050
|
}
|
|
4746
5051
|
];
|
|
4747
5052
|
}
|
|
4748
|
-
function
|
|
5053
|
+
function Or(e, t) {
|
|
4749
5054
|
const o = $.create({
|
|
4750
5055
|
name: e.type,
|
|
4751
5056
|
inline: !0,
|
|
@@ -4754,24 +5059,24 @@ function Fr(e, t) {
|
|
|
4754
5059
|
atom: e.content === "none",
|
|
4755
5060
|
content: e.content === "styled" ? "inline*" : "",
|
|
4756
5061
|
addAttributes() {
|
|
4757
|
-
return
|
|
5062
|
+
return dt(e.propSchema);
|
|
4758
5063
|
},
|
|
4759
5064
|
addKeyboardShortcuts() {
|
|
4760
|
-
return
|
|
5065
|
+
return Ro(e);
|
|
4761
5066
|
},
|
|
4762
5067
|
parseHTML() {
|
|
4763
5068
|
return Go(e);
|
|
4764
5069
|
},
|
|
4765
5070
|
renderHTML({ node: i }) {
|
|
4766
5071
|
const n = this.options.editor, r = t.render(
|
|
4767
|
-
|
|
5072
|
+
rt(
|
|
4768
5073
|
i,
|
|
4769
5074
|
n.schema.inlineContentSchema,
|
|
4770
5075
|
n.schema.styleSchema
|
|
4771
5076
|
)
|
|
4772
5077
|
// TODO: fix cast
|
|
4773
5078
|
);
|
|
4774
|
-
return
|
|
5079
|
+
return zo(
|
|
4775
5080
|
r,
|
|
4776
5081
|
e.type,
|
|
4777
5082
|
i.attrs,
|
|
@@ -4799,14 +5104,14 @@ function Ko(e) {
|
|
|
4799
5104
|
function Wo(e, t, o, i) {
|
|
4800
5105
|
return e.dom.setAttribute("data-style-type", t), i === "string" && e.dom.setAttribute("data-value", o), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
|
|
4801
5106
|
}
|
|
4802
|
-
function
|
|
5107
|
+
function ht(e, t) {
|
|
4803
5108
|
return {
|
|
4804
5109
|
config: e,
|
|
4805
5110
|
implementation: t
|
|
4806
5111
|
};
|
|
4807
5112
|
}
|
|
4808
5113
|
function U(e, t) {
|
|
4809
|
-
return
|
|
5114
|
+
return ht(
|
|
4810
5115
|
{
|
|
4811
5116
|
type: e.name,
|
|
4812
5117
|
propSchema: t
|
|
@@ -4816,7 +5121,7 @@ function U(e, t) {
|
|
|
4816
5121
|
}
|
|
4817
5122
|
);
|
|
4818
5123
|
}
|
|
4819
|
-
function
|
|
5124
|
+
function mt(e) {
|
|
4820
5125
|
return Object.fromEntries(
|
|
4821
5126
|
Object.entries(e).map(([t, o]) => [t, o.config])
|
|
4822
5127
|
);
|
|
@@ -4832,8 +5137,8 @@ function $o(e) {
|
|
|
4832
5137
|
}
|
|
4833
5138
|
];
|
|
4834
5139
|
}
|
|
4835
|
-
function
|
|
4836
|
-
const o =
|
|
5140
|
+
function Fr(e, t) {
|
|
5141
|
+
const o = Ce.create({
|
|
4837
5142
|
name: e.type,
|
|
4838
5143
|
addAttributes() {
|
|
4839
5144
|
return Ko(e.propSchema);
|
|
@@ -4857,7 +5162,7 @@ function Gr(e, t) {
|
|
|
4857
5162
|
);
|
|
4858
5163
|
}
|
|
4859
5164
|
});
|
|
4860
|
-
return
|
|
5165
|
+
return ht(e, {
|
|
4861
5166
|
mark: o
|
|
4862
5167
|
});
|
|
4863
5168
|
}
|
|
@@ -4870,7 +5175,7 @@ const de = (e) => {
|
|
|
4870
5175
|
return i.className = "bn-file-default-preview-name", i.textContent = e.props.name || "", t.appendChild(o), t.appendChild(i), {
|
|
4871
5176
|
dom: t
|
|
4872
5177
|
};
|
|
4873
|
-
},
|
|
5178
|
+
}, z = (e, t) => {
|
|
4874
5179
|
const o = document.createElement("div");
|
|
4875
5180
|
o.className = "bn-file-and-caption-wrapper";
|
|
4876
5181
|
const i = document.createElement("p");
|
|
@@ -4924,10 +5229,10 @@ const de = (e) => {
|
|
|
4924
5229
|
return i.textContent = t, o.appendChild(e), o.appendChild(i), {
|
|
4925
5230
|
dom: o
|
|
4926
5231
|
};
|
|
4927
|
-
},
|
|
5232
|
+
}, Te = (e, t) => {
|
|
4928
5233
|
const o = document.createElement("figure"), i = document.createElement("figcaption");
|
|
4929
5234
|
return i.textContent = t, o.appendChild(e), o.appendChild(i), { dom: o };
|
|
4930
|
-
},
|
|
5235
|
+
}, ft = (e, t, o, i, n) => {
|
|
4931
5236
|
if (!e.props.previewWidth)
|
|
4932
5237
|
throw new Error("Block must have a `previewWidth` prop.");
|
|
4933
5238
|
const r = document.createElement("div");
|
|
@@ -4987,7 +5292,7 @@ const de = (e) => {
|
|
|
4987
5292
|
);
|
|
4988
5293
|
}
|
|
4989
5294
|
};
|
|
4990
|
-
},
|
|
5295
|
+
}, Fe = (e) => ({ url: e.src || void 0 }), qo = {
|
|
4991
5296
|
backgroundColor: _.backgroundColor,
|
|
4992
5297
|
// File name.
|
|
4993
5298
|
name: {
|
|
@@ -5033,26 +5338,26 @@ const de = (e) => {
|
|
|
5033
5338
|
i.className = "bn-audio", t.resolveFileUrl(e.props.url).then((r) => {
|
|
5034
5339
|
i.src = r;
|
|
5035
5340
|
}), i.controls = !0, i.contentEditable = "false", i.draggable = !1;
|
|
5036
|
-
const n =
|
|
5341
|
+
const n = z(e, i);
|
|
5037
5342
|
return o.appendChild(n.dom), {
|
|
5038
5343
|
dom: o
|
|
5039
5344
|
};
|
|
5040
5345
|
} else {
|
|
5041
5346
|
const i = de(e).dom;
|
|
5042
5347
|
return {
|
|
5043
|
-
dom:
|
|
5348
|
+
dom: z(e, i).dom
|
|
5044
5349
|
};
|
|
5045
5350
|
}
|
|
5046
5351
|
}, Jo = (e) => {
|
|
5047
5352
|
if (e.tagName === "AUDIO")
|
|
5048
|
-
return
|
|
5353
|
+
return Fe(e);
|
|
5049
5354
|
if (e.tagName === "FIGURE") {
|
|
5050
5355
|
const t = ue(e, "audio");
|
|
5051
5356
|
if (!t)
|
|
5052
5357
|
return;
|
|
5053
5358
|
const { targetElement: o, caption: i } = t;
|
|
5054
5359
|
return {
|
|
5055
|
-
...
|
|
5360
|
+
...Fe(o),
|
|
5056
5361
|
caption: i
|
|
5057
5362
|
};
|
|
5058
5363
|
}
|
|
@@ -5064,7 +5369,7 @@ const de = (e) => {
|
|
|
5064
5369
|
};
|
|
5065
5370
|
}
|
|
5066
5371
|
let t;
|
|
5067
|
-
return e.props.showPreview ? (t = document.createElement("audio"), t.src = e.props.url) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ?
|
|
5372
|
+
return e.props.showPreview ? (t = document.createElement("audio"), t.src = e.props.url) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Te(t, e.props.caption) : pe(t, e.props.caption) : {
|
|
5068
5373
|
dom: t
|
|
5069
5374
|
};
|
|
5070
5375
|
}, Qo = le(Xo, {
|
|
@@ -5099,7 +5404,7 @@ const de = (e) => {
|
|
|
5099
5404
|
destroy: i.destroy
|
|
5100
5405
|
};
|
|
5101
5406
|
} else {
|
|
5102
|
-
const i = de(e).dom, n =
|
|
5407
|
+
const i = de(e).dom, n = z(e, i);
|
|
5103
5408
|
return o.appendChild(n.dom), {
|
|
5104
5409
|
dom: o
|
|
5105
5410
|
};
|
|
@@ -5132,7 +5437,7 @@ const de = (e) => {
|
|
|
5132
5437
|
render: oi,
|
|
5133
5438
|
parse: ii,
|
|
5134
5439
|
toExternalHTML: ni
|
|
5135
|
-
}),
|
|
5440
|
+
}), Ge = (e) => {
|
|
5136
5441
|
const t = e.src || void 0, o = e.width || void 0;
|
|
5137
5442
|
return { url: t, previewWidth: o };
|
|
5138
5443
|
}, ai = {
|
|
@@ -5189,13 +5494,13 @@ const de = (e) => {
|
|
|
5189
5494
|
e.props.previewWidth,
|
|
5190
5495
|
t.domElement.firstElementChild.clientWidth
|
|
5191
5496
|
);
|
|
5192
|
-
const n =
|
|
5497
|
+
const n = ft(
|
|
5193
5498
|
e,
|
|
5194
5499
|
t,
|
|
5195
5500
|
i,
|
|
5196
5501
|
() => i.width,
|
|
5197
5502
|
(a) => i.width = a
|
|
5198
|
-
), r =
|
|
5503
|
+
), r = z(e, n.dom);
|
|
5199
5504
|
return o.appendChild(r.dom), {
|
|
5200
5505
|
dom: o,
|
|
5201
5506
|
destroy: n.destroy
|
|
@@ -5203,19 +5508,19 @@ const de = (e) => {
|
|
|
5203
5508
|
} else {
|
|
5204
5509
|
const i = de(e).dom;
|
|
5205
5510
|
return {
|
|
5206
|
-
dom:
|
|
5511
|
+
dom: z(e, i).dom
|
|
5207
5512
|
};
|
|
5208
5513
|
}
|
|
5209
5514
|
}, di = (e) => {
|
|
5210
5515
|
if (e.tagName === "IMG")
|
|
5211
|
-
return
|
|
5516
|
+
return Ge(e);
|
|
5212
5517
|
if (e.tagName === "FIGURE") {
|
|
5213
5518
|
const t = ue(e, "img");
|
|
5214
5519
|
if (!t)
|
|
5215
5520
|
return;
|
|
5216
5521
|
const { targetElement: o, caption: i } = t;
|
|
5217
5522
|
return {
|
|
5218
|
-
...
|
|
5523
|
+
...Ge(o),
|
|
5219
5524
|
caption: i
|
|
5220
5525
|
};
|
|
5221
5526
|
}
|
|
@@ -5227,14 +5532,14 @@ const de = (e) => {
|
|
|
5227
5532
|
};
|
|
5228
5533
|
}
|
|
5229
5534
|
let t;
|
|
5230
|
-
return e.props.showPreview ? (t = document.createElement("img"), t.src = e.props.url, t.alt = e.props.name || e.props.caption || "BlockNote image", t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ?
|
|
5535
|
+
return e.props.showPreview ? (t = document.createElement("img"), t.src = e.props.url, t.alt = e.props.name || e.props.caption || "BlockNote image", t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Te(t, e.props.caption) : pe(t, e.props.caption) : {
|
|
5231
5536
|
dom: t
|
|
5232
5537
|
};
|
|
5233
5538
|
}, ui = le(si, {
|
|
5234
5539
|
render: li,
|
|
5235
5540
|
parse: di,
|
|
5236
5541
|
toExternalHTML: ci
|
|
5237
|
-
}),
|
|
5542
|
+
}), Ke = (e) => {
|
|
5238
5543
|
const t = e.src || void 0, o = e.width || void 0;
|
|
5239
5544
|
return { url: t, previewWidth: o };
|
|
5240
5545
|
}, pi = {
|
|
@@ -5289,13 +5594,13 @@ const de = (e) => {
|
|
|
5289
5594
|
e.props.previewWidth,
|
|
5290
5595
|
t.domElement.firstElementChild.clientWidth
|
|
5291
5596
|
);
|
|
5292
|
-
const n =
|
|
5597
|
+
const n = ft(
|
|
5293
5598
|
e,
|
|
5294
5599
|
t,
|
|
5295
5600
|
i,
|
|
5296
5601
|
() => i.width,
|
|
5297
5602
|
(a) => i.width = a
|
|
5298
|
-
), r =
|
|
5603
|
+
), r = z(e, n.dom);
|
|
5299
5604
|
return o.appendChild(r.dom), {
|
|
5300
5605
|
dom: o,
|
|
5301
5606
|
destroy: n.destroy
|
|
@@ -5303,19 +5608,19 @@ const de = (e) => {
|
|
|
5303
5608
|
} else {
|
|
5304
5609
|
const i = de(e).dom;
|
|
5305
5610
|
return {
|
|
5306
|
-
dom:
|
|
5611
|
+
dom: z(e, i).dom
|
|
5307
5612
|
};
|
|
5308
5613
|
}
|
|
5309
5614
|
}, fi = (e) => {
|
|
5310
5615
|
if (e.tagName === "VIDEO")
|
|
5311
|
-
return
|
|
5616
|
+
return Ke(e);
|
|
5312
5617
|
if (e.tagName === "FIGURE") {
|
|
5313
5618
|
const t = ue(e, "video");
|
|
5314
5619
|
if (!t)
|
|
5315
5620
|
return;
|
|
5316
5621
|
const { targetElement: o, caption: i } = t;
|
|
5317
5622
|
return {
|
|
5318
|
-
...
|
|
5623
|
+
...Ke(o),
|
|
5319
5624
|
caption: i
|
|
5320
5625
|
};
|
|
5321
5626
|
}
|
|
@@ -5327,14 +5632,14 @@ const de = (e) => {
|
|
|
5327
5632
|
};
|
|
5328
5633
|
}
|
|
5329
5634
|
let t;
|
|
5330
|
-
return e.props.showPreview ? (t = document.createElement("video"), t.src = e.props.url, t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ?
|
|
5635
|
+
return e.props.showPreview ? (t = document.createElement("video"), t.src = e.props.url, t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Te(t, e.props.caption) : pe(t, e.props.caption) : {
|
|
5331
5636
|
dom: t
|
|
5332
5637
|
};
|
|
5333
5638
|
}, bi = le(hi, {
|
|
5334
5639
|
render: mi,
|
|
5335
5640
|
parse: fi,
|
|
5336
5641
|
toExternalHTML: gi
|
|
5337
|
-
}),
|
|
5642
|
+
}), Gr = async (e) => {
|
|
5338
5643
|
const t = new FormData();
|
|
5339
5644
|
return t.append("file", e), (await (await fetch("https://tmpfiles.org/api/v1/upload", {
|
|
5340
5645
|
method: "POST",
|
|
@@ -5343,7 +5648,7 @@ const de = (e) => {
|
|
|
5343
5648
|
"tmpfiles.org/",
|
|
5344
5649
|
"tmpfiles.org/dl/"
|
|
5345
5650
|
);
|
|
5346
|
-
}, ki =
|
|
5651
|
+
}, ki = Ce.create({
|
|
5347
5652
|
name: "backgroundColor",
|
|
5348
5653
|
addAttributes() {
|
|
5349
5654
|
return {
|
|
@@ -5372,7 +5677,7 @@ const de = (e) => {
|
|
|
5372
5677
|
}), _i = U(
|
|
5373
5678
|
ki,
|
|
5374
5679
|
"string"
|
|
5375
|
-
), yi =
|
|
5680
|
+
), yi = Ce.create({
|
|
5376
5681
|
name: "textColor",
|
|
5377
5682
|
addAttributes() {
|
|
5378
5683
|
return {
|
|
@@ -5405,7 +5710,7 @@ const de = (e) => {
|
|
|
5405
5710
|
}, vi = {
|
|
5406
5711
|
..._,
|
|
5407
5712
|
level: { default: 1, values: [1, 2, 3] }
|
|
5408
|
-
}, xi =
|
|
5713
|
+
}, xi = R({
|
|
5409
5714
|
name: "heading",
|
|
5410
5715
|
content: "inline*",
|
|
5411
5716
|
group: "blockContent",
|
|
@@ -5511,7 +5816,7 @@ const de = (e) => {
|
|
|
5511
5816
|
}), Ei = q(
|
|
5512
5817
|
xi,
|
|
5513
5818
|
vi
|
|
5514
|
-
),
|
|
5819
|
+
), Be = (e) => {
|
|
5515
5820
|
const { contentNode: t, contentType: o } = k(
|
|
5516
5821
|
e.state.doc,
|
|
5517
5822
|
e.state.selection.from
|
|
@@ -5532,7 +5837,7 @@ const de = (e) => {
|
|
|
5532
5837
|
]);
|
|
5533
5838
|
}, Ci = {
|
|
5534
5839
|
..._
|
|
5535
|
-
}, Si =
|
|
5840
|
+
}, Si = R({
|
|
5536
5841
|
name: "bulletListItem",
|
|
5537
5842
|
content: "inline*",
|
|
5538
5843
|
group: "blockContent",
|
|
@@ -5555,7 +5860,7 @@ const de = (e) => {
|
|
|
5555
5860
|
},
|
|
5556
5861
|
addKeyboardShortcuts() {
|
|
5557
5862
|
return {
|
|
5558
|
-
Enter: () =>
|
|
5863
|
+
Enter: () => Be(this.editor),
|
|
5559
5864
|
"Mod-Shift-8": () => C(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
|
|
5560
5865
|
this.editor.state.selection.anchor,
|
|
5561
5866
|
{
|
|
@@ -5646,7 +5951,7 @@ const de = (e) => {
|
|
|
5646
5951
|
}
|
|
5647
5952
|
}), Li = {
|
|
5648
5953
|
..._
|
|
5649
|
-
}, Ii =
|
|
5954
|
+
}, Ii = R({
|
|
5650
5955
|
name: "numberedListItem",
|
|
5651
5956
|
content: "inline*",
|
|
5652
5957
|
group: "blockContent",
|
|
@@ -5678,7 +5983,7 @@ const de = (e) => {
|
|
|
5678
5983
|
},
|
|
5679
5984
|
addKeyboardShortcuts() {
|
|
5680
5985
|
return {
|
|
5681
|
-
Enter: () =>
|
|
5986
|
+
Enter: () => Be(this.editor),
|
|
5682
5987
|
"Mod-Shift-7": () => C(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
|
|
5683
5988
|
this.editor.state.selection.anchor,
|
|
5684
5989
|
{
|
|
@@ -5747,7 +6052,7 @@ const de = (e) => {
|
|
|
5747
6052
|
checked: {
|
|
5748
6053
|
default: !1
|
|
5749
6054
|
}
|
|
5750
|
-
}, Pi =
|
|
6055
|
+
}, Pi = R({
|
|
5751
6056
|
name: "checkListItem",
|
|
5752
6057
|
content: "inline*",
|
|
5753
6058
|
group: "blockContent",
|
|
@@ -5792,7 +6097,7 @@ const de = (e) => {
|
|
|
5792
6097
|
},
|
|
5793
6098
|
addKeyboardShortcuts() {
|
|
5794
6099
|
return {
|
|
5795
|
-
Enter: () =>
|
|
6100
|
+
Enter: () => Be(this.editor),
|
|
5796
6101
|
"Mod-Shift-9": () => C(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
|
|
5797
6102
|
this.editor.state.selection.anchor,
|
|
5798
6103
|
{
|
|
@@ -5904,7 +6209,7 @@ const de = (e) => {
|
|
|
5904
6209
|
Ni
|
|
5905
6210
|
), Ui = {
|
|
5906
6211
|
..._
|
|
5907
|
-
}, Di =
|
|
6212
|
+
}, Di = R({
|
|
5908
6213
|
name: "paragraph",
|
|
5909
6214
|
content: "inline*",
|
|
5910
6215
|
group: "blockContent",
|
|
@@ -5951,10 +6256,10 @@ const de = (e) => {
|
|
|
5951
6256
|
), Vi = M.create({
|
|
5952
6257
|
name: "BlockNoteTableExtension",
|
|
5953
6258
|
addProseMirrorPlugins: () => [
|
|
5954
|
-
|
|
6259
|
+
oo({
|
|
5955
6260
|
cellMinWidth: 100
|
|
5956
6261
|
}),
|
|
5957
|
-
|
|
6262
|
+
io()
|
|
5958
6263
|
],
|
|
5959
6264
|
addKeyboardShortcuts() {
|
|
5960
6265
|
return {
|
|
@@ -5975,14 +6280,14 @@ const de = (e) => {
|
|
|
5975
6280
|
storage: e.storage
|
|
5976
6281
|
};
|
|
5977
6282
|
return {
|
|
5978
|
-
tableRole:
|
|
5979
|
-
|
|
6283
|
+
tableRole: Ut(
|
|
6284
|
+
Dt(e, "tableRole", t)
|
|
5980
6285
|
)
|
|
5981
6286
|
};
|
|
5982
6287
|
}
|
|
5983
|
-
}),
|
|
6288
|
+
}), zi = {
|
|
5984
6289
|
..._
|
|
5985
|
-
},
|
|
6290
|
+
}, Ri = R({
|
|
5986
6291
|
name: "table",
|
|
5987
6292
|
content: "tableRow+",
|
|
5988
6293
|
group: "blockContent",
|
|
@@ -6003,7 +6308,7 @@ const de = (e) => {
|
|
|
6003
6308
|
((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
|
|
6004
6309
|
);
|
|
6005
6310
|
}
|
|
6006
|
-
}),
|
|
6311
|
+
}), Oi = $.create({
|
|
6007
6312
|
name: "tableParagraph",
|
|
6008
6313
|
group: "tableContent",
|
|
6009
6314
|
content: "inline*",
|
|
@@ -6024,25 +6329,25 @@ const de = (e) => {
|
|
|
6024
6329
|
renderHTML({ HTMLAttributes: e }) {
|
|
6025
6330
|
return [
|
|
6026
6331
|
"p",
|
|
6027
|
-
|
|
6332
|
+
jt(this.options.HTMLAttributes, e),
|
|
6028
6333
|
0
|
|
6029
6334
|
];
|
|
6030
6335
|
}
|
|
6031
6336
|
}), Fi = q(
|
|
6032
|
-
Oi,
|
|
6033
6337
|
Ri,
|
|
6338
|
+
zi,
|
|
6034
6339
|
[
|
|
6035
6340
|
Vi,
|
|
6036
|
-
|
|
6037
|
-
|
|
6341
|
+
Oi,
|
|
6342
|
+
eo.extend({
|
|
6038
6343
|
content: "tableContent"
|
|
6039
6344
|
}),
|
|
6040
|
-
|
|
6345
|
+
Qt.extend({
|
|
6041
6346
|
content: "tableContent"
|
|
6042
6347
|
}),
|
|
6043
|
-
|
|
6348
|
+
to
|
|
6044
6349
|
]
|
|
6045
|
-
),
|
|
6350
|
+
), gt = {
|
|
6046
6351
|
paragraph: ji,
|
|
6047
6352
|
heading: Ei,
|
|
6048
6353
|
bulletListItem: Mi,
|
|
@@ -6053,19 +6358,19 @@ const de = (e) => {
|
|
|
6053
6358
|
image: ui,
|
|
6054
6359
|
video: bi,
|
|
6055
6360
|
audio: Qo
|
|
6056
|
-
}, Gi =
|
|
6057
|
-
bold: U(
|
|
6058
|
-
italic: U(
|
|
6059
|
-
underline: U(
|
|
6060
|
-
strike: U(
|
|
6061
|
-
code: U(
|
|
6361
|
+
}, Gi = ut(gt), bt = {
|
|
6362
|
+
bold: U(qt, "boolean"),
|
|
6363
|
+
italic: U(Zt, "boolean"),
|
|
6364
|
+
underline: U(Yt, "boolean"),
|
|
6365
|
+
strike: U(Jt, "boolean"),
|
|
6366
|
+
code: U(Xt, "boolean"),
|
|
6062
6367
|
textColor: wi,
|
|
6063
6368
|
backgroundColor: _i
|
|
6064
|
-
},
|
|
6369
|
+
}, Kr = mt(bt), kt = {
|
|
6065
6370
|
text: { config: "text", implementation: {} },
|
|
6066
6371
|
link: { config: "link", implementation: {} }
|
|
6067
|
-
}, Ki =
|
|
6068
|
-
|
|
6372
|
+
}, Ki = pt(
|
|
6373
|
+
kt
|
|
6069
6374
|
);
|
|
6070
6375
|
function E(e, t) {
|
|
6071
6376
|
return e in t.schema.blockSchema && t.schema.blockSchema[e] === Gi[e];
|
|
@@ -6076,22 +6381,22 @@ function Wi(e, t) {
|
|
|
6076
6381
|
function $i(e, t, o) {
|
|
6077
6382
|
return t.type === e && t.type in o.schema.blockSchema && E(t.type, o);
|
|
6078
6383
|
}
|
|
6079
|
-
function
|
|
6384
|
+
function Wr(e, t) {
|
|
6080
6385
|
return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock || !1;
|
|
6081
6386
|
}
|
|
6082
|
-
function
|
|
6387
|
+
function $r(e, t) {
|
|
6083
6388
|
return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock && "showPreview" in t.schema.blockSchema[e.type].propSchema || !1;
|
|
6084
6389
|
}
|
|
6085
|
-
function
|
|
6390
|
+
function qr(e, t) {
|
|
6086
6391
|
return t.schema.blockSchema[e.type].isFileBlock && !e.props.url;
|
|
6087
6392
|
}
|
|
6088
6393
|
function qi(e, t, o) {
|
|
6089
6394
|
return t in o.schema.blockSchema && e in o.schema.blockSchema[t].propSchema && o.schema.blockSchema[t].propSchema[e] === _[e];
|
|
6090
6395
|
}
|
|
6091
|
-
function
|
|
6396
|
+
function Xr(e, t, o) {
|
|
6092
6397
|
return qi(e, t.type, o);
|
|
6093
6398
|
}
|
|
6094
|
-
function
|
|
6399
|
+
function Le(e, t) {
|
|
6095
6400
|
let o, i;
|
|
6096
6401
|
if (t.firstChild.descendants((n, r) => o ? !1 : n.type.name !== "blockContainer" || n.attrs.id !== e ? !0 : (o = n, i = r + 1, !1)), o === void 0 || i === void 0)
|
|
6097
6402
|
throw Error("Could not find block in the editor with matching ID.");
|
|
@@ -6106,7 +6411,7 @@ function Xi(e, t, o = "before", i) {
|
|
|
6106
6411
|
r.push(
|
|
6107
6412
|
P(d, i.pmSchema, i.schema.styleSchema)
|
|
6108
6413
|
);
|
|
6109
|
-
const { node: a, posBeforeNode: s } =
|
|
6414
|
+
const { node: a, posBeforeNode: s } = Le(
|
|
6110
6415
|
n,
|
|
6111
6416
|
i._tiptapEditor.state.doc
|
|
6112
6417
|
);
|
|
@@ -6140,7 +6445,7 @@ function Xi(e, t, o = "before", i) {
|
|
|
6140
6445
|
return l;
|
|
6141
6446
|
}
|
|
6142
6447
|
function Zi(e, t, o) {
|
|
6143
|
-
const i = o._tiptapEditor, n = typeof e == "string" ? e : e.id, { posBeforeNode: r } =
|
|
6448
|
+
const i = o._tiptapEditor, n = typeof e == "string" ? e : e.id, { posBeforeNode: r } = Le(n, i.state.doc);
|
|
6144
6449
|
i.commands.BNUpdateBlock(r + 1, t);
|
|
6145
6450
|
const a = i.state.doc.resolve(r + 1).node();
|
|
6146
6451
|
return v(
|
|
@@ -6151,7 +6456,7 @@ function Zi(e, t, o) {
|
|
|
6151
6456
|
o.blockCache
|
|
6152
6457
|
);
|
|
6153
6458
|
}
|
|
6154
|
-
function
|
|
6459
|
+
function _t(e, t, o) {
|
|
6155
6460
|
const i = t._tiptapEditor, n = i.state.tr, r = new Set(
|
|
6156
6461
|
e.map(
|
|
6157
6462
|
(l) => typeof l == "string" ? l : l.id
|
|
@@ -6186,7 +6491,7 @@ function kt(e, t, o) {
|
|
|
6186
6491
|
return t.dispatch(n), a;
|
|
6187
6492
|
}
|
|
6188
6493
|
function Ji(e, t) {
|
|
6189
|
-
return
|
|
6494
|
+
return _t(e, t);
|
|
6190
6495
|
}
|
|
6191
6496
|
function Yi(e, t, o) {
|
|
6192
6497
|
const i = [];
|
|
@@ -6194,7 +6499,7 @@ function Yi(e, t, o) {
|
|
|
6194
6499
|
i.push(
|
|
6195
6500
|
P(s, o.pmSchema, o.schema.styleSchema)
|
|
6196
6501
|
);
|
|
6197
|
-
const n = typeof e[0] == "string" ? e[0] : e[0].id, r =
|
|
6502
|
+
const n = typeof e[0] == "string" ? e[0] : e[0].id, r = _t(
|
|
6198
6503
|
e,
|
|
6199
6504
|
o,
|
|
6200
6505
|
(s, l, d, u) => {
|
|
@@ -6228,7 +6533,7 @@ function Qi(e, t, o, i = { updateSelection: !0 }) {
|
|
|
6228
6533
|
const { parent: u } = n.doc.resolve(r);
|
|
6229
6534
|
u.isTextblock && !u.type.spec.code && !u.childCount && (r -= 1, a += 1);
|
|
6230
6535
|
}
|
|
6231
|
-
return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), i.updateSelection &&
|
|
6536
|
+
return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), i.updateSelection && Vt(n, n.steps.length - 1, -1), o.dispatch(n), !0;
|
|
6232
6537
|
}
|
|
6233
6538
|
function en() {
|
|
6234
6539
|
const e = (t) => {
|
|
@@ -6255,18 +6560,18 @@ function tn() {
|
|
|
6255
6560
|
n.type === "element" && n.tagName === "input" && ((o = n.properties) == null ? void 0 : o.type) === "checkbox" && (r == null ? void 0 : r.type) === "element" && r.tagName === "p" ? (r.tagName = "span", r.children.splice(
|
|
6256
6561
|
0,
|
|
6257
6562
|
0,
|
|
6258
|
-
|
|
6563
|
+
we(document.createTextNode(" "))
|
|
6259
6564
|
)) : e(n);
|
|
6260
6565
|
}
|
|
6261
6566
|
};
|
|
6262
6567
|
return e;
|
|
6263
6568
|
}
|
|
6264
|
-
function
|
|
6265
|
-
return
|
|
6569
|
+
function Ie(e) {
|
|
6570
|
+
return Ee().use(Je, { fragment: !0 }).use(en).use(tn).use(no).use(Qe).use(ro, { handlers: { text: (o) => o.value } }).processSync(e).value;
|
|
6266
6571
|
}
|
|
6267
6572
|
function on(e, t, o, i) {
|
|
6268
6573
|
const r = se(t, o).exportBlocks(e, i);
|
|
6269
|
-
return
|
|
6574
|
+
return Ie(r);
|
|
6270
6575
|
}
|
|
6271
6576
|
function nn(e) {
|
|
6272
6577
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
@@ -6299,19 +6604,19 @@ function sn(e) {
|
|
|
6299
6604
|
n.append(i.nextElementSibling);
|
|
6300
6605
|
});
|
|
6301
6606
|
}
|
|
6302
|
-
let
|
|
6607
|
+
let We = null;
|
|
6303
6608
|
function ln() {
|
|
6304
|
-
return
|
|
6609
|
+
return We || (We = document.implementation.createHTMLDocument("title"));
|
|
6305
6610
|
}
|
|
6306
|
-
function
|
|
6611
|
+
function yt(e) {
|
|
6307
6612
|
if (typeof e == "string") {
|
|
6308
6613
|
const t = ln().createElement("div");
|
|
6309
6614
|
t.innerHTML = e, e = t;
|
|
6310
6615
|
}
|
|
6311
6616
|
return an(e), sn(e), e;
|
|
6312
6617
|
}
|
|
6313
|
-
async function
|
|
6314
|
-
const r =
|
|
6618
|
+
async function wt(e, t, o, i, n) {
|
|
6619
|
+
const r = yt(e), s = It.fromSchema(n).parse(r, {
|
|
6315
6620
|
topNode: n.nodes.blockGroup.create()
|
|
6316
6621
|
}), l = [];
|
|
6317
6622
|
for (let d = 0; d < s.childCount; d++)
|
|
@@ -6338,13 +6643,13 @@ function dn(e, t) {
|
|
|
6338
6643
|
}, e.patch(t, n), n;
|
|
6339
6644
|
}
|
|
6340
6645
|
function cn(e, t, o, i, n) {
|
|
6341
|
-
const r =
|
|
6646
|
+
const r = Ee().use(ao).use(Qe).use(so, {
|
|
6342
6647
|
handlers: {
|
|
6343
|
-
...
|
|
6648
|
+
...lo,
|
|
6344
6649
|
code: dn
|
|
6345
6650
|
}
|
|
6346
|
-
}).use(
|
|
6347
|
-
return
|
|
6651
|
+
}).use(Ye).processSync(e);
|
|
6652
|
+
return wt(
|
|
6348
6653
|
r.value,
|
|
6349
6654
|
t,
|
|
6350
6655
|
o,
|
|
@@ -6472,7 +6777,7 @@ class hn {
|
|
|
6472
6777
|
c(this, "preventHide", !1);
|
|
6473
6778
|
c(this, "preventShow", !1);
|
|
6474
6779
|
c(this, "shouldShow", ({ state: t, from: o, to: i, view: n }) => {
|
|
6475
|
-
const { doc: r, selection: a } = t, { empty: s } = a, l = !r.textBetween(o, i).length &&
|
|
6780
|
+
const { doc: r, selection: a } = t, { empty: s } = a, l = !r.textBetween(o, i).length && zt(t.selection);
|
|
6476
6781
|
return !(!n.hasFocus() || s || l);
|
|
6477
6782
|
});
|
|
6478
6783
|
c(this, "blurHandler", (t) => {
|
|
@@ -6548,7 +6853,7 @@ class hn {
|
|
|
6548
6853
|
if (a)
|
|
6549
6854
|
return a.getBoundingClientRect();
|
|
6550
6855
|
}
|
|
6551
|
-
return
|
|
6856
|
+
return ye(this.pmView, n, r);
|
|
6552
6857
|
}
|
|
6553
6858
|
}
|
|
6554
6859
|
const mn = new S(
|
|
@@ -6596,7 +6901,7 @@ class gn {
|
|
|
6596
6901
|
const o = t.target, i = this.pmView.posAtDOM(o, 0) + 1, n = this.pmView.state.doc.resolve(i), r = n.marks();
|
|
6597
6902
|
for (const a of r)
|
|
6598
6903
|
if (a.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
6599
|
-
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange =
|
|
6904
|
+
this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = De(n, a.type, a.attrs) || void 0;
|
|
6600
6905
|
break;
|
|
6601
6906
|
}
|
|
6602
6907
|
}
|
|
@@ -6612,7 +6917,7 @@ class gn {
|
|
|
6612
6917
|
});
|
|
6613
6918
|
c(this, "scrollHandler", () => {
|
|
6614
6919
|
var t;
|
|
6615
|
-
this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos =
|
|
6920
|
+
this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos = ye(
|
|
6616
6921
|
this.pmView,
|
|
6617
6922
|
this.linkMarkRange.from,
|
|
6618
6923
|
this.linkMarkRange.to
|
|
@@ -6668,7 +6973,7 @@ class gn {
|
|
|
6668
6973
|
const i = this.pmView.state.selection.$from.marks();
|
|
6669
6974
|
for (const n of i)
|
|
6670
6975
|
if (n.type.name === this.pmView.state.schema.mark("link").type.name) {
|
|
6671
|
-
this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange =
|
|
6976
|
+
this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange = De(
|
|
6672
6977
|
this.pmView.state.selection.$from,
|
|
6673
6978
|
n.type,
|
|
6674
6979
|
n.attrs
|
|
@@ -6679,7 +6984,7 @@ class gn {
|
|
|
6679
6984
|
if (this.mouseHoveredLinkMark && (this.linkMark = this.mouseHoveredLinkMark, this.linkMarkRange = this.mouseHoveredLinkMarkRange), this.keyboardHoveredLinkMark && (this.linkMark = this.keyboardHoveredLinkMark, this.linkMarkRange = this.keyboardHoveredLinkMarkRange), this.linkMark && this.editor.isEditable) {
|
|
6680
6985
|
this.state = {
|
|
6681
6986
|
show: !0,
|
|
6682
|
-
referencePos:
|
|
6987
|
+
referencePos: ye(
|
|
6683
6988
|
this.pmView,
|
|
6684
6989
|
this.linkMarkRange.from,
|
|
6685
6990
|
this.linkMarkRange.to
|
|
@@ -6762,7 +7067,7 @@ class kn extends X {
|
|
|
6762
7067
|
return ((i = (o = this.view) == null ? void 0 : o.state) == null ? void 0 : i.show) || !1;
|
|
6763
7068
|
}
|
|
6764
7069
|
}
|
|
6765
|
-
class
|
|
7070
|
+
class O extends me {
|
|
6766
7071
|
constructor(o, i) {
|
|
6767
7072
|
super(o, i);
|
|
6768
7073
|
c(this, "nodes");
|
|
@@ -6773,13 +7078,13 @@ class z extends me {
|
|
|
6773
7078
|
});
|
|
6774
7079
|
}
|
|
6775
7080
|
static create(o, i, n = i) {
|
|
6776
|
-
return new
|
|
7081
|
+
return new O(o.resolve(i), o.resolve(n));
|
|
6777
7082
|
}
|
|
6778
7083
|
content() {
|
|
6779
7084
|
return new D(L.from(this.nodes), 0, 0);
|
|
6780
7085
|
}
|
|
6781
7086
|
eq(o) {
|
|
6782
|
-
if (!(o instanceof
|
|
7087
|
+
if (!(o instanceof O) || this.nodes.length !== o.nodes.length || this.from !== o.from || this.to !== o.to)
|
|
6783
7088
|
return !1;
|
|
6784
7089
|
for (let i = 0; i < this.nodes.length; i++)
|
|
6785
7090
|
if (!this.nodes[i].eq(o.nodes[i]))
|
|
@@ -6788,7 +7093,7 @@ class z extends me {
|
|
|
6788
7093
|
}
|
|
6789
7094
|
map(o, i) {
|
|
6790
7095
|
const n = i.mapResult(this.from), r = i.mapResult(this.to);
|
|
6791
|
-
return r.deleted ? me.near(o.resolve(n.pos)) : n.deleted ? me.near(o.resolve(r.pos)) : new
|
|
7096
|
+
return r.deleted ? me.near(o.resolve(n.pos)) : n.deleted ? me.near(o.resolve(r.pos)) : new O(
|
|
6792
7097
|
o.resolve(n.pos),
|
|
6793
7098
|
o.resolve(r.pos)
|
|
6794
7099
|
);
|
|
@@ -6799,10 +7104,10 @@ class z extends me {
|
|
|
6799
7104
|
}
|
|
6800
7105
|
let B;
|
|
6801
7106
|
function he(e, t) {
|
|
6802
|
-
var o;
|
|
6803
|
-
for (; e && e.parentElement && e.parentElement !== t.dom &&
|
|
7107
|
+
var o, i;
|
|
7108
|
+
for (; e && e.parentElement && e.parentElement !== t.dom && ((o = e.getAttribute) == null ? void 0 : o.call(e, "data-node-type")) !== "blockContainer"; )
|
|
6804
7109
|
e = e.parentElement;
|
|
6805
|
-
if (e.
|
|
7110
|
+
if (((i = e.getAttribute) == null ? void 0 : i.call(e, "data-node-type")) === "blockContainer")
|
|
6806
7111
|
return { node: e, id: e.getAttribute("data-id") };
|
|
6807
7112
|
}
|
|
6808
7113
|
function _n(e, t) {
|
|
@@ -6823,7 +7128,7 @@ function yn(e, t) {
|
|
|
6823
7128
|
o = e.from, i = e.to;
|
|
6824
7129
|
return { from: o, to: i };
|
|
6825
7130
|
}
|
|
6826
|
-
function
|
|
7131
|
+
function $e(e, t, o = t) {
|
|
6827
7132
|
t === o && (o += e.state.doc.resolve(t + 1).node().nodeSize);
|
|
6828
7133
|
const i = e.domAtPos(t).node.cloneNode(!0), n = e.domAtPos(t).node, r = (u, p) => Array.prototype.indexOf.call(u.children, p), a = r(
|
|
6829
7134
|
n,
|
|
@@ -6836,13 +7141,13 @@ function We(e, t, o = t) {
|
|
|
6836
7141
|
);
|
|
6837
7142
|
for (let u = n.childElementCount - 1; u >= 0; u--)
|
|
6838
7143
|
(u > s || u < a) && i.removeChild(i.children[u]);
|
|
6839
|
-
|
|
7144
|
+
vt(e.root), B = i;
|
|
6840
7145
|
const d = e.dom.className.split(" ").filter(
|
|
6841
7146
|
(u) => u !== "ProseMirror" && u !== "bn-root" && u !== "bn-editor"
|
|
6842
7147
|
).join(" ");
|
|
6843
7148
|
B.className = B.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(B) : e.root.body.appendChild(B);
|
|
6844
7149
|
}
|
|
6845
|
-
function
|
|
7150
|
+
function vt(e) {
|
|
6846
7151
|
B !== void 0 && (e instanceof ShadowRoot ? e.removeChild(B) : e.body.removeChild(B), B = void 0);
|
|
6847
7152
|
}
|
|
6848
7153
|
function wn(e, t) {
|
|
@@ -6863,19 +7168,19 @@ function wn(e, t) {
|
|
|
6863
7168
|
return;
|
|
6864
7169
|
const s = _n(a.node, o);
|
|
6865
7170
|
if (s != null) {
|
|
6866
|
-
const l = o.state.selection, d = o.state.doc, { from: u, to: p } = yn(l, d), h = u <= s && s < p, f = l.$anchor.node() !== l.$head.node() || l instanceof
|
|
7171
|
+
const l = o.state.selection, d = o.state.doc, { from: u, to: p } = yn(l, d), h = u <= s && s < p, f = l.$anchor.node() !== l.$head.node() || l instanceof O;
|
|
6867
7172
|
h && f ? (o.dispatch(
|
|
6868
|
-
o.state.tr.setSelection(
|
|
6869
|
-
),
|
|
7173
|
+
o.state.tr.setSelection(O.create(d, u, p))
|
|
7174
|
+
), $e(o, u, p)) : (o.dispatch(
|
|
6870
7175
|
o.state.tr.setSelection(re.create(o.state.doc, s))
|
|
6871
|
-
),
|
|
6872
|
-
const m = o.state.selection.content(), g = t.pmSchema, A =
|
|
7176
|
+
), $e(o, s));
|
|
7177
|
+
const m = o.state.selection.content(), g = t.pmSchema, A = Me(g, t).serializeProseMirrorFragment(
|
|
6873
7178
|
m.content,
|
|
6874
7179
|
{}
|
|
6875
7180
|
), N = se(g, t).exportProseMirrorFragment(
|
|
6876
7181
|
m.content,
|
|
6877
7182
|
{}
|
|
6878
|
-
), Z =
|
|
7183
|
+
), Z = Ie(N);
|
|
6879
7184
|
e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", A), e.dataTransfer.setData("text/html", N), e.dataTransfer.setData("text/plain", Z), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(B, 0, 0), o.dragging = { slice: m, move: !0 };
|
|
6880
7185
|
}
|
|
6881
7186
|
}
|
|
@@ -7113,7 +7418,7 @@ class En extends X {
|
|
|
7113
7418
|
/**
|
|
7114
7419
|
* Handles drag & drop events for blocks.
|
|
7115
7420
|
*/
|
|
7116
|
-
c(this, "blockDragEnd", () =>
|
|
7421
|
+
c(this, "blockDragEnd", () => vt(this.editor.prosemirrorView.root));
|
|
7117
7422
|
/**
|
|
7118
7423
|
* Freezes the side menu. When frozen, the side menu will stay
|
|
7119
7424
|
* attached to the same block regardless of which block is hovered by the
|
|
@@ -7314,11 +7619,11 @@ class Mn extends X {
|
|
|
7314
7619
|
return ((i = (o = this.view) == null ? void 0 : o.state) == null ? void 0 : i.show) || !1;
|
|
7315
7620
|
}
|
|
7316
7621
|
}
|
|
7317
|
-
function
|
|
7622
|
+
function Zr(e, t) {
|
|
7318
7623
|
e.suggestionMenus.addTriggerCharacter(t);
|
|
7319
7624
|
}
|
|
7320
7625
|
let w;
|
|
7321
|
-
function
|
|
7626
|
+
function qe(e) {
|
|
7322
7627
|
w || (w = document.createElement("div"), w.innerHTML = "_", w.style.opacity = "0", w.style.height = "1px", w.style.width = "1px", e instanceof Document ? e.body.appendChild(w) : e.appendChild(w));
|
|
7323
7628
|
}
|
|
7324
7629
|
function Tn(e) {
|
|
@@ -7501,7 +7806,7 @@ class An extends X {
|
|
|
7501
7806
|
newIndex: this.view.state.colIndex,
|
|
7502
7807
|
tablePos: this.view.tablePos
|
|
7503
7808
|
})
|
|
7504
|
-
),
|
|
7809
|
+
), qe(this.editor._tiptapEditor.view.root), o.dataTransfer.setDragImage(w, 0, 0), o.dataTransfer.effectAllowed = "move";
|
|
7505
7810
|
});
|
|
7506
7811
|
/**
|
|
7507
7812
|
* Callback that should be set on the `dragStart` event for whichever element
|
|
@@ -7523,7 +7828,7 @@ class An extends X {
|
|
|
7523
7828
|
newIndex: this.view.state.rowIndex,
|
|
7524
7829
|
tablePos: this.view.tablePos
|
|
7525
7830
|
})
|
|
7526
|
-
),
|
|
7831
|
+
), qe(this.editor._tiptapEditor.view.root), o.dataTransfer.setDragImage(w, 0, 0), o.dataTransfer.effectAllowed = "copyMove";
|
|
7527
7832
|
});
|
|
7528
7833
|
/**
|
|
7529
7834
|
* Callback that should be set on the `dragEnd` event for both the element
|
|
@@ -7607,8 +7912,8 @@ class An extends X {
|
|
|
7607
7912
|
return this.on("update", o);
|
|
7608
7913
|
}
|
|
7609
7914
|
}
|
|
7610
|
-
function
|
|
7611
|
-
const o = e.state.selection.content().content, n =
|
|
7915
|
+
function Xe(e, t) {
|
|
7916
|
+
const o = e.state.selection.content().content, n = Me(
|
|
7612
7917
|
e.state.schema,
|
|
7613
7918
|
t
|
|
7614
7919
|
).serializeProseMirrorFragment(
|
|
@@ -7620,7 +7925,7 @@ function qe(e, t) {
|
|
|
7620
7925
|
).exportProseMirrorFragment(
|
|
7621
7926
|
o,
|
|
7622
7927
|
{}
|
|
7623
|
-
), s =
|
|
7928
|
+
), s = Ie(a);
|
|
7624
7929
|
return { internalHTML: n, externalHTML: a, plainText: s };
|
|
7625
7930
|
}
|
|
7626
7931
|
const Nn = (e) => M.create({
|
|
@@ -7638,7 +7943,7 @@ const Nn = (e) => M.create({
|
|
|
7638
7943
|
)
|
|
7639
7944
|
)
|
|
7640
7945
|
);
|
|
7641
|
-
const { internalHTML: i, externalHTML: n, plainText: r } =
|
|
7946
|
+
const { internalHTML: i, externalHTML: n, plainText: r } = Xe(t, e);
|
|
7642
7947
|
return o.clipboardData.setData("blocknote/html", i), o.clipboardData.setData("text/html", n), o.clipboardData.setData("text/plain", r), !0;
|
|
7643
7948
|
},
|
|
7644
7949
|
// This is for the use-case in which only a block without content
|
|
@@ -7654,7 +7959,7 @@ const Nn = (e) => M.create({
|
|
|
7654
7959
|
)
|
|
7655
7960
|
)
|
|
7656
7961
|
), o.preventDefault(), o.dataTransfer.clearData();
|
|
7657
|
-
const { internalHTML: i, externalHTML: n, plainText: r } =
|
|
7962
|
+
const { internalHTML: i, externalHTML: n, plainText: r } = Xe(t, e);
|
|
7658
7963
|
return o.dataTransfer.setData("blocknote/html", i), o.dataTransfer.setData("text/html", n), o.dataTransfer.setData("text/plain", r), !0;
|
|
7659
7964
|
}
|
|
7660
7965
|
}
|
|
@@ -7679,7 +7984,7 @@ function x(e, t) {
|
|
|
7679
7984
|
const i = e.getTextCursorPosition().block;
|
|
7680
7985
|
return Pn(e), i;
|
|
7681
7986
|
}
|
|
7682
|
-
function
|
|
7987
|
+
function Jr(e) {
|
|
7683
7988
|
const t = [];
|
|
7684
7989
|
return E("heading", e) && t.push(
|
|
7685
7990
|
{
|
|
@@ -7829,14 +8134,14 @@ function Yr(e) {
|
|
|
7829
8134
|
...e.dictionary.slash_menu.emoji
|
|
7830
8135
|
}), t;
|
|
7831
8136
|
}
|
|
7832
|
-
function
|
|
8137
|
+
function Yr(e, t) {
|
|
7833
8138
|
return e.filter(
|
|
7834
8139
|
({ title: o, aliases: i }) => o.toLowerCase().includes(t.toLowerCase()) || i && i.filter(
|
|
7835
8140
|
(n) => n.toLowerCase().includes(t.toLowerCase())
|
|
7836
8141
|
).length !== 0
|
|
7837
8142
|
);
|
|
7838
8143
|
}
|
|
7839
|
-
const
|
|
8144
|
+
const Ae = [
|
|
7840
8145
|
"blocknote/html",
|
|
7841
8146
|
"Files",
|
|
7842
8147
|
"text/html",
|
|
@@ -7850,14 +8155,14 @@ function Hn(e, t) {
|
|
|
7850
8155
|
throw new Error(`The string ${t} is not a valid MIME type.`);
|
|
7851
8156
|
return o[1] === "*" || i[1] === "*" ? o[0] === i[0] : (o[0] === "*" || i[0] === "*" || o[0] === i[0]) && o[1] === i[1];
|
|
7852
8157
|
}
|
|
7853
|
-
async function
|
|
8158
|
+
async function xt(e, t) {
|
|
7854
8159
|
if (!t.uploadFile)
|
|
7855
8160
|
return;
|
|
7856
8161
|
const o = "dataTransfer" in e ? e.dataTransfer : e.clipboardData;
|
|
7857
8162
|
if (o === null)
|
|
7858
8163
|
return;
|
|
7859
8164
|
let i = null;
|
|
7860
|
-
for (const a of
|
|
8165
|
+
for (const a of Ae)
|
|
7861
8166
|
if (o.types.includes(a)) {
|
|
7862
8167
|
i = a;
|
|
7863
8168
|
break;
|
|
@@ -7906,7 +8211,7 @@ const Un = (e) => M.create({
|
|
|
7906
8211
|
if (o.preventDefault(), !e.isEditable)
|
|
7907
8212
|
return;
|
|
7908
8213
|
let i = null;
|
|
7909
|
-
for (const r of
|
|
8214
|
+
for (const r of Ae)
|
|
7910
8215
|
if (o.clipboardData.types.includes(r)) {
|
|
7911
8216
|
i = r;
|
|
7912
8217
|
break;
|
|
@@ -7914,9 +8219,9 @@ const Un = (e) => M.create({
|
|
|
7914
8219
|
if (i === null)
|
|
7915
8220
|
return !0;
|
|
7916
8221
|
if (i === "Files")
|
|
7917
|
-
return
|
|
8222
|
+
return xt(o, e), !0;
|
|
7918
8223
|
let n = o.clipboardData.getData(i);
|
|
7919
|
-
return i === "text/html" && (n =
|
|
8224
|
+
return i === "text/html" && (n = yt(n.trim()).innerHTML), e._tiptapEditor.view.pasteHTML(n), !0;
|
|
7920
8225
|
}
|
|
7921
8226
|
}
|
|
7922
8227
|
}
|
|
@@ -7934,12 +8239,12 @@ const Un = (e) => M.create({
|
|
|
7934
8239
|
if (!e.isEditable)
|
|
7935
8240
|
return;
|
|
7936
8241
|
let i = null;
|
|
7937
|
-
for (const n of
|
|
8242
|
+
for (const n of Ae)
|
|
7938
8243
|
if (o.dataTransfer.types.includes(n)) {
|
|
7939
8244
|
i = n;
|
|
7940
8245
|
break;
|
|
7941
8246
|
}
|
|
7942
|
-
return i === null ? !0 : i === "Files" ? (
|
|
8247
|
+
return i === null ? !0 : i === "Files" ? (xt(o, e), !0) : !1;
|
|
7943
8248
|
}
|
|
7944
8249
|
}
|
|
7945
8250
|
}
|
|
@@ -7990,7 +8295,7 @@ const Un = (e) => M.create({
|
|
|
7990
8295
|
}
|
|
7991
8296
|
];
|
|
7992
8297
|
}
|
|
7993
|
-
}),
|
|
8298
|
+
}), zn = M.create({
|
|
7994
8299
|
name: "blockTextColor",
|
|
7995
8300
|
addGlobalAttributes() {
|
|
7996
8301
|
return [
|
|
@@ -8008,7 +8313,7 @@ const Un = (e) => M.create({
|
|
|
8008
8313
|
}
|
|
8009
8314
|
];
|
|
8010
8315
|
}
|
|
8011
|
-
}),
|
|
8316
|
+
}), Rn = M.create({
|
|
8012
8317
|
name: "trailingNode",
|
|
8013
8318
|
addProseMirrorPlugins() {
|
|
8014
8319
|
const e = new S(this.name);
|
|
@@ -8043,8 +8348,8 @@ const Un = (e) => M.create({
|
|
|
8043
8348
|
})
|
|
8044
8349
|
];
|
|
8045
8350
|
}
|
|
8046
|
-
}),
|
|
8047
|
-
key:
|
|
8351
|
+
}), On = new S("non-editable-block"), Fn = () => new y({
|
|
8352
|
+
key: On,
|
|
8048
8353
|
props: {
|
|
8049
8354
|
handleKeyDown: (e, t) => {
|
|
8050
8355
|
if ("node" in e.state.selection) {
|
|
@@ -8069,7 +8374,7 @@ const Un = (e) => M.create({
|
|
|
8069
8374
|
return !1;
|
|
8070
8375
|
}
|
|
8071
8376
|
}
|
|
8072
|
-
}),
|
|
8377
|
+
}), Ze = new S("previous-blocks"), Gn = {
|
|
8073
8378
|
// Numbered List Items
|
|
8074
8379
|
index: "index",
|
|
8075
8380
|
// Headings
|
|
@@ -8081,14 +8386,14 @@ const Un = (e) => M.create({
|
|
|
8081
8386
|
}, Kn = () => {
|
|
8082
8387
|
let e;
|
|
8083
8388
|
return new y({
|
|
8084
|
-
key:
|
|
8389
|
+
key: Ze,
|
|
8085
8390
|
view(t) {
|
|
8086
8391
|
return {
|
|
8087
8392
|
update: async (o, i) => {
|
|
8088
8393
|
var n;
|
|
8089
8394
|
((n = this.key) == null ? void 0 : n.getState(o.state).updatedBlocks.size) > 0 && (e = setTimeout(() => {
|
|
8090
8395
|
o.dispatch(
|
|
8091
|
-
o.state.tr.setMeta(
|
|
8396
|
+
o.state.tr.setMeta(Ze, { clearUpdate: !0 })
|
|
8092
8397
|
);
|
|
8093
8398
|
}, 0));
|
|
8094
8399
|
},
|
|
@@ -8111,9 +8416,9 @@ const Un = (e) => M.create({
|
|
|
8111
8416
|
apply(t, o, i, n) {
|
|
8112
8417
|
if (o.currentTransactionOldBlockAttrs = {}, o.updatedBlocks.clear(), !t.docChanged || i.doc.eq(n.doc))
|
|
8113
8418
|
return o;
|
|
8114
|
-
const r = {}, a =
|
|
8419
|
+
const r = {}, a = je(i.doc, (d) => d.attrs.id), s = new Map(
|
|
8115
8420
|
a.map((d) => [d.node.attrs.id, d])
|
|
8116
|
-
), l =
|
|
8421
|
+
), l = je(n.doc, (d) => d.attrs.id);
|
|
8117
8422
|
for (const d of l) {
|
|
8118
8423
|
const u = s.get(d.node.attrs.id), p = u == null ? void 0 : u.node.firstChild, h = d.node.firstChild;
|
|
8119
8424
|
if (u && p && h) {
|
|
@@ -8259,7 +8564,7 @@ const Un = (e) => M.create({
|
|
|
8259
8564
|
this.options.editor.schema.styleSchema
|
|
8260
8565
|
);
|
|
8261
8566
|
else if (t.content.type === "tableContent")
|
|
8262
|
-
p =
|
|
8567
|
+
p = it(
|
|
8263
8568
|
t.content,
|
|
8264
8569
|
o.schema,
|
|
8265
8570
|
this.options.editor.schema.styleSchema
|
|
@@ -8534,17 +8839,17 @@ const Un = (e) => M.create({
|
|
|
8534
8839
|
J.FocusEvents,
|
|
8535
8840
|
J.Tabindex,
|
|
8536
8841
|
// DevTools,
|
|
8537
|
-
|
|
8842
|
+
mo,
|
|
8538
8843
|
// DropCursor,
|
|
8539
8844
|
oe.configure({
|
|
8540
8845
|
types: ["blockContainer"]
|
|
8541
8846
|
}),
|
|
8542
|
-
|
|
8847
|
+
fo.extend({ priority: 10 }),
|
|
8543
8848
|
// Comments,
|
|
8544
8849
|
// basics:
|
|
8545
|
-
|
|
8850
|
+
ko,
|
|
8546
8851
|
// marks:
|
|
8547
|
-
|
|
8852
|
+
bo.extend({
|
|
8548
8853
|
addKeyboardShortcuts() {
|
|
8549
8854
|
return {
|
|
8550
8855
|
"Mod-k": () => (this.editor.commands.toggleLink({ href: "" }), !0)
|
|
@@ -8552,7 +8857,7 @@ const Un = (e) => M.create({
|
|
|
8552
8857
|
}
|
|
8553
8858
|
}),
|
|
8554
8859
|
...Object.values(e.styleSpecs).map((n) => n.implementation.mark),
|
|
8555
|
-
|
|
8860
|
+
zn,
|
|
8556
8861
|
jn,
|
|
8557
8862
|
Vn,
|
|
8558
8863
|
// make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
|
|
@@ -8593,14 +8898,14 @@ const Un = (e) => M.create({
|
|
|
8593
8898
|
Nn(e.editor),
|
|
8594
8899
|
Un(e.editor),
|
|
8595
8900
|
Dn(e.editor),
|
|
8596
|
-
|
|
8901
|
+
ho.configure({ width: 5, color: "#ddeeff" }),
|
|
8597
8902
|
// This needs to be at the bottom of this list, because Key events (such as enter, when selecting a /command),
|
|
8598
8903
|
// should be handled before Enter handlers in other components like splitListItem
|
|
8599
|
-
...e.trailingBlock === void 0 || e.trailingBlock ? [
|
|
8904
|
+
...e.trailingBlock === void 0 || e.trailingBlock ? [Rn] : []
|
|
8600
8905
|
];
|
|
8601
8906
|
if (e.collaboration) {
|
|
8602
8907
|
if (t.push(
|
|
8603
|
-
|
|
8908
|
+
uo.configure({
|
|
8604
8909
|
fragment: e.collaboration.fragment
|
|
8605
8910
|
})
|
|
8606
8911
|
), (i = e.collaboration.provider) != null && i.awareness) {
|
|
@@ -8613,7 +8918,7 @@ const Un = (e) => M.create({
|
|
|
8613
8918
|
return a.insertBefore(l, null), a.insertBefore(s, null), a.insertBefore(d, null), a;
|
|
8614
8919
|
};
|
|
8615
8920
|
t.push(
|
|
8616
|
-
|
|
8921
|
+
po.configure({
|
|
8617
8922
|
user: e.collaboration.user,
|
|
8618
8923
|
render: e.collaboration.renderCursor || n,
|
|
8619
8924
|
provider: e.collaboration.provider
|
|
@@ -8621,7 +8926,7 @@ const Un = (e) => M.create({
|
|
|
8621
8926
|
);
|
|
8622
8927
|
}
|
|
8623
8928
|
} else
|
|
8624
|
-
t.push(
|
|
8929
|
+
t.push(go);
|
|
8625
8930
|
const o = e.disableExtensions || [];
|
|
8626
8931
|
return t.filter((n) => !o.includes(n.name));
|
|
8627
8932
|
};
|
|
@@ -8653,7 +8958,7 @@ function be(e) {
|
|
|
8653
8958
|
Object.entries(e).filter(([, t]) => t !== void 0)
|
|
8654
8959
|
);
|
|
8655
8960
|
}
|
|
8656
|
-
class
|
|
8961
|
+
class Ne {
|
|
8657
8962
|
constructor(t) {
|
|
8658
8963
|
c(this, "blockSpecs");
|
|
8659
8964
|
c(this, "inlineContentSpecs");
|
|
@@ -8665,15 +8970,15 @@ class Ae {
|
|
|
8665
8970
|
c(this, "BlockNoteEditor", "only for types");
|
|
8666
8971
|
c(this, "Block", "only for types");
|
|
8667
8972
|
c(this, "PartialBlock", "only for types");
|
|
8668
|
-
this.blockSpecs = be(t == null ? void 0 : t.blockSpecs) ||
|
|
8973
|
+
this.blockSpecs = be(t == null ? void 0 : t.blockSpecs) || gt, this.inlineContentSpecs = be(t == null ? void 0 : t.inlineContentSpecs) || kt, this.styleSpecs = be(t == null ? void 0 : t.styleSpecs) || bt, this.blockSchema = ut(this.blockSpecs), this.inlineContentSchema = pt(
|
|
8669
8974
|
this.inlineContentSpecs
|
|
8670
|
-
), this.styleSchema =
|
|
8975
|
+
), this.styleSchema = mt(this.styleSpecs);
|
|
8671
8976
|
}
|
|
8672
8977
|
static create(t) {
|
|
8673
|
-
return new
|
|
8978
|
+
return new Ne(t);
|
|
8674
8979
|
}
|
|
8675
8980
|
}
|
|
8676
|
-
class
|
|
8981
|
+
class Et extends Ft {
|
|
8677
8982
|
constructor(o, i) {
|
|
8678
8983
|
super({ ...o, content: void 0 });
|
|
8679
8984
|
c(this, "_state");
|
|
@@ -8692,14 +8997,14 @@ class xt extends zt {
|
|
|
8692
8997
|
if (r)
|
|
8693
8998
|
return r;
|
|
8694
8999
|
const d = a.apply(n.nodes.doc, l), u = JSON.parse(JSON.stringify(d.toJSON()));
|
|
8695
|
-
return u.content[0].content[0].attrs.id = "initialBlockId", r =
|
|
9000
|
+
return u.content[0].content[0].attrs.id = "initialBlockId", r = At.fromJSON(n, u), r;
|
|
8696
9001
|
};
|
|
8697
9002
|
let s;
|
|
8698
9003
|
try {
|
|
8699
9004
|
const l = o == null ? void 0 : o.content.map(
|
|
8700
9005
|
(d) => P(d, this.schema, i).toJSON()
|
|
8701
9006
|
);
|
|
8702
|
-
s =
|
|
9007
|
+
s = Gt(
|
|
8703
9008
|
{
|
|
8704
9009
|
type: "doc",
|
|
8705
9010
|
content: [
|
|
@@ -8720,7 +9025,7 @@ class xt extends zt {
|
|
|
8720
9025
|
"Error creating document from blocks passed as `initialContent`:\n" + +JSON.stringify(o.content)
|
|
8721
9026
|
);
|
|
8722
9027
|
}
|
|
8723
|
-
this._state =
|
|
9028
|
+
this._state = Wt.create({
|
|
8724
9029
|
doc: s,
|
|
8725
9030
|
schema: this.schema
|
|
8726
9031
|
// selection: selection || undefined,
|
|
@@ -8737,7 +9042,7 @@ class xt extends zt {
|
|
|
8737
9042
|
*/
|
|
8738
9043
|
createViewAlternative() {
|
|
8739
9044
|
queueMicrotask(() => {
|
|
8740
|
-
this.view = new
|
|
9045
|
+
this.view = new co(
|
|
8741
9046
|
{ mount: this.options.element },
|
|
8742
9047
|
// use mount option so that we reuse the existing element instead of creating a new one
|
|
8743
9048
|
{
|
|
@@ -8754,7 +9059,7 @@ class xt extends zt {
|
|
|
8754
9059
|
});
|
|
8755
9060
|
}
|
|
8756
9061
|
}
|
|
8757
|
-
|
|
9062
|
+
Et.prototype.createView = () => {
|
|
8758
9063
|
};
|
|
8759
9064
|
const Qn = new S("blocknote-placeholder"), er = (e, t) => new y({
|
|
8760
9065
|
key: Qn,
|
|
@@ -8806,7 +9111,7 @@ const Qn = new S("blocknote-placeholder"), er = (e, t) => new y({
|
|
|
8806
9111
|
enablePasteRules: !0,
|
|
8807
9112
|
enableCoreExtensions: !1
|
|
8808
9113
|
};
|
|
8809
|
-
class
|
|
9114
|
+
class Ct {
|
|
8810
9115
|
constructor(t) {
|
|
8811
9116
|
c(this, "_pmSchema");
|
|
8812
9117
|
/**
|
|
@@ -8885,10 +9190,10 @@ class Et {
|
|
|
8885
9190
|
throw new Error(
|
|
8886
9191
|
"editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false"
|
|
8887
9192
|
);
|
|
8888
|
-
this.dictionary = t.dictionary ||
|
|
9193
|
+
this.dictionary = t.dictionary || et;
|
|
8889
9194
|
const i = {
|
|
8890
9195
|
defaultStyles: !0,
|
|
8891
|
-
schema: t.schema ||
|
|
9196
|
+
schema: t.schema || Ne.create(),
|
|
8892
9197
|
_headless: !1,
|
|
8893
9198
|
...t,
|
|
8894
9199
|
placeholders: {
|
|
@@ -8958,7 +9263,7 @@ class Et {
|
|
|
8958
9263
|
transformPasted: Yn
|
|
8959
9264
|
}
|
|
8960
9265
|
};
|
|
8961
|
-
this.headless ? this._pmSchema =
|
|
9266
|
+
this.headless ? this._pmSchema = Kt(s.extensions) : (this._tiptapEditor = new Et(
|
|
8962
9267
|
s,
|
|
8963
9268
|
this.schema.styleSchema
|
|
8964
9269
|
), this._pmSchema = this._tiptapEditor.schema);
|
|
@@ -8967,7 +9272,7 @@ class Et {
|
|
|
8967
9272
|
return this._pmSchema;
|
|
8968
9273
|
}
|
|
8969
9274
|
static create(t = {}) {
|
|
8970
|
-
return new
|
|
9275
|
+
return new Ct(t);
|
|
8971
9276
|
}
|
|
8972
9277
|
dispatch(t) {
|
|
8973
9278
|
this._tiptapEditor.dispatch(t);
|
|
@@ -9099,7 +9404,7 @@ class Et {
|
|
|
9099
9404
|
* @param placement Whether the text cursor should be placed at the start or end of the block.
|
|
9100
9405
|
*/
|
|
9101
9406
|
setTextCursorPosition(t, o = "start") {
|
|
9102
|
-
const i = typeof t == "string" ? t : t.id, { posBeforeNode: n } =
|
|
9407
|
+
const i = typeof t == "string" ? t : t.id, { posBeforeNode: n } = Le(i, this._tiptapEditor.state.doc), { startPos: r, contentNode: a } = k(
|
|
9103
9408
|
this._tiptapEditor.state.doc,
|
|
9104
9409
|
n + 2
|
|
9105
9410
|
), s = this.schema.blockSchema[a.type.name].content;
|
|
@@ -9145,7 +9450,7 @@ class Et {
|
|
|
9145
9450
|
throw new Error("no editor, but also not headless?");
|
|
9146
9451
|
return !1;
|
|
9147
9452
|
}
|
|
9148
|
-
return this._tiptapEditor.isEditable;
|
|
9453
|
+
return this._tiptapEditor.isEditable === void 0 ? !0 : this._tiptapEditor.isEditable;
|
|
9149
9454
|
}
|
|
9150
9455
|
/**
|
|
9151
9456
|
* Makes the editor editable or locks it, depending on the argument passed.
|
|
@@ -9356,7 +9661,7 @@ class Et {
|
|
|
9356
9661
|
* @returns The blocks, serialized as an HTML string.
|
|
9357
9662
|
*/
|
|
9358
9663
|
async blocksToFullHTML(t) {
|
|
9359
|
-
return
|
|
9664
|
+
return Me(this.pmSchema, this).serializeBlocks(t, {});
|
|
9360
9665
|
}
|
|
9361
9666
|
/**
|
|
9362
9667
|
* Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
|
|
@@ -9366,7 +9671,7 @@ class Et {
|
|
|
9366
9671
|
* @returns The blocks parsed from the HTML string.
|
|
9367
9672
|
*/
|
|
9368
9673
|
async tryParseHTMLToBlocks(t) {
|
|
9369
|
-
return
|
|
9674
|
+
return wt(
|
|
9370
9675
|
t,
|
|
9371
9676
|
this.schema.blockSchema,
|
|
9372
9677
|
this.schema.inlineContentSchema,
|
|
@@ -9450,22 +9755,22 @@ class Et {
|
|
|
9450
9755
|
);
|
|
9451
9756
|
}
|
|
9452
9757
|
}
|
|
9453
|
-
let ne;
|
|
9454
|
-
async function
|
|
9758
|
+
let ne, ke;
|
|
9759
|
+
async function Qr(e, t) {
|
|
9455
9760
|
if (!Wi("text", e))
|
|
9456
9761
|
return [];
|
|
9457
9762
|
if (!ne) {
|
|
9458
|
-
ne = import("@emoji-mart/data");
|
|
9763
|
+
ne = import("@emoji-mart/data"), ke = await import("emoji-mart");
|
|
9459
9764
|
const n = (await ne).default;
|
|
9460
|
-
await
|
|
9765
|
+
await ke.init({ data: n });
|
|
9461
9766
|
}
|
|
9462
9767
|
const o = (await ne).default;
|
|
9463
|
-
return (t.trim() === "" ? Object.values(o.emojis) : await
|
|
9768
|
+
return (t.trim() === "" ? Object.values(o.emojis) : await ke.SearchIndex.search(t)).map((n) => ({
|
|
9464
9769
|
id: n.skins[0].native,
|
|
9465
9770
|
onItemClick: () => e.insertInlineContent(n.skins[0].native + " ")
|
|
9466
9771
|
}));
|
|
9467
9772
|
}
|
|
9468
|
-
function
|
|
9773
|
+
function _e(e = "") {
|
|
9469
9774
|
return typeof e == "string" ? [
|
|
9470
9775
|
{
|
|
9471
9776
|
type: "text",
|
|
@@ -9474,22 +9779,22 @@ function ke(e = "") {
|
|
|
9474
9779
|
}
|
|
9475
9780
|
] : e;
|
|
9476
9781
|
}
|
|
9477
|
-
function
|
|
9478
|
-
return typeof e == "string" ?
|
|
9782
|
+
function St(e) {
|
|
9783
|
+
return typeof e == "string" ? _e(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? _e(t) : ot(t) ? {
|
|
9479
9784
|
...t,
|
|
9480
|
-
content:
|
|
9785
|
+
content: _e(t.content)
|
|
9481
9786
|
} : te(t) ? t : {
|
|
9482
9787
|
props: {},
|
|
9483
9788
|
...t,
|
|
9484
|
-
content:
|
|
9789
|
+
content: St(t.content)
|
|
9485
9790
|
}) : e;
|
|
9486
9791
|
}
|
|
9487
|
-
function
|
|
9792
|
+
function ea(e, t) {
|
|
9488
9793
|
return t.map(
|
|
9489
|
-
(o) =>
|
|
9794
|
+
(o) => Mt(e, o)
|
|
9490
9795
|
);
|
|
9491
9796
|
}
|
|
9492
|
-
function
|
|
9797
|
+
function Mt(e, t) {
|
|
9493
9798
|
const o = {
|
|
9494
9799
|
id: "",
|
|
9495
9800
|
type: t.type,
|
|
@@ -9504,8 +9809,8 @@ function St(e, t) {
|
|
|
9504
9809
|
}
|
|
9505
9810
|
), {
|
|
9506
9811
|
...o,
|
|
9507
|
-
content:
|
|
9508
|
-
children: o.children.map((i) =>
|
|
9812
|
+
content: St(o.content),
|
|
9813
|
+
children: o.children.map((i) => Mt(e, i))
|
|
9509
9814
|
};
|
|
9510
9815
|
}
|
|
9511
9816
|
function or(e) {
|
|
@@ -9517,14 +9822,14 @@ function ir(e) {
|
|
|
9517
9822
|
}
|
|
9518
9823
|
export {
|
|
9519
9824
|
Qo as AudioBlock,
|
|
9520
|
-
|
|
9521
|
-
|
|
9825
|
+
Ct as BlockNoteEditor,
|
|
9826
|
+
Ne as BlockNoteSchema,
|
|
9522
9827
|
ri as FileBlock,
|
|
9523
9828
|
pn as FilePanelProsemirrorPlugin,
|
|
9524
9829
|
un as FilePanelView,
|
|
9525
9830
|
fn as FormattingToolbarProsemirrorPlugin,
|
|
9526
9831
|
hn as FormattingToolbarView,
|
|
9527
|
-
|
|
9832
|
+
wt as HTMLToBlocks,
|
|
9528
9833
|
ui as ImageBlock,
|
|
9529
9834
|
kn as LinkToolbarProsemirrorPlugin,
|
|
9530
9835
|
En as SideMenuProsemirrorPlugin,
|
|
@@ -9537,10 +9842,10 @@ export {
|
|
|
9537
9842
|
bi as VideoBlock,
|
|
9538
9843
|
or as addIdsToBlock,
|
|
9539
9844
|
ir as addIdsToBlocks,
|
|
9540
|
-
|
|
9541
|
-
|
|
9845
|
+
zo as addInlineContentAttributes,
|
|
9846
|
+
Ro as addInlineContentKeyboardShortcuts,
|
|
9542
9847
|
Wo as addStyleAttributes,
|
|
9543
|
-
|
|
9848
|
+
Vr as assertEmpty,
|
|
9544
9849
|
Xo as audioBlockConfig,
|
|
9545
9850
|
Jo as audioParse,
|
|
9546
9851
|
qo as audioPropSchema,
|
|
@@ -9549,92 +9854,92 @@ export {
|
|
|
9549
9854
|
P as blockToNode,
|
|
9550
9855
|
on as blocksToMarkdown,
|
|
9551
9856
|
ae as camelToDataKebab,
|
|
9552
|
-
|
|
9857
|
+
Xr as checkBlockHasDefaultProp,
|
|
9553
9858
|
$i as checkBlockIsDefaultType,
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9859
|
+
Wr as checkBlockIsFileBlock,
|
|
9860
|
+
qr as checkBlockIsFileBlockWithPlaceholder,
|
|
9861
|
+
$r as checkBlockIsFileBlockWithPreview,
|
|
9557
9862
|
qi as checkBlockTypeHasDefaultProp,
|
|
9558
9863
|
E as checkDefaultBlockTypeInSchema,
|
|
9559
9864
|
Wi as checkDefaultInlineContentTypeInSchema,
|
|
9560
|
-
|
|
9561
|
-
|
|
9865
|
+
Ie as cleanHTMLToMarkdown,
|
|
9866
|
+
Se as contentNodeToInlineContent,
|
|
9562
9867
|
ce as createAddFileButton,
|
|
9563
9868
|
le as createBlockSpec,
|
|
9564
9869
|
q as createBlockSpecFromStronglyTypedTiptapNode,
|
|
9565
9870
|
de as createDefaultFilePreview,
|
|
9566
9871
|
se as createExternalHTMLExporter,
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9872
|
+
Te as createFigureWithCaption,
|
|
9873
|
+
z as createFileAndCaptionWrapper,
|
|
9874
|
+
Or as createInlineContentSpec,
|
|
9570
9875
|
Fo as createInlineContentSpecFromTipTapNode,
|
|
9571
|
-
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9876
|
+
ct as createInternalBlockSpec,
|
|
9877
|
+
Me as createInternalHTMLSerializer,
|
|
9878
|
+
Oo as createInternalInlineContentSpec,
|
|
9879
|
+
ht as createInternalStyleSpec,
|
|
9575
9880
|
pe as createLinkWithCaption,
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9881
|
+
ft as createResizeHandlesWrapper,
|
|
9882
|
+
R as createStronglyTypedTiptapNode,
|
|
9883
|
+
Fr as createStyleSpec,
|
|
9579
9884
|
U as createStyleSpecFromTipTapMark,
|
|
9580
|
-
|
|
9885
|
+
Zr as createSuggestionMenu,
|
|
9581
9886
|
Gi as defaultBlockSchema,
|
|
9582
|
-
|
|
9887
|
+
gt as defaultBlockSpecs,
|
|
9583
9888
|
Ki as defaultInlineContentSchema,
|
|
9584
|
-
|
|
9889
|
+
kt as defaultInlineContentSpecs,
|
|
9585
9890
|
_ as defaultProps,
|
|
9586
|
-
|
|
9587
|
-
|
|
9891
|
+
Kr as defaultStyleSchema,
|
|
9892
|
+
bt as defaultStyleSpecs,
|
|
9588
9893
|
ti as fileBlockConfig,
|
|
9589
9894
|
ii as fileParse,
|
|
9590
9895
|
ei as filePropSchema,
|
|
9591
9896
|
oi as fileRender,
|
|
9592
9897
|
ni as fileToExternalHTML,
|
|
9593
|
-
|
|
9594
|
-
|
|
9898
|
+
Rr as filenameFromURL,
|
|
9899
|
+
Yr as filterSuggestionItems,
|
|
9595
9900
|
H as formatKeyboardShortcut,
|
|
9596
9901
|
mn as formattingToolbarPluginKey,
|
|
9597
9902
|
jo as getBlockFromPos,
|
|
9598
9903
|
Zn as getBlockNoteExtensions,
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
|
|
9904
|
+
ut as getBlockSchemaFromSpecs,
|
|
9905
|
+
Qr as getDefaultEmojiPickerItems,
|
|
9906
|
+
Jr as getDefaultSlashMenuItems,
|
|
9602
9907
|
he as getDraggableBlockFromElement,
|
|
9603
9908
|
Go as getInlineContentParseRules,
|
|
9604
|
-
|
|
9909
|
+
pt as getInlineContentSchemaFromSpecs,
|
|
9605
9910
|
Vo as getParseRules,
|
|
9606
9911
|
$o as getStyleParseRules,
|
|
9607
|
-
|
|
9912
|
+
mt as getStyleSchemaFromSpecs,
|
|
9608
9913
|
si as imageBlockConfig,
|
|
9609
9914
|
di as imageParse,
|
|
9610
9915
|
ai as imagePropSchema,
|
|
9611
9916
|
li as imageRender,
|
|
9612
9917
|
ci as imageToExternalHTML,
|
|
9613
|
-
|
|
9918
|
+
lt as inheritedProps,
|
|
9614
9919
|
W as inlineContentToNodes,
|
|
9615
9920
|
x as insertOrUpdateBlock,
|
|
9616
9921
|
Do as isAppleOS,
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9922
|
+
Ve as isLinkInlineContent,
|
|
9923
|
+
ot as isPartialLinkInlineContent,
|
|
9924
|
+
zr as isSafari,
|
|
9620
9925
|
te as isStyledTextInlineContent,
|
|
9621
9926
|
bn as linkToolbarPluginKey,
|
|
9622
|
-
|
|
9927
|
+
jr as locales,
|
|
9623
9928
|
cn as markdownToBlocks,
|
|
9624
9929
|
j as mergeCSSClasses,
|
|
9625
9930
|
v as nodeToBlock,
|
|
9626
|
-
|
|
9931
|
+
rt as nodeToCustomInlineContent,
|
|
9627
9932
|
Oe as parseEmbedElement,
|
|
9628
9933
|
ue as parseFigureElement,
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9934
|
+
Ge as parseImageElement,
|
|
9935
|
+
Mt as partialBlockToBlockForTesting,
|
|
9936
|
+
ea as partialBlocksToBlocksForTesting,
|
|
9937
|
+
dt as propsToAttributes,
|
|
9633
9938
|
xn as sideMenuPluginKey,
|
|
9634
9939
|
Ko as stylePropsToAttributes,
|
|
9635
|
-
|
|
9940
|
+
it as tableContentToNodes,
|
|
9636
9941
|
Q as tableHandlesPluginKey,
|
|
9637
|
-
|
|
9942
|
+
Gr as uploadToTmpFilesDotOrg_DEV_ONLY,
|
|
9638
9943
|
hi as videoBlockConfig,
|
|
9639
9944
|
fi as videoParse,
|
|
9640
9945
|
pi as videoPropSchema,
|